main_2020_show.js 2.6 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693556945569555696556975569855699557005570155702557035570455705557065570755708557095571055711557125571355714557155571655717557185571955720557215572255723557245572555726557275572855729557305573155732557335573455735557365573755738557395574055741557425574355744557455574655747557485574955750557515575255753557545575555756557575575855759557605576155762557635576455765557665576755768557695577055771557725577355774557755577655777557785577955780557815578255783557845578555786557875578855789557905579155792557935579455795557965579755798557995580055801558025580355804558055580655807558085580955810558115581255813558145581555816558175581855819558205582155822558235582455825558265582755828558295583055831558325583355834558355583655837558385583955840558415584255843558445584555846558475584855849558505585155852558535585455855558565585755858558595586055861558625586355864558655586655867558685586955870558715587255873558745587555876558775587855879558805588155882558835588455885558865588755888558895589055891558925589355894558955589655897558985589955900559015590255903559045590555906559075590855909559105591155912559135591455915559165591755918559195592055921559225592355924559255592655927559285592955930559315593255933559345593555936559375593855939559405594155942559435594455945559465594755948559495595055951559525595355954559555595655957559585595955960559615596255963559645596555966559675596855969559705597155972559735597455975559765597755978559795598055981559825598355984559855598655987559885598955990559915599255993559945599555996559975599855999560005600156002560035600456005560065600756008560095601056011560125601356014560155601656017560185601956020560215602256023560245602556026560275602856029560305603156032560335603456035560365603756038560395604056041560425604356044560455604656047560485604956050560515605256053560545605556056560575605856059560605606156062560635606456065560665606756068560695607056071560725607356074560755607656077560785607956080560815608256083560845608556086560875608856089560905609156092560935609456095560965609756098560995610056101561025610356104561055610656107561085610956110561115611256113561145611556116561175611856119561205612156122561235612456125561265612756128561295613056131561325613356134561355613656137561385613956140561415614256143561445614556146561475614856149561505615156152561535615456155561565615756158561595616056161561625616356164561655616656167561685616956170561715617256173561745617556176561775617856179561805618156182561835618456185561865618756188561895619056191561925619356194561955619656197561985619956200562015620256203562045620556206562075620856209562105621156212562135621456215562165621756218562195622056221562225622356224562255622656227562285622956230562315623256233562345623556236562375623856239562405624156242562435624456245562465624756248562495625056251562525625356254562555625656257562585625956260562615626256263562645626556266562675626856269562705627156272562735627456275562765627756278562795628056281562825628356284562855628656287562885628956290562915629256293562945629556296562975629856299563005630156302563035630456305563065630756308563095631056311563125631356314563155631656317563185631956320563215632256323563245632556326563275632856329563305633156332563335633456335563365633756338563395634056341563425634356344563455634656347563485634956350563515635256353563545635556356563575635856359563605636156362563635636456365563665636756368563695637056371563725637356374563755637656377563785637956380563815638256383563845638556386563875638856389563905639156392563935639456395563965639756398563995640056401564025640356404564055640656407564085640956410564115641256413564145641556416564175641856419564205642156422564235642456425564265642756428564295643056431564325643356434564355643656437564385643956440564415644256443564445644556446564475644856449564505645156452564535645456455564565645756458564595646056461564625646356464564655646656467564685646956470564715647256473564745647556476564775647856479564805648156482564835648456485564865648756488564895649056491564925649356494564955649656497564985649956500565015650256503565045650556506565075650856509565105651156512565135651456515565165651756518565195652056521565225652356524565255652656527565285652956530565315653256533565345653556536565375653856539565405654156542565435654456545565465654756548565495655056551565525655356554565555655656557565585655956560565615656256563565645656556566565675656856569565705657156572565735657456575565765657756578565795658056581565825658356584565855658656587565885658956590565915659256593565945659556596565975659856599566005660156602566035660456605566065660756608566095661056611566125661356614566155661656617566185661956620566215662256623566245662556626566275662856629566305663156632566335663456635566365663756638566395664056641566425664356644566455664656647566485664956650566515665256653566545665556656566575665856659566605666156662566635666456665566665666756668566695667056671566725667356674566755667656677566785667956680566815668256683566845668556686566875668856689566905669156692566935669456695566965669756698566995670056701567025670356704567055670656707567085670956710567115671256713567145671556716567175671856719567205672156722567235672456725567265672756728567295673056731567325673356734567355673656737567385673956740567415674256743567445674556746567475674856749567505675156752567535675456755567565675756758567595676056761567625676356764567655676656767567685676956770567715677256773567745677556776567775677856779567805678156782567835678456785567865678756788567895679056791567925679356794567955679656797567985679956800568015680256803568045680556806568075680856809568105681156812568135681456815568165681756818568195682056821568225682356824568255682656827568285682956830568315683256833568345683556836568375683856839568405684156842568435684456845568465684756848568495685056851568525685356854568555685656857568585685956860568615686256863568645686556866568675686856869568705687156872568735687456875568765687756878568795688056881568825688356884568855688656887568885688956890568915689256893568945689556896568975689856899569005690156902569035690456905569065690756908569095691056911569125691356914569155691656917569185691956920569215692256923569245692556926569275692856929569305693156932569335693456935569365693756938569395694056941569425694356944569455694656947569485694956950569515695256953569545695556956569575695856959569605696156962569635696456965569665696756968569695697056971569725697356974569755697656977569785697956980569815698256983569845698556986569875698856989569905699156992569935699456995569965699756998569995700057001570025700357004570055700657007570085700957010570115701257013570145701557016570175701857019570205702157022570235702457025570265702757028570295703057031570325703357034570355703657037570385703957040570415704257043570445704557046570475704857049570505705157052570535705457055570565705757058570595706057061570625706357064570655706657067570685706957070570715707257073570745707557076570775707857079570805708157082570835708457085570865708757088570895709057091570925709357094570955709657097570985709957100571015710257103571045710557106571075710857109571105711157112571135711457115571165711757118571195712057121571225712357124571255712657127571285712957130571315713257133571345713557136571375713857139571405714157142571435714457145571465714757148571495715057151571525715357154571555715657157571585715957160571615716257163571645716557166571675716857169571705717157172571735717457175571765717757178571795718057181571825718357184571855718657187571885718957190571915719257193571945719557196571975719857199572005720157202572035720457205572065720757208572095721057211572125721357214572155721657217572185721957220572215722257223572245722557226572275722857229572305723157232572335723457235572365723757238572395724057241572425724357244572455724657247572485724957250572515725257253572545725557256572575725857259572605726157262572635726457265572665726757268572695727057271572725727357274572755727657277572785727957280572815728257283572845728557286572875728857289572905729157292572935729457295572965729757298572995730057301573025730357304573055730657307573085730957310573115731257313573145731557316573175731857319573205732157322573235732457325573265732757328573295733057331573325733357334573355733657337573385733957340573415734257343573445734557346573475734857349573505735157352573535735457355573565735757358573595736057361573625736357364573655736657367573685736957370573715737257373573745737557376573775737857379573805738157382573835738457385573865738757388573895739057391573925739357394573955739657397573985739957400574015740257403574045740557406574075740857409574105741157412574135741457415574165741757418574195742057421574225742357424574255742657427574285742957430574315743257433574345743557436574375743857439574405744157442574435744457445574465744757448574495745057451574525745357454574555745657457574585745957460574615746257463574645746557466574675746857469574705747157472574735747457475574765747757478574795748057481574825748357484574855748657487574885748957490574915749257493574945749557496574975749857499575005750157502575035750457505575065750757508575095751057511575125751357514575155751657517575185751957520575215752257523575245752557526575275752857529575305753157532575335753457535575365753757538575395754057541575425754357544575455754657547575485754957550575515755257553575545755557556575575755857559575605756157562575635756457565575665756757568575695757057571575725757357574575755757657577575785757957580575815758257583575845758557586575875758857589575905759157592575935759457595575965759757598575995760057601576025760357604576055760657607576085760957610576115761257613576145761557616576175761857619576205762157622576235762457625576265762757628576295763057631576325763357634576355763657637576385763957640576415764257643576445764557646576475764857649576505765157652576535765457655576565765757658576595766057661576625766357664576655766657667576685766957670576715767257673576745767557676576775767857679576805768157682576835768457685576865768757688576895769057691576925769357694576955769657697576985769957700577015770257703577045770557706577075770857709577105771157712577135771457715577165771757718577195772057721577225772357724577255772657727577285772957730577315773257733577345773557736577375773857739577405774157742577435774457745577465774757748577495775057751577525775357754577555775657757577585775957760577615776257763577645776557766577675776857769577705777157772577735777457775577765777757778577795778057781577825778357784577855778657787577885778957790577915779257793577945779557796577975779857799578005780157802578035780457805578065780757808578095781057811578125781357814578155781657817578185781957820578215782257823578245782557826578275782857829578305783157832578335783457835578365783757838578395784057841578425784357844578455784657847578485784957850578515785257853578545785557856578575785857859578605786157862578635786457865578665786757868578695787057871578725787357874578755787657877578785787957880578815788257883578845788557886578875788857889578905789157892578935789457895578965789757898578995790057901579025790357904579055790657907579085790957910579115791257913579145791557916579175791857919579205792157922579235792457925579265792757928579295793057931579325793357934579355793657937579385793957940579415794257943579445794557946579475794857949579505795157952579535795457955579565795757958579595796057961579625796357964579655796657967579685796957970579715797257973579745797557976579775797857979579805798157982579835798457985579865798757988579895799057991579925799357994579955799657997579985799958000580015800258003580045800558006580075800858009580105801158012580135801458015580165801758018580195802058021580225802358024580255802658027580285802958030580315803258033580345803558036580375803858039580405804158042580435804458045580465804758048580495805058051580525805358054580555805658057580585805958060580615806258063580645806558066580675806858069580705807158072580735807458075580765807758078580795808058081580825808358084580855808658087580885808958090580915809258093580945809558096580975809858099581005810158102581035810458105581065810758108581095811058111581125811358114581155811658117581185811958120581215812258123581245812558126581275812858129581305813158132581335813458135581365813758138581395814058141581425814358144581455814658147581485814958150581515815258153581545815558156581575815858159581605816158162581635816458165581665816758168581695817058171581725817358174581755817658177581785817958180581815818258183581845818558186581875818858189581905819158192581935819458195581965819758198581995820058201582025820358204582055820658207582085820958210582115821258213582145821558216582175821858219582205822158222582235822458225582265822758228582295823058231582325823358234582355823658237582385823958240582415824258243582445824558246582475824858249582505825158252582535825458255582565825758258582595826058261582625826358264582655826658267582685826958270582715827258273582745827558276582775827858279582805828158282582835828458285582865828758288582895829058291582925829358294582955829658297582985829958300583015830258303583045830558306583075830858309583105831158312583135831458315583165831758318583195832058321583225832358324583255832658327583285832958330583315833258333583345833558336583375833858339583405834158342583435834458345583465834758348583495835058351583525835358354583555835658357583585835958360583615836258363583645836558366583675836858369583705837158372583735837458375583765837758378583795838058381583825838358384583855838658387583885838958390583915839258393583945839558396583975839858399584005840158402584035840458405584065840758408584095841058411584125841358414584155841658417584185841958420584215842258423584245842558426584275842858429584305843158432584335843458435584365843758438584395844058441584425844358444584455844658447584485844958450584515845258453584545845558456584575845858459584605846158462584635846458465584665846758468584695847058471584725847358474584755847658477584785847958480584815848258483584845848558486584875848858489584905849158492584935849458495584965849758498584995850058501585025850358504585055850658507585085850958510585115851258513585145851558516585175851858519585205852158522585235852458525585265852758528585295853058531585325853358534585355853658537585385853958540585415854258543585445854558546585475854858549585505855158552585535855458555585565855758558585595856058561585625856358564585655856658567585685856958570585715857258573585745857558576585775857858579585805858158582585835858458585585865858758588585895859058591585925859358594585955859658597585985859958600586015860258603586045860558606586075860858609586105861158612586135861458615586165861758618586195862058621586225862358624586255862658627586285862958630586315863258633586345863558636586375863858639586405864158642586435864458645586465864758648586495865058651586525865358654586555865658657586585865958660586615866258663586645866558666586675866858669586705867158672586735867458675586765867758678586795868058681586825868358684586855868658687586885868958690586915869258693586945869558696586975869858699587005870158702587035870458705587065870758708587095871058711587125871358714587155871658717587185871958720587215872258723587245872558726587275872858729587305873158732587335873458735587365873758738587395874058741587425874358744587455874658747587485874958750587515875258753587545875558756587575875858759587605876158762587635876458765587665876758768587695877058771587725877358774587755877658777587785877958780587815878258783587845878558786587875878858789587905879158792587935879458795587965879758798587995880058801588025880358804588055880658807588085880958810588115881258813588145881558816588175881858819588205882158822588235882458825588265882758828588295883058831588325883358834588355883658837588385883958840588415884258843588445884558846588475884858849588505885158852588535885458855588565885758858588595886058861588625886358864588655886658867588685886958870588715887258873588745887558876588775887858879588805888158882588835888458885588865888758888588895889058891588925889358894588955889658897588985889958900589015890258903589045890558906589075890858909589105891158912589135891458915589165891758918589195892058921589225892358924589255892658927589285892958930589315893258933589345893558936589375893858939589405894158942589435894458945589465894758948589495895058951589525895358954589555895658957589585895958960589615896258963589645896558966589675896858969589705897158972589735897458975589765897758978589795898058981589825898358984589855898658987589885898958990589915899258993589945899558996589975899858999590005900159002590035900459005590065900759008590095901059011590125901359014590155901659017590185901959020590215902259023590245902559026590275902859029590305903159032590335903459035590365903759038590395904059041590425904359044590455904659047590485904959050590515905259053590545905559056590575905859059590605906159062590635906459065590665906759068590695907059071590725907359074590755907659077590785907959080590815908259083590845908559086590875908859089590905909159092590935909459095590965909759098590995910059101591025910359104591055910659107591085910959110591115911259113591145911559116591175911859119591205912159122591235912459125591265912759128591295913059131591325913359134591355913659137591385913959140591415914259143591445914559146591475914859149591505915159152591535915459155591565915759158591595916059161591625916359164591655916659167591685916959170591715917259173591745917559176591775917859179591805918159182591835918459185591865918759188591895919059191591925919359194591955919659197591985919959200592015920259203592045920559206592075920859209592105921159212592135921459215592165921759218592195922059221592225922359224592255922659227592285922959230592315923259233592345923559236592375923859239592405924159242592435924459245592465924759248592495925059251592525925359254592555925659257592585925959260592615926259263592645926559266592675926859269592705927159272592735927459275592765927759278592795928059281592825928359284592855928659287592885928959290592915929259293592945929559296592975929859299593005930159302593035930459305593065930759308593095931059311593125931359314593155931659317593185931959320593215932259323593245932559326593275932859329593305933159332593335933459335593365933759338593395934059341593425934359344593455934659347593485934959350593515935259353593545935559356593575935859359593605936159362593635936459365593665936759368593695937059371593725937359374593755937659377593785937959380593815938259383593845938559386593875938859389593905939159392593935939459395593965939759398593995940059401594025940359404594055940659407594085940959410594115941259413594145941559416594175941859419594205942159422594235942459425594265942759428594295943059431594325943359434594355943659437594385943959440594415944259443594445944559446594475944859449594505945159452594535945459455594565945759458594595946059461594625946359464594655946659467594685946959470594715947259473594745947559476594775947859479594805948159482594835948459485594865948759488594895949059491594925949359494594955949659497594985949959500595015950259503595045950559506595075950859509595105951159512595135951459515595165951759518595195952059521595225952359524595255952659527595285952959530595315953259533595345953559536595375953859539595405954159542595435954459545595465954759548595495955059551595525955359554595555955659557595585955959560595615956259563595645956559566595675956859569595705957159572595735957459575595765957759578595795958059581595825958359584595855958659587595885958959590595915959259593595945959559596595975959859599596005960159602596035960459605596065960759608596095961059611596125961359614596155961659617596185961959620596215962259623596245962559626596275962859629596305963159632596335963459635596365963759638596395964059641596425964359644596455964659647596485964959650596515965259653596545965559656596575965859659596605966159662596635966459665596665966759668596695967059671596725967359674596755967659677596785967959680596815968259683596845968559686596875968859689596905969159692596935969459695596965969759698596995970059701597025970359704597055970659707597085970959710597115971259713597145971559716597175971859719597205972159722597235972459725597265972759728597295973059731597325973359734597355973659737597385973959740597415974259743597445974559746597475974859749597505975159752597535975459755597565975759758597595976059761597625976359764597655976659767597685976959770597715977259773597745977559776597775977859779597805978159782597835978459785597865978759788597895979059791597925979359794597955979659797597985979959800598015980259803598045980559806598075980859809598105981159812598135981459815598165981759818598195982059821598225982359824598255982659827598285982959830598315983259833598345983559836598375983859839598405984159842598435984459845598465984759848598495985059851598525985359854598555985659857598585985959860598615986259863598645986559866598675986859869598705987159872598735987459875598765987759878598795988059881598825988359884598855988659887598885988959890598915989259893598945989559896598975989859899599005990159902599035990459905599065990759908599095991059911599125991359914599155991659917599185991959920599215992259923599245992559926599275992859929599305993159932599335993459935599365993759938599395994059941599425994359944599455994659947599485994959950599515995259953599545995559956599575995859959599605996159962599635996459965599665996759968599695997059971599725997359974599755997659977599785997959980599815998259983599845998559986599875998859989599905999159992599935999459995599965999759998599996000060001600026000360004600056000660007600086000960010600116001260013600146001560016600176001860019600206002160022600236002460025600266002760028600296003060031600326003360034600356003660037600386003960040600416004260043600446004560046600476004860049600506005160052600536005460055600566005760058600596006060061600626006360064600656006660067600686006960070600716007260073600746007560076600776007860079600806008160082600836008460085600866008760088600896009060091600926009360094600956009660097600986009960100601016010260103601046010560106601076010860109601106011160112601136011460115601166011760118601196012060121601226012360124601256012660127601286012960130601316013260133601346013560136601376013860139601406014160142601436014460145601466014760148601496015060151601526015360154601556015660157601586015960160601616016260163601646016560166601676016860169601706017160172601736017460175601766017760178601796018060181601826018360184601856018660187601886018960190601916019260193601946019560196601976019860199602006020160202602036020460205602066020760208602096021060211602126021360214602156021660217602186021960220602216022260223602246022560226602276022860229602306023160232602336023460235602366023760238602396024060241602426024360244602456024660247602486024960250602516025260253602546025560256602576025860259602606026160262602636026460265602666026760268602696027060271602726027360274602756027660277602786027960280602816028260283602846028560286602876028860289602906029160292602936029460295602966029760298602996030060301603026030360304603056030660307603086030960310603116031260313603146031560316603176031860319603206032160322603236032460325603266032760328603296033060331603326033360334603356033660337603386033960340603416034260343603446034560346603476034860349603506035160352603536035460355603566035760358603596036060361603626036360364603656036660367603686036960370603716037260373603746037560376603776037860379603806038160382603836038460385603866038760388603896039060391603926039360394603956039660397603986039960400604016040260403604046040560406604076040860409604106041160412604136041460415604166041760418604196042060421604226042360424604256042660427604286042960430604316043260433604346043560436604376043860439604406044160442604436044460445604466044760448604496045060451604526045360454604556045660457604586045960460604616046260463604646046560466604676046860469604706047160472604736047460475604766047760478604796048060481604826048360484604856048660487604886048960490604916049260493604946049560496604976049860499605006050160502605036050460505605066050760508605096051060511605126051360514605156051660517605186051960520605216052260523605246052560526605276052860529605306053160532605336053460535605366053760538605396054060541605426054360544605456054660547605486054960550605516055260553605546055560556605576055860559605606056160562605636056460565605666056760568605696057060571605726057360574605756057660577605786057960580605816058260583605846058560586605876058860589605906059160592605936059460595605966059760598605996060060601606026060360604606056060660607606086060960610606116061260613606146061560616606176061860619606206062160622606236062460625606266062760628606296063060631606326063360634606356063660637606386063960640606416064260643606446064560646606476064860649606506065160652606536065460655606566065760658606596066060661606626066360664606656066660667606686066960670606716067260673606746067560676606776067860679606806068160682606836068460685606866068760688606896069060691606926069360694606956069660697606986069960700607016070260703607046070560706607076070860709607106071160712607136071460715607166071760718607196072060721607226072360724607256072660727607286072960730607316073260733607346073560736607376073860739607406074160742607436074460745607466074760748607496075060751607526075360754607556075660757607586075960760607616076260763607646076560766607676076860769607706077160772607736077460775607766077760778607796078060781607826078360784607856078660787607886078960790607916079260793607946079560796607976079860799608006080160802608036080460805608066080760808608096081060811608126081360814608156081660817608186081960820608216082260823608246082560826608276082860829608306083160832608336083460835608366083760838608396084060841608426084360844608456084660847608486084960850608516085260853608546085560856608576085860859608606086160862608636086460865608666086760868608696087060871608726087360874608756087660877608786087960880608816088260883608846088560886608876088860889608906089160892608936089460895608966089760898608996090060901609026090360904609056090660907609086090960910609116091260913609146091560916609176091860919609206092160922609236092460925609266092760928609296093060931609326093360934609356093660937609386093960940609416094260943609446094560946609476094860949609506095160952609536095460955609566095760958609596096060961609626096360964609656096660967609686096960970609716097260973609746097560976609776097860979609806098160982609836098460985609866098760988609896099060991609926099360994609956099660997609986099961000610016100261003610046100561006610076100861009610106101161012610136101461015610166101761018
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. let highMapAddColor = 0//true
  5. !function() {
  6. "use strict";
  7. function t(t, i) {
  8. return typeof t === i
  9. }
  10. function i(t, i) {
  11. return t instanceof i
  12. }
  13. function n(t) {
  14. return t && t.nodeType
  15. }
  16. function e(t) {
  17. return n(t) ? t : i(t, g) ? t[0] : void 0
  18. }
  19. function o(t, i, n) {
  20. return g.each(t, function(t, e) {
  21. n = i.call(e, n, t, e)
  22. }),
  23. n
  24. }
  25. function r(t, i, n) {
  26. var e, o, r;
  27. if (t === i)
  28. return !0;
  29. if (!t || !i || t.constructor !== i.constructor)
  30. return !1;
  31. for (e = 0,
  32. o = n.length; o > e; e += 1) {
  33. if (r = n[e],
  34. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  35. return !1;
  36. if (t[r] !== i[r])
  37. return !1
  38. }
  39. return !0
  40. }
  41. function s(t, i, n, e) {
  42. this.left = E(t),
  43. this.top = E(i),
  44. this.width = E(n),
  45. this.height = E(e),
  46. this.right = this.left + this.width,
  47. this.bottom = this.top + this.height
  48. }
  49. function h(t, i, n, e) {
  50. this.visible = t || 0,
  51. this.viewport = i || 0,
  52. this.possible = n || 0,
  53. this.rects = e && T({}, e) || null
  54. }
  55. function l(t, i) {
  56. this.els = t,
  57. this.viewport = i
  58. }
  59. function c(t, i, n) {
  60. var e;
  61. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  62. e ? e[n] : 0
  63. }
  64. function u(t, i) {
  65. return t.val - i.val
  66. }
  67. function a(t, i) {
  68. return i.val - t.val
  69. }
  70. function f(t) {
  71. var i = s.ofContent(t, !0)
  72. , n = s.ofViewport(t, !0)
  73. , e = i.width - n.width
  74. , o = i.height - n.height;
  75. this.content = i,
  76. this.viewport = n,
  77. this.width = 0 >= e ? null : n.left / e,
  78. this.height = 0 >= o ? null : n.top / o,
  79. this.left = n.left,
  80. this.top = n.top,
  81. this.right = i.right - n.right,
  82. this.bottom = i.bottom - n.bottom
  83. }
  84. function p(t) {
  85. this.el = t || window
  86. }
  87. function d(t, i) {
  88. this.context = t,
  89. this.viewport = i,
  90. this.init()
  91. }
  92. function v(t, i, n, e) {
  93. this.context = new l(t,i),
  94. this.property = n,
  95. this.descending = e,
  96. this.init()
  97. }
  98. function w(t) {
  99. t && t !== window && t !== document ? (this.context = t,
  100. this.$autoTarget = g(t)) : this.context = window,
  101. this.init()
  102. }
  103. var g = jQuery
  104. , m = g(window)
  105. , b = g(document)
  106. , T = g.extend
  107. , y = g.isFunction
  108. , k = Math.max
  109. , V = Math.min
  110. , E = Math.round
  111. , x = function() {
  112. var t = {}
  113. , i = 1;
  114. return function(n) {
  115. return n ? (t[n] || (t[n] = i,
  116. i += 1),
  117. t[n]) : 0
  118. }
  119. }();
  120. T(s.prototype, {
  121. equals: function(t) {
  122. return r(this, t, ["left", "top", "width", "height"])
  123. },
  124. area: function() {
  125. return this.width * this.height
  126. },
  127. relativeTo: function(t) {
  128. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  129. },
  130. intersection: function(t) {
  131. if (!i(t, s))
  132. return null;
  133. var n = k(this.left, t.left)
  134. , e = V(this.right, t.right)
  135. , o = k(this.top, t.top)
  136. , r = V(this.bottom, t.bottom)
  137. , h = e - n
  138. , l = r - o;
  139. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  140. },
  141. envelope: function(t) {
  142. if (!i(t, s))
  143. return this;
  144. var n = V(this.left, t.left)
  145. , e = k(this.right, t.right)
  146. , o = V(this.top, t.top)
  147. , r = k(this.bottom, t.bottom)
  148. , h = e - n
  149. , l = r - o;
  150. return new s(n,o,h,l)
  151. }
  152. }),
  153. T(s, {
  154. ofContent: function(t, i) {
  155. 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())
  156. },
  157. ofViewport: function(t, i) {
  158. 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())
  159. },
  160. ofElement: function(t) {
  161. var i = g(t);
  162. if (!i.is(":visible"))
  163. return null;
  164. var n = i.offset();
  165. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  166. }
  167. }),
  168. T(h.prototype, {
  169. equals: function(t) {
  170. return this.fracsEqual(t) && this.rectsEqual(t)
  171. },
  172. fracsEqual: function(t) {
  173. return r(this, t, ["visible", "viewport", "possible"])
  174. },
  175. rectsEqual: function(t) {
  176. return r(this.rects, t.rects, ["document", "element", "viewport"])
  177. }
  178. }),
  179. T(h, {
  180. of: function(t, i) {
  181. var e, o, r;
  182. return t = n(t) && s.ofElement(t) || t,
  183. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  184. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  185. r = V(t.width, i.width) * V(t.height, i.height),
  186. new h(o / t.area(),o / i.area(),o / r,{
  187. document: e,
  188. element: e.relativeTo(t),
  189. viewport: e.relativeTo(i)
  190. })) : new h
  191. }
  192. });
  193. var q = ["width", "height", "left", "right", "top", "bottom"]
  194. , S = ["possible", "visible", "viewport"];
  195. T(l.prototype, {
  196. sorted: function(t, i) {
  197. var n = this.viewport;
  198. return g.map(this.els, function(i) {
  199. return {
  200. el: i,
  201. val: c(i, n, t)
  202. }
  203. }).sort(i ? a : u)
  204. },
  205. best: function(t, i) {
  206. return this.els.length ? this.sorted(t, i)[0] : null
  207. }
  208. }),
  209. T(f.prototype, {
  210. equals: function(t) {
  211. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  212. }
  213. }),
  214. T(p.prototype, {
  215. equals: function(t) {
  216. return r(this, t, ["el"])
  217. },
  218. scrollState: function() {
  219. return new f(this.el)
  220. },
  221. scrollTo: function(t, i, n) {
  222. var e = g(this.el === window ? "html,body" : this.el);
  223. t = t || 0,
  224. i = i || 0,
  225. n = isNaN(n) ? 1e3 : n,
  226. e.stop(!0).animate({
  227. scrollLeft: t,
  228. scrollTop: i
  229. }, n)
  230. },
  231. scroll: function(t, i, n) {
  232. var e = this.el === window ? m : g(this.el);
  233. t = t || 0,
  234. i = i || 0,
  235. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  236. },
  237. scrollToRect: function(t, i, n, e) {
  238. i = i || 0,
  239. n = n || 0,
  240. this.scrollTo(t.left - i, t.top - n, e)
  241. },
  242. scrollToElement: function(t, i, n, e) {
  243. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  244. this.scrollToRect(o, i, n, e)
  245. }
  246. });
  247. var C = {
  248. init: function() {
  249. this.callbacks = g.Callbacks("memory unique"),
  250. this.currVal = null,
  251. this.prevVal = null,
  252. this.checkProxy = g.proxy(this.check, this),
  253. this.autoCheck()
  254. },
  255. bind: function(t) {
  256. this.callbacks.add(t)
  257. },
  258. unbind: function(t) {
  259. t ? this.callbacks.remove(t) : this.callbacks.empty()
  260. },
  261. trigger: function() {
  262. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  263. },
  264. check: function(t) {
  265. var i = this.updatedValue(t);
  266. return void 0 !== i && (this.prevVal = this.currVal,
  267. this.currVal = i,
  268. this.trigger(),
  269. !0)
  270. },
  271. $autoTarget: m,
  272. autoEvents: "load resize scroll",
  273. autoCheck: function(t) {
  274. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  275. }
  276. };
  277. T(d.prototype, C, {
  278. updatedValue: function() {
  279. var t = h.of(this.context, this.viewport);
  280. return this.currVal && this.currVal.equals(t) ? void 0 : t
  281. }
  282. }),
  283. T(v.prototype, C, {
  284. updatedValue: function() {
  285. var t = this.context.best(this.property, this.descending);
  286. return t && (t = t.val > 0 ? t.el : null,
  287. this.currVal !== t) ? t : void 0
  288. }
  289. }),
  290. T(w.prototype, C, {
  291. updatedValue: function() {
  292. var t = new f(this.context);
  293. return this.currVal && this.currVal.equals(t) ? void 0 : t
  294. }
  295. });
  296. var L = function(t, i) {
  297. var n = [].slice
  298. , e = jQuery
  299. , o = e.extend
  300. , r = e.isFunction
  301. , s = o({}, i)
  302. , h = function(i, n, o, s) {
  303. return o = r(o) ? o.apply(i, n) : o,
  304. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  305. }
  306. , l = function() {
  307. return h(this, n.call(arguments), s.defaultStatic, l)
  308. }
  309. , c = function(t) {
  310. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  311. }
  312. , u = function(t) {
  313. t && (o(l, t.statics),
  314. o(c, t.methods)),
  315. l.modplug = u
  316. };
  317. u.prev = {
  318. statics: e[t],
  319. methods: e.fn[t]
  320. },
  321. u(i),
  322. e[t] = l,
  323. e.fn[t] = c
  324. }
  325. , M = "fracs";
  326. L(M, {
  327. statics: {
  328. version: "0.15.0",
  329. Rect: s,
  330. Fractions: h,
  331. Group: l,
  332. ScrollState: f,
  333. Viewport: p,
  334. FracsCallbacks: d,
  335. GroupCallbacks: v,
  336. ScrollStateCallbacks: w,
  337. fracs: function(t, i) {
  338. return h.of(t, i)
  339. }
  340. },
  341. methods: {
  342. content: function(t) {
  343. return this.length ? s.ofContent(this[0], t) : null
  344. },
  345. envelope: function() {
  346. return o(this, function(t) {
  347. var i = s.ofElement(this);
  348. return t ? t.envelope(i) : i
  349. })
  350. },
  351. fracs: function(i, n, o) {
  352. t(i, "string") || (o = n,
  353. n = i,
  354. i = null),
  355. y(n) || (o = n,
  356. n = null),
  357. o = e(o);
  358. var r = M + ".fracs." + x(o);
  359. return "unbind" === i ? this.each(function() {
  360. var t = g(this).data(r);
  361. t && t.unbind(n)
  362. }) : "check" === i ? this.each(function() {
  363. var t = g(this).data(r);
  364. t && t.check()
  365. }) : y(n) ? this.each(function() {
  366. var t = g(this)
  367. , i = t.data(r);
  368. i || (i = new d(this,o),
  369. t.data(r, i)),
  370. i.bind(n)
  371. }) : this.length ? h.of(this[0], o) : null
  372. },
  373. intersection: function() {
  374. return o(this, function(t) {
  375. var i = s.ofElement(this);
  376. return t ? t.intersection(i) : i
  377. })
  378. },
  379. max: function(t, i, n) {
  380. return y(i) || (n = i,
  381. i = null),
  382. n = e(n),
  383. i ? (new v(this,n,t,!0).bind(i),
  384. this) : this.pushStack(new l(this,n).best(t, !0).el)
  385. },
  386. min: function(t, i, n) {
  387. return y(i) || (n = i,
  388. i = null),
  389. n = e(n),
  390. i ? (new v(this,n,t).bind(i),
  391. this) : this.pushStack(new l(this,n).best(t).el)
  392. },
  393. rect: function() {
  394. return this.length ? s.ofElement(this[0]) : null
  395. },
  396. scrollState: function(i, n) {
  397. var e = M + ".scrollState";
  398. return t(i, "string") || (n = i,
  399. i = null),
  400. "unbind" === i ? this.each(function() {
  401. var t = g(this).data(e);
  402. t && t.unbind(n)
  403. }) : "check" === i ? this.each(function() {
  404. var t = g(this).data(e);
  405. t && t.check()
  406. }) : y(n) ? this.each(function() {
  407. var t = g(this)
  408. , i = t.data(e);
  409. i || (i = new w(this),
  410. t.data(e, i)),
  411. i.bind(n)
  412. }) : this.length ? new f(this[0]) : null
  413. },
  414. scroll: function(t, i, n) {
  415. return this.each(function() {
  416. new p(this).scroll(t, i, n)
  417. })
  418. },
  419. scrollTo: function(t, i, n, o) {
  420. return g.isNumeric(t) && (o = n,
  421. n = i,
  422. i = t,
  423. t = null),
  424. t = e(t),
  425. this.each(function() {
  426. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  427. })
  428. },
  429. scrollToThis: function(t, i, n, o) {
  430. return o = new p(e(o)),
  431. o.scrollToElement(this[0], t, i, n),
  432. this
  433. },
  434. softLink: function(t, i, n, o) {
  435. return o = new p(e(o)),
  436. this.filter("a[href^=#]").each(function() {
  437. var e = g(this);
  438. e.on("click", function() {
  439. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  440. })
  441. })
  442. },
  443. sort: function(i, n, o) {
  444. return t(n, "boolean") || (o = n,
  445. n = null),
  446. o = e(o),
  447. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  448. return t.el
  449. }))
  450. },
  451. viewport: function(t) {
  452. return this.length ? s.ofViewport(this[0], t) : null
  453. }
  454. },
  455. defaultStatic: "fracs",
  456. defaultMethod: "fracs"
  457. })
  458. }();
  459. if ("undefined" == typeof jQuery)
  460. throw new Error("Bootstrap's JavaScript requires jQuery");
  461. +function(t) {
  462. "use strict";
  463. function e(e) {
  464. return this.each(function() {
  465. var o = t(this)
  466. , s = o.data("bs.tooltip")
  467. , n = "object" == typeof e && e;
  468. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  469. "string" == typeof e && s[e]())
  470. })
  471. }
  472. var i = function(t, e) {
  473. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  474. this.init("tooltip", t, e)
  475. };
  476. i.VERSION = "3.2.0",
  477. i.DEFAULTS = {
  478. animation: !0,
  479. placement: "top",
  480. selector: !1,
  481. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  482. trigger: "hover focus",
  483. title: "",
  484. delay: 0,
  485. html: !1,
  486. container: !1,
  487. viewport: {
  488. selector: "body",
  489. padding: 0
  490. }
  491. },
  492. i.prototype.init = function(e, i, o) {
  493. this.enabled = !0,
  494. this.type = e,
  495. this.$element = t(i),
  496. this.options = this.getOptions(o),
  497. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  498. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  499. var r = s[n];
  500. if ("click" == r)
  501. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  502. else if ("manual" != r) {
  503. var a = "hover" == r ? "mouseenter" : "focusin"
  504. , l = "hover" == r ? "mouseleave" : "focusout";
  505. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  506. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  507. }
  508. }
  509. this.options.selector ? this._options = t.extend({}, this.options, {
  510. trigger: "manual",
  511. selector: ""
  512. }) : this.fixTitle()
  513. }
  514. ,
  515. i.prototype.getDefaults = function() {
  516. return i.DEFAULTS
  517. }
  518. ,
  519. i.prototype.getOptions = function(e) {
  520. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  521. e.delay && "number" == typeof e.delay && (e.delay = {
  522. show: e.delay,
  523. hide: e.delay
  524. }),
  525. e
  526. }
  527. ,
  528. i.prototype.getDelegateOptions = function() {
  529. var e = {}
  530. , i = this.getDefaults();
  531. return this._options && t.each(this._options, function(t, o) {
  532. i[t] != o && (e[t] = o)
  533. }),
  534. e
  535. }
  536. ,
  537. i.prototype.enter = function(e) {
  538. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  539. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  540. t(e.currentTarget).data("bs." + this.type, i)),
  541. clearTimeout(i.timeout),
  542. i.hoverState = "in",
  543. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  544. // "in" == i.hoverState && i.show()
  545. }, i.options.delay.show)) : i.show()
  546. }
  547. ,
  548. i.prototype.leave = function(e) {
  549. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  550. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  551. t(e.currentTarget).data("bs." + this.type, i)),
  552. clearTimeout(i.timeout),
  553. i.hoverState = "out",
  554. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  555. "out" == i.hoverState && i.hide()
  556. }, i.options.delay.hide)) : i.hide()
  557. }
  558. ,
  559. i.prototype.show = function() {
  560. var e = t.Event("show.bs." + this.type);
  561. if (this.hasContent() && this.enabled) {
  562. this.$element.trigger(e);
  563. var i = t.contains(document.documentElement, this.$element[0]);
  564. if (e.isDefaultPrevented() || !i)
  565. return;
  566. var o = this
  567. , s = this.tip()
  568. , n = this.getUID(this.type);
  569. this.setContent(),
  570. s.attr("id", n),
  571. this.$element.attr("aria-describedby", n),
  572. this.options.animation && s.addClass("fade");
  573. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  574. , a = /\s?auto?\s?/i
  575. , l = a.test(r);
  576. l && (r = r.replace(a, "") || "top"),
  577. s.detach().css({
  578. top: 0,
  579. left: 0,
  580. display: "block"
  581. }).addClass(r).data("bs." + this.type, this),
  582. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  583. var p = this.getPosition()
  584. , h = s[0].offsetWidth
  585. , f = s[0].offsetHeight;
  586. if (l) {
  587. var u = r
  588. , c = this.$element.parent()
  589. , d = this.getPosition(c);
  590. 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,
  591. s.removeClass(u).addClass(r)
  592. }
  593. var g = this.getCalculatedOffset(r, p, h, f);
  594. this.applyPlacement(g, r);
  595. var y = function() {
  596. o.$element.trigger("shown.bs." + o.type),
  597. o.hoverState = null
  598. };
  599. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  600. }
  601. }
  602. ,
  603. i.prototype.applyPlacement = function(e, i) {
  604. var o = this.tip()
  605. , s = o[0].offsetWidth
  606. , n = o[0].offsetHeight
  607. , r = parseInt(o.css("margin-top"), 10)
  608. , a = parseInt(o.css("margin-left"), 10);
  609. isNaN(r) && (r = 0),
  610. isNaN(a) && (a = 0),
  611. e.top = e.top + r,
  612. e.left = e.left + a,
  613. t.offset.setOffset(o[0], t.extend({
  614. using: function(t) {
  615. o.css({
  616. top: Math.round(t.top),
  617. left: Math.round(t.left)
  618. })
  619. }
  620. }, e), 0),
  621. o.addClass("in");
  622. var l = o[0].offsetWidth
  623. , p = o[0].offsetHeight;
  624. "top" == i && p != n && (e.top = e.top + n - p);
  625. var h = this.getViewportAdjustedDelta(i, e, l, p);
  626. h.left ? e.left += h.left : e.top += h.top;
  627. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  628. , u = h.left ? "left" : "top"
  629. , c = h.left ? "offsetWidth" : "offsetHeight";
  630. o.offset(e),
  631. this.replaceArrow(f, o[0][c], u)
  632. }
  633. ,
  634. i.prototype.replaceArrow = function(t, e, i) {
  635. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  636. }
  637. ,
  638. i.prototype.setContent = function() {
  639. var t = this.tip()
  640. , e = this.getTitle();
  641. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  642. t.removeClass("fade in top bottom left right")
  643. }
  644. ,
  645. i.prototype.hide = function() {
  646. function e() {
  647. "in" != i.hoverState && o.detach(),
  648. i.$element.trigger("hidden.bs." + i.type)
  649. }
  650. var i = this
  651. , o = this.tip()
  652. , s = t.Event("hide.bs." + this.type);
  653. if (this.$element.removeAttr("aria-describedby"),
  654. this.$element.trigger(s),
  655. !s.isDefaultPrevented())
  656. return o.removeClass("in"),
  657. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  658. this.hoverState = null,
  659. this
  660. }
  661. ,
  662. i.prototype.fixTitle = function() {
  663. var t = this.$element;
  664. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  665. }
  666. ,
  667. i.prototype.hasContent = function() {
  668. return this.getTitle()
  669. }
  670. ,
  671. i.prototype.getPosition = function(e) {
  672. e = e || this.$element;
  673. var i = e[0]
  674. , o = "BODY" == i.tagName;
  675. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  676. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  677. width: o ? t(window).width() : e.outerWidth(),
  678. height: o ? t(window).height() : e.outerHeight()
  679. }, o ? {
  680. top: 0,
  681. left: 0
  682. } : e.offset())
  683. }
  684. ,
  685. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  686. return "bottom" == t ? {
  687. top: e.top + e.height,
  688. left: e.left + e.width / 2 - i / 2
  689. } : "top" == t ? {
  690. top: e.top - o,
  691. left: e.left + e.width / 2 - i / 2
  692. } : "left" == t ? {
  693. top: e.top + e.height / 2 - o / 2,
  694. left: e.left - i
  695. } : {
  696. top: e.top + e.height / 2 - o / 2,
  697. left: e.left + e.width
  698. }
  699. }
  700. ,
  701. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  702. var s = {
  703. top: 0,
  704. left: 0
  705. };
  706. if (!this.$viewport)
  707. return s;
  708. var n = this.options.viewport && this.options.viewport.padding || 0
  709. , r = this.getPosition(this.$viewport);
  710. if (/right|left/.test(t)) {
  711. var a = e.top - n - r.scroll
  712. , l = e.top + n - r.scroll + o;
  713. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  714. } else {
  715. var p = e.left - n
  716. , h = e.left + n + i;
  717. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  718. }
  719. return s
  720. }
  721. ,
  722. i.prototype.getTitle = function() {
  723. var t, e = this.$element, i = this.options;
  724. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  725. }
  726. ,
  727. i.prototype.getUID = function(t) {
  728. do
  729. t += ~~(1e6 * Math.random());
  730. while (document.getElementById(t));return t
  731. }
  732. ,
  733. i.prototype.tip = function() {
  734. return this.$tip = this.$tip || t(this.options.template)
  735. }
  736. ,
  737. i.prototype.arrow = function() {
  738. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  739. }
  740. ,
  741. i.prototype.validate = function() {
  742. this.$element[0].parentNode || (this.hide(),
  743. this.$element = null,
  744. this.options = null)
  745. }
  746. ,
  747. i.prototype.enable = function() {
  748. this.enabled = !0
  749. }
  750. ,
  751. i.prototype.disable = function() {
  752. this.enabled = !1
  753. }
  754. ,
  755. i.prototype.toggleEnabled = function() {
  756. this.enabled = !this.enabled
  757. }
  758. ,
  759. i.prototype.toggle = function(e) {
  760. var i = this;
  761. e && (i = t(e.currentTarget).data("bs." + this.type),
  762. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  763. t(e.currentTarget).data("bs." + this.type, i))),
  764. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  765. }
  766. ,
  767. i.prototype.destroy = function() {
  768. clearTimeout(this.timeout),
  769. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  770. }
  771. ;
  772. var o = t.fn.tooltip;
  773. t.fn.tooltip = e,
  774. t.fn.tooltip.Constructor = i,
  775. t.fn.tooltip.noConflict = function() {
  776. return t.fn.tooltip = o,
  777. this
  778. }
  779. }(jQuery);
  780. !function(e, t, n) {
  781. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  782. }("Keen", this, function() {
  783. "use strict";
  784. function Keen() {
  785. return _init.apply(this, arguments)
  786. }
  787. function _init(e) {
  788. if (_isUndefined(e))
  789. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  790. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  791. throw new Error("Please provide a projectId");
  792. this.configure(e)
  793. }
  794. function _extend(e) {
  795. for (var t = 1; t < arguments.length; t++)
  796. for (var n in arguments[t])
  797. e[n] = arguments[t][n];
  798. return e
  799. }
  800. function _isUndefined(e) {
  801. return void 0 === e
  802. }
  803. function _type(e) {
  804. var t = e && e.constructor ? e.constructor.toString() : void 0;
  805. return t ? t.match(/function (.*)\(/)[1] : "Null"
  806. }
  807. function _each(e, t, n) {
  808. var r;
  809. if (!e)
  810. return 0;
  811. if (n = n ? n : e,
  812. "array" === _type(e)) {
  813. for (r = 0; r < e.length; r++)
  814. if (t.call(n, e[r], r, e) === !1)
  815. return 0
  816. } else
  817. for (r in e)
  818. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  819. return 0;
  820. return 1
  821. }
  822. function _parse_params(e) {
  823. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  824. return decodeURIComponent(e.replace(r, " "))
  825. }, a = e.split("?")[1]; t = i.exec(a); )
  826. n[o(t[1])] = o(t[2]);
  827. return n
  828. }
  829. function _set_protocol(e) {
  830. switch (e) {
  831. case "http":
  832. return "http";
  833. case "auto":
  834. return location.protocol.replace(/:/g, "");
  835. case "https":
  836. case void 0:
  837. default:
  838. return "https"
  839. }
  840. }
  841. function _set_request_type(e) {
  842. var t = e || "jsonp"
  843. , n = !1;
  844. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  845. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  846. }
  847. function _build_url(e) {
  848. return this.client.endpoint + "/projects/" + this.client.projectId + e
  849. }
  850. function _uploadEvent(e, t, n, r, i) {
  851. var o = _build_url.apply(this, ["/events/" + e])
  852. , a = {};
  853. n = n !== !1,
  854. this.client.globalProperties && (a = this.client.globalProperties(e));
  855. for (var c in t)
  856. t.hasOwnProperty(c) && (a[c] = t[c]);
  857. switch (this.client.requestType) {
  858. case "xhr":
  859. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  860. break;
  861. case "jsonp":
  862. var s = JSON.stringify(a)
  863. , l = Keen.Base64.encode(s);
  864. o = o + "?api_key=" + this.client.writeKey,
  865. o = o + "&data=" + l,
  866. o = o + "&modified=" + (new Date).getTime(),
  867. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  868. break;
  869. case "beacon":
  870. var s = JSON.stringify(a)
  871. , l = Keen.Base64.encode(s);
  872. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  873. o = o + "&data=" + encodeURIComponent(l),
  874. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  875. o += "&c=clv1",
  876. _request.beacon.apply(this, [o, null, r, i])
  877. }
  878. }
  879. Keen.prototype.configure = function(e) {
  880. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  881. e.protocol = _set_protocol(e.protocol),
  882. e.requestType = _set_request_type(e.requestType),
  883. this.client = {
  884. projectId: e.projectId,
  885. writeKey: e.writeKey,
  886. readKey: e.readKey,
  887. globalProperties: null,
  888. endpoint: e.protocol + "://" + e.host,
  889. requestType: e.requestType
  890. },
  891. Keen.trigger("client", this, e),
  892. this.trigger("ready"),
  893. this
  894. }
  895. ;
  896. var _request = {
  897. xhr: function(e, t, n, r, i, o, a, c) {
  898. if (!i)
  899. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  900. var s = new XMLHttpRequest;
  901. if (s.onreadystatechange = function() {
  902. if (4 == s.readyState)
  903. if (s.status >= 200 && s.status < 300) {
  904. var e;
  905. try {
  906. e = JSON.parse(s.responseText)
  907. } catch (e) {
  908. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  909. c && c(s, e)
  910. }
  911. a && e && a(e)
  912. } else
  913. Keen.log("HTTP request failed."),
  914. c && c(s, null)
  915. }
  916. ,
  917. s.open(e, t, o),
  918. i && s.setRequestHeader("Authorization", i),
  919. r && s.setRequestHeader("Content-Type", "application/json"),
  920. n)
  921. for (var l in n)
  922. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  923. var u = r ? JSON.stringify(r) : null;
  924. s.send(u)
  925. },
  926. jsonp: function(e, t, n, r) {
  927. if (!t)
  928. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  929. if (t && e.indexOf("api_key") < 0) {
  930. var i = e.indexOf("?") > 0 ? "&" : "?";
  931. e = e + i + "api_key=" + t
  932. }
  933. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  934. o += "a";
  935. var a = !1;
  936. window[o] = function(e) {
  937. a = !0,
  938. n && e && n(e),
  939. window[o] = void 0
  940. }
  941. ,
  942. e = e + "&jsonp=" + o;
  943. var c = document.createElement("script");
  944. c.id = "keen-jsonp",
  945. c.src = e,
  946. document.getElementsByTagName("head")[0].appendChild(c),
  947. c.onreadystatechange = function() {
  948. a === !1 && "loaded" === this.readyState && (a = !0,
  949. r && r())
  950. }
  951. ,
  952. c.onerror = function() {
  953. a === !1 && (a = !0,
  954. r && r())
  955. }
  956. },
  957. beacon: function(e, t, n, r) {
  958. if (t && e.indexOf("api_key") < 0) {
  959. var i = e.indexOf("?") > 0 ? "&" : "?";
  960. e = e + i + "api_key=" + t
  961. }
  962. var o = !1
  963. , a = document.createElement("img");
  964. a.onload = function() {
  965. if (o = !0,
  966. "naturalHeight"in this) {
  967. if (this.naturalHeight + this.naturalWidth === 0)
  968. return void this.onerror()
  969. } else if (this.width + this.height === 0)
  970. return void this.onerror();
  971. n && n({
  972. created: !0
  973. })
  974. }
  975. ,
  976. a.onerror = function() {
  977. o = !0,
  978. r && r()
  979. }
  980. ,
  981. a.src = e
  982. }
  983. }
  984. , Events = Keen.Events = {
  985. on: function(e, t) {
  986. this.listeners || (this.listeners = {});
  987. var n = this.listeners[e] || (this.listeners[e] = []);
  988. return n.push({
  989. callback: t
  990. }),
  991. this
  992. },
  993. off: function(e, t) {
  994. if (!e && !t)
  995. return this.listeners = void 0,
  996. delete this.listeners,
  997. this;
  998. for (var n = this.listeners[e] || [], r = n.length; r--; )
  999. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1000. t && 0 != n.length || (this.listeners[e] = void 0,
  1001. delete this.listeners[e]);
  1002. return this
  1003. },
  1004. trigger: function(e) {
  1005. if (!this.listeners)
  1006. return this;
  1007. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1008. n[r].callback.apply(this, t);
  1009. return this
  1010. }
  1011. };
  1012. _extend(Keen.prototype, Events),
  1013. _extend(Keen, Events),
  1014. Keen.loaded = !0,
  1015. Keen.utils = {
  1016. each: _each,
  1017. extend: _extend,
  1018. parseParams: _parse_params
  1019. },
  1020. Keen.ready = function(e) {
  1021. Keen.loaded ? e() : Keen.on("ready", e)
  1022. }
  1023. ,
  1024. Keen.log = function(e) {
  1025. "object" == typeof console && console.log("[Keen IO]", e)
  1026. }
  1027. ;
  1028. var Plugins = Keen.Plugins = {};
  1029. Keen.prototype.addEvent = function() {
  1030. _uploadEvent.apply(this, arguments)
  1031. }
  1032. ,
  1033. Keen.prototype.addEventSync = function(e, t, n, r) {
  1034. _uploadEvent.apply(this, [e, t, !1, n, r])
  1035. }
  1036. ,
  1037. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1038. var o = e
  1039. , a = o.metaKey
  1040. , c = o.target
  1041. , s = !1
  1042. , l = function() {};
  1043. return void 0 === r && (r = 500),
  1044. "A" === c.nodeName ? l = function() {
  1045. a || s || (s = !0,
  1046. window.location = c.href)
  1047. }
  1048. : "FORM" === c.nodeName && (l = function() {
  1049. s || (s = !0,
  1050. c.submit())
  1051. }
  1052. ),
  1053. i && (l = function() {
  1054. s || (s = !0,
  1055. i())
  1056. }
  1057. ),
  1058. _uploadEvent.call(this, t, n, l, l),
  1059. setTimeout(function() {
  1060. l()
  1061. }, r),
  1062. !!a && void 0
  1063. }
  1064. ,
  1065. Keen.prototype.setGlobalProperties = function(e) {
  1066. if (!this.client)
  1067. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1068. if (!e || "function" != typeof e)
  1069. throw new Error("Invalid value for global properties: " + e);
  1070. this.client.globalProperties = e
  1071. }
  1072. ,
  1073. Keen.Base64 = {
  1074. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1075. encode: function(e) {
  1076. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1077. for (e = this.utf8.encode(e); l < e.length; )
  1078. t = e.charCodeAt(l++),
  1079. n = e.charCodeAt(l++),
  1080. r = e.charCodeAt(l++),
  1081. i = t >> 2,
  1082. o = (3 & t) << 4 | n >> 4,
  1083. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1084. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1085. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1086. return s
  1087. },
  1088. decode: function(e) {
  1089. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1090. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1091. t = u.indexOf(e.charAt(l++)),
  1092. n = u.indexOf(e.charAt(l++)),
  1093. r = u.indexOf(e.charAt(l++)),
  1094. i = u.indexOf(e.charAt(l++)),
  1095. o = t << 2 | n >> 4,
  1096. a = (15 & n) << 4 | r >> 2,
  1097. c = (3 & r) << 6 | i,
  1098. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1099. return this.utf8.decode(s)
  1100. },
  1101. utf8: {
  1102. encode: function(e) {
  1103. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1104. t = e.charCodeAt(r++),
  1105. 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);
  1106. return n
  1107. },
  1108. decode: function(e) {
  1109. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1110. n = e.charCodeAt(i),
  1111. 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];
  1112. return r
  1113. }
  1114. }
  1115. },
  1116. "object" != typeof JSON && (JSON = {}),
  1117. function() {
  1118. function f(e) {
  1119. return 10 > e ? "0" + e : e
  1120. }
  1121. function quote(e) {
  1122. return escapable.lastIndex = 0,
  1123. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1124. var t = meta[e];
  1125. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1126. }) + '"' : '"' + e + '"'
  1127. }
  1128. function str(e, t) {
  1129. var n, r, i, o, a, c = gap, s = t[e];
  1130. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1131. "function" == typeof rep && (s = rep.call(t, e, s)),
  1132. typeof s) {
  1133. case "string":
  1134. return quote(s);
  1135. case "number":
  1136. return isFinite(s) ? String(s) : "null";
  1137. case "boolean":
  1138. case "null":
  1139. return String(s);
  1140. case "object":
  1141. if (!s)
  1142. return "null";
  1143. if (gap += indent,
  1144. a = [],
  1145. "[object Array]" === Object.prototype.toString.apply(s)) {
  1146. for (o = s.length,
  1147. n = 0; o > n; n += 1)
  1148. a[n] = str(n, s) || "null";
  1149. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1150. gap = c,
  1151. i
  1152. }
  1153. if (rep && "object" == typeof rep)
  1154. for (o = rep.length,
  1155. n = 0; o > n; n += 1)
  1156. "string" == typeof rep[n] && (r = rep[n],
  1157. i = str(r, s),
  1158. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1159. else
  1160. for (r in s)
  1161. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1162. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1163. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1164. gap = c,
  1165. i
  1166. }
  1167. }
  1168. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1169. 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
  1170. }
  1171. ,
  1172. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1173. return this.valueOf()
  1174. }
  1175. );
  1176. 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 = {
  1177. "\b": "\\b",
  1178. "\t": "\\t",
  1179. "\n": "\\n",
  1180. "\f": "\\f",
  1181. "\r": "\\r",
  1182. '"': '\\"',
  1183. "\\": "\\\\"
  1184. }, rep;
  1185. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1186. var r;
  1187. if (gap = "",
  1188. indent = "",
  1189. "number" == typeof n)
  1190. for (r = 0; n > r; r += 1)
  1191. indent += " ";
  1192. else
  1193. "string" == typeof n && (indent = n);
  1194. if (rep = t,
  1195. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1196. throw new Error("JSON.stringify");
  1197. return str("", {
  1198. "": e
  1199. })
  1200. }
  1201. ),
  1202. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1203. function walk(e, t) {
  1204. var n, r, i = e[t];
  1205. if (i && "object" == typeof i)
  1206. for (n in i)
  1207. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1208. void 0 !== r ? i[n] = r : delete i[n]);
  1209. return reviver.call(e, t, i)
  1210. }
  1211. var j;
  1212. if (text = String(text),
  1213. cx.lastIndex = 0,
  1214. cx.test(text) && (text = text.replace(cx, function(e) {
  1215. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1216. })),
  1217. /^[\],:{}\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, "")))
  1218. return j = eval("(" + text + ")"),
  1219. "function" == typeof reviver ? walk({
  1220. "": j
  1221. }, "") : j;
  1222. throw new SyntaxError("JSON.parse")
  1223. }
  1224. )
  1225. }(),
  1226. !function(e, t, n) {
  1227. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1228. }("domready", Keen.utils, function(e) {
  1229. function t(e) {
  1230. for (d = 1; e = r.shift(); )
  1231. e()
  1232. }
  1233. 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]);
  1234. return o[l] && o[l](s, n = function() {
  1235. o.removeEventListener(s, n, i),
  1236. t()
  1237. }
  1238. , i),
  1239. c && o.attachEvent(u, n = function() {
  1240. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1241. t())
  1242. }
  1243. ),
  1244. e = c ? function(t) {
  1245. self != top ? d ? t() : r.push(t) : function() {
  1246. try {
  1247. a.doScroll("left")
  1248. } catch (n) {
  1249. return setTimeout(function() {
  1250. e(t)
  1251. }, 50)
  1252. }
  1253. t()
  1254. }()
  1255. }
  1256. : function(e) {
  1257. d ? e() : r.push(e)
  1258. }
  1259. });
  1260. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1261. if (loaded && cached) {
  1262. clients = cached.clients || {},
  1263. ready = cached.ready || [];
  1264. for (var instance in clients)
  1265. if (clients.hasOwnProperty(instance)) {
  1266. var client = clients[instance];
  1267. for (var method in Keen.prototype)
  1268. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1269. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1270. ,
  1271. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1272. ,
  1273. client._config && (client.configure.call(client, client._config),
  1274. delete client._config),
  1275. client._setGlobalProperties) {
  1276. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1277. client.setGlobalProperties.apply(client, globals[i]);
  1278. delete client._setGlobalProperties
  1279. }
  1280. if (client._addEvent) {
  1281. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1282. client.addEvent.apply(client, queue[i]);
  1283. delete client._addEvent
  1284. }
  1285. var callback = client._on || [];
  1286. if (client._on) {
  1287. for (var i = 0; i < callback.length; i++)
  1288. client.on.apply(client, callback[i]);
  1289. client.trigger("ready"),
  1290. delete client._on
  1291. }
  1292. }
  1293. for (var i = 0; i < ready.length; i++) {
  1294. var callback = ready[i];
  1295. Keen.on("ready", function() {
  1296. callback()
  1297. })
  1298. }
  1299. }
  1300. return Keen.loaded && setTimeout(function() {
  1301. Keen.utils.domready(function() {
  1302. Keen.trigger("ready")
  1303. })
  1304. }, 0),
  1305. Keen
  1306. });
  1307. !function() {
  1308. var t = window.analytics = window.analytics || [];
  1309. if (!t.initialize) {
  1310. if (t.invoked)
  1311. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1312. t.invoked = !0,
  1313. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1314. t.factory = function(e) {
  1315. return function() {
  1316. var n = Array.prototype.slice.call(arguments);
  1317. return n.unshift(e),
  1318. t.push(n),
  1319. t
  1320. }
  1321. }
  1322. ;
  1323. for (var e = 0; e < t.methods.length; e++) {
  1324. var n = t.methods[e];
  1325. t[n] = t.factory(n)
  1326. }
  1327. t.load = function(t) {
  1328. var e = document.createElement("script");
  1329. e.type = "text/javascript",
  1330. e.async = !0,
  1331. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1332. var n = document.getElementsByTagName("script")[0];
  1333. n.parentNode.insertBefore(e, n)
  1334. }
  1335. ,
  1336. t.SNIPPET_VERSION = "4.0.0"
  1337. }
  1338. }();
  1339. !function(i, e) {
  1340. "use strict";
  1341. var s = ""
  1342. , r = "?"
  1343. , o = "function"
  1344. , a = "undefined"
  1345. , n = "object"
  1346. , t = "major"
  1347. , d = "model"
  1348. , w = "name"
  1349. , l = "type"
  1350. , p = "vendor"
  1351. , m = "version"
  1352. , c = "architecture"
  1353. , u = "console"
  1354. , g = "mobile"
  1355. , f = "tablet"
  1356. , h = "smarttv"
  1357. , b = {
  1358. has: function(i, e) {
  1359. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1360. },
  1361. lowerize: function(i) {
  1362. return i.toLowerCase()
  1363. }
  1364. }
  1365. , y = {
  1366. rgx: function() {
  1367. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1368. var c = m[p]
  1369. , u = m[p + 1];
  1370. if (typeof i === a) {
  1371. i = {};
  1372. for (t in u)
  1373. d = u[t],
  1374. typeof d === n ? i[d[0]] = e : i[d] = e
  1375. }
  1376. for (s = r = 0; s < c.length; s++)
  1377. if (w = c[s].exec(this.getUA())) {
  1378. for (t = 0; t < u.length; t++)
  1379. l = w[++r],
  1380. d = u[t],
  1381. 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;
  1382. break
  1383. }
  1384. if (w)
  1385. break
  1386. }
  1387. return i
  1388. },
  1389. str: function(i, s) {
  1390. for (var o in s)
  1391. if (typeof s[o] === n && s[o].length > 0) {
  1392. for (var a = 0; a < s[o].length; a++)
  1393. if (b.has(s[o][a], i))
  1394. return o === r ? e : o
  1395. } else if (b.has(s[o], i))
  1396. return o === r ? e : o;
  1397. return i
  1398. }
  1399. }
  1400. , v = {
  1401. browser: {
  1402. oldsafari: {
  1403. major: {
  1404. 1: ["/8", "/1", "/3"],
  1405. 2: "/4",
  1406. "?": "/"
  1407. },
  1408. version: {
  1409. "1.0": "/8",
  1410. 1.2: "/1",
  1411. 1.3: "/3",
  1412. "2.0": "/412",
  1413. "2.0.2": "/416",
  1414. "2.0.3": "/417",
  1415. "2.0.4": "/419",
  1416. "?": "/"
  1417. }
  1418. }
  1419. },
  1420. device: {
  1421. sprint: {
  1422. model: {
  1423. "Evo Shift 4G": "7373KT"
  1424. },
  1425. vendor: {
  1426. HTC: "APA",
  1427. Sprint: "Sprint"
  1428. }
  1429. }
  1430. },
  1431. os: {
  1432. windows: {
  1433. version: {
  1434. ME: "4.90",
  1435. "NT 3.11": "NT3.51",
  1436. "NT 4.0": "NT4.0",
  1437. 2e3: "NT 5.0",
  1438. XP: ["NT 5.1", "NT 5.2"],
  1439. Vista: "NT 6.0",
  1440. 7: "NT 6.1",
  1441. 8: "NT 6.2",
  1442. 8.1: "NT 6.3",
  1443. RT: "ARM"
  1444. }
  1445. }
  1446. }
  1447. }
  1448. , k = {
  1449. 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]],
  1450. 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]],
  1451. 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]],
  1452. 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]],
  1453. 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]]
  1454. }
  1455. , x = function(e) {
  1456. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1457. return this instanceof x ? (this.getBrowser = function() {
  1458. return y.rgx.apply(this, k.browser)
  1459. }
  1460. ,
  1461. this.getCPU = function() {
  1462. return y.rgx.apply(this, k.cpu)
  1463. }
  1464. ,
  1465. this.getDevice = function() {
  1466. return y.rgx.apply(this, k.device)
  1467. }
  1468. ,
  1469. this.getEngine = function() {
  1470. return y.rgx.apply(this, k.engine)
  1471. }
  1472. ,
  1473. this.getOS = function() {
  1474. return y.rgx.apply(this, k.os)
  1475. }
  1476. ,
  1477. this.getResult = function() {
  1478. return {
  1479. ua: this.getUA(),
  1480. browser: this.getBrowser(),
  1481. engine: this.getEngine(),
  1482. os: this.getOS(),
  1483. device: this.getDevice(),
  1484. cpu: this.getCPU()
  1485. }
  1486. }
  1487. ,
  1488. this.getUA = function() {
  1489. return r
  1490. }
  1491. ,
  1492. this.setUA = function(i) {
  1493. return r = i,
  1494. this
  1495. }
  1496. ,
  1497. void this.setUA(r)) : new x(e).getResult()
  1498. };
  1499. if (typeof exports !== a)
  1500. typeof module !== a && module.exports && (exports = module.exports = x),
  1501. exports.UAParser = x;
  1502. else if (i.UAParser = x,
  1503. typeof define === o && define.amd && define(function() {
  1504. return x
  1505. }),
  1506. typeof i.jQuery !== a) {
  1507. var A = i.jQuery
  1508. , _ = new x;
  1509. A.ua = _.getResult(),
  1510. A.ua.get = function() {
  1511. return _.getUA()
  1512. }
  1513. ,
  1514. A.ua.set = function(i) {
  1515. _.setUA(i);
  1516. var e = _.getResult();
  1517. for (var s in e)
  1518. A.ua[s] = e[s]
  1519. }
  1520. }
  1521. }(this);
  1522. window.Modernizr = function(n, e, t) {
  1523. function o(n) {
  1524. d.cssText = n
  1525. }
  1526. function r(n, e) {
  1527. return typeof n === e
  1528. }
  1529. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1530. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1531. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1532. return e in n && r(n.constructor.prototype[e], "undefined")
  1533. }
  1534. : function(n, e) {
  1535. return v.call(n, e)
  1536. }
  1537. ,
  1538. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1539. var e = this;
  1540. if ("function" != typeof e)
  1541. throw new TypeError;
  1542. var t = b.call(arguments, 1)
  1543. , o = function() {
  1544. if (this instanceof o) {
  1545. var r = function() {};
  1546. r.prototype = e.prototype;
  1547. var i = new r
  1548. , c = e.apply(i, t.concat(b.call(arguments)));
  1549. return Object(c) === c ? c : i
  1550. }
  1551. return e.apply(n, t.concat(b.call(arguments)))
  1552. };
  1553. return o
  1554. }
  1555. ),
  1556. y.webgl = function() {
  1557. return !!n.WebGLRenderingContext
  1558. }
  1559. ;
  1560. for (var h in y)
  1561. u(y, h) && (c = h.toLowerCase(),
  1562. f[c] = y[h](),
  1563. w.push((f[c] ? "" : "no-") + c));
  1564. return f.addTest = function(n, e) {
  1565. if ("object" == typeof n)
  1566. for (var o in n)
  1567. u(n, o) && f.addTest(o, n[o]);
  1568. else {
  1569. if (n = n.toLowerCase(),
  1570. f[n] !== t)
  1571. return f;
  1572. e = "function" == typeof e ? e() : e,
  1573. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1574. f[n] = e
  1575. }
  1576. return f
  1577. }
  1578. ,
  1579. o(""),
  1580. p = i = null,
  1581. f._version = a,
  1582. f
  1583. }(this, this.document);
  1584. !function(e, t, a) {
  1585. "use strict";
  1586. function n(t, h, m) {
  1587. function H(a) {
  1588. var n = 0
  1589. , i = Ee.length;
  1590. if (Ce.old = e.extend({}, Ce),
  1591. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1592. ke = Be[ge.horizontal ? "width" : "height"](),
  1593. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1594. Ee.length = 0,
  1595. Ce.start = 0,
  1596. Ce.end = q(ze - Ie, 0),
  1597. Re) {
  1598. n = Ne.length,
  1599. qe = Pe.children(ge.itemSelector),
  1600. Ne.length = 0;
  1601. 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;
  1602. ze = 0,
  1603. qe.each(function(t, a) {
  1604. var n = e(a)
  1605. , i = a.getBoundingClientRect()
  1606. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1607. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1608. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1609. , h = l + d + p
  1610. , m = !d || !p
  1611. , g = {};
  1612. g.el = a,
  1613. g.size = m ? l : h,
  1614. g.half = g.size / 2,
  1615. g.start = ze + (m ? d : 0),
  1616. g.center = g.start - E(Ie / 2 - g.size / 2),
  1617. g.end = g.start - Ie + g.size,
  1618. t || (ze += s),
  1619. ze += h,
  1620. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1621. t === v && (g.end += o,
  1622. ze += o,
  1623. f = m ? p : 0),
  1624. Ne.push(g),
  1625. r = g
  1626. }),
  1627. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1628. ze -= f,
  1629. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1630. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1631. }
  1632. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1633. Q(),
  1634. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1635. Te = d(Te, ge.minHandleSize, ke),
  1636. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1637. xe.end = ke - Te,
  1638. it || j()),
  1639. !we && Ie > 0) {
  1640. var p = Ce.start
  1641. , h = "";
  1642. if (Re)
  1643. e.each(Ne, function(e, t) {
  1644. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1645. Ee.push(p),
  1646. p += Ie,
  1647. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1648. });
  1649. else
  1650. for (; p - Ie < Ce.end; )
  1651. Ee.push(p),
  1652. p += Ie;
  1653. if (De[0] && i !== Ee.length) {
  1654. for (var m = 0; m < Ee.length; m++)
  1655. h += ge.pageBuilder.call(ye, m);
  1656. Ae = De.html(h).children(),
  1657. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1658. }
  1659. }
  1660. if (Oe.slideeSize = ze,
  1661. Oe.frameSize = Ie,
  1662. Oe.sbSize = ke,
  1663. Oe.handleSize = Te,
  1664. Re) {
  1665. a && null != ge.startAt && (W(ge.startAt),
  1666. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1667. var g = Ne[Oe.activeItem];
  1668. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1669. } else
  1670. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1671. pe("load")
  1672. }
  1673. function X(e, t, a) {
  1674. if (Re && at.released && !a) {
  1675. var n = $(e)
  1676. , i = e > Ce.start && e < Ce.end;
  1677. Le ? (i && (e = Ne[n.centerItem].center),
  1678. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1679. }
  1680. 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),
  1681. et.start = +new Date,
  1682. et.time = 0,
  1683. et.from = Ce.cur,
  1684. et.to = e,
  1685. et.delta = e - Ce.cur,
  1686. et.tweesing = at.tweese || at.init && !at.slidee,
  1687. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1688. at.tweese = 0,
  1689. e !== Ce.dest && (Ce.dest = e,
  1690. pe("change"),
  1691. it || Y()),
  1692. K(),
  1693. Q(),
  1694. Z(),
  1695. F()
  1696. }
  1697. function Y() {
  1698. if (ye.initialized) {
  1699. if (!it)
  1700. return it = w(Y),
  1701. void (at.released && pe("moveStart"));
  1702. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1703. 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),
  1704. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1705. et.to === Ce.cur ? (Ce.cur = et.to,
  1706. at.tweese = it = 0) : it = w(Y),
  1707. pe("move"),
  1708. 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"),
  1709. !it && at.released && pe("moveEnd"),
  1710. j()
  1711. }
  1712. }
  1713. function j() {
  1714. 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,
  1715. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1716. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1717. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1718. }
  1719. function F() {
  1720. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1721. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1722. pe("activePage", _e.page))
  1723. }
  1724. function M() {
  1725. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1726. ot = at.init ? w(M) : 0,
  1727. tt.now = +new Date,
  1728. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1729. X(at.init ? tt.pos : E(tt.pos)),
  1730. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1731. tt.lastTime = tt.now
  1732. }
  1733. function L(e, t, n) {
  1734. if ("boolean" === i(t) && (n = t,
  1735. t = a),
  1736. t === a)
  1737. X(Ce[e], n);
  1738. else {
  1739. if (Le && "center" !== e)
  1740. return;
  1741. var r = ye.getPos(t);
  1742. r && X(r[e], n, !Le)
  1743. }
  1744. }
  1745. function R(e) {
  1746. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1747. }
  1748. function U(e) {
  1749. return R(l(e) && 0 > e ? e + Ne.length : e)
  1750. }
  1751. function W(e, t) {
  1752. var a = R(e);
  1753. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1754. qe.eq(a).addClass(ge.activeClass),
  1755. _e.active = Oe.activeItem = a,
  1756. Z(),
  1757. pe("active", a)),
  1758. a)
  1759. }
  1760. function $(e) {
  1761. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1762. var t = {}
  1763. , a = Me ? 0 : Ie / 2;
  1764. if (!we)
  1765. for (var n = 0, i = Ee.length; i > n; n++) {
  1766. if (e >= Ce.end || n === Ee.length - 1) {
  1767. t.activePage = Ee.length - 1;
  1768. break
  1769. }
  1770. if (e <= Ee[n] + a) {
  1771. t.activePage = n;
  1772. break
  1773. }
  1774. }
  1775. if (Re) {
  1776. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1777. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1778. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1779. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1780. s = c;
  1781. break
  1782. }
  1783. t.firstItem = l(r) ? r : 0,
  1784. t.centerItem = l(o) ? o : t.firstItem,
  1785. t.lastItem = l(s) ? s : t.centerItem
  1786. }
  1787. return t
  1788. }
  1789. function Q(t) {
  1790. e.extend(Oe, $(t))
  1791. }
  1792. function Z() {
  1793. var e = Ce.dest <= Ce.start
  1794. , t = Ce.dest >= Ce.end
  1795. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1796. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1797. Je.is("button,input") && Je.prop("disabled", e),
  1798. Ke.is("button,input") && Ke.prop("disabled", t),
  1799. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1800. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1801. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1802. Qe.is("button,input") && Qe.prop("disabled", e),
  1803. $e.is("button,input") && $e.prop("disabled", t)),
  1804. Re && null != Oe.activeItem) {
  1805. var n = 0 === Oe.activeItem
  1806. , i = Oe.activeItem >= Ne.length - 1
  1807. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1808. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1809. Ze.is("button,input") && Ze.prop("disabled", n),
  1810. Ge.is("button,input") && Ge.prop("disabled", i),
  1811. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1812. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1813. }
  1814. }
  1815. function G(e, t, a) {
  1816. if (e = U(e),
  1817. t = U(t),
  1818. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1819. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1820. var n = t > e ? e : a ? t : t - 1
  1821. , i = e > t ? e : a ? t + 1 : t
  1822. , r = e > t;
  1823. 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)),
  1824. H()
  1825. }
  1826. }
  1827. function J(e, t) {
  1828. for (var a = 0, n = Ve[e].length; n > a; a++)
  1829. if (Ve[e][a] === t)
  1830. return a;
  1831. return -1
  1832. }
  1833. function K() {
  1834. at.released && !ye.isPaused && ye.resume()
  1835. }
  1836. function V(e) {
  1837. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1838. }
  1839. function _() {
  1840. at.history[0] = at.history[1],
  1841. at.history[1] = at.history[2],
  1842. at.history[2] = at.history[3],
  1843. at.history[3] = at.delta
  1844. }
  1845. function ee(e) {
  1846. at.released = 0,
  1847. at.source = e,
  1848. at.slidee = "slidee" === e
  1849. }
  1850. function te(t) {
  1851. var a = "touchstart" === t.type
  1852. , n = t.data.source
  1853. , i = "slidee" === n;
  1854. 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),
  1855. ee(n),
  1856. at.init = 0,
  1857. at.$source = e(t.target),
  1858. at.touch = a,
  1859. at.pointer = a ? t.originalEvent.touches[0] : t,
  1860. at.initX = at.pointer.pageX,
  1861. at.initY = at.pointer.pageY,
  1862. at.initPos = i ? Ce.cur : xe.cur,
  1863. at.start = +new Date,
  1864. at.time = 0,
  1865. at.path = 0,
  1866. at.delta = 0,
  1867. at.locked = 0,
  1868. at.history = [0, 0, 0, 0],
  1869. at.pathToLock = i ? a ? 30 : 10 : 0,
  1870. b.on(a ? z : I, ae),
  1871. ye.pause(1),
  1872. (i ? Pe : Se).addClass(ge.draggedClass),
  1873. pe("moveStart"),
  1874. i && (rt = setInterval(_, 10)))
  1875. }
  1876. function ae(e) {
  1877. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1878. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1879. at.pathX = at.pointer.pageX - at.initX,
  1880. at.pathY = at.pointer.pageY - at.initY,
  1881. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1882. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1883. at.released || !(at.path < 1)) {
  1884. if (!at.init) {
  1885. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1886. return ne();
  1887. at.init = 1
  1888. }
  1889. r(e),
  1890. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1891. at.$source.on(B, s)),
  1892. at.released && (ne(),
  1893. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1894. at.delta += at.swing,
  1895. at.tweese = x(at.swing) > 10)),
  1896. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1897. }
  1898. }
  1899. function ne() {
  1900. clearInterval(rt),
  1901. at.released = !0,
  1902. b.off(at.touch ? z : I, ae),
  1903. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1904. setTimeout(function() {
  1905. at.$source.off(B, s)
  1906. }),
  1907. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1908. ye.resume(1),
  1909. at.init = 0
  1910. }
  1911. function ie(t) {
  1912. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1913. }
  1914. function re() {
  1915. ye.stop(),
  1916. b.off("mouseup", re)
  1917. }
  1918. function se(e) {
  1919. switch (r(e),
  1920. this) {
  1921. case $e[0]:
  1922. case Qe[0]:
  1923. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1924. b.on("mouseup", re);
  1925. break;
  1926. case Ze[0]:
  1927. ye.prev();
  1928. break;
  1929. case Ge[0]:
  1930. ye.next();
  1931. break;
  1932. case Je[0]:
  1933. ye.prevPage();
  1934. break;
  1935. case Ke[0]:
  1936. ye.nextPage()
  1937. }
  1938. }
  1939. function oe(e) {
  1940. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1941. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1942. Re ? (p = +new Date,
  1943. nt.last < p - nt.resetTime && (nt.delta = 0),
  1944. nt.last = p,
  1945. nt.delta += nt.curDelta,
  1946. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1947. nt.delta %= 1),
  1948. nt.finalDelta) : nt.curDelta
  1949. }
  1950. function le(e) {
  1951. e.originalEvent[g] = ye;
  1952. var t = +new Date;
  1953. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1954. return void (O = t);
  1955. if (ge.scrollBy && Ce.start !== Ce.end) {
  1956. var a = oe(e.originalEvent);
  1957. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1958. ye.slideBy(ge.scrollBy * a)
  1959. }
  1960. }
  1961. function ce(e) {
  1962. ge.clickBar && e.target === Be[0] && (r(e),
  1963. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1964. }
  1965. function de(e) {
  1966. if (ge.keyboardNavBy)
  1967. switch (e.which) {
  1968. case ge.horizontal ? 37 : 38:
  1969. r(e),
  1970. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1971. break;
  1972. case ge.horizontal ? 39 : 40:
  1973. r(e),
  1974. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1975. }
  1976. }
  1977. function ue(e) {
  1978. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1979. }
  1980. function fe() {
  1981. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1982. }
  1983. function ve(e) {
  1984. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1985. }
  1986. function pe(e, t) {
  1987. if (Ve[e]) {
  1988. for (me = Ve[e].length,
  1989. T.length = 0,
  1990. he = 0; me > he; he++)
  1991. T.push(Ve[e][he]);
  1992. for (he = 0; me > he; he++)
  1993. T[he].call(ye, e, t)
  1994. }
  1995. }
  1996. 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 = {
  1997. start: 0,
  1998. center: 0,
  1999. end: 0,
  2000. cur: 0,
  2001. dest: 0
  2002. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2003. start: 0,
  2004. end: 0,
  2005. cur: 0
  2006. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2007. firstItem: 0,
  2008. lastItem: 0,
  2009. centerItem: 0,
  2010. activeItem: null,
  2011. activePage: 0
  2012. }, 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 = {
  2013. released: 1
  2014. }, nt = {
  2015. last: 0,
  2016. delta: 0,
  2017. resetTime: 200
  2018. }, it = 0, rt = 0, st = 0, ot = 0;
  2019. we || (t = be[0]),
  2020. ye.initialized = 0,
  2021. ye.frame = t,
  2022. ye.slidee = Pe[0],
  2023. ye.pos = Ce,
  2024. ye.rel = Oe,
  2025. ye.items = Ne,
  2026. ye.pages = Ee,
  2027. ye.isPaused = 0,
  2028. ye.options = ge,
  2029. ye.dragging = at,
  2030. ye.reload = function() {
  2031. H()
  2032. }
  2033. ,
  2034. ye.getPos = function(e) {
  2035. if (Re) {
  2036. var t = R(e);
  2037. return -1 !== t && Ne[t]
  2038. }
  2039. var a = Pe.find(e).eq(0);
  2040. if (a[0]) {
  2041. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2042. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2043. return {
  2044. start: n,
  2045. center: n - Ie / 2 + i / 2,
  2046. end: n - Ie + i,
  2047. size: i
  2048. }
  2049. }
  2050. return !1
  2051. }
  2052. ,
  2053. ye.moveBy = function(e) {
  2054. tt.speed = e,
  2055. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2056. tt.startPos = Ce.cur,
  2057. ee("button"),
  2058. at.init = 1,
  2059. pe("moveStart"),
  2060. y(ot),
  2061. M())
  2062. }
  2063. ,
  2064. ye.stop = function() {
  2065. "button" === at.source && (at.init = 0,
  2066. at.released = 1)
  2067. }
  2068. ,
  2069. ye.prev = function() {
  2070. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2071. }
  2072. ,
  2073. ye.next = function() {
  2074. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2075. }
  2076. ,
  2077. ye.prevPage = function() {
  2078. ye.activatePage(Oe.activePage - 1)
  2079. }
  2080. ,
  2081. ye.nextPage = function() {
  2082. ye.activatePage(Oe.activePage + 1)
  2083. }
  2084. ,
  2085. ye.slideBy = function(e, t) {
  2086. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2087. }
  2088. ,
  2089. ye.slideTo = function(e, t) {
  2090. X(e, t)
  2091. }
  2092. ,
  2093. ye.toStart = function(e, t) {
  2094. L("start", e, t)
  2095. }
  2096. ,
  2097. ye.toEnd = function(e, t) {
  2098. L("end", e, t)
  2099. }
  2100. ,
  2101. ye.toCenter = function(e, t) {
  2102. L("center", e, t)
  2103. }
  2104. ,
  2105. ye.getIndex = R,
  2106. ye.activate = function(e, t) {
  2107. var a = W(e);
  2108. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2109. }
  2110. ,
  2111. ye.activatePage = function(e, t) {
  2112. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2113. }
  2114. ,
  2115. ye.resume = function(e) {
  2116. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2117. st ? st = clearTimeout(st) : pe("resume"),
  2118. st = setTimeout(function() {
  2119. switch (pe("cycle"),
  2120. ge.cycleBy) {
  2121. case "items":
  2122. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2123. break;
  2124. case "pages":
  2125. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2126. }
  2127. }, ge.cycleInterval))
  2128. }
  2129. ,
  2130. ye.pause = function(e) {
  2131. e < ye.isPaused || (ye.isPaused = e || 100,
  2132. st && (st = clearTimeout(st),
  2133. pe("pause")))
  2134. }
  2135. ,
  2136. ye.toggle = function() {
  2137. ye[st ? "pause" : "resume"]()
  2138. }
  2139. ,
  2140. ye.set = function(t, a) {
  2141. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2142. }
  2143. ,
  2144. ye.add = function(t, a) {
  2145. var n = e(t);
  2146. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2147. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2148. H()
  2149. }
  2150. ,
  2151. ye.remove = function(t) {
  2152. if (Re) {
  2153. var a = U(t);
  2154. if (a > -1) {
  2155. qe.eq(a).remove();
  2156. var n = a === Oe.activeItem;
  2157. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2158. H(),
  2159. n && (_e.active = null,
  2160. ye.activate(Oe.activeItem))
  2161. }
  2162. } else
  2163. e(t).remove(),
  2164. H()
  2165. }
  2166. ,
  2167. ye.moveAfter = function(e, t) {
  2168. G(e, t, 1)
  2169. }
  2170. ,
  2171. ye.moveBefore = function(e, t) {
  2172. G(e, t)
  2173. }
  2174. ,
  2175. ye.on = function(e, t) {
  2176. if ("object" === i(e))
  2177. for (var a in e)
  2178. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2179. else if ("function" === i(t))
  2180. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2181. Ve[n[r]] = Ve[n[r]] || [],
  2182. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2183. else if ("array" === i(t))
  2184. for (var o = 0, l = t.length; l > o; o++)
  2185. ye.on(e, t[o])
  2186. }
  2187. ,
  2188. ye.one = function(e, t) {
  2189. function a() {
  2190. t.apply(ye, arguments),
  2191. ye.off(e, a)
  2192. }
  2193. ye.on(e, a)
  2194. }
  2195. ,
  2196. ye.off = function(e, t) {
  2197. if (t instanceof Array)
  2198. for (var a = 0, n = t.length; n > a; a++)
  2199. ye.off(e, t[a]);
  2200. else
  2201. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2202. if (Ve[i[r]] = Ve[i[r]] || [],
  2203. null == t)
  2204. Ve[i[r]].length = 0;
  2205. else {
  2206. var o = J(i[r], t);
  2207. -1 !== o && Ve[i[r]].splice(o, 1)
  2208. }
  2209. }
  2210. ,
  2211. ye.destroy = function() {
  2212. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2213. b.off("keydown", de),
  2214. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2215. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2216. De.empty(),
  2217. we || (be.off("." + g),
  2218. He.restore(),
  2219. Xe.restore(),
  2220. Ye.restore(),
  2221. je.restore(),
  2222. e.removeData(t, g)),
  2223. Ne.length = Ee.length = 0,
  2224. _e = {},
  2225. ye.initialized = 0,
  2226. ye
  2227. }
  2228. ,
  2229. ye.init = function() {
  2230. if (!ye.initialized) {
  2231. ye.on(m);
  2232. var e = ["overflow", "position"]
  2233. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2234. He.save.apply(He, e),
  2235. Ye.save.apply(Ye, e),
  2236. Xe.save.apply(Xe, t),
  2237. je.save.apply(je, t);
  2238. var a = Se;
  2239. return we || (a = a.add(Pe),
  2240. be.css("overflow", "hidden"),
  2241. f || "static" !== be.css("position") || be.css("position", "relative")),
  2242. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2243. a.css({
  2244. position: "absolute"
  2245. })),
  2246. ge.forward && $e.on(S, se),
  2247. ge.backward && Qe.on(S, se),
  2248. ge.prev && Ze.on(B, se),
  2249. ge.next && Ge.on(B, se),
  2250. ge.prevPage && Je.on(B, se),
  2251. ge.nextPage && Ke.on(B, se),
  2252. Ue.on(C, le),// C是 "wheel.sly" 滚动监听
  2253. Be[0] && Be.on(B, ce),
  2254. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2255. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2256. We.on(P, {
  2257. source: "slidee"
  2258. }, te),
  2259. Se && Se.on(P, {
  2260. source: "handle"
  2261. }, te),
  2262. b.on("keydown", de),
  2263. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2264. be.on("scroll." + g, o)),
  2265. ye.initialized = 1,
  2266. H(!0),
  2267. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2268. ye
  2269. }
  2270. }
  2271. }
  2272. function i(e) {
  2273. 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
  2274. }
  2275. function r(e, t) {
  2276. e.preventDefault(),
  2277. t && e.stopPropagation()
  2278. }
  2279. function s(t) {
  2280. r(t, 1),
  2281. e(this).off(t.type, s)
  2282. }
  2283. function o() {
  2284. this.scrollLeft = 0,
  2285. this.scrollTop = 0
  2286. }
  2287. function l(e) {
  2288. return !isNaN(parseFloat(e)) && isFinite(e)
  2289. }
  2290. function c(e, t) {
  2291. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2292. }
  2293. function d(e, t, a) {
  2294. return t > e ? t : e > a ? a : e
  2295. }
  2296. function u(e) {
  2297. var t = {};
  2298. return t.style = {},
  2299. t.save = function() {
  2300. if (e && e.nodeType) {
  2301. for (var a = 0; a < arguments.length; a++)
  2302. t.style[arguments[a]] = e.style[arguments[a]];
  2303. return t
  2304. }
  2305. }
  2306. ,
  2307. t.restore = function() {
  2308. if (e && e.nodeType) {
  2309. for (var a in t.style)
  2310. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2311. return t
  2312. }
  2313. }
  2314. ,
  2315. t
  2316. }
  2317. 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;
  2318. b.on(C, function(e) {
  2319. var t = e.originalEvent[g]
  2320. , a = +new Date;
  2321. (!t || t.options.scrollHijack < a - O) && (O = a)
  2322. }),
  2323. function(e) {
  2324. function t(e) {
  2325. var t = (new Date).getTime()
  2326. , n = Math.max(0, 16 - (t - a))
  2327. , i = setTimeout(e, n);
  2328. return a = t,
  2329. i
  2330. }
  2331. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2332. var a = (new Date).getTime()
  2333. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2334. y = function(t) {
  2335. n.call(e, t)
  2336. }
  2337. }(window),
  2338. function() {
  2339. function e(e) {
  2340. for (var n = 0, i = t.length; i > n; n++) {
  2341. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2342. if (null != a.style[r])
  2343. return r
  2344. }
  2345. }
  2346. var t = ["", "webkit", "moz", "ms", "o"]
  2347. , a = document.createElement("div");
  2348. f = e("transform"),
  2349. v = e("perspective") ? "translateZ(0) " : ""
  2350. }(),
  2351. t[m] = n,
  2352. e.fn[h] = function(t, a) {
  2353. var r, s;
  2354. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2355. s = Array.prototype.slice.call(arguments, 1)),
  2356. t = {}),
  2357. this.each(function(i, o) {
  2358. var l = e.data(o, g);
  2359. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2360. })
  2361. }
  2362. ,
  2363. n.defaults = {
  2364. slidee: null,
  2365. horizontal: !1,
  2366. itemNav: null,
  2367. itemSelector: null,
  2368. smart: !1,
  2369. activateOn: null,
  2370. activateMiddle: !1,
  2371. scrollSource: null,
  2372. scrollBy: 0,
  2373. scrollHijack: 300,
  2374. scrollTrap: !1,
  2375. dragSource: null,
  2376. mouseDragging: !1,
  2377. touchDragging: !1,
  2378. releaseSwing: !1,
  2379. swingSpeed: .2,
  2380. elasticBounds: !1,
  2381. interactive: null,
  2382. scrollBar: null,
  2383. dragHandle: !1,
  2384. dynamicHandle: !1,
  2385. minHandleSize: 50,
  2386. clickBar: !1,
  2387. syncSpeed: .5,
  2388. pagesBar: null,
  2389. activatePageOn: null,
  2390. pageBuilder: function(e) {
  2391. return "<li>" + (e + 1) + "</li>"
  2392. },
  2393. forward: null,
  2394. backward: null,
  2395. prev: null,
  2396. next: null,
  2397. prevPage: null,
  2398. nextPage: null,
  2399. cycleBy: null,
  2400. cycleInterval: 5e3,
  2401. pauseOnHover: !1,
  2402. startPaused: !1,
  2403. moveBy: 300,
  2404. speed: 0,
  2405. easing: "swing",
  2406. startAt: null,
  2407. keyboardNavBy: null,
  2408. draggedClass: "dragged",
  2409. activeClass: "active",
  2410. disabledClass: "disabled"
  2411. }
  2412. }(jQuery, window);
  2413. !function e(t, i, n) {
  2414. function r(a, s) {
  2415. if (!i[a]) {
  2416. if (!t[a]) {
  2417. var l = "function" == typeof require && require;
  2418. if (!s && l)
  2419. return l(a, !0);
  2420. if (o)
  2421. return o(a, !0);
  2422. var c = new Error("Cannot find module '" + a + "'");
  2423. throw c.code = "MODULE_NOT_FOUND",
  2424. c
  2425. }
  2426. var h = i[a] = {
  2427. exports: {}
  2428. };
  2429. t[a][0].call(h.exports, function(e) {
  2430. var i = t[a][1][e];
  2431. return r(i ? i : e)
  2432. }, h, h.exports, e, t, i, n)
  2433. }
  2434. return i[a].exports
  2435. }
  2436. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2437. r(n[a]);
  2438. return r
  2439. }({
  2440. 1: [function(e, t, i) {
  2441. (function(i) {
  2442. "use strict";
  2443. function n(e) {
  2444. this.player = null,
  2445. this.director = null,
  2446. this.modelManager = null,
  2447. this.container = null,
  2448. this.tagManager = null,
  2449. this.fadeInSpeed = e,
  2450. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2451. }
  2452. var r = e("three")
  2453. , o = e("./util/logger")
  2454. , a = (e("./util/common"),
  2455. e("./enum/PlayerEvents"))
  2456. , s = e("./enum/DirectorEvents")
  2457. , l = e("./settings")
  2458. , c = e("./enum/Viewmode")
  2459. , h = (e("./enum/WarpStyle"),
  2460. e("./enum/BlackoutStyle"),
  2461. e("./enum/ModelManagerEvents"))
  2462. , u = e("./enum/tagEvents")
  2463. , d = e("./util/transitions")
  2464. , p = e("./util/lerp")
  2465. , f = new o(i);
  2466. //window.THREE = r;
  2467. n.prototype.init = function(e, t, i, n, r) {
  2468. window.app = this;
  2469. this.player = t,
  2470. this.director = e,
  2471. this.modelManager = i,
  2472. this.tagManager = n,
  2473. this.container = r,
  2474. this.updateModel(),
  2475. this.bindEvents()
  2476. }
  2477. ,
  2478. n.prototype.bindEvents = function() {
  2479. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2480. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2481. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2482. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2483. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2484. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2485. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2486. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2487. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2488. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2489. }
  2490. ,
  2491. n.prototype.updateModel = function() {
  2492. //模型this.model
  2493. this.model = this.modelManager.getActiveModel()
  2494. }
  2495. ,
  2496. n.prototype.handleWarpStarted = function() {
  2497. this.hidePlayerReticule()
  2498. }
  2499. ,
  2500. n.prototype.ontagActivated = function() {
  2501. this.hidePlayerReticule()
  2502. }
  2503. ,
  2504. n.prototype.onNavigationTotag = function() {
  2505. this.hidePlayerReticule()
  2506. }
  2507. ,
  2508. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2509. var n = this.modelManager.getActiveModel()
  2510. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2511. n.fadePanoMarkers(r),
  2512. n.setMode(t)
  2513. }
  2514. ,
  2515. n.prototype.handlePlayerModeChanged = function(e, t) {
  2516. var i = this.modelManager.getActiveModel()
  2517. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2518. i.setSide(n),
  2519. i.setMode(t)
  2520. }
  2521. ,
  2522. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2523. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2524. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2525. }
  2526. ,
  2527. n.prototype.handleActionInterruption = function() {}
  2528. ,
  2529. n.prototype.handleStartInside = function(e) {
  2530. var t = l[this.player.mode]
  2531. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2532. this.fadeIn(this.fadeInSpeed),
  2533. this.model.alpha = 0,
  2534. this.model.skybox.material.uniforms.opacity.value = 1,
  2535. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2536. var n = this.player.reticule;
  2537. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2538. }
  2539. ,
  2540. n.prototype.handleStartOutside = function(e) {
  2541. this.fadeIn(e)
  2542. }
  2543. ,
  2544. n.prototype.fadeIn = function(e) {
  2545. null !== e && void 0 !== e || (e = 2e3,
  2546. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2547. $(this.container).fadeIn(e)
  2548. }
  2549. ,
  2550. n.prototype.hidePlayerReticule = function() {
  2551. this.player.reticule.hide()
  2552. }
  2553. ,
  2554. t.exports = n
  2555. }
  2556. ).call(this, "/js/DisplayController.js")
  2557. }
  2558. , {
  2559. "./enum/BlackoutStyle": 18,
  2560. "./enum/DirectorEvents": 23,
  2561. "./enum/tagEvents": 32,
  2562. "./enum/ModelManagerEvents": 33,
  2563. "./enum/PlayerEvents": 40,
  2564. "./enum/Viewmode": 51,
  2565. "./enum/WarpStyle": 52,
  2566. "./settings": 166,
  2567. "./util/common": 185,
  2568. "./util/lerp": 188,
  2569. "./util/logger": 189,
  2570. "./util/transitions": 195,
  2571. three: 217
  2572. }],
  2573. 2: [function(e, t, i) {
  2574. "use strict";
  2575. function n() {
  2576. this.baseStartTime = performance.timing.navigationStart,
  2577. this.loadingStartTime = null,
  2578. this.waitingStartTime = null,
  2579. this.appReadyTime = null
  2580. }
  2581. n.prototype.setBaseStartTime = function(e) {
  2582. this.baseStartTime = e || Date.now()
  2583. }
  2584. ,
  2585. n.prototype.setWaitingStartTime = function(e) {
  2586. this.waitingStartTime = e || Date.now()
  2587. }
  2588. ,
  2589. n.prototype.setLoadingStartTime = function(e) {
  2590. this.loadingStartTime = e || Date.now()
  2591. }
  2592. ,
  2593. n.prototype.setAppReadyTime = function(e) {
  2594. this.appReadyTime = e || Date.now()
  2595. }
  2596. ,
  2597. n.prototype.calcFullLoadingTime = function() {
  2598. var e = this.appReadyTime - this.baseStartTime;
  2599. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2600. e
  2601. }
  2602. ,
  2603. t.exports = n
  2604. }
  2605. , {}],
  2606. 3: [function(e, t, i) {
  2607. (function(i) {
  2608. "use strict";
  2609. function n() {
  2610. return 100 * Math.random()
  2611. }
  2612. var r = e("./util/logger")
  2613. , o = e("./util/browser")
  2614. , a = new r(i)
  2615. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2616. initialized: !1,
  2617. init: function(e, t) {
  2618. if (t = t || {},
  2619. !this.initialized) {
  2620. this.initialized = !0,
  2621. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2622. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2623. for (var i in e) {
  2624. var r = i.match("^sc_tilegen_([0-9]+)$");
  2625. r && (s.tilegen = n() < parseInt(r[1]));
  2626. var l = i.match("^sc_imgopt_([0-9]+)$");
  2627. l && (s.imgopt = n() < parseInt(l[1]))
  2628. }
  2629. for (var c in t)
  2630. s[c] = t[c],
  2631. a.debug("A/B override:", c, s[c])
  2632. }
  2633. },
  2634. changeIfTileGenerating: function(e) {
  2635. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2636. e += ""),
  2637. e
  2638. },
  2639. changeIfImageOptimzing: function(e) {
  2640. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2641. e += ""),
  2642. e
  2643. },
  2644. tilegen: !1,
  2645. imgopt: !1
  2646. };
  2647. t.exports = s
  2648. }
  2649. ).call(this, "/js/ab.js")
  2650. }
  2651. , {
  2652. "./util/browser": 182,
  2653. "./util/logger": 189
  2654. }],
  2655. 4: [function(e, t, i) {
  2656. (function(i) {
  2657. "use strict";
  2658. function n() {
  2659. return {
  2660. addons: [{
  2661. name: "keen:ua_parser",
  2662. input: {
  2663. ua_string: "user_agent"
  2664. },
  2665. output: "parsed_user_agent"
  2666. }]
  2667. }
  2668. }
  2669. function r(e, t, i, n) {
  2670. function r(t) {
  2671. l[t.sid] = !0;
  2672. var i = t.billboard.media && t.billboard.media.type
  2673. , n = {
  2674. tag_id: t.sid,
  2675. tags_visited: Object.keys(l).length,
  2676. tag_count: Object.keys(e.tags).length,
  2677. tag_view_count: ++E,
  2678. has_media: !!i
  2679. };
  2680. i && (n.media_type = i),
  2681. u("tag_opened", n)
  2682. }
  2683. var l = {}
  2684. , h = Date.now() - N
  2685. , f = null;
  2686. n && (f = Date.now() - window.navigationStart);
  2687. var g;
  2688. try {
  2689. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2690. } catch (e) {
  2691. g = !1
  2692. }
  2693. var v, A = e.supportsVR;
  2694. A || (v = "VR disabled at the model/account level",
  2695. 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"))),
  2696. u("model_loaded", {
  2697. duration: h,
  2698. duration_from_navigation_start: f,
  2699. has_hlr: g,
  2700. has_vr: A,
  2701. vr_reason: v
  2702. });
  2703. var I = 0;
  2704. e.panos.forEach(function(e) {
  2705. e.on("enter", function() {
  2706. c("pano_viewed", {
  2707. pano_id: e.id,
  2708. pano_view_count: ++I,
  2709. alignment_type: e.alignmentType,
  2710. interaction_source: O,
  2711. navigation_source: p
  2712. })
  2713. })
  2714. });
  2715. var E = 0;
  2716. for (var T in e.tags)
  2717. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2718. t.on("tour_auto", function(e) {
  2719. p = "tour_" + e
  2720. }),
  2721. t.on("tour_manual", function(e) {
  2722. O = "gui-" + e,
  2723. p = "tour_manual"
  2724. }),
  2725. i.on(C.InteractionKey, function() {
  2726. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2727. }),
  2728. i.on(C.InteractionDirect, function() {
  2729. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2730. }),
  2731. o(t),
  2732. a(),
  2733. s()
  2734. }
  2735. function o(e) {
  2736. I.on(T.OPENED, function() {
  2737. c("showcase_share_intent", {
  2738. pano_id: e.currentPano && e.currentPano.id
  2739. })
  2740. }),
  2741. I.on(T.LINK_CLICKED, function(t) {
  2742. c("showcase_share_action", {
  2743. channel: t.channel,
  2744. pano_id: e.currentPano && e.currentPano.id
  2745. })
  2746. }),
  2747. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2748. c("showcase_share_origin_link_clicked")
  2749. })
  2750. }
  2751. function a() {}
  2752. function s() {
  2753. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2754. gui_action: "click_vr_button"
  2755. })),
  2756. b.on(S.LAUNCH, function(e) {
  2757. c("showcase_gui", {
  2758. gui_action: "launch_vr",
  2759. vr_platform: e.vr_platform,
  2760. vr_app: e.vr_app
  2761. })
  2762. }),
  2763. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2764. gui_action: "vr_modal_prev"
  2765. })),
  2766. b.on(S.NEXT, function(e) {
  2767. c("showcase_gui", {
  2768. gui_action: e.nextAction
  2769. })
  2770. }),
  2771. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2772. gui_action: "vr_modal_close"
  2773. })),
  2774. b.on(S.falseICECHOSEN, function(e) {
  2775. c("showcase_gui", {
  2776. gui_action: e.name + " "
  2777. })
  2778. }),
  2779. b.on(S.STORE, function(e) {
  2780. c("showcase_gui", {
  2781. gui_action: "launch_store",
  2782. store: e
  2783. })
  2784. })
  2785. }
  2786. function l(e, t) {
  2787. if (f)
  2788. try {
  2789. f.addEvent(e, v.extendObject({
  2790. host: window.location.host,
  2791. keen: n(),
  2792. user_agent: "${keen.user_agent}",
  2793. referrer: {
  2794. url: v.normalizeUrl(document.referrer),
  2795. domain: v.domainFromUrl(document.referrer),
  2796. url_original: document.referrer
  2797. },
  2798. embedded: m.inIframe(),
  2799. is_mobile: m.isMobile(),
  2800. version: "2.25.6-0-gd87e5b1"
  2801. }, t))
  2802. } catch (e) {
  2803. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2804. }
  2805. }
  2806. function c(e, t) {
  2807. if (t = t || {},
  2808. L)
  2809. try {
  2810. window.analytics.track(e, v.extendObject(t, B), {
  2811. context: {
  2812. app: {
  2813. name: "showcase",
  2814. version: "2.25.6-0-gd87e5b1"
  2815. },
  2816. screen: {
  2817. width: window.screen.width,
  2818. height: window.screen.height,
  2819. density: window.devicePixelRatio
  2820. }
  2821. }
  2822. })
  2823. } catch (t) {
  2824. console.warn("Failed to send data to segment for " + e)
  2825. }
  2826. }
  2827. function h(e, t) {
  2828. if (t = t || {},
  2829. navigator.sendBeacon && L)
  2830. try {
  2831. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2832. event: e,
  2833. anonymousId: window.analytics.user().anonymousId(),
  2834. properties: v.extendObject(t, B),
  2835. writeKey: L,
  2836. sentAt: Date.now(),
  2837. type: "track",
  2838. context: {
  2839. userAgent: m.userAgent(),
  2840. library: {
  2841. name: "showcase-beacon",
  2842. version: "2.25.6-0-gd87e5b1"
  2843. },
  2844. app: {
  2845. name: "showcase",
  2846. version: "2.25.6-0-gd87e5b1"
  2847. }
  2848. }
  2849. }))
  2850. } catch (e) {
  2851. console.warn("Failed to send async segment request")
  2852. }
  2853. }
  2854. function u(e, t) {
  2855. t = t || {},
  2856. c(e, t)
  2857. }
  2858. function d(e, t) {
  2859. O = e === C.InteractionGui ? "gui-" + t : e,
  2860. p = "self_guided"
  2861. }
  2862. var p, f, g = (e("three"),
  2863. e("./util/ajax"),
  2864. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2865. 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"),
  2866. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2867. t.exports = {
  2868. report: function(e, t, i, n) {
  2869. l("Session starts", {
  2870. model: e,
  2871. status: t,
  2872. loadtime: Date.now() - (N || Date.now()),
  2873. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2874. autoplay: i,
  2875. quickstart: n,
  2876. ab_tilegen: g.tilegen,
  2877. ab_imgopt: g.imgopt
  2878. })
  2879. },
  2880. impression: function(e) {
  2881. e = e || {};
  2882. var t = void 0 === e.isVisible || e.isVisible
  2883. , i = (void 0 !== e.immediate && e.immediate,
  2884. window.location.search.substr(1).split("&"));
  2885. u("impression", {
  2886. visible: t,
  2887. url_params: i
  2888. })
  2889. },
  2890. initKeen: function(e) {
  2891. return e.token && e.appId ? void (f = new Keen({
  2892. projectId: e.appId,
  2893. writeKey: e.token,
  2894. readKey: "",
  2895. requestType: "xhr"
  2896. })) : void P.warn("no keen token/appId")
  2897. },
  2898. initSegment: function(e) {
  2899. return e.token ? (L = e.token,
  2900. window.analytics.load(e.token),
  2901. B = {
  2902. model_id: e.model,
  2903. start_source: e.startSource,
  2904. autoplay: e.autoplay,
  2905. quickstart: e.quickstart,
  2906. language_tag: A.languageTag,
  2907. is_mobile: m.isMobile(),
  2908. iframe: m.inIframe(),
  2909. aspect_ratio: m.aspectRatio(),
  2910. session_id: F,
  2911. window: {
  2912. width: $("#player").width(),
  2913. height: $("#player").height()
  2914. },
  2915. platform: {
  2916. browser: {
  2917. name: $.ua.browser.name,
  2918. major: $.ua.browser.major,
  2919. version: $.ua.browser.version
  2920. },
  2921. os: {
  2922. name: $.ua.os.name,
  2923. version: $.ua.os.version
  2924. },
  2925. device: {
  2926. vendor: $.ua.device.vendor,
  2927. model: $.ua.device.model,
  2928. type: $.ua.device.type
  2929. }
  2930. }
  2931. },
  2932. D = Math.random() < A.analytics.sessionTrackingRate,
  2933. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2934. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2935. },
  2936. sessionStart: function(e) {
  2937. P.debug("analytics user_session_start"),
  2938. c("session_started"),
  2939. N = Date.now(),
  2940. window.addEventListener("unload", function() {
  2941. h("session_ended", {
  2942. duration: Date.now() - N
  2943. })
  2944. })
  2945. },
  2946. modelLoaded: function(e, t, i, n) {
  2947. r(e, t, i, n)
  2948. },
  2949. loadComplete: function(e) {
  2950. var t = {
  2951. time_to_app_start: e
  2952. };
  2953. c("load_times", t)
  2954. },
  2955. track: function(e, t) {
  2956. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2957. c(e, t))
  2958. },
  2959. trackAlways: function(e, t) {
  2960. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2961. c(e, t)
  2962. },
  2963. getSessionId: function() {
  2964. return F
  2965. },
  2966. updateInteraction: d
  2967. }
  2968. }
  2969. ).call(this, "/js/analytics.js")
  2970. }
  2971. , {
  2972. "./ab": 3,
  2973. "./enum/ControlEvents": 21,
  2974. "./enum/PlayerEvents": 40,
  2975. "./enum/VROption": 47,
  2976. "./enum/VRPlatforms": 49,
  2977. "./enum/Viewmode": 51,
  2978. "./gui/sharing/ShareEvents": 76,
  2979. "./gui/sharing/modal": 77,
  2980. "./gui/title/TitleEvents": 80,
  2981. "./gui/title/titleBar": 82,
  2982. "./gui/vr/vrEvent": 85,
  2983. "./gui/vr/vrModal": 87,
  2984. "./localization/localize": 108,
  2985. "./tag/Billboard/BillboardEvent": 120,
  2986. "./settings": 166,
  2987. "./util/ajax": 181,
  2988. "./util/browser": 182,
  2989. "./util/common": 185,
  2990. "./util/logger": 189,
  2991. three: 217
  2992. }],
  2993. 5: [function(e, t, i) {
  2994. "use strict";
  2995. function n() {
  2996. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2997. this.controls = null
  2998. }
  2999. var r = e("three")
  3000. , o = e("../constants")
  3001. , a = e("../util/cameraLight");
  3002. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3003. n.prototype.updateAspect = function(e) {
  3004. this.aspect = e,
  3005. this.updateProjectionMatrix()
  3006. }
  3007. ,
  3008. t.exports = n
  3009. }
  3010. , {
  3011. "../constants": 8,
  3012. "../util/cameraLight": 184,
  3013. three: 217
  3014. }],
  3015. 6: [function(e, t, i) {
  3016. "use strict";
  3017. function n() {
  3018. var e = $("#player").width() / $("#player").height();
  3019. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3020. this.controls = null,
  3021. this.updateAspect(e)
  3022. }
  3023. var r = e("three")
  3024. , o = e("../constants");
  3025. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3026. n.prototype.updateAspect = function(e) {
  3027. this.aspect = e,
  3028. this.top = o.orthoBase / e,
  3029. this.bottom = -o.orthoBase / e,
  3030. this.updateProjectionMatrix()
  3031. }
  3032. ,
  3033. t.exports = n
  3034. }
  3035. , {
  3036. "../constants": 8,
  3037. three: 217
  3038. }],
  3039. 7: [function(e, t, i) {
  3040. "use strict";
  3041. function n() {
  3042. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3043. this.controls = null
  3044. }
  3045. var r = e("three")
  3046. , o = e("../settings")
  3047. , a = e("../util/cameraLight");
  3048. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3049. n.prototype.updateAspect = function(e) {
  3050. this.aspect = e,
  3051. this.updateProjectionMatrix()
  3052. }
  3053. ,
  3054. t.exports = n
  3055. }
  3056. , {
  3057. "../settings": 166,
  3058. "../util/cameraLight": 184,
  3059. three: 217
  3060. }],
  3061. 8: [function(e, t, i) {
  3062. "use strict";
  3063. t.exports = {
  3064. signedUrlDefaultExpireTime: 24e4,
  3065. signedUrlCheckInterval: 1e4,
  3066. signedUrlRefreshBuffer: 15e3,
  3067. dollhouseFOV: 70,
  3068. dollhouseNear: 1,
  3069. dollhouseFar: 5e3,
  3070. insideFOV: 70,
  3071. insideFOVMax: 120,
  3072. insideNear: .1,
  3073. insideFar: 5e3,
  3074. insideLookSpeed: .12,
  3075. insideLookLimitUp: 40, //视角
  3076. insideLookLimitDown: -40,
  3077. orthoNear: 1,
  3078. orthoFar: 5e3,
  3079. orthoBase: 10,
  3080. narrowLandscapeHeight: 290,
  3081. reallyNarrowLandscapeHeight: 250,
  3082. visionTilingStartDate: new Date("8/26/2016"),
  3083. visionTilingStartVersion: "1.1.407.13667",
  3084. windowHeightHighQualityThreshold: 900,
  3085. tourStepDelayDefault: 3500,
  3086. tourStepDelaySlideShow: 5e3,
  3087. workshopApsect: 9 / 16,
  3088. highQualityMaxZoom: 2,
  3089. ultraHighQualityMaxZoom: 3
  3090. }
  3091. }
  3092. , {}],
  3093. 9: [function(e, t, i) {
  3094. "use strict";
  3095. function n() {
  3096. this.activeControl = null,
  3097. this.controls = {},
  3098. this.cameras = {}
  3099. }
  3100. var r = e("./PanoramaControls")
  3101. , o = e("./DollhouseControls")
  3102. , a = e("./FloorplanControls")
  3103. , s = e("../cameras/PanoramaCamera")
  3104. , l = e("../cameras/DollhouseCamera")
  3105. , c = e("../cameras/FloorplanCamera")
  3106. , h = e("events").EventEmitter
  3107. , u = e("../enum/ControlEvents")
  3108. , d = e("../enum/ModelManagerEvents")
  3109. , p = e("../enum/Viewmode")
  3110. , f = e("../settings");
  3111. n.prototype = Object.create(h.prototype),
  3112. n.prototype.init = function(e, t) {
  3113. this.setUpControls(),
  3114. this.bindEvents(e, t)
  3115. }
  3116. ,
  3117. n.prototype.activateControls = function(e) {
  3118. this.activeControl && (this.activeControl.reset(),
  3119. this.activeControl.enabled = !1),
  3120. this.controls[e] && (this.controls[e].enabled = !0),
  3121. this.activeControl = this.controls[e]
  3122. }
  3123. ,
  3124. n.prototype.setUpControls = function() {
  3125. var e = {}
  3126. , t = {}
  3127. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3128. , n = [s, l, c]
  3129. , h = [r, o, a];
  3130. i.forEach(function(i, r) {
  3131. e[i] = new n[r],
  3132. t[i] = new h[r](e[i]),
  3133. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3134. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3135. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3136. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3137. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3138. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3139. }
  3140. .bind(this)),
  3141. this.controls = t,
  3142. this.cameras = e
  3143. }
  3144. ,
  3145. n.prototype.bindEvents = function(e, t) {
  3146. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3147. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3148. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3149. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3150. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this),{ passive: false }),
  3151. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3152. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3153. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3154. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3155. e.addEventListener("contextmenu", function(e) {
  3156. e.preventDefault()
  3157. }),
  3158. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3159. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3160. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3161. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3162. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3163. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3164. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3165. t.on(d.ActiveModelChanged, function(e) {
  3166. this.setModelForControls(e.model)
  3167. }
  3168. .bind(this))
  3169. }
  3170. ,
  3171. n.prototype.setModelForControls = function(e) {
  3172. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3173. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3174. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3175. this.controls[e].setBounds(t)
  3176. }
  3177. .bind(this))
  3178. }
  3179. ,
  3180. n.prototype.onMouseDown = function(e) {
  3181. e.preventDefault(),
  3182. this.activeControl && this.activeControl.onMouseDown(e)
  3183. }
  3184. ,
  3185. n.prototype.onMouseMove = function(e) {
  3186. e.preventDefault(),
  3187. this.activeControl && this.activeControl.onMouseMove(e)
  3188. }
  3189. ,
  3190. n.prototype.onMouseUp = function(e) {
  3191. e.preventDefault(),
  3192. this.activeControl && this.activeControl.onMouseUp(e)
  3193. }
  3194. ,
  3195. n.prototype.onMouseOver = function(e) {
  3196. e.preventDefault(),
  3197. this.activeControl && this.activeControl.onMouseOver(e)
  3198. }
  3199. ,
  3200. n.prototype.onMouseWheel = function(e) {
  3201. e.preventDefault(),
  3202. this.activeControl && this.activeControl.onMouseWheel(e)
  3203. }
  3204. ,
  3205. n.prototype.onTouchStart = function(e) {
  3206. e.preventDefault(),
  3207. this.activeControl && this.activeControl.onTouchStart(e);
  3208. var hotList = $('#hotListWrap')[0];
  3209. hotList.classList.remove('hotListActive');
  3210. $('#hotListContent ul .active').removeClass('active');
  3211. $('#hotList')[0].classList.remove('active')
  3212. }
  3213. ,
  3214. n.prototype.onTouchMove = function(e) {
  3215. e.preventDefault(),
  3216. this.activeControl && this.activeControl.onTouchMove(e)
  3217. }
  3218. ,
  3219. n.prototype.onTouchEnd = function(e) {
  3220. e.preventDefault(),
  3221. this.activeControl && this.activeControl.onTouchEnd(e)
  3222. }
  3223. ,
  3224. n.prototype.onPointerDown = function(e) {
  3225. if (e.preventDefault(),
  3226. this.activeControl)
  3227. switch (e.pointerType) {
  3228. case "mouse":
  3229. this.activeControl.onMouseDown(e);
  3230. break;
  3231. default:
  3232. this.activeControl.onPointerDown(e)
  3233. }
  3234. }
  3235. ,
  3236. n.prototype.onPointerMove = function(e) {
  3237. if (e.preventDefault(),
  3238. this.activeControl)
  3239. switch (e.pointerType) {
  3240. case "mouse":
  3241. this.activeControl.onMouseMove(e);
  3242. break;
  3243. default:
  3244. this.activeControl.onPointerMove(e)
  3245. }
  3246. }
  3247. ,
  3248. n.prototype.onPointerUp = function(e) {
  3249. if (e.preventDefault(),
  3250. this.activeControl)
  3251. switch (e.pointerType) {
  3252. case "mouse":
  3253. this.activeControl.onMouseUp(e);
  3254. break;
  3255. default:
  3256. this.activeControl.onPointerUp(e)
  3257. }
  3258. }
  3259. ,
  3260. n.prototype.onPointerCancel = function(e) {
  3261. e.preventDefault(),
  3262. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3263. }
  3264. ,
  3265. n.prototype.onKeyDown = function(e) {
  3266. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3267. this.activeControl && this.activeControl.onKeyDown(e))
  3268. }
  3269. ,
  3270. n.prototype.onKeyUp = function(e) {
  3271. e.preventDefault(),
  3272. this.activeControl && this.activeControl.onKeyUp(e)
  3273. }
  3274. ,
  3275. t.exports = n
  3276. }
  3277. , {
  3278. "../cameras/DollhouseCamera": 5,
  3279. "../cameras/FloorplanCamera": 6,
  3280. "../cameras/PanoramaCamera": 7,
  3281. "../enum/ControlEvents": 21,
  3282. "../enum/ModelManagerEvents": 33,
  3283. "../enum/Viewmode": 51,
  3284. "../settings": 166,
  3285. "./DollhouseControls": 10,
  3286. "./FloorplanControls": 11,
  3287. "./PanoramaControls": 13,
  3288. events: 202
  3289. }],
  3290. 10: [function(e, t, i) {
  3291. "use strict";
  3292. function n(e) {
  3293. a.call(this, e),
  3294. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3295. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3296. this.minDistance = o.dollhouseDefault.minDistance,
  3297. this.maxDistance = o.dollhouseDefault.maxDistance,
  3298. this.adjustedMinDistance = this.minDistance,
  3299. this.adjustedMaxDistance = this.maxDistance
  3300. }
  3301. var r = e("three")
  3302. , o = e("../settings")
  3303. , a = e("./OutsideControls");
  3304. n.prototype = Object.create(a.prototype),
  3305. n.prototype.pan = function(e, t) {
  3306. this.camera.updateMatrix();
  3307. var i = this.camera.position.clone().sub(this.target).length();
  3308. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3309. this.panLeft(2 * e * i / $("#player").height()),
  3310. this.panUp(-2 * t * i / $("#player").height())
  3311. }
  3312. ,
  3313. n.prototype.updateZoom = function() {
  3314. var e = this.offset.length();
  3315. return e * this.scale
  3316. }
  3317. ,
  3318. n.prototype.setZoomBounds = function(e) {
  3319. var t = e.min.distanceTo(e.max);
  3320. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3321. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3322. this.minDistance = this.adjustedMinDistance,
  3323. this.maxDistance = this.adjustedMaxDistance
  3324. }
  3325. ,
  3326. n.prototype.resetRanges = function(e, t) {
  3327. e ? (this.minDistance = Math.min(e, this.minDistance),
  3328. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3329. this.maxDistance = this.adjustedMaxDistance),
  3330. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3331. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3332. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3333. }
  3334. ,
  3335. n.prototype.toJSON = function() {
  3336. return a.prototype.toJSON.call(this)
  3337. }
  3338. ,
  3339. t.exports = n
  3340. }
  3341. , {
  3342. "../settings": 166,
  3343. "./OutsideControls": 12,
  3344. three: 217
  3345. }],
  3346. 11: [function(e, t, i) {
  3347. "use strict";
  3348. function n(e) {
  3349. a.call(this, e),
  3350. this.minDistance = 15,
  3351. this.maxDistance = 50,
  3352. this.noRotateUpDown = !0,
  3353. this.minPolarAngle = 0,
  3354. this.maxPolarAngle = 0,
  3355. this.mouseActions[l.LEFT] = s.PAN,
  3356. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3357. this.mouseActions[l.RIGHT] = s.ROTATE,
  3358. this.touchActions[1] = s.PAN,
  3359. this.touchActions[2] = s.ROTATE_DOLLY,
  3360. this.absoluteScale = 1,
  3361. this.currentScale = 1
  3362. }
  3363. var r = e("three")
  3364. , o = e("../settings")
  3365. , a = e("./OutsideControls")
  3366. , s = e("../enum/ControlActions")
  3367. , l = e("../enum/MouseButton")
  3368. , c = e("../util/math")
  3369. , h = e("../util/browser");
  3370. n.prototype = Object.create(a.prototype),
  3371. n.prototype.zoomToContain = function(e) {
  3372. this.absoluteScale = this.getDefaultAbsoluteScale(e);
  3373. this.currentScale = this.absoluteScale
  3374. }
  3375. ,
  3376. n.prototype.getDefaultAbsoluteScale = function(modelSize, ratio) {
  3377. let defaultRatio = 1.2 , absoluteScale
  3378. if(_settings.floorPlanAngle){//指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3379. var angle = parseFloat(_settings.floorPlanAngle)
  3380. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3381. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3382. var screenSize = Math.min($("#player").width(), $("#player").height())
  3383. var maxSize = 800;//模型最大占据像素
  3384. ratio = ratio != void 0 ? ratio : Math.max(screenSize * defaultRatio / maxSize, defaultRatio) ;
  3385. absoluteScale = n / 2 / o.orthoBase * ratio; //根据模型所占最大视口尺寸调整缩放
  3386. }else{
  3387. var t = Math.max(modelSize.x, modelSize.z)
  3388. , i = Math.min(modelSize.x, modelSize.z)
  3389. , n = Math.max(t, i * this.camera.aspect)
  3390. , r = Math.max(i, t * this.camera.aspect);
  3391. absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * defaultRatio
  3392. }
  3393. return absoluteScale
  3394. },
  3395. /* n.prototype.rotateToView = function(e, t) {
  3396. var i = 0
  3397. , n = h.aspectRatio() < 1
  3398. , r = e.x < e.z;
  3399. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3400. this.rotateLeft(i),
  3401. this.update(0)
  3402. },
  3403. */
  3404. n.prototype.rotateToView = function(modelSize, direction) {
  3405. let i = 0, n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3406. if(_settings.floorPlanAngle ){//规定了cadImage旋转值的话 (0是无效的,将不设置)
  3407. i = parseFloat(_settings.floorPlanAngle)
  3408. }else{
  3409. let r = modelSize.x < modelSize.z; //是否视口为“窄屏”
  3410. if(n === r) //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3411. {
  3412. if(direction.z > 0) //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3413. {
  3414. i = Math.PI; //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3415. }
  3416. //(第二种情况) 不做处理
  3417. }
  3418. else if(direction.x > 0)
  3419. {
  3420. i = Math.PI / 2;
  3421. }
  3422. else
  3423. {
  3424. i = -Math.PI / 2;
  3425. }
  3426. }
  3427. if(_settings.angleShift2d){
  3428. i += THREE.Math.degToRad(_settings.angleShift2d)
  3429. }
  3430. this.rotateLeft(i);
  3431. this.update(0);
  3432. }
  3433. ,
  3434. n.prototype.rotateToAngle = function(angle){//add 旋转到特定角度
  3435. this.rotateLeft(angle + this.lon);
  3436. this.update(0);
  3437. }
  3438. ,
  3439. n.prototype.pan = function(e, t) {
  3440. this.camera.updateMatrix(),
  3441. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3442. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3443. }
  3444. ,
  3445. n.prototype.updateZoom = function() {
  3446. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3447. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3448. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3449. this.camera.left = -o.orthoBase * this.currentScale,
  3450. this.camera.right = o.orthoBase * this.currentScale,
  3451. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3452. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3453. this.camera.updateProjectionMatrix(),
  3454. this.offset.length()
  3455. }
  3456. ,
  3457. n.prototype.toJSON = function() {
  3458. var e = new r.Quaternion
  3459. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3460. , i = new r.Quaternion;
  3461. return function() {
  3462. var n = a.prototype.toJSON.call(this);
  3463. return e.copy(n.camera_quaternion),
  3464. i.copy(t),
  3465. i.multiply(e),
  3466. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3467. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3468. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3469. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3470. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3471. n
  3472. }
  3473. }(),
  3474. t.exports = n
  3475. }
  3476. , {
  3477. "../enum/ControlActions": 20,
  3478. "../enum/MouseButton": 34,
  3479. "../settings": 166,
  3480. "../util/browser": 182,
  3481. "../util/math": 190,
  3482. "./OutsideControls": 12,
  3483. three: 217
  3484. }],
  3485. 12: [function(e, t, i) {
  3486. "use strict";
  3487. function n(e) {
  3488. this.camera = e,
  3489. this.camera.controls = this,
  3490. this.enabled = !1,
  3491. this.target = new r.Vector3,
  3492. this.targetBounds = new r.Box3,
  3493. this.zoomSpeed = 1,
  3494. this.minDistance = 0,
  3495. this.maxDistance = 1 / 0,
  3496. this.noRotateUpDown = !1,
  3497. this.rotateSpeed = 1,
  3498. this.keyboardZoomSpeed = 0,
  3499. this.keyPanSpeed = 7,
  3500. this.autoRotate = !1,
  3501. this.autoRotateSpeed = 2,
  3502. this.autoPan = !1,
  3503. this.autoPanPosition = new r.Vector3,
  3504. this.minPolarAngle = r.Math.degToRad(25),
  3505. this.maxPolarAngle = r.Math.degToRad(65),
  3506. this.rotationAcceleration = new r.Vector2,
  3507. this.rotationSpeed = new r.Vector2,
  3508. this.panAcceleration = new r.Vector2,
  3509. this.panSpeed = new r.Vector2,
  3510. this.rotateStart = new r.Vector2,
  3511. this.rotateEnd = new r.Vector2,
  3512. this.rotateDelta = new r.Vector2,
  3513. this.panStart = new r.Vector2,
  3514. this.panEnd = new r.Vector2,
  3515. this.panDelta = new r.Vector2,
  3516. this.panOffset = new r.Vector3,
  3517. this.offset = new r.Vector3,
  3518. this.dollyStart = new r.Vector2,
  3519. this.dollyEnd = new r.Vector2,
  3520. this.dollyDelta = new r.Vector2,
  3521. this.phiDelta = 0,
  3522. this.thetaDelta = 0,
  3523. this.scale = 1,
  3524. this.panVector = new r.Vector3,
  3525. this.lastPosition = new r.Vector3,
  3526. this.state = c.NONE,
  3527. this.mouseActions = {},
  3528. this.mouseActions[h.LEFT] = c.ROTATE,
  3529. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3530. this.mouseActions[h.RIGHT] = c.PAN,
  3531. this.touchActions = {},
  3532. this.touchActions[1] = c.ROTATE,
  3533. this.touchActions[2] = c.PAN_DOLLY,
  3534. this.lastMoveTime = 0,
  3535. this.pointersLimit = 2,
  3536. this.pointers = []
  3537. }
  3538. var r = e("three")
  3539. , o = e("../settings")
  3540. , a = e("../util/common")
  3541. , s = e("../util/math")
  3542. , l = e("../enum/Vectors")
  3543. , c = e("../enum/ControlActions")
  3544. , h = e("../enum/MouseButton")
  3545. , u = e("../enum/Keys")
  3546. , d = e("../enum/ControlEvents")
  3547. , p = e("events").EventEmitter
  3548. , f = 1e-6;
  3549. n.prototype = Object.create(p.prototype),
  3550. n.prototype.setBounds = function(e) {
  3551. this.targetBounds = e
  3552. }
  3553. ,
  3554. n.prototype.isEngaged = function() {
  3555. return this.state !== c.NONE
  3556. }
  3557. ,
  3558. n.prototype.rotateLeft = function(e) {
  3559. void 0 === e && (e = this.getAutoRotationAngle()),
  3560. this.thetaDelta -= e
  3561. }
  3562. ,
  3563. n.prototype.rotateUp = function(e) {
  3564. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3565. this.phiDelta -= e)
  3566. }
  3567. ,
  3568. n.prototype.panLeft = function(e) {
  3569. var t = this.camera.matrix.elements;
  3570. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3571. this.panOffset.multiplyScalar(-e),
  3572. this.panVector.add(this.panOffset)
  3573. }
  3574. ,
  3575. n.prototype.panUp = function(e) {
  3576. var t = this.camera.matrix.elements;
  3577. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3578. this.panOffset.multiplyScalar(-e),
  3579. this.panVector.add(this.panOffset)
  3580. }
  3581. ,
  3582. n.prototype.startRotating = function(e, t) {
  3583. e && this.navRotationAcc("x", e),
  3584. t && this.navRotationAcc("y", t)
  3585. }
  3586. ,
  3587. n.prototype.stopRotating = function(e) {
  3588. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3589. this.navRotationAcc("x", 0),
  3590. this.navRotationAcc("y", 0)
  3591. }
  3592. ,
  3593. n.prototype.setAutoPanPosition = function(e, t) {
  3594. var i = new r.Vector3
  3595. , n = new r.Vector3;
  3596. return function(e, t) {
  3597. i.copy(this.camera.position),
  3598. void 0 === e && null === e || i.setX(e),
  3599. void 0 === t && null === t || i.setZ(t);
  3600. var r = this.camera.position.distanceTo(this.target)
  3601. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3602. this.targetClamped = !1,
  3603. n.copy(i).addScaledVector(o, r),
  3604. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3605. i.copy(n).addScaledVector(o, -r),
  3606. this.targetClamped = !0),
  3607. this.autoPanPosition.x = i.x,
  3608. this.autoPanPosition.z = i.z,
  3609. this.autoPan && this.stopAutoPanning()
  3610. }
  3611. }(),
  3612. n.prototype.stopAutoPanning = function() {
  3613. var e = this.autoPan;
  3614. this.autoPan = !1,
  3615. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3616. }
  3617. ,
  3618. n.prototype.dollyIn = function(e) {
  3619. void 0 === e && (e = this.getZoomScale()),
  3620. this.scale /= e
  3621. }
  3622. ,
  3623. n.prototype.dollyOut = function(e) {
  3624. void 0 === e && (e = this.getZoomScale()),
  3625. this.scale *= e
  3626. }
  3627. ,
  3628. n.prototype.updatePan = function(e) {
  3629. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3630. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3631. this.autoPan) {
  3632. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3633. t.setY(0).clampLength(0, 50 * e),
  3634. this.target.add(t),
  3635. this.camera.position.add(t),
  3636. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3637. this.stopAutoPanning())
  3638. }
  3639. }
  3640. ,
  3641. n.prototype.update = function(e) {
  3642. e || (e = 1 / 60)
  3643. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  3644. this.rotationSpeed.multiplyScalar(1 - friction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3645. this.rotateLeft(-this.rotationSpeed.x),
  3646. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3647. this.updatePan(e);
  3648. var t = this.camera.position;
  3649. this.offset.copy(t).sub(this.target);
  3650. var i = Math.atan2(this.offset.x, this.offset.z)
  3651. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3652. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3653. i += this.thetaDelta,
  3654. n += this.phiDelta,
  3655. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3656. n = Math.max(f, Math.min(Math.PI - f, n));
  3657. this.lon = i, this.lat = n//add
  3658. var r = this.updateZoom();
  3659. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3660. this.target.add(this.panVector),
  3661. this.targetBounds.clampPoint(this.target, this.target),
  3662. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3663. this.offset.y = r * Math.cos(n),
  3664. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3665. t.copy(this.target).add(this.offset),
  3666. this.camera.lookAt(this.target),
  3667. this.thetaDelta = 0,
  3668. this.phiDelta = 0,
  3669. this.scale = 1,
  3670. this.panVector.set(0, 0, 0),
  3671. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3672. }
  3673. ,
  3674. n.prototype.getAutoRotationAngle = function() {
  3675. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3676. }
  3677. ,
  3678. n.prototype.getZoomScale = function() {
  3679. return Math.pow(.95, this.zoomSpeed)
  3680. }
  3681. ,
  3682. n.prototype.onMouseDown = function(e) {
  3683. if (this.enabled) {
  3684. switch (e.preventDefault(),
  3685. this.stopAutoPanning(),
  3686. this.mouseDown = !0,
  3687. this.state = this.mouseActions[e.button],
  3688. this.state) {
  3689. case c.ROTATE:
  3690. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3691. this.rotationSpeed.set(0, 0);
  3692. break;
  3693. case c.DOLLY:
  3694. this.dollyStart.set(e.clientX, e.clientY);
  3695. break;
  3696. case c.PAN:
  3697. this.panStart.set(e.clientX, e.clientY)
  3698. }
  3699. this.emit(d.InputStart, "mouse")
  3700. }
  3701. }
  3702. ,
  3703. n.prototype.onMouseMove = function(e) {
  3704. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3705. switch (e.preventDefault(),
  3706. this.state) {
  3707. case c.ROTATE:
  3708. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3709. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3710. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3711. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3712. this.rotateStart.copy(this.rotateEnd);
  3713. break;
  3714. case c.DOLLY:
  3715. this.dollyEnd.set(e.clientX, e.clientY),
  3716. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3717. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3718. t.call(this),
  3719. this.dollyStart.copy(this.dollyEnd);
  3720. break;
  3721. case c.PAN:
  3722. this.panEnd.set(e.clientX, e.clientY),
  3723. this.panDelta.subVectors(this.panEnd, this.panStart),
  3724. this.pan(this.panDelta.x, this.panDelta.y),
  3725. this.panStart.copy(this.panEnd)
  3726. }
  3727. this.emit(d.Move, "mouse"),
  3728. this.lastMoveTime = e.timeStamp,
  3729. this.update()
  3730. }
  3731. }
  3732. ,
  3733. n.prototype.onMouseUp = function(e) {
  3734. this.enabled && (this.mouseDown = !1,
  3735. this.state = c.NONE,
  3736. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3737. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3738. this.update(),
  3739. this.rotationAcceleration.set(0, 0),
  3740. this.rotateDelta.set(0, 0)))
  3741. }
  3742. ,
  3743. n.prototype.onMouseOver = function(e) {
  3744. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3745. }
  3746. ,
  3747. n.prototype.onMouseWheel = function(e) {
  3748. if (this.enabled && o.useWheel) {
  3749. this.emit(d.Move, "wheel");
  3750. var t = e.wheelDelta || -e.detail
  3751. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3752. i.call(this),
  3753. this.update()
  3754. }
  3755. }
  3756. ,
  3757. n.prototype.onKeyDown = function(e) {
  3758. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3759. this.handleKeyDown(e.which)))
  3760. }
  3761. ,
  3762. n.prototype.navRotationAcc = function(e, t) {
  3763. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3764. }
  3765. ,
  3766. n.prototype.navPanAcc = function(e, t) {
  3767. this.stopAutoPanning(),
  3768. this.panAcceleration[e] = t
  3769. }
  3770. ,
  3771. n.prototype.handleKeyDown = function(e) {
  3772. var t = !0;
  3773. switch (e) {
  3774. case u.UPARROW:
  3775. case u.I:
  3776. this.navRotationAcc("y", 1);
  3777. break;
  3778. case u.DOWNARROW:
  3779. case u.K:
  3780. this.navRotationAcc("y", -1);
  3781. break;
  3782. case u.LEFTARROW:
  3783. case u.J:
  3784. this.navRotationAcc("x", -1);
  3785. break;
  3786. case u.RIGHTARROW:
  3787. case u.L:
  3788. this.navRotationAcc("x", 1);
  3789. break;
  3790. case u.W:
  3791. this.navPanAcc("y", 1);
  3792. break;
  3793. case u.S:
  3794. this.navPanAcc("y", -1);
  3795. break;
  3796. case u.A:
  3797. this.navPanAcc("x", -1);
  3798. break;
  3799. case u.D:
  3800. this.navPanAcc("x", 1);
  3801. break;
  3802. default:
  3803. t = !1
  3804. }
  3805. t && this.emit(d.Move, "key")
  3806. }
  3807. ,
  3808. n.prototype.onKeyUp = function(e) {
  3809. this.enabled && (e.preventDefault(),
  3810. e.stopPropagation(),
  3811. this.handleKeyUp(e.which))
  3812. }
  3813. ,
  3814. n.prototype.handleKeyUp = function(e) {
  3815. switch (e) {
  3816. case u.I:
  3817. case u.K:
  3818. case u.UPARROW:
  3819. case u.DOWNARROW:
  3820. this.keyboardZoomSpeed = 0,
  3821. this.rotationAcceleration.y = 0;
  3822. break;
  3823. case u.J:
  3824. case u.L:
  3825. case u.LEFTARROW:
  3826. case u.RIGHTARROW:
  3827. this.rotationAcceleration.x = 0;
  3828. break;
  3829. case u.S:
  3830. case u.W:
  3831. this.panAcceleration.y = 0;
  3832. break;
  3833. case u.A:
  3834. case u.D:
  3835. this.panAcceleration.x = 0
  3836. }
  3837. }
  3838. ,
  3839. n.prototype.onTouchStart = function(e) {
  3840. if (this.enabled || this.state === c.NONE) {
  3841. e.preventDefault(),
  3842. e.stopPropagation(),
  3843. this.stopAutoPanning();
  3844. var t = function() {
  3845. if (2 === e.touches.length) {
  3846. var t = e.touches[0].pageX - e.touches[1].pageX
  3847. , i = e.touches[0].pageY - e.touches[1].pageY;
  3848. this.dollyStart.set(t, i)
  3849. }
  3850. }
  3851. .bind(this)
  3852. , i = function() {
  3853. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3854. }
  3855. .bind(this)
  3856. , n = function() {
  3857. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3858. }
  3859. .bind(this);
  3860. switch (this.state = this.touchActions[e.touches.length],
  3861. this.state) {
  3862. case c.PAN_DOLLY:
  3863. t();
  3864. case c.PAN:
  3865. i();
  3866. break;
  3867. case c.ROTATE_DOLLY:
  3868. t();
  3869. case c.ROTATE:
  3870. n()
  3871. }
  3872. this.rotationSpeed.set(0, 0),
  3873. this.emit(d.InputStart, "touch")
  3874. }
  3875. }
  3876. ,
  3877. n.prototype.onTouchMove = function(e) {
  3878. if (this.enabled && this.state !== c.NONE) {
  3879. e.preventDefault(),
  3880. e.stopPropagation();
  3881. var t = function() {
  3882. var t = e.touches[0].pageX - e.touches[1].pageX
  3883. , i = e.touches[0].pageY - e.touches[1].pageY;
  3884. this.dollyEnd.set(t, i);
  3885. var n = this.dollyStart.length() - this.dollyEnd.length();
  3886. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3887. this.dollyStart.copy(this.dollyEnd)
  3888. }
  3889. .bind(this)
  3890. , i = function() {
  3891. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3892. this.panDelta.subVectors(this.panEnd, this.panStart),
  3893. this.pan(this.panDelta.x, this.panDelta.y),
  3894. this.panStart.copy(this.panEnd),
  3895. this.rotateDelta.set(0, 0)
  3896. }
  3897. .bind(this)
  3898. , n = function() {
  3899. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3900. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3901. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3902. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3903. this.rotateStart.copy(this.rotateEnd)
  3904. }
  3905. .bind(this)
  3906. , r = function() {
  3907. if (2 === e.touches.length) {
  3908. var i = window.devicePixelRatio || 1
  3909. , r = e.touches[1].pageX - e.touches[0].pageX
  3910. , s = e.touches[1].pageY - e.touches[0].pageY
  3911. , l = Math.sqrt(r * r + s * s)
  3912. , h = Math.abs(this.dollyStart.length() - l);
  3913. if (h > o.input.touchMoveThreshold * i)
  3914. this.state = c.DOLLY,
  3915. t();
  3916. else {
  3917. var u = a.average(e.touches, "pageX")
  3918. , d = a.average(e.touches, "pageY")
  3919. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3920. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3921. this.rotateStart.set(u, d),
  3922. n())
  3923. }
  3924. }
  3925. }
  3926. .bind(this);
  3927. switch (this.state) {
  3928. case c.PAN_DOLLY:
  3929. t();
  3930. case c.PAN:
  3931. i();
  3932. break;
  3933. case c.ROTATE_DOLLY:
  3934. r();
  3935. break;
  3936. case c.DOLLY:
  3937. t();
  3938. break;
  3939. case c.ROTATE:
  3940. n();
  3941. break;
  3942. default:
  3943. this.state = c.NONE
  3944. }
  3945. this.lastMoveTime = e.timeStamp,
  3946. this.emit(d.Move, "touch")
  3947. }
  3948. }
  3949. ,
  3950. n.prototype.onTouchEnd = function(e) {
  3951. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3952. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3953. this.state = c.NONE,
  3954. this.update(),
  3955. this.rotationAcceleration.set(0, 0),
  3956. this.rotateDelta.set(0, 0))
  3957. }
  3958. ,
  3959. n.prototype.onPointerDown = function(e) {
  3960. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3961. id: e.pointerId,
  3962. pageX: e.pageX,
  3963. pageY: e.pageY
  3964. }),
  3965. e.touches = this.pointers,
  3966. this.onTouchStart(e)),
  3967. this.emit(d.InputStart, "pointer"))
  3968. }
  3969. ,
  3970. n.prototype.onPointerMove = function(e) {
  3971. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3972. e.pointerId === t.id && (t.pageX = e.pageX,
  3973. t.pageY = e.pageY)
  3974. }),
  3975. e.touches = this.pointers,
  3976. this.onTouchMove(e))
  3977. }
  3978. ,
  3979. n.prototype.onPointerUp = function(e) {
  3980. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3981. e.pointerId === t.id && this.pointers.splice(i, 1)
  3982. }
  3983. .bind(this)),
  3984. e.touches = this.pointers,
  3985. this.onTouchEnd(e))
  3986. }
  3987. ,
  3988. n.prototype.reset = function() {
  3989. this.state = c.NONE,
  3990. this.stopAutoPanning(),
  3991. this.rotationSpeed.set(0, 0),
  3992. this.rotationAcceleration.set(0, 0),
  3993. this.panSpeed.set(0, 0),
  3994. this.panAcceleration.set(0, 0)
  3995. }
  3996. ,
  3997. n.prototype.toJSON = function() {
  3998. var e = {
  3999. camera_position: {
  4000. x: s.toPrecision(this.camera.position.x, 4),
  4001. y: s.toPrecision(this.camera.position.y, 4),
  4002. z: s.toPrecision(this.camera.position.z, 4)
  4003. },
  4004. camera_quaternion: {
  4005. x: s.toPrecision(this.camera.quaternion.x, 4),
  4006. y: s.toPrecision(this.camera.quaternion.y, 4),
  4007. z: s.toPrecision(this.camera.quaternion.z, 4),
  4008. w: s.toPrecision(this.camera.quaternion.w, 4)
  4009. }
  4010. };
  4011. return e
  4012. }
  4013. ,
  4014. t.exports = n
  4015. }
  4016. , {
  4017. "../enum/ControlActions": 20,
  4018. "../enum/ControlEvents": 21,
  4019. "../enum/Keys": 30,
  4020. "../enum/MouseButton": 34,
  4021. "../enum/Vectors": 50,
  4022. "../settings": 166,
  4023. "../util/common": 185,
  4024. "../util/math": 190,
  4025. events: 202,
  4026. three: 217
  4027. }],
  4028. 13: [function(e, t, i) {
  4029. (function(i) {
  4030. "use strict";
  4031. function n(e) {
  4032. this.camera = e,
  4033. this.camera.controls = this,
  4034. this.target = new r.Vector3(0,0,0),
  4035. this.lookVector = new r.Vector3,
  4036. this.lookSpeed = .05,
  4037. this.rotationAcc = new r.Vector2,
  4038. this.rotationSpeed = new r.Vector2,
  4039. this.lat = 0,
  4040. this.lon = 0,
  4041. this.phi = 0,
  4042. this.theta = 0,
  4043. this.enabled = !1,
  4044. this.locked = !1,
  4045. this.pointer = new r.Vector2(0,0),
  4046. this.rotationHistory = [],
  4047. this.rotationDifference = new r.Vector2,
  4048. this.pointerDragOn = !1,
  4049. this.pointerDragStart = new r.Vector2(0,0),
  4050. this.pinchDistance = 0,
  4051. this.moveStart = new r.Vector2,
  4052. this.moveTolerance = .01,
  4053. this.pointersLimit = 2,
  4054. this.pointers = []
  4055. }
  4056. var r = e("three")
  4057. , o = e("../util/logger")
  4058. , a = e("../settings")
  4059. , s = e("../util/common")
  4060. , l = e("../util/math")
  4061. , c = (e("../enum/Vectors"),
  4062. e("../enum/MouseButton"))
  4063. , h = e("../enum/Keys")
  4064. , u = e("../enum/ControlEvents")
  4065. , d = e("events").EventEmitter;
  4066. new o(i);
  4067. n.prototype = Object.create(d.prototype),
  4068. n.prototype.usable = function() {
  4069. return this.enabled && !this.locked
  4070. }
  4071. ,
  4072. /* n.prototype.lookAt = function(e) {
  4073. var t = this.camera.position.clone().sub(e)
  4074. , i = Math.atan(t.z / t.x);
  4075. i += t.x < 0 ? Math.PI : 0,
  4076. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4077. this.lon = r.Math.radToDeg(i) + 180;
  4078. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4079. , o = Math.atan(t.y / n);
  4080. this.lat = -r.Math.radToDeg(o)
  4081. }
  4082. */
  4083. n.prototype.lookAt = function(aim, dir) {
  4084. var t = dir || this.camera.position.clone().sub(aim); //aim所指点的笛卡尔坐标系
  4085. var i = Math.atan(t.z / t.x);
  4086. i += t.x < 0 ? Math.PI : 0;
  4087. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0;
  4088. this.lon = r.Math.radToDeg(i) + 180;
  4089. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4090. o = Math.atan(t.y / n);
  4091. this.lat = -r.Math.radToDeg(o);
  4092. }
  4093. ,
  4094. n.prototype.startRotationFrom = function(e, t) {
  4095. l.convertScreenPositionToNDC(e, t, this.pointer),
  4096. this.pointerDragOn = !0,
  4097. this.pointerDragStart.copy(this.pointer),
  4098. this.moveStart.copy(this.pointer),
  4099. this.rotationHistory = [],
  4100. this.rotationSpeed.set(0, 0)
  4101. }
  4102. ,
  4103. n.prototype.onMouseOver = function(e) {
  4104. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4105. }
  4106. ,
  4107. n.prototype.onTouchStart = function(e) {
  4108. if (this.usable()) {
  4109. switch (e.preventDefault(),
  4110. e.stopPropagation(),
  4111. e.touches.length) {
  4112. case 1:
  4113. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4114. break;
  4115. case 2:
  4116. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4117. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4118. this.pinchDistance = Math.sqrt(t * t + i * i)
  4119. }
  4120. this.emit(u.InputStart, "touch")
  4121. }
  4122. }
  4123. ,
  4124. n.prototype.onPointerDown = function(e) {
  4125. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4126. id: e.pointerId,
  4127. clientX: e.clientX,
  4128. clientY: e.clientY
  4129. }),
  4130. e.touches = this.pointers,
  4131. this.onTouchStart(e),
  4132. this.emit(u.InputStart, "pointer"))
  4133. }
  4134. ,
  4135. n.prototype.onMouseDown = function(e) {
  4136. if (this.usable()) {
  4137. switch (e.preventDefault(),
  4138. e.stopPropagation(),
  4139. e.button) {
  4140. case c.LEFT:
  4141. this.startRotationFrom(e.clientX, e.clientY)
  4142. }
  4143. SoundManager.pause('tour',true) // zeg 点击场景时停止语音
  4144. this.emit(u.InputStart, "mouse")
  4145. }
  4146. }
  4147. ,
  4148. n.prototype.updateRotation = function() {
  4149. if (this.usable() && this.pointerDragOn) {
  4150. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4151. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4152. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4153. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4154. , o = Math.atan2(e.y, i)
  4155. , a = Math.atan2(t.y, n);
  4156. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4157. e.y = 0,
  4158. t.y = 0;
  4159. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4160. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4161. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4162. this.pointerDragStart.copy(this.pointer)
  4163. }
  4164. }
  4165. ,
  4166. n.prototype.onMouseMove = function(e) {
  4167. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4168. 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"))
  4169. }
  4170. ,
  4171. n.prototype.onTouchMove = function(e) {
  4172. if (this.usable())
  4173. switch (this.emit(u.Move, "touch"),
  4174. e.touches.length) {
  4175. case 1:
  4176. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4177. break;
  4178. case 2:
  4179. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4180. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4181. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4182. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4183. this.emit(u.Pinch, n),
  4184. this.pinchDistance -= n)
  4185. }
  4186. }
  4187. ,
  4188. n.prototype.onPointerMove = function(e) {
  4189. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4190. e.pointerId === t.id && (t.clientX = e.clientX,
  4191. t.clientY = e.clientY)
  4192. }),
  4193. e.touches = this.pointers,
  4194. this.onTouchMove(e))
  4195. }
  4196. ,
  4197. n.prototype.endRotation = function() {
  4198. this.pointerDragOn = !1;
  4199. var e = s.averageVectors(this.rotationHistory);
  4200. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4201. }
  4202. ,
  4203. n.prototype.onTouchEnd = function(e) {
  4204. this.usable() && (e.preventDefault(),
  4205. e.stopPropagation(),
  4206. this.endRotation())
  4207. }
  4208. ,
  4209. n.prototype.onMouseUp = function(e) {
  4210. //if(window.vrEnabled && !browser.isMobile() )return //xzw add
  4211. this.usable() && (e.preventDefault(),
  4212. e.stopPropagation(),
  4213. this.endRotation())
  4214. }
  4215. ,
  4216. n.prototype.onPointerUp = function(e) {
  4217. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4218. e.pointerId === t.id && this.pointers.splice(i, 1)
  4219. }
  4220. .bind(this)),
  4221. e.touches = this.pointers,
  4222. this.onTouchEnd(e))
  4223. }
  4224. ,
  4225. /* n.prototype.getLimitAngleAtPano = function(defaultAngle, pano){
  4226. let limitUpAtPano = a.upDownAngleLimitPanos?.[pano.id]
  4227. let insideLookLimitUp = limitUpAtPano?.up != void 0 ? limitUpAtPano?.up : defaultAngle
  4228. return insideLookLimitUp
  4229. } */
  4230. n.prototype.update = function(e) {
  4231. this.lon,
  4232. this.lat;
  4233. for (this.updateRotation(),
  4234. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4235. this.rotationHistory.shift();
  4236. this.lon += this.rotationDifference.x,
  4237. this.lat += this.rotationDifference.y,
  4238. this.rotationDifference.set(0, 0)
  4239. //改
  4240. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4241. this.rotationSpeed.x = this.rotationSpeed.x * (1 - friction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4242. this.rotationSpeed.y = this.rotationSpeed.y * (1 - friction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4243. this.lon += this.rotationSpeed.x * e,
  4244. this.lat += this.rotationSpeed.y * e
  4245. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : a.insideLookLimitDown
  4246. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
  4247. /* insideLookLimitUp = this.getLimitAngleAtPano(insideLookLimitUp, player.currentPano)
  4248. if(player.flying && player.nextPano){//过渡渐变
  4249. let insideLookLimitUp2 = this.getLimitAngleAtPano(insideLookLimitUp, player.nextPano)
  4250. if(insideLookLimitUp2 != insideLookLimitUp){
  4251. let object = transitions.funcs.find(e=>e.name == 'camFly')
  4252. if(object){
  4253. let r = object.current / object.duration
  4254. insideLookLimitUp = math.linearClamp(r,[0,1],[insideLookLimitUp,insideLookLimitUp2])
  4255. }else{
  4256. console.error('?????????????')
  4257. //insideLookLimitUp = insideLookLimitUp2
  4258. }
  4259. }
  4260. } */
  4261. insideLookLimitDown = insideLookLimitDown - a.insideFOV/2 + this.camera.fov / 2
  4262. insideLookLimitUp = insideLookLimitUp + a.insideFOV/2 - this.camera.fov / 2
  4263. 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 );
  4264. this.phi = r.Math.degToRad(90 - this.lat),
  4265. this.theta = r.Math.degToRad(this.lon),
  4266. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4267. this.lookVector.y = Math.cos(this.phi),
  4268. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4269. this.target.copy(this.lookVector).add(this.camera.position),
  4270. this.camera.lookAt(this.target)
  4271. }
  4272. ,
  4273. n.prototype.onMouseWheel = function(e) {
  4274. if (this.usable()) {
  4275. var t = e.wheelDelta || -e.detail;
  4276. this.emit(u.InteractionDirect),
  4277. this.emit(u.Scroll, t)
  4278. }
  4279. }
  4280. ,
  4281. n.prototype.onKeyDown = function(e) {
  4282. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4283. this.handleKeyDown(e.which)))
  4284. }
  4285. ,
  4286. n.prototype.handleKeyDown = function(e) {
  4287. var t = function(e, t) {
  4288. this.rotationAcc[e] = t
  4289. }
  4290. .bind(this);
  4291. this.emit(u.InteractionKey);
  4292. var i = !0;
  4293. switch (e) {
  4294. case h.LEFTARROW:
  4295. case h.J:
  4296. t("x", -1);
  4297. break;
  4298. case h.RIGHTARROW:
  4299. case h.L:
  4300. t("x", 1);
  4301. break;
  4302. case h.I:
  4303. t("y", 1);
  4304. break;
  4305. case h.K:
  4306. t("y", -1);
  4307. break;
  4308. default:
  4309. i = !1
  4310. }
  4311. i && this.emit(u.Move, "key")
  4312. }
  4313. ,
  4314. n.prototype.onKeyUp = function(e) {
  4315. this.usable() && (e.preventDefault(),
  4316. e.stopPropagation(),
  4317. this.handleKeyUp(e.which))
  4318. }
  4319. ,
  4320. n.prototype.handleKeyUp = function(e) {
  4321. switch (e) {
  4322. case h.LEFTARROW:
  4323. case h.J:
  4324. case h.RIGHTARROW:
  4325. case h.L:
  4326. this.rotationAcc.x = 0;
  4327. break;
  4328. case h.I:
  4329. case h.K:
  4330. this.rotationAcc.y = 0
  4331. }
  4332. }
  4333. ,
  4334. n.prototype.startRotating = function(e, t) {
  4335. e && (this.rotationAcc.x = e),
  4336. t && (this.rotationAcc.y = t)
  4337. }
  4338. ,
  4339. n.prototype.stopRotating = function(e) {
  4340. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4341. this.rotationAcc.set(0, 0)
  4342. }
  4343. ,
  4344. n.prototype.reset = function() {
  4345. this.pointerDragOn = !1,
  4346. this.rotationAcc.set(0, 0),
  4347. this.rotationSpeed.set(0, 0),
  4348. this.pointers = []
  4349. }
  4350. ,
  4351. n.prototype.toJSON = function() {
  4352. var e = {
  4353. camera_position: {
  4354. x: l.toPrecision(this.camera.position.x, 4),
  4355. y: l.toPrecision(this.camera.position.y, 4),
  4356. z: l.toPrecision(this.camera.position.z, 4)
  4357. },
  4358. camera_quaternion: {
  4359. x: l.toPrecision(this.camera.quaternion.x, 4),
  4360. y: l.toPrecision(this.camera.quaternion.y, 4),
  4361. z: l.toPrecision(this.camera.quaternion.z, 4),
  4362. w: l.toPrecision(this.camera.quaternion.w, 4)
  4363. }
  4364. };
  4365. return e
  4366. }
  4367. ,
  4368. n.prototype.setStateFromJSON = function(e) {
  4369. this.camera.position.copy(e.camera_position),
  4370. this.camera.quaternion.copy(e.camera_quaternion)
  4371. }
  4372. ,
  4373. t.exports = n
  4374. }
  4375. ).call(this, "/js/controls/PanoramaControls.js")
  4376. }
  4377. , {
  4378. "../enum/ControlEvents": 21,
  4379. "../enum/Keys": 30,
  4380. "../enum/MouseButton": 34,
  4381. "../enum/Vectors": 50,
  4382. "../settings": 166,
  4383. "../util/common": 185,
  4384. "../util/logger": 189,
  4385. "../util/math": 190,
  4386. events: 202,
  4387. three: 217
  4388. }],
  4389. 14: [function(e, t, i) {
  4390. (function(i) {
  4391. "use strict";
  4392. var n = e("three")
  4393. , r = e("../enum/Viewmode")
  4394. , o = e("../util/logger")
  4395. , a = new o(i);
  4396. t.exports = {
  4397. serialize: function(e) {
  4398. return encodeURI(JSON.stringify(e))
  4399. },
  4400. deserialize: function(e) {
  4401. function t(e) {
  4402. function t(e, t) {
  4403. return e && "number" == typeof t && !isNaN(t)
  4404. }
  4405. return e.reduce(t, !0)
  4406. }
  4407. try {
  4408. var i = JSON.parse(decodeURI(e))
  4409. , o = {
  4410. mode: r.fromInt(i.camera_mode),
  4411. panoId: i.scan_id,
  4412. position: (new n.Vector3).copy(i.camera_position),
  4413. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4414. zoom: i.ortho_zoom,
  4415. floorVisibility: i.floor_visibility
  4416. }
  4417. , s = o.position;
  4418. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4419. var l = o.quaternion;
  4420. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4421. o
  4422. } catch (i) {
  4423. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4424. try {
  4425. var c = e.split(",")
  4426. , h = {
  4427. x: parseFloat(c[2]),
  4428. y: parseFloat(c[3]),
  4429. z: parseFloat(c[4])
  4430. }
  4431. , u = {
  4432. x: parseFloat(c[5]),
  4433. y: parseFloat(c[6]),
  4434. z: parseFloat(c[7]),
  4435. w: parseFloat(c[8])
  4436. };
  4437. return t([h.x, h.y, h.z]) || (h.x = 0,
  4438. h.y = 0,
  4439. h.z = 0),
  4440. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4441. u.y = 0,
  4442. u.z = 0,
  4443. u.w = 1),
  4444. {
  4445. mode: r.fromInt(c[0]),
  4446. panoId: c[1],
  4447. position: (new n.Vector3).copy(h),
  4448. quaternion: (new n.Quaternion).copy(u)
  4449. }
  4450. } catch (t) {
  4451. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4452. }
  4453. }
  4454. return null
  4455. }
  4456. }
  4457. }
  4458. ).call(this, "/js/controls/serializer.js")
  4459. }
  4460. , {
  4461. "../enum/Viewmode": 51,
  4462. "../util/logger": 189,
  4463. three: 217
  4464. }],
  4465. 15: [function(e, t, i) {
  4466. (function(i) {
  4467. "use strict";
  4468. function n() {
  4469. this.endlessLoop = a.warp.loop,
  4470. this.clock = new r.Clock(!0),
  4471. this.model = null,
  4472. this.player = null,
  4473. this.currentItem = null,
  4474. this.destinationItem = null,
  4475. this.tourIsPlaying = !1,
  4476. this.transitionStage = y.None,
  4477. this.nextFunc = null,
  4478. this.onTheBus = !1,
  4479. this.tourInProgress = !1,
  4480. this.reachSource = null,
  4481. this.interrupted = !1,
  4482. this.nItems = 0,
  4483. this.walkingSectionPaused = !1
  4484. }
  4485. var r = e("three")
  4486. , o = e("./util/logger")
  4487. , a = e("./settings")
  4488. , s = e("./util/transitions")
  4489. , l = e("events").EventEmitter
  4490. , c = e("./enum/Viewmode")
  4491. , h = e("./analytics")
  4492. , u = e("./enum/WarpStyle")
  4493. , s = e("./util/transitions")
  4494. , d = (e("./model/ModelManager"),
  4495. e("./enum/ModelManagerEvents"))
  4496. , p = e("./enum/DirectorEvents")
  4497. , f = e("./enum/PlayerEvents")
  4498. , g = (e("./enum/ControlEvents"),
  4499. e("./enum/BlackoutStyle"))
  4500. , m = e("./enum/PathDiscardMode")
  4501. , v = e("./enum/PathDisplayMode")
  4502. , A = (e("./player"),
  4503. new o(i))
  4504. , y = Object.freeze({
  4505. None: 0,
  4506. Moving: 1,
  4507. Aiming: 2,
  4508. Interlude: 3
  4509. })
  4510. , C = Object.freeze({
  4511. Forward: 1,
  4512. NoChange: 0,
  4513. Backwards: -1
  4514. })
  4515. , I = s.getUniqueId();
  4516. n.prototype = Object.create(l.prototype),
  4517. n.prototype.init = function(e, t) {
  4518. this.player = e,
  4519. this.modelManager = t,
  4520. this.updateModel(),
  4521. this.resetAll(),
  4522. this.bindEvents()
  4523. // // zeg 查询pano对应的导览片段
  4524. // if(!this.panoIdMap) {
  4525. // this.panoIdMap = new Map()
  4526. // this.model.heroLocations.forEach( (value, index) => {
  4527. // // value.heroLocations.forEach( hl => {
  4528. // if(!value.heroLocations) return
  4529. // let hl = value.heroLocations[0]
  4530. // let arr = this.panoIdMap.get(hl.panoId)
  4531. // if(arr){
  4532. // this.panoIdMap.set(hl.panoId, [...arr, index])
  4533. // } else {
  4534. // this.panoIdMap.set(hl.panoId, [index])
  4535. // }
  4536. // // })
  4537. // })
  4538. // }
  4539. }
  4540. ,
  4541. n.prototype.resetAll = function() {
  4542. if (this.currentItem = null,
  4543. this.destinationItem = null,
  4544. this.tourIsPlaying = !1,
  4545. //this.bgmReplay(),//xzw
  4546. this.transitionStage = y.None,
  4547. this.nextFunc = null,
  4548. this.onTheBus = !1,
  4549. this.reachSource = null,
  4550. this.interrupted = !1,
  4551. this.model) {
  4552. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4553. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4554. } else
  4555. this.defaultWarpStyle = u.BLACK,
  4556. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4557. this.resetSpecialTransition()
  4558. }
  4559. ,
  4560. n.prototype.updateModel = function() {
  4561. this.model = this.modelManager.getActiveModel(),
  4562. this.nItems = this.model.heroLocations.length
  4563. }
  4564. ,
  4565. n.prototype.bindEvents = function() {
  4566. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4567. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4568. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4569. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4570. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4571. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4572. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4573. this.player.once(f.Move, function() {
  4574. s.cancelById(I)
  4575. })
  4576. }
  4577. ,
  4578. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {//快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4579. return /* e === u.WALK && ( */this.interrupt(g.NONE),
  4580. this.pauseWalkingSection(),
  4581. this.player.fastForwardActivePanoFlight(),
  4582. !0/* ) */
  4583. }
  4584. ,
  4585. n.prototype.handlePlayerMove = function(e) {
  4586. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4587. this.emit("update.controls")
  4588. }
  4589. ,
  4590. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4591. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4592. this.emit("update.controls"))
  4593. }
  4594. ,
  4595. n.prototype.handlePlayerModeChanged = function(e, t) {
  4596. this.intermediateState() || e === t || (this.onTheBus = !1,
  4597. this.emit("update.controls"))
  4598. }
  4599. ,
  4600. n.prototype.handlePlayerInputStart = function(e) {
  4601. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4602. }
  4603. ,
  4604. n.prototype.handlePlayerFlyingStarted = function() {
  4605. this.clearWalkingSectionPaused()
  4606. }
  4607. ,
  4608. n.prototype.describe = function() {
  4609. return {
  4610. nItems: this.nItems,
  4611. currentItem: this.currentItem,
  4612. destinationItem: this.destinationItem,
  4613. tourIsPlaying: this.tourIsPlaying,
  4614. onTheBus: this.onTheBus,
  4615. endlessLoop: this.endlessLoop,
  4616. viewMode: this.player.mode,
  4617. inTransition: this._inTransition(),
  4618. transitionStage: this.transitionStage,
  4619. tourInProgress: this.tourInProgress
  4620. }
  4621. }
  4622. ,
  4623. n.prototype._inTransition = function() {
  4624. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4625. }
  4626. ,
  4627. n.prototype.bounceable = function() {
  4628. var e = this.clock.getDelta();
  4629. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4630. }
  4631. ,
  4632. n.prototype.itemCompare = function(item1, item2, type){//add
  4633. if(type == 'equal'){//==
  4634. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4635. }else if(type == 'less'){//<
  4636. return item1 && item2 && (item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4637. }
  4638. }
  4639. n.prototype.currentMoveDirection = function() {
  4640. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4641. 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
  4642. }
  4643. ,
  4644. n.prototype.clearPath = function() {
  4645. this._inTransition() || this.player.path.discardPathObject()
  4646. }
  4647. ,
  4648. n.prototype.allFloors = function() {
  4649. this.model.toggleAllFloors()
  4650. }
  4651. ,
  4652. n.prototype.actionComplete = function(e) {
  4653. if (this.interrupted = !1,
  4654. this.transitionStage = y.None,
  4655. this.resetSpecialTransition(),
  4656. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4657. this.tourIsPlaying || (this.player.disablePreRendering(),
  4658. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4659. this.emit("update.controls"),
  4660. this.nextFunc) {
  4661. var t = this.nextFunc;
  4662. this.nextFunc = null,
  4663. t()
  4664. }
  4665. }
  4666. ,
  4667. n.prototype.awaitCompletion = function(e, t) {
  4668. this.nextFunc = t,
  4669. e()
  4670. }
  4671. ,
  4672. n.prototype.updateSuccessFunction = function(e) {
  4673. this.nextFunc = e
  4674. }
  4675. ,
  4676. n.prototype.interrupt = function(e, t) {//滑动屏幕或按下键盘等
  4677. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4678. this.tourIsPlaying = !1,
  4679. //this.bgmReplay(),//xzw
  4680. this.interrupted = !0,
  4681. this.nextFunc = null,
  4682. this.emit(p.ActionInterrupted),
  4683. null !== e && void 0 !== e || (e = g.BEGINNING),
  4684. this.player.interruptAndFastForward(e, t),
  4685. !0)
  4686. }
  4687. ,
  4688. n.prototype.wouldInterrupt = function() {
  4689. return this.transitionStage !== y.None
  4690. }
  4691. ,
  4692. n.prototype.intermediateState = function() {
  4693. return this.transitionStage !== y.None
  4694. }
  4695. ,
  4696. n.prototype.isInterrupted = function() {
  4697. return this.interrupted
  4698. }
  4699. ,
  4700. n.prototype.pauseWalkingSection = function() {
  4701. this.walkingSectionPaused = !0
  4702. }
  4703. ,
  4704. n.prototype.clearWalkingSectionPaused = function() {
  4705. this.walkingSectionPaused = !1
  4706. }
  4707. ,
  4708. n.prototype.autoTour = function() {
  4709. var e = Date.now();
  4710. this.model.auxDataPromise.then(function() {
  4711. e = Date.now() - e;
  4712. var t = a.warp.auto
  4713. , i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */;
  4714. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4715. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4716. done: function() {
  4717. this.playTour()
  4718. }
  4719. .bind(this),
  4720. name: "_atr",
  4721. id: I
  4722. })
  4723. }
  4724. .bind(this))
  4725. }
  4726. ,
  4727. n.prototype.atDestinationPano = function(pano) {
  4728. if(null === this.destinationItem)return !1;
  4729. pano = pano || this.player.currentPano
  4730. if(!pano){
  4731. return !1;
  4732. }
  4733. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4734. return destination && destination.panoId == pano.id
  4735. }
  4736. ,
  4737. n.prototype.redirectToItem = function(e, t) {
  4738. if (null === e || void 0 === e)
  4739. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4740. if (!this.wouldInterrupt())
  4741. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4742. if (this.player.mode === c.TRANSITIONING)
  4743. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4744. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4745. var i = function() {
  4746. s.setTimeout(function() {
  4747. this.setDestinationItem(e),
  4748. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4749. }
  4750. .bind(this), 0)
  4751. }
  4752. .bind(this);
  4753. this.interrupt(g.END, 0),
  4754. this.updateSuccessFunction(i)
  4755. }
  4756. ,
  4757. n.prototype.useSpecialTransition = function(e) {
  4758. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4759. this.nextWarpStyle = u.BLACK
  4760. }
  4761. ,
  4762. n.prototype.resetSpecialTransition = function() {
  4763. this.nextWarpStyle = this.defaultWarpStyle
  4764. }
  4765. ,
  4766. n.prototype.arrivedAtDestination = function(e) {
  4767. if (this.player.flying || this.player.isWarping())
  4768. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4769. else {
  4770. this.transitionStage = y.Aiming;
  4771. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4772. this.player.model.fadePanoMarkers(0),
  4773. this.awaitCompletion(function() {
  4774. this.resetSpecialTransition(),
  4775. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4776. }
  4777. .bind(this), t)
  4778. }
  4779. }
  4780. ,
  4781. n.prototype.goToDestination = function(e, t, i, n) {
  4782. //音频
  4783. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4784. // zeg 手动导览不播放音频
  4785. if(musicInfo && musicInfo.music && !e){
  4786. let musicType = localStorage.getItem('xunirole') || 'male'
  4787. let isMale = musicType.indexOf('female') < 0
  4788. let fixMusic = isMale?musicInfo.music:(musicInfo.fmusic||musicInfo.music)
  4789. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4790. let src = fixMusic
  4791. let audioObj = SoundManager.list.find(e=>e.name == 'tour')
  4792. let audioSrc1 = common.getFileNameFromUrl(audioObj.src);
  4793. let audioSrc2 = common.getFileNameFromUrl(src)
  4794. if(audioSrc1 == audioSrc2){//应该是继续播放该folder
  4795. if(this.destinationItem[1] == 0){//从头开始播放 因为可能暂停后然后再点该缩略图播
  4796. SoundManager.play('tour',null,0) // currentTime = 0;
  4797. }else if( audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration ){//未播完
  4798. SoundManager.play('tour')//继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4799. }
  4800. }else{//很可能是该folder的起始
  4801. SoundManager.play('tour', manage.dealURL(src))
  4802. }
  4803. }
  4804. let oldPos = this.player.position.clone();
  4805. let oldPano = this.player.currentPano
  4806. if (this.onTheBus = !0,
  4807. this.emit("update.controls"),
  4808. this.player.updateLastView(),
  4809. !n && this.atDestinationPano()){
  4810. /*
  4811. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4812. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4813. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4814. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4815. } */
  4816. return void this.arrivedAtDestination(!0);
  4817. }
  4818. if (this.player.flying || this.player.isWarping())
  4819. A.warn("Cannot go to new destination while player is flying or warping.");
  4820. else {
  4821. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4822. , o = null
  4823. , a1 = null;
  4824. if (r.isPano()) {
  4825. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4826. //var walk = window.DATA.black ? 'black' : 'walk';
  4827. //若是点击item,直接瞬间过渡。
  4828. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4829. if(this.destinationItem[0] == 0 && this.destinationItem[1] == 0) s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
  4830. a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this)),
  4831. o = this.arrivedAtDestination.bind(this, !0)
  4832. if(s=='black' && r.zoom && r.zoom != this.player.zoomLevel){//add
  4833. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4834. }
  4835. } else{
  4836. a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4837. o = this.arrivedAtDestination.bind(this, !1);
  4838. }
  4839. this.transitionStage = y.Moving,
  4840. this.model.fadePanoMarkers(0),
  4841. this.awaitCompletion(function() {
  4842. a1();
  4843. }
  4844. .bind(this), o),
  4845. this.emit("update.controls")
  4846. }
  4847. }
  4848. ,
  4849. n.prototype.tourInterlude = function() {
  4850. if (h.trackAlways("reach_highlight", {
  4851. reach_source: this.reachSource
  4852. }),
  4853. this.model.fadePanoMarkers(0),
  4854. this.emit("update.controls"),
  4855. this.tourIsPlaying)
  4856. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4857. void this.awaitCompletion(function() {
  4858. this.transitionStage = y.Interlude,
  4859. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4860. }
  4861. .bind(this), function(){
  4862. this.currentItem = [0,0],
  4863. this.stopTour(true),
  4864. this.emit(p.TourEnd)
  4865. }.bind(this)),
  4866. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4867. this.transitionStage = y.Interlude,
  4868. this.player.tourInterlude(this.nextItem(this.currentItem),this.actionComplete.bind(this))
  4869. }
  4870. .bind(this), this.goNext.bind(this))
  4871. }
  4872. ,
  4873. n.prototype.findNearestItem = function(endToStart=true, searchEvery){//找到离currentPano最近的导览
  4874. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4875. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4876. } */
  4877. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4878. var result = {item:[0,0], dis:Infinity};
  4879. var compare = (location, item)=>{
  4880. if(location.panoId != void 0 && location.panoId!= "outside"){
  4881. var pano = this.model.panos.index[location.panoId];
  4882. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4883. if(dis<result.dis){
  4884. result.item = item, result.dis = dis, result.location = location, result.angle = null
  4885. }else if(dis == result.dis){
  4886. if(this.currentItem){
  4887. if(result.angle == void 0){
  4888. result.angle = result.location.quaternion.angleTo(player.quaternion)
  4889. }//用角度最接近的那一个
  4890. let angle = location.quaternion.angleTo(player.quaternion)
  4891. if(angle < result.angle){
  4892. result.item = item, result.dis = dis, result.location = location, result.angle = angle
  4893. }
  4894. /* //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4895. let dis1 = [Math.abs(item[0] - this.currentItem[0]), Math.abs(item[1] - this.currentItem[1])] //当前差距
  4896. let dis2 = [Math.abs(result.item[0] - this.currentItem[0]), Math.abs(result.item[1] - this.currentItem[1])]
  4897. if( this.itemCompare(dis1, dis2, 'less')){
  4898. result.item = item, result.dis = dis
  4899. } */
  4900. }
  4901. }
  4902. }
  4903. }
  4904. this.model.heroLocations.forEach((e,i)=>{
  4905. if(e.heroLocations){
  4906. if(searchEvery){
  4907. e.heroLocations.forEach((a,j)=>{
  4908. compare(a, [i,j])
  4909. })
  4910. }else{
  4911. var location = e.heroLocations.find(e=>e.panoId != void 0)
  4912. location && compare(location, [i,0]) //跳到此区域开头
  4913. }
  4914. }else{
  4915. compare(e, [i,0])
  4916. }
  4917. })
  4918. if(endToStart && this.atEndOfTour(result.item)){ //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4919. return [0,0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4920. }
  4921. return result.item
  4922. }
  4923. n.prototype.playTour = function() {
  4924. if (!this.bounceable() && this.model.heroLocations.length) {
  4925. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  4926. // if(!this.currentItem) this.currentItem = []
  4927. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  4928. // // zeg 从当前pano进行自动导览
  4929. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  4930. // // this.model.heroLocations.forEach( (value, index) => {
  4931. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  4932. // // currentPanoDestinations.push(index)
  4933. // // }
  4934. // // })
  4935. // if(!currentPanoDestinations) {
  4936. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  4937. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  4938. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  4939. // for(var i = 0; i < neighbourIndex.length; i++) {
  4940. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  4941. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  4942. // }
  4943. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  4944. // }
  4945. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  4946. // this.currentItem[0] = currentPanoDestinations[0]
  4947. // }
  4948. // }
  4949. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4950. this.tourInProgress = !0,
  4951. this.reachSource = "play",
  4952. this.tourIsPlaying = !0,
  4953. this.wasZoomEnabled = this.player.zoomEnabled,
  4954. this.player.zoomEnabled = !1,
  4955. this.resetSpecialTransition(),
  4956. this.emit("update.controls"),
  4957. this.emit(p.TourStart),
  4958. this.player.enablePreRendering(),
  4959. // this.currentItem[1] = null,
  4960. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4961. this.goToDestination()) : /* this.goNext() */(this.tourAdvance(0) ,this.goToDestination()))) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4962. }
  4963. }
  4964. n.prototype.playTourNearBy = function() {//就近导览
  4965. if (!this.bounceable()){
  4966. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4967. this.tourInProgress = !0,
  4968. this.reachSource = "play",
  4969. this.tourIsPlaying = !0,
  4970. this.wasZoomEnabled = this.player.zoomEnabled,
  4971. this.player.zoomEnabled = !1,
  4972. this.resetSpecialTransition(),
  4973. this.emit("update.controls"),
  4974. this.emit(p.TourStart),
  4975. this.player.enablePreRendering(),
  4976. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4977. this.goToDestination()) : this.goNext())) */
  4978. this.setDestinationItem(this.findNearestItem()) , this.goToDestination()) )
  4979. }
  4980. }
  4981. ,
  4982. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4983. } */
  4984. n.prototype.stopTour = function(isAutoStop) {//停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4985. SoundManager.pause('tour',true), // zeg 自动导览暂停时同时停止语音
  4986. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4987. this.tourIsPlaying = !1,
  4988. this.interrupt(),
  4989. this.clearWalkingSectionPaused(),
  4990. this.resetSpecialTransition(),
  4991. this.emit("update.controls"))
  4992. }
  4993. ,
  4994. n.prototype.endTourProgress = function() {
  4995. this.tourInProgress = !1,
  4996. this.emit("update.controls"),
  4997. this.emit(p.TourEnd)
  4998. }
  4999. ,
  5000. n.prototype.goToHighlight = function(e) {
  5001. if (this.wouldInterrupt())
  5002. this.itemCompare(this.destinationItem,e,'equal') ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  5003. else {
  5004. if (A.debug("<tour.goto " + e + ">"),
  5005. this.isInterrupted())
  5006. return;
  5007. this.clearWalkingSectionPaused(),
  5008. this.setDestinationItem(e),
  5009. this.useSpecialTransition("Hilight")
  5010. this.goToDestination(true),//add true
  5011. h.trackAlways("reach_highlight", {
  5012. reach_source: "thumb"
  5013. })
  5014. }
  5015. }
  5016. ,
  5017. n.prototype.prevHighlight = function() {
  5018. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  5019. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5020. this.reachSource = "prev",
  5021. this.goPrev()))
  5022. }
  5023. ,
  5024. n.prototype.nextHighlight = function() {
  5025. this.bounceable() || (this.player.emit("tour_manual", "next"),
  5026. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  5027. this.reachSource = "next",
  5028. this.goNext()))
  5029. }
  5030. ,
  5031. n.prototype.changeMode = function(e) {
  5032. var t = $.Deferred()
  5033. , i = t.resolve.bind(t)
  5034. , n = t.reject.bind(t);
  5035. this.emit(p.StartModeChange);
  5036. var r = function() {
  5037. return this.clearWalkingSectionPaused(),
  5038. !!this.wouldInterrupt() && (this.interrupt(),
  5039. !0)
  5040. }
  5041. .bind(this);
  5042. if (!r()) {
  5043. switch (e) {
  5044. case c.PANORAMA:
  5045. 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);
  5046. break;
  5047. case c.DOLLHOUSE:
  5048. case c.FLOORPLAN:
  5049. this.player.flyToNewMode({
  5050. mode: e
  5051. }).done(i).fail(n);
  5052. break;
  5053. case c.OUTDOOR:
  5054. 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)
  5055. }
  5056. return t.promise()
  5057. }
  5058. }
  5059. ,
  5060. n.prototype.atEndOfTour = function(currentItem=this.currentItem) {
  5061. var end = currentItem && currentItem[0] >= this.nItems - 1;
  5062. if(end){
  5063. var heroLocations = this.model.heroLocations[this.nItems-1].heroLocations
  5064. if(heroLocations){
  5065. end = currentItem[1] >= heroLocations.length - 1
  5066. }
  5067. }
  5068. return end;
  5069. }
  5070. ,
  5071. n.prototype.firstDestination = function() {
  5072. //return 0 < this.nItems ? 0 : null
  5073. return 0 < this.nItems ? [0,0]: null
  5074. }
  5075. ,
  5076. n.prototype.finalDestination = function() {
  5077. //return 0 < this.nItems ? this.nItems - 1 : null
  5078. return 0 < this.nItems ? [this.nItems - 1,0]: null
  5079. }
  5080. ,
  5081. n.prototype.goPrev = function() {
  5082. this.tourAdvance(-1)
  5083. }
  5084. ,
  5085. n.prototype.goNext = function() {
  5086. this.tourAdvance(1)
  5087. }
  5088. ,
  5089. n.prototype.setDestinationItem = function(e) {
  5090. this.destinationItem = e,
  5091. this.emit("update.controls")
  5092. }
  5093. ,
  5094. n.prototype.setCurrentItem = function(e) {
  5095. this.currentItem = e,
  5096. this.emit("update.controls")
  5097. }
  5098. ,
  5099. n.prototype.nextItem = function(currentItem) {
  5100. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5101. if(currentItem == void 0)return this.firstDestination()
  5102. var currentLocation = this.model.heroLocations[currentItem[0]];
  5103. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5104. var item;
  5105. if(this.currentItem[1] >= currentChildNum - 1){//子目录中最后一个
  5106. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5107. }else{
  5108. item = [currentItem[0] , currentItem[1]+1]
  5109. }
  5110. if(item[0] >= this.nItems ){
  5111. item = this.firstDestination()
  5112. }
  5113. return item;
  5114. //暂时不理会endlessLoop,默认为false
  5115. }
  5116. ,
  5117. n.prototype.prevItem = function(currentItem) {
  5118. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5119. if(currentItem == void 0)return this.firstDestination()
  5120. var item;
  5121. var lastLocation = this.model.heroLocations[currentItem[0]-1];
  5122. if(!lastLocation) return this.finalDestination()//[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5123. else{
  5124. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5125. if(this.currentItem[1] == 0){//子目录中第一个
  5126. return [currentItem[0] - 1, lastChildNum-1]
  5127. }else{
  5128. return [currentItem[0], currentItem[1]-1]
  5129. }
  5130. }
  5131. }
  5132. ,
  5133. n.prototype.tourAdvance = function(e) {//e是1或-1 或 0
  5134. A.debug("tourAdvance(" + e + ")")
  5135. if(null === this.currentItem || void 0 === this.currentItem){
  5136. this.setDestinationItem(this.firstDestination())
  5137. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5138. }else{
  5139. var item = this.currentItem
  5140. if(e == 1){
  5141. item = this.nextItem(this.currentItem)
  5142. }else if(e == -1){
  5143. item = this.prevItem(this.currentItem)
  5144. }
  5145. this.setDestinationItem(item)
  5146. }
  5147. if(this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')/* [0] < 0 */){
  5148. this.useSpecialTransition("reverse-looping to end")
  5149. }else if(this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')){
  5150. this.useSpecialTransition("looping back to start")
  5151. }
  5152. /* var momentTour = this.getMomentTour(this.destinationItem);
  5153. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5154. var zoomLevel = this.player.zoomLevel;
  5155. this.player.zoomEnabled = true;
  5156. var zoom = function(e, d) {
  5157. this.player.zoomTo((1-e)*zoomLevel, true)
  5158. }.bind(this)
  5159. s.start(zoom, 1500, function(){
  5160. }, 0, d.easeOutQuad, "zoom")
  5161. } */
  5162. this.goToDestination()
  5163. }
  5164. ,
  5165. n.prototype.getMomentTour = function(destinationItem) {//add
  5166. var wholeMomentTour = window.DATA.momentTour || "walk"; //最外层 还有一种是'std'
  5167. if(!destinationItem) return wholeMomentTour
  5168. else{
  5169. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem)//最内层。 如果有使用最内层
  5170. if(currentLocation.momentTour)return currentLocation.momentTour;
  5171. var currentLocation_ = this.model.heroLocations[destinationItem[0]];
  5172. return currentLocation_.momentTour || wholeMomentTour; //若中间层或最内层有就使用,否则使用最外层
  5173. }
  5174. }
  5175. ,
  5176. t.exports = n
  5177. }
  5178. ).call(this, "/js/director.js")
  5179. }
  5180. , {
  5181. "./analytics": 4,
  5182. "./enum/BlackoutStyle": 18,
  5183. "./enum/ControlEvents": 21,
  5184. "./enum/DirectorEvents": 23,
  5185. "./enum/ModelManagerEvents": 33,
  5186. "./enum/PathDiscardMode": 38,
  5187. "./enum/PathDisplayMode": 39,
  5188. "./enum/PlayerEvents": 40,
  5189. "./enum/Viewmode": 51,
  5190. "./enum/WarpStyle": 52,
  5191. "./model/ModelManager": 140,
  5192. "./player": 155,
  5193. "./settings": 166,
  5194. "./util/logger": 189,
  5195. "./util/transitions": 195,
  5196. events: 202,
  5197. three: 217
  5198. }],
  5199. 16: [function(e, t, i) {
  5200. "use strict";
  5201. var n = e("three")
  5202. , r = e("./enum/Viewmode")
  5203. , o = (e("./settings"),
  5204. e("./util/transitions"))
  5205. , a = e("./enum/PlayerEvents")
  5206. , s = new n.ShaderPass(n.HorizontalBlurShader)
  5207. , l = new n.ShaderPass(n.VerticalBlurShader);
  5208. l.renderToScreen = !0;
  5209. var c = $("#player").width() / $("#player").height();
  5210. isNaN(c) && (c = 1);
  5211. var h = {
  5212. currentBlur: 0,
  5213. aspect: c,
  5214. blurStrength: 1,
  5215. hblurPass: s,
  5216. vblurPass: l,
  5217. fastTranMaskPass : new n.TransitionPass()
  5218. ,
  5219. bindEvents: function(e) {
  5220. e.on(a.ModeChanged, function(e, t) {
  5221. e === r.PANORAMA && (o.cancel(h.blur),
  5222. o.cancel(h.addBlur),
  5223. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  5224. })
  5225. },
  5226. blur: function(e) {
  5227. h.currentBlur = e;
  5228. var t = e * h.blurStrength;
  5229. l.uniforms.v.value = t / 512 * h.aspect,
  5230. s.uniforms.h.value = t / 512
  5231. },
  5232. addBlur: function(e) {
  5233. e = Math.max(e, h.currentBlur),
  5234. h.blur(e)
  5235. },
  5236. removeBlur: function(e) {
  5237. e = Math.min(1 - e, h.currentBlur),
  5238. h.blur(e)
  5239. }
  5240. };
  5241. h.blur(0),
  5242. t.exports = h
  5243. }
  5244. , {
  5245. "./enum/PlayerEvents": 40,
  5246. "./enum/Viewmode": 51,
  5247. "./settings": 166,
  5248. "./util/transitions": 195,
  5249. three: 217
  5250. }],
  5251. 17: [function(e, t, i) {
  5252. "use strict";
  5253. t.exports = {
  5254. UNKNOWN: 0,
  5255. ALIGNED: 1,
  5256. UNALIGNED: 2,
  5257. PLACED: 3
  5258. }
  5259. }
  5260. , {}],
  5261. 18: [function(e, t, i) {
  5262. "use strict";
  5263. t.exports = {
  5264. NONE: 0,
  5265. MIDDLE: 1,
  5266. END: 2,
  5267. BEGINNING: 3,
  5268. FADEIN: 4
  5269. }
  5270. }
  5271. , {}],
  5272. 19: [function(e, t, i) {
  5273. "use strict";
  5274. var n = e("three");
  5275. t.exports = {
  5276. newBlue: new n.Color(4967932),
  5277. altBlue: new n.Color(47355),
  5278. tagDefault: new n.Color(223357),
  5279. classicBlue: new n.Color(53759),
  5280. mpYellow: new n.Color(16502016),
  5281. mpOrange: new n.Color(16428055),
  5282. mpBlue: new n.Color(12096),
  5283. mpLtGrey: new n.Color(13751252),
  5284. mpDkGrey: new n.Color(10000019),
  5285. mpRed: new n.Color(12525854),
  5286. mpOrangeDesat: new n.Color(16764529),
  5287. mpBlueDesat: new n.Color(4034734),
  5288. mpRedDesat: new n.Color(14705505),
  5289. white: new n.Color(16777215),
  5290. black: new n.Color(0),
  5291. _desat: function(e, t) {
  5292. var i = t || .3
  5293. , r = (new n.Color).copy(e).getHSL();
  5294. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  5295. },
  5296. _darken: function(e, t) {
  5297. var i = t || .2
  5298. , r = e.getHSL();
  5299. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  5300. }
  5301. }
  5302. }
  5303. , {
  5304. three: 217
  5305. }],
  5306. 20: [function(e, t, i) {
  5307. "use strict";
  5308. t.exports = {
  5309. NONE: -1,
  5310. ROTATE: 0,
  5311. DOLLY: 1,
  5312. PAN: 2,
  5313. ROTATE_DOLLY: 3,
  5314. PAN_DOLLY: 4
  5315. }
  5316. }
  5317. , {}],
  5318. 21: [function(e, t, i) {
  5319. "use strict";
  5320. t.exports = {
  5321. Move: "move",
  5322. InteractionDirect: "interaction.direct",
  5323. InteractionKey: "interaction.key",
  5324. InteractionGui: "interaction.gui",
  5325. FlyInDirection: "fly.direction",
  5326. InputStart: "input.start",
  5327. Pinch: "input.pinch",
  5328. Scroll: "input.scroll",
  5329. AutoPanInterrupt: "autopan.interrupt",
  5330. AutoPanComplete: "autopan.complete",
  5331. AutoPanClamped: "autopan.clamped",
  5332. LongTap: "longtap"
  5333. }
  5334. }
  5335. , {}],
  5336. 22: [function(e, t, i) {
  5337. "use strict";
  5338. t.exports = Object.freeze({
  5339. FORWARD: "FORWARD",
  5340. LEFT: "LEFT",
  5341. RIGHT: "RIGHT",
  5342. BACK: "BACK",
  5343. UP: "UP",
  5344. DOWN: "DOWN"
  5345. })
  5346. }
  5347. , {}],
  5348. 23: [function(e, t, i) {
  5349. "use strict";
  5350. t.exports = {
  5351. ActionInterrupted: "action.interrupted",
  5352. TourStart: "tour.start",
  5353. TourEnd: "tour.end",
  5354. StartModeChange: "mode.startChange"
  5355. }
  5356. }
  5357. , {}],
  5358. 24: [function(e, t, i) {
  5359. "use strict";
  5360. t.exports = Object.freeze({
  5361. None: 0,
  5362. Queued: 1,
  5363. ForceQueued: 2,
  5364. Downloading: 3,
  5365. Downloaded: 4,
  5366. DownloadFailed: 5
  5367. })
  5368. }
  5369. , {}],
  5370. 25: [function(e, t, i) {
  5371. "use strict";
  5372. t.exports = {
  5373. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5374. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5375. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5376. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5377. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5378. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5379. }
  5380. }
  5381. , {}],
  5382. 26: [function(e, t, i) {
  5383. "use strict";
  5384. t.exports = {
  5385. Texture2D: 0,
  5386. TextureCube: 1
  5387. }
  5388. }
  5389. , {}],
  5390. 27: [function(e, t, i) {
  5391. "use strict";
  5392. t.exports = {
  5393. SMALL: "small",
  5394. LARGE: "large"
  5395. }
  5396. }
  5397. , {}],
  5398. 28: [function(e, t, i) {
  5399. "use strict";
  5400. var n = e("./Viewmode")
  5401. , r = {
  5402. LANDING: {},
  5403. NAVIGATION: "navigation",
  5404. MORE_HELP: "moreHelp",
  5405. TOUR_INTERACTION: {}
  5406. };
  5407. r.LANDING[n.PANORAMA] = "panorama.landing",
  5408. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5409. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5410. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5411. r.TOUR_INTERACTION.standard = "standard.tour",
  5412. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5413. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5414. t.exports = r
  5415. }
  5416. , {
  5417. "./Viewmode": 51
  5418. }],
  5419. 29: [function(e, t, i) {
  5420. "use strict";
  5421. var n = {
  5422. UP: 1,
  5423. DOWN: -1,
  5424. LEFT: "L",
  5425. RIGHT: "R",
  5426. FORWARD: "F",
  5427. BACK: "B",
  5428. reverse: {},
  5429. opposite: function(e) {
  5430. return this.reverse[e.toString()]
  5431. }
  5432. };
  5433. !function() {
  5434. n.reverse[n.UP] = n.DOWN,
  5435. n.reverse[n.DOWN] = n.UP,
  5436. n.reverse[n.LEFT] = n.RIGHT,
  5437. n.reverse[n.RIGHT] = n.LEFT,
  5438. n.reverse[n.FORWARD] = n.BACK,
  5439. n.reverse[n.BACK] = n.FORWARD
  5440. }(),
  5441. t.exports = n
  5442. }
  5443. , {}],
  5444. 30: [function(e, t, i) {
  5445. "use strict";
  5446. var n = e("../util/browser")
  5447. , r = {
  5448. ZERO: 48,
  5449. ONE: 49,
  5450. TWO: 50,
  5451. THREE: 51,
  5452. FOUR: 52,
  5453. FIVE: 53,
  5454. SIX: 54,
  5455. SEVEN: 55,
  5456. EIGHT: 56,
  5457. NINE: 57,
  5458. LEFTARROW: 37,
  5459. UPARROW: 38,
  5460. RIGHTARROW: 39,
  5461. DOWNARROW: 40,
  5462. A: 65,
  5463. B: 66,
  5464. C: 67,
  5465. D: 68,
  5466. E: 69,
  5467. F: 70,
  5468. G: 71,
  5469. H: 72,
  5470. I: 73,
  5471. J: 74,
  5472. K: 75,
  5473. L: 76,
  5474. M: 77,
  5475. N: 78,
  5476. O: 79,
  5477. P: 80,
  5478. Q: 81,
  5479. R: 82,
  5480. S: 83,
  5481. T: 84,
  5482. U: 85,
  5483. V: 86,
  5484. W: 87,
  5485. X: 88,
  5486. Y: 89,
  5487. Z: 90,
  5488. SPACE: 32,
  5489. RETURN: 13,
  5490. SEMICOLON: 186,
  5491. PLUSEQUALS: 187,
  5492. DASHUNDERSCORE: 189,
  5493. OPENBRACKET: 219
  5494. };
  5495. n.detectFirefox() && (r.SEMICOLON = 59,
  5496. r.PLUSEQUALS = 61,
  5497. r.DASHUNDERSCORE = 173),
  5498. t.exports = r
  5499. }
  5500. , {
  5501. "../util/browser": 182
  5502. }],
  5503. 31: [function(e, t, i) {
  5504. "use strict";
  5505. t.exports = {
  5506. EN_US: "en-US",
  5507. ES_MX: "es-MX",
  5508. FR_FR: "fr-FR",
  5509. DE_DE: "de-DE",
  5510. RU_RU: "ru-RU",
  5511. CN_CN: "cn-CN",
  5512. JP_JP: "jp-JP"
  5513. }
  5514. }
  5515. , {}],
  5516. 32: [function(e, t, i) {
  5517. "use strict";
  5518. t.exports = {
  5519. TagActivated: "tag.activated",
  5520. TagDismissed: "tag.dismissed",
  5521. TagNavigation: "tag.navigation"
  5522. }
  5523. }
  5524. , {}],
  5525. 33: [function(e, t, i) {
  5526. "use strict";
  5527. t.exports = {
  5528. ModelAdded: "model-added",
  5529. ActiveModelChanged: "active-model-changed"
  5530. }
  5531. }
  5532. , {}],
  5533. 34: [function(e, t, i) {
  5534. "use strict";
  5535. t.exports = {
  5536. LEFT: 0,
  5537. MIDDLE: 1,
  5538. RIGHT: 2
  5539. }
  5540. }
  5541. , {}],
  5542. 35: [function(e, t, i) {
  5543. "use strict";
  5544. t.exports = {
  5545. PanoRenderComplete: "panorama.render.complete",
  5546. TileRenderFailure: "panorama.tile.render.failed",
  5547. TileRenderSuccess: "panorama.tile.render.success",
  5548. TileUploadAttempted: "panorama.tile.upload.attempted",
  5549. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5550. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5551. }
  5552. }
  5553. , {}],
  5554. 36: [function(e, t, i) {
  5555. "use strict";
  5556. t.exports = {
  5557. BASE: 1,
  5558. STANDARD: 2,
  5559. HIGH: 3,
  5560. ULTRAHIGH: 4
  5561. }
  5562. }
  5563. , {}],
  5564. 37: [function(e, t, i) {
  5565. "use strict";
  5566. t.exports = {
  5567. LoadComplete: "panorama.load.complete",
  5568. LoadFailed: "panorama.load.failed",
  5569. TileLoaded: "panorama.tile.loaded"
  5570. }
  5571. }
  5572. , {}],
  5573. 38: [function(e, t, i) {
  5574. "use strict";
  5575. t.exports = Object.freeze({
  5576. Standard: 0,
  5577. Slow: 1,
  5578. Retain: 2
  5579. })
  5580. }
  5581. , {}],
  5582. 39: [function(e, t, i) {
  5583. "use strict";
  5584. t.exports = Object.freeze({
  5585. Show: 0,
  5586. Hide: 1,
  5587. Retain: 2
  5588. })
  5589. }
  5590. , {}],
  5591. 40: [function(e, t, i) {
  5592. "use strict";
  5593. t.exports = {
  5594. Move: "move",
  5595. MoveComplete: "move.complete",
  5596. ModeChanged: "mode.changed",
  5597. ModeChanging: "mode.changing",
  5598. PanoChosen: "pano.chosen",
  5599. ClosestPanoChanging: "closest.pano.changing",
  5600. WarpStarted: "warp.started",
  5601. WarpInterrupted: "warp.interrupted",
  5602. WarpEnded: "warp.ended",
  5603. FlyinFinished: "flyin.finished",
  5604. FlyingStarted: "flying.started",
  5605. FlyingInterrupted: "flying.interrupted",
  5606. FlyingEnded: "flying.ended",
  5607. Ready: "ready",
  5608. StartInside: "start.inside",
  5609. StartOutside: "start.outside",
  5610. ViewChanged: "view.changed",
  5611. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5612. InputStart: "input.start"
  5613. }
  5614. }
  5615. , {}],
  5616. 41: [function(e, t, i) {
  5617. "use strict";
  5618. t.exports = Object.freeze({
  5619. DEFAULT: 0,
  5620. PANOMARKERS: 1,
  5621. RETICULE: 2,
  5622. TAG: 3
  5623. })
  5624. }
  5625. , {}],
  5626. 42: [function(e, t, i) {
  5627. "use strict";
  5628. t.exports = {
  5629. visibleFloor: 1,
  5630. ghostFloor: 3,
  5631. boundingSkybox: 1,
  5632. panoMarker: 2,
  5633. reticule: 3,
  5634. tagStem: 4,
  5635. tagDisc: 5,
  5636. ribbon: 100
  5637. }
  5638. }
  5639. , {}],
  5640. 43: [function(e, t, i) {
  5641. "use strict";
  5642. t.exports = {
  5643. ContextCreated: "scene-renderer-context-created",
  5644. AfterRender: "after-render",
  5645. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5646. }
  5647. }
  5648. , {}],
  5649. 44: [function(e, t, i) {
  5650. "use strict";
  5651. t.exports = {
  5652. IDLE: "idle",
  5653. BROWSE: "browse",
  5654. EXAMINE: "examine"
  5655. }
  5656. }
  5657. , {}],
  5658. 45: [function(e, t, i) {
  5659. "use strict";
  5660. t.exports = {
  5661. TileDownloadSuccess: "tiledownloader.download.success",
  5662. TileDownloadFailure: "tiledownloader.download.failure",
  5663. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5664. }
  5665. }
  5666. , {}],
  5667. 46: [function(e, t, i) {
  5668. "use strict";
  5669. t.exports = {
  5670. CardboardAndroid: "googlevr",
  5671. GearVR: "gearvr",
  5672. CardboardIOS: "googlevrios",
  5673. Cardboard: "googlevr"
  5674. }
  5675. }
  5676. , {}],
  5677. 47: [function(e, t, i) {
  5678. "use strict";
  5679. t.exports = {
  5680. NONE: 0,
  5681. CONTEXTUAL: 1,
  5682. ANDROID: 2
  5683. }
  5684. }
  5685. , {}],
  5686. 48: [function(e, t, i) {
  5687. "use strict";
  5688. var n = {
  5689. Title: 0,
  5690. Cardboard: 1
  5691. }
  5692. , r = {
  5693. Title: 0,
  5694. Cardboard: 1,
  5695. Gear: 2
  5696. };
  5697. !function() {
  5698. [n, r].forEach(function(e) {
  5699. e.pageCount = Object.keys(e).length
  5700. })
  5701. }(),
  5702. t.exports.ios = n,
  5703. t.exports.standard = r
  5704. }
  5705. , {}],
  5706. 49: [function(e, t, i) {
  5707. "use strict";
  5708. t.exports = {
  5709. Android: "android",
  5710. IOS: "ios",
  5711. Desktop: "desktop",
  5712. UnsupportedAndroid: "android-unsupported"
  5713. }
  5714. }
  5715. , {}],
  5716. 50: [function(e, t, i) {
  5717. "use strict";
  5718. var n = e("three");
  5719. t.exports = {
  5720. UP: new n.Vector3(0,1,0),
  5721. DOWN: new n.Vector3(0,-1,0),
  5722. LEFT: new n.Vector3(-1,0,0),
  5723. RIGHT: new n.Vector3(1,0,0),
  5724. FORWARD: new n.Vector3(0,0,-1),
  5725. BACK: new n.Vector3(0,0,1)
  5726. }
  5727. }
  5728. , {
  5729. three: 217
  5730. }],
  5731. 51: [function(e, t, i) {
  5732. "use strict";
  5733. var n = e("../exception/ViewmodeConvertException")
  5734. , r = e("./coreViewmodes")
  5735. , o = e("../util/common")
  5736. , a = {
  5737. MESH: "mesh",
  5738. OUTDOOR: "outdoor",
  5739. TRANSITIONING: "transitioning",
  5740. toInt: function(e) {
  5741. switch (e) {
  5742. case this.PANORAMA:
  5743. return 1;
  5744. case this.DOLLHOUSE:
  5745. return 2;
  5746. case this.FLOORPLAN:
  5747. return 3;
  5748. case this.OUTDOOR:
  5749. return 4;
  5750. case this.TRANSITIONING:
  5751. return -1
  5752. }
  5753. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5754. },
  5755. fromInt: function(e) {
  5756. switch (e) {
  5757. case "1":
  5758. case 1:
  5759. return this.PANORAMA;
  5760. case "2":
  5761. case 2:
  5762. return this.DOLLHOUSE;
  5763. case "3":
  5764. case 3:
  5765. return this.FLOORPLAN;
  5766. case "4":
  5767. case 4:
  5768. return this.OUTDOOR
  5769. }
  5770. throw new n("No known conversion for int to viewmode for int: " + e)
  5771. },
  5772. convertWorkshopModeInt: function(e) {
  5773. switch (e) {
  5774. case "0":
  5775. case 0:
  5776. case undefined: //xzw add
  5777. return this.PANORAMA;
  5778. case "1":
  5779. case 1:
  5780. return this.FLOORPLAN;
  5781. case "2":
  5782. case 2:
  5783. return this.DOLLHOUSE;
  5784. case "3":
  5785. case 3:
  5786. return this.MESH
  5787. }
  5788. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5789. }
  5790. };
  5791. o.extendObject(a, r),
  5792. t.exports = a
  5793. }
  5794. , {
  5795. "../exception/ViewmodeConvertException": 58,
  5796. "../util/common": 185,
  5797. "./coreViewmodes": 54
  5798. }],
  5799. 52: [function(e, t, i) {
  5800. "use strict";
  5801. t.exports = {
  5802. BLACK: "black",
  5803. STD: "std",
  5804. WALK: "walk"
  5805. }
  5806. }
  5807. , {}],
  5808. 53: [function(e, t, i) {
  5809. "use strict";
  5810. t.exports = {
  5811. ZoomIn: "zoom.in",
  5812. ZoomOut: "zoom.out",
  5813. ZoomMax: "zoom.max",
  5814. ZoomMin: "zoom.min"
  5815. }
  5816. }
  5817. , {}],
  5818. 54: [function(e, t, i) {
  5819. "use strict";
  5820. t.exports = {
  5821. PANORAMA: "panorama",
  5822. DOLLHOUSE: "dollhouse",
  5823. FLOORPLAN: "floorplan"
  5824. }
  5825. }
  5826. , {}],
  5827. 55: [function(e, t, i) {
  5828. "use strict";
  5829. function n(e) {
  5830. this.message = e
  5831. }
  5832. t.exports = n
  5833. }
  5834. , {}],
  5835. 56: [function(e, t, i) {
  5836. "use strict";
  5837. function n(e) {
  5838. r.call(this, e)
  5839. }
  5840. var r = e("./BasicException");
  5841. n.prototype = Object.create(r.prototype),
  5842. t.exports = n
  5843. }
  5844. , {
  5845. "./BasicException": 55
  5846. }],
  5847. 57: [function(e, t, i) {
  5848. "use strict";
  5849. function n(e) {
  5850. r.call(this, e)
  5851. }
  5852. var r = e("./BasicException");
  5853. n.prototype = Object.create(r.prototype),
  5854. t.exports = n
  5855. }
  5856. , {
  5857. "./BasicException": 55
  5858. }],
  5859. 58: [function(e, t, i) {
  5860. "use strict";
  5861. function n(e) {
  5862. r.call(this, e)
  5863. }
  5864. var r = e("./BasicException");
  5865. n.prototype = Object.create(r.prototype),
  5866. t.exports = n
  5867. }
  5868. , {
  5869. "./BasicException": 55
  5870. }],
  5871. 59: [function(e, t, i) {
  5872. (function(i) {
  5873. "use strict";
  5874. function n(e) {
  5875. var t = {};
  5876. if (e) {
  5877. var i = e.flags;
  5878. if (i)
  5879. for (var n in i)
  5880. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5881. return t
  5882. }
  5883. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5884. null
  5885. }
  5886. var r = e("./util/ajax")
  5887. , o = e("./util/showcase")
  5888. , a = e("./util/logger")
  5889. , s = ""
  5890. , l = new a(i)
  5891. , c = {};
  5892. t.exports = {
  5893. loadFeatureFlags: function(e) {
  5894. var t = $.Deferred();
  5895. return r.get(e.urlBase + s, {
  5896. responseType: "json",
  5897. prefetchFrom: "user",
  5898. auth: o.getAuthorizationHeader()
  5899. }).done(function(e) {
  5900. c = n(e),
  5901. c ? t.resolve(c) : t.reject("loading-failed")
  5902. }).fail(function() {
  5903. l.debug("Retrieval of feature flags failed."),
  5904. t.reject("loading-failed")
  5905. }),
  5906. t.promise()
  5907. },
  5908. getFlags: function() {
  5909. return c
  5910. },
  5911. updateDependentSettings: function(e, t) {
  5912. e = e || c,
  5913. e.labels && (t.labels.enabled = !0),
  5914. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5915. e.showcase_sdk && (t.sdkInit = !0),
  5916. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5917. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5918. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5919. e.hide_sc_sharing && (t.share.enabled = !1)
  5920. }
  5921. }
  5922. }
  5923. ).call(this, "/js/featureflags.js")
  5924. }
  5925. , {
  5926. "./util/ajax": 181,
  5927. "./util/logger": 189,
  5928. "./util/showcase": 193
  5929. }],
  5930. 60: [function(e, t, i) {
  5931. "use strict";
  5932. var n = (e("../util/common"),
  5933. {
  5934. status: 0,
  5935. set: function(e) {
  5936. if (isNaN(e))
  5937. return !1;
  5938. var t = $('.progressbar');
  5939. 0 > e && (e = 0);
  5940. e > 100 && (e = 100);
  5941. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5942. var barperc = e*width;
  5943. var perc = Math.round(e);
  5944. var labelpos = (parseInt(barperc)-15);
  5945. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5946. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5947. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5948. this.status = e
  5949. },
  5950. done: function(e) {
  5951. return e || this.status ? (this.status = null,
  5952. this.set(100)) : this
  5953. }
  5954. });
  5955. t.exports.circleLoader = n
  5956. }
  5957. , {
  5958. "../util/common": 185
  5959. }],
  5960. 61: [function(e, t, i) {
  5961. "use strict";
  5962. t.exports = Object.freeze({
  5963. CLOSE: "modal.closer.close"
  5964. })
  5965. }
  5966. , {}],
  5967. 62: [function(e, t, i) {
  5968. "use strict";
  5969. function n(e, t) {
  5970. t && (t.stopPropagation(),
  5971. t.preventDefault()),
  5972. e && this.emit(l.CLOSE, e),
  5973. g.reset()
  5974. }
  5975. function r(e, t) {
  5976. function i() {
  5977. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5978. t !== f && (f = t,
  5979. t ? (e.classList.add("closeByFooter"),
  5980. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5981. h.classList.remove("closeByFooter")))
  5982. }
  5983. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5984. }
  5985. var o = e("../../settings")
  5986. , a = (e("../../tag/Media/MediaEvent"),
  5987. e("../../util/browser"))
  5988. , s = e("../../util/common")
  5989. , l = e("./ModalCloserEvent")
  5990. , c = e("events").EventEmitter
  5991. , h = document.getElementsByClassName("footer")[0]
  5992. , u = h.querySelectorAll(".close")[0]
  5993. , d = null
  5994. , p = null
  5995. , f = null
  5996. , g = (a.isMobile(),
  5997. {
  5998. open: function(e) {
  5999. e && (r(e),
  6000. d && u.removeEventListener("click", d, !0),
  6001. d = n.bind(this, e.id),
  6002. u.addEventListener("click", d, !0),
  6003. p && window.removeEventListener("resize", p, !0),
  6004. p = r.bind(this, e),
  6005. window.addEventListener("resize", p, !0))
  6006. },
  6007. reset: function() {
  6008. h.classList.remove("closeByFooter"),
  6009. u.removeEventListener("click", d, !0),
  6010. window.removeEventListener("resize", p, !0),
  6011. d = p = f = null
  6012. }
  6013. });
  6014. s.extendObject(g, c.prototype),
  6015. t.exports = g
  6016. }
  6017. , {
  6018. "../../tag/Media/MediaEvent": 131,
  6019. "../../settings": 166,
  6020. "../../util/browser": 182,
  6021. "../../util/common": 185,
  6022. "./ModalCloserEvent": 61,
  6023. events: 202
  6024. }],
  6025. 63: [function(e, t, i) {
  6026. "use strict";
  6027. function n(e, t, i) {
  6028. var n = new r.GUI({
  6029. width: 400
  6030. })
  6031. , u = n.addFolder("Flydown from Dollhouse");
  6032. u.add(h.flydown, "movementEasing", Object.keys(a)),
  6033. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  6034. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  6035. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  6036. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  6037. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  6038. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  6039. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  6040. var d = n.addFolder("Transition between panos");
  6041. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  6042. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6043. h.transition.flyTime = 0,
  6044. d.__controllers.forEach(function(e) {
  6045. e.updateDisplay()
  6046. })
  6047. }),
  6048. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  6049. h.transition.flySpeed = 0,
  6050. d.__controllers.forEach(function(e) {
  6051. e.updateDisplay()
  6052. })
  6053. }),
  6054. d.add(h.transition, "aimTime", 500, 2500).step(50),
  6055. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  6056. d.add(h.transition, "movementEasing", Object.keys(a));
  6057. var p = n.addFolder("Path Display");
  6058. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  6059. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  6060. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  6061. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  6062. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6063. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  6064. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  6065. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  6066. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  6067. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  6068. h.path.color = l[h.path.color],
  6069. h.path.colorUp = l._desat(h.path.color),
  6070. h.path.colorDown = l.darken(h.path.color)
  6071. }),
  6072. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  6073. h.reticuleColor = l[h.reticuleColor]
  6074. });
  6075. var f = n.addFolder("Warping")
  6076. , g = f.addFolder("Warp/Teleport");
  6077. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  6078. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6079. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  6080. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  6081. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  6082. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  6083. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  6084. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  6085. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6086. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  6087. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  6088. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6089. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  6090. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  6091. h.path.typ = c[h.path.typ]
  6092. }),
  6093. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  6094. t.endlessLoop = h.warp.loop
  6095. }),
  6096. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  6097. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  6098. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  6099. var m = f.addFolder("Long Warp Only");
  6100. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  6101. h.warp.flySpeed = 0,
  6102. m.__controllers.forEach(function(e) {
  6103. e.updateDisplay()
  6104. })
  6105. }),
  6106. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  6107. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  6108. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  6109. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6110. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  6111. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  6112. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  6113. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  6114. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  6115. var v = n.addFolder("Warp Esoterica");
  6116. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  6117. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  6118. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  6119. h.warp.minWarpTime = 0,
  6120. v.__controllers.forEach(function(e) {
  6121. e.updateDisplay()
  6122. })
  6123. }),
  6124. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  6125. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  6126. v.add(h.warp, "movementEasing", Object.keys(a));
  6127. var A = n.addFolder("Misc");
  6128. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  6129. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6130. }),
  6131. A.add(h, "insideFOV", 10, 180).onChange(function() {
  6132. i.cameras[s.PANORAMA].fov = h.insideFOV
  6133. }),
  6134. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  6135. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  6136. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  6137. var y = n.addFolder("Navigation");
  6138. y.add(h.navigation, "panoScores").onFinishChange(function() {
  6139. h.navigation.panoScores || e.panos.forEach(function(e) {
  6140. e.floor.remove(e.text3d),
  6141. e.text3d = null
  6142. })
  6143. }),
  6144. y.add(h.navigation, "mouseDirection"),
  6145. y.add(h.navigation, "filterStrictness", 0, 1),
  6146. y.add(h.navigation, "angleFactor", -60, 0),
  6147. y.add(h.navigation, "directionFactor", 1, 20),
  6148. y.add(h.navigation, "distanceFactor", -5, 5),
  6149. y.add(h.navigation, "optionalityFactor", .1, 10);
  6150. var C = n.addFolder("tags")
  6151. , I = C.addFolder("Tag Creation");
  6152. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  6153. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  6154. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  6155. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  6156. var E = C.addFolder("Visibility");
  6157. E.add(h.tags.visibility, "anyDistance"),
  6158. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  6159. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  6160. E.add(h.tags.visibility, "hideViaFloor"),
  6161. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  6162. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  6163. var b = C.addFolder("Disc Parameters");
  6164. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  6165. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  6166. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  6167. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6168. }),
  6169. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  6170. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6171. }),
  6172. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  6173. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  6174. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  6175. var w = C.addFolder("Navigate");
  6176. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  6177. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  6178. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  6179. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  6180. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  6181. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  6182. var _ = n.addFolder("Debug");
  6183. _.add(h, "wireframe").onFinishChange(function() {
  6184. e.chunks.forEach(function(t) {
  6185. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  6186. t.wireframeTwin.material.depthWrite = !1,
  6187. t.wireframeTwin.material.depthTest = !1,
  6188. t.wireframeTwin.material.opacity = .5,
  6189. t.wireframeTwin.material.transparent = !0),
  6190. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6191. })
  6192. }),
  6193. _.add(h, "skyboxWireframe").onFinishChange(function() {
  6194. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  6195. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  6196. e.skybox.wireframe = null)
  6197. }),
  6198. _.add(h, "showSweeps").onFinishChange(function() {
  6199. e.setSweepVisibility(h.showSweeps)
  6200. }),
  6201. _.add(h, "showMesh").onFinishChange(function() {
  6202. e.chunks.forEach(function(e) {
  6203. e.visible = h.showMesh
  6204. })
  6205. }),
  6206. _.add(h, "showFloors").onFinishChange(function() {
  6207. e.floors.forEach(function(e) {
  6208. e.collider.children.forEach(function(e) {
  6209. e.material.visible = h.showFloors
  6210. })
  6211. })
  6212. }),
  6213. _.add(h, "showSkyboxes").onFinishChange(function() {
  6214. e.panos.forEach(function(e) {
  6215. e.skyboxMesh.visible = h.showSkyboxes
  6216. })
  6217. }),
  6218. _.add(h, "showNeighbors").onChange(function() {}),
  6219. _.add(e, "alpha", 0, 1)
  6220. }
  6221. var r = e("../lib/dat.gui")
  6222. , o = e("three")
  6223. , a = e("../util/easing")
  6224. , s = e("../enum/Viewmode")
  6225. , l = e("../enum/Colors")
  6226. , c = e("../enum/WarpStyle")
  6227. , h = e("../settings");
  6228. e("../tag/tag");
  6229. r.GUI.prototype.removeFolder = function(e) {
  6230. var t = this.__folders[e];
  6231. t && (t.close(),
  6232. this.__ul.removeChild(t.domElement.parentNode),
  6233. delete this.__folders[e],
  6234. this.onResize())
  6235. }
  6236. ,
  6237. t.exports.toggle = n
  6238. }
  6239. , {
  6240. "../enum/Colors": 19,
  6241. "../enum/Viewmode": 51,
  6242. "../enum/WarpStyle": 52,
  6243. "../lib/dat.gui": 93,
  6244. "../tag/tag": 123,
  6245. "../settings": 166,
  6246. "../util/easing": 186,
  6247. three: 217
  6248. }],
  6249. 64: [function(e, t, i) {
  6250. (function(i) {
  6251. "use strict";
  6252. function n(e, t, i, n) {
  6253. $(".gui-error .error-problem-text").text(e),
  6254. $(".gui-error .error-solution-text").text(t),
  6255. $(".gui-error .error-explanation").text(i),
  6256. $(".gui-error .error-actions").html(n),
  6257. $(window).resize(),
  6258. $(".gui-error").fadeIn(),
  6259. $("#bottom-logo").fadeIn()
  6260. }
  6261. function r(e) {
  6262. 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("");
  6263. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6264. s.isMobile() || $("[rel=tiletip]").tooltip({
  6265. placement: "bottom",
  6266. delay: {
  6267. show: 50,
  6268. hide: 0
  6269. },
  6270. trigger: "hover",
  6271. viewport: {
  6272. selector: "body",
  6273. padding: 10
  6274. }
  6275. })
  6276. }
  6277. function o() {
  6278. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  6279. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  6280. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  6281. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  6282. e.preventDefault(),
  6283. e.stopPropagation(),
  6284. r(" ")
  6285. })
  6286. }
  6287. function a(e) {
  6288. if ($("head title").text(c.pageTitle),
  6289. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  6290. $("#gui-loading").fadeOut(250),
  6291. $("#quick-blackout").hide(),
  6292. l.track("showcase_error", {
  6293. error_key: e
  6294. }),
  6295. h.locale || h.init(),
  6296. "webgl-unsupported" === e)
  6297. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  6298. else if ("webgl-ios" === e)
  6299. 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>.");
  6300. else if ("webgl-safari" === e)
  6301. 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>.");
  6302. else if ("webgl-generic" === e)
  6303. o();
  6304. else if ("missing-urls" === e)
  6305. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  6306. else if ("loading-failed" === e)
  6307. 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>.");
  6308. else {
  6309. if ("loading-failed-maintenance" !== e)
  6310. return void d.error("Unhandled error: " + e);
  6311. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6312. }
  6313. }
  6314. var s = e("./../util/browser")
  6315. , l = e("./../analytics")
  6316. , c = e("./../settings")
  6317. , h = e("../localization/localize")
  6318. , u = e("./../util/logger")
  6319. , d = new u(i)
  6320. , p = '"https://support.port.com/hc/articles/208220058"';
  6321. t.exports.error = a
  6322. }
  6323. ).call(this, "/js/gui/error.js")
  6324. }
  6325. , {
  6326. "../localization/localize": 108,
  6327. "./../analytics": 4,
  6328. "./../settings": 166,
  6329. "./../util/browser": 182,
  6330. "./../util/logger": 189
  6331. }],
  6332. 65: [function(e, t, i) {
  6333. (function(i) {
  6334. "use strict";
  6335. function n() {
  6336. Ue = [],
  6337. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6338. Ue.push(".hideTarget", ".pinTop.right")
  6339. }
  6340. function r() {
  6341. for (var e in je)
  6342. if (je.hasOwnProperty(e)) {
  6343. var t = je[e];
  6344. if (!t.visible)
  6345. for (var i = 0; i < t.elements.length; i++)
  6346. $(t.elements[i]).hide()
  6347. }
  6348. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6349. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6350. n()
  6351. }
  6352. function o(e, t) {
  6353. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6354. $("#gui-zoomin").toggle(i),
  6355. $("#gui-zoomout").toggle(i)
  6356. }
  6357. function a() {
  6358. c(),
  6359. $(".pinBottom").toggleClass("open"),
  6360. $("#drawer").toggleClass("open"),
  6361. $(".footer").toggleClass("open"),
  6362. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6363. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6364. ie.resetDrawer()),
  6365. setTimeout(function() {
  6366. $("#pullTab").toggleClass("opened");
  6367. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6368. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6369. }
  6370. function s(e) {
  6371. var t;
  6372. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6373. t = e.position().top + e.outerHeight(),
  6374. e.attr("style", "display: none"));
  6375. var i = $("#player").outerHeight()
  6376. , n = i - 130;
  6377. return n < t + 25
  6378. }
  6379. function l(e) {
  6380. "touchstart" === e.type && e.preventDefault(),
  6381. e.stopPropagation()
  6382. }
  6383. function c() {
  6384. W && (W.reload(),
  6385. W.init())
  6386. }
  6387. function h(e) {
  6388. ne.show(e),
  6389. r()
  6390. }
  6391. function u(e) {
  6392. ne.progress(e)
  6393. }
  6394. function d(e, t, i) {
  6395. var n = t.player;
  6396. $("#gui-thumb").fadeOut(2500),
  6397. ne.hide(function() {
  6398. Ge = !1
  6399. }),
  6400. me.init(e, i),
  6401. de.finishSetup(Object.keys(e.tags).length),
  6402. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6403. var s = function() {
  6404. i.dismissExaminedTag(),
  6405. i.disableHovering()
  6406. };
  6407. Ae.on(ye.OPENED, s),
  6408. Ce.on(Me.OPENED, s),
  6409. he.on(ue.OPENED, s),
  6410. fe.on(ge.OPENED, s);
  6411. var l = i.enableHovering.bind(i);
  6412. if (Ae.on(ye.CLOSED, l),
  6413. Ce.on(Me.CLOSED, l),
  6414. he.on(ue.CLOSED, l),
  6415. fe.on(ge.CLOSED, l),
  6416. Q.labels.enabled && Object.keys(e.labels).length,
  6417. (!settings.extractFloor || !settings.extractFloor[number]) && e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6418. C(e.currentFloor, n.mode)),
  6419. getQueryVariable('m') === '372'&& (je.floors.visible = 1, y(e,t)),
  6420. r(),
  6421. o(t, t.player),
  6422. $("#gui").fadeIn(1500),
  6423. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6424. a(),
  6425. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6426. }, 2e3),
  6427. !K.isMobile())
  6428. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6429. $(c[h]).addClass("hasHover");
  6430. O(e),
  6431. de.setupToggling();
  6432. //xzw:
  6433. window.editHotPanel && editHotPanel();
  6434. //czj
  6435. navBorderRadius(e);
  6436. //czj 编辑界面
  6437. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6438. window.EditTools && new EditTools(n.sceneRenderer);
  6439. }
  6440. function navBorderRadius(e){
  6441. var pullTab = $("#pullTab"),
  6442. mobileRadius = {
  6443. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6444. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6445. },
  6446. topRadius = {
  6447. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6448. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6449. };
  6450. function BorderRadius(bottom,top){
  6451. $("#gui-modes-map > div:visible:last").css(bottom);
  6452. if(pullTab.is(':visible')){
  6453. $(".viewContainer > div:visible:first").css(top);
  6454. }else{
  6455. $("#gui-modes-map > div:visible:first").css(top);
  6456. }
  6457. }
  6458. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6459. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6460. }else{
  6461. BorderRadius(topRadius.bottom,topRadius.top);
  6462. }
  6463. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6464. if(window.DATA.model.special || window.DATA.special){
  6465. window.specialScene && specialScene.special().afterImplement();
  6466. }
  6467. }
  6468. function p(e) {
  6469. e || (e = 0),
  6470. We = !1,
  6471. window.setTimeout(function() {
  6472. We || (ze = !0,
  6473. $("#gui-spinner").stop(!0, !0).show())
  6474. }
  6475. .bind(this), e)
  6476. }
  6477. function f() {
  6478. $("#gui-spinner").stop(!0, !0),
  6479. $("#gui-spinner").fadeOut(1e3),
  6480. We = !0,
  6481. ze = !1
  6482. }
  6483. function g(e, t) {
  6484. var i = e.mode
  6485. , n = t || e.currentPano;
  6486. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6487. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6488. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6489. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6490. Q.show360Views.enabled && !n.isAligned() ? (
  6491. $(".gui-floor").addClass("hidden"),
  6492. $("#gui-modes-outside").addClass("desktop-only")) : (
  6493. $(".gui-floor").removeClass("hidden"),
  6494. $("#gui-modes-outside").removeClass("desktop-only")),
  6495. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6496. Be = i,
  6497. $("#gui-modes-outside").addClass("hidden"),
  6498. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6499. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6500. }
  6501. function m(e, t) {
  6502. var i = t.player;
  6503. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6504. l(e),
  6505. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6506. J.track("USER", {
  6507. event_type: "showcase_gui",
  6508. gui_action: "click_inside_mode_button"
  6509. }),
  6510. t.changeMode(_e.PANORAMA);
  6511. }),
  6512. $("#gui-modes-outside").find("a").on("click", function(e) {
  6513. l(e),
  6514. J.track("showcase_gui", {
  6515. gui_action: "click_outside_mode_button"
  6516. }),
  6517. t.changeMode(Be)
  6518. }),
  6519. $("#gui-modes-floorplan").on("click", function(e) {
  6520. l(e),
  6521. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6522. gui_action: "click_floorplan_mode_button"
  6523. }),
  6524. t.changeMode(_e.FLOORPLAN));
  6525. }),
  6526. $("#gui-modes-dollhouse").on("click", function(e) {
  6527. l(e),
  6528. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6529. gui_action: "click_dollhouse_mode_button"
  6530. }),
  6531. t.changeMode(_e.DOLLHOUSE));
  6532. })
  6533. }
  6534. function v(e, t) {
  6535. function i() {
  6536. document.getElementById("vr").classList.remove("hidden"),
  6537. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6538. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6539. $(".improper-embed").toggleClass("hidden", !1),
  6540. r())
  6541. }, function(e) {
  6542. r()
  6543. }) : r()
  6544. }
  6545. function n(i) {
  6546. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6547. Ie.init(e.data, t, i, q),
  6548. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6549. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6550. }
  6551. function r() {
  6552. De.info("WebVR support not found, VR button activates native app VR modal"),
  6553. Ae.init(e.data, q),
  6554. Ae.on(ye.OPENED, function() {
  6555. var e = document.getElementById("vr-modal");
  6556. return function() {
  6557. Ze("vr"),
  6558. le.open(e)
  6559. }
  6560. }()),
  6561. Ae.on(ye.CLOSED, le.reset)
  6562. }
  6563. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0)){
  6564. /*********************** 方奕卓 VR功能事件监听 ********************/
  6565. K.isMobile() && $('#vr').css('display', ''); // 显示vr功能按钮
  6566. switch (Q.vr.option) {
  6567. case Pe.CONTEXTUAL:
  6568. i();
  6569. break;
  6570. case Pe.ANDROID:
  6571. K.detectAndroid() && i();
  6572. break;
  6573. case Pe.NONE:
  6574. }
  6575. }
  6576. }
  6577. function A(e, t) {
  6578. $("#play").on("mousedown touchstart", function(e) {
  6579. l(e);
  6580. Ze("tour");
  6581. ve.play();
  6582. J.trackAlways("showcase_gui", {
  6583. gui_action: "play_highlights"
  6584. })
  6585. }),
  6586. window.startAndPlay = function(e) {
  6587. // l(e);
  6588. Ze("tour");
  6589. ve.play();
  6590. J.trackAlways("showcase_gui", {
  6591. gui_action: "play_highlights"
  6592. })
  6593. };
  6594. $("#pause").on("mousedown touchstart", function(e) {
  6595. l(e),
  6596. ve.pause(),
  6597. J.trackAlways("showcase_gui", {
  6598. gui_action: "pause_highlights"
  6599. })
  6600. }),
  6601. $("#gui-zoomin").find("a").on("click", function(e) {
  6602. l(e),
  6603. t.player.zoomInIncrementally()
  6604. }),
  6605. $("#gui-zoomout").find("a").on("click", function(e) {
  6606. l(e),
  6607. t.player.zoomOutIncrementally()
  6608. })
  6609. }
  6610. function y(e, t) {
  6611. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6612. if(getQueryVariable('m') === '372') continue;
  6613. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6614. $(".gui-floor").find(".container").prepend(r)
  6615. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6616. }
  6617. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6618. i.on("click", function(e) {
  6619. l(e),
  6620. Ze("floor"),
  6621. i.toggleClass("open")
  6622. }),
  6623. $(".floorChoice").on("click", function(e) {
  6624. l(e);
  6625. var n = $(this).data("index");
  6626. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6627. t.player.gotoFloor(n),
  6628. J.track("showcase_gui", {
  6629. gui_action: "click_floor_select_button",
  6630. interaction_source: "gui"
  6631. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6632. Ze("move"),
  6633. t.allFloors(),
  6634. J.track("showcase_gui", {
  6635. gui_action: "click_toggle_all_floors_button",
  6636. interaction_source: "gui"
  6637. })),
  6638. i.removeClass("open")
  6639. })
  6640. }
  6641. function C(e, t) {
  6642. 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()),
  6643. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6644. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6645. $(".floorChoice").removeClass("active"),
  6646. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6647. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6648. $(".floorChoice").removeClass("active"),
  6649. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6650. }
  6651. function I(e) {
  6652. return e.describe().inTransition
  6653. }
  6654. function b(e, t, i) {
  6655. Fe = e.heroLocations.length;
  6656. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6657. , r = 100 / Fe + "%"
  6658. , o = $("#thumb-container")
  6659. , a = $("#progressBar");
  6660. $("#status").find(".totalSteps").text(Fe);
  6661. for (var s = 0; s < Fe; s++) {
  6662. var c = e.heroLocations[s]
  6663. , h = $(n);
  6664. var thumbUrl
  6665. if(c.heroLocations){//有子项,选第一张截图
  6666. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl)//.replace('https://','').replace('http://','')
  6667. }else{
  6668. thumbUrl = manage.dealURL(c.thumbUrl)//.replace('https://','').replace('http://','')
  6669. }
  6670. h.attr("data-index", s)
  6671. je.highlight.visible && h.find("img").attr("src", thumbUrl)
  6672. if (c.name) {
  6673. var u = $('<div class="overlay"></div>').text(c.name);
  6674. h.prepend(u)
  6675. }
  6676. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6677. var d = e.panos.get(c.panoId)
  6678. , p = d && !d.isAligned()
  6679. , 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>';
  6680. h.prepend(f)
  6681. }
  6682. o.append(h),
  6683. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6684. }
  6685. j = 144 * Fe,
  6686. Y = 111 * Fe,
  6687. $(".thumbImg").on("mouseover", function() {
  6688. I(t) || i.showPathToHeroLocation([$(this).data("index"),0])//改
  6689. }),
  6690. $(".thumbImg").on("mouseout", function() {
  6691. t.clearPath()
  6692. }),
  6693. $(".thumbImg").on("click", function(e) {
  6694. l(e);
  6695. var i = $(this);
  6696. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6697. J.trackAlways("showcase_gui", {
  6698. gui_action: "click_highlight"
  6699. }),
  6700. t.goToHighlight([i.data("index"),0])//改
  6701. }),
  6702. $(".previous").find("a").on("click", function(e) {
  6703. l(e),
  6704. J.trackAlways("showcase_gui", {
  6705. gui_action: "prev_highlight"
  6706. }),
  6707. t.prevHighlight()
  6708. }),
  6709. $(".next").find("a").on("click", function(e) {
  6710. l(e),
  6711. J.trackAlways("showcase_gui", {
  6712. gui_action: "next_highlight"
  6713. }),
  6714. t.nextHighlight()
  6715. }),
  6716. $("#drawer").on("mouseleave", function(e) {
  6717. l(e);
  6718. var t;
  6719. try {
  6720. t = new MouseEvent("mouseup",{
  6721. clientX: e.clientX,
  6722. clientY: e.clientY,
  6723. screenX: e.screenX,
  6724. screenY: e.screenY
  6725. })
  6726. } catch (i) {
  6727. t = document.createEvent("MouseEvents"),
  6728. 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)
  6729. }
  6730. document.dispatchEvent(t)
  6731. }),
  6732. W = new Sly($("#scrollFrame"),{
  6733. horizontal: !0,
  6734. itemNav: "centered",
  6735. smart: !0,
  6736. scrollTrap: !0,
  6737. scrollBy: 1,
  6738. mouseDragging: !0,
  6739. touchDragging: !0,
  6740. speed: 300,
  6741. dragHandle: !0,
  6742. dynamicHandle: !0,
  6743. clickBar: !0,
  6744. scrollBar: $("#scroller"),
  6745. activateOn: null
  6746. }).init(),
  6747. W.on("active", function(e, t) {
  6748. Ve = t,
  6749. Ze("tour"),
  6750. $(".step").removeClass("active"),
  6751. $("#status").find(".curIdx").text(t + 1);
  6752. for (var i = 0; i <= t; i++)
  6753. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6754. }),
  6755. w()
  6756. //add :
  6757. let scrollFrame = $(W.frame)
  6758. scrollFrame.on("wheel.sly", function() {
  6759. lastMoveScrollTime = Date.now()
  6760. })
  6761. let dragstart
  6762. /* scrollFrame.on("pointerdown", function() {
  6763. dragstart = true
  6764. })
  6765. scrollFrame.on("pointerup", function() {
  6766. dragstart = false
  6767. }) */
  6768. scrollFrame.on("pointermove", function() {
  6769. //if(dragstart){
  6770. lastMoveScrollTime = Date.now()
  6771. //}
  6772. })
  6773. }
  6774. function w() {
  6775. var e = $("#player").width() - 20
  6776. , t = $("#scroller")
  6777. , i = $("#drawer")
  6778. , n = $(".pinBottom");
  6779. if ($("#player").width() < 488 || $("#player").height() < 488)
  6780. t.addClass("hidden"),
  6781. i.addClass("noScroll"),
  6782. n.addClass("noScroll");
  6783. else {
  6784. var r = j > e
  6785. , o = !i.hasClass("noScroll")
  6786. , a = r !== o;
  6787. a && (t.toggleClass("hidden"),
  6788. i.toggleClass("noScroll"),
  6789. n.toggleClass("noScroll"))
  6790. }
  6791. }
  6792. function _(e) {
  6793. je.tourControls.visible = true//e.tour_buttons && K.valueFromHash("gt", 1),
  6794. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6795. je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights
  6796. }
  6797. function T(e) {
  6798. function t(t, i) {
  6799. return !!e.player_options[t] && e[i || t]
  6800. }
  6801. $(".model-title").text(e.name);
  6802. var i = Q.pageTitle;
  6803. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6804. 2 !== K.valueFromHash("mls", 0) && e.name && (i = e.name),
  6805. document.title = i ,
  6806. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6807. delay: {
  6808. show: 50,
  6809. hide: 0
  6810. },
  6811. trigger: "hover",
  6812. html: !1,
  6813. viewport: {
  6814. selector: "body",
  6815. padding: 10
  6816. }
  6817. }),
  6818. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6819. // 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"),
  6820. de.populate({
  6821. name: t("model_name", "name"),
  6822. coBrand: t("presented_by"),
  6823. description: t("model_summary", "summary") || "暂无内容",
  6824. contactName: t("contact_name"),
  6825. address: t("address"),
  6826. phone: t("contact_phone"),
  6827. formattedPhone: e.formatted_contact_phone,
  6828. email: t("contact_email"),
  6829. url: t("external_url"),
  6830. socialSharing: e.enable_social_sharing && e.is_public
  6831. })
  6832. }
  6833. function x(e, t, i, n, r, o) {
  6834. function a() {
  6835. o.setLoadingStartTime(),
  6836. H(),
  6837. r ? (re.showMessage(t, i, je.coBrand.visible),
  6838. l()) : h(l)
  6839. }
  6840. var s = $.Deferred()
  6841. , l = s.resolve.bind(s);
  6842. return Ge = !0,
  6843. O(e),
  6844. e.data.player_options && _(e.data.player_options),
  6845. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6846. Re.localizeGUI(),
  6847. T(e.data),
  6848. r || $(".quick").addClass("hidden"),
  6849. //e.data.image && !r && E(e.data.image),
  6850. n ? (J.impression(),
  6851. a()) : (o.setWaitingStartTime(),
  6852. oe.show(r, a)),
  6853. s
  6854. }
  6855. function S(e, t, i, n, r, a, s) {
  6856. q = s,
  6857. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6858. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6859. ae.init(),
  6860. re.init(e, a),
  6861. Oe.init(e, t, n),
  6862. $(".icon").on("mouseover", function() {
  6863. t.player && t.player.reticule.hide()
  6864. }),
  6865. m(e, t),
  6866. A(e, t),
  6867. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(window.DATA.name/* e.data.name */),
  6868. Ce.on(Me.OPENED, function() {
  6869. var e = document.getElementById("share-modal");
  6870. return function() {
  6871. Ze("share"),
  6872. le.open(e)
  6873. }
  6874. }()),
  6875. Ce.on(Me.CLOSED, le.reset)),
  6876. e.heroLocations.length > 0 ? b(e, t, i) : (je.highlight.visible = !1,
  6877. je.tourControls.visible = !1),
  6878. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6879. z(),
  6880. g(i),
  6881. v(e, r),
  6882. e.on("floor.changed", C),
  6883. e.on("waiting", R.bind(this, e)),
  6884. e.on("waiting-done", P.bind(this, e)),
  6885. i.on(xe.ModeChanged, function(e, n) {
  6886. g(i),
  6887. o(t, i),
  6888. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6889. he.updateMode(n)
  6890. }),
  6891. n.on(Se.Move, Ze.bind(this, "move")),
  6892. i.on(xe.Ready, function() {
  6893. ie.init(n, i, i.tagManager, t),
  6894. i.on(xe.ModeChanged, function(e, t) {
  6895. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6896. })
  6897. }),
  6898. i.on(xe.PanoChosen, function(e, t) {
  6899. g(i, t),
  6900. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6901. }),
  6902. le.on(ce.CLOSE, function(e) {
  6903. switch (e) {
  6904. case "vr-modal":
  6905. Ae.dismiss();
  6906. break;
  6907. case "share-modal":
  6908. Ce.hide();
  6909. break;
  6910. case "terms-modal":
  6911. fe.hide()
  6912. }
  6913. });
  6914. var l = $("#play").eq(0)
  6915. , c = $("#pause").eq(0)
  6916. , h = $(".pinBottom").toArray()
  6917. , u = $("#drawer").eq(0)
  6918. , d = $("#playHead").eq(0)
  6919. , p = $("#progressBar").eq(0)
  6920. , f = $("#thumb-container").eq(0)
  6921. , y = f.children()
  6922. , I = p.children();
  6923. t.on("update.controls", function() {//导览控制
  6924. var n = t.describe();
  6925. if(n.tourIsPlaying || i.isWarping()){
  6926. if(je.tourControls.visible){
  6927. l.hide() //play button
  6928. c.show() //pause button
  6929. }
  6930. if(n.tourInProgress){
  6931. h.forEach(function(e) {
  6932. e.classList.add("playing")
  6933. }),
  6934. u.addClass("playing"),
  6935. d.addClass("playing")
  6936. }
  6937. }else{
  6938. if(je.tourControls.visible){
  6939. l.show(),
  6940. c.hide()
  6941. }
  6942. if(!n.tourInProgress){
  6943. ve.stopTour(),
  6944. h.forEach(function(e) {
  6945. e.classList.remove("playing")
  6946. }),
  6947. u.removeClass("playing"),
  6948. d.removeClass("playing")
  6949. }
  6950. }
  6951. var r, a, s;
  6952. if (null !== n.currentItem) {
  6953. var p, f;
  6954. $("#status").find(".curIdx").text(n.currentItem[0] + 1),
  6955. n.onTheBus ? (p = "active",
  6956. f = "recent") : (f = "active",
  6957. p = "recent");
  6958. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0];
  6959. /* for (r = 0; r < e.heroLocations.length; r += 1)
  6960. s = y.eq(r),
  6961. a = I.eq(r),
  6962. s.removeClass(f),
  6963. a.removeClass(f),
  6964. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  6965. a.addClass(p),
  6966. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  6967. a.addClass(p)) : (s.removeClass(p),
  6968. a.removeClass(p)) */
  6969. for (r = 0; r < e.heroLocations.length; r += 1){
  6970. s = y.eq(r),
  6971. a = I.eq(r),
  6972. s.removeClass(f),
  6973. a.removeClass(f);
  6974. if(n.onTheBus && r === n.destinationItem[0]){
  6975. s.addClass(p)
  6976. a.addClass(p)
  6977. if(Date.now() - lastMoveScrollTime > 2000){ //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  6978. W.activate(r) // scrollbar slide to this
  6979. }
  6980. }else{
  6981. n.onTheBus && g && r === n.currentItem[0] ?
  6982. (s.addClass(p), a.addClass(p)) :
  6983. (s.removeClass(p), a.removeClass(p))
  6984. }
  6985. }
  6986. } else
  6987. for (r = 0; r < e.heroLocations.length; r += 1)
  6988. s = y.eq(r),
  6989. a = I.eq(r),
  6990. s.removeClass("active recent"),
  6991. a.removeClass("active recent");
  6992. o(t, i)
  6993. }),
  6994. document.addEventListener("keydown", function(n) {
  6995. switch (J.updateInteraction(Se.InteractionKey),
  6996. n.which) {
  6997. case we.ZERO:
  6998. Q.debug && e.toggleAlpha();
  6999. break;
  7000. case we.NINE:
  7001. Q.debug && se.toggle();
  7002. break;
  7003. case we.ONE:
  7004. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  7005. break;
  7006. case we.TWO:
  7007. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  7008. break;
  7009. case we.THREE:
  7010. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  7011. break;
  7012. case we.FOUR:
  7013. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  7014. break;
  7015. case we.SPACE:
  7016. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  7017. break;
  7018. case we.RETURN:
  7019. Q.debug && e.toggleExplodeUp();
  7020. break;
  7021. case we.P:
  7022. k();
  7023. break;
  7024. case we.U:
  7025. B();
  7026. break;
  7027. case we.X:
  7028. Q.debug && e.toggleExplode();
  7029. break;
  7030. case we.PLUSEQUALS:
  7031. t.player.activatePersistentZooming(!0),
  7032. ie.hideUi();
  7033. break;
  7034. case we.DASHUNDERSCORE:
  7035. t.player.activatePersistentZooming(!1),
  7036. ie.hideUi();
  7037. break;
  7038. case we.SEVEN:
  7039. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  7040. break;
  7041. case we.EIGHT:
  7042. t.player.decreaseZoomSpeed();
  7043. break;
  7044. case we.NINE:
  7045. t.player.increaseZoomSpeed()
  7046. }
  7047. return i && i.reticule.hide(),
  7048. !0
  7049. }
  7050. .bind(this)),
  7051. document.addEventListener("keyup", function(e) {
  7052. switch (e.which) {
  7053. case we.PLUSEQUALS:
  7054. t.player.deactivatePersistentZooming();
  7055. break;
  7056. case we.DASHUNDERSCORE:
  7057. t.player.deactivatePersistentZooming()
  7058. }
  7059. }
  7060. .bind(this)),
  7061. F(e),
  7062. L(e, t.player),
  7063. M(i),
  7064. te.setAutoPlay(e.heroCount()),
  7065. he.init(i, a.mode),
  7066. he.on(ue.OPENED, Ze.bind(this, "help")),
  7067. fe.init(),
  7068. fe.on(ge.OPENED, function() {
  7069. var e = document.getElementById("terms-modal");
  7070. return function() {
  7071. Ze("terms"),
  7072. le.open(e)
  7073. }
  7074. }()),
  7075. fe.on(ge.CLOSED, le.reset),
  7076. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7077. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7078. Q.profiling.enabled && se.show(),
  7079. ve.init(t)
  7080. }
  7081. function M(e) {
  7082. var t = function(e, t) {
  7083. $(e).find("a").each(function(e, i) {
  7084. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  7085. i.style.pointerEvents = t ? "auto" : "none"
  7086. })
  7087. }
  7088. , i = function() {
  7089. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  7090. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  7091. };
  7092. e.on(Ne.ZoomMax, function() {
  7093. t("#gui-zoomin", !1),
  7094. t("#gui-zoomout", !0)
  7095. }),
  7096. e.on(Ne.ZoomMin, function() {
  7097. t("#gui-zoomin", !0),
  7098. t("#gui-zoomout", !1)
  7099. }),
  7100. e.on(Ne.ZoomIn, function() {
  7101. t("#gui-zoomout", !0)
  7102. }),
  7103. e.on(Ne.ZoomOut, function() {
  7104. t("#gui-zoomin", !0)
  7105. }),
  7106. i()
  7107. }
  7108. function R(e) {
  7109. O(e)
  7110. }
  7111. function P(e) {
  7112. O(e)
  7113. }
  7114. function O(e) {
  7115. var t = e.waitQueue.length;
  7116. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7117. }
  7118. function L(e, t) {
  7119. He = {
  7120. gui: null,
  7121. visible: !1,
  7122. model: e,
  7123. player: t
  7124. }
  7125. }
  7126. function D(e, t) {
  7127. function i() {
  7128. var i = t.toJSON();
  7129. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  7130. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  7131. }
  7132. var n = {}
  7133. , r = new Le.GUI({
  7134. autoPlace: !0,
  7135. width: "60%"
  7136. });
  7137. i(),
  7138. t.on(xe.ViewChanged, i),
  7139. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  7140. r.domElement.id = "datLinks";
  7141. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  7142. return o.forEach(function(e) {
  7143. if (!K.detectSafari()) {
  7144. var t = document.createElement("button");
  7145. t.classList.add("btn-deep-link"),
  7146. t.innerText = Re.MENU_COPY,
  7147. e.nextSibling.appendChild(t);
  7148. var i = function() {
  7149. alert(Re.LINK_ALERT_COPY),
  7150. t.hide()
  7151. };
  7152. t.addEventListener("click", function(e) {
  7153. try {
  7154. var t = e.target.parentNode.childNodes[0];
  7155. t.select();
  7156. var n = document.execCommand("copy");
  7157. t.blur(),
  7158. n || i()
  7159. } catch (e) {
  7160. i()
  7161. }
  7162. })
  7163. }
  7164. }),
  7165. $(r.__closeButton).hide(),
  7166. r
  7167. }
  7168. function N(e) {
  7169. He.gui || (He.gui = D(He.model, He.player)),
  7170. He.visible = e,
  7171. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7172. }
  7173. function B() {
  7174. N(!He.visible)
  7175. }
  7176. function F(e) {
  7177. ke = {
  7178. gui: null,
  7179. visible: !1,
  7180. model: e
  7181. }
  7182. }
  7183. function V(e) {
  7184. var t = new Le.GUI;
  7185. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  7186. e.setSweepVisibility(Q.showSweeps)
  7187. }),
  7188. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  7189. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  7190. Q.transition.flySpeed = 0,
  7191. t.__controllers.forEach(function(e) {
  7192. e.updateDisplay()
  7193. })
  7194. }),
  7195. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  7196. $(t.__closeButton).hide(),
  7197. t
  7198. }
  7199. function U(e) {
  7200. ke.gui || (ke.gui = V(ke.model)),
  7201. ke.visible = e,
  7202. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7203. }
  7204. function k() {
  7205. U(!ke.visible)
  7206. }
  7207. function H() {
  7208. function e(e) {
  7209. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target)/* || e.preventDefault()*/
  7210. }
  7211. $("body").css("touch-action", "none"),
  7212. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  7213. // e.preventDefault()
  7214. });
  7215. var t = document.getElementById("terms-text")
  7216. , i = document.getElementById("more-help-wrapper")
  7217. , n = (document.getElementById("navigation-help-wrapper"),
  7218. document.getElementById("help-dialog"),
  7219. document.getElementById("tag-billboards"));
  7220. Q.useWheel && (document.body.addEventListener("mousewheel", e, { passive: false }),
  7221. document.body.addEventListener("DOMMouseScroll", e)),
  7222. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  7223. e.stopPropagation()
  7224. })
  7225. }
  7226. function G(e, t) {
  7227. for (var i = []; e; )
  7228. i.push(e),
  7229. e = e.parentNode;
  7230. for (; t && i.indexOf(t) === -1; )
  7231. t = t.parentNode;
  7232. return t
  7233. }
  7234. function z() {
  7235. var e, t = function(t) {
  7236. e = 0 === t.button || 1 === t.which ? t.target : null
  7237. }, i = function(t) {
  7238. e !== t.target && (e = G(e, t.target));
  7239. var i = document.getElementById("gui-parent");
  7240. if (G(i, e) !== i && (e = null),
  7241. e) {
  7242. var n;
  7243. try {
  7244. n = new MouseEvent("click",t)
  7245. } catch (e) {
  7246. n = document.createEvent("MouseEvents"),
  7247. 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)
  7248. }
  7249. n.syntheticClick = !0,
  7250. e.dispatchEvent(n),
  7251. e = null
  7252. }
  7253. };
  7254. document.body.addEventListener("mousedown", t, !0),
  7255. document.body.addEventListener("mouseup", i, !0),
  7256. document.getElementById("gui-parent").addEventListener("click", function(e) {
  7257. e.syntheticClick || (e.stopPropagation(),
  7258. "A" === e.target.nodeName && e.preventDefault())
  7259. }, !0)
  7260. }
  7261. var lastMoveScrollTime = 0;//add
  7262. var W, j, Y, X, Z, q, K = (e("three"),
  7263. e("../util/ajax"),
  7264. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  7265. e("../util/camera"),
  7266. e("../util/logger")), te = (e("../objects/Snapshot"),
  7267. 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"),
  7268. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  7269. e("../enum/PathDisplayMode"),
  7270. e("../enum/DirectorEvents"),
  7271. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  7272. e("../enum/WarpStyle"),
  7273. e("../enum/AlignmentType"),
  7274. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  7275. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  7276. coBrand: {
  7277. visible: !0,
  7278. elements: [".co-brand", "#loaderCoBrand"]
  7279. },
  7280. help: {
  7281. visible: !0,
  7282. elements: [".nav-help", "#nav-help"]
  7283. },
  7284. tourControls: {
  7285. visible: !0,
  7286. elements: [".next", ".previous", "#play"]
  7287. },
  7288. highlight: {
  7289. visible: !0,
  7290. elements: ["#drawer", "#pullTab"]
  7291. },
  7292. share: {
  7293. visible: !0,
  7294. elements: [".socialButton", "#share"]
  7295. },
  7296. fullScreen: {
  7297. visible: !0,
  7298. elements: ["#gui-fullscreen"]
  7299. },
  7300. floors: {
  7301. visible: !0,
  7302. elements: [".gui-floor"]
  7303. }
  7304. }, Ye = function() {
  7305. var e = document.getElementById("drawer");
  7306. return function() {
  7307. $("#player").height() < 400 && e.classList.contains("open") && a()
  7308. }
  7309. }(), Xe = function() {
  7310. var e = document.getElementById("meta-info");
  7311. return function() {
  7312. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  7313. }
  7314. }(), Ze = function(e) {
  7315. function t() {
  7316. u.classList.contains("expand") && de.toggleMeta(!0)
  7317. }
  7318. function i() {
  7319. fe.hide()
  7320. }
  7321. function n() {
  7322. he.close()
  7323. }
  7324. function r() {
  7325. Ae.dismiss()
  7326. }
  7327. function o() {
  7328. p.hasClass("open") && a(!0)
  7329. }
  7330. function l() {
  7331. Ce.hide()
  7332. }
  7333. function c() {
  7334. f.hasClass("open") && f.removeClass("open")
  7335. }
  7336. function h() {
  7337. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  7338. }
  7339. var u = document.getElementById("meta-info")
  7340. , d = document.getElementById("interaction-modal")
  7341. , p = $("#drawer").eq(0)
  7342. , f = $(".gui-floor").eq(0)
  7343. , g = $(".vr-popup").eq(0);
  7344. return function(e) {
  7345. switch (e) {
  7346. case "info":
  7347. i(),
  7348. n(),
  7349. Ye(),
  7350. l(),
  7351. c(),
  7352. r(),
  7353. h();
  7354. break;
  7355. case "terms":
  7356. t(),
  7357. n(),
  7358. o(),
  7359. l(),
  7360. c(),
  7361. r(),
  7362. h();
  7363. break;
  7364. case "help":
  7365. t(),
  7366. i(),
  7367. l(),
  7368. c(),
  7369. r(),
  7370. h();
  7371. break;
  7372. case "vr":
  7373. t(),
  7374. i(),
  7375. l(),
  7376. c(),
  7377. n(),
  7378. h(),
  7379. s(g) && o();
  7380. break;
  7381. case "highlights":
  7382. Xe(),
  7383. i(),
  7384. l(),
  7385. c();
  7386. break;
  7387. case "share":
  7388. t(),
  7389. i(),
  7390. n(),
  7391. c(),
  7392. r(),
  7393. h();
  7394. break;
  7395. case "floor":
  7396. i(),
  7397. l(),
  7398. r();
  7399. break;
  7400. case "view":
  7401. c(),
  7402. l(),
  7403. i(),
  7404. r();
  7405. break;
  7406. case "tour":
  7407. i(),
  7408. l(),
  7409. c(),
  7410. r();
  7411. break;
  7412. case "move":
  7413. i(),
  7414. l(),
  7415. c(),
  7416. r();
  7417. break;
  7418. case "resize":
  7419. t(),
  7420. Ye(),
  7421. c();
  7422. break;
  7423. case "tag":
  7424. i(),
  7425. n(),
  7426. l(),
  7427. c(),
  7428. r()
  7429. }
  7430. }
  7431. }();
  7432. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7433. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7434. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7435. setTimeout(function() {
  7436. $(".icon:visible").hide().show(0)
  7437. }, 100)
  7438. }),
  7439. $("#gui-fullscreen").find("a").on("click", function(e) {
  7440. l(e),
  7441. K.requestFullscreen($("body")[0]),
  7442. J.track("showcase_gui", {
  7443. gui_action: "click_enter_fullscreen",
  7444. interaction_source: "gui"
  7445. })
  7446. //czj
  7447. //W.reload()
  7448. }),
  7449. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7450. l(e),
  7451. K.exitFullscreen(),
  7452. J.track("showcase_gui", {
  7453. gui_action: "click_exit_fullscreen",
  7454. interaction_source: "gui"
  7455. })
  7456. })
  7457. $(window).on("resize", function(e) {
  7458. var t = e.target.innerHeight
  7459. , i = e.target.innerWidth;
  7460. t === X && i === Z || (je.highlight.visible && w(),
  7461. Ze("resize"),
  7462. $(".pinTop.right").removeClass("hideUnderMeta"),
  7463. c(),
  7464. X = t,
  7465. Z = i)
  7466. }).resize(),
  7467. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7468. $("#pullTab").on("click", function(e) {
  7469. l(e),
  7470. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7471. gui_action: "hide_highlight_reel"
  7472. }),
  7473. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7474. gui_action: "show_highlight_reel"
  7475. }),
  7476. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png"));
  7477. a()
  7478. });
  7479. /***********************方奕卓 热点列表事件监听 ************************/
  7480. if(window.DATA.showHotListSta) {
  7481. $('#hotList').css('display', '');
  7482. $('#hotList').on('click',function(e){
  7483. l(e);
  7484. var hotList = $('#hotListWrap')[0];
  7485. var isActive = hotList.classList.contains('hotListActive');
  7486. if(isActive){
  7487. hotList.classList.remove('hotListActive');
  7488. this.classList.remove('active')
  7489. }else{
  7490. hotList.classList.add('hotListActive');
  7491. this.classList.add('active')
  7492. }
  7493. }),
  7494. $('#hotListContent ul').on('mouseover', function(e){
  7495. l(e);
  7496. var target = e.target;
  7497. var hotList = document.getElementById('hotListWrap');
  7498. if(target.tagName === 'SPAN'){
  7499. var targetParent = target.parentElement.parentElement;
  7500. if(target.offsetWidth + 116 >= targetParent.clientWidth){
  7501. hotList.style.width = target.offsetWidth + 116 + 'px';
  7502. }else{
  7503. hotList.style.width = '';
  7504. }
  7505. }else if(target.tagName === 'LI'){
  7506. var targetParent = target.parentElement;
  7507. if(target.children[0].offsetWidth + 116 >= targetParent.clientWidth){
  7508. hotList.style.width = target.children[0].offsetWidth + 116 + 'px';
  7509. }else{
  7510. hotList.style.width = ''
  7511. }
  7512. }else {
  7513. hotList.style.width = '';
  7514. }
  7515. });
  7516. $('#hotListContent ul').on('click', function(e){
  7517. l(e);
  7518. this.preElem && this.preElem.classList.remove('active');
  7519. if(e.target.tagName === 'SPAN'){
  7520. e.target.parentElement.classList.add('active');
  7521. e.target.parentElement.hot && e.target.parentElement.hot.examine( ); // 打开热点
  7522. this.preElem = e.target.parentElement;
  7523. }else{
  7524. e.target.classList.add('active');
  7525. e.target.hot && e.target.hot.examine( ); // 打开热点
  7526. this.preElem = e.target;
  7527. }
  7528. })
  7529. $('#hotListClose').on('click', function(e){
  7530. l(e);
  7531. var hotList = $('#hotListWrap')[0];
  7532. hotList.classList.remove('hotListActive');
  7533. $('#hotListContent ul .active').removeClass('active');
  7534. $('#hotList')[0].classList.remove('active')
  7535. })
  7536. }
  7537. /*****************************************************************/
  7538. $("#more-menu-button").on("click", function(e) {
  7539. l(e);
  7540. var t = $("#more-menu");
  7541. t.toggleClass("open")
  7542. }),
  7543. t.exports.init = S,
  7544. t.exports.startLoading = x,
  7545. t.exports.endLoading = d,
  7546. t.exports.onProgress = u
  7547. }
  7548. ).call(this, "/js/gui/gui.js")
  7549. }
  7550. , {
  7551. "../analytics": 4,
  7552. "../controls/serializer": 14,
  7553. "../enum/AlignmentType": 17,
  7554. "../enum/BlackoutStyle": 18,
  7555. "../enum/ControlEvents": 21,
  7556. "../enum/DirectorEvents": 23,
  7557. "../enum/Keys": 30,
  7558. "../enum/PathDiscardMode": 38,
  7559. "../enum/PathDisplayMode": 39,
  7560. "../enum/PlayerEvents": 40,
  7561. "../enum/VROption": 47,
  7562. "../enum/Vectors": 50,
  7563. "../enum/Viewmode": 51,
  7564. "../enum/WarpStyle": 52,
  7565. "../enum/ZoomEvents": 53,
  7566. "../lib/dat.gui": 93,
  7567. "../localization/localize": 108,
  7568. "../tag/Media/MediaEvent": 131,
  7569. "../objects/Snapshot": 153,
  7570. "../settings": 166,
  7571. "../util/ajax": 181,
  7572. "../util/browser": 182,
  7573. "../util/camera": 183,
  7574. "../util/logger": 189,
  7575. "../util/showcase": 193,
  7576. "../util/transitions": 195,
  7577. "./closer/ModalCloserEvent": 61,
  7578. "./closer/modalCloser": 62,
  7579. "./help/HelpEvent": 66,
  7580. "./help/help": 67,
  7581. "./helpManager": 68,
  7582. "./immersiveMode": 69,
  7583. "./konami": 70,
  7584. "./landingScreen": 71,
  7585. "./loadingScreen": 72,
  7586. "./memoryUsage": 73,
  7587. "./playButton": 74,
  7588. "./populateModal": 75,
  7589. "./sharing/ShareEvents": 76,
  7590. "./sharing/modal": 77,
  7591. "./terms/TermsEvent": 78,
  7592. "./terms/terms": 79,
  7593. "./title/TitleEvents": 80,
  7594. "./title/tagToggle": 81,
  7595. "./title/titleBar": 82,
  7596. "./tourInteraction": 84,
  7597. "./vr/vrEvent": 85,
  7598. "./vr/vrModal": 87,
  7599. "./webvr/WebVrEvent": 88,
  7600. "./webvr/webVRgui": 89,
  7601. three: 217
  7602. }],
  7603. 66: [function(e, t, i) {
  7604. "use strict";
  7605. t.exports = Object.freeze({
  7606. OPENED: "help.opened",
  7607. CLOSED: "help.closed"
  7608. })
  7609. }
  7610. , {}],
  7611. 67: [function(e, t, i) {
  7612. "use strict";
  7613. function n() {
  7614. g.on("click", function(e) {
  7615. if (S && S !== l.TRANSITIONING) {
  7616. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7617. t && !M ? R.close() : r()
  7618. }
  7619. }),
  7620. w.on("click", function(e) {
  7621. R.close()
  7622. }),
  7623. E.on("click", function(e) {
  7624. S && S !== l.TRANSITIONING && (s(),
  7625. o())
  7626. }),
  7627. b.on("click", function(e) {
  7628. s(),
  7629. a()
  7630. })
  7631. }
  7632. function r() {
  7633. S && S !== l.TRANSITIONING && (M = !0,
  7634. setTimeout(function() {
  7635. M = !1
  7636. }, d.help.modalStayDuration),
  7637. R.emit(h.OPENED),
  7638. m.addClass("open " + S),
  7639. g.addClass("open"),
  7640. s(),
  7641. o(),
  7642. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7643. y.classList.add("fadeIn"))
  7644. }
  7645. function o() {
  7646. E.addClass("underline-tab"),
  7647. u.fill(_, c.NAVIGATION, S),
  7648. m.addClass(S)
  7649. }
  7650. function a() {
  7651. b.addClass("underline-tab"),
  7652. u.fill(T, c.MORE_HELP),
  7653. m.addClass("more-help")
  7654. }
  7655. function s(e, t) {
  7656. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7657. I.forEach(function(e) {
  7658. e.classList.remove("underline-tab")
  7659. })
  7660. }
  7661. var l = e("../../enum/Viewmode")
  7662. , c = e("../../enum/HelpModalType")
  7663. , h = e("./HelpEvent")
  7664. , u = (e("../helpManager"),
  7665. e("./../populateModal"))
  7666. , d = e("../../settings")
  7667. , p = e("../../util/common")
  7668. , f = e("events").EventEmitter
  7669. , g = $(".footer-help").eq(0)
  7670. , m = $("#help-dialog").eq(0)
  7671. , v = document.querySelector("#quick-logo")
  7672. , A = document.querySelector("#loaderCoBrand")
  7673. , y = document.querySelector("#help-dialog")
  7674. , C = document.querySelector(".footer")
  7675. , I = $(".help-tabs").children().toArray()
  7676. , E = $(".navigation-tab").eq(0)
  7677. , b = $(".more-help-tab").eq(0)
  7678. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7679. m.find(".close").eq(0))
  7680. , _ = m.find(".interactions").toArray()
  7681. , T = m.find(".ui-instructions").toArray()
  7682. , x = l.PANORAMA
  7683. , S = l.PANORAMA
  7684. , M = !1
  7685. , R = {
  7686. init: function(e, t) {
  7687. S = t,
  7688. x = t,
  7689. [y, A, v, C].forEach(function(e) {
  7690. e.classList.add(u.deviceType)
  7691. }),
  7692. n()
  7693. },
  7694. close: function() {
  7695. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7696. g.removeClass("open"),
  7697. m.removeClass("open"),
  7698. y.classList.contains("fadeIn"))) {
  7699. y.classList.remove("fadeIn");
  7700. var e = S === l.TRANSITIONING ? x : S;
  7701. u.clear(_, c.NAVIGATION, e)
  7702. }
  7703. },
  7704. updateMode: function(e) {
  7705. x = S,
  7706. S = e
  7707. }
  7708. };
  7709. p.extendObject(R, f.prototype),
  7710. t.exports = R
  7711. }
  7712. , {
  7713. "../../enum/HelpModalType": 28,
  7714. "../../enum/Viewmode": 51,
  7715. "../../settings": 166,
  7716. "../../util/common": 185,
  7717. "../helpManager": 68,
  7718. "./../populateModal": 75,
  7719. "./HelpEvent": 66,
  7720. events: 202
  7721. }],
  7722. 68: [function(e, t, i) {
  7723. (function(i) {
  7724. "use strict";
  7725. var n = e("../util/browser")
  7726. , r = e("./../util/logger")
  7727. , o = e("./../settings")
  7728. , a = new r(i)
  7729. , s = function() {
  7730. var e;
  7731. try {
  7732. return e = window.localStorage.getItem("visitCount") || "0",
  7733. e = (parseFloat(e) + 1).toString(),
  7734. window.localStorage.setItem("visitCount", e),
  7735. a.debug("visitCount = " + e),
  7736. e
  7737. } catch (t) {
  7738. e = "1",
  7739. a.debug("couldn't set local storage")
  7740. }
  7741. }()
  7742. , l = !1;
  7743. t.exports = {
  7744. isHelpDisabled: function() {
  7745. return "0" === n.valueFromHash("help", null) || l
  7746. },
  7747. isLargeHelpEnabled: function() {
  7748. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7749. },
  7750. isSmallHelpEnabled: function() {
  7751. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7752. },
  7753. isHelpEnabled: function() {
  7754. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7755. },
  7756. setAutoPlay: function(e) {
  7757. l = o.warp.auto >= 0 && e > 1
  7758. }
  7759. }
  7760. }
  7761. ).call(this, "/js/gui/helpManager.js")
  7762. }
  7763. , {
  7764. "../util/browser": 182,
  7765. "./../settings": 166,
  7766. "./../util/logger": 189
  7767. }],
  7768. 69: [function(e, t, i) {
  7769. "use strict";
  7770. function n(e, t, i, n) {
  7771. F = n,
  7772. r(e, t, i, F),
  7773. o(),
  7774. N = t.mode
  7775. }
  7776. function r(e, t, i, n) {
  7777. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7778. e.controls[t].on(v.Move, a),
  7779. e.controls[t].on(v.LongTap, c)
  7780. }),
  7781. M.on("mousewheel DOMMouseScroll", a),
  7782. i.on(m.TagActivated, a),
  7783. i.on(m.TagNavigation, a),
  7784. t.on(A.FlyingEnded, s),
  7785. t.on(A.ModeChanging, function(e, t) {
  7786. B = t !== C.PANORAMA && e !== C.PANORAMA
  7787. }),
  7788. t.on(A.ModeChanged, function(e, i) {
  7789. N = t.mode,
  7790. i !== C.TRANSITIONING ? l() : a("modeChange")
  7791. }),
  7792. n.on(y.TourStart, function() {
  7793. L = !0,
  7794. a()
  7795. }),
  7796. n.on(y.TourEnd, function() {
  7797. L = !1,
  7798. l()
  7799. }),
  7800. n.on(y.ActionInterrupted, function() {
  7801. L = !1
  7802. }),
  7803. R.addEventListener("touchend", function() {
  7804. $("#pullTab").hasClass("opened") && !L && l()
  7805. }, !0)
  7806. }
  7807. function o() {
  7808. p.isMobile() ? (b.forEach(function(e) {
  7809. e.classList.add("mobile")
  7810. }),
  7811. w.click(l)) : (b.forEach(function(e) {
  7812. e.addEventListener("mouseleave", function() {
  7813. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7814. }, !0)
  7815. }),
  7816. M.mouseleave(function() {
  7817. b[0].classList.contains("detectHover") && l()
  7818. }))
  7819. }
  7820. function a(e) {
  7821. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7822. P = !0,
  7823. g.close(),
  7824. h(e),
  7825. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7826. _.hasClass("playing") || (b.forEach(function(e) {
  7827. e.classList.add("detectHover")
  7828. }),
  7829. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7830. }
  7831. function s() {
  7832. _.hasClass("playing") || (clearTimeout(O),
  7833. O = setTimeout(l, f.immersive.timeToShowAgain))
  7834. }
  7835. function l() {
  7836. clearTimeout(O),
  7837. P = !1,
  7838. I.forEach(function(e) {
  7839. e.classList.remove("drawerOpen")
  7840. }),
  7841. L || E.forEach(function(e) {
  7842. e.classList.remove("duringTour")
  7843. }),
  7844. b.forEach(function(e) {
  7845. e.classList.remove("detectHover")
  7846. })
  7847. }
  7848. function c() {
  7849. P ? l() : a(),
  7850. D = !0,
  7851. setTimeout(function() {
  7852. D = !1
  7853. }, f.immersive.uiStayDuration)
  7854. }
  7855. function h(e) {
  7856. !d(e) && L ? E.forEach(function(e) {
  7857. e.classList.remove("drawerOpen"),
  7858. e.classList.add("duringTour")
  7859. }) : _.hasClass("open") ? E.forEach(function(e) {
  7860. e.classList.remove("duringTour"),
  7861. e.classList.add("drawerOpen")
  7862. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7863. e.classList.add("fadeOut")
  7864. })
  7865. }
  7866. function u() {
  7867. T.hasClass("duringTour") || (L = !1,
  7868. a("gui"),
  7869. l())
  7870. }
  7871. function d(e) {
  7872. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7873. }
  7874. var p = e("../util/browser")
  7875. , f = e("../settings")
  7876. , g = e("./help/help")
  7877. , m = e("../enum/tagEvents")
  7878. , v = e("../enum/ControlEvents")
  7879. , A = e("../enum/PlayerEvents")
  7880. , y = e("../enum/DirectorEvents")
  7881. , A = e("../enum/PlayerEvents")
  7882. , C = e("../enum/Viewmode")
  7883. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7884. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7885. , b = $("#hover-bottom, #hover-top").toArray()
  7886. , w = ($("#pullTab").eq(0),
  7887. $("#playHead").eq(0),
  7888. $(".pinBottom-container").eq(0))
  7889. , _ = $("#drawer").eq(0)
  7890. , T = $("#drawer-container").eq(0)
  7891. , x = $("#meta-info").eq(0)
  7892. , S = $(".pinTop.left").eq(0)
  7893. , M = $("#player").eq(0)
  7894. , R = document.getElementById("pullTab")
  7895. , P = !1
  7896. , O = null
  7897. , L = !1
  7898. , D = !1
  7899. , N = null
  7900. , B = !1
  7901. , F = null;
  7902. t.exports.init = n,
  7903. t.exports.hideUi = a,
  7904. t.exports.resetDrawer = u
  7905. }
  7906. , {
  7907. "../enum/ControlEvents": 21,
  7908. "../enum/DirectorEvents": 23,
  7909. "../enum/tagEvents": 32,
  7910. "../enum/PlayerEvents": 40,
  7911. "../enum/Viewmode": 51,
  7912. "../settings": 166,
  7913. "../util/browser": 182,
  7914. "./help/help": 67
  7915. }],
  7916. 70: [function(e, t, i) {
  7917. (function(i) {
  7918. "use strict";
  7919. function n(e, t, i) {
  7920. l.debug("konami has the modelInstance");
  7921. var n = [];
  7922. $(window).on("keydown", function(e) {
  7923. n.push(e.which),
  7924. n.length > o.secretPanelWord.length && n.shift(),
  7925. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7926. o.debug = !0)
  7927. }),
  7928. $(window).on("keydown", function n(r) {
  7929. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7930. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7931. })
  7932. }
  7933. var r = e("./../util/logger")
  7934. , o = e("./../settings")
  7935. , a = e("./debug")
  7936. , s = e("./../util/common")
  7937. , l = (e("./gui"),
  7938. new r(i));
  7939. o.console && $("body").append('<div id="debug-console"></div>'),
  7940. t.exports.init = n
  7941. }
  7942. ).call(this, "/js/gui/konami.js")
  7943. }
  7944. , {
  7945. "./../settings": 166,
  7946. "./../util/common": 185,
  7947. "./../util/logger": 189,
  7948. "./debug": 63,
  7949. "./gui": 65
  7950. }],
  7951. 71: [function(e, t, i) {
  7952. "use strict";
  7953. function n(e, t) {
  7954. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7955. }
  7956. function r(e) {
  7957. var t = $.Deferred();
  7958. e || t.resolve();
  7959. var i = c.startupFlyinDelay;
  7960. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7961. setTimeout(t.resolve.bind(t), i),
  7962. t
  7963. }
  7964. function o(e, t, i) {
  7965. var n = 0;
  7966. c.quickstart.enabled && (a(i),
  7967. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7968. var r = function() {
  7969. e.once(g.Move, l),
  7970. t.once(f.TourStart, l)
  7971. };
  7972. s(n, r)
  7973. }
  7974. function a(e) {
  7975. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  7976. v.before(y),
  7977. A = $(".quick-brand").toArray()),*/
  7978. m.addClass("fadeOut"),
  7979. setTimeout(function() {
  7980. A.forEach(function(e) {
  7981. e.classList.add("fadeIn")
  7982. })
  7983. }, c.quickstart.showTextDelay),
  7984. setTimeout(function() {
  7985. A.forEach(function(e) {
  7986. e.classList.add("fadeOut")
  7987. })
  7988. }, c.quickstart.fadeOutDelay),
  7989. !0
  7990. }
  7991. function s(e, t) {
  7992. setTimeout(function() {
  7993. if (h.isHelpEnabled()) {
  7994. if (t(),
  7995. u.init(),
  7996. C.addClass("fadeIn landing " + u.deviceType),
  7997. h.isSmallHelpEnabled())
  7998. return void C.addClass("small");
  7999. u.fill(I, d.LANDING[E]),
  8000. C.addClass(E)
  8001. }
  8002. }, e)
  8003. //csz 用户引导界面
  8004. var helpData = {
  8005. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  8006. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  8007. }
  8008. var navIcon = $(".nav-icon .icon");
  8009. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  8010. function paging(id){
  8011. id.on("click",function(){
  8012. var navPage = null;
  8013. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  8014. if(navPage > helpData.length || navPage < 1) return false
  8015. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  8016. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  8017. }else{
  8018. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  8019. }
  8020. })
  8021. };
  8022. paging($(".next-button"));
  8023. paging($(".prev-button"));
  8024. }
  8025. function l() {
  8026. u.clear(I, d.LANDING[E]),
  8027. C.removeClass("fadeIn")
  8028. }
  8029. var c = e("../settings")
  8030. , h = (e("./help/help"),
  8031. e("./helpManager"))
  8032. , u = e("./populateModal")
  8033. , d = e("../enum/HelpModalType")
  8034. , p = e("../enum/Viewmode")
  8035. , f = e("../enum/DirectorEvents")
  8036. , g = e("../enum/PlayerEvents")
  8037. , m = $("#quick-blackout").eq(0)
  8038. , v = $("#quick-logo").eq(0)
  8039. , A = $(".quick-brand").toArray()
  8040. , y = $("#loaderCoBrand").eq(0)
  8041. , C = $("#interaction-modal").eq(0)
  8042. , I = C.find(".interaction").toArray()
  8043. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  8044. "");
  8045. t.exports.delayLanding = r,
  8046. t.exports.showMessage = o,
  8047. t.exports.init = n,
  8048. t.exports.dismissModal = l
  8049. }
  8050. , {
  8051. "../enum/DirectorEvents": 23,
  8052. "../enum/HelpModalType": 28,
  8053. "../enum/PlayerEvents": 40,
  8054. "../enum/Viewmode": 51,
  8055. "../settings": 166,
  8056. "./help/help": 67,
  8057. "./helpManager": 68,
  8058. "./populateModal": 75
  8059. }],
  8060. 72: [function(e, t, i) {
  8061. "use strict";
  8062. var n = e("./circleLoader").circleLoader;
  8063. t.exports = {
  8064. element: $("#gui-loading"),
  8065. hide: function(e) {
  8066. n.done(),
  8067. this.element.fadeOut(1500, e)
  8068. },
  8069. show: function(e) {
  8070. this.element.fadeIn(500, function() {
  8071. this.element.css("display", "table"),
  8072. e && e()
  8073. }
  8074. .bind(this))
  8075. },
  8076. progress: function(e) {
  8077. n.set(e)
  8078. }
  8079. }
  8080. }
  8081. , {
  8082. "./circleLoader": 60
  8083. }],
  8084. 73: [function(e, t, i) {
  8085. "use strict";
  8086. var n = e("../settings")
  8087. , r = $("#memory-info")
  8088. , o = r.find("#memory-gpu")
  8089. , a = !1;
  8090. t.exports = {
  8091. show: function() {
  8092. n.profiling.enabled && (r.show(),
  8093. a = !0)
  8094. },
  8095. hide: function() {
  8096. r.hide(),
  8097. a = !1
  8098. },
  8099. toggle: function() {
  8100. a ? this.hide() : this.show()
  8101. },
  8102. update: function(e) {
  8103. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  8104. }
  8105. }
  8106. }
  8107. , {
  8108. "../settings": 166
  8109. }],
  8110. 74: [function(e, t, i) {
  8111. "use strict";
  8112. var n = e("../util/browser")
  8113. , r = e("../analytics");
  8114. e("../settings");
  8115. t.exports = {
  8116. show: function(e, t) {
  8117. $("#gui-message").fadeOut(500, function() {
  8118. t()
  8119. })
  8120. }
  8121. }
  8122. }
  8123. , {
  8124. "../analytics": 4,
  8125. "../settings": 166,
  8126. "../util/browser": 182
  8127. }],
  8128. 75: [function(e, t, i) {
  8129. "use strict";
  8130. function n(e, t, i, n) {
  8131. function r(e) {
  8132. return e.classList.contains(a)
  8133. }
  8134. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  8135. //for (var a in o) {
  8136. //var s = e.find(r);
  8137. //for (var l in o[a]) {
  8138. //var c = o[a][l];
  8139. //if ("top-info" === l || "bottom-info" === l) {
  8140. //var h = n ? c : "";
  8141. //czj 注释掉第一次打开的用户引导
  8142. //s.querySelector("." + l).textContent = h
  8143. //} else {
  8144. //var u = n ? c : "";
  8145. //, d = s.querySelector("." + l);
  8146. //d.src = u,
  8147. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8148. //}
  8149. //}
  8150. //}
  8151. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8152. // p.forEach(function(e) {
  8153. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8154. // })
  8155. }
  8156. var r = e("../util/browser")
  8157. , o = e("../localization/localize")
  8158. , a = e("../enum/HelpModalType")
  8159. , s = (e("../enum/HelpModalSize"),
  8160. e("../enum/Viewmode"));
  8161. t.exports = {
  8162. init: function() {
  8163. if (!this.hasInitialized) {
  8164. this.hasInitialized = !0,
  8165. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  8166. this.assets = {},
  8167. this.assets[a.LANDING[s.PANORAMA]] = {
  8168. desktop: {
  8169. left: {
  8170. "top-info": o.ROTATE,
  8171. "big-image": "images/nav_help_mouse_drag_left.png",
  8172. keyboard: "images/nav_help_keyboard_left_right.png"
  8173. },
  8174. middle: {
  8175. "top-info": o.MOVE,
  8176. "big-image": "images/nav_help_mouse_click.png",
  8177. keyboard: "images/nav_help_keyboard_up_down.png"
  8178. },
  8179. right: {
  8180. "top-info": o.ZOOM,
  8181. "big-image": "images/nav_help_mouse_zoom.png",
  8182. keyboard: "images/nav_help_zoom_keys.png"
  8183. }
  8184. },
  8185. mobile: {
  8186. left: {
  8187. "top-info": o.ROTATE,
  8188. "big-image": "images/nav_help_gesture_drag.png"
  8189. },
  8190. middle: {
  8191. "top-info": o.MOVE,
  8192. "big-image": "images/nav_help_gesture_tap.png"
  8193. },
  8194. right: {
  8195. "top-info": o.ZOOM,
  8196. "big-image": "images/nav_help_gesture_pinch.png"
  8197. }
  8198. }
  8199. },
  8200. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  8201. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8202. desktop: {
  8203. left: {
  8204. "top-info": o.ROTATE,
  8205. "big-image": "images/nav_help_mouse_drag_left.png",
  8206. keyboard: "images/nav_help_keyboard_left_right.png"
  8207. },
  8208. middle: {
  8209. "top-info": o.MOVE,
  8210. "big-image": "images/nav_help_mouse_position_right.png"
  8211. }
  8212. },
  8213. mobile: {
  8214. left: {
  8215. "top-info": o.ROTATE,
  8216. "big-image": "images/nav_help_gesture_drag.png"
  8217. },
  8218. middle: {
  8219. "top-info": o.MOVE,
  8220. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8221. }
  8222. }
  8223. },
  8224. this.assets[a.LANDING[s.FLOORPLAN]] = {
  8225. desktop: {
  8226. left: {
  8227. "top-info": o.MOVE,
  8228. "big-image": "images/nav_help_mouse_position_left.png"
  8229. },
  8230. middle: {
  8231. "top-info": o.ROTATE,
  8232. "big-image": "images/nav_help_mouse_drag_right.png",
  8233. keyboard: "images/nav_help_keyboard_left_right.png"
  8234. }
  8235. },
  8236. mobile: {
  8237. left: {
  8238. "top-info": o.MOVE,
  8239. "big-image": "images/nav_help_gesture_position.png"
  8240. },
  8241. middle: {
  8242. "top-info": o.ROTATE,
  8243. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8244. }
  8245. }
  8246. };
  8247. var e = {
  8248. "top-info": o.INSIDE,
  8249. "big-image": "images/nav_help_click_inside.png",
  8250. keyboard: "images/nav_help_inside_key.png"
  8251. };
  8252. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  8253. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  8254. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  8255. var t = {
  8256. "top-info": o.INSIDE,
  8257. "big-image": "images/nav_help_tap_inside.png"
  8258. };
  8259. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  8260. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  8261. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  8262. this.assets[a.NAVIGATION] = {},
  8263. this.assets[a.NAVIGATION][s.PANORAMA] = {
  8264. desktop: {
  8265. left: {
  8266. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  8267. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  8268. "big-image": "images/nav_help_mouse_drag_left.png",
  8269. keyboard: "images/nav_help_keyboard_left_right.png"
  8270. },
  8271. middle: {
  8272. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  8273. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  8274. "big-image": "images/nav_help_mouse_click.png",
  8275. keyboard: "images/nav_help_keyboard_up_down.png"
  8276. },
  8277. right: {
  8278. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  8279. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  8280. "big-image": "images/nav_help_mouse_zoom.png",
  8281. keyboard: "images/nav_help_zoom_keys.png"
  8282. }
  8283. },
  8284. mobile: {
  8285. left: {
  8286. "top-info": o.HELP_MOBILE_PANORAMA_1,
  8287. "big-image": "images/nav_help_gesture_drag.png"
  8288. },
  8289. middle: {
  8290. "top-info": o.HELP_MOBILE_PANORAMA_2,
  8291. "big-image": "images/nav_help_gesture_tap.png"
  8292. },
  8293. right: {
  8294. "top-info": o.HELP_MOBILE_3,
  8295. "big-image": "images/nav_help_gesture_pinch.png"
  8296. }
  8297. }
  8298. },
  8299. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8300. desktop: {
  8301. left: {
  8302. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  8303. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  8304. "big-image": "images/nav_help_mouse_drag_left.png",
  8305. keyboard: "images/nav_help_keyboard_all.png"
  8306. },
  8307. middle: {
  8308. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  8309. "big-image": "images/nav_help_mouse_position_right.png"
  8310. },
  8311. right: {
  8312. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  8313. "big-image": "images/nav_help_mouse_zoom.png"
  8314. }
  8315. },
  8316. mobile: {
  8317. left: {
  8318. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  8319. "big-image": "images/nav_help_gesture_drag.png"
  8320. },
  8321. middle: {
  8322. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  8323. "big-image": "images/nav_help_gesture_position_two_finger.png"
  8324. },
  8325. right: {
  8326. "top-info": o.HELP_MOBILE_3,
  8327. "big-image": "images/nav_help_gesture_pinch.png"
  8328. }
  8329. }
  8330. },
  8331. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8332. desktop: {
  8333. left: {
  8334. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  8335. "big-image": "images/nav_help_mouse_position_left.png"
  8336. },
  8337. middle: {
  8338. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  8339. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  8340. "big-image": "images/nav_help_mouse_drag_right.png",
  8341. keyboard: "images/nav_help_keyboard_left_right.png"
  8342. },
  8343. right: {
  8344. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  8345. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  8346. "big-image": "images/nav_help_mouse_zoom.png",
  8347. keyboard: "images/nav_help_keyboard_up_down.png"
  8348. }
  8349. },
  8350. mobile: {
  8351. left: {
  8352. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  8353. "big-image": "images/nav_help_gesture_position.png"
  8354. },
  8355. middle: {
  8356. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  8357. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  8358. },
  8359. right: {
  8360. "top-info": o.HELP_MOBILE_3,
  8361. "big-image": "images/nav_help_gesture_pinch.png"
  8362. }
  8363. }
  8364. },
  8365. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  8366. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8367. "top-info": o.HELP_DESKTOP_360_2A,
  8368. "bottom-info": o.HELP_DESKTOP_360_2B,
  8369. "big-image": "images/nav_help_click_inside.png",
  8370. keyboard: "images/nav_help_inside_key.png"
  8371. },
  8372. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8373. "top-info": o.HELP_MOBILE_360_2,
  8374. "big-image": "images/nav_help_tap_inside.png"
  8375. },
  8376. this.assets[a.MORE_HELP] = {
  8377. desktop: {
  8378. "more-help-hlr": {
  8379. "top-info": o.HELP_MORE_HLR_A,
  8380. "big-image": "images/nav_help_expand.svg",
  8381. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8382. },
  8383. "more-help-dollhouse": {
  8384. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8385. "big-image": "images/nav_help_dollhouse.svg",
  8386. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8387. },
  8388. "more-help-floors": {
  8389. "top-info": o.HELP_MORE_FLOORS_A,
  8390. "big-image": "images/nav_help_floor picker.svg",
  8391. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8392. },
  8393. "more-help-tag": {
  8394. "top-info": o.HELP_MORE_TAG_A,
  8395. "big-image": "images/nav_help_tag.svg",
  8396. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  8397. },
  8398. "more-help-zoom": {
  8399. "top-info": o.HELP_MORE_ZOOM_A,
  8400. "big-image": "images/nav_help_zoom.svg",
  8401. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  8402. },
  8403. "more-help-tour": {
  8404. "top-info": o.HELP_MORE_TOUR_A,
  8405. "big-image": "images/nav_help_play.png",
  8406. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8407. },
  8408. "more-help-inside": {
  8409. "top-info": o.HELP_MORE_INSIDE_A,
  8410. "big-image": "images/nav_help_inside.svg",
  8411. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8412. },
  8413. "more-help-vr": {
  8414. "top-info": o.HELP_MORE_VR_A,
  8415. "big-image": "images/nav_help_vr.svg",
  8416. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8417. },
  8418. "more-help-360": {
  8419. "top-info": o.HELP_MORE_360_A,
  8420. "big-image": "images/nav_help_360.svg",
  8421. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8422. },
  8423. "more-help-fullscreen": {
  8424. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8425. "big-image": "images/nav_help_fullscreen.svg",
  8426. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8427. }
  8428. },
  8429. mobile: {
  8430. "more-help-hlr": {
  8431. "top-info": o.HELP_MORE_HLR_A,
  8432. "big-image": "images/nav_help_expand.svg",
  8433. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8434. },
  8435. "more-help-dollhouse": {
  8436. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8437. "big-image": "images/nav_help_dollhouse.svg",
  8438. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8439. },
  8440. "more-help-floors": {
  8441. "top-info": o.HELP_MORE_FLOORS_A,
  8442. "big-image": "images/nav_help_floor picker.svg",
  8443. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8444. },
  8445. "more-help-tag": {
  8446. "top-info": o.HELP_MORE_TAG_A,
  8447. "big-image": "images/nav_help_tag.svg",
  8448. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8449. },
  8450. "more-help-tour": {
  8451. "top-info": o.HELP_MORE_TOUR_A,
  8452. "big-image": "images/nav_help_play.png",
  8453. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8454. },
  8455. "more-help-inside": {
  8456. "top-info": o.HELP_MORE_INSIDE_A,
  8457. "big-image": "images/nav_help_inside.svg",
  8458. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8459. },
  8460. "more-help-vr": {
  8461. "top-info": o.HELP_MORE_VR_A,
  8462. "big-image": "images/webvr.svg",
  8463. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8464. },
  8465. "more-help-360": {
  8466. "top-info": o.HELP_MORE_360_A,
  8467. "big-image": "images/nav_help_360.svg",
  8468. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8469. }
  8470. }
  8471. },
  8472. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8473. desktop: {
  8474. left: {
  8475. "top-info": o.ROTATE,
  8476. "big-image": "images/nav_help_mouse_drag_left.png",
  8477. keyboard: "images/nav_help_keyboard_left_right.png"
  8478. },
  8479. middle: {
  8480. "top-info": o.MOVE,
  8481. "big-image": "images/nav_help_mouse_click.png",
  8482. keyboard: "images/nav_help_keyboard_up_down.png"
  8483. },
  8484. right: {
  8485. "top-info": o.PLAY,
  8486. "big-image": "images/Desktop-help-play-button.svg",
  8487. keyboard: "images/Desktop-help-spacebar-2.svg"
  8488. }
  8489. },
  8490. mobile: {
  8491. left: {
  8492. "top-info": o.ROTATE,
  8493. "big-image": "images/nav_help_gesture_drag.png"
  8494. },
  8495. middle: {
  8496. "top-info": o.MOVE,
  8497. "big-image": "images/nav_help_gesture_tap.png"
  8498. },
  8499. right: {
  8500. "top-info": o.PLAY,
  8501. "big-image": "images/mobile-help-play-button.svg"
  8502. }
  8503. }
  8504. },
  8505. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8506. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8507. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8508. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8509. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8510. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8511. }
  8512. },
  8513. fill: function(e, t, i) {
  8514. n.call(this, e, t, i, !0)
  8515. },
  8516. clear: function(e, t, i) {
  8517. n.call(this, e, t, i, !1)
  8518. }
  8519. }
  8520. }
  8521. , {
  8522. "../enum/HelpModalSize": 27,
  8523. "../enum/HelpModalType": 28,
  8524. "../enum/Viewmode": 51,
  8525. "../localization/localize": 108,
  8526. "../util/browser": 182
  8527. }],
  8528. 76: [function(e, t, i) {
  8529. "use strict";
  8530. t.exports = Object.freeze({
  8531. OPENED: "share.open",
  8532. CLOSED: "share.closed",
  8533. LINK_CLICKED: "share.linked"
  8534. })
  8535. }
  8536. , {}],
  8537. 77: [function(e, t, i) {
  8538. "use strict";
  8539. function n(e) {
  8540. function t(t, i) {
  8541. var n = window.screenY + ($("#player").height() - i) / 2
  8542. , r = window.screenX + ($("#player").width() - t) / 2
  8543. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8544. I.emit(l.LINK_CLICKED, {
  8545. channel: e
  8546. }),
  8547. window.open(C[e], "shareWindow", o)
  8548. }
  8549. switch (e) {
  8550. case y.FACEBOOK:
  8551. t(580, 420);
  8552. break;
  8553. case y.TWITTER:
  8554. t(550, 440);
  8555. break;
  8556. case y.MAIL:
  8557. I.emit(l.LINK_CLICKED, {
  8558. channel: "email"
  8559. }),
  8560. window.open(C[e], "_blank");
  8561. break;
  8562. case y.LINKEDIN:
  8563. }
  8564. }
  8565. function r(e) {
  8566. I.emit(l.LINK_CLICKED, {
  8567. channel: "copylink"
  8568. });
  8569. var t = document.createRange();
  8570. t.selectNodeContents(v);
  8571. var i = window.getSelection();
  8572. i.removeAllRanges(),
  8573. i.addRange(t),
  8574. document.execCommand("copy"),
  8575. A.classList.remove("hidden"),
  8576. v.classList.add("highlighted")
  8577. }
  8578. function o(e) {
  8579. e && (e.stopPropagation(),
  8580. e.target === v) || (window.getSelection().removeAllRanges(),
  8581. v.classList.remove("highlighted"),
  8582. A.classList.add("hidden"))
  8583. }
  8584. var a = e("../../util/browser")
  8585. , s = e("../../localization/localize")
  8586. , l = e("./ShareEvents")
  8587. , c = e("../../util/common")
  8588. , h = e("events").EventEmitter
  8589. , u = document.getElementById("sharing")
  8590. , d = document.getElementById("share-modal")
  8591. , p = document.getElementById("share-close")
  8592. , f = document.getElementById("facebook-share")
  8593. , g = document.getElementById("twitter-share")
  8594. , m = document.getElementById("mail-share")
  8595. , v = document.getElementById("share-url-text")
  8596. , A = document.getElementById("copy-success")
  8597. , y = Object.freeze({
  8598. FACEBOOK: "facebook",
  8599. TWITTER: "twitter",
  8600. MAIL: "mail",
  8601. LINKEDIN: "linkedin"
  8602. })
  8603. , C = {};
  8604. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8605. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8606. C[y.MAIL] = "mailto:?subject=";
  8607. var I = {
  8608. init: function(e) {
  8609. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8610. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8611. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8612. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8613. u.addEventListener("click", this.toggle.bind(this)),
  8614. p.addEventListener("click", this.hide.bind(this)),
  8615. v.addEventListener("click", r),
  8616. d.addEventListener("click", o),
  8617. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8618. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8619. m.addEventListener("click", n.bind(this, y.MAIL)),
  8620. v.textContent = window.location.href + "&utm_source=4",
  8621. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8622. u.classList.remove("hidden")
  8623. },
  8624. show: function() {
  8625. this.emit(l.OPENED),
  8626. d.classList.add("fadeIn")
  8627. },
  8628. hide: function() {
  8629. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8630. document.selection && document.selection.empty(),
  8631. window.getSelection().removeAllRanges(),
  8632. o(),
  8633. d.classList.remove("fadeIn"))
  8634. },
  8635. toggle: function() {
  8636. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8637. }
  8638. };
  8639. c.extendObject(I, h.prototype),
  8640. t.exports = I
  8641. }
  8642. , {
  8643. "../../localization/localize": 108,
  8644. "../../util/browser": 182,
  8645. "../../util/common": 185,
  8646. "./ShareEvents": 76,
  8647. events: 202
  8648. }],
  8649. 78: [function(e, t, i) {
  8650. "use strict";
  8651. t.exports = Object.freeze({
  8652. OPENED: "terms.opened",
  8653. CLOSED: "terms.closed"
  8654. })
  8655. }
  8656. , {}],
  8657. 79: [function(e, t, i) {
  8658. "use strict";
  8659. var n = e("./TermsEvent")
  8660. , r = e("../../localization/localize")
  8661. , o = e("../../analytics")
  8662. , a = e("../../util/ajax")
  8663. , s = e("../../util/common")
  8664. , l = e("events").EventEmitter
  8665. , c = document.getElementById("terms-modal")
  8666. , h = {
  8667. init: function() {
  8668. $(".footer-terms").on("click", function(e) {
  8669. e.preventDefault(),
  8670. this.show()
  8671. }
  8672. .bind(this)),
  8673. $("#terms-modal .close").on("click", this.hide.bind(this))
  8674. },
  8675. show: function() {
  8676. this.emit(n.OPENED),
  8677. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8678. var t = $("#terms-text").html(e);
  8679. o.track("showcase_gui", {
  8680. gui_action: "click_terms_button",
  8681. interaction_source: "gui"
  8682. }),
  8683. t.find("a").attr("target", "_blank")
  8684. }).fail(function() {
  8685. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8686. }),
  8687. c.classList.add("fadeIn")
  8688. },
  8689. hide: function(e) {
  8690. e && e.preventDefault(),
  8691. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8692. c.classList.remove("fadeIn")
  8693. }
  8694. };
  8695. s.extendObject(h, l.prototype),
  8696. t.exports = h
  8697. }
  8698. , {
  8699. "../../analytics": 4,
  8700. "../../localization/localize": 108,
  8701. "../../util/ajax": 181,
  8702. "../../util/common": 185,
  8703. "./TermsEvent": 78,
  8704. events: 202
  8705. }],
  8706. 80: [function(e, t, i) {
  8707. "use strict";
  8708. t.exports = Object.freeze({
  8709. OPEN_INFO: "title.open.info",
  8710. CLOSE_INFO: "title.close.info",
  8711. SHOW_INFO: "title.show.info",
  8712. HIDE_INFO: "title.hide.info",
  8713. LINK_CLICKED: "title.link.click",
  8714. CONTACT_LINK_CLICKED: "title.contact.click",
  8715. ORIGIN_LINK_CLICKED: "title.origin.click"
  8716. })
  8717. }
  8718. , {}],
  8719. 81: [function(e, t, i) {
  8720. "use strict";
  8721. function n(e, t) {
  8722. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8723. }
  8724. function r(e, t) {
  8725. function i(i) {
  8726. e.shouldShowtags = "show" === this.value,
  8727. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8728. }
  8729. document.getElementById("tag-toggles").classList.remove("hidden"),
  8730. document.getElementById("radio-tag-show").checked = !0;
  8731. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8732. n[r].addEventListener("change", i)
  8733. }
  8734. var o = e("../../settings");
  8735. t.exports.init = n
  8736. }
  8737. , {
  8738. "../../settings": 166
  8739. }],
  8740. 82: [function(e, t, i) {
  8741. (function(i) {
  8742. "use strict";
  8743. function n(e, t) {
  8744. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e, g_weixinObj.title = e,
  8745. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8746. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8747. document.getElementById("gui-name").classList.add("noCoBrand"),
  8748. document.getElementById("cobrandTitle").classList.add("hidden")),
  8749. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8750. !1)
  8751. }
  8752. function r(e) {
  8753. return e ? (L = !0,
  8754. void (_.innerHTML = e)) : void _.classList.add("hidden")
  8755. }
  8756. function o(e, t, i, n) {
  8757. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8758. return void T.classList.add("hidden");
  8759. L = !0;
  8760. var r = []
  8761. , o = c(r, "<br>");
  8762. if (e && o('<span id="contactName">' + e + "</span>"),
  8763. t) {
  8764. var a = n || t
  8765. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8766. o(s)
  8767. }
  8768. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8769. r[0] = "",
  8770. x.innerHTML = r.join("")
  8771. }
  8772. function a(e) {
  8773. if ("string" == typeof e)
  8774. try {
  8775. e = JSON.parse(e)
  8776. } catch (e) {
  8777. return y.warn("Unable to parse address data"),
  8778. void S.parentElement.classList.add("hidden")
  8779. }
  8780. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8781. return void S.parentElement.classList.add("hidden");
  8782. L = !0;
  8783. var t = []
  8784. , i = c(t, " ");
  8785. e.address_1 && i(e.address_1),
  8786. e.address_2 && i(e.address_2),
  8787. e.city && i(e.city, ", "),
  8788. e.state && i(e.state, ", "),
  8789. e.zip && i(e.zip, e.state ? " " : ", "),
  8790. t[0] = "",
  8791. S.innerText = t.join("")
  8792. }
  8793. function s(e) {
  8794. var t = document.createElement("a");
  8795. return t.id = "url",
  8796. t.target = "_blank",
  8797. t.href = e,
  8798. t.innerText = e,
  8799. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8800. t
  8801. }
  8802. function l(e) {
  8803. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8804. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8805. P.appendChild(s(e)),
  8806. O.forEach(function(e) {
  8807. e.classList.add("share-link")
  8808. }),
  8809. !0)
  8810. }
  8811. function c(e, t) {
  8812. var i = e
  8813. , n = t;
  8814. return function(e, t) {
  8815. i.push(t || n, e)
  8816. }
  8817. }
  8818. function h() {
  8819. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8820. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8821. var e = [].slice.call(_.querySelectorAll("a"));
  8822. e.forEach(function(e) {
  8823. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8824. });
  8825. var t = [].slice.call(T.querySelectorAll("a"));
  8826. t.forEach(function(e) {
  8827. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8828. contact_type: e.getAttribute("id")
  8829. }))
  8830. })
  8831. }
  8832. var u = e("../../util/browser")
  8833. , d = e("../../util/common")
  8834. , p = e("../../util/logger")
  8835. , f = e("../../localization/localize")
  8836. , g = e("./titleBarSettings")
  8837. , m = e("../../settings")
  8838. , v = e("./TitleEvents")
  8839. , A = e("events").EventEmitter
  8840. , y = new p(i)
  8841. , C = document.querySelector(".pinTop.left")
  8842. , I = document.getElementsByClassName("title-container")[0]
  8843. , E = document.getElementById("title-toggle").querySelector("i")
  8844. , b = document.getElementById("meta-info-wrapper")
  8845. , w = document.getElementById("meta-info")
  8846. , _ = document.getElementById("meta-description")
  8847. , T = document.getElementsByClassName("contact-info")[0]
  8848. , x = document.getElementById("contact-data")
  8849. , S = document.getElementById("addressTxt")
  8850. , M = document.getElementById("tag-toggles")
  8851. , R = document.getElementById("share-origin")
  8852. , P = document.getElementById("share-link-wrapper")
  8853. , O = [w, b, I]
  8854. , L = !1
  8855. , D = !1
  8856. , N = {
  8857. populate: function(e) {
  8858. if (n(window.DATA.name, e.coBrand)) {
  8859. if (r(e.description),
  8860. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8861. a(e.address),
  8862. L) {
  8863. var t = document.createElement("br");
  8864. M.insertBefore(t, M.firstElementChild)
  8865. }
  8866. e.socialSharing && m.share.enabled && (D = l(e.url))
  8867. }
  8868. },
  8869. finishSetup: function(e) {
  8870. L = L || !!e,
  8871. h(),
  8872. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8873. },
  8874. toggleMeta: function(e, t) {
  8875. var title = document.getElementById("model-title");
  8876. t && t.preventDefault();
  8877. var i = w.classList.contains("expand");
  8878. e && !i || (i ? (O.forEach(function(e) {
  8879. e.classList.remove("expand")
  8880. }),
  8881. this.emit(v.CLOSE_INFO),title.classList.remove("expand")) : (O.forEach(function(e) {
  8882. e.classList.add("expand");
  8883. }),
  8884. title.classList.add("expand"),
  8885. this.emit(v.OPEN_INFO)))
  8886. },
  8887. setupToggling: function() {
  8888. b.style.height = w.offsetHeight + "px",
  8889. w.addEventListener("transitionend", function() {
  8890. b.style.height = w.offsetHeight + "px"
  8891. })
  8892. },
  8893. toggleTitle: function(e) {
  8894. e && e.preventDefault(),
  8895. C.classList.contains("closed") ? (C.classList.add("open"),
  8896. E.classList.remove("icon-dpad-right"),
  8897. E.classList.add("icon-dpad-left"),
  8898. this.emit(v.SHOW_INFO),
  8899. setTimeout(function() {
  8900. C.classList.remove("closed"),
  8901. C.classList.remove("open")
  8902. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8903. E.classList.remove("icon-dpad-left"),
  8904. E.classList.add("icon-dpad-right"),
  8905. this.emit(v.HIDE_INFO))
  8906. }
  8907. };
  8908. d.extendObject(N, A.prototype),
  8909. t.exports = N
  8910. }
  8911. ).call(this, "/js/gui/title/titleBar.js")
  8912. }
  8913. , {
  8914. "../../localization/localize": 108,
  8915. "../../settings": 166,
  8916. "../../util/browser": 182,
  8917. "../../util/common": 185,
  8918. "../../util/logger": 189,
  8919. "./TitleEvents": 80,
  8920. "./titleBarSettings": 83,
  8921. events: 202
  8922. }],
  8923. 83: [function(e, t, i) {
  8924. "use strict";
  8925. t.exports = Object.freeze({
  8926. minTooltipCharacters: 19,
  8927. removeAnimationClasses: 500
  8928. })
  8929. }
  8930. , {}],
  8931. 84: [function(e, t, i) {
  8932. "use strict";
  8933. function n(e) {
  8934. C = e,
  8935. P.forEach(function(e) {
  8936. b.addEventListener(e, u.bind(this, !1), !0),
  8937. w.addEventListener(e, u.bind(this, !0), !0),
  8938. E.addEventListener(e, stopTour2, !0)
  8939. /* S.forEach(function(t) {//会触发导览停止
  8940. t.addEventListener(e, stopTour, !0)
  8941. }) */
  8942. $("#drawer img").on(e, stopTour)
  8943. })
  8944. document.addEventListener("keydown", u.bind(this, !1), !0)
  8945. C.on(v.TourStart, function() {
  8946. E.classList.add("playing")
  8947. })
  8948. }
  8949. function play() {//r
  8950. settings.playTourNearBy ? C.playTourNearBy() : C.playTour()
  8951. I && clearTimeout(I),
  8952. d(),
  8953. _.removeClass("fadeIn")
  8954. }
  8955. function stopTour2() {//o
  8956. E.classList.contains("playing") && (C.stopTour(),
  8957. _.addClass("fadeIn"),
  8958. setTimeout(function() {
  8959. _.removeClass("fadeIn")
  8960. }, p.tourInteraction.showPauseButton),
  8961. O || (clearTimeout(I),
  8962. I = setTimeout(h, p.tourInteraction.showModal)),
  8963. setTimeout(function() {
  8964. E.classList.remove("playing")
  8965. }, p.tourInteraction.allowNextClick))
  8966. }
  8967. function stopTour() { //a
  8968. C.tourInProgress && (C.stopTour(),
  8969. C.endTourProgress(),
  8970. E.classList.remove("playing"))
  8971. }
  8972. function togglePlay() {//s
  8973. T.is(":visible") ? play() : stopTour2()
  8974. }
  8975. function l() {
  8976. x.hasClass("playing") && (clearTimeout(I),
  8977. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8978. }
  8979. function c() {
  8980. E.classList.remove("playing"),
  8981. h()
  8982. }
  8983. function h() {//去掉导览结束时的提示
  8984. /* if (!p.tourInteraction.disabled) {
  8985. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8986. M.addClass("fadeIn tour " + m.deviceType);
  8987. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8988. if (!p.tourInteraction.smallModal) {
  8989. var t;
  8990. 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,
  8991. m.fill(R, A.TOUR_INTERACTION[t]),
  8992. M.addClass(t)
  8993. }
  8994. M.addClass(e)
  8995. } */
  8996. }
  8997. function u(e, t) {
  8998. if (t) {
  8999. var i = "keydown" === t.type
  9000. , n = t.which === f.SPACE || C.tourIsPlaying;
  9001. i && n || e || (O = !0),
  9002. C.atEndOfTour() && d(),
  9003. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"), d(), t.which !== f.SPACE && stopTour()),
  9004. i && n && togglePlay() //空格键播放或暂停
  9005. }
  9006. }
  9007. function d() {
  9008. M.removeClass("fadeIn")
  9009. }
  9010. var p = (e("../util/browser"),
  9011. e("../settings"))
  9012. , f = e("../enum/Keys")
  9013. , g = e("../enum/Viewmode")
  9014. , m = (e("./helpManager"),
  9015. e("./populateModal"))
  9016. , v = e("../enum/DirectorEvents")
  9017. , A = e("../enum/HelpModalType")
  9018. , y = e("../enum/HelpModalSize")
  9019. , C = null
  9020. , I = null
  9021. , E = document.getElementById("pause-overlay")
  9022. , b = document.getElementById("player")
  9023. , w = document.getElementById("gui")
  9024. , _ = $("#pause-icon").eq(0)
  9025. , T = $("#play").eq(0)
  9026. , x = $("#playHead").eq(0)
  9027. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  9028. , M = $("#interaction-modal").eq(0)
  9029. , R = $("#interaction-modal .interaction").toArray()
  9030. , P = ["touchstart", "mousedown", "pointerdown"]
  9031. , O = !1;
  9032. t.exports.init = n,
  9033. t.exports.play = play,
  9034. t.exports.pause = stopTour2,
  9035. t.exports.pauseWithoutCTA = stopTour,
  9036. t.exports.togglePlay = togglePlay,
  9037. t.exports.stopTour = l,
  9038. t.exports.dismissModal = d
  9039. }
  9040. , {
  9041. "../enum/DirectorEvents": 23,
  9042. "../enum/HelpModalSize": 27,
  9043. "../enum/HelpModalType": 28,
  9044. "../enum/Keys": 30,
  9045. "../enum/Viewmode": 51,
  9046. "../settings": 166,
  9047. "../util/browser": 182,
  9048. "./helpManager": 68,
  9049. "./populateModal": 75
  9050. }],
  9051. 85: [function(e, t, i) {
  9052. "use strict";
  9053. t.exports = Object.freeze({
  9054. OPENED: "vr.modal.opened",
  9055. LAUNCH: "vr.modal.launch",
  9056. CLOSED: "vr.modal.closed",
  9057. NEXT: "vr.modal.next",
  9058. PREV: "vr.modal.prev",
  9059. STORE: "vr.modal.store",
  9060. falseICECHOSEN: "vr.modal.device"
  9061. })
  9062. }
  9063. , {}],
  9064. 86: [function(e, t, i) {
  9065. "use strict";
  9066. function n(e, t, i) {
  9067. function n(e, t, n, r) {
  9068. function o() {
  9069. return p + "&m=" + t + "&display=" + e
  9070. }
  9071. function s() {
  9072. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  9073. , t = "&utm_source=" + u
  9074. , n = "&utm_showcase_session_id=" + i;
  9075. return e + t + n
  9076. }
  9077. function l() {
  9078. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  9079. }
  9080. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  9081. }
  9082. function r(e, t, i, r) {
  9083. var o = "https://api.branch.io/v1/url"
  9084. , a = n(e, t, i, r)
  9085. , s = {
  9086. responseType: "json",
  9087. data: {
  9088. branch_key: h.appConfig.branch_key,
  9089. data: {
  9090. m: t,
  9091. full_url: a,
  9092. $desktop_url: m,
  9093. $og_app_id: "331853976762864119",
  9094. $og_title: i,
  9095. $og_description: r,
  9096. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  9097. $canonical_url: window.location.href
  9098. }
  9099. }
  9100. };
  9101. c.post(o, s).done(function(t) {
  9102. f[e] = t.url
  9103. }).fail(function(t) {
  9104. f[e] = t
  9105. }
  9106. .bind(this, a))
  9107. }
  9108. function o(e, t, i) {
  9109. for (var r in s) {
  9110. var o = s[r]
  9111. , a = n(o, e, t, i);
  9112. f[o] = a
  9113. }
  9114. }
  9115. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  9116. , d = g + "/vr/dlist/?ret=" + u
  9117. , p = g + "/vr/show/?ret=" + u
  9118. , m = "";
  9119. switch (e) {
  9120. case l.IOS:
  9121. r(s.CardboardIOS, t.sid, t.name, t.summary);
  9122. break;
  9123. default:
  9124. o(t.sid, t.name, t.summary)
  9125. }
  9126. }
  9127. function r(e) {
  9128. var t = f[e];
  9129. window.open(t, "_blank")
  9130. }
  9131. function o(e) {
  9132. var t = u[e];
  9133. window.open(t, "_blank")
  9134. }
  9135. var a = e("../../util/browser")
  9136. , s = e("../../enum/VRApps")
  9137. , l = e("../../enum/VRPlatforms")
  9138. , c = e("../../util/ajax")
  9139. , h = e("../../settings")
  9140. , u = {};
  9141. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  9142. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  9143. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  9144. for (var d in s) {
  9145. var p = s[d];
  9146. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  9147. }
  9148. var f = {}
  9149. , g = function() {
  9150. var e = window.location.host;
  9151. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  9152. "https://" + e
  9153. }();
  9154. t.exports.init = n,
  9155. t.exports.launch = r,
  9156. t.exports.launchStore = o
  9157. }
  9158. , {
  9159. "../../enum/VRApps": 46,
  9160. "../../enum/VRPlatforms": 49,
  9161. "../../settings": 166,
  9162. "../../util/ajax": 181,
  9163. "../../util/browser": 182
  9164. }],
  9165. 87: [function(e, t, i) {
  9166. "use strict";
  9167. function n(e) {
  9168. var t;
  9169. switch (e) {
  9170. case m.IOS:
  9171. return t = p.iosVersion(),
  9172. t.major > 9 || 9 === t.major && t.minor >= 1;
  9173. case m.Android:
  9174. return t = p.androidVersion(),
  9175. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  9176. }
  9177. return !1
  9178. }
  9179. function r(e, t) {
  9180. function i(e) {
  9181. K.emit(A.STORE, {
  9182. type: e
  9183. }),
  9184. f.launchStore(e)
  9185. }
  9186. function r(e) {
  9187. switch (e !== _.pageCount && (a(e),
  9188. N.text(e + 1 + " / " + _.pageCount)),
  9189. e) {
  9190. case _.Title:
  9191. O.css("display", "none"),
  9192. L.text(u[e]),
  9193. o(s);
  9194. break;
  9195. case _.Cardboard:
  9196. O.css("display", "block"),
  9197. L.text(u[e]),
  9198. M.filter(".cardboard").off(),
  9199. M.filter(".gearvr").off(),
  9200. c(e, s),
  9201. h(H, X, Z);
  9202. break;
  9203. case _.Gear:
  9204. L.text(u[e]),
  9205. c(e, s),
  9206. T.addClass("lastPage"),
  9207. h(G, X, Z);
  9208. break;
  9209. case _.pageCount:
  9210. T.removeClass("fadeIn"),
  9211. K.emit(A.CLOSED)
  9212. }
  9213. B.filter("[src='']").hide()
  9214. }
  9215. var s = function() {
  9216. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  9217. w = ".show-supported",
  9218. m.Android) : (T.addClass("unsupported"),
  9219. w = ".show-unsupported",
  9220. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  9221. w = ".show-ios",
  9222. _ = v.ios,
  9223. m.IOS) : (T.addClass("desktop"),
  9224. w = ".show-desktop",
  9225. m.Desktop)
  9226. }();
  9227. f.init(s, e, t),
  9228. s !== m.Desktop && T.addClass("mobile");
  9229. var l = function(e) {
  9230. K.emit(A.LAUNCH, {
  9231. vr_platform: s,
  9232. vr_app: e
  9233. }),
  9234. f.launch(e)
  9235. };
  9236. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  9237. q.gear = l.bind(this, g.GearVR),
  9238. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  9239. d(),
  9240. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  9241. $(w).show();
  9242. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  9243. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  9244. s === m.IOS && (u.splice(1, 1),
  9245. y.splice(1, 1)),
  9246. $("#vr").on("click", function(e) {
  9247. e.preventDefault();
  9248. player.FlyToMode("panorama", ()=>{
  9249. if(!window.vrEnabled) { // 开启VR
  9250. window.vrEnabled = true;
  9251. this.classList.add('active');
  9252. $('#gui div').not('#vrOff').addClass('vrHide');
  9253. $('#vrOffImg').css({'display':'inline-block'});
  9254. }else{
  9255. }
  9256. })
  9257. });
  9258. let exitVR = function(){
  9259. $('#gui div').not('#vrOff').removeClass('vrHide');
  9260. $('#vrOffImg').css({'display':'none'});
  9261. $('#player canvas').css({width:'', 'height': ''}); // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9262. $('#vr').removeClass('active'); // 清除vr按钮的激活样式
  9263. }
  9264. $('#vrOff').on('click', function(){
  9265. window.vrEnabled = false;
  9266. exitVR()
  9267. })
  9268. window.bus.addEventListener('exitWebXR',(e)=>{
  9269. exitVR()
  9270. })
  9271. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  9272. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  9273. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  9274. $("span.modelLink").text(I),
  9275. O.on("click", function(e) {
  9276. K.emit(A.PREV),
  9277. b--,
  9278. r(b)
  9279. }),
  9280. L.on("click", function(e) {
  9281. L.text();
  9282. K.emit(A.NEXT, {
  9283. nextAction: y[b]
  9284. }),
  9285. b++,
  9286. r(b)
  9287. }),
  9288. T.find(".close").on("click", K.dismiss)
  9289. }
  9290. function o(e) {
  9291. switch (e) {
  9292. case m.Android:
  9293. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  9294. M.filter(".gearvr").off().on("click", q.gear),
  9295. s(H, G, "logo-button", "same-line");
  9296. break;
  9297. case m.UnsupportedAndroid:
  9298. s("", z, "", "");
  9299. break;
  9300. case m.IOS:
  9301. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  9302. s(H, "", "logo-button", "");
  9303. break;
  9304. case m.Desktop:
  9305. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  9306. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  9307. s(H, G, "logo-button", "same-line"),
  9308. Q.cardboard()
  9309. }
  9310. }
  9311. function a(e) {
  9312. $(".p1, .p2, .p3").hide(),
  9313. x.insertAfter(S),
  9314. T.removeClass("front-page"),
  9315. T.removeClass("details-page"),
  9316. T.removeClass("lastPage"),
  9317. M.removeClass("logo-button"),
  9318. M.removeClass("same-line"),
  9319. S.removeClass("headsetOptions"),
  9320. R.attr("src", ""),
  9321. R.filter(".second").removeClass("gear"),
  9322. R.css("display", "inline-block"),
  9323. R.off(),
  9324. P.filter(".second").css("display", ""),
  9325. D.css("display", "none"),
  9326. $(".p" + (e + 1) + w).show(),
  9327. R.filter(".third").insertBefore(P.filter(".third"))
  9328. }
  9329. function s(e, t, i, n) {
  9330. T.addClass("front-page"),
  9331. R.filter(".first").attr("src", e),
  9332. R.filter(".second").attr("src", t),
  9333. M.filter(".first").addClass(i),
  9334. M.filter(".second").addClass(i),
  9335. M.addClass(n),
  9336. ".show-desktop" === w && S.insertAfter(x)
  9337. }
  9338. function l(e, t, i) {
  9339. S.addClass("headsetOptions"),
  9340. M.off(),
  9341. R.filter(".second").attr("src", t),
  9342. D.css("display", "block"),
  9343. P.filter(".second").css("display", "none"),
  9344. D.on("click", function() {
  9345. a(_.Title),
  9346. o(m.Desktop)
  9347. }),
  9348. e && (K.emit(A.falseICECHOSEN, {
  9349. name: g.GearVR
  9350. }),
  9351. R.filter(".first").attr("src", e),
  9352. R.filter(".second").addClass("gear"),
  9353. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9354. Q.gearvr()),
  9355. i && (K.emit(A.falseICECHOSEN, {
  9356. name: g.Cardboard
  9357. }),
  9358. R.filter(".third").attr("src", i),
  9359. R.filter(".third").show(),
  9360. R.filter(".third").insertAfter(R.filter(".second")),
  9361. R.filter(".third").addClass("link"),
  9362. R.filter(".second").addClass("link"),
  9363. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9364. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  9365. Q.cardboard())
  9366. }
  9367. function c(e, t) {
  9368. switch (t) {
  9369. case m.IOS:
  9370. X = Y,
  9371. Z = j;
  9372. break;
  9373. case m.Desktop:
  9374. e === _.Cardboard ? (X = F,
  9375. Z = U,
  9376. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  9377. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  9378. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  9379. Z = "");
  9380. break;
  9381. default:
  9382. e === _.Cardboard ? (X = z,
  9383. Z = j) : (X = k,
  9384. Z = W)
  9385. }
  9386. }
  9387. function h(e, t, i) {
  9388. T.find(".inner").addClass("details-page"),
  9389. T.addClass("details-page"),
  9390. R.filter(".first").attr("src", e),
  9391. R.filter(".second").attr("src", t),
  9392. R.filter(".third").attr("src", i)
  9393. }
  9394. function u() {
  9395. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  9396. K.emit(A.CLOSED))
  9397. }
  9398. function d() {
  9399. var e = p.aspectRatio() > 1 && p.isMobile();
  9400. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  9401. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  9402. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  9403. }
  9404. var p = e("../../util/browser")
  9405. , f = e("./vrLink")
  9406. , g = e("../../enum/VRApps")
  9407. , m = e("../../enum/VRPlatforms")
  9408. , v = e("../../enum/VRPages")
  9409. , A = e("./vrEvent")
  9410. , y = (e("../../settings"),
  9411. e("../../constants"))
  9412. , C = e("../../localization/localize")
  9413. , I = e("../../util/common")
  9414. , E = e("events").EventEmitter
  9415. , b = 0
  9416. , w = null
  9417. , _ = v.standard
  9418. , T = $(".vr-popup")
  9419. , x = T.find(".vr-popup-body")
  9420. , S = T.find(".vr-images")
  9421. , M = T.find(".img-container")
  9422. , R = T.find(".vr-sm-image")
  9423. , P = M.find(".vr-img-caption")
  9424. , O = $(".vr-buttons").find(".prev-button")
  9425. , L = $(".vr-buttons").find(".next-button")
  9426. , D = S.find(".front-close")
  9427. , N = $(".vr-page")
  9428. , B = T.find("img")
  9429. , F = "images/apple-store.png"
  9430. , V = "images/badge-oculus.png"
  9431. , U = "images/badge-cardboard.png"
  9432. , k = "images/logo-samsung.png"
  9433. , H = "images/headset-cardboard.png"
  9434. , G = "images/headset-gearvr.png"
  9435. , z = "images/ico-android-robot.png"
  9436. , W = "images/ico-gearvr.png"
  9437. , j = "images/ico-vr.png"
  9438. , Y = "images/apple-logo-white.svg"
  9439. , X = null
  9440. , Z = null
  9441. , q = {}
  9442. , K = {
  9443. init: r,
  9444. dismiss: u,
  9445. isDeviceSupported: n
  9446. };
  9447. I.extendObject(K, E.prototype),
  9448. $(window).resize(d);
  9449. var Q = function() {
  9450. var e = P.filter(".first").find(".cardboard")
  9451. , t = P.filter(".first").find(".gearvr");
  9452. return {
  9453. cardboard: function() {
  9454. t.addClass("hidden"),
  9455. e.removeClass("hidden")
  9456. },
  9457. gearvr: function() {
  9458. e.addClass("hidden"),
  9459. t.removeClass("hidden")
  9460. }
  9461. }
  9462. }();
  9463. t.exports = K
  9464. }
  9465. , {
  9466. "../../constants": 8,
  9467. "../../enum/VRApps": 46,
  9468. "../../enum/VRPages": 48,
  9469. "../../enum/VRPlatforms": 49,
  9470. "../../localization/localize": 108,
  9471. "../../settings": 166,
  9472. "../../util/browser": 182,
  9473. "../../util/common": 185,
  9474. "./vrEvent": 85,
  9475. "./vrLink": 86,
  9476. events: 202
  9477. }],
  9478. 88: [function(e, t, i) {
  9479. "use strict";
  9480. t.exports = Object.freeze({
  9481. OPENED: "webvr.modal.opened",
  9482. SHOW_TERMS: "webvr.footer.show.terms"
  9483. })
  9484. }
  9485. , {}],
  9486. 89: [function(e, t, i) {
  9487. (function(i) {
  9488. "use strict";
  9489. function n(e, t, i, n) {
  9490. function r(e) {
  9491. e.preventDefault(),
  9492. a(e.currentTarget.id)
  9493. }
  9494. function a(e) {
  9495. ne[e](),
  9496. Object.keys(ne).map(function(t, i) {
  9497. $("#" + t).toggleClass("tabs-underlined", t === e)
  9498. })
  9499. }
  9500. y = i,
  9501. v = t,
  9502. w.init(E.Android, e, n),
  9503. m();
  9504. var l = new RegExp("daydream","i")
  9505. , c = l.test(y.displayName);
  9506. c ? (a("tabdaydream"),
  9507. B.filter(".device-headset-side").attr("src", H),
  9508. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9509. B.filter(".device-headset-side").attr("src", Y),
  9510. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9511. $("#vr").on("click", function(e) {
  9512. e.preventDefault(),
  9513. g("click_webvr_button"),
  9514. L.is(":hidden") && (ie.emit(_.OPENED),
  9515. o())
  9516. }),
  9517. $(".webvr-popup .close").on("click", function(e) {
  9518. e.preventDefault(),
  9519. D.hasClass("hidden") ? (g("webvr_help_close"),
  9520. p()) : s()
  9521. }),
  9522. $("#tabcardboard").on("click", r),
  9523. $("#tabdaydream").on("click", r),
  9524. $("#tabnative").on("click", r),
  9525. $(".webvr-popup .open-with-app").on("click", function(e) {
  9526. e.preventDefault(),
  9527. g("webvr_learn_more"),
  9528. a("tabnative"),
  9529. p()
  9530. }),
  9531. $(".webvr-popup .help").on("click", function(e) {
  9532. e.preventDefault(),
  9533. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9534. p()
  9535. }),
  9536. $(".webvr-popup .terms").on("click", function(e) {
  9537. e.preventDefault(),
  9538. g("webvr_click_terms"),
  9539. s(),
  9540. ie.emit(_.SHOW_TERMS)
  9541. }),
  9542. F.on("click", function(e) {
  9543. e.preventDefault(),
  9544. g(ee),
  9545. window.open(J, "_blank")
  9546. }),
  9547. V.on("click", function(e) {
  9548. e.preventDefault(),
  9549. g("webvr_phone_link"),
  9550. window.open(te, "_blank")
  9551. }),
  9552. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9553. e.preventDefault(),
  9554. g("webvr_cardboard_link"),
  9555. w.launch(b.CardboardAndroid)
  9556. }),
  9557. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9558. e.preventDefault(),
  9559. g("webvr_oculus_link"),
  9560. w.launch(b.GearVR)
  9561. })
  9562. }
  9563. function r() {
  9564. function e() {
  9565. y.isPresenting || (f(),
  9566. window.removeEventListener("vrdisplaypresentchange", e))
  9567. }
  9568. R.info("Headset mounted"),
  9569. v.suspend();
  9570. var t = document.createElement("canvas");
  9571. for (t.getContext("webgl"),
  9572. t.className = "webvr-canvas",
  9573. document.bgColor = "#000",
  9574. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9575. document.body.removeChild(document.body.firstChild);
  9576. document.body.appendChild(t),
  9577. g("webvr_enter_app"),
  9578. y.requestPresent([{
  9579. source: t,
  9580. predistorted: !0
  9581. }]).catch(function(t) {
  9582. R.error("Failed to present: " + t),
  9583. g("webvr_exit_calibrate"),
  9584. e()
  9585. }),
  9586. A.then(function() {
  9587. window.dispatchEvent(new Event("vrapp-start"))
  9588. }),
  9589. window.addEventListener("vrdisplaypresentchange", e)
  9590. }
  9591. function o() {
  9592. O.fadeOut(I.guiAnimationSpeed),
  9593. L.fadeIn(I.guiAnimationSpeed),
  9594. a()
  9595. }
  9596. function a() {
  9597. if (!A) {
  9598. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9599. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9600. A = new Promise(function(e, i) {
  9601. var n = document.createElement("script");
  9602. n.type = "text/javascript",
  9603. n.src = t,
  9604. n.onload = e,
  9605. document.head.appendChild(n)
  9606. }
  9607. )
  9608. }
  9609. D.find(".enter-button").on("click", r)
  9610. }
  9611. function s() {
  9612. g("webvr_modal_close"),
  9613. D.find(".enter-button").off("click", r),
  9614. L.fadeOut(I.guiAnimationSpeed, function() {
  9615. D.toggleClass("hidden", !1),
  9616. N.toggleClass("hidden", !0),
  9617. C.exitFullscreen()
  9618. }),
  9619. O.fadeIn(I.guiAnimationSpeed)
  9620. }
  9621. function l() {
  9622. k.toggleClass("hidden", !1),
  9623. U.toggleClass("hidden", !0)
  9624. }
  9625. function c() {
  9626. k.toggleClass("hidden", !0),
  9627. U.toggleClass("hidden", !1)
  9628. }
  9629. function h() {
  9630. B.filter(".device-headset").attr("src", G),
  9631. B.filter(".device-phone").attr("src", z),
  9632. J = Z,
  9633. ee = K,
  9634. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9635. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9636. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9637. c()
  9638. }
  9639. function u() {
  9640. B.filter(".badge-cardboard").attr("src", j),
  9641. B.filter(".badge-oculus").attr("src", X),
  9642. l()
  9643. }
  9644. function d() {
  9645. B.filter(".device-headset").attr("src", Y),
  9646. B.filter(".device-phone").attr("src", W),
  9647. J = q,
  9648. ee = Q,
  9649. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9650. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9651. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9652. c()
  9653. }
  9654. function p() {
  9655. D.toggleClass("hidden"),
  9656. N.toggleClass("hidden")
  9657. }
  9658. function f() {
  9659. R.info("exiting webVR"),
  9660. g("webvr_exit_app"),
  9661. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9662. }
  9663. function g(e) {
  9664. var t = C.isLandscape() ? "landscape" : "portrait";
  9665. T.trackAlways("showcase_gui", {
  9666. gui_action: e,
  9667. orientation: t
  9668. })
  9669. }
  9670. function m() {
  9671. var e = C.isLandscape();
  9672. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9673. }
  9674. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9675. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9676. 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 = {
  9677. init: n
  9678. }, ne = {
  9679. tabcardboard: d,
  9680. tabdaydream: h,
  9681. tabnative: u
  9682. };
  9683. S.extendObject(ie, P.prototype),
  9684. $(window).resize(m),
  9685. t.exports = ie
  9686. }
  9687. ).call(this, "/js/gui/webvr/webVRgui.js")
  9688. }
  9689. , {
  9690. "../../analytics": 4,
  9691. "../../constants": 8,
  9692. "../../enum/VRApps": 46,
  9693. "../../enum/VRPlatforms": 49,
  9694. "../../localization/localize": 108,
  9695. "../../settings": 166,
  9696. "../../util/browser": 182,
  9697. "../../util/common": 185,
  9698. "../../util/logger": 189,
  9699. "./../gui": 65,
  9700. "./../vr/vrLink": 86,
  9701. "./WebVrEvent": 88,
  9702. events: 202
  9703. }],
  9704. 90: [function(e, t, i) {
  9705. "use strict";
  9706. function n(e, t, i, n, o) {
  9707. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9708. this.roomId = o || "",
  9709. this.labelId = e,
  9710. this.position = (new r.Vector3).copy(t),
  9711. this.text = i
  9712. }
  9713. var r = e("three")
  9714. , o = e("../util/browser");
  9715. n.prototype.build = function() {
  9716. var e = window.document.createElement("div");
  9717. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9718. var t = window.document.createElement("div");
  9719. t.setAttribute("class", "gui-floorplan-label-text");
  9720. var i = window.document.createTextNode(this.text);
  9721. t.appendChild(i),
  9722. e.appendChild(t),
  9723. window.document.body.appendChild(e),
  9724. this.labelGui = e,
  9725. this.textBlock = t,
  9726. $(this.labelGui).hide();
  9727. var n = window.getComputedStyle(this.labelGui);
  9728. this.initialTransform = n.transform || n.webkitTransform
  9729. }
  9730. ,
  9731. t.exports = n
  9732. }
  9733. , {
  9734. "../util/browser": 182,
  9735. three: 217
  9736. }],
  9737. 91: [function(e, t, i) {
  9738. "use strict";
  9739. function n() {
  9740. this.player = null,
  9741. this.modelManager = null,
  9742. this.container = null
  9743. }
  9744. var r = e("three")
  9745. , o = (e("../util/common"),
  9746. e("../enum/PlayerEvents"))
  9747. , a = (e("../enum/DirectorEvents"),
  9748. e("../enum/ModelManagerEvents"))
  9749. , s = e("../settings")
  9750. , l = e("../enum/Viewmode")
  9751. , c = (e("../enum/WarpStyle"),
  9752. e("../util/transitions"),
  9753. e("../util/lerp"),
  9754. e("../util/browser"));
  9755. //场景初始化
  9756. n.prototype.init = function(e, t, i) {
  9757. this.player = e,
  9758. this.modelManager = t,
  9759. this.container = i,
  9760. this.updateModel(),
  9761. this.bindEvents()
  9762. }
  9763. ,
  9764. n.prototype.bindEvents = function() {
  9765. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9766. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9767. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9768. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9769. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9770. }
  9771. ,
  9772. n.prototype.updateModel = function() {
  9773. this.model = this.modelManager.getActiveModel()
  9774. }
  9775. ,
  9776. n.prototype.handlePlayerViewChanged = function() {
  9777. this.updateLabelVisibility(),
  9778. this.updateLabelDisplay()
  9779. }
  9780. ,
  9781. n.prototype.getLabelsForFloor = function(e, t) {
  9782. return t = t || [],
  9783. t.length = 0,
  9784. this.model.labels.forEach(function(i) {
  9785. this.labelVisibleForFloor(i, e) && t.push(i)
  9786. }
  9787. .bind(this)),
  9788. t
  9789. }
  9790. ,
  9791. n.prototype.getLabelsForCurrentFloor = function(e) {
  9792. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9793. }
  9794. ,
  9795. n.prototype.labelVisibleForFloor = function(e, t) {
  9796. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9797. if (!this.model.showingLabels || !e.labelGui || !i)
  9798. return !1;
  9799. var n = e.floorId === this.model.floors.size() - 1;
  9800. return this.model.allFloorsVisible ? n : e.floorId === t
  9801. }
  9802. ,
  9803. n.prototype.updateLabelVisibility = function(e) {
  9804. this.model.labels.forEach(function(e) {
  9805. 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)
  9806. }
  9807. .bind(this))
  9808. }
  9809. ,
  9810. n.prototype.showAllLabels = function(e, t) {
  9811. this.model.labels.forEach(function(i) {
  9812. this.showLabel(i, e, t)
  9813. }
  9814. .bind(this))
  9815. }
  9816. ,
  9817. n.prototype.hideAllLabels = function(e, t) {
  9818. this.model.labels.forEach(function(i) {
  9819. this.hideLabel(i, e, t)
  9820. }
  9821. .bind(this))
  9822. }
  9823. ,
  9824. n.prototype.showLabel = function(e, t, i) {
  9825. this.model.showingLabels && (e.visible || (e.visible = !0,
  9826. e.labelGui.style.display = "block",
  9827. e.labelGui.style.opacity = 0,
  9828. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9829. }
  9830. ,
  9831. n.prototype.hideLabel = function(e, t, i) {
  9832. e.visible && (e.visible = !1,
  9833. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9834. }
  9835. ,
  9836. n.prototype.supportedMode = function() {
  9837. return this.player.mode === l.FLOORPLAN
  9838. }
  9839. ,
  9840. n.prototype.updateLabelDisplay = function() {
  9841. var e = (new r.Vector3,
  9842. new r.Vector3,
  9843. []);
  9844. return function() {
  9845. var t = this.player.getLabelScaleFactor()
  9846. , i = .6
  9847. , n = 1.2
  9848. , r = (1 - t) * n + i
  9849. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9850. this.getLabelsForCurrentFloor(e);
  9851. for (var a = 0; a < e.length; a++) {
  9852. var l = e[a];
  9853. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9854. 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)
  9855. }
  9856. }
  9857. }(),
  9858. n.prototype.updateProjectedGuiElement = function() {
  9859. var e = new r.Vector3;
  9860. new r.Vector3;
  9861. return function(t, i, n, r, o) {
  9862. i.style.fontSize = 100 * o + "%";
  9863. var a = $("#player").width()
  9864. , s = $("#player").height()
  9865. , l = .5 * a
  9866. , c = .5 * s;
  9867. e.copy(n),
  9868. e.project(this.player.camera);
  9869. var h = e.x * l + l
  9870. , u = -(e.y * c) + c;
  9871. h -= t.offsetWidth / 2,
  9872. u -= t.offsetHeight / 2,
  9873. t.style.left = h + "px",
  9874. t.style.top = u + "px"
  9875. }
  9876. }(),
  9877. n.prototype.handleStartInside = function(e) {
  9878. this.updateLabelVisibility()
  9879. }
  9880. ,
  9881. n.prototype.handleStartOutside = function() {
  9882. this.updateLabelVisibility()
  9883. }
  9884. ,
  9885. t.exports = n
  9886. }
  9887. , {
  9888. "../enum/DirectorEvents": 23,
  9889. "../enum/ModelManagerEvents": 33,
  9890. "../enum/PlayerEvents": 40,
  9891. "../enum/Viewmode": 51,
  9892. "../enum/WarpStyle": 52,
  9893. "../settings": 166,
  9894. "../util/browser": 182,
  9895. "../util/common": 185,
  9896. "../util/lerp": 188,
  9897. "../util/transitions": 195,
  9898. three: 217
  9899. }],
  9900. 92: [function(e, t, i) {
  9901. "use strict";
  9902. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9903. if (null == this)
  9904. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9905. if ("function" != typeof e)
  9906. throw new TypeError("predicate must be a function");
  9907. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9908. if (t = i[o],
  9909. e.call(r, t, o, i))
  9910. return o;
  9911. return -1
  9912. }
  9913. ),
  9914. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9915. value: function(e) {
  9916. if (null == this)
  9917. throw new TypeError('"this" is null or not defined');
  9918. var t = Object(this)
  9919. , i = t.length >>> 0;
  9920. if ("function" != typeof e)
  9921. throw new TypeError("predicate must be a function");
  9922. for (var n = arguments[1], r = 0; r < i; ) {
  9923. var o = t[r];
  9924. if (e.call(n, o, r, t))
  9925. return o;
  9926. r++
  9927. }
  9928. }
  9929. })
  9930. }
  9931. , {}],
  9932. 93: [function(e, t, i) {
  9933. "use strict";
  9934. var n = n || {};
  9935. t.exports = n,
  9936. n.gui = n.gui || {},
  9937. n.utils = n.utils || {},
  9938. n.controllers = n.controllers || {},
  9939. n.dom = n.dom || {},
  9940. n.color = n.color || {},
  9941. n.utils.css = function() {
  9942. return {
  9943. load: function(e, t) {
  9944. t = t || document;
  9945. var i = t.createElement("link");
  9946. i.type = "text/css",
  9947. i.rel = "stylesheet",
  9948. i.href = e,
  9949. t.getElementsByTagName("head")[0].appendChild(i)
  9950. },
  9951. inject: function(e, t) {
  9952. t = t || document;
  9953. var i = document.createElement("style");
  9954. i.type = "text/css",
  9955. i.innerHTML = e,
  9956. t.getElementsByTagName("head")[0].appendChild(i)
  9957. }
  9958. }
  9959. }(),
  9960. n.utils.common = function() {
  9961. var e = Array.prototype.forEach
  9962. , t = Array.prototype.slice;
  9963. return {
  9964. BREAK: {},
  9965. extend: function(e) {
  9966. return this.each(t.call(arguments, 1), function(t) {
  9967. for (var i in t)
  9968. this.isUndefined(t[i]) || (e[i] = t[i])
  9969. }, this),
  9970. e
  9971. },
  9972. defaults: function(e) {
  9973. return this.each(t.call(arguments, 1), function(t) {
  9974. for (var i in t)
  9975. this.isUndefined(e[i]) && (e[i] = t[i])
  9976. }, this),
  9977. e
  9978. },
  9979. compose: function() {
  9980. var e = t.call(arguments);
  9981. return function() {
  9982. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9983. i = [e[n].apply(this, i)];
  9984. return i[0]
  9985. }
  9986. },
  9987. each: function(t, i, n) {
  9988. if (t)
  9989. if (e && t.forEach && t.forEach === e)
  9990. t.forEach(i, n);
  9991. else if (t.length === t.length + 0) {
  9992. for (var r = 0, o = t.length; r < o; r++)
  9993. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9994. return
  9995. } else
  9996. for (var r in t)
  9997. if (i.call(n, t[r], r) === this.BREAK)
  9998. return
  9999. },
  10000. defer: function(e) {
  10001. setTimeout(e, 0)
  10002. },
  10003. toArray: function(e) {
  10004. return e.toArray ? e.toArray() : t.call(e)
  10005. },
  10006. isUndefined: function(e) {
  10007. return void 0 === e
  10008. },
  10009. isNull: function(e) {
  10010. return null === e
  10011. },
  10012. isNaN: function(e) {
  10013. return e !== e
  10014. },
  10015. isArray: Array.isArray || function(e) {
  10016. return e.constructor === Array
  10017. }
  10018. ,
  10019. isObject: function(e) {
  10020. return e === Object(e)
  10021. },
  10022. isNumber: function(e) {
  10023. return e === e + 0
  10024. },
  10025. isString: function(e) {
  10026. return e === e + ""
  10027. },
  10028. isBoolean: function(e) {
  10029. return e === !1 || e === !0
  10030. },
  10031. isFunction: function(e) {
  10032. return "[object Function]" === Object.prototype.toString.call(e)
  10033. }
  10034. }
  10035. }(),
  10036. n.controllers.Controller = function(e) {
  10037. var t = function(e, t) {
  10038. this.initialValue = e[t],
  10039. this.domElement = document.createElement("div"),
  10040. this.object = e,
  10041. this.property = t,
  10042. this.__onChange = void 0,
  10043. this.__onFinishChange = void 0
  10044. };
  10045. return e.extend(t.prototype, {
  10046. onChange: function(e) {
  10047. return this.__onChange = e,
  10048. this
  10049. },
  10050. onFinishChange: function(e) {
  10051. return this.__onFinishChange = e,
  10052. this
  10053. },
  10054. setValue: function(e) {
  10055. return this.object[this.property] = e,
  10056. this.__onChange && this.__onChange.call(this, e),
  10057. this.updateDisplay(),
  10058. this
  10059. },
  10060. getValue: function() {
  10061. return this.object[this.property]
  10062. },
  10063. updateDisplay: function() {
  10064. return this
  10065. },
  10066. isModified: function() {
  10067. return this.initialValue !== this.getValue()
  10068. }
  10069. }),
  10070. t
  10071. }(n.utils.common),
  10072. n.dom.dom = function(e) {
  10073. function t(t) {
  10074. if ("0" === t || e.isUndefined(t))
  10075. return 0;
  10076. var i = t.match(r);
  10077. return e.isNull(i) ? 0 : parseFloat(i[1])
  10078. }
  10079. var i = {
  10080. HTMLEvents: ["change"],
  10081. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  10082. KeyboardEvents: ["keydown"]
  10083. }
  10084. , n = {};
  10085. e.each(i, function(t, i) {
  10086. e.each(t, function(e) {
  10087. n[e] = i
  10088. })
  10089. });
  10090. var r = /(\d+(\.\d+)?)px/
  10091. , o = {
  10092. makeSelectable: function(e, t) {
  10093. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  10094. return !1
  10095. }
  10096. : function() {}
  10097. ,
  10098. e.style.MozUserSelect = t ? "auto" : "none",
  10099. e.style.KhtmlUserSelect = t ? "auto" : "none",
  10100. e.unselectable = t ? "on" : "off")
  10101. },
  10102. makeFullscreen: function(t, i, n) {
  10103. e.isUndefined(i) && (i = !0),
  10104. e.isUndefined(n) && (n = !0),
  10105. t.style.position = "absolute",
  10106. i && (t.style.left = 0,
  10107. t.style.right = 0),
  10108. n && (t.style.top = 0,
  10109. t.style.bottom = 0)
  10110. },
  10111. fakeEvent: function(t, i, r, o) {
  10112. r = r || {};
  10113. var a = n[i];
  10114. if (!a)
  10115. throw new Error("Event type " + i + " not supported.");
  10116. var s = document.createEvent(a);
  10117. switch (a) {
  10118. case "MouseEvents":
  10119. var l = r.x || r.clientX || 0
  10120. , c = r.y || r.clientY || 0;
  10121. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  10122. break;
  10123. case "KeyboardEvents":
  10124. var h = s.initKeyboardEvent || s.initKeyEvent;
  10125. e.defaults(r, {
  10126. cancelable: !0,
  10127. ctrlKey: !1,
  10128. altKey: !1,
  10129. shiftKey: !1,
  10130. metaKey: !1,
  10131. keyCode: void 0,
  10132. charCode: void 0
  10133. }),
  10134. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  10135. break;
  10136. default:
  10137. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10138. }
  10139. e.defaults(s, o),
  10140. t.dispatchEvent(s)
  10141. },
  10142. bind: function(e, t, i, n) {
  10143. return n = n || !1,
  10144. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  10145. o
  10146. },
  10147. unbind: function(e, t, i, n) {
  10148. return n = n || !1,
  10149. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  10150. o
  10151. },
  10152. addClass: function(e, t) {
  10153. if (void 0 === e.className)
  10154. e.className = t;
  10155. else if (e.className !== t) {
  10156. var i = e.className.split(/ +/);
  10157. i.indexOf(t) == -1 && (i.push(t),
  10158. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  10159. }
  10160. return o
  10161. },
  10162. removeClass: function(e, t) {
  10163. if (t)
  10164. if (void 0 === e.className)
  10165. ;
  10166. else if (e.className === t)
  10167. e.removeAttribute("class");
  10168. else {
  10169. var i = e.className.split(/ +/)
  10170. , n = i.indexOf(t);
  10171. n != -1 && (i.splice(n, 1),
  10172. e.className = i.join(" "))
  10173. }
  10174. else
  10175. e.className = void 0;
  10176. return o
  10177. },
  10178. hasClass: function(e, t) {
  10179. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  10180. },
  10181. getWidth: function(e) {
  10182. var i = getComputedStyle(e);
  10183. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  10184. },
  10185. getHeight: function(e) {
  10186. var i = getComputedStyle(e);
  10187. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  10188. },
  10189. getOffset: function(e) {
  10190. var t = {
  10191. left: 0,
  10192. top: 0
  10193. };
  10194. if (e.offsetParent)
  10195. do
  10196. t.left += e.offsetLeft,
  10197. t.top += e.offsetTop;
  10198. while (e = e.offsetParent);return t
  10199. },
  10200. isActive: function(e) {
  10201. return e === document.activeElement && (e.type || e.href)
  10202. }
  10203. };
  10204. return o
  10205. }(n.utils.common),
  10206. n.controllers.OptionController = function(e, t, i) {
  10207. var n = function(e, r, o) {
  10208. n.superclass.call(this, e, r);
  10209. var a = this;
  10210. if (this.__select = document.createElement("select"),
  10211. i.isArray(o)) {
  10212. var s = {};
  10213. i.each(o, function(e) {
  10214. s[e] = e
  10215. }),
  10216. o = s
  10217. }
  10218. i.each(o, function(e, t) {
  10219. var i = document.createElement("option");
  10220. i.innerHTML = t,
  10221. i.setAttribute("value", e),
  10222. a.__select.appendChild(i)
  10223. }),
  10224. this.updateDisplay(),
  10225. t.bind(this.__select, "change", function() {
  10226. var e = this.options[this.selectedIndex].value;
  10227. a.setValue(e)
  10228. }),
  10229. this.domElement.appendChild(this.__select)
  10230. };
  10231. return n.superclass = e,
  10232. i.extend(n.prototype, e.prototype, {
  10233. setValue: function(e) {
  10234. var t = n.superclass.prototype.setValue.call(this, e);
  10235. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10236. t
  10237. },
  10238. updateDisplay: function() {
  10239. return this.__select.value = this.getValue(),
  10240. n.superclass.prototype.updateDisplay.call(this)
  10241. }
  10242. }),
  10243. n
  10244. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10245. n.controllers.NumberController = function(e, t) {
  10246. function i(e) {
  10247. return e = e.toString(),
  10248. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  10249. }
  10250. var n = function(e, r, o) {
  10251. n.superclass.call(this, e, r),
  10252. o = o || {},
  10253. this.__min = o.min,
  10254. this.__max = o.max,
  10255. this.__step = o.step,
  10256. 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,
  10257. this.__precision = i(this.__impliedStep)
  10258. };
  10259. return n.superclass = e,
  10260. t.extend(n.prototype, e.prototype, {
  10261. setValue: function(e) {
  10262. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10263. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10264. n.superclass.prototype.setValue.call(this, e)
  10265. },
  10266. min: function(e) {
  10267. return this.__min = e,
  10268. this
  10269. },
  10270. max: function(e) {
  10271. return this.__max = e,
  10272. this
  10273. },
  10274. step: function(e) {
  10275. return this.__step = e,
  10276. this.__impliedStep = e,
  10277. this.__precision = i(e),
  10278. this
  10279. }
  10280. }),
  10281. n
  10282. }(n.controllers.Controller, n.utils.common),
  10283. n.controllers.NumberControllerBox = function(e, t, i) {
  10284. function n(e, t) {
  10285. var i = Math.pow(10, t);
  10286. return Math.round(e * i) / i
  10287. }
  10288. var r = function(e, n, o) {
  10289. function a() {
  10290. var e = parseFloat(d.__input.value);
  10291. i.isNaN(e) || d.setValue(e)
  10292. }
  10293. function s() {
  10294. a(),
  10295. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10296. }
  10297. function l(e) {
  10298. t.bind(window, "mousemove", c),
  10299. t.bind(window, "mouseup", h),
  10300. u = e.clientY
  10301. }
  10302. function c(e) {
  10303. var t = u - e.clientY;
  10304. d.setValue(d.getValue() + t * d.__impliedStep),
  10305. u = e.clientY
  10306. }
  10307. function h() {
  10308. t.unbind(window, "mousemove", c),
  10309. t.unbind(window, "mouseup", h)
  10310. }
  10311. this.__truncationSuspended = !1,
  10312. r.superclass.call(this, e, n, o);
  10313. var u, d = this;
  10314. this.__input = document.createElement("input"),
  10315. this.__input.setAttribute("type", "text"),
  10316. t.bind(this.__input, "change", a),
  10317. t.bind(this.__input, "blur", s),
  10318. t.bind(this.__input, "mousedown", l),
  10319. t.bind(this.__input, "keydown", function(e) {
  10320. 13 === e.keyCode && (d.__truncationSuspended = !0,
  10321. this.blur(),
  10322. d.__truncationSuspended = !1)
  10323. }),
  10324. this.updateDisplay(),
  10325. this.domElement.appendChild(this.__input)
  10326. };
  10327. return r.superclass = e,
  10328. i.extend(r.prototype, e.prototype, {
  10329. updateDisplay: function() {
  10330. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  10331. r.superclass.prototype.updateDisplay.call(this)
  10332. }
  10333. }),
  10334. r
  10335. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  10336. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  10337. function o(e, t, i, n, r) {
  10338. return n + (r - n) * ((e - t) / (i - t))
  10339. }
  10340. var a = function(e, i, n, r, s) {
  10341. function l(e) {
  10342. t.bind(window, "mousemove", c),
  10343. t.bind(window, "mouseup", h),
  10344. c(e)
  10345. }
  10346. function c(e) {
  10347. e.preventDefault();
  10348. var i = t.getOffset(u.__background)
  10349. , n = t.getWidth(u.__background);
  10350. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  10351. !1
  10352. }
  10353. function h() {
  10354. t.unbind(window, "mousemove", c),
  10355. t.unbind(window, "mouseup", h),
  10356. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10357. }
  10358. a.superclass.call(this, e, i, {
  10359. min: n,
  10360. max: r,
  10361. step: s
  10362. });
  10363. var u = this;
  10364. this.__background = document.createElement("div"),
  10365. this.__foreground = document.createElement("div"),
  10366. t.bind(this.__background, "mousedown", l),
  10367. t.addClass(this.__background, "slider"),
  10368. t.addClass(this.__foreground, "slider-fg"),
  10369. this.updateDisplay(),
  10370. this.__background.appendChild(this.__foreground),
  10371. this.domElement.appendChild(this.__background)
  10372. };
  10373. return a.superclass = e,
  10374. a.useDefaultStyles = function() {
  10375. i.inject(r)
  10376. }
  10377. ,
  10378. n.extend(a.prototype, e.prototype, {
  10379. updateDisplay: function() {
  10380. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  10381. return this.__foreground.style.width = 100 * e + "%",
  10382. a.superclass.prototype.updateDisplay.call(this)
  10383. }
  10384. }),
  10385. a
  10386. }(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}"),
  10387. n.controllers.FunctionController = function(e, t, i) {
  10388. var n = function(e, i, r) {
  10389. n.superclass.call(this, e, i);
  10390. var o = this;
  10391. this.__button = document.createElement("div"),
  10392. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  10393. t.bind(this.__button, "click", function(e) {
  10394. return e.preventDefault(),
  10395. o.fire(),
  10396. !1
  10397. }),
  10398. t.addClass(this.__button, "button"),
  10399. this.domElement.appendChild(this.__button)
  10400. };
  10401. return n.superclass = e,
  10402. i.extend(n.prototype, e.prototype, {
  10403. fire: function() {
  10404. this.__onChange && this.__onChange.call(this),
  10405. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10406. this.getValue().call(this.object)
  10407. }
  10408. }),
  10409. n
  10410. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10411. n.controllers.BooleanController = function(e, t, i) {
  10412. var n = function(e, i) {
  10413. function r() {
  10414. o.setValue(!o.__prev)
  10415. }
  10416. n.superclass.call(this, e, i);
  10417. var o = this;
  10418. this.__prev = this.getValue(),
  10419. this.__checkbox = document.createElement("input"),
  10420. this.__checkbox.setAttribute("type", "checkbox"),
  10421. t.bind(this.__checkbox, "change", r, !1),
  10422. this.domElement.appendChild(this.__checkbox),
  10423. this.updateDisplay()
  10424. };
  10425. return n.superclass = e,
  10426. i.extend(n.prototype, e.prototype, {
  10427. setValue: function(e) {
  10428. var t = n.superclass.prototype.setValue.call(this, e);
  10429. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10430. this.__prev = this.getValue(),
  10431. t
  10432. },
  10433. updateDisplay: function() {
  10434. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10435. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10436. n.superclass.prototype.updateDisplay.call(this)
  10437. }
  10438. }),
  10439. n
  10440. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10441. n.color.toString = function(e) {
  10442. return function(t) {
  10443. if (1 == t.a || e.isUndefined(t.a)) {
  10444. for (var i = t.hex.toString(16); i.length < 6; )
  10445. i = "0" + i;
  10446. return "#" + i
  10447. }
  10448. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10449. }
  10450. }(n.utils.common),
  10451. n.color.interpret = function(e, t) {
  10452. var i, n, r = function() {
  10453. n = !1;
  10454. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10455. return t.each(o, function(r) {
  10456. if (r.litmus(e))
  10457. return t.each(r.conversions, function(r, o) {
  10458. if (i = r.read(e),
  10459. n === !1 && i !== !1)
  10460. return n = i,
  10461. i.conversionName = o,
  10462. i.conversion = r,
  10463. t.BREAK
  10464. }),
  10465. t.BREAK
  10466. }),
  10467. n
  10468. }, o = [{
  10469. litmus: t.isString,
  10470. conversions: {
  10471. THREE_CHAR_HEX: {
  10472. read: function(e) {
  10473. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10474. return null !== t && {
  10475. space: "HEX",
  10476. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10477. }
  10478. },
  10479. write: e
  10480. },
  10481. SIX_CHAR_HEX: {
  10482. read: function(e) {
  10483. var t = e.match(/^#([A-F0-9]{6})$/i);
  10484. return null !== t && {
  10485. space: "HEX",
  10486. hex: parseInt("0x" + t[1].toString())
  10487. }
  10488. },
  10489. write: e
  10490. },
  10491. CSS_RGB: {
  10492. read: function(e) {
  10493. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10494. return null !== t && {
  10495. space: "RGB",
  10496. r: parseFloat(t[1]),
  10497. g: parseFloat(t[2]),
  10498. b: parseFloat(t[3])
  10499. }
  10500. },
  10501. write: e
  10502. },
  10503. CSS_RGBA: {
  10504. read: function(e) {
  10505. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10506. return null !== t && {
  10507. space: "RGB",
  10508. r: parseFloat(t[1]),
  10509. g: parseFloat(t[2]),
  10510. b: parseFloat(t[3]),
  10511. a: parseFloat(t[4])
  10512. }
  10513. },
  10514. write: e
  10515. }
  10516. }
  10517. }, {
  10518. litmus: t.isNumber,
  10519. conversions: {
  10520. HEX: {
  10521. read: function(e) {
  10522. return {
  10523. space: "HEX",
  10524. hex: e,
  10525. conversionName: "HEX"
  10526. }
  10527. },
  10528. write: function(e) {
  10529. return e.hex
  10530. }
  10531. }
  10532. }
  10533. }, {
  10534. litmus: t.isArray,
  10535. conversions: {
  10536. RGB_ARRAY: {
  10537. read: function(e) {
  10538. return 3 == e.length && {
  10539. space: "RGB",
  10540. r: e[0],
  10541. g: e[1],
  10542. b: e[2]
  10543. }
  10544. },
  10545. write: function(e) {
  10546. return [e.r, e.g, e.b]
  10547. }
  10548. },
  10549. RGBA_ARRAY: {
  10550. read: function(e) {
  10551. return 4 == e.length && {
  10552. space: "RGB",
  10553. r: e[0],
  10554. g: e[1],
  10555. b: e[2],
  10556. a: e[3]
  10557. }
  10558. },
  10559. write: function(e) {
  10560. return [e.r, e.g, e.b, e.a]
  10561. }
  10562. }
  10563. }
  10564. }, {
  10565. litmus: t.isObject,
  10566. conversions: {
  10567. RGBA_OBJ: {
  10568. read: function(e) {
  10569. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10570. space: "RGB",
  10571. r: e.r,
  10572. g: e.g,
  10573. b: e.b,
  10574. a: e.a
  10575. }
  10576. },
  10577. write: function(e) {
  10578. return {
  10579. r: e.r,
  10580. g: e.g,
  10581. b: e.b,
  10582. a: e.a
  10583. }
  10584. }
  10585. },
  10586. RGB_OBJ: {
  10587. read: function(e) {
  10588. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10589. space: "RGB",
  10590. r: e.r,
  10591. g: e.g,
  10592. b: e.b
  10593. }
  10594. },
  10595. write: function(e) {
  10596. return {
  10597. r: e.r,
  10598. g: e.g,
  10599. b: e.b
  10600. }
  10601. }
  10602. },
  10603. HSVA_OBJ: {
  10604. read: function(e) {
  10605. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10606. space: "HSV",
  10607. h: e.h,
  10608. s: e.s,
  10609. v: e.v,
  10610. a: e.a
  10611. }
  10612. },
  10613. write: function(e) {
  10614. return {
  10615. h: e.h,
  10616. s: e.s,
  10617. v: e.v,
  10618. a: e.a
  10619. }
  10620. }
  10621. },
  10622. HSV_OBJ: {
  10623. read: function(e) {
  10624. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10625. space: "HSV",
  10626. h: e.h,
  10627. s: e.s,
  10628. v: e.v
  10629. }
  10630. },
  10631. write: function(e) {
  10632. return {
  10633. h: e.h,
  10634. s: e.s,
  10635. v: e.v
  10636. }
  10637. }
  10638. }
  10639. }
  10640. }];
  10641. return r
  10642. }(n.color.toString, n.utils.common),
  10643. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10644. function g(e, t, i, o) {
  10645. if (void 0 === t[i])
  10646. throw new Error("Object " + t + ' has no property "' + i + '"');
  10647. var a;
  10648. if (o.color)
  10649. a = new h(t,i);
  10650. else {
  10651. var s = [t, i].concat(o.factoryArgs);
  10652. a = n.apply(e, s)
  10653. }
  10654. o.before instanceof r && (o.before = o.before.__li),
  10655. A(e, a),
  10656. p.addClass(a.domElement, "c");
  10657. var l = document.createElement("span");
  10658. p.addClass(l, "property-name"),
  10659. l.innerHTML = a.property;
  10660. var c = document.createElement("div");
  10661. c.appendChild(l),
  10662. c.appendChild(a.domElement);
  10663. var u = m(e, c, o.before);
  10664. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10665. p.addClass(u, typeof a.getValue()),
  10666. v(e, u, a),
  10667. e.__controllers.push(a),
  10668. a
  10669. }
  10670. function m(e, t, i) {
  10671. var n = document.createElement("li");
  10672. return t && n.appendChild(t),
  10673. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10674. e.onResize(),
  10675. n
  10676. }
  10677. function v(e, t, i) {
  10678. if (i.__li = t,
  10679. i.__gui = e,
  10680. f.extend(i, {
  10681. options: function(t) {
  10682. return arguments.length > 1 ? (i.remove(),
  10683. g(e, i.object, i.property, {
  10684. before: i.__li.nextElementSibling,
  10685. factoryArgs: [f.toArray(arguments)]
  10686. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10687. g(e, i.object, i.property, {
  10688. before: i.__li.nextElementSibling,
  10689. factoryArgs: [t]
  10690. })) : void 0
  10691. },
  10692. name: function(e) {
  10693. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10694. i
  10695. },
  10696. listen: function() {
  10697. return i.__gui.listen(i),
  10698. i
  10699. },
  10700. remove: function() {
  10701. return i.__gui.remove(i),
  10702. i
  10703. }
  10704. }),
  10705. i instanceof l) {
  10706. var n = new s(i.object,i.property,{
  10707. min: i.__min,
  10708. max: i.__max,
  10709. step: i.__step
  10710. });
  10711. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10712. var t = i[e]
  10713. , r = n[e];
  10714. i[e] = n[e] = function() {
  10715. var e = Array.prototype.slice.call(arguments);
  10716. return t.apply(i, e),
  10717. r.apply(n, e)
  10718. }
  10719. }),
  10720. p.addClass(t, "has-slider"),
  10721. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10722. } else if (i instanceof s) {
  10723. var r = function(t) {
  10724. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10725. g(e, i.object, i.property, {
  10726. before: i.__li.nextElementSibling,
  10727. factoryArgs: [i.__min, i.__max, i.__step]
  10728. })) : t
  10729. };
  10730. i.min = f.compose(r, i.min),
  10731. i.max = f.compose(r, i.max)
  10732. } else
  10733. i instanceof o ? (p.bind(t, "click", function() {
  10734. p.fakeEvent(i.__checkbox, "click")
  10735. }),
  10736. p.bind(i.__checkbox, "click", function(e) {
  10737. e.stopPropagation()
  10738. })) : i instanceof a ? (p.bind(t, "click", function() {
  10739. p.fakeEvent(i.__button, "click")
  10740. }),
  10741. p.bind(t, "mouseover", function() {
  10742. p.addClass(i.__button, "hover")
  10743. }),
  10744. p.bind(t, "mouseout", function() {
  10745. p.removeClass(i.__button, "hover")
  10746. })) : i instanceof h && (p.addClass(t, "color"),
  10747. i.updateDisplay = f.compose(function(e) {
  10748. return t.style.borderLeftColor = i.__color.toString(),
  10749. e
  10750. }, i.updateDisplay),
  10751. i.updateDisplay());
  10752. i.setValue = f.compose(function(t) {
  10753. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10754. t
  10755. }, i.setValue)
  10756. }
  10757. function A(e, t) {
  10758. var i = e.getRoot()
  10759. , n = i.__rememberedObjects.indexOf(t.object);
  10760. if (n != -1) {
  10761. var r = i.__rememberedObjectIndecesToControllers[n];
  10762. if (void 0 === r && (r = {},
  10763. i.__rememberedObjectIndecesToControllers[n] = r),
  10764. r[t.property] = t,
  10765. i.load && i.load.remembered) {
  10766. var o, a = i.load.remembered;
  10767. if (a[e.preset])
  10768. o = a[e.preset];
  10769. else {
  10770. if (!a[L])
  10771. return;
  10772. o = a[L]
  10773. }
  10774. if (o[n] && void 0 !== o[n][t.property]) {
  10775. var s = o[n][t.property];
  10776. t.initialValue = s,
  10777. t.setValue(s)
  10778. }
  10779. }
  10780. }
  10781. }
  10782. function y(e, t) {
  10783. return document.location.href + "." + t
  10784. }
  10785. function C(e) {
  10786. var t = e.__save_row = document.createElement("li");
  10787. p.addClass(e.domElement, "has-save"),
  10788. e.__ul.insertBefore(t, e.__ul.firstChild),
  10789. p.addClass(t, "save-row");
  10790. var i = document.createElement("span");
  10791. i.innerHTML = "&nbsp;",
  10792. p.addClass(i, "button gears");
  10793. var n = document.createElement("span");
  10794. n.innerHTML = "Save",
  10795. p.addClass(n, "button"),
  10796. p.addClass(n, "save");
  10797. var r = document.createElement("span");
  10798. r.innerHTML = "New",
  10799. p.addClass(r, "button"),
  10800. p.addClass(r, "save-as");
  10801. var o = document.createElement("span");
  10802. o.innerHTML = "Revert",
  10803. p.addClass(o, "button"),
  10804. p.addClass(o, "revert");
  10805. var a = e.__preset_select = document.createElement("select");
  10806. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10807. w(e, i, i == e.preset)
  10808. }) : w(e, L, !1),
  10809. p.bind(a, "change", function() {
  10810. for (var t = 0; t < e.__preset_select.length; t++)
  10811. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10812. e.preset = this.value
  10813. }),
  10814. t.appendChild(a),
  10815. t.appendChild(i),
  10816. t.appendChild(n),
  10817. t.appendChild(r),
  10818. t.appendChild(o),
  10819. D) {
  10820. var s = document.getElementById("dg-save-locally")
  10821. , l = document.getElementById("dg-local-explain");
  10822. s.style.display = "block";
  10823. var c = document.getElementById("dg-local-storage");
  10824. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10825. var h = function() {
  10826. l.style.display = e.useLocalStorage ? "block" : "none"
  10827. };
  10828. h(),
  10829. p.bind(c, "change", function() {
  10830. e.useLocalStorage = !e.useLocalStorage,
  10831. h()
  10832. })
  10833. }
  10834. var u = document.getElementById("dg-new-constructor");
  10835. p.bind(u, "keydown", function(e) {
  10836. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10837. }),
  10838. p.bind(i, "click", function() {
  10839. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10840. S.show(),
  10841. u.focus(),
  10842. u.select()
  10843. }),
  10844. p.bind(n, "click", function() {
  10845. e.save()
  10846. }),
  10847. p.bind(r, "click", function() {
  10848. var t = prompt("Enter a new preset name.");
  10849. t && e.saveAs(t)
  10850. }),
  10851. p.bind(o, "click", function() {
  10852. e.revert()
  10853. })
  10854. }
  10855. function I(e) {
  10856. function t(t) {
  10857. return t.preventDefault(),
  10858. r = t.clientX,
  10859. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10860. p.bind(window, "mousemove", i),
  10861. p.bind(window, "mouseup", n),
  10862. !1
  10863. }
  10864. function i(t) {
  10865. return t.preventDefault(),
  10866. e.width += r - t.clientX,
  10867. e.onResize(),
  10868. r = t.clientX,
  10869. !1
  10870. }
  10871. function n() {
  10872. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10873. p.unbind(window, "mousemove", i),
  10874. p.unbind(window, "mouseup", n)
  10875. }
  10876. e.__resize_handle = document.createElement("div"),
  10877. f.extend(e.__resize_handle.style, {
  10878. width: "6px",
  10879. marginLeft: "-3px",
  10880. height: "200px",
  10881. cursor: "ew-resize",
  10882. position: "absolute"
  10883. });
  10884. var r;
  10885. p.bind(e.__resize_handle, "mousedown", t),
  10886. p.bind(e.__closeButton, "mousedown", t),
  10887. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10888. }
  10889. function E(e, t) {
  10890. e.domElement.style.width = t + "px",
  10891. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10892. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10893. }
  10894. function b(e, t) {
  10895. var i = {};
  10896. return f.each(e.__rememberedObjects, function(n, r) {
  10897. var o = {}
  10898. , a = e.__rememberedObjectIndecesToControllers[r];
  10899. f.each(a, function(e, i) {
  10900. o[i] = t ? e.initialValue : e.getValue()
  10901. }),
  10902. i[r] = o
  10903. }),
  10904. i
  10905. }
  10906. function w(e, t, i) {
  10907. var n = document.createElement("option");
  10908. n.innerHTML = t,
  10909. n.value = t,
  10910. e.__preset_select.appendChild(n),
  10911. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10912. }
  10913. function _(e) {
  10914. for (var t = 0; t < e.__preset_select.length; t++)
  10915. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10916. }
  10917. function T(e, t) {
  10918. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10919. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10920. }
  10921. function x(e) {
  10922. 0 != e.length && u(function() {
  10923. x(e)
  10924. }),
  10925. f.each(e, function(e) {
  10926. e.updateDisplay()
  10927. })
  10928. }
  10929. e.inject(i);
  10930. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10931. try {
  10932. return "localStorage"in window && null !== window.localStorage
  10933. } catch (e) {
  10934. return !1
  10935. }
  10936. }(), N = !0, B = !1, F = [], V = function(e) {
  10937. function t() {
  10938. var e = i.getRoot();
  10939. e.width += 1,
  10940. f.defer(function() {
  10941. e.width -= 1
  10942. })
  10943. }
  10944. var i = this;
  10945. this.domElement = document.createElement("div"),
  10946. this.__ul = document.createElement("ul"),
  10947. this.domElement.appendChild(this.__ul),
  10948. p.addClass(this.domElement, R),
  10949. this.__folders = {},
  10950. this.__controllers = [],
  10951. this.__rememberedObjects = [],
  10952. this.__rememberedObjectIndecesToControllers = [],
  10953. this.__listening = [],
  10954. e = e || {},
  10955. e = f.defaults(e, {
  10956. autoPlace: !0,
  10957. width: V.DEFAULT_WIDTH
  10958. }),
  10959. e = f.defaults(e, {
  10960. resizable: e.autoPlace,
  10961. hideable: e.autoPlace
  10962. }),
  10963. f.isUndefined(e.load) ? e.load = {
  10964. preset: L
  10965. } : e.preset && (e.load.preset = e.preset),
  10966. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10967. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10968. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10969. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10970. if (Object.defineProperties(this, {
  10971. parent: {
  10972. get: function() {
  10973. return e.parent
  10974. }
  10975. },
  10976. scrollable: {
  10977. get: function() {
  10978. return e.scrollable
  10979. }
  10980. },
  10981. autoPlace: {
  10982. get: function() {
  10983. return e.autoPlace
  10984. }
  10985. },
  10986. preset: {
  10987. get: function() {
  10988. return i.parent ? i.getRoot().preset : e.load.preset
  10989. },
  10990. set: function(t) {
  10991. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10992. _(this),
  10993. i.revert()
  10994. }
  10995. },
  10996. width: {
  10997. get: function() {
  10998. return e.width
  10999. },
  11000. set: function(t) {
  11001. e.width = t,
  11002. E(i, t)
  11003. }
  11004. },
  11005. name: {
  11006. get: function() {
  11007. return e.name
  11008. },
  11009. set: function(t) {
  11010. e.name = t,
  11011. a && (a.innerHTML = e.name)
  11012. }
  11013. },
  11014. closed: {
  11015. get: function() {
  11016. return e.closed
  11017. },
  11018. set: function(t) {
  11019. e.closed = t,
  11020. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11021. this.onResize(),
  11022. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11023. }
  11024. },
  11025. load: {
  11026. get: function() {
  11027. return e.load
  11028. }
  11029. },
  11030. useLocalStorage: {
  11031. get: function() {
  11032. return r
  11033. },
  11034. set: function(e) {
  11035. D && (r = e,
  11036. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  11037. localStorage.setItem(y(i, "isLocal"), e))
  11038. }
  11039. }
  11040. }),
  11041. f.isUndefined(e.parent)) {
  11042. if (e.closed = !1,
  11043. p.addClass(this.domElement, V.CLASS_MAIN),
  11044. p.makeSelectable(this.domElement, !1),
  11045. D && r) {
  11046. i.useLocalStorage = !0;
  11047. var o = localStorage.getItem(y(this, "gui"));
  11048. o && (e.load = JSON.parse(o))
  11049. }
  11050. this.__closeButton = document.createElement("div"),
  11051. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  11052. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11053. this.domElement.appendChild(this.__closeButton),
  11054. p.bind(this.__closeButton, "click", function() {
  11055. i.closed = !i.closed
  11056. })
  11057. } else {
  11058. void 0 === e.closed && (e.closed = !0);
  11059. var a = document.createTextNode(e.name);
  11060. p.addClass(a, "controller-name");
  11061. var s = m(i, a)
  11062. , l = function(e) {
  11063. return e.preventDefault(),
  11064. i.closed = !i.closed,
  11065. !1
  11066. };
  11067. p.addClass(this.__ul, V.CLASS_CLOSED),
  11068. p.addClass(s, "title"),
  11069. p.bind(s, "click", l),
  11070. e.closed || (this.closed = !1)
  11071. }
  11072. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  11073. p.addClass(M, R),
  11074. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  11075. document.body.appendChild(M),
  11076. N = !1),
  11077. M.appendChild(this.domElement),
  11078. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11079. this.parent || E(i, e.width)),
  11080. p.bind(window, "resize", function() {
  11081. i.onResize()
  11082. }),
  11083. p.bind(this.__ul, "webkitTransitionEnd", function() {
  11084. i.onResize()
  11085. }),
  11086. p.bind(this.__ul, "transitionend", function() {
  11087. i.onResize()
  11088. }),
  11089. p.bind(this.__ul, "oTransitionEnd", function() {
  11090. i.onResize()
  11091. }),
  11092. this.onResize(),
  11093. e.resizable && I(this),
  11094. n = function() {
  11095. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  11096. }
  11097. ,
  11098. this.saveToLocalStorageIfPossible = n;
  11099. i.getRoot();
  11100. e.parent || t()
  11101. };
  11102. return V.toggleHide = function() {
  11103. B = !B,
  11104. f.each(F, function(e) {
  11105. e.domElement.style.zIndex = B ? -999 : 999,
  11106. e.domElement.style.opacity = B ? 0 : 1
  11107. })
  11108. }
  11109. ,
  11110. V.CLASS_AUTO_PLACE = "a",
  11111. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  11112. V.CLASS_MAIN = "main",
  11113. V.CLASS_CONTROLLER_ROW = "cr",
  11114. V.CLASS_TOO_TALL = "taller-than-window",
  11115. V.CLASS_CLOSED = "closed",
  11116. V.CLASS_CLOSE_BUTTON = "close-button",
  11117. V.CLASS_DRAG = "drag",
  11118. V.DEFAULT_WIDTH = 245,
  11119. V.TEXT_CLOSED = "Close Controls",
  11120. V.TEXT_OPEN = "Open Controls",
  11121. p.bind(window, "keydown", function(e) {
  11122. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  11123. }, !1),
  11124. f.extend(V.prototype, {
  11125. add: function(e, t) {
  11126. return g(this, e, t, {
  11127. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11128. })
  11129. },
  11130. addColor: function(e, t) {
  11131. return g(this, e, t, {
  11132. color: !0
  11133. })
  11134. },
  11135. remove: function(e) {
  11136. this.__ul.removeChild(e.__li),
  11137. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  11138. var t = this;
  11139. f.defer(function() {
  11140. t.onResize()
  11141. })
  11142. },
  11143. destroy: function() {
  11144. this.autoPlace && M.removeChild(this.domElement)
  11145. },
  11146. addFolder: function(e) {
  11147. if (void 0 !== this.__folders[e])
  11148. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  11149. var t = {
  11150. name: e,
  11151. parent: this
  11152. };
  11153. t.autoPlace = this.autoPlace,
  11154. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  11155. t.load = this.load.folders[e]);
  11156. var i = new V(t);
  11157. this.__folders[e] = i;
  11158. var n = m(this, i.domElement);
  11159. return p.addClass(n, "folder"),
  11160. i
  11161. },
  11162. open: function() {
  11163. this.closed = !1
  11164. },
  11165. close: function() {
  11166. this.closed = !0
  11167. },
  11168. onResize: function() {
  11169. var e = this.getRoot();
  11170. if (e.scrollable) {
  11171. var t = p.getOffset(e.__ul).top
  11172. , i = 0;
  11173. f.each(e.__ul.childNodes, function(t) {
  11174. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  11175. }),
  11176. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  11177. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  11178. e.__ul.style.height = "auto")
  11179. }
  11180. e.__resize_handle && f.defer(function() {
  11181. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  11182. }),
  11183. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  11184. },
  11185. remember: function() {
  11186. if (f.isUndefined(S) && (S = new d,
  11187. S.domElement.innerHTML = t),
  11188. this.parent)
  11189. throw new Error("You can only call remember on a top level GUI.");
  11190. var e = this;
  11191. f.each(Array.prototype.slice.call(arguments), function(t) {
  11192. 0 == e.__rememberedObjects.length && C(e),
  11193. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11194. }),
  11195. this.autoPlace && E(this, this.width)
  11196. },
  11197. getRoot: function() {
  11198. for (var e = this; e.parent; )
  11199. e = e.parent;
  11200. return e
  11201. },
  11202. getSaveObject: function() {
  11203. var e = this.load;
  11204. return e.closed = this.closed,
  11205. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  11206. e.remembered || (e.remembered = {}),
  11207. e.remembered[this.preset] = b(this)),
  11208. e.folders = {},
  11209. f.each(this.__folders, function(t, i) {
  11210. e.folders[i] = t.getSaveObject()
  11211. }),
  11212. e
  11213. },
  11214. save: function() {
  11215. this.load.remembered || (this.load.remembered = {}),
  11216. this.load.remembered[this.preset] = b(this),
  11217. T(this, !1),
  11218. this.saveToLocalStorageIfPossible()
  11219. },
  11220. saveAs: function(e) {
  11221. this.load.remembered || (this.load.remembered = {},
  11222. this.load.remembered[L] = b(this, !0)),
  11223. this.load.remembered[e] = b(this),
  11224. this.preset = e,
  11225. w(this, e, !0),
  11226. this.saveToLocalStorageIfPossible()
  11227. },
  11228. revert: function(e) {
  11229. f.each(this.__controllers, function(t) {
  11230. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11231. }, this),
  11232. f.each(this.__folders, function(e) {
  11233. e.revert(e)
  11234. }),
  11235. e || T(this.getRoot(), !1)
  11236. },
  11237. listen: function(e) {
  11238. var t = 0 == this.__listening.length;
  11239. this.__listening.push(e),
  11240. t && x(this.__listening)
  11241. }
  11242. }),
  11243. V
  11244. }(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) {
  11245. return function(s, l) {
  11246. var c = s[l];
  11247. 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,{
  11248. min: arguments[2],
  11249. max: arguments[3]
  11250. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  11251. }
  11252. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  11253. var n = function(e, i) {
  11254. function r() {
  11255. a.setValue(a.__input.value)
  11256. }
  11257. function o() {
  11258. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11259. }
  11260. n.superclass.call(this, e, i);
  11261. var a = this;
  11262. this.__input = document.createElement("input"),
  11263. this.__input.setAttribute("type", "text"),
  11264. t.bind(this.__input, "keyup", r),
  11265. t.bind(this.__input, "change", r),
  11266. t.bind(this.__input, "blur", o),
  11267. t.bind(this.__input, "keydown", function(e) {
  11268. 13 === e.keyCode && this.blur()
  11269. }),
  11270. this.updateDisplay(),
  11271. this.domElement.appendChild(this.__input)
  11272. };
  11273. return n.superclass = e,
  11274. i.extend(n.prototype, e.prototype, {
  11275. updateDisplay: function() {
  11276. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  11277. n.superclass.prototype.updateDisplay.call(this)
  11278. }
  11279. }),
  11280. n
  11281. }(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) {
  11282. function o(e, t, i, n) {
  11283. e.style.background = "",
  11284. r.each(l, function(r) {
  11285. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  11286. })
  11287. }
  11288. function a(e) {
  11289. e.style.background = "",
  11290. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  11291. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11292. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11293. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  11294. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  11295. }
  11296. var s = function(e, l) {
  11297. function c(e) {
  11298. p(e),
  11299. t.bind(window, "mousemove", p),
  11300. t.bind(window, "mouseup", h)
  11301. }
  11302. function h() {
  11303. t.unbind(window, "mousemove", p),
  11304. t.unbind(window, "mouseup", h)
  11305. }
  11306. function u() {
  11307. var e = n(this.value);
  11308. e !== !1 ? (g.__color.__state = e,
  11309. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  11310. }
  11311. function d() {
  11312. t.unbind(window, "mousemove", f),
  11313. t.unbind(window, "mouseup", d)
  11314. }
  11315. function p(e) {
  11316. e.preventDefault();
  11317. var i = t.getWidth(g.__saturation_field)
  11318. , n = t.getOffset(g.__saturation_field)
  11319. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  11320. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11321. return o > 1 ? o = 1 : o < 0 && (o = 0),
  11322. r > 1 ? r = 1 : r < 0 && (r = 0),
  11323. g.__color.v = o,
  11324. g.__color.s = r,
  11325. g.setValue(g.__color.toOriginal()),
  11326. !1
  11327. }
  11328. function f(e) {
  11329. e.preventDefault();
  11330. var i = t.getHeight(g.__hue_field)
  11331. , n = t.getOffset(g.__hue_field)
  11332. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  11333. return r > 1 ? r = 1 : r < 0 && (r = 0),
  11334. g.__color.h = 360 * r,
  11335. g.setValue(g.__color.toOriginal()),
  11336. !1
  11337. }
  11338. s.superclass.call(this, e, l),
  11339. this.__color = new i(this.getValue()),
  11340. this.__temp = new i(0);
  11341. var g = this;
  11342. this.domElement = document.createElement("div"),
  11343. t.makeSelectable(this.domElement, !1),
  11344. this.__selector = document.createElement("div"),
  11345. this.__selector.className = "selector",
  11346. this.__saturation_field = document.createElement("div"),
  11347. this.__saturation_field.className = "saturation-field",
  11348. this.__field_knob = document.createElement("div"),
  11349. this.__field_knob.className = "field-knob",
  11350. this.__field_knob_border = "2px solid ",
  11351. this.__hue_knob = document.createElement("div"),
  11352. this.__hue_knob.className = "hue-knob",
  11353. this.__hue_field = document.createElement("div"),
  11354. this.__hue_field.className = "hue-field",
  11355. this.__input = document.createElement("input"),
  11356. this.__input.type = "text",
  11357. this.__input_textShadow = "0 1px 1px ",
  11358. t.bind(this.__input, "keydown", function(e) {
  11359. 13 === e.keyCode && u.call(this)
  11360. }),
  11361. t.bind(this.__input, "blur", u),
  11362. t.bind(this.__selector, "mousedown", function(e) {
  11363. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  11364. t.removeClass(g.__selector, "drag")
  11365. })
  11366. });
  11367. var m = document.createElement("div");
  11368. r.extend(this.__selector.style, {
  11369. width: "122px",
  11370. height: "102px",
  11371. padding: "3px",
  11372. backgroundColor: "#222",
  11373. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  11374. }),
  11375. r.extend(this.__field_knob.style, {
  11376. position: "absolute",
  11377. width: "12px",
  11378. height: "12px",
  11379. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  11380. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  11381. borderRadius: "12px",
  11382. zIndex: 1
  11383. }),
  11384. r.extend(this.__hue_knob.style, {
  11385. position: "absolute",
  11386. width: "15px",
  11387. height: "2px",
  11388. borderRight: "4px solid #fff",
  11389. zIndex: 1
  11390. }),
  11391. r.extend(this.__saturation_field.style, {
  11392. width: "100px",
  11393. height: "100px",
  11394. border: "1px solid #555",
  11395. marginRight: "3px",
  11396. display: "inline-block",
  11397. cursor: "pointer"
  11398. }),
  11399. r.extend(m.style, {
  11400. width: "100%",
  11401. height: "100%",
  11402. background: "none"
  11403. }),
  11404. o(m, "top", "rgba(0,0,0,0)", "#000"),
  11405. r.extend(this.__hue_field.style, {
  11406. width: "15px",
  11407. height: "100px",
  11408. display: "inline-block",
  11409. border: "1px solid #555",
  11410. cursor: "ns-resize"
  11411. }),
  11412. a(this.__hue_field),
  11413. r.extend(this.__input.style, {
  11414. outline: "none",
  11415. textAlign: "center",
  11416. color: "#fff",
  11417. border: 0,
  11418. fontWeight: "bold",
  11419. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  11420. }),
  11421. t.bind(this.__saturation_field, "mousedown", c),
  11422. t.bind(this.__field_knob, "mousedown", c),
  11423. t.bind(this.__hue_field, "mousedown", function(e) {
  11424. f(e),
  11425. t.bind(window, "mousemove", f),
  11426. t.bind(window, "mouseup", d)
  11427. }),
  11428. this.__saturation_field.appendChild(m),
  11429. this.__selector.appendChild(this.__field_knob),
  11430. this.__selector.appendChild(this.__saturation_field),
  11431. this.__selector.appendChild(this.__hue_field),
  11432. this.__hue_field.appendChild(this.__hue_knob),
  11433. this.domElement.appendChild(this.__input),
  11434. this.domElement.appendChild(this.__selector),
  11435. this.updateDisplay()
  11436. };
  11437. s.superclass = e,
  11438. r.extend(s.prototype, e.prototype, {
  11439. updateDisplay: function() {
  11440. var e = n(this.getValue());
  11441. if (e !== !1) {
  11442. var t = !1;
  11443. r.each(i.COMPONENTS, function(i) {
  11444. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11445. return t = !0,
  11446. {}
  11447. }, this),
  11448. t && r.extend(this.__color.__state, e)
  11449. }
  11450. r.extend(this.__temp.__state, this.__color.__state),
  11451. this.__temp.a = 1;
  11452. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11453. , s = 255 - a;
  11454. r.extend(this.__field_knob.style, {
  11455. marginLeft: 100 * this.__color.s - 7 + "px",
  11456. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11457. backgroundColor: this.__temp.toString(),
  11458. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11459. }),
  11460. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11461. this.__temp.s = 1,
  11462. this.__temp.v = 1,
  11463. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11464. r.extend(this.__input.style, {
  11465. backgroundColor: this.__input.value = this.__color.toString(),
  11466. color: "rgb(" + a + "," + a + "," + a + ")",
  11467. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11468. })
  11469. }
  11470. });
  11471. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11472. return s
  11473. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11474. function r(e, t, i) {
  11475. Object.defineProperty(e, t, {
  11476. get: function() {
  11477. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11478. this.__state[t])
  11479. },
  11480. set: function(e) {
  11481. "RGB" !== this.__state.space && (a(this, t, i),
  11482. this.__state.space = "RGB"),
  11483. this.__state[t] = e
  11484. }
  11485. })
  11486. }
  11487. function o(e, t) {
  11488. Object.defineProperty(e, t, {
  11489. get: function() {
  11490. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11491. this.__state[t])
  11492. },
  11493. set: function(e) {
  11494. "HSV" !== this.__state.space && (s(this),
  11495. this.__state.space = "HSV"),
  11496. this.__state[t] = e
  11497. }
  11498. })
  11499. }
  11500. function a(e, i, r) {
  11501. if ("HEX" === e.__state.space)
  11502. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11503. else {
  11504. if ("HSV" !== e.__state.space)
  11505. throw "Corrupted color state";
  11506. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11507. }
  11508. }
  11509. function s(e) {
  11510. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11511. n.extend(e.__state, {
  11512. s: i.s,
  11513. v: i.v
  11514. }),
  11515. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11516. }
  11517. var l = function() {
  11518. if (this.__state = e.apply(this, arguments),
  11519. this.__state === !1)
  11520. throw "Failed to interpret color arguments";
  11521. this.__state.a = this.__state.a || 1
  11522. };
  11523. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11524. n.extend(l.prototype, {
  11525. toString: function() {
  11526. return i(this)
  11527. },
  11528. toOriginal: function() {
  11529. return this.__state.conversion.write(this)
  11530. }
  11531. }),
  11532. r(l.prototype, "r", 2),
  11533. r(l.prototype, "g", 1),
  11534. r(l.prototype, "b", 0),
  11535. o(l.prototype, "h"),
  11536. o(l.prototype, "s"),
  11537. o(l.prototype, "v"),
  11538. Object.defineProperty(l.prototype, "a", {
  11539. get: function() {
  11540. return this.__state.a
  11541. },
  11542. set: function(e) {
  11543. this.__state.a = e
  11544. }
  11545. }),
  11546. Object.defineProperty(l.prototype, "hex", {
  11547. get: function() {
  11548. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11549. this.__state.hex
  11550. },
  11551. set: function(e) {
  11552. this.__state.space = "HEX",
  11553. this.__state.hex = e
  11554. }
  11555. }),
  11556. l
  11557. }(n.color.interpret, n.color.math = function() {
  11558. var e;
  11559. return {
  11560. hsv_to_rgb: function(e, t, i) {
  11561. var n = Math.floor(e / 60) % 6
  11562. , r = e / 60 - Math.floor(e / 60)
  11563. , o = i * (1 - t)
  11564. , a = i * (1 - r * t)
  11565. , s = i * (1 - (1 - r) * t)
  11566. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11567. return {
  11568. r: 255 * l[0],
  11569. g: 255 * l[1],
  11570. b: 255 * l[2]
  11571. }
  11572. },
  11573. rgb_to_hsv: function(e, t, i) {
  11574. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11575. return 0 == a ? {
  11576. h: NaN,
  11577. s: 0,
  11578. v: 0
  11579. } : (r = s / a,
  11580. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11581. n /= 6,
  11582. n < 0 && (n += 1),
  11583. {
  11584. h: 360 * n,
  11585. s: r,
  11586. v: a / 255
  11587. })
  11588. },
  11589. rgb_to_hex: function(e, t, i) {
  11590. var n = this.hex_with_component(0, 2, e);
  11591. return n = this.hex_with_component(n, 1, t),
  11592. n = this.hex_with_component(n, 0, i)
  11593. },
  11594. component_from_hex: function(e, t) {
  11595. return e >> 8 * t & 255
  11596. },
  11597. hex_with_component: function(t, i, n) {
  11598. return n << (e = 8 * i) | t & ~(255 << e)
  11599. }
  11600. }
  11601. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11602. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11603. window.setTimeout(e, 1e3 / 60)
  11604. }
  11605. }(), n.dom.CenteredDiv = function(e, t) {
  11606. var i = function() {
  11607. this.backgroundElement = document.createElement("div"),
  11608. t.extend(this.backgroundElement.style, {
  11609. backgroundColor: "rgba(0,0,0,0.8)",
  11610. top: 0,
  11611. left: 0,
  11612. display: "none",
  11613. zIndex: "1000",
  11614. opacity: 0,
  11615. WebkitTransition: "opacity 0.2s linear"
  11616. }),
  11617. e.makeFullscreen(this.backgroundElement),
  11618. this.backgroundElement.style.position = "fixed",
  11619. this.domElement = document.createElement("div"),
  11620. t.extend(this.domElement.style, {
  11621. position: "fixed",
  11622. display: "none",
  11623. zIndex: "1001",
  11624. opacity: 0,
  11625. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11626. }),
  11627. document.body.appendChild(this.backgroundElement),
  11628. document.body.appendChild(this.domElement);
  11629. var i = this;
  11630. e.bind(this.backgroundElement, "click", function() {
  11631. i.hide()
  11632. })
  11633. };
  11634. return i.prototype.show = function() {
  11635. var e = this;
  11636. this.backgroundElement.style.display = "block",
  11637. this.domElement.style.display = "block",
  11638. this.domElement.style.opacity = 0,
  11639. this.domElement.style.webkitTransform = "scale(1.1)",
  11640. this.layout(),
  11641. t.defer(function() {
  11642. e.backgroundElement.style.opacity = 1,
  11643. e.domElement.style.opacity = 1,
  11644. e.domElement.style.webkitTransform = "scale(1)"
  11645. })
  11646. }
  11647. ,
  11648. i.prototype.hide = function() {
  11649. var t = this
  11650. , i = function() {
  11651. t.domElement.style.display = "none",
  11652. t.backgroundElement.style.display = "none",
  11653. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11654. e.unbind(t.domElement, "transitionend", i),
  11655. e.unbind(t.domElement, "oTransitionEnd", i)
  11656. };
  11657. e.bind(this.domElement, "webkitTransitionEnd", i),
  11658. e.bind(this.domElement, "transitionend", i),
  11659. e.bind(this.domElement, "oTransitionEnd", i),
  11660. this.backgroundElement.style.opacity = 0,
  11661. this.domElement.style.opacity = 0,
  11662. this.domElement.style.webkitTransform = "scale(1.1)"
  11663. }
  11664. ,
  11665. i.prototype.layout = function() {
  11666. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11667. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11668. }
  11669. ,
  11670. i
  11671. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11672. }
  11673. , {}],
  11674. 94: [function(e, t, i) {
  11675. (function(e) {
  11676. "use strict";
  11677. function i(t) {
  11678. function i(e) {
  11679. 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++) {
  11680. var n = _((t[i] * e + 50) / 100);
  11681. n < 1 ? n = 1 : n > 255 && (n = 255),
  11682. T[G[i]] = n
  11683. }
  11684. 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++) {
  11685. var a = _((r[o] * e + 50) / 100);
  11686. a < 1 ? a = 1 : a > 255 && (a = 255),
  11687. x[G[o]] = a
  11688. }
  11689. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11690. for (var h = 0; h < 8; h++)
  11691. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11692. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11693. l++
  11694. }
  11695. function n(e, t) {
  11696. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11697. for (var a = 1; a <= e[o]; a++)
  11698. r[t[n]] = [],
  11699. r[t[n]][0] = i,
  11700. r[t[n]][1] = o,
  11701. n++,
  11702. i++;
  11703. i *= 2
  11704. }
  11705. return r
  11706. }
  11707. function r() {
  11708. C = n(z, W),
  11709. I = n(X, Z),
  11710. E = n(j, Y),
  11711. b = n(q, K)
  11712. }
  11713. function o() {
  11714. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11715. for (var n = e; n < t; n++)
  11716. P[32767 + n] = i,
  11717. R[32767 + n] = [],
  11718. R[32767 + n][1] = i,
  11719. R[32767 + n][0] = n;
  11720. for (var r = -(t - 1); r <= -e; r++)
  11721. P[32767 + r] = i,
  11722. R[32767 + r] = [],
  11723. R[32767 + r][1] = i,
  11724. R[32767 + r][0] = t - 1 + r;
  11725. e <<= 1,
  11726. t <<= 1
  11727. }
  11728. }
  11729. function a() {
  11730. for (var e = 0; e < 256; e++)
  11731. H[e] = 19595 * e,
  11732. H[e + 256 >> 0] = 38470 * e,
  11733. H[e + 512 >> 0] = 7471 * e + 32768,
  11734. H[e + 768 >> 0] = -11059 * e,
  11735. H[e + 1024 >> 0] = -21709 * e,
  11736. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11737. H[e + 1536 >> 0] = -27439 * e,
  11738. H[e + 1792 >> 0] = -5329 * e
  11739. }
  11740. function s(e) {
  11741. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11742. t & 1 << i && (N |= 1 << B),
  11743. i--,
  11744. B--,
  11745. B < 0 && (255 == N ? (l(255),
  11746. l(0)) : l(N),
  11747. B = 7,
  11748. N = 0)
  11749. }
  11750. function l(e) {
  11751. D.push(e)
  11752. }
  11753. function c(e) {
  11754. l(e >> 8 & 255),
  11755. l(255 & e)
  11756. }
  11757. function h(e, t) {
  11758. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11759. for (h = 0; h < d; ++h) {
  11760. i = e[u],
  11761. n = e[u + 1],
  11762. r = e[u + 2],
  11763. o = e[u + 3],
  11764. a = e[u + 4],
  11765. s = e[u + 5],
  11766. l = e[u + 6],
  11767. c = e[u + 7];
  11768. var f = i + c
  11769. , g = i - c
  11770. , m = n + l
  11771. , v = n - l
  11772. , A = r + s
  11773. , y = r - s
  11774. , C = o + a
  11775. , I = o - a
  11776. , E = f + C
  11777. , b = f - C
  11778. , w = m + A
  11779. , _ = m - A;
  11780. e[u] = E + w,
  11781. e[u + 4] = E - w;
  11782. var T = .707106781 * (_ + b);
  11783. e[u + 2] = b + T,
  11784. e[u + 6] = b - T,
  11785. E = I + y,
  11786. w = y + v,
  11787. _ = v + g;
  11788. var x = .382683433 * (E - _)
  11789. , S = .5411961 * E + x
  11790. , M = 1.306562965 * _ + x
  11791. , R = .707106781 * w
  11792. , P = g + R
  11793. , L = g - R;
  11794. e[u + 5] = L + S,
  11795. e[u + 3] = L - S,
  11796. e[u + 1] = P + M,
  11797. e[u + 7] = P - M,
  11798. u += 8
  11799. }
  11800. for (u = 0,
  11801. h = 0; h < d; ++h) {
  11802. i = e[u],
  11803. n = e[u + 8],
  11804. r = e[u + 16],
  11805. o = e[u + 24],
  11806. a = e[u + 32],
  11807. s = e[u + 40],
  11808. l = e[u + 48],
  11809. c = e[u + 56];
  11810. var D = i + c
  11811. , N = i - c
  11812. , B = n + l
  11813. , F = n - l
  11814. , V = r + s
  11815. , U = r - s
  11816. , k = o + a
  11817. , H = o - a
  11818. , G = D + k
  11819. , z = D - k
  11820. , W = B + V
  11821. , j = B - V;
  11822. e[u] = G + W,
  11823. e[u + 32] = G - W;
  11824. var Y = .707106781 * (j + z);
  11825. e[u + 16] = z + Y,
  11826. e[u + 48] = z - Y,
  11827. G = H + U,
  11828. W = U + F,
  11829. j = F + N;
  11830. var X = .382683433 * (G - j)
  11831. , Z = .5411961 * G + X
  11832. , q = 1.306562965 * j + X
  11833. , K = .707106781 * W
  11834. , Q = N + K
  11835. , J = N - K;
  11836. e[u + 40] = J + Z,
  11837. e[u + 24] = J - Z,
  11838. e[u + 8] = Q + q,
  11839. e[u + 56] = Q - q,
  11840. u++
  11841. }
  11842. var $;
  11843. for (h = 0; h < p; ++h)
  11844. $ = e[h] * t[h],
  11845. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11846. return O
  11847. }
  11848. function u() {
  11849. c(65504),
  11850. c(16),
  11851. l(74),
  11852. l(70),
  11853. l(73),
  11854. l(70),
  11855. l(0),
  11856. l(1),
  11857. l(1),
  11858. l(0),
  11859. c(1),
  11860. c(1),
  11861. l(0),
  11862. l(0)
  11863. }
  11864. function d(e, t) {
  11865. c(65472),
  11866. c(17),
  11867. l(8),
  11868. c(t),
  11869. c(e),
  11870. l(3),
  11871. l(1),
  11872. l(17),
  11873. l(0),
  11874. l(2),
  11875. l(17),
  11876. l(1),
  11877. l(3),
  11878. l(17),
  11879. l(1)
  11880. }
  11881. function p() {
  11882. c(65499),
  11883. c(132),
  11884. l(0);
  11885. for (var e = 0; e < 64; e++)
  11886. l(T[e]);
  11887. l(1);
  11888. for (var t = 0; t < 64; t++)
  11889. l(x[t])
  11890. }
  11891. function f() {
  11892. c(65476),
  11893. c(418),
  11894. l(0);
  11895. for (var e = 0; e < 16; e++)
  11896. l(z[e + 1]);
  11897. for (var t = 0; t <= 11; t++)
  11898. l(W[t]);
  11899. l(16);
  11900. for (var i = 0; i < 16; i++)
  11901. l(j[i + 1]);
  11902. for (var n = 0; n <= 161; n++)
  11903. l(Y[n]);
  11904. l(1);
  11905. for (var r = 0; r < 16; r++)
  11906. l(X[r + 1]);
  11907. for (var o = 0; o <= 11; o++)
  11908. l(Z[o]);
  11909. l(17);
  11910. for (var a = 0; a < 16; a++)
  11911. l(q[a + 1]);
  11912. for (var s = 0; s <= 161; s++)
  11913. l(K[s])
  11914. }
  11915. function g() {
  11916. c(65498),
  11917. c(12),
  11918. l(3),
  11919. l(1),
  11920. l(0),
  11921. l(2),
  11922. l(17),
  11923. l(3),
  11924. l(17),
  11925. l(0),
  11926. l(63),
  11927. l(0)
  11928. }
  11929. function m(e, t, i, n, r) {
  11930. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11931. L[G[f]] = p[f];
  11932. var g = L[0] - i;
  11933. i = L[0],
  11934. 0 == g ? s(n[0]) : (o = 32767 + g,
  11935. s(n[P[o]]),
  11936. s(R[o]));
  11937. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11938. ;
  11939. if (0 == m)
  11940. return s(a),
  11941. i;
  11942. for (var v, A = 1; A <= m; ) {
  11943. for (var y = A; 0 == L[A] && A <= m; ++A)
  11944. ;
  11945. var C = A - y;
  11946. if (C >= c) {
  11947. v = C >> 4;
  11948. for (var I = 1; I <= v; ++I)
  11949. s(l);
  11950. C &= 15
  11951. }
  11952. o = 32767 + L[A],
  11953. s(r[(C << 4) + P[o]]),
  11954. s(R[o]),
  11955. A++
  11956. }
  11957. return m != u && s(a),
  11958. i
  11959. }
  11960. function v() {
  11961. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11962. k[t] = e(t)
  11963. }
  11964. function A(e) {
  11965. if (e <= 0 && (e = 1),
  11966. e > 100 && (e = 100),
  11967. w != e) {
  11968. var t = 0;
  11969. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11970. i(t),
  11971. w = e
  11972. }
  11973. }
  11974. function y() {
  11975. var e = (new Date).getTime();
  11976. t || (t = 50),
  11977. v(),
  11978. r(),
  11979. o(),
  11980. a(),
  11981. A(t);
  11982. (new Date).getTime() - e
  11983. }
  11984. var C, I, E, b, w, _ = (Math.round,
  11985. 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];
  11986. this.encode = function(t, i) {
  11987. var n = ((new Date).getTime(),
  11988. i.quality);
  11989. n && A(n),
  11990. D = new Array,
  11991. N = 0,
  11992. B = 7,
  11993. c(65496),
  11994. u(),
  11995. p(),
  11996. d(t.width, t.height),
  11997. f(),
  11998. g();
  11999. var r = 0
  12000. , o = 0
  12001. , a = 0;
  12002. N = 0,
  12003. B = 7,
  12004. this.encode.displayName = "_encode_";
  12005. 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; ) {
  12006. for (l = 0; l < G; ) {
  12007. for (w = G * z + l,
  12008. _ = w,
  12009. T = -1,
  12010. x = 0,
  12011. R = 0; R < 64; R++)
  12012. x = (k ? 63 - R : R) >> 3,
  12013. T = 4 * (7 & R),
  12014. _ = w + x * G + T,
  12015. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12016. l + T >= G && (_ -= l + T - G + 4),
  12017. h = P[_++],
  12018. v = P[_++],
  12019. y = P[_++],
  12020. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  12021. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  12022. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  12023. r = m(F, S, r, C, E),
  12024. o = m(V, M, o, I, b),
  12025. a = m(U, M, a, I, b),
  12026. l += 32
  12027. }
  12028. z += W
  12029. }
  12030. if (B >= 0) {
  12031. var j = [];
  12032. j[1] = B + 1,
  12033. j[0] = (1 << B + 1) - 1,
  12034. s(j)
  12035. }
  12036. return c(65497),
  12037. new e(D)
  12038. }
  12039. ,
  12040. y()
  12041. }
  12042. function n(e, t) {
  12043. t = t || {},
  12044. t.quality = t.quality || 50;
  12045. var n = t.quality
  12046. , r = new i(n)
  12047. , o = r.encode(e, t);
  12048. return {
  12049. data: o,
  12050. width: e.width,
  12051. height: e.height
  12052. }
  12053. }
  12054. t.exports.encode = n
  12055. }
  12056. ).call(this, e("buffer").Buffer)
  12057. }
  12058. , {
  12059. buffer: 198
  12060. }],
  12061. 95: [function(e, t, i) {
  12062. "use strict";
  12063. !function() {
  12064. if ("performance"in window == !1 && (window.performance = {}),
  12065. Date.now = Date.now || function() {
  12066. return (new Date).getTime()
  12067. }
  12068. ,
  12069. "now"in window.performance == !1) {
  12070. var e = Date.now();
  12071. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12072. window.performance.now = function() {
  12073. return Date.now() - e
  12074. }
  12075. }
  12076. }()
  12077. }
  12078. , {}],
  12079. 96: [function(e, t, i) {
  12080. "use strict";
  12081. var n = e("three");
  12082. n.EffectComposer = function(e, t) {
  12083. if (this.renderer = e,
  12084. void 0 === t) {
  12085. var i = {
  12086. minFilter: n.LinearFilter,
  12087. magFilter: n.LinearFilter,
  12088. format: n.RGBAFormat,
  12089. stencilBuffer: !1
  12090. }
  12091. , r = e.getSize();
  12092. t = new n.WebGLRenderTarget(r.width,r.height,i)
  12093. }
  12094. this.renderTarget1 = t,
  12095. this.renderTarget2 = t.clone(),
  12096. this.writeBuffer = this.renderTarget1,
  12097. this.readBuffer = this.renderTarget2,
  12098. this.passes = [],
  12099. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  12100. this.copyPass = new n.ShaderPass(n.CopyShader)
  12101. }
  12102. ,
  12103. n.EffectComposer.prototype = {
  12104. swapBuffers: function() {
  12105. var e = this.readBuffer;
  12106. this.readBuffer = this.writeBuffer,
  12107. this.writeBuffer = e
  12108. },
  12109. addPass: function(e) {
  12110. this.passes.push(e)
  12111. },
  12112. insertPass: function(e, t) {
  12113. this.passes.splice(t, 0, e)
  12114. },
  12115. render: function(e) {
  12116. this.writeBuffer = this.renderTarget1,
  12117. this.readBuffer = this.renderTarget2;
  12118. var t, i, r = !1, o = this.passes.length;
  12119. for (i = 0; i < o; i++)
  12120. if (t = this.passes[i],
  12121. t.enabled) {
  12122. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  12123. t.needsSwap) {
  12124. if (r) {
  12125. var a = this.renderer.context;
  12126. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  12127. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  12128. a.stencilFunc(a.EQUAL, 1, 4294967295)
  12129. }
  12130. this.swapBuffers()
  12131. }
  12132. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  12133. }
  12134. },
  12135. reset: function(e) {
  12136. if (void 0 === e) {
  12137. var t = this.renderer.getSize();
  12138. e = this.renderTarget1.clone(),
  12139. e.setSize(t.width, t.height)
  12140. }
  12141. this.renderTarget1.dispose(),
  12142. this.renderTarget2.dispose(),
  12143. this.renderTarget1 = e,
  12144. this.renderTarget2 = e.clone(),
  12145. this.writeBuffer = this.renderTarget1,
  12146. this.readBuffer = this.renderTarget2
  12147. },
  12148. setSize: function(e, t) {
  12149. this.renderTarget1.setSize(e, t),
  12150. this.renderTarget2.setSize(e, t)
  12151. this.passes.forEach(a=>{//add for TransitionPass
  12152. a.setSize && a.setSize(e, t)
  12153. })
  12154. }
  12155. }
  12156. }
  12157. , {
  12158. three: 217
  12159. }],
  12160. 97: [function(e, t, i) {
  12161. "use strict";
  12162. var n = e("three");
  12163. n.MaskPass = function(e, t) {
  12164. this.scene = e,
  12165. this.camera = t,
  12166. this.enabled = !0,
  12167. this.clear = !0,
  12168. this.needsSwap = !1,
  12169. this.inverse = !1
  12170. }
  12171. ,
  12172. n.MaskPass.prototype = {
  12173. render: function(e, t, i, n) {
  12174. var r = e.context;
  12175. r.colorMask(!1, !1, !1, !1),
  12176. r.depthMask(!1);
  12177. var o, a;
  12178. this.inverse ? (o = 0,
  12179. a = 1) : (o = 1,
  12180. a = 0),
  12181. r.enable(r.STENCIL_TEST),
  12182. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12183. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12184. r.clearStencil(a),
  12185. e.render(this.scene, this.camera, i, this.clear),
  12186. e.render(this.scene, this.camera, t, this.clear),
  12187. r.colorMask(!0, !0, !0, !0),
  12188. r.depthMask(!0),
  12189. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12190. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12191. }
  12192. },
  12193. n.ClearMaskPass = function() {
  12194. this.enabled = !0
  12195. }
  12196. ,
  12197. n.ClearMaskPass.prototype = {
  12198. render: function(e, t, i, n) {
  12199. var r = e.context;
  12200. r.disable(r.STENCIL_TEST)
  12201. }
  12202. }
  12203. }
  12204. , {
  12205. three: 217
  12206. }],
  12207. 98: [function(e, t, i) {
  12208. "use strict";
  12209. var n = e("three");
  12210. n.RenderPass = function(e, t, i, r, o) {
  12211. this.scene = e,
  12212. this.camera = t,
  12213. this.overrideMaterial = i,
  12214. this.clearColor = r,
  12215. this.clearAlpha = void 0 !== o ? o : 1,
  12216. this.oldClearColor = new n.Color,
  12217. this.oldClearAlpha = 1,
  12218. this.enabled = !0,
  12219. this.clear = !0,
  12220. this.needsSwap = !1
  12221. }
  12222. ,
  12223. n.RenderPass.prototype = {
  12224. render: function(e, t, i, n) {
  12225. this.scene.overrideMaterial = this.overrideMaterial,
  12226. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  12227. this.oldClearAlpha = e.getClearAlpha(),
  12228. e.setClearColor(this.clearColor, this.clearAlpha)),
  12229. e.render(this.scene, this.camera, i, this.clear),
  12230. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12231. this.scene.overrideMaterial = null
  12232. }
  12233. }
  12234. }
  12235. , {
  12236. three: 217
  12237. }],
  12238. 99: [function(e, t, i) {
  12239. "use strict";
  12240. var n = e("three");
  12241. n.ShaderPass = function(e, t) {
  12242. this.textureID = void 0 !== t ? t : "tDiffuse",
  12243. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  12244. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  12245. this.material = new n.ShaderMaterial({
  12246. defines: e.defines || {},
  12247. uniforms: this.uniforms,
  12248. vertexShader: e.vertexShader,
  12249. fragmentShader: e.fragmentShader
  12250. })),
  12251. this.renderToScreen = !1,
  12252. this.enabled = !0,
  12253. this.needsSwap = !0,
  12254. this.clear = !1,
  12255. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  12256. this.scene = new n.Scene,
  12257. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  12258. this.scene.add(this.quad)
  12259. }
  12260. ,
  12261. n.ShaderPass.prototype = {
  12262. render: function(e, t, i, n) {
  12263. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12264. this.quad.material = this.material,
  12265. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12266. }
  12267. }
  12268. }
  12269. , {
  12270. three: 217
  12271. }],
  12272. 100: [function(e, t, i) {
  12273. "use strict";
  12274. var n = e("three");
  12275. n.CopyShader = {
  12276. uniforms: {
  12277. tDiffuse: {
  12278. type: "t",
  12279. value: null
  12280. },
  12281. opacity: {
  12282. type: "f",
  12283. value: 1
  12284. }
  12285. },
  12286. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12287. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  12288. }
  12289. }
  12290. , {
  12291. three: 217
  12292. }],
  12293. 101: [function(e, t, i) {
  12294. "use strict";
  12295. var n = e("three");
  12296. n.HorizontalBlurShader = {
  12297. uniforms: {
  12298. tDiffuse: {
  12299. type: "t",
  12300. value: null
  12301. },
  12302. h: {
  12303. type: "f",
  12304. value: 1 / 512
  12305. }
  12306. },
  12307. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12308. 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")
  12309. }
  12310. }
  12311. , {
  12312. three: 217
  12313. }],
  12314. 102: [function(e, t, i) {
  12315. "use strict";
  12316. var n = e("three");
  12317. n.VerticalBlurShader = {
  12318. uniforms: {
  12319. tDiffuse: {
  12320. type: "t",
  12321. value: null
  12322. },
  12323. v: {
  12324. type: "f",
  12325. value: 1 / 512
  12326. }
  12327. },
  12328. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  12329. 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")
  12330. }
  12331. }
  12332. , {
  12333. three: 217
  12334. }],
  12335. 103: [function(e, t, i) {
  12336. "use strict";
  12337. var n = e("three");
  12338. !function() {
  12339. if ("performance"in window == 0 && (window.performance = {}),
  12340. "now"in window.performance == 0) {
  12341. var e = Date.now();
  12342. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12343. window.performance.now = function() {
  12344. return Date.now() - e
  12345. }
  12346. }
  12347. }(),
  12348. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  12349. var t, i = this.extensions, r = this.context;
  12350. if (e === n.RepeatWrapping)
  12351. return r.REPEAT;
  12352. if (e === n.ClampToEdgeWrapping)
  12353. return r.CLAMP_TO_EDGE;
  12354. if (e === n.MirroredRepeatWrapping)
  12355. return r.MIRRORED_REPEAT;
  12356. if (e === n.NearestFilter)
  12357. return r.NEAREST;
  12358. if (e === n.NearestMipMapNearestFilter)
  12359. return r.NEAREST_MIPMAP_NEAREST;
  12360. if (e === n.NearestMipMapLinearFilter)
  12361. return r.NEAREST_MIPMAP_LINEAR;
  12362. if (e === n.LinearFilter)
  12363. return r.LINEAR;
  12364. if (e === n.LinearMipMapNearestFilter)
  12365. return r.LINEAR_MIPMAP_NEAREST;
  12366. if (e === n.LinearMipMapLinearFilter)
  12367. return r.LINEAR_MIPMAP_LINEAR;
  12368. if (e === n.UnsignedByteType)
  12369. return r.UNSIGNED_BYTE;
  12370. if (e === n.UnsignedShort4444Type)
  12371. return r.UNSIGNED_SHORT_4_4_4_4;
  12372. if (e === n.UnsignedShort5551Type)
  12373. return r.UNSIGNED_SHORT_5_5_5_1;
  12374. if (e === n.UnsignedShort565Type)
  12375. return r.UNSIGNED_SHORT_5_6_5;
  12376. if (e === n.ByteType)
  12377. return r.BYTE;
  12378. if (e === n.ShortType)
  12379. return r.SHORT;
  12380. if (e === n.UnsignedShortType)
  12381. return r.UNSIGNED_SHORT;
  12382. if (e === n.IntType)
  12383. return r.INT;
  12384. if (e === n.UnsignedIntType)
  12385. return r.UNSIGNED_INT;
  12386. if (e === n.FloatType)
  12387. return r.FLOAT;
  12388. if (t = i.get("OES_texture_half_float"),
  12389. null !== t && e === n.HalfFloatType)
  12390. return t.HALF_FLOAT_OES;
  12391. if (e === n.AlphaFormat)
  12392. return r.ALPHA;
  12393. if (e === n.RGBFormat)
  12394. return r.RGB;
  12395. if (e === n.RGBAFormat)
  12396. return r.RGBA;
  12397. if (e === n.LuminanceFormat)
  12398. return r.LUMINANCE;
  12399. if (e === n.LuminanceAlphaFormat)
  12400. return r.LUMINANCE_ALPHA;
  12401. if (e === n.AddEquation)
  12402. return r.FUNC_ADD;
  12403. if (e === n.SubtractEquation)
  12404. return r.FUNC_SUBTRACT;
  12405. if (e === n.ReverseSubtractEquation)
  12406. return r.FUNC_REVERSE_SUBTRACT;
  12407. if (e === n.ZeroFactor)
  12408. return r.ZERO;
  12409. if (e === n.OneFactor)
  12410. return r.ONE;
  12411. if (e === n.SrcColorFactor)
  12412. return r.SRC_COLOR;
  12413. if (e === n.OneMinusSrcColorFactor)
  12414. return r.ONE_MINUS_SRC_COLOR;
  12415. if (e === n.SrcAlphaFactor)
  12416. return r.SRC_ALPHA;
  12417. if (e === n.OneMinusSrcAlphaFactor)
  12418. return r.ONE_MINUS_SRC_ALPHA;
  12419. if (e === n.DstAlphaFactor)
  12420. return r.DST_ALPHA;
  12421. if (e === n.OneMinusDstAlphaFactor)
  12422. return r.ONE_MINUS_DST_ALPHA;
  12423. if (e === n.DstColorFactor)
  12424. return r.DST_COLOR;
  12425. if (e === n.OneMinusDstColorFactor)
  12426. return r.ONE_MINUS_DST_COLOR;
  12427. if (e === n.SrcAlphaSaturateFactor)
  12428. return r.SRC_ALPHA_SATURATE;
  12429. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12430. null !== t) {
  12431. if (e === n.RGB_S3TC_DXT1_Format)
  12432. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12433. if (e === n.RGBA_S3TC_DXT1_Format)
  12434. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12435. if (e === n.RGBA_S3TC_DXT3_Format)
  12436. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12437. if (e === n.RGBA_S3TC_DXT5_Format)
  12438. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12439. }
  12440. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12441. null !== t) {
  12442. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12443. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12444. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12445. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12446. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12447. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12448. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12449. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12450. }
  12451. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12452. null !== t && e === n.RGB_ETC1_Format)
  12453. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12454. if (t = i.get("EXT_blend_minmax"),
  12455. null !== t) {
  12456. if (e === n.MinEquation)
  12457. return t.MIN_EXT;
  12458. if (e === n.MaxEquation)
  12459. return t.MAX_EXT
  12460. }
  12461. return 0
  12462. }
  12463. ,
  12464. n.WebGLState = function(e, t, i) {
  12465. var r = this
  12466. , o = new n.Vector4
  12467. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12468. , s = new Uint8Array(a)
  12469. , l = new Uint8Array(a)
  12470. , c = new Uint8Array(a)
  12471. , h = {}
  12472. , u = null
  12473. , d = null
  12474. , p = null
  12475. , f = null
  12476. , g = null
  12477. , m = null
  12478. , v = null
  12479. , A = null
  12480. , y = !1
  12481. , C = null
  12482. , I = null
  12483. , E = null
  12484. , b = null
  12485. , w = null
  12486. , _ = null
  12487. , T = null
  12488. , x = null
  12489. , S = null
  12490. , M = null
  12491. , R = null
  12492. , P = null
  12493. , O = null
  12494. , L = null
  12495. , D = null
  12496. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12497. , B = void 0
  12498. , F = {}
  12499. , V = new n.Vector4
  12500. , U = null
  12501. , k = null
  12502. , H = new n.Vector4
  12503. , G = new n.Vector4;
  12504. this.init = function() {
  12505. this.clearColor(0, 0, 0, 1),
  12506. this.clearDepth(1),
  12507. this.clearStencil(0),
  12508. this.enable(e.DEPTH_TEST),
  12509. e.depthFunc(e.LEQUAL),
  12510. e.frontFace(e.CCW),
  12511. e.cullFace(e.BACK),
  12512. this.enable(e.CULL_FACE),
  12513. this.enable(e.BLEND),
  12514. e.blendEquation(e.FUNC_ADD),
  12515. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12516. }
  12517. ,
  12518. this.initAttributes = function() {
  12519. for (var e = 0, t = s.length; e < t; e++)
  12520. s[e] = 0
  12521. }
  12522. ,
  12523. this.enableAttribute = function(i) {
  12524. if (s[i] = 1,
  12525. 0 === l[i] && (e.enableVertexAttribArray(i),
  12526. l[i] = 1),
  12527. 0 !== c[i]) {
  12528. var n = t.get("ANGLE_instanced_arrays");
  12529. n.vertexAttribDivisorANGLE(i, 0),
  12530. c[i] = 0
  12531. }
  12532. }
  12533. ,
  12534. this.enableAttributeAndDivisor = function(t, i, n) {
  12535. s[t] = 1,
  12536. 0 === l[t] && (e.enableVertexAttribArray(t),
  12537. l[t] = 1),
  12538. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12539. c[t] = i)
  12540. }
  12541. ,
  12542. this.disableUnusedAttributes = function() {
  12543. for (var t = 0, i = l.length; t < i; t++)
  12544. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12545. l[t] = 0)
  12546. }
  12547. ,
  12548. this.enable = function(t) {
  12549. h[t] !== !0 && (e.enable(t),
  12550. h[t] = !0)
  12551. }
  12552. ,
  12553. this.disable = function(t) {
  12554. h[t] !== !1 && (e.disable(t),
  12555. h[t] = !1)
  12556. }
  12557. ,
  12558. this.getCompressedTextureFormats = function() {
  12559. if (null === u && (u = [],
  12560. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12561. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12562. u.push(i[n]);
  12563. return u
  12564. }
  12565. ,
  12566. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12567. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12568. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12569. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12570. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12571. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12572. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12573. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12574. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12575. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12576. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12577. d = t,
  12578. y = h),
  12579. t === n.CustomBlending ? (s = s || r,
  12580. l = l || o,
  12581. c = c || a,
  12582. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12583. p = r,
  12584. m = s),
  12585. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12586. f = o,
  12587. g = a,
  12588. v = l,
  12589. A = c)) : (p = null,
  12590. f = null,
  12591. g = null,
  12592. m = null,
  12593. v = null,
  12594. A = null)
  12595. }
  12596. ,
  12597. this.setDepthFunc = function(t) {
  12598. if (C !== t) {
  12599. if (t)
  12600. switch (t) {
  12601. case n.NeverDepth:
  12602. e.depthFunc(e.NEVER);
  12603. break;
  12604. case n.AlwaysDepth:
  12605. e.depthFunc(e.ALWAYS);
  12606. break;
  12607. case n.LessDepth:
  12608. e.depthFunc(e.LESS);
  12609. break;
  12610. case n.LessEqualDepth:
  12611. e.depthFunc(e.LEQUAL);
  12612. break;
  12613. case n.EqualDepth:
  12614. e.depthFunc(e.EQUAL);
  12615. break;
  12616. case n.GreaterEqualDepth:
  12617. e.depthFunc(e.GEQUAL);
  12618. break;
  12619. case n.GreaterDepth:
  12620. e.depthFunc(e.GREATER);
  12621. break;
  12622. case n.NotEqualDepth:
  12623. e.depthFunc(e.NOTEQUAL);
  12624. break;
  12625. default:
  12626. e.depthFunc(e.LEQUAL)
  12627. }
  12628. else
  12629. e.depthFunc(e.LEQUAL);
  12630. C = t
  12631. }
  12632. }
  12633. ,
  12634. this.setDepthTest = function(t) {
  12635. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12636. }
  12637. ,
  12638. this.setDepthWrite = function(t) {
  12639. I !== t && (e.depthMask(t),
  12640. I = t)
  12641. }
  12642. ,
  12643. this.setColorWrite = function(t) {
  12644. E !== t && (e.colorMask(t, t, t, t),
  12645. E = t)
  12646. }
  12647. ,
  12648. this.setStencilFunc = function(t, i, n) {
  12649. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12650. w = t,
  12651. _ = i,
  12652. T = n)
  12653. }
  12654. ,
  12655. this.setStencilOp = function(t, i, n) {
  12656. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12657. x = t,
  12658. S = i,
  12659. M = n)
  12660. }
  12661. ,
  12662. this.setStencilTest = function(t) {
  12663. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12664. }
  12665. ,
  12666. this.setStencilWrite = function(t) {
  12667. b !== t && (e.stencilMask(t),
  12668. b = t)
  12669. }
  12670. ,
  12671. this.setFlipSided = function(t) {
  12672. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12673. R = t)
  12674. }
  12675. ,
  12676. this.setLineWidth = function(t) {
  12677. t !== P && (e.lineWidth(t),
  12678. P = t)
  12679. }
  12680. ,
  12681. this.setPolygonOffset = function(t, i, n) {
  12682. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12683. !t || O === i && L === n || (e.polygonOffset(i, n),
  12684. O = i,
  12685. L = n)
  12686. }
  12687. ,
  12688. this.getScissorTest = function() {
  12689. return D
  12690. }
  12691. ,
  12692. this.setScissorTest = function(t) {
  12693. D = t,
  12694. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12695. }
  12696. ,
  12697. this.activeTexture = function(t) {
  12698. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12699. B !== t && (e.activeTexture(t),
  12700. B = t)
  12701. }
  12702. ,
  12703. this.bindTexture = function(t, i) {
  12704. void 0 === B && r.activeTexture();
  12705. var n = F[B];
  12706. void 0 === n && (n = {
  12707. type: void 0,
  12708. texture: void 0
  12709. },
  12710. F[B] = n),
  12711. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12712. n.type = t,
  12713. n.texture = i)
  12714. }
  12715. ,
  12716. this.compressedTexImage2D = function() {
  12717. try {
  12718. e.compressedTexImage2D.apply(e, arguments)
  12719. } catch (e) {
  12720. console.error(e)
  12721. }
  12722. }
  12723. ,
  12724. this.texImage2D = function() {
  12725. try {
  12726. e.texImage2D.apply(e, arguments)
  12727. } catch (e) {
  12728. console.error(e)
  12729. }
  12730. }
  12731. ,
  12732. this.clearColor = function(t, i, n, r) {
  12733. o.set(t, i, n, r),
  12734. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12735. V.copy(o))
  12736. }
  12737. ,
  12738. this.clearDepth = function(t) {
  12739. U !== t && (e.clearDepth(t),
  12740. U = t)
  12741. }
  12742. ,
  12743. this.clearStencil = function(t) {
  12744. k !== t && (e.clearStencil(t),
  12745. k = t)
  12746. }
  12747. ,
  12748. this.scissor = function(t) {
  12749. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12750. H.copy(t))
  12751. }
  12752. ,
  12753. this.viewport = function(t) {
  12754. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12755. G.copy(t))
  12756. }
  12757. ,
  12758. this.reset = function() {
  12759. for (var t = 0; t < l.length; t++)
  12760. 1 === l[t] && (e.disableVertexAttribArray(t),
  12761. l[t] = 0);
  12762. h = {},
  12763. u = null,
  12764. B = void 0,
  12765. F = {},
  12766. d = null,
  12767. E = null,
  12768. I = null,
  12769. b = null,
  12770. R = null
  12771. }
  12772. }
  12773. }
  12774. , {
  12775. three: 217
  12776. }],
  12777. 104: [function(e, t, i) {
  12778. (function(i, n) {
  12779. "use strict";
  12780. function r(e) {
  12781. this.urls = e;
  12782. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12783. this.builder = a.loadProto(t),
  12784. this.decoder = this.builder.build("binary_mesh")
  12785. }
  12786. var o = e("three")
  12787. , a = e("protobufjs")
  12788. , s = e("../util/logger")
  12789. , l = (e("../util/common"),
  12790. e("../util/ajax"))
  12791. , c = e("../objects/Chunk")
  12792. , h = new s(n);
  12793. r.prototype = {
  12794. constructor: r,
  12795. load: function(e, t, i, n) {
  12796. return h.time("download"),
  12797. l.get(e, {
  12798. responseType: "arraybuffer"
  12799. }).done(function(r) {
  12800. h.timeEnd("download"),
  12801. this.parse(r, e, t, i, n)
  12802. }
  12803. .bind(this)).fail(n)
  12804. },
  12805. parse: function(e, t, i, n, r) {
  12806. var o = this.readProtobuf(e);
  12807. if (!o)
  12808. return r();
  12809. try {
  12810. h.time("convert to webgl"),
  12811. this.convertProtobufToSceneObject(o, t, i, n, r),
  12812. h.timeEnd("convert to webgl")
  12813. } catch (e) {
  12814. return h.error("failed parsing .dam"),
  12815. h.error(e.message),
  12816. r()
  12817. }
  12818. },
  12819. readProtobuf: function(e) {
  12820. var t;
  12821. try {
  12822. h.time("parse proto"),
  12823. t = this.decoder.decode(e),
  12824. h.timeEnd("parse proto")
  12825. } catch (e) {
  12826. return h.error("failed parsing proto for .dam"),
  12827. h.error(e.message),
  12828. null
  12829. }
  12830. return t
  12831. },
  12832. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12833. function a(e) {
  12834. var i = new o.BufferGeometry;
  12835. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12836. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12837. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12838. i.applyMatrix(s),
  12839. i.computeBoundingBox(),
  12840. new c({
  12841. geometry: i,
  12842. textureName: e.material_name,
  12843. name: e.chunk_name,
  12844. meshUrl: t
  12845. })
  12846. }
  12847. if (0 === e.chunk.length)
  12848. return h.warn("No chunks in damfile..."),
  12849. i([]);
  12850. var s = new o.Matrix4;
  12851. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12852. var l = e.chunk.map(a);
  12853. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12854. r())
  12855. }
  12856. },
  12857. t.exports = r
  12858. }
  12859. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12860. }
  12861. , {
  12862. "../objects/Chunk": 144,
  12863. "../util/ajax": 181,
  12864. "../util/common": 185,
  12865. "../util/logger": 189,
  12866. buffer: 198,
  12867. protobufjs: 214,
  12868. three: 217
  12869. }],
  12870. 105: [function(e, t, i) {
  12871. (function(i) {
  12872. "use strict";
  12873. var n = (e("three"),
  12874. e("../settings"),
  12875. e("../util/browser"),
  12876. e("./DamLoader"))
  12877. , r = e("../util/logger")
  12878. , o = (e("../ab"),
  12879. new r(i));
  12880. t.exports = {
  12881. getLoaders: function() {
  12882. return [["_50k", ".dam", n], ["", ".dam", n]]
  12883. },
  12884. load: function(e, t, i, n, r, a) {
  12885. var s = this.getLoaders();
  12886. a = a || 0;
  12887. var l = s[a];
  12888. if (!l)
  12889. return void (r && r("No suitable model file found..."));
  12890. var c = l[0]
  12891. , h = l[1]
  12892. , u = new l[2](t)
  12893. , d = t.get(e + c + h);
  12894. d ? (o.debug("Trying " + c + h),
  12895. u.load(d, i, n, function() {
  12896. this.load(e, t, i, n, r, ++a)
  12897. }
  12898. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12899. this.load(e, t, i, n, r, ++a))
  12900. }
  12901. }
  12902. }
  12903. ).call(this, "/js/loaders/ModelLoader.js")
  12904. }
  12905. , {
  12906. "../ab": 3,
  12907. "../settings": 166,
  12908. "../util/browser": 182,
  12909. "../util/logger": 189,
  12910. "./DamLoader": 104,
  12911. three: 217
  12912. }],
  12913. 106: [function(e, t, i) {
  12914. (function(i) {
  12915. "use strict";
  12916. var n = e("../util/common")
  12917. , r = e("../util/texture")
  12918. , o = e("../util/browser")
  12919. , a = e("../util/logger")
  12920. , s = e("../settings")
  12921. , l = new a(i);
  12922. t.exports = {
  12923. load: function(e, t) {
  12924. function i(e, i) {
  12925. e || (t.push(i),
  12926. p++,
  12927. d.notify(p, a),
  12928. p === a && d.resolve())
  12929. }
  12930. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12931. return $.when();
  12932. var a = n.countUnique(e.chunks.map(function(e) {
  12933. return e.textureName
  12934. }))
  12935. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12936. , h = "_50k" === c ? "high" : "low";
  12937. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12938. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12939. h = "low"));
  12940. //经常没有low的贴图,这里要不要去掉转low的?? xzw
  12941. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12942. , d = $.Deferred()
  12943. , p = 0;
  12944. return e.chunks.forEach(function(t) {
  12945. if (!t.material.map && t.textureName) {
  12946. var n = e.urls.get(u + t.textureName);
  12947. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12948. }
  12949. }),
  12950. d.promise()
  12951. }
  12952. }
  12953. }
  12954. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12955. }
  12956. , {
  12957. "../settings": 166,
  12958. "../util/browser": 182,
  12959. "../util/common": 185,
  12960. "../util/logger": 189,
  12961. "../util/texture": 194
  12962. }],
  12963. 107: [function(e, t, i) {
  12964. (function(i, n) {
  12965. "use strict";
  12966. function r(e) {
  12967. this.model = e,
  12968. this.modelDataPath = this.model.urls.get("vision.modeldata")+"?m="+new Date().getTime(),
  12969. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12970. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12971. , n = o.loadProto(t);
  12972. this.decoder = n.build("VisionModeldata")
  12973. }
  12974. var o = e("protobufjs")
  12975. , a = e("../util/ajax")
  12976. , s = (e("../util/common"),
  12977. e("../util/math"))
  12978. , l = e("../util/logger")
  12979. , c = new l(n);
  12980. r.prototype.load = function() {
  12981. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12982. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12983. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12984. $.when([]))
  12985. }
  12986. ,
  12987. r.prototype.loadVisionModelData = function() {
  12988. return a.get(this.modelDataPath, {
  12989. responseType: "arraybuffer"
  12990. }).then(function(e) {
  12991. var t;
  12992. try {
  12993. t = this.decoder.decode(e)
  12994. } catch (e) {
  12995. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12996. this.loadSweepLocationsCSV()
  12997. }
  12998. var i = t.sweepLocations.map(function(e) {
  12999. return {
  13000. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  13001. position: {
  13002. x: e.pose.translation.x,
  13003. y: e.pose.translation.y,
  13004. z: e.pose.translation.z
  13005. },
  13006. quaternion: {
  13007. x: e.pose.rotation.x,
  13008. y: e.pose.rotation.y,
  13009. z: e.pose.rotation.z,
  13010. w: e.pose.rotation.w
  13011. },
  13012. puck: {
  13013. x: e.puck.x,
  13014. y: e.puck.y,
  13015. z: e.puck.z
  13016. },
  13017. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  13018. neighbours: e.visibles,
  13019. alignmentType: e.alignment_type
  13020. }
  13021. }).map(function(e) {
  13022. return e.position = s.convertVisionVector(e.position),
  13023. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13024. e.puck = s.convertVisionVector(e.puck),
  13025. e
  13026. });
  13027. return i.forEach(function(e) {
  13028. e.neighbours = e.neighbours.map(function(e) {
  13029. return i[e].uuid
  13030. })
  13031. }),
  13032. i
  13033. }
  13034. .bind(this), function() {
  13035. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  13036. this.loadSweepLocationsCSV()
  13037. }
  13038. .bind(this))
  13039. }
  13040. ,
  13041. r.prototype.loadSweepLocationsCSV = function() {
  13042. return a.get(this.sweepLocationsPath).then(function(e) {
  13043. var t = e.split("\n").map(function(e) {
  13044. return e.split(", ")
  13045. }).filter(function(e) {
  13046. return e.length > 1
  13047. }).map(function(e) {
  13048. return {
  13049. uuid: e[0],
  13050. position: {
  13051. x: parseFloat(e[1]),
  13052. y: parseFloat(e[2]),
  13053. z: parseFloat(e[3])
  13054. },
  13055. quaternion: {
  13056. x: parseFloat(e[4]),
  13057. y: parseFloat(e[5]),
  13058. z: parseFloat(e[6]),
  13059. w: parseFloat(e[7])
  13060. }
  13061. }
  13062. }).map(function(e) {
  13063. return e.position = s.convertVisionVector(e.position),
  13064. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  13065. e
  13066. });
  13067. return t
  13068. }).fail(function() {
  13069. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  13070. })
  13071. }
  13072. ,
  13073. t.exports = r
  13074. }
  13075. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  13076. }
  13077. , {
  13078. "../util/ajax": 181,
  13079. "../util/common": 185,
  13080. "../util/logger": 189,
  13081. "../util/math": 190,
  13082. buffer: 198,
  13083. protobufjs: 214
  13084. }],
  13085. 108: [function(e, t, i) {
  13086. (function(i) {
  13087. "use strict";
  13088. function n() {
  13089. this.locale = null
  13090. }
  13091. var r = e("../settings")
  13092. , o = e("../util/common")
  13093. , a = e("../util/logger")
  13094. , s = e("../enum/Locale")
  13095. , l = new a(i);
  13096. n.prototype.init = function() {
  13097. var t;
  13098. switch (r.languageTag) {
  13099. case null:
  13100. case "en":
  13101. case s.EN_US:
  13102. this.locale = s.EN_US,
  13103. t = e("./strings-en-US");
  13104. break;
  13105. case "es":
  13106. case s.ES_MX:
  13107. this.locale = s.ES_MX,
  13108. t = e("./strings-es-MX");
  13109. break;
  13110. case "fr":
  13111. case s.FR_FR:
  13112. this.locale = s.FR_FR,
  13113. t = e("./strings-fr-FR");
  13114. break;
  13115. case "de":
  13116. case s.DE_DE:
  13117. this.locale = s.DE_DE,
  13118. t = e("./strings-de-DE");
  13119. break;
  13120. case "ru":
  13121. case s.RU_RU:
  13122. this.locale = s.RU_RU,
  13123. t = e("./strings-ru-RU");
  13124. break;
  13125. case "cn":
  13126. case s.CN_CN:
  13127. this.locale = s.CN_CN,
  13128. t = e("./strings-cn-CN");
  13129. break;
  13130. case "jp":
  13131. case s.JP_JP:
  13132. this.locale = s.JP_JP,
  13133. t = e("./strings-jp-JP");
  13134. break;
  13135. default:
  13136. l.info("Unsupported language tag, defaulting to 'en-US'"),
  13137. this.locale = s.EN_US,
  13138. t = e("./strings-en-US")
  13139. }
  13140. l.info("Using locale '" + this.locale + "'"),
  13141. o.extendObject(this, t)
  13142. }
  13143. ,
  13144. n.prototype.localizeGUI = function() {
  13145. var e = document.querySelector("#gui-parent");
  13146. this.localizeTree(e),
  13147. this.localizeLoadingText()
  13148. }
  13149. ,
  13150. n.prototype.localizeLoadingText = function() {
  13151. // var e = document.querySelector("#loader-cont")
  13152. // , t = e.getAttribute("title");
  13153. // e.removeAttribute("title"),
  13154. // e.setAttribute("data-status", t),
  13155. // e.classList.add(this.locale),
  13156. document.querySelector("#help-dialog").classList.add(this.locale),
  13157. document.querySelector("#interaction-modal").classList.add(this.locale),
  13158. document.querySelector("#gui").classList.add(this.locale);
  13159. }
  13160. ,
  13161. n.prototype.localizeTree = function(e) {
  13162. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  13163. if (e.nodeType === Node.TEXT_NODE)
  13164. t = e.data.match(n),
  13165. t && (i = t[1],
  13166. e.data = this.localizeText(i) || i);
  13167. else if (e.nodeType === Node.ELEMENT_NODE) {
  13168. var r = e.getAttribute("title");
  13169. r && (t = r.match(n),
  13170. t && (i = t[1],
  13171. e.setAttribute("title", this.localizeText(i) || i)))
  13172. }
  13173. for (e = e.firstChild; e; )
  13174. this.localizeTree(e),
  13175. e = e.nextSibling
  13176. }
  13177. ,
  13178. n.prototype.localizeText = function(t) {
  13179. var i = this[t];
  13180. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  13181. i = e("./strings-en-US")[t]),
  13182. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13183. i
  13184. }
  13185. ,
  13186. t.exports = new n
  13187. }
  13188. ).call(this, "/js/localization/localize.js")
  13189. }
  13190. , {
  13191. "../enum/Locale": 31,
  13192. "../settings": 166,
  13193. "../util/common": 185,
  13194. "../util/logger": 189,
  13195. "./strings-cn-CN": 109,
  13196. "./strings-de-DE": 110,
  13197. "./strings-en-US": 111,
  13198. "./strings-es-MX": 112,
  13199. "./strings-fr-FR": 113,
  13200. "./strings-jp-JP": 114,
  13201. "./strings-ru-RU": 115
  13202. }],
  13203. 109: [function(e, t, i) {
  13204. "use strict";
  13205. t.exports = {
  13206. PAGE_TITLE: "",
  13207. LOADING: "正在加载",
  13208. PRESENTED_BY_CAPS: "呈现者:",
  13209. POWERED_BY: "技术支持:",
  13210. POWERED_BY_CAPS: "技术支持:",
  13211. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13212. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  13213. PRESENTED_BY: "呈现者:",
  13214. MORE: "更多 ",
  13215. LESS: "更少 ",
  13216. TAG_CONTENT: "tag™ 内容",
  13217. SHOW: "显示",
  13218. HIDE: "隐藏",
  13219. DOLLHOUSE: "场景屋",
  13220. FLOOR_PLAN: "楼层平面图",
  13221. OPEN_HIGHLIGHTS: "打开精彩片段",
  13222. CLOSE_HIGHLIGHTS: "关闭",
  13223. PREVIOUS: "上一个",
  13224. PLAY: "播放",
  13225. PAUSE: "暂停",
  13226. NEXT: "下一个",
  13227. EXPLORE_3D_SPACE: "探索 3D 空间",
  13228. VIEW_DOLLHOUSE: "观看场景屋",
  13229. SOCIAL_SHARING: "分享这个空间",
  13230. VIEW_IN_VR: "以 VR 观看",
  13231. VIEW_FULLSCREEN: "全屏观看",
  13232. EXIT_FULLSCREEN: " 退出全屏",
  13233. ZOOM_IN: "放大",
  13234. ZOOM_OUT: "缩小",
  13235. FLOOR_NAME: "楼层",
  13236. FLOOR_ALL: "ALL",
  13237. FLOOR_Lang: ["Floor",""],
  13238. TERMS: "条款",
  13239. PORT_TERMS: "port 条款",
  13240. TERMS_OF_USE: "使用条款",
  13241. CLOSE_TERMS: "关闭",
  13242. TERMS_TEXT_FILE: "terms-cn-CN.html",
  13243. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  13244. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  13245. WEBVR_ENTER_WEBVR: "进入 VR",
  13246. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  13247. WEBVR_LEARN_MORE: "了解更多",
  13248. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  13249. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  13250. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13251. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  13252. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  13253. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  13254. VR_LEARN_MORE_CAPS: "了解更多",
  13255. VR_PREVIOUS_CAPS: "上一个’,",
  13256. VR_NEXT_CAPS: "下一个",
  13257. VR_GOT_IT_CAPS: "明白了",
  13258. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  13259. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  13260. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  13261. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  13262. VR_WHAT_YOU_NEED: "关于...您需要什么",
  13263. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  13264. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  13265. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  13266. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  13267. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13268. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13269. VR_APP: "port VR 应用程序",
  13270. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13271. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13272. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  13273. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  13274. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  13275. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  13276. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  13277. VR_ANDROID_DVICES: "Android 设备",
  13278. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  13279. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  13280. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  13281. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  13282. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  13283. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  13284. VR_DOWNLOAD_HERE: "在此下载",
  13285. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  13286. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  13287. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  13288. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  13289. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  13290. SHARE_TO: "分享到",
  13291. SHARE_LINK: "直接链接",
  13292. SHARE_EXPLORE: "探索",
  13293. SHARE_AT: "在",
  13294. SHARE_WITH: "使用",
  13295. SHARE_3D: "以 3D",
  13296. SHARE_COPIED: "已复制!",
  13297. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  13298. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  13299. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  13300. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  13301. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  13302. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  13303. ERROR_GENERIC_ACTIONS_3: " 或",
  13304. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  13305. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  13306. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  13307. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  13308. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  13309. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  13310. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  13311. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  13312. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  13313. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  13314. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  13315. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  13316. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  13317. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  13318. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  13319. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  13320. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  13321. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  13322. LINK_TO_LOCATION: "地点链接",
  13323. MENU_COPY: "复制",
  13324. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  13325. ROTATE: "旋转",
  13326. MOVE: "移动",
  13327. INSIDE: "内部",
  13328. ZOOM: "缩放",
  13329. HELP: "小帮手",
  13330. HELP_NAVIGATION_TAB: "导航",
  13331. HELP_MORE_HELP_TAB: "更多帮助",
  13332. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  13333. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  13334. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  13335. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  13336. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  13337. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  13338. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  13339. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  13340. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  13341. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  13342. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  13343. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  13344. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  13345. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  13346. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  13347. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  13348. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  13349. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  13350. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  13351. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  13352. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  13353. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  13354. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  13355. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  13356. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  13357. HELP_MORE_HLR_A: "精彩片段集锦",
  13358. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  13359. HELP_MORE_DOLLHOUSE_A: "场景屋",
  13360. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  13361. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  13362. HELP_MORE_FLOORS_A: "楼层选择器",
  13363. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  13364. HELP_MORE_TAG_A: "tag™ 贴文",
  13365. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  13366. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  13367. HELP_MORE_ZOOM_A: "缩放控件",
  13368. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  13369. HELP_MORE_TOUR_A: "导览控件",
  13370. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  13371. HELP_MORE_INSIDE_A: "内部视图",
  13372. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  13373. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  13374. HELP_MORE_VR_A: "VR 模式",
  13375. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  13376. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  13377. HELP_MORE_360_A: "360° 视图",
  13378. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  13379. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  13380. HELP_MORE_FULLSCREEN_A: "全屏",
  13381. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  13382. CLOSE: "关闭"
  13383. }
  13384. }
  13385. , {}],
  13386. 110: [function(e, t, i) {
  13387. "use strict";
  13388. t.exports = {
  13389. PAGE_TITLE: "",
  13390. LOADING: "Lädt",
  13391. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  13392. POWERED_BY: "Angetrieben von",
  13393. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  13394. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13395. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  13396. PRESENTED_BY: "Präsentiert von ",
  13397. MORE: "Mehr ",
  13398. LESS: "Weniger ",
  13399. TAG_CONTENT: "tag™ Inhalt",
  13400. SHOW: "Anzeigen",
  13401. HIDE: "Verbergen",
  13402. DOLLHOUSE: "Puppenhaus",
  13403. FLOOR_PLAN: "Grundriss",
  13404. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  13405. CLOSE_HIGHLIGHTS: "Schließen",
  13406. PREVIOUS: "Vorheriges",
  13407. PLAY: "Abspielen",
  13408. PAUSE: "Pausieren",
  13409. NEXT: "Nächstes",
  13410. EXPLORE_3D_SPACE: "Innenraum betreten",
  13411. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  13412. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  13413. VIEW_IN_VR: "In VR ansehen",
  13414. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  13415. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  13416. ZOOM_IN: "Vergrößern",
  13417. ZOOM_OUT: "Verkleinern",
  13418. FLOOR_NAME: "Etage ",
  13419. FLOOR_ALL: "Alle",
  13420. TERMS: "Bedingungen",
  13421. PORT_TERMS: "port Bedingungen",
  13422. TERMS_OF_USE: "Nutzungsbedingungen",
  13423. TERMS_TEXT_FILE: "terms-de-DE.html",
  13424. CLOSE_TERMS: "Schließen",
  13425. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  13426. HELP: "Hilfe",
  13427. HELP_NAVIGATION_TAB: "Navigation",
  13428. HELP_MORE_HELP_TAB: "Hilfe-Details",
  13429. CLOSE: "Schließen",
  13430. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13431. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13432. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13433. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13434. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13435. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13436. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13437. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13438. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13439. 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.",
  13440. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13441. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13442. 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.",
  13443. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13444. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13445. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13446. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13447. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13448. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13449. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13450. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13451. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13452. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13453. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13454. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13455. HELP_MORE_HLR_A: "Liste das Highlight",
  13456. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13457. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13458. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13459. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13460. HELP_MORE_FLOORS_A: "Etage auswählen",
  13461. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13462. HELP_MORE_TAG_A: "tag™ Posts",
  13463. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13464. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13465. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13466. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13467. HELP_MORE_TOUR_A: "Tour Steuerung",
  13468. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13469. HELP_MORE_INSIDE_A: "Innenansicht",
  13470. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13471. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13472. HELP_MORE_VR_A: "VR Modus",
  13473. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13474. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13475. HELP_MORE_360_A: "360° Views Ansicht ",
  13476. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13477. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13478. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13479. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13480. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13481. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13482. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13483. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13484. WEBVR_LEARN_MORE: "Mehr Infos",
  13485. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13486. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13487. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13488. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13489. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13490. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13491. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13492. VR_APP: "port VR App",
  13493. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13494. 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",
  13495. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13496. VR_APP_FOR_ANDROID: "port VR app für Android",
  13497. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13498. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13499. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13500. VR_PREVIOUS_CAPS: "ZURÜCK",
  13501. VR_NEXT_CAPS: "WEITER",
  13502. VR_GOT_IT_CAPS: "VERSTANDEN",
  13503. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13504. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13505. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13506. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13507. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13508. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13509. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13510. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13511. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13512. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13513. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13514. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13515. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13516. VR_ANDROID_DVICES: "Android Geräte",
  13517. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13518. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13519. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13520. VR_DOWNLOAD_HERE: "Hier runterladen",
  13521. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13522. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13523. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13524. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13525. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13526. SHARE_TO: "Teilen auf",
  13527. SHARE_LINK: "Direkter Link",
  13528. SHARE_EXPLORE: "Umsehen",
  13529. SHARE_AT: "auf",
  13530. SHARE_WITH: "mit",
  13531. SHARE_3D: "in 3D",
  13532. SHARE_COPIED: "Kopiert!",
  13533. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13534. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13535. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13536. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13537. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13538. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13539. ERROR_GENERIC_ACTIONS_3: " oder ",
  13540. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13541. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13542. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13543. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13544. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13545. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13546. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13547. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13548. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13549. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13550. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13551. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13552. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13553. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13554. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13555. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13556. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13557. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13558. LINK_TO_LOCATION: "Link zu",
  13559. MENU_COPY: "Kopieren",
  13560. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13561. ROTATE: "Drehen",
  13562. INSIDE: "Drinnen",
  13563. MOVE: "Bewegen",
  13564. ZOOM: "Vergrößern"
  13565. }
  13566. }
  13567. , {}],
  13568. 111: [function(e, t, i) {
  13569. "use strict";
  13570. t.exports = {
  13571. PAGE_TITLE: "",
  13572. LOADING: "Loading",
  13573. PRESENTED_BY_CAPS: "PRESENTED BY",
  13574. POWERED_BY: "powered by ",
  13575. POWERED_BY_CAPS: "POWERED BY",
  13576. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13577. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13578. PRESENTED_BY: "Presented by ",
  13579. MORE: "More ",
  13580. LESS: "Less ",
  13581. TAG_CONTENT: "tag™ Content",
  13582. SHOW: "Show",
  13583. HIDE: "Hide",
  13584. DOLLHOUSE: "Dollhouse",
  13585. FLOOR_PLAN: "Floor plan",
  13586. OPEN_HIGHLIGHTS: "Open Highlights",
  13587. CLOSE_HIGHLIGHTS: "Close",
  13588. PREVIOUS: "Previous",
  13589. PLAY: "Play",
  13590. PAUSE: "Pause",
  13591. NEXT: "Next",
  13592. EXPLORE_3D_SPACE: "Explore 3D Space",
  13593. VIEW_DOLLHOUSE: "View dollhouse",
  13594. SOCIAL_SHARING: "Share this Space",
  13595. VIEW_IN_VR: "View in VR",
  13596. VIEW_FULLSCREEN: "全屏",
  13597. EXIT_FULLSCREEN: "退出全屏",
  13598. ZOOM_IN: "Zoom in",
  13599. ZOOM_OUT: "Zoom out",
  13600. FLOOR_NAME: "Floor ",
  13601. FLOOR_ALL: "全部",
  13602. TERMS: "Terms",
  13603. PORT_TERMS: "port terms",
  13604. TERMS_OF_USE: "Terms of Use",
  13605. TERMS_TEXT_FILE: "terms-en-US.html",
  13606. CLOSE_TERMS: "Close",
  13607. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13608. HELP: "Help",
  13609. HELP_NAVIGATION_TAB: "Navigation",
  13610. HELP_MORE_HELP_TAB: "More Help",
  13611. CLOSE: "Close",
  13612. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13613. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13614. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13615. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13616. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13617. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13618. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13619. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13620. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13621. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13622. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13623. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13624. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13625. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13626. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13627. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13628. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13629. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13630. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13631. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13632. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13633. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13634. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13635. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13636. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13637. HELP_MORE_HLR_A: "Highlight Reel",
  13638. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13639. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13640. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13641. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13642. HELP_MORE_FLOORS_A: "Floor Selector",
  13643. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13644. HELP_MORE_TAG_A: "tag™ Posts",
  13645. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13646. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13647. HELP_MORE_ZOOM_A: "Zoom Controls",
  13648. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13649. HELP_MORE_TOUR_A: "Tour Controls",
  13650. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13651. HELP_MORE_INSIDE_A: "Inside View",
  13652. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13653. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13654. HELP_MORE_VR_A: "VR Mode",
  13655. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13656. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13657. HELP_MORE_360_A: "360° Views",
  13658. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13659. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13660. HELP_MORE_FULLSCREEN_A: "Full screen",
  13661. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13662. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13663. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13664. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13665. WEBVR_ENTER_WEBVR: "ENTER VR",
  13666. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13667. WEBVR_LEARN_MORE: "Learn more",
  13668. WEBVR_VIEW_SPACE: "View Space in VR",
  13669. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13670. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13671. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13672. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13673. VR_PREVIOUS_CAPS: "PREVIOUS",
  13674. VR_NEXT_CAPS: "NEXT",
  13675. VR_GOT_IT_CAPS: "GOT IT",
  13676. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13677. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13678. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13679. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13680. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13681. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13682. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13683. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13684. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13685. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13686. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13687. VR_APP: "port VR App",
  13688. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13689. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13690. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13691. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13692. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13693. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13694. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13695. VR_ANDROID_DVICES: "Android Devices",
  13696. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13697. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13698. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13699. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13700. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13701. VR_APP_OPEN: "Open with the port VR app instead",
  13702. VR_DOWNLOAD_HERE: "Download here",
  13703. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13704. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13705. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13706. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13707. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13708. SHARE_TO: "Share to",
  13709. SHARE_LINK: "Direct Link",
  13710. SHARE_EXPLORE: "Explore ",
  13711. SHARE_AT: "at",
  13712. SHARE_WITH: "with",
  13713. SHARE_3D: " in 3D",
  13714. SHARE_COPIED: "Copied!",
  13715. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13716. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13717. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13718. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13719. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13720. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13721. ERROR_GENERIC_ACTIONS_3: " or ",
  13722. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13723. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13724. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13725. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13726. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13727. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13728. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13729. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13730. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13731. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13732. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13733. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13734. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13735. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13736. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13737. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13738. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13739. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13740. LINK_TO_LOCATION: "Link to location",
  13741. MENU_COPY: "Copy",
  13742. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13743. ROTATE: "Rotate",
  13744. INSIDE: "Inside",
  13745. MOVE: "Move",
  13746. ZOOM: "Zoom"
  13747. }
  13748. }
  13749. , {}],
  13750. 112: [function(e, t, i) {
  13751. "use strict";
  13752. t.exports = {
  13753. PAGE_TITLE: "",
  13754. LOADING: "Cargando",
  13755. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13756. POWERED_BY: "potenciando por ",
  13757. POWERED_BY_CAPS: "POTENCIADO POR ",
  13758. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13759. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13760. PRESENTED_BY: "Presentado por ",
  13761. MORE: "Más ",
  13762. LESS: "Menos ",
  13763. TAG_CONTENT: "Contenido de tag™",
  13764. SHOW: "Mostrar",
  13765. HIDE: "Ocultar",
  13766. DOLLHOUSE: "Dollhouse",
  13767. FLOOR_PLAN: "Planos",
  13768. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13769. CLOSE_HIGHLIGHTS: "Cerrar",
  13770. PREVIOUS: "Anterior",
  13771. PLAY: "Play",
  13772. PAUSE: "Pausa",
  13773. NEXT: "Siguiente",
  13774. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13775. VIEW_DOLLHOUSE: "Ver dollhouse",
  13776. SOCIAL_SHARING: "Compartir este espacio",
  13777. VIEW_IN_VR: "Ver en realidad virtual",
  13778. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13779. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13780. ZOOM_IN: "Acercar",
  13781. ZOOM_OUT: "Alejar",
  13782. FLOOR_NAME: "Piso ",
  13783. FLOOR_ALL: "Todas",
  13784. TERMS: "Condiciones",
  13785. PORT_TERMS: "port términos de uso",
  13786. TERMS_OF_USE: "Términos de uso",
  13787. TERMS_TEXT_FILE: "terms-es-MX.html",
  13788. CLOSE_TERMS: "Cerrar",
  13789. 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.",
  13790. HELP: "Ayuda",
  13791. HELP_NAVIGATION_TAB: "Navegación",
  13792. HELP_MORE_HELP_TAB: "Más Ayuda",
  13793. CLOSE: "Cerrar",
  13794. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13795. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13796. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13797. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13798. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13799. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13800. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13801. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13802. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13803. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13804. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13805. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13806. 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.",
  13807. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13808. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13809. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13810. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13811. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13812. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13813. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13814. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13815. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13816. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13817. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13818. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13819. HELP_MORE_HLR_A: "Galería destacada",
  13820. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13821. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13822. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13823. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13824. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13825. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13826. HELP_MORE_TAG_A: "tag™ Posts",
  13827. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13828. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13829. HELP_MORE_ZOOM_A: "Controles de zoom",
  13830. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13831. HELP_MORE_TOUR_A: "Controles de recorrido",
  13832. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13833. HELP_MORE_INSIDE_A: "Vista interior",
  13834. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13835. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13836. HELP_MORE_VR_A: "Modo de realidad virtual",
  13837. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13838. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13839. HELP_MORE_360_A: "360° Views",
  13840. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13841. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13842. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13843. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13844. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13845. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13846. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13847. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13848. WEBVR_LEARN_MORE: "Más información",
  13849. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13850. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13851. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13852. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13853. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13854. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13855. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13856. VR_APP: "port VR App",
  13857. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13858. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13859. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13860. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13861. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13862. VR_PREVIOUS_CAPS: "ANTERIOR",
  13863. VR_NEXT_CAPS: "SIGUIENTE",
  13864. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13865. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13866. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13867. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13868. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13869. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13870. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13871. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13872. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13873. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13874. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13875. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13876. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13877. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13878. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13879. VR_ANDROID_DVICES: "Dispositivos Android",
  13880. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13881. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13882. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13883. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13884. VR_DOWNLOAD_HERE: "Descargar aquí",
  13885. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13886. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13887. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13888. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13889. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13890. SHARE_TO: "Compartir en",
  13891. SHARE_LINK: "Enlace directo",
  13892. SHARE_EXPLORE: "Explorar ",
  13893. SHARE_AT: "en",
  13894. SHARE_WITH: "con",
  13895. SHARE_3D: " en 3D",
  13896. SHARE_COPIED: "¡Copiado!",
  13897. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13898. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13899. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13900. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13901. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13902. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13903. ERROR_GENERIC_ACTIONS_3: " o ",
  13904. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13905. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13906. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13907. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13908. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13909. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13910. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13911. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13912. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13913. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13914. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13915. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13916. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13917. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13918. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13919. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13920. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13921. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13922. LINK_TO_LOCATION: "Enlace a la ubicación",
  13923. MENU_COPY: "Copiar",
  13924. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13925. ROTATE: "Girar",
  13926. INSIDE: "Interior",
  13927. MOVE: "Moverse",
  13928. ZOOM: "Acercar o alejar"
  13929. }
  13930. }
  13931. , {}],
  13932. 113: [function(e, t, i) {
  13933. "use strict";
  13934. t.exports = {
  13935. PAGE_TITLE: "",
  13936. LOADING: "Chargement",
  13937. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13938. POWERED_BY: "alimenté par ",
  13939. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13940. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13941. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13942. PRESENTED_BY: "Présenté par ",
  13943. MORE: "Plus ",
  13944. LESS: "Moins ",
  13945. TAG_CONTENT: "Contenu tag™",
  13946. SHOW: "Montrer",
  13947. HIDE: "Cacher",
  13948. DOLLHOUSE: "Dollhouse",
  13949. FLOOR_PLAN: "Plan de sol",
  13950. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13951. CLOSE_HIGHLIGHTS: "Fermer",
  13952. PREVIOUS: "Précédent",
  13953. PLAY: "Lecture",
  13954. PAUSE: "Pause",
  13955. NEXT: "Suivant",
  13956. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13957. VIEW_DOLLHOUSE: "Voir dollhouse",
  13958. SOCIAL_SHARING: "Partager cet espace",
  13959. VIEW_IN_VR: "Voir en VR",
  13960. VIEW_FULLSCREEN: "Plein écran",
  13961. EXIT_FULLSCREEN: "Fermer plein écran",
  13962. ZOOM_IN: "Zoom avant",
  13963. ZOOM_OUT: "Zoom arrière",
  13964. FLOOR_NAME: "Étage ",
  13965. FLOOR_ALL: "Tous",
  13966. TERMS: "Mentions légales",
  13967. PORT_TERMS: "port mentions légales",
  13968. TERMS_OF_USE: "Conditions d'utilisation",
  13969. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13970. CLOSE_TERMS: "Fermer",
  13971. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13972. HELP: "Aide",
  13973. HELP_NAVIGATION_TAB: "Navigation",
  13974. HELP_MORE_HELP_TAB: "Aide",
  13975. CLOSE: "Fermer",
  13976. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13977. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13978. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13979. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13980. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13981. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13982. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13983. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13984. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13985. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13986. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13987. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13988. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13989. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13990. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13991. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13992. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13993. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13994. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13995. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13996. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13997. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13998. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13999. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  14000. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  14001. HELP_MORE_HLR_A: "Carrousel",
  14002. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  14003. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  14004. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  14005. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  14006. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  14007. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  14008. HELP_MORE_TAG_A: "tag™ Posts",
  14009. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  14010. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  14011. HELP_MORE_ZOOM_A: "Commandes de zoom",
  14012. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  14013. HELP_MORE_TOUR_A: "Commandes de la visite",
  14014. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  14015. HELP_MORE_INSIDE_A: "Vue intérieure",
  14016. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  14017. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  14018. HELP_MORE_VR_A: "Mode RV",
  14019. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  14020. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  14021. HELP_MORE_360_A: "Vues 360°",
  14022. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14023. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  14024. HELP_MORE_FULLSCREEN_A: "Plein écran",
  14025. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  14026. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  14027. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  14028. WEBVR_ENTER_WEBVR: "ENTRER VR",
  14029. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  14030. WEBVR_LEARN_MORE: "En savoir plus",
  14031. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  14032. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14033. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  14034. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  14035. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  14036. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  14037. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  14038. VR_NEXT_CAPS: "SUIVANT",
  14039. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  14040. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  14041. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  14042. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  14043. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  14044. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  14045. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  14046. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  14047. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  14048. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  14049. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14050. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14051. VR_APP: "port VR App",
  14052. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14053. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14054. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  14055. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  14056. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  14057. 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",
  14058. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  14059. VR_ANDROID_DVICES: "Appareils Android",
  14060. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  14061. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  14062. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  14063. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  14064. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  14065. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  14066. VR_DOWNLOAD_HERE: "Télécharger ici",
  14067. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  14068. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  14069. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  14070. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  14071. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  14072. SHARE_TO: "Partager sur",
  14073. SHARE_LINK: "Lien direct",
  14074. SHARE_EXPLORE: "Explorer ",
  14075. SHARE_AT: "à",
  14076. SHARE_WITH: "avec",
  14077. SHARE_3D: " en 3D",
  14078. SHARE_COPIED: "Copié!",
  14079. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  14080. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  14081. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  14082. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  14083. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  14084. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  14085. ERROR_GENERIC_ACTIONS_3: " ou ",
  14086. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  14087. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  14088. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  14089. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  14090. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  14091. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  14092. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  14093. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  14094. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  14095. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  14096. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  14097. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  14098. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  14099. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  14100. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  14101. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  14102. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  14103. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  14104. LINK_TO_LOCATION: "Lien vers l'emplacement",
  14105. MENU_COPY: "Copie",
  14106. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  14107. ROTATE: "Faire pivoter",
  14108. INSIDE: "Intérieure",
  14109. MOVE: "Se déplacer",
  14110. ZOOM: "Zoom"
  14111. }
  14112. }
  14113. , {}],
  14114. 114: [function(e, t, i) {
  14115. "use strict";
  14116. t.exports = {
  14117. PAGE_TITLE: "",
  14118. LOADING: "読み込み中",
  14119. PRESENTED_BY_CAPS: "PRESENTED BY",
  14120. POWERED_BY: "powered by",
  14121. POWERED_BY_CAPS: "POWERED BY",
  14122. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  14123. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  14124. PRESENTED_BY: "Presented by ",
  14125. MORE: "全て表示 ",
  14126. LESS: "閉じる ",
  14127. TAG_CONTENT: "tag™コンテンツ ",
  14128. SHOW: "表示",
  14129. HIDE: "非表示",
  14130. DOLLHOUSE: "ドールハウス",
  14131. FLOOR_PLAN: "フロアプラン",
  14132. OPEN_HIGHLIGHTS: "ハイライトを開く",
  14133. CLOSE_HIGHLIGHTS: "閉じる",
  14134. PREVIOUS: "前へ",
  14135. PLAY: "再生",
  14136. PAUSE: "一時停止",
  14137. NEXT: "次へ",
  14138. EXPLORE_3D_SPACE: "3DSpaceの探索",
  14139. VIEW_DOLLHOUSE: "ドールハウスの表示",
  14140. SOCIAL_SHARING: "このSpaceを共有する",
  14141. VIEW_IN_VR: "VRで表示",
  14142. VIEW_FULLSCREEN: "フルスクリーン表示",
  14143. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  14144. ZOOM_IN: "ズームイン",
  14145. ZOOM_OUT: "ズームアウト",
  14146. FLOOR_NAME: "フロア ",
  14147. FLOOR_ALL: "すべて",
  14148. TERMS: "規約",
  14149. PORT_TERMS: "port規約",
  14150. TERMS_OF_USE: "利用規約",
  14151. CLOSE_TERMS: "閉じる",
  14152. TERMS_TEXT_FILE: "terms-jp-JP.html",
  14153. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  14154. WEBVR_FOR_DAYDREAM: "Daydream View用",
  14155. WEBVR_ENTER_WEBVR: "VRに入る",
  14156. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  14157. WEBVR_LEARN_MORE: "もっと詳しく",
  14158. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  14159. WEBVR_DAYDREAM_VIEW: "Daydream View",
  14160. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  14161. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  14162. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  14163. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  14164. VR_LEARN_MORE_CAPS: "もっと詳しく",
  14165. VR_PREVIOUS_CAPS: "前へ",
  14166. VR_NEXT_CAPS: "次へ",
  14167. VR_GOT_IT_CAPS: "了解",
  14168. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  14169. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  14170. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  14171. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  14172. VR_WHAT_YOU_NEED: "必要なもの",
  14173. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  14174. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  14175. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  14176. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  14177. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14178. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14179. VR_APP: "port VRアプリ",
  14180. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14181. VR_COMPATIBLE_IPHONES_1: "iPhone",
  14182. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  14183. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  14184. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  14185. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  14186. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  14187. VR_ANDROID_DVICES: "Androidデバイス",
  14188. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  14189. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  14190. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  14191. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  14192. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  14193. VR_APP_OPEN: "port VRアプリで開く",
  14194. VR_DOWNLOAD_HERE: "ここからダウンロード",
  14195. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  14196. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  14197. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  14198. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  14199. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  14200. SHARE_TO: "共有先",
  14201. SHARE_LINK: "ダイレクトリンク",
  14202. SHARE_EXPLORE: "探索",
  14203. SHARE_AT: "場所",
  14204. SHARE_WITH: "使用アプリ",
  14205. SHARE_3D: "3Dで",
  14206. SHARE_COPIED: "コピーされました!",
  14207. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  14208. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  14209. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  14210. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  14211. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  14212. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  14213. ERROR_GENERIC_ACTIONS_3: "または",
  14214. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  14215. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  14216. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  14217. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  14218. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  14219. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  14220. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  14221. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  14222. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  14223. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  14224. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  14225. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  14226. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  14227. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  14228. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  14229. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  14230. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  14231. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  14232. LINK_TO_LOCATION: "ロケーションへのリンク",
  14233. MENU_COPY: "コピー",
  14234. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  14235. ROTATE: "回転",
  14236. MOVE: "移動",
  14237. INSIDE: "内側",
  14238. ZOOM: "ズーム",
  14239. HELP: "ヘルプ",
  14240. HELP_NAVIGATION_TAB: "ナビゲーション",
  14241. HELP_MORE_HELP_TAB: "その他のヘルプ",
  14242. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  14243. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  14244. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14245. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  14246. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  14247. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  14248. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  14249. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  14250. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  14251. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  14252. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14253. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  14254. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  14255. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  14256. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  14257. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  14258. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  14259. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  14260. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  14261. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  14262. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  14263. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  14264. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  14265. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  14266. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  14267. HELP_MORE_HLR_A: "ハイライト",
  14268. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  14269. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  14270. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  14271. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  14272. HELP_MORE_FLOORS_A: "フロアセレクター",
  14273. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  14274. HELP_MORE_TAG_A: "tag™ Posts",
  14275. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  14276. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  14277. HELP_MORE_ZOOM_A: "ズームコントロール",
  14278. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  14279. HELP_MORE_TOUR_A: "ツアーコントロール",
  14280. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  14281. HELP_MORE_INSIDE_A: "内側ビュー",
  14282. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  14283. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  14284. HELP_MORE_VR_A: "VRモード",
  14285. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  14286. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  14287. HELP_MORE_360_A: "360° Views",
  14288. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  14289. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  14290. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  14291. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  14292. CLOSE: "閉じる"
  14293. }
  14294. }
  14295. , {}],
  14296. 115: [function(e, t, i) {
  14297. "use strict";
  14298. t.exports = {
  14299. PAGE_TITLE: "",
  14300. LOADING: "Загрузка",
  14301. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  14302. POWERED_BY: "разработано на платформе ",
  14303. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  14304. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  14305. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  14306. PRESENTED_BY: "Представлено ",
  14307. MORE: "Больше ",
  14308. LESS: "Меньше ",
  14309. TAG_CONTENT: "tag™ Контент",
  14310. SHOW: "Показать",
  14311. HIDE: "Скрыть",
  14312. DOLLHOUSE: "Dollhouse",
  14313. FLOOR_PLAN: "Планировка",
  14314. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  14315. CLOSE_HIGHLIGHTS: "Закрыть",
  14316. PREVIOUS: "Предыдущий",
  14317. PLAY: "Воспроизвести",
  14318. PAUSE: "Пауза",
  14319. NEXT: "Следующий",
  14320. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  14321. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  14322. SOCIAL_SHARING: "Поделиться этой моделью",
  14323. VIEW_IN_VR: "Посмотреть в VR",
  14324. VIEW_FULLSCREEN: "Полный экран",
  14325. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  14326. ZOOM_IN: "Увеличить",
  14327. ZOOM_OUT: "Уменьшить",
  14328. FLOOR_NAME: "Этаж ",
  14329. FLOOR_ALL: "Все",
  14330. TERMS: "Условия",
  14331. PORT_TERMS: "Правила пользования",
  14332. TERMS_OF_USE: "Условия использования",
  14333. TERMS_TEXT_FILE: "terms-ru-RU.html",
  14334. CLOSE_TERMS: "Закрыть",
  14335. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  14336. HELP: "Помощь",
  14337. HELP_NAVIGATION_TAB: "Навигация",
  14338. HELP_MORE_HELP_TAB: "Доп. Помощь",
  14339. CLOSE: "Закрыть",
  14340. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  14341. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  14342. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  14343. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  14344. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  14345. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  14346. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14347. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  14348. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  14349. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  14350. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14351. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  14352. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  14353. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  14354. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  14355. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  14356. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  14357. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  14358. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  14359. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  14360. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  14361. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  14362. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  14363. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  14364. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  14365. HELP_MORE_HLR_A: "Фотоколлаж",
  14366. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  14367. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  14368. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14369. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  14370. HELP_MORE_FLOORS_A: "Выбор Этажа",
  14371. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  14372. HELP_MORE_TAG_A: "tag™ Posts",
  14373. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  14374. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  14375. HELP_MORE_ZOOM_A: "Масштаб",
  14376. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  14377. HELP_MORE_TOUR_A: "Управление Туром",
  14378. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  14379. HELP_MORE_INSIDE_A: "Вид Изнутри",
  14380. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14381. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  14382. HELP_MORE_VR_A: "Режим VR",
  14383. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14384. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  14385. HELP_MORE_360_A: "360° Views",
  14386. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14387. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  14388. HELP_MORE_FULLSCREEN_A: "Полный экран",
  14389. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  14390. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  14391. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  14392. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  14393. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  14394. WEBVR_LEARN_MORE: "Узнать больше",
  14395. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  14396. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  14397. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14398. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  14399. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  14400. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  14401. VR_GOOGLE_DAYDREAM: "Google Daydream",
  14402. VR_APP: "port VR App",
  14403. VR_APP_OPEN: "Или открыть через приложение port VR",
  14404. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14405. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  14406. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  14407. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  14408. VR_VIEW_SPACE: "Запустить модель в VR",
  14409. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  14410. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  14411. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  14412. VR_GOT_IT_CAPS: "ЯСНО",
  14413. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  14414. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  14415. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  14416. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  14417. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  14418. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  14419. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  14420. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  14421. VR_COMPATIBLE_IPHONES_1: "iPhones",
  14422. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  14423. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  14424. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  14425. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14426. VR_ANDROID_DVICES: "Android устройства",
  14427. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  14428. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  14429. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14430. VR_DOWNLOAD_HERE: "Скачать здесь",
  14431. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14432. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14433. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14434. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14435. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14436. SHARE_TO: "Поделиться",
  14437. SHARE_LINK: "Прямая ссылка",
  14438. SHARE_EXPLORE: "просмотреть",
  14439. SHARE_AT: "на",
  14440. SHARE_WITH: "с",
  14441. SHARE_3D: "в 3D",
  14442. SHARE_COPIED: "Скопировано!",
  14443. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14444. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14445. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14446. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14447. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14448. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14449. ERROR_GENERIC_ACTIONS_3: " или ",
  14450. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14451. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14452. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14453. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14454. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14455. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14456. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14457. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14458. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14459. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14460. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14461. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14462. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14463. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14464. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14465. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14466. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14467. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14468. LINK_TO_LOCATION: "Ссылка на местоположение",
  14469. MENU_COPY: "Копировать",
  14470. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14471. ROTATE: "Вращать",
  14472. MOVE: "Передвигаться",
  14473. INSIDE: "Вид изнутри",
  14474. ZOOM: "Масштаб"
  14475. }
  14476. }
  14477. , {}],
  14478. 116: [function(e, t, i) {//main.js
  14479. (function(t) {
  14480. "use strict";
  14481. var modelProgressBase = 0.4;
  14482. var progressUpdate = function(e){ // 0 <= e <= 1
  14483. console.log('e1:'+e)
  14484. e = Math.round(modelProgressBase * e * 100);
  14485. console.log('e2:'+e)
  14486. var t = $('.progressbar');
  14487. t.find('.bar').css('width',e+'%');
  14488. t.find('.label').css('left', t.width() * e / 100 - 15 + 'px' ); //上面跟着的字的百分比
  14489. t.find('.perc').text(e +'%'); //具体数字的百分比
  14490. }
  14491. $('#gui-loading').fadeIn(200);
  14492. progressUpdate(0.1)
  14493. var fileName = g_version ? 'modeldata.js' : 'someData.json' ;
  14494. $.ajax(g_Prefix + "data/"+window.number+"/"+fileName+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14495. var data = matcher(e);
  14496. data.files.templates[0] = g_Prefix + e.files.templates[0].replace("{{number}}",window.number);
  14497. data.user = {
  14498. "is_authenticated": false,
  14499. "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"]
  14500. }
  14501. try{//处理一下导览数据
  14502. data.model.images = data.model.images.filter(e=>{
  14503. if(!e.locations && !e.thumbnail_signed_src)return; //旧的曾有导览数据是错误的,将它删除
  14504. if(e.locations)e.locations = e.locations.filter(e=>e)
  14505. if(e.locations && e.locations.length == 0)return;
  14506. return e
  14507. })
  14508. }catch(e){console.log(e) }
  14509. window.DATA = data;
  14510. data.model.summary = data.summary
  14511. data.model.name = data.name
  14512. for(let i in data){
  14513. data[i] == "false" && (data[i] = false)
  14514. }
  14515. progressUpdate(0.7);
  14516. StartLoad(); //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14517. if(data.weixinDesc){
  14518. g_weixinObj.desc = data.weixinDesc;
  14519. }
  14520. if(data.shareImgUrl){
  14521. g_weixinObj.imgUrl = data.shareImgUrl
  14522. }
  14523. window.wx && manage.weixinShare();
  14524. //初始画面
  14525. data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
  14526. function E(e) {
  14527. $("<img/>").attr("src", e).on("load", function() {
  14528. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  14529. $(this).remove()
  14530. })
  14531. }
  14532. //背景
  14533. settings.transparentBg = settings.transparentBg || data.transparentBg || false,
  14534. settings.bgImg = settings.bgImg || data.bgImg || null
  14535. if(settings.bgImg){
  14536. $("#player").css({'background-image': "url("+settings.bgImg+")",
  14537. "background-position": "center center"
  14538. })
  14539. }
  14540. {//初始化导览时间
  14541. if(DATA.tourBlackSpeed == void 0)DATA.tourBlackSpeed = 100
  14542. window._settings.warp.teleportTime = settings.teleportTime / DATA.tourBlackSpeed * 100;
  14543. if(DATA.tourWalkSpeed == void 0)DATA.tourWalkSpeed = 100
  14544. if(DATA.tourRotTime == '' || DATA.tourRotTime == void 0){
  14545. DATA.tourRotTime = settings.tourRotTime; //默认停留2秒
  14546. }
  14547. settings.playTourNearBy = !DATA.tourFromStart
  14548. }
  14549. {//其他
  14550. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14551. _settings.angleShift2d = DATA.angleShift2d || 0
  14552. if(DATA.insideLookLimit){
  14553. _settings.insideLookLimitDown = DATA.insideLookLimit[0]
  14554. _settings.insideLookLimitUp = DATA.insideLookLimit[1]
  14555. }
  14556. /* _settings.upDownAngleLimitPanos = {
  14557. 25:{up:30},
  14558. 26:{up:30},
  14559. 27:{up:30},
  14560. 28:{up:30},
  14561. 29:{up:30},
  14562. 30:{up:30},
  14563. 31:{up:30},
  14564. 32:{up:30},
  14565. 33:{up:24},
  14566. 34:{up:30},
  14567. 35:{up:30},
  14568. 36:{up:30},
  14569. 37:{up:30},
  14570. 38:{up:30},
  14571. 39:{up:30}
  14572. } */
  14573. }
  14574. if (data.showCad){
  14575. $.ajax({
  14576. url: '//super.4dage.com/data/'+ window.number +'/floor.json',
  14577. method: 'GET',
  14578. success(res) {
  14579. grendCAD(res, document.documentElement, data.cadSignColor, data.cadBorderColor, data.cadBorderWidth)
  14580. }
  14581. })
  14582. }
  14583. }).fail(e=>{
  14584. alert("缺少someData文件,请检查场景码是否正确。")
  14585. })
  14586. function StartLoad(){//当加载完data后
  14587. function i() {
  14588. var e = window.number//Y.getModelIDFromQueryString();
  14589. if (!e)
  14590. return b(null, "loading-failed");
  14591. var t = Y.parseSidUrl(e)
  14592. , i = l()
  14593. , a = c()
  14594. , s = o()
  14595. , u = V.quickstart.enabled
  14596. , g = null
  14597. , m = null
  14598. , v = null
  14599. , w = null
  14600. , T = null
  14601. , x = null
  14602. , S = null
  14603. , M = null
  14604. , R = null
  14605. , P = null
  14606. , O = null
  14607. , L = null
  14608. , N = new ue;
  14609. r(s);
  14610. h({ //MP开头写法
  14611. urlBase: t.urlBase
  14612. }).then(function() {
  14613. return re.init(),
  14614. d(t, e) //getModel and load
  14615. }).then(function(e) {
  14616. progressUpdate(0.9)
  14617. return P = e,
  14618. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14619. startSource: i,
  14620. autoplay: V.autoplay,
  14621. quickstart: u
  14622. }),
  14623. P.urls.init()
  14624. }).then(function() {
  14625. return P.loadPanos()
  14626. }).then(function() {
  14627. m = X.getStartCameraOptions(P, P.panos),
  14628. S = A(P),
  14629. O = y(u, m.mode),
  14630. v = O.controls,
  14631. w = O.player,
  14632. T = O.director,
  14633. x = O.tagManager,
  14634. M = O.tileDownloader,
  14635. R = O.qualityManager,
  14636. L = O.panoRenderer,
  14637. C(P, S, O, s),
  14638. w.director = T,//xzw add
  14639. P.supportsTiles && M.start(),
  14640. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14641. u = !1);
  14642. var e = null;
  14643. if (u) {
  14644. de.warn("Quickstart engaged. Hold on to your knickers.");
  14645. var t = v.controls[D.PANORAMA];
  14646. g = new ie(R,S.scene,S.camera,t,s),
  14647. _(S, s, P),
  14648. e = g.load(m).then(function() {
  14649. S.addComponent(g),
  14650. S.once(le.AfterRender, function() {
  14651. de.warn("First render after quickstart load finished.")
  14652. })
  14653. })
  14654. }
  14655. window.flyToFirst = function(){//xzw add
  14656. var pano = w.model.panos.get("8d778e19657f433fb9cf8947d823bb70");
  14657. var q = new _x.Quaternion(0.7099827027821568,-0.07708150183830938,0.6958985789714591,0.07555241737970636);
  14658. var lookAtPoint = new _x.Vector3(0,0,-1).applyQuaternion(q).add(pano.position);
  14659. w.flyToPano({pano:pano, lookAtPoint:lookAtPoint})
  14660. };
  14661. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14662. }).then(function() {
  14663. return f(P, U.onProgress, i, !u, a)
  14664. }).then(function() {
  14665. if (m.quickstart = u,
  14666. I(P, S, O, s),
  14667. S.started || _(S, s, P),
  14668. H.modelLoaded(P, w, v, V.autoplay),
  14669. E(w, P, m, V.autoplay).done(function() {
  14670. T.autoTour()
  14671. }),
  14672. !P.supportsTiles) {
  14673. var e = new Z(P,w);
  14674. e.start()
  14675. }
  14676. u && (S.removeComponent(g),
  14677. g.destroy(),
  14678. m.pano.enter()),
  14679. U.init(P, T, w, v, S, m, H.getSessionId()),
  14680. U.endLoading(P, T, x),
  14681. S.once(le.AfterRender, function() {
  14682. N.setAppReadyTime();
  14683. var e = N.calcFullLoadingTime();
  14684. de.warn("Total load time: " + e / 1e3),
  14685. H.loadComplete(e),
  14686. de.warn("First render after model load finished.")
  14687. try {
  14688. window.evt && window.dispatchEvent(window.evt);
  14689. parent.postMessage({
  14690. cmd: "loaded",
  14691. }, "*")
  14692. } catch (err) {}
  14693. }),
  14694. S.on(le.MemoryUsageUpdated, n)
  14695. }).fail(b.bind(this, e))
  14696. }
  14697. function n(e) {
  14698. ce.update(e)
  14699. }
  14700. function r(e) {
  14701. de.info("Version", "2.25.6-0-gd87e5b1"),
  14702. q.defaultMaxListeners = 1e3,
  14703. a(e),
  14704. s()
  14705. }
  14706. function o() {
  14707. return document.getElementById("player")
  14708. }
  14709. function a(e) {
  14710. e.addEventListener("dragenter", T, !1),
  14711. e.addEventListener("dragover", T, !1)
  14712. }
  14713. function s() {
  14714. F.valueFromHash("title", !0) || $(document).ready(function() {
  14715. var e = $(".model-title");
  14716. e.hide()
  14717. })
  14718. }
  14719. function l() {
  14720. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14721. }
  14722. function c() {
  14723. return {
  14724. panoElementsToLoad: 6,
  14725. modelElementsToLoad: 0,
  14726. totalElementsLoaded: 0,
  14727. totalElementsToLoad: 0,
  14728. totalPercentageLoaded: 0,
  14729. progressCallback: null
  14730. }
  14731. }
  14732. function h(e) {
  14733. return K.loadFeatureFlags(e).done(function(e) {
  14734. K.updateDependentSettings(e, V)
  14735. })
  14736. }
  14737. // function u(e) {
  14738. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14739. // responseType: "json",
  14740. // prefetchFrom: "config"
  14741. // }).then(function(e) {
  14742. // return e ? void j.extendObject(V.appConfig, e) : {}
  14743. // }, function(e) {
  14744. // return de.warn("Failed loading runtime config, using defaults."),
  14745. // $.when({})
  14746. // })
  14747. // }
  14748. function d(e, t) {
  14749. var i = B.getModel({
  14750. url: t,
  14751. floors: F.valueFromHash("f", !0),
  14752. autoload: !1
  14753. })
  14754. ;
  14755. return $.when(i, n).then(null, function(e) {
  14756. return this
  14757. })
  14758. }
  14759. function p(e, t, i, n, r) {
  14760. de.info("Model data loaded"),
  14761. de.debug("UUID: " + e.data.job.uuid),
  14762. J.init(K.getFlags()),
  14763. i && H.initKeen({
  14764. token: i,
  14765. appId: n
  14766. }),
  14767. H.initSegment({
  14768. model: e.sid,
  14769. version: "2.25.6-0-gd87e5b1",
  14770. startSource: r.startSource,
  14771. token: t,
  14772. autoplay: r.autoplay,
  14773. quickstart: r.quickstart
  14774. })
  14775. }
  14776. function f(e, t, i, n, r) {
  14777. return r.progressCallback = t,
  14778. H.sessionStart(),
  14779. e.load(n).progress(g.bind(this, r))
  14780. }
  14781. function g(e, t) {
  14782. e.modelElementsToLoad = t[1],
  14783. v(e),
  14784. m(e)
  14785. }
  14786. function m(e) {
  14787. e.totalElementsLoaded++,
  14788. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14789. //----许钟文-----------------模型进度条向后调整
  14790. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0);
  14791. e.totalPercentageLoaded = modelProgressBase + (1-modelProgressBase)*e.totalPercentageLoaded;
  14792. //console.log('pro:'+e.totalPercentageLoaded)
  14793. //---------------------------
  14794. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14795. }
  14796. function v(e) {
  14797. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14798. }
  14799. function A(e) {
  14800. var t = new x.PerspectiveCamera;
  14801. t.layers.enable(he.PANOMARKERS),
  14802. t.layers.enable(he.RETICULE),
  14803. t.layers.enable(he.TAG);
  14804. var i = new x.Scene
  14805. , n = new x.AmbientLight(16777215);
  14806. i.add(n),
  14807. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14808. side: x.DoubleSide
  14809. })),
  14810. i.plane.position.y = 0,
  14811. i.plane.rotateX(-Math.PI / 2),
  14812. i.plane.material.visible = !1,
  14813. i.add(i.plane),
  14814. i.updateMatrixWorld(),
  14815. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14816. if (e.metadata && e.metadata.camera_position) {
  14817. var t = e.metadata.camera_position
  14818. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14819. n.position = t.clone(),
  14820. i.add(n);
  14821. var r = e.metadata.camera_quaternion
  14822. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14823. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14824. }
  14825. }),
  14826. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14827. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14828. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14829. //背景
  14830. if(!settings.transparentBg && !settings.bgImg){
  14831. i.skybox = new W
  14832. i.add(i.skybox)
  14833. }
  14834. var r = new te(i,t,z);
  14835. return r
  14836. }
  14837. function y(e, t) {
  14838. var i = e ? 1 : 1e3
  14839. , n = J.tilegen || J.imgopt ? 6 : 2;
  14840. n = F.valueFromHash("tileconc", n);
  14841. var r = new ne
  14842. , o = new ae({
  14843. concurrentDownloads: n
  14844. })
  14845. , a = new se
  14846. , s = new P
  14847. , l = new M
  14848. , c = new S(t)
  14849. , h = new R
  14850. , u = new O(i)
  14851. , d = new L
  14852. , p = new oe;
  14853. return {
  14854. qualityManager: r,
  14855. panoRenderer: a,
  14856. tileDownloader: o,
  14857. player: c,
  14858. director: l,
  14859. modelManager: s,
  14860. tagManager: p,
  14861. displayController: u,
  14862. labelDisplayController: d,
  14863. controls: h
  14864. }
  14865. }
  14866. function C(e, t, i, n) {
  14867. var r = i.controls
  14868. , o = i.qualityManager
  14869. , a = i.panoRenderer
  14870. , s = i.tileDownloader
  14871. , l = i.modelManager;
  14872. r.init(n, l),
  14873. ee.init(i.director, r, i.player, l, t),
  14874. o.init(l),
  14875. s.init(o),
  14876. a.init(t, s, o),
  14877. l.init(s, a, o),
  14878. l.addModel(e),
  14879. t.addComponent(G)
  14880. }
  14881. function I(e, t, i, n) {
  14882. var r = i.qualityManager
  14883. , o = i.panoRenderer
  14884. , a = i.tileDownloader
  14885. , s = i.modelManager
  14886. , l = i.player
  14887. , c = i.director
  14888. , h = i.tagManager
  14889. , u = i.displayController
  14890. , d = i.labelDisplayController
  14891. , p = i.controls;
  14892. t.scene.add(e),
  14893. t.qualityManager = r;
  14894. var f = {
  14895. camera: t.camera,
  14896. director: c,
  14897. modelManager: s,
  14898. tileDownloader: a,
  14899. panoRenderer: o,
  14900. qualityManager: r,
  14901. tagManager: h,
  14902. container: n,
  14903. controls: p
  14904. };
  14905. l.init(f),
  14906. l.setScene(t.scene),
  14907. h.init(s, l),
  14908. c.init(l, s),
  14909. u.init(c, l, s, h, n),
  14910. d.init(l, s, n),
  14911. z.bindEvents(l),
  14912. t.addComponent(h),
  14913. t.addComponent(l),
  14914. t.addComponent(o),
  14915. l.sceneRenderer = t; //xzw add 方便resize
  14916. }
  14917. function E(e, t, i, n) {
  14918. return de.info("Starting player in " + i.mode),
  14919. H.report(t.sid, "started-playing", n, i.quickstart),
  14920. e.start(i)
  14921. }
  14922. function b(e, t) {
  14923. de.error(t),
  14924. k.error(t),
  14925. H.report(e, "error-" + t)
  14926. }
  14927. function w(e) {
  14928. var t = F.details();
  14929. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14930. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14931. H.report(e, "error-webgl-generic"))
  14932. }
  14933. function _(e, t, i) {
  14934. try {
  14935. e.start(t)
  14936. } catch (e) {
  14937. throw de.warn(e.message),
  14938. w(i.sid),
  14939. e
  14940. }
  14941. }
  14942. function T(e) {
  14943. e.stopPropagation(),
  14944. e.preventDefault()
  14945. }
  14946. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14947. if (window.DATA.hoticon){
  14948. g_HotImage = {
  14949. point: window.DATA.hoticon.default || "https://super.4dage.com/images/4dagePoint2.png",
  14950. point2: window.DATA.hoticon.higt || "https://super.4dage.com/images/4dagePoint.png"
  14951. } ;
  14952. }
  14953. //czj 判断someData 有没有backgroundMusic 添加音乐
  14954. if (window.DATA.backgroundMusic && window.isLocal) {
  14955. window.DATA.backgroundMusic = manage.dealURL(window.DATA.backgroundMusic)
  14956. }else if (g_version === "one"){
  14957. window.DATA.backgroundMusic = manage.dealURL( g_Prefix+"/audio/"+"audio"+window.number + "/background.mp3")
  14958. }
  14959. if (window.DATA.backgroundMusic) {
  14960. SoundManager.setSrc('bgm', window.DATA.backgroundMusic )
  14961. $("#volume").show();
  14962. }
  14963. //隐藏公司logo
  14964. if(window.DATA.loadlogo){
  14965. showLogo();
  14966. }
  14967. // 隐藏顶部介绍
  14968. window.DATA.topText && topTextHide();
  14969. e("./lib/three75-shim"),
  14970. e("./lib/array-polyfill"),
  14971. e("./lib/performance-polyfill"),
  14972. e("./lib/shaders/CopyShader.js"),
  14973. e("./lib/shaders/HorizontalBlurShader.js"),
  14974. e("./lib/shaders/VerticalBlurShader.js"),
  14975. e("./lib/postprocessing/EffectComposer.js"),
  14976. e("./lib/postprocessing/RenderPass.js"),
  14977. e("./lib/postprocessing/MaskPass.js"),
  14978. e("./lib/postprocessing/ShaderPass.js"),
  14979. window.Promise || (window.Promise = e("promise-polyfill"));
  14980. var x = e("three")
  14981. , _x = e("three")
  14982. , S = (e("./util/sentry"),
  14983. e("./player"))
  14984. , M = e("./director")
  14985. , R = e("./controls/CameraControls")
  14986. , P = e("./model/ModelManager")
  14987. , O = e("./DisplayController")
  14988. , L = e("./label/LabelDisplayController")
  14989. , D = e("./enum/Viewmode")
  14990. , N = e("./util/logger")
  14991. , B = e("./showcase")
  14992. , F = e("./util/browser")
  14993. , V = e("./settings")
  14994. , U = e("./gui/gui")
  14995. , k = e("./gui/error")
  14996. , H = e("./analytics")
  14997. , G = e("./util/transitions")
  14998. , z = e("./effects")
  14999. , W = e("./objects/Skybox")
  15000. , j = e("./util/common")
  15001. , Y = (e("./util/PanoramaCollection"),
  15002. e("./util/math"),
  15003. e("./util/showcase"))
  15004. , X = e("./util/camera")
  15005. , Z = (e("./objects/Panorama"),
  15006. e("./cameras/PanoramaCamera"),
  15007. e("./preloaders"))
  15008. , q = e("events").EventEmitter
  15009. , K = e("./featureflags")
  15010. , Q = (e("./util/lerp"),
  15011. e("./util/ajax"))
  15012. , J = e("./ab")
  15013. , ee = e("./sdk/automation.js")
  15014. , te = e("./scene/SceneRenderer")
  15015. , ie = e("./scene/QuickstartManager")
  15016. , ne = e("./tile/QualityManager.js")
  15017. , re = e("./localization/localize")
  15018. , oe = e("./tag/tagManager")
  15019. , ae = e("./tile/TileDownloader")
  15020. , se = e("./tile/PanoRenderer")
  15021. , le = (e("./enum/PanoSizeClass"),
  15022. e("./enum/PanoramaEvents"),
  15023. e("./enum/SceneRendererEvents"))
  15024. , ce = e("./gui/memoryUsage")
  15025. , he = e("./enum/RenderLayers")
  15026. , ue = e("./TimingData")
  15027. , de = new N(t);
  15028. N.level = V.logLevel,
  15029. N.consoleEnabled = V.console,
  15030. i()
  15031. }
  15032. }
  15033. ).call(this, "/js/main.js")
  15034. }
  15035. , {
  15036. "./DisplayController": 1,
  15037. "./TimingData": 2,
  15038. "./ab": 3,
  15039. "./analytics": 4,
  15040. "./cameras/PanoramaCamera": 7,
  15041. "./controls/CameraControls": 9,
  15042. "./director": 15,
  15043. "./effects": 16,
  15044. "./enum/PanoSizeClass": 36,
  15045. "./enum/PanoramaEvents": 37,
  15046. "./enum/RenderLayers": 41,
  15047. "./enum/SceneRendererEvents": 43,
  15048. "./enum/Viewmode": 51,
  15049. "./featureflags": 59,
  15050. "./gui/error": 64,
  15051. "./gui/gui": 65,
  15052. "./gui/memoryUsage": 73,
  15053. "./label/LabelDisplayController": 91,
  15054. "./lib/array-polyfill": 92,
  15055. "./lib/performance-polyfill": 95,
  15056. "./lib/postprocessing/EffectComposer.js": 96,
  15057. "./lib/postprocessing/MaskPass.js": 97,
  15058. "./lib/postprocessing/RenderPass.js": 98,
  15059. "./lib/postprocessing/ShaderPass.js": 99,
  15060. "./lib/shaders/CopyShader.js": 100,
  15061. "./lib/shaders/HorizontalBlurShader.js": 101,
  15062. "./lib/shaders/VerticalBlurShader.js": 102,
  15063. "./lib/three75-shim": 103,
  15064. "./localization/localize": 108,
  15065. "./tag/tagManager": 124,
  15066. "./model/ModelManager": 140,
  15067. "./objects/Panorama": 148,
  15068. "./objects/Skybox": 152,
  15069. "./player": 155,
  15070. "./preloaders": 156,
  15071. "./scene/QuickstartManager": 157,
  15072. "./scene/SceneRenderer": 158,
  15073. "./sdk/automation.js": 164,
  15074. "./settings": 166,
  15075. "./showcase": 168,
  15076. "./tile/PanoRenderer": 169,
  15077. "./tile/QualityManager.js": 170,
  15078. "./tile/TileDownloader": 171,
  15079. "./util/PanoramaCollection": 178,
  15080. "./util/ajax": 181,
  15081. "./util/browser": 182,
  15082. "./util/camera": 183,
  15083. "./util/common": 185,
  15084. "./util/lerp": 188,
  15085. "./util/logger": 189,
  15086. "./util/math": 190,
  15087. "./util/sentry": 192,
  15088. "./util/showcase": 193,
  15089. "./util/transitions": 195,
  15090. events: 202,
  15091. "promise-polyfill": 213,
  15092. three: 217
  15093. }],
  15094. 117: [function(e, t, i) {
  15095. "use strict";
  15096. function n(e) {
  15097. e = e || {}
  15098. r.RawShaderMaterial.call(this, a.extendObject({
  15099. fragmentShader: o.cube.fragmentShader,
  15100. vertexShader: o.cube.vertexShader,
  15101. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15102. name: "CubemapMaterial",
  15103. }, e))
  15104. }
  15105. var r = e("three")
  15106. , o = e("../shaders")
  15107. , a = e("../util/common");
  15108. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15109. n.prototype.constructor = n,
  15110. t.exports = n
  15111. }
  15112. , {
  15113. "../shaders": 167,
  15114. "../util/common": 185,
  15115. three: 217
  15116. }],
  15117. 118: [function(e, t, i) {
  15118. "use strict";
  15119. function n(e) {
  15120. e = e || {}
  15121. r.RawShaderMaterial.call(this, a.extendObject({
  15122. fragmentShader: o.model.fragmentShader,
  15123. vertexShader: o.model.vertexShader,
  15124. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15125. name: "ModelTextureMaterial",
  15126. }, e))
  15127. }
  15128. var r = e("three")
  15129. , o = e("../shaders")
  15130. , a = e("../util/common");
  15131. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  15132. n.prototype.constructor = n,
  15133. n.prototype.setProjectedPanos = function(e, t, i) {
  15134. i && (this.uniforms.progress.value = 0),
  15135. e.ensureSkyboxReadyForRender(),
  15136. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  15137. this.uniforms.pano0Position.value.copy(e.position),
  15138. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15139. t.ensureSkyboxReadyForRender(),
  15140. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  15141. this.uniforms.pano1Position.value.copy(t.position),
  15142. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15143. }
  15144. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15145. this.uniforms.eyeDir.value.copy(dir)
  15146. this.uniforms.eyePos.value.copy(pos)
  15147. }
  15148. n.prototype.setBendCameraQua = function(matrix) {//加
  15149. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15150. } */
  15151. ,
  15152. t.exports = n
  15153. }
  15154. , {
  15155. "../shaders": 167,
  15156. "../util/common": 185,
  15157. three: 217
  15158. }],
  15159. 119: [function(e, t, i) {
  15160. (function(i) {
  15161. "use strict";
  15162. function n(e, t, i, n) {
  15163. this.div = null,
  15164. this.body = null,
  15165. this.label = e,
  15166. this.description = t,
  15167. this.parsedDescription = [],
  15168. this.media = i || {
  15169. type: null
  15170. },
  15171. this.loadingSpinner = null,
  15172. this.parser = new r({
  15173. supportLinks: !u.valueFromHash("mls"),
  15174. keepLinkLabels: !0
  15175. }),
  15176. this.state = I.CLOSED,
  15177. this.orientation = "",
  15178. this.initialTransform = "",
  15179. this.hovering = !1,
  15180. this.openTransition = null,
  15181. this.closeTransition = null,
  15182. this.openPromise = null,
  15183. this.closePromise = null,
  15184. this.animationTransition = null,
  15185. this.animationScale = 0
  15186. }
  15187. var r = e("../Parser/DescriptionParser")
  15188. , o = e("../Media/Link")
  15189. , a = e("../Media/Image")
  15190. , s = e("../Media/EmbedlyPlayer")
  15191. , l = e("../Media/EmbedlyEmbed")
  15192. , c = e("../../util/transitions")
  15193. , h = e("../../util/lerp")
  15194. , u = e("../../util/browser")
  15195. , d = e("./BillboardEvent")
  15196. , p = e("../Media/MediaEvent")
  15197. , f = e("../Parser/DescriptionChunkType")
  15198. , g = e("events").EventEmitter
  15199. , m = e("./billboardSettings")
  15200. , v = e("./overlaySettings")
  15201. , A = e("../../util/logger")
  15202. , y = new A(i)
  15203. , C = document.getElementById("tag-billboards");
  15204. C.addEventListener("touchend", function(e) {
  15205. C.style.pointerEvents = "none"
  15206. }),
  15207. C.addEventListener("touchcancel", function(e) {
  15208. C.style.pointerEvents = "none"
  15209. });
  15210. var I = {
  15211. CLOSED: "closed",
  15212. OPENING: "opening",
  15213. OPEN: "open",
  15214. CLOSING: "closing",
  15215. ACTIVE: "active"
  15216. };
  15217. n.prototype = Object.create(g.prototype),
  15218. n.prototype.build = function(e) {
  15219. this.parsedDescription = this.parser.parse(this.description);
  15220. var t = document.createElement("div");
  15221. t.className = "tag-container has-hotzone",
  15222. this.div = t,
  15223. this.body = document.createElement("div"),
  15224. this.body.className = "tag-body";
  15225. var i = document.createElement("div");
  15226. i.classList.add("tag-content");
  15227. var n = document.createElement("div");
  15228. n.classList.add("tag-text-content");
  15229. var r = document.createElement("div");
  15230. r.className = "tag-label",
  15231. r.textContent = this.label,
  15232. n.appendChild(r);
  15233. var o = document.createElement("div");
  15234. o.className = "tag-desc",
  15235. n.appendChild(o),
  15236. i.appendChild(n),
  15237. this.body.appendChild(i),
  15238. this.appendDescriptionElements(this.parsedDescription, o),
  15239. this.appendMedia(),
  15240. t.appendChild(this.body),
  15241. C.appendChild(t),
  15242. this.bindEvents(t, this.body)
  15243. }
  15244. ,
  15245. n.prototype.bindEvents = function(e, t) {
  15246. var i = function(e) {
  15247. return function(t) {
  15248. if (!this.div.classList.contains("overlay")) {
  15249. var i, n = document.getElementById("player");
  15250. try {
  15251. i = new MouseEvent(e,t)
  15252. } catch (n) {
  15253. i = document.createEvent("MouseEvents"),
  15254. 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)
  15255. }
  15256. n.dispatchEvent(i)
  15257. }
  15258. }
  15259. };
  15260. t.addEventListener("mousedown", function(e) {
  15261. e.stopPropagation()
  15262. }),
  15263. t.addEventListener("mouseup", function(e) {
  15264. e.stopPropagation()
  15265. }),
  15266. e.addEventListener("touchstart", function(e) {
  15267. C.style.pointerEvents = "auto"
  15268. }),
  15269. e.addEventListener("mousedown", i("mousedown").bind(this)),
  15270. e.addEventListener("mouseup", i("mouseup").bind(this)),
  15271. t.addEventListener("mouseover", function(t) {
  15272. this.state === I.OPEN && e.classList.remove("has-hotzone")
  15273. }
  15274. .bind(this)),
  15275. e.addEventListener("mouseenter", function(e) {
  15276. this.state !== I.CLOSING && (this.hovering = !0,
  15277. this.emit(d.ENTER))
  15278. }
  15279. .bind(this)),
  15280. e.addEventListener("mouseleave", function(e) {
  15281. this.hovering = !1,
  15282. this.emit(d.LEAVE)
  15283. }
  15284. .bind(this)),
  15285. e.addEventListener("gesturestart", function(e) {
  15286. e.preventDefault()
  15287. });
  15288. var n = e.querySelector(".tag-text-content")
  15289. , r = 0;
  15290. n.addEventListener("touchstart", function(e) {
  15291. r = e.changedTouches[0].clientY
  15292. }),
  15293. n.addEventListener("touchmove", function(t) {
  15294. function i(e) {
  15295. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  15296. }
  15297. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  15298. }),
  15299. e.addEventListener("touchmove", function(e) {
  15300. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15301. })
  15302. }
  15303. ,
  15304. n.prototype.appendDescriptionElements = function(e, t) {
  15305. e.length > 0 && this.div.classList.add("has-text"),
  15306. e.forEach(function(e, i) {
  15307. switch (e.type) {
  15308. case f.TEXT:
  15309. t.appendChild(this.createTextElement(e.text));
  15310. break;
  15311. case f.LINK:
  15312. t.appendChild(this.createLinkElement(e.link))
  15313. }
  15314. }
  15315. .bind(this))
  15316. }
  15317. ,
  15318. n.prototype.appendLoadingSpinner = function() {
  15319. this.loadingSpinner = document.createElement("div"),
  15320. this.loadingSpinner.classList.add("loading-spinner");
  15321. var e = document.createElement("div");
  15322. e.classList.add("gui-spinner-icon"),
  15323. this.loadingSpinner.appendChild(e),
  15324. this.body.appendChild(this.loadingSpinner)
  15325. }
  15326. ,
  15327. n.prototype.onMediaLoadFinished = function() {
  15328. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  15329. this.applyOrientation(this.orientation),
  15330. this.loadingSpinner = null)
  15331. }
  15332. ,
  15333. n.prototype.appendMedia = function() {
  15334. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  15335. this.appendLoadingSpinner();
  15336. var e = document.createElement("div");
  15337. e.classList.add("tag-media-content");
  15338. var t = document.createElement("i");
  15339. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  15340. t.classList.add(e)
  15341. }),
  15342. this.body.appendChild(t),
  15343. this.body.appendChild(e),
  15344. this.media.type) {
  15345. case f.IMAGE:
  15346. e.appendChild(this.createImageElement(this.media, this.body));
  15347. break;
  15348. case f.VIDEO:
  15349. e.appendChild(this.createVideoElement(this.media, this.body));
  15350. break;
  15351. case f.RICH:
  15352. e.appendChild(this.createEmbedElement(this.media, this.body))
  15353. }
  15354. }
  15355. }
  15356. ,
  15357. n.prototype.createTextElement = function(e) {
  15358. var t = document.createElement("span");
  15359. return t.textContent = e,
  15360. t
  15361. }
  15362. ;
  15363. n.prototype.createLinkElement = function(e) {
  15364. var t = new o(e);
  15365. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  15366. t.createDomElement()
  15367. }
  15368. ,
  15369. n.prototype.createImageElement = function(e, t) {
  15370. function i() {
  15371. function e() {
  15372. m || (r.classList.remove("view-image"),
  15373. c.classList.add("overlay"),
  15374. i(),
  15375. window.addEventListener("resize", b),
  15376. c.addEventListener("click", a),
  15377. g.addEventListener("click", l),
  15378. f.addEventListener("click", s),
  15379. m = !0,
  15380. o.emit(p.IMAGE_OPENED))
  15381. }
  15382. function i() {
  15383. t.classList.add("show-info"),
  15384. h.classList.remove("collapsible"),
  15385. h.style.height = "";
  15386. var e = parseFloat(getComputedStyle(I).lineHeight)
  15387. , i = y + e
  15388. , r = c.clientWidth - 2 * v.boundaryWidth - C
  15389. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  15390. , s = a
  15391. , l = s * n.aspect;
  15392. l > r && (l = r,
  15393. s = l / n.aspect),
  15394. s > a && (s = a,
  15395. l = s * n.aspect),
  15396. l += C,
  15397. s += C + i,
  15398. t.style.width = l + "px",
  15399. t.style.height = s + "px",
  15400. u.style.paddingTop = e + C + "px",
  15401. o.description.length > 0 && (h.classList.add("collapsible"),
  15402. h.style.height = h.clientHeight + 12 + "px",
  15403. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  15404. }
  15405. function a(e) {
  15406. e.target === c && s()
  15407. }
  15408. function s() {
  15409. m && (m = !1,
  15410. r.classList.add("view-image"),
  15411. c.classList.remove("overlay"),
  15412. h.style.height = "",
  15413. u.style.paddingTop = "",
  15414. t.style.width = "",
  15415. t.style.height = "",
  15416. window.removeEventListener("resize", b),
  15417. c.removeEventListener("click", a),
  15418. g.removeEventListener("click", l),
  15419. f.removeEventListener("click", s),
  15420. o.emit(p.IMAGE_CLOSED),
  15421. o.close(!0))
  15422. }
  15423. function l(e) {
  15424. t.classList.toggle("show-info")
  15425. }
  15426. var c = o.div
  15427. , h = c.getElementsByClassName("tag-content")[0]
  15428. , u = c.getElementsByClassName("tag-media-content")[0]
  15429. , f = t.getElementsByClassName("close")[0]
  15430. , g = h.getElementsByClassName("tag-label")[0];
  15431. c.classList.add("has-image"),
  15432. r.classList.add("view-image"),
  15433. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  15434. o.applyOrientation(o.orientation);
  15435. var m = !1
  15436. , A = getComputedStyle(h)
  15437. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  15438. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  15439. , I = h.querySelector(".tag-label")
  15440. , E = h.querySelector(".tag-desc")
  15441. , b = function() {
  15442. var e, t, n = 0;
  15443. return function() {
  15444. clearInterval(e),
  15445. clearTimeout(t),
  15446. e = setInterval(function() {
  15447. var e = c.clientHeight;
  15448. n !== e && (i(),
  15449. n = e)
  15450. }, 100),
  15451. t = setTimeout(clearInterval.bind(this, e), 1e3)
  15452. }
  15453. }();
  15454. n.on(p.IMAGE_OPENING, e),
  15455. o.on(d.ACTIVATE, e),
  15456. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  15457. o.on(d.CLOSING, s)
  15458. }
  15459. var n = new a
  15460. , r = n.createDomElement();
  15461. this.once(d.OPENED, function() {
  15462. n.load(e.src).then(i).catch(function(t) {
  15463. y.warn("Failed to load image:", e.src),
  15464. y.warn("with error:", t)
  15465. }).then(this.onMediaLoadFinished.bind(this))
  15466. });
  15467. var o = this;
  15468. return r
  15469. }
  15470. ,
  15471. n.prototype.createVideoElement = function(e, t) {
  15472. var i = new s({
  15473. autoPlay: !0,
  15474. autoResume: !0,
  15475. startMuted: !1,
  15476. loop: !1
  15477. })
  15478. , n = i.createDomElement();
  15479. return this.once(d.OPENED, function() {
  15480. i.load(e.src).then(function() {
  15481. this.div.classList.add("has-video"),
  15482. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  15483. i.play()),
  15484. this.on(d.OPENING, i.show.bind(i)),
  15485. this.on(d.OPENED, i.play.bind(i)),
  15486. this.on(d.CLOSING, i.pause.bind(i)),
  15487. this.on(d.CLOSED, i.hide.bind(i))
  15488. }
  15489. .bind(this)).catch(function(t) {
  15490. y.warn("Failed to embed video:", e.src),
  15491. y.warn("with error:", t)
  15492. }).then(this.onMediaLoadFinished.bind(this))
  15493. }
  15494. .bind(this)),
  15495. n
  15496. }
  15497. ,
  15498. n.prototype.createEmbedElement = function(e, t) {
  15499. var i = new l
  15500. , n = i.createDomElement();
  15501. return this.once(d.OPENED, function() {
  15502. i.load(e.src).then(function() {
  15503. this.div.classList.add("has-embed"),
  15504. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  15505. this.applyOrientation(this.orientation),
  15506. this.on(d.OPENING, i.show.bind(i)),
  15507. this.on(d.CLOSED, i.hide.bind(i))
  15508. }
  15509. .bind(this)).catch(function(t) {
  15510. y.warn("Failed to embed:", e.src),
  15511. y.warn("with error:", t)
  15512. }).then(this.onMediaLoadFinished.bind(this))
  15513. }
  15514. .bind(this)),
  15515. n
  15516. }
  15517. ,
  15518. n.prototype.open = function(e) {
  15519. return this.openPromise = $.Deferred(),
  15520. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  15521. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  15522. this.state !== I.OPEN && (this.emit(d.OPENING),
  15523. e && this.emit(d.ACTIVATING),
  15524. this.state = I.OPENING,
  15525. this.animateOpen(function() {
  15526. e && this.setActiveState(),
  15527. this.openPromise.resolve()
  15528. }
  15529. .bind(this)))
  15530. }
  15531. .bind(this), m.animation.openDelay),
  15532. c.cancel(this.closeTransition),
  15533. this.closePromise && this.closePromise.reject(),
  15534. this.closeTransition = void 0,
  15535. this.openPromise.promise())
  15536. }
  15537. ,
  15538. n.prototype.close = function(e) {
  15539. return this.closePromise = $.Deferred(),
  15540. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  15541. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  15542. this.state = I.CLOSING,
  15543. this.animateClose())
  15544. }
  15545. .bind(this), m.animation.closeDelay)),
  15546. c.cancel(this.openTransition),
  15547. this.openPromise && this.openPromise.reject(),
  15548. this.openTransition = void 0,
  15549. this.closePromise.resolve(),
  15550. this.closePromise.promise())
  15551. }
  15552. ,
  15553. n.prototype.setActiveState = function() {
  15554. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  15555. this.emit(d.ACTIVATE),
  15556. this.div.classList.remove("has-hotzone"))
  15557. }
  15558. ,
  15559. n.prototype.animateOpen = function(e) {
  15560. if (this.state === I.OPENING) {
  15561. if (c.cancel(this.animationTransition),
  15562. u.detectSamsungNative())
  15563. return this.boardOrientation = null,
  15564. this.div.style.visibility = "visible",
  15565. this.emit(d.OPENED),
  15566. this.state = I.OPEN,
  15567. void (e && e());
  15568. this.div.style.webkitTransform = "scale(0)",
  15569. this.div.style.transform = "scale(0)",
  15570. this.div.style.visibility = "visible",
  15571. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  15572. this.emit(d.OPENED),
  15573. this.state = I.OPEN,
  15574. e && e()
  15575. }
  15576. .bind(this))
  15577. }
  15578. }
  15579. ,
  15580. n.prototype.animateClose = function(e) {
  15581. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15582. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15583. this.emit(d.CLOSED),
  15584. this.state = I.CLOSED,
  15585. this.div.style.visibility = "hidden",
  15586. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15587. e && e()
  15588. }
  15589. .bind(this)))
  15590. }
  15591. ,
  15592. n.prototype.needsUpdate = function() {
  15593. return this.state !== I.CLOSED
  15594. }
  15595. ,
  15596. n.prototype.update = function(e, t) {
  15597. if (this.needsUpdate()) {
  15598. var i = (this.updateOrientation(e),
  15599. this.calcScale(t))
  15600. , n = {
  15601. x: (e.x + 1) * $("#player").width() / 2,
  15602. y: (e.y + 1) * $("#player").height() / 2
  15603. };
  15604. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15605. this.div.style.webkitTransform = this.div.screenTransform,
  15606. this.div.style.transform = this.div.screenTransform
  15607. }
  15608. }
  15609. ,
  15610. n.prototype.getDimensions = function() {
  15611. return this.div.getBoundingClientRect()
  15612. }
  15613. ,
  15614. n.prototype.calcScale = function(e) {
  15615. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15616. }
  15617. ,
  15618. n.prototype.updateOrientation = function(e) {
  15619. if (this.state !== I.ACTIVE) {
  15620. var t = 1 / 3
  15621. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15622. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15623. , r = "";
  15624. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15625. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15626. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15627. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15628. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15629. }
  15630. }
  15631. ,
  15632. n.prototype.applyOrientation = function(e) {
  15633. this.div.style.transform = this.div.style.webkitTransform = "",
  15634. this.div.classList.remove("tag-container-" + this.orientation),
  15635. this.div.classList.add("tag-container-" + e);
  15636. var t = window.getComputedStyle(this.div);
  15637. this.initialTransform = t.transform || t.webkitTransform,
  15638. "none" === this.initialTransform && (this.initialTransform = "");
  15639. var i = t.transform.slice(7, -1).split(",")
  15640. , n = -i[4]
  15641. , r = -i[5];
  15642. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15643. this.div.style.transformOrigin = n + "px " + r + "px",
  15644. this.orientation = e
  15645. }
  15646. ,
  15647. t.exports = n
  15648. }
  15649. ).call(this, "/js/tag/Billboard/Billboard.js")
  15650. }
  15651. , {
  15652. "../../util/browser": 182,
  15653. "../../util/lerp": 188,
  15654. "../../util/logger": 189,
  15655. "../../util/transitions": 195,
  15656. "../Media/EmbedlyEmbed": 125,
  15657. "../Media/EmbedlyPlayer": 126,
  15658. "../Media/Image": 128,
  15659. "../Media/Link": 129,
  15660. "../Media/MediaEvent": 131,
  15661. "../Parser/DescriptionChunkType": 133,
  15662. "../Parser/DescriptionParser": 134,
  15663. "./BillboardEvent": 120,
  15664. "./billboardSettings": 121,
  15665. "./overlaySettings": 122,
  15666. events: 202
  15667. }],
  15668. 120: [function(e, t, i) {
  15669. "use strict";
  15670. t.exports = Object.freeze({
  15671. ENTER: "billboard.enter",
  15672. LEAVE: "billboard.leave",
  15673. OPENING: "billboard.opening",
  15674. OPENED: "billboard.open",
  15675. CLOSING: "billboard.closing",
  15676. CLOSED: "billboard.closed",
  15677. ACTIVATING: "billboard.activating",
  15678. ACTIVATE: "billboard.activate"
  15679. })
  15680. }
  15681. , {}],
  15682. 121: [function(e, t, i) {
  15683. "use strict";
  15684. t.exports = Object.freeze({
  15685. animation: Object.freeze({
  15686. hoverOnClosing: !1,
  15687. openDelay: 100,
  15688. closeDelay: 50,
  15689. openDuration: 200,
  15690. closeDuration: 100
  15691. }),
  15692. boardToDiscRatio: 1.2
  15693. })
  15694. }
  15695. , {}],
  15696. 122: [function(e, t, i) {
  15697. "use strict";
  15698. t.exports = Object.freeze({
  15699. boundaryWidth: 30,
  15700. boundaryHeight: 0
  15701. })
  15702. }
  15703. , {}],
  15704. 123: [function(e, t, i) {//tag
  15705. (function(i) {
  15706. "use strict";
  15707. function n(e, t, i) {
  15708. var n = i.version || "0";
  15709. "0" !== n && I.info("tag defined using version " + n),
  15710. this.model = e,
  15711. this.sid = t,
  15712. this.color = (new r.Color).set(i.color || l.tagDefault),
  15713. this.hoverColor = l._darken(this.color, .2),
  15714. this.floor = null,
  15715. this.floorIndex = i.floor,
  15716. this.mode = s.PANORAMA,
  15717. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15718. this.obj3d = null,
  15719. this.disc = null,
  15720. this.materials = {
  15721. disc: null,
  15722. pole: null
  15723. },
  15724. this.position = (new r.Vector3).copy(i.position),
  15725. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15726. this.discWorldPosition = null,
  15727. this.discScale = .05,
  15728. this.poleEnabled = i.stem.enabled,
  15729. this.billboard = new o(i.label,i.description,i.media,this),
  15730. this.visibleTransition = null,
  15731. this.hoveringDisc = !1
  15732. }
  15733. var r = e("three")
  15734. , o = e("./Billboard/Billboard")
  15735. , a = e("../settings")
  15736. , s = e("../enum/Viewmode")
  15737. , l = e("../enum/Colors")
  15738. , c = e("../enum/RenderLayers")
  15739. , h = e("../enum/RenderOrder")
  15740. , u = (e("../util/common"),
  15741. e("../util/math"))
  15742. , d = e("../util/texture")
  15743. , p = e("../objects/Panorama")
  15744. , f = e("../shaders")
  15745. , g = e("../util/transitions")
  15746. , m = e("../util/lerp")
  15747. , v = e("../util/easing")
  15748. , A = e("./Billboard/BillboardEvent")
  15749. , y = e("events").EventEmitter
  15750. , C = e("../util/logger")
  15751. , I = new C(i)
  15752. , 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==")
  15753. , 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")
  15754. , w = new r.PlaneBufferGeometry(1,1);
  15755. n.prototype = Object.create(y.prototype),
  15756. n.raycaster = new r.Raycaster,
  15757. n.prototype.bindEvents = function() {
  15758. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15759. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15760. }
  15761. ,
  15762. n.prototype.build = function() {
  15763. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15764. this.floor && (this.billboard.build(this.model.sid),
  15765. this.obj3d = this.buildObject3D(),
  15766. this.floor.add(this.obj3d)),
  15767. this
  15768. }
  15769. ,
  15770. n.prototype.buildObject3D = function() {
  15771. var e = new r.Object3D;
  15772. e.position.copy(this.position);
  15773. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15774. t.bg.value = b,
  15775. t.mask.value = E,
  15776. t.color.value.copy(this.color),
  15777. this.materials.disc = new r.RawShaderMaterial({
  15778. transparent: !0,
  15779. vertexShader: f.tagDisc.vertexShader,
  15780. fragmentShader: f.tagDisc.fragmentShader,
  15781. uniforms: t
  15782. }),
  15783. this.disc = new r.Mesh(w,this.materials.disc),
  15784. this.disc.layers.set(c.TAG),
  15785. this.disc.position.copy(this.discPosition),
  15786. this.disc.renderOrder = h.tagDisc,
  15787. this.disc.tag = this;
  15788. var i = this.buildPole();
  15789. return i.layers.set(c.TAG),
  15790. i.renderOrder = h.tagStem,
  15791. e.add(i),
  15792. e.layers.set(c.TAG),
  15793. e.add(this.disc)
  15794. }
  15795. ,
  15796. n.prototype.buildPole = function() {
  15797. var e = new r.BufferGeometry
  15798. , t = new Float32Array(6);
  15799. return t[0] = t[1] = t[2] = 0,
  15800. t[3] = this.discPosition.x,
  15801. t[4] = this.discPosition.y,
  15802. t[5] = this.discPosition.z,
  15803. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15804. this.materials.pole = new r.LineBasicMaterial({
  15805. linewidth: a.tags.pole.width,
  15806. color: a.tags.pole.color,
  15807. opacity: 0,
  15808. visible: this.poleEnabled,
  15809. transparent: !0,
  15810. depthWrite: !1
  15811. }),
  15812. new r.Line(e,this.materials.pole)
  15813. }
  15814. ,
  15815. n.prototype.setFreeState = function(e) {
  15816. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15817. this.materials.disc.uniforms.color.value = this.color
  15818. }
  15819. .bind(this))
  15820. }
  15821. ,
  15822. n.prototype.setHoverState = function(e) {
  15823. this.billboard.open(e),
  15824. this.materials.disc.uniforms.color.value = this.hoverColor
  15825. }
  15826. ,
  15827. n.prototype.hide = function(e, t) {
  15828. var i = $.Deferred();
  15829. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15830. return i.resolve().promise();
  15831. e = e || 0,
  15832. t = t || 0,
  15833. g.cancel(this.visibleTransition);
  15834. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15835. , r = t + e
  15836. , o = t / r;
  15837. return this.visibleTransition = g.start(function(e) {
  15838. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15839. , i = m.property(e.materials.pole, "opacity", 0);
  15840. return function(n) {
  15841. t(n),
  15842. e.materials.pole && i(n)
  15843. }
  15844. }(this), r * n, function() {
  15845. i.resolve()
  15846. }, o, v[a.warp.blendEasing]),
  15847. i.promise()
  15848. }
  15849. ,
  15850. n.prototype.show = function(e, t) {
  15851. var i = $.Deferred();
  15852. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15853. return i.resolve().promise();
  15854. e = e || 0,
  15855. t = t || 0,
  15856. g.cancel(this.visibleTransition);
  15857. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15858. , r = t + e
  15859. , o = t / r;
  15860. return this.visibleTransition = g.start(function(e) {
  15861. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15862. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15863. return function(n) {
  15864. t(n),
  15865. e.materials.pole && i(n)
  15866. }
  15867. }(this), r * n, function() {
  15868. i.resolve()
  15869. }, o, v[a.warp.blendEasing]),
  15870. i.promise()
  15871. }
  15872. ,
  15873. n.prototype.closestPanoTowardTag = function(e, t) {
  15874. var i = []
  15875. , o = []
  15876. , l = this.disc.getWorldPosition();
  15877. if (e === s.PANORAMA) {
  15878. var c = .5
  15879. , h = t.position.clone().sub(l).normalize();
  15880. i.push(p.filters.isPanoAligned()),
  15881. i.push(p.filters.isNeighbourPanoTo(t)),
  15882. i.push(p.filters.inPanoDirection(l, h, c)),
  15883. o.push(p.scoreFunctions.direction(l, h))
  15884. }
  15885. var u = new r.Vector3
  15886. , d = function(e) {
  15887. u.copy(l).sub(e.position);
  15888. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15889. , i = a.tags.navigate.tiltTolerance;
  15890. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15891. }
  15892. , f = function(e) {
  15893. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15894. };
  15895. i.push(f, d),
  15896. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15897. var g = this.model.panos.sortByScore(i, o);
  15898. if (a.tags.navigate.lineOfSight) {
  15899. for (var m = 0; m < g.length; m++) {
  15900. var v = g[m].item
  15901. , A = v.position.distanceTo(l);
  15902. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15903. return null;
  15904. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15905. var y = n.raycaster.intersectObjects(this.model.colliders);
  15906. if (0 === y.length || y[0].distance > A)
  15907. return v
  15908. }
  15909. return null
  15910. }
  15911. return g.length > 0 && g[0].item
  15912. }
  15913. ,
  15914. n.prototype.examine = function(e) {
  15915. var t = e.mode
  15916. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15917. , n = this.disc.getWorldPosition();
  15918. this.billboard.setActiveState();
  15919. var o = function() {
  15920. var t = this.billboard.getDimensions()
  15921. , n = new r.Vector3;
  15922. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15923. n.unproject(e.camera),
  15924. e.flyToPano({
  15925. pano: i,
  15926. lookAtPoint: n
  15927. })
  15928. }
  15929. .bind(this);
  15930. if (t === s.PANORAMA)
  15931. if (i !== e.currentPano) {
  15932. var l = {
  15933. pano: i,
  15934. lookAtPoint: n,
  15935. duration: null,
  15936. maxDistanceOverride: null,
  15937. skipWarpingCheck: !1
  15938. };
  15939. e.flyToPano(l, o)
  15940. } else
  15941. setTimeout(function() {
  15942. this.billboard.open().then(function() {
  15943. o()
  15944. })
  15945. }
  15946. .bind(this), 0);
  15947. else {
  15948. var c = {
  15949. pano: i
  15950. };
  15951. if (n) {
  15952. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15953. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15954. }
  15955. c.callback = o,
  15956. c.duration = 1500,
  15957. c.mode = s.PANORAMA,
  15958. e.flyToNewMode(c)
  15959. }
  15960. }
  15961. ,
  15962. n.prototype.update = function(e, t) {
  15963. var i = new r.Vector3;
  15964. return function(e, t) {
  15965. this.discWorldPosition = this.disc.getWorldPosition(),
  15966. this.updateDisc(e, t),
  15967. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15968. i.z < 1 && (i.y *= -1,
  15969. this.billboard.update(i, this.getDiscRadius(i, t))))
  15970. }
  15971. }(),
  15972. n.prototype.updateDisc = function(e, t) {
  15973. var i = new r.Vector3
  15974. , o = new r.Vector3
  15975. , l = new r.Vector3
  15976. , c = new r.Vector3
  15977. , h = new r.Vector3;
  15978. return function(e, t) {
  15979. var u = a.tags.visibility
  15980. , d = a.tags.disc.scale
  15981. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15982. 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)),
  15983. this.obj3d.visible) {
  15984. this.disc.quaternion.copy(t.quaternion);
  15985. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15986. i.copy(this.discWorldPosition).project(t),
  15987. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15988. l.set(f / 2, 0, 0).add(o),
  15989. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15990. h.copy(c).unproject(t);
  15991. var g = h.distanceTo(this.discWorldPosition)
  15992. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15993. this.discScale = g * m,
  15994. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15995. }
  15996. }
  15997. }(),
  15998. n.prototype.getDiscRadius = function(e, t) {
  15999. var i = new r.Vector3;
  16000. return function(e, t) {
  16001. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  16002. Math.abs(e.x - i.x) * $("#player").width()
  16003. }
  16004. }(),
  16005. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  16006. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  16007. }
  16008. ,
  16009. n.prototype.offScreen = function(e, t) {
  16010. var i = e.getWorldPosition().project(t);
  16011. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  16012. }
  16013. ,
  16014. n.viewportScale = function() {
  16015. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  16016. n.viewportHeight = $("#player").height(),
  16017. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  16018. n.currentViewportScale
  16019. }
  16020. ,
  16021. t.exports = n
  16022. }
  16023. ).call(this, "/js/tag/tag.js")
  16024. }
  16025. , {
  16026. "../enum/Colors": 19,
  16027. "../enum/RenderLayers": 41,
  16028. "../enum/RenderOrder": 42,
  16029. "../enum/Viewmode": 51,
  16030. "../objects/Panorama": 148,
  16031. "../settings": 166,
  16032. "../shaders": 167,
  16033. "../util/common": 185,
  16034. "../util/easing": 186,
  16035. "../util/lerp": 188,
  16036. "../util/logger": 189,
  16037. "../util/math": 190,
  16038. "../util/texture": 194,
  16039. "../util/transitions": 195,
  16040. "./Billboard/Billboard": 119,
  16041. "./Billboard/BillboardEvent": 120,
  16042. events: 202,
  16043. three: 217
  16044. }],
  16045. 124: [function(e, t, i) {
  16046. (function(i) {
  16047. "use strict";
  16048. function n() {
  16049. this.tagState = y.IDLE,
  16050. this.intersectTag = null,
  16051. this.hoveredTag = null,
  16052. this.activeTag = null,
  16053. this.tagDiscs = [],
  16054. this.raycaster = new r.Raycaster,
  16055. this.modelManager = null,
  16056. this.player = null,
  16057. this.totaltags = 0,
  16058. this.navigatingViaTag = !1,
  16059. this.enabled = !1
  16060. }
  16061. var r = e("three")
  16062. , o = e("../util/logger")
  16063. , a = e("../util/common")
  16064. , s = e("../controls/serializer")
  16065. , l = e("../objects/Snapshot")
  16066. , c = e("../settings")
  16067. , h = e("./Billboard/BillboardEvent")
  16068. , u = e("./Media/MediaEvent")
  16069. , d = e("./Media/LinkType")
  16070. , p = e("../enum/Viewmode")
  16071. , f = e("../enum/WarpStyle")
  16072. , g = e("../enum/BlackoutStyle")
  16073. , m = e("../enum/ModelManagerEvents")
  16074. , v = e("../enum/tagEvents")
  16075. , A = e("../enum/PlayerEvents")
  16076. , y = (e("../util/lerp"),
  16077. e("../enum/TagStates"))
  16078. , C = e("events").EventEmitter
  16079. , I = new o(i);
  16080. a.extend(n, C),
  16081. n.prototype.init = function(e, t) {
  16082. this.modelManager = e,
  16083. this.player = t,
  16084. this.updateModel(),
  16085. this.bindEvents()
  16086. }
  16087. ,
  16088. n.prototype.update = function(e) {
  16089. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16090. }
  16091. ,
  16092. n.prototype.updateTags = function(e, t, i, n) {
  16093. for (var r in this.model.tags)
  16094. this.model.tags[r].update(e, t, i, n)
  16095. }
  16096. ,
  16097. n.prototype.updateModel = function() {
  16098. this.model = this.modelManager.getActiveModel(),
  16099. this.gettagsFromModel(),
  16100. this.totaltags = Object.keys(this.model.tags).length
  16101. }
  16102. ,
  16103. n.prototype.gettagsFromModel = function() {
  16104. this.tagDiscs = [];
  16105. for (var e in this.model.tags) {
  16106. var t = this.model.tags[e].disc;
  16107. t && this.tagDiscs.push(t)
  16108. }
  16109. }
  16110. ,
  16111. n.prototype.bindEvents = function() {
  16112. function e() {
  16113. Object.keys(this.model.tags).forEach(function(e) {
  16114. var t = this.model.tags[e];
  16115. t.bindEvents(),
  16116. t.billboard.on(u.LINK_CLICK, function(e) {
  16117. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16118. }
  16119. .bind(this)),
  16120. t.billboard.on(u.IMAGE_OPENED, function() {
  16121. this.tagState = y.EXAMINE,
  16122. this.emit(u.IMAGE_OPENED)
  16123. }
  16124. .bind(this)),
  16125. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16126. }
  16127. .bind(this))
  16128. }
  16129. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16130. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16131. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16132. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16133. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16134. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16135. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16136. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16137. e.call(this)
  16138. }
  16139. ,
  16140. n.prototype.navigateViaLink = function(e) {
  16141. var t = s.deserialize(e);
  16142. if (t)
  16143. if (t.mode === p.PANORAMA) {
  16144. try {
  16145. this.player.model.panos.get(t.panoId)
  16146. } catch (e) {
  16147. return void I.warn("Unable to find panorama location", t.panoId)
  16148. }
  16149. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16150. } else {
  16151. var i = {
  16152. cameraMode: t.mode,
  16153. position: t.position,
  16154. quaternion: t.quaternion,
  16155. scanId: t.panoId,
  16156. orthoZoom: t.zoom,
  16157. floorVisibility: t.floorVisibility,
  16158. thumbUrl: null,
  16159. name: null
  16160. };
  16161. this.player.flyToNewMode({
  16162. mode: t.mode,
  16163. duration: c.warp.outsideTime,
  16164. warpDest: new l(i),
  16165. force: !0
  16166. })
  16167. }
  16168. }
  16169. ,
  16170. n.prototype.handleWarpStart = function(e, t, i, n) {
  16171. this.dismissExaminedTag(),
  16172. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  16173. e && (i = g.END),
  16174. this.hideShowTagsForBlackoutStyle(i, n))
  16175. }
  16176. ,
  16177. n.prototype.handleWarpInterruption = function(e, t, i) {
  16178. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  16179. this.hideShowTagsForBlackoutStyle(t, i)
  16180. }
  16181. ,
  16182. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  16183. var i = 0
  16184. , n = 0
  16185. , r = t / 2;
  16186. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  16187. e) {
  16188. case g.END:
  16189. this.hideAlltags(r);
  16190. break;
  16191. case g.BEGINNING:
  16192. this.hideAlltags().done(this.showAlltags.bind(this, r));
  16193. break;
  16194. case g.NONE:
  16195. break;
  16196. case g.MIDDLE:
  16197. i = r,
  16198. n = r,
  16199. this.hideAlltags(n),
  16200. setTimeout(function() {
  16201. this.showAlltags(i)
  16202. }
  16203. .bind(this), n);
  16204. break;
  16205. case g.FADEIN:
  16206. setTimeout(function() {
  16207. this.showAlltags(r)
  16208. }
  16209. .bind(this), r)
  16210. }
  16211. }
  16212. ,
  16213. n.prototype.onPlayerModeChanging = function(e, t) {
  16214. t !== p.PANORAMA && this.dismissExaminedTag(),
  16215. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  16216. var i = t !== p.OUTDOOR;
  16217. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16218. }
  16219. ,
  16220. n.prototype.onPanoChange = function(e, t) {
  16221. var i = this.navigatingViaTag;
  16222. if (this.navigatingViaTag = !1,
  16223. !i) {
  16224. this.dismissExaminedTag();
  16225. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  16226. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  16227. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16228. }
  16229. }
  16230. ,
  16231. n.prototype.onPlayerReady = function(e, t, i) {
  16232. this.startAlltags(e, t ? i : null)
  16233. }
  16234. ,
  16235. n.prototype.onPlayerFlyingEnded = function(e, t) {
  16236. this.updateClosestTags(e)
  16237. }
  16238. ,
  16239. n.prototype.dismissExaminedTag = function() {
  16240. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  16241. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  16242. this.hoveredTag = null)
  16243. }
  16244. ,
  16245. n.prototype.startAlltags = function(e, t) {
  16246. this.model.shouldShowtags = c.tags.enabled,
  16247. this.enabled = !0,
  16248. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16249. t && setTimeout(function() {
  16250. this.activateTag(this.model.getTagBySid(t))
  16251. }
  16252. .bind(this), c.tags.startup.fadeInDuration / 2))
  16253. }
  16254. ,
  16255. n.prototype.showAlltags = function(e, t, i) {
  16256. function n() {
  16257. o++,
  16258. o === this.totaltags && (this.model.tagsShown = !0,
  16259. r.resolve())
  16260. }
  16261. var r = $.Deferred();
  16262. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  16263. return r.resolve().promise();
  16264. var o = 0;
  16265. for (var a in this.model.tags) {
  16266. var s = this.model.tags[a];
  16267. s.show(e, t).done(n.bind(this))
  16268. }
  16269. return r.promise()
  16270. }
  16271. ,
  16272. n.prototype.hideAlltags = function(e, t) {
  16273. function i() {
  16274. r++,
  16275. r === this.totaltags && (this.model.tagsShown = !1,
  16276. n.resolve())
  16277. }
  16278. var n = $.Deferred()
  16279. , r = 0;
  16280. for (var o in this.model.tags) {
  16281. var a = this.model.tags[o];
  16282. a.hide(e, t).done(i.bind(this)),
  16283. a === this.activeTag && this.dismissActiveTag()
  16284. }
  16285. return n.promise()
  16286. }
  16287. ,
  16288. n.prototype.enableHovering = function() {
  16289. this.enabled = !0
  16290. }
  16291. ,
  16292. n.prototype.disableHovering = function() {
  16293. this.enabled = !1
  16294. }
  16295. ,
  16296. n.prototype.activateTag = function(e, t) {
  16297. t = t || y.EXAMINE,
  16298. this.activeTag = e,
  16299. this.activeTag.hoveringDisc = !0,
  16300. this.activeTag.setHoverState(t === y.EXAMINE),
  16301. this.tagState = t,
  16302. this.emit(v.TagActivated, e)
  16303. }
  16304. ,
  16305. n.prototype.dismissActiveTag = function() {
  16306. this.activeTag.hoveringDisc = !1,
  16307. this.activeTag.setFreeState(!0);
  16308. var e = this.activeTag;
  16309. this.activeTag = null,
  16310. this.tagState = y.IDLE,
  16311. this.emit(v.TagDismissed, e)
  16312. }
  16313. ,
  16314. n.prototype.clickedOnTag = function(e) {
  16315. var t = function() {
  16316. this.navigatingViaTag = !0,
  16317. this.activeTag.examine(this.player),
  16318. this.emit(v.TagNavigation, this.activeTag)
  16319. }
  16320. .bind(this);
  16321. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  16322. this.activeTag = this.intersectTag,
  16323. t(),
  16324. !0) : (this.dismissActiveTag(),
  16325. !1)
  16326. }
  16327. ,
  16328. n.prototype.intersecttag = function() {
  16329. var e = new r.Vector3
  16330. , t = new r.Vector3
  16331. , i = new r.Vector3;
  16332. return function(n, r, o) {
  16333. if (!this.enabled)
  16334. return null;
  16335. var a = null
  16336. , s = this.tagDiscs.filter(function(e) {
  16337. return e.parent.visible
  16338. });
  16339. if (s.length > 0) {
  16340. var l = this.model.floors.reduce(function(e, t) {
  16341. return t.hidden ? e : e.concat(t.collider.children)
  16342. }, s);
  16343. e.set(n.x, n.y, -1).unproject(o),
  16344. t.set(n.x, n.y, 1).unproject(o),
  16345. i.copy(t).sub(e).normalize(),
  16346. this.raycaster.set(e, i);
  16347. var c = this.raycaster.intersectObjects(l);
  16348. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16349. }
  16350. return this.intersectTag = a,
  16351. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  16352. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  16353. this.hoveredTag = a
  16354. }
  16355. .bind(this)),
  16356. a.billboard.on(h.LEAVE, function() {
  16357. this.hoveredTag = null
  16358. }
  16359. .bind(this))),
  16360. this.activateTag(a, y.BROWSE))),
  16361. a
  16362. }
  16363. }(),
  16364. n.prototype.rankedtagInDirection = function() {
  16365. var e = []
  16366. , t = []
  16367. , i = new r.Vector3
  16368. , n = new r.Vector3
  16369. , o = new r.Vector3;
  16370. return function(r, a, s, l) {
  16371. var c = 0;
  16372. t.length = 0;
  16373. for (var h = 0; h < this.closesttags.length; h++) {
  16374. var u = this.closesttags[h];
  16375. n.copy(u.position),
  16376. n.add(u.discPosition),
  16377. i.copy(a),
  16378. i.sub(n).negate(),
  16379. i.normalize();
  16380. var d = i.dot(l);
  16381. if (d >= 0) {
  16382. o.copy(n),
  16383. o.project(s);
  16384. var p = this.intersecttag(o, !1, s);
  16385. if (p) {
  16386. if (c >= e.length)
  16387. for (var f = 0; f < 64; f++)
  16388. e.push({
  16389. tag: u,
  16390. dot: d
  16391. });
  16392. var g = e[c];
  16393. g.tag = u,
  16394. g.dot = d,
  16395. g.position = math.projectPositionToCanvas(n, s),
  16396. t.push(g),
  16397. c++
  16398. }
  16399. }
  16400. }
  16401. return t.sort(function(e, t) {
  16402. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16403. }),
  16404. r < t.length ? t[r].tag : null
  16405. }
  16406. }(),
  16407. n.prototype.updateClosestTags = function() {
  16408. var e = new r.Vector3
  16409. , t = 30;
  16410. return function(i) {
  16411. this.closesttags || (this.closesttags = []),
  16412. this.closesttags.length = 0;
  16413. var n = this.model.tags;
  16414. if (n)
  16415. for (var r in n)
  16416. if (n.hasOwnProperty(r)) {
  16417. var o = n[r]
  16418. , a = o.position;
  16419. e.copy(i),
  16420. e.sub(a).negate();
  16421. var s = e.lengthSq();
  16422. s < t && this.closesttags.push(o)
  16423. }
  16424. }
  16425. }(),
  16426. t.exports = n
  16427. }
  16428. ).call(this, "/js/tag/tagManager.js")
  16429. }
  16430. , {
  16431. "../controls/serializer": 14,
  16432. "../enum/BlackoutStyle": 18,
  16433. "../enum/tagEvents": 32,
  16434. "../enum/ModelManagerEvents": 33,
  16435. "../enum/PlayerEvents": 40,
  16436. "../enum/TagStates": 44,
  16437. "../enum/Viewmode": 51,
  16438. "../enum/WarpStyle": 52,
  16439. "../objects/Snapshot": 153,
  16440. "../settings": 166,
  16441. "../util/common": 185,
  16442. "../util/lerp": 188,
  16443. "../util/logger": 189,
  16444. "./Billboard/BillboardEvent": 120,
  16445. "./Media/LinkType": 130,
  16446. "./Media/MediaEvent": 131,
  16447. events: 202,
  16448. three: 217
  16449. }],
  16450. 125: [function(e, t, i) {
  16451. (function(i) {
  16452. "use strict";
  16453. function n() {
  16454. this.embedWrapper = null,
  16455. this.embedElement = null
  16456. }
  16457. var r = e("../../util/ajax")
  16458. , o = e("./mediaSettings")
  16459. , a = e("../../settings")
  16460. , s = e("../../util/logger")
  16461. , l = new s(i);
  16462. n.prototype.createDomElement = function() {
  16463. return this.embedWrapper = document.createElement("div"),
  16464. this.embedWrapper.classList.add("tag-embed"),
  16465. this.embedWrapper.classList.add("hidden"),
  16466. this.embedWrapper
  16467. }
  16468. ,
  16469. n.prototype.load = function(e) {
  16470. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16471. return new Promise(function(e, i) {
  16472. r.get(t).then(function(t) {
  16473. if (t = JSON.parse(t),
  16474. t.html && t.html.indexOf("<script") === -1) {
  16475. this.embedWrapper.innerHTML = t.html;
  16476. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16477. if (this.embedWrapper.style.width = n + "px",
  16478. t.height) {
  16479. var r = t.height / t.width;
  16480. this.embedWrapper.style.height = n * r + "px"
  16481. }
  16482. this.embedElement = this.embedWrapper.firstChild;
  16483. var a = [];
  16484. try {
  16485. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16486. } catch (e) {
  16487. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16488. }
  16489. a.forEach(function(e) {
  16490. e.setAttribute("target", "_blank")
  16491. }),
  16492. this.embedElement.classList.add("hidden"),
  16493. this.embedWrapper.classList.remove("hidden"),
  16494. e()
  16495. } else
  16496. i("Not a valid embed")
  16497. }
  16498. .bind(this), function(e) {
  16499. i(e.response)
  16500. })
  16501. }
  16502. .bind(this))
  16503. }
  16504. ,
  16505. n.prototype.show = function() {
  16506. this.embedElement && this.embedElement.classList.remove("hidden")
  16507. }
  16508. ,
  16509. n.prototype.hide = function() {
  16510. this.embedElement && this.embedElement.classList.add("hidden")
  16511. }
  16512. ,
  16513. t.exports = n
  16514. }
  16515. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16516. }
  16517. , {
  16518. "../../settings": 166,
  16519. "../../util/ajax": 181,
  16520. "../../util/logger": 189,
  16521. "./mediaSettings": 132
  16522. }],
  16523. 126: [function(e, t, i) {
  16524. (function(i) {
  16525. "use strict";
  16526. function n(e) {
  16527. o.call(this),
  16528. this.options = e,
  16529. this.playerControls = null,
  16530. this.state = s.NOT_READY
  16531. }
  16532. var r = e("../../util/browser")
  16533. , o = e("./EmbedlyEmbed")
  16534. , a = e("../../util/logger")
  16535. , s = (new a(i),
  16536. Object.freeze({
  16537. NOT_READY: "player.not.ready",
  16538. CUED: "player.cued",
  16539. PLAYING: "player.playing",
  16540. PAUSED: "player.paused"
  16541. }));
  16542. n.prototype = Object.create(o.prototype),
  16543. n.prototype.createDomElement = function() {
  16544. return this.embedWrapper = document.createElement("div"),
  16545. this.embedWrapper.classList.add("tag-video"),
  16546. this.embedWrapper.classList.add("hidden"),
  16547. this.embedWrapper
  16548. }
  16549. ,
  16550. n.prototype.load = function(e) {
  16551. var t = function() {
  16552. function e(e) {
  16553. this.playerState = s.CUED,
  16554. this.options.startMuted && this.playerControls.mute()
  16555. }
  16556. function t(e) {
  16557. this.playerState = e
  16558. }
  16559. function i(e) {
  16560. this.playerControls.setCurrentTime(0),
  16561. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16562. }
  16563. this.playerControls = new playerjs.Player(this.embedElement),
  16564. this.playerControls.on("ready", e.bind(this)),
  16565. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16566. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16567. this.playerControls.on("ended", i.bind(this))
  16568. }
  16569. .bind(this);
  16570. return o.prototype.load.call(this, e).then(t.bind(this))
  16571. }
  16572. ,
  16573. n.prototype.play = function() {
  16574. var e = r.isMobile();
  16575. return function() {
  16576. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16577. }
  16578. }(),
  16579. n.prototype.pause = function() {
  16580. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16581. }
  16582. ,
  16583. t.exports = n
  16584. }
  16585. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16586. }
  16587. , {
  16588. "../../util/browser": 182,
  16589. "../../util/logger": 189,
  16590. "./EmbedlyEmbed": 125
  16591. }],
  16592. 127: [function(e, t, i) {
  16593. (function(i) {
  16594. "use strict";
  16595. function n(e) {
  16596. function t() {
  16597. return a.debug("requesting file from embedly:", e.href),
  16598. r.get(e.href, {
  16599. responseType: e.responseType
  16600. }).then(function(t) {
  16601. return a.debug("requesting file finished:", e.href),
  16602. t
  16603. })
  16604. }
  16605. function i() {}
  16606. return s = new Promise(function(e, n) {
  16607. s.catch(i).then(function() {
  16608. t().then(e, n)
  16609. })
  16610. }
  16611. )
  16612. }
  16613. var r = e("../../util/ajax")
  16614. , o = (e("./mediaSettings"),
  16615. e("../../util/logger"))
  16616. , a = new o(i)
  16617. , s = Promise.resolve();
  16618. t.exports.enqueue = n
  16619. }
  16620. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16621. }
  16622. , {
  16623. "../../util/ajax": 181,
  16624. "../../util/logger": 189,
  16625. "./mediaSettings": 132
  16626. }],
  16627. 128: [function(e, t, i) {
  16628. (function(i) {
  16629. "use strict";
  16630. function n() {
  16631. this.imageWrapper = null,
  16632. this.width = 0,
  16633. this.height = 0,
  16634. this.aspect = 1
  16635. }
  16636. var r = e("./MediaEvent")
  16637. , o = e("./EmbedlyQueue")
  16638. , a = e("events").EventEmitter
  16639. , s = e("../../util/logger")
  16640. , l = e("../../settings");
  16641. new s(i);
  16642. n.prototype = Object.create(a.prototype),
  16643. n.prototype.createDomElement = function() {
  16644. return this.imageWrapper = document.createElement("div"),
  16645. this.imageWrapper.classList.add("tag-image"),
  16646. this.imageWrapper.classList.add("hidden"),
  16647. this.imageWrapper.addEventListener("click", function(e) {
  16648. e.stopPropagation(),
  16649. this.emit(r.IMAGE_OPENING),
  16650. this.imageWrapper.style.pointerEvents = "none"
  16651. }
  16652. .bind(this)),
  16653. this.imageWrapper
  16654. }
  16655. ,
  16656. n.prototype.onClosed = function() {
  16657. this.imageWrapper.style.pointerEvents = "auto"
  16658. }
  16659. ,
  16660. n.prototype.load = function(e) {
  16661. var t = Math.max(window.screen.height, window.screen.width)
  16662. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16663. return new Promise(function(e, t) {
  16664. function n(t) {
  16665. var i = t.target;
  16666. this.width = i.naturalWidth,
  16667. this.height = i.naturalHeight,
  16668. this.aspect = this.width / this.height;
  16669. var n = t.target.src;
  16670. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16671. this.imageWrapper.style.width = this.width + "px",
  16672. this.imageWrapper.style.height = this.height + "px",
  16673. this.imageWrapper.classList.remove("hidden"),
  16674. e()
  16675. }
  16676. o.enqueue({
  16677. href: i,
  16678. responseType: "arraybuffer"
  16679. }).then(function(e) {
  16680. var t = new Uint8Array(e)
  16681. , i = new Blob([t])
  16682. , r = new window.Image;
  16683. r.addEventListener("load", n.bind(this));
  16684. var o = URL.createObjectURL(i);
  16685. r.src = o
  16686. }
  16687. .bind(this), t)
  16688. }
  16689. .bind(this))
  16690. }
  16691. ,
  16692. t.exports = n
  16693. }
  16694. ).call(this, "/js/tag/Media/Image.js")
  16695. }
  16696. , {
  16697. "../../settings": 166,
  16698. "../../util/logger": 189,
  16699. "./EmbedlyQueue": 127,
  16700. "./MediaEvent": 131,
  16701. events: 202
  16702. }],
  16703. 129: [function(e, t, i) {
  16704. "use strict";
  16705. function n(e) {
  16706. this.label = e.label,
  16707. this.href = e.url,
  16708. this.type = this.updateLinkForType(),
  16709. this.domElement = null,
  16710. this.id = c++
  16711. }
  16712. var r = e("./LinkType")
  16713. , o = e("./MediaEvent")
  16714. , a = e("../../util/browser")
  16715. , s = e("../../analytics")
  16716. , l = e("events").EventEmitter
  16717. , c = 0;
  16718. n.prototype = Object.create(l.prototype),
  16719. n.prototype.updateLinkForType = function() {
  16720. function e(e) {
  16721. var t = new RegExp("[#&?]start=([^#&?]*)")
  16722. , i = t.exec(e);
  16723. return i[1]
  16724. }
  16725. function t(e) {
  16726. return e + "&play=1"
  16727. }
  16728. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16729. 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),
  16730. r.NAVIGATION) : (this.href = t(this.href),
  16731. r.MODEL) : r.EXT_LINK
  16732. }
  16733. ;
  16734. var h = {};
  16735. n.prototype.createDomElement = function() {
  16736. function e(e) {
  16737. switch (e.stopPropagation(),
  16738. h[this.id] = !0,
  16739. s.trackAlways("click_tag_link", {
  16740. link_type: this.type,
  16741. link_count: c,
  16742. links_clicked: Object.keys(h).length
  16743. }),
  16744. this.type) {
  16745. case r.MODEL:
  16746. window.location.replace(this.href);
  16747. break;
  16748. case r.EXT_LINK:
  16749. window.open(this.href, "_blank")
  16750. }
  16751. this.emit(o.LINK_CLICK, {
  16752. type: this.type,
  16753. url: this.href
  16754. })
  16755. }
  16756. if (this.domElement = document.createElement("a"),
  16757. this.domElement.classList.add("tag-link"),
  16758. this.domElement.textContent = this.label,
  16759. this.type === r.EXT_LINK) {
  16760. this.domElement.textContent += " ";
  16761. var t = document.createElement("i");
  16762. t.classList.add("icon-ext-link"),
  16763. t.title = "Link to external web site",
  16764. this.domElement.appendChild(t)
  16765. }
  16766. return this.domElement.addEventListener("click", e.bind(this)),
  16767. this.domElement
  16768. }
  16769. ,
  16770. t.exports = n
  16771. }
  16772. , {
  16773. "../../analytics": 4,
  16774. "../../util/browser": 182,
  16775. "./LinkType": 130,
  16776. "./MediaEvent": 131,
  16777. events: 202
  16778. }],
  16779. 130: [function(e, t, i) {
  16780. "use strict";
  16781. t.exports = {
  16782. NAVIGATION: "navigation",
  16783. MODEL: "model",
  16784. EXT_LINK: "ext-link"
  16785. }
  16786. }
  16787. , {}],
  16788. 131: [function(e, t, i) {
  16789. "use strict";
  16790. t.exports = Object.freeze({
  16791. LINK_CLICK: "mtmedia.link",
  16792. IMAGE_LOADED: "mtmedia.image.loaded",
  16793. IMAGE_OPENING: "mtmedia.image.opening",
  16794. IMAGE_OPENED: "mtmedia.image.opened",
  16795. IMAGE_CLOSING: "mtmedia.image.closing",
  16796. IMAGE_CLOSED: "mtmedia.image.closed",
  16797. VIDEO_START: "mtmedia.video.start",
  16798. VIDEO_PAUSE: "mtmedia.video.pause",
  16799. VIDEO_ENDED: "mtmedia.video.end"
  16800. })
  16801. }
  16802. , {}],
  16803. 132: [function(e, t, i) {
  16804. "use strict";
  16805. t.exports = Object.freeze({
  16806. maxEmbedWidth: 350,
  16807. defaultAspectRatio: .75
  16808. })
  16809. }
  16810. , {}],
  16811. 133: [function(e, t, i) {
  16812. "use strict";
  16813. t.exports = Object.freeze({
  16814. TEXT: "text",
  16815. LINK: "link",
  16816. IMAGE: "photo",
  16817. VIDEO: "video",
  16818. RICH: "rich"
  16819. })
  16820. }
  16821. , {}],
  16822. 134: [function(e, t, i) {
  16823. "use strict";
  16824. function n(e) {
  16825. this.capabilities = {
  16826. links: {
  16827. enable: e.supportLinks,
  16828. keepLabels: e.keepLinkLabels
  16829. }
  16830. }
  16831. }
  16832. var r = e("./DescriptionChunkType");
  16833. n.prototype.parse = function(e, t) {
  16834. var i = []
  16835. , n = e.split("[").map(function(e, t) {
  16836. return 0 === t ? e : "[" + e
  16837. });
  16838. return n.forEach(function(e) {
  16839. var n = this.findMarkdown(e);
  16840. if (n) {
  16841. if (n.url.indexOf("javascript:") !== -1)
  16842. return;
  16843. this.addLinkChunk(i, n, t),
  16844. this.addTextChunk(i, e.slice(n.markdown.length))
  16845. } else
  16846. this.addTextChunk(i, e)
  16847. }
  16848. .bind(this)),
  16849. i
  16850. }
  16851. ,
  16852. n.prototype.findMarkdown = function(e) {
  16853. var t = /\[([^\]]*)\]\((.*)\)/
  16854. , i = e.match(t);
  16855. if (i) {
  16856. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16857. 0 !== r); )
  16858. o++;
  16859. var a = n.length - o;
  16860. return {
  16861. markdown: i[0].substring(0, i[0].length - a),
  16862. label: i[1],
  16863. url: i[2].substring(0, o)
  16864. }
  16865. }
  16866. }
  16867. ,
  16868. n.prototype.addTextChunk = function(e, t) {
  16869. 0 !== t.length && e.push({
  16870. type: r.TEXT,
  16871. text: t
  16872. })
  16873. }
  16874. ,
  16875. n.prototype.addLinkChunk = function(e, t) {
  16876. if (!this.capabilities.links.enable)
  16877. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16878. var i = {
  16879. label: t.label,
  16880. url: t.url
  16881. };
  16882. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16883. e.push({
  16884. type: r.LINK,
  16885. link: i
  16886. })
  16887. }
  16888. ,
  16889. t.exports = n
  16890. }
  16891. , {
  16892. "./DescriptionChunkType": 133
  16893. }],
  16894. 135: [function(e, t, i) {
  16895. (function(i) {
  16896. "use strict";
  16897. var n = e("../util/logger")
  16898. , r = new n(i)
  16899. , o = {
  16900. parseIdsFromChunkName: function(e, t) {
  16901. t.floorId = o.parseFloor(e),
  16902. t.roomId = o.parseRoom(e)
  16903. },
  16904. parseFloor: function(e) {
  16905. var t = e.match(/_group([0-9]+)/);
  16906. if (!t)
  16907. return 0;
  16908. try {
  16909. return parseInt(t[1], 10)
  16910. } catch (e) {
  16911. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16912. 0
  16913. }
  16914. },
  16915. parseRoom: function(e) {
  16916. var t = e.match(/_sub([0-9]+)/);
  16917. if (!t)
  16918. return -1;
  16919. try {
  16920. return parseInt(t[1], 10)
  16921. } catch (e) {
  16922. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16923. 0
  16924. }
  16925. }
  16926. };
  16927. t.exports = o
  16928. }
  16929. ).call(this, "/js/model/Chunks.js")
  16930. }
  16931. , {
  16932. "../util/logger": 189
  16933. }],
  16934. 136: [function(e, t, i) {
  16935. (function(i) {
  16936. "use strict";
  16937. function n(e) {
  16938. s.call(this),
  16939. this.model = e,
  16940. this.exploded = !1
  16941. }
  16942. var r = e("../objects/Floor")
  16943. , o = (e("../settings"),
  16944. e("../util/logger"))
  16945. , a = e("../util/transitions")
  16946. , s = e("../util/IndexedCollection")
  16947. , l = e("../util/common")
  16948. , c = e("../util/easing");
  16949. new o(i);
  16950. l.inherit(n, s),
  16951. n.prototype.add = function(e) {
  16952. s.prototype.add.call(this, e),
  16953. this.model.add(e)
  16954. }
  16955. ,
  16956. n.prototype.getIndex = function(e) {
  16957. return e.floorIndex
  16958. }
  16959. ,
  16960. n.prototype.build = function() {
  16961. this.list.forEach(function(e) {
  16962. e.build()
  16963. })
  16964. }
  16965. ,
  16966. n.prototype.size = function() {
  16967. return this.length
  16968. }
  16969. ,
  16970. n.prototype.sort = function() {
  16971. s.prototype.sort.call(this, function(e, t) {
  16972. return e.floorIndex - t.floorIndex
  16973. })
  16974. }
  16975. ,
  16976. n.prototype.nextFloor = function(e, t) {
  16977. return this.index[e.floorIndex + t] || null
  16978. }
  16979. ,
  16980. n.prototype.getFloorAtPoint = function(e) {
  16981. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16982. var r = this.list[n]
  16983. , o = r.distanceToPoint(e);
  16984. (!t || i > o) && (i = o,
  16985. t = r)
  16986. }
  16987. return t
  16988. }
  16989. ,
  16990. n.prototype.getOrMakeFloor = function(e) {
  16991. var t = this.index[e];
  16992. return t || (t = new r(this.model,e),
  16993. this.add(t)),
  16994. t
  16995. }
  16996. ,
  16997. n.prototype.hide = function() {
  16998. this.list.forEach(function(e) {
  16999. e.hide()
  17000. })
  17001. }
  17002. ,
  17003. n.prototype.show = function() {
  17004. this.list.forEach(function(e) {
  17005. e.show()
  17006. })
  17007. }
  17008. ,
  17009. n.prototype.names = function() {
  17010. return this.list.reduce(function(e, t) {
  17011. return e.concat(t.name)
  17012. }, [])
  17013. }
  17014. ,
  17015. n.prototype.toggleExplodeHorizontal = function() {
  17016. function e(e, t) {
  17017. r.copy(e.position),
  17018. e.position.x = i[e.floorIndex] * t,
  17019. e.position.y = 1 * e.floorIndex * t,
  17020. r.sub(e.position).multiplyScalar(-1),
  17021. e.panos.forEach(function(e) {
  17022. e.translate(r)
  17023. })
  17024. }
  17025. var t, i = [], n = 0;
  17026. this.list.forEach(function(e, r, o) {
  17027. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  17028. n += t,
  17029. i[r] = n
  17030. }),
  17031. i = i.map(function(e) {
  17032. return e - n / 2
  17033. });
  17034. var r = this.list[0].position.clone();
  17035. this.exploded ? this.list.forEach(function(t) {
  17036. a.start(function(i) {
  17037. e(t, 1 - i)
  17038. }, 1500, null, 0, c.easeOutExpo)
  17039. }) : this.list.forEach(function(t) {
  17040. a.start(function(i) {
  17041. e(t, i)
  17042. }, 1500, null, 0, c.easeOutExpo)
  17043. }),
  17044. this.exploded = !this.exploded
  17045. }
  17046. ,
  17047. n.prototype.toggleExplodeVertical = function() {
  17048. function e(e, i) {
  17049. var n = n.copy(e.position);
  17050. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  17051. n.sub(e.position).multiplyScalar(-1),
  17052. e.panos.forEach(function(e) {
  17053. e.translate(n)
  17054. })
  17055. }
  17056. var t = this.model.size;
  17057. this.list[0].position.clone();
  17058. this.exploded ? this.list.forEach(function(t) {
  17059. a.start(function(i) {
  17060. e(t, 1 - i)
  17061. }, 1500, null, 0, c.easeOutExpo)
  17062. }) : this.list.forEach(function(t) {
  17063. a.start(function(i) {
  17064. e(t, i)
  17065. }, 1500, null, 0, c.easeOutExpo)
  17066. }),
  17067. this.exploded = !this.exploded
  17068. }
  17069. ,
  17070. t.exports = n
  17071. }
  17072. ).call(this, "/js/model/FloorCollection.js")
  17073. }
  17074. , {
  17075. "../objects/Floor": 146,
  17076. "../settings": 166,
  17077. "../util/IndexedCollection": 175,
  17078. "../util/common": 185,
  17079. "../util/easing": 186,
  17080. "../util/logger": 189,
  17081. "../util/transitions": 195
  17082. }],
  17083. 137: [function(e, t, i) {
  17084. (function(i) {
  17085. "use strict";
  17086. function n() {
  17087. c.call(this)
  17088. }
  17089. var r = e("../settings")
  17090. , o = e("../util/logger")
  17091. , a = e("../enum/Viewmode")
  17092. , s = e("../objects/Snapshot")
  17093. , l = (e("../util/math"),
  17094. e("../util/common"))
  17095. , c = e("../util/IndexedCollection")
  17096. , h = new o(i);
  17097. l.inherit(n, c),
  17098. n.prototype.getImage = function(e) {
  17099. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  17100. }
  17101. ,
  17102. n.prototype.filterByModesAndReel = function(e, t) {
  17103. for (var i = [], n = 0; n < t.length; n += 1) {
  17104. var r = t[n]
  17105. , o = this.index[r.sid];
  17106. o && i.push(o)
  17107. }
  17108. var s = e[a.DOLLHOUSE]
  17109. , l = e[a.FLOORPLAN];
  17110. i = i.filter(function(e) {
  17111. if (!e.metadata || void 0 === e.metadata.camera_mode)
  17112. return !0;
  17113. var t;
  17114. try {
  17115. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  17116. } catch (e) {
  17117. return h.debug(e.message),
  17118. !1
  17119. }
  17120. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  17121. }),
  17122. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  17123. this.list = i,
  17124. this.reIndex()
  17125. }
  17126. ,
  17127. n.prototype.getHeroLocations = function(panos) {//改 增加二级location
  17128. if (0 === this.list.length)
  17129. return [];
  17130. var locations = [];
  17131. var deal = (info, container)=>{
  17132. var src = info.thumbnail_signed_src,
  17133. o = info.name || "";
  17134. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  17135. if (!r.show360Views.enabled && info.metadata.scan_id) {
  17136. let a = panos.get(info.metadata.scan_id);
  17137. if (a && !a.isAligned()) return
  17138. }
  17139. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode);
  17140. if (cameraMode === a.MESH) return
  17141. if(window.isLocal)src = manage.dealURL(src)
  17142. else src = "one" === g_version ? g_Prefix + src + "?" + randomTime().getTime() : src + "?" + randomTime().getTime()
  17143. var l = {
  17144. cameraMode: cameraMode,
  17145. position: info.metadata.camera_position,
  17146. quaternion: info.metadata.camera_quaternion,
  17147. zoom: info.metadata.zoom,
  17148. panoId: info.metadata.scan_id,
  17149. orthoZoom: info.metadata.ortho_zoom,
  17150. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17151. thumbUrl: src,
  17152. name: n.filterImageName(o),
  17153. sid: info.sid
  17154. }
  17155. var item = new s(l);
  17156. item.momentTour = info.momentTour
  17157. item.dontRot = info.dontRot
  17158. item.rotTime = info.rotTime
  17159. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {}//新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17160. container.push(item)
  17161. return item
  17162. }
  17163. }
  17164. this.list.forEach(image=>{
  17165. if(image.images){
  17166. var folder = $.extend({}, image )
  17167. folder.heroLocations = [];
  17168. image.images.list.forEach(child=>{
  17169. deal(child, folder.heroLocations);
  17170. })
  17171. folder.musicInfo = folder.musicInfo || {}
  17172. locations.push(folder)
  17173. delete folder.images;
  17174. delete folder.locations;
  17175. }else{
  17176. var item = deal(image, locations);
  17177. }
  17178. })
  17179. return locations
  17180. }
  17181. ,
  17182. n.prototype.getIndex = function(e) {
  17183. return e.sid
  17184. }
  17185. ,
  17186. n.filterImageName = function(e) {
  17187. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17188. }
  17189. ,
  17190. t.exports = n
  17191. }
  17192. ).call(this, "/js/model/ImageCollection.js")
  17193. }
  17194. , {
  17195. "../enum/Viewmode": 51,
  17196. "../objects/Snapshot": 153,
  17197. "../settings": 166,
  17198. "../util/IndexedCollection": 175,
  17199. "../util/common": 185,
  17200. "../util/logger": 189,
  17201. "../util/math": 190
  17202. }],
  17203. 138: [function(e, t, i) {
  17204. (function(i) {
  17205. "use strict";
  17206. function n() {
  17207. u.call(this)
  17208. }
  17209. var r = e("../label/Label")
  17210. , o = e("../settings")
  17211. , a = e("../util/logger")
  17212. , s = e("../util/math")
  17213. , l = e("../util/ajax")
  17214. , c = e("./RoomCollection")
  17215. , h = e("../util/common")
  17216. , u = e("../util/IndexedCollection");
  17217. new a(i);
  17218. h.inherit(n, u),
  17219. n.prototype.getIndex = function(e) {
  17220. return e.labelId
  17221. }
  17222. ,
  17223. n.prototype.associateWithRooms = function(e) {
  17224. this.forEach(function(t) {
  17225. e.forEach(function(e) {
  17226. e.roomId === t.roomId && (t.room = e)
  17227. })
  17228. })
  17229. }
  17230. ,
  17231. n.prototype.createFromLabelData = function(e) {
  17232. e.forEach(function(e) {
  17233. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  17234. t = c.generateRoomId(e.floorId, t);
  17235. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  17236. i.position = s.convertWorkshopVector(i.position),
  17237. this.add(i),
  17238. i.build()
  17239. }
  17240. .bind(this))
  17241. }
  17242. ,
  17243. n.prototype.load = function(e, t) {
  17244. return l.get(e, {
  17245. responseType: "json",
  17246. auth: t ? o.authorizationHeader : null
  17247. }).done(function(e) {
  17248. var t = [];
  17249. for (var i in e) {
  17250. var n = e[i];
  17251. t.push(n)
  17252. }
  17253. this.createFromLabelData(t)
  17254. }
  17255. .bind(this))
  17256. }
  17257. ,
  17258. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  17259. var t = -1;
  17260. if (e) {
  17261. if(typeof e == 'number'){//add
  17262. t = parseInt(e)
  17263. }else{
  17264. var i = e.split("_");
  17265. t = parseInt(i[0])
  17266. }
  17267. }
  17268. return t
  17269. },
  17270. t.exports = n
  17271. }
  17272. ).call(this, "/js/model/LabelCollection.js")
  17273. }
  17274. , {
  17275. "../label/Label": 90,
  17276. "../settings": 166,
  17277. "../util/IndexedCollection": 175,
  17278. "../util/ajax": 181,
  17279. "../util/common": 185,
  17280. "../util/logger": 189,
  17281. "../util/math": 190,
  17282. "./RoomCollection": 141
  17283. }],
  17284. 139: [function(e, t, i) {
  17285. (function(i) {
  17286. "use strict";
  17287. function n(e, t) {
  17288. o.Object3D.call(this)
  17289. this.sid = window.number;//t.sid,
  17290. this.data = t,
  17291. this.options = e,
  17292. this.urls = new s(e.urlFiles),
  17293. this.isPublic = void 0 !== t.is_public && t.is_public,
  17294. //创建heroLocations
  17295. this.images = new _(this),
  17296. this.images.extend(t.images),
  17297. this.images.forEach((info)=>{
  17298. if(info.locations){
  17299. info.images = new _(this);
  17300. info.images.extend(info.locations)
  17301. }
  17302. })
  17303. this.heroLocations = []
  17304. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17305. this.outdoorPanoLocations = [],
  17306. this.floors = new d(this),
  17307. this.floorsEnabled = void 0 === e.floors || e.floors,
  17308. this.changingFloor = !1,
  17309. this.chunks = [],
  17310. this.panos = new A,
  17311. this.colliders = [],
  17312. this.loadPanosPromise = null,
  17313. this.loadMeshTexturesPromise = null,
  17314. this.auxDataPromise = null,
  17315. this.meshTexturesLoaded = !1,
  17316. this.meshTextures = [],
  17317. this.tags = {},
  17318. this.tagsShown = !1,
  17319. this.shouldShowtags = !1,
  17320. this.has360Views = !1,
  17321. this.showingLabels = f.labels.enabled && t.player_options.labels,
  17322. this.supportedModes = {},
  17323. this.supportedModes[c.PANORAMA] = !0,
  17324. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  17325. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  17326. this.supportedModes[c.TRANSITIONING] = !0,
  17327. this.supportsTiles = this.configureTiling(),
  17328. // this.supportsVR = t.is_vr,
  17329. this.supportsVR = window.DATA.supportsVR || false//true; // 方奕卓 VR功能可配置
  17330. this.mode = c.DOLLHOUSE,
  17331. this.size = null,
  17332. this.center = null,
  17333. this.boundingBox = new o.Box3,
  17334. this.currentFloor = null,
  17335. this.allFloorsVisible = !0,
  17336. this.projectedPano0 = null,
  17337. this.projectedPano1 = null,
  17338. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  17339. this.addFloor(new u(this,t,e.trim()))
  17340. }
  17341. .bind(this)),
  17342. this.waitQueue = [],
  17343. this.on("load", function(e) {
  17344. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  17345. return !e.isLoadedCallback()
  17346. }),
  17347. 0 === this.waitQueue.length && this.emit("waiting-done"))
  17348. }
  17349. .bind(this)),
  17350. this.setupCustomProperties()
  17351. this.hots = {};
  17352. }
  17353. function r() {
  17354. try {
  17355. var e = document.createElement("canvas")
  17356. , t = e.getContext("webgl");
  17357. t || (t = e.getContext("experimental-webgl"));
  17358. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  17359. return i
  17360. } catch (e) {
  17361. return 0
  17362. }
  17363. }
  17364. var o = e("three")
  17365. , a = e("../util/ajax")
  17366. , s = e("../util/ModelUrls")
  17367. , l = e("../objects/BoundingTextureSkybox")
  17368. , c = e("../enum/Viewmode")
  17369. , h = e("../enum/RenderOrder")
  17370. , u = (e("../enum/AlignmentType"),
  17371. e("../objects/Floor"))
  17372. , d = e("./FloorCollection")
  17373. , p = e("../objects/Chunk")
  17374. , f = (e("../objects/Room"),
  17375. e("../objects/Snapshot"),
  17376. e("../label/Label"),
  17377. e("../util/math"),
  17378. e("../settings"))
  17379. ,ss = e("../shaders")
  17380. , g = e("../util/logger")
  17381. , m = e("../tag/tag")
  17382. , v = (e("../tag/tagManager"),
  17383. e("../objects/Panorama"))
  17384. , A = e("../util/PanoramaCollection")
  17385. , y = e("../loaders/ModelLoader")
  17386. , C = e("../loaders/ModelTextureLoader")
  17387. , I = e("../loaders/SweepDataLoader")
  17388. , E = e("../util/transitions")
  17389. , b = e("../util/common")
  17390. , es = e("../util/easing")
  17391. ,lerp = e("../util/lerp")
  17392. ,tex = e("../util/texture")
  17393. , w = e("./../util/browser")
  17394. , _ = e("./ImageCollection")
  17395. , T = e("./RoomCollection")
  17396. , x = e("./LabelCollection")
  17397. , S = e("./Chunks")
  17398. , cameraLight = e("./util/cameraLight")
  17399. , M = e("./../util/showcase")
  17400. , R = e("../exception/BasicException")
  17401. , P = (e("../constants")
  17402. ,e("events").EventEmitter)
  17403. ,GLCubeFaces = e("../enum/GLCubeFaces")
  17404. //,Hot = e("hot")
  17405. , O = new g(i);
  17406. n.prototype = Object.create(o.Object3D.prototype),
  17407. b.extend(n, P),
  17408. n.prototype.setupCustomProperties = function() {
  17409. var e = f.modelAlpha;
  17410. Object.defineProperty(this, "alpha", {
  17411. get: function() {
  17412. return e
  17413. },
  17414. set: function(t) {
  17415. e = t
  17416. //console.log(t)
  17417. this.chunks.forEach(function(chunk) {
  17418. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  17419. chunk.material.uniforms.modelAlpha.value = e
  17420. //修改一下defines,为了在不需要map时不加载map。 by xzw
  17421. /* if (e>0) {
  17422. if (!('useModelMap' in chunk.material.defines)) {
  17423. chunk.material.defines.useModelMap = ''
  17424. chunk.material.needsUpdate = true
  17425. console.log('add useModelMap')
  17426. }
  17427. } else {
  17428. if ('useModelMap' in chunk.material.defines) {
  17429. delete chunk.material.defines.useModelMap
  17430. chunk.material.needsUpdate = true
  17431. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  17432. console.log('delete useModelMap')
  17433. }
  17434. } */
  17435. }
  17436. })
  17437. }
  17438. })
  17439. }
  17440. ,
  17441. n.prototype.configureTiling = function() {
  17442. var e = r();
  17443. if (e < 2048)
  17444. return !1;
  17445. O.warn("Max cube texture size: " + e);
  17446. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17447. var i = f.tiling.tilingFlagNames[t];
  17448. if ("1" === w.valueFromHash(i, null))
  17449. return !0;
  17450. if ("0" === w.valueFromHash(i, null))
  17451. return !1
  17452. }
  17453. //--------------------------------------------许钟文-------------------------------------------
  17454. //return true;
  17455. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17456. //--------------------------------------------e n d -------------------------------------------
  17457. }
  17458. ,
  17459. n.prototype.toggleAlpha = function() {
  17460. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  17461. }
  17462. ,
  17463. n.prototype.load = function(e) {
  17464. var t = function() {
  17465. return $.when(this.loadPanos(), this.loadMesh())
  17466. }
  17467. , i = this.urls.init().then(t.bind(this));
  17468. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  17469. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  17470. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  17471. }
  17472. ,
  17473. n.prototype.loadMesh = function() {
  17474. function e(e) {
  17475. O.error(e),
  17476. n.reject("loading-failed")
  17477. }
  17478. function t(e, t) {
  17479. n.notify(e, t)
  17480. }
  17481. function i(e, t) {
  17482. if (0 === e.length) {
  17483. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17484. r.supportedModes[c.DOLLHOUSE] = !1,
  17485. r.supportedModes[c.FLOORPLAN] = !1;
  17486. var i = new p({
  17487. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17488. });
  17489. i.material.visible = !1,
  17490. i.rotateX(-Math.PI / 2),
  17491. i.geometry.computeBoundingBox(),
  17492. e = [i]
  17493. }
  17494. e.forEach(function(e) {
  17495. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17496. r.addChunk(t, e)
  17497. }),
  17498. r.floors.sort(),
  17499. n.resolve(r)
  17500. }
  17501. var n = $.Deferred()
  17502. , r = this;
  17503. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17504. n.promise()
  17505. }
  17506. ,
  17507. n.prototype.loadMeshTextures = function() {
  17508. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17509. this.meshTexturesLoaded = !0
  17510. }
  17511. .bind(this)),
  17512. this.loadTexturesPromise)
  17513. }
  17514. ,
  17515. /* n.prototype.loadtags = function() {//xzw改
  17516. var e = $.Deferred();
  17517. if (!f.tags.enabled)
  17518. return e.resolve();
  17519. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17520. t = "data/" + this.sid + "/tags.json"
  17521. return a.get(t, {
  17522. responseType: "json",
  17523. auth: this.isPublic ? null : f.authorizationHeader
  17524. }).done(function(t) {
  17525. var i = 0
  17526. , n = 0;
  17527. for (var r in t) {
  17528. var o = t[r];
  17529. o.enabled && (n++,
  17530. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17531. i++))
  17532. }
  17533. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17534. e.resolve()
  17535. }
  17536. .bind(this)).fail(function() {
  17537. O.warn("Getting tags failed, not displaying tags."),
  17538. e.resolve()
  17539. }),
  17540. e
  17541. } */
  17542. n.prototype.shineHots = function(){ //xzw
  17543. E.trigger({
  17544. func: function(e) {
  17545. var opa = e <= .5 ? 2 * e : -2 * e + 2
  17546. for(var i in this.hots){
  17547. this.hots[i].mesh.material.uniforms.opac.value = opa;
  17548. }
  17549. }.bind(this),
  17550. cycling: true,
  17551. duration: 3000,
  17552. //easing: "easeInOutQuad",
  17553. name: "hotShine"
  17554. })
  17555. },
  17556. /* n.prototype.loadOverlays = function(overlays){
  17557. var overlays = window.data2 && window.data2.overlays
  17558. overlays && overlays.forEach((info)=>{
  17559. new Overlay(info)
  17560. })
  17561. Overlay.load()
  17562. }
  17563. */
  17564. n.prototype.loadhots = function() {//xzw
  17565. initHot(this)
  17566. this.roomLabels = []
  17567. this.hotsCount = 0;
  17568. var r = $.Deferred();
  17569. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17570. return a.get(t, {
  17571. responseType: "json",
  17572. auth: this.isPublic ? null : f.authorizationHeader
  17573. }).done(function(e) {
  17574. window.data2 = e;
  17575. if(!e){
  17576. console.error("data2 is null")
  17577. }else{
  17578. g_data2 = hotMatcher(e);
  17579. let create = ()=>{
  17580. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17581. if(e.hots){
  17582. var sids = Object.keys(e.hots).sort((a,b)=>{return e.hots[a].order - e.hots[b].order});
  17583. sids.forEach((sid)=>{
  17584. e.hots[sid].sid = sid
  17585. if(e.hots[sid].texType == 'photo' && !e.hots[sid].texSrc)return console.error('有photo热点无texSrc',e.hots[sid])
  17586. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && "byHot" )
  17587. })
  17588. }
  17589. if(e.overlays){
  17590. e.overlays.forEach((info)=>{
  17591. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17592. new Hot(info, 'byOverlay')
  17593. })
  17594. }
  17595. Hot.createHotList();
  17596. Hot.startLoad()
  17597. {
  17598. let maxCount = browser.isMobile() ? 200000 : 400000
  17599. let noVisiHots = this.hotGroup.children.filter(e=>!e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17600. //let visiHots = this.hotGroup.children.filter(e=>e.info.visiblePanos)
  17601. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17602. if(c > maxCount){ //防止加载时间过长,分批计算
  17603. console.log('hot分批setVisiblePanos')
  17604. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17605. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16;
  17606. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17607. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur*noVisiHots.length))
  17608. if(noVisiHots.length){
  17609. let i = 0
  17610. let hotVisiInterval = setInterval(()=>{
  17611. noVisiHots[i].setVisiblePanos();
  17612. i++;
  17613. if(i>=noVisiHots.length){
  17614. clearInterval(hotVisiInterval)
  17615. }
  17616. }, dur)
  17617. }
  17618. }
  17619. }
  17620. if(DATA.roomLabels){
  17621. DATA.roomLabels.forEach((data)=>{
  17622. this.roomLabels.push(new RoomLabel(data))
  17623. })
  17624. }
  17625. }
  17626. if(player.currentPano){
  17627. create()
  17628. }else{
  17629. let f = ()=>{
  17630. window.bus.removeEventListener('playerAndModelReady',f)
  17631. create()
  17632. }
  17633. window.bus.addEventListener('playerAndModelReady',f)
  17634. }
  17635. g_index = w.valueFromHash("m");
  17636. }
  17637. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17638. /* var dataJsPromise = $.Deferred();
  17639. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17640. a.get(dataJsUrl,{
  17641. responseType: "json",
  17642. auth: this.isPublic ? null : f.authorizationHeader
  17643. }).done(function(data) {
  17644. window.hotData = data;
  17645. this.createHotItem(data, this.hots);
  17646. for(let i in this.hots){//add
  17647. data[i] && this.hots[i].initStyleImg(data[i]);
  17648. }
  17649. dataJsPromise.resolve();
  17650. }.bind(this)).fail(function(){
  17651. console.log('Data.js is empty');
  17652. dataJsPromise.resolve();
  17653. }) */
  17654. r.resolve();
  17655. }.bind(this)).fail(function() {
  17656. console.log('没有热点');
  17657. r.resolve()
  17658. }),
  17659. r
  17660. }
  17661. ,
  17662. n.prototype.loadPanos = function() {
  17663. if (this.loadPanosPromise)
  17664. return this.loadPanosPromise;
  17665. var e = new I(this);
  17666. return this.loadPanosPromise = e.load().then(function(e) {
  17667. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17668. if(this.data.sweeps[e.uuid])return this.data.sweeps[e.uuid].enabled
  17669. else console.log(e.uuid)
  17670. }
  17671. .bind(this))),
  17672. this.panos.extend(e.map(function(e) {
  17673. return new v(this,e.uuid,e,this.supportsTiles)
  17674. }
  17675. .bind(this))),
  17676. this.panos.forEach(function(e) {
  17677. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17678. var i = this.panos.get(t);
  17679. i && this.panos.setNeighbour(e, i, !0)
  17680. }
  17681. .bind(this)),
  17682. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17683. }
  17684. .bind(this)),
  17685. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17686. this.supportedModes[c.PANORAMA] = !1),
  17687. $.when(this)
  17688. }
  17689. .bind(this)),
  17690. this.loadPanosPromise
  17691. }
  17692. ,
  17693. n.prototype.loadHighlightReel = function() {//xzw
  17694. var e = $.Deferred()
  17695. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17696. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17697. return a.get(t, {
  17698. responseType: "json",
  17699. auth: this.isPublic ? null : f.authorizationHeader
  17700. }).done(function(t) {
  17701. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17702. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17703. e.resolve()
  17704. }
  17705. .bind(this)).fail(function() {
  17706. O.warn("Getting highlight reel failed, no highlights available"),
  17707. e.resolve()
  17708. }),
  17709. e
  17710. }
  17711. ,
  17712. n.prototype.waitForLoad = function(e, t) {
  17713. t() || (this.waitQueue.push({
  17714. object: e,
  17715. isLoadedCallback: t
  17716. }),
  17717. 1 === this.waitQueue.length && this.emit("waiting"))
  17718. }
  17719. ,
  17720. n.prototype.hide = function() {
  17721. this.floors.hide()
  17722. }
  17723. ,
  17724. n.prototype.show = function() {
  17725. this.floors.show()
  17726. }
  17727. ,
  17728. n.prototype.floorNames = function() {
  17729. return this.floors.names()
  17730. }
  17731. ,
  17732. n.prototype.warpDestFloors = function(e, t) {
  17733. if (!e || this.floors.length !== e.length)
  17734. return void this.toggleAllFloors(!0);
  17735. var i = e.findIndex(function(e) {
  17736. return e
  17737. }
  17738. .bind(this));
  17739. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17740. }
  17741. ,
  17742. n.prototype.setFloor = function(e, t, i) {
  17743. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17744. this.allFloorsVisible = !1,
  17745. this._setFloor(e, t, i)
  17746. }
  17747. ,
  17748. n.prototype.toggleAllFloors = function(e) {
  17749. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17750. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17751. this._setFloor(this.currentFloor)
  17752. }
  17753. ,
  17754. n.prototype._setFloor = function(e, t, i) {
  17755. t = t || this.mode,
  17756. this.emit("floor.changed", e, t, this.currentFloor),
  17757. this.currentFloor = e;
  17758. var n;
  17759. if (t === c.PANORAMA) {
  17760. if (this.show(),
  17761. this.shouldShowtags && this.tagsShown)
  17762. for (n in this.tags)
  17763. this.tags[n].show(f.showFloorDuration)
  17764. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17765. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17766. }
  17767. .bind(this)),
  17768. this.shouldShowtags && this.tagsShown))
  17769. for (n in this.tags) {
  17770. var r = this.tags[n];
  17771. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17772. }
  17773. var o = this
  17774. , a = e;
  17775. E.start(function() {}, f.showFloorDelay, function() {
  17776. o.floors.forEach(function(e) {
  17777. e.chunks.forEach(function(t) {
  17778. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17779. })
  17780. })
  17781. }
  17782. .bind(this))
  17783. }
  17784. ,
  17785. n.prototype.toggleExplode = function() {
  17786. this.floors.toggleExplodeHorizontal()
  17787. }
  17788. ,
  17789. n.prototype.toggleExplodeUp = function() {
  17790. this.floors.toggleExplodeVertical()
  17791. }
  17792. ,
  17793. n.prototype.nextFloor = function(e) {
  17794. return this.floors.nextFloor(this.currentFloor, e)
  17795. }
  17796. ,
  17797. n.prototype.addFloor = function(e) {
  17798. this.floors.add(e)
  17799. }
  17800. ,
  17801. n.prototype.getFloorAtPoint = function(e) {
  17802. return this.floors.getFloorAtPoint(e)
  17803. }
  17804. ,
  17805. n.prototype.getTagBySid = function(e) {
  17806. return this.tags[e]
  17807. }
  17808. ,
  17809. n.prototype.addChunk = function(e, t) {
  17810. this.floors.getOrMakeFloor(e).addChunk(t),
  17811. this.chunks.push(t)
  17812. }
  17813. ,
  17814. n.prototype.setMode = function(e) {
  17815. if (!this.supportedModes[e])
  17816. throw new R("Mode not supported for this model: " + e);
  17817. this.mode = e;
  17818. this.skybox.material.transparent = e == "panorama" ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17819. this.chunks.forEach(function(t) {
  17820. t.setMode(e)
  17821. })
  17822. }
  17823. ,
  17824. n.prototype.build = function() {
  17825. this.heroLocations = this.images.getHeroLocations(this.panos);
  17826. var e = function() {
  17827. 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()
  17828. }
  17829. .bind(this)();
  17830. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17831. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17832. }
  17833. .bind(this)) || e,
  17834. null === this.heroImage && O.warn("No hero image defined."),
  17835. this.currentFloor = this.floors.last(),
  17836. this.floors.build(),
  17837. this.colliders = this.floors.reduce(function(e, t) {
  17838. return e.concat(t.collider.children)
  17839. }, []),
  17840. this.panos.forEach(function(e) {
  17841. e.build1(),
  17842. e.on("enter", function() {
  17843. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17844. }
  17845. .bind(this))
  17846. }
  17847. .bind(this))
  17848. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  17849. let time1 = performance.now()
  17850. let downVec = new THREE.Vector3(0,-1,0)
  17851. this.panos.forEach((pano)=>{
  17852. player.raycaster.set(pano.position, downVec);
  17853. let collider = pano.floor.collider.children
  17854. let n = player.raycaster.intersectObjects(collider , true );//add true
  17855. if(n && n[0]){
  17856. if(n[0].point.y - pano.floorPosition.y > 0.03){
  17857. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17858. pano.originFloorY = pano.floorPosition.y
  17859. pano.floorPosition.y = n[0].point.y
  17860. }
  17861. }
  17862. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17863. })
  17864. let time2 = performance.now()
  17865. console.log('探测时间',time2-time1)
  17866. this.panos.forEach(function(e) {
  17867. e.build2()
  17868. }),
  17869. this.floors.forEach(function(e) {
  17870. this.boundingBox.union(e.boundingBox)
  17871. }
  17872. .bind(this)),
  17873. this.size = this.boundingBox.size(),
  17874. this.center = this.boundingBox.center(),
  17875. this.floors.forEach(function(e) {
  17876. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17877. }
  17878. .bind(this)),
  17879. this.panos.populate_path_graph(),
  17880. this.skybox = new l(this.boundingBox),
  17881. this.skybox.matrixWorldNeedsUpdate = !0,
  17882. this.add(this.skybox);
  17883. //因为一部分漫游点在模型外
  17884. {
  17885. let bounding = new THREE.Box3 //不包含pano的bound
  17886. this.floors.list.forEach(floor=>{
  17887. bounding.union(floor.conservativeBoundingBox)
  17888. })
  17889. this.boundWithoutPanos = bounding
  17890. this.sizeWithoutPanos = bounding.size()
  17891. this.centerWithoutPanos = bounding.center()
  17892. /* 如果想居中模型, bound不加pano:
  17893. this.boundingBox = bounding
  17894. this.size = bounding.size()
  17895. this.center = bounding.center() */
  17896. }
  17897. this.createFloorLogo()
  17898. return O.debug("Done building model"),
  17899. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17900. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17901. this.buildRooms(),
  17902. this.labels.associateWithRooms(this.rooms),
  17903. $.when(this)
  17904. }
  17905. ,
  17906. n.prototype.createFloorLogo = function(){
  17907. console.log('createFloorLogo')
  17908. if(this.floorLogos || !settings.floorlogoURL)return;
  17909. var url = settings.floorlogoURL
  17910. var map = tex.load(url);//可以追加done
  17911. this.floorLogos = [];
  17912. for(var i=0; i<2; i++){ //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17913. var material = new o.MeshBasicMaterial({
  17914. opacity:0,
  17915. map:map,
  17916. side: o.DoubleSide,
  17917. transparent: !0,
  17918. depthWrite: !1,
  17919. depthTest:false//改 在chunk\skybox外也可看到
  17920. });
  17921. var logo = new o.Mesh(new o.PlaneGeometry(2,2,1,1),material);
  17922. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17923. //logo.scale.set(s,s,s);
  17924. logo.position.set(0,-1.5,0);
  17925. logo.lookAt(logo.position.clone().add(new o.Vector3(0,1,0)));
  17926. logo.renderOrder = 100;//cover the videoSkybox
  17927. //logo.layers.set(0)
  17928. this.add(logo);
  17929. this.floorLogos.push(logo);
  17930. }
  17931. this.floorLogos[1].visible = false;
  17932. }
  17933. n.prototype.adjustfloorLogoHeight = function(o){
  17934. var h = player.currentPano.floorPosition.y + 0.01;
  17935. this.floorLogos[1].position.setY(h);
  17936. this.floorLogos[0].position.setY(h);
  17937. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17938. },
  17939. n.prototype.changefloorLogoOpa = function(o){//改 i, opacity, time, delay
  17940. if(!this.floorLogos) return;
  17941. E.cancelById("flOpa_"+o.index);//先停止之前该logo的透明度变化
  17942. if(o.from!=void 0)this.floorLogos[o.index].material.opacity = o.from;//初始透明度
  17943. if(!o.dur){//立刻
  17944. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17945. this.floorLogos[o.index].material.opacity = o.opa;
  17946. }else{
  17947. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17948. E.start(lerp.property(this.floorLogos[o.index].material, "opacity", o.opa), o.dur || 0, null,
  17949. o.delay||0, es["easeInQuad"], "changefloorLogoOpa", "flOpa_"+o.index)
  17950. }
  17951. },
  17952. n.prototype.updateFloorlogo = function() { //xzw add 更新地标的旋转
  17953. var lastQ, lastP;
  17954. var equals = function(v1, v2, min){
  17955. return Math.abs(v1-v2) < min
  17956. }
  17957. var isSame = function(now, last, k){//如果和上次相同就不改变
  17958. if(!last)return false;
  17959. var R = k.sceneRenderer;
  17960. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17961. //暂时:
  17962. var min = 0.0008
  17963. var same = equals(now.x , last.x, min) && equals(now.y , last.y, min) && equals(now.z , last.z, min)
  17964. && (now.w!=void 0 ? equals(now.w , last.w, min) : true)
  17965. return same;
  17966. }
  17967. return function(Q, k){
  17968. if(!Q)return;
  17969. /* if(Config.ifFish && window.lowFPS){
  17970. this.fLCompute++;
  17971. if(R.AFPS < 38){
  17972. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17973. else if(k.flying && k.fLCompute%2 !=1) return;
  17974. k.fLCompute %= 4;
  17975. }else if(R.AFPS < 45){
  17976. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17977. else if(k.flying && k.fLCompute%2 !=1) return;
  17978. k.fLCompute %= 6;
  17979. }else{
  17980. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17981. //else if(k.flying && k.fLCompute%2 !=1) return;
  17982. k.fLCompute %= 2;
  17983. }
  17984. } */
  17985. var sameQ, sameP, quaternion, visible;
  17986. for(var i=0;i<2;i++){
  17987. var logo = this.floorLogos[i];
  17988. if(!logo.visible || logo.material.uniforms.opacity.value==0) continue;
  17989. visible = true;
  17990. }
  17991. if(!visible)return; //如果两个都不可见,就不更改,如果有一个可见,就都改
  17992. var c = k.cameraControls.activeControl;
  17993. var sameQ = c ? ( c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1) ): false;
  17994. sameQ || (lastQ = c ? c.lon : null); //相机旋转是否改变了
  17995. for(var i=0;i<2;i++){
  17996. var logo = this.floorLogos[i];
  17997. if(!sameQ){
  17998. if(!quaternion){
  17999. var a = new THREE.Vector3(0,0,-1);
  18000. a.applyQuaternion(Q);
  18001. a.setY(0);
  18002. var _ = (new THREE.Matrix4).lookAt(a,new THREE.Vector3, new THREE.Vector3(0,1,0));
  18003. quaternion = (new THREE.Quaternion).setFromRotationMatrix(_)
  18004. var a = new THREE.Quaternion( 0, 0.7071067811865476, 0.7071067811865476 , 0)//计算得
  18005. quaternion.multiply(a);
  18006. }
  18007. logo.quaternion.copy(quaternion);
  18008. }
  18009. }
  18010. }
  18011. }()
  18012. n.prototype.loadLabels = function() {//xzw
  18013. this.labels = new x(this);
  18014. var e = $.Deferred();
  18015. //加载俯视图的标签 注释这个备注就会加载
  18016. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  18017. window.DATA.showingLabels ? this.showingLabels = true : '';
  18018. if (!this.showingLabels)
  18019. return e.resolve();
  18020. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  18021. var t = g_Prefix + "data/" + this.sid + "/labels.json";
  18022. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  18023. O.warn("Getting labels failed, not displaying labels."),
  18024. e.resolve()
  18025. }),
  18026. e
  18027. }
  18028. ,
  18029. n.prototype.buildRooms = function() {
  18030. this.rooms = new T(this),
  18031. this.rooms.createFromChunks(this.chunks),
  18032. this.rooms.calcRoomBoundaries()
  18033. }
  18034. ,
  18035. n.prototype.updateProjectedPanos = function() {
  18036. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  18037. }
  18038. ,
  18039. n.prototype.setProjectedPanos = function(e, t, i) {
  18040. void 0 !== i && null !== i || (i = !0),
  18041. i = !!i,
  18042. this.projectedPano0 = e,
  18043. this.projectedPano1 = t,
  18044. this.skybox.material.setProjectedPanos(e, t, i),
  18045. this.chunks.forEach(function(n) {
  18046. n.materialInside.setProjectedPanos(e, t, i)
  18047. })
  18048. }
  18049. ,
  18050. n.prototype.setSide = function(e) {
  18051. this.floors.forEach(function(t) {
  18052. t.collider.material.side = e
  18053. })
  18054. }
  18055. ,
  18056. n.prototype.heroCount = function() {
  18057. return this.heroLocations ? this.heroLocations.length : 0
  18058. }
  18059. ,
  18060. n.prototype.getHeroDescriptorByIndex = function(e=[]) {//改 因增加了二级目录
  18061. if (e[0] < 0)
  18062. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  18063. null;
  18064. if (this.heroCount() < 1)
  18065. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  18066. null;
  18067. var t = this.heroLocations[e[0]];
  18068. if(t.heroLocations && e[1]!=void 0){
  18069. t = t.heroLocations[e[1]];
  18070. }
  18071. return void 0 === t ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  18072. null) : t
  18073. }
  18074. ,
  18075. n.prototype.findPanoramicHero = function() {
  18076. for (var e in this.heroLocations)
  18077. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  18078. return this.heroLocations[e];
  18079. return null
  18080. }
  18081. ,
  18082. n.prototype.listImagePanos = function() {
  18083. var e = []
  18084. , t = this;
  18085. return this.images.forEach(function(i) {
  18086. if (i.metadata && i.metadata.scan_id) {
  18087. var n = t.panos.get(i.metadata.scan_id);
  18088. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  18089. }
  18090. }),
  18091. e
  18092. }
  18093. ,
  18094. n.prototype.fadePanoMarkers = function(/* e, t */opacity, dur, o = {}) {//改
  18095. //this.panos.fadeMarkerOpacity(e, t)
  18096. if(window.DATA.hideFloorMarker)return
  18097. var currentPano = player.currentPano
  18098. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  18099. var hideWhenFlyOut = () => {
  18100. var shows = [],
  18101. hides = []
  18102. player.model.panos.forEach(pano => {
  18103. hides.push(pano)
  18104. })
  18105. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  18106. }
  18107. if (opacity == 0) {
  18108. hideWhenFlyOut()
  18109. } else {
  18110. if (player.mode == 'panorama' && currentPano) {
  18111. var shows = [], hides = []
  18112. player.model.panos.forEach(pano => { //是邻近点就显示否则隐藏
  18113. if (currentPano.neighbourPanos[pano.id]) {
  18114. shows.push(pano)
  18115. } else {
  18116. hides.push(pano)
  18117. }
  18118. })
  18119. this.panos.fadeMarkerOpacity(opacity, dur, [
  18120. { toOp: opacity, member: shows },
  18121. { toOp: 0, member: hides },
  18122. ])
  18123. } else if (player.modeTran.split('-')[1] != 'panorama') {
  18124. //飞出后marker隐藏
  18125. hideWhenFlyOut()
  18126. }
  18127. }
  18128. }
  18129. ,
  18130. n.prototype.setSweepVisibility = function(e) {
  18131. this.panos.forEach(function(t) {
  18132. t.marker && (t.marker.visible = e)
  18133. })
  18134. }
  18135. ,
  18136. n.prototype.outsideAllowed = function() {
  18137. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  18138. }
  18139. ,
  18140. n.prototype.addHighMapCube = function() {
  18141. //创建8*8的tile cube
  18142. if (player.qualityManager.getMaxZoomClass() == '4k' && player.qualityManager.maxRenderTargetSize == 2048) {
  18143. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  18144. var cube = new THREE.Object3D()
  18145. cube.tiles = []
  18146. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  18147. var face = new THREE.Object3D()
  18148. for (var i = 0; i < 8; i++) {
  18149. for (var j = 0; j < 8; j++) {
  18150. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  18151. tile.position.set(i - 3.5, j - 3.5, -4)
  18152. if (highMapAddColor) {
  18153. tile.material.opacity = 0.4
  18154. var colorHue = Math.random()
  18155. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  18156. }
  18157. tile.material.transparent = true
  18158. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  18159. tile.visible = false
  18160. tile.tileX = i
  18161. tile.tileY = j
  18162. tile.cubeFace = cubeIndex
  18163. tile.renderOrder = 2//RenderOrder.highTileCube
  18164. cube.tiles.push(tile)
  18165. face.add(tile)
  18166. }
  18167. }
  18168. switch (cubeIndex) {
  18169. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  18170. face.rotation.set(0, Math.PI / 2, 0)
  18171. break
  18172. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  18173. face.rotation.set(0, -Math.PI / 2, 0)
  18174. break
  18175. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  18176. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18177. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 2)
  18178. face.quaternion.copy(rot1).multiply(rot2)
  18179. //face.rotation.set(Math.PI/2,0,0);
  18180. break
  18181. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  18182. //face.rotation.set(-Math.PI/2,0,0);
  18183. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18184. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2)
  18185. face.quaternion.copy(rot1).multiply(rot2)
  18186. break
  18187. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  18188. face.rotation.set(0, Math.PI, 0)
  18189. break
  18190. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  18191. face.rotation.set(0, 0, 0)
  18192. }
  18193. face.scale.set(1, -1, 1)
  18194. cube.add(face)
  18195. }
  18196. cube.name = 'highMapCube'
  18197. this.highMapCube = cube
  18198. this.add(cube)
  18199. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  18200. this.highMapCube.visible = false
  18201. this.highMapCube.texLoadedCount = 0
  18202. player.once("pano.chosen",()=>{//wait sceneRenderer
  18203. player.sceneRenderer.on('after-render', e => {
  18204. if (this.highMapCube.visibleTiles) {
  18205. this.updateTiles()
  18206. }
  18207. if (player && player.lastFrameChanged) {
  18208. common.intervalTool.isWaiting(
  18209. 'update4kTiles',
  18210. () => {
  18211. let vectorForward = player.getDirection()
  18212. this.updateTiles(vectorForward)
  18213. },
  18214. 500
  18215. )
  18216. }
  18217. })
  18218. })
  18219. }
  18220. }
  18221. /*
  18222. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  18223. */
  18224. n.prototype.isHighMapLoaded = function(cubeFace, tileX, tileY){
  18225. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18226. return !!tile.material.map
  18227. }
  18228. n.prototype.updateTiles = function(direction) {
  18229. if (!this.highMapCube || !this.highMapCube.visible) return
  18230. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  18231. //performance.mark('updateTiles-start')
  18232. if (direction) {
  18233. let camera = player.cameraControls.cameras.panorama
  18234. let hfov = THREE.Math.degToRad(cameraLight.getHFOVForCamera(camera, $("#player").width(), $("#player").height())) / 2
  18235. let vfov = THREE.Math.degToRad(camera.fov) / 2
  18236. /* let hcos = Math.cos(hfov / 2)
  18237. let vcos = Math.cos(vfov / 2) */
  18238. let list = this.highMapCube.tiles
  18239. list.forEach(e => {
  18240. //屏幕外的不显示
  18241. let pos = e.getWorldPosition(new THREE.Vector3())
  18242. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  18243. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  18244. let hRad = Math.acos(hcos_)
  18245. let vRad = -200
  18246. if (hRad > hfov + 0.08) {
  18247. e.score = -100
  18248. } else {
  18249. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  18250. if (vRad > vfov + 0.08) {
  18251. e.score = -100
  18252. } else {
  18253. e.score = -(hRad / hfov + vRad / vfov)
  18254. }
  18255. }
  18256. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  18257. if (e.score == -100) {
  18258. this.resetTile(e)
  18259. }
  18260. })
  18261. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  18262. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  18263. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  18264. */
  18265. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  18266. }
  18267. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  18268. if (needRecover.length) {
  18269. let maxCount = 1//common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  18270. let count = 0
  18271. needRecover.forEach((e, i) => {
  18272. //只更新若干个,因为太耗时了, 其余的等下帧更新
  18273. if (count >= maxCount) return
  18274. let r = this.recoverTile(e)
  18275. if (r) count++
  18276. })
  18277. }
  18278. }
  18279. n.prototype.getHighImage = function(image, cubeFace, tileX, tileY){
  18280. this.gotSomeHighImg = true; //标记,需要马上updateTiles
  18281. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18282. tile.image = image //先记录下来
  18283. }
  18284. n.prototype.updateHighMap = function(image, cubeFace, tileX, tileY) {
  18285. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18286. if (image) tile.image = image //先记录下来
  18287. if (tile.material.map) return
  18288. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile) ) {
  18289. return
  18290. }
  18291. //简易创建贴图
  18292. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  18293. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  18294. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  18295. */
  18296. var tex = new THREE.Texture()
  18297. tex.image = image
  18298. tex.flipY = false
  18299. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  18300. tex.generateMipmaps = false
  18301. tex.minFilter = THREE.LinearFilter
  18302. tex.needsUpdate = true
  18303. tile.material.map = tex
  18304. if (highMapAddColor) {
  18305. tile.material.opacity = 1
  18306. }
  18307. tile.visible = true
  18308. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  18309. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  18310. }
  18311. n.prototype.recoverTile = function(tile) {
  18312. if (tile.material.map) return
  18313. if (tile.image) {
  18314. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  18315. return true
  18316. } else {
  18317. //console.log('no image')
  18318. }
  18319. }
  18320. n.prototype.resetTile = function(tile, kill) {
  18321. if (kill) {
  18322. //完全消灭
  18323. tile.image = null
  18324. }
  18325. let map = tile.material.map
  18326. if (map) {
  18327. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  18328. map.loaded = !1
  18329. map.version = 0
  18330. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  18331. var h = player.sceneRenderer.renderer.properties.get(map)
  18332. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  18333. tile.material.map = null
  18334. if (highMapAddColor) {
  18335. tile.material.opacity = 0.4
  18336. }
  18337. tile.material.needsUpdate = true
  18338. tile.visible = false
  18339. //this.highMapCube.texLoadedCount --
  18340. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  18341. }
  18342. }
  18343. n.prototype.resetHighMap = function() {
  18344. if (!this.highMapCube) return
  18345. this.highMapCube.children.forEach(e =>
  18346. e.children.forEach(tile => {
  18347. this.resetTile(tile, true)
  18348. })
  18349. )
  18350. //this.highMapCube.texLoadedCount = 0
  18351. this.highMapCube.visibleTiles = null
  18352. this.hideHighMap()
  18353. }
  18354. n.prototype.setHighMap = function(pano) {
  18355. if (!this.highMapCube) return
  18356. this.highMapCube.position.copy(pano.position)
  18357. this.highMapCube.quaternion.copy(pano.quaternion)
  18358. }
  18359. n.prototype.showHighMap = function() {
  18360. if (!this.highMapCube) return
  18361. this.highMapCube.visible = true
  18362. }
  18363. n.prototype.hideHighMap = function() {
  18364. if (!this.highMapCube) return
  18365. this.highMapCube.visible = false
  18366. }
  18367. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  18368. t.exports = n
  18369. }
  18370. ).call(this, "/js/model/Model.js")
  18371. }
  18372. , {
  18373. "../constants": 8,
  18374. "../enum/AlignmentType": 17,
  18375. "../enum/RenderOrder": 42,
  18376. "../enum/Viewmode": 51,
  18377. "../exception/BasicException": 55,
  18378. "../label/Label": 90,
  18379. "../loaders/ModelLoader": 105,
  18380. "../loaders/ModelTextureLoader": 106,
  18381. "../loaders/SweepDataLoader": 107,
  18382. "../tag/tag": 123,
  18383. "./util/cameraLight": 184,
  18384. "../tag/tagManager": 124,
  18385. "../objects/BoundingTextureSkybox": 143,
  18386. "../objects/Chunk": 144,
  18387. "../objects/Floor": 146,
  18388. "../objects/Panorama": 148,
  18389. "../objects/Room": 150,
  18390. "../objects/Snapshot": 153,
  18391. "../settings": 166,
  18392. "../shaders": 167,
  18393. "../util/ModelUrls": 177,
  18394. "../util/PanoramaCollection": 178,
  18395. "../util/ajax": 181,
  18396. "../util/common": 185,
  18397. "../util/easing": 186,
  18398. "../util/lerp": 188,
  18399. "../util/logger": 189,
  18400. "../util/math": 190,
  18401. "../util/texture": 194,
  18402. "../util/transitions": 195,
  18403. "./../util/browser": 182,
  18404. "./../util/showcase": 193,
  18405. "./Chunks": 135,
  18406. "./FloorCollection": 136,
  18407. "./ImageCollection": 137,
  18408. "./LabelCollection": 138,
  18409. "./RoomCollection": 141,
  18410. events: 202,
  18411. three: 217,
  18412. "hot": "hot" ,
  18413. "../enum/GLCubeFaces":25 ,
  18414. }],
  18415. 140: [function(e, t, i) {
  18416. "use strict";
  18417. function n() {
  18418. this.modelMap = {},
  18419. this.activeModel = null,
  18420. this.modelCount = 0,
  18421. this.tileDownloader = null,
  18422. this.panoRenderer = null
  18423. }
  18424. var r = (e("three"),
  18425. e("../util/common"))
  18426. , o = e("../exception/BasicException")
  18427. , a = e("../enum/ModelManagerEvents")
  18428. , s = e("../enum/PanoRendererEvents")
  18429. , l = e("events").EventEmitter;
  18430. n.prototype.init = function(e, t, i) {
  18431. this.tileDownloader = e,
  18432. this.panoRenderer = t,
  18433. this.qualityManager = i,
  18434. this.bindEvents()
  18435. }
  18436. ,
  18437. n.prototype.bindEvents = function() {
  18438. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18439. }
  18440. ,
  18441. n.prototype.onTileRendered = function(e, t, i, n) {}
  18442. ,
  18443. n.prototype.addModel = function(e) {
  18444. this.modelMap[e.sid] = e,
  18445. 0 === this.modelCount && this.activateModel(e.sid),
  18446. this.modelCount++,
  18447. this.emit(a.ModelAdded)
  18448. }
  18449. ,
  18450. n.prototype.getModel = function(e) {
  18451. return this.modelMap[e]
  18452. }
  18453. ,
  18454. n.prototype.activateModel = function(e) {
  18455. var t = this.modelMap[e];
  18456. if (!t)
  18457. throw new o("Tried to activate invalid model!");
  18458. var i = this.activeModel;
  18459. this.activeModel = t,
  18460. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18461. this.tileDownloader.setUrls(t.urls),
  18462. t.panos.forEach(function(e) {
  18463. e.attachToPanoRenderer(this.panoRenderer),
  18464. e.tileDownloader = this.tileDownloader,
  18465. e.qualityManager = this.qualityManager
  18466. }
  18467. .bind(this)),
  18468. this.emit(a.ActiveModelChanged, {
  18469. oldModel: i,
  18470. model: t
  18471. })
  18472. }
  18473. ,
  18474. n.prototype.getActiveModel = function() {
  18475. return this.activeModel
  18476. }
  18477. ,
  18478. r.extend(n, l),
  18479. t.exports = n
  18480. }
  18481. , {
  18482. "../enum/ModelManagerEvents": 33,
  18483. "../enum/PanoRendererEvents": 35,
  18484. "../exception/BasicException": 55,
  18485. "../util/common": 185,
  18486. events: 202,
  18487. three: 217
  18488. }],
  18489. 141: [function(e, t, i) {
  18490. (function(i) {
  18491. "use strict";
  18492. function n() {
  18493. s.call(this)
  18494. }
  18495. var r = e("../objects/Room")
  18496. , o = (e("../settings"),
  18497. e("../util/logger"))
  18498. , a = (e("../util/transitions"),
  18499. e("../util/easing"),
  18500. e("../util/common"))
  18501. , s = e("../util/IndexedCollection")
  18502. , l = e("./Chunks");
  18503. new o(i);
  18504. a.inherit(n, s),
  18505. n.prototype.getIndex = function(e) {
  18506. return e.roomId
  18507. }
  18508. ,
  18509. n.prototype.calcRoomBoundaries = function() {
  18510. this.forEach(function(e) {
  18511. e.calcBoundaries()
  18512. })
  18513. }
  18514. ,
  18515. n.prototype.createFromChunks = function(e) {
  18516. var t = {
  18517. floorId: -1,
  18518. roomId: -1
  18519. }
  18520. , i = {};
  18521. e.forEach(function(e) {
  18522. l.parseIdsFromChunkName(e.name, t);
  18523. var o = i[t.roomId];
  18524. if (!o) {
  18525. var a = n.generateRoomId(t.floorId, t.roomId);
  18526. o = new r(t.floorId,a),
  18527. this.add(o),
  18528. i[t.roomId] = o
  18529. }
  18530. o.addChunk(e)
  18531. }
  18532. .bind(this)),
  18533. this.calcRoomBoundaries()
  18534. }
  18535. ,
  18536. n.generateRoomId = function(e, t) {
  18537. return e + "_" + t
  18538. }
  18539. ,
  18540. t.exports = n
  18541. }
  18542. ).call(this, "/js/model/RoomCollection.js")
  18543. }
  18544. , {
  18545. "../objects/Room": 150,
  18546. "../settings": 166,
  18547. "../util/IndexedCollection": 175,
  18548. "../util/common": 185,
  18549. "../util/easing": 186,
  18550. "../util/logger": 189,
  18551. "../util/transitions": 195,
  18552. "./Chunks": 135
  18553. }],
  18554. 142: [function(e, t, i) {
  18555. "use strict";
  18556. function n(e, t, i) {
  18557. e = e.clone().expandByScalar(0.01);//改
  18558. var n = e.size()
  18559. , o = new r.BoxGeometry(n.x,n.y,n.z);
  18560. o.boundingBox = e,
  18561. r.Mesh.call(this, o, t),
  18562. this.position.copy(e.center()),
  18563. this.frustumCulled = !1,
  18564. i && this.add(new r.WireframeHelper(this))
  18565. }
  18566. var r = e("three");
  18567. n.prototype = Object.create(r.Mesh.prototype),
  18568. n.prototype.constructor = n,
  18569. t.exports = n
  18570. }
  18571. , {
  18572. three: 217
  18573. }],
  18574. 143: [function(e, t, i) {
  18575. (function(i) {
  18576. "use strict";
  18577. function n(e) {
  18578. h.time("Computing a nice bounding cubemap");
  18579. var t = new a({
  18580. side: r.BackSide,
  18581. transparent: !0
  18582. });
  18583. t.uniforms.modelAlpha.value = 0,
  18584. t.uniforms.opacity.value = 1 - s.modelAlpha,
  18585. this.renderOrder = l.boundingSkybox,
  18586. o.call(this, e, t),
  18587. h.timeEnd("Computing a nice bounding cubemap")
  18588. }
  18589. var r = e("three")
  18590. , o = (e("../enum/Viewmode"),
  18591. e("../shaders"),
  18592. e("./BoundingMesh"))
  18593. , a = e("../materials/ModelTextureMaterial")
  18594. , s = e("../settings")
  18595. , l = e("../enum/RenderOrder")
  18596. , c = e("../util/logger")
  18597. , h = new c(i);
  18598. n.prototype = Object.create(o.prototype),
  18599. n.prototype.constructor = n,
  18600. t.exports = n
  18601. }
  18602. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  18603. }
  18604. , {
  18605. "../enum/RenderOrder": 42,
  18606. "../enum/Viewmode": 51,
  18607. "../materials/ModelTextureMaterial": 118,
  18608. "../settings": 166,
  18609. "../shaders": 167,
  18610. "../util/logger": 189,
  18611. "./BoundingMesh": 142,
  18612. three: 217
  18613. }],
  18614. 144: [function(e, t, i) {
  18615. "use strict";
  18616. function n(e) {
  18617. this.materialInside = new s({
  18618. side: r.DoubleSide
  18619. });
  18620. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  18621. this.materialOutside = new r.RawShaderMaterial({
  18622. fragmentShader: o.modelOutside.fragmentShader,
  18623. vertexShader: o.modelOutside.vertexShader,
  18624. uniforms: t,
  18625. side: r.FrontSide,
  18626. name: "chunkOut"
  18627. }),
  18628. r.Mesh.call(this, e.geometry, this.materialInside),
  18629. this.name = e.name || "",
  18630. this.textureName = e.textureName,
  18631. this.meshUrl = e.meshUrl
  18632. }
  18633. var r = e("three")
  18634. , o = e("../shaders")
  18635. , a = e("../enum/Viewmode")
  18636. , s = e("../materials/ModelTextureMaterial");
  18637. n.prototype = Object.create(r.Mesh.prototype),
  18638. n.prototype.setTextureMap = function(e) {
  18639. this.materialInside.uniforms.map.value = e,
  18640. this.materialOutside.uniforms.map.value = e
  18641. }
  18642. ,
  18643. n.prototype.setMode = function(e) {
  18644. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  18645. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  18646. t.transparent = this.material.transparent,
  18647. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  18648. this.material = t
  18649. }
  18650. ,
  18651. t.exports = n
  18652. }
  18653. , {
  18654. "../enum/Viewmode": 51,
  18655. "../materials/ModelTextureMaterial": 118,
  18656. "../shaders": 167,
  18657. three: 217
  18658. }],
  18659. 145: [function(e, t, i) {
  18660. "use strict";
  18661. function n(e) {
  18662. this.chunksize = e || 10,
  18663. this.chunks = {},
  18664. this.boundingBoxes = {},
  18665. this.children = [],
  18666. this.offset = new r.Vector3(0,.5,0),
  18667. this.material = new r.MeshBasicMaterial({
  18668. color: 16777215 * Math.random(),
  18669. side: r.DoubleSide
  18670. })
  18671. }
  18672. var r = e("three");
  18673. e("../enum/Viewmode");
  18674. n.prototype.add = function(e) {
  18675. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  18676. m ? (t = m.position.array,
  18677. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  18678. n = e.faces);
  18679. var v = new r.Vector3;
  18680. if (i)
  18681. for (o = 0,
  18682. a = i.length; o < a; o += 3) {
  18683. var A = 3 * i[o]
  18684. , y = 3 * i[o + 1]
  18685. , C = 3 * i[o + 2];
  18686. s = (t[A] + t[y] + t[C]) / 3,
  18687. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  18688. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  18689. h = Math.floor(s / this.chunksize),
  18690. u = Math.floor(l / this.chunksize),
  18691. d = Math.floor(c / this.chunksize),
  18692. p = h + "." + u + "." + d,
  18693. p in this.chunks ? (g = this.chunks[p],
  18694. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18695. f = this.boundingBoxes[p] = new r.Box3),
  18696. 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]),
  18697. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18698. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18699. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18700. }
  18701. else
  18702. for (o = 0,
  18703. a = t.length; o < a; o += 9)
  18704. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  18705. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  18706. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  18707. h = Math.floor(s / this.chunksize),
  18708. u = Math.floor(l / this.chunksize),
  18709. d = Math.floor(c / this.chunksize),
  18710. p = h + "." + u + "." + d,
  18711. p in this.chunks ? (g = this.chunks[p],
  18712. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  18713. f = this.boundingBoxes[p] = new r.Box3),
  18714. 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]),
  18715. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18716. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18717. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18718. }
  18719. ,
  18720. n.prototype.build = function() {
  18721. var e = new r.Object3D;
  18722. e.material = this.material;
  18723. for (var t in this.chunks) {
  18724. var i = this.chunks[t]
  18725. , n = new r.BufferGeometry;
  18726. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  18727. n.boundingBox = this.boundingBoxes[t];
  18728. var o = new r.Mesh(n,this.material);
  18729. o.material.visible = !1,
  18730. e.add(o),
  18731. this.chunks[t] = []
  18732. }
  18733. return e
  18734. }
  18735. ,
  18736. t.exports = n
  18737. }
  18738. , {
  18739. "../enum/Viewmode": 51,
  18740. three: 217
  18741. }],
  18742. 146: [function(e, t, i) {
  18743. "use strict";
  18744. var r = e("three")
  18745. , o = e("../settings")
  18746. , a = e("../util/common")
  18747. , s = e("../util/lerp")
  18748. , l = e("./ChunkedCollider")
  18749. , c = e("../util/transitions")
  18750. , h = e("../util/easing")
  18751. , u = (e("../objects/Panorama"),
  18752. e("../enum/RenderOrder"))
  18753. , d = e("../localization/localize");
  18754. function n(e, t, i) {
  18755. r.Object3D.call(this),
  18756. this.model = e,
  18757. this.floorIndex = t,
  18758. this.lang = o.languageTag,
  18759. this.name = i || o.languageTag === "cn" ? "Floor " + (t + 1) + "" : "第" + (t + 1) + "层",
  18760. this.panos = [],
  18761. this.chunks = [],
  18762. this.colliderBuilder = new l(3),
  18763. this.collider = null,
  18764. this.center = null,
  18765. this.boundingBox = new r.Box3,
  18766. this.size = null,
  18767. this.hidden = !1,
  18768. this.conservativeBoundingBox = new r.Box3,
  18769. this.debugColor = 16777215 * Math.random(),
  18770. this.transition = null
  18771. }
  18772. n.prototype = Object.create(r.Object3D.prototype),
  18773. n.prototype.enter = function(e) {
  18774. this.model.setFloor(this, e)
  18775. }
  18776. ,
  18777. n.prototype.hide = function(e) {
  18778. if (!this.hidden || this.transition) {
  18779. this.chunks.forEach(function(e) {
  18780. e.material.transparent = !0
  18781. }),
  18782. c.cancel(this.transition);
  18783. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  18784. , i = e ? 0 : o.hideFloorDelay / t;
  18785. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  18786. this.hidden = !0
  18787. }
  18788. .bind(this), i, h.easeInOutQuad)
  18789. }
  18790. }
  18791. ,
  18792. n.prototype.show = function(e) {
  18793. if (this.hidden || this.transition) {
  18794. this.hidden = !1,
  18795. c.cancel(this.transition);
  18796. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  18797. , i = e ? 0 : o.showFloorDelay / t;
  18798. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  18799. this.hidden || this.chunks.forEach(function(e) {
  18800. e.material.transparent = !1
  18801. })
  18802. }
  18803. .bind(this), i, h.easeInOutQuad)
  18804. }
  18805. }
  18806. ,
  18807. n.prototype.toggle = function(e, t) {
  18808. e = void 0 === e ? this.hidden : e,
  18809. e ? this.show(t) : this.hide(t)
  18810. }
  18811. ,
  18812. n.prototype.containsPoint = function(e) {
  18813. return this.collider.children.some(function(t) {
  18814. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  18815. t.geometry.boundingBox.containsPoint(e)
  18816. })
  18817. }
  18818. ,
  18819. n.prototype.distanceToPoint = function(e) {
  18820. var t = null
  18821. , i = 1 / 0;
  18822. return this.collider.children.forEach(function(n) {
  18823. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  18824. var r = n.geometry.boundingBox.distanceToPoint(e);
  18825. (!t || i > r) && (i = r,
  18826. t = n)
  18827. }),
  18828. i
  18829. }
  18830. ,
  18831. n.prototype.addChunk = function(e) {
  18832. e.renderOrder = u.ghostFloor,
  18833. this.add(e),
  18834. this.chunks.push(e),
  18835. this.boundingBox.union(e.geometry.boundingBox),
  18836. this.size = this.boundingBox.size(),
  18837. this.colliderBuilder.add(e.geometry)
  18838. }
  18839. ,
  18840. n.prototype.addPano = function(e) {
  18841. this.panos.push(e),
  18842. this.add(e.skyboxMesh),
  18843. e.marker && this.add(e.marker);
  18844. if(e.neighbourUUIDs && e.neighbourUUIDs.length){//add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18845. var t = new r.Vector3(1,1,1)
  18846. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  18847. this.boundingBox.union(i)
  18848. }
  18849. }
  18850. ,
  18851. n.prototype.build = function() {
  18852. this.collider = this.colliderBuilder.build(!0),
  18853. this.add(this.collider),
  18854. this.center = this.boundingBox.center(),
  18855. this.conservativeBoundingBox.copy(this.boundingBox),
  18856. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  18857. return e.geometry.boundingBox.min.y
  18858. }), 5),
  18859. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  18860. return e.geometry.boundingBox.max.y
  18861. }), 5)
  18862. if(!settings.extractFloor || !settings.extractFloor[window.number]){
  18863. this.colliderBuilder = null
  18864. }
  18865. }
  18866. ,
  18867. n.prototype.toShortString = function() {
  18868. return a.nth(this.floorIndex + 1)
  18869. }
  18870. ,
  18871. n.prototype.toString = function() {
  18872. return this.name
  18873. }
  18874. ,
  18875. n.prototype.constructor = n, //add
  18876. t.exports = n
  18877. }
  18878. , {
  18879. "../enum/RenderOrder": 42,
  18880. "../localization/localize": 108,
  18881. "./strings-cn-CN": 109,
  18882. "../objects/Panorama": 148,
  18883. "../settings": 166,
  18884. "../util/common": 185,
  18885. "../util/easing": 186,
  18886. "../util/lerp": 188,
  18887. "../util/transitions": 195,
  18888. "./ChunkedCollider": 145,
  18889. three: 217
  18890. }],
  18891. 147: [function(e, t, i) {
  18892. "use strict";
  18893. function n(e) {
  18894. this.player = e,
  18895. this.obj3d = null,
  18896. this.UP = new r.Vector3(0,1,0)
  18897. }
  18898. var r = e("three")
  18899. , o = e("../settings");
  18900. n.prototype.prefs = {
  18901. linewidth: 3,
  18902. height: .07,
  18903. opacity: .45,
  18904. endScale: .05
  18905. },
  18906. n.prototype.discard = function() {
  18907. if (this.obj3d) {
  18908. var e = this.obj3d.parent;
  18909. e && e.remove(this.obj3d)
  18910. }
  18911. this.obj3d = null
  18912. }
  18913. ,
  18914. n.prototype.draw = function() {
  18915. if (this.discard(),
  18916. o.showNeighbors) {
  18917. var e = this.player.currentPano.floor;
  18918. this.obj3d = new r.Object3D;
  18919. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  18920. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  18921. i.y += this.prefs.height;
  18922. var n = .1525
  18923. , a = .127
  18924. , s = .0127
  18925. , l = .1
  18926. , c = .19
  18927. , h = .2032
  18928. , u = .2286
  18929. , d = .255
  18930. , p = new r.Matrix4;
  18931. for (var f in t)
  18932. if (t[f]) {
  18933. var g = this.player.model.panos.get(f)
  18934. , m = (g.position.clone().sub(this.player.model.position),
  18935. g.position.clone().sub(g.floorPosition))
  18936. , v = g.floorPosition.clone().sub(this.player.model.position);
  18937. v.y += this.prefs.height;
  18938. var A = new r.Geometry;
  18939. 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)),
  18940. 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)),
  18941. p.identity().setPosition(m),
  18942. A.applyMatrix(p),
  18943. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18944. 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)),
  18945. p.lookAt(v, i, this.UP).setPosition(v),
  18946. A.applyMatrix(p),
  18947. A.vertices.push(v, i);
  18948. var y = new r.Line(A,new r.LineBasicMaterial({
  18949. color: g.debugColor.getHex(),
  18950. transparent: !0,
  18951. opacity: this.prefs.opacity,
  18952. depthWrite: !1,
  18953. name: "sLine" + f,
  18954. linewidth: this.prefs.linewidth
  18955. }));
  18956. this.obj3d.add(y)
  18957. }
  18958. e.add(this.obj3d)
  18959. }
  18960. }
  18961. ,
  18962. n.prototype.update = function() {
  18963. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18964. }
  18965. ,
  18966. t.exports = n
  18967. }
  18968. , {
  18969. "../settings": 166,
  18970. three: 217
  18971. }],
  18972. 148: [function(e, t, i) {
  18973. (function(i) {
  18974. "use strict";
  18975. function n(e, t, i, n) {
  18976. this.model = e,
  18977. this.id = t,
  18978. this.alignmentType = i.alignmentType || l.ALIGNED,
  18979. this.neighbourUUIDs = i.neighbours || null,
  18980. this.neighbourPanos = null,
  18981. this.floor = null,
  18982. this.floorIndex = i.floor,
  18983. this.failedLoadingAt = 0,
  18984. this.maxLoadRetries = 4,
  18985. this.origin = i.position.clone(),
  18986. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18987. this.quaternion = i.quaternion.clone(),
  18988. this.skyboxMesh = new r.Mesh(E),
  18989. this.skyboxMesh.position.copy(this.position),
  18990. this.skyboxMesh.quaternion.copy(this.quaternion),
  18991. this.skyboxMesh.name = "skybox",
  18992. this.skyboxMesh.visible = !1,
  18993. this.skyboxMesh.updateMatrix(),
  18994. this.skyboxMesh.updateMatrixWorld(),
  18995. this.marker = null,
  18996. this.showFloorMarker = !window.DATA.hideFloorMarker;
  18997. if(this.isAligned() ){
  18998. this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18999. map: w,
  19000. side: r.DoubleSide,
  19001. opacity: 0,
  19002. transparent: !0,
  19003. depthWrite: !1
  19004. })),
  19005. this.marker.visible = false //改:先不显示,之后根据opacity显示
  19006. this.marker.renderOrder = s.panoMarker,
  19007. this.marker.name = "marker",
  19008. this.marker.pano = this,
  19009. this.marker.layers.set(v.PANOMARKERS),
  19010. this.marker.updateMatrixWorld()
  19011. if(!window.DATA.hideFloorMarker){//xzw
  19012. let opa = this.marker.material.opacity
  19013. Object.defineProperty(this.marker.material, 'opacity', {
  19014. get: function () {
  19015. return opa
  19016. },
  19017. set: (o)=>{
  19018. opa = o
  19019. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  19020. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  19021. //console.log(o,this.id,this.marker.visible)
  19022. },
  19023. })
  19024. }
  19025. a.colorMarkerOnLoad && this.on("load", function() {
  19026. this.marker.material.color.set(65280)
  19027. })
  19028. }
  19029. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  19030. this.floorPosition = i.puck ? i.puck.clone() : null,
  19031. this.tiled = n,
  19032. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  19033. this.solidSkybox.flipY = !1,
  19034. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  19035. this.solidSkybox.magFilter = r.LinearFilter,
  19036. this.solidSkybox.generateMipmaps = !1)),
  19037. this.zoomed = !1,
  19038. this.panoRenderer = null,
  19039. this.qualityManager = null,
  19040. this.tileDownloader = null,
  19041. this.tiledPanoRenderTarget = null,
  19042. this.minimumTiledPanoLoaded = !1,
  19043. this.highestPartialTileRenderOpCompleted = 0,
  19044. this.highestFullTileRenderOpCompleted = 0,
  19045. this.shouldRedrawOnBaseLoaded = !1,
  19046. this.lockUntilRenderingComplete = !1,
  19047. a.colorMarkerOnLoad && this.on("load", function() {
  19048. this.marker.material.color.set(65280)
  19049. });
  19050. /********************************************************************fyz改vr from徐世廷*************************************************************/
  19051. var e = new r.TextureLoader;
  19052. e.setCrossOrigin(!0);
  19053. var g = e.load("images/texture.jpg");
  19054. if (this.vrMarker = new r.Mesh(new r.OctahedronGeometry(.1,0),new r.MeshLambertMaterial({
  19055. color: 16777215,
  19056. transparent: !0,
  19057. opacity: .75,
  19058. map: g
  19059. })),
  19060. this.vrMarker.boluoType = "vr",
  19061. this.vrMarker.position.z = 1,
  19062. this.vrMarker.enabled = !0,
  19063. this.vrMarker.visible = !1,
  19064. window.vrMarkers = window.vrMarkers || [],
  19065. window.vrMarkers.push(this.vrMarker),
  19066. this.marker && this.marker.add(this.vrMarker),
  19067. a.showAxis && (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,1,0),new r.Vector3(0,0,0),1,255)),
  19068. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0,0,1),new r.Vector3(0,0,0),1,16711680)),
  19069. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1,0,0),new r.Vector3(0,0,0),1,65280))),
  19070. this.adjustAngleEnable) {
  19071. var i = new r.Quaternion;
  19072. i.setFromAxisAngle(new r.Vector3(1,0,0), this.adjustAngleX),
  19073. this.skyboxMesh.quaternion.multiply(i);
  19074. var m = new r.Quaternion;
  19075. m.setFromAxisAngle(new r.Vector3(0,1,0), this.adjustAngleY),
  19076. this.skyboxMesh.quaternion.multiply(m);
  19077. var n = new r.Quaternion;
  19078. n.setFromAxisAngle(new r.Vector3(0,0,1), this.adjustAngleZ),
  19079. this.skyboxMesh.quaternion.multiply(n),
  19080. this.skyboxMesh.updateMatrix(),
  19081. this.skyboxMesh.updateMatrixWorld(),
  19082. this.model.updateProjectedPanos()
  19083. }
  19084. /**************************************************************************************************************************************/
  19085. }
  19086. var r = e("three")
  19087. , o = e("../util/logger")
  19088. , a = e("../settings")
  19089. , s = (e("../enum/Viewmode"),
  19090. e("../enum/RenderOrder"))
  19091. , l = e("../enum/AlignmentType")
  19092. , c = (e("../util/common"),
  19093. e("../util/transitions"))
  19094. , h = e("../util/lerp")
  19095. , u = e("../util/ajax")
  19096. , d = e("../util/texture")
  19097. , p = e("../util/panorama")
  19098. , f = (e("../enum/TileDownloaderEvents"),
  19099. e("../enum/PanoramaEvents"))
  19100. , g = e("../enum/PanoRendererEvents")
  19101. , m = e("../enum/PanoSizeClass")
  19102. , v = e("../enum/RenderLayers")
  19103. , A = (e("../scene/SceneRenderer"),
  19104. e("../enum/GLCubeFaces"),
  19105. e("../exception/BasicException"))
  19106. , y = e("../tile/TileUtils")
  19107. , C = e("events").EventEmitter
  19108. , I = new o(i)
  19109. , E = new r.SphereBufferGeometry(.1)
  19110. , b = new r.PlaneBufferGeometry(.35,.35,1,1)
  19111. , w = d.load("images/marker.png");
  19112. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  19113. n.prototype = Object.create(C.prototype),
  19114. n.prototype.enter = function() {
  19115. var e = null;
  19116. return function() {
  19117. this.setZoomed(!1),
  19118. this.emit("enter", {
  19119. oldPano: e,
  19120. newPano: this
  19121. }),
  19122. e = this
  19123. this.model.setHighMap(this) //add
  19124. }
  19125. }(),
  19126. n.prototype.exit = function() {
  19127. this.tiled ? (this.clearWaitDeferreds(),
  19128. this.minimumTiledPanoLoaded = !1,
  19129. this.tiledPanoRenderTarget = null,
  19130. this.setZoomed(!1),
  19131. this.panoRenderer.deactivateTiledPano(this),
  19132. this.highestPartialTileRenderOpCompleted = 0,
  19133. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  19134. this.solidSkybox.loaded = !1,
  19135. this.solidSkybox.version = 0),
  19136. this.emit("exit")
  19137. }
  19138. ,
  19139. n.prototype.hoverOn = function(e) {
  19140. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  19141. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  19142. }
  19143. ,
  19144. n.prototype.hoverOff = function(e) {
  19145. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  19146. }
  19147. ,
  19148. n.prototype.build1 = function() {
  19149. 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),
  19150. this.floor.addPano(this),
  19151. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  19152. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  19153. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  19154. }
  19155. ,
  19156. n.prototype.build2 = function() {
  19157. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  19158. this.height = this.position.distanceTo(this.floorPosition),
  19159. this.placeMarker()
  19160. }
  19161. ,
  19162. n.prototype.interpolateFloorPosition = function() {
  19163. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  19164. return !!e.floorPosition
  19165. }).sort(function(e, t) {
  19166. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  19167. }
  19168. .bind(this))
  19169. , t = this.position.clone();
  19170. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  19171. t
  19172. }
  19173. ,
  19174. n.prototype.raycastFloorPosition = function() {
  19175. I.warn("Performance warning: Raycasting to find floor position");
  19176. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  19177. , t = e.intersectObjects(this.model.colliders);
  19178. return t.length ? t[0].point : null
  19179. }
  19180. ,
  19181. n.prototype.raycastToFindFloor = function() {
  19182. 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)];
  19183. return function() {
  19184. I.warn("Performance warning: Raycasting to find floor index");
  19185. for (var t = 0; t < e.length; t++) {
  19186. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  19187. , n = i.intersectObjects(this.model.colliders);
  19188. if (n.length)
  19189. return n[0].object.parent.parent
  19190. }
  19191. return null
  19192. }
  19193. }(),
  19194. n.prototype.placeMarker = function() {
  19195. this.marker && (this.marker.position.copy(this.floorPosition),
  19196. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  19197. this.marker.position.y += settings.markerHeight,
  19198. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  19199. }
  19200. ,
  19201. n.prototype.translate = function(e) {
  19202. this.position.add(e),
  19203. this.floorPosition.add(e)
  19204. }
  19205. ,
  19206. n.prototype.findClosestMidtpointPanoTo = function(e) {
  19207. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  19208. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19209. }
  19210. ,
  19211. n.prototype.attachToPanoRenderer = function(e) {
  19212. this.panoRenderer = e,
  19213. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19214. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19215. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19216. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19217. }
  19218. ;
  19219. var _ = {};
  19220. n.prototype.getWaitDeferred = function(e) {
  19221. var t = _[this.id];
  19222. t || (t = {},
  19223. _[this.id] = t);
  19224. var i = t[e];
  19225. return i || (i = {
  19226. deferred: $.Deferred(),
  19227. active: !1
  19228. },
  19229. t[e] = i),
  19230. i
  19231. }
  19232. ,
  19233. n.prototype.resetWaitDeferred = function(e) {
  19234. var t = this.getWaitDeferred(e);
  19235. t.active = !1,
  19236. t.deferred = $.Deferred()
  19237. }
  19238. ,
  19239. n.prototype.clearWaitDeferreds = function() {
  19240. var e = _[this.id];
  19241. e || (e = {},
  19242. _[this.id] = e);
  19243. for (var t in e)
  19244. if (e.hasOwnProperty(t)) {
  19245. var i = e[t];
  19246. i.active = !1,
  19247. i.deferred = $.Deferred()
  19248. }
  19249. }
  19250. ,
  19251. n.prototype.loadTiledPano = function() {
  19252. var e = (new r.Vector3,
  19253. [])
  19254. , t = [];
  19255. return function(i, n, r, o, a, s) {
  19256. null !== o && void 0 !== o || (o = !0),
  19257. null !== a && void 0 !== a || (a = !0);
  19258. var l = this.getWaitDeferred(i)
  19259. , c = l.deferred
  19260. , h = null
  19261. , u = null;
  19262. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  19263. u = r.vFov)),
  19264. !this.isLoaded(i)) {
  19265. if (!l.active) {
  19266. if (l.active = !0,
  19267. r) {
  19268. var d = y.matchingTilesInDirection(this, i, n, h, u);
  19269. e[this.id + ":" + i] = {
  19270. tileCount: 0,
  19271. targetTileCount: d
  19272. },
  19273. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  19274. }
  19275. t[this.id] || (t[this.id] = !0,
  19276. this.on(f.LoadComplete, function(e, t) {
  19277. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  19278. var i = this.getWaitDeferred(e).deferred;
  19279. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  19280. this.resetWaitDeferred(e))
  19281. }
  19282. .bind(this)),
  19283. this.on(f.LoadFailed, function(e) {
  19284. var t = this.getWaitDeferred(e).deferred;
  19285. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  19286. this.resetWaitDeferred(e))
  19287. }
  19288. .bind(this)),
  19289. this.on(f.TileLoaded, function(t, i, n) {
  19290. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  19291. var r = this.getWaitDeferred(t).deferred;
  19292. if (r && "pending" === r.state()) {
  19293. r.notify(t, i, n);
  19294. var o = e[this.id + ":" + t];
  19295. o && (o.tileCount++,
  19296. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  19297. r.resolve(t, n),
  19298. this.resetWaitDeferred(t)))
  19299. }
  19300. }
  19301. .bind(this)))
  19302. }
  19303. this.tileDownloader.clearForceQueue(),
  19304. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19305. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, Math.min(2048, this.qualityManager.getMaxNavPanoSize()) , o), //不要超过2048否则漫游到下一个点时卡顿
  19306. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19307. }
  19308. return c.promise()
  19309. }
  19310. }(),
  19311. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  19312. if (e === this.id) {
  19313. var n = this.qualityManager.getPanoSize(m.BASE);
  19314. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  19315. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  19316. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19317. }
  19318. }
  19319. ,
  19320. n.prototype.onTileRendered = function(e, t, i, n) {
  19321. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19322. }
  19323. ,
  19324. n.prototype.onPanoRendered = function(e, t, i, n) {
  19325. e === this.id && (this.minimumTiledPanoLoaded = !0,
  19326. this.updateSkyboxForZoomLevel(),
  19327. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19328. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19329. this.emit("load", t),
  19330. this.model.emit("load", this),
  19331. this.emit(f.LoadComplete, t, i))
  19332. }
  19333. ,
  19334. n.prototype.setZoomed = function(e) {
  19335. this.zoomed = e,
  19336. this.updateSkyboxForZoomLevel()
  19337. if(e){ //add
  19338. if(player.qualityManager.getNavZoomClass() != '1k' ){
  19339. this.model.showHighMap()
  19340. }
  19341. }else{
  19342. this.model.hideHighMap()
  19343. }
  19344. }
  19345. ,
  19346. n.prototype.ensureSkyboxReadyForRender = function() {
  19347. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  19348. this.solidSkybox.loaded = !0)
  19349. }
  19350. ,
  19351. n.prototype.updateSkyboxForZoomLevel = function() {
  19352. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19353. }
  19354. ,
  19355. n.prototype.getSkyboxTexture = function() {
  19356. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19357. if(!this.tiled){
  19358. return this.solidSkybox
  19359. }
  19360. if(this.minimumTiledPanoLoaded)
  19361. {
  19362. if(this.zoomed && (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize|| player.qualityManager.getNavZoomClass() == '4k' ))//change 如果放大后和不放大都是2k就不用这个
  19363. {
  19364. return this.panoRenderer.zoomRenderTarget.texture;
  19365. }
  19366. else
  19367. {
  19368. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping//add
  19369. return this.tiledPanoRenderTarget.texture;
  19370. }
  19371. }
  19372. else
  19373. {
  19374. return null;
  19375. }
  19376. }
  19377. ,
  19378. n.prototype.onTileRenderFail = function(e, t, i) {
  19379. e === this.id && this.emit(f.LoadFailed, t)
  19380. }
  19381. ,
  19382. n.prototype.isLoaded = function(e) {
  19383. if (this.tiled) {
  19384. if (e && "string" == typeof e)
  19385. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  19386. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19387. }
  19388. if (e && "number" == typeof e)
  19389. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  19390. return !!this.solidSkybox.high || e in this.solidSkybox
  19391. }
  19392. ,
  19393. n.prototype.loadCube = function(e) {
  19394. if (this.isLoaded(e))
  19395. return I.info("Skipping load of pano, already loaded"),
  19396. $.when();
  19397. this.emit("loading", e),
  19398. this.model.emit("loading", this);
  19399. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  19400. , i = t.filter(function(e) {
  19401. return !e
  19402. });
  19403. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  19404. e = "high",
  19405. t = p.getCubemapUrls(this.model.urls, this.id, e));
  19406. var n = 0
  19407. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  19408. return u.getImage(t[i])
  19409. }
  19410. .bind(this));
  19411. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  19412. return this.solidSkybox[e] = [t, i, n, r, o, a],
  19413. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  19414. this.solidSkybox.low = null),
  19415. this.solidSkybox.needsUpdate = !0,
  19416. this.emit("load", e),
  19417. this.model.emit("load", this),
  19418. this
  19419. }
  19420. .bind(this), function() {
  19421. I.error("Downloading cubemap for pano", this.id, "failed"),
  19422. this.failedLoadingAt = Date.now()
  19423. }
  19424. .bind(this), function() {
  19425. return $.when(++n, 6)
  19426. })
  19427. }
  19428. ,
  19429. n.raycastsSkipped = 0,
  19430. n.raycastsDone = 0,
  19431. n.prototype.findNeighourPanos = function() {
  19432. return this.model.panos.setNeighbour(this.id, this.id, !1),
  19433. this.model.panos.forEach(function(e) {
  19434. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19435. var t = this.position.distanceTo(e.position);
  19436. if (t > a.panoramaNeighbourMaxDistance)
  19437. return this.model.panos.setNeighbour(this, e, !1),
  19438. void n.raycastsSkipped++;
  19439. var i = e.position.clone().sub(this.position).normalize()
  19440. , o = new r.Raycaster(this.position,i.clone(),0,t)
  19441. , s = o.intersectObjects(this.model.colliders);
  19442. n.raycastsDone++,
  19443. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19444. 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)))
  19445. }
  19446. }
  19447. .bind(this)),
  19448. this.model.panos.neighbourMap[this.id]
  19449. }
  19450. ,
  19451. n.prototype.worldPosition = function() {
  19452. return this.position
  19453. }
  19454. ,
  19455. n.prototype.addLabel = function() {
  19456. this.removeLabel()
  19457. this.label = new TextSprite({
  19458. sizeInfo: {
  19459. minSize: 100,
  19460. maxSize: 200,
  19461. nearBound: 0.7,
  19462. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  19463. farBoundPlan: 100,
  19464. },
  19465. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  19466. textColor: { r: 0, g: 0, b: 0, a: 1 },
  19467. borderRadius: 15,
  19468. renderOrder: 5,
  19469. text: this.id //`${this.id}-f${this.floorIndex}`
  19470. })
  19471. let position = this.floorPosition.clone()
  19472. position.y += 0.2
  19473. this.label.position.copy(position)
  19474. this.floor.add(this.label)
  19475. },
  19476. n.prototype.removeLabel = function() {
  19477. this.label && (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  19478. },
  19479. /* n.prototype.addTextSprite = function(e, t) {
  19480. this.removeTextSprite();
  19481. var i = document.createElement("canvas")
  19482. , n = i.getContext("2d");
  19483. i.width = 256,
  19484. i.height = 256;
  19485. var o = "Arial"
  19486. , a = 60;
  19487. n.font = "bold " + a + "px " + o,
  19488. n.fillStyle = "white";
  19489. var s = n.measureText(e).width;
  19490. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19491. var l = new r.Texture(i);
  19492. l.needsUpdate = !0;
  19493. var c = new r.SpriteMaterial({
  19494. map: l,
  19495. color: t || 16428055
  19496. });
  19497. this.text3d = new r.Sprite(c),
  19498. this.text3d.position.copy(this.skyboxMesh.position),
  19499. this.floor.add(this.text3d)
  19500. }
  19501. ,
  19502. n.prototype.removeTextSprite = function() {
  19503. this.text3d && (this.floor.remove(this.text3d),
  19504. this.text3d = null)
  19505. }*/
  19506. n.prototype.isAligned = function() {
  19507. return this.alignmentType === l.ALIGNED
  19508. }
  19509. ,
  19510. n.filters = {
  19511. inDirection: function(e, t, i) {
  19512. return function(n) {
  19513. var r = n.position.clone().sub(e).normalize();
  19514. return r.dot(t) > i
  19515. }
  19516. },
  19517. inFloorDirection: function(e, t, i) {
  19518. return function(n) {
  19519. var r = n.floorPosition.clone().sub(e).normalize();
  19520. return r.dot(t) > i
  19521. }
  19522. },
  19523. inPanoDirection: function(e, t, i) {
  19524. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  19525. function(n) {
  19526. var r = n.floorPosition.clone().sub(e).normalize()
  19527. , o = n.position.clone().sub(e).normalize();
  19528. return r.dot(t) > i || o.dot(t) > i
  19529. }
  19530. },
  19531. atFloor: function(e) {
  19532. return function(t) {
  19533. return !e || t.floor === e
  19534. }
  19535. },
  19536. not: function(e) {
  19537. return function(t) {
  19538. return t !== e
  19539. }
  19540. },
  19541. notIn: function(e) {
  19542. return function(t) {
  19543. return e.indexOf(t) === -1
  19544. }
  19545. },
  19546. isLoaded: function() {
  19547. return function(e) {
  19548. return e.isLoaded()
  19549. }
  19550. },
  19551. isNotLoaded: function() {
  19552. return function(e) {
  19553. return !e.isLoaded()
  19554. }
  19555. },
  19556. isCloseEnoughTo: function(e, t) {
  19557. return function(i) {
  19558. return e.distanceTo(i.floorPosition) < t
  19559. }
  19560. },
  19561. hasMinimumHeightDifferenceTo: function(e, t) {
  19562. return function(i) {
  19563. return Math.abs(i.position.y - e.y) > t
  19564. }
  19565. },
  19566. isNotBehindNormal: function(e, t) {
  19567. var i = new r.Vector3;
  19568. return t = t.clone(),
  19569. function(n) {
  19570. var r = i.copy(n.position).sub(e).normalize();
  19571. return r.dot(t) > 0
  19572. }
  19573. },
  19574. isNeighbourPanoTo: function(e) {
  19575. return function(t) {
  19576. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19577. }
  19578. },
  19579. isNeighbourOfNeighbourTo: function(e) {
  19580. return function(t) {
  19581. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  19582. var n = e.model.panos.get(i);
  19583. return !!n && n.neighbourPanos[t.id]
  19584. })
  19585. }
  19586. },
  19587. isNotRecentlyFailed: function(e) {
  19588. return function(t) {
  19589. return Date.now() - t.failedLoadingAt > e
  19590. }
  19591. },
  19592. isOnVisibleFloor: function() {
  19593. return function(e) {
  19594. return !e.floor.hidden
  19595. }
  19596. },
  19597. isPanoAligned: function() {
  19598. return function(e) {
  19599. return e.isAligned()
  19600. }
  19601. }
  19602. },
  19603. n.sortFunctions = {
  19604. distanceToPoint: function(e) {
  19605. return function(t, i) {
  19606. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19607. }
  19608. },
  19609. floorDistanceToPoint: function(e) {
  19610. return function(t, i) {
  19611. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19612. }
  19613. },
  19614. choose: function(e) {
  19615. return function(t, i) {
  19616. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19617. }
  19618. }
  19619. },
  19620. n.scoreFunctions = {
  19621. distance: function(e, t) {
  19622. return t = t || a.navigation.distanceFactor,
  19623. function(i) {
  19624. return e ? e.position.distanceTo(i.position) * t : 0
  19625. }
  19626. },
  19627. distanceSquared: function(e, t) {
  19628. return t = t || a.navigation.distanceFactor,
  19629. function(i) {
  19630. return e ? e.position.distanceToSquared(i.position) * t : 0
  19631. }
  19632. },
  19633. direction: function(e, t) {
  19634. return function(i) {
  19635. var n = i.position.clone().sub(e).normalize();
  19636. return n.dot(t) * a.navigation.directionFactor
  19637. }
  19638. },
  19639. angle: function(e, t) {
  19640. return function(i) {
  19641. var n = i.position.clone().sub(e).normalize();
  19642. return n.angleTo(t) * a.navigation.angleFactor
  19643. }
  19644. },
  19645. inFieldOfView: function(e, t) {
  19646. return function(i) {
  19647. var n = i.position.clone().sub(e).normalize();
  19648. return n.dot(t) > .75 ? 10 : -1
  19649. }
  19650. },
  19651. optionality: function(e) {
  19652. return function(t) {
  19653. var i = t.neighbourUUIDs.filter(function(t) {
  19654. return !(t in e.neighbourUUIDs) && t !== e.id
  19655. });
  19656. return i.length * a.navigation.optionalityFactor
  19657. }
  19658. },
  19659. penalizeHeightDifferenceUnder: function(e, t) {
  19660. return function(i) {
  19661. return e.y - i.position.y < t ? -20 : 0
  19662. }
  19663. }
  19664. },
  19665. t.exports = n
  19666. }
  19667. ).call(this, "/js/objects/Panorama.js")
  19668. }
  19669. , {
  19670. "../enum/AlignmentType": 17,
  19671. "../enum/GLCubeFaces": 25,
  19672. "../enum/PanoRendererEvents": 35,
  19673. "../enum/PanoSizeClass": 36,
  19674. "../enum/PanoramaEvents": 37,
  19675. "../enum/RenderLayers": 41,
  19676. "../enum/RenderOrder": 42,
  19677. "../enum/TileDownloaderEvents": 45,
  19678. "../enum/Viewmode": 51,
  19679. "../exception/BasicException": 55,
  19680. "../scene/SceneRenderer": 158,
  19681. "../settings": 166,
  19682. "../tile/TileUtils": 174,
  19683. "../util/ajax": 181,
  19684. "../util/common": 185,
  19685. "../util/lerp": 188,
  19686. "../util/logger": 189,
  19687. "../util/panorama": 191,
  19688. "../util/texture": 194,
  19689. "../util/transitions": 195,
  19690. events: 202,
  19691. three: 217
  19692. }],
  19693. 149: [function(e, t, i) {
  19694. "use strict";
  19695. function n(e) {
  19696. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  19697. t.map.value = d,
  19698. t.opacity.value = 0,
  19699. t.color.value.set(o.reticuleColor),
  19700. t.showMouseMarker = !window.DATA.hideMouseMarker;
  19701. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  19702. side: r.DoubleSide,
  19703. depthWrite: !1,
  19704. depthTest: !1,
  19705. transparent: !0,
  19706. vertexShader: c.waypoint.vertexShader,
  19707. fragmentShader: c.waypoint.fragmentShader,
  19708. uniforms: t,
  19709. name: "waypoint",
  19710. opacity: 0,
  19711. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19712. })),
  19713. this.layers.set(h.RETICULE),
  19714. this.renderOrder = u.reticule,
  19715. this.player = e,
  19716. this.direction = new r.Vector3,
  19717. this.hidden = !0,
  19718. this.mouseLastMoveTime = Date.now()
  19719. }
  19720. var r = e("three")
  19721. , o = e("../settings")
  19722. , a = e("../util/transitions")
  19723. , s = e("../util/texture")
  19724. , l = e("../util/lerp")
  19725. , c = e("../shaders")
  19726. , h = e("../enum/RenderLayers")
  19727. , u = e("../enum/RenderOrder")
  19728. , d = s.load("images/reticule.png");
  19729. d.anisotropy = browser.isMobile() ? 1 : 4; //各向异性
  19730. n.prototype = Object.create(r.Mesh.prototype),
  19731. n.prototype.move = function(e, t, i) {
  19732. this.hidden = i,
  19733. this.mouseLastMoveTime = Date.now()
  19734. }
  19735. ,
  19736. n.prototype.hide = function() {
  19737. this.hidden || (this.hidden = !0,
  19738. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  19739. }
  19740. ,
  19741. n.prototype.show = function() {
  19742. this.hidden = !1,
  19743. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19744. }
  19745. ,
  19746. n.prototype.update = function() {
  19747. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19748. }
  19749. ,
  19750. n.prototype.updatePosition = function(e, t) {
  19751. if (!this.hidden) {
  19752. if (!t)
  19753. return this.hide();
  19754. var i = t.point
  19755. , n = e.distanceTo(i)
  19756. , r = 1 + .01 * n;
  19757. n < 1 && (r -= 1 - n),
  19758. this.show(),
  19759. this.scale.set(r, r, r),
  19760. this.direction = this.direction.multiplyScalar(.8),
  19761. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  19762. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  19763. this.lookAt(this.position.clone().add(this.direction))
  19764. }
  19765. }
  19766. ,
  19767. n.prototype.writeAstag = function() {
  19768. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  19769. , t = new Date;
  19770. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  19771. var i = {
  19772. enabled: !0,
  19773. version: "0",
  19774. created: t.toISOString(),
  19775. created_by: "APITest",
  19776. position: this.position.clone(),
  19777. stem: {
  19778. enabled: o.tags.pole.enabled,
  19779. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19780. },
  19781. label: "tag " + this.tagCount,
  19782. description: "Description " + e,
  19783. floor: function(e) {
  19784. if (e.currentFloor) {
  19785. var t = e.floors.indexOf(e.currentFloor);
  19786. return t > -1 ? t : void 0
  19787. }
  19788. }(this.player.model),
  19789. type: "info",
  19790. metadata: {
  19791. preferred_camera: {
  19792. mode: this.player.mode
  19793. }
  19794. }
  19795. };
  19796. console.log("--------------------------"),
  19797. console.log(JSON.stringify(i));
  19798. var n = this.player.model.addtag(e, i).build();
  19799. n && (n.disc && this.player.tagDiscs.push(n.disc),
  19800. n.visible || n.show(o.tags.startup.fadeInDuration))
  19801. }
  19802. ,
  19803. t.exports = n
  19804. }
  19805. , {
  19806. "../enum/RenderLayers": 41,
  19807. "../enum/RenderOrder": 42,
  19808. "../settings": 166,
  19809. "../shaders": 167,
  19810. "../util/lerp": 188,
  19811. "../util/texture": 194,
  19812. "../util/transitions": 195,
  19813. three: 217
  19814. }],
  19815. 150: [function(e, t, i) {
  19816. "use strict";
  19817. function n(e, t) {
  19818. this.chunks = [],
  19819. this.floorId = e,
  19820. this.roomId = t,
  19821. this.position = new r.Vector3
  19822. }
  19823. var r = e("three");
  19824. n.prototype.addChunk = function(e) {
  19825. this.chunks.push(e)
  19826. }
  19827. ,
  19828. n.prototype.calcBoundaries = function() {
  19829. 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++) {
  19830. var s = this.chunks[a]
  19831. , l = s.geometry.attributes.position;
  19832. if (l)
  19833. for (var c = 0; c < l.array.length; c += 3)
  19834. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  19835. t.add(e),
  19836. 0 === c ? (i.copy(e),
  19837. n.copy(e)) : (i.max(e),
  19838. n.min(e)),
  19839. o++
  19840. }
  19841. o > 0 ? (t.multiplyScalar(1 / o),
  19842. this.average = t) : this.average = null,
  19843. this.boundsMax = i,
  19844. this.boundsMin = n,
  19845. this.center = new r.Vector3,
  19846. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  19847. }
  19848. ,
  19849. t.exports = n
  19850. }
  19851. , {
  19852. three: 217
  19853. }],
  19854. 151: [function(e, t, i) {
  19855. (function(i) {
  19856. "use strict";
  19857. function n(e, t, i) {
  19858. this.obj3d = null,
  19859. this.nodes = [],
  19860. this.colorHull = [],
  19861. this.shortPaths = {},
  19862. this.floorHull = null,
  19863. this.cameraHull = null,
  19864. this.floorPathDistance = 0,
  19865. this.floorCurvePoints = null,
  19866. this.floorCurveColors = null,
  19867. this.camCurvePoints = null,
  19868. this.warpDestHeroLoc = null,
  19869. this.warpDestPano = null,
  19870. this.warpPathPoints = null,
  19871. this.warpPathLengths = [0],
  19872. this.warpLength = 0,
  19873. this.closeWarpDistance = 4,
  19874. this.UP = A.UP.clone(),
  19875. this.longestStep = 0,
  19876. this.upcomingTransType = null,
  19877. this.burnsDir = 1, //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19878. this.prevNextDist = 0,
  19879. this.nextI = 0,
  19880. this.activeTransType = null,
  19881. this.lastTransType = null,
  19882. this.bunnyObj = null,
  19883. this.director = e,
  19884. this.player = t,
  19885. this.playerControls = i,
  19886. this.modelManager = t.modelManager,
  19887. this.updateModel(),
  19888. this.updateDefaultsFromModelData(),
  19889. this.bindEvents(),
  19890. this.warping = !1,
  19891. this.waitingToWarp = !1,
  19892. this.warpInterrupted = !1,
  19893. this.warpInterruptionBlackoutStyle = null,
  19894. this.warpInterruptionTravelTime = null
  19895. }
  19896. var r = e("three")
  19897. , o = e("../util/logger")
  19898. , a = e("../enum/Viewmode")
  19899. , s = e("../enum/RenderOrder")
  19900. , l = e("../enum/WarpStyle")
  19901. , c = e("../settings")
  19902. , h = e("../util/math")
  19903. , u = e("../util/lerp")
  19904. , d = e("../util/easing")
  19905. , p = e("../util/transitions")
  19906. , f = e("../objects/Snapshot")
  19907. , g = e("../effects")
  19908. , m = e("../shaders")
  19909. , v = (e("../gui/gui"),
  19910. e("../util/texture"))
  19911. , A = e("../enum/Vectors")
  19912. , y = (e("../model/ModelManager"),
  19913. new o(i))
  19914. , C = e("../enum/PlayerEvents")
  19915. , I = e("../enum/BlackoutStyle")
  19916. , E = e("../enum/ModelManagerEvents")
  19917. , b = e("../constants")
  19918. , w = {
  19919. 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"),
  19920. pathEnd: v.load("images/End.png"),
  19921. 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==")
  19922. };
  19923. n.prototype.setScene = function(e) {
  19924. this.createCpm(e),
  19925. this.createBunnyObj(e)
  19926. }
  19927. ,
  19928. n.prototype.updateModel = function() {
  19929. this.model = this.modelManager.getActiveModel()
  19930. }
  19931. ,
  19932. n.prototype.bindEvents = function() {
  19933. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19934. }
  19935. ,
  19936. n.prototype.updateDefaultsFromModelData = function() {
  19937. this.model.data
  19938. }
  19939. ,
  19940. n.prototype.pointPathDistance = function(e) {
  19941. for (var t = 0, i = 1; i < e.length; i += 1)
  19942. t += e[i - 1].distanceTo(e[i]);
  19943. return t
  19944. }
  19945. ,
  19946. n.prototype.pointPathLengths = function(e) {
  19947. for (var t = [0], i = 1; i < e.length; i += 1)
  19948. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  19949. return t
  19950. }
  19951. ,
  19952. n.prototype.interpAlongPath = function(e, t, i) {
  19953. var n, o = new r.Vector3, a = t[t.length - 1];
  19954. if (i < 1) {
  19955. n = i * a;
  19956. for (var s = 1; s < t.length; s += 1)
  19957. if (t[s] > n) {
  19958. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  19959. return o.copy(e[s]),
  19960. o.sub(e[s - 1]),
  19961. o.multiplyScalar(l),
  19962. o.add(e[s - 1]),
  19963. o
  19964. }
  19965. } else
  19966. o.copy(e[e.length - 1]);
  19967. return o
  19968. }
  19969. ,
  19970. n.prototype.pathHeight = function() {
  19971. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19972. }
  19973. ,
  19974. n.prototype.createBunnyObj = function(e) {
  19975. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  19976. this.bunnyObj.visible = c.warp.showBunny),
  19977. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19978. e.add(this.bunnyObj)
  19979. }
  19980. ,
  19981. n.prototype.createCpm = function(e) {
  19982. if (!this.currentPanoMarker) {
  19983. var t = this.makeWaypointObj(w.pathEnd, "Current");
  19984. t.material.uniforms.opacity.value = 0,
  19985. //变成一个定位sprite
  19986. /* let sprite = new THREE.Mesh(new THREE.PlaneBufferGeometry(0.4,0.4,1,1), new THREE.MeshBasicMaterial({
  19987. map: v.load('images/icon_address.png'), depthTest:false,
  19988. transparent:true,
  19989. }))
  19990. sprite.position.y = 0.3
  19991. let t = new THREE.Object3D()
  19992. t.add(sprite)
  19993. setTimeout(()=>{
  19994. window.player.on("view.changed",()=>{
  19995. player.path.currentPanoMarker.mesh.quaternion.copy(player.quaternion)
  19996. })
  19997. },1000)*/
  19998. this.currentPanoMarker = {
  19999. mesh: t,
  20000. placed: !1
  20001. }
  20002. }
  20003. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20004. this.placeCpm(),
  20005. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  20006. }
  20007. ,
  20008. n.prototype.placeCpm = function() {
  20009. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  20010. var e = this.player.currentPano.floor;
  20011. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  20012. e.add(this.currentPanoMarker.mesh)),
  20013. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  20014. this.currentPanoMarker.mesh.position.y += this.pathHeight() ,
  20015. this.currentPanoMarker.placed = !0
  20016. } else
  20017. this.popOutCpm()
  20018. }
  20019. ,
  20020. n.prototype.fadeInCpm = function(e) {
  20021. //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)
  20022. 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)
  20023. }
  20024. ,
  20025. n.prototype.fadeOutCpm = function(e) {
  20026. //p.start(u.property(this.currentPanoMarker.mesh.children[0].material/* .uniforms.opacity */, "opacity", 0), e)
  20027. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  20028. }
  20029. n.prototype.popInCpm = function() {
  20030. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  20031. }
  20032. ,
  20033. n.prototype.popOutCpm = function() {
  20034. this.fadeOutCpm(2)
  20035. }
  20036. ,
  20037. n.prototype.brushPrefs = {
  20038. linewidth: 7,
  20039. strokeWidth: 15,
  20040. cvSegments: 48,
  20041. paveStep: .1,
  20042. paveWidth: .2,
  20043. lookBlendDist: 3,
  20044. maxTurn: r.Math.degToRad(2)
  20045. },
  20046. n.prototype.panoPathDistance = function(e) {
  20047. var t = this.model.panos;
  20048. if (!e || e.length < 2)
  20049. return 0;
  20050. for (var i = [], n = 0; n < e.length; n += 1)
  20051. i.push(t.get(e[n]).floorPosition);
  20052. return this.pointPathDistance(i)
  20053. }
  20054. ,
  20055. n.prototype.loadTileTexture = function(e) {
  20056. var t = v.load(e, function(t) {
  20057. t.wrapS = r.RepeatWrapping,
  20058. t.wrapT = r.RepeatWrapping,
  20059. t.needsUpdate = !0,
  20060. y.debug('path texture "' + e + '" is ready')
  20061. }, function() {
  20062. y.error('path texture "' + e + '" failed')
  20063. });
  20064. return t.mapping = r.UVMapping,
  20065. t
  20066. }
  20067. ,
  20068. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  20069. var a = {
  20070. cameraMode: n,
  20071. position: e,
  20072. quaternion: t,
  20073. panoId: i,
  20074. orthoZoom: o,
  20075. floorVisibility: r,
  20076. thumbUrl: null,
  20077. name: null
  20078. };
  20079. return new f(a)
  20080. }
  20081. ,
  20082. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  20083. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  20084. }
  20085. ,
  20086. n.prototype.setWarpDestination = function(e) {
  20087. this.warpDestHeroLoc = e
  20088. }
  20089. ,
  20090. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  20091. var t = this.getHeroDescriptorByHeroIndex(e);
  20092. return null !== t && (this.setWarpDestination(t),
  20093. !0)
  20094. }
  20095. ,
  20096. n.prototype.setWarpDestinationByPano = function(e, t) {
  20097. var i = this.model.panos.get(e.id);
  20098. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  20099. }
  20100. ,
  20101. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  20102. var i = this.model.panos.get(e);
  20103. if (i) {
  20104. t = t || new r.Quaternion;
  20105. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  20106. return this.setWarpDestination(n),
  20107. !0
  20108. }
  20109. return !1
  20110. }
  20111. ,
  20112. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  20113. var t = this.model.heroCount();
  20114. /* if (null !== this.warpDestHeroLoc && t < 2)
  20115. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  20116. this.model.getHeroDescriptorByIndex(0); */
  20117. var i = this.model.getHeroDescriptorByIndex(e);
  20118. if (i) {
  20119. var n = i.isPano() ? i.panoId : i.cameraMode;
  20120. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  20121. }
  20122. return i
  20123. }
  20124. ,
  20125. n.prototype.getHeroDescriptorByPano = function(e) {
  20126. var t = this.model.panos.get(e.id);
  20127. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  20128. }
  20129. ,
  20130. n.prototype.getHeroDescriptorByPanoId = function(e) {
  20131. var t = this.getHeroIndexFromPanoId(e);
  20132. return this.getHeroDescriptorByHeroIndex(t)
  20133. }
  20134. ,
  20135. n.prototype.getHeroIndexFromPanoId = function(e) {
  20136. for (var t = 0; t < this.model.heroLocations.length; t++) {
  20137. var i = this.model.heroLocations[t]
  20138. , n = this.getHeroId(i);
  20139. if (n && n === e)
  20140. return t
  20141. }
  20142. return -1
  20143. }
  20144. ,
  20145. n.prototype.getHeroPano = function(e) {
  20146. if (null === e)
  20147. return y.warn("getHeroPano(): no destination"),
  20148. null;
  20149. var t = this.getHeroId(e)
  20150. , i = this.model.panos.get(t);
  20151. return void 0 === i && (i = null,
  20152. "" !== t && y.debug('unable to find pano "' + t + '"')),
  20153. i
  20154. }
  20155. ,
  20156. n.prototype.getHeroId = function(e) {
  20157. return e.panoId
  20158. }
  20159. ,
  20160. n.prototype.setWarpDestPano = function() {
  20161. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  20162. this.warpDestPano
  20163. }
  20164. ,
  20165. n.prototype.brushToWarpPano = function(e, t) {
  20166. if (this.discardPathObject(),
  20167. !this.setWarpDestPano())
  20168. return !1;
  20169. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  20170. !this.warpDestPano)
  20171. return y.info("No brush"),
  20172. !1;
  20173. if (!this.player.currentPano)
  20174. return y.debug("No current pano, visibility undefined"),
  20175. !1;
  20176. if (!this.warpDestPano)
  20177. return y.info("No wPano, visibility undefined"),
  20178. !1;
  20179. if (!this.warpDestPano.isAligned())
  20180. return y.debug("Cannot brush to unaligned pano"),
  20181. !1;
  20182. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  20183. , n = !0;
  20184. if (this.player.currentPano.id === this.warpDestPano.id)
  20185. y.debug("Already at destination pano");
  20186. else {
  20187. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20188. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  20189. this.obj3d = new r.Object3D,
  20190. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  20191. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  20192. e = t) : (this.setPathHulls(this.nodes),
  20193. this.setFloorCurves(),
  20194. 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)))),
  20195. this.player.currentPano.floor.add(this.obj3d);
  20196. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  20197. , s = e === l.STD;
  20198. if (!n && (i || s)) {
  20199. if (o) {
  20200. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  20201. this.obj3d.add(h)
  20202. }
  20203. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  20204. this.obj3d.add(u)
  20205. }
  20206. this.appearSlow()
  20207. }
  20208. return this.upcomingTransType = e,
  20209. !n
  20210. }
  20211. ,
  20212. n.prototype.findShortestPath = function(e, t) {
  20213. if (!e || !t)
  20214. return null;
  20215. var i = c.warp.walkExtraPanosDistance
  20216. , n = e.id + ":" + t.id + ":" + i;
  20217. if (this.shortPaths.hasOwnProperty(n))
  20218. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  20219. var r = t.id + ":" + e.id + ":" + i;
  20220. if (this.shortPaths.hasOwnProperty(r))
  20221. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  20222. var o = this.model.panos.aStarSearch(e, t);
  20223. return this.model.panos.includeNodesNearPath(o, i),
  20224. this.shortPaths[n] = o ? o.slice() : null,
  20225. o
  20226. }
  20227. ,
  20228. n.prototype.makePathHulls = function(e) {
  20229. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  20230. t = u.get(e[0]),
  20231. r = t.floor.floorIndex;
  20232. for (var d = 0; d < e.length; d += 1)
  20233. t = u.get(e[d]),
  20234. i = t.floorPosition.clone().sub(this.model.position),
  20235. i.y += this.pathHeight(),
  20236. s.push(i),
  20237. l.push(t.position.clone()),
  20238. n = t.floor.floorIndex,
  20239. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  20240. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  20241. o > a && (a = o));
  20242. return a > this.longestStep && (this.longestStep = a,
  20243. y.debug("path contains " + a + " meter segment")),
  20244. {
  20245. floor: s,
  20246. camera: l,
  20247. color: h
  20248. }
  20249. }
  20250. ,
  20251. n.prototype.makeFloorCurves = function(e, t, i) {
  20252. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20253. , o = this.pointPathDistance(e) - 2 * n
  20254. , s = e.slice(0)
  20255. , l = s[1].clone().sub(s[0]);
  20256. l.y = 0,
  20257. l.normalize().multiplyScalar(n),
  20258. s[0] = (new r.Vector3).copy(s[0]).add(l),
  20259. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  20260. l.y = 0,
  20261. l.normalize().multiplyScalar(n),
  20262. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  20263. var h = new r.CatmullRomCurve3(s)
  20264. , u = Math.floor(o / i);
  20265. u = 4 * Math.floor(u / 4),
  20266. u = Math.max(4, u);
  20267. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  20268. f = 0,
  20269. d = g[A].distanceTo(e[0]);
  20270. for (var y = 1; y < e.length; y += 1)
  20271. v.copy(g[A]).sub(e[y]),
  20272. v.y *= 4,
  20273. p = v.length(),
  20274. p < d && (f = y);
  20275. m.push(t[f])
  20276. }
  20277. return {
  20278. distance: o,
  20279. points: g,
  20280. colors: m
  20281. }
  20282. }
  20283. ,
  20284. n.prototype.makeCameraCurvePoints = function(e, t) {
  20285. var i = this.pointPathDistance(e)
  20286. , n = new r.CatmullRomCurve3(e);
  20287. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20288. }
  20289. ,
  20290. n.prototype.makeCameraCurveTangents = function(e, t) {
  20291. var i = this.pointPathDistance(e)
  20292. , n = new r.CatmullRomCurve3(e)
  20293. , o = Math.max(2, Math.floor(i / t));
  20294. o || (o = 5);
  20295. for (var a = [], s = 0; s <= o; s++)
  20296. a.push(n.getTangentAt(s / o));
  20297. return a
  20298. }
  20299. ,
  20300. n.prototype.setPathHulls = function(e) {
  20301. var t = this.makePathHulls(e);
  20302. this.floorHull = t.floor,
  20303. this.cameraHull = t.camera,
  20304. this.colorHull = t.color
  20305. }
  20306. ,
  20307. n.prototype.setFloorCurves = function() {
  20308. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  20309. this.floorPathDistance = e.distance,
  20310. this.floorCurvePoints = e.points,
  20311. this.floorCurveColors = e.colors
  20312. }
  20313. ,
  20314. n.prototype.setCameraCurvePoints = function() {
  20315. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20316. }
  20317. ,
  20318. n.prototype.chooseWarpPath = function(e) {
  20319. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  20320. if (this.player.currentPano === this.warpDestPano || !e)
  20321. return this.warpPathPoints = null,
  20322. this.warpLength = 0,
  20323. !1;
  20324. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  20325. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  20326. t = this.warpDestPano.position.clone().sub(o.position),
  20327. i = t.clone().negate(),
  20328. t.multiplyScalar(.15).add(o.position),
  20329. i.multiplyScalar(.15).add(this.warpDestPano.position),
  20330. t.y = o.position.y,
  20331. i.y = this.warpDestPano.position.y,
  20332. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  20333. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  20334. this.setCameraCurvePoints(),
  20335. this.warpPathPoints = this.camCurvePoints.slice(0)),
  20336. this.warpLength = 0,
  20337. this.warpPathLengths = [0];
  20338. 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) {
  20339. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  20340. var p = s.length();
  20341. s.y *= c.warp.climbEffort;
  20342. var f = s.length() / p;
  20343. if (d > 1) {
  20344. s.setY(0).normalize(),
  20345. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  20346. var g = Math.min(1, s.dot(l))
  20347. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  20348. f = Math.max(m, f)
  20349. }
  20350. this.warpLength += p * f,
  20351. this.warpPathLengths[d] = this.warpLength
  20352. }
  20353. return !0
  20354. }
  20355. ,
  20356. n.prototype.drawPathRibbon = function(e, t) {
  20357. this.bunnyObj.visible = c.warp.showBunny;
  20358. 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) {
  20359. h.copy(e[u]),
  20360. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  20361. h.normalize(),
  20362. n.crossVectors(h, A.UP),
  20363. n.multiplyScalar(i);
  20364. var d = (new r.Vector3).copy(e[u]).add(o);
  20365. d.sub(n),
  20366. l.vertices.push(d),
  20367. d = (new r.Vector3).copy(e[u]).add(o),
  20368. d.add(n),
  20369. l.vertices.push(d)
  20370. }
  20371. var p, f = 0;
  20372. for (u = 0; u < e.length - 1; u += 1) {
  20373. var g = 2 * u
  20374. , v = f;
  20375. f += e[u + 1].distanceTo(e[u]);
  20376. var y = f
  20377. , C = t[u]
  20378. , I = t[u + 1];
  20379. p = new r.Face3(g,g + 1,g + 2),
  20380. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  20381. l.faces.push(p),
  20382. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  20383. p = new r.Face3(g + 2,g + 1,g + 3),
  20384. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  20385. l.faces.push(p),
  20386. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  20387. }
  20388. l.computeFaceNormals(),
  20389. l.computeVertexNormals();
  20390. var E, b;
  20391. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  20392. b.map.value = w.path,
  20393. b.opacity.value = 0,
  20394. b.color.value.set(c.path.color),
  20395. E = new r.RawShaderMaterial({
  20396. side: r.DoubleSide,
  20397. depthWrite: !1,
  20398. transparent: !0,
  20399. vertexShader: m.ribbon.vertexShader,
  20400. fragmentShader: m.ribbon.fragmentShader,
  20401. uniforms: b,
  20402. name: "ribbonT",
  20403. opacity: 0
  20404. })) : E = new r.MeshBasicMaterial({
  20405. color: 16777215,
  20406. side: r.DoubleSide,
  20407. name: "ribbonOut",
  20408. vertexColors: r.VertexColors
  20409. });
  20410. var _ = new r.Mesh(l,E);
  20411. _.renderOrder = 10
  20412. return _.name = "ribbon",
  20413. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  20414. _
  20415. }
  20416. ,
  20417. n.prototype.drawPathPavement = function(e) {
  20418. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  20419. s.copy(e[l]),
  20420. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20421. s.normalize(),
  20422. n.crossVectors(s, A.UP),
  20423. n.multiplyScalar(this.brushPrefs.paveWidth),
  20424. t = (new r.Vector3).copy(e[l]),
  20425. t.sub(n),
  20426. o.vertices.push(t),
  20427. o.vertices.push((new r.Vector3).copy(e[l])),
  20428. t = (new r.Vector3).copy(e[l]),
  20429. t.add(n),
  20430. o.vertices.push(t);
  20431. var h, u, d;
  20432. for (l = 0; l < e.length - 1; l += 1)
  20433. h = 3 * l + 1,
  20434. u = l * i,
  20435. d = u + i,
  20436. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  20437. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  20438. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  20439. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  20440. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  20441. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  20442. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  20443. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  20444. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  20445. color: c.path.color,
  20446. side: r.DoubleSide,
  20447. transparent: !0,
  20448. depthWrite: !1,
  20449. opacity: 0,
  20450. name: "paveT",
  20451. map: w.path
  20452. }) : new r.MeshBasicMaterial({
  20453. color: c.path.color,
  20454. side: r.DoubleSide,
  20455. transparent: !0,
  20456. depthWrite: !1,
  20457. opacity: 1,
  20458. name: "paveO",
  20459. map: w.path
  20460. });
  20461. return new r.Mesh(o,p)
  20462. }
  20463. ,
  20464. n.prototype.hintPrefs = {
  20465. rad: .18,
  20466. width: .0125,
  20467. depth: .0625,
  20468. setBack: -.04,
  20469. markRad: .25,
  20470. markInnerRad: .16
  20471. },
  20472. n.prototype.makeWaypointObj = function(e, t) {
  20473. var i = new r.Geometry
  20474. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  20475. , o = this.pathHeight();
  20476. 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)),
  20477. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  20478. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  20479. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  20480. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  20481. s.map.value = e,
  20482. s.opacity.value = 0,
  20483. s.color.value.set(c.path.color);
  20484. var l = {
  20485. side: r.DoubleSide,
  20486. depthWrite: !1,
  20487. transparent: !0,
  20488. vertexShader: m.waypoint.vertexShader,
  20489. fragmentShader: m.waypoint.fragmentShader,
  20490. uniforms: s,
  20491. name: "waypoint",
  20492. opacity: 0
  20493. };
  20494. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  20495. l.name = "wayPtOut");
  20496. var h = new r.RawShaderMaterial(l)
  20497. , u = new r.Mesh(i,h);
  20498. return u.name = t,
  20499. u
  20500. }
  20501. ,
  20502. n.prototype.makeStartMarker = function(e, t) {
  20503. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  20504. i.y = 0,
  20505. i.normalize();
  20506. var n = Math.acos(i.x)
  20507. , o = this.makeWaypointObj(w.pathStart, "Start");
  20508. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  20509. o.position.copy(e),
  20510. o
  20511. }
  20512. ,
  20513. n.prototype.makeEndMarker = function(e) {
  20514. var t = this.makeWaypointObj(w.pathEnd, "End")
  20515. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  20516. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  20517. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  20518. t.position.copy(e),
  20519. t
  20520. }
  20521. ,
  20522. n.prototype.pathClean = function(e) {
  20523. if (e) {
  20524. for (var t in e.children)
  20525. this.pathClean(e.children[t]);
  20526. e.geometry && e.geometry.dispose(),
  20527. e.material && e.material.dispose()
  20528. }
  20529. }
  20530. ,
  20531. n.prototype.discardPathObject = function() {
  20532. if (this.obj3d) {
  20533. var e = this.obj3d.parent;
  20534. e && e.remove(this.obj3d),
  20535. this.pathClean(this.obj3d)
  20536. }
  20537. this.obj3d = null,
  20538. this.popInCpm()
  20539. }
  20540. ,
  20541. n.prototype.discardSlow = function() {
  20542. if (this.obj3d) {
  20543. if (this.player.mode !== a.PANORAMA)
  20544. return void this.discardPathObject();
  20545. for (var e, t = this, i = 0, n = function() {
  20546. this.discardPathObject()
  20547. }
  20548. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  20549. e = t.obj3d.children[r],
  20550. 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]),
  20551. i += 1,
  20552. n = null);
  20553. 0 === i && this.discardPathObject(),
  20554. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20555. }
  20556. }
  20557. ,
  20558. n.prototype.appearSlow = function() {
  20559. var e, t = this;
  20560. this.fadeOutCpm(c.path.fadeInTime);
  20561. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20562. e = t.obj3d.children[n],
  20563. 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]))
  20564. }
  20565. ,
  20566. n.prototype.update = function() {
  20567. this.obj3d && this.obj3d.updateMatrixWorld()
  20568. }
  20569. ,
  20570. n.prototype.calcBurnsAmount = function(e) {//计算导览点旋转角
  20571. var t = r.Math.degToRad(c.warp.burnsAngle);
  20572. if (this.player.mode === a.PANORAMA) {
  20573. var i = this.burnsDir * t;
  20574. if (this.upcomingTransType === l.BLACK)
  20575. return i;
  20576. var n = e;
  20577. if (null === n)
  20578. return y.warn("Transition request for non-highlight"),
  20579. i;
  20580. var o = this.getHeroDescriptorByHeroIndex(n);
  20581. if (null === o)
  20582. return i;
  20583. if (!o.isPano())
  20584. return i;
  20585. var s = this.getHeroPano(o)
  20586. , h = this.playerControls.cameras[a.PANORAMA]
  20587. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  20588. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  20589. , p = function(e) {
  20590. var i = Math.acos(Math.min(1, e.dot(u)))
  20591. , n = (new r.Vector3).crossVectors(u, e);
  20592. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20593. };
  20594. if (s === this.player.currentPano)
  20595. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  20596. var f = this.findShortestPath(this.player.currentPano, s);
  20597. if (void 0 === f || null === f || f.length < 1)
  20598. return y.debug("Empty path ahead..."),
  20599. i;
  20600. var g = this.makePathHulls(f)
  20601. , m = new r.CatmullRomCurve3(g.camera)
  20602. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  20603. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  20604. }
  20605. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  20606. }
  20607. ,
  20608. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  20609. var i = (time==void 0)? c.warp.tourStepDelay : time;
  20610. i==void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  20611. var n = new r.Euler
  20612. , o = new r.Vector3;
  20613. y.debug("Starting wait: " + (void 0 !== t));
  20614. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)//this.model.heroLocations[this.director.currentItem[0]]
  20615. var s = currentLocation.dontRot || this.calcBurnsAmount(e)
  20616. , h = function() {
  20617. this.endWarpState(),
  20618. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  20619. t && t()
  20620. }
  20621. .bind(this)
  20622. , u = function(e, t) {
  20623. if (this.warpInterrupted)
  20624. return h(),
  20625. !0;
  20626. var r = t || 1e3 / 60;
  20627. if (c.warp.doBurns && !currentLocation.dontRot )
  20628. if (this.player.mode === a.PANORAMA) {
  20629. var l = this.playerControls.cameras[a.PANORAMA];
  20630. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  20631. var u = i == 0 ? s : r * s / i;
  20632. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20633. n.y += u,
  20634. o.set(0, 0, -1),
  20635. o.applyEuler(n),
  20636. o.add(l.position),
  20637. l.controls.lookAt(o),
  20638. l.controls.lookVector.copy(o)
  20639. ,l.lookAt(o)
  20640. } else
  20641. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  20642. }
  20643. .bind(this);
  20644. this.startWarpState(),
  20645. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  20646. }
  20647. ,
  20648. n.prototype.warpToNonPano = function(e) {
  20649. if (this.discardPathObject(),
  20650. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  20651. var t = function() {
  20652. e && e()
  20653. }
  20654. .bind(this);
  20655. this.player.flyToNewMode({
  20656. mode: this.warpDestHeroLoc.cameraMode,
  20657. duration: c.warp.outsideTime,
  20658. warpDest: this.warpDestHeroLoc,
  20659. callback: t,
  20660. force: !0
  20661. })
  20662. } else
  20663. y.warn("no warp destination!!!"),
  20664. e && e()
  20665. }
  20666. ,
  20667. n.prototype._resetWarpShaderParams = function(e) {//
  20668. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  20669. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20670. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20671. delete e.material.defines.newBlack;
  20672. e.material.needsUpdate = true
  20673. } */
  20674. }
  20675. ,
  20676. n.prototype._clearWarpShading = function() {
  20677. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  20678. this._resetWarpShaderParams(e[t]),
  20679. e[t].visible = !0;
  20680. this._resetWarpShaderParams(this.model.skybox)
  20681. }
  20682. ,
  20683. n.prototype._warpStopFlying = function() {
  20684. this.activeTransType = null,
  20685. this.placeCpm()
  20686. }
  20687. ,
  20688. n.prototype._wrapupTravelOnlyBits = function() {
  20689. this._warpStopFlying(),
  20690. this.warpPathPoints && (this.player.currentPano.exit(),
  20691. this.warpDestPano.enter(),
  20692. this.player.currentPano = this.warpDestPano),
  20693. this.player.spider.draw(),
  20694. this.placeCpm()
  20695. }
  20696. ,
  20697. n.prototype._wrapupTravel = function(e) {
  20698. this._wrapupTravelOnlyBits(),
  20699. this.warpCameraAim(e)
  20700. }
  20701. ,
  20702. n.prototype._wrapupWarpShading = function(e) {
  20703. this._clearWarpShading(),
  20704. this._wrapupTravel(e)
  20705. }
  20706. ,
  20707. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  20708. t !== I.END && this._clearWarpShading(),
  20709. this._wrapupTravelOnlyBits(),
  20710. this.upcomingTransType = null,
  20711. e && e()
  20712. }
  20713. ,
  20714. n.prototype._warpCameraAim = function(e, t) {//到每个片段终点时转向终点朝向。
  20715. var i = this.warpDestHeroLoc.quaternion
  20716. , n = this.playerControls.cameras[a.PANORAMA]
  20717. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  20718. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  20719. , l = s.dot(o)
  20720. , u = r.Math.radToDeg(Math.acos(l))
  20721. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  20722. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20723. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  20724. m.y = h.constrainedTurn(m.y),
  20725. this.burnsDir = Math.sign(m.y);
  20726. var v = new r.Euler(0,0,0,c.warp.eOrder)
  20727. , A = new r.Vector3
  20728. , C = function(e, t) {
  20729. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  20730. v.y = g.y + e * m.y,
  20731. v.z = g.z + e * m.z,
  20732. A.set(0, 0, -1),
  20733. A.applyEuler(v),
  20734. A.add(n.position),
  20735. n.controls.lookAt(A),
  20736. n.controls.lookVector.copy(A),
  20737. void n.lookAt(A))
  20738. }
  20739. .bind(this);
  20740. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20741. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20742. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20743. ):
  20744. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20745. ,void (t && t())
  20746. ) */
  20747. (this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20748. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20749. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) :
  20750. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20751. ,void (t && t())
  20752. )
  20753. }
  20754. ,
  20755. n.prototype._warpBendAim = function(e, t, i, n) {
  20756. var o = n || 0
  20757. , s = this.playerControls.cameras[a.PANORAMA]
  20758. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20759. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  20760. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  20761. f.y = h.constrainedTurn(f.y);
  20762. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  20763. f.x = g * Math.sign(f.x),
  20764. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  20765. this.burnsDir = Math.sign(f.y),
  20766. g *= Math.sign(f.y),
  20767. f.y = g;
  20768. var m = new r.Euler(0,0,0,c.warp.eOrder)
  20769. , v = new r.Vector3
  20770. , A = function(e, t) {
  20771. if (e < .5)
  20772. m.x = u.x + e * f.x,
  20773. m.y = u.y + e * f.y,
  20774. m.z = u.z + e * f.z;
  20775. else {
  20776. var i = (1 - e) * c.warp.softBendEnd;
  20777. m.x = l.x - i * f.x,
  20778. m.y = l.y - i * f.y,
  20779. m.z = l.z - i * f.z
  20780. }
  20781. v.set(0, 0, -1),
  20782. v.applyEuler(m),
  20783. v.add(s.position);
  20784. s.controls.lookAt(v),
  20785. s.controls.lookVector.copy(v),
  20786. s.lookAt(v);
  20787. }
  20788. .bind(this);
  20789. if(window.DATA.momentTourBlackNewType){
  20790. A(1)
  20791. }else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20792. }
  20793. ,
  20794. n.prototype._warpStepCameraAim = function(e, t, i) {
  20795. var n = this.playerControls.cameras[a.PANORAMA]
  20796. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20797. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  20798. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  20799. l.y = h.constrainedTurn(l.y),
  20800. this.burnsDir = Math.sign(l.y);
  20801. var u = new r.Euler(0,0,0,c.warp.eOrder)
  20802. , f = new r.Vector3
  20803. , g = function(e, t) {
  20804. e < .5 ? u.copy(s) : u.copy(o),
  20805. f.set(0, 0, -1),
  20806. f.applyEuler(u),
  20807. f.add(n.position),
  20808. n.controls.lookAt(f),
  20809. n.controls.lookVector.copy(f),
  20810. n.lookAt(f)
  20811. }
  20812. .bind(this);
  20813. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20814. }
  20815. ,
  20816. n.prototype.setBurnsDir = function() {
  20817. var e = this.playerControls.cameras[a.PANORAMA]
  20818. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20819. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  20820. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  20821. n.y = h.constrainedTurn(n.y),
  20822. this.burnsDir = Math.sign(n.y)
  20823. }
  20824. ,
  20825. n.prototype.stepWarpPath = function(firstPos, e ) {
  20826. var i = this.playerControls.cameras[a.PANORAMA];
  20827. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20828. if (!n){
  20829. return i.position.copy(this.warpDestPano.position),
  20830. !0;
  20831. }
  20832. /* if (!this.warpPathPoints)
  20833. return i.position.copy(this.warpDestPano.position),
  20834. !0;
  20835. var n = this.warpPathPoints[0] */
  20836. var o = this.warpDestPano.position;
  20837. /* console.log(firstPos)
  20838. console.log(o) */
  20839. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20840. var s = new r.Vector3;
  20841. 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),
  20842. i.position.copy(s)
  20843. } else
  20844. e < .5 ? i.position.copy(n) : i.position.copy(o)
  20845. }
  20846. ,
  20847. n.prototype.interruptAndFastForward = function(e, t) {
  20848. this.warping && (this.warpInterrupted = !0,
  20849. this.warpInterruptionBlackoutStyle = e,
  20850. this.warpInterruptionTravelTime = t,
  20851. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20852. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  20853. }
  20854. ,
  20855. n.prototype.warpCameraAim = function(e) {
  20856. var t = c.warp.minWarpTime;
  20857. if (this.upcomingTransType === l.BLACK)
  20858. t = c.warp.teleportTime;
  20859. else {
  20860. var i = this.playerControls.cameras[a.PANORAMA]
  20861. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  20862. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  20863. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  20864. s.y = h.constrainedTurn(s.y);
  20865. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  20866. t = Math.max(t, u)
  20867. }
  20868. var d = function() {
  20869. this._warpStopFlying(),
  20870. this.discardSlow(),
  20871. e && e()
  20872. }
  20873. .bind(this);
  20874. this._warpCameraAim(t, d)
  20875. }
  20876. ,
  20877. n.prototype.warpCommonParameters = function(e, t, i, n) {
  20878. this.model.skybox.material.uniforms.blackout.value = n;
  20879. var r = u.uniform(this.model.skybox, "progress", 1)
  20880. , o = u.allUniforms(this.model.chunks, "progress", 1)
  20881. , a = !1
  20882. , s = function() {
  20883. if (this.warpInterrupted)
  20884. return a = !0,
  20885. !0
  20886. }
  20887. .bind(this)
  20888. , l = function(e, t) {
  20889. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  20890. !0) : void r(e, t)
  20891. }
  20892. .bind(this)
  20893. , h = function(e, t) {
  20894. return i && a ? (o(0),
  20895. !0) : void o(e, t)
  20896. }
  20897. .bind(this);
  20898. p.start(s, e, null, t, null, "safeHaltWatch"),
  20899. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  20900. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  20901. }
  20902. ,
  20903. n.prototype.warpTravel_STD = function(e) {
  20904. 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),
  20905. 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;
  20906. w += this.warpLength * c.warp.timePerMeter,
  20907. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  20908. var _ = !1
  20909. , T = this.warpDestHeroLoc.quaternion
  20910. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  20911. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  20912. , M = S.dot(x)
  20913. , R = r.Math.radToDeg(Math.acos(M))
  20914. , P = function(e) {
  20915. var t = o
  20916. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  20917. return i
  20918. }
  20919. , O = function() {
  20920. return E.lookAt(C, t, A.UP),
  20921. s.setFromRotationMatrix(E, c.warp.eOrder),
  20922. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20923. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20924. h.constrainedTurn(b.y)
  20925. }
  20926. .bind(this)
  20927. , L = function(e, t) {
  20928. if (this.warpInterrupted)
  20929. return _ = !0,
  20930. !0
  20931. }
  20932. .bind(this)
  20933. , D = function(e, t) {
  20934. return _ || !this.warpPathPoints ? (g.blur(0),
  20935. !0) : void g.blur(e)
  20936. }
  20937. .bind(this)
  20938. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  20939. , B = function(e, t) {
  20940. return _ || !this.warpPathPoints ? (N(0),
  20941. !0) : void N(e, t)
  20942. }
  20943. .bind(this)
  20944. , F = function(e, t) {
  20945. if (!this.warpPathPoints)
  20946. return n.position.copy(this.warpDestPano.position),
  20947. !0;
  20948. if (_)
  20949. return !0;
  20950. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  20951. n.position.copy(i),
  20952. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  20953. }
  20954. .bind(this)
  20955. , V = function(e, n) {
  20956. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  20957. !0)
  20958. }
  20959. .bind(this)
  20960. , U = function(e, o) {
  20961. if (_)
  20962. return y.debug(">>>> Walkthrough interupted at t=" + e),
  20963. !0;
  20964. if (!this.warpPathPoints)
  20965. return !0;
  20966. var a = this.warpLength * e
  20967. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  20968. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  20969. c.warp.matchCam && (l *= 1 - u),
  20970. E.lookAt(C, t, A.UP),
  20971. s.setFromRotationMatrix(E, c.warp.eOrder),
  20972. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20973. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20974. b.y = h.constrainedTurn(b.y),
  20975. s.x = m.x + l * b.x,
  20976. s.y = m.y + l * b.y,
  20977. s.z = m.z + l * b.z,
  20978. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20979. b.y = h.constrainedTurn(b.y);
  20980. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  20981. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  20982. v.x = v.x + b.x * c.warp.turnFriction,
  20983. v.y = v.y + b.y * c.warp.turnFriction,
  20984. v.z = v.z + b.z * c.warp.turnFriction,
  20985. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  20986. var p = t.clone().sub(C).normalize();
  20987. if (R < c.warp.maxAimRotation && u > 0) {
  20988. var g = 1 - u;
  20989. p.x = p.x * g + u * S.x,
  20990. p.y = p.y * g + u * S.y,
  20991. p.z = p.z * g + u * S.z,
  20992. p.normalize()
  20993. }
  20994. this.bunnyObj.position.copy(n.position).add(p),
  20995. f.set(0, 0, -1).applyEuler(v).normalize(),
  20996. f.multiplyScalar(8),
  20997. f.add(n.position),
  20998. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  20999. n.controls.lookVector.copy(f),
  21000. n.lookAt(f))
  21001. }
  21002. .bind(this)
  21003. , k = function() {
  21004. _ ? (this.discardSlow(),
  21005. this.upcomingTransType = l.BLACK,
  21006. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  21007. }
  21008. .bind(this);
  21009. V(0);
  21010. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  21011. w += H;
  21012. var G = H / w;
  21013. this.warpCommonParameters(w, G, !0, I.NONE),
  21014. p.start(L, w, null, 0, null, "_haltWatcher"),
  21015. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  21016. p.start(D, w, null, G, P, "blurring")),
  21017. p.start(B, w, null, G, P, "modelAlpha"),
  21018. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  21019. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  21020. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  21021. }
  21022. ,
  21023. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  21024. var r = e || 0;
  21025. void 0 !== t && null !== t || (t = c.warp.teleportTime)
  21026. //add
  21027. player.model.hotGroup.visible = false
  21028. let oldPano = this.player.currentPano
  21029. let toPano = this.player.model.panos.get(this.warpDestHeroLoc.panoId)
  21030. this.player.emit("pano.chosen", oldPano, toPano)
  21031. var done = ()=>{
  21032. this.player.transitionPos({type:"beforeFlytopano", pano:this.player.currentPano, dur:0, callback:()=>{
  21033. player.model.hotGroup.visible = true
  21034. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  21035. }})
  21036. this.player.emit("flying.ended",toPano.position, oldPano.position,toPano, oldPano)
  21037. }
  21038. if(window.DATA.momentTourBlackNewType){
  21039. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  21040. var camera = this.playerControls.cameras[a.PANORAMA];
  21041. var end = this.warpDestHeroLoc.position
  21042. camera.position.copy(end)
  21043. setTimeout(()=>{
  21044. player.sceneRenderer.effects.fastTranMaskPass.stop()
  21045. this.wrapupWarpShadingOnly(n, i);
  21046. done()
  21047. },t)
  21048. }else{
  21049. var o = function() {
  21050. this.wrapupWarpShadingOnly(n, i);
  21051. done()
  21052. }
  21053. .bind(this);
  21054. var firstPos = this.player.position.clone()//add
  21055. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], "stepMotion")
  21056. }
  21057. this.warpCommonParameters(t, r, !1, i)
  21058. this.model.chunks.concat(this.model.skybox).forEach(function(e) {// 改
  21059. if(window.DATA.momentTourBlackNewType){
  21060. e.material.uniforms.blackout.value = 5//i 改
  21061. //e.material.defines.newBlack = ''
  21062. //e.material.needsUpdate = true
  21063. }else{
  21064. e.material.uniforms.blackout.value = i
  21065. }
  21066. }),
  21067. this._warpBendAim(null, t, null, r);
  21068. }
  21069. ,
  21070. n.prototype.flightStepWalk = function(e, t, i) {
  21071. var n = .001
  21072. , o = 1
  21073. , a = 1.2
  21074. , s = new r.Vector3
  21075. , h = new r.Vector3
  21076. , u = function(e, t) {
  21077. //导览速度
  21078. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  21079. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  21080. , r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime;
  21081. h.copy(A.FORWARD),
  21082. this.player.getDirection(h),
  21083. s.copy(t).sub(e.position).normalize();
  21084. var l = s.dot(h)
  21085. , u = Math.acos(l)
  21086. , d = u / r;
  21087. d > n && (r *= d / n,
  21088. u < o && (r *= a))
  21089. return r / DATA.tourWalkSpeed * 100 // 改
  21090. };
  21091. return function(e, t, i) {
  21092. if (this.warpInterrupted)
  21093. i && i();
  21094. else if (this.activeTransType !== l.WALK)
  21095. this._clearWarpShading(),
  21096. this._warpStopFlying(),
  21097. this.player.spider.draw(),
  21098. this.placeCpm(),
  21099. i && i();
  21100. else if (this.player.currentPano !== e) {
  21101. var n = {
  21102. pano: e,
  21103. lookAtPoint: t,
  21104. duration: null,
  21105. maxDistanceOverride: c.warp.walkMaxDist,
  21106. skipWarpingCheck: !1,
  21107. constantMoveSpeed: !0
  21108. };
  21109. if(e == this.warpDestPano){//到达终点前,放大到终点的zoom
  21110. n.zoomLevel = this.warpDestHeroLoc.zoom
  21111. }
  21112. n.duration = u.call(this, e, t),
  21113. this.player.nonInterruptingFlyToPano(n, i)
  21114. } else
  21115. i && i()
  21116. }
  21117. }(),
  21118. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  21119. return this.flightStepWalk.bind(this, e, t, i)
  21120. }
  21121. ,
  21122. n.prototype.warpTravel_WALK = function() {
  21123. var e = [];
  21124. return function(t) {
  21125. var i = this.player.model.panos;
  21126. e.length = 0;
  21127. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  21128. var s = this.nodes[a]
  21129. , l = i.get(s);
  21130. a === this.nodes.length - 1;
  21131. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  21132. n && o || (e.push(s),
  21133. n = l)
  21134. }
  21135. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  21136. var h = e.length
  21137. , u = i.get(e[h - 1])
  21138. , d = new Array(h + 1);
  21139. d[d.length - 1] = function() {
  21140. t && t()
  21141. }
  21142. .bind(this);
  21143. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  21144. var g = e[p];
  21145. u = i.get(g);
  21146. var m = new r.Vector3;
  21147. this.getLookAtForWalkingTourNode(e, p, m),
  21148. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  21149. p--
  21150. }
  21151. d[0]()
  21152. }
  21153. }(),
  21154. n.prototype.getLookAtForWalkingTourNode = function() {
  21155. var e = new r.Vector3
  21156. , t = new r.Vector3
  21157. , i = new r.Vector3
  21158. , n = new r.Vector3
  21159. , o = new r.Vector3
  21160. , a = .65
  21161. , s = .75
  21162. , l = .2
  21163. , c = .4
  21164. , h = .2
  21165. , u = 3;
  21166. return function(r, d, p) {
  21167. var f = r.length;
  21168. if (d >= f)
  21169. return !1;
  21170. var g = 1
  21171. , m = 1;
  21172. t.set(0, 0, 0),
  21173. o.set(0, 0, 0);
  21174. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  21175. if (v = this.player.model.panos.get(r[A]),
  21176. this.getOrientationForWalkingTourNode(r, A, i),
  21177. A === d && e.copy(i),
  21178. n.copy(i),
  21179. A > d) {
  21180. var y = n.dot(e) < a;
  21181. g *= y ? l : s,
  21182. m *= y ? h : c
  21183. }
  21184. i.multiplyScalar(g),
  21185. t.add(i),
  21186. o.lerp(v.position, m)
  21187. }
  21188. return t.normalize(),
  21189. p.copy(o),
  21190. p.add(t),
  21191. !0
  21192. }
  21193. }(),
  21194. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  21195. var n = e.length;
  21196. if (t >= n)
  21197. return !1;
  21198. if (t === n - 1)
  21199. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  21200. else {
  21201. var r = this.player.model.panos.get(e[t])
  21202. , o = this.player.model.panos.get(e[t + 1]);
  21203. i.copy(o.position).sub(r.position)
  21204. }
  21205. return i.normalize(),
  21206. !0
  21207. }
  21208. ,
  21209. n.prototype.warpCameraTravel = function(e, t, i, n) {
  21210. if (this.activeTransType = this.upcomingTransType,
  21211. this.lastTransType = this.activeTransType,
  21212. this.upcomingTransType = null,
  21213. !e) {
  21214. var r = function() {
  21215. this._wrapupTravel(n)
  21216. }
  21217. .bind(this)
  21218. , o = {
  21219. pano: this.warpDestPano,
  21220. lookAtPoint: null,
  21221. duration: null,
  21222. maxDistanceOverride: null,
  21223. skipWarpingCheck: !1
  21224. };
  21225. return void this.player.flyToPano(o, r)
  21226. }
  21227. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  21228. this._clearWarpShading(),
  21229. this._warpStopFlying(),
  21230. this.player.spider.draw(),
  21231. this.placeCpm(),
  21232. n && n()
  21233. }
  21234. .bind(this)) : this.warpTravel_STD(n)
  21235. }
  21236. ,
  21237. n.prototype.startWarpState = function() {
  21238. this.warping = !0,
  21239. this.warpInterrupted = !1,
  21240. this.warpInterruptionBlackoutStyle = null,
  21241. this.warpInterruptionTravelTime = null
  21242. }
  21243. ,
  21244. n.prototype.endWarpState = function() {
  21245. this.warping = !1
  21246. this.director.emit('warp.end')//xzw add
  21247. }
  21248. ,
  21249. n.prototype.warpToPano = function(e, t, i, n) {
  21250. if (this.warping)
  21251. return void y.warn("Cannot warp when already warping");
  21252. if (this.upcomingTransType = e,
  21253. this.activeTransType = null,
  21254. !this.setWarpDestPano())
  21255. return this.upcomingTransType = null,
  21256. void this.warpToNonPano(n);
  21257. if (this.player.mode !== a.PANORAMA)
  21258. return this.upcomingTransType = null,
  21259. this.discardSlow(),
  21260. void this.player.flyToNewMode({
  21261. mode: a.PANORAMA,
  21262. pano: this.warpDestPano,
  21263. duration: c.warp.outsideTime,
  21264. warpDest: this.warpDestHeroLoc,
  21265. callback: n,
  21266. force: !0
  21267. });
  21268. if (!this.warpDestPano)
  21269. return y.warn("no warp destination, callback dropped"),
  21270. void (this.upcomingTransType = null);
  21271. 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)
  21272. , o = this.chooseWarpPath(r);
  21273. if (o && this.upcomingTransType !== l.WALK) {
  21274. var s = function() {
  21275. this.waitingToWarp = !1,
  21276. this.warpToPano(e, t, i, n)
  21277. }
  21278. .bind(this);
  21279. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  21280. return void (this.waitingToWarp = !0)
  21281. }
  21282. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  21283. this.player.currentPano = this.warpDestPano,
  21284. this.placeCpm(),
  21285. this.fadeOutCpm(c.path.fadeOutTime),
  21286. this.player.spider.draw()),
  21287. y.debug("Warping to pano ", this.warpDestPano.position),
  21288. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  21289. this.startWarpState();
  21290. var h = function() {
  21291. this.endWarpState(),
  21292. n && n()
  21293. }
  21294. .bind(this);
  21295. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  21296. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  21297. }
  21298. ,
  21299. t.exports = n
  21300. }
  21301. ).call(this, "/js/objects/ShowPath.js")
  21302. }
  21303. , {
  21304. "../constants": 8,
  21305. "../effects": 16,
  21306. "../enum/BlackoutStyle": 18,
  21307. "../enum/ModelManagerEvents": 33,
  21308. "../enum/PlayerEvents": 40,
  21309. "../enum/RenderOrder": 42,
  21310. "../enum/Vectors": 50,
  21311. "../enum/Viewmode": 51,
  21312. "../enum/WarpStyle": 52,
  21313. "../gui/gui": 65,
  21314. "../model/ModelManager": 140,
  21315. "../objects/Snapshot": 153,
  21316. "../settings": 166,
  21317. "../shaders": 167,
  21318. "../util/easing": 186,
  21319. "../util/lerp": 188,
  21320. "../util/logger": 189,
  21321. "../util/math": 190,
  21322. "../util/texture": 194,
  21323. "../util/transitions": 195,
  21324. three: 217
  21325. }],
  21326. 152: [function(e, t, i) {
  21327. "use strict";
  21328. function n() {
  21329. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  21330. , t = new r.RawShaderMaterial({
  21331. fragmentShader: o.skysphere.fragmentShader,
  21332. vertexShader: o.skysphere.vertexShader,
  21333. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  21334. side: r.BackSide,
  21335. name: "skysphere"
  21336. });
  21337. t.uniforms.radius.value = e.parameters.radius,
  21338. r.Mesh.call(this, e, t)
  21339. }
  21340. var r = e("three")
  21341. , o = e("../shaders")
  21342. , a = e("../settings");
  21343. n.prototype = Object.create(r.Mesh.prototype),
  21344. n.prototype.constructor = n,
  21345. t.exports = n
  21346. }
  21347. , {
  21348. "../settings": 166,
  21349. "../shaders": 167,
  21350. three: 217
  21351. }],
  21352. 153: [function(e, t, i) {
  21353. (function(i) {
  21354. "use strict";
  21355. function n(e) {
  21356. o.call(this, e),
  21357. this.sid = e.sid,//xzw add
  21358. this.panoId = e.panoId,
  21359. this.orthoZoom = e.orthoZoom,
  21360. this.floorVisibility = e.floorVisibility,
  21361. this.thumbUrl = e.thumbUrl,
  21362. this.name = e.name,
  21363. this.zoom = e.zoom
  21364. }
  21365. var r = (e("three"),
  21366. e("../util/logger"))
  21367. , o = (e("../settings"),
  21368. e("../enum/Viewmode"),
  21369. e("../util/common"),
  21370. e("../util/transitions"),
  21371. e("../util/lerp"),
  21372. e("../util/ajax"),
  21373. e("../util/texture"),
  21374. e("./View"));
  21375. e("events").EventEmitter,
  21376. new r(i);
  21377. n.prototype = Object.create(o.prototype),
  21378. n.prototype.isPano = function() {
  21379. return this.panoId && "" !== this.panoId && this.panoId != "outside"
  21380. }
  21381. ,
  21382. t.exports = n
  21383. }
  21384. ).call(this, "/js/objects/Snapshot.js")
  21385. }
  21386. , {
  21387. "../enum/Viewmode": 51,
  21388. "../settings": 166,
  21389. "../util/ajax": 181,
  21390. "../util/common": 185,
  21391. "../util/lerp": 188,
  21392. "../util/logger": 189,
  21393. "../util/texture": 194,
  21394. "../util/transitions": 195,
  21395. "./View": 154,
  21396. events: 202,
  21397. three: 217
  21398. }],
  21399. 154: [function(e, t, i) {
  21400. (function(i) {
  21401. "use strict";
  21402. function n(e) {
  21403. e = e || {},
  21404. this.position = new r.Vector3,
  21405. this.quaternion = new r.Quaternion,
  21406. this.update(e)
  21407. }
  21408. var r = e("three")
  21409. , o = e("../util/logger")
  21410. , a = (e("../settings"),
  21411. e("../enum/Viewmode"),
  21412. e("../util/common"),
  21413. e("../util/transitions"),
  21414. e("../util/lerp"),
  21415. e("../util/ajax"),
  21416. e("../util/texture"),
  21417. e("events").EventEmitter);
  21418. new o(i);
  21419. n.prototype = Object.create(a.prototype),
  21420. n.prototype.isValid = function() {
  21421. return !!this.cameraMode
  21422. }
  21423. ,
  21424. n.prototype.update = function(e) {
  21425. return this.cameraMode = e.cameraMode || this.cameraMode,
  21426. this.pano = e.pano || this.pano,
  21427. e.position && this.position.copy(e.position),
  21428. e.quaternion && this.quaternion.copy(e.quaternion),
  21429. this
  21430. }
  21431. ,
  21432. t.exports = n
  21433. }
  21434. ).call(this, "/js/objects/View.js")
  21435. }
  21436. , {
  21437. "../enum/Viewmode": 51,
  21438. "../settings": 166,
  21439. "../util/ajax": 181,
  21440. "../util/common": 185,
  21441. "../util/lerp": 188,
  21442. "../util/logger": 189,
  21443. "../util/texture": 194,
  21444. "../util/transitions": 195,
  21445. events: 202,
  21446. three: 217
  21447. }],
  21448. 155: [function(e, t, i) {//player.js
  21449. (function(i) {
  21450. "use strict";
  21451. function n(e) {
  21452. this.currentPano = null,
  21453. this.nextPano = null,
  21454. this.camera = null,
  21455. this.paused = !1,
  21456. this.flying = !1,
  21457. this.sceneIntersectionPlane = null,
  21458. this.target = new r.Vector3,
  21459. this.mouse = new r.Vector3(1.1,1.1,.5),
  21460. this.mouseAtMouseDown = new r.Vector2,
  21461. this.mouseCouldBeClickToMove = !1,
  21462. this.mouseLastMoveTime = Date.now(),
  21463. this.mouseDown = !1,
  21464. this.mouseDownTimer = null,
  21465. this.couldBeLongTap = !1,
  21466. this.containsMouse = !1, //
  21467. this.isTouchEvent = !1,
  21468. this.isPanoHover = !1,
  21469. this.reticule = new a(this),
  21470. this.panoMarkers = [],
  21471. this.spider = new h(this),
  21472. this.quaternion = new r.Quaternion,
  21473. this.position = new r.Vector3(15,10,15),
  21474. this.previousState = null,
  21475. this.lastInsideView = new c,
  21476. this.last360View = new c,
  21477. this.raycaster = new r.Raycaster,
  21478. this.intersect = null,
  21479. this.lastChangeTime = Date.now(),
  21480. this.history = new I,
  21481. this.cameraControls = null,
  21482. this.path = null,
  21483. this.model = null,
  21484. this.domElement = null,
  21485. this.cachedPanoCandidates = null,
  21486. this.basePanoSize = 0,
  21487. this.standardPanoSize = 0,
  21488. this.highPanoSize = 0,
  21489. this.ultraHighPanoSize = 0,
  21490. this.zoomLevel = 1,
  21491. this.zooming = 0,
  21492. this.zoomSpeed = .5,
  21493. this.scrollZoomSpeed = .06,
  21494. this.zoomSpeedAdjust = .05,
  21495. this.defaultZoomIncrement = .2,
  21496. this.baseFov = f.insideFOV,
  21497. this.zoomFov = this.baseFov,
  21498. this.zoomEnabled = !0,
  21499. this.preRenderingEnabled = !1,
  21500. this.setupCustomProperties(e),
  21501. this.zoomStats = new L
  21502. window.player = this
  21503. this.modeTran = ''
  21504. }
  21505. var r = e("three")
  21506. , o = e("./util/logger")
  21507. , a = e("./objects/Reticule")
  21508. , s = e("./objects/Panorama")
  21509. , l = e("./objects/ShowPath")
  21510. , c = e("./objects/View")
  21511. , h = (e("./objects/Snapshot"),
  21512. e("./objects/NSpider"))
  21513. , u = e("./enum/Viewmode")
  21514. , d = (e("./enum/TagStates"),
  21515. e("./enum/Vectors"))
  21516. , p = e("./enum/Keys")
  21517. , f = (e("./enum/AlignmentType"),
  21518. e("./settings"))
  21519. , g = e("./util/common")
  21520. , m = (e("./util/browser"),
  21521. e("./util/math"))
  21522. , v = e("./util/lerp")
  21523. , A = e("./util/easing")
  21524. , y = e("./util/transitions")
  21525. , C = e("events").EventEmitter
  21526. , I = (e("./shaders"),
  21527. e("./util/history"))
  21528. , E = (e("./util/camera"),
  21529. e("./model/ModelManager"),
  21530. e("./enum/PathDiscardMode"))
  21531. , b = e("./enum/PathDisplayMode")
  21532. , w = e("./enum/PlayerEvents")
  21533. , _ = e("./enum/ControlEvents")
  21534. , T = e("./enum/ModelManagerEvents")
  21535. , x = e("./enum/WarpStyle")
  21536. , S = e("./enum/BlackoutStyle")
  21537. , M = e("./exception/BasicException")
  21538. , R = e("./enum/PanoSizeClass")
  21539. , P = (e("./tile/TileDownloader"),
  21540. e("./tile/TilePrioritizer"))
  21541. , O = (e("./enum/PanoramaEvents"),
  21542. e("./enum/ZoomEvents"))
  21543. , L = e("./util/ZoomStats")
  21544. , D = e("./constants")
  21545. , N = e("./util/common")
  21546. , B = e("./util/cameraLight")
  21547. //, Hot = e('hot')
  21548. , F = new o(i)
  21549. , V = Object.freeze({
  21550. FlyToPano: y.getUniqueId(),
  21551. FlyToNewMode: y.getUniqueId(),
  21552. FlyToSameMode: y.getUniqueId(),
  21553. FlyToViewFloor: y.getUniqueId(),
  21554. LookTransition: y.getUniqueId(),
  21555. ZoomTransition: y.getUniqueId()
  21556. });
  21557. n.prototype = Object.create(C.prototype),
  21558. n.prototype.init = function(e) {
  21559. this.modelManager = e.modelManager,
  21560. this.tileDownloader = e.tileDownloader,
  21561. this.panoRenderer = e.panoRenderer,
  21562. this.qualityManager = e.qualityManager,
  21563. this.domElement = e.container,
  21564. this.camera = e.camera,
  21565. this.tagManager = e.tagManager,
  21566. this.cameraControls = e.controls,
  21567. this.path = new l(e.director,this,e.controls),
  21568. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  21569. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  21570. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  21571. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  21572. this.tileDownloader.processPriorityQueue = !1,
  21573. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  21574. this.bindEvents(e.container),
  21575. this.updateModel()
  21576. //this.guider2 = new PanTransGuide(this)
  21577. }
  21578. //xzw add: 截图
  21579. function dataURLtoBlob(dataurl) {
  21580. var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
  21581. bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
  21582. while(n--){
  21583. u8arr[n] = bstr.charCodeAt(n);
  21584. };
  21585. return new Blob([u8arr], {type:mime});
  21586. }
  21587. n.prototype.screenShot = function(o){
  21588. if(this.flying || this.flyingToTag) return;
  21589. var R = this.sceneRenderer;
  21590. R.updateScreenSize(o);
  21591. for(var i in this.model.panos.index){
  21592. if(!this.model.panos.index[i].marker) continue;
  21593. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible;
  21594. this.model.panos.index[i].marker.visible = false;
  21595. }
  21596. for(var i in this.model.hots){
  21597. this.model.hots[i].mesh.visible = false;
  21598. }
  21599. this.reticule.visible = false;
  21600. this.reticule.forceUnvisible = true;
  21601. this.path.currentPanoMarker.mesh.visible = false;
  21602. setTimeout(function(){//因resize效用没办法立即生效(原因未知),故而延后
  21603. R.renderer.clear(true,true,true);
  21604. R.renderer.render(R.scene, R.camera);
  21605. var imgData = R.renderer.domElement.toDataURL(o.type,0.9);
  21606. o.f && o.f(imgData)
  21607. R.updateScreenSize({resize:true});
  21608. this.reticule.visible = true;
  21609. for(var i in this.model.hots){
  21610. this.model.hots[i].mesh.visible = true;
  21611. }
  21612. for(var i in this.model.panos.index){
  21613. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide;
  21614. }
  21615. this.path.currentPanoMarker.mesh.visible = true;
  21616. R.renderer.render(R.scene, R.camera);
  21617. }.bind(this),30) //这个数字不能太小
  21618. }
  21619. var scaleImg = e("scaleImg");
  21620. var ResizeImg = function(img, option){
  21621. var img2; //不能直接改img 否则可能触发第二次img.onload
  21622. var compress = function(ratio,type){
  21623. var image = img2 || img;
  21624. var c = document.createElement('canvas');
  21625. c.width = image.width; c.height = image.height;
  21626. var ctx = c.getContext('2d');
  21627. ctx.drawImage(image,0,0,image.width,image.height);
  21628. img2 = scaleImg(ratio/* option.maxSize/oldSize */, c, type/* option.type||"png" */);//最大不能超过0.8M
  21629. }
  21630. var reCom = function(){ //如果有了img2 就只需要img2 否则创造新的img2
  21631. var image = img2 || img;
  21632. var blob = dataURLtoBlob(image.src);
  21633. if(option.maxWeight && blob.size > option.maxWeight){
  21634. compress(option.maxWeight/blob.size, "jpeg")
  21635. blob = dataURLtoBlob(image.src);
  21636. }
  21637. if(!img2){
  21638. img2 = new Image();
  21639. }
  21640. img2.base64Src = image.src;
  21641. img2.src = window.URL.createObjectURL(blob);
  21642. }
  21643. var oldSize = Math.max(img.width, img.height);
  21644. if(option.toType != "png"){//不是非要png的话
  21645. if(option.oldType == "jpeg"){//jpeg先判断尺寸,然后是尺寸
  21646. if(oldSize > option.maxSize){
  21647. compress(option.maxSize/oldSize, "jpeg");
  21648. }
  21649. reCom();
  21650. }else if(option.oldType == "png"){//png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21651. if(option.maxWeight && option.weight > option.maxWeight){//如果一开始大小不大就不压缩 还是png
  21652. compress(oldSize>option.maxSize ? option.maxSize/oldSize : 1, "jpeg");
  21653. reCom();
  21654. }
  21655. }
  21656. }else{
  21657. //?貌似png会越压缩越大?
  21658. }
  21659. return img2 || img;
  21660. }
  21661. var _fixType=function(type) {
  21662. type = type.toLowerCase().replace(/jpg/i, 'jpeg');
  21663. var r = type.match(/png|jpeg|bmp|gif/)[0];
  21664. return 'image/' + r;
  21665. };
  21666. var saveFile=function(data, filename){
  21667. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');
  21668. save_link.href = data;
  21669. save_link.download = filename;
  21670. var event = document.createEvent('MouseEvents');
  21671. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
  21672. save_link.dispatchEvent(event);
  21673. };
  21674. n.prototype.getWrapShot = function(){ //获取导览点截图/初始画面和信息
  21675. var info = this.getSnapAngleInfo();
  21676. var str = ',{\r\t' + info;
  21677. var arg = arguments[0];
  21678. this.screenShot({ width:g_snapShotWidth*4, height:g_snapShotHeight*4, type:"image/jpeg", f:function(imgData){
  21679. if (arg && arg.__callback) {
  21680. return arg.__callback(imgData, info)
  21681. }
  21682. var img = new Image();
  21683. img.src = imgData;
  21684. img.onload = function(){
  21685. var img2 = ResizeImg(this,{maxSize: g_snapShotWidth, oldType:"jpeg"}); //暂定缩略图大小
  21686. img2.src.replace(_fixType("image/jpeg"),'image/octet-stream');
  21687. var filename = "snap" + (new Date()).getTime();
  21688. saveFile(img2.src,filename + ".jpg");
  21689. str +=(',\r\t"thumbnail_signed_src":"'+filename+'.jpg",');
  21690. str +=('\r\t"sid":"'+filename+'",');
  21691. str +=('\r\t"name":"'+filename+'"\r}');
  21692. logData(str)
  21693. }
  21694. }});
  21695. }
  21696. ,
  21697. n.prototype.getSnapAngleInfo = function(){
  21698. var info = {};
  21699. var str = '"metadata":{';
  21700. var q = this.camera.quaternion.clone();
  21701. switch (this.mode) {
  21702. case "panorama":
  21703. info.scan_id = this.currentPano.id;
  21704. str += ('"scan_id":"'+this.currentPano.id+'",');
  21705. break;
  21706. case "floorplan":
  21707. info.camera_mode = 1;
  21708. q = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  21709. q.multiply(this.camera.quaternion);
  21710. str += ('"camera_mode":1,');
  21711. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21712. str += ('"ortho_zoom":'+ m.toPrecision(this.cameraControls.activeControl.currentScale, 4 )+",");
  21713. break;
  21714. case "dollhouse":
  21715. info.camera_mode = 2;
  21716. str += ('"camera_mode":2,');
  21717. break;
  21718. }
  21719. info.camera_position = m.toPrecision(this.camera.position.toArray(),4);
  21720. console.log(info.camera_position)
  21721. if(window.screenSta === 'tour'){ // fyz 导览截屏需要做额外的
  21722. /**fyz 对相机截屏的角度进行校对 */
  21723. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21724. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21725. out.x *= -1;
  21726. out.w *= -1;
  21727. info.camera_quaternion = m.toPrecision(out.toArray(),4);
  21728. }else{
  21729. info.camera_quaternion = m.toPrecision(q.toArray(),4);;
  21730. }
  21731. info.zoom = this.zoomLevel;
  21732. console.log(info.camera_quaternion)
  21733. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21734. // fyz 扩展编辑页面, 加上导览点缩放值
  21735. str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+'], "zoom":' + info.zoom + '}');
  21736. return str;
  21737. }
  21738. //------end
  21739. n.prototype.setupCustomProperties = function(e) {
  21740. var t = e || u.PANORAMA;
  21741. Object.defineProperty(this, "mode", {
  21742. get: function() {
  21743. return t
  21744. },
  21745. set: function(e) {
  21746. var i = t;
  21747. t = e,
  21748. this.onModeUpdated(i, t)
  21749. }
  21750. })
  21751. }
  21752. ,
  21753. n.prototype.isInMode = function() {
  21754. for (var e = 0; e < arguments.length; e++)
  21755. if (this.mode === arguments[e])
  21756. return !0;
  21757. return !1
  21758. }
  21759. ,
  21760. n.prototype.isOutsideMode = function(e) {
  21761. return e = e || this.mode,
  21762. e === u.DOLLHOUSE || e === u.FLOORPLAN
  21763. }
  21764. ,
  21765. n.prototype.is360View = function(e, t) {
  21766. return e === u.PANORAMA && t && !t.isAligned()
  21767. }
  21768. ,
  21769. n.prototype.setScene = function(e) {
  21770. this.sceneIntersectionPlane = e.plane,
  21771. this.path.setScene(e),
  21772. this.moveReticuleToScene(e)
  21773. }
  21774. ,
  21775. n.prototype.moveReticuleToScene = function(e) {
  21776. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  21777. e.add(this.reticule)
  21778. }
  21779. ,
  21780. n.prototype.updateModel = function() {
  21781. function e(e, t, n) {
  21782. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21783. }
  21784. function t(e, t) {
  21785. if (this.mode === u.DOLLHOUSE) {
  21786. var n = e ? this.model.center.y : n = t.center.y;
  21787. i.call(this, n)
  21788. }
  21789. }
  21790. function i(e) {
  21791. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  21792. , i = this.cameraControls.controls[u.DOLLHOUSE]
  21793. , n = t.position.y + (e - i.target.y)
  21794. , r = f.showFloorDuration + f.showFloorDelay;
  21795. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21796. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21797. }
  21798. this.model = this.modelManager.getActiveModel(),
  21799. this.model.on("floor.changed", e.bind(this)),
  21800. this.model.on("allfloors.toggled", t.bind(this)),
  21801. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model));
  21802. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21803. var e2 = this;
  21804. this.model.panos.list.forEach(function(a) {
  21805. a.vrMarker.addEventListener("click", function() {
  21806. e2.flyToPano({
  21807. pano: a
  21808. })
  21809. })
  21810. })
  21811. /********************************************************************************************************************************************/
  21812. this.model.addHighMapCube()//add
  21813. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  21814. }
  21815. ,
  21816. n.prototype.updateModelDependentData = function() {
  21817. this.cameraControls.setModelForControls(this.model),
  21818. this.getPanoMarkersFromModel(this.model)
  21819. }
  21820. ,
  21821. n.prototype.onModelChanged = function() {
  21822. this.updateModel(),
  21823. this.updateModelDependentData()
  21824. }
  21825. ,
  21826. n.prototype.getPanoMarkersFromModel = function(e) {
  21827. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  21828. return t.marker ? e.concat(t.marker) : e
  21829. }, [])
  21830. }
  21831. ,
  21832. n.prototype.handleControlMove = function(e) {
  21833. this.emit(w.Move, e)
  21834. }
  21835. ,
  21836. n.prototype.handleControlInputStart = function(e) {
  21837. this.emit(w.InputStart, e)
  21838. }
  21839. ,
  21840. n.prototype.onModeUpdated = function(e, t) {
  21841. this.cameraControls.activateControls(t),
  21842. this.emit(w.ModeChanged, e, t)
  21843. }
  21844. ,
  21845. n.prototype.isWarping = function() {//是否导览缓慢走向某个点
  21846. return this.path.warping
  21847. }
  21848. ,
  21849. n.prototype.isWaitingToWarp = function() {
  21850. return this.path.waitingToWarp
  21851. }
  21852. ,
  21853. n.prototype.getLabelScaleFactor = function() {
  21854. if (this.isOutsideMode()) {
  21855. var e = 10
  21856. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  21857. return t
  21858. }
  21859. return .5
  21860. }
  21861. ,
  21862. /* n.prototype.changeMusic = function() {//xzw add
  21863. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21864. } */
  21865. n.prototype.bindEvents = function(e) {
  21866. e !== document && e.setAttribute("tabindex", -1),
  21867. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  21868. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  21869. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  21870. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  21871. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  21872. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21873. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  21874. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  21875. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  21876. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  21877. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  21878. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  21879. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  21880. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  21881. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  21882. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21883. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21884. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21885. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21886. window.addEventListener("snapshotBegin", this.getWrapShot.bind(this)),//xzw add
  21887. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21888. // lzb
  21889. window.getSeft && getSeft(this);
  21890. }
  21891. ,
  21892. n.prototype.onMouseDown = function(e) {
  21893. e.currentTarget !== document && e.currentTarget.focus(),
  21894. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  21895. this.updateIntersect())
  21896. }
  21897. ,
  21898. n.prototype.onMouseMove = function(e) {
  21899. this.isTouchEvent = !1,
  21900. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21901. }
  21902. ,
  21903. n.prototype.onMouseOver = function(e) {
  21904. this.containsMouse = !0,
  21905. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  21906. if(this.intersectHot){
  21907. this.intersectHot.setHoverState(true)
  21908. }
  21909. }
  21910. ,
  21911. n.prototype.onMouseOut = function(e) {
  21912. this.containsMouse = !1
  21913. if(this.intersectHot){
  21914. this.intersectHot.setHoverState(false)
  21915. }
  21916. }
  21917. ,
  21918. n.prototype.onMouseUp = function(e) {
  21919. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  21920. }
  21921. ,
  21922. n.prototype.onTouchStart = function(e) {
  21923. if (e.currentTarget !== document && e.currentTarget.focus(),
  21924. !this.mouseDown) {
  21925. this.couldBeLongTap = !0;
  21926. var t = g.average(e.changedTouches, "clientX")
  21927. , i = g.average(e.changedTouches, "clientY");
  21928. this.handleInputStart.call(this, t, i, !0),
  21929. this.mouseDownTimer = setTimeout(function() {
  21930. this.updateIntersect(),
  21931. this.handleInputEnd.call(this, t, i, !0)
  21932. }
  21933. .bind(this), f.input.longTapThreshold)
  21934. }
  21935. }
  21936. ,
  21937. n.prototype.onTouchMove = function(e) {
  21938. var t = g.average(e.changedTouches, "clientX")
  21939. , i = g.average(e.changedTouches, "clientY");
  21940. this.handleInputMove.call(this, t, i, !0)
  21941. }
  21942. ,
  21943. n.prototype.onTouchEnd = function(e) {
  21944. if (clearTimeout(this.mouseDownTimer),
  21945. this.mouseDown) {
  21946. this.couldBeLongTap = !1,
  21947. this.updateIntersect();
  21948. var t = g.average(e.changedTouches, "clientX")
  21949. , i = g.average(e.changedTouches, "clientY");
  21950. this.handleInputEnd.call(this, t, i, !0)
  21951. }
  21952. //add
  21953. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21954. this.intersectHot = null
  21955. Hot.mobileAutoPlay(this)
  21956. }
  21957. ,
  21958. n.prototype.onPointerDown = function(e) {
  21959. return e.currentTarget !== document && e.currentTarget.focus(),
  21960. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  21961. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21962. void (this.mouseDownTimer = setTimeout(function() {
  21963. this.updateIntersect(),
  21964. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21965. }
  21966. .bind(this), f.input.longTapThreshold)))
  21967. }
  21968. ,
  21969. n.prototype.onPointerMove = function(e) {
  21970. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21971. }
  21972. ,
  21973. n.prototype.onPointerUp = function(e) {
  21974. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  21975. this.couldBeLongTap = !1,
  21976. this.updateIntersect(),
  21977. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  21978. }
  21979. ,
  21980. n.prototype.onPointerOut = function(e) {
  21981. this.mouseDown = !1
  21982. }
  21983. ,
  21984. n.prototype.onPointerCancel = function(e) {
  21985. this.mouseDown = !1
  21986. }
  21987. ,
  21988. n.prototype.onKeyDown = function(e) {
  21989. var t = function() {
  21990. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  21991. }
  21992. .bind(this)
  21993. , i = e.which;
  21994. switch (i) {
  21995. case p.F:
  21996. t(),
  21997. this.changeFloor(-1);
  21998. break;
  21999. case p.R:
  22000. t(),
  22001. this.changeFloor(1)
  22002. }
  22003. if (this.mode === u.PANORAMA)
  22004. switch (i) {
  22005. case p.UPARROW:
  22006. case p.W:
  22007. this.flyLocalDirection(d.FORWARD.clone());
  22008. break;
  22009. case p.DOWNARROW:
  22010. case p.S:
  22011. this.flyLocalDirection(d.BACK.clone());
  22012. break;
  22013. case p.A:
  22014. this.flyLocalDirection(d.LEFT.clone());
  22015. break;
  22016. case p.D:
  22017. this.flyLocalDirection(d.RIGHT.clone())
  22018. }
  22019. }
  22020. ,
  22021. n.prototype.handleScrollPinchZoom = function() {
  22022. return function(e) {
  22023. var t = e
  22024. , i = this.zoomLevel;
  22025. this.zoomBy(t),
  22026. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  22027. }
  22028. }(),
  22029. n.prototype.handleControlPinch = function(e) {
  22030. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  22031. }
  22032. ,
  22033. n.prototype.handleControlScroll = function(e) {
  22034. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  22035. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  22036. }
  22037. ,
  22038. n.prototype.handleInputStart = function(e, t, i) {
  22039. //许钟文加
  22040. var pad = this.handelPadding(e, t);
  22041. e = pad.x;
  22042. t = pad.y;
  22043. this.isTouchEvent = i,
  22044. m.convertScreenPositionToNDC(e, t, this.mouse),
  22045. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  22046. this.mouseCouldBeClickToMove = !0,
  22047. this.mouseDown = !0;
  22048. Hot.mobileAutoPlay(this)
  22049. }
  22050. ,
  22051. n.prototype.handelPadding = function(x, y) {
  22052. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  22053. if (!this.pad)
  22054. this.pad = {//可以直接用$("#player")[0].getBoundingClientRect() , 因为body没有offset
  22055. x: dom.getOffset("left", $("#player")[0]),
  22056. y: dom.getOffset("top", $("#player")[0])
  22057. }
  22058. return {
  22059. x: x - this.pad.x,
  22060. y: y - this.pad.y
  22061. }
  22062. }
  22063. n.prototype.handleInputMove = function(e, t, i) {
  22064. //许钟文加
  22065. var pad = this.handelPadding(e, t);
  22066. e = pad.x;
  22067. t = pad.y;
  22068. this.isTouchEvent = i,
  22069. m.convertScreenPositionToNDC(e, t, this.mouse),
  22070. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  22071. this.couldBeLongTap = !1,
  22072. clearTimeout(this.mouseDownTimer)),
  22073. this.mouseLastMoveTime = Date.now(),
  22074. this.reticule.move(e, t, i)
  22075. }
  22076. ,
  22077. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  22078. if (this.isTouchEvent = i,
  22079. this.mouseDown = !1,
  22080. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  22081. !i && this.couldBeLongTap)
  22082. return !0;
  22083. if (this.handleLongTap())
  22084. return !0;
  22085. /* if(this.director.tourIsPlaying){
  22086. return !0;
  22087. } */
  22088. if (this.mouseCouldBeClickToMove) {
  22089. if (this.flying)
  22090. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  22091. !0;
  22092. //add----
  22093. if(this.checkHotClick())//add
  22094. return !0;
  22095. if(this.hoveringPlane){
  22096. this.clickOverlay(this.hoveringPlane)
  22097. return;
  22098. }
  22099. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  22100. this.history.invalidate(),
  22101. this.intersect)
  22102. return this.flyToPanoClosestToMouse();
  22103. if (this.mode === u.PANORAMA) {
  22104. var n = this.closestPanoInDirection(this.getMouseDirection());
  22105. return n ? this.flyToPano({
  22106. pano: n
  22107. }) : this.bump(this.getMouseDirection())
  22108. }
  22109. }
  22110. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode) //xzw 删,否则拖拽后就不高亮了
  22111. }
  22112. ,
  22113. n.prototype.handleLongTap = function() {
  22114. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  22115. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  22116. !0
  22117. }
  22118. ,
  22119. n.prototype.checktagClick = function() {
  22120. if (this.tagManager.intersectTag) {
  22121. var e = this.isTouchEvent
  22122. , t = this.tagManager.clickedOnTag(e, this);
  22123. return e || t || y.cancelById(V.LookTransition),
  22124. !0
  22125. }
  22126. if (this.tagManager.activeTag)
  22127. return this.tagManager.dismissActiveTag(),
  22128. !1
  22129. }
  22130. ,
  22131. n.prototype.rankedtagInDirection = function(e, t) {
  22132. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  22133. }
  22134. ,
  22135. n.prototype.start = function(e) {
  22136. //-------------------
  22137. //-------------------
  22138. var t = e.mode
  22139. , i = e.pano
  22140. , n = e.position
  22141. , rr = e.quaternion
  22142. , o = e.tag
  22143. , a = e.quickstart
  22144. , s = $.Deferred();
  22145. this.updateModelDependentData(),
  22146. this.updateFromControls(),
  22147. this.findDefaultViews();
  22148. var l = this.is360View(t, i);
  22149. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  22150. s.done(function(e) {
  22151. this.emit(w.Ready, l, e, o)
  22152. }
  22153. .bind(this)),
  22154. s.promise()
  22155. }
  22156. ,
  22157. n.prototype.startOutside = function(e, t) {
  22158. var i = e.mode
  22159. , n = e.pano
  22160. , r = e.position
  22161. , o = e.quaternion
  22162. , a = e.zoom
  22163. , s = e.floorVisibility
  22164. , l = e.tag;
  22165. this.emit(w.StartOutside, f[i].transitionTime),
  22166. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  22167. y.cancelById(V.FlyToViewFloor),
  22168. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  22169. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  22170. }
  22171. ,
  22172. n.prototype.startInside = function(e, t, i, n, r) {
  22173. r = r || $.Deferred(),
  22174. this.currentPano = e;
  22175. window.bus.dispatchEvent({type:'playerAndModelReady'})
  22176. this.ready = true
  22177. var o = e && !e.isAligned();
  22178. if (t = o ? e.position : t || e.position,
  22179. i = i || e.quaternion,
  22180. e) {
  22181. var a = this.startInside.bind(this, e, t, i, n, r);
  22182. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  22183. return
  22184. }
  22185. //add
  22186. this.transitionPos({type:"beforeFlytopano", pano:this.currentPano, dur:0})
  22187. //this.updateHotVisible()
  22188. Hot.updateVisibles([this.currentPano])
  22189. this.modeTran = "panorama-panorama"
  22190. return this.mode = u.PANORAMA,
  22191. e.floor.enter(this.mode),
  22192. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  22193. this.switchCameraMode(this.mode, i),
  22194. this.emit(w.StartInside, o),
  22195. r.resolve(!0),
  22196. r
  22197. }
  22198. ,
  22199. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  22200. if (r = r || $.Deferred(),
  22201. this.dollhouseMode(),
  22202. !e)
  22203. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  22204. r.resolve(!1),
  22205. r;
  22206. t = t || e.position;
  22207. var o = i || this.cameraControls.activeControl.camera.quaternion
  22208. , a = e.position;
  22209. return this.fitDollhouse(a, t, o),
  22210. setTimeout(function(t) {
  22211. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  22212. var n = {
  22213. mode: u.PANORAMA,
  22214. pano: e,
  22215. quaternion: i,
  22216. callback: function() {
  22217. this.emit(w.FlyinFinished),
  22218. r.resolve(!0)
  22219. }
  22220. .bind(this)
  22221. };
  22222. this.flyToNewMode(n)
  22223. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  22224. r
  22225. }
  22226. ,
  22227. n.prototype.checkAndWaitForPanoLoad = function() {
  22228. var e = {}
  22229. , t = {}
  22230. , i = 5e3
  22231. , n = function() {
  22232. for (var n in e)
  22233. if (e.hasOwnProperty(n) && e[n]) {
  22234. var r = performance.now() - t[n];
  22235. if (r < i)
  22236. return !0
  22237. }
  22238. return !1
  22239. };
  22240. return function(r, o, a, s, l, c, h, u, d, p) {
  22241. if (n())
  22242. return !0;
  22243. var f = function(t, i, n) {
  22244. N.delayOneFrame(function() {
  22245. e[t] = !1,
  22246. l && l(i, n)
  22247. }
  22248. .bind(this))
  22249. }
  22250. .bind(this, r.id)
  22251. , g = function(t, i) {
  22252. N.delayOneFrame(function() {
  22253. e[t] = !1,
  22254. c && c(i)
  22255. }
  22256. .bind(this))
  22257. }
  22258. .bind(this, r.id);
  22259. try {
  22260. return null !== u && void 0 !== u || (u = !0),
  22261. 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),
  22262. e[r.id] && (t[r.id] = performance.now()),
  22263. e[r.id]
  22264. } catch (n) {
  22265. throw e[r.id] = !1,
  22266. t[r.id] = performance.now() - i,
  22267. n
  22268. }
  22269. }
  22270. }(),
  22271. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  22272. if (!e)
  22273. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  22274. return r && this.model.waitForLoad(e, function() {
  22275. return e.isLoaded(i)
  22276. }),
  22277. !e.isLoaded(t) && (e.loadCube(t).done(n),
  22278. !0)
  22279. }
  22280. ,
  22281. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  22282. var e = new r.Vector3;
  22283. return function(t, i, n, r, o, a, s, l) {
  22284. if (!t)
  22285. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  22286. return e.copy(d.FORWARD),
  22287. this.getDirection(e),
  22288. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  22289. return t.isLoaded(i)
  22290. }),
  22291. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  22292. n && n(e, t)
  22293. }
  22294. .bind(this)).fail(function(e) {
  22295. r && r(e)
  22296. }
  22297. .bind(this)).progress(function(e, t, i) {
  22298. o && o(e, t, i)
  22299. }
  22300. .bind(this)),
  22301. !0)
  22302. }
  22303. }(),
  22304. n.prototype.switchCameraMode = function(e, t) {
  22305. var i = this.cameraControls.controls[e]
  22306. , n = i.camera;
  22307. switch (e) {
  22308. case u.PANORAMA:
  22309. n.position.copy(this.currentPano.position);
  22310. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  22311. i.lookAt(o.add(n.position));
  22312. break;
  22313. case u.DOLLHOUSE:
  22314. /* var a = this.position.clone();
  22315. 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),
  22316. n.position.copy(a),
  22317. i.target.copy(this.target.clone().setY(this.model.center.y));
  22318. break; */
  22319. //for多楼层 且 让模型刚好适应屏幕
  22320. var box = this.model.boundingBox.clone();
  22321. box.applyMatrix4(this.camera.matrixWorld);//将 boundingbox、也就是模型, 转换到当前相机朝向
  22322. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  22323. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1); //获得在当前窗口的横向的fov
  22324. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2))//根据上面获得的参数得到target到相机的距离
  22325. //console.log(boxSize.x,distance, boxSize.length() / 2)
  22326. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  22327. if(this.mode === u.PANORAMA){
  22328. i.target.copy(this.model.center);
  22329. var vec = this.getDirection().negate().setY(1).normalize()//获得朝向
  22330. }else{
  22331. i.target.copy(this.target.clone().setY(this.model.center.y))
  22332. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  22333. }
  22334. vec.multiplyScalar(distance )
  22335. n.position.copy(i.target.clone().add(vec))
  22336. break
  22337. case u.FLOORPLAN:
  22338. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  22339. i.target.copy(this.model.center).setY(0),
  22340. i.zoomToContain(this.model.size),
  22341. i.rotateToView(this.model.size, this.getDirection())
  22342. }
  22343. i.update(0)
  22344. }
  22345. ,
  22346. n.prototype.update = function() {
  22347. var e = (new r.Vector3,
  22348. {})
  22349. , t = [];
  22350. return function(i) {
  22351. this.updatePersistentZooming(i),
  22352. this.updateFromControls(i),
  22353. this.getCurrentNodePanos(t)
  22354. this.lastFrameChanged = false
  22355. if(this.hasChanged(e) ) {
  22356. this.lastFrameChanged = e.cameraChanged3 ? 'level3' : e.cameraChanged2 ? 'level2' : e.cameraChanged ? 'level1' : false
  22357. this.lastChangeTime = Date.now(),
  22358. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  22359. this.emit(w.ViewChanged, e),
  22360. // 注意: player.cameraControls.activeControl.camera 的 matrix是错的
  22361. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  22362. }
  22363. if(e.cameraChanged2){ //变化要更大些
  22364. }
  22365. if(e.cameraChanged){
  22366. this.mode == "panorama" && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon);
  22367. /* for(var i in this.model.hots){
  22368. this.model.hots[i].updateTitle(this)
  22369. } */
  22370. Hot.updateHots()
  22371. }
  22372. this.model.supportsTiles && (this.updateTileDownloader(t),
  22373. this.updatePanoRenderer(t)),
  22374. this.updatePreRendering(t),
  22375. this.reticule.update(),
  22376. this.path.update(),
  22377. this.spider.update(),
  22378. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  22379. this.updateControlLocks(),
  22380. this.model.supportsTiles && this.updateZoomPano()
  22381. }
  22382. }(),
  22383. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  22384. var lastMode, lastPano;
  22385. return function(){
  22386. var mode = this.mode;
  22387. var pano = mode == "panorama" ? this.currentPano : "";
  22388. if(mode != "panorama" || pano != lastPano){
  22389. overlay.noBlock = null
  22390. }
  22391. this.overlayGroup.children.forEach((overlay)=>{
  22392. if(overlay.overlayType == "video" ){
  22393. var matrix = overlay.plane.matrixWorld;
  22394. var inSight = false;
  22395. var cameraDir = this.getDirection();
  22396. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  22397. var vertexes = []
  22398. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  22399. for(let i=0; i<4; i++){
  22400. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  22401. vertexes.push(vertex)
  22402. if(overlay.noBlock == null){
  22403. if(!m.ifShelter(vertex)){
  22404. overlay.noBlock = true
  22405. }
  22406. inSight = true; break;
  22407. }else{
  22408. overlay.noBlock = true
  22409. }
  22410. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  22411. inSight = true; break;
  22412. }
  22413. }
  22414. }
  22415. overlay.inSight = inSight
  22416. if(!inSight)overlay.plane.material.map.image.pause()
  22417. else overlay.plane.material.map.image.play()//maybe fail
  22418. }
  22419. })
  22420. lastMode = mode, lastPano = pano
  22421. }
  22422. }() */
  22423. n.prototype.updatePersistentZooming = function(e) {
  22424. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  22425. }
  22426. ,
  22427. n.prototype.updateControlLocks = function() {
  22428. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  22429. }
  22430. ,
  22431. n.prototype.updatePanoRenderer = function() {
  22432. var e = new r.Vector3;
  22433. return function(t) {
  22434. var i = this.nextPano || this.currentPano;
  22435. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  22436. this.getDirection(e),
  22437. this.panoRenderer.updateDirection(e))
  22438. }
  22439. }(),
  22440. n.prototype.cleanupInactivePanos = function() {
  22441. var e = []
  22442. , t = [];
  22443. return function() {
  22444. e.length = 0,
  22445. e.push(this.currentPano),
  22446. this.nextPano && e.push(this.nextPano),
  22447. t.length = 0;
  22448. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  22449. t.push(this.panoRenderer.activePanos[i]);
  22450. for (var n = 0; n < t.length; n++) {
  22451. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  22452. r.id === e[a].id && (o = !1);
  22453. o && r.exit()
  22454. }
  22455. }
  22456. }(),
  22457. n.prototype.updatePreRendering = function() {
  22458. var e = {};
  22459. return function(t) {
  22460. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  22461. var i = this.nextPano || this.currentPano;
  22462. if (i && t && t.length > 1) {
  22463. var n = t.findIndex(function(e) {
  22464. if (e.id === i.id)
  22465. return !0
  22466. });
  22467. if (n >= 0 && n + 1 < t.length) {
  22468. var r = t[n + 1];
  22469. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  22470. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  22471. window.setTimeout(function(t) {
  22472. e[t.id] = !1
  22473. }
  22474. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  22475. }
  22476. .bind(this, r), f.tiling.panoPreRenderDelay),
  22477. e[r.id] = !0)
  22478. }
  22479. }
  22480. }
  22481. }
  22482. }(),
  22483. n.prototype.enablePreRendering = function() {
  22484. this.preRenderingEnabled = !0
  22485. }
  22486. ,
  22487. n.prototype.disablePreRendering = function() {
  22488. this.preRenderingEnabled = !1,
  22489. this.cleanupInactivePanos()
  22490. }
  22491. ,
  22492. n.prototype.updateTileDownloader = function() {
  22493. var e = new r.Vector3;
  22494. return function(t) {
  22495. var i = this.nextPano || this.currentPano;
  22496. i && (e.copy(d.FORWARD),
  22497. this.getDirection(e),
  22498. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  22499. this.tileDownloader.processPriorityQueue = !0)
  22500. }
  22501. }(),
  22502. n.prototype.updateFromControls = function(e) {
  22503. null !== e && void 0 !== e || (e = 0),
  22504. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  22505. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  22506. this.position.copy(this.cameraControls.activeControl.camera.position),
  22507. this.target.copy(this.cameraControls.activeControl.target),
  22508. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  22509. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  22510. this.camera.position.copy(this.position),
  22511. this.camera.quaternion.copy(this.quaternion),
  22512. this.camera.updateMatrix(),
  22513. this.camera.updateMatrixWorld()
  22514. }
  22515. ,
  22516. n.prototype.hasChanged = function(e) {
  22517. if (!this.previousState)
  22518. {
  22519. this.previousState = {
  22520. allFloorsVisible: this.model.allFloorsVisible,
  22521. position: this.position.clone(),
  22522. quaternion: this.quaternion.clone(),
  22523. mouse: this.mouse.clone(),
  22524. //labelScaleFactor: this.getLabelScaleFactor(),
  22525. currentFloor: this.model.currentFloor,
  22526. projectionMatrix: this.camera.projectionMatrix.clone(),
  22527. worldMatrix: this.camera.matrixWorld.clone(),
  22528. mode: this.mode,
  22529. modelPosition: this.model.position.clone(),
  22530. modelCenter: this.model.center.clone(),
  22531. zoomLevel: this.zoomLevel
  22532. };
  22533. e.cameraChanged = e.cameraChanged2 = true;
  22534. return !0;
  22535. }
  22536. //许钟文改 分成相机是否改变cameraChanged 和其他
  22537. 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)
  22538. 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 ;
  22539. e.cameraChanged = !a;
  22540. e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  22541. e.moved = !this.position.equals(this.previousState.position),
  22542. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  22543. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  22544. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22545. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  22546. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  22547. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  22548. e.modeChanged = this.mode !== this.previousState.mode,
  22549. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  22550. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  22551. e.nextPanoActive = null !== this.nextPano,
  22552. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel
  22553. /* if(e.cameraChanged){//
  22554. 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)
  22555. }else e.cameraChanged2 = false */
  22556. if(e.cameraChanged){
  22557. e.cameraChanged2 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22558. e.cameraChanged3 = e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 3)
  22559. } else {
  22560. e.cameraChanged2 = false
  22561. e.cameraChanged3 = false
  22562. }
  22563. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  22564. this.previousState.position.copy(this.position),
  22565. this.previousState.quaternion.copy(this.quaternion),
  22566. this.previousState.mouse.copy(this.mouse),
  22567. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22568. this.previousState.currentFloor = this.model.currentFloor,
  22569. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22570. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22571. this.previousState.mode = this.mode,
  22572. this.previousState.modelPosition.copy(this.model.position),
  22573. this.previousState.modelCenter.copy(this.model.center),
  22574. this.previousState.zoomLevel = this.zoomLevel;
  22575. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22576. return !t
  22577. }
  22578. ,
  22579. n.prototype.updateIntersect = function() {
  22580. var e = this.flying || this.isWarping()
  22581. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  22582. , i = y.getById(V.LookTransition)
  22583. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  22584. {//clear:
  22585. if(this.intersectHot) this.intersectHot.setHoverState(false)
  22586. this.intersectHot = null
  22587. CursorDeal.remove('hoverHot')
  22588. }
  22589. var deal = ()=>{
  22590. if(this.intersect && this.intersect.object.visible ){
  22591. if("hotSprite" == this.intersect.object.type){
  22592. this.intersectHot = this.intersect.object
  22593. while(!(this.intersectHot instanceof Hot)){
  22594. this.intersectHot = this.intersectHot.parent
  22595. }
  22596. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass("active")
  22597. this.intersectHot.setHoverState(true)
  22598. }
  22599. }
  22600. }
  22601. if(this.model.hotGroup){
  22602. var hots = this.model.hotGroup.children.filter(e=> e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  22603. let colliders = this.model.floors.reduce(function(e, t) {
  22604. return t.hidden ? e : e.concat(t.collider.children)
  22605. }, this.mode === 'panorama' ? this.panoMarkers : [])
  22606. this.intersect = this.getMouseIntersect(null, hots.concat(colliders/* this.model.colliders */));
  22607. if(this.intersect){
  22608. deal()
  22609. let intersect = this.intersect
  22610. if(this.intersectHot){
  22611. this.intersect = null
  22612. CursorDeal.add('hoverHot')
  22613. }else{
  22614. if(intersect.object.parent.parent.hidden ){//楼层已隐藏
  22615. this.intersect = null
  22616. }
  22617. }
  22618. }
  22619. }else{
  22620. this.intersect = this.getMouseIntersect()
  22621. }
  22622. this.intersect && this.updateClosestPano(this.intersect),
  22623. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  22624. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  22625. }
  22626. ,
  22627. n.prototype.checkHotClick = function() {
  22628. if(this.intersectHot){
  22629. if(this.intersectHot.texType == "video" && this.intersectHot.info.actionType.playAndPause){
  22630. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  22631. }
  22632. this.intersectHot.examine(this)
  22633. return true;
  22634. }
  22635. },
  22636. n.prototype.getMouseDirection = function(e) {
  22637. e = e || this.mouse;
  22638. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  22639. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  22640. return i.sub(t).normalize()
  22641. }
  22642. ,
  22643. n.prototype.hoverOverlay = function(mesh){
  22644. if(!mesh){
  22645. this.hoveringPlane = null;
  22646. $("#player").css("cursor",this.currentCursor || "" );
  22647. }else{
  22648. var overlay = mesh.parent;
  22649. $("#player").css("cursor","pointer");
  22650. this.hoveringPlane = overlay;
  22651. return true;
  22652. }
  22653. },
  22654. n.prototype.clickOverlay = function(overlay){
  22655. if(this.openOverlay && !overlay)return;
  22656. var plane = overlay.plane;
  22657. /* if(overlay.overlayType == "video"){
  22658. if(plane.material.map.image.paused) plane.material.map.image.play()
  22659. else plane.material.map.image.pause()
  22660. } */
  22661. if(overlay.overlayType == "video"){
  22662. overlay.switchPlay(!!overlay.pausedByUser)
  22663. }
  22664. /* if(window.EditOverlay &&EditOverlay.editing){
  22665. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22666. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22667. EditOverlay.endAddPlane();
  22668. EditOverlay.updateOverlayPanel(overlay)
  22669. EditOverlay.controlSelectOverlay(overlay)
  22670. return;
  22671. } */
  22672. },
  22673. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  22674. e = e || this.mouse.clone(),
  22675. t = t || this.model.floors.reduce(function(e, t) {
  22676. return t.hidden ? e : e.concat(t.collider.children)
  22677. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  22678. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  22679. this.raycaster.set(i, this.getMouseDirection(e));
  22680. var n = this.raycaster.intersectObjects(t, true);//add true
  22681. var o = n[0];
  22682. if(o){
  22683. o.face && (o.normal = o.face.normal.applyQuaternion(o.object.quaternion),
  22684. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22685. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  22686. o.horizontal = .8 < o.normal.y);
  22687. return o
  22688. }
  22689. }
  22690. ,
  22691. n.prototype.updateClosestPano = function(e) {
  22692. var t = [s.filters.isPanoAligned()];
  22693. if (this.mode === u.PANORAMA) {
  22694. if (!this.currentPano)
  22695. return;
  22696. t.push(s.filters.not(this.currentPano)),
  22697. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22698. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  22699. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22700. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22701. } else{
  22702. t.push(s.filters.isOnVisibleFloor()),
  22703. t.push(this.checkHasNeighbor)//add
  22704. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  22705. }
  22706. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  22707. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  22708. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22709. this.closestPano = i,
  22710. this.closestPano && this.mode == 'panorama' ? CursorDeal.add('hoverPano' ) : CursorDeal.remove('hoverPano' ) //add
  22711. ) : this.isPanoHover = !1
  22712. }
  22713. ,
  22714. n.prototype.dollhouseMode = function(e, t) {
  22715. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  22716. this.mode = u.DOLLHOUSE,
  22717. this.cameraControls.controls[u.DOLLHOUSE].reset();
  22718. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  22719. , n = new r.Vector3(15,10,15);
  22720. if (e && t) {
  22721. var o = d.FORWARD.clone().applyQuaternion(t)
  22722. , a = this.model.center.clone().sub(e)
  22723. , s = a.dot(o);
  22724. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  22725. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22726. }
  22727. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22728. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22729. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22730. this.updateFromControls(),
  22731. this.model.alpha = 1,
  22732. this.model.skybox.material.uniforms.opacity.value = 0
  22733. }
  22734. ,
  22735. n.prototype.insideMode = function(e, t) {
  22736. var i = $.Deferred()
  22737. , n = t || null;
  22738. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22739. var r = [s.filters.isPanoAligned()];
  22740. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22741. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  22742. this.flyToNewMode({
  22743. mode: u.PANORAMA,
  22744. pano: e,
  22745. callback: n
  22746. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  22747. } else {
  22748. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  22749. i.reject(o)
  22750. }
  22751. return i.promise()
  22752. }
  22753. ,
  22754. n.prototype.fitDollhouse = function(e, t, i) {//许钟文改 飞入前寻找和初始视角最合适的位置
  22755. //if(urlHasValue('oldEntry')){
  22756. //搬自一代。
  22757. var maxY = this.model.boundingBox.max.y;
  22758. var n = d.FORWARD.clone().applyQuaternion(i)
  22759. , i = n.clone().add(e);
  22760. this.cameraControls.activeControl.target.copy(i),
  22761. this.cameraControls.activeControl.camera.position.set(0, maxY * 2.4, 0).add(e).add(n.multiplyScalar(-10))
  22762. //return;
  22763. /* //this.camera.position.copy(this.model.center);
  22764. //this.camera.updateMatrixWorld()
  22765. this.switchCameraMode("dollhouse", i) */
  22766. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22767. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22768. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22769. this.cameraControls.activeControl.target.copy(n).add(e);
  22770. var o = d.RIGHT.clone().applyQuaternion(i)
  22771. , a = d.UP.clone()
  22772. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22773. , l = this.model.boundingBox.max.clone()
  22774. , c = this.model.boundingBox.min.clone()
  22775. , 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)]
  22776. , u = 0
  22777. , p = 0
  22778. , g = 0;
  22779. h.forEach(function(e, t, i) {
  22780. var n = Math.abs(e.dot(o))
  22781. , r = e.dot(s);
  22782. n > u && (u = n,
  22783. p = r),
  22784. r > g && (g = r)
  22785. });
  22786. 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)))
  22787. , v = s.clone().multiplyScalar(p).add(t)
  22788. , A = s.clone().multiplyScalar(g).add(t);
  22789. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22790. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22791. p = Math.max(p, 10),
  22792. g = Math.max(g, 10);
  22793. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22794. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22795. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22796. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22797. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22798. */
  22799. }
  22800. ,
  22801. n.prototype.floorplanMode = function(e, t, i) {
  22802. this.mode = u.FLOORPLAN;
  22803. var n = this.cameraControls.controls[u.FLOORPLAN];
  22804. n.reset();
  22805. var r = e ? e : this.model.center;
  22806. if (n.target.copy(r).setY(0),
  22807. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22808. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  22809. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  22810. t) {
  22811. var o = d.LEFT.clone().applyQuaternion(t);
  22812. n.rotateLeft(-Math.atan2(o.x, o.z))
  22813. } else
  22814. n.rotateToView(this.model.size, this.getDirection());
  22815. n.update(0)
  22816. }
  22817. ,
  22818. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  22819. return e.skipWarpingCheck = !0,
  22820. this.flyToPano(e, t)
  22821. }
  22822. ,
  22823. n.prototype.updateMarkerVisi = function() {//加
  22824. if(this.mode != "panorama")return;
  22825. this.model.panos.list.forEach((pano)=>{
  22826. if(!pano.marker)return;
  22827. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id];
  22828. })
  22829. }
  22830. ,
  22831. /* n.prototype.updateHotVisible = function(pano){
  22832. var hots = this.model.hots;
  22833. pano = pano || this.currentPano;
  22834. for (var index in hots){
  22835. var visible;
  22836. if(this.mode != "panorama"){
  22837. visible = true;
  22838. }else{
  22839. //hots[index].mesh.material.depthTest = false;
  22840. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22841. }
  22842. hots[index].mesh.visible = visible;
  22843. }
  22844. } */
  22845. n.prototype.flyToPano = function(e, t) {
  22846. var i = e.pano
  22847. , aim = e.lookAtPoint
  22848. , aimQua = e.quaternion //ADD
  22849. , o = e.duration
  22850. , a = e.aimDuration
  22851. , s = e.maxDistanceOverride
  22852. , l = e.skipWarpingCheck
  22853. , c = e.constantMoveSpeed
  22854. , h = null
  22855. , p = null
  22856. if (aim){
  22857. var _ = (new r.Matrix4).lookAt(i.position, aim, d.UP)
  22858. aimQua = (new r.Quaternion).setFromRotationMatrix(_)
  22859. }
  22860. else aimQua = aimQua
  22861. var zoomLevel = e.zoomLevel || 1 //add
  22862. if(this.flying) return t && t(e)
  22863. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i);
  22864. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  22865. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  22866. t && t(),
  22867. !1;
  22868. if (this.updateLastView(),
  22869. this.mode !== u.PANORAMA) {
  22870. var m;
  22871. return void this.flyToNewMode({
  22872. mode: u.PANORAMA,
  22873. pano: i,
  22874. duration: o,
  22875. quaternion: aimQua ,
  22876. callback: t
  22877. })
  22878. }
  22879. if (!i || (h = g.deepExtend(e),
  22880. p = function() {
  22881. N.delayOneFrame(function() {
  22882. this.flyToPano(h, t)
  22883. }
  22884. .bind(this))
  22885. }
  22886. .bind(this),
  22887. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  22888. var C = function(e) {
  22889. t && t(e)
  22890. }
  22891. .bind(this);
  22892. this.currentPano || (this.currentPano = i,
  22893. this.path.placeCpm(),
  22894. this.path.fadeOutCpm(f.path.fadeOutTime),
  22895. this.spider.draw());
  22896. var I = o;
  22897. if ("number" != typeof o) {
  22898. var E = s || f.transition.flytimeMaxDistanceThreshold;
  22899. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22900. }
  22901. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  22902. zoomLevel !== this.zoomLevel)
  22903. switch (f.zoom.transitionStyle) {
  22904. case 1:
  22905. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I); //改
  22906. break;
  22907. case 2:
  22908. return h = g.deepExtend(e),
  22909. p = this.flyToPano.bind(this, h, t),
  22910. void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22911. }
  22912. if (aimQua) {
  22913. y.cancelById(V.LookTransition),
  22914. I *= f.transition.aimSlowFactor;
  22915. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  22916. , S = b.clone()
  22917. , M = new r.Vector3;
  22918. if (i === this.currentPano) {
  22919. var R = d.FORWARD.clone().applyQuaternion(b)
  22920. , P = d.FORWARD.clone().applyQuaternion(aimQua)
  22921. , O = R.angleTo(P);
  22922. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  22923. void y.start(function(e) {
  22924. S.copy(b),
  22925. v.quaternion(S, aimQua)(e),
  22926. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22927. this.cameraControls.activeControl.lookAt(M)
  22928. }
  22929. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  22930. }
  22931. }
  22932. if (i === this.currentPano )
  22933. return void C();
  22934. this.flying = !0;
  22935. var L = this.position.clone()
  22936. , D = this.currentPano;
  22937. F.debug("Flying to pano ", i.position),
  22938. this.emit(w.PanoChosen, this.currentPano, i),
  22939. this.emit(w.FlyingStarted, i.position, L, i, D)
  22940. //---------before fly--------------- add
  22941. this.transitionPos({type:"beforeFlytopano", pano:i, dur:I})//add
  22942. Hot.updateVisibles([this.currentPano, i],'every')
  22943. //地标变化
  22944. if(this.model.floorLogos){
  22945. this.model.changefloorLogoOpa({index:0, opa:0, dur: p, delay:0.7})//this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22946. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position));
  22947. //this.model.adjustfloorLogoHeight();
  22948. this.model.floorLogos[1].material.opacity = 0;//uniforms.opacity.value = 0;
  22949. this.model.floorLogos[1].visible = true;
  22950. this.model.changefloorLogoOpa({index:1, opa:1, dur: 250})//this.model.floorLogoShow(1,250);
  22951. }
  22952. //=======================================
  22953. this.nextPano = i
  22954. let beginTran = ()=>{
  22955. aimQua && y.start(function(e) {
  22956. S.copy(b),
  22957. v.quaternion(S, aimQua)(e),
  22958. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22959. this.cameraControls.activeControl.lookAt(M)
  22960. }
  22961. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  22962. var B = c ? null : A[f.transition.movementEasing];
  22963. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  22964. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  22965. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  22966. this.flying = !1,
  22967. this.currentPano !== i && this.currentPano.exit(),
  22968. i.enter(),
  22969. this.currentPano = i,
  22970. this.nextPano = null,
  22971. this.path.placeCpm(),
  22972. this.path.fadeOutCpm(f.path.fadeOutTime),
  22973. this.spider.draw(),
  22974. this.emit(w.FlyingEnded, i.position, L, i, D),
  22975. this.updateMarkerVisi(),//add
  22976. C(e)
  22977. //add:
  22978. if(this.mode == "panorama" ){
  22979. if(this.model.floorLogos){
  22980. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22981. //this.model.adjustfloorLogoHeight()
  22982. this.model.changefloorLogoOpa({index:0,opa:1,dur:0});//this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22983. this.model.floorLogos[1].visible = false;
  22984. }
  22985. this.model.fadePanoMarkers()//add
  22986. Hot.updateVisibles([this.currentPano])//add
  22987. }
  22988. }
  22989. .bind(this), 0, B, "camFly", V.FlyToPano)
  22990. }
  22991. if(!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */){
  22992. setTimeout(()=>{
  22993. beginTran()
  22994. }, 50) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  22995. }else{
  22996. beginTran()
  22997. }
  22998. }
  22999. }
  23000. ,
  23001. n.prototype.warpToPano = function(o={}) {
  23002. }
  23003. n.prototype.blackToPano = function(o={},callback) {//add 瞬间过渡
  23004. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  23005. if(this.flying || this.isWarping() )return;
  23006. let pano = o.pano || this.model.panos.index[o.panoId]
  23007. if (this.mode !== u.PANORAMA) {
  23008. var m;
  23009. void this.flyToNewMode({
  23010. mode: u.PANORAMA,
  23011. pano ,
  23012. duration: o.duration,
  23013. quaternion: o.quaternion ,
  23014. callback
  23015. })
  23016. }
  23017. let oldPos = this.position.clone();
  23018. let oldPano = this.currentPano
  23019. this.path.warpDestPano = pano
  23020. var retry = ()=>{
  23021. this.waitingToWarp = !1,
  23022. this.blackToPano(o,callback)
  23023. }
  23024. if (this.checkAndWaitForPanoLoad(pano, "high", "low", this.basePanoSize, retry))
  23025. return void (this.waitingToWarp = !0)
  23026. this.flying = true
  23027. this.nextPano = pano //提前加载高清图片
  23028. this.path.warpDestHeroLoc = {
  23029. panoId : pano.id,
  23030. position: pano.position,
  23031. quaternion: o.quaternion || this.quaternion.clone()
  23032. }
  23033. this.path.warpTravel_BLACK(null, 1500,1, ()=>{
  23034. pano != this.currentPano && this.currentPano.exit()
  23035. pano.enter()
  23036. this.currentPano = pano
  23037. this.flying = false
  23038. this.nextPano = null
  23039. this.updateMarkerVisi();//add
  23040. callback && callback()
  23041. } )
  23042. }
  23043. window._transitionPosId = 9999
  23044. n.prototype.transitionPos = function(o={}) {//渐变overlay和热点的位置
  23045. y.cancelById(_transitionPosId)
  23046. var begin = function(object, pos, qua, scale){
  23047. if(pos){
  23048. if(!same(object.position, pos, 0.01)){
  23049. y.start(v.vector(object.position, pos), o.dur, (e)=>{
  23050. object.updateScale()
  23051. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23052. }
  23053. if(qua && !same(object.quaternion, qua, 1e-6)){
  23054. y.start(v.quaternion(object.quaternion, qua), o.dur, (e)=>{
  23055. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23056. }
  23057. if(scale && !same(object.scale, scale, 0.001)){
  23058. y.start(v.vector(object.scale, scale), o.dur, (e)=>{
  23059. },0, A[f.transition.movementEasing], "transitionPos", _transitionPosId)
  23060. }
  23061. }
  23062. }
  23063. var same = function(vec1, vec2, diff){
  23064. var s = Math.abs(vec1.x-vec2.x) < diff && Math.abs(vec1.y-vec2.y) < diff && Math.abs(vec1.z-vec2.z) < diff
  23065. if(s && vec1.w) s = Math.abs(vec1.w-vec2.w) < diff
  23066. return s
  23067. }
  23068. var sid = o.pano != void 0 ? o.pano.id : "outside";
  23069. for(let i in this.model.hots){//是否判断visible?
  23070. var hot = this.model.hots[i];
  23071. var panoData = hot.info.transformAtPanos[sid];
  23072. var useCustom = !panoData
  23073. //if(hot.usingTransformData || !useCustom){
  23074. var pos = useCustom ? hot.info.position : panoData.pos;
  23075. var qua = hot.isSprite ? null : (useCustom ? hot.info.quaternion : panoData.qua);
  23076. var scale = useCustom ? hot.info.scale : panoData.scale;
  23077. begin(hot, pos , qua, scale )
  23078. //}
  23079. //hot.usingTransformData = !useCustom;
  23080. }
  23081. if(o.callback){
  23082. setTimeout(()=>{
  23083. o.callback()
  23084. },o.dur + 16) ;//姑且这么写
  23085. }
  23086. }
  23087. window._tranOutsideFocus = 4399
  23088. n.prototype.focusPoint = function(o={}){//当在外时,聚焦相机到这一点
  23089. console.log("focusPoint")
  23090. if(this.mode == "floorplan"){
  23091. var modelSize = o.modelSize || new THREE.Vector3(8,8,8);//可视范围
  23092. var control = this.cameraControls.controls.floorplan;
  23093. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  23094. var currentScale = control.absoluteScale;
  23095. var currentTarget = control.target.clone()
  23096. y.cancelById(window._tranOutsideFocus, true);
  23097. y.start(function(progress){
  23098. control.absoluteScale = absoluteScale*progress + currentScale*(1-progress);
  23099. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23100. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  23101. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23102. }else if(player.mode == "dollhouse"){
  23103. var control = player.cameraControls.controls.dollhouse;
  23104. var radius = o.radius || 8;
  23105. var currentTarget = control.target.clone()
  23106. var dir = control.offset.clone().normalize()
  23107. var currentRadius = control.offset.length();
  23108. y.cancelById(window._tranOutsideFocus, true);
  23109. y.start(function(progress){
  23110. control.target = o.aim.clone().multiplyScalar(progress).add(currentTarget.clone().multiplyScalar(1-progress))
  23111. let radius_ = radius*progress+currentRadius*(1-progress)
  23112. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  23113. }.bind(this) , o.dur || 600, null/* cancelFuc */, 0, A[f.transition.movementEasing], "outsideFocus", window._tranOutsideFocus, null/* cancelFuc */);
  23114. }else if(this.mode == 'panorama'){
  23115. this.flyToPano({
  23116. lookAtPoint: o.aim.clone() ,
  23117. pano: this.currentPano,
  23118. aimDuration: o.dur || 600
  23119. })
  23120. }
  23121. }
  23122. /*
  23123. 切换到某个模式后再执行函数
  23124. */
  23125. n.prototype.FlyToMode = function(mode, f1, duration){
  23126. var f2;
  23127. if (this.mode == mode) {
  23128. f1 && f1()
  23129. } else {
  23130. f2 = f1;
  23131. if (this.mode == "transitioning" && this.modeTran.split('-')[1] != mode) {//正飞向其他模式,就要先飞完再飞进来然后执行
  23132. this.afterCModeFuc = function() {
  23133. /* objects.gui.modeChange[mode](null, {
  23134. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  23135. }); */
  23136. this.afterCModeFuc = f2
  23137. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano,
  23138. //callback : f2
  23139. });
  23140. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  23141. }.bind(this)
  23142. } else {
  23143. if(this.afterCModeFuc)console.log("已经有afterCModeFuc了!!!!!!!!!!!!!!!")
  23144. this.afterCModeFuc = f2;//飞入后执行
  23145. try{ //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  23146. this.flyToNewMode({mode:mode, pano: mode == "panorama" && this.currentPano, duration:duration});
  23147. }catch(e){
  23148. console.log('FlyToMode遇到问题?')
  23149. }
  23150. }
  23151. }
  23152. }
  23153. n.prototype.fastForwardActivePanoFlight = function(e) {
  23154. e = e || f.transition.fastForwardFactor / 10 * 4 + 1
  23155. y.adjustSpeed(V.FlyToPano, e)
  23156. y.adjustSpeed(V.LookTransition, e)
  23157. }
  23158. ,
  23159. n.prototype.flyToPanoClosestToMouse = function() {
  23160. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  23161. this.intersect && this.updateClosestPano(this.intersect)),
  23162. this.closestPano)
  23163. return this.flyToPano({
  23164. pano: this.closestPano
  23165. });
  23166. var e = this.getMouseDirection();
  23167. this.flyDirection(e) || this.flyToPano({
  23168. pano: this.currentPano
  23169. })
  23170. }
  23171. ,
  23172. n.prototype.flyLocalDirection = function(e) {
  23173. var t = this.getDirection(e)
  23174. , i = 1 === e.z ? .4 : .75
  23175. , n = 1 === Math.abs(e.x);
  23176. return this.flyDirection(t, i, n)
  23177. }
  23178. ,
  23179. n.prototype.flyDirection = function(e, t, i) {
  23180. Hot.closePopup();//xzw add
  23181. var n = $.Deferred();
  23182. this.history.invalidate();
  23183. var r = this.closestPanoInDirection(e, t, i);
  23184. return r ? this.flyToPano({
  23185. pano: r
  23186. }, n.resolve.bind(n, !0)) : (this.bump(e),
  23187. n.resolve(!1)),
  23188. n.promise()
  23189. }
  23190. ,
  23191. n.prototype.closestPanoInDirection = function(e, t, i) {
  23192. return this.rankedPanoInDirection(0, e, t, i)
  23193. }
  23194. ,
  23195. n.prototype.rankedPanoInDirection = function() {
  23196. var e = {
  23197. pano: null,
  23198. candidates: []
  23199. };
  23200. return function(t, i, n, r) {
  23201. t || (t = 0),
  23202. n = void 0 !== n ? n : .75;
  23203. var o = r ? "angle" : "direction";
  23204. return this.model.panos.findRankedByScore(t,
  23205. [s.filters.isPanoAligned(),
  23206. s.filters.not(this.currentPano),
  23207. s.filters.isNeighbourPanoTo(this.currentPano),
  23208. s.filters.inPanoDirection(this.position, i, n)],
  23209. [s.scoreFunctions.distanceSquared(this.currentPano),
  23210. s.scoreFunctions[o](this.position, i)], e),
  23211. this.cachedPanoCandidates = e.candidates,
  23212. e.pano
  23213. }
  23214. }(),
  23215. n.prototype.bump = function(e) {
  23216. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  23217. 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;
  23218. if (s)
  23219. t = function() {
  23220. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  23221. }
  23222. .bind(this),
  23223. i = function() {
  23224. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  23225. }
  23226. .bind(this);
  23227. else {
  23228. var l = this.camera.position.clone()
  23229. , c = e.clone();
  23230. this.raycaster.set(l, c);
  23231. var h = this.model.floors.reduce(function(e, t) {
  23232. return e.concat(t.collider.children)
  23233. }, [])
  23234. , d = this.raycaster.intersectObjects(h)
  23235. , p = d.length > 0 ? d[0].distance / 25 : .04
  23236. , g = l.clone().add(c.multiplyScalar(p));
  23237. t = function() {
  23238. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  23239. }
  23240. .bind(this),
  23241. i = function() {
  23242. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  23243. }
  23244. .bind(this)
  23245. }
  23246. n = function() {
  23247. this.flying = !1
  23248. }
  23249. .bind(this),
  23250. this.flying = !0,
  23251. t()
  23252. }
  23253. }
  23254. ,
  23255. n.prototype.changeFloor = function(e) {
  23256. if (!this.is360View(this.mode, this.currentPano))
  23257. if (this.mode === u.PANORAMA) {
  23258. var t = this.history.reversePano(e);
  23259. t && t.isAligned() ? this.flyToPano({
  23260. pano: t
  23261. }) : this.changeFloorByScore(e)
  23262. } else
  23263. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  23264. }
  23265. ,
  23266. n.prototype.changeFloorByScore = function() {
  23267. var e = {
  23268. pano: null,
  23269. candidates: []
  23270. };
  23271. return function(t) {
  23272. var i = this.model.nextFloor(t);
  23273. 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),
  23274. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  23275. this.history.push(t, this.currentPano),
  23276. this.flyToPano({
  23277. pano: e.pano
  23278. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  23279. }
  23280. }(),
  23281. n.prototype.gotoFloor = function(e) {
  23282. var t = e - this.model.currentFloor.floorIndex;
  23283. this.changeFloor(t)
  23284. }
  23285. ,
  23286. n.prototype.getDirection = function(e) {
  23287. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  23288. e.applyQuaternion(this.camera.quaternion)
  23289. }
  23290. ,
  23291. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  23292. if (o = o || $.Deferred(),
  23293. this.mode === u.TRANSITIONING)
  23294. return F.warn("should not be transitioning here"),
  23295. n && n(!1),
  23296. o.reject().promise();
  23297. var a = i || !1
  23298. , s = i ? i.position : this.position
  23299. , l = this.position.clone()
  23300. , c = this.currentPano;
  23301. if (F.debug("New pose in mode " + this.mode),
  23302. !e || (retryCallback = function() {
  23303. N.delayOneFrame(function() {
  23304. this.flyToSameMode(e, t, i, n, o)
  23305. }
  23306. .bind(this))
  23307. }
  23308. .bind(this),
  23309. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  23310. var h = function() {
  23311. this.emit(w.FlyingEnded, s, l, e, c),
  23312. n && n(!0)
  23313. }
  23314. .bind(this)
  23315. , d = f[this.mode]
  23316. , p = void 0 !== t ? t : d.transitionTime
  23317. , g = new r.Vector3
  23318. , C = new r.Vector3;
  23319. if (this.emit(w.FlyingStarted, s, l, e, c),
  23320. this.mode === u.PANORAMA)
  23321. F.warn("we should not be here for panorama views");
  23322. else if (this.mode === u.DOLLHOUSE)
  23323. if (a) {
  23324. var I = new r.Vector3(0,1,0);
  23325. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23326. this.model.warpDestFloors(i.floorVisibility),
  23327. C.copy(i.position);
  23328. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  23329. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  23330. , _ = b.intersectObjects(this.model.colliders)
  23331. , T = 3;
  23332. _.length ? (g.copy(_[0].point),
  23333. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  23334. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  23335. var x = (new r.Matrix4).lookAt(C, g, I)
  23336. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  23337. , M = g.distanceTo(C)
  23338. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  23339. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  23340. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  23341. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  23342. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  23343. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  23344. this.path.burnsDir = Math.sign(L.y);
  23345. var D = new r.Euler(0,0,0,f.warp.eOrder)
  23346. , B = new r.Vector3;
  23347. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23348. y.start(function(e, t) {
  23349. D.x = P.x + e * L.x,
  23350. D.y = P.y + e * L.y,
  23351. D.z = P.z + e * L.z;
  23352. var i = O + e * (M - O);
  23353. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  23354. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  23355. }
  23356. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  23357. y.start(function(e, t) {
  23358. this.cameraControls.controls[u.DOLLHOUSE].update(),
  23359. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  23360. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  23361. }
  23362. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23363. } else
  23364. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  23365. else if (this.path.placeCpm(),
  23366. this.path.fadeInCpm(f.path.fadeInTime),
  23367. i) {
  23368. this.model.warpDestFloors(i.floorVisibility);
  23369. var U = this.cameraControls.cameras[u.FLOORPLAN]
  23370. , k = this.cameraControls.controls[u.FLOORPLAN]
  23371. , H = k.target.clone()
  23372. , G = i.position.clone().sub(H)
  23373. , z = U.position.clone().sub(k.target)
  23374. , W = z.length()
  23375. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  23376. , Y = Math.atan2(k.offset.x, k.offset.z)
  23377. , X = Math.atan2(j.x, j.z)
  23378. , Z = k.absoluteScale
  23379. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  23380. y.start(function(e, t) {
  23381. k.target.copy(G).multiplyScalar(e).add(H);
  23382. var i = Y + (X - Y) * e;
  23383. k.offset.x = W * Math.sin(i),
  23384. k.offset.z = W * Math.cos(i),
  23385. U.position.copy(k.target).add(k.offset),
  23386. k.absoluteScale = Z + e * (q - Z),
  23387. k.update(),
  23388. this.quaternion.copy(U.quaternion),
  23389. this.position.copy(U.position),
  23390. this.target.copy(k.target),
  23391. this.camera.projectionMatrix.copy(U.projectionMatrix)
  23392. }
  23393. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  23394. } else
  23395. F.info("flyToSameMode() funny floorplan view? skipping");
  23396. return y.setTimeout(function(e) {
  23397. this.mode = e,
  23398. h(),
  23399. o.resolve(!0)
  23400. }
  23401. .bind(this, this.mode), p, V.FlyToSameMode),
  23402. this.mode = u.TRANSITIONING,
  23403. o.promise()
  23404. }
  23405. }
  23406. ,
  23407. n.prototype.flyToNewMode = function(e, t) {
  23408. Hot.closePopup();//xzw add
  23409. e = e || {};
  23410. var i = e.mode
  23411. , n = e.pano
  23412. , o = e.duration
  23413. , a = e.warpDest
  23414. , s = e.callback
  23415. , l = e.force
  23416. , c = e.quaternion;
  23417. if (t = t || $.Deferred(),
  23418. this.isWarping())
  23419. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  23420. s && s(!1),
  23421. t.reject("Cannot change mode during tour transition").promise();
  23422. if (this.mode === u.TRANSITIONING)
  23423. return s && s(!1),
  23424. t.reject("Cannot change mode during mode transition").promise();
  23425. if (i === this.mode)
  23426. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  23427. t.promise()) : (s && s(!1),
  23428. t.reject("Already in " + i + " mode").promise());
  23429. var h = a || !1;
  23430. F.debug("Switching mode to " + i);
  23431. if (window.vrEnabled && i != 'panorama'){
  23432. return s && s(!1), t.reject("vr不允许飞出").promise();
  23433. }
  23434. var d = function() {
  23435. N.delayOneFrame(function() {
  23436. this.flyToNewMode(e, t)
  23437. }
  23438. .bind(this))
  23439. }
  23440. .bind(this);
  23441. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  23442. return t.promise();
  23443. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  23444. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  23445. this.model.waitForLoad(this.model, function() {
  23446. return this.model.meshTexturesLoaded;
  23447. }
  23448. .bind(this)),
  23449. this.model.loadMeshTextures().done(d),
  23450. t.promise();
  23451. this.history.invalidate(),
  23452. this.updateLastView();
  23453. var p = this.mode
  23454. , C = this.cameraControls.cameras[i];
  23455. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  23456. var I = void 0 !== o ? o : e.transitionTime;
  23457. this.emit(w.ModeChanging, p, i, n, I),
  23458. n && (this.currentPano = n),
  23459. this.switchCameraMode(i, c),
  23460. y.cancelById(V.LookTransition);
  23461. //before fly---------------------
  23462. this.modeTran = p + "-" + i; //add
  23463. if(this.mode == "panorama"){
  23464. if(this.model.floorLogos){
  23465. this.model.floorLogos[0].visible = false;
  23466. this.model.floorLogos[1].visible = false;
  23467. }
  23468. }
  23469. if(i == "panorama"){
  23470. this.transitionPos({type:"beforeFlyIn", pano:n, dur:I})//add
  23471. }else{
  23472. this.transitionPos({type:"beforeFlyOut", dur:I/2})//add
  23473. }
  23474. window.bus.dispatchEvent({type:'playerAndModelReady'})
  23475. this.ready = true
  23476. //------------------------------------
  23477. var beginTran = ()=>{
  23478. var _ = (new r.Vector3).copy(this.position);
  23479. if (i === u.PANORAMA){
  23480. this.emit(w.PanoChosen, n, n),
  23481. setTimeout(function() {
  23482. n.floor.enter(i)
  23483. }
  23484. .bind(this), I / 2),
  23485. this.path.fadeOutCpm(f.path.fadeOutTime);
  23486. if(this.model.floorLogos){
  23487. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position));//改
  23488. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position);//for floorIcon position
  23489. }
  23490. }else if (i === u.DOLLHOUSE) {
  23491. if (h && (this.model.stayPut = !0),
  23492. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  23493. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23494. this.path.placeCpm(),
  23495. this.path.fadeInCpm(f.path.fadeInTime),
  23496. h) {
  23497. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  23498. _.set(15, 10, 15);
  23499. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  23500. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  23501. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  23502. P.length ? (T.copy(P[0].point),
  23503. _.copy(a.position),
  23504. 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),
  23505. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23506. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23507. _.add(this.model.position),
  23508. C.position.copy(_),
  23509. this.cameraControls.controls[u.DOLLHOUSE].update()
  23510. }
  23511. } else if (this.path.placeCpm(),
  23512. this.path.fadeInCpm(f.path.fadeInTime),
  23513. a) {
  23514. this.model.warpDestFloors(a.floorVisibility);
  23515. var O = this.cameraControls.cameras[u.FLOORPLAN]
  23516. , L = this.cameraControls.controls[u.FLOORPLAN]
  23517. , D = O.position.clone().sub(L.target)
  23518. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  23519. , U = Math.atan2(B.x, B.z);
  23520. L.target.copy(a.position);
  23521. var k = D.length();
  23522. L.offset.x = k * Math.sin(U),
  23523. L.offset.y = 0,
  23524. L.offset.z = k * Math.cos(U),
  23525. O.position.copy(L.target).add(L.offset);
  23526. L.target.clone().sub(C.position);
  23527. C.quaternion.copy(a.quaternion),
  23528. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  23529. L.absoluteScale = L.currentScale,
  23530. L.update()
  23531. } else
  23532. this.model.currentFloor.enter(i);
  23533. var H = this.currentPano
  23534. , G = this.position.clone();
  23535. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23536. this.flying = !0,
  23537. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  23538. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  23539. C.controls.update()),
  23540. e.blackoutStyle = S.FADEIN,
  23541. I = f.show360Views.transitionTime,
  23542. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  23543. this.mode = i,
  23544. this.path && this.path.popOutCpm(),
  23545. e.blackoutStyle = S.END,
  23546. I = f.show360Views.transitionTime,
  23547. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23548. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23549. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23550. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23551. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23552. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  23553. y.setTimeout(function() {
  23554. this.flying = !1,
  23555. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  23556. this.currentPano.enter(),
  23557. this.path.placeCpm(),
  23558. this.path.fadeOutCpm(f.path.fadeOutTime),
  23559. this.spider.draw()),
  23560. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23561. this.mode = i,
  23562. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23563. //add:
  23564. this.updateMarkerVisi() ;
  23565. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  23566. this.mode == u.PANORAMA&&this.model.floorLogos&&(
  23567. this.model.changefloorLogoOpa({index:0, from:0, opa:1, dur: 150 }),//this.model.floorLogoShow(0,150);
  23568. this.model.floorLogos[0].visible = true
  23569. )
  23570. if (this.afterCModeFuc) {
  23571. //手动加的函数
  23572. var cf = this.afterCModeFuc;
  23573. this.afterCModeFuc = null;//因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  23574. cf();
  23575. }
  23576. if(this.mode == u.PANORAMA){
  23577. Hot.updateVisibles([this.currentPano])
  23578. this.model.fadePanoMarkers()
  23579. }else{
  23580. Hot.updateVisibles(true)
  23581. this.model.hotGroup.children.forEach(overlay=>{
  23582. if(overlay.animateInfo){
  23583. GifTexDeal.start(overlay.animation)
  23584. }
  23585. })
  23586. }
  23587. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  23588. t.resolve())
  23589. }
  23590. .bind(this), I, V.FlyToNewMode)
  23591. }
  23592. if( i == "panorama" && !this.model.supportsTiles && n.getSkyboxTexture().image[0].width > 1024){
  23593. setTimeout(()=>{
  23594. beginTran()
  23595. },16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  23596. }else{
  23597. beginTran()
  23598. }
  23599. this.mode = u.TRANSITIONING
  23600. //p == "panorama" && this.updateHotVisible(),
  23601. return t.promise()
  23602. }
  23603. ,
  23604. n.prototype.fade360View = function(e, t, i) {
  23605. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23606. $(this.domElement).fadeOut(.5 * e, function() {
  23607. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  23608. this.model.alpha = i.modelAlpha,
  23609. this.position.copy(t.position),
  23610. this.quaternion.copy(t.quaternion),
  23611. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23612. $(this.domElement).fadeIn(.5 * e)
  23613. }
  23614. .bind(this))
  23615. }
  23616. ,
  23617. n.prototype.findDefaultViews = function() {
  23618. this.findDefaultView(this.lastInsideView, !0),
  23619. this.findDefaultView(this.last360View, !1)
  23620. }
  23621. ,
  23622. n.prototype.findDefaultView = function(e, t) {
  23623. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  23624. if (e.cameraMode !== u.PANORAMA)
  23625. return !1;
  23626. var i = r.get(e.panoId);
  23627. return i && i.isAligned() === t
  23628. });
  23629. o >= 0 ? (i = r.get(n[o].panoId),
  23630. e.update({
  23631. cameraMode: u.PANORAMA,
  23632. pano: i,
  23633. position: n[o].position,
  23634. quaternion: n[o].quaternion
  23635. })) : (o = r.list.findIndex(function(e) {
  23636. return e.isAligned() === t
  23637. }),
  23638. o >= 0 ? (i = r.list[o],
  23639. e.update({
  23640. cameraMode: u.PANORAMA,
  23641. pano: i,
  23642. position: i.position
  23643. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  23644. }
  23645. ,
  23646. n.prototype.updateLastView = function() {
  23647. if (this.mode === u.PANORAMA) {
  23648. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  23649. e.update({
  23650. pano: this.currentPano,
  23651. position: this.position,
  23652. quaternion: this.quaternion
  23653. })
  23654. }
  23655. }
  23656. ,
  23657. n.prototype.goToLastView = function(e, t) {
  23658. var i = $.Deferred()
  23659. , n = i.resolve.bind(i)
  23660. , r = i.reject.bind(i)
  23661. , o = e ? this.lastInsideView : this.last360View;
  23662. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23663. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  23664. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  23665. mode: o.cameraMode,
  23666. pano: o.pano,
  23667. quaternion: o.quaternion,
  23668. callback: t
  23669. }).done(n).fail(r),
  23670. i.promise()
  23671. }
  23672. ,
  23673. n.prototype.fadeToView = function(e, t, i, n) {
  23674. var r = $.Deferred()
  23675. , o = r.resolve.bind(r)
  23676. , a = r.reject.bind(r);
  23677. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  23678. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  23679. a("Cannot go to illegal view"),
  23680. r.promise();
  23681. var s = (f[t.cameraMode],
  23682. function() {
  23683. $(this.domElement).fadeIn(.5 * i),
  23684. n && n(),
  23685. o()
  23686. }
  23687. .bind(this))
  23688. , l = e ? S.FADEIN : S.END;
  23689. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23690. $(this.domElement).fadeOut(.5 * i, function() {
  23691. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23692. t.cameraMode === u.PANORAMA ? this.flyToPano({
  23693. pano: t.pano,
  23694. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23695. duration: 0
  23696. }, s) : this.flyToNewMode({
  23697. mode: t.cameraMode,
  23698. quaternion: t.quaternion,
  23699. duration: 0,
  23700. callback: s
  23701. })
  23702. }
  23703. .bind(this)),
  23704. r.promise()
  23705. }
  23706. ,
  23707. n.prototype.startWarp = function(e, t, i, n, r, o) {
  23708. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  23709. this.flying)
  23710. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  23711. o && o(),
  23712. !1;
  23713. null !== e && void 0 !== e || (e = b.Show),
  23714. this.history.invalidate()
  23715. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  23716. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  23717. return this.emit(w.WarpStarted, a, i, n, r),
  23718. n = n || S.MIDDLE,
  23719. this.path.warpToPano(i, n, r, function() {
  23720. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23721. this.emit(w.WarpEnded, i),
  23722. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23723. o && o()
  23724. }
  23725. .bind(this)),
  23726. e === b.Hide && this.path.discardPathObject(),
  23727. !0
  23728. }
  23729. ,
  23730. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  23731. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  23732. s && s(),
  23733. !1)
  23734. }
  23735. ,
  23736. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  23737. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23738. a && a(),
  23739. !1)
  23740. }
  23741. ,
  23742. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  23743. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23744. }
  23745. ,
  23746. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  23747. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  23748. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  23749. t && t(),
  23750. !1)
  23751. }
  23752. ,
  23753. n.prototype.aimTourCamera = function(e, t, i, n) {
  23754. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  23755. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23756. }
  23757. ,
  23758. n.prototype.showPathToHeroLocation = function(e) {
  23759. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23760. }
  23761. ,
  23762. n.prototype.tourInterlude = function(e, t) {
  23763. this.history.invalidate();
  23764. this.path.discardSlow();
  23765. //xzw:
  23766. var defaultRotTime = DATA.tourRotTime * 1000
  23767. var timeEachItem = 2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23768. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  23769. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  23770. //zeg 标注一下
  23771. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23772. var rotTime
  23773. if(currentLocation.rotTime == void 0 || currentLocation.rotTime == ''){
  23774. var restChildCount = currentLocation0.heroLocations ? (currentLocation0.heroLocations.length-this.director.currentItem[1]-1) : 0
  23775. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  23776. if(hasMusic){
  23777. var audioObj = SoundManager.list.find(e=>e.name == 'tour')
  23778. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23779. rotTime = currentLocation0.musicInfo.time - current
  23780. if(restChildCount){//如果当前folder中还有剩下的item,平分一下时间
  23781. rotTime = (rotTime-timeEachItem*restChildCount) / (restChildCount+1);
  23782. }
  23783. }else{
  23784. rotTime = defaultRotTime
  23785. }
  23786. rotTime = Math.max(0, rotTime)
  23787. Log("rotTime "+rotTime +" at item "+this.director.currentItem + (hasMusic ? (",musicCurrentTime:"+current+'音乐总长:'+currentLocation0.musicInfo.time) : ''),"#E8E")
  23788. }else{
  23789. rotTime = currentLocation.rotTime * 1000
  23790. Log("rotTime "+rotTime +" at item "+this.director.currentItem,"#E8E")
  23791. }
  23792. this.path.waitNextStep(e, function() {
  23793. t && t()
  23794. }.bind(this), rotTime)
  23795. }
  23796. ,
  23797. n.prototype.stopInterlude = function() {
  23798. this.interruptAndFastForward(null, 0)
  23799. }
  23800. ,
  23801. n.prototype.interruptAndFastForward = function(e, t) {
  23802. //Log('interruptAndFastForward' , '#f00')
  23803. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  23804. this.flying && this.emit(w.FlyingInterrupted),
  23805. this.path.interruptAndFastForward(e, t)
  23806. }
  23807. ,
  23808. n.prototype.setSize = function(e, t) {
  23809. var i = e / t;
  23810. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  23811. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  23812. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  23813. for (var r in this.cameraControls.cameras) {
  23814. var o = this.cameraControls.cameras[r];
  23815. o.fov = this.baseFov * (1 / this.zoomLevel),
  23816. o.updateAspect(i)
  23817. }
  23818. }
  23819. ,
  23820. n.prototype.toJSON = function() {
  23821. var e = {};
  23822. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  23823. e.camera_mode = u.toInt(this.mode),
  23824. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  23825. return e.hidden ? 0 : 1
  23826. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23827. e) : e
  23828. }
  23829. ,
  23830. n.prototype.getCurrentNodePanos = function(e) {
  23831. this.model.panos.map;
  23832. if (e.length = 0, this.path.nodes){
  23833. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23834. if(momentTour == 'black'){ //改 upcomingPanos如果是black的只需要起点和终点
  23835. if(this.path.nodes.length){
  23836. e.push(this.model.panos.get(this.path.nodes[0]))
  23837. }
  23838. if(this.path.nodes.length>1){
  23839. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length-1]))
  23840. }
  23841. }else{
  23842. for (var t = 0; t < this.path.nodes.length; t++) {
  23843. var i = this.path.nodes[t];
  23844. e.push(this.model.panos.get(i))
  23845. }
  23846. }
  23847. }
  23848. }
  23849. ,
  23850. n.prototype.zoomIncrementally = function(e) {
  23851. var t = this.zoomLevel;
  23852. this.zoomTo(this.zoomLevel + e),
  23853. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23854. }
  23855. ,
  23856. n.prototype.zoomInIncrementally = function(e) {
  23857. e = e || this.defaultZoomIncrement,
  23858. this.zoomIncrementally(e)
  23859. }
  23860. ,
  23861. n.prototype.zoomOutIncrementally = function(e) {
  23862. e = e || -this.defaultZoomIncrement,
  23863. this.zoomIncrementally(e)
  23864. }
  23865. ,
  23866. n.prototype.zoomBy = function(e) {
  23867. this.zoomTo(this.zoomLevel * e)
  23868. }
  23869. ,
  23870. n.prototype.zoomIn = function() {
  23871. this.zoomBy(1 + this.zoomSpeed)
  23872. }
  23873. ,
  23874. n.prototype.zoomOut = function() {
  23875. this.zoomBy(1 - this.zoomSpeed)
  23876. }
  23877. ,
  23878. n.prototype.zoomTo = function(e, t) {
  23879. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  23880. if (e < f.zoom.min && (e = f.zoom.min),
  23881. e > f.zoom.max && (e = f.zoom.max),
  23882. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  23883. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  23884. e === f.zoom.min && this.emit(O.ZoomMin)),
  23885. this.cameraControls.activeControl) {
  23886. var i = this.cameraControls.activeControl.camera;
  23887. this.zoomLevel = e,
  23888. i.fov = this.baseFov * (1 / this.zoomLevel),
  23889. i.updateProjectionMatrix(),
  23890. this.zoomFov = i.fov
  23891. }
  23892. }
  23893. }
  23894. ,
  23895. n.prototype.increaseZoomSpeed = function() {
  23896. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23897. }
  23898. ,
  23899. n.prototype.decreaseZoomSpeed = function() {
  23900. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23901. }
  23902. ,
  23903. n.prototype.clampZoomSpeed = function(e) {
  23904. return e < 0 ? 0 : e
  23905. }
  23906. ,
  23907. n.prototype.activatePersistentZooming = function(e) {
  23908. this.zooming = e ? 1 : -1
  23909. }
  23910. ,
  23911. n.prototype.deactivatePersistentZooming = function() {
  23912. this.zooming = 0
  23913. }
  23914. ,
  23915. n.prototype.zoomDefault = function() {
  23916. this.zoomTo(1, !0)
  23917. }
  23918. ,
  23919. window.fovTranId = 333;//add
  23920. n.prototype.smoothZoomToDefault = function(e, t) {
  23921. y.cancelById(window.fovTranId)
  23922. var i, n = this.zoomLevel,
  23923. r = function(e) {
  23924. e > 1 && (e = 1),
  23925. i = n * (1 - e) + e,
  23926. this.zoomTo(i, !0)
  23927. }.bind(this),
  23928. o = function() {
  23929. this.zoomDefault(),
  23930. t && window.setTimeout(t, 50)
  23931. }.bind(this);
  23932. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23933. }
  23934. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {//add
  23935. y.cancelById(window.fovTranId)
  23936. console.log("smoothZoomFovTo "+zoomLevel)
  23937. var i,
  23938. n = this.zoomLevel,
  23939. aimLevel = zoomLevel || this.baseFov / fov
  23940. if (n == aimLevel) return
  23941. var fun = function (e) {
  23942. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel),
  23943. this.zoomTo(i, !0)
  23944. }.bind(this)
  23945. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23946. }
  23947. n.prototype.updateZoomPano = function() {
  23948. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA && this.currentPano) {
  23949. let navTileClass = this.qualityManager.getNavZoomClass()
  23950. let tileClass = this.qualityManager.getMaxZoomClass()
  23951. if(navTileClass == '4k'){
  23952. var r = true
  23953. }else{
  23954. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5 , levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  23955. var t = this.zoomLevel > levelThreshold1
  23956. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  23957. , n = !i && !this.isWarping()
  23958. , r = t //&& n ; // 允许flying状态下加载4K图
  23959. }
  23960. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  23961. this.panoRenderer.setZoomingActive(r, this.currentPano, !0);
  23962. var o = function(pano, ifZoom) {
  23963. this.panoRenderer.resetRenderStatus(pano.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23964. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  23965. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  23966. pano.setZoomed(ifZoom)
  23967. }.bind(this);
  23968. if(navTileClass == '4k'){
  23969. if (!this.currentPano.zoomed) {
  23970. o(this.currentPano, !0);
  23971. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  23972. this.qualityManager.useUltraHighResolutionPanos && (f.zoom.max = D.ultraHighQualityMaxZoom);
  23973. o(this.currentPano, !0)
  23974. }
  23975. .bind(this));
  23976. }
  23977. }else{
  23978. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  23979. if (r && (!this.currentPano.zoomed || zoomLevelRes && zoomLevelRes != '4k')) {//needZoom
  23980. this.currentPano.zoomed || o(this.currentPano, !0);
  23981. if(navTileClass == '1k' && tileClass != '1k' && this.zoomLevel < levelThreshold2){
  23982. this.panoRenderer.enableHighQuality( function() {//开启2k
  23983. if(tileClass != '4k'){
  23984. o(this.currentPano, !0);
  23985. }
  23986. }.bind(this));
  23987. }else{
  23988. this.panoRenderer.enableUltraHighQualityMode(function() {//开启4k getMaxZoomPanoSize
  23989. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom)
  23990. o(this.currentPano, !0)
  23991. }.bind(this));
  23992. }
  23993. } else {
  23994. !t && this.currentPano.zoomed && o(this.currentPano, !1);
  23995. }
  23996. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  23997. if(r && navTileClass == '1k' && tileClass == '4k' ){ //目前只有手机端navTileClass == '1k'
  23998. var change = (zoomedFlag)=>{
  23999. this.qualityManager.updateMaximums()//更新maxZoomPanoSize
  24000. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  24001. //this.currentPano.setZoomed(t);//更新uniforms贴图
  24002. if(this.qualityManager.zoomLevelResolution == '4k'){
  24003. this.model.showHighMap()
  24004. }else{
  24005. this.model.hideHighMap()
  24006. }
  24007. }
  24008. this.qualityManager.zoomLevelResolution = this.zoomLevel >= levelThreshold2 ? '4k' : this.zoomLevel > levelThreshold1? '2k' : '1k'
  24009. if(this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2){//1k/2k-4k
  24010. change()
  24011. o(this.currentPano, t)
  24012. }else if(this.oldZoomLevel <= levelThreshold1 && this.zoomLevel > levelThreshold1){//1k-2k
  24013. change()
  24014. }else if(this.oldZoomLevel > levelThreshold2 && this.zoomLevel <= levelThreshold2){//4k-2k/1k
  24015. change()
  24016. o(this.currentPano, t)
  24017. }else if(this.oldZoomLevel > levelThreshold1 && this.zoomLevel <= levelThreshold1){//2k-1k
  24018. change()
  24019. }
  24020. this.oldZoomLevel = this.zoomLevel
  24021. }
  24022. }
  24023. }
  24024. }
  24025. n.prototype.checkHasNeighbor = function(pano){//add
  24026. for(var i in pano.neighbourPanos ){
  24027. if(i == pano.id)continue;
  24028. if(pano.neighbourPanos[i]){
  24029. return true;
  24030. }
  24031. }
  24032. }
  24033. ,
  24034. t.exports = n
  24035. }
  24036. ).call(this, "/js/player.js")
  24037. }
  24038. , {
  24039. "./constants": 8,
  24040. "./enum/AlignmentType": 17,
  24041. "./enum/BlackoutStyle": 18,
  24042. "./enum/ControlEvents": 21,
  24043. "./enum/Keys": 30,
  24044. "./enum/ModelManagerEvents": 33,
  24045. "./enum/PanoSizeClass": 36,
  24046. "./enum/PanoramaEvents": 37,
  24047. "./enum/PathDiscardMode": 38,
  24048. "./enum/PathDisplayMode": 39,
  24049. "./enum/PlayerEvents": 40,
  24050. "./enum/TagStates": 44,
  24051. "./enum/Vectors": 50,
  24052. "./enum/Viewmode": 51,
  24053. "./enum/WarpStyle": 52,
  24054. "./enum/ZoomEvents": 53,
  24055. "./exception/BasicException": 55,
  24056. "./model/ModelManager": 140,
  24057. "./objects/NSpider": 147,
  24058. "./objects/Panorama": 148,
  24059. "./objects/Reticule": 149,
  24060. "./objects/ShowPath": 151,
  24061. "./objects/Snapshot": 153,
  24062. "./objects/View": 154,
  24063. "./settings": 166,
  24064. "./shaders": 167,
  24065. "./tile/TileDownloader": 171,
  24066. "./tile/TilePrioritizer": 172,
  24067. "./util/ZoomStats": 179,
  24068. "./util/browser": 182,
  24069. "./util/camera": 183,
  24070. "./util/cameraLight": 184,
  24071. "./util/common": 185,
  24072. "./util/easing": 186,
  24073. "./util/history": 187,
  24074. "./util/lerp": 188,
  24075. "./util/logger": 189,
  24076. "./util/math": 190,
  24077. "./util/transitions": 195,
  24078. "hot":"hot",
  24079. "scaleImg":"scaleImg",
  24080. events: 202,
  24081. three: 217
  24082. }],
  24083. "scaleImg":[function(t, e){// xzw
  24084. var OUTPUT = e;
  24085. (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")}
  24086. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  24087. 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}
  24088. return G.getImageData(0,0,s,f)}
  24089. 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}
  24090. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  24091. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  24092. 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}
  24093. else
  24094. 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)
  24095. 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)
  24096. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  24097. 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)
  24098. 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)
  24099. W=new Float32Array(at);else
  24100. for(W=[],et=0;at>et;++et)
  24101. W[et]=0;for(b=0;w>b;b++)
  24102. 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)
  24103. 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;}
  24104. delete p,h(),J=n(W)}
  24105. 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}
  24106. if("png-src"===i||"jpeg-src"===i)
  24107. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  24108. return B}
  24109. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  24110. OUTPUT.exports = c;
  24111. }, {}
  24112. ],
  24113. 156: [function(e, t, i) {
  24114. (function(i) {
  24115. "use strict";
  24116. function n(e, t) {
  24117. this.model = e,
  24118. this.panos = e.panos,
  24119. this.player = t,
  24120. this.imagePanos = this.listImagePanos(),
  24121. this.retryMinimumTime = 1e4
  24122. }
  24123. var r = (e("three"),
  24124. e("./enum/Viewmode"))
  24125. , o = (e("./settings"),
  24126. e("./objects/Panorama"))
  24127. , a = e("./util/logger")
  24128. , s = new a(i);
  24129. n.prototype.start = function() {
  24130. this.loadNextPano(function(e) {
  24131. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  24132. setTimeout(function() {
  24133. this.start()
  24134. }
  24135. .bind(this), 1e3))
  24136. }
  24137. .bind(this))
  24138. }
  24139. ,
  24140. n.prototype.validLoadTarget = function(e) {
  24141. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  24142. }
  24143. ,
  24144. n.prototype.listImagePanos = function() {
  24145. var e = []
  24146. , t = this;
  24147. return this.model.images.forEach(function(i) {
  24148. if (i.metadata && i.metadata.scan_id) {
  24149. var n = t.model.panos.get(i.metadata.scan_id);
  24150. n && !n.isLoaded("high") && e.push(n)
  24151. }
  24152. }),
  24153. e
  24154. }
  24155. ,
  24156. n.prototype.nextNotLoadedImage = function() {
  24157. for (; this.imagePanos.length > 0; ) {
  24158. var e = this.imagePanos[0];
  24159. if (!e.isLoaded("high"))
  24160. return e;
  24161. this.imagePanos.shift()
  24162. }
  24163. return null
  24164. }
  24165. ,
  24166. n.prototype.loadNextPano = function(e) {
  24167. var t, i, n = this.model.waitQueue.filter(function(e) {
  24168. return e.object instanceof o
  24169. });
  24170. n.length > 0 ? (t = n[0].object,
  24171. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  24172. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  24173. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  24174. t = this.imagePanos[0],
  24175. 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())]),
  24176. t && s.debug("Normal pano selection: neighbor " + t.id)),
  24177. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  24178. s.debug("Preloading " + i + "-res pano " + t.id),
  24179. t.loadCube(i).done(e).fail(function() {
  24180. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  24181. e()
  24182. })) : e && e(null)
  24183. }
  24184. ,
  24185. t.exports = n
  24186. }
  24187. ).call(this, "/js/preloaders.js")
  24188. }
  24189. , {
  24190. "./enum/Viewmode": 51,
  24191. "./objects/Panorama": 148,
  24192. "./settings": 166,
  24193. "./util/logger": 189,
  24194. three: 217
  24195. }],
  24196. 157: [function(e, t, i) {
  24197. (function(i) {
  24198. "use strict";
  24199. function n(e, t, i, n, r) {
  24200. this.qualityManager = e,
  24201. this.scene = t,
  24202. this.camera = i,
  24203. this.container = r,
  24204. this.controls = n,
  24205. this.controls.enabled = !0,
  24206. this.controls.locked = !0,
  24207. this.quickstartCamera = n.camera,
  24208. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  24209. this.skybox = null
  24210. }
  24211. var r = e("three")
  24212. , o = e("../util/logger")
  24213. , a = e("../constants")
  24214. , s = (e("../util/transitions"),
  24215. e("../util/lerp"),
  24216. e("../util/easing"),
  24217. e("../enum/Vectors"))
  24218. , l = e("../enum/PanoSizeClass")
  24219. , c = (e("../materials/ModelTextureMaterial"),
  24220. e("../materials/CubemapMaterial"))
  24221. , h = (e("../cameras/PanoramaCamera"),
  24222. e("../controls/PanoramaControls"),
  24223. e("../tile/TileUtils"),
  24224. e("../util/camera"),
  24225. e("../util/cameraLight"))
  24226. , u = (e("../util/browser"),
  24227. e("../settings"),
  24228. e("../gui/helpManager"),
  24229. new o(i));
  24230. n.prototype.load = function(e) {
  24231. e.pano.shouldRedrawOnBaseLoaded = !0;
  24232. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  24233. this.controls.lookAt(r.add(this.quickstartCamera.position));
  24234. var a = this.qualityManager.getPanoSize(l.BASE)
  24235. , c = this.qualityManager.getPanoSize(l.STANDARD);
  24236. if (e.pano.tiled) {
  24237. u.warn("Loading startPano, TILED", e.pano.id);
  24238. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  24239. , p = this.quickstartCamera.fov;
  24240. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  24241. t = e.pano.loadTiledPano(c, r, {
  24242. hFov: d,
  24243. vFov: p
  24244. }, !1, !1, !0),
  24245. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  24246. } else
  24247. u.warn("Loading startPano", e.pano.id),
  24248. t = e.pano.loadCube("high");
  24249. return $.when(t).then(function() {
  24250. n.init(e.pano, e.quaternion),
  24251. e.pano.tiled ? i.done(function() {
  24252. e.pano.lockUntilRenderingComplete = !1,
  24253. this.controls.locked = !1
  24254. }
  24255. .bind(this)) : this.controls.locked = !1
  24256. }
  24257. .bind(this))
  24258. }
  24259. ,
  24260. n.prototype.init = function(e, t) {
  24261. u.info("Quickstart done loading, adding scene objects"),
  24262. e.lockUntilRenderingComplete = !0,
  24263. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  24264. side: r.BackSide
  24265. })),
  24266. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  24267. this.skybox.quaternion.copy(e.quaternion),
  24268. this.scene.add(this.skybox),
  24269. $(this.container).show()
  24270. }
  24271. ,
  24272. n.prototype.update = function(e) {
  24273. this.controls.update(e),
  24274. this.camera.copy(this.quickstartCamera)
  24275. }
  24276. ,
  24277. n.prototype.setSize = function(e, t) {
  24278. this.quickstartCamera.updateAspect(e / t)
  24279. }
  24280. ,
  24281. n.prototype.destroy = function() {
  24282. this.scene.remove(this.skybox)
  24283. }
  24284. ,
  24285. t.exports = n
  24286. }
  24287. ).call(this, "/js/scene/QuickstartManager.js")
  24288. }
  24289. , {
  24290. "../cameras/PanoramaCamera": 7,
  24291. "../constants": 8,
  24292. "../controls/PanoramaControls": 13,
  24293. "../enum/PanoSizeClass": 36,
  24294. "../enum/Vectors": 50,
  24295. "../gui/helpManager": 68,
  24296. "../materials/CubemapMaterial": 117,
  24297. "../materials/ModelTextureMaterial": 118,
  24298. "../settings": 166,
  24299. "../tile/TileUtils": 174,
  24300. "../util/browser": 182,
  24301. "../util/camera": 183,
  24302. "../util/cameraLight": 184,
  24303. "../util/easing": 186,
  24304. "../util/lerp": 188,
  24305. "../util/logger": 189,
  24306. "../util/transitions": 195,
  24307. three: 217
  24308. }],
  24309. 158: [function(e, t, i) {
  24310. "use strict";
  24311. function n(e, t, i) {
  24312. this.scene = e,
  24313. this.camera = t,
  24314. this.renderer = null,
  24315. this.effects = i,
  24316. this.animateCallback = null,
  24317. this.composer = null,
  24318. this.qualityManager = null,
  24319. e.renderWidth = 0,
  24320. e.renderHeight = 0,
  24321. this.updateClock = new r.Clock,
  24322. this.components = [],
  24323. this.updateListeners = [],
  24324. this.resizeListeners = [],
  24325. this.forceUpdateSize = !1,
  24326. this.started = !1,
  24327. this.textures = {},
  24328. this.suspendedObjects = []
  24329. }
  24330. var r = e("three")
  24331. , o = e("../shaders")
  24332. , a = e("../enum/SceneRendererEvents")
  24333. , s = e("../enum/GLTextureType")
  24334. , l = e("../enum/GLCubeFaces")
  24335. , c = e("../exception/BasicException")
  24336. , h = e("../exception/RendererCreationException")
  24337. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24338. , m = e("../util/browser")
  24339. /**************************************************************************************************************************************************/
  24340. , u = e("../settings")
  24341. , d = e("events").EventEmitter;
  24342. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  24343. n.prototype = Object.create(d.prototype),
  24344. n.prototype.addComponent = function(e) {
  24345. this.components.push(e),
  24346. e.update && this.updateListeners.push(e),
  24347. e.setSize && (this.resizeListeners.push(e),
  24348. this.forceUpdateSize = !0)
  24349. }
  24350. ,
  24351. n.prototype.removeComponent = function(e) {
  24352. var t = function(t) {
  24353. return t !== e
  24354. };
  24355. this.components = this.components.filter(t),
  24356. this.updateListeners = this.updateListeners.filter(t),
  24357. this.resizeListeners = this.resizeListeners.filter(t)
  24358. }
  24359. ,
  24360. n.prototype.start = function(e) {
  24361. if (this.started)
  24362. throw new c("Can't start SceneRenderer, already started");
  24363. this.createContext(e),
  24364. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24365. /* m.isMobile() && */this.boluoVrInit(),
  24366. /*******************************************************************************************************************************/
  24367. this.initComposer(),
  24368. this.started = !0,
  24369. (p = p.bind(this))()
  24370. }
  24371. ,
  24372. n.prototype.createContext = function(e) {
  24373. var transparent = !!(settings.transparentBg || settings.bgImg)
  24374. try {
  24375. this.renderer = new r.WebGLRenderer({antialias: !m.isMobile(), alpha:transparent}),
  24376. this.renderer.autoClear = !0,
  24377. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24378. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  24379. transparent && this.renderer.setClearColor( 0x000000, 0 ); //透明
  24380. this.emit(a.ContextCreated)
  24381. } catch (e) {
  24382. throw new h("Unable to create a WebGL rendering context")
  24383. }
  24384. u.profiling.enabled && this.overrideTextures(),
  24385. e.appendChild(this.renderer.domElement)
  24386. /* window.stats = new Stats();
  24387. e.appendChild( stats.dom ); */
  24388. }
  24389. ,
  24390. n.prototype.overrideTextures = function() {
  24391. var e = this.renderer.context
  24392. , t = 0
  24393. , i = e.createTexture;
  24394. e.createTexture = function() {
  24395. var n = i.call(e);
  24396. return n.id = t++,
  24397. this.textures[n.id] = n,
  24398. n
  24399. }
  24400. .bind(this);
  24401. var n = e.texImage2D;
  24402. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  24403. var d, p = this.getTextureTypeFromTarget(e, t);
  24404. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  24405. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  24406. h = a,
  24407. u = l,
  24408. o = u.naturalWidth,
  24409. a = u.naturalHeight,
  24410. n.call(e, t, i, r, c, h, u));
  24411. var f = this.textures[d.id];
  24412. f.width = p === s.TextureCube ? 6 * o : o,
  24413. f.height = a
  24414. }
  24415. .bind(this);
  24416. var r = e.deleteTexture;
  24417. e.deleteTexture = function(t) {
  24418. delete this.textures[t.id],
  24419. r.call(e, t)
  24420. }
  24421. .bind(this)
  24422. }
  24423. ,
  24424. n.prototype.updateTextureMemory = function() {
  24425. var e = null;
  24426. return function() {
  24427. var t = 0;
  24428. for (var i in this.textures) {
  24429. var n = this.textures[i];
  24430. n.width && n.height && (t += n.width * n.height * 4)
  24431. }
  24432. t !== e && this.emit(a.MemoryUsageUpdated, t),
  24433. e = t
  24434. }
  24435. }(),
  24436. n.prototype.getTextureTypeFromTarget = function(e, t) {
  24437. switch (t) {
  24438. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24439. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24440. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24441. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24442. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24443. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24444. return s.TextureCube;
  24445. case e.TEXTURE_2D:
  24446. return s.Texture2D;
  24447. default:
  24448. return null
  24449. }
  24450. }
  24451. ,
  24452. n.prototype.initComposer = function() {
  24453. this.composer = new r.EffectComposer(this.renderer),
  24454. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  24455. //this.composer.addPass(this.effects.hblurPass),
  24456. //this.composer.addPass(this.effects.vblurPass)
  24457. this.composer.addPass(this.effects.fastTranMaskPass)//add
  24458. }
  24459. ,
  24460. n.prototype.setSize = function(e, t, devicePixelRatio) {
  24461. this.renderWidth = e,
  24462. this.renderHeight = t,
  24463. this.effects.aspect = e / t,
  24464. /* this.renderer.setSize(e, t), -----MP */
  24465. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24466. this.composer.setSize(e, t);
  24467. for (var i = 0; i < this.resizeListeners.length; i++)
  24468. this.resizeListeners[i].setSize(e, t)
  24469. }
  24470. ,
  24471. n.prototype.render = function() {
  24472. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24473. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24474. }
  24475. /******************************************************************************************************徐世廷**********************************************************************/
  24476. var vrPermission = {};
  24477. var vrPermissionCallBack = function(info1,info2){
  24478. if(info1 == "reset"){
  24479. vrPermission = {};
  24480. }else{
  24481. vrPermission[info1] = info2
  24482. if(Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != "granted" || vrPermission.deviceOrientation != "granted")){
  24483. alert("运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。" )
  24484. }
  24485. }
  24486. }
  24487. n.prototype.boluoVrInit = function() {
  24488. console.log("boluoVrInit")
  24489. //webxr.init(this.renderer)
  24490. this.isHuawei5X = m.detectHUAWEI5X(),
  24491. this.oldRenderer = this.renderer,
  24492. this.newRenderer = new this.vrRenderer(this.renderer,this,this.camera);
  24493. window.panoCamera = this.camera;
  24494. var a = this;
  24495. window._vrEnabled = !1,
  24496. Object.defineProperty(window, "vrEnabled", {
  24497. get: function() {
  24498. return window._vrEnabled
  24499. },
  24500. set: function(b) {
  24501. //if(webxr.xrType)return webxr.enterVR()
  24502. b = !!b
  24503. b ? (a.renderer = a.newRenderer,
  24504. window.vrMarkers.forEach(function(a) {
  24505. a.visible = !0
  24506. })) : (a.renderer = a.oldRenderer,
  24507. window.vrMarkers.forEach(function(a) {
  24508. a.visible = !1
  24509. })),
  24510. a.cursor.visible = b,
  24511. a.setSize(window.innerWidth, window.innerHeight)
  24512. window._vrEnabled = b
  24513. $('.cad').css('visibility',b?'hidden':'')
  24514. b ? browser.requestFullscreen(document.body) : browser.exitFullscreen()
  24515. a.setSizeFitGlass()
  24516. setTimeout(()=>{
  24517. console.log('ch',document.body.clientWidth, document.body.clientHeight, window.innerWidth, window.innerHeight )//全屏后得到的才准确
  24518. a.setSizeFitGlass()
  24519. },600)
  24520. if(b){
  24521. setTimeout(function(){
  24522. console.log("orientEnable"+window.orientEnable)
  24523. if(window.vrEnabled && !window.orientEnable){//很可能没能触发陀螺仪事件
  24524. if(m.detectIOS()/* && m.detectSafari() */){
  24525. var b = m.iosVersion();//{major: 10, minor: 3, patch: 1}
  24526. console.log("开始获取权限 major"+b.major)
  24527. if(b.major == 12 && b.minor>=2){
  24528. if(browser.detectSafari()) alert("浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。")
  24529. else{//app??
  24530. alert("浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24531. }
  24532. }else if(b.major >= 13){
  24533. if(!window.location.href.includes("https://")){
  24534. console.log("需要https");
  24535. alert("当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。")
  24536. return;
  24537. }
  24538. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != "granted" || window.vrPermission.deviceOrientation != "granted")
  24539. setTimeout(()=>{//如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24540. if(!window.vrEnabled || window.orientEnable)return;
  24541. vrPermissionCallBack("reset")
  24542. console.log(window.DeviceMotionEvent)
  24543. if ( window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24544. console.log("开始获取权限1")
  24545. ///注意:需要https 本地服务器permissionState会得到denied
  24546. window.DeviceMotionEvent.requestPermission().then(permissionState => {
  24547. console.log("permissionState1: "+permissionState)
  24548. vrPermissionCallBack("deviceMotion", permissionState)
  24549. }).catch(function(e){
  24550. vrPermissionCallBack("deviceMotion", false)
  24551. console.log(e)
  24552. })
  24553. }else{
  24554. console.log("window.DeviceMotionEvent undefined")
  24555. vrPermissionCallBack("deviceMotion", false)
  24556. }
  24557. if ( window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24558. console.log("开始获取权限2")
  24559. window.DeviceOrientationEvent.requestPermission().then(permissionState => {
  24560. console.log("permissionState2: "+permissionState)
  24561. vrPermissionCallBack("deviceOrientation", permissionState)
  24562. }).catch(function(e){
  24563. vrPermissionCallBack("deviceOrientation", false)
  24564. console.log(e)
  24565. })
  24566. }else{
  24567. console.log("window.DeviceOrientationEvent undefined")
  24568. vrPermissionCallBack("deviceOrientation", false)
  24569. }
  24570. },hasFailed ? 0 : 150)
  24571. /* /* setTimeout(function(){
  24572. if(settings.vrEnabled && !window.orientEnable){
  24573. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24574. }
  24575. },4000) */
  24576. }else console.log("陀螺仪未能启用 ios "+b.major+"."+b.minor)
  24577. }else{
  24578. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24579. }
  24580. }else{
  24581. //已经触发了
  24582. }
  24583. },200);
  24584. }else {
  24585. if(player.mode == 'panorama'){ //xzw add
  24586. player.cameraControls.controls.panorama.endRotation()
  24587. }
  24588. }
  24589. }
  24590. }),
  24591. this.createCursor(.5, !1, 1, 16777215, 0);
  24592. var b = {
  24593. setSize: function(b, c) {
  24594. a.camera.aspect = b / c
  24595. }
  24596. };
  24597. this.resizeListeners.push(b),
  24598. this.vrLoadingInit()
  24599. document.addEventListener('fullscreenchange', (e)=>{
  24600. this.setSizeFitGlass()
  24601. })
  24602. }
  24603. ,
  24604. n.prototype.vrLoadingInit = function() {
  24605. var a = function(camera) {
  24606. var a = this
  24607. , b = new r.RingGeometry(1.3,1.5,32,32,0,1.2 * Math.PI)
  24608. , c = new r.MeshBasicMaterial({
  24609. color: 4967932,
  24610. side: r.DoubleSide
  24611. })
  24612. , d = new r.Mesh(b,c);
  24613. this.mesh = d,
  24614. d.position.z = -2,
  24615. d.scale.set(.08, .08, .08),
  24616. d.visible = !1,
  24617. camera.add(d),
  24618. //window.player.camera.add(d),
  24619. a.enabled = !1,
  24620. this.update = function(b) {
  24621. 1 == a.enabled && (d.rotation.z += 15 * b)
  24622. }
  24623. }
  24624. , a = new a(this.camera);
  24625. window.Loading = a,
  24626. this.updateListeners.push(a)
  24627. }
  24628. ,
  24629. n.prototype.createCursor = function(a, b, c, d, e) {
  24630. var g, h = new r.SpriteMaterial({
  24631. opacity: c,
  24632. color: d,
  24633. transparent: b,
  24634. map: this.boluoGetTexture("images/cursor.png"),
  24635. needsUpdate: !0,
  24636. side: r.DoubleSide
  24637. });
  24638. h.map.offset = new r.Vector2(1 / 17 * e,0),
  24639. h.map.repeat = new r.Vector2(1 / 17,1),
  24640. h.depthTest = !1,
  24641. h.blending = r.AdditiveBlending,
  24642. g = new r.Sprite(h),
  24643. // g.scale.set(a, a, a),
  24644. g.scale.set(.3,.3,.3)
  24645. g.position.z = -2,
  24646. g.visible = !1,
  24647. g.name = "cursor",
  24648. this.camera.add(g),
  24649. this.scene.add(this.camera),
  24650. this.cursor = g;
  24651. var i = new this.CursorAnimation(this.scene,g,this.camera);
  24652. this.cursor.triggerTargetEvent = i.triggerTargetEvent,
  24653. this.updateListeners.push(i)
  24654. }
  24655. n.prototype.setSizeFitGlass = function(){//add 现在大多数手机过长,可能超出眼镜范围,导致看不全眩晕。另外注意调节和镜头的距离。
  24656. let verti = window.orientation == 0 || window.orientation == 180//竖屏
  24657. console.log('setSizeFitGlass')
  24658. if( document.fullscreenElement && !verti && window.vrEnabled && !browser.isMobile()){
  24659. let longW = Math.max(document.body.clientWidth, document.body.clientHeight)
  24660. let shortW = Math.min(document.body.clientWidth, document.body.clientHeight)
  24661. const hopeRatio = 1.84 //因为无法知道手机长度,只能估计,若长宽比较大,很可能过长,所以缩短点。
  24662. let r = longW / shortW
  24663. if(r > hopeRatio){
  24664. let w = shortW*hopeRatio
  24665. window.player.domElement.style.width = w + 'px' //缩短
  24666. window.player.domElement.style.transform = `translate(${(longW-w)*0.5}px,0)` //居中。但我手机荣耀自带浏览器会向右多偏移一些不知为何
  24667. }
  24668. }else{
  24669. window.player.domElement.style.width = ''
  24670. window.player.domElement.style.transform = ''
  24671. }
  24672. }
  24673. ,
  24674. window.orientEnable = 0; //是否能触发deviceorientation
  24675. n.prototype.CursorAnimation = function(a, b, c) {
  24676. function d() {
  24677. g.orient = r.Math.degToRad(window.orientation || 0)
  24678. player.sceneRenderer.setSizeFitGlass()
  24679. }
  24680. function e(a) {
  24681. if(!window.vrEnabled && window.orientEnable) return;
  24682. window.orientEnable || (window.orientEnable = 1);
  24683. var b = r.Math.degToRad(a.alpha)
  24684. , c = r.Math.degToRad(a.beta)
  24685. , d = r.Math.degToRad(a.gamma);
  24686. if (this.isHuawei5X ? (-1e3 === g.alpha && (g.alpha = b),
  24687. -1e3 === g.beta && (g.beta = c),
  24688. -1e3 === g.gamma && (g.gamma = d),
  24689. Math.abs(b - g.alpha) > .06 && (g.alpha = b),
  24690. Math.abs(c - g.beta) > .006 && (g.beta = c),
  24691. Math.abs(d - g.gamma) > .006 && (g.gamma = d)) : (g.alpha = b,
  24692. g.beta = c,
  24693. g.gamma = d),
  24694. n.vrDebug) {
  24695. $("#info-device-orientation").css("display", "block");
  24696. var e = "";
  24697. e += "alpha=(" + g.alpha + ")<BR/>",
  24698. e += "beta=(" + g.beta + ")<BR/>",
  24699. e += "gamma=" + g.gamma + "<BR/>",
  24700. document.getElementById("info-device-orientation").innerHTML = e
  24701. }
  24702. }
  24703. this.cursor = b,
  24704. this.raycaster = new r.Raycaster,
  24705. this.targetEventObj = {},
  24706. this.type = 1,
  24707. this.tweenFlag = !0;
  24708. var g = this;
  24709. this.target = c,
  24710. console.log(c.uuid),
  24711. this.euler = new r.Euler,
  24712. this.q0 = new r.Quaternion,
  24713. this.q1 = new r.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),
  24714. this.zee = new r.Vector3(0,0,1),
  24715. this.alpha = -1e3,
  24716. this.beta = -1e3,
  24717. this.gamma = -1e3,
  24718. this.orient = r.Math.degToRad(window.orientation || 0),
  24719. window.addEventListener("orientationchange", d),
  24720. window.addEventListener("deviceorientation", e),
  24721. this.setObjectQuaternion = function(a, b, d, e, f) {
  24722. if (b == -1000) return //防止打开就歪着
  24723. g.euler.set(d, b, -e, "YXZ"),
  24724. a.setFromEuler(g.euler),
  24725. a.multiply(g.q1),
  24726. a.multiply(g.q0.setFromAxisAngle(g.zee, -f)),
  24727. c.updateMatrixWorld()
  24728. }
  24729. ,
  24730. parent !== window && window.addEventListener("message", function(a) {
  24731. var b = JSON.parse(a.data)
  24732. , c = -1 !== window.navigator.userAgent.indexOf("KIW-TL00H");
  24733. b && b.alpha && b.beta && b.gamma && function(a) {
  24734. var c = r.Math.degToRad(b.alpha)
  24735. , d = r.Math.degToRad(b.beta)
  24736. , e = r.Math.degToRad(b.gamma);
  24737. a ? (-1e3 === g.alpha && (g.alpha = c),
  24738. -1e3 === g.beta && (g.beta = d),
  24739. -1e3 === g.gamma && (g.gamma = e),
  24740. Math.abs(c - g.alpha) > .06 && (g.alpha = c),
  24741. Math.abs(d - g.beta) > .006 && (g.beta = d),
  24742. Math.abs(e - g.gamma) > .006 && (g.gamma = e)) : (g.alpha = c,
  24743. g.beta = d,
  24744. g.gamma = e)
  24745. }(c)
  24746. }),
  24747. this.update = function(a) {
  24748. TWEEN.update()
  24749. if (window.vrEnabled) {
  24750. if (window.ifTest || !browser.isMobile()) this.triggerTargetEvent()//测试时不根据陀螺仪来转向
  24751. else {
  24752. this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient)
  24753. this.triggerTargetEvent()
  24754. }
  24755. }
  24756. }
  24757. ,
  24758. this.triggerTargetEvent = function() {
  24759. var a = this.choseObj()
  24760. , b = a ? a.object : void 0;
  24761. this.targetEventObj.currentObj = b,
  24762. b !== this.targetEventObj.lastObj && (b && this.autoCursorPosition(a),
  24763. 1 === this.type ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24764. b && b.enabled && this.startAnimate(function() {
  24765. this.clickCallback(b)
  24766. }
  24767. .bind(this))) : this.type,
  24768. this.targetEventObj.lastObj = b)
  24769. }
  24770. ,
  24771. this.choseObj = function() {
  24772. this.raycaster.setFromCamera({
  24773. x: 0,
  24774. y: 0
  24775. }, c);
  24776. var a = (this.raycaster.ray,
  24777. window.vrMarkers)
  24778. , b = this.raycaster.intersectObjects(a);
  24779. if (b.length > 0)
  24780. return b[0]
  24781. }
  24782. ,
  24783. this.clickCallback = function(a) {
  24784. this.runTHREEAction(a, "onclick")
  24785. }
  24786. ,
  24787. this.runTHREEAction = function(a, b) {
  24788. switch (b) {
  24789. case "onclick":
  24790. a._listeners && a._listeners.click && a._listeners.click.forEach(function(a) {
  24791. a()
  24792. });
  24793. break;
  24794. case "onhover":
  24795. a._listeners && a._listeners.hover && a._listeners.hover.forEach(function(a) {
  24796. a()
  24797. });
  24798. break;
  24799. case "onout":
  24800. a._listeners && a._listeners.out && a._listeners.out.forEach(function(a) {
  24801. a()
  24802. })
  24803. }
  24804. }
  24805. ,
  24806. this.startAnimate = function(a) {
  24807. this.tweenFlag && this.initAnimation(a)
  24808. }
  24809. ,
  24810. this.initAnimation = function(a) {
  24811. var b = this
  24812. , c = this.cursor.material.map.offset
  24813. , d = function(a) {
  24814. return Math.floor(17 * a) / 17
  24815. };
  24816. b.tweenFlag = !1,
  24817. this.cursorAnimate = new TWEEN.Tween(c).to({
  24818. x: 1
  24819. }, 1e3).onStart(function() {
  24820. b.tweenFlag = !1
  24821. }).onStop(function() {
  24822. b.tweenFlag = !0,
  24823. this.x = 0,
  24824. c.x = 0
  24825. }).onUpdate(function() {}).onComplete(function() {
  24826. a(),
  24827. c.x = 0,
  24828. setTimeout(function() {
  24829. b.tweenFlag = !0
  24830. }, 1500)
  24831. }),
  24832. this.cursorAnimate.easing(d),
  24833. this.cursorAnimate.start()
  24834. }
  24835. ,
  24836. this.autoCursorPosition = function(a) {
  24837. // var b = Math.abs(a.distance - 10);
  24838. // this.cursor.position.z = -b,
  24839. // b /= 10;
  24840. // alert(b);
  24841. // this.cursor.scale.set(b, b, b)
  24842. this.cursor.scale.set(.3,.3,.3)
  24843. }
  24844. }
  24845. ,
  24846. n.prototype.vrRenderer = function(a, b, c) {
  24847. var d = new b.vrCamera(c);
  24848. d.bananaAspect = 0.75// fov origin:0.8
  24849. this.width,
  24850. this.height;
  24851. var b = this;
  24852. this.setSize = function(c, d) {
  24853. a.setSize.call(this, c, d),
  24854. b.width = c,
  24855. b.height = d
  24856. }
  24857. ,
  24858. this.render = function(b, c, e, f) {
  24859. window.cameraQua = c.quaternion.clone();
  24860. var g, h;
  24861. if (c.__RESS__SKIP__STEREO__)
  24862. return a.render(b, c, e, f);
  24863. if ("PerspectiveCamera" === c.type)
  24864. g = d.cameraL,
  24865. h = d.cameraR,
  24866. b.updateMatrixWorld(),
  24867. null === c.parent && c.updateMatrixWorld(),
  24868. d.vrCameraUpdate(c);
  24869. else {
  24870. if ("OrthographicCamera" !== c.type)
  24871. return DEBUG && console.error("Unsupported renderer: ", c.type);
  24872. g = h = c
  24873. }
  24874. a.setScissorTest(!0),
  24875. a.setScissor(0, 0, this.width / 2, this.height),
  24876. a.setViewport(0, 0, this.width / 2, this.height),
  24877. a.render.call(this, b, g, e, f),
  24878. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24879. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24880. a.render.call(this, b, h, e, f),
  24881. a.setScissorTest(!1)
  24882. }
  24883. ,
  24884. this.__proto__ = {
  24885. __proto__: a
  24886. }
  24887. }
  24888. ,
  24889. n.prototype.vrCamera = function(a) {
  24890. this.type = "StereoCamera",
  24891. this._aspect = 1,
  24892. this._overlap = .064,
  24893. this.cameraL = new r.PerspectiveCamera,
  24894. this.cameraL.layers.enable(1),
  24895. this.cameraL.near = 0.01,//xzw add
  24896. this.cameraL.matrixAutoUpdate = !1,
  24897. this.cameraR = new r.PerspectiveCamera,
  24898. this.cameraR.layers.enable(2),
  24899. this.cameraR.near = 0.01,//xzw add
  24900. this.cameraR.matrixAutoUpdate = !1,
  24901. this.eyeRight = new r.Matrix4,
  24902. this.eyeLeft = new r.Matrix4,
  24903. this.vrCameraNeedsUpdate = !0,
  24904. window.vrCameraL = this.cameraL; // fyz 记录vr相机
  24905. Object.defineProperty(this, "bananaAspect", {
  24906. get: function() {
  24907. return this._aspect
  24908. },
  24909. set: function(a) {
  24910. this._aspect !== a && (this.vrCameraNeedsUpdate = !0),
  24911. this._aspect = a
  24912. }
  24913. }),
  24914. Object.defineProperty(this, "overlap", {//瞳距
  24915. get: function() {
  24916. return this._overlap
  24917. },
  24918. set: function(a) {
  24919. this._overlap !== a && (this.vrCameraNeedsUpdate = !0),
  24920. this._overlap = a
  24921. }
  24922. }),
  24923. this.vrCameraUpdate = function(a) {
  24924. this.vrCameraNeedsUpdate = true;
  24925. if (this.vrCameraNeedsUpdate = this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far,
  24926. this.vrCameraNeedsUpdate) {
  24927. this.vrCameraNeedsUpdate = !1,
  24928. //console.debug("vrCameraUpdate"),
  24929. this.bananaFocus = a.focus,
  24930. this.bananaFov = a.fov,
  24931. this.bananaReal_aspect = a.aspect * (window.ban || this.bananaAspect),
  24932. this.bananaNear = a.near,
  24933. this.bananaFar = a.far,
  24934. //console.debug(a.aspect),
  24935. this.bananaFocus = 10;
  24936. 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);
  24937. this.eyeLeft.elements[12] = -e,
  24938. this.eyeRight.elements[12] = e,
  24939. b = -g * this.bananaReal_aspect + f,
  24940. c = g * this.bananaReal_aspect + f,
  24941. d.elements[0] = 2 * this.bananaNear / (c - b),
  24942. d.elements[8] = (c + b) / (c - b),
  24943. this.cameraL.projectionMatrix.copy(d),
  24944. b = -g * this.bananaReal_aspect - f,
  24945. c = g * this.bananaReal_aspect - f,
  24946. d.elements[0] = 2 * this.bananaNear / (c - b),
  24947. d.elements[8] = (c + b) / (c - b),
  24948. this.cameraR.projectionMatrix.copy(d)
  24949. }
  24950. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft),
  24951. this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24952. }
  24953. }
  24954. ,
  24955. n.prototype.boluoGetTexture = function(a) {
  24956. var b = new r.TextureLoader;
  24957. return b.crossOrigin = "anonymous",
  24958. b.load(a)
  24959. }
  24960. /* let webxr = {
  24961. init(renderer) {
  24962. this.renderer = renderer
  24963. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  24964. renderer.xr.enabled = true
  24965. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  24966. //pico firefox
  24967. var mode = 'immersive-vr'
  24968. navigator.xr
  24969. .isSessionSupported(mode)
  24970. .then(supported => {
  24971. if (!supported) {
  24972. this.xrNotFound('isSessionSupported not supported')
  24973. } else {
  24974. this.xrType = 'xr' //showEnterXR();
  24975. }
  24976. })
  24977. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  24978. } else if ('getVRDisplays' in navigator) {
  24979. //pico 的vr browser是这个
  24980. console.log('getVRDisplays')
  24981. let setDevice = device => {
  24982. this.xrType = 'vr'
  24983. this.device = device
  24984. this.renderer.xr.setDevice(device) //新版是renderer.vr
  24985. }
  24986. window.addEventListener(
  24987. 'vrdisplayconnect',
  24988. function (event) {
  24989. setDevice(event.display)
  24990. },
  24991. false
  24992. )
  24993. window.addEventListener(
  24994. 'vrdisplaydisconnect',
  24995. function ( ) {
  24996. console.log('vrdisplaydisconnect')
  24997. window.bus.dispatchEvent({type:'exitWebXR'})
  24998. },
  24999. false
  25000. )
  25001. window.addEventListener(
  25002. 'vrdisplaypresentchange',
  25003. function (event) {
  25004. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  25005. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  25006. },
  25007. false
  25008. )
  25009. window.addEventListener(
  25010. 'vrdisplayactivate',
  25011. function (event) {
  25012. event.display.requestPresent([{ source: this.renderer.domElement }])
  25013. },
  25014. false
  25015. )
  25016. navigator
  25017. .getVRDisplays()
  25018. .then(function (displays) {
  25019. if (displays.length > 0) {
  25020. setDevice(displays[0])
  25021. } else {
  25022. this.xrNotFound('no displays')
  25023. }
  25024. })
  25025. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  25026. } else {
  25027. this.xrNotFound('xr not supported')
  25028. }
  25029. },
  25030. enterVR() {
  25031. if (!this.xrType) return //不支持
  25032. console.log('enterVR', this.xrType)
  25033. if (this.xrType == 'vr') {
  25034. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  25035. } else if (this.xrType == 'xr') {
  25036. if (this.currentSession == void 0) {
  25037. console.log('this.currentSession == void 0 ')
  25038. function getXRSessionInit(mode, options) {
  25039. var space = (options || {}).referenceSpaceType || 'local-floor'
  25040. var sessionInit = (options && options.sessionInit) || {}
  25041. // Nothing to do for default features.
  25042. if (space == 'viewer') return sessionInit
  25043. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  25044. // If the user already specified the space as an optional or required feature, don't do anything.
  25045. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  25046. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  25047. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  25048. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  25049. // request it later.
  25050. var newInit = Object.assign({}, sessionInit)
  25051. newInit.requiredFeatures = [space]
  25052. if (sessionInit.requiredFeatures) {
  25053. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  25054. }
  25055. return newInit
  25056. }
  25057. let onSessionEnded = ( ) => {
  25058. console.log('onSessionEnded')
  25059. this.currentSession.removeEventListener('end', onSessionEnded)
  25060. setTimeout(()=>{
  25061. this.renderer.xr.setSession(null)
  25062. this.currentSession = null
  25063. window.bus.dispatchEvent({type:'exitWebXR'})
  25064. },1)//延迟原因:先使THREE里的onSessionEnded执行
  25065. }
  25066. let onSessionStarted = session => {
  25067. console.log('onSessionStarted')
  25068. session.addEventListener('end', onSessionEnded)
  25069. this.renderer.xr.setSession(session)
  25070. this.currentSession = session
  25071. }
  25072. var mode = 'immersive-vr'
  25073. var sessionInit = getXRSessionInit(mode)
  25074. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  25075. } else {
  25076. console.log('this.currentSession.end()', this.currentSession)
  25077. this.currentSession.end()
  25078. }
  25079. }
  25080. },
  25081. xrNotFound(text) {
  25082. console.log('xrNotFound:', text)
  25083. },
  25084. } */
  25085. /***********************************************************************************************************************************************************************************/
  25086. n.prototype.updateScreenSize = function() {//xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  25087. var W,H;//当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  25088. return function(o){
  25089. var render = false;
  25090. var ratio;
  25091. var w, h; //记录应当render的大小
  25092. if(o && !o.resize && o.width!= void 0 && o.height!= void 0){
  25093. w = o.width, h = o.height, render = true, ratio=1;
  25094. }else{
  25095. w = $('#player').width();
  25096. h = $('#player').height();
  25097. o && o.resize && (W = this.renderWidth, H = this.renderHeight);
  25098. (w !== W || h !== H || this.forceUpdateSize) &&
  25099. (W = w, H = h, render = true, ratio = window.devicePixelRatio);
  25100. }
  25101. if(render){
  25102. this.setSize(w, h, ratio);
  25103. this.forceUpdateSize = !1
  25104. }
  25105. }
  25106. }()
  25107. ,
  25108. n.prototype.updateComponents = function() {
  25109. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  25110. this.updateListeners[t].update(e)
  25111. }
  25112. ,
  25113. n.prototype.suspend = function() {
  25114. this.started = !1,
  25115. this.suspendedObjects = this.scene.children.map(function(e) {
  25116. return this.scene.remove(e),
  25117. e
  25118. }
  25119. .bind(this)),
  25120. this.render()
  25121. }
  25122. ,
  25123. n.prototype.resume = function() {
  25124. this.suspendedObjects.forEach(function(e) {
  25125. this.scene.add(e)
  25126. }
  25127. .bind(this)),
  25128. this.suspendedObjects = [],
  25129. this.started = !0,
  25130. p()
  25131. }
  25132. ;
  25133. var p = function() {
  25134. this.started && (window.requestAnimationFrame(p),
  25135. this.updateScreenSize(), // fyz resize
  25136. this.updateComponents(),
  25137. this.updateTextureMemory(),
  25138. this.render(),
  25139. window.stats && (window.fps = stats.update()),
  25140. this.emit(a.AfterRender))
  25141. };
  25142. n.prototype.getImageData = function() {
  25143. var e = document.createElement("canvas")
  25144. , t = e.getContext("2d");
  25145. return function(i, n, r) {
  25146. return e.width === n && e.height === r || (e.width = n,
  25147. e.height = r),
  25148. t.drawImage(i, 0, 0, n, r),
  25149. t.getImageData(0, 0, n, r)
  25150. }
  25151. }(),
  25152. n.prototype.initSizedTexture2D = function(e, t, i) {
  25153. var n = this.renderer
  25154. , o = n.context
  25155. , a = n.state
  25156. , s = new r.Texture(null);
  25157. s.flipY = !1,
  25158. i !== !0 && (i = !1),
  25159. s.generateMipmaps = i;
  25160. var l = n.paramThreeToGL(s.format)
  25161. , c = n.paramThreeToGL(s.type)
  25162. , h = n.properties.get(s)
  25163. , u = o.createTexture();
  25164. a.bindTexture(o.TEXTURE_2D, u),
  25165. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  25166. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  25167. s.wrapS = t,
  25168. s.wrapT = t;
  25169. var d = n.paramThreeToGL(t);
  25170. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  25171. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  25172. i ? (s.magFilter = r.LinearFilter,
  25173. s.minFilter = r.LinearMipMapLinearFilter,
  25174. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25175. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  25176. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  25177. s.minFilter = r.LinearFilter,
  25178. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  25179. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  25180. a.bindTexture(o.TEXTURE_2D, null),
  25181. h.__webglTexture = u,
  25182. s
  25183. }
  25184. ,
  25185. n.prototype.initSizedCubeMap = function(e, t) {
  25186. var i = this.renderer
  25187. , n = i.context
  25188. , o = i.state
  25189. , a = new r.CubeTexture([null, null, null, null, null, null]);
  25190. a.flipY = !1,
  25191. a.generateMipmaps = t;
  25192. var s = i.paramThreeToGL(a.format)
  25193. , l = i.paramThreeToGL(a.type)
  25194. , c = i.properties.get(a)
  25195. , h = n.createTexture();
  25196. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  25197. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  25198. for (var u = 0; u < 6; u++)
  25199. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  25200. return t ? (a.magFilter = r.LinearFilter,
  25201. a.minFilter = r.LinearMipMapLinearFilter,
  25202. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25203. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  25204. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  25205. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  25206. a.minFilter = r.LinearFilter,
  25207. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  25208. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  25209. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  25210. c.__image__webglTextureCube = h,
  25211. a
  25212. }
  25213. ,
  25214. n.prototype.deallocateCubeTexture = function(e) {
  25215. var t = this.renderer
  25216. , i = t.context
  25217. , n = t.properties.get(e);
  25218. i.deleteTexture(n.__image__webglTextureCube)
  25219. }
  25220. ,
  25221. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  25222. var a = this.renderer
  25223. , s = a.context
  25224. , l = a.state
  25225. , c = a.properties.get(t);
  25226. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  25227. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25228. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  25229. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  25230. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  25231. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  25232. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  25233. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  25234. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  25235. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  25236. l.bindTexture(s.TEXTURE_2D, null)
  25237. }
  25238. ,
  25239. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  25240. var s = this.renderer
  25241. , l = s.context
  25242. , c = s.state
  25243. , h = s.properties.get(t);
  25244. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  25245. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  25246. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  25247. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  25248. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  25249. }
  25250. ,
  25251. n.prototype.rebuildMipMaps2D = function(e) {
  25252. var t = this.renderer
  25253. , i = t.context
  25254. , n = t.state;
  25255. t.properties.get(e);
  25256. i.generateMipmap(i.TEXTURE_2D),
  25257. n.bindTexture(i.TEXTURE_2D, null)
  25258. }
  25259. ,
  25260. n.prototype.rebuildMipMaps3D = function(e) {
  25261. var t = this.renderer
  25262. , i = t.context
  25263. , n = t.state
  25264. , r = t.properties.get(e);
  25265. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  25266. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  25267. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  25268. }
  25269. ,
  25270. n.prototype.renderToCubeMap = function() {
  25271. var e = !1
  25272. , t = null
  25273. , i = null
  25274. , n = null
  25275. , a = null
  25276. , s = null
  25277. , l = 1;
  25278. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  25279. var _ = this.renderer;
  25280. _.context;
  25281. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  25282. i.position.z = 150,
  25283. t = new r.Scene,
  25284. t.add(i),
  25285. n = new r.ShaderMaterial({
  25286. uniforms: {
  25287. tDiffuse: {
  25288. type: "t",
  25289. value: null
  25290. },
  25291. alpha: {
  25292. type: "f",
  25293. value: 1
  25294. }
  25295. },
  25296. vertexShader: o.basicTextured.vertexShader,
  25297. fragmentShader: o.basicTextured.fragmentShader,
  25298. depthWrite: !1,
  25299. depthTest: !1,
  25300. side: r.DoubleSide
  25301. }),
  25302. a = new r.PlaneBufferGeometry(l,l),
  25303. s = new r.Mesh(a,n),
  25304. s.position.z = 0,
  25305. t.add(s),
  25306. e = !0);
  25307. var T = a.getAttribute("uv");
  25308. T.setDynamic(!0),
  25309. T.needsUpdate = !0;
  25310. var x = T.array
  25311. , S = p / u
  25312. , M = f / d
  25313. , R = g / u
  25314. , P = m / d;
  25315. x[0] = S,
  25316. x[1] = M + P,
  25317. x[2] = S + R,
  25318. x[3] = M + P,
  25319. x[4] = S,
  25320. x[5] = M,
  25321. x[6] = S + R,
  25322. x[7] = M;
  25323. var O = a.getAttribute("position");
  25324. O.setDynamic(!0),
  25325. O.needsUpdate = !0;
  25326. var L = O.array
  25327. , D = v / h.width - l / 2
  25328. , N = A / h.height - l / 2
  25329. , B = y / h.width
  25330. , F = C / h.height;
  25331. L[0] = D,
  25332. L[1] = N + F,
  25333. L[3] = D + B,
  25334. L[4] = N + F,
  25335. L[6] = D,
  25336. L[7] = N,
  25337. L[9] = D + B,
  25338. L[10] = N;
  25339. this.renderer.properties.get(c);
  25340. n.uniforms.tDiffuse.value = c,
  25341. n.blending = E || r.NoBlending,
  25342. n.transparent = !!b,
  25343. void 0 !== w && null !== w || (w = 1),
  25344. n.uniforms.alpha.value = w,
  25345. n.needUpdate = !0,
  25346. h.activeCubeFace = I,
  25347. h.viewport.set(0, 0, h.width, h.height);
  25348. var V = this.renderer.autoClear;
  25349. this.renderer.autoClear = !1,
  25350. this.renderer.render(t, i, h, !1),
  25351. this.renderer.autoClear = V
  25352. }
  25353. }(),
  25354. n.prototype.copyCubeMap = function() {
  25355. var e = !1
  25356. , t = null
  25357. , i = null
  25358. , a = null
  25359. , s = null
  25360. , l = null
  25361. , c = new r.Euler;
  25362. new r.Vector3;
  25363. return function(h, u, d, p, f, g, m, v, A) {
  25364. if(f > this.qualityManager.maxRenderTargetSize) return; //add
  25365. this.renderer;
  25366. if (!e) {
  25367. var y = 2;
  25368. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  25369. i.position.set(0, 0, 0),
  25370. t = new r.Scene,
  25371. t.add(i),
  25372. a = new r.ShaderMaterial({
  25373. uniforms: {
  25374. tDiffuse: {
  25375. type: "t",
  25376. value: null
  25377. },
  25378. alpha: {
  25379. type: "f",
  25380. value: 1
  25381. }
  25382. },
  25383. vertexShader: o.copyCubeMap.vertexShader,
  25384. fragmentShader: o.copyCubeMap.fragmentShader,
  25385. depthWrite: !1,
  25386. depthTest: !1,
  25387. side: r.DoubleSide
  25388. }),
  25389. s = new r.BoxGeometry(y,y,y),
  25390. l = new r.Mesh(s,a),
  25391. t.add(l),
  25392. e = !0
  25393. }
  25394. for (var C = 0; C < 6; C++)
  25395. n.getCubeOrientationForCubeFace(C, c),
  25396. l.rotation.copy(c),
  25397. l.matrixWorldNeedsUpdate = !0,
  25398. l.updateMatrixWorld(),
  25399. a.uniforms.tDiffuse.value = h,
  25400. a.blending = m || r.NoBlending,
  25401. a.transparent = !!v,
  25402. void 0 !== A && null !== A || (A = 1),
  25403. a.uniforms.alpha.value = A,
  25404. a.needUpdate = !0,
  25405. u.activeCubeFace = C,
  25406. u.viewport.set(0, 0, f, g),
  25407. this.renderer.render(t, i, u, !1)
  25408. }
  25409. }(),
  25410. n.getLookAtForCubeFace = function(e, t) {
  25411. switch (e) {
  25412. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25413. t.set(1, 0, 0);
  25414. break;
  25415. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25416. t.set(-1, 0, 0);
  25417. break;
  25418. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25419. t.set(0, 1, 0);
  25420. break;
  25421. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25422. t.set(0, -1, 0);
  25423. break;
  25424. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25425. t.set(0, 0, 1);
  25426. break;
  25427. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25428. t.set(0, 0, -1)
  25429. }
  25430. }
  25431. ,
  25432. n.getCubeOrientationForCubeFace = function(e, t) {
  25433. switch (e) {
  25434. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25435. t.set(0, -Math.PI / 2, 0);
  25436. break;
  25437. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25438. t.set(0, Math.PI / 2, 0);
  25439. break;
  25440. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25441. t.set(Math.PI / 2, Math.PI, 0);
  25442. break;
  25443. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25444. t.set(-Math.PI / 2, Math.PI, 0);
  25445. break;
  25446. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25447. t.set(0, -Math.PI, 0);
  25448. break;
  25449. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25450. t.set(0, 0, 0)
  25451. }
  25452. }
  25453. ,
  25454. t.exports = n
  25455. }
  25456. , {
  25457. "../enum/GLCubeFaces": 25,
  25458. "../enum/GLTextureType": 26,
  25459. "../enum/SceneRendererEvents": 43,
  25460. "../exception/BasicException": 55,
  25461. "../exception/RendererCreationException": 57,
  25462. "../settings": 166,
  25463. "../shaders": 167,
  25464. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25465. "../util/browser": 182,
  25466. /************************************************************************************************************************************************/
  25467. events: 202,
  25468. three: 217
  25469. }],
  25470. 159: [function(e, t, i) {
  25471. "use strict";
  25472. function n(e) {
  25473. this.messenger = new a(e),
  25474. this.clientKey = null
  25475. }
  25476. var r = e("../util/ajax")
  25477. , o = e("./PostMessageType")
  25478. , a = e("./postmessage")
  25479. , s = e("./VersionInfo")
  25480. , l = e("events").EventEmitter
  25481. , c = window.location.origin + "/api/v1/user/";
  25482. n.prototype = Object.create(l.prototype),
  25483. n.prototype.bindEvents = function() {
  25484. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25485. }
  25486. ,
  25487. n.prototype.waitForConnection = function() {
  25488. var e = new Promise(function(e, t) {
  25489. this.messenger.on(o.CONNECT, function(i) {
  25490. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25491. }
  25492. .bind(this))
  25493. }
  25494. .bind(this));
  25495. return e
  25496. }
  25497. ,
  25498. n.prototype.onConnectionReceived = function(e) {
  25499. return this.messenger.setTarget(e.source, e.origin),
  25500. this.verifyConnection(e).then(function(t, i) {
  25501. this.messenger.send({
  25502. type: o.ACCEPT,
  25503. toId: e.fromId,
  25504. warning: i
  25505. }),
  25506. this.clientKey = t,
  25507. this.messenger.removeAllListeners(o.CONNECT),
  25508. this.bindEvents()
  25509. }
  25510. .bind(this), function(t) {
  25511. this.messenger.send({
  25512. type: o.REJECT,
  25513. toId: e.fromId,
  25514. reason: t
  25515. }),
  25516. this.messenger.setTarget()
  25517. }
  25518. .bind(this))
  25519. }
  25520. ,
  25521. n.prototype.verifyConnection = function(e) {
  25522. return new Promise(function(t, i) {
  25523. var n;
  25524. if (s.isDeprecated(e.sdkVersion))
  25525. n = "这个版本正在被弃用";
  25526. else if (!s.isSupported(e.sdkVersion))
  25527. return i("不支持此版本的SDK");
  25528. var o = {
  25529. cache: !1,
  25530. headers: {
  25531. "X-port-Application-Key": e.applicationKey,
  25532. "X-port-Referrer": e.origin
  25533. }
  25534. };
  25535. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  25536. }
  25537. )
  25538. }
  25539. ,
  25540. n.prototype.onMessageReceived = function(e) {
  25541. if (this.validateClientApplicationKey(e.applicationKey)) {
  25542. var t = this;
  25543. e.onDone = function(i) {
  25544. i.toId = e.fromId,
  25545. i.uid = e.uid,
  25546. i.type = o.RESPONSE,
  25547. t.messenger.send(i)
  25548. }
  25549. ,
  25550. this.emit(o.ACTION, e)
  25551. }
  25552. }
  25553. ,
  25554. n.prototype.validateClientApplicationKey = function(e) {
  25555. return this.clientKey === e
  25556. }
  25557. ,
  25558. n.prototype.sendEvent = function(e, t) {
  25559. this.messenger.send({
  25560. type: o.EVENT,
  25561. eventType: e,
  25562. eventData: t
  25563. })
  25564. }
  25565. ,
  25566. t.exports = n
  25567. }
  25568. , {
  25569. "../util/ajax": 181,
  25570. "./PostMessageType": 160,
  25571. "./VersionInfo": 163,
  25572. "./postmessage": 165,
  25573. events: 202
  25574. }],
  25575. 160: [function(e, t, i) {
  25576. "use strict";
  25577. t.exports = Object.freeze({
  25578. CONNECT: "postmessage.connect",
  25579. ACCEPT: "postmessage.accept",
  25580. REJECT: "postmessage.reject",
  25581. ACTION: "postmessage.action",
  25582. RESPONSE: "postmessage.response",
  25583. EVENT: "postmessage.event"
  25584. })
  25585. }
  25586. , {}],
  25587. 161: [function(e, t, i) {
  25588. "use strict";
  25589. t.exports = Object.freeze({
  25590. MOVE: "sdk.move",
  25591. ENTER_PANO: "sdk.enterpano",
  25592. MODEL_LOADED: "sdk.modelloaded"
  25593. })
  25594. }
  25595. , {}],
  25596. 162: [function(e, t, i) {
  25597. "use strict";
  25598. t.exports = Object.freeze({
  25599. FLY: "transition.fly",
  25600. FADEOUT: "transition.fade",
  25601. INSTANT: "transition.instant"
  25602. })
  25603. }
  25604. , {}],
  25605. 163: [function(e, t, i) {
  25606. "use strict";
  25607. t.exports = {
  25608. current: "1.0",
  25609. supported: ["1.0"],
  25610. deprecated: [],
  25611. isSupported: function(e) {
  25612. return this.supported.indexOf(e) !== -1
  25613. },
  25614. isDeprecated: function(e) {
  25615. return this.deprecated.indexOf(e) !== -1
  25616. },
  25617. isValid: function(e) {
  25618. return this.isSupported(e) || this.isDeprecated(e)
  25619. }
  25620. }
  25621. }
  25622. , {}],
  25623. 164: [function(e, t, i) {
  25624. (function(i) {
  25625. "use strict";
  25626. function n(e, t, i) {
  25627. e && (e = e.toLowerCase().trim());
  25628. var n = new I.UP.clone
  25629. , r = Math.PI / 3
  25630. , o = Math.PI / 2;
  25631. switch (e) {
  25632. case "left":
  25633. i.copy(t),
  25634. i.applyAxisAngle(n, o);
  25635. break;
  25636. case "right":
  25637. i.copy(t),
  25638. i.applyAxisAngle(n, -o);
  25639. break;
  25640. case "forwardleft":
  25641. i.copy(t),
  25642. i.applyAxisAngle(n, r);
  25643. break;
  25644. case "forwardright":
  25645. i.copy(t),
  25646. i.applyAxisAngle(n, -r);
  25647. break;
  25648. case "forward":
  25649. default:
  25650. i.copy(t)
  25651. }
  25652. return i
  25653. }
  25654. function r(e, t) {
  25655. if (e) {
  25656. var i = {
  25657. pano: e,
  25658. lookAtPoint: null,
  25659. duration: null,
  25660. maxDistanceOverride: null,
  25661. skipWarpingCheck: !1
  25662. };
  25663. this.player.flyToPano(i, function() {
  25664. t && t({
  25665. success: !0,
  25666. message: "Transition complete."
  25667. })
  25668. })
  25669. } else
  25670. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  25671. t && t({
  25672. success: !1,
  25673. error: "Unable to find pano."
  25674. })
  25675. }
  25676. function o(e, t) {
  25677. var i = this.findRankedPano(e, t);
  25678. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  25679. null)
  25680. }
  25681. function a(e, t) {
  25682. var i = this.findRankedtag(e, t);
  25683. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  25684. null)
  25685. }
  25686. function s(e, t) {
  25687. t.copy(I.FORWARD),
  25688. e.getDirection(t)
  25689. }
  25690. function l(e) {
  25691. function t(e) {
  25692. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  25693. return {
  25694. x: c.Math.radToDeg(t._x),
  25695. y: c.Math.radToDeg(t._y),
  25696. z: c.Math.radToDeg(t._z)
  25697. }
  25698. }
  25699. var i = function(e) {
  25700. return e.alignmentType !== m.ALIGNED ? null : {
  25701. x: e.position.x,
  25702. y: e.position.y,
  25703. z: e.position.z
  25704. }
  25705. };
  25706. return {
  25707. panos: e.panos.list.map(function(n) {
  25708. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  25709. return {
  25710. uuid: n.id,
  25711. aligned: n.alignmentType === m.ALIGNED,
  25712. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25713. position: i(n),
  25714. rotation: t(n),
  25715. thumbnail: r
  25716. }
  25717. })
  25718. }
  25719. }
  25720. var c = e("three")
  25721. , h = e("./ApiHost")
  25722. , u = e("../util/logger")
  25723. , d = e("../util/common")
  25724. , p = e("../util/math")
  25725. , f = e("../enum/ModelManagerEvents")
  25726. , g = e("./PostMessageType")
  25727. , m = e("../enum/AlignmentType")
  25728. , v = e("../enum/Direction")
  25729. , A = e("./TransitionStyles")
  25730. , y = e("../util/panorama")
  25731. , C = e("../enum/GLCubeFaces")
  25732. , I = e("../enum/Vectors")
  25733. , E = e("../enum/Viewmode")
  25734. , b = e("../enum/WarpStyle")
  25735. , w = (e("../enum/Keys"),
  25736. e("../enum/PlayerEvents"))
  25737. , _ = e("../sdk/SdkEvents")
  25738. , I = e("../enum/Vectors")
  25739. , T = e("../enum/ControlEvents")
  25740. , x = e("../enum/RenderLayers")
  25741. , S = (e("../constants"),
  25742. e("../settings"))
  25743. , M = e("../lib/jpeg_encoder")
  25744. , R = new u(i)
  25745. , P = function() {
  25746. var e = function e() {
  25747. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25748. e.player.getDirection(e.playerDirection),
  25749. e.projectVectors();
  25750. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  25751. if (e.angleTravelled += Math.abs(t),
  25752. e.angleTravelled >= Math.abs(e.angle)) {
  25753. if (e.active = !1,
  25754. e.onDone) {
  25755. var i = e.onDone;
  25756. i()
  25757. }
  25758. } else
  25759. e.lastFacingDirection.copy(e.playerDirection),
  25760. window.setTimeout(e, 4)
  25761. };
  25762. return e.active = !1,
  25763. e.angle = 0,
  25764. e.angleTravelled = 0,
  25765. e.playerDirection = new c.Vector3,
  25766. e.lastFacingDirection = new c.Vector3,
  25767. e.onDone = null,
  25768. e.player = null,
  25769. e.start = function(t, i, n, r) {
  25770. e.active = !0,
  25771. t && i && (i = 0),
  25772. e.angle = t || i,
  25773. e.xAngle = t,
  25774. e.yAngle = i,
  25775. e.angleTravelled = 0,
  25776. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25777. n.getDirection(e.playerDirection),
  25778. e.lastFacingDirection.copy(e.playerDirection),
  25779. e.projectVectors(),
  25780. e.onDone = r,
  25781. e.player = n,
  25782. e()
  25783. }
  25784. ,
  25785. e.projectVectors = function() {
  25786. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  25787. e.lastFacingDirection.projectOnPlane(I.UP))
  25788. }
  25789. ,
  25790. e
  25791. }()
  25792. , O = function() {
  25793. var e = new c.Vector3;
  25794. return function(t) {
  25795. t ? (e.copy(t.position),
  25796. e.add(t.discPosition),
  25797. p.projectPositionToCanvas(e, this.player.camera, e),
  25798. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  25799. }
  25800. }()
  25801. , L = function() {
  25802. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25803. }
  25804. , D = function() {
  25805. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25806. }
  25807. , N = function(e) {
  25808. var t = new c.Vector3;
  25809. return function(e) {
  25810. var i = this.player.getDirection();
  25811. t.copy(i);
  25812. var n = t.y;
  25813. t.y = 0,
  25814. t.normalize();
  25815. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  25816. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  25817. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  25818. 0;
  25819. this.player.mode === E.DOLLHOUSE && (r = -r);
  25820. var o = L.call(this) - .1
  25821. , a = D.call(this) + .1
  25822. , s = r + e;
  25823. s > o ? s = o : s < a && (s = a);
  25824. var l = s - r;
  25825. return e > 0 && l < .01 && (l = 0),
  25826. e < 0 && l > -.01 && (l = 0),
  25827. l
  25828. }
  25829. }()
  25830. , B = function() {
  25831. var e = new c.Euler;
  25832. return function(t) {
  25833. return e.setFromQuaternion(t.quaternion, "YXZ"),
  25834. {
  25835. position: {
  25836. x: t.position.x,
  25837. y: t.position.y,
  25838. z: t.position.z
  25839. },
  25840. rotation: {
  25841. x: c.Math.radToDeg(e.x),
  25842. y: c.Math.radToDeg(e.y),
  25843. z: 0
  25844. },
  25845. pano: t.currentPano ? t.currentPano.id : null,
  25846. mode: t.mode
  25847. }
  25848. }
  25849. }()
  25850. , F = null;
  25851. t.exports = {
  25852. init: function(e, t, i, n, r) {
  25853. V.init(e, t, i, r),
  25854. F = new Promise(function(e, t) {
  25855. i.on(w.Ready, function() {
  25856. e()
  25857. })
  25858. }
  25859. .bind(this));
  25860. var o = new h(window)
  25861. , a = o.waitForConnection();
  25862. a.then(function(e) {
  25863. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25864. });
  25865. var s = function() {
  25866. var e = Date.now();
  25867. return function() {
  25868. if (!(Date.now() - e < 100)) {
  25869. var t = B(i);
  25870. o.sendEvent(_.MOVE, {
  25871. state: t
  25872. }),
  25873. e = Date.now()
  25874. }
  25875. }
  25876. }();
  25877. i.on(w.Move, s),
  25878. i.on(w.ViewChanged, s),
  25879. n.on(f.ActiveModelChanged, function(e) {
  25880. function t(e) {
  25881. var t, i = e.newPano.id;
  25882. e.oldPano && (t = e.oldPano.id),
  25883. i !== t && o.sendEvent(_.ENTER_PANO, {
  25884. oldPano: t,
  25885. newPano: i
  25886. })
  25887. }
  25888. var i = e.model
  25889. , n = e.oldModel;
  25890. V.model = i,
  25891. a.then(function() {
  25892. o.sendEvent(_.MODEL_LOADED, {
  25893. metadata: l(i)
  25894. })
  25895. }),
  25896. n && n.panos.forEach(function(e) {
  25897. e.removeEventListener("enter", t)
  25898. }),
  25899. i.panos.forEach(function(e) {
  25900. e.on("enter", t)
  25901. })
  25902. })
  25903. }
  25904. };
  25905. var V = {
  25906. director: null,
  25907. player: null,
  25908. controls: null,
  25909. sceneRenderer: null,
  25910. model: null,
  25911. init: function(e, t, i, n) {
  25912. this.director = e,
  25913. this.player = i,
  25914. this.controls = t,
  25915. this.sceneRenderer = n
  25916. },
  25917. handleToObject: {},
  25918. objectToHandle: {},
  25919. handleCount: 0,
  25920. onMessageReceive: function(e) {
  25921. if (e) {
  25922. var t = e.targetFunction
  25923. , i = e.params
  25924. , n = e.onDone;
  25925. t && this[t] && this[t](i, n)
  25926. }
  25927. },
  25928. waitForInit: function(e, t) {
  25929. F.then(t.bind({
  25930. success: !0,
  25931. message: "Init complete."
  25932. }))
  25933. },
  25934. moveToPano: function(e, t) {
  25935. var i = new c.Euler(0,0,0,"YXZ")
  25936. , n = new c.Quaternion;
  25937. return function(e, t) {
  25938. var r = e.pano
  25939. , o = e.rotation
  25940. , a = e.transition;
  25941. if (!this.model)
  25942. return t({
  25943. success: !1,
  25944. error: "The model has not been loaded yet"
  25945. });
  25946. var s = this.model.panos.get(r);
  25947. if (!s)
  25948. return t({
  25949. success: !1,
  25950. error: r + " does not exist in this model"
  25951. });
  25952. if (!o)
  25953. return t({
  25954. sucess: !1,
  25955. erorr: o + " is not a valid rotation"
  25956. });
  25957. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  25958. console.log(o.z);
  25959. var l = {
  25960. success: !0,
  25961. message: r
  25962. };
  25963. if (a === A.FADEOUT)
  25964. n.setFromEuler(i),
  25965. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  25966. else {
  25967. var h, u;
  25968. a === A.INSTANT && (h = 0,
  25969. u = 0);
  25970. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  25971. this.player.flyToPano({
  25972. pano: s,
  25973. lookAtPoint: d,
  25974. duration: h,
  25975. aimDuration: u
  25976. }, t.bind(this, l))
  25977. }
  25978. }
  25979. }(),
  25980. moveInDirection: function(e, t) {
  25981. var i = e.direction;
  25982. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  25983. void (t && t({
  25984. success: !1,
  25985. error: "Invalid direction."
  25986. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  25987. t(e ? {
  25988. success: !0,
  25989. message: "moved " + i
  25990. } : {
  25991. success: !1,
  25992. error: "Cannot move in direction: " + i
  25993. })
  25994. })
  25995. },
  25996. getPose: function(e, t) {
  25997. this.player.camera.position,
  25998. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  25999. return t({
  26000. success: !0,
  26001. message: B(this.player)
  26002. })
  26003. },
  26004. takeScreenShot: function() {
  26005. var e = new c.PerspectiveCamera
  26006. , t = new c.WebGLRenderTarget;
  26007. return function(i, n) {
  26008. if (!i.resolution)
  26009. return n({
  26010. success: !1,
  26011. error: "An invalid resolution was specified"
  26012. });
  26013. if (i.resolution.width === -1 || i.resolution.height === -1) {
  26014. var r = this.sceneRenderer.renderer.getSize();
  26015. i.resolution.width = r.width,
  26016. i.resolution.height = r.height
  26017. }
  26018. e.layers.set(x.DEFAULT),
  26019. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  26020. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  26021. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  26022. var o = i.resolution.width
  26023. , a = i.resolution.height
  26024. , s = o / a;
  26025. e.position.copy(this.sceneRenderer.camera.position),
  26026. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  26027. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  26028. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  26029. t.setSize(o, a),
  26030. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  26031. var l = new Uint8Array(o * a * 4);
  26032. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  26033. var c = M.encode({
  26034. data: l,
  26035. width: o,
  26036. height: a,
  26037. heading: 180,
  26038. pitch: 0
  26039. }, {
  26040. quality: 75,
  26041. flipY: !0
  26042. })
  26043. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  26044. n({
  26045. success: !0,
  26046. message: h
  26047. })
  26048. }
  26049. }(),
  26050. findRankedPano: function(e, t) {
  26051. var i = new c.Vector3
  26052. , r = new c.Vector3;
  26053. return function(e, t) {
  26054. s(this.player, r),
  26055. n(t, r, i);
  26056. var o = this.player.rankedPanoInDirection(e, i);
  26057. if (o) {
  26058. var a = this.objectToHandle[o.id];
  26059. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  26060. this.handleToObject[a] = o),
  26061. a
  26062. }
  26063. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  26064. -1
  26065. }
  26066. }(),
  26067. findRankedtag: function(e, t) {
  26068. var i = new c.Vector3
  26069. , r = new c.Vector3;
  26070. return function(e, t) {
  26071. s(this.player, r),
  26072. n(t, r, i);
  26073. var o = this.player.rankedtagInDirection(e, i);
  26074. if (o) {
  26075. var a = this.objectToHandle[o.sid];
  26076. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  26077. this.handleToObject[a] = o),
  26078. a
  26079. }
  26080. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  26081. -1
  26082. }
  26083. }(),
  26084. clickNearesttag: function(e) {
  26085. this.clickRankedtag(0, e)
  26086. },
  26087. clickRankedtag: function(e, t) {
  26088. var i = a.call(this, e, t);
  26089. i && O.call(this, i)
  26090. },
  26091. clickNearestPano: function(e, t) {
  26092. this.clickRankedPano(0, e, t)
  26093. },
  26094. clickRankedPano: function(e, t, i) {
  26095. var n = o.call(this, e, t);
  26096. n ? r.call(this, n, i) : i(null)
  26097. },
  26098. clickPano: function(e, t) {
  26099. var i = this.handleTable[e];
  26100. i ? r.call(this, i, t) : t(null)
  26101. },
  26102. rotateDirection: function() {
  26103. return function(e, t) {
  26104. var i = e.direction
  26105. , n = e.angle;
  26106. if (!P.active) {
  26107. var r = 0
  26108. , o = 0
  26109. , a = 0
  26110. , s = 0;
  26111. if (!n || isNaN(n))
  26112. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  26113. void (t && t({
  26114. success: !1,
  26115. error: "Invalid rotation angle."
  26116. }));
  26117. if (this.player.mode === E.TRANSITIONING)
  26118. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  26119. void (t && t({
  26120. success: !1,
  26121. error: "Cannot rotate while transitioning"
  26122. }));
  26123. if (i === v.RIGHT || i === v.LEFT)
  26124. i === v.RIGHT && (n = -n),
  26125. r = n > 0 ? -1 : 1,
  26126. a = n;
  26127. else {
  26128. if (i !== v.UP && i !== v.DOWN)
  26129. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  26130. void (t && t({
  26131. success: !1,
  26132. error: "Invalid direction for rotation."
  26133. }));
  26134. if (this.player.mode === E.FLOORPLAN)
  26135. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  26136. void (t && t({
  26137. success: !1,
  26138. error: "Cannot rotate " + i + " in floorplan mode"
  26139. }));
  26140. if (i === v.DOWN && (n = -n),
  26141. n = N.call(this, n),
  26142. 0 === n)
  26143. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  26144. void (t && t({
  26145. success: !1,
  26146. error: "Already at maximum rotation in direction: " + i
  26147. }));
  26148. o = n > 0 ? 1 : -1,
  26149. s = n
  26150. }
  26151. var l = n;
  26152. n = c.Math.degToRad(n),
  26153. a = c.Math.degToRad(a),
  26154. s = c.Math.degToRad(s);
  26155. var h = this.controls.activeControl
  26156. , u = function() {
  26157. h.stopRotating(!0),
  26158. t && t({
  26159. success: !0,
  26160. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  26161. })
  26162. };
  26163. h.startRotating(r, o),
  26164. P.start(a, s, this.player, u)
  26165. }
  26166. }
  26167. }(),
  26168. rotate: function() {
  26169. var e = new c.Vector3
  26170. , t = new c.Vector3;
  26171. return function(i, n) {
  26172. var r = i.xAngle
  26173. , o = i.yAngle;
  26174. if (!P.active) {
  26175. if (r = r || 0,
  26176. o = o || 0,
  26177. isNaN(r) || isNaN(o))
  26178. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  26179. void (n && n({
  26180. success: !1,
  26181. error: "Invalid rotation angle."
  26182. }));
  26183. if (this.player.mode === E.TRANSITIONING)
  26184. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  26185. void (n && n({
  26186. success: !1,
  26187. error: "Cannot rotate while transitioning"
  26188. }));
  26189. Math.abs(r) < .01 && (r = 0),
  26190. Math.abs(o) < .01 && (o = 0);
  26191. var a = o;
  26192. o = N.call(this, o),
  26193. r = -r;
  26194. var s = a > 0 ? "UP" : "DOWN";
  26195. if (!r && a && !o)
  26196. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  26197. void (n && n({
  26198. success: !1,
  26199. error: "Already at maximum rotation in direction: " + s
  26200. }));
  26201. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  26202. var l = o;
  26203. o = c.Math.degToRad(o),
  26204. r = c.Math.degToRad(r),
  26205. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  26206. this.player.getDirection(e),
  26207. t.copy(e).applyAxisAngle(I.UP, r),
  26208. t.applyAxisAngle(I.RIGHT, o);
  26209. var h = (e.angleTo(t),
  26210. r > 0 ? -1 : r < 0 ? 1 : 0)
  26211. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  26212. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  26213. var d = this.controls.activeControl
  26214. , p = function() {
  26215. d.stopRotating(!0),
  26216. n && n({
  26217. success: !0,
  26218. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  26219. })
  26220. };
  26221. d.startRotating(h, u),
  26222. P.start(r, o, this.player, p)
  26223. }
  26224. }
  26225. }(),
  26226. panCamera: function(e, t) {
  26227. function i(e) {
  26228. switch (r.removeAllListeners(T.AutoPanComplete),
  26229. r.removeAllListeners(T.AutoPanInterrupt),
  26230. r.removeAllListeners(T.AutoPanClamped),
  26231. e) {
  26232. case T.AutoPanInterrupt:
  26233. t({
  26234. success: !0,
  26235. message: "Camera panning interrupted."
  26236. });
  26237. break;
  26238. case T.AutoPanClamped:
  26239. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  26240. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  26241. return void t({
  26242. success: !1,
  26243. error: "Already at edge of current model bounds."
  26244. });
  26245. var i = "The view point is outside the bounds for the current model. ";
  26246. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  26247. console.warn(i)
  26248. }
  26249. case T.AutoPanComplete:
  26250. t({
  26251. success: !0,
  26252. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  26253. })
  26254. }
  26255. }
  26256. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  26257. return t({
  26258. success: !1,
  26259. error: "Camera panning is not available in the current mode: " + this.player.mode
  26260. });
  26261. var n = e.position
  26262. , r = this.player.control;
  26263. r.setAutoPanPosition(n.x, n.z),
  26264. r.autoPan = !0;
  26265. var o = function(e, t) {
  26266. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  26267. };
  26268. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  26269. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  26270. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  26271. },
  26272. click: function(e, t) {
  26273. var i = e.x
  26274. , n = e.y
  26275. , r = e.percentage;
  26276. r === !0 && (i = i / 100 * $("#player").width(),
  26277. n = n / 100 * $("#player").height()),
  26278. this.player.handleInputStart(i, n),
  26279. this.player.updateIntersect(),
  26280. this.player.handleInputEnd(i, n)
  26281. },
  26282. mouseOver: function(e, t) {
  26283. var i = e.x
  26284. , n = e.y
  26285. , r = e.percentage;
  26286. r === !0 && (i = i / 100 * $("#player").width(),
  26287. n = n / 100 * $("#player").height()),
  26288. this.player.handleInputMove(i, n),
  26289. this.player.updateIntersect()
  26290. },
  26291. moveToMode: function(e, t) {
  26292. function i(e) {
  26293. t(e ? {
  26294. success: !1,
  26295. error: "Failed to load new mode: " + e
  26296. } : {
  26297. success: !0,
  26298. message: "Moved to new mode: " + n
  26299. })
  26300. }
  26301. var n = e.mode;
  26302. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  26303. i()
  26304. }, function(e) {
  26305. i(e)
  26306. }) : t({
  26307. success: !1,
  26308. error: "Invalid mode selection"
  26309. })
  26310. }
  26311. }
  26312. }
  26313. ).call(this, "/js/sdk/automation.js")
  26314. }
  26315. , {
  26316. "../constants": 8,
  26317. "../enum/AlignmentType": 17,
  26318. "../enum/ControlEvents": 21,
  26319. "../enum/Direction": 22,
  26320. "../enum/GLCubeFaces": 25,
  26321. "../enum/Keys": 30,
  26322. "../enum/ModelManagerEvents": 33,
  26323. "../enum/PlayerEvents": 40,
  26324. "../enum/RenderLayers": 41,
  26325. "../enum/Vectors": 50,
  26326. "../enum/Viewmode": 51,
  26327. "../enum/WarpStyle": 52,
  26328. "../lib/jpeg_encoder": 94,
  26329. "../sdk/SdkEvents": 161,
  26330. "../settings": 166,
  26331. "../util/common": 185,
  26332. "../util/logger": 189,
  26333. "../util/math": 190,
  26334. "../util/panorama": 191,
  26335. "./ApiHost": 159,
  26336. "./PostMessageType": 160,
  26337. "./TransitionStyles": 162,
  26338. three: 217
  26339. }],
  26340. 165: [function(e, t, i) {
  26341. "use strict";
  26342. function n(e) {
  26343. this.sourceWindow = e,
  26344. this.targetWindow = null,
  26345. this.targetOrigin = null,
  26346. this.id = Math.floor(1e5 * Math.random()),
  26347. this.bindEvents()
  26348. }
  26349. var r = e("./PostMessageType")
  26350. , o = e("events").EventEmitter;
  26351. n.prototype = Object.create(o.prototype),
  26352. n.prototype.bindEvents = function() {
  26353. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  26354. }
  26355. ,
  26356. n.prototype.setTarget = function(e, t) {
  26357. this.targetWindow = e,
  26358. this.targetOrigin = t
  26359. }
  26360. ,
  26361. n.prototype.onPostmessageReceived = function(e) {
  26362. var t = e.origin || e.originalEvent.origin
  26363. , i = e.source;
  26364. switch (e.data.type) {
  26365. case r.CONNECT:
  26366. break;
  26367. case r.RESPONSE:
  26368. if (this.id !== e.data.toId)
  26369. return;
  26370. default:
  26371. if (!this.validateMessageOrigin(t))
  26372. return
  26373. }
  26374. var n = e.data;
  26375. n.source = i,
  26376. n.origin = t,
  26377. n.timestamp = Date.now(),
  26378. this.emit(e.data.type, n)
  26379. }
  26380. ,
  26381. n.prototype.validateMessageOrigin = function(e) {
  26382. return "*" === this.targetOrigin || e === this.targetOrigin
  26383. }
  26384. ,
  26385. n.prototype.send = function(e) {
  26386. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  26387. this.targetWindow.postMessage(e, this.targetOrigin))
  26388. }
  26389. ,
  26390. t.exports = n
  26391. }
  26392. , {
  26393. "./PostMessageType": 160,
  26394. events: 202
  26395. }],
  26396. 166: [function(e, t, i) {
  26397. "use strict";
  26398. var n = e("three")
  26399. , r = e("./util/browser")
  26400. , o = e("./enum/Viewmode")
  26401. , a = e("./enum/VROption")
  26402. , s = e("./enum/Colors")
  26403. , l = e("./enum/WarpStyle")
  26404. , c = e("./util/easing")
  26405. , h = e("./util/common")
  26406. , u = e("./util/showcase")
  26407. , d = e("./constants")
  26408. , p = {
  26409. debug: !1,
  26410. version: "2.25.6-0-gd87e5b1",
  26411. languageTag: r.valueFromHash("lang", null),
  26412. pageTitle: "四维虚拟漫游",
  26413. authorizationHeader: u.getAuthorizationHeader(),
  26414. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  26415. logLevel: r.valueFromHash("log", 2),
  26416. skyboxRadius: 2500,
  26417. modelBoundsPadding: 5,
  26418. showNeighbors: !1,
  26419. brand: r.valueFromHash("brand", !0),
  26420. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  26421. startHighlights: r.valueFromHash("hl", -1),
  26422. specialEdition: r.valueFromHash("bn", 0),
  26423. useWheel: r.valueFromHash("wh", !0),
  26424. crossOrigin: "anonymous",
  26425. fancierTransition: !1,
  26426. wireframe: !1,
  26427. skyboxWireframe: !1,
  26428. modelAlpha: 1,
  26429. highlightPanoSelection: !1,
  26430. showSweeps: !0,
  26431. showSkyboxes: !1,
  26432. showMesh: !0,
  26433. showFloors: !1,
  26434. showFloorDuration: 300,
  26435. showFloorDelay: 300,
  26436. hideFloorDuration: 300,
  26437. hideFloorDelay: 0,
  26438. reticuleOpacityTransitionTime: 250,
  26439. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26440. markerOpacityTransitionTime: 500,
  26441. guiAnimationSpeed: 250,
  26442. highlightAnimationDuration: 500,
  26443. modelComponentLoadSpinnerDelay: 150,
  26444. captureErrors: !1,
  26445. maxMobileTextures: 6,
  26446. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  26447. startupFlyinDelay: 3e3,
  26448. dollhouseDefault: {
  26449. minDistance: 15,
  26450. maxDistance: 50,
  26451. minPolarAngle: n.Math.degToRad(10),
  26452. maxPolarAngle: n.Math.degToRad(90)
  26453. },
  26454. hideReticuleTimeout: 1e3,
  26455. analytics: {
  26456. inactivityThreshold: 30,
  26457. sessionTrackingRate: .15,
  26458. maxTrackedErrors: 20,
  26459. sessionDurationPingFrequency: 10,
  26460. sessionDurationTimeout: 15
  26461. },
  26462. flydown: {
  26463. movementEasing: "easeInOutQuad",
  26464. movementDelay: .001,
  26465. rotationEasing: "easeInOutQuad",
  26466. rotationDelay: .5,
  26467. modelTextureDelay: .75,
  26468. skyboxDelay: .75
  26469. },
  26470. transition: {
  26471. flySpeed: .001,
  26472. flyTime: 750,
  26473. flytimeMaxDistanceThreshold: 5,
  26474. flytimeDistanceMultiplier: 150,
  26475. aimTime: 1500,
  26476. aimSlowFactor: 1.5,
  26477. blur: 0.8,
  26478. movementEasing: "easeInOutQuad",
  26479. blendEasing: "easeInOutQuad",
  26480. fastForwardFactor: 4,//r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  26481. },
  26482. show360Views: {
  26483. enabled: !0,
  26484. transitionTime: 1e3
  26485. },
  26486. quickstart: {
  26487. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  26488. animation: 1400,
  26489. showTextDelay: 500,
  26490. fadeOutDelay: 3e3,
  26491. fovChange: 10
  26492. },
  26493. appConfig: {
  26494. webvr_version: null,
  26495. segment_key: null,
  26496. embedly_key: null,
  26497. branch_key: null,
  26498. keen_write_key: null,
  26499. keen_project_id: null
  26500. },
  26501. vr: {
  26502. enabled: !0,
  26503. allowWebVR: !1,
  26504. option: r.valueFromHash("vr", a.CONTEXTUAL)
  26505. },
  26506. share: {
  26507. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  26508. },
  26509. input: {
  26510. longTapThreshold: 200,
  26511. moveToleranceNDC: 0.01,//.08,
  26512. touchMoveThreshold: 25
  26513. },
  26514. help: {
  26515. modalStayDuration: 600
  26516. },
  26517. immersive: {
  26518. timeToShowAgain: 1250,
  26519. uiStayDuration: 600
  26520. },
  26521. tourInteraction: {
  26522. disabled: "0" === r.valueFromHash("tourcta", null),
  26523. showPauseButton: 1e3,
  26524. showModal: 1500,
  26525. allowNextClick: 200,
  26526. largeModal: "1" === r.valueFromHash("tourcta", null),
  26527. smallModal: "2" === r.valueFromHash("tourcta", null)
  26528. },
  26529. labels: {
  26530. enabled: !1,
  26531. hideUntilStart: !0,
  26532. fadeInDuration: 250,
  26533. fadeInDelay: 250,
  26534. fadeOutDuration: 250,
  26535. fadeOutDelay: 0,
  26536. zoomHideThreshhold: {
  26537. mobile: r.isSmallScreen() ? .45 : .6,
  26538. desktop: 2
  26539. },
  26540. zoomTruncateThreshhold: {
  26541. mobile: r.isSmallScreen() ? .35 : .45,
  26542. desktop: .85
  26543. },
  26544. minLengthForTruncate: 16,
  26545. truncateLength: 12,
  26546. truncateSuffix: "..."
  26547. },
  26548. tags: {
  26549. enabled: r.valueFromHash("mt", 1),
  26550. startup: {
  26551. hideUntilStart: !0,
  26552. fadeInDuration: 500,
  26553. fadeInDelay: 100
  26554. },
  26555. visibility: {
  26556. anyDistance: !0,
  26557. visibleDistance: 8,
  26558. cameraClearance: .1,
  26559. alphaTestLevel: .05,
  26560. hideViaFloor: !0,
  26561. hideOffScreenDisc: !1,
  26562. hideOffScreenObject: !1
  26563. },
  26564. disc: {
  26565. opacity: 1,
  26566. disabledOpacity: .5,
  26567. scale: {
  26568. nearBound: 1.5,
  26569. farBound: 4.8,
  26570. linkFarBound: !1,
  26571. linkPercent: 40,
  26572. maxSize: 80,
  26573. minSize: 40,
  26574. baseViewportSize: 800,
  26575. responsiveness: 100
  26576. }
  26577. },
  26578. pole: {
  26579. enabled: !0,
  26580. height: .5,
  26581. width: 2,
  26582. opacity: .5,
  26583. color: "white"
  26584. },
  26585. navigate: {
  26586. nearestPano: !0,
  26587. lineOfSight: !0,
  26588. reactivate: !0,
  26589. aimAt: "disc",
  26590. tiltTolerance: 25,
  26591. rotateSpeedFactor: .6
  26592. }
  26593. },
  26594. path: {
  26595. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26596. colorUp: s._desat(s.newBlue, .5),
  26597. colorDown: s._darken(s.newBlue, .35),
  26598. opacity: .5,
  26599. style: "ribbon",
  26600. height: .025,
  26601. ribbonWidth: .24,
  26602. outsideHeight: .5,
  26603. waypointRadius: .5,
  26604. waypointIndoorRadius: .24,
  26605. waypointPulse: 1e3,
  26606. typ: l.BLACK,
  26607. meshFree: r.valueFromHash("mf", 1),
  26608. mapGuides: r.valueFromHash("guides", !0),
  26609. fadeInTime: 400,
  26610. fadeOutTime: 300
  26611. },
  26612. warp: {
  26613. nearPanoDist: .1,
  26614. matchCam: !1,
  26615. blur: .33,
  26616. fastTime: 1500,
  26617. teleportTime: 1500,//瞬间过渡的时间
  26618. flytimeDistanceMultiplier:150,//add
  26619. flyTime:750,//add
  26620. outsideTime: 2e3,
  26621. lookAheadMax: .3,
  26622. lookAheadDist: 2.5,
  26623. softPushDist: .37,
  26624. softPushEnd: .3,
  26625. softBendAngle: 8,
  26626. softBendTilt: 4,
  26627. softBendEnd: .3,
  26628. doBurns: true, //r.valueFromHash("kb", !0),
  26629. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26630. minBurnsAngle: 35,
  26631. minDownAngle: -35,
  26632. maxTurnPerSec: 280,
  26633. maxAimPerSec: 35,
  26634. minRotation: 12,
  26635. maxAimRotation: 33.2,
  26636. turnFriction: .2,
  26637. flySpeed: .01,
  26638. minWarpTime: 1200,
  26639. warpInterruptionRedirectTime: 500,
  26640. tourStepDelay: r.valueFromHash("st", 0),
  26641. walkDelay: 0,
  26642. walkMaxDist: 50,
  26643. walkMinDist: .8,
  26644. walkSlideShowThreshhold: 3000,
  26645. walkExtraPanosDistance: .4,
  26646. timePerMeter: 1200,
  26647. motionLeadTime: 5000,
  26648. movementEasing: "easeInOutQuad",
  26649. blendEasing: "easeInOutQuad",
  26650. showBunny: !1,
  26651. loop: r.valueFromHash("lp", !1),
  26652. auto: r.valueFromHash("ts", -1),
  26653. eOrder: 'YXZ', //"YXZ",
  26654. stepFactor: .25,
  26655. brakeStrength: 2,
  26656. minBrakeAngle: .1,
  26657. maxBrakeAngle: 1.8,
  26658. climbEffort: 4
  26659. },
  26660. rotationFriction: .05,
  26661. rotationAccelerationInside: 4.5,
  26662. rotationAccelerationOutside: .15,
  26663. rotationAfterMoveMultiplier: 40,
  26664. rotationAfterMoveHistoryCount: 5,
  26665. panFriction: .09,
  26666. panAccelerationOutside: 60,
  26667. onload: r.valueFromHash("onload", o.PANORAMA),
  26668. zoomNearLimit: .1,
  26669. zoomFarLimit: 50,
  26670. navigation: {
  26671. panoScores: !1,
  26672. mouseDirection: !0,
  26673. filterStrictness: .75,
  26674. angleFactor: -30,
  26675. directionFactor: 10,
  26676. distanceFactor: -1,
  26677. optionalityFactor: 3
  26678. },
  26679. sdkInit: !1,
  26680. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26681. console: r.valueFromHash("console", !1),
  26682. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  26683. panoramaNeighbourMaxDistance: 5,
  26684. panoFloorClickRadius: .35,
  26685. showScreenshotLocations: !1,
  26686. showAxis: !1,
  26687. showNeighbourRaycasts: !1,
  26688. colorMarkerOnLoad: !1,
  26689. colorMarkerByFloor: !1,
  26690. tiling: {
  26691. panoPreRenderRepeatDelay: 2500,
  26692. panoPreRenderDelay: 500,
  26693. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  26694. tilingFlagNames: ["usetiles", "tiles"],
  26695. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  26696. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  26697. overlayStyle: r.valueFromHash("tileoverlay", 0),
  26698. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  26699. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  26700. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 1/* 2 */),
  26701. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  26702. customCompression: r.valueFromHash("tilecustcomp", 0),
  26703. // mobileHighQualityOverride: !1,
  26704. mobileHighQualityOverride: 1,
  26705. allowUltraHighResolution: true
  26706. },
  26707. zoom: {
  26708. enabled: true,
  26709. forceOff: r.valueFromHash("nozoom", 0),
  26710. overridemax: r.valueFromHash("maxzoom", null),
  26711. overridemin: r.valueFromHash("minzoom", null),
  26712. max: d.highQualityMaxZoom,
  26713. min: 1,
  26714. transitionStyle: r.valueFromHash("zoomtrans", 1),
  26715. activationThreshold: 1.1,
  26716. restoreTime: 500
  26717. },
  26718. profiling: {
  26719. enabled: r.valueFromHash("mem", !1)
  26720. }
  26721. };
  26722. p = h.deepExtend(p, d, {
  26723. insideFOV: r.valueFromHash("fov", d.insideFOV),
  26724. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  26725. panorama: {
  26726. transitionTime: 1e3,
  26727. modelAlpha: 0,
  26728. modelAlphaDelay: p.flydown.modelTextureDelay,
  26729. modelAlphaLength: 1,
  26730. skyboxOpacity: 1,
  26731. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26732. skyboxOpacityLength: .9,
  26733. fovLength: 1,
  26734. fovDelay: 0,
  26735. cameraMatrixDuration: .8,
  26736. cameraMatrixDelay: 0,
  26737. cameraMatrixEase: c.easeInCubic,
  26738. reticuleOpacity: 1,
  26739. markerOpacity: .3,
  26740. markerOpacityOnHover: 1
  26741. },
  26742. dollhouse: {
  26743. transitionTime: 1e3,
  26744. modelAlpha: 1,
  26745. modelAlphaDelay: 0,
  26746. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26747. skyboxOpacity: 0,
  26748. skyboxOpacityDelay: 0,
  26749. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26750. fovLength: 1,
  26751. fovDelay: 0,
  26752. cameraMatrixDuration: .8,
  26753. cameraMatrixDelay: .3,
  26754. cameraMatrixEase: c.easeInCubic,
  26755. reticuleOpacity: 1,
  26756. markerOpacity: 0,
  26757. markerOpacityOnHover: 0
  26758. },
  26759. floorplan: {
  26760. transitionTime: 1e3,
  26761. modelAlpha: 1,
  26762. modelAlphaDelay: 0,
  26763. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26764. skyboxOpacity: 0,
  26765. skyboxOpacityDelay: 0,
  26766. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26767. fovLength: 1,
  26768. fovDelay: 0,
  26769. cameraMatrixDuration: .5,
  26770. cameraMatrixDelay: 0,
  26771. cameraMatrixEase: c.easeOutCubic,
  26772. reticuleOpacity: 1,
  26773. markerOpacity: 0,
  26774. markerOpacityOnHover: 0,
  26775. cameraHeight: 50
  26776. },
  26777. transitioning: {
  26778. reticuleOpacity: 0,
  26779. markerOpacity: .3,
  26780. markerOpacityOnHover: 1
  26781. },
  26782. "floorplan-dollhouse": {
  26783. rotationDelay: 0,
  26784. rotationDuration: 1
  26785. },
  26786. "floorplan-panorama": {
  26787. rotationDelay: .5,
  26788. rotationDuration: 1
  26789. },
  26790. "dollhouse-panorama": {
  26791. rotationDelay: .5,
  26792. rotationDuration: 1
  26793. },
  26794. "dollhouse-floorplan": {
  26795. rotationDelay: 0,
  26796. rotationDuration: 1,
  26797. cameraMatrixDuration: 1.05,
  26798. cameraMatrixDelay: .5
  26799. },
  26800. "panorama-dollhouse": {
  26801. rotationDelay: 0,
  26802. rotationDuration: .5
  26803. },
  26804. "panorama-floorplan": {
  26805. transitionTime: 1500,
  26806. rotationDelay: 0,
  26807. rotationDuration: .5
  26808. }
  26809. }),
  26810. p.path.meshFree && (p.path.typ = l.WALK),
  26811. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  26812. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  26813. window._settings = t.exports = p
  26814. }
  26815. , {
  26816. "./constants": 8,
  26817. "./enum/Colors": 19,
  26818. "./enum/VROption": 47,
  26819. "./enum/Viewmode": 51,
  26820. "./enum/WarpStyle": 52,
  26821. "./util/browser": 182,
  26822. "./util/common": 185,
  26823. "./util/easing": 186,
  26824. "./util/showcase": 193,
  26825. three: 217
  26826. }],
  26827. 167: [function(e, t, i) {
  26828. "use strict";
  26829. var n = e("three")
  26830. , r = e("./settings")
  26831. , 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"
  26832. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  26833. t.exports = {
  26834. basicTextured: {
  26835. uniforms: {
  26836. tDiffuse: {
  26837. type: "t",
  26838. value: null
  26839. },
  26840. alpha: {
  26841. type: "f",
  26842. value: 1
  26843. }
  26844. },
  26845. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  26846. 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}"
  26847. },
  26848. copyCubeMap: {
  26849. uniforms: {
  26850. tDiffuse: {
  26851. type: "t",
  26852. value: null
  26853. },
  26854. alpha: {
  26855. type: "f",
  26856. value: 1
  26857. }
  26858. },
  26859. 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}",
  26860. 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}"
  26861. },
  26862. cube: {
  26863. uniforms: {
  26864. map: {
  26865. type: "t",
  26866. value: null
  26867. },
  26868. opacity: {
  26869. type: "f",
  26870. value: 1
  26871. }
  26872. },
  26873. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  26874. 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"
  26875. },
  26876. model: {
  26877. uniforms: {
  26878. map: {
  26879. type: "t",
  26880. value: null
  26881. },
  26882. modelAlpha: {
  26883. type: "f",
  26884. value: r.modelAlpha
  26885. },
  26886. opacity: {
  26887. type: "f",
  26888. value: 1
  26889. },
  26890. progress: {
  26891. type: "f",
  26892. value: 0
  26893. },
  26894. blackout: {
  26895. type: "i",
  26896. value: 0
  26897. },
  26898. pano0Map: {
  26899. type: "t",
  26900. value: null
  26901. },
  26902. pano0Position: {
  26903. type: "v3",
  26904. value: new n.Vector3
  26905. },
  26906. pano0Matrix: {
  26907. type: "m4",
  26908. value: new n.Matrix4
  26909. },
  26910. pano1Map: {
  26911. type: "t",
  26912. value: null
  26913. },
  26914. pano1Position: {
  26915. type: "v3",
  26916. value: new n.Vector3
  26917. },
  26918. pano1Matrix: {
  26919. type: "m4",
  26920. value: new n.Matrix4
  26921. }
  26922. },
  26923. vertexShader: o + `uniform vec3 pano0Position;
  26924. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26925. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26926. varying vec3 vWorldPosition0;
  26927. varying vec3 vWorldPosition1;
  26928. uniform int blackout;
  26929. void main() {
  26930. vUv = uv;
  26931. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26932. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26933. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26934. vWorldPosition0.x *= -1.0;
  26935. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26936. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26937. vWorldPosition1.x *= -1.0;
  26938. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26939. }`,
  26940. fragmentShader: a + `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26941. 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
  26942. void main() {
  26943. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26944. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26945. vec4 colorFromPanos;
  26946. if (blackout == 5){//add for TransitionPass
  26947. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26948. }else{
  26949. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26950. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26951. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26952. else if (blackout == 1) {
  26953. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26954. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26955. }
  26956. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26957. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26958. }
  26959. //#ifdef useModelMap //起不了作用为啥
  26960. if(modelAlpha>0.0){
  26961. vec4 colorFromTexture = texture2D( map, vUv );
  26962. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26963. }
  26964. //#endif
  26965. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26966. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26967. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26968. }`
  26969. },
  26970. hot:{
  26971. uniforms:{
  26972. color:{
  26973. type: "c",
  26974. value: new n.Color( 0xff2200 )
  26975. },
  26976. opac:{
  26977. type: "f",
  26978. value: 0
  26979. },
  26980. texture1:{
  26981. type: "t",
  26982. value: null
  26983. },
  26984. texture2:{
  26985. type: "t",
  26986. value: null
  26987. }
  26988. },
  26989. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  26990. 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"
  26991. },
  26992. modelOutside: {
  26993. uniforms: {
  26994. map: {
  26995. type: "t",
  26996. value: null
  26997. },
  26998. opacity: {
  26999. type: "f",
  27000. value: 1
  27001. }
  27002. },
  27003. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  27004. 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"
  27005. },
  27006. ribbon: {
  27007. uniforms: {
  27008. map: {
  27009. type: "t",
  27010. value: null
  27011. },
  27012. opacity: {
  27013. type: "f",
  27014. value: 1
  27015. },
  27016. color: {
  27017. type: "c",
  27018. value: new n.Color(r.path.color)
  27019. }
  27020. },
  27021. 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",
  27022. 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"
  27023. },
  27024. waypoint: {
  27025. uniforms: {
  27026. map: {
  27027. type: "t",
  27028. value: null
  27029. },
  27030. opacity: {
  27031. type: "f",
  27032. value: 1
  27033. },
  27034. pulse: {
  27035. type: "f",
  27036. value: 1
  27037. },
  27038. nearFade: {
  27039. type: "v2",
  27040. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  27041. },
  27042. color: {
  27043. type: "c",
  27044. value: new n.Color(r.reticuleColor)
  27045. }
  27046. },
  27047. 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",
  27048. 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"
  27049. },
  27050. modelDebug: {
  27051. uniforms: {
  27052. map: {
  27053. type: "t",
  27054. value: null
  27055. },
  27056. modelAlpha: {
  27057. type: "f",
  27058. value: r.modelAlpha
  27059. },
  27060. depthmapRatio: {
  27061. type: "f",
  27062. value: 0
  27063. },
  27064. opacity: {
  27065. type: "f",
  27066. value: 1
  27067. },
  27068. progress: {
  27069. type: "f",
  27070. value: 0
  27071. },
  27072. considerOcclusion: {
  27073. type: "i",
  27074. value: r.fancierTransition
  27075. },
  27076. highlightPanoSelection: {
  27077. type: "i",
  27078. value: 0
  27079. },
  27080. useThirdPano: {
  27081. type: "i",
  27082. value: r.useThirdPano
  27083. },
  27084. pano0Map: {
  27085. type: "t",
  27086. value: null
  27087. },
  27088. pano0Depth: {
  27089. type: "t",
  27090. value: null
  27091. },
  27092. pano0Position: {
  27093. type: "v3",
  27094. value: new n.Vector3
  27095. },
  27096. pano0Matrix: {
  27097. type: "m4",
  27098. value: new n.Matrix4
  27099. },
  27100. pano0Weight: {
  27101. type: "f",
  27102. value: r.transition.pano0Weight
  27103. },
  27104. pano1Map: {
  27105. type: "t",
  27106. value: null
  27107. },
  27108. pano1Depth: {
  27109. type: "t",
  27110. value: null
  27111. },
  27112. pano1Position: {
  27113. type: "v3",
  27114. value: new n.Vector3
  27115. },
  27116. pano1Matrix: {
  27117. type: "m4",
  27118. value: new n.Matrix4
  27119. },
  27120. pano1Weight: {
  27121. type: "f",
  27122. value: r.transition.pano1Weight
  27123. },
  27124. pano2Map: {
  27125. type: "t",
  27126. value: null
  27127. },
  27128. pano2Depth: {
  27129. type: "t",
  27130. value: null
  27131. },
  27132. pano2Position: {
  27133. type: "v3",
  27134. value: new n.Vector3
  27135. },
  27136. pano2Matrix: {
  27137. type: "m4",
  27138. value: new n.Matrix4
  27139. },
  27140. pano2Weight: {
  27141. type: "f",
  27142. value: r.transition.pano2Weight
  27143. }
  27144. },
  27145. 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",
  27146. 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"
  27147. },
  27148. customDepth: {
  27149. uniforms: {
  27150. panoPosition: {
  27151. type: "v3",
  27152. value: new n.Vector3
  27153. }
  27154. },
  27155. 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",
  27156. 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"
  27157. },
  27158. skysphere: {
  27159. uniforms: {
  27160. radius: {
  27161. type: "f",
  27162. value: 0
  27163. }
  27164. },
  27165. 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",
  27166. 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"
  27167. },
  27168. tagDisc: {
  27169. uniforms: {
  27170. opacity: {
  27171. type: "f",
  27172. value: 0
  27173. },
  27174. color: {
  27175. type: "c",
  27176. value: new n.Color
  27177. },
  27178. bg: {
  27179. type: "t",
  27180. value: null
  27181. },
  27182. mask: {
  27183. type: "t",
  27184. value: null
  27185. }
  27186. },
  27187. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  27188. 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"
  27189. }
  27190. }
  27191. }
  27192. , {
  27193. "./settings": 166,
  27194. three: 217
  27195. }],
  27196. 168: [function(e, t, i) {
  27197. (function(i) {
  27198. "use strict";
  27199. var n = e("three")
  27200. , r = (e("url"),
  27201. e("./util/ajax"))
  27202. , o = e("./settings")
  27203. , a = e("./util/logger")
  27204. , s = e("./util/math")
  27205. , l = e("./util/showcase")
  27206. , c = e("./objects/Panorama")
  27207. , h = new a(i)
  27208. , u = e("./model/Model")
  27209. , d = e("./shaders")
  27210. , p = e("./util/transitions")
  27211. , f = e("./objects/Chunk")
  27212. , g = e("./objects/Reticule")
  27213. , m = e("./objects/Skybox")
  27214. , v = e("./objects/Floor")
  27215. , A = e("./cameras/DollhouseCamera")
  27216. , y = e("./cameras/FloorplanCamera")
  27217. , C = e("./cameras/PanoramaCamera")
  27218. , I = e("./controls/DollhouseControls")
  27219. , E = e("./controls/FloorplanControls")
  27220. , b = e("./controls/PanoramaControls");
  27221. n.ImageUtils.crossOrigin = o.crossOrigin,
  27222. t.exports = {
  27223. shaders: d,
  27224. transitions: p,
  27225. Model: u,
  27226. Chunk: f,
  27227. Floor: v,
  27228. Skybox: m,
  27229. Reticule: g,
  27230. Panorama: c,
  27231. DollhouseCamera: A,
  27232. FloorplanCamera: y,
  27233. PanoramaCamera: C,
  27234. DollhouseControls: I,
  27235. FloorplanControls: E,
  27236. PanoramaControls: b,
  27237. getModel: function(e) {
  27238. if (!e.url)
  27239. throw 'getModel(): missing parameter "url"';
  27240. e.autoload = void 0 === e.autoload || e.autoload;
  27241. var t = l.parseSidUrl(e.url);
  27242. e.urlBase = t.urlBase,
  27243. e.urlModel = t.urlModel,
  27244. e.urlFiles = t.urlFiles;
  27245. var i = this._getPlatformError();
  27246. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  27247. this._loadModel().then(this._buildModel.bind(this)))
  27248. },
  27249. _getPlatformError: function() {
  27250. 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"
  27251. },
  27252. _loadModel: function() {
  27253. return r.get(this.options.urlModel, {
  27254. responseType: "json",
  27255. prefetchFrom: "model",
  27256. auth: l.getAuthorizationHeader()
  27257. }).then(null, function() {
  27258. return h.warn("Model loading failed at initial metadata load"),
  27259. "loading-failed"
  27260. })
  27261. },
  27262. _buildModel: function(e) {
  27263. e = l.normalizeModeldata(e, s);
  27264. var t = new u(this.options,e);
  27265. return this.options.autoload ? t.load(!0) : $.when(t)
  27266. }
  27267. }
  27268. }
  27269. ).call(this, "/js/showcase.js")
  27270. }
  27271. , {
  27272. "./cameras/DollhouseCamera": 5,
  27273. "./cameras/FloorplanCamera": 6,
  27274. "./cameras/PanoramaCamera": 7,
  27275. "./controls/DollhouseControls": 10,
  27276. "./controls/FloorplanControls": 11,
  27277. "./controls/PanoramaControls": 13,
  27278. "./model/Model": 139,
  27279. "./objects/Chunk": 144,
  27280. "./objects/Floor": 146,
  27281. "./objects/Panorama": 148,
  27282. "./objects/Reticule": 149,
  27283. "./objects/Skybox": 152,
  27284. "./settings": 166,
  27285. "./shaders": 167,
  27286. "./util/ajax": 181,
  27287. "./util/logger": 189,
  27288. "./util/math": 190,
  27289. "./util/showcase": 193,
  27290. "./util/transitions": 195,
  27291. three: 217,
  27292. url: 208
  27293. }],
  27294. 169: [function(e, t, i) {
  27295. "use strict";
  27296. function n() {
  27297. var e = {
  27298. renderTarget: null,
  27299. inUse: !1,
  27300. size: -1,
  27301. pano: null
  27302. };
  27303. return e
  27304. }
  27305. function r(e) {
  27306. M.push(e)
  27307. }
  27308. function o(e) {
  27309. var t = n();
  27310. return t.inUse = !0,
  27311. t.size = e,
  27312. r(t),
  27313. t
  27314. }
  27315. function a(e) {
  27316. for (var t = 0; t < M.length; t++) {
  27317. var i = M[t];
  27318. if (!i.inUse && i.size === e)
  27319. return i.inUse = !0,
  27320. i
  27321. }
  27322. return null
  27323. }
  27324. function s(e) {
  27325. for (var t = 0; t < M.length; t++) {
  27326. var i = M[t];
  27327. if (i.renderTarget === e)
  27328. return i.inUse = !1,
  27329. !0
  27330. }
  27331. return !1
  27332. }
  27333. function l() {
  27334. this.tileDirectory = {},
  27335. this.activeRenderTargetDescriptors = {},
  27336. this.activePanos = [],
  27337. this.panoLODDescriptors = {},
  27338. this.panoDescriptors = {},
  27339. this.tileTrees = {},
  27340. this.sceneRenderer = null,
  27341. this.tileDownloader = null,
  27342. this.forceQueue = [],
  27343. this.uploadQueues = {},
  27344. this.uploadInterval = null,
  27345. this.uploadIntervalCancelled = !1,
  27346. this.usingTileOverlay = !1,
  27347. this.overlayTilesLoaded = !1,
  27348. this.overlayTileBase = null,
  27349. this.overlayTilesBasic = {},
  27350. this.overlayTilesEnhanced = {},
  27351. this.zoomRenderTarget = null,
  27352. this.zoomPano = null,
  27353. this.zoomingActive = !1,
  27354. this.zoomPanoId = null,
  27355. this.zoomPanoRenderingDisabled = !1,
  27356. this.direction = new h.Vector3,
  27357. this.initTime = -1,
  27358. this.maxBaseUploadsPerFrame = x,
  27359. this.maxNonBaseUploadsPerFrame = T
  27360. }
  27361. function c() {
  27362. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27363. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27364. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27365. }
  27366. /* function c() {
  27367. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27368. this.updateUploadQueue(1, 2),
  27369. w = 18,
  27370. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27371. } */
  27372. var h = e("three")
  27373. , u = e("../exception/BasicException")
  27374. , d = e("../settings")
  27375. , p = e("../enum/PanoSizeClass")
  27376. , f = (e("../objects/Panorama"),
  27377. e("../enum/PanoRendererEvents"))
  27378. , g = e("../enum/SceneRendererEvents")
  27379. , m = e("../enum/TileDownloaderEvents")
  27380. , v = e("../enum/Vectors")
  27381. , A = (e("../enum/GLCubeFaces"),
  27382. e("../objects/Panorama"),
  27383. e("./TileTree"))
  27384. , y = (e("./TileDownloader"),
  27385. e("./TilePrioritizer"))
  27386. , C = e("./TileUtils")
  27387. , p = e("../enum/PanoSizeClass")
  27388. , I = (e("../util/browser"),
  27389. e("../util/panorama"))
  27390. , E = e("events").EventEmitter
  27391. , b = !1
  27392. , w = d.tiling.uploadIntervalDelay
  27393. , _ = d.tiling.initialIntervalDelay
  27394. , T = d.tiling.maxNonBaseUploadsPerFrame
  27395. , x = d.tiling.maxBaseUploadsPerFrame
  27396. , S = {
  27397. Base: 0,
  27398. Remaining: 1
  27399. }
  27400. ,M = [];
  27401. window.targetList = M
  27402. l.prototype = Object.create(E.prototype),
  27403. l.prototype.init = function(e, t, i) {
  27404. this.sceneRenderer = e,
  27405. this.tileDownloader = t,
  27406. this.qualityManager = i,
  27407. this.bindEvents(),
  27408. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27409. this.initTime = performance.now()
  27410. }
  27411. ,
  27412. l.prototype.getActivePanoTextures = function(e) {
  27413. e = e || [];
  27414. for (var t = 0; t < M.length; t++) {
  27415. var i = M[t];
  27416. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27417. }
  27418. }
  27419. ,
  27420. l.prototype.hasQueuedTiles = function() {
  27421. var e = this.peekNextFromUploadQueue();
  27422. return null !== e && void 0 !== e
  27423. }
  27424. ,
  27425. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  27426. return this.activeRenderTargetDescriptors[e]
  27427. }
  27428. ,
  27429. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  27430. this.activeRenderTargetDescriptors[e] = t
  27431. }
  27432. ,
  27433. l.prototype.loadOverlayTiles = function() {
  27434. if (0 !== d.tiling.overlayStyle) {
  27435. var e = 0
  27436. , t = function(t, n, r) {
  27437. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  27438. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27439. e++,
  27440. e === i.length && (this.overlayTilesLoaded = !0)
  27441. }
  27442. .bind(this)
  27443. , 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)]];
  27444. i.forEach(function(e) {
  27445. this.tileDownloader.loadImage(e[0], 0, e[1])
  27446. }
  27447. .bind(this)),
  27448. this.usingTileOverlay = !0
  27449. } else
  27450. this.usingTileOverlay = !1
  27451. }
  27452. ,
  27453. l.prototype.bindEvents = function() {
  27454. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27455. }
  27456. ,
  27457. l.prototype.setupZoomRenderTarget = function() {
  27458. var targets = {};
  27459. return function(){
  27460. if(this.qualityManager.maxRenderTargetSize == '2k' && this.qualityManager.getMaxNavPanoSize()=='2k')return; //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  27461. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27462. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  27463. return;
  27464. var e = this.zoomRenderTarget;
  27465. var size = this.qualityManager.getMaxZoomPanoSize()
  27466. if(size > this.qualityManager.maxRenderTargetSize){
  27467. return
  27468. }
  27469. if(targets[size]){
  27470. this.zoomRenderTarget = targets[size]
  27471. }else{
  27472. this.zoomRenderTarget = this.initTiledPano(size, true )//放大后不使用抗锯齿,否则消耗更多内存
  27473. targets[size] = this.zoomRenderTarget
  27474. }
  27475. if(e) {//将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  27476. var t = e.width
  27477. , i = this.zoomRenderTarget.width;
  27478. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27479. e.texture.dispose(),
  27480. e.texture.loaded = !1,
  27481. e.texture.version = 0,
  27482. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27483. e.texture = null
  27484. }
  27485. this.zoomPanoRenderingDisabled = !1
  27486. } else
  27487. this.zoomPanoRenderingDisabled = !0
  27488. }
  27489. }()
  27490. ,
  27491. l.prototype.enableHighQuality = function(e) {
  27492. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  27493. if (!this.qualityManager.highQualityModeStarted) {
  27494. this.setupZoomRenderTarget()
  27495. e()
  27496. this.qualityManager.highQualityModeStarted = true
  27497. }
  27498. }
  27499. ,
  27500. l.prototype.enableUltraHighQualityMode = function(e) {
  27501. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27502. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  27503. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  27504. t && (this.qualityManager.enableUltraHighQualityMode(),
  27505. this.setupZoomRenderTarget(),
  27506. e())
  27507. }
  27508. .bind(this))
  27509. }
  27510. }
  27511. ,
  27512. l.prototype.activateTiledPano = function(e, t, i) {
  27513. i && this.clearAllQueuedUploads();
  27514. for (var n = 0; n < C.FACES_PER_PANO; n++)
  27515. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  27516. this.linkAllTilesAndNodes(e);
  27517. var r = this.getActiveRenderTargetDescriptor(e.id)
  27518. , l = t;
  27519. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  27520. !r || l !== r.size) {
  27521. if (r && s(r.renderTarget),
  27522. r = a(l),
  27523. !r) {
  27524. var c = this.initTiledPano(l, !browser.isMobile()/* !1 */);
  27525. r = o(c.width),
  27526. r.renderTarget = c
  27527. }
  27528. r.pano = e,
  27529. this.resetPanoDescriptor(e.id),
  27530. this.resetPanoLODDescriptors(e.id),
  27531. this.resetRenderStatus(e.id, !0, !0)
  27532. }
  27533. this.setActiveRenderTargetDescriptor(e.id, r);
  27534. var h = i ? 0 : 1;
  27535. return this.updateActivePanos(e, h),
  27536. r.renderTarget
  27537. }
  27538. ,
  27539. l.prototype.deactivateTiledPano = function(e) {
  27540. var t = this.getActiveRenderTargetDescriptor(e.id);
  27541. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  27542. this.setActiveRenderTargetDescriptor(e.id, null);
  27543. var i = this.getUploadQueueForPano(e.id);
  27544. this.clearUploadQueue(i),
  27545. this.updateActivePanos()
  27546. }
  27547. ,
  27548. l.prototype.updateActivePanos = function() {
  27549. var e = [];
  27550. return function(t, i) {
  27551. e.length = 0;
  27552. for (var n = 0; n < this.activePanos.length; n++) {
  27553. t && e.length === i && e.push(t);
  27554. var r = this.activePanos[n]
  27555. , o = this.getActiveRenderTargetDescriptor(r.id);
  27556. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27557. }
  27558. t && i >= e.length && e.push(t),
  27559. this.activePanos.length = 0,
  27560. this.activePanos.push.apply(this.activePanos, e)
  27561. }
  27562. }(),
  27563. l.prototype.getActivePanoCount = function() {
  27564. return this.activePanos.length
  27565. }
  27566. ,
  27567. l.prototype.resetRenderStatus = function(e, t, i, n) {
  27568. var r = null;
  27569. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  27570. for (var o = function(e, n, r, o) {
  27571. i && (n.tile.zoomUploaded = !1),
  27572. t && (n.tile.uploaded = !1)
  27573. }, a = 0; a < C.FACES_PER_PANO; a++) {
  27574. var s = this.getTileTree(e, a);
  27575. s.breadthFirst({
  27576. callback: o.bind(this, a),
  27577. minLevel: r
  27578. })
  27579. }
  27580. }
  27581. ,
  27582. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  27583. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  27584. t.tile.zoomUploaded = t.tile.uploaded,
  27585. t.zoomCovered = t.covered
  27586. }, n = 0; n < C.FACES_PER_PANO; n++) {
  27587. var r = this.getTileTree(e, n);
  27588. r.breadthFirst({
  27589. callback: i.bind(this, n),
  27590. maxLevel: t
  27591. })
  27592. }
  27593. }
  27594. ,
  27595. l.prototype.renderPanoTiles = function() {
  27596. var e = [];
  27597. return function(t, i, n, r) {
  27598. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27599. i = i || this.direction || v.FORWARD;
  27600. var o = this.getActiveRenderTargetDescriptor(t);
  27601. if (!this.isRenderTargetDescriptorValid(o))
  27602. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  27603. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27604. var s = this.getTileTree(t, a);
  27605. e.length = 0,
  27606. s.breadthFirst({
  27607. saveVisited: e
  27608. });
  27609. for (var l = 0; l < e.length; l++) {
  27610. var c = e[l];
  27611. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  27612. }
  27613. }
  27614. this.updateDirection(i)
  27615. }
  27616. }(),
  27617. l.prototype.isRenderTargetDescriptorValid = function(e) {
  27618. return e && e.renderTarget
  27619. }
  27620. ,
  27621. l.prototype.isPanoActive = function(e) {
  27622. var t = this.getActiveRenderTargetDescriptor(e);
  27623. return this.isRenderTargetDescriptorValid(t)
  27624. }
  27625. ,
  27626. l.prototype.isPanoZoomed = function(e) {
  27627. return this.zoomingActive && this.zoomPanoId === e
  27628. }
  27629. ,
  27630. l.prototype.initTileTree = function(e, t, i) {
  27631. var n = this.tileTrees[e];
  27632. n || (n = [],
  27633. this.tileTrees[e] = n);
  27634. var r = n[t];
  27635. if (!r) {
  27636. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  27637. r = new A(C.TILE_SIZE,o),
  27638. n[t] = r
  27639. }
  27640. }
  27641. ,
  27642. l.prototype.getTileTree = function(e, t) {
  27643. var i = this.tileTrees[e];
  27644. if (!i)
  27645. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  27646. var n = i[t];
  27647. if (!n)
  27648. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  27649. return n
  27650. }
  27651. ,
  27652. l.prototype.initTiledPano = function(e, antialias) {
  27653. var i = this.sceneRenderer.renderer
  27654. , n = (i.context,
  27655. new h.WebGLRenderTargetCube(e,e,{
  27656. stencilBuffer: !1
  27657. }))
  27658. , r = new h.CubeTexture([]);
  27659. n.texture = r,
  27660. r.image = [null, null, null, null, null, null],
  27661. r.flipY = !0,
  27662. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  27663. antialias ? (r.generateMipmaps = !0,
  27664. r.magFilter = h.LinearFilter,
  27665. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  27666. r.magFilter = h.LinearFilter,
  27667. r.minFilter = h.LinearFilter),
  27668. r.format = h.RGBAFormat,
  27669. i.setRenderTarget(n),
  27670. i.setRenderTarget(null);
  27671. var o = i.properties.get(r);
  27672. return o.__image__webglTextureCube = o.__webglTexture,
  27673. n
  27674. }
  27675. ,
  27676. l.prototype.getUploadQueueForPano = function(e) {
  27677. var t = this.uploadQueues[e];
  27678. return t || (t = [],
  27679. this.uploadQueues[e] = t),
  27680. t
  27681. }
  27682. ,
  27683. l.prototype.isTileUploaded = function(e) {
  27684. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27685. }
  27686. ,
  27687. l.prototype.setUploaded = function(e, t) {
  27688. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  27689. }
  27690. ,
  27691. l.prototype.queueTileUpload = function(e, t, i) {
  27692. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  27693. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27694. var r = this.getUploadQueueForPano(e.panoId);
  27695. 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),
  27696. e.uploadQueued = !0,
  27697. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27698. }
  27699. }
  27700. ,
  27701. l.prototype.shoulPushToFrontOfQueue = function(e) {
  27702. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27703. }
  27704. ,
  27705. l.prototype.getTopUploadQueue = function() {
  27706. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27707. for (var n = 0; n < this.activePanos.length; n++)
  27708. if (e = this.activePanos[n],
  27709. t = this.getUploadQueueForPano(e.id),
  27710. t.length > 0)
  27711. switch (i) {
  27712. case S.Base:
  27713. if (0 === t[0].level)
  27714. return t;
  27715. break;
  27716. case S.Remaining:
  27717. return t
  27718. }
  27719. return null
  27720. }
  27721. ,
  27722. l.prototype.getNextFromUploadQueue = function() {
  27723. var e = function(e) {
  27724. var t = e.shift();
  27725. return t.uploadQueued = !1,
  27726. t
  27727. };
  27728. return function() {
  27729. if (this.forceQueue.length > 0)
  27730. return e(this.forceQueue);
  27731. var t = this.getTopUploadQueue();
  27732. return t && t.length > 0 ? e(t) : null
  27733. }
  27734. }(),
  27735. l.prototype.peekNextFromUploadQueue = function() {
  27736. if (this.forceQueue.length > 0)
  27737. return this.forceQueue[0];
  27738. var e = this.getTopUploadQueue();
  27739. return e && e.length > 0 ? e[0] : null
  27740. }
  27741. ,
  27742. l.prototype.clearAllQueuedUploads = function() {
  27743. this.clearAllUploadQueues(null, 0)
  27744. }
  27745. ,
  27746. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  27747. this.clearAllUploadQueues(e, 0)
  27748. }
  27749. ,
  27750. l.prototype.clearAllUploadQueues = function(e, t) {
  27751. if (e)
  27752. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  27753. this.clearUploadQueue(this.forceQueue, t, e);
  27754. else {
  27755. for (var i = 0; i < this.activePanos.length; i++) {
  27756. var n = this.activePanos[i];
  27757. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27758. }
  27759. this.clearUploadQueue(this.forceQueue, t)
  27760. }
  27761. }
  27762. ,
  27763. l.prototype.clearUploadQueue = function(e, t, i) {
  27764. void 0 !== t && null !== t || (t = 0);
  27765. for (var n = 0; n < e.length; ) {
  27766. var r = e[n];
  27767. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  27768. e.splice(n, 1)) : n++
  27769. }
  27770. }
  27771. ,
  27772. l.prototype.refreshUploadInterval = function() {
  27773. var e = null;
  27774. return function(t) {
  27775. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  27776. null !== t && void 0 !== t || (t = w),
  27777. b || (t = _),
  27778. this.uploadInterval = window.setTimeout(e, t),
  27779. this.uploadIntervalDelay = t)
  27780. }
  27781. }(),
  27782. l.prototype.update = function() {
  27783. var e = performance.now()
  27784. , t = 0;
  27785. return function() {
  27786. this.uploadIntervalCancelled = !0,
  27787. window.clearTimeout(this.uploadInterval),
  27788. this.uploadInterval = null;
  27789. var i = performance.now() - e;
  27790. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27791. e = performance.now()),
  27792. t++
  27793. }
  27794. }(),
  27795. l.prototype.updateUploadQueue = function(e, t) {
  27796. e || (e = 1);
  27797. for (var i = 0, n = 0; ; ) {
  27798. if (n >= t || i >= e)
  27799. break;
  27800. var r = this.getNextFromUploadQueue();
  27801. if (!r)
  27802. break;
  27803. if (0 !== r.level ? i++ : n++,
  27804. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  27805. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  27806. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27807. }
  27808. }
  27809. }
  27810. ,
  27811. l.prototype.updateDirection = function(e) {
  27812. if (e = e || this.direction) {
  27813. this.direction = e;
  27814. for (var t = 0; t < this.activePanos.length; t++) {
  27815. var i = this.activePanos[t]
  27816. , n = this.getUploadQueueForPano(i.id);
  27817. y.sortPanoTiles(n, i, this.direction)
  27818. }
  27819. }
  27820. }
  27821. ,
  27822. l.prototype.uploadTile = function() {
  27823. var e = {}
  27824. , t = (new h.Vector4,
  27825. d.tiling.overlayStyle);
  27826. //var failHistory = {};
  27827. return function(i, n) {
  27828. var r = i.panoId
  27829. , o = i.image
  27830. , a = i.tileSize
  27831. , s = i.panoSize
  27832. , l = i.tileIndex
  27833. , c = (i.faceTileIndex,
  27834. i.totalTiles)
  27835. , u = (i.face,
  27836. i.tileX)
  27837. , d = i.tileY
  27838. , p = !0
  27839. , g = !1
  27840. , m = (this.getPanoDescriptor(r),
  27841. this.getPanoLODDescriptor(r, s))
  27842. , v = this.getActiveRenderTargetDescriptor(r)
  27843. , A = v.renderTarget
  27844. , y = v.size;
  27845. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  27846. y = A.width), //this.qualityManager.getMaxZoomPanoSize()),
  27847. this.isRenderTargetDescriptorValid(v) || (p = !1,
  27848. g = !1),
  27849. n || (this.anyUploaded(i.node) && (p = !1,
  27850. g = !0),
  27851. this.isTileUploaded(i) && (p = !1,
  27852. g = !1)),
  27853. p) {
  27854. /* if(failHistory[''+r+s+l]){
  27855. console.log('uploadTile retry', r, s, l)
  27856. }
  27857. console.log('uploadTile 成功', r, s, l)
  27858. */
  27859. var C = u * a
  27860. , I = d * a
  27861. , E = a / s * y
  27862. , b = C / s * y
  27863. , w = I / s * y;
  27864. if (s > this.qualityManager.maxRenderTargetSize) {
  27865. player.model.getHighImage(o, i.cubeFace, u, d)
  27866. }else{
  27867. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  27868. var _ = e[a]
  27869. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  27870. if ( 1 === t || 2 === t) {
  27871. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  27872. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27873. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  27874. } else
  27875. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  27876. }
  27877. m.uploadCount++,
  27878. this.emit(f.TileRenderSuccess, r, s, l, c),
  27879. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  27880. this.setUploaded(i, !0),
  27881. this.addCoverageForNode(i.node)
  27882. } else{
  27883. this.setUploaded(i, !1);
  27884. //console.log('uploadTile 失败', r, s, l)
  27885. //failHistory[''+r+s+l] = true;
  27886. }
  27887. return i.uploadAttempted || (m.uploadAttempts++,
  27888. this.emit(f.TileUploadAttempted, r, s, l, c)),
  27889. i.uploadAttempted = !0,
  27890. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27891. g
  27892. }
  27893. }(),
  27894. l.prototype.linkTileAndNode = function(e, t) {
  27895. t.tile = e,
  27896. e.node = t
  27897. }
  27898. ,
  27899. l.prototype.linkAllTilesAndNodes = function(e) {
  27900. for (var t = function(t, i, n, r, o) {
  27901. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  27902. this.linkTileAndNode(a, n)
  27903. }, i = 0; i < C.FACES_PER_PANO; i++) {
  27904. var n = this.getTileTree(e.id, i);
  27905. n.breadthFirst({
  27906. callback: t.bind(this, n, i)
  27907. })
  27908. }
  27909. }
  27910. ,
  27911. l.prototype.anyUploaded = function(e) {
  27912. if (!e)
  27913. return !1;
  27914. if (e.tile && this.isTileUploaded(e.tile))
  27915. return !0;
  27916. if (e.children)
  27917. for (var t = 0; t < e.children.length; t++) {
  27918. var i = e.children[t];
  27919. if (this.anyUploaded(i))
  27920. return !0
  27921. }
  27922. return !1
  27923. }
  27924. ,
  27925. l.prototype.setNodeCovered = function(e, t) {
  27926. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  27927. }
  27928. ,
  27929. l.prototype.isNodeCovered = function(e) {
  27930. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27931. }
  27932. ,
  27933. l.prototype.addCoverageForNode = function(e) {
  27934. if (this.setNodeCovered(e, !0),
  27935. e.parent && e.covered) {
  27936. var t = e.parent;
  27937. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27938. }
  27939. }
  27940. ,
  27941. l.prototype.calcFullCoverage = function(e) {
  27942. var t = !1;
  27943. if (e.children)
  27944. for (var i = 0; i < e.children.length; i++) {
  27945. var n = e.children[i];
  27946. t = t || this.calcFullCoverage(n)
  27947. }
  27948. e.covered = e.tile.uploaded || t
  27949. }
  27950. ,
  27951. l.prototype.nodeSubcovered = function(e) {
  27952. if (!e.children)
  27953. return !1;
  27954. for (var t = 0; t < e.children.length; t++)
  27955. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  27956. return !1;
  27957. return !0
  27958. }
  27959. ,
  27960. l.prototype.resetPanoDescriptor = function(e) {
  27961. this.getPanoDescriptor(e)
  27962. }
  27963. ,
  27964. l.prototype.getPanoDescriptor = function(e) {
  27965. var t = this.panoDescriptors[e];
  27966. return t || (t = {},
  27967. this.panoDescriptors[e] = t),
  27968. t
  27969. }
  27970. ,
  27971. l.prototype.resetPanoLODDescriptors = function(e) {
  27972. var t = this.getPanoLODDescriptors(e);
  27973. for (var i in t)
  27974. if (t.hasOwnProperty(i)) {
  27975. var n = t[i];
  27976. n.uploadCount = 0,
  27977. n.uploadAttempts = 0
  27978. }
  27979. }
  27980. ,
  27981. l.prototype.getPanoLODDescriptor = function(e, t) {
  27982. var i = this.getPanoLODDescriptors(e)
  27983. , n = i[t];
  27984. return n || (n = {
  27985. uploadCount: 0,
  27986. uploadAttempts: 0
  27987. },
  27988. i[t] = n),
  27989. n
  27990. }
  27991. ,
  27992. l.prototype.getPanoLODDescriptors = function(e) {
  27993. var t = this.panoLODDescriptors[e];
  27994. return t || (t = {},
  27995. this.panoLODDescriptors[e] = t),
  27996. t
  27997. }
  27998. ,
  27999. l.prototype.onTileDownloaded = function(e) {
  28000. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  28001. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  28002. if (i.downloaded = !0,
  28003. i.image = e.image,
  28004. i.panoSize = e.panoSize,
  28005. i.tileX = e.tileX,
  28006. i.tileY = e.tileY,
  28007. i.totalTiles = e.totalTiles,
  28008. i.tileIndex = e.tileIndex,
  28009. i.faceTileIndex = e.faceTileIndex,
  28010. i.face = e.face,
  28011. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  28012. i.panoId = e.panoId,
  28013. i.tileSize = e.tileSize,
  28014. i.direction = (new h.Vector3).copy(e.direction),
  28015. i.node = null,
  28016. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  28017. this.isPanoActive(i.panoId)) {
  28018. var n = this.getTileTree(i.panoId, i.face)
  28019. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  28020. this.linkTileAndNode(i, r),
  28021. this.queueTileUpload(i, !0)
  28022. }
  28023. }
  28024. ,
  28025. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  28026. var r = this.tileDirectory[e];
  28027. r || (r = {},
  28028. this.tileDirectory[e] = r);
  28029. var o = 16384 * t + 1024 * i + n
  28030. , a = r[o];
  28031. return a || (a = {
  28032. downloaded: !1,
  28033. uploaded: !1,
  28034. zoomUploaded: !1
  28035. },
  28036. r[o] = a),
  28037. a._key = e + ":" + t + ":" + i + ":" + n,
  28038. a._tileKey = o,
  28039. a
  28040. }
  28041. ,
  28042. l.prototype.setZoomingActive = function(e, t, i) {
  28043. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  28044. this.zoomPanoId = t.id,
  28045. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  28046. }
  28047. ,
  28048. l.prototype.updateZoomedPanoFromBase = function(e) {
  28049. if (!this.zoomPanoRenderingDisabled) {
  28050. var t = this.getActiveRenderTargetDescriptor(e.id);
  28051. if (t && t.renderTarget) {
  28052. var i = Math.min(this.qualityManager.maxRenderTargetSize, this.qualityManager.getMaxZoomPanoSize()), //this.qualityManager.getMaxZoomPanoSize()
  28053. n = t.renderTarget
  28054. , r = t.size;
  28055. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  28056. this.copyBaseRenderStatusToZoomed(e.id)
  28057. }
  28058. }
  28059. }
  28060. ,
  28061. t.exports = l
  28062. }
  28063. , {
  28064. "../enum/GLCubeFaces": 25,
  28065. "../enum/PanoRendererEvents": 35,
  28066. "../enum/PanoSizeClass": 36,
  28067. "../enum/SceneRendererEvents": 43,
  28068. "../enum/TileDownloaderEvents": 45,
  28069. "../enum/Vectors": 50,
  28070. "../exception/BasicException": 55,
  28071. "../objects/Panorama": 148,
  28072. "../settings": 166,
  28073. "../util/browser": 182,
  28074. "../util/panorama": 191,
  28075. "./TileDownloader": 171,
  28076. "./TilePrioritizer": 172,
  28077. "./TileTree": 173,
  28078. "./TileUtils": 174,
  28079. events: 202,
  28080. three: 217
  28081. }],
  28082. 170: [function(e, t, i) {
  28083. "use strict";
  28084. function n(e, t, i) {
  28085. this.maxNavPanoSize = -1,
  28086. this.maxZoomPanoSize = -1,
  28087. this.devicePixelDensity = e,
  28088. this.deviceScreenSize = t,
  28089. this.clientBandwidth = i,
  28090. this.panoSizeClassMap = {},
  28091. this.useHighResolutionPanos = !0,
  28092. this.useUltraHighResolutionPanos = !1,
  28093. this.modelHasUltraHighPanos = !1
  28094. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  28095. this.maxRenderTargetSize = Math.min( common.getMaxCubemapSize(), this.maxRenderTargetSize)//add
  28096. }
  28097. var r = e("../enum/PanoSizeClass")
  28098. , o = e("../settings")
  28099. , a = e("../util/browser")
  28100. , s = e("../constants")
  28101. , l = e("../util/showcase")
  28102. , c = e("../enum/ModelManagerEvents");
  28103. n.prototype.init = function(e) {
  28104. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  28105. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  28106. this.highSize = this.getPanoSize(r.HIGH),
  28107. this.standardSize = this.getPanoSize(r.STANDARD),
  28108. this.baseSize = this.getPanoSize(r.BASE),
  28109. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  28110. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  28111. this.updateMaximums(),
  28112. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  28113. }
  28114. ,
  28115. n.prototype.updateFromModel = function(e) {
  28116. this.updateHighResolutionSettings(e),
  28117. this.updateUltraHighResolutionSettings(e)
  28118. }
  28119. ,
  28120. n.prototype.updateHighResolutionSettings = function(e) {
  28121. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  28122. l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  28123. //this.useHighResolutionPanos = !0;
  28124. //----------------------e n d -----------------------------------------------------------------
  28125. this.updateMaximums()
  28126. }
  28127. ,
  28128. n.prototype.updateUltraHighResolutionSettings = function(e) {
  28129. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  28130. this.updateMaximums()
  28131. }
  28132. ,
  28133. n.prototype.enableUltraHighQualityMode = function() {
  28134. this.modelHasUltraHighPanos = !0,
  28135. this.updateUltraHighResolutionSettings(null)
  28136. }
  28137. ,
  28138. n.prototype.ultraHighQualityModeEnabled = function() {
  28139. return this.modelHasUltraHighPanos
  28140. }
  28141. ,
  28142. n.prototype.onModelChanged = function(e) {
  28143. this.updateFromModel(e.model),
  28144. this.updateMaximums()
  28145. }
  28146. ,
  28147. n.prototype.updateMaximums = function() {
  28148. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  28149. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  28150. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  28151. }
  28152. ,
  28153. n.prototype.buildPanoSizeClassMap = function() {
  28154. this.panoSizeClassMap[r.BASE] = 512,
  28155. this.panoSizeClassMap[r.STANDARD] = 1024,
  28156. this.panoSizeClassMap[r.HIGH] = 2048,
  28157. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  28158. }
  28159. ,
  28160. n.prototype.getPanoSize = function(e) {
  28161. return this.panoSizeClassMap[e]
  28162. }
  28163. ,
  28164. n.prototype.getMaxPossiblePanoSize = function() {
  28165. return this.getPanoSize(r.ULTRAHIGH)
  28166. }
  28167. ,
  28168. n.prototype.getMaxPanoSize = function() {
  28169. return this.maxZoomPanoSize
  28170. }
  28171. ,
  28172. n.prototype.getMaxNavPanoSize = function() {
  28173. return this.maxNavPanoSize
  28174. }
  28175. ,
  28176. n.prototype.getMaxZoomPanoSize = function() {
  28177. return this.maxZoomPanoSize
  28178. }
  28179. ,
  28180. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  28181. if(settings.mobileNavHigh)return r.HIGH //改
  28182. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  28183. } */
  28184. n.prototype.detectDevice = function(){//add
  28185. if(a.isMobile()){
  28186. let area = $("#player").width() * $("#player").height()
  28187. if(area < 768 * 1024){//ipad mini full screen 大场景拍的质量很好默认不需要很高清
  28188. return 'mobile'
  28189. }else{
  28190. return 'bigMobile'
  28191. }
  28192. }else{
  28193. return 'pc'
  28194. }
  28195. }
  28196. n.prototype.detectMaxNavPanoSizeClass = function() { //xzw 改
  28197. switch(this.getNavZoomClass()){
  28198. case '1k':
  28199. return r.STANDARD;
  28200. break;
  28201. case '2k':
  28202. default:
  28203. return r.HIGH;
  28204. case '4k':
  28205. return r.ULTRAHIGH;
  28206. }
  28207. }
  28208. ,
  28209. n.prototype.detectMaxNavPanoSize = function() {
  28210. var e = this.detectMaxNavPanoSizeClass();
  28211. return this.getPanoSize(e)
  28212. }
  28213. ,
  28214. n.prototype.getMaxZoomClass = function(){//add
  28215. let type = this.detectDevice()
  28216. let setting = settings.tileClass[type] //见manage.js的settings
  28217. return setting.max
  28218. }
  28219. n.prototype.getNavZoomClass = function(){//add
  28220. let type = this.detectDevice()
  28221. let setting = settings.tileClass[type]
  28222. return setting.nav
  28223. }
  28224. ,
  28225. n.prototype.detectMaxZoomPanoSize = function() {//获取当前zoomRenderTarget应下载的最高级别
  28226. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  28227. if (this.zoomLevelResolution) {//有三个级别
  28228. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  28229. return this.getPanoSize(r.ULTRAHIGH)
  28230. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  28231. return this.getPanoSize(r.STANDARD)
  28232. } else {
  28233. return this.getPanoSize(r.HIGH)
  28234. }
  28235. } else {
  28236. let tileClass = this.getMaxZoomClass()
  28237. if(tileClass == '1k')return this.getPanoSize(r.STANDARD);
  28238. if(tileClass == '4k' && this.useUltraHighResolutionPanos ){
  28239. return this.getPanoSize(r.ULTRAHIGH);
  28240. }else{//'2k'
  28241. return this.getPanoSize(r.HIGH);
  28242. }
  28243. }
  28244. }
  28245. /* n.prototype.detectMaxZoomPanoSize = function() {
  28246. 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)
  28247. } */
  28248. ,
  28249. t.exports = n
  28250. }
  28251. , {
  28252. "../constants": 8,
  28253. "../enum/ModelManagerEvents": 33,
  28254. "../enum/PanoSizeClass": 36,
  28255. "../settings": 166,
  28256. "../util/browser": 182,
  28257. "../util/showcase": 193
  28258. }],
  28259. 171: [function(e, t, i) {
  28260. (function(i) {
  28261. "use strict";
  28262. function n(e) {
  28263. this.panos = null,
  28264. this.retryMinimumTime = 1e4,
  28265. this.urls = null,
  28266. this.panoLoadCallbacks = {},
  28267. this.downloadDescriptors = {},
  28268. this.priorityQueue = [],
  28269. this.forceQueue = [],
  28270. this.activeDownloads = [],
  28271. this.qualityManager = null,
  28272. this.tilePrioritizer = null,
  28273. this.refreshInterval = null,
  28274. this.processPriorityQueue = !1,
  28275. this.concurrentDownloads = e.concurrentDownloads || 1,
  28276. this.downloadTestResults = {}
  28277. }
  28278. var r = e("three")
  28279. , o = (e("../enum/Viewmode"),
  28280. e("../settings"))
  28281. , a = (e("../objects/Panorama"),
  28282. e("../util/logger"))
  28283. , s = (e("../enum/Vectors"),
  28284. e("../enum/PanoSizeClass"),
  28285. e("../enum/TileDownloaderEvents"))
  28286. , l = e("./TilePrioritizer")
  28287. , c = e("./TileUtils")
  28288. , h = (e("../enum/GLCubeFaces"),
  28289. e("../enum/DownloadStatus"))
  28290. , u = e("../util/panorama")
  28291. , d = e("../util/ajax")
  28292. , p = e("../ab")
  28293. , f = e("events").EventEmitter
  28294. , g = (new a(i),
  28295. Object.freeze({
  28296. Testing: 1,
  28297. Success: 2,
  28298. Fail: 3
  28299. }));
  28300. n.prototype = Object.create(f.prototype),
  28301. n.IDLE_REFRESH_DELAY = 500,
  28302. n.ACTIVE_REFRESH_DELAY = 16,
  28303. n.DOWNLOAD_RETRIES = 4,
  28304. n.prototype.init = function(e) {
  28305. this.qualityManager = e
  28306. }
  28307. ,
  28308. n.prototype.setUrls = function(e) {
  28309. this.urls = e
  28310. }
  28311. ,
  28312. n.prototype.setPanoData = function(e, t, i) {
  28313. this.panos = e,
  28314. this.imagePanos = t,
  28315. this.panoGroupId = i
  28316. }
  28317. ,
  28318. n.prototype.start = function() {
  28319. this.refreshUpdateInterval(0)
  28320. }
  28321. ,
  28322. n.prototype.stop = function() {
  28323. window.cancel(this.refreshInterval)
  28324. }
  28325. ,
  28326. n.prototype.refreshUpdateInterval = function(e) {
  28327. e || (e = 0),
  28328. this.refreshInterval = window.setTimeout(function() {
  28329. var e = this.update();
  28330. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  28331. }
  28332. .bind(this), e)
  28333. }
  28334. ,
  28335. n.prototype.update = function() {
  28336. var e = this.forceQueue.length > 0;
  28337. return this.processQueueForDownloading(this.forceQueue),
  28338. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  28339. this.priorityQueue.length > 0 && (e = !0),
  28340. this.processQueueForDownloading(this.priorityQueue)),
  28341. e
  28342. }
  28343. ,
  28344. n.prototype.forceQueueTilesForPano = function() {
  28345. var e = []
  28346. , t = [];
  28347. return function(i, n, r, o, a, s) {
  28348. e.length = 0;
  28349. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  28350. var p = u[d];
  28351. p.status !== h.None && p.status !== h.Queued || e.push(p)
  28352. }
  28353. if (r && e.length > 0) {
  28354. l.sortPanoTiles(e, i, r),
  28355. t.length = 0,
  28356. c.matchingTilesInDirection(i, n, r, o, a, t);
  28357. for (var f = 0, g = function(e) {
  28358. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  28359. }; f < e.length; ) {
  28360. var m = e[f]
  28361. , v = t.findIndex(g);
  28362. v < 0 ? e.splice(f, 1) : f++
  28363. }
  28364. }
  28365. for (var A = 0; A < e.length; A++)
  28366. this.forceQueue.push(e[A]);
  28367. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  28368. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  28369. s && this.processQueueForDownloading(this.forceQueue, !0)
  28370. }
  28371. }(),
  28372. n.prototype.clearForceQueue = function() {
  28373. this.clearQueue(this.forceQueue)
  28374. }
  28375. ,
  28376. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  28377. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  28378. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  28379. this.clearFromQueue(this.priorityQueue, h.None, !0),
  28380. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  28381. }
  28382. ,
  28383. n.prototype.clearQueue = function(e) {
  28384. this.setStatusForAllDescriptors(e, h.None),
  28385. e.length = 0
  28386. }
  28387. ,
  28388. n.prototype.clearFromQueue = function(e, t, i) {
  28389. for (var n = 0; n < e.length; n++) {
  28390. var r = e[n];
  28391. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  28392. }
  28393. }
  28394. ,
  28395. n.prototype.setStatusForAllDescriptors = function(e, t) {
  28396. for (var i = 0; i < e.length; i++) {
  28397. var n = e[i];
  28398. n && (n.status = t)
  28399. }
  28400. }
  28401. ,
  28402. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  28403. for (var i = 0; i < e.length; i++) {
  28404. var n = e[i];
  28405. n && (n.status !== t ? n.status = t : e[i] = null)
  28406. }
  28407. }
  28408. ,
  28409. n.prototype.getTileDownloadDescriptors = function(e, t) {
  28410. var i = this.getAllTileDownloadDescriptorsForPano(e)
  28411. , n = i[t];
  28412. return n || (n = this.buildDownloadDescriptorArray(t),
  28413. i[t] = n,
  28414. this.initTileDownloadDescriptors(n, e, t)),
  28415. n
  28416. }
  28417. ,
  28418. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  28419. var t = this.downloadDescriptors[e.id];
  28420. return t || (t = {},
  28421. this.downloadDescriptors[e.id] = t),
  28422. t
  28423. }
  28424. ,
  28425. n.prototype.processQueueForDownloading = function(e, t) {
  28426. if (this.cleanupActiveDownloads(),
  28427. this.activeDownloads.length < this.concurrentDownloads || t)
  28428. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  28429. var o = e.shift();
  28430. o && (this.startDownload(o),
  28431. n++)
  28432. }
  28433. }
  28434. ,
  28435. n.prototype.testDownload = function(e, t, i) {
  28436. var n = this.downloadTestResults[e];
  28437. if (n)
  28438. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  28439. this.downloadTestResults[e] = g.Testing;
  28440. var r = this.panos.list[0]
  28441. , o = this.getTileUrl(r.id, e, t, 0)
  28442. , a = function(t) {
  28443. this.downloadTestResults[e] = g.Success,
  28444. i(!0)
  28445. }
  28446. .bind(this)
  28447. , s = function() {
  28448. this.downloadTestResults[e] = g.Fail,
  28449. i(!1)
  28450. }
  28451. .bind(this);
  28452. this.loadImage(o, 0, a, s)
  28453. }
  28454. ,
  28455. n.prototype.startDownload = function(e) {
  28456. e.status = h.Downloading;
  28457. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  28458. this.activeDownloads.push(e),
  28459. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28460. }
  28461. ,
  28462. n.prototype.downloadFailed = function(e, t) {}
  28463. ,
  28464. n.prototype.downloadComplete = function(e, t) {
  28465. if (e.panoGroupId === this.panoGroupId) {
  28466. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  28467. e.status = h.Downloaded,
  28468. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  28469. var n = {
  28470. panoId: e.pano.id,
  28471. image: t,
  28472. tileSize: e.tileSize,
  28473. panoSize: e.panoSize,
  28474. tileIndex: e.tileIndex,
  28475. faceTileIndex: e.faceTileIndex,
  28476. totalTiles: e.totalTiles,
  28477. face: e.face,
  28478. tileX: e.tileX,
  28479. tileY: e.tileY,
  28480. direction: e.direction
  28481. };
  28482. e.image = t,
  28483. this.emit(s.TileDownloadSuccess, n),
  28484. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  28485. panoId: e.pano.id,
  28486. tileSize: e.tileSize,
  28487. panoSize: e.panoSize
  28488. },
  28489. this.emit(s.PanoDownloadComplete, n),
  28490. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28491. }
  28492. }
  28493. ,
  28494. n.prototype.cleanupActiveDownloads = function() {
  28495. var e = [];
  28496. return function() {
  28497. e.length = 0;
  28498. for (var t = 0; t < this.activeDownloads.length; t++) {
  28499. var i = this.activeDownloads[t];
  28500. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28501. }
  28502. this.activeDownloads.length = 0,
  28503. this.activeDownloads.push.apply(this.activeDownloads, e)
  28504. }
  28505. }(),
  28506. n.prototype.isPanoDownloaded = function(e, t) {
  28507. var i = this.getTileDownloadDescriptors(e, t);
  28508. if (i.length <= 0)
  28509. return !1;
  28510. for (var n = 0; n < i.length; n++) {
  28511. var r = i[n];
  28512. if (r.status !== h.Downloaded)
  28513. return !1
  28514. }
  28515. return !0
  28516. }
  28517. ,
  28518. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  28519. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  28520. this.panoLoadCallbacks[o] = {
  28521. onLoad: i,
  28522. onFail: n,
  28523. onProgress: r
  28524. }
  28525. }
  28526. ,
  28527. n.prototype.getPanoLoadCallbacks = function(e, t) {
  28528. var i = e.id + ":" + t;
  28529. return this.panoLoadCallbacks[i]
  28530. }
  28531. ,
  28532. n.prototype.buildDownloadDescriptorArray = function(e) {
  28533. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28534. var r = this.buildDownloadDescriptor();
  28535. i.push(r)
  28536. }
  28537. return i
  28538. }
  28539. ,
  28540. n.prototype.buildDownloadDescriptor = function() {
  28541. var e = {
  28542. panoGroupId: null,
  28543. pano: null,
  28544. panoSize: -1,
  28545. tileSize: -1,
  28546. tileIndex: -1,
  28547. totalTiles: -1,
  28548. faceTileIndex: -1,
  28549. status: h.None,
  28550. url: null,
  28551. image: null,
  28552. direction: new r.Vector3,
  28553. face: -1,
  28554. cubeFace: -1,
  28555. tileX: -1,
  28556. tileY: -1
  28557. };
  28558. return e
  28559. }
  28560. ,
  28561. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  28562. for (var n = 0; n < e.length; n++) {
  28563. var r = e[n];
  28564. this.initTileDownloadDescriptor(r, t, i, n)
  28565. }
  28566. }
  28567. ,
  28568. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  28569. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  28570. e.face = c.getFaceForTile(i, n),
  28571. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  28572. e.panoGroupId = this.panoGroupId,
  28573. e.pano = t,
  28574. e.panoSize = i,
  28575. e.tileSize = r,
  28576. e.tileIndex = n,
  28577. e.totalTiles = c.getTileCountForSize(i),
  28578. e.status = h.None,
  28579. e.image = null,
  28580. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28581. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28582. }
  28583. ,
  28584. n.prototype.getTileUrl = function() {
  28585. var e = {
  28586. 256: "256",
  28587. 512: "512",
  28588. 1024: "1k",
  28589. 2048: "2k",
  28590. 4096: "4k"
  28591. }
  28592. , t = {
  28593. face: -1,
  28594. faceTileIndex: -1,
  28595. tileX: -1,
  28596. tileY: -1
  28597. };
  28598. return function(i, n, r, a) {
  28599. c.getTileLocation(n, a, t);
  28600. var s = Math.floor(n / r)
  28601. , l = s * s
  28602. , h = Math.floor(a / l)
  28603. , u = "";
  28604. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  28605. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  28606. return d = p.changeIfTileGenerating(d)
  28607. }
  28608. }(),
  28609. n.prototype.loadImage = function(e, t, i, n) {
  28610. d.getImage(e, t).then(function(e) {
  28611. i(e)
  28612. }).fail(n)
  28613. }
  28614. ,
  28615. t.exports = n
  28616. }
  28617. ).call(this, "/js/tile/TileDownloader.js")
  28618. }
  28619. , {
  28620. "../ab": 3,
  28621. "../enum/DownloadStatus": 24,
  28622. "../enum/GLCubeFaces": 25,
  28623. "../enum/PanoSizeClass": 36,
  28624. "../enum/TileDownloaderEvents": 45,
  28625. "../enum/Vectors": 50,
  28626. "../enum/Viewmode": 51,
  28627. "../objects/Panorama": 148,
  28628. "../settings": 166,
  28629. "../util/ajax": 181,
  28630. "../util/logger": 189,
  28631. "../util/panorama": 191,
  28632. "./TilePrioritizer": 172,
  28633. "./TileUtils": 174,
  28634. events: 202,
  28635. three: 217
  28636. }],
  28637. 172: [function(e, t, i) {
  28638. (function(i) {
  28639. "use strict";
  28640. function n(e, t, i, o, a) {
  28641. this.qualityManager = e,
  28642. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  28643. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  28644. this.baseSize = t,
  28645. this.standardSize = i,
  28646. this.highSize = o,
  28647. this.ultraHighSize = a,
  28648. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  28649. }
  28650. var r = e("three")
  28651. , o = (e("../enum/Viewmode"),
  28652. e("../settings"),
  28653. e("../settings"),
  28654. e("../objects/Panorama"))
  28655. , a = e("../util/logger")
  28656. , s = (e("../enum/Vectors"),
  28657. e("../enum/PanoSizeClass"),
  28658. e("../enum/ModelManagerEvents"),
  28659. e("../enum/GLCubeFaces"),
  28660. e("../enum/DownloadStatus"))
  28661. , l = (e("../util/browser"),
  28662. e("./TileUtils"))
  28663. , c = e("../util/math")
  28664. , h = (e("events").EventEmitter,
  28665. new a(i),
  28666. Object.freeze({
  28667. None: 0,
  28668. DirectionalFOV: 1
  28669. }));
  28670. n.PriorityCriteria = function(e, t, i, n, o) {
  28671. this.pano = e,
  28672. this.cameraPosition = (new r.Vector3).copy(t),
  28673. this.cameraDir = (new r.Vector3).copy(i),
  28674. this.panoSpaceDir = (new r.Vector3).copy(n),
  28675. this.upcomingPanos = o,
  28676. this.copy = function(e) {
  28677. this.pano = e.pano,
  28678. this.cameraPosition.copy(e.cameraPosition),
  28679. this.cameraDir.copy(e.cameraDir),
  28680. this.panoSpaceDir.copy(e.panoSpaceDir),
  28681. this.upcomingPanos = o
  28682. }
  28683. ,
  28684. this.zoomingActive = !1
  28685. }
  28686. ,
  28687. n.DIRECTIONAL_FOV = 180,
  28688. n.DIRECTIONAL_FOV_NARROW = 120,
  28689. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  28690. n.MAX_SCORED_PANOS_TOADD = 2,
  28691. n.MAX_UPCOMING_PANOS_TOADD = 3,
  28692. n.DIRECTION_SCORE_STRICTNESS = .75,
  28693. n.appendQueue = function(e, t) {
  28694. if (e && t)
  28695. for (var i = 0; i < t.length; i++)
  28696. e.push(t[i])
  28697. }
  28698. ,
  28699. n.prototype.updateCriteria = function(e, t, i, n) {
  28700. this.priorityCriteria.pano = e,
  28701. this.priorityCriteria.cameraPosition.copy(t),
  28702. this.priorityCriteria.cameraDir.copy(i),
  28703. this.priorityCriteria.upcomingPanos = n,
  28704. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()
  28705. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28706. if(!player.panoRenderer.isPanoZoomed(e.id)){ //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  28707. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  28708. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  28709. }
  28710. }
  28711. ,
  28712. n.prototype.filterAndPrioritize = function() {
  28713. var e = []
  28714. , t = []
  28715. , i = [];
  28716. return function(r, o, a) {
  28717. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  28718. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  28719. var s = this.baseSize
  28720. , l = this.standardSize
  28721. , c = this.highSize
  28722. , h = this.ultraHighSize;
  28723. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28724. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28725. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024 , n.MAX_UPCOMING_PANOS_TOADD),//更清晰些
  28726. i.length = 0,
  28727. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28728. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28729. n.appendQueue(r, i),
  28730. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28731. i.length = 0,
  28732. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28733. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28734. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28735. n.appendQueue(r, i),
  28736. i.length = 0,
  28737. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28738. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28739. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28740. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28741. n.appendQueue(r, i),
  28742. this.queueTilesForPanos(r, e, a, s)
  28743. }
  28744. }(),
  28745. n.prototype.canDownloadSize = function(e) {
  28746. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  28747. }
  28748. ,
  28749. n.prototype.populateNeighborPanos = function(e, t, i) {
  28750. i = i || [],
  28751. i.length = 0;
  28752. var n = t.getNeighbours(e);
  28753. for (var r in n)
  28754. if (n.hasOwnProperty(r)) {
  28755. var o = t.get(r);
  28756. i.push(o)
  28757. }
  28758. return i
  28759. }
  28760. ,
  28761. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  28762. i = i || [],
  28763. i.length = 0;
  28764. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  28765. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  28766. , c = t.sortByScore(s, l);
  28767. if (c)
  28768. for (var h = 0; h < c.length && h < a; h++) {
  28769. var u = c[h].item;
  28770. i.push(u)
  28771. }
  28772. return i
  28773. }
  28774. ,
  28775. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  28776. for (var o = 0, a = 0; a < t.length; a++) {
  28777. var s = t[a]
  28778. , l = this.queueTilesForPano(e, i, s, n);
  28779. if (o += l > 0 ? 1 : 0,
  28780. r && o >= r)
  28781. break
  28782. }
  28783. return o
  28784. }
  28785. ,
  28786. n.prototype.queueTilesForPano = function() {
  28787. var e = {
  28788. filter: h.None
  28789. };
  28790. return function(t, i, n, r) {
  28791. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28792. }
  28793. }(),
  28794. n.prototype.queueTilesForPanosInDirection = function() {
  28795. var e = new r.Vector3;
  28796. return function(t, i, n, r, o, a, s, l) {
  28797. for (var h = 0, u = 0; u < n.length; u++) {
  28798. var d = n[u];
  28799. e.copy(d.position),
  28800. e.sub(o),
  28801. e.normalize();
  28802. var p = Math.max(Math.min(a.dot(e), 1), -1)
  28803. , f = c.getFOVDotThreshold(s);
  28804. if (p >= f) {
  28805. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  28806. if (h += g > 0 ? 1 : 0,
  28807. l && h >= l)
  28808. break
  28809. }
  28810. }
  28811. return h
  28812. }
  28813. }(),
  28814. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  28815. for (var l = 0, c = 0; c < i.length; c++) {
  28816. var h = i[c]
  28817. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  28818. if (l += u > 0 ? 1 : 0,
  28819. s && l >= s)
  28820. break
  28821. }
  28822. return l
  28823. }
  28824. ,
  28825. n.prototype.queueTilesInDirectionForPano = function() {
  28826. var e = {
  28827. filter: h.DirectionalFOV,
  28828. direction: new r.Vector3,
  28829. fov: 60
  28830. }
  28831. , t = new r.Vector3;
  28832. return function(i, n, r, o, a, s, c) {
  28833. return t.copy(s),
  28834. l.getRelativeDirection(r.quaternion, t),
  28835. e.direction.copy(t),
  28836. e.fov = c,
  28837. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28838. }
  28839. }(),
  28840. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  28841. var e = [];
  28842. return function(t, i, n, r, o) {
  28843. var a = i.getTileDownloadDescriptors(n, r);
  28844. e.length = 0,
  28845. this.filterTileDownloadDescriptors(n, a, e, o);
  28846. for (var s = 0, l = 0; l < e.length; l++) {
  28847. var c = e[l];
  28848. c && (t.push(c),
  28849. s++)
  28850. }
  28851. return s
  28852. }
  28853. }(),
  28854. n.prototype.filterTileDownloadDescriptors = function() {
  28855. new r.Vector3;
  28856. return function(e, t, i, n) {
  28857. var r, o;
  28858. switch (n.filter) {
  28859. case h.DirectionalFOV:
  28860. for (r = 0; r < t.length; r++)
  28861. o = t[r],
  28862. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  28863. break;
  28864. default:
  28865. for (r = 0; r < t.length; r++)
  28866. o = t[r],
  28867. i.push(o)
  28868. }
  28869. for (r = 0; r < i.length; r++)
  28870. o = i[r],
  28871. this.canIncludeDescriptor(o) || (i[r] = null)
  28872. }
  28873. }(),
  28874. n.prototype.canIncludeDescriptor = function(e) {
  28875. return e.status !== s.Downloading && e.status !== s.Downloaded
  28876. }
  28877. ,
  28878. n.prototype.canIncludePano = function(e, t) {
  28879. return !e.isLoaded(t)
  28880. }
  28881. ,
  28882. n.getFOVDotThreshold = function(e) {
  28883. return Math.cos(r.Math.degToRad(e / 2))
  28884. }
  28885. ;
  28886. var u = function() {
  28887. var e = function e(t, i) {
  28888. var n = e._panoSpaceDir
  28889. , r = e._fovThreshold
  28890. , o = e._fovThresholdNarrow
  28891. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  28892. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  28893. return t._dot = a,
  28894. i._dot = s,
  28895. 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)
  28896. };
  28897. return e._panoSpaceDir = new r.Vector3,
  28898. e._fovThreshold = -1,
  28899. e._fovThresholdNarrow = -1,
  28900. e
  28901. }();
  28902. n.sortPanoTiles = function(e, t, i) {
  28903. u._panoSpaceDir.copy(i),
  28904. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28905. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28906. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  28907. e.sort(u)
  28908. }
  28909. ,
  28910. n.insertSortedPanoTile = function(e, t, i, r) {
  28911. u._panoSpaceDir.copy(r),
  28912. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28913. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  28914. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  28915. for (var o = -1, a = 0; a < e.length; a++) {
  28916. var s = u(t, e[a]);
  28917. if (s <= 0) {
  28918. o = a;
  28919. break
  28920. }
  28921. }
  28922. if (o === -1)
  28923. e[e.length] = t;
  28924. else {
  28925. for (var h = e.length; h > o; h--)
  28926. e[h] = e[h - 1];
  28927. e[o] = t
  28928. }
  28929. }
  28930. ,
  28931. n.prototype.setZoomingActive = function(e) {
  28932. e !== this.zoomingActive && (this.zoomingActive = e)
  28933. }
  28934. ,
  28935. t.exports = n
  28936. }
  28937. ).call(this, "/js/tile/TilePrioritizer.js")
  28938. }
  28939. , {
  28940. "../enum/DownloadStatus": 24,
  28941. "../enum/GLCubeFaces": 25,
  28942. "../enum/ModelManagerEvents": 33,
  28943. "../enum/PanoSizeClass": 36,
  28944. "../enum/Vectors": 50,
  28945. "../enum/Viewmode": 51,
  28946. "../objects/Panorama": 148,
  28947. "../settings": 166,
  28948. "../util/browser": 182,
  28949. "../util/logger": 189,
  28950. "../util/math": 190,
  28951. "./TileUtils": 174,
  28952. events: 202,
  28953. three: 217
  28954. }],
  28955. 173: [function(e, t, i) {
  28956. "use strict";
  28957. function n(e, t) {
  28958. this.levels = t,
  28959. this.tileSize = e,
  28960. this.root = null,
  28961. this.allNodes = [],
  28962. a(this)
  28963. }
  28964. function r(e, t) {
  28965. this.tree = e,
  28966. this.parent = t,
  28967. this.children = [],
  28968. this.id = ++u
  28969. }
  28970. function o(e, t, i, r, a, s, l, h) {
  28971. if (e) {
  28972. l = l || n.TraversalType.PreOrder;
  28973. var u = r * c + i;
  28974. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  28975. s && s.push(e)),
  28976. e.children && 0 !== e.children.length) {
  28977. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  28978. for (var g = 0; g < c; g++)
  28979. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  28980. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  28981. s && s.push(e))
  28982. }
  28983. }
  28984. }
  28985. function a(e) {
  28986. e.root = s(e, null, 0)
  28987. }
  28988. function s(e, t, i) {
  28989. if (i > e.levels)
  28990. return null;
  28991. var n = new r(e,t);
  28992. e.allNodes.push(n);
  28993. for (var o = 0; o < h; o++)
  28994. n.children[o] = s(e, n, i + 1);
  28995. return n
  28996. }
  28997. function l(e, t, i, n, r) {
  28998. if (!e)
  28999. return null;
  29000. if (0 === i)
  29001. return e;
  29002. if (!e.children || 0 === e.children.length)
  29003. return null;
  29004. var o = Math.pow(c, i)
  29005. , a = o / c
  29006. , s = n % a
  29007. , h = r % a
  29008. , u = Math.floor(r / a)
  29009. , d = Math.floor(n / a)
  29010. , p = u * c + d
  29011. , f = e.children[p];
  29012. return l(f, t + 1, i - 1, s, h)
  29013. }
  29014. var c = (e("three"),
  29015. e("./TileUtils"),
  29016. e("../objects/Panorama"),
  29017. e("../util/panorama"),
  29018. e("events").EventEmitter,
  29019. 2)
  29020. , h = c * c;
  29021. n.TraversalType = Object.freeze({
  29022. PreOrder: 0,
  29023. PostOrder: 1
  29024. });
  29025. var u = 0;
  29026. n.getLevelCountForSize = function(e, t) {
  29027. var i = 0;
  29028. for (t < e && (t = e); ; ) {
  29029. if (t /= c,
  29030. t < e)
  29031. break;
  29032. i++
  29033. }
  29034. return i
  29035. }
  29036. ,
  29037. n.getSizeForLevel = function(e, t) {
  29038. return Math.pow(c, t) * e
  29039. }
  29040. ,
  29041. n.prototype.getSubNode = function(e, t, i) {
  29042. (!t || e < this.tileSize) && (t = 0),
  29043. (!i || e < this.tileSize) && (i = 0),
  29044. e < this.tileSize && (e = this.tileSize);
  29045. var r = n.getLevelCountForSize(this.tileSize, e)
  29046. , o = l(this.root, 0, r, t, i);
  29047. return o
  29048. }
  29049. ,
  29050. n.prototype.breadthFirst = function(e) {
  29051. e = e || {};
  29052. var t = !!e.nullLevelEnd
  29053. , i = e.maxLevel
  29054. , n = e.minLevel
  29055. , r = e.callback
  29056. , o = e.saveVisited
  29057. , a = []
  29058. , s = {}
  29059. , l = 0
  29060. , c = 0;
  29061. for (a.push(this.root),
  29062. a.push(s); a.length > 0 && !(i && l > i); ) {
  29063. var h = a.shift();
  29064. if (h === s)
  29065. (!n || l >= n) && (r && t && r(null),
  29066. o && t && o.push(null)),
  29067. a.length > 0 && a.push(s),
  29068. l++,
  29069. c = 0;
  29070. else {
  29071. if (h.children)
  29072. for (var u = 0; u < h.children.length; u++) {
  29073. var d = h.children[u];
  29074. d && a.push(h.children[u])
  29075. }
  29076. var p = this.getFaceIndexFromNode(h);
  29077. (!n || l >= n) && (r && r(h, l, p),
  29078. o && o.push(h)),
  29079. c++
  29080. }
  29081. }
  29082. }
  29083. ,
  29084. n.prototype.getFaceIndexFromNode = function(e) {
  29085. if (!e)
  29086. return -1;
  29087. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  29088. var o = i.parent;
  29089. if (!o)
  29090. break;
  29091. for (var a = -1, s = 0; s < o.children.length; s++)
  29092. o.children[s] === i && (a = s);
  29093. var l = a % c
  29094. , h = Math.floor(a / c);
  29095. n = l * t + n,
  29096. r = h * t + r,
  29097. t *= c,
  29098. i = o
  29099. }
  29100. return r * t + n
  29101. }
  29102. ,
  29103. n.prototype.depthFirst = function(e, t, i) {
  29104. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  29105. }
  29106. ,
  29107. t.exports = n
  29108. }
  29109. , {
  29110. "../objects/Panorama": 148,
  29111. "../util/panorama": 191,
  29112. "./TileUtils": 174,
  29113. events: 202,
  29114. three: 217
  29115. }],
  29116. 174: [function(e, t, i) {
  29117. "use strict";
  29118. var n = e("../enum/GLCubeFaces")
  29119. , r = e("../util/MathLight")
  29120. , o = {};
  29121. o.TILE_SIZE = 512,
  29122. o.FACES_PER_PANO = 6,
  29123. o.LocationOnTile = {
  29124. Center: 0,
  29125. UpperLeft: 1,
  29126. UpperRight: 2,
  29127. LowerRight: 3,
  29128. LowerLeft: 4
  29129. },
  29130. o.getTileVector = function() {
  29131. return function(e, t, i, a, s, l, c, h) {
  29132. l = l || o.LocationOnTile.Center;
  29133. var u = e / t
  29134. , d = a / u;
  29135. s = -s + (u - 1);
  29136. var p = s / u
  29137. , f = t / e
  29138. , g = 2 * f
  29139. , m = g / 2
  29140. , v = 2 * d - 1 + m
  29141. , A = 2 * p - 1 + m;
  29142. switch (l) {
  29143. case o.LocationOnTile.UpperLeft:
  29144. v -= m,
  29145. A += m,
  29146. v += c * g;
  29147. break;
  29148. case o.LocationOnTile.UpperRight:
  29149. v += m,
  29150. A += m,
  29151. A -= c * g;
  29152. break;
  29153. case o.LocationOnTile.LowerRight:
  29154. v += m,
  29155. A -= m,
  29156. v -= c * g;
  29157. break;
  29158. case o.LocationOnTile.LowerLeft:
  29159. v -= m,
  29160. A -= m,
  29161. A += c * g;
  29162. break;
  29163. case o.LocationOnTile.Center:
  29164. }
  29165. switch (i) {
  29166. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  29167. r.setVector(h, -1, A, -v);
  29168. break;
  29169. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  29170. r.setVector(h, 1, A, v);
  29171. break;
  29172. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  29173. r.setVector(h, -v, 1, -A);
  29174. break;
  29175. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  29176. r.setVector(h, -v, -1, A);
  29177. break;
  29178. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  29179. r.setVector(h, -v, A, 1);
  29180. break;
  29181. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  29182. r.setVector(h, v, A, -1)
  29183. }
  29184. r.normalize(h)
  29185. }
  29186. }(),
  29187. o.getFaceForTile = function(e, t) {
  29188. var i = o.TILE_SIZE;
  29189. e < o.TILE_SIZE && (i = e);
  29190. var n = Math.floor(e / i)
  29191. , r = n * n;
  29192. return Math.floor(t / r)
  29193. }
  29194. ,
  29195. o.getTileLocation = function(e, t, i) {
  29196. var n = o.TILE_SIZE;
  29197. e < o.TILE_SIZE && (n = e);
  29198. var r = o.getFaceForTile(e, t)
  29199. , a = Math.floor(e / n)
  29200. , s = a * a
  29201. , l = t - r * s;
  29202. i.tileX = l % a,
  29203. i.tileY = Math.floor(l / a),
  29204. i.face = r,
  29205. i.faceTileIndex = l
  29206. }
  29207. ,
  29208. o.getTileCountForSize = function(e) {
  29209. if (e <= o.TILE_SIZE)
  29210. return o.FACES_PER_PANO;
  29211. var t = Math.floor(e / o.TILE_SIZE)
  29212. , i = t * t
  29213. , n = i * o.FACES_PER_PANO;
  29214. return n
  29215. }
  29216. ,
  29217. o.getRelativeDirection = function() {
  29218. var e = new r.Matrix4
  29219. , t = new r.Quaternion;
  29220. return function(i, n) {
  29221. t.copy(i),
  29222. t.inverse(),
  29223. e.makeRotationFromQuaternion(t),
  29224. e.applyToVector3(n),
  29225. r.normalize(n)
  29226. }
  29227. }(),
  29228. o.matchingTilesInDirection = function() {
  29229. var e = new r.Vector3
  29230. , t = new r.Vector3(0,0,-1)
  29231. , i = new r.Quaternion
  29232. , n = function(e, t) {
  29233. e.push({
  29234. face: t.face,
  29235. faceTileIndex: t.faceTileIndex,
  29236. tileX: t.tileX,
  29237. tileY: t.tileY
  29238. })
  29239. }
  29240. , a = function() {
  29241. var e = {
  29242. face: -1,
  29243. faceTileIndex: -1,
  29244. tileX: -1,
  29245. tileY: -1
  29246. };
  29247. return function(t, i, r) {
  29248. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  29249. o.getTileLocation(t, l, e),
  29250. i && !i(e) || (s++,
  29251. r && n(r, e));
  29252. return s
  29253. }
  29254. }();
  29255. return function(n, s, l, c, h, u) {
  29256. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  29257. o.getTileCountForSize(s);
  29258. if (!c && !h)
  29259. return a(s, null, u);
  29260. var p = !!h;
  29261. if (h = h || c,
  29262. h = Math.max(0, Math.min(h, 360)),
  29263. c = Math.max(0, Math.min(c, 360)),
  29264. r.copyVector(l, e),
  29265. o.getRelativeDirection(n.quaternion, e),
  29266. p) {
  29267. i.setFromUnitVectors(e, t);
  29268. var f = function(e) {
  29269. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  29270. };
  29271. return a(s, f, u)
  29272. }
  29273. var g = function(t) {
  29274. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  29275. };
  29276. return a(s, g, u)
  29277. }
  29278. }(),
  29279. o.isTileWithinFrustum = function() {
  29280. var e = new r.Vector3
  29281. , t = 1e-5;
  29282. return function(i, n, a, s, l, c, h, u) {
  29283. 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++)
  29284. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  29285. r.applyQuaternionToVector(c, e),
  29286. e.z >= -t)
  29287. I++;
  29288. else {
  29289. var w = -1 / e.z
  29290. , _ = e.x * w
  29291. , T = e.y * w;
  29292. T > d ? v++ : T < p && A++,
  29293. _ > f ? y++ : _ < g && C++,
  29294. E++
  29295. }
  29296. return A !== E && v !== E && y !== E && C !== E
  29297. }
  29298. }(),
  29299. o.isTileWithinFOV = function() {
  29300. var e = new r.Vector3
  29301. , t = new r.Vector3(0,1,0)
  29302. , i = new r.Vector3(1,0,0);
  29303. return function(n, a, s, l, c, h, u) {
  29304. var d = o.mapFaceToCubemapFace(s);
  29305. if (r.cross(h, t, i),
  29306. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  29307. o.isWithinFOV(e, h, u, null))
  29308. return !0;
  29309. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  29310. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  29311. if (o.getTileVector(n, a, d, l, c, v, g, e),
  29312. o.isWithinFOV(e, h, u, null))
  29313. return !0;
  29314. g += p
  29315. }
  29316. return !1
  29317. }
  29318. }(),
  29319. o.isWithinFOV = function() {
  29320. var e = new r.Vector3
  29321. , t = new r.Vector3;
  29322. return function(i, n, o, a) {
  29323. if (r.copyVector(i, t),
  29324. a) {
  29325. r.copyVector(a, e),
  29326. r.normalize(e);
  29327. var s = r.dot(e, i);
  29328. e.x *= s,
  29329. e.y *= s,
  29330. e.z *= s,
  29331. r.subVector(t, e)
  29332. }
  29333. var l = o / 2 * r.RADIANS_PER_DEGREE
  29334. , c = Math.cos(l)
  29335. , h = r.dot(t, n);
  29336. return h >= c
  29337. }
  29338. }(),
  29339. o.mapFaceToCubemapFace = function() {
  29340. var e = {
  29341. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  29342. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  29343. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  29344. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  29345. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  29346. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  29347. };
  29348. return function(t) {
  29349. return e[t]
  29350. }
  29351. }(),
  29352. t.exports = o
  29353. }
  29354. , {
  29355. "../enum/GLCubeFaces": 25,
  29356. "../util/MathLight": 176
  29357. }],
  29358. 175: [function(e, t, i) {
  29359. (function(i) {
  29360. "use strict";
  29361. function n() {
  29362. this.list = [],
  29363. this.index = {},
  29364. Object.defineProperty(this, "length", {
  29365. get: function() {
  29366. return this.list.length
  29367. }
  29368. })
  29369. }
  29370. var r = (e("./common"),
  29371. e("./logger"));
  29372. new r(i);
  29373. n.prototype.forEach = function(e) {
  29374. this.list.forEach(e)
  29375. }
  29376. ,
  29377. n.prototype.add = function(e) {
  29378. this.list.push(e),
  29379. this.index[this.getIndex(e)] = e
  29380. }
  29381. ,
  29382. n.prototype.getIndex = function(e) {
  29383. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  29384. }
  29385. ,
  29386. n.prototype.extend = function(e) {
  29387. for (var t = 0; t < e.length; t++)
  29388. this.add(e[t])
  29389. }
  29390. ,
  29391. n.prototype.get = function(e) {
  29392. return this.index[e]
  29393. }
  29394. ,
  29395. n.prototype.first = function() {
  29396. return this.list[0]
  29397. }
  29398. ,
  29399. n.prototype.last = function() {
  29400. return this.list[this.list.length - 1]
  29401. }
  29402. ,
  29403. n.prototype.reIndex = function() {
  29404. this.index = {};
  29405. var e = this;
  29406. this.forEach(function(t) {
  29407. e.index[e.getIndex(t)] = t
  29408. })
  29409. }
  29410. ,
  29411. n.prototype.filter = function(e) {
  29412. var t = this.list.filter(e);
  29413. return this.reIndex(),
  29414. t
  29415. }
  29416. ,
  29417. n.prototype.reduce = function(e, t) {
  29418. return this.list.reduce(e, t)
  29419. }
  29420. ,
  29421. n.prototype.sort = function(e) {
  29422. return this.list.sort(e)
  29423. }
  29424. ,
  29425. n.prototype.indexOf = function(e) {
  29426. for (var t = 0; t < this.list.length; ++t)
  29427. if (this.list[t] === e)
  29428. return t;
  29429. return -1
  29430. }
  29431. ,
  29432. t.exports = n
  29433. }
  29434. ).call(this, "/js/util/IndexedCollection.js")
  29435. }
  29436. , {
  29437. "./common": 185,
  29438. "./logger": 189
  29439. }],
  29440. 176: [function(e, t, i) {
  29441. "use strict";
  29442. var n = e("../constants")
  29443. , r = {};
  29444. r.RADIANS_PER_DEGREE = Math.PI / 180,
  29445. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  29446. r.Vector3 = function(e, t, i) {
  29447. this.x = e || 0,
  29448. this.y = t || 0,
  29449. this.z = i || 0
  29450. }
  29451. ,
  29452. r.Matrix4 = function() {
  29453. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  29454. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  29455. }
  29456. ,
  29457. r.Matrix4.prototype = {
  29458. identity: function() {
  29459. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  29460. this
  29461. },
  29462. copy: function(e) {
  29463. return this.elements.set(e.elements),
  29464. this
  29465. },
  29466. applyToVector3: function(e) {
  29467. var t = e.x
  29468. , i = e.y
  29469. , n = e.z
  29470. , r = this.elements;
  29471. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  29472. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  29473. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  29474. this
  29475. },
  29476. getInverse: function(e, t) {
  29477. var i = this.elements
  29478. , n = e.elements
  29479. , r = n[0]
  29480. , o = n[1]
  29481. , a = n[2]
  29482. , s = n[3]
  29483. , l = n[4]
  29484. , c = n[5]
  29485. , h = n[6]
  29486. , u = n[7]
  29487. , d = n[8]
  29488. , p = n[9]
  29489. , f = n[10]
  29490. , g = n[11]
  29491. , m = n[12]
  29492. , v = n[13]
  29493. , A = n[14]
  29494. , y = n[15]
  29495. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  29496. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  29497. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  29498. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  29499. , w = r * C + o * I + a * E + s * b;
  29500. if (0 === w) {
  29501. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  29502. if (t)
  29503. throw new Error(_);
  29504. return console.warn(_),
  29505. this.identity()
  29506. }
  29507. var T = 1 / w;
  29508. return i[0] = C * T,
  29509. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  29510. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  29511. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  29512. i[4] = I * T,
  29513. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  29514. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  29515. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  29516. i[8] = E * T,
  29517. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  29518. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  29519. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  29520. i[12] = b * T,
  29521. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  29522. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  29523. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  29524. this
  29525. },
  29526. makeRotationFromQuaternion: function(e) {
  29527. var t = this.elements
  29528. , i = e.x
  29529. , n = e.y
  29530. , r = e.z
  29531. , o = e.w
  29532. , a = i + i
  29533. , s = n + n
  29534. , l = r + r
  29535. , c = i * a
  29536. , h = i * s
  29537. , u = i * l
  29538. , d = n * s
  29539. , p = n * l
  29540. , f = r * l
  29541. , g = o * a
  29542. , m = o * s
  29543. , v = o * l;
  29544. return t[0] = 1 - (d + f),
  29545. t[4] = h - v,
  29546. t[8] = u + m,
  29547. t[1] = h + v,
  29548. t[5] = 1 - (c + f),
  29549. t[9] = p - g,
  29550. t[2] = u - m,
  29551. t[6] = p + g,
  29552. t[10] = 1 - (c + d),
  29553. t[3] = 0,
  29554. t[7] = 0,
  29555. t[11] = 0,
  29556. t[12] = 0,
  29557. t[13] = 0,
  29558. t[14] = 0,
  29559. t[15] = 1,
  29560. this
  29561. }
  29562. },
  29563. r.Quaternion = function(e, t, i, n) {
  29564. this._x = e || 0,
  29565. this._y = t || 0,
  29566. this._z = i || 0,
  29567. this._w = void 0 !== n ? n : 1
  29568. }
  29569. ,
  29570. r.Quaternion.prototype = {
  29571. get x() {
  29572. return this._x
  29573. },
  29574. set x(e) {
  29575. this._x = e
  29576. },
  29577. get y() {
  29578. return this._y
  29579. },
  29580. set y(e) {
  29581. this._y = e
  29582. },
  29583. get z() {
  29584. return this._z
  29585. },
  29586. set z(e) {
  29587. this._z = e
  29588. },
  29589. get w() {
  29590. return this._w
  29591. },
  29592. set w(e) {
  29593. this._w = e
  29594. },
  29595. copy: function(e) {
  29596. this._x = e.x,
  29597. this._y = e.y,
  29598. this._z = e.z,
  29599. this._w = e.w
  29600. },
  29601. inverse: function() {
  29602. return this.conjugate().normalize()
  29603. },
  29604. conjugate: function() {
  29605. return this._x *= -1,
  29606. this._y *= -1,
  29607. this._z *= -1,
  29608. this
  29609. },
  29610. length: function() {
  29611. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29612. },
  29613. normalize: function() {
  29614. var e = this.length();
  29615. return 0 === e ? (this._x = 0,
  29616. this._y = 0,
  29617. this._z = 0,
  29618. this._w = 1) : (e = 1 / e,
  29619. this._x = this._x * e,
  29620. this._y = this._y * e,
  29621. this._z = this._z * e,
  29622. this._w = this._w * e),
  29623. this
  29624. },
  29625. setFromAxisAngle: function(e, t) {
  29626. var i = t / 2
  29627. , n = Math.sin(i);
  29628. return this._x = e.x * n,
  29629. this._y = e.y * n,
  29630. this._z = e.z * n,
  29631. this._w = Math.cos(i),
  29632. this
  29633. },
  29634. setFromUnitVectors: function() {
  29635. var e, t, i = 1e-6;
  29636. return function(n, o) {
  29637. return void 0 === e && (e = new r.Vector3),
  29638. t = r.dot(n, o) + 1,
  29639. t < i ? (t = 0,
  29640. 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),
  29641. this._x = e.x,
  29642. this._y = e.y,
  29643. this._z = e.z,
  29644. this._w = t,
  29645. this.normalize()
  29646. }
  29647. }(),
  29648. multiply: function(e) {
  29649. return this.multiplyQuaternions(this, e)
  29650. },
  29651. premultiply: function(e) {
  29652. return this.multiplyQuaternions(e, this)
  29653. },
  29654. multiplyQuaternions: function(e, t) {
  29655. var i = e._x
  29656. , n = e._y
  29657. , r = e._z
  29658. , o = e._w
  29659. , a = t._x
  29660. , s = t._y
  29661. , l = t._z
  29662. , c = t._w;
  29663. return this._x = i * c + o * a + n * l - r * s,
  29664. this._y = n * c + o * s + r * a - i * l,
  29665. this._z = r * c + o * l + i * s - n * a,
  29666. this._w = o * c - i * a - n * s - r * l,
  29667. this
  29668. }
  29669. },
  29670. r.convertWorkshopVector = function(e) {
  29671. return new r.Vector3(-e.x,e.y,e.z)
  29672. }
  29673. ,
  29674. r.convertWorkshopQuaternion = function(e) {
  29675. 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))
  29676. }
  29677. ;
  29678. r.convertWorkshopOrthoZoom = function(e) {//xzw
  29679. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29680. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  29681. }
  29682. ,
  29683. r.convertWorkshopPanoramaQuaternion = function(e) {
  29684. 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))
  29685. }
  29686. ,
  29687. r.normalize = function(e) {
  29688. var t = e.x * e.x + e.y * e.y + e.z * e.z
  29689. , i = Math.sqrt(t);
  29690. e.x /= i,
  29691. e.y /= i,
  29692. e.z /= i
  29693. }
  29694. ,
  29695. r.dot = function(e, t) {
  29696. return e.x * t.x + e.y * t.y + e.z * t.z
  29697. }
  29698. ,
  29699. r.cross = function(e, t, i) {
  29700. var n = e.x
  29701. , r = e.y
  29702. , o = e.z;
  29703. i.x = r * t.z - o * t.y,
  29704. i.y = o * t.x - n * t.z,
  29705. i.z = n * t.y - r * t.x
  29706. }
  29707. ,
  29708. r.setVector = function(e, t, i, n) {
  29709. e.x = t,
  29710. e.y = i,
  29711. e.z = n
  29712. }
  29713. ,
  29714. r.copyVector = function(e, t) {
  29715. t.x = e.x,
  29716. t.y = e.y,
  29717. t.z = e.z
  29718. }
  29719. ,
  29720. r.addVector = function(e, t) {
  29721. e.x += t.x,
  29722. e.y += t.y,
  29723. e.z += t.z
  29724. }
  29725. ,
  29726. r.subVector = function(e, t) {
  29727. e.x -= t.x,
  29728. e.y -= t.y,
  29729. e.z -= t.z
  29730. }
  29731. ,
  29732. r.applyQuaternionToVector = function(e, t) {
  29733. var i = t.x
  29734. , n = t.y
  29735. , r = t.z
  29736. , o = e.x
  29737. , a = e.y
  29738. , s = e.z
  29739. , l = e.w
  29740. , c = l * i + a * r - s * n
  29741. , h = l * n + s * i - o * r
  29742. , u = l * r + o * n - a * i
  29743. , d = -o * i - a * n - s * r;
  29744. t.x = c * l + d * -o + h * -s - u * -a,
  29745. t.y = h * l + d * -a + u * -o - c * -s,
  29746. t.z = u * l + d * -s + c * -a - h * -o
  29747. }
  29748. ,
  29749. r.angleBetweenVectors = function(e, t) {
  29750. return Math.acos(r.dot(e, t))
  29751. }
  29752. ,
  29753. t.exports = r
  29754. }
  29755. , {
  29756. "../constants": 8
  29757. }],
  29758. 177: [function(e, t, i) {
  29759. (function(i) {
  29760. "use strict";
  29761. function n(e) {
  29762. this.cache = null,
  29763. this.expires = 0
  29764. }
  29765. function r() {
  29766. this.baseUrl = null,
  29767. this.cache = null,
  29768. this.expires = 0
  29769. }
  29770. function o() {
  29771. this.baseUrl = null,
  29772. this.expires = 0
  29773. }
  29774. function a(e) {
  29775. this.initialLoadingPromise = null,
  29776. this.endpoint = e + "?type=3",
  29777. this.urlContainer = null,
  29778. this.authorizationHeader = h.getAuthorizationHeader(),
  29779. this.containerClasses = [o, r, n]
  29780. }
  29781. var s = e("./ajax")
  29782. , l = e("./logger")
  29783. , c = e("../constants")
  29784. , h = e("./showcase")
  29785. , u = (e("../ab"),
  29786. new l(i));
  29787. n.prototype = {
  29788. version: 1,
  29789. validate: function(e) {
  29790. return "catalog.json"in e && Object.keys(e).length > 0
  29791. },
  29792. update: function(e) {
  29793. return this.cache = e,
  29794. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29795. $.when()
  29796. },
  29797. get: function(e) {
  29798. return this.cache[e]
  29799. }
  29800. },
  29801. r.prototype = {
  29802. version: 2,
  29803. validate: function(e) {
  29804. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  29805. },
  29806. update: function(e) {
  29807. return this.baseUrl = e["base.url"],
  29808. this.cache = e,
  29809. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29810. $.when()
  29811. },
  29812. get: function(e) {
  29813. var t = this.cache[e];
  29814. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  29815. }
  29816. },
  29817. o.prototype = {
  29818. version: 3,
  29819. validate: function(e) {
  29820. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29821. },
  29822. update: function(e) {
  29823. return this.baseUrl = e.templates[0],
  29824. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  29825. $.when()
  29826. },
  29827. get: function(e) {
  29828. return this.baseUrl.replace("{{filename}}", e)
  29829. }
  29830. },
  29831. a.prototype = {
  29832. init: function() {
  29833. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  29834. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  29835. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  29836. this.refresh().done(function() {
  29837. u.debug("Refreshed")
  29838. }).fail(function() {
  29839. u.error("Failed url refresh, urls might go stale soon")
  29840. }))
  29841. }
  29842. .bind(this), c.signedUrlCheckInterval),
  29843. this.initialLoadingPromise = this.refresh(),
  29844. this.initialLoadingPromise)
  29845. },
  29846. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  29847. e = e || {};
  29848. /*var t = void 0 === e.cache || e.cache;
  29849. return s.get( this.endpoint , { //file
  29850. responseType: "json",
  29851. prefetchFrom: t ? "files" : null,
  29852. cache: t,
  29853. auth: this.authorizationHeader
  29854. }).then(function(e) {
  29855. if (this.urlContainer && this.urlContainer.validate(e))
  29856. return this.urlContainer.update(e);
  29857. for (var i = 0; i < this.containerClasses.length; i++) {
  29858. var n = this.containerClasses[i]
  29859. , r = new n;
  29860. if (r.validate(e))
  29861. return u.info("Using urls version " + r.version),
  29862. this.urlContainer = r,
  29863. this.urlContainer.update(e)
  29864. }
  29865. return t ? this.refresh({
  29866. cache: !1
  29867. }) : $.Deferred().reject("missing-urls")
  29868. }
  29869. .bind(this), function(e) {
  29870. return "loading-failed"
  29871. }) */
  29872. return $.Deferred().resolve();
  29873. },
  29874. get: function(e) {
  29875. //return this.urlContainer.get(e)
  29876. return window.DATA.files.templates[0].replace("{{filename}}", e)
  29877. }
  29878. },
  29879. t.exports = a
  29880. }
  29881. ).call(this, "/js/util/ModelUrls.js")
  29882. }
  29883. , {
  29884. "../ab": 3,
  29885. "../constants": 8,
  29886. "./ajax": 181,
  29887. "./logger": 189,
  29888. "./showcase": 193
  29889. }],
  29890. 178: [function(e, t, i) {
  29891. (function(i) {
  29892. "use strict";
  29893. function n() {
  29894. u.call(this),
  29895. this.neighbourMap = {},
  29896. this.map = null
  29897. }
  29898. var r = e("three")
  29899. , o = e("./common")
  29900. , a = e("../settings")
  29901. , s = e("../objects/Panorama")
  29902. , a = e("../settings")
  29903. , l = e("./aStar")
  29904. , c = e("./logger")
  29905. , h = new c(i)
  29906. , u = e("./IndexedCollection")
  29907. , d = e("./transitions");
  29908. o.inherit(n, u),
  29909. n.prototype.getIndex = function(e) {
  29910. return e.id
  29911. }
  29912. ,
  29913. n.prototype.find = function(e, t) {
  29914. var i = o.filterAll(this.list, e);
  29915. return 0 === i.length ? null : (t && t.forEach(function(e) {
  29916. i = o.stableSort(i, e)
  29917. }),
  29918. i[0])
  29919. }
  29920. /* n.prototype.sortByScore = function(e, t) {
  29921. var i = o.filterAll(this.list, e);
  29922. return 0 === i.length ? null : i = i.map(function(e) {
  29923. return {
  29924. pano: e,
  29925. score: t.reduce(function(t, i) {
  29926. return t + i(e)
  29927. }, 0)
  29928. }
  29929. }).sort(function(e, t) {
  29930. return t.score - e.score;
  29931. })
  29932. } */
  29933. ,
  29934. n.prototype.sortByScore = function( request, rank){
  29935. return common.sortByScore(this.list, request, rank)
  29936. }
  29937. ,
  29938. n.prototype.lowestByScore = function(e, t, i) {
  29939. return this.findRankedByScore(0, e, t, i)
  29940. }
  29941. ,
  29942. n.prototype.findRankedByScore = function(e, t, i, n) {
  29943. n && (n.candidates = null,
  29944. n.pano = null),
  29945. e || (e = 0);
  29946. var r = this.sortByScore(t, i);
  29947. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  29948. n.pano = r[e].item),
  29949. r[e].item)
  29950. }
  29951. ,
  29952. n.prototype.showPanoScores = function(e) {
  29953. this.list.forEach(function(e) {
  29954. e.removeTextSprite()
  29955. });
  29956. var t = 6344768;
  29957. e.forEach(function(e) {
  29958. e.pano.addTextSprite(e.score.toFixed(2), t),
  29959. t = 16428055
  29960. })
  29961. }
  29962. ,
  29963. n.prototype.isNeighbour = function(e, t) {
  29964. return this.neighbourMap[e.id][t.id]
  29965. }
  29966. ,
  29967. n.prototype.getNeighbours = function(e) {
  29968. return this.neighbourMap[e.id]
  29969. }
  29970. ,
  29971. n.prototype.setNeighbour = function(e, t, i) {
  29972. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29973. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29974. this.neighbourMap[e.id][e.id] = !0,
  29975. this.neighbourMap[t.id][t.id] = !0,
  29976. this.neighbourMap[e.id][t.id] = i,
  29977. this.neighbourMap[t.id][e.id] = i,
  29978. this.neighbourMap[e.id]
  29979. }
  29980. ,
  29981. n.prototype.findClosest = function(e, t) {
  29982. var i = [s.filters.isPanoAligned()];
  29983. return t && i.push(s.filters.inDirection(e, t, .75)),
  29984. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29985. }
  29986. ,
  29987. n.prototype.dualNeighbors = function(e, t) {
  29988. var i, n = [];
  29989. for (i in this.neighbourMap[e.id])
  29990. this.neighbourMap[t.id][i] && n.push(i);
  29991. return n
  29992. }
  29993. ,
  29994. n.prototype.populate_path_graph = function() {
  29995. 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;
  29996. for (e = 0; e < this.list.length; e += 1) {
  29997. o = this.list[e],
  29998. s = {},
  29999. l = !1,
  30000. i = o.neighbourPanos || o.findNeighourPanos();
  30001. for (t in i)
  30002. if (i[t]) {
  30003. a = this.index[t],
  30004. p.copy(o.floorPosition),
  30005. p.sub(a.floorPosition);
  30006. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  30007. , v = (Math.abs(p.y) / Math.max(m, .01),
  30008. Math.max(0, Math.abs(p.y) - .2));
  30009. v > 0 ? (f += 1,
  30010. v = Math.pow(4 * v, 2),
  30011. m = Math.pow(m, 2),
  30012. n = Math.sqrt(v * v + m * m)) : (g += 1,
  30013. n = p.length()),
  30014. s[a.id] = n,
  30015. l = !0
  30016. }
  30017. l ? u[o.id] = s : d += 1
  30018. }
  30019. this.map = u,
  30020. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  30021. }
  30022. ,
  30023. n.prototype.aStarSearch = function(e, t) {
  30024. var i = Date.now()
  30025. , n = new l({
  30026. start: e,
  30027. isEnd: function(e) {
  30028. return e === t
  30029. },
  30030. neighbor: function(e) {
  30031. var t = e.neighbourPanos || e.findNeighourPanos()
  30032. , i = [];
  30033. for (var n in t)
  30034. t[n] && i.push(this.index[n]); //add: t[n] &&
  30035. return i
  30036. }
  30037. .bind(this),
  30038. distance: function(e, t) {
  30039. var i = this.map[e.id]
  30040. , n = i[t.id];
  30041. return n
  30042. }
  30043. .bind(this),
  30044. heuristic: function(e, t) {
  30045. return 1
  30046. }
  30047. .bind(this),
  30048. hash: function(e) {
  30049. return e.id
  30050. },
  30051. timeout: 5e3
  30052. });
  30053. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  30054. "success" !== n.status)
  30055. return h.debug("Did not find A* path from " + e + " to " + t),
  30056. null;
  30057. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  30058. var r = [];
  30059. return n.path.forEach(function(e) {
  30060. r.push(e.id)
  30061. }),
  30062. r
  30063. }
  30064. ,
  30065. n.prototype.includeNodesNearPath = function() {
  30066. var e = new r.Vector3
  30067. , t = new r.Vector3
  30068. , i = new r.Vector3
  30069. , n = new r.Vector3
  30070. , o = new r.Vector3
  30071. , a = new r.Vector3
  30072. , s = new r.Vector3
  30073. , l = new r.Vector3
  30074. , c = []
  30075. , h = new r.Vector3
  30076. , u = new r.Vector3;
  30077. return function(r, d) {
  30078. if (r)
  30079. for (var p = function(e, t, i) {
  30080. return o.copy(t).sub(e),
  30081. o.dot(i)
  30082. }, f = function(e, t) {
  30083. return p(h, e.position, i) - p(h, t.position, i)
  30084. }, g = 0; g < r.length - 1; ) {
  30085. var m = r[g]
  30086. , v = r[g + 1]
  30087. , A = this.index[m]
  30088. , y = this.index[v];
  30089. h.copy(A.position),
  30090. u.copy(y.position),
  30091. c.length = 0,
  30092. e.copy(u).sub(h),
  30093. i.copy(e).normalize();
  30094. for (var C = 0; C < this.list.length; C++) {
  30095. var I = this.list[C];
  30096. o.copy(I.position).sub(h);
  30097. var E = o.dot(i);
  30098. if (E > 0) {
  30099. s.copy(i),
  30100. s.multiplyScalar(E),
  30101. a.copy(o),
  30102. a.sub(s);
  30103. var b = a.length();
  30104. if (b < d) {
  30105. t.copy(e).negate(),
  30106. n.copy(t).normalize(),
  30107. l.copy(I.position).sub(u);
  30108. var w = l.dot(n);
  30109. w > 0 && c.push(I)
  30110. }
  30111. }
  30112. }
  30113. if (c.length > 0) {
  30114. c.sort(f);
  30115. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  30116. r[_] = r[_ - c.length];
  30117. for (var T = 0; T < c.length; T++)
  30118. r[T + g + 1] = c[T].id
  30119. }
  30120. g += c.length + 1
  30121. }
  30122. }
  30123. }(),
  30124. /* n.prototype. = function(e, t) {
  30125. var i = void 0 === e ? a.panorama.markerOpacity : e
  30126. , n = this.list.findIndex(function(e) {
  30127. return e.marker
  30128. });
  30129. if (!(n < 0)) {
  30130. var r = this.list[n].marker.material.opacity;
  30131. if (r !== e) {
  30132. var o = i - r;
  30133. d.trigger({
  30134. func: function(e, t) {
  30135. var i = r + e * o;
  30136. this.forEach(function(e) {
  30137. e.marker && (e.marker.material.opacity = i)
  30138. })
  30139. }
  30140. .bind(this),
  30141. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  30142. name: "_fpm"
  30143. })
  30144. }
  30145. }
  30146. } */
  30147. n.prototype.fadeMarkerOpacity = function(e, t, gr) {
  30148. d.cancelById('fadeMarkerOpacity')
  30149. var n = this.list.findIndex(function (e) {
  30150. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  30151. return e.marker
  30152. })
  30153. if (n < 0) {
  30154. //logger.info('marker findIndex<0')
  30155. return
  30156. }
  30157. var group
  30158. var tran = function (list, index) {
  30159. list.member = list.member.filter(function (m) {
  30160. return m.marker && m.marker.material.opacity != list.toOp
  30161. })
  30162. transitions.trigger({
  30163. func: function (e, t) {
  30164. //e:0-1
  30165. list.member.forEach(function (m) {
  30166. var o = m.marker.oldOpacity
  30167. var i = o + e * (list.toOp - o)
  30168. m.marker && (m.marker.material.opacity = i)
  30169. })
  30170. }.bind(this),
  30171. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  30172. name: '_fpm_' + index,
  30173. id: 'fadeMarkerOpacity',
  30174. })
  30175. }
  30176. this.forEach(function (e) {
  30177. //先记录旧的opacity
  30178. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  30179. })
  30180. group = gr
  30181. /* if (e > 0 && gr) {
  30182. group = gr
  30183. } else {
  30184. group = [
  30185. {
  30186. member: this.list,
  30187. toOp: 0,
  30188. },
  30189. ]
  30190. } */
  30191. for (var i = 0; i < group.length; i++) {
  30192. tran(group[i], i)
  30193. }
  30194. }
  30195. ,
  30196. t.exports = n
  30197. }
  30198. ).call(this, "/js/util/PanoramaCollection.js")
  30199. }
  30200. , {
  30201. "../objects/Panorama": 148,
  30202. "../settings": 166,
  30203. "./IndexedCollection": 175,
  30204. "./aStar": 180,
  30205. "./common": 185,
  30206. "./logger": 189,
  30207. "./transitions": 195,
  30208. three: 217
  30209. }],
  30210. 179: [function(e, t, i) {
  30211. "use strict";
  30212. function n() {
  30213. this.actionSequence = [],
  30214. this.actionSequenceInProgress = !1
  30215. }
  30216. function r(e, t, i, n) {
  30217. s.trackAlways("zoom_" + e, {
  30218. from: t,
  30219. to: i,
  30220. pano: n
  30221. })
  30222. }
  30223. function o(e, t) {
  30224. r("initial", 1, e, t)
  30225. }
  30226. function a(e, t, i) {
  30227. r("followup", e, t, i)
  30228. }
  30229. var s = e("../analytics");
  30230. n.prototype.reset = function(e) {
  30231. this.actionSequenceInProgress = !1,
  30232. this.actionSequence.length = 0
  30233. }
  30234. ,
  30235. n.prototype.addZoomAction = function() {
  30236. var e = null
  30237. , t = null
  30238. , i = !1
  30239. , n = function() {
  30240. if (e = null,
  30241. this.actionSequence.length > 0) {
  30242. var i = this.actionSequence[0].start
  30243. , n = this.actionSequence[this.actionSequence.length - 1].end;
  30244. 1 === i ? o(n, t) : a(i, n, t)
  30245. }
  30246. this.reset()
  30247. };
  30248. return function(r, o, a) {
  30249. if (r !== o) {
  30250. i || (n = n.bind(this),
  30251. i = !0),
  30252. e && (window.clearTimeout(e),
  30253. e = null),
  30254. a === t && this.actionSequenceInProgress || (this.reset(),
  30255. t = a),
  30256. this.actionSequenceInProgress = !0;
  30257. var s = {
  30258. start: r,
  30259. end: o
  30260. };
  30261. this.actionSequence.push(s),
  30262. e = window.setTimeout(n, 150)
  30263. }
  30264. }
  30265. }(),
  30266. t.exports = n
  30267. }
  30268. , {
  30269. "../analytics": 4
  30270. }],
  30271. 180: [function(e, t, i) {
  30272. "use strict";
  30273. function n(e) {
  30274. void 0 === e.timeout && (e.timeout = 1 / 0);
  30275. var t = e.hash || o
  30276. , i = {
  30277. data: e.start,
  30278. g: 0,
  30279. h: e.heuristic(e.start)
  30280. }
  30281. , n = i;
  30282. i.f = i.h;
  30283. var h = new s
  30284. , u = new l(a)
  30285. , d = c();
  30286. u.push(i),
  30287. d.set(t(i.data), i);
  30288. for (var p = new Date; u.size(); ) {
  30289. if (new Date - p > e.timeout)
  30290. return {
  30291. status: "timeout",
  30292. cost: n.g,
  30293. path: r(n)
  30294. };
  30295. var f = u.pop();
  30296. if (d.delete(t(f.data)),
  30297. e.isEnd(f.data))
  30298. return {
  30299. status: "success",
  30300. cost: f.g,
  30301. path: r(f)
  30302. };
  30303. h.add(t(f.data));
  30304. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  30305. var v = g[m];
  30306. if (!h.contains(t(v))) {
  30307. var A = f.g + e.distance(f.data, v)
  30308. , y = d.get(t(v))
  30309. , C = !1;
  30310. if (void 0 === y)
  30311. y = {
  30312. data: v
  30313. },
  30314. d.set(t(v), y);
  30315. else {
  30316. if (y.g < A)
  30317. continue;
  30318. C = !0
  30319. }
  30320. y.parent = f,
  30321. y.g = A,
  30322. y.h = e.heuristic(v),
  30323. y.f = A + y.h,
  30324. y.h < n.h && (n = y),
  30325. C ? u.heapify() : u.push(y)
  30326. }
  30327. }
  30328. }
  30329. return {
  30330. status: "noPath",
  30331. cost: n.g,
  30332. path: r(n)
  30333. }
  30334. }
  30335. function r(e) {
  30336. if (void 0 !== e.parent) {
  30337. var t = r(e.parent);
  30338. return t.push(e.data),
  30339. t
  30340. }
  30341. return [e.data]
  30342. }
  30343. function o(e) {
  30344. return e.toString()
  30345. }
  30346. function a(e, t) {
  30347. return e.f - t.f
  30348. }
  30349. var s = e("Set")
  30350. , l = e("heap")
  30351. , c = e("dict");
  30352. t.exports = n
  30353. }
  30354. , {
  30355. Set: 196,
  30356. dict: 210,
  30357. heap: 211
  30358. }],
  30359. 181: [function(e, t, i) {
  30360. (function(i) {
  30361. "use strict";
  30362. function n(e, t, i) {
  30363. var n = new XMLHttpRequest;
  30364. if (i && "withCredentials"in n)
  30365. n.open(e, t, i);
  30366. else if ("undefined" != typeof XDomainRequest)
  30367. n = new XDomainRequest,
  30368. n.open(e, t);
  30369. else {
  30370. if (i)
  30371. throw "Browser does not support CORS!";
  30372. n.open(e, t)
  30373. }
  30374. return n
  30375. }
  30376. function r(e, t, i) {
  30377. function o() {
  30378. u.warn("Retrying ", t),
  30379. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  30380. }
  30381. function a(e, t) {
  30382. var i = e.response;
  30383. if ("json" === t && "object" != typeof i)
  30384. try {
  30385. i = JSON.parse(e.responseText)
  30386. } catch (e) {
  30387. return void c.reject({
  30388. error: "Failed parsing JSON"
  30389. })
  30390. }
  30391. else if ("image/jpeg" === t) {
  30392. var n = new Uint8Array(e.response)
  30393. , r = new Blob([n],{
  30394. type: "image/jpeg"
  30395. })
  30396. , o = URL.createObjectURL(r);
  30397. i = new Image,
  30398. i.src = o,
  30399. i.crossOrigin = "Anonymous",
  30400. i.onload = function() {
  30401. URL.revokeObjectURL(o)
  30402. }
  30403. }
  30404. return i
  30405. }
  30406. var s = n(e, t, !1);
  30407. if (i = i || {},
  30408. i.retries = void 0 !== i.retries ? i.retries : 0,
  30409. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  30410. i.responseType)
  30411. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  30412. s.responseType = i.responseType;
  30413. else {
  30414. if ("image/jpeg" !== i.responseType)
  30415. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  30416. s.responseType = "arraybuffer"
  30417. }
  30418. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  30419. i.auth && s.setRequestHeader("Authorization", i.auth),
  30420. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  30421. s.setRequestHeader("Content-Type", "application/json")),
  30422. "object" == typeof i.headers)
  30423. for (var l in i.headers)
  30424. s.setRequestHeader(l, i.headers[l]);
  30425. var c = $.Deferred();
  30426. return s.onreadystatechange = function(e) {
  30427. if (4 === this.readyState)
  30428. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  30429. i.retries++,
  30430. setTimeout(o, 1e3);
  30431. else if (200 === this.status) {
  30432. var t = a(this, i.responseType);
  30433. c.resolve(t)
  30434. } else
  30435. c.reject(this)
  30436. }
  30437. ,
  30438. s.onprogress = function(e) {
  30439. c.notify(e)
  30440. }
  30441. ,
  30442. s.send(i.data),
  30443. c.promise()
  30444. }
  30445. function o(e) {
  30446. return Object.keys(e).sort().map(function(t) {
  30447. return {
  30448. key: t,
  30449. value: e[t]
  30450. }
  30451. })
  30452. }
  30453. function a(e, t) {
  30454. var i = t.responseType || null
  30455. , n = t.auth || null
  30456. , r = t.prefetchFrom || null
  30457. , a = e + "__" + i + "__" + n + "__" + r;
  30458. return t.headers && o(t.headers).forEach(function(e) {
  30459. a += "__" + e.key + ":" + e.value
  30460. }),
  30461. a
  30462. }
  30463. function s(e, t) {
  30464. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  30465. }
  30466. function l(e, t, i) {
  30467. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  30468. }
  30469. var c = e("./logger")
  30470. , h = e("../ab")
  30471. , u = new c(i);
  30472. window.URL = window.URL || window.webkitURL,
  30473. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  30474. window.DATA = window.DATA || {}
  30475. /* setTimeout(function() {//MP-- xzw delete
  30476. window.MP_REQUEST_CACHE = null,
  30477. window.DATA = {}
  30478. }, 6e4),
  30479. window.onpageshow = function(e) {
  30480. e.persisted && (window.MP_REQUEST_CACHE = null,
  30481. window.DATA = {})
  30482. } */
  30483. ,
  30484. t.exports = {
  30485. get: function(e, t) {
  30486. t = t || {};
  30487. var i = void 0 === t.cache || t.cache;
  30488. if (i) {
  30489. var n = s(e, t);
  30490. if (n)
  30491. return n
  30492. }
  30493. var o;
  30494. return o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r("GET", e, t),
  30495. i && l(e, t, o),
  30496. o
  30497. },
  30498. post: function(e, t) {
  30499. return r("POST", e, t)
  30500. },
  30501. patch: function(e, t) {
  30502. return r("PATCH", e, t)
  30503. },
  30504. getImage: function(e, t) { //xzw改 遇到部分图片在ios16以上显示不出,ios18更严重。查阅解决方法为使用decode
  30505. function i() {
  30506. u.warn("Retrying ", e),
  30507. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  30508. }
  30509. var n = $.Deferred()
  30510. , r = new Image
  30511. , o = this;
  30512. e = h.changeIfImageOptimzing(e)
  30513. r.crossOrigin = "anonymous",
  30514. r.src = e
  30515. /* if(browser.texNeedDecode){//
  30516. r.decode().then((e) => {
  30517. let delay = Math.round(r.width * r.height / 30000)
  30518. browser.isMobile() && (delay *= 3)
  30519. //console.log('delay111111111111',delay)
  30520. setTimeout(()=>{n.resolve(r)}, delay ) //需延迟,否则报错 WebGL: INVALID_VALUE: texImage2D: bad image data,但延迟时间不定。 试过定时1秒后更新tex没用。 直接改图为rgb模式了
  30521. }).catch((error) => {
  30522. console.error('Image decoding failed:?!!!!', error);
  30523. });
  30524. }else{//原本的代码: */
  30525. null !== t && void 0 !== t || (t = 3)
  30526. r.onerror = function() {
  30527. t > 0 ? setTimeout(i, 1e3) : n.reject()
  30528. }
  30529. ,
  30530. r.onload = function() {
  30531. n.resolve(r)
  30532. }
  30533. //}
  30534. return n
  30535. /*
  30536. Safari 浏览器在 iOS 上有一个特殊的图像解码策略,称为“懒加载”或“延迟解码”。这意味着图像不会立即解码,而是在需要显示时才解码。这可能会导致某些情况下图像无法及时显示。
  30537. 使用 decode() 方法:如果你使用的是现代浏览器(如 Safari 14+),可以尝试使用 ImageBitmapRenderingContext 的 createImageBitmap() 和 decode() 方法来提前解码图像。
  30538. const image = new Image();
  30539. image.src = 'image.png';
  30540. image.decode().then(() => {
  30541. const texture = new THREE.Texture(image);
  30542. texture.needsUpdate = true;
  30543. }).catch((error) => {
  30544. console.error('Image decoding failed:', error);
  30545. });
  30546. */
  30547. }
  30548. }
  30549. }
  30550. ).call(this, "/js/util/ajax.js")
  30551. }
  30552. , {
  30553. "../ab": 3,
  30554. "./logger": 189
  30555. }],
  30556. 182: [function(e, t, i) {
  30557. "use strict";
  30558. function n(e, t) {
  30559. var i = window.navigator.userAgent
  30560. , n = i.match(e);
  30561. return n = n ? n[1].split(t) : [],
  30562. {
  30563. major: parseInt(n[0]) || 0,
  30564. minor: parseInt(n[1]) || 0,
  30565. patch: parseInt(n[2]) || 0
  30566. }
  30567. }
  30568. var r = e("../exception/DeviceMismatchException");
  30569. t.exports = {
  30570. supportsFullscreen: function() {
  30571. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  30572. },
  30573. isPointerLocked: function() {
  30574. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  30575. },
  30576. requestFullscreen: function(e, t) {
  30577. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  30578. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  30579. },
  30580. requestPointerLock: function() {
  30581. var e;
  30582. if (document.fullscreenElement)
  30583. e = document.fullscreenElement();
  30584. else if (document.mozFullscreenElement)
  30585. e = document.mozFullscreenElement();
  30586. else if (document.mozFullScreenElement)
  30587. e = document.mozFullScreenElement();
  30588. else {
  30589. if (!document.webkitFullscreenElement)
  30590. return;
  30591. e = document.webkitFullscreenElement()
  30592. }
  30593. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  30594. e.requestPointerLock(),
  30595. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  30596. },
  30597. exitPointerLock: function() {
  30598. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  30599. document.exitPointerLock()
  30600. },
  30601. exitFullscreen: function() {
  30602. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  30603. },
  30604. details: function() {
  30605. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  30606. return e ? {
  30607. name: e[1],
  30608. version: parseInt(e[2]),
  30609. platform: navigator.platform
  30610. } : {}
  30611. },
  30612. is: function(e) {
  30613. return this.details() && this.details().name === e
  30614. },
  30615. inIframe: function() {
  30616. return window.parent !== window
  30617. },
  30618. aspectRatio: function() {
  30619. var e = $("#player").width() / $("#player").height();
  30620. return isFinite(e) ? e : 0
  30621. },
  30622. userAgent: function() {
  30623. return window.navigator.userAgent
  30624. },
  30625. isLandscape: function() {
  30626. return this.isMobile && this.aspectRatio() > 1
  30627. },
  30628. isSmallScreen: function() {
  30629. var e = screen.width / window.devicePixelRatio;
  30630. return e < 240
  30631. },
  30632. detectIE: function() {
  30633. var e = window.navigator.userAgent
  30634. , t = e.indexOf("MSIE ");
  30635. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  30636. },
  30637. detectSafari: function() {
  30638. var e = window.navigator.userAgent
  30639. , t = e.indexOf("Safari");
  30640. return t !== -1 && !this.detectChrome()//因为 Chrome 的用户代理字符串中也包含 "Safari"。
  30641. },
  30642. SafariVersion: function() {//add
  30643. if(!this.detectSafari())return;
  30644. const match = window.navigator.userAgent.match(/Version\/(\d+)\.(\d+)/);
  30645. if (match) {
  30646. return {
  30647. major: parseInt(match[1], 10),
  30648. minor: parseInt(match[2], 10)
  30649. };
  30650. }
  30651. },
  30652. detectFirefox: function() {
  30653. var e = window.navigator.userAgent;
  30654. return e.indexOf("Firefox") !== -1
  30655. },
  30656. detectChrome: function() {
  30657. var e = window.navigator.userAgent;
  30658. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  30659. },
  30660. detectOpera: function() {
  30661. var e = window.navigator.userAgent;
  30662. return e.indexOf("OPR") !== -1
  30663. },
  30664. detectIOS: function() {
  30665. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  30666. },
  30667. detectIPad: function() {
  30668. var e = window.navigator.userAgent
  30669. , t = /iPad/;
  30670. return t.test(e)
  30671. },
  30672. detectIPod: function() {
  30673. var e = window.navigator.userAgent
  30674. , t = /iPod/;
  30675. return t.test(e)
  30676. },
  30677. detectIPhone: function() {
  30678. var e = window.navigator.userAgent
  30679. , t = /iPhone/;
  30680. return t.test(e)
  30681. },
  30682. detectAndroid: function() {
  30683. var e = window.navigator.userAgent;
  30684. return e.indexOf("Android") !== -1
  30685. },
  30686. detectAndroidMobile: function() {
  30687. var e = window.navigator.userAgent;
  30688. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  30689. },
  30690. detectSamsungNative: function() {
  30691. var e = window.navigator.userAgent;
  30692. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  30693. },
  30694. detectSamsungS6: function() {
  30695. var e = window.navigator.userAgent;
  30696. return e.indexOf("SM-G92") !== -1
  30697. },
  30698. /************************************************************fyz改from徐世廷*************************************************************/
  30699. detectHUAWEI5X: function() {
  30700. return -1 !== window.navigator.userAgent.indexOf("KIW-TL00H")
  30701. },
  30702. /*******************************************************************************************************************************/
  30703. detectWebVR: function() {
  30704. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  30705. },
  30706. getVRDisplay: function() {
  30707. var e = $.Deferred();
  30708. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  30709. t.length >= 1 && e.resolve(t[0]),
  30710. e.reject(null)
  30711. }),
  30712. e) : e.reject(null)
  30713. },
  30714. iosVersion: function() {
  30715. if (!this.detectIOS())
  30716. throw new r("Did not detect an iDevice");
  30717. var e = /((?:\d+\_?){1,3}) like Mac OS/
  30718. , t = "_";
  30719. return n(e, t)
  30720. },
  30721. androidVersion: function() {
  30722. if (!this.detectAndroid())
  30723. throw new r("Did not detect an Android based device");
  30724. var e = /Android ((?:\d+\.?){1,3})/
  30725. , t = ".";
  30726. return n(e, t)
  30727. },
  30728. valueFromCookie: function(e, t) {
  30729. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  30730. if (!i)
  30731. return t;
  30732. var n = i[1];
  30733. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  30734. }
  30735. }
  30736. Object.assign(window.browser, t.exports)
  30737. t.exports = window.browser
  30738. //window.browser.texNeedDecode = true//browser.SafariVersion()?.major > 14
  30739. changeLog()
  30740. }
  30741. , {
  30742. "../exception/DeviceMismatchException": 56
  30743. }],
  30744. 183: [function(e, t, i) {
  30745. (function(i) {
  30746. "use strict";
  30747. function n(e, t) {
  30748. var i = r(t);
  30749. var replaceAll = function (str, f, e) {
  30750. //f全部替换成e
  30751. var reg = new RegExp(f, "g"); //创建正则RegExp对象
  30752. return str.replace(reg, e);
  30753. };
  30754. //获取方法:postFix = `&firstView=pano:${player.currentPano.id},qua:${math.toPrecision(player.quaternion.toArray(),4)}&qs=1`
  30755. var urlFirstView = c.valueFromHash('firstView');
  30756. if(urlFirstView){ //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.01515,0.325382,0.0052157,0.9454&qs=1
  30757. try{
  30758. urlFirstView = replaceAll(urlFirstView, "pano:", '"pano":"')
  30759. if(urlFirstView.includes('qua')){
  30760. urlFirstView = replaceAll(urlFirstView, ",qua:", '","qua":[')
  30761. urlFirstView += ']'
  30762. }else{
  30763. urlFirstView+='"'
  30764. }
  30765. urlFirstView = "{"+urlFirstView+"}"
  30766. let info = JSON.parse(urlFirstView);
  30767. i.pano = t.index[info.pano] //panos.get(info.pano)
  30768. if(!i.pano){
  30769. urlFirstView = false
  30770. console.error('检测到firstView但是 找不到该pano')
  30771. }else{
  30772. if(info.qua){
  30773. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30774. }else{
  30775. i.quaternion = new THREE.Quaternion()
  30776. }
  30777. i.zoom = -1;
  30778. i.mode = "panorama"
  30779. i.setByUrl = true
  30780. }
  30781. }catch(e){
  30782. urlFirstView = false
  30783. console.error('检测到firstView但是解析出错'+e)
  30784. }
  30785. }
  30786. if (Object.keys(i).length > 0)
  30787. return i;
  30788. if (e.heroImage)
  30789. i = o(e, t);
  30790. else if (window.DATA.camera_start) {
  30791. var n = window.DATA.camera_start;
  30792. try {
  30793. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  30794. i.position = n.camera.position,
  30795. //i.quaternion = n.camera.quaternion,
  30796. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  30797. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  30798. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  30799. d.debug("Using camera_start"),
  30800. d.debug("Modeldata pano: ", i.pano.quaternion),
  30801. d.debug("Camera start pano: ", n.pano.quaternion)),
  30802. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30803. } catch (e) {
  30804. d.warn(e.message)
  30805. if(i.mode == "panorama" && !i.pano)i.pano = t.list[0]
  30806. }
  30807. }
  30808. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30809. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  30810. i.pano = t.findClosest(i.position),
  30811. i.quaternion = i.pano.quaternion),
  30812. 0 === Object.keys(i).length) {
  30813. var a = t.list[0];
  30814. a && (i.mode = h.PANORAMA,
  30815. i.pano = a,
  30816. i.position = a.position,
  30817. i.quaternion = a.quaternion,
  30818. d.info("Starting at 1st pano " + a.id))
  30819. }
  30820. return i.mode = i.mode || h.DOLLHOUSE,
  30821. i
  30822. }
  30823. function r(e) {
  30824. var t = c.valueFromHash("start", "")
  30825. , i = {};
  30826. if ("" !== t) {
  30827. d.debug("Start override found in parameters, trying to parse..."),
  30828. i = a(t) || {};
  30829. var n = c.valueFromHash("tag", null);
  30830. n && (i.tag = n),
  30831. i.panoId && (i.pano = e.get(i.panoId))
  30832. }
  30833. return i
  30834. }
  30835. function o(e, t) {
  30836. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  30837. return {};
  30838. var i = {}
  30839. , n = e.heroImage.metadata;
  30840. d.debug("Using start position from thumbnail image"),
  30841. i.position = n.camera_position,
  30842. i.quaternion = n.camera_quaternion;
  30843. try {
  30844. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  30845. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  30846. } catch (e) {
  30847. d.debug(e.message)
  30848. }
  30849. return i
  30850. }
  30851. function a(e) {
  30852. return s.deserialize(e)
  30853. }
  30854. var s = e("../controls/serializer")
  30855. , l = e("../util/math")
  30856. , c = e("./browser")
  30857. , h = e("../enum/Viewmode")
  30858. , u = e("../util/logger")
  30859. , th = e("three")//xzw
  30860. , d = new u(i);
  30861. t.exports = {
  30862. getStartCameraOptions: n
  30863. }
  30864. }
  30865. ).call(this, "/js/util/camera.js")
  30866. }
  30867. , {
  30868. "../controls/serializer": 14,
  30869. "../enum/Viewmode": 51,
  30870. "../util/logger": 189,
  30871. "../util/math": 190,
  30872. "./browser": 182,
  30873. "three": 217
  30874. }],
  30875. 184: [function(e, t, i) {
  30876. "use strict";
  30877. function n(e, t, i) {
  30878. return o(e.fov, t, i)
  30879. }
  30880. var r = e("./MathLight")
  30881. , o = function(e, t, i) {
  30882. var n = t
  30883. , o = i
  30884. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  30885. return a
  30886. }
  30887. , a = function(e, t, i) {
  30888. var n = t
  30889. , o = i
  30890. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  30891. return a
  30892. }
  30893. , s = function(e, t, i, n) {
  30894. var r = o(e, i, n);
  30895. return r > t ? a(t, i, n) : e
  30896. };
  30897. t.exports = {
  30898. clampVFOV: s,
  30899. getHFOVForCamera: n,
  30900. getHFOVFromVFOV: o,
  30901. getVFOVFromHFOV: a
  30902. }
  30903. window.MathLight = t.exports
  30904. MathLight.closeTo = function(e1,e2, precision){//xzw add 判断e1,e2是否接近
  30905. var prec = Math.pow(10, - (precision || 4));
  30906. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  30907. if(e1.w){
  30908. return s1 && Math.abs(e1.w - e2.w) < prec
  30909. }else return s1
  30910. }
  30911. }
  30912. , {
  30913. "./MathLight": 176
  30914. }],
  30915. 185: [function(e, t, i) {
  30916. "use strict";
  30917. var n = e("three");
  30918. t.exports = {
  30919. delayOneFrame: function(e) {
  30920. window.setTimeout(e, 1)
  30921. },
  30922. normalizeUrl: function(e) {
  30923. return e.replace("https://", "http://")
  30924. },
  30925. domainFromUrl: function(e) {
  30926. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  30927. return t ? t[3] : e
  30928. },
  30929. average: function(e, t) {
  30930. if (0 === e.length)
  30931. return null;
  30932. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30933. var o = t ? e[r][t] : e[r];
  30934. i += o,
  30935. n++
  30936. }
  30937. return i / n
  30938. },
  30939. countUnique: function(e) {
  30940. for (var t = {}, i = 0; i < e.length; i++)
  30941. t[e[i]] = 1 + (t[e[i]] || 0);
  30942. return Object.keys(t).length
  30943. },
  30944. averageVectors: function(e, t) {
  30945. var i = new n.Vector3;
  30946. if (0 === e.length)
  30947. return i;
  30948. for (var r = 0, o = 0; o < e.length; o++) {
  30949. var a = t ? e[o][t] : e[o];
  30950. i.add(a),
  30951. r++
  30952. }
  30953. return i.divideScalar(r)
  30954. },
  30955. equalLists: function(e, t) {
  30956. if (e.length !== t.length)
  30957. return !1;
  30958. for (var i = 0; i < e.length; i++)
  30959. if (e[i] !== t[i])
  30960. return !1;
  30961. return !0
  30962. },
  30963. lowerMedian: function(e, t) {
  30964. if (0 === e.length)
  30965. return null;
  30966. t = t || 2,
  30967. e.sort(function(e, t) {
  30968. return e - t
  30969. });
  30970. var i = Math.floor(e.length / t);
  30971. return e[i]
  30972. },
  30973. stableSort: function(e, t) {
  30974. return e.map(function(e, t) {
  30975. return {
  30976. value: e,
  30977. index: t
  30978. }
  30979. }).sort(function(e, i) {
  30980. var n = t(e.value, i.value);
  30981. return 0 !== n ? n : e.index - i.index
  30982. }).map(function(e) {
  30983. return e.value
  30984. })
  30985. },
  30986. filterAll: function(e, t) {
  30987. return e.filter(function(e) {
  30988. return t.every(function(t) {
  30989. return t(e)
  30990. })
  30991. })
  30992. },
  30993. formatDate: function(e) {
  30994. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  30995. },
  30996. formatDatetime: function(e) {
  30997. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  30998. },
  30999. randomString: function(e) {
  31000. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  31001. t += i.charAt(Math.floor(Math.random() * i.length));
  31002. return t
  31003. },
  31004. uint8ToBase64: function(e, t) {
  31005. t && "number" == typeof t || (t = 8192);
  31006. for (var i = [], n = 0; n < e.length; n += t)
  31007. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  31008. return btoa(i.join(""))
  31009. },
  31010. uuid4: function e(t) {
  31011. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  31012. },
  31013. nth: function(e) {
  31014. return e %= 10,
  31015. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  31016. },
  31017. extendObject: function(e, t) {
  31018. return Object.keys(t).forEach(function(i) {
  31019. e[i] = t[i]
  31020. }),
  31021. e
  31022. },
  31023. deepExtend: function e(t) {
  31024. t = t || {};
  31025. for (var i = 1; i < arguments.length; i++) {
  31026. var n = arguments[i];
  31027. if (n)
  31028. for (var r in n)
  31029. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  31030. }
  31031. return t
  31032. },
  31033. inherit: function(e, t) {
  31034. e.prototype = Object.create(t.prototype),
  31035. e.prototype.constructor = e
  31036. },
  31037. extend: function(e, t) {
  31038. for (var i in t.prototype)
  31039. e.prototype[i] = t.prototype[i]
  31040. }
  31041. ,
  31042. getFileNameFromUrl:function(url){
  31043. return url.split('/').pop();
  31044. },
  31045. },
  31046. Math.sign = function(e) {
  31047. return e < 0 ? -1 : 1
  31048. }
  31049. window.common = t.exports
  31050. expandCommon(common)
  31051. }
  31052. , {
  31053. three: 217
  31054. }],
  31055. 186: [function(e, t, i) {
  31056. "use strict";
  31057. var n = {};
  31058. n.linearTween = function(e, t, i, n) {
  31059. return i * e / n + t
  31060. }
  31061. ,
  31062. n.easeInQuad = function(e, t, i, n) {
  31063. return e /= n,
  31064. i * e * e + t
  31065. }
  31066. ,
  31067. n.easeOutQuad = function(e, t, i, n) {
  31068. return e /= n,
  31069. -i * e * (e - 2) + t
  31070. }
  31071. ,
  31072. n.easeInOutQuad = function(e, t, i, n) {
  31073. return e /= n / 2,
  31074. e < 1 ? i / 2 * e * e + t : (e--,
  31075. -i / 2 * (e * (e - 2) - 1) + t)
  31076. }
  31077. ,
  31078. n.easeInCubic = function(e, t, i, n) {
  31079. return e /= n,
  31080. i * e * e * e + t
  31081. }
  31082. ,
  31083. n.easeOutCubic = function(e, t, i, n) {
  31084. return e /= n,
  31085. e--,
  31086. i * (e * e * e + 1) + t
  31087. }
  31088. ,
  31089. n.easeInOutCubic = function(e, t, i, n) {
  31090. return e /= n / 2,
  31091. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  31092. i / 2 * (e * e * e + 2) + t)
  31093. }
  31094. ,
  31095. n.easeInQuart = function(e, t, i, n) {
  31096. return e /= n,
  31097. i * e * e * e * e + t
  31098. }
  31099. ,
  31100. n.easeOutQuart = function(e, t, i, n) {
  31101. return e /= n,
  31102. e--,
  31103. -i * (e * e * e * e - 1) + t
  31104. }
  31105. ,
  31106. n.easeInOutQuart = function(e, t, i, n) {
  31107. return e /= n / 2,
  31108. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  31109. -i / 2 * (e * e * e * e - 2) + t)
  31110. }
  31111. ,
  31112. n.easeInQuint = function(e, t, i, n) {
  31113. return e /= n,
  31114. i * e * e * e * e * e + t
  31115. }
  31116. ,
  31117. n.easeOutQuint = function(e, t, i, n) {
  31118. return e /= n,
  31119. e--,
  31120. i * (e * e * e * e * e + 1) + t
  31121. }
  31122. ,
  31123. n.easeInOutQuint = function(e, t, i, n) {
  31124. return e /= n / 2,
  31125. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  31126. i / 2 * (e * e * e * e * e + 2) + t)
  31127. }
  31128. ,
  31129. n.easeInSine = function(e, t, i, n) {
  31130. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  31131. }
  31132. ,
  31133. n.easeOutSine = function(e, t, i, n) {
  31134. return i * Math.sin(e / n * (Math.PI / 2)) + t
  31135. }
  31136. ,
  31137. n.easeInOutSine = function(e, t, i, n) {
  31138. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  31139. }
  31140. ,
  31141. n.easeInExpo = function(e, t, i, n) {
  31142. return i * Math.pow(2, 10 * (e / n - 1)) + t
  31143. }
  31144. ,
  31145. n.easeOutExpo = function(e, t, i, n) {
  31146. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  31147. }
  31148. ,
  31149. n.easeInOutExpo = function(e, t, i, n) {
  31150. return e /= n / 2,
  31151. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  31152. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  31153. }
  31154. ,
  31155. n.easeInCirc = function(e, t, i, n) {
  31156. return e /= n,
  31157. -i * (Math.sqrt(1 - e * e) - 1) + t
  31158. }
  31159. ,
  31160. n.easeOutCirc = function(e, t, i, n) {
  31161. return e /= n,
  31162. e--,
  31163. i * Math.sqrt(1 - e * e) + t
  31164. }
  31165. ,
  31166. n.easeInOutCirc = function(e, t, i, n) {
  31167. return e /= n / 2,
  31168. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  31169. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  31170. }
  31171. ,
  31172. n.easeInElastic = function(e, t, i, n) {
  31173. var r = 1.70158
  31174. , o = 0
  31175. , a = i;
  31176. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31177. a < Math.abs(i) ? (a = i,
  31178. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31179. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  31180. }
  31181. ,
  31182. n.easeOutElastic = function(e, t, i, n) {
  31183. var r = 1.70158
  31184. , o = 0
  31185. , a = i;
  31186. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  31187. a < Math.abs(i) ? (a = i,
  31188. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31189. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  31190. }
  31191. ,
  31192. n.easeInOutElastic = function(e, t, i, n) {
  31193. var r = 1.70158
  31194. , o = 0
  31195. , a = i;
  31196. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  31197. a < Math.abs(i) ? (a = i,
  31198. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  31199. 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)
  31200. }
  31201. ,
  31202. n.easeInBack = function(e, t, i, n, r) {
  31203. return void 0 === r && (r = 1.70158),
  31204. i * (e /= n) * e * ((r + 1) * e - r) + t
  31205. }
  31206. ,
  31207. n.easeOutBack = function(e, t, i, n, r) {
  31208. return void 0 === r && (r = 1.70158),
  31209. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  31210. }
  31211. ,
  31212. n.easeInOutBack = function(e, t, i, n, r) {
  31213. return void 0 === r && (r = 1.70158),
  31214. (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
  31215. }
  31216. ,
  31217. n.easeOutBounce = function(e, t, i, n) {
  31218. 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
  31219. }
  31220. ,
  31221. n.easeInBounce = function(e, t, i, r) {
  31222. return i - n.easeOutBounce(r - e, 0, i, r) + t
  31223. }
  31224. ,
  31225. n.easeInOutBounce = function(e, t, i, r) {
  31226. 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
  31227. }
  31228. ,
  31229. t.exports = n
  31230. window.easing = n
  31231. }
  31232. , {}],
  31233. 187: [function(e, t, i) {
  31234. "use strict";
  31235. function n() {
  31236. this.events = [],
  31237. this.valid = !1
  31238. }
  31239. var r = e("../enum/Joystick");
  31240. n.prototype.push = function(e, t) {
  31241. this.events.push({
  31242. direction: e,
  31243. pano: t
  31244. }),
  31245. this.valid = !0
  31246. }
  31247. ,
  31248. n.prototype.pop = function(e) {
  31249. var t = this.events.pop();
  31250. return this.events.length < 1 && (this.valid = !1),
  31251. t
  31252. }
  31253. ,
  31254. n.prototype.peek = function() {
  31255. return this.events.length ? this.events[this.events.length - 1] : {
  31256. direction: null,
  31257. pano: null
  31258. }
  31259. }
  31260. ,
  31261. n.prototype.invalidate = function() {
  31262. this.events = [],
  31263. this.valid = !1
  31264. }
  31265. ,
  31266. n.prototype.reversePano = function(e) {
  31267. if (!this.valid)
  31268. return null;
  31269. var t = this.peek();
  31270. return r.opposite(e) === t.direction ? (this.pop(),
  31271. t.pano) : null
  31272. }
  31273. ,
  31274. t.exports = n
  31275. }
  31276. , {
  31277. "../enum/Joystick": 29
  31278. }],
  31279. 188: [function(e, t, i) {
  31280. "use strict";
  31281. window.lerp = t.exports = {
  31282. vector: function(e, t) {
  31283. var i = e.clone();
  31284. return t = t.clone(),
  31285. function(n) {
  31286. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  31287. }
  31288. },
  31289. quaternion: function(e, t) {
  31290. var i = e.clone();
  31291. return function(n) {
  31292. e.copy(i).slerp(t, n)
  31293. }
  31294. },
  31295. property: function(e, t, i, n) {
  31296. var r = e[t];
  31297. return function(o) {
  31298. e[t] = r * (1 - o) + i * o,
  31299. n && n(e[t])
  31300. }
  31301. },
  31302. uniform: function(e, t, i) {
  31303. var n = e.material.uniforms[t].value;
  31304. return function(r) {
  31305. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  31306. }
  31307. },
  31308. matrix4: function(e, t) {
  31309. var i = e.clone();
  31310. return function(n) {
  31311. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  31312. r[s] = o[s] * (1 - n) + a[s] * n
  31313. }
  31314. },
  31315. allUniforms: function(e, t, i) {
  31316. var n = e.map(function(e) {
  31317. return this.uniform(e, t, i)
  31318. }
  31319. .bind(this));
  31320. return function(e) {
  31321. n.forEach(function(t) {
  31322. t(e)
  31323. })
  31324. }
  31325. }
  31326. }
  31327. }
  31328. , {}],
  31329. 189: [function(e, t, i) {
  31330. "use strict";
  31331. function n(e) {
  31332. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  31333. if (n.consoleEnabled) {
  31334. var h = function(e) {
  31335. $("#debug-console").append("<p>" + e + "</p>"),
  31336. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  31337. };
  31338. t = function(e) {
  31339. h(Array.prototype.slice.call(arguments).join(" "))
  31340. }
  31341. ,
  31342. i = function(e) {
  31343. h(Array.prototype.slice.call(arguments).join(" "))
  31344. }
  31345. ,
  31346. o = function(e) {
  31347. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  31348. }
  31349. ,
  31350. a = function(e) {
  31351. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  31352. }
  31353. } else
  31354. console.log ? (t = console.log,
  31355. i = console.info ? console.info : console.log,
  31356. o = console.warn ? console.warn : console.log,
  31357. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  31358. ;
  31359. var u = function(e) {
  31360. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  31361. }
  31362. , d = function(t, i) {
  31363. if (r) {
  31364. var o = Array.prototype.slice.call(t).join(" ");
  31365. r.captureMessage(o, {
  31366. level: i,
  31367. path: e,
  31368. timestamp: n.timestamp()
  31369. })
  31370. }
  31371. }
  31372. , p = function(t, i) {
  31373. if (r) {
  31374. var o = Array.prototype.slice.call(t).join(" ");
  31375. r.captureException(new Error(o), {
  31376. level: i,
  31377. path: e,
  31378. timestamp: n.timestamp()
  31379. })
  31380. }
  31381. };
  31382. return {
  31383. debug: function() {
  31384. n.level >= n.levels.debug && t.apply(console, u(arguments))
  31385. },
  31386. info: function() {
  31387. n.level >= n.levels.info && i.apply(console, u(arguments))
  31388. },
  31389. warn: function() {
  31390. d(arguments, "warn"),
  31391. n.level >= n.levels.warn && o.apply(console, u(arguments))
  31392. },
  31393. error: function() {
  31394. p(arguments, "error"),
  31395. n.level >= n.levels.error && a.apply(console, u(arguments))
  31396. },
  31397. v3str: function(e, t) {
  31398. var i = void 0 === t ? 2 : t;
  31399. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  31400. },
  31401. eulstr: function(e, t) {
  31402. var i = void 0 === t ? 2 : t;
  31403. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  31404. },
  31405. time: function(e) {
  31406. n.level >= n.levels.debug && (c[e] = Date.now())
  31407. },
  31408. timeEnd: function(e) {
  31409. if (n.level >= n.levels.debug) {
  31410. var t = c[e];
  31411. if (!t)
  31412. return;
  31413. var i = (Date.now() - t) / 1e3;
  31414. this.debug(e, i + "s")
  31415. }
  31416. }
  31417. }
  31418. }
  31419. var r = window.Raven;
  31420. n.timestamp = function() {
  31421. return (Date.now() - window.navigationStart) / 1e3 + "s"
  31422. }
  31423. ,
  31424. n.levels = {
  31425. debug: 3,
  31426. info: 2,
  31427. warn: 1,
  31428. error: 0
  31429. },
  31430. n.level = n.levels.info,
  31431. t.exports = n
  31432. }
  31433. , {}],
  31434. 190: [function(e, t, i) {
  31435. "use strict";
  31436. var n = e("three")
  31437. , r = e("../enum/GLCubeFaces")
  31438. , o = e("../constants");
  31439. t.exports = {
  31440. convertVisionVector: function(e) {
  31441. return new n.Vector3(e.x,e.z,-e.y)
  31442. },
  31443. convertVisionQuaternion: function(e) {
  31444. 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)))
  31445. },
  31446. convertWorkshopVector: function(e) {
  31447. return new n.Vector3(-e.x,e.y,e.z)
  31448. },
  31449. convertWorkshopQuaternion: function(e) {
  31450. 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))
  31451. },
  31452. convertWorkshopPanoramaQuaternion: function(e) {
  31453. 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)))
  31454. },
  31455. convertWorkshopOrthoZoom: function(e) {// xzw
  31456. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  31457. //return e;
  31458. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  31459. },
  31460. toPrecision: function(e, t) {//xzw change
  31461. var f = function(e, t){
  31462. var i = Math.pow(10, t);
  31463. return Math.round(e * i) / i
  31464. }
  31465. if(e instanceof Array){
  31466. for(var s=0; s<e.length; s++){
  31467. e[s] = f(e[s],t);
  31468. }
  31469. return e;
  31470. }
  31471. else return f(e,t)
  31472. },
  31473. isEmptyQuaternion: function(e) {
  31474. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  31475. },
  31476. projectPositionToCanvas: function(e, t, i) {
  31477. i = i || new n.Vector3,
  31478. i.copy(e);
  31479. var r = .5 * $("#player").width()
  31480. , o = .5 * $("#player").height();
  31481. return i.project(t),
  31482. i.x = i.x * r + r,
  31483. i.y = -(i.y * o) + o,
  31484. i
  31485. },
  31486. convertScreenPositionToNDC: function(e, t, i) {
  31487. return i = i || new n.Vector2,
  31488. i.x = e / $("#player").width() * 2 - 1,
  31489. i.y = 2 * -(t / $("#player").height()) + 1,
  31490. i
  31491. },
  31492. constrainedTurn: function(e) {
  31493. var t = e % (2 * Math.PI);
  31494. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  31495. },
  31496. getFOVDotThreshold: function(e) {
  31497. return Math.cos(n.Math.degToRad(e / 2))
  31498. },
  31499. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  31500. switch (e) {
  31501. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  31502. i.set(1, t.y, t.x);
  31503. break;
  31504. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  31505. i.set(-1, t.y, -t.x);
  31506. break;
  31507. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  31508. i.set(-t.x, 1, -t.y);
  31509. break;
  31510. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  31511. i.set(-t.x, -1, t.y);
  31512. break;
  31513. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  31514. i.set(-t.x, t.y, 1);
  31515. break;
  31516. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  31517. i.set(t.x, t.y, -1)
  31518. }
  31519. n && i.normalize()
  31520. },
  31521. //add:
  31522. getPos2d : function(point, camera, dom){
  31523. var camera = camera ;
  31524. var dom = dom;
  31525. 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);
  31526. var x,y;
  31527. x = (pos.x + 1) / 2 * dom.clientWidth;
  31528. y = (1 - (pos.y + 1) / 2) * dom.clientHeight;
  31529. var inSight = x <= dom.clientWidth && x >= 0
  31530. && y <= dom.clientHeight && y >= 0
  31531. return {
  31532. pos: new THREE.Vector2(x,y),
  31533. vector: pos,
  31534. trueSide : pos.z<1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  31535. inSight : inSight //在屏幕范围内可见
  31536. };
  31537. },
  31538. getDirByLonLat: function(lon, lat) {
  31539. var dir = new THREE.Vector3();
  31540. var phi = THREE.Math.degToRad(90 - lat);
  31541. var theta = THREE.Math.degToRad(lon);
  31542. dir.x = Math.sin(phi) * Math.cos(theta);
  31543. dir.y = Math.cos(phi);
  31544. dir.z = Math.sin(phi) * Math.sin(theta);
  31545. return dir.negate();
  31546. }
  31547. }
  31548. window.math = t.exports
  31549. expandMath(math)
  31550. }
  31551. , {
  31552. "../constants": 8,
  31553. "../enum/GLCubeFaces": 25,
  31554. three: 217
  31555. }],
  31556. 191: [function(e, t, i) {
  31557. "use strict";
  31558. function n(e, t, i) {
  31559. return a.map(function(n, o) {
  31560. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  31561. }
  31562. .bind(this))
  31563. }
  31564. function r(e) {
  31565. return s[e]
  31566. }
  31567. var o = e("../enum/GLCubeFaces")
  31568. , a = [0, 1, 2, 3, 4, 5]
  31569. , s = {
  31570. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  31571. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  31572. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  31573. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  31574. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  31575. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  31576. };
  31577. t.exports = {
  31578. mapFaceToCubemapFace: r,
  31579. getCubemapUrls: n
  31580. }
  31581. }
  31582. , {
  31583. "../enum/GLCubeFaces": 25
  31584. }],
  31585. 192: [function(e, t, i) {
  31586. "use strict";
  31587. t.exports = {
  31588. captureErrors: function(e, t, i) {
  31589. if ("Raven"in window) {
  31590. Raven.config(e, t).install(),
  31591. i && Raven.setTagsContext(i);
  31592. var n = console.warn
  31593. , r = console.error;
  31594. console.warn = function() {
  31595. var e = Array.prototype.slice.call(arguments);
  31596. Raven.captureMessage(e.join(" "), {
  31597. level: "warning"
  31598. }),
  31599. n.apply(console, e)
  31600. }
  31601. ,
  31602. console.error = function() {
  31603. var e = Array.prototype.slice.call(arguments);
  31604. Raven.captureException(new Error(e.join(" ")), {
  31605. level: "error"
  31606. }),
  31607. r.apply(console, e)
  31608. }
  31609. } else
  31610. console.error("Raven not found, not capturing errors.")
  31611. }
  31612. }
  31613. }
  31614. , {}],
  31615. 193: [function(e, t, i) {
  31616. (function(i) {
  31617. "use strict";
  31618. var n = e("./browser")
  31619. , r = e("../constants")
  31620. , o = e("url")
  31621. , a = e("./logger")
  31622. , ss = e('three')
  31623. , s = new a(i)
  31624. , l = {
  31625. getAuthorizationHeader: function() {
  31626. var e = n.valueFromHash("auth");
  31627. if (e)
  31628. return e.replace(",", " ");
  31629. var t = n.valueFromCookie("token");
  31630. return t ? "Token " + t : null
  31631. },
  31632. parseSidUrl: function(e) {
  31633. var t, i;
  31634. t=g_Prefix;
  31635. if (e = e || "",
  31636. e.match(/^https?/)) {
  31637. var n = o.parse(e);
  31638. t = g_Prefix,
  31639. i = e
  31640. } else{
  31641. //xzw 原先的不能用
  31642. //t = window.location.protocol + "//" + window.location.host, //MP
  31643. t = g_Prefix
  31644. //i = t + "/api/player/models/" + e; //MP
  31645. i = t + "data/" + e;
  31646. }
  31647. return {
  31648. urlBase: t,
  31649. urlModel: i,
  31650. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  31651. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  31652. }
  31653. },
  31654. getModelIDFromQueryString: function() {
  31655. return n.valueFromHash("model") || n.valueFromHash("m")
  31656. },
  31657. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31658. e = JSON.parse(JSON.stringify(e));
  31659. var i = null;
  31660. if (e.images.forEach(function(n) {
  31661. if(!n.metadata) return;
  31662. if ("string" == typeof n.metadata)
  31663. try {
  31664. n.metadata = JSON.parse(n.metadata)
  31665. } catch (e) {
  31666. s.warn("Unable to parse image metadata"),
  31667. n.metadata = null
  31668. }
  31669. else{
  31670. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31671. }
  31672. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31673. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31674. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31675. }else{
  31676. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31677. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  31678. n.metadata.zoom = n.metadata.zoom || 1;
  31679. }
  31680. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31681. }),
  31682. //icon初始视角的:
  31683. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31684. var n = {};
  31685. n.pano = {
  31686. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31687. position: t.convertWorkshopVector(i.scan_position),
  31688. uuid: i.scan_id
  31689. },
  31690. n.camera = {
  31691. quaternion: i.camera_quaternion,
  31692. position: i.camera_position
  31693. },
  31694. e.startPano = n
  31695. }
  31696. return e
  31697. },
  31698. */
  31699. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  31700. e = JSON.parse(JSON.stringify(e));
  31701. var i = null;
  31702. var deal = function(n) {
  31703. if(!n.metadata) return;
  31704. if ("string" == typeof n.metadata)
  31705. try {
  31706. n.metadata = JSON.parse(n.metadata)
  31707. } catch (e) {
  31708. s.warn("Unable to parse image metadata"),
  31709. n.metadata = null
  31710. }
  31711. else{
  31712. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  31713. }
  31714. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  31715. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  31716. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  31717. }else{
  31718. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  31719. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  31720. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  31721. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  31722. }
  31723. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  31724. }
  31725. //改
  31726. e.images.forEach(info=>{
  31727. if(info.locations){
  31728. info.locations.forEach(a=>deal(a))
  31729. }else{
  31730. deal(info)
  31731. }
  31732. })
  31733. //icon初始视角的:
  31734. if(i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  31735. var n = {};
  31736. n.pano = {
  31737. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  31738. position: t.convertWorkshopVector(i.scan_position),
  31739. uuid: i.scan_id
  31740. },
  31741. n.camera = {
  31742. quaternion: i.camera_quaternion,
  31743. position: i.camera_position
  31744. },
  31745. e.startPano = n
  31746. }
  31747. return e
  31748. },
  31749. visionVersionToInt: function() {
  31750. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  31751. return function(t) {
  31752. if (!t)
  31753. throw new Error("Vision version is required");
  31754. var i = e.exec(t);
  31755. if (null === i)
  31756. throw new Error("String is not a vision version: " + t);
  31757. return parseInt(i[1])
  31758. }
  31759. }(),
  31760. modelDataPromisesTiles: function(e) {
  31761. var vision_version = e.vision_version || window.DATA.vision_version
  31762. if (vision_version)
  31763. try {
  31764. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  31765. } catch (t) {
  31766. s.warn("Invalid vision version: " + vision_version)
  31767. }
  31768. // var t = e.created ? new Date(e.created) : null;
  31769. // return t && t >= r.visionTilingStartDate
  31770. return false
  31771. }
  31772. };
  31773. t.exports = l
  31774. }
  31775. ).call(this, "/js/util/showcase.js")
  31776. }
  31777. , {
  31778. "../constants": 8,
  31779. "./browser": 182,
  31780. "./logger": 189,
  31781. three:217,
  31782. url: 208
  31783. }],
  31784. 194: [function(e, t, i) {
  31785. "use strict";
  31786. var n = e("../util/ajax")
  31787. , r = e("three")
  31788. , o = e("../settings")
  31789. , a = {};
  31790. t.exports = {
  31791. load: function(e, t, i) {
  31792. var s = a[e];
  31793. return s ? (t && setTimeout(function() {
  31794. t(s)
  31795. }, 1),
  31796. s) : (s = new r.Texture,
  31797. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  31798. s.magFilter = r.LinearFilter,
  31799. s.generateMipmaps = !1),
  31800. s.sourceFile = e,
  31801. a[e] = s,
  31802. n.getImage(e).then(function(e) {
  31803. s.image = e,
  31804. s.needsUpdate = !0,
  31805. t && t(s)
  31806. }).fail(i),
  31807. s)
  31808. },
  31809. loadBase64: function(e, t) {
  31810. t = t || "png";
  31811. var i = new r.Texture;
  31812. return i.image = document.createElement("img"),
  31813. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  31814. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  31815. i.magFilter = r.LinearFilter,
  31816. i.generateMipmaps = !1),
  31817. i.needsUpdate = !0,
  31818. i
  31819. },
  31820. isLoaded: function(e) {
  31821. return !!a[e]
  31822. }
  31823. }
  31824. window.Texture = t.exports
  31825. }
  31826. , {
  31827. "../settings": 166,
  31828. "../util/ajax": 181,
  31829. three: 217
  31830. }],
  31831. 195: [function(e, t, i) {
  31832. "use strict";
  31833. var n = e("./easing");
  31834. window.transitions = t.exports = {
  31835. globalDone: null,
  31836. funcs: [],
  31837. counter: 0,
  31838. uniqueID: 0,
  31839. start: function(e, t, i, r, o, a, s) {
  31840. return r = r || 0,
  31841. this.funcs.push({
  31842. func: e,
  31843. current: -r * Math.abs(t),
  31844. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31845. done: i,
  31846. easing: o || n.linearTween,
  31847. cycling: t < 0,
  31848. running: !0,
  31849. debug: r < 0,
  31850. name: a || "T" + this.counter,
  31851. id: void 0 === s ? this.counter : s,
  31852. paused: !1
  31853. }),
  31854. e(0, 16),
  31855. this.counter += 1,
  31856. e
  31857. },
  31858. trigger: function(e) {
  31859. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  31860. , i = e.func || function() {}
  31861. , r = void 0 === e.duration ? 0 : e.duration;
  31862. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  31863. var o = e.done || null
  31864. , a = e.easing || n.linearTween
  31865. , s = e.name || "R" + this.counter
  31866. , l = void 0 === e.id ? this.counter : e.id;
  31867. return this.start(i, r, o, t, a, s, l)
  31868. },
  31869. setTimeout: function(e, t, i) {
  31870. var n = void 0 === i ? this.counter : i;
  31871. return this.trigger({
  31872. done: e,
  31873. duration: void 0 === t ? 0 : t,
  31874. name: "O" + this.counter,
  31875. id: n
  31876. })
  31877. },
  31878. pause: function() {
  31879. this.paused = !0
  31880. },
  31881. resume: function() {
  31882. this.paused = !1
  31883. },
  31884. update: function(e) {
  31885. this.funcs.forEach(function(t) {
  31886. if (!(t.paused || (t.current += 1e3 * e,
  31887. t.current < 0)))
  31888. if (t.current >= t.duration && !t.cycling) {
  31889. var i = t.easing(1, 0, 1, 1);
  31890. t.func(i, 1e3 * e),
  31891. t.done && t.done(),
  31892. t.running = !1
  31893. } else {
  31894. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  31895. , r = t.func(n, 1e3 * e) || !1;
  31896. r && (t.done && t.done(),
  31897. t.running = !1)
  31898. }
  31899. });
  31900. var t = this.funcs.length;
  31901. this.funcs = this.funcs.filter(function(e) {
  31902. return e.running
  31903. });
  31904. var i = this.funcs.length;
  31905. if (t > 0 && 0 === i && this.globalDone) {
  31906. var n = this.globalDone;
  31907. this.globalDone = null,
  31908. n()
  31909. }
  31910. },
  31911. adjustSpeed: function(e, t) {
  31912. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31913. var r = i[n];
  31914. r.duration /= t,
  31915. r.current /= t
  31916. }
  31917. },
  31918. getById: function(e) {
  31919. return this.funcs.filter(function(t) {
  31920. return e === t.id
  31921. })
  31922. },
  31923. get: function(e) {
  31924. for (var t = 0; t < this.funcs.length; t += 1)
  31925. if (this.funcs[t].func === e)
  31926. return this.funcs[t];
  31927. return null
  31928. },
  31929. isRunning: function(e) {
  31930. var t = this.get(e);
  31931. return null !== t && t.running
  31932. },
  31933. countActive: function() {
  31934. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  31935. e += this.funcs[t].running;
  31936. return e
  31937. },
  31938. listActive: function() {
  31939. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  31940. this.funcs[t].running && e.push(this.funcs[t].name);
  31941. return e
  31942. },
  31943. done: function(e) {
  31944. this.globalDone = e
  31945. },
  31946. cancelById: function(e) {
  31947. var t = void 0 === e ? 0 : e;
  31948. this.funcs = this.funcs.filter(function(e) {
  31949. return e.id !== t
  31950. })
  31951. },
  31952. cancel: function(e) {
  31953. this.funcs = this.funcs.filter(function(t) {
  31954. return t.func !== e
  31955. })
  31956. },
  31957. getUniqueId: function() {
  31958. return this.uniqueID -= 1,
  31959. this.uniqueID
  31960. }
  31961. }
  31962. }
  31963. , {
  31964. "./easing": 186
  31965. }],
  31966. 196: [function(e, t, i) {
  31967. function n(e) {
  31968. if (this.set = {},
  31969. this.infContains = function() {
  31970. return !0
  31971. }
  31972. ,
  31973. "object" == typeof e)
  31974. if (e instanceof Array)
  31975. for (var t = 0; t < e.length; t++)
  31976. this.set[e[t]] = !0;
  31977. else
  31978. this.set = e;
  31979. else if ("function" == typeof e)
  31980. this.infContains = e;
  31981. else if ("undefined" != typeof e)
  31982. throw new Error("set must be either an array or an object.")
  31983. }
  31984. t.exports = n,
  31985. n.prototype.contains = function(e) {
  31986. return !!this.set[e]
  31987. }
  31988. ,
  31989. n.prototype.has = n.prototype.contains,
  31990. n.prototype.add = function(e) {
  31991. if (1 == arguments.length)
  31992. this.set[e] = !0;
  31993. else
  31994. for (var t = 0; t < arguments.length; t++)
  31995. this.set[arguments[t]] = !0
  31996. }
  31997. ,
  31998. n.prototype.addAll = function(e) {
  31999. if ("object" != typeof e && !(e instanceof Array))
  32000. throw new Error("arr must be an array.");
  32001. for (var t = 0; t < e.length; t++)
  32002. this.add(e[t])
  32003. }
  32004. ,
  32005. n.prototype.remove = function(e) {
  32006. if (1 == arguments.length)
  32007. delete this.set[e];
  32008. else
  32009. for (var t = 0; t < arguments.length; t++)
  32010. delete this.set[arguments[t]]
  32011. }
  32012. ,
  32013. n.prototype.delete = n.prototype.remove,
  32014. n.prototype.clear = function() {
  32015. this.set = {}
  32016. }
  32017. ,
  32018. n.prototype.size = function() {
  32019. return Object.keys(this.set).length
  32020. }
  32021. ,
  32022. n.prototype.toString = function() {
  32023. return "{" + Object.keys(this.set).toString() + "}"
  32024. }
  32025. ,
  32026. n.prototype.toArray = function() {
  32027. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  32028. }
  32029. ,
  32030. n.prototype["*values"] = n.prototype.toArray
  32031. }
  32032. , {}],
  32033. 197: [function(e, t, i) {}
  32034. , {}],
  32035. 198: [function(e, t, i) {
  32036. (function(t) {
  32037. "use strict";
  32038. function n() {
  32039. try {
  32040. var e = new Uint8Array(1);
  32041. return e.__proto__ = {
  32042. __proto__: Uint8Array.prototype,
  32043. foo: function() {
  32044. return 42
  32045. }
  32046. },
  32047. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  32048. } catch (e) {
  32049. return !1
  32050. }
  32051. }
  32052. function r() {
  32053. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  32054. }
  32055. function o(e, t) {
  32056. if (r() < t)
  32057. throw new RangeError("Invalid typed array length");
  32058. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  32059. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  32060. e.length = t),
  32061. e
  32062. }
  32063. function a(e, t, i) {
  32064. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  32065. return new a(e,t,i);
  32066. if ("number" == typeof e) {
  32067. if ("string" == typeof t)
  32068. throw new Error("If encoding is specified then the first argument must be a string");
  32069. return h(this, e)
  32070. }
  32071. return s(this, e, t, i)
  32072. }
  32073. function s(e, t, i, n) {
  32074. if ("number" == typeof t)
  32075. throw new TypeError('"value" argument must not be a number');
  32076. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  32077. }
  32078. function l(e) {
  32079. if ("number" != typeof e)
  32080. throw new TypeError('"size" argument must be a number');
  32081. if (e < 0)
  32082. throw new RangeError('"size" argument must not be negative')
  32083. }
  32084. function c(e, t, i, n) {
  32085. return l(t),
  32086. 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)
  32087. }
  32088. function h(e, t) {
  32089. if (l(t),
  32090. e = o(e, t < 0 ? 0 : 0 | g(t)),
  32091. !a.TYPED_ARRAY_SUPPORT)
  32092. for (var i = 0; i < t; ++i)
  32093. e[i] = 0;
  32094. return e
  32095. }
  32096. function u(e, t, i) {
  32097. if ("string" == typeof i && "" !== i || (i = "utf8"),
  32098. !a.isEncoding(i))
  32099. throw new TypeError('"encoding" must be a valid string encoding');
  32100. var n = 0 | v(t, i);
  32101. e = o(e, n);
  32102. var r = e.write(t, i);
  32103. return r !== n && (e = e.slice(0, r)),
  32104. e
  32105. }
  32106. function d(e, t) {
  32107. var i = t.length < 0 ? 0 : 0 | g(t.length);
  32108. e = o(e, i);
  32109. for (var n = 0; n < i; n += 1)
  32110. e[n] = 255 & t[n];
  32111. return e
  32112. }
  32113. function p(e, t, i, n) {
  32114. if (t.byteLength,
  32115. i < 0 || t.byteLength < i)
  32116. throw new RangeError("'offset' is out of bounds");
  32117. if (t.byteLength < i + (n || 0))
  32118. throw new RangeError("'length' is out of bounds");
  32119. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  32120. a.TYPED_ARRAY_SUPPORT ? (e = t,
  32121. e.__proto__ = a.prototype) : e = d(e, t),
  32122. e
  32123. }
  32124. function f(e, t) {
  32125. if (a.isBuffer(t)) {
  32126. var i = 0 | g(t.length);
  32127. return e = o(e, i),
  32128. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  32129. e)
  32130. }
  32131. if (t) {
  32132. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  32133. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  32134. if ("Buffer" === t.type && $(t.data))
  32135. return d(e, t.data)
  32136. }
  32137. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  32138. }
  32139. function g(e) {
  32140. if (e >= r())
  32141. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  32142. return 0 | e
  32143. }
  32144. function m(e) {
  32145. return +e != e && (e = 0),
  32146. a.alloc(+e)
  32147. }
  32148. function v(e, t) {
  32149. if (a.isBuffer(e))
  32150. return e.length;
  32151. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  32152. return e.byteLength;
  32153. "string" != typeof e && (e = "" + e);
  32154. var i = e.length;
  32155. if (0 === i)
  32156. return 0;
  32157. for (var n = !1; ; )
  32158. switch (t) {
  32159. case "ascii":
  32160. case "latin1":
  32161. case "binary":
  32162. return i;
  32163. case "utf8":
  32164. case "utf-8":
  32165. case void 0:
  32166. return j(e).length;
  32167. case "ucs2":
  32168. case "ucs-2":
  32169. case "utf16le":
  32170. case "utf-16le":
  32171. return 2 * i;
  32172. case "hex":
  32173. return i >>> 1;
  32174. case "base64":
  32175. return Z(e).length;
  32176. default:
  32177. if (n)
  32178. return j(e).length;
  32179. t = ("" + t).toLowerCase(),
  32180. n = !0
  32181. }
  32182. }
  32183. function A(e, t, i) {
  32184. var n = !1;
  32185. if ((void 0 === t || t < 0) && (t = 0),
  32186. t > this.length)
  32187. return "";
  32188. if ((void 0 === i || i > this.length) && (i = this.length),
  32189. i <= 0)
  32190. return "";
  32191. if (i >>>= 0,
  32192. t >>>= 0,
  32193. i <= t)
  32194. return "";
  32195. for (e || (e = "utf8"); ; )
  32196. switch (e) {
  32197. case "hex":
  32198. return L(this, t, i);
  32199. case "utf8":
  32200. case "utf-8":
  32201. return M(this, t, i);
  32202. case "ascii":
  32203. return P(this, t, i);
  32204. case "latin1":
  32205. case "binary":
  32206. return O(this, t, i);
  32207. case "base64":
  32208. return S(this, t, i);
  32209. case "ucs2":
  32210. case "ucs-2":
  32211. case "utf16le":
  32212. case "utf-16le":
  32213. return D(this, t, i);
  32214. default:
  32215. if (n)
  32216. throw new TypeError("Unknown encoding: " + e);
  32217. e = (e + "").toLowerCase(),
  32218. n = !0
  32219. }
  32220. }
  32221. function y(e, t, i) {
  32222. var n = e[t];
  32223. e[t] = e[i],
  32224. e[i] = n
  32225. }
  32226. function C(e, t, i, n, r) {
  32227. if (0 === e.length)
  32228. return -1;
  32229. if ("string" == typeof i ? (n = i,
  32230. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  32231. i = +i,
  32232. isNaN(i) && (i = r ? 0 : e.length - 1),
  32233. i < 0 && (i = e.length + i),
  32234. i >= e.length) {
  32235. if (r)
  32236. return -1;
  32237. i = e.length - 1
  32238. } else if (i < 0) {
  32239. if (!r)
  32240. return -1;
  32241. i = 0
  32242. }
  32243. if ("string" == typeof t && (t = a.from(t, n)),
  32244. a.isBuffer(t))
  32245. return 0 === t.length ? -1 : I(e, t, i, n, r);
  32246. if ("number" == typeof t)
  32247. return t &= 255,
  32248. 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);
  32249. throw new TypeError("val must be string, number or Buffer")
  32250. }
  32251. function I(e, t, i, n, r) {
  32252. function o(e, t) {
  32253. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  32254. }
  32255. var a = 1
  32256. , s = e.length
  32257. , l = t.length;
  32258. if (void 0 !== n && (n = String(n).toLowerCase(),
  32259. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  32260. if (e.length < 2 || t.length < 2)
  32261. return -1;
  32262. a = 2,
  32263. s /= 2,
  32264. l /= 2,
  32265. i /= 2
  32266. }
  32267. var c;
  32268. if (r) {
  32269. var h = -1;
  32270. for (c = i; c < s; c++)
  32271. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  32272. if (h === -1 && (h = c),
  32273. c - h + 1 === l)
  32274. return h * a
  32275. } else
  32276. h !== -1 && (c -= c - h),
  32277. h = -1
  32278. } else
  32279. for (i + l > s && (i = s - l),
  32280. c = i; c >= 0; c--) {
  32281. for (var u = !0, d = 0; d < l; d++)
  32282. if (o(e, c + d) !== o(t, d)) {
  32283. u = !1;
  32284. break
  32285. }
  32286. if (u)
  32287. return c
  32288. }
  32289. return -1
  32290. }
  32291. function E(e, t, i, n) {
  32292. i = Number(i) || 0;
  32293. var r = e.length - i;
  32294. n ? (n = Number(n),
  32295. n > r && (n = r)) : n = r;
  32296. var o = t.length;
  32297. if (o % 2 !== 0)
  32298. throw new TypeError("Invalid hex string");
  32299. n > o / 2 && (n = o / 2);
  32300. for (var a = 0; a < n; ++a) {
  32301. var s = parseInt(t.substr(2 * a, 2), 16);
  32302. if (isNaN(s))
  32303. return a;
  32304. e[i + a] = s
  32305. }
  32306. return a
  32307. }
  32308. function b(e, t, i, n) {
  32309. return q(j(t, e.length - i), e, i, n)
  32310. }
  32311. function w(e, t, i, n) {
  32312. return q(Y(t), e, i, n)
  32313. }
  32314. function _(e, t, i, n) {
  32315. return w(e, t, i, n)
  32316. }
  32317. function T(e, t, i, n) {
  32318. return q(Z(t), e, i, n)
  32319. }
  32320. function x(e, t, i, n) {
  32321. return q(X(t, e.length - i), e, i, n)
  32322. }
  32323. function S(e, t, i) {
  32324. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  32325. }
  32326. function M(e, t, i) {
  32327. i = Math.min(e.length, i);
  32328. for (var n = [], r = t; r < i; ) {
  32329. var o = e[r]
  32330. , a = null
  32331. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  32332. if (r + s <= i) {
  32333. var l, c, h, u;
  32334. switch (s) {
  32335. case 1:
  32336. o < 128 && (a = o);
  32337. break;
  32338. case 2:
  32339. l = e[r + 1],
  32340. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  32341. u > 127 && (a = u));
  32342. break;
  32343. case 3:
  32344. l = e[r + 1],
  32345. c = e[r + 2],
  32346. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  32347. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  32348. break;
  32349. case 4:
  32350. l = e[r + 1],
  32351. c = e[r + 2],
  32352. h = e[r + 3],
  32353. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  32354. u > 65535 && u < 1114112 && (a = u))
  32355. }
  32356. }
  32357. null === a ? (a = 65533,
  32358. s = 1) : a > 65535 && (a -= 65536,
  32359. n.push(a >>> 10 & 1023 | 55296),
  32360. a = 56320 | 1023 & a),
  32361. n.push(a),
  32362. r += s
  32363. }
  32364. return R(n)
  32365. }
  32366. function R(e) {
  32367. var t = e.length;
  32368. if (t <= ee)
  32369. return String.fromCharCode.apply(String, e);
  32370. for (var i = "", n = 0; n < t; )
  32371. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  32372. return i
  32373. }
  32374. function P(e, t, i) {
  32375. var n = "";
  32376. i = Math.min(e.length, i);
  32377. for (var r = t; r < i; ++r)
  32378. n += String.fromCharCode(127 & e[r]);
  32379. return n
  32380. }
  32381. function O(e, t, i) {
  32382. var n = "";
  32383. i = Math.min(e.length, i);
  32384. for (var r = t; r < i; ++r)
  32385. n += String.fromCharCode(e[r]);
  32386. return n
  32387. }
  32388. function L(e, t, i) {
  32389. var n = e.length;
  32390. (!t || t < 0) && (t = 0),
  32391. (!i || i < 0 || i > n) && (i = n);
  32392. for (var r = "", o = t; o < i; ++o)
  32393. r += W(e[o]);
  32394. return r
  32395. }
  32396. function D(e, t, i) {
  32397. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  32398. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  32399. return r
  32400. }
  32401. function N(e, t, i) {
  32402. if (e % 1 !== 0 || e < 0)
  32403. throw new RangeError("offset is not uint");
  32404. if (e + t > i)
  32405. throw new RangeError("Trying to access beyond buffer length")
  32406. }
  32407. function B(e, t, i, n, r, o) {
  32408. if (!a.isBuffer(e))
  32409. throw new TypeError('"buffer" argument must be a Buffer instance');
  32410. if (t > r || t < o)
  32411. throw new RangeError('"value" argument is out of bounds');
  32412. if (i + n > e.length)
  32413. throw new RangeError("Index out of range")
  32414. }
  32415. function F(e, t, i, n) {
  32416. t < 0 && (t = 65535 + t + 1);
  32417. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  32418. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  32419. }
  32420. function V(e, t, i, n) {
  32421. t < 0 && (t = 4294967295 + t + 1);
  32422. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  32423. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  32424. }
  32425. function U(e, t, i, n, r, o) {
  32426. if (i + n > e.length)
  32427. throw new RangeError("Index out of range");
  32428. if (i < 0)
  32429. throw new RangeError("Index out of range")
  32430. }
  32431. function k(e, t, i, n, r) {
  32432. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  32433. J.write(e, t, i, n, 23, 4),
  32434. i + 4
  32435. }
  32436. function H(e, t, i, n, r) {
  32437. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  32438. J.write(e, t, i, n, 52, 8),
  32439. i + 8
  32440. }
  32441. function G(e) {
  32442. if (e = z(e).replace(te, ""),
  32443. e.length < 2)
  32444. return "";
  32445. for (; e.length % 4 !== 0; )
  32446. e += "=";
  32447. return e
  32448. }
  32449. function z(e) {
  32450. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  32451. }
  32452. function W(e) {
  32453. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  32454. }
  32455. function j(e, t) {
  32456. t = t || 1 / 0;
  32457. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  32458. if (i = e.charCodeAt(a),
  32459. i > 55295 && i < 57344) {
  32460. if (!r) {
  32461. if (i > 56319) {
  32462. (t -= 3) > -1 && o.push(239, 191, 189);
  32463. continue
  32464. }
  32465. if (a + 1 === n) {
  32466. (t -= 3) > -1 && o.push(239, 191, 189);
  32467. continue
  32468. }
  32469. r = i;
  32470. continue
  32471. }
  32472. if (i < 56320) {
  32473. (t -= 3) > -1 && o.push(239, 191, 189),
  32474. r = i;
  32475. continue
  32476. }
  32477. i = (r - 55296 << 10 | i - 56320) + 65536
  32478. } else
  32479. r && (t -= 3) > -1 && o.push(239, 191, 189);
  32480. if (r = null,
  32481. i < 128) {
  32482. if ((t -= 1) < 0)
  32483. break;
  32484. o.push(i)
  32485. } else if (i < 2048) {
  32486. if ((t -= 2) < 0)
  32487. break;
  32488. o.push(i >> 6 | 192, 63 & i | 128)
  32489. } else if (i < 65536) {
  32490. if ((t -= 3) < 0)
  32491. break;
  32492. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  32493. } else {
  32494. if (!(i < 1114112))
  32495. throw new Error("Invalid code point");
  32496. if ((t -= 4) < 0)
  32497. break;
  32498. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  32499. }
  32500. }
  32501. return o
  32502. }
  32503. function Y(e) {
  32504. for (var t = [], i = 0; i < e.length; ++i)
  32505. t.push(255 & e.charCodeAt(i));
  32506. return t
  32507. }
  32508. function X(e, t) {
  32509. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  32510. i = e.charCodeAt(a),
  32511. n = i >> 8,
  32512. r = i % 256,
  32513. o.push(r),
  32514. o.push(n);
  32515. return o
  32516. }
  32517. function Z(e) {
  32518. return Q.toByteArray(G(e))
  32519. }
  32520. function q(e, t, i, n) {
  32521. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  32522. t[r + i] = e[r];
  32523. return r
  32524. }
  32525. function K(e) {
  32526. return e !== e
  32527. }
  32528. var Q = e("base64-js")
  32529. , J = e("ieee754")
  32530. , $ = e("isarray");
  32531. i.Buffer = a,
  32532. i.SlowBuffer = m,
  32533. i.INSPECT_MAX_BYTES = 50,
  32534. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  32535. i.kMaxLength = r(),
  32536. a.poolSize = 8192,
  32537. a._augment = function(e) {
  32538. return e.__proto__ = a.prototype,
  32539. e
  32540. }
  32541. ,
  32542. a.from = function(e, t, i) {
  32543. return s(null, e, t, i)
  32544. }
  32545. ,
  32546. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  32547. a.__proto__ = Uint8Array,
  32548. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  32549. value: null,
  32550. configurable: !0
  32551. })),
  32552. a.alloc = function(e, t, i) {
  32553. return c(null, e, t, i)
  32554. }
  32555. ,
  32556. a.allocUnsafe = function(e) {
  32557. return h(null, e)
  32558. }
  32559. ,
  32560. a.allocUnsafeSlow = function(e) {
  32561. return h(null, e)
  32562. }
  32563. ,
  32564. a.isBuffer = function(e) {
  32565. return !(null == e || !e._isBuffer)
  32566. }
  32567. ,
  32568. a.compare = function(e, t) {
  32569. if (!a.isBuffer(e) || !a.isBuffer(t))
  32570. throw new TypeError("Arguments must be Buffers");
  32571. if (e === t)
  32572. return 0;
  32573. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  32574. if (e[r] !== t[r]) {
  32575. i = e[r],
  32576. n = t[r];
  32577. break
  32578. }
  32579. return i < n ? -1 : n < i ? 1 : 0
  32580. }
  32581. ,
  32582. a.isEncoding = function(e) {
  32583. switch (String(e).toLowerCase()) {
  32584. case "hex":
  32585. case "utf8":
  32586. case "utf-8":
  32587. case "ascii":
  32588. case "latin1":
  32589. case "binary":
  32590. case "base64":
  32591. case "ucs2":
  32592. case "ucs-2":
  32593. case "utf16le":
  32594. case "utf-16le":
  32595. return !0;
  32596. default:
  32597. return !1
  32598. }
  32599. }
  32600. ,
  32601. a.concat = function(e, t) {
  32602. if (!$(e))
  32603. throw new TypeError('"list" argument must be an Array of Buffers');
  32604. if (0 === e.length)
  32605. return a.alloc(0);
  32606. var i;
  32607. if (void 0 === t)
  32608. for (t = 0,
  32609. i = 0; i < e.length; ++i)
  32610. t += e[i].length;
  32611. var n = a.allocUnsafe(t)
  32612. , r = 0;
  32613. for (i = 0; i < e.length; ++i) {
  32614. var o = e[i];
  32615. if (!a.isBuffer(o))
  32616. throw new TypeError('"list" argument must be an Array of Buffers');
  32617. o.copy(n, r),
  32618. r += o.length
  32619. }
  32620. return n
  32621. }
  32622. ,
  32623. a.byteLength = v,
  32624. a.prototype._isBuffer = !0,
  32625. a.prototype.swap16 = function() {
  32626. var e = this.length;
  32627. if (e % 2 !== 0)
  32628. throw new RangeError("Buffer size must be a multiple of 16-bits");
  32629. for (var t = 0; t < e; t += 2)
  32630. y(this, t, t + 1);
  32631. return this
  32632. }
  32633. ,
  32634. a.prototype.swap32 = function() {
  32635. var e = this.length;
  32636. if (e % 4 !== 0)
  32637. throw new RangeError("Buffer size must be a multiple of 32-bits");
  32638. for (var t = 0; t < e; t += 4)
  32639. y(this, t, t + 3),
  32640. y(this, t + 1, t + 2);
  32641. return this
  32642. }
  32643. ,
  32644. a.prototype.swap64 = function() {
  32645. var e = this.length;
  32646. if (e % 8 !== 0)
  32647. throw new RangeError("Buffer size must be a multiple of 64-bits");
  32648. for (var t = 0; t < e; t += 8)
  32649. y(this, t, t + 7),
  32650. y(this, t + 1, t + 6),
  32651. y(this, t + 2, t + 5),
  32652. y(this, t + 3, t + 4);
  32653. return this
  32654. }
  32655. ,
  32656. a.prototype.toString = function() {
  32657. var e = 0 | this.length;
  32658. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  32659. }
  32660. ,
  32661. a.prototype.equals = function(e) {
  32662. if (!a.isBuffer(e))
  32663. throw new TypeError("Argument must be a Buffer");
  32664. return this === e || 0 === a.compare(this, e)
  32665. }
  32666. ,
  32667. a.prototype.inspect = function() {
  32668. var e = ""
  32669. , t = i.INSPECT_MAX_BYTES;
  32670. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  32671. this.length > t && (e += " ... ")),
  32672. "<Buffer " + e + ">"
  32673. }
  32674. ,
  32675. a.prototype.compare = function(e, t, i, n, r) {
  32676. if (!a.isBuffer(e))
  32677. throw new TypeError("Argument must be a Buffer");
  32678. if (void 0 === t && (t = 0),
  32679. void 0 === i && (i = e ? e.length : 0),
  32680. void 0 === n && (n = 0),
  32681. void 0 === r && (r = this.length),
  32682. t < 0 || i > e.length || n < 0 || r > this.length)
  32683. throw new RangeError("out of range index");
  32684. if (n >= r && t >= i)
  32685. return 0;
  32686. if (n >= r)
  32687. return -1;
  32688. if (t >= i)
  32689. return 1;
  32690. if (t >>>= 0,
  32691. i >>>= 0,
  32692. n >>>= 0,
  32693. r >>>= 0,
  32694. this === e)
  32695. return 0;
  32696. 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)
  32697. if (c[u] !== h[u]) {
  32698. o = c[u],
  32699. s = h[u];
  32700. break
  32701. }
  32702. return o < s ? -1 : s < o ? 1 : 0
  32703. }
  32704. ,
  32705. a.prototype.includes = function(e, t, i) {
  32706. return this.indexOf(e, t, i) !== -1
  32707. }
  32708. ,
  32709. a.prototype.indexOf = function(e, t, i) {
  32710. return C(this, e, t, i, !0)
  32711. }
  32712. ,
  32713. a.prototype.lastIndexOf = function(e, t, i) {
  32714. return C(this, e, t, i, !1)
  32715. }
  32716. ,
  32717. a.prototype.write = function(e, t, i, n) {
  32718. if (void 0 === t)
  32719. n = "utf8",
  32720. i = this.length,
  32721. t = 0;
  32722. else if (void 0 === i && "string" == typeof t)
  32723. n = t,
  32724. i = this.length,
  32725. t = 0;
  32726. else {
  32727. if (!isFinite(t))
  32728. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  32729. t |= 0,
  32730. isFinite(i) ? (i |= 0,
  32731. void 0 === n && (n = "utf8")) : (n = i,
  32732. i = void 0)
  32733. }
  32734. var r = this.length - t;
  32735. if ((void 0 === i || i > r) && (i = r),
  32736. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  32737. throw new RangeError("Attempt to write outside buffer bounds");
  32738. n || (n = "utf8");
  32739. for (var o = !1; ; )
  32740. switch (n) {
  32741. case "hex":
  32742. return E(this, e, t, i);
  32743. case "utf8":
  32744. case "utf-8":
  32745. return b(this, e, t, i);
  32746. case "ascii":
  32747. return w(this, e, t, i);
  32748. case "latin1":
  32749. case "binary":
  32750. return _(this, e, t, i);
  32751. case "base64":
  32752. return T(this, e, t, i);
  32753. case "ucs2":
  32754. case "ucs-2":
  32755. case "utf16le":
  32756. case "utf-16le":
  32757. return x(this, e, t, i);
  32758. default:
  32759. if (o)
  32760. throw new TypeError("Unknown encoding: " + n);
  32761. n = ("" + n).toLowerCase(),
  32762. o = !0
  32763. }
  32764. }
  32765. ,
  32766. a.prototype.toJSON = function() {
  32767. return {
  32768. type: "Buffer",
  32769. data: Array.prototype.slice.call(this._arr || this, 0)
  32770. }
  32771. }
  32772. ;
  32773. var ee = 4096;
  32774. a.prototype.slice = function(e, t) {
  32775. var i = this.length;
  32776. e = ~~e,
  32777. t = void 0 === t ? i : ~~t,
  32778. e < 0 ? (e += i,
  32779. e < 0 && (e = 0)) : e > i && (e = i),
  32780. t < 0 ? (t += i,
  32781. t < 0 && (t = 0)) : t > i && (t = i),
  32782. t < e && (t = e);
  32783. var n;
  32784. if (a.TYPED_ARRAY_SUPPORT)
  32785. n = this.subarray(e, t),
  32786. n.__proto__ = a.prototype;
  32787. else {
  32788. var r = t - e;
  32789. n = new a(r,void 0);
  32790. for (var o = 0; o < r; ++o)
  32791. n[o] = this[o + e]
  32792. }
  32793. return n
  32794. }
  32795. ,
  32796. a.prototype.readUIntLE = function(e, t, i) {
  32797. e |= 0,
  32798. t |= 0,
  32799. i || N(e, t, this.length);
  32800. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32801. n += this[e + o] * r;
  32802. return n
  32803. }
  32804. ,
  32805. a.prototype.readUIntBE = function(e, t, i) {
  32806. e |= 0,
  32807. t |= 0,
  32808. i || N(e, t, this.length);
  32809. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  32810. n += this[e + --t] * r;
  32811. return n
  32812. }
  32813. ,
  32814. a.prototype.readUInt8 = function(e, t) {
  32815. return t || N(e, 1, this.length),
  32816. this[e]
  32817. }
  32818. ,
  32819. a.prototype.readUInt16LE = function(e, t) {
  32820. return t || N(e, 2, this.length),
  32821. this[e] | this[e + 1] << 8
  32822. }
  32823. ,
  32824. a.prototype.readUInt16BE = function(e, t) {
  32825. return t || N(e, 2, this.length),
  32826. this[e] << 8 | this[e + 1]
  32827. }
  32828. ,
  32829. a.prototype.readUInt32LE = function(e, t) {
  32830. return t || N(e, 4, this.length),
  32831. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  32832. }
  32833. ,
  32834. a.prototype.readUInt32BE = function(e, t) {
  32835. return t || N(e, 4, this.length),
  32836. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  32837. }
  32838. ,
  32839. a.prototype.readIntLE = function(e, t, i) {
  32840. e |= 0,
  32841. t |= 0,
  32842. i || N(e, t, this.length);
  32843. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  32844. n += this[e + o] * r;
  32845. return r *= 128,
  32846. n >= r && (n -= Math.pow(2, 8 * t)),
  32847. n
  32848. }
  32849. ,
  32850. a.prototype.readIntBE = function(e, t, i) {
  32851. e |= 0,
  32852. t |= 0,
  32853. i || N(e, t, this.length);
  32854. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  32855. o += this[e + --n] * r;
  32856. return r *= 128,
  32857. o >= r && (o -= Math.pow(2, 8 * t)),
  32858. o
  32859. }
  32860. ,
  32861. a.prototype.readInt8 = function(e, t) {
  32862. return t || N(e, 1, this.length),
  32863. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  32864. }
  32865. ,
  32866. a.prototype.readInt16LE = function(e, t) {
  32867. t || N(e, 2, this.length);
  32868. var i = this[e] | this[e + 1] << 8;
  32869. return 32768 & i ? 4294901760 | i : i
  32870. }
  32871. ,
  32872. a.prototype.readInt16BE = function(e, t) {
  32873. t || N(e, 2, this.length);
  32874. var i = this[e + 1] | this[e] << 8;
  32875. return 32768 & i ? 4294901760 | i : i
  32876. }
  32877. ,
  32878. a.prototype.readInt32LE = function(e, t) {
  32879. return t || N(e, 4, this.length),
  32880. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  32881. }
  32882. ,
  32883. a.prototype.readInt32BE = function(e, t) {
  32884. return t || N(e, 4, this.length),
  32885. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  32886. }
  32887. ,
  32888. a.prototype.readFloatLE = function(e, t) {
  32889. return t || N(e, 4, this.length),
  32890. J.read(this, e, !0, 23, 4)
  32891. }
  32892. ,
  32893. a.prototype.readFloatBE = function(e, t) {
  32894. return t || N(e, 4, this.length),
  32895. J.read(this, e, !1, 23, 4)
  32896. }
  32897. ,
  32898. a.prototype.readDoubleLE = function(e, t) {
  32899. return t || N(e, 8, this.length),
  32900. J.read(this, e, !0, 52, 8)
  32901. }
  32902. ,
  32903. a.prototype.readDoubleBE = function(e, t) {
  32904. return t || N(e, 8, this.length),
  32905. J.read(this, e, !1, 52, 8)
  32906. }
  32907. ,
  32908. a.prototype.writeUIntLE = function(e, t, i, n) {
  32909. if (e = +e,
  32910. t |= 0,
  32911. i |= 0,
  32912. !n) {
  32913. var r = Math.pow(2, 8 * i) - 1;
  32914. B(this, e, t, i, r, 0)
  32915. }
  32916. var o = 1
  32917. , a = 0;
  32918. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  32919. this[t + a] = e / o & 255;
  32920. return t + i
  32921. }
  32922. ,
  32923. a.prototype.writeUIntBE = function(e, t, i, n) {
  32924. if (e = +e,
  32925. t |= 0,
  32926. i |= 0,
  32927. !n) {
  32928. var r = Math.pow(2, 8 * i) - 1;
  32929. B(this, e, t, i, r, 0)
  32930. }
  32931. var o = i - 1
  32932. , a = 1;
  32933. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  32934. this[t + o] = e / a & 255;
  32935. return t + i
  32936. }
  32937. ,
  32938. a.prototype.writeUInt8 = function(e, t, i) {
  32939. return e = +e,
  32940. t |= 0,
  32941. i || B(this, e, t, 1, 255, 0),
  32942. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  32943. this[t] = 255 & e,
  32944. t + 1
  32945. }
  32946. ,
  32947. a.prototype.writeUInt16LE = function(e, t, i) {
  32948. return e = +e,
  32949. t |= 0,
  32950. i || B(this, e, t, 2, 65535, 0),
  32951. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  32952. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  32953. t + 2
  32954. }
  32955. ,
  32956. a.prototype.writeUInt16BE = function(e, t, i) {
  32957. return e = +e,
  32958. t |= 0,
  32959. i || B(this, e, t, 2, 65535, 0),
  32960. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  32961. this[t + 1] = 255 & e) : F(this, e, t, !1),
  32962. t + 2
  32963. }
  32964. ,
  32965. a.prototype.writeUInt32LE = function(e, t, i) {
  32966. return e = +e,
  32967. t |= 0,
  32968. i || B(this, e, t, 4, 4294967295, 0),
  32969. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  32970. this[t + 2] = e >>> 16,
  32971. this[t + 1] = e >>> 8,
  32972. this[t] = 255 & e) : V(this, e, t, !0),
  32973. t + 4
  32974. }
  32975. ,
  32976. a.prototype.writeUInt32BE = function(e, t, i) {
  32977. return e = +e,
  32978. t |= 0,
  32979. i || B(this, e, t, 4, 4294967295, 0),
  32980. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  32981. this[t + 1] = e >>> 16,
  32982. this[t + 2] = e >>> 8,
  32983. this[t + 3] = 255 & e) : V(this, e, t, !1),
  32984. t + 4
  32985. }
  32986. ,
  32987. a.prototype.writeIntLE = function(e, t, i, n) {
  32988. if (e = +e,
  32989. t |= 0,
  32990. !n) {
  32991. var r = Math.pow(2, 8 * i - 1);
  32992. B(this, e, t, i, r - 1, -r)
  32993. }
  32994. var o = 0
  32995. , a = 1
  32996. , s = 0;
  32997. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  32998. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  32999. this[t + o] = (e / a >> 0) - s & 255;
  33000. return t + i
  33001. }
  33002. ,
  33003. a.prototype.writeIntBE = function(e, t, i, n) {
  33004. if (e = +e,
  33005. t |= 0,
  33006. !n) {
  33007. var r = Math.pow(2, 8 * i - 1);
  33008. B(this, e, t, i, r - 1, -r)
  33009. }
  33010. var o = i - 1
  33011. , a = 1
  33012. , s = 0;
  33013. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  33014. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  33015. this[t + o] = (e / a >> 0) - s & 255;
  33016. return t + i
  33017. }
  33018. ,
  33019. a.prototype.writeInt8 = function(e, t, i) {
  33020. return e = +e,
  33021. t |= 0,
  33022. i || B(this, e, t, 1, 127, -128),
  33023. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  33024. e < 0 && (e = 255 + e + 1),
  33025. this[t] = 255 & e,
  33026. t + 1
  33027. }
  33028. ,
  33029. a.prototype.writeInt16LE = function(e, t, i) {
  33030. return e = +e,
  33031. t |= 0,
  33032. i || B(this, e, t, 2, 32767, -32768),
  33033. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33034. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  33035. t + 2
  33036. }
  33037. ,
  33038. a.prototype.writeInt16BE = function(e, t, i) {
  33039. return e = +e,
  33040. t |= 0,
  33041. i || B(this, e, t, 2, 32767, -32768),
  33042. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  33043. this[t + 1] = 255 & e) : F(this, e, t, !1),
  33044. t + 2
  33045. }
  33046. ,
  33047. a.prototype.writeInt32LE = function(e, t, i) {
  33048. return e = +e,
  33049. t |= 0,
  33050. i || B(this, e, t, 4, 2147483647, -2147483648),
  33051. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  33052. this[t + 1] = e >>> 8,
  33053. this[t + 2] = e >>> 16,
  33054. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  33055. t + 4
  33056. }
  33057. ,
  33058. a.prototype.writeInt32BE = function(e, t, i) {
  33059. return e = +e,
  33060. t |= 0,
  33061. i || B(this, e, t, 4, 2147483647, -2147483648),
  33062. e < 0 && (e = 4294967295 + e + 1),
  33063. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  33064. this[t + 1] = e >>> 16,
  33065. this[t + 2] = e >>> 8,
  33066. this[t + 3] = 255 & e) : V(this, e, t, !1),
  33067. t + 4
  33068. }
  33069. ,
  33070. a.prototype.writeFloatLE = function(e, t, i) {
  33071. return k(this, e, t, !0, i)
  33072. }
  33073. ,
  33074. a.prototype.writeFloatBE = function(e, t, i) {
  33075. return k(this, e, t, !1, i)
  33076. }
  33077. ,
  33078. a.prototype.writeDoubleLE = function(e, t, i) {
  33079. return H(this, e, t, !0, i)
  33080. }
  33081. ,
  33082. a.prototype.writeDoubleBE = function(e, t, i) {
  33083. return H(this, e, t, !1, i)
  33084. }
  33085. ,
  33086. a.prototype.copy = function(e, t, i, n) {
  33087. if (i || (i = 0),
  33088. n || 0 === n || (n = this.length),
  33089. t >= e.length && (t = e.length),
  33090. t || (t = 0),
  33091. n > 0 && n < i && (n = i),
  33092. n === i)
  33093. return 0;
  33094. if (0 === e.length || 0 === this.length)
  33095. return 0;
  33096. if (t < 0)
  33097. throw new RangeError("targetStart out of bounds");
  33098. if (i < 0 || i >= this.length)
  33099. throw new RangeError("sourceStart out of bounds");
  33100. if (n < 0)
  33101. throw new RangeError("sourceEnd out of bounds");
  33102. n > this.length && (n = this.length),
  33103. e.length - t < n - i && (n = e.length - t + i);
  33104. var r, o = n - i;
  33105. if (this === e && i < t && t < n)
  33106. for (r = o - 1; r >= 0; --r)
  33107. e[r + t] = this[r + i];
  33108. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  33109. for (r = 0; r < o; ++r)
  33110. e[r + t] = this[r + i];
  33111. else
  33112. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  33113. return o
  33114. }
  33115. ,
  33116. a.prototype.fill = function(e, t, i, n) {
  33117. if ("string" == typeof e) {
  33118. if ("string" == typeof t ? (n = t,
  33119. t = 0,
  33120. i = this.length) : "string" == typeof i && (n = i,
  33121. i = this.length),
  33122. 1 === e.length) {
  33123. var r = e.charCodeAt(0);
  33124. r < 256 && (e = r)
  33125. }
  33126. if (void 0 !== n && "string" != typeof n)
  33127. throw new TypeError("encoding must be a string");
  33128. if ("string" == typeof n && !a.isEncoding(n))
  33129. throw new TypeError("Unknown encoding: " + n)
  33130. } else
  33131. "number" == typeof e && (e &= 255);
  33132. if (t < 0 || this.length < t || this.length < i)
  33133. throw new RangeError("Out of range index");
  33134. if (i <= t)
  33135. return this;
  33136. t >>>= 0,
  33137. i = void 0 === i ? this.length : i >>> 0,
  33138. e || (e = 0);
  33139. var o;
  33140. if ("number" == typeof e)
  33141. for (o = t; o < i; ++o)
  33142. this[o] = e;
  33143. else {
  33144. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  33145. , l = s.length;
  33146. for (o = 0; o < i - t; ++o)
  33147. this[o + t] = s[o % l]
  33148. }
  33149. return this
  33150. }
  33151. ;
  33152. var te = /[^+\/0-9A-Za-z-_]/g
  33153. }
  33154. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33155. }
  33156. , {
  33157. "base64-js": 199,
  33158. ieee754: 200,
  33159. isarray: 201
  33160. }],
  33161. 199: [function(e, t, i) {
  33162. "use strict";
  33163. function n(e) {
  33164. var t = e.length;
  33165. if (t % 4 > 0)
  33166. throw new Error("Invalid string. Length must be a multiple of 4");
  33167. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  33168. }
  33169. function r(e) {
  33170. return 3 * e.length / 4 - n(e)
  33171. }
  33172. function o(e) {
  33173. var t, i, r, o, a, s, l = e.length;
  33174. a = n(e),
  33175. s = new u(3 * l / 4 - a),
  33176. r = a > 0 ? l - 4 : l;
  33177. var c = 0;
  33178. for (t = 0,
  33179. i = 0; t < r; t += 4,
  33180. i += 3)
  33181. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  33182. s[c++] = o >> 16 & 255,
  33183. s[c++] = o >> 8 & 255,
  33184. s[c++] = 255 & o;
  33185. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  33186. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  33187. s[c++] = o >> 8 & 255,
  33188. s[c++] = 255 & o),
  33189. s
  33190. }
  33191. function a(e) {
  33192. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  33193. }
  33194. function s(e, t, i) {
  33195. for (var n, r = [], o = t; o < i; o += 3)
  33196. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  33197. r.push(a(n));
  33198. return r.join("")
  33199. }
  33200. function l(e) {
  33201. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  33202. o.push(s(e, l, l + a > h ? h : l + a));
  33203. return 1 === n ? (t = e[i - 1],
  33204. r += c[t >> 2],
  33205. r += c[t << 4 & 63],
  33206. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  33207. r += c[t >> 10],
  33208. r += c[t >> 4 & 63],
  33209. r += c[t << 2 & 63],
  33210. r += "="),
  33211. o.push(r),
  33212. o.join("")
  33213. }
  33214. i.byteLength = r,
  33215. i.toByteArray = o,
  33216. i.fromByteArray = l;
  33217. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  33218. c[p] = d[p],
  33219. h[d.charCodeAt(p)] = p;
  33220. h["-".charCodeAt(0)] = 62,
  33221. h["_".charCodeAt(0)] = 63
  33222. }
  33223. , {}],
  33224. 200: [function(e, t, i) {
  33225. i.read = function(e, t, i, n, r) {
  33226. 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];
  33227. for (u += d,
  33228. o = p & (1 << -h) - 1,
  33229. p >>= -h,
  33230. h += s; h > 0; o = 256 * o + e[t + u],
  33231. u += d,
  33232. h -= 8)
  33233. ;
  33234. for (a = o & (1 << -h) - 1,
  33235. o >>= -h,
  33236. h += n; h > 0; a = 256 * a + e[t + u],
  33237. u += d,
  33238. h -= 8)
  33239. ;
  33240. if (0 === o)
  33241. o = 1 - c;
  33242. else {
  33243. if (o === l)
  33244. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  33245. a += Math.pow(2, n),
  33246. o -= c
  33247. }
  33248. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  33249. }
  33250. ,
  33251. i.write = function(e, t, i, n, r, o) {
  33252. 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;
  33253. for (t = Math.abs(t),
  33254. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  33255. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  33256. t * (l = Math.pow(2, -a)) < 1 && (a--,
  33257. l *= 2),
  33258. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  33259. t * l >= 2 && (a++,
  33260. l /= 2),
  33261. a + u >= h ? (s = 0,
  33262. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  33263. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  33264. a = 0)); r >= 8; e[i + p] = 255 & s,
  33265. p += f,
  33266. s /= 256,
  33267. r -= 8)
  33268. ;
  33269. for (a = a << r | s,
  33270. c += r; c > 0; e[i + p] = 255 & a,
  33271. p += f,
  33272. a /= 256,
  33273. c -= 8)
  33274. ;
  33275. e[i + p - f] |= 128 * g
  33276. }
  33277. }
  33278. , {}],
  33279. 201: [function(e, t, i) {
  33280. var n = {}.toString;
  33281. t.exports = Array.isArray || function(e) {
  33282. return "[object Array]" == n.call(e)
  33283. }
  33284. }
  33285. , {}],
  33286. 202: [function(e, t, i) {
  33287. function n() {
  33288. this._events = this._events || {},
  33289. this._maxListeners = this._maxListeners || void 0
  33290. }
  33291. function r(e) {
  33292. return "function" == typeof e
  33293. }
  33294. function o(e) {
  33295. return "number" == typeof e
  33296. }
  33297. function a(e) {
  33298. return "object" == typeof e && null !== e
  33299. }
  33300. function s(e) {
  33301. return void 0 === e
  33302. }
  33303. t.exports = n,
  33304. n.EventEmitter = n,
  33305. n.prototype._events = void 0,
  33306. n.prototype._maxListeners = void 0,
  33307. n.defaultMaxListeners = 10,
  33308. n.prototype.setMaxListeners = function(e) {
  33309. if (!o(e) || e < 0 || isNaN(e))
  33310. throw TypeError("n must be a positive number");
  33311. return this._maxListeners = e,
  33312. this
  33313. }
  33314. ,
  33315. n.prototype.emit = function(e) {
  33316. var t, i, n, o, l, c;
  33317. if (this._events || (this._events = {}),
  33318. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  33319. if (t = arguments[1],
  33320. t instanceof Error)
  33321. throw t;
  33322. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  33323. throw h.context = t,
  33324. h
  33325. }
  33326. if (i = this._events[e],
  33327. s(i))
  33328. return !1;
  33329. if (r(i))
  33330. switch (arguments.length) {
  33331. case 1:
  33332. i.call(this);
  33333. break;
  33334. case 2:
  33335. i.call(this, arguments[1]);
  33336. break;
  33337. case 3:
  33338. i.call(this, arguments[1], arguments[2]);
  33339. break;
  33340. default:
  33341. o = Array.prototype.slice.call(arguments, 1),
  33342. i.apply(this, o)
  33343. }
  33344. else if (a(i))
  33345. for (o = Array.prototype.slice.call(arguments, 1),
  33346. c = i.slice(),
  33347. n = c.length,
  33348. l = 0; l < n; l++)
  33349. c[l].apply(this, o);
  33350. return !0
  33351. }
  33352. ,
  33353. n.prototype.addListener = function(e, t) {
  33354. var i;
  33355. if (!r(t))
  33356. throw TypeError("listener must be a function");
  33357. return this._events || (this._events = {}),
  33358. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  33359. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  33360. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  33361. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  33362. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  33363. "function" == typeof console.trace && console.trace())),
  33364. this
  33365. }
  33366. ,
  33367. n.prototype.on = n.prototype.addListener,
  33368. n.prototype.once = function(e, t) {
  33369. function i() {
  33370. this.removeListener(e, i),
  33371. n || (n = !0,
  33372. t.apply(this, arguments))
  33373. }
  33374. if (!r(t))
  33375. throw TypeError("listener must be a function");
  33376. var n = !1;
  33377. return i.listener = t,
  33378. this.on(e, i),
  33379. this
  33380. }
  33381. ,
  33382. n.prototype.removeListener = function(e, t) {
  33383. var i, n, o, s;
  33384. if (!r(t))
  33385. throw TypeError("listener must be a function");
  33386. if (!this._events || !this._events[e])
  33387. return this;
  33388. if (i = this._events[e],
  33389. o = i.length,
  33390. n = -1,
  33391. i === t || r(i.listener) && i.listener === t)
  33392. delete this._events[e],
  33393. this._events.removeListener && this.emit("removeListener", e, t);
  33394. else if (a(i)) {
  33395. for (s = o; s-- > 0; )
  33396. if (i[s] === t || i[s].listener && i[s].listener === t) {
  33397. n = s;
  33398. break
  33399. }
  33400. if (n < 0)
  33401. return this;
  33402. 1 === i.length ? (i.length = 0,
  33403. delete this._events[e]) : i.splice(n, 1),
  33404. this._events.removeListener && this.emit("removeListener", e, t)
  33405. }
  33406. return this
  33407. }
  33408. ,
  33409. n.prototype.removeAllListeners = function(e) {
  33410. var t, i;
  33411. if (!this._events)
  33412. return this;
  33413. if (!this._events.removeListener)
  33414. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  33415. this;
  33416. if (0 === arguments.length) {
  33417. for (t in this._events)
  33418. "removeListener" !== t && this.removeAllListeners(t);
  33419. return this.removeAllListeners("removeListener"),
  33420. this._events = {},
  33421. this
  33422. }
  33423. if (i = this._events[e],
  33424. r(i))
  33425. this.removeListener(e, i);
  33426. else if (i)
  33427. for (; i.length; )
  33428. this.removeListener(e, i[i.length - 1]);
  33429. return delete this._events[e],
  33430. this
  33431. }
  33432. ,
  33433. n.prototype.listeners = function(e) {
  33434. var t;
  33435. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  33436. }
  33437. ,
  33438. n.prototype.listenerCount = function(e) {
  33439. if (this._events) {
  33440. var t = this._events[e];
  33441. if (r(t))
  33442. return 1;
  33443. if (t)
  33444. return t.length
  33445. }
  33446. return 0
  33447. }
  33448. ,
  33449. n.listenerCount = function(e, t) {
  33450. return e.listenerCount(t)
  33451. }
  33452. }
  33453. , {}],
  33454. 203: [function(e, t, i) {
  33455. function n() {
  33456. throw new Error("setTimeout has not been defined")
  33457. }
  33458. function r() {
  33459. throw new Error("clearTimeout has not been defined")
  33460. }
  33461. function o(e) {
  33462. if (u === setTimeout)
  33463. return setTimeout(e, 0);
  33464. if ((u === n || !u) && setTimeout)
  33465. return u = setTimeout,
  33466. setTimeout(e, 0);
  33467. try {
  33468. return u(e, 0)
  33469. } catch (t) {
  33470. try {
  33471. return u.call(null, e, 0)
  33472. } catch (t) {
  33473. return u.call(this, e, 0)
  33474. }
  33475. }
  33476. }
  33477. function a(e) {
  33478. if (d === clearTimeout)
  33479. return clearTimeout(e);
  33480. if ((d === r || !d) && clearTimeout)
  33481. return d = clearTimeout,
  33482. clearTimeout(e);
  33483. try {
  33484. return d(e)
  33485. } catch (t) {
  33486. try {
  33487. return d.call(null, e)
  33488. } catch (t) {
  33489. return d.call(this, e)
  33490. }
  33491. }
  33492. }
  33493. function s() {
  33494. m && f && (m = !1,
  33495. f.length ? g = f.concat(g) : v = -1,
  33496. g.length && l())
  33497. }
  33498. function l() {
  33499. if (!m) {
  33500. var e = o(s);
  33501. m = !0;
  33502. for (var t = g.length; t; ) {
  33503. for (f = g,
  33504. g = []; ++v < t; )
  33505. f && f[v].run();
  33506. v = -1,
  33507. t = g.length
  33508. }
  33509. f = null,
  33510. m = !1,
  33511. a(e)
  33512. }
  33513. }
  33514. function c(e, t) {
  33515. this.fun = e,
  33516. this.array = t
  33517. }
  33518. function h() {}
  33519. var u, d, p = t.exports = {};
  33520. !function() {
  33521. try {
  33522. u = "function" == typeof setTimeout ? setTimeout : n
  33523. } catch (e) {
  33524. u = n
  33525. }
  33526. try {
  33527. d = "function" == typeof clearTimeout ? clearTimeout : r
  33528. } catch (e) {
  33529. d = r
  33530. }
  33531. }();
  33532. var f, g = [], m = !1, v = -1;
  33533. p.nextTick = function(e) {
  33534. var t = new Array(arguments.length - 1);
  33535. if (arguments.length > 1)
  33536. for (var i = 1; i < arguments.length; i++)
  33537. t[i - 1] = arguments[i];
  33538. g.push(new c(e,t)),
  33539. 1 !== g.length || m || o(l)
  33540. }
  33541. ,
  33542. c.prototype.run = function() {
  33543. this.fun.apply(null, this.array)
  33544. }
  33545. ,
  33546. p.title = "browser",
  33547. p.browser = !0,
  33548. p.env = {},
  33549. p.argv = [],
  33550. p.version = "",
  33551. p.versions = {},
  33552. p.on = h,
  33553. p.addListener = h,
  33554. p.once = h,
  33555. p.off = h,
  33556. p.removeListener = h,
  33557. p.removeAllListeners = h,
  33558. p.emit = h,
  33559. p.binding = function(e) {
  33560. throw new Error("process.binding is not supported")
  33561. }
  33562. ,
  33563. p.cwd = function() {
  33564. return "/"
  33565. }
  33566. ,
  33567. p.chdir = function(e) {
  33568. throw new Error("process.chdir is not supported")
  33569. }
  33570. ,
  33571. p.umask = function() {
  33572. return 0
  33573. }
  33574. }
  33575. , {}],
  33576. 204: [function(e, t, i) {
  33577. (function(e) {
  33578. !function(n) {
  33579. function r(e) {
  33580. throw new RangeError(L[e])
  33581. }
  33582. function o(e, t) {
  33583. for (var i = e.length, n = []; i--; )
  33584. n[i] = t(e[i]);
  33585. return n
  33586. }
  33587. function a(e, t) {
  33588. var i = e.split("@")
  33589. , n = "";
  33590. i.length > 1 && (n = i[0] + "@",
  33591. e = i[1]),
  33592. e = e.replace(O, ".");
  33593. var r = e.split(".")
  33594. , a = o(r, t).join(".");
  33595. return n + a
  33596. }
  33597. function s(e) {
  33598. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  33599. t = e.charCodeAt(r++),
  33600. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  33601. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  33602. r--)) : n.push(t);
  33603. return n
  33604. }
  33605. function l(e) {
  33606. return o(e, function(e) {
  33607. var t = "";
  33608. return e > 65535 && (e -= 65536,
  33609. t += B(e >>> 10 & 1023 | 55296),
  33610. e = 56320 | 1023 & e),
  33611. t += B(e)
  33612. }).join("")
  33613. }
  33614. function c(e) {
  33615. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  33616. }
  33617. function h(e, t) {
  33618. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  33619. }
  33620. function u(e, t, i) {
  33621. var n = 0;
  33622. for (e = i ? N(e / T) : e >> 1,
  33623. e += N(e / t); e > D * w >> 1; n += E)
  33624. e = N(e / D);
  33625. return N(n + (D + 1) * e / (e + _))
  33626. }
  33627. function d(e) {
  33628. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  33629. for (i = e.lastIndexOf(M),
  33630. i < 0 && (i = 0),
  33631. n = 0; n < i; ++n)
  33632. e.charCodeAt(n) >= 128 && r("not-basic"),
  33633. g.push(e.charCodeAt(n));
  33634. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  33635. for (a = v,
  33636. s = 1,
  33637. h = E; o >= m && r("invalid-input"),
  33638. d = c(e.charCodeAt(o++)),
  33639. (d >= E || d > N((I - v) / s)) && r("overflow"),
  33640. v += d * s,
  33641. p = h <= y ? b : h >= y + w ? w : h - y,
  33642. !(d < p); h += E)
  33643. f = E - p,
  33644. s > N(I / f) && r("overflow"),
  33645. s *= f;
  33646. t = g.length + 1,
  33647. y = u(v - a, t, 0 == a),
  33648. N(v / t) > I - A && r("overflow"),
  33649. A += N(v / t),
  33650. v %= t,
  33651. g.splice(v++, 0, A)
  33652. }
  33653. return l(g)
  33654. }
  33655. function p(e) {
  33656. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  33657. for (e = s(e),
  33658. m = e.length,
  33659. t = S,
  33660. i = 0,
  33661. a = x,
  33662. l = 0; l < m; ++l)
  33663. g = e[l],
  33664. g < 128 && C.push(B(g));
  33665. for (n = o = C.length,
  33666. o && C.push(M); n < m; ) {
  33667. for (c = I,
  33668. l = 0; l < m; ++l)
  33669. g = e[l],
  33670. g >= t && g < c && (c = g);
  33671. for (v = n + 1,
  33672. c - t > N((I - i) / v) && r("overflow"),
  33673. i += (c - t) * v,
  33674. t = c,
  33675. l = 0; l < m; ++l)
  33676. if (g = e[l],
  33677. g < t && ++i > I && r("overflow"),
  33678. g == t) {
  33679. for (d = i,
  33680. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  33681. !(d < f); p += E)
  33682. y = d - f,
  33683. A = E - f,
  33684. C.push(B(h(f + y % A, 0))),
  33685. d = N(y / A);
  33686. C.push(B(h(d, 0))),
  33687. a = u(i, v, n == o),
  33688. i = 0,
  33689. ++n
  33690. }
  33691. ++i,
  33692. ++t
  33693. }
  33694. return C.join("")
  33695. }
  33696. function f(e) {
  33697. return a(e, function(e) {
  33698. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  33699. })
  33700. }
  33701. function g(e) {
  33702. return a(e, function(e) {
  33703. return P.test(e) ? "xn--" + p(e) : e
  33704. })
  33705. }
  33706. var m = "object" == typeof i && i && !i.nodeType && i
  33707. , v = "object" == typeof t && t && !t.nodeType && t
  33708. , A = "object" == typeof e && e;
  33709. A.global !== A && A.window !== A && A.self !== A || (n = A);
  33710. 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 = {
  33711. overflow: "Overflow: input needs wider integers to process",
  33712. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  33713. "invalid-input": "Invalid input"
  33714. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  33715. if (y = {
  33716. version: "1.4.1",
  33717. ucs2: {
  33718. decode: s,
  33719. encode: l
  33720. },
  33721. decode: d,
  33722. encode: p,
  33723. toASCII: g,
  33724. toUnicode: f
  33725. },
  33726. "function" == typeof define && "object" == typeof define.amd && define.amd)
  33727. define("punycode", function() {
  33728. return y
  33729. });
  33730. else if (m && v)
  33731. if (t.exports == m)
  33732. v.exports = y;
  33733. else
  33734. for (C in y)
  33735. y.hasOwnProperty(C) && (m[C] = y[C]);
  33736. else
  33737. n.punycode = y
  33738. }(this)
  33739. }
  33740. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  33741. }
  33742. , {}],
  33743. 205: [function(e, t, i) {
  33744. "use strict";
  33745. function n(e, t) {
  33746. return Object.prototype.hasOwnProperty.call(e, t)
  33747. }
  33748. t.exports = function(e, t, i, o) {
  33749. t = t || "&",
  33750. i = i || "=";
  33751. var a = {};
  33752. if ("string" != typeof e || 0 === e.length)
  33753. return a;
  33754. var s = /\+/g;
  33755. e = e.split(t);
  33756. var l = 1e3;
  33757. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  33758. var c = e.length;
  33759. l > 0 && c > l && (c = l);
  33760. for (var h = 0; h < c; ++h) {
  33761. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  33762. m >= 0 ? (u = g.substr(0, m),
  33763. d = g.substr(m + 1)) : (u = g,
  33764. d = ""),
  33765. p = decodeURIComponent(u),
  33766. f = decodeURIComponent(d),
  33767. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  33768. }
  33769. return a
  33770. }
  33771. ;
  33772. var r = Array.isArray || function(e) {
  33773. return "[object Array]" === Object.prototype.toString.call(e)
  33774. }
  33775. }
  33776. , {}],
  33777. 206: [function(e, t, i) {
  33778. "use strict";
  33779. function n(e, t) {
  33780. if (e.map)
  33781. return e.map(t);
  33782. for (var i = [], n = 0; n < e.length; n++)
  33783. i.push(t(e[n], n));
  33784. return i
  33785. }
  33786. var r = function(e) {
  33787. switch (typeof e) {
  33788. case "string":
  33789. return e;
  33790. case "boolean":
  33791. return e ? "true" : "false";
  33792. case "number":
  33793. return isFinite(e) ? e : "";
  33794. default:
  33795. return ""
  33796. }
  33797. };
  33798. t.exports = function(e, t, i, s) {
  33799. return t = t || "&",
  33800. i = i || "=",
  33801. null === e && (e = void 0),
  33802. "object" == typeof e ? n(a(e), function(a) {
  33803. var s = encodeURIComponent(r(a)) + i;
  33804. return o(e[a]) ? n(e[a], function(e) {
  33805. return s + encodeURIComponent(r(e))
  33806. }).join(t) : s + encodeURIComponent(r(e[a]))
  33807. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  33808. }
  33809. ;
  33810. var o = Array.isArray || function(e) {
  33811. return "[object Array]" === Object.prototype.toString.call(e)
  33812. }
  33813. , a = Object.keys || function(e) {
  33814. var t = [];
  33815. for (var i in e)
  33816. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  33817. return t
  33818. }
  33819. }
  33820. , {}],
  33821. 207: [function(e, t, i) {
  33822. "use strict";
  33823. i.decode = i.parse = e("./decode"),
  33824. i.encode = i.stringify = e("./encode")
  33825. }
  33826. , {
  33827. "./decode": 205,
  33828. "./encode": 206
  33829. }],
  33830. 208: [function(e, t, i) {
  33831. "use strict";
  33832. function n() {
  33833. this.protocol = null,
  33834. this.slashes = null,
  33835. this.auth = null,
  33836. this.host = null,
  33837. this.port = null,
  33838. this.hostname = null,
  33839. this.hash = null,
  33840. this.search = null,
  33841. this.query = null,
  33842. this.pathname = null,
  33843. this.path = null,
  33844. this.href = null
  33845. }
  33846. function r(e, t, i) {
  33847. if (e && c.isObject(e) && e instanceof n)
  33848. return e;
  33849. var r = new n;
  33850. return r.parse(e, t, i),
  33851. r
  33852. }
  33853. function o(e) {
  33854. return c.isString(e) && (e = r(e)),
  33855. e instanceof n ? e.format() : n.prototype.format.call(e)
  33856. }
  33857. function a(e, t) {
  33858. return r(e, !1, !0).resolve(t)
  33859. }
  33860. function s(e, t) {
  33861. return e ? r(e, !1, !0).resolveObject(t) : t
  33862. }
  33863. var l = e("punycode")
  33864. , c = e("./util");
  33865. i.parse = r,
  33866. i.resolve = a,
  33867. i.resolveObject = s,
  33868. i.format = o,
  33869. i.Url = n;
  33870. var h = /^([a-z0-9.+-]+:)/i
  33871. , u = /:[0-9]*$/
  33872. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  33873. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  33874. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  33875. , g = ["'"].concat(f)
  33876. , m = ["%", "/", "?", ";", "#"].concat(g)
  33877. , v = ["/", "?", "#"]
  33878. , A = 255
  33879. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  33880. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  33881. , I = {
  33882. javascript: !0,
  33883. "javascript:": !0
  33884. }
  33885. , E = {
  33886. javascript: !0,
  33887. "javascript:": !0
  33888. }
  33889. , b = {
  33890. http: !0,
  33891. https: !0,
  33892. ftp: !0,
  33893. gopher: !0,
  33894. file: !0,
  33895. "http:": !0,
  33896. "https:": !0,
  33897. "ftp:": !0,
  33898. "gopher:": !0,
  33899. "file:": !0
  33900. }
  33901. , w = e("querystring");
  33902. n.prototype.parse = function(e, t, i) {
  33903. if (!c.isString(e))
  33904. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  33905. var n = e.indexOf("?")
  33906. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  33907. , o = e.split(r)
  33908. , a = /\\/g;
  33909. o[0] = o[0].replace(a, "/"),
  33910. e = o.join(r);
  33911. var s = e;
  33912. if (s = s.trim(),
  33913. !i && 1 === e.split("#").length) {
  33914. var u = d.exec(s);
  33915. if (u)
  33916. return this.path = s,
  33917. this.href = s,
  33918. this.pathname = u[1],
  33919. u[2] ? (this.search = u[2],
  33920. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  33921. this.query = {}),
  33922. this
  33923. }
  33924. var p = h.exec(s);
  33925. if (p) {
  33926. p = p[0];
  33927. var f = p.toLowerCase();
  33928. this.protocol = f,
  33929. s = s.substr(p.length)
  33930. }
  33931. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  33932. var _ = "//" === s.substr(0, 2);
  33933. !_ || p && E[p] || (s = s.substr(2),
  33934. this.slashes = !0)
  33935. }
  33936. if (!E[p] && (_ || p && !b[p])) {
  33937. for (var T = -1, x = 0; x < v.length; x++) {
  33938. var S = s.indexOf(v[x]);
  33939. S !== -1 && (T === -1 || S < T) && (T = S)
  33940. }
  33941. var M, R;
  33942. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  33943. R !== -1 && (M = s.slice(0, R),
  33944. s = s.slice(R + 1),
  33945. this.auth = decodeURIComponent(M)),
  33946. T = -1;
  33947. for (var x = 0; x < m.length; x++) {
  33948. var S = s.indexOf(m[x]);
  33949. S !== -1 && (T === -1 || S < T) && (T = S)
  33950. }
  33951. T === -1 && (T = s.length),
  33952. this.host = s.slice(0, T),
  33953. s = s.slice(T),
  33954. this.parseHost(),
  33955. this.hostname = this.hostname || "";
  33956. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  33957. if (!P)
  33958. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  33959. var D = O[x];
  33960. if (D && !D.match(y)) {
  33961. for (var N = "", B = 0, F = D.length; B < F; B++)
  33962. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  33963. if (!N.match(y)) {
  33964. var V = O.slice(0, x)
  33965. , U = O.slice(x + 1)
  33966. , k = D.match(C);
  33967. k && (V.push(k[1]),
  33968. U.unshift(k[2])),
  33969. U.length && (s = "/" + U.join(".") + s),
  33970. this.hostname = V.join(".");
  33971. break
  33972. }
  33973. }
  33974. }
  33975. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  33976. P || (this.hostname = l.toASCII(this.hostname));
  33977. var H = this.port ? ":" + this.port : ""
  33978. , G = this.hostname || "";
  33979. this.host = G + H,
  33980. this.href += this.host,
  33981. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  33982. "/" !== s[0] && (s = "/" + s))
  33983. }
  33984. if (!I[f])
  33985. for (var x = 0, L = g.length; x < L; x++) {
  33986. var z = g[x];
  33987. if (s.indexOf(z) !== -1) {
  33988. var W = encodeURIComponent(z);
  33989. W === z && (W = escape(z)),
  33990. s = s.split(z).join(W)
  33991. }
  33992. }
  33993. var j = s.indexOf("#");
  33994. j !== -1 && (this.hash = s.substr(j),
  33995. s = s.slice(0, j));
  33996. var Y = s.indexOf("?");
  33997. if (Y !== -1 ? (this.search = s.substr(Y),
  33998. this.query = s.substr(Y + 1),
  33999. t && (this.query = w.parse(this.query)),
  34000. s = s.slice(0, Y)) : t && (this.search = "",
  34001. this.query = {}),
  34002. s && (this.pathname = s),
  34003. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  34004. this.pathname || this.search) {
  34005. var H = this.pathname || ""
  34006. , X = this.search || "";
  34007. this.path = H + X
  34008. }
  34009. return this.href = this.format(),
  34010. this
  34011. }
  34012. ,
  34013. n.prototype.format = function() {
  34014. var e = this.auth || "";
  34015. e && (e = encodeURIComponent(e),
  34016. e = e.replace(/%3A/i, ":"),
  34017. e += "@");
  34018. var t = this.protocol || ""
  34019. , i = this.pathname || ""
  34020. , n = this.hash || ""
  34021. , r = !1
  34022. , o = "";
  34023. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  34024. this.port && (r += ":" + this.port)),
  34025. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  34026. var a = this.search || o && "?" + o || "";
  34027. return t && ":" !== t.substr(-1) && (t += ":"),
  34028. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  34029. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  34030. n && "#" !== n.charAt(0) && (n = "#" + n),
  34031. a && "?" !== a.charAt(0) && (a = "?" + a),
  34032. i = i.replace(/[?#]/g, function(e) {
  34033. return encodeURIComponent(e)
  34034. }),
  34035. a = a.replace("#", "%23"),
  34036. t + r + i + a + n
  34037. }
  34038. ,
  34039. n.prototype.resolve = function(e) {
  34040. return this.resolveObject(r(e, !1, !0)).format()
  34041. }
  34042. ,
  34043. n.prototype.resolveObject = function(e) {
  34044. if (c.isString(e)) {
  34045. var t = new n;
  34046. t.parse(e, !1, !0),
  34047. e = t
  34048. }
  34049. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  34050. var a = r[o];
  34051. i[a] = this[a]
  34052. }
  34053. if (i.hash = e.hash,
  34054. "" === e.href)
  34055. return i.href = i.format(),
  34056. i;
  34057. if (e.slashes && !e.protocol) {
  34058. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  34059. var h = s[l];
  34060. "protocol" !== h && (i[h] = e[h])
  34061. }
  34062. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  34063. i.href = i.format(),
  34064. i
  34065. }
  34066. if (e.protocol && e.protocol !== i.protocol) {
  34067. if (!b[e.protocol]) {
  34068. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  34069. var p = u[d];
  34070. i[p] = e[p]
  34071. }
  34072. return i.href = i.format(),
  34073. i
  34074. }
  34075. if (i.protocol = e.protocol,
  34076. e.host || E[e.protocol])
  34077. i.pathname = e.pathname;
  34078. else {
  34079. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  34080. ;
  34081. e.host || (e.host = ""),
  34082. e.hostname || (e.hostname = ""),
  34083. "" !== f[0] && f.unshift(""),
  34084. f.length < 2 && f.unshift(""),
  34085. i.pathname = f.join("/")
  34086. }
  34087. if (i.search = e.search,
  34088. i.query = e.query,
  34089. i.host = e.host || "",
  34090. i.auth = e.auth,
  34091. i.hostname = e.hostname || e.host,
  34092. i.port = e.port,
  34093. i.pathname || i.search) {
  34094. var g = i.pathname || ""
  34095. , m = i.search || "";
  34096. i.path = g + m
  34097. }
  34098. return i.slashes = i.slashes || e.slashes,
  34099. i.href = i.format(),
  34100. i
  34101. }
  34102. var v = i.pathname && "/" === i.pathname.charAt(0)
  34103. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  34104. , y = A || v || i.host && e.pathname
  34105. , C = y
  34106. , I = i.pathname && i.pathname.split("/") || []
  34107. , f = e.pathname && e.pathname.split("/") || []
  34108. , w = i.protocol && !b[i.protocol];
  34109. if (w && (i.hostname = "",
  34110. i.port = null,
  34111. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  34112. i.host = "",
  34113. e.protocol && (e.hostname = null,
  34114. e.port = null,
  34115. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  34116. e.host = null),
  34117. y = y && ("" === f[0] || "" === I[0])),
  34118. A)
  34119. i.host = e.host || "" === e.host ? e.host : i.host,
  34120. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  34121. i.search = e.search,
  34122. i.query = e.query,
  34123. I = f;
  34124. else if (f.length)
  34125. I || (I = []),
  34126. I.pop(),
  34127. I = I.concat(f),
  34128. i.search = e.search,
  34129. i.query = e.query;
  34130. else if (!c.isNullOrUndefined(e.search)) {
  34131. if (w) {
  34132. i.hostname = i.host = I.shift();
  34133. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34134. _ && (i.auth = _.shift(),
  34135. i.host = i.hostname = _.shift())
  34136. }
  34137. return i.search = e.search,
  34138. i.query = e.query,
  34139. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34140. i.href = i.format(),
  34141. i
  34142. }
  34143. if (!I.length)
  34144. return i.pathname = null,
  34145. i.search ? i.path = "/" + i.search : i.path = null,
  34146. i.href = i.format(),
  34147. i;
  34148. 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--)
  34149. T = I[M],
  34150. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  34151. S++) : S && (I.splice(M, 1),
  34152. S--);
  34153. if (!y && !C)
  34154. for (; S--; S)
  34155. I.unshift("..");
  34156. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  34157. x && "/" !== I.join("/").substr(-1) && I.push("");
  34158. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  34159. if (w) {
  34160. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  34161. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  34162. _ && (i.auth = _.shift(),
  34163. i.host = i.hostname = _.shift())
  34164. }
  34165. return y = y || i.host && I.length,
  34166. y && !R && I.unshift(""),
  34167. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  34168. i.path = null),
  34169. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  34170. i.auth = e.auth || i.auth,
  34171. i.slashes = i.slashes || e.slashes,
  34172. i.href = i.format(),
  34173. i
  34174. }
  34175. ,
  34176. n.prototype.parseHost = function() {
  34177. var e = this.host
  34178. , t = u.exec(e);
  34179. t && (t = t[0],
  34180. ":" !== t && (this.port = t.substr(1)),
  34181. e = e.substr(0, e.length - t.length)),
  34182. e && (this.hostname = e)
  34183. }
  34184. }
  34185. , {
  34186. "./util": 209,
  34187. punycode: 204,
  34188. querystring: 207
  34189. }],
  34190. 209: [function(e, t, i) {
  34191. "use strict";
  34192. t.exports = {
  34193. isString: function(e) {
  34194. return "string" == typeof e
  34195. },
  34196. isObject: function(e) {
  34197. return "object" == typeof e && null !== e
  34198. },
  34199. isNull: function(e) {
  34200. return null === e
  34201. },
  34202. isNullOrUndefined: function(e) {
  34203. return null == e
  34204. }
  34205. }
  34206. }
  34207. , {}],
  34208. 210: [function(e, t, i) {
  34209. "use strict";
  34210. function n(e) {
  34211. return l + e
  34212. }
  34213. function r(e) {
  34214. return e.substring(l.length)
  34215. }
  34216. function o(e, t) {
  34217. for (var i in t)
  34218. Object.defineProperty(e, i, {
  34219. value: t[i],
  34220. configurable: !0,
  34221. writable: !0
  34222. })
  34223. }
  34224. function a(e) {
  34225. if ("string" != typeof e)
  34226. throw new TypeError("key must be a string.")
  34227. }
  34228. var s = Object.prototype.hasOwnProperty
  34229. , l = "~";
  34230. t.exports = function(e) {
  34231. var t = Object.create(null)
  34232. , i = 0
  34233. , l = {};
  34234. return o(l, {
  34235. get: function(e, i) {
  34236. a(e);
  34237. var r = n(e);
  34238. return r in t ? t[r] : i
  34239. },
  34240. set: function(e, r) {
  34241. a(e);
  34242. var o = n(e);
  34243. return o in t || ++i,
  34244. t[o] = r
  34245. },
  34246. has: function(e) {
  34247. return a(e),
  34248. n(e)in t
  34249. },
  34250. delete: function(e) {
  34251. a(e);
  34252. var r = n(e);
  34253. return r in t && (--i,
  34254. delete t[r],
  34255. !0)
  34256. },
  34257. clear: function() {
  34258. t = Object.create(null),
  34259. i = 0
  34260. },
  34261. forEach: function(e, i) {
  34262. if ("function" != typeof e)
  34263. throw new TypeError("`callback` must be a function");
  34264. for (var n in t)
  34265. if (s.call(t, n)) {
  34266. var o = r(n)
  34267. , a = t[n];
  34268. e.call(i, a, o, l)
  34269. }
  34270. }
  34271. }),
  34272. Object.defineProperty(l, "size", {
  34273. get: function() {
  34274. return i
  34275. },
  34276. configurable: !0
  34277. }),
  34278. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  34279. l.set(t, e[t])
  34280. }),
  34281. l
  34282. }
  34283. }
  34284. , {}],
  34285. 211: [function(e, t, i) {
  34286. t.exports = e("./lib/heap")
  34287. }
  34288. , {
  34289. "./lib/heap": 212
  34290. }],
  34291. 212: [function(e, t, i) {
  34292. (function() {
  34293. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  34294. r = Math.floor,
  34295. u = Math.min,
  34296. n = function(e, t) {
  34297. return e < t ? -1 : e > t ? 1 : 0
  34298. }
  34299. ,
  34300. h = function(e, t, i, o, a) {
  34301. var s;
  34302. if (null == i && (i = 0),
  34303. null == a && (a = n),
  34304. i < 0)
  34305. throw new Error("lo must be non-negative");
  34306. for (null == o && (o = e.length); i < o; )
  34307. s = r((i + o) / 2),
  34308. a(t, e[s]) < 0 ? o = s : i = s + 1;
  34309. return [].splice.apply(e, [i, i - i].concat(t)),
  34310. t
  34311. }
  34312. ,
  34313. s = function(e, t, i) {
  34314. return null == i && (i = n),
  34315. e.push(t),
  34316. g(e, 0, e.length - 1, i)
  34317. }
  34318. ,
  34319. a = function(e, t) {
  34320. var i, r;
  34321. return null == t && (t = n),
  34322. i = e.pop(),
  34323. e.length ? (r = e[0],
  34324. e[0] = i,
  34325. m(e, 0, t)) : r = i,
  34326. r
  34327. }
  34328. ,
  34329. c = function(e, t, i) {
  34330. var r;
  34331. return null == i && (i = n),
  34332. r = e[0],
  34333. e[0] = t,
  34334. m(e, 0, i),
  34335. r
  34336. }
  34337. ,
  34338. l = function(e, t, i) {
  34339. var r;
  34340. return null == i && (i = n),
  34341. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  34342. t = r[0],
  34343. e[0] = r[1],
  34344. m(e, 0, i)),
  34345. t
  34346. }
  34347. ,
  34348. o = function(e, t) {
  34349. var i, o, a, s, l, c;
  34350. for (null == t && (t = n),
  34351. s = function() {
  34352. c = [];
  34353. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  34354. c.push(t);
  34355. return c
  34356. }
  34357. .apply(this).reverse(),
  34358. l = [],
  34359. o = 0,
  34360. a = s.length; o < a; o++)
  34361. i = s[o],
  34362. l.push(m(e, i, t));
  34363. return l
  34364. }
  34365. ,
  34366. f = function(e, t, i) {
  34367. var r;
  34368. if (null == i && (i = n),
  34369. r = e.indexOf(t),
  34370. r !== -1)
  34371. return g(e, 0, r, i),
  34372. m(e, r, i)
  34373. }
  34374. ,
  34375. d = function(e, t, i) {
  34376. var r, a, s, c, h;
  34377. if (null == i && (i = n),
  34378. a = e.slice(0, t),
  34379. !a.length)
  34380. return a;
  34381. for (o(a, i),
  34382. h = e.slice(t),
  34383. s = 0,
  34384. c = h.length; s < c; s++)
  34385. r = h[s],
  34386. l(a, r, i);
  34387. return a.sort(i).reverse()
  34388. }
  34389. ,
  34390. p = function(e, t, i) {
  34391. var r, s, l, c, d, p, f, g, m, v;
  34392. if (null == i && (i = n),
  34393. 10 * t <= e.length) {
  34394. if (c = e.slice(0, t).sort(i),
  34395. !c.length)
  34396. return c;
  34397. for (l = c[c.length - 1],
  34398. g = e.slice(t),
  34399. d = 0,
  34400. f = g.length; d < f; d++)
  34401. r = g[d],
  34402. i(r, l) < 0 && (h(c, r, 0, null, i),
  34403. c.pop(),
  34404. l = c[c.length - 1]);
  34405. return c
  34406. }
  34407. for (o(e, i),
  34408. v = [],
  34409. s = p = 0,
  34410. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  34411. v.push(a(e, i));
  34412. return v
  34413. }
  34414. ,
  34415. g = function(e, t, i, r) {
  34416. var o, a, s;
  34417. for (null == r && (r = n),
  34418. o = e[i]; i > t && (s = i - 1 >> 1,
  34419. a = e[s],
  34420. r(o, a) < 0); )
  34421. e[i] = a,
  34422. i = s;
  34423. return e[i] = o
  34424. }
  34425. ,
  34426. m = function(e, t, i) {
  34427. var r, o, a, s, l;
  34428. for (null == i && (i = n),
  34429. o = e.length,
  34430. l = t,
  34431. a = e[t],
  34432. r = 2 * t + 1; r < o; )
  34433. s = r + 1,
  34434. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  34435. e[t] = e[r],
  34436. t = r,
  34437. r = 2 * t + 1;
  34438. return e[t] = a,
  34439. g(e, l, t, i)
  34440. }
  34441. ,
  34442. e = function() {
  34443. function e(e) {
  34444. this.cmp = null != e ? e : n,
  34445. this.nodes = []
  34446. }
  34447. return e.push = s,
  34448. e.pop = a,
  34449. e.replace = c,
  34450. e.pushpop = l,
  34451. e.heapify = o,
  34452. e.updateItem = f,
  34453. e.nlargest = d,
  34454. e.nsmallest = p,
  34455. e.prototype.push = function(e) {
  34456. return s(this.nodes, e, this.cmp)
  34457. }
  34458. ,
  34459. e.prototype.pop = function() {
  34460. return a(this.nodes, this.cmp)
  34461. }
  34462. ,
  34463. e.prototype.peek = function() {
  34464. return this.nodes[0]
  34465. }
  34466. ,
  34467. e.prototype.contains = function(e) {
  34468. return this.nodes.indexOf(e) !== -1
  34469. }
  34470. ,
  34471. e.prototype.replace = function(e) {
  34472. return c(this.nodes, e, this.cmp)
  34473. }
  34474. ,
  34475. e.prototype.pushpop = function(e) {
  34476. return l(this.nodes, e, this.cmp)
  34477. }
  34478. ,
  34479. e.prototype.heapify = function() {
  34480. return o(this.nodes, this.cmp)
  34481. }
  34482. ,
  34483. e.prototype.updateItem = function(e) {
  34484. return f(this.nodes, e, this.cmp)
  34485. }
  34486. ,
  34487. e.prototype.clear = function() {
  34488. return this.nodes = []
  34489. }
  34490. ,
  34491. e.prototype.empty = function() {
  34492. return 0 === this.nodes.length
  34493. }
  34494. ,
  34495. e.prototype.size = function() {
  34496. return this.nodes.length
  34497. }
  34498. ,
  34499. e.prototype.clone = function() {
  34500. var t;
  34501. return t = new e,
  34502. t.nodes = this.nodes.slice(0),
  34503. t
  34504. }
  34505. ,
  34506. e.prototype.toArray = function() {
  34507. return this.nodes.slice(0)
  34508. }
  34509. ,
  34510. e.prototype.insert = e.prototype.push,
  34511. e.prototype.top = e.prototype.peek,
  34512. e.prototype.front = e.prototype.peek,
  34513. e.prototype.has = e.prototype.contains,
  34514. e.prototype.copy = e.prototype.clone,
  34515. e
  34516. }(),
  34517. function(e, n) {
  34518. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  34519. }(this, function() {
  34520. return e
  34521. })
  34522. }
  34523. ).call(this)
  34524. }
  34525. , {}],
  34526. 213: [function(e, t, i) {
  34527. !function(e) {
  34528. function i() {}
  34529. function n(e, t) {
  34530. return function() {
  34531. e.apply(t, arguments)
  34532. }
  34533. }
  34534. function r(e) {
  34535. if ("object" != typeof this)
  34536. throw new TypeError("Promises must be constructed via new");
  34537. if ("function" != typeof e)
  34538. throw new TypeError("not a function");
  34539. this._state = 0,
  34540. this._handled = !1,
  34541. this._value = void 0,
  34542. this._deferreds = [],
  34543. h(e, this)
  34544. }
  34545. function o(e, t) {
  34546. for (; 3 === e._state; )
  34547. e = e._value;
  34548. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  34549. void r._immediateFn(function() {
  34550. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  34551. if (null === i)
  34552. return void (1 === e._state ? a : s)(t.promise, e._value);
  34553. var n;
  34554. try {
  34555. n = i(e._value)
  34556. } catch (e) {
  34557. return void s(t.promise, e)
  34558. }
  34559. a(t.promise, n)
  34560. }))
  34561. }
  34562. function a(e, t) {
  34563. try {
  34564. if (t === e)
  34565. throw new TypeError("A promise cannot be resolved with itself.");
  34566. if (t && ("object" == typeof t || "function" == typeof t)) {
  34567. var i = t.then;
  34568. if (t instanceof r)
  34569. return e._state = 3,
  34570. e._value = t,
  34571. void l(e);
  34572. if ("function" == typeof i)
  34573. return void h(n(i, t), e)
  34574. }
  34575. e._state = 1,
  34576. e._value = t,
  34577. l(e)
  34578. } catch (t) {
  34579. s(e, t)
  34580. }
  34581. }
  34582. function s(e, t) {
  34583. e._state = 2,
  34584. e._value = t,
  34585. l(e)
  34586. }
  34587. function l(e) {
  34588. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  34589. e._handled || r._unhandledRejectionFn(e._value)
  34590. });
  34591. for (var t = 0, i = e._deferreds.length; t < i; t++)
  34592. o(e, e._deferreds[t]);
  34593. e._deferreds = null
  34594. }
  34595. function c(e, t, i) {
  34596. this.onFulfilled = "function" == typeof e ? e : null,
  34597. this.onRejected = "function" == typeof t ? t : null,
  34598. this.promise = i
  34599. }
  34600. function h(e, t) {
  34601. var i = !1;
  34602. try {
  34603. e(function(e) {
  34604. i || (i = !0,
  34605. a(t, e))
  34606. }, function(e) {
  34607. i || (i = !0,
  34608. s(t, e))
  34609. })
  34610. } catch (e) {
  34611. if (i)
  34612. return;
  34613. i = !0,
  34614. s(t, e)
  34615. }
  34616. }
  34617. var u = setTimeout;
  34618. r.prototype.catch = function(e) {
  34619. return this.then(null, e)
  34620. }
  34621. ,
  34622. r.prototype.then = function(e, t) {
  34623. var n = new this.constructor(i);
  34624. return o(this, new c(e,t,n)),
  34625. n
  34626. }
  34627. ,
  34628. r.all = function(e) {
  34629. var t = Array.prototype.slice.call(e);
  34630. return new r(function(e, i) {
  34631. function n(o, a) {
  34632. try {
  34633. if (a && ("object" == typeof a || "function" == typeof a)) {
  34634. var s = a.then;
  34635. if ("function" == typeof s)
  34636. return void s.call(a, function(e) {
  34637. n(o, e)
  34638. }, i)
  34639. }
  34640. t[o] = a,
  34641. 0 === --r && e(t)
  34642. } catch (e) {
  34643. i(e)
  34644. }
  34645. }
  34646. if (0 === t.length)
  34647. return e([]);
  34648. for (var r = t.length, o = 0; o < t.length; o++)
  34649. n(o, t[o])
  34650. }
  34651. )
  34652. }
  34653. ,
  34654. r.resolve = function(e) {
  34655. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  34656. t(e)
  34657. }
  34658. )
  34659. }
  34660. ,
  34661. r.reject = function(e) {
  34662. return new r(function(t, i) {
  34663. i(e)
  34664. }
  34665. )
  34666. }
  34667. ,
  34668. r.race = function(e) {
  34669. return new r(function(t, i) {
  34670. for (var n = 0, r = e.length; n < r; n++)
  34671. e[n].then(t, i)
  34672. }
  34673. )
  34674. }
  34675. ,
  34676. r._immediateFn = "function" == typeof setImmediate && function(e) {
  34677. setImmediate(e)
  34678. }
  34679. || function(e) {
  34680. u(e, 0)
  34681. }
  34682. ,
  34683. r._unhandledRejectionFn = function(e) {
  34684. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  34685. }
  34686. ,
  34687. r._setImmediateFn = function(e) {
  34688. r._immediateFn = e
  34689. }
  34690. ,
  34691. r._setUnhandledRejectionFn = function(e) {
  34692. r._unhandledRejectionFn = e
  34693. }
  34694. ,
  34695. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  34696. }(this)
  34697. }
  34698. , {}],
  34699. 214: [function(e, t, i) {
  34700. (function(i) {
  34701. !function(i, n) {
  34702. "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)
  34703. }(this, function(t, n) {
  34704. "use strict";
  34705. var r = {};
  34706. return r.ByteBuffer = t,
  34707. r.Long = t.Long || null,
  34708. r.VERSION = "5.0.1",
  34709. r.WIRE_TYPES = {},
  34710. r.WIRE_TYPES.VARINT = 0,
  34711. r.WIRE_TYPES.BITS64 = 1,
  34712. r.WIRE_TYPES.LDELIM = 2,
  34713. r.WIRE_TYPES.STARTGROUP = 3,
  34714. r.WIRE_TYPES.ENDGROUP = 4,
  34715. r.WIRE_TYPES.BITS32 = 5,
  34716. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  34717. r.TYPES = {
  34718. int32: {
  34719. name: "int32",
  34720. wireType: r.WIRE_TYPES.VARINT,
  34721. defaultValue: 0
  34722. },
  34723. uint32: {
  34724. name: "uint32",
  34725. wireType: r.WIRE_TYPES.VARINT,
  34726. defaultValue: 0
  34727. },
  34728. sint32: {
  34729. name: "sint32",
  34730. wireType: r.WIRE_TYPES.VARINT,
  34731. defaultValue: 0
  34732. },
  34733. int64: {
  34734. name: "int64",
  34735. wireType: r.WIRE_TYPES.VARINT,
  34736. defaultValue: r.Long ? r.Long.ZERO : void 0
  34737. },
  34738. uint64: {
  34739. name: "uint64",
  34740. wireType: r.WIRE_TYPES.VARINT,
  34741. defaultValue: r.Long ? r.Long.UZERO : void 0
  34742. },
  34743. sint64: {
  34744. name: "sint64",
  34745. wireType: r.WIRE_TYPES.VARINT,
  34746. defaultValue: r.Long ? r.Long.ZERO : void 0
  34747. },
  34748. bool: {
  34749. name: "bool",
  34750. wireType: r.WIRE_TYPES.VARINT,
  34751. defaultValue: !1
  34752. },
  34753. double: {
  34754. name: "double",
  34755. wireType: r.WIRE_TYPES.BITS64,
  34756. defaultValue: 0
  34757. },
  34758. string: {
  34759. name: "string",
  34760. wireType: r.WIRE_TYPES.LDELIM,
  34761. defaultValue: ""
  34762. },
  34763. bytes: {
  34764. name: "bytes",
  34765. wireType: r.WIRE_TYPES.LDELIM,
  34766. defaultValue: null
  34767. },
  34768. fixed32: {
  34769. name: "fixed32",
  34770. wireType: r.WIRE_TYPES.BITS32,
  34771. defaultValue: 0
  34772. },
  34773. sfixed32: {
  34774. name: "sfixed32",
  34775. wireType: r.WIRE_TYPES.BITS32,
  34776. defaultValue: 0
  34777. },
  34778. fixed64: {
  34779. name: "fixed64",
  34780. wireType: r.WIRE_TYPES.BITS64,
  34781. defaultValue: r.Long ? r.Long.UZERO : void 0
  34782. },
  34783. sfixed64: {
  34784. name: "sfixed64",
  34785. wireType: r.WIRE_TYPES.BITS64,
  34786. defaultValue: r.Long ? r.Long.ZERO : void 0
  34787. },
  34788. float: {
  34789. name: "float",
  34790. wireType: r.WIRE_TYPES.BITS32,
  34791. defaultValue: 0
  34792. },
  34793. enum: {
  34794. name: "enum",
  34795. wireType: r.WIRE_TYPES.VARINT,
  34796. defaultValue: 0
  34797. },
  34798. message: {
  34799. name: "message",
  34800. wireType: r.WIRE_TYPES.LDELIM,
  34801. defaultValue: null
  34802. },
  34803. group: {
  34804. name: "group",
  34805. wireType: r.WIRE_TYPES.STARTGROUP,
  34806. defaultValue: null
  34807. }
  34808. },
  34809. 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],
  34810. r.ID_MIN = 1,
  34811. r.ID_MAX = 536870911,
  34812. r.convertFieldsToCamelCase = !1,
  34813. r.populateAccessors = !0,
  34814. r.populateDefaults = !0,
  34815. r.Util = function() {
  34816. var t = {};
  34817. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  34818. t.XHR = function() {
  34819. for (var e = [function() {
  34820. return new XMLHttpRequest
  34821. }
  34822. , function() {
  34823. return new ActiveXObject("Msxml2.XMLHTTP")
  34824. }
  34825. , function() {
  34826. return new ActiveXObject("Msxml3.XMLHTTP")
  34827. }
  34828. , function() {
  34829. return new ActiveXObject("Microsoft.XMLHTTP")
  34830. }
  34831. ], t = null, i = 0; i < e.length; i++) {
  34832. try {
  34833. t = e[i]()
  34834. } catch (e) {
  34835. continue
  34836. }
  34837. break
  34838. }
  34839. if (!t)
  34840. throw Error("XMLHttpRequest is not supported");
  34841. return t
  34842. }
  34843. ,
  34844. t.fetch = function(i, n) {
  34845. if (n && "function" != typeof n && (n = null),
  34846. t.IS_NODE) {
  34847. var r = e("fs");
  34848. if (n)
  34849. r.readFile(i, function(e, t) {
  34850. n(e ? null : "" + t)
  34851. });
  34852. else
  34853. try {
  34854. return r.readFileSync(i)
  34855. } catch (e) {
  34856. return null
  34857. }
  34858. } else {
  34859. var o = t.XHR();
  34860. if (o.open("GET", i, !!n),
  34861. o.setRequestHeader("Accept", "text/plain"),
  34862. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  34863. !n)
  34864. return o.send(null),
  34865. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  34866. if (o.onreadystatechange = function() {
  34867. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  34868. }
  34869. ,
  34870. 4 == o.readyState)
  34871. return;
  34872. o.send(null)
  34873. }
  34874. }
  34875. ,
  34876. t.toCamelCase = function(e) {
  34877. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  34878. return t.toUpperCase()
  34879. })
  34880. }
  34881. ,
  34882. t
  34883. }(),
  34884. r.Lang = {
  34885. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  34886. RULE: /^(?:required|optional|repeated|map)$/,
  34887. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  34888. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  34889. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  34890. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  34891. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  34892. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  34893. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  34894. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  34895. NUMBER_OCT: /^0[0-7]+$/,
  34896. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  34897. BOOL: /^(?:true|false)$/i,
  34898. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34899. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  34900. WHITESPACE: /\s/,
  34901. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  34902. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  34903. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  34904. },
  34905. r.DotProto = function(e, t) {
  34906. function i(e, i) {
  34907. var n = -1
  34908. , r = 1;
  34909. if ("-" == e.charAt(0) && (r = -1,
  34910. e = e.substring(1)),
  34911. t.NUMBER_DEC.test(e))
  34912. n = parseInt(e);
  34913. else if (t.NUMBER_HEX.test(e))
  34914. n = parseInt(e.substring(2), 16);
  34915. else {
  34916. if (!t.NUMBER_OCT.test(e))
  34917. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34918. n = parseInt(e.substring(1), 8)
  34919. }
  34920. if (n = r * n | 0,
  34921. !i && n < 0)
  34922. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  34923. return n
  34924. }
  34925. function n(e) {
  34926. var i = 1;
  34927. if ("-" == e.charAt(0) && (i = -1,
  34928. e = e.substring(1)),
  34929. t.NUMBER_DEC.test(e))
  34930. return i * parseInt(e, 10);
  34931. if (t.NUMBER_HEX.test(e))
  34932. return i * parseInt(e.substring(2), 16);
  34933. if (t.NUMBER_OCT.test(e))
  34934. return i * parseInt(e.substring(1), 8);
  34935. if ("inf" === e)
  34936. return i * (1 / 0);
  34937. if ("nan" === e)
  34938. return NaN;
  34939. if (t.NUMBER_FLT.test(e))
  34940. return i * parseFloat(e);
  34941. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  34942. }
  34943. function r(e, t, i) {
  34944. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  34945. e[t].push(i))
  34946. }
  34947. var o = {}
  34948. , a = function(e) {
  34949. this.source = e + "",
  34950. this.index = 0,
  34951. this.line = 1,
  34952. this.stack = [],
  34953. this._stringOpen = null
  34954. }
  34955. , s = a.prototype;
  34956. s._readString = function() {
  34957. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  34958. e.lastIndex = this.index - 1;
  34959. var i = e.exec(this.source);
  34960. if (!i)
  34961. throw Error("unterminated string");
  34962. return this.index = e.lastIndex,
  34963. this.stack.push(this._stringOpen),
  34964. this._stringOpen = null,
  34965. i[1]
  34966. }
  34967. ,
  34968. s.next = function() {
  34969. if (this.stack.length > 0)
  34970. return this.stack.shift();
  34971. if (this.index >= this.source.length)
  34972. return null;
  34973. if (null !== this._stringOpen)
  34974. return this._readString();
  34975. var e, i, n;
  34976. do {
  34977. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  34978. if ("\n" === n && ++this.line,
  34979. ++this.index === this.source.length)
  34980. return null;
  34981. if ("/" === this.source.charAt(this.index))
  34982. if (++this.index,
  34983. "/" === this.source.charAt(this.index)) {
  34984. for (; "\n" !== this.source.charAt(++this.index); )
  34985. if (this.index == this.source.length)
  34986. return null;
  34987. ++this.index,
  34988. ++this.line,
  34989. e = !0
  34990. } else {
  34991. if ("*" !== (n = this.source.charAt(this.index)))
  34992. return "/";
  34993. do {
  34994. if ("\n" === n && ++this.line,
  34995. ++this.index === this.source.length)
  34996. return null;
  34997. i = n,
  34998. n = this.source.charAt(this.index)
  34999. } while ("*" !== i || "/" !== n);++this.index,
  35000. e = !0
  35001. }
  35002. } while (e);if (this.index === this.source.length)
  35003. return null;
  35004. var r = this.index;
  35005. t.DELIM.lastIndex = 0;
  35006. var o = t.DELIM.test(this.source.charAt(r++));
  35007. if (!o)
  35008. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  35009. ++r;
  35010. var a = this.source.substring(this.index, this.index = r);
  35011. return '"' !== a && "'" !== a || (this._stringOpen = a),
  35012. a
  35013. }
  35014. ,
  35015. s.peek = function() {
  35016. if (0 === this.stack.length) {
  35017. var e = this.next();
  35018. if (null === e)
  35019. return null;
  35020. this.stack.push(e)
  35021. }
  35022. return this.stack[0]
  35023. }
  35024. ,
  35025. s.skip = function(e) {
  35026. var t = this.next();
  35027. if (t !== e)
  35028. throw Error("illegal '" + t + "', '" + e + "' expected")
  35029. }
  35030. ,
  35031. s.omit = function(e) {
  35032. return this.peek() === e && (this.next(),
  35033. !0)
  35034. }
  35035. ,
  35036. s.toString = function() {
  35037. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  35038. }
  35039. ,
  35040. o.Tokenizer = a;
  35041. var l = function(e) {
  35042. this.tn = new a(e),
  35043. this.proto3 = !1
  35044. }
  35045. , c = l.prototype;
  35046. return c.parse = function() {
  35047. var e, i, n = {
  35048. name: "[ROOT]",
  35049. package: null,
  35050. messages: [],
  35051. enums: [],
  35052. imports: [],
  35053. options: {},
  35054. services: []
  35055. }, r = !0;
  35056. try {
  35057. for (; e = this.tn.next(); )
  35058. switch (e) {
  35059. case "package":
  35060. if (!r || null !== n.package)
  35061. throw Error("unexpected 'package'");
  35062. if (e = this.tn.next(),
  35063. !t.TYPEREF.test(e))
  35064. throw Error("illegal package name: " + e);
  35065. this.tn.skip(";"),
  35066. n.package = e;
  35067. break;
  35068. case "import":
  35069. if (!r)
  35070. throw Error("unexpected 'import'");
  35071. e = this.tn.peek(),
  35072. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  35073. e = this._readString(),
  35074. this.tn.skip(";"),
  35075. i || n.imports.push(e);
  35076. break;
  35077. case "syntax":
  35078. if (!r)
  35079. throw Error("unexpected 'syntax'");
  35080. this.tn.skip("="),
  35081. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  35082. this.tn.skip(";");
  35083. break;
  35084. case "message":
  35085. this._parseMessage(n, null),
  35086. r = !1;
  35087. break;
  35088. case "enum":
  35089. this._parseEnum(n),
  35090. r = !1;
  35091. break;
  35092. case "option":
  35093. this._parseOption(n);
  35094. break;
  35095. case "service":
  35096. this._parseService(n);
  35097. break;
  35098. case "extend":
  35099. this._parseExtend(n);
  35100. break;
  35101. default:
  35102. throw Error("unexpected '" + e + "'")
  35103. }
  35104. } catch (e) {
  35105. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  35106. e
  35107. }
  35108. return delete n.name,
  35109. n
  35110. }
  35111. ,
  35112. l.parse = function(e) {
  35113. return new l(e).parse()
  35114. }
  35115. ,
  35116. c._readString = function() {
  35117. var e, t, i = "";
  35118. do {
  35119. if (t = this.tn.next(),
  35120. "'" !== t && '"' !== t)
  35121. throw Error("illegal string delimiter: " + t);
  35122. i += this.tn.next(),
  35123. this.tn.skip(t),
  35124. e = this.tn.peek()
  35125. } while ('"' === e || '"' === e);return i
  35126. }
  35127. ,
  35128. c._readValue = function(e) {
  35129. var i = this.tn.peek();
  35130. if ('"' === i || "'" === i)
  35131. return this._readString();
  35132. if (this.tn.next(),
  35133. t.NUMBER.test(i))
  35134. return n(i);
  35135. if (t.BOOL.test(i))
  35136. return "true" === i.toLowerCase();
  35137. if (e && t.TYPEREF.test(i))
  35138. return i;
  35139. throw Error("illegal value: " + i)
  35140. }
  35141. ,
  35142. c._parseOption = function(e, i) {
  35143. var n = this.tn.next()
  35144. , r = !1;
  35145. if ("(" === n && (r = !0,
  35146. n = this.tn.next()),
  35147. !t.TYPEREF.test(n))
  35148. throw Error("illegal option name: " + n);
  35149. var o = n;
  35150. r && (this.tn.skip(")"),
  35151. o = "(" + o + ")",
  35152. n = this.tn.peek(),
  35153. t.FQTYPEREF.test(n) && (o += n,
  35154. this.tn.next())),
  35155. this.tn.skip("="),
  35156. this._parseOptionValue(e, o),
  35157. i || this.tn.skip(";")
  35158. }
  35159. ,
  35160. c._parseOptionValue = function(e, i) {
  35161. var n = this.tn.peek();
  35162. if ("{" !== n)
  35163. r(e.options, i, this._readValue(!0));
  35164. else
  35165. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  35166. if (!t.NAME.test(n))
  35167. throw Error("illegal option name: " + i + "." + n);
  35168. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  35169. }
  35170. }
  35171. ,
  35172. c._parseService = function(e) {
  35173. var i = this.tn.next();
  35174. if (!t.NAME.test(i))
  35175. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  35176. var n = i
  35177. , r = {
  35178. name: n,
  35179. rpc: {},
  35180. options: {}
  35181. };
  35182. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35183. if ("option" === i)
  35184. this._parseOption(r);
  35185. else {
  35186. if ("rpc" !== i)
  35187. throw Error("illegal service token: " + i);
  35188. this._parseServiceRPC(r)
  35189. }
  35190. this.tn.omit(";"),
  35191. e.services.push(r)
  35192. }
  35193. ,
  35194. c._parseServiceRPC = function(e) {
  35195. var i = "rpc"
  35196. , n = this.tn.next();
  35197. if (!t.NAME.test(n))
  35198. throw Error("illegal rpc service method name: " + n);
  35199. var r = n
  35200. , o = {
  35201. request: null,
  35202. response: null,
  35203. request_stream: !1,
  35204. response_stream: !1,
  35205. options: {}
  35206. };
  35207. if (this.tn.skip("("),
  35208. n = this.tn.next(),
  35209. "stream" === n.toLowerCase() && (o.request_stream = !0,
  35210. n = this.tn.next()),
  35211. !t.TYPEREF.test(n))
  35212. throw Error("illegal rpc service request type: " + n);
  35213. if (o.request = n,
  35214. this.tn.skip(")"),
  35215. n = this.tn.next(),
  35216. "returns" !== n.toLowerCase())
  35217. throw Error("illegal rpc service request type delimiter: " + n);
  35218. if (this.tn.skip("("),
  35219. n = this.tn.next(),
  35220. "stream" === n.toLowerCase() && (o.response_stream = !0,
  35221. n = this.tn.next()),
  35222. o.response = n,
  35223. this.tn.skip(")"),
  35224. n = this.tn.peek(),
  35225. "{" === n) {
  35226. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  35227. if ("option" !== n)
  35228. throw Error("illegal rpc service token: " + n);
  35229. this._parseOption(o)
  35230. }
  35231. this.tn.omit(";")
  35232. } else
  35233. this.tn.skip(";");
  35234. "undefined" == typeof e[i] && (e[i] = {}),
  35235. e[i][r] = o
  35236. }
  35237. ,
  35238. c._parseMessage = function(e, n) {
  35239. var r = !!n
  35240. , o = this.tn.next()
  35241. , a = {
  35242. name: "",
  35243. fields: [],
  35244. enums: [],
  35245. messages: [],
  35246. options: {},
  35247. services: [],
  35248. oneofs: {}
  35249. };
  35250. if (!t.NAME.test(o))
  35251. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  35252. for (a.name = o,
  35253. r && (this.tn.skip("="),
  35254. n.id = i(this.tn.next()),
  35255. a.isGroup = !0),
  35256. o = this.tn.peek(),
  35257. "[" === o && n && this._parseFieldOptions(n),
  35258. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  35259. if (t.RULE.test(o))
  35260. this._parseMessageField(a, o);
  35261. else if ("oneof" === o)
  35262. this._parseMessageOneOf(a);
  35263. else if ("enum" === o)
  35264. this._parseEnum(a);
  35265. else if ("message" === o)
  35266. this._parseMessage(a);
  35267. else if ("option" === o)
  35268. this._parseOption(a);
  35269. else if ("service" === o)
  35270. this._parseService(a);
  35271. else if ("extensions" === o)
  35272. a.extensions = this._parseExtensionRanges();
  35273. else if ("reserved" === o)
  35274. this._parseIgnored();
  35275. else if ("extend" === o)
  35276. this._parseExtend(a);
  35277. else {
  35278. if (!t.TYPEREF.test(o))
  35279. throw Error("illegal message token: " + o);
  35280. if (!this.proto3)
  35281. throw Error("illegal field rule: " + o);
  35282. this._parseMessageField(a, "optional", o)
  35283. }
  35284. return this.tn.omit(";"),
  35285. e.messages.push(a),
  35286. a
  35287. }
  35288. ,
  35289. c._parseIgnored = function() {
  35290. for (; ";" !== this.tn.peek(); )
  35291. this.tn.next();
  35292. this.tn.skip(";")
  35293. }
  35294. ,
  35295. c._parseMessageField = function(e, n, r) {
  35296. if (!t.RULE.test(n))
  35297. throw Error("illegal message field rule: " + n);
  35298. var o, a = {
  35299. rule: n,
  35300. type: "",
  35301. name: "",
  35302. options: {},
  35303. id: 0
  35304. };
  35305. if ("map" === n) {
  35306. if (r)
  35307. throw Error("illegal type: " + r);
  35308. if (this.tn.skip("<"),
  35309. o = this.tn.next(),
  35310. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35311. throw Error("illegal message field type: " + o);
  35312. if (a.keytype = o,
  35313. this.tn.skip(","),
  35314. o = this.tn.next(),
  35315. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  35316. throw Error("illegal message field: " + o);
  35317. if (a.type = o,
  35318. this.tn.skip(">"),
  35319. o = this.tn.next(),
  35320. !t.NAME.test(o))
  35321. throw Error("illegal message field name: " + o);
  35322. a.name = o,
  35323. this.tn.skip("="),
  35324. a.id = i(this.tn.next()),
  35325. o = this.tn.peek(),
  35326. "[" === o && this._parseFieldOptions(a),
  35327. this.tn.skip(";")
  35328. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  35329. "group" === r) {
  35330. var s = this._parseMessage(e, a);
  35331. if (!/^[A-Z]/.test(s.name))
  35332. throw Error("illegal group name: " + s.name);
  35333. a.type = s.name,
  35334. a.name = s.name.toLowerCase(),
  35335. this.tn.omit(";")
  35336. } else {
  35337. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  35338. throw Error("illegal message field type: " + r);
  35339. if (a.type = r,
  35340. o = this.tn.next(),
  35341. !t.NAME.test(o))
  35342. throw Error("illegal message field name: " + o);
  35343. a.name = o,
  35344. this.tn.skip("="),
  35345. a.id = i(this.tn.next()),
  35346. o = this.tn.peek(),
  35347. "[" === o && this._parseFieldOptions(a),
  35348. this.tn.skip(";")
  35349. }
  35350. return e.fields.push(a),
  35351. a
  35352. }
  35353. ,
  35354. c._parseMessageOneOf = function(e) {
  35355. var i = this.tn.next();
  35356. if (!t.NAME.test(i))
  35357. throw Error("illegal oneof name: " + i);
  35358. var n, r = i, o = [];
  35359. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35360. n = this._parseMessageField(e, "optional", i),
  35361. n.oneof = r,
  35362. o.push(n.id);
  35363. this.tn.omit(";"),
  35364. e.oneofs[r] = o
  35365. }
  35366. ,
  35367. c._parseFieldOptions = function(e) {
  35368. this.tn.skip("[");
  35369. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  35370. i || this.tn.skip(","),
  35371. this._parseOption(e, !0),
  35372. i = !1;
  35373. this.tn.next()
  35374. }
  35375. ,
  35376. c._parseEnum = function(e) {
  35377. var n = {
  35378. name: "",
  35379. values: [],
  35380. options: {}
  35381. }
  35382. , r = this.tn.next();
  35383. if (!t.NAME.test(r))
  35384. throw Error("illegal name: " + r);
  35385. for (n.name = r,
  35386. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  35387. if ("option" === r)
  35388. this._parseOption(n);
  35389. else {
  35390. if (!t.NAME.test(r))
  35391. throw Error("illegal name: " + r);
  35392. this.tn.skip("=");
  35393. var o = {
  35394. name: r,
  35395. id: i(this.tn.next(), !0)
  35396. };
  35397. r = this.tn.peek(),
  35398. "[" === r && this._parseFieldOptions({
  35399. options: {}
  35400. }),
  35401. this.tn.skip(";"),
  35402. n.values.push(o)
  35403. }
  35404. this.tn.omit(";"),
  35405. e.enums.push(n)
  35406. }
  35407. ,
  35408. c._parseExtensionRanges = function() {
  35409. var t, i, r, o = [];
  35410. do {
  35411. for (i = []; ; ) {
  35412. switch (t = this.tn.next()) {
  35413. case "min":
  35414. r = e.ID_MIN;
  35415. break;
  35416. case "max":
  35417. r = e.ID_MAX;
  35418. break;
  35419. default:
  35420. r = n(t)
  35421. }
  35422. if (i.push(r),
  35423. 2 === i.length)
  35424. break;
  35425. if ("to" !== this.tn.peek()) {
  35426. i.push(r);
  35427. break
  35428. }
  35429. this.tn.next()
  35430. }
  35431. o.push(i)
  35432. } while (this.tn.omit(","));return this.tn.skip(";"),
  35433. o
  35434. }
  35435. ,
  35436. c._parseExtend = function(e) {
  35437. var i = this.tn.next();
  35438. if (!t.TYPEREF.test(i))
  35439. throw Error("illegal extend reference: " + i);
  35440. var n = {
  35441. ref: i,
  35442. fields: []
  35443. };
  35444. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  35445. if (t.RULE.test(i))
  35446. this._parseMessageField(n, i);
  35447. else {
  35448. if (!t.TYPEREF.test(i))
  35449. throw Error("illegal extend token: " + i);
  35450. if (!this.proto3)
  35451. throw Error("illegal field rule: " + i);
  35452. this._parseMessageField(n, "optional", i)
  35453. }
  35454. return this.tn.omit(";"),
  35455. e.messages.push(n),
  35456. n
  35457. }
  35458. ,
  35459. c.toString = function() {
  35460. return "Parser at line " + this.tn.line
  35461. }
  35462. ,
  35463. o.Parser = l,
  35464. o
  35465. }(r, r.Lang),
  35466. r.Reflect = function(e) {
  35467. function i(i) {
  35468. if ("string" == typeof i && (i = e.TYPES[i]),
  35469. "undefined" == typeof i.defaultValue)
  35470. throw Error("default value for type " + i.name + " is not supported");
  35471. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  35472. }
  35473. function n(t, i) {
  35474. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  35475. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  35476. if ("string" == typeof t)
  35477. return e.Long.fromString(t, i || !1, 10);
  35478. if ("number" == typeof t)
  35479. return e.Long.fromNumber(t, i || !1);
  35480. throw Error("not convertible to Long")
  35481. }
  35482. function r(t, i) {
  35483. var n = i.readVarint32()
  35484. , o = 7 & n
  35485. , a = n >>> 3;
  35486. switch (o) {
  35487. case e.WIRE_TYPES.VARINT:
  35488. do
  35489. n = i.readUint8();
  35490. while (128 === (128 & n));break;
  35491. case e.WIRE_TYPES.BITS64:
  35492. i.offset += 8;
  35493. break;
  35494. case e.WIRE_TYPES.LDELIM:
  35495. n = i.readVarint32(),
  35496. i.offset += n;
  35497. break;
  35498. case e.WIRE_TYPES.STARTGROUP:
  35499. r(a, i);
  35500. break;
  35501. case e.WIRE_TYPES.ENDGROUP:
  35502. if (a === t)
  35503. return !1;
  35504. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  35505. case e.WIRE_TYPES.BITS32:
  35506. i.offset += 4;
  35507. break;
  35508. default:
  35509. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  35510. }
  35511. return !0
  35512. }
  35513. var o = {}
  35514. , a = function(e, t, i) {
  35515. this.builder = e,
  35516. this.parent = t,
  35517. this.name = i,
  35518. this.className
  35519. }
  35520. , s = a.prototype;
  35521. s.fqn = function() {
  35522. for (var e = this.name, t = this; ; ) {
  35523. if (t = t.parent,
  35524. null == t)
  35525. break;
  35526. e = t.name + "." + e
  35527. }
  35528. return e
  35529. }
  35530. ,
  35531. s.toString = function(e) {
  35532. return (e ? this.className + " " : "") + this.fqn()
  35533. }
  35534. ,
  35535. s.build = function() {
  35536. throw Error(this.toString(!0) + " cannot be built directly")
  35537. }
  35538. ,
  35539. o.T = a;
  35540. var l = function(e, t, i, n, r) {
  35541. a.call(this, e, t, i),
  35542. this.className = "Namespace",
  35543. this.children = [],
  35544. this.options = n || {},
  35545. this.syntax = r || "proto2"
  35546. }
  35547. , c = l.prototype = Object.create(a.prototype);
  35548. c.getChildren = function(e) {
  35549. if (e = e || null,
  35550. null == e)
  35551. return this.children.slice();
  35552. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  35553. this.children[i]instanceof e && t.push(this.children[i]);
  35554. return t
  35555. }
  35556. ,
  35557. c.addChild = function(e) {
  35558. var t;
  35559. if (t = this.getChild(e.name))
  35560. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  35561. t.name = t.originalName;
  35562. else {
  35563. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  35564. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  35565. e.name = e.originalName
  35566. }
  35567. this.children.push(e)
  35568. }
  35569. ,
  35570. c.getChild = function(e) {
  35571. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  35572. if (this.children[i][t] === e)
  35573. return this.children[i];
  35574. return null
  35575. }
  35576. ,
  35577. c.resolve = function(e, t) {
  35578. var i = "string" == typeof e ? e.split(".") : e
  35579. , n = this
  35580. , r = 0;
  35581. if ("" === i[r]) {
  35582. for (; null !== n.parent; )
  35583. n = n.parent;
  35584. r++
  35585. }
  35586. var a;
  35587. do {
  35588. do {
  35589. if (!(n instanceof o.Namespace)) {
  35590. n = null;
  35591. break
  35592. }
  35593. if (a = n.getChild(i[r]),
  35594. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  35595. n = null;
  35596. break
  35597. }
  35598. n = a,
  35599. r++
  35600. } while (r < i.length);if (null != n)
  35601. break;
  35602. if (null !== this.parent)
  35603. return this.parent.resolve(e, t)
  35604. } while (null != n);return n
  35605. }
  35606. ,
  35607. c.qn = function(e) {
  35608. var t = []
  35609. , i = e;
  35610. do
  35611. t.unshift(i.name),
  35612. i = i.parent;
  35613. while (null !== i);for (var n = 1; n <= t.length; n++) {
  35614. var r = t.slice(t.length - n);
  35615. if (e === this.resolve(r, e instanceof o.Namespace))
  35616. return r.join(".")
  35617. }
  35618. return e.fqn()
  35619. }
  35620. ,
  35621. c.build = function() {
  35622. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  35623. e = i[n],
  35624. e instanceof l && (t[e.name] = e.build());
  35625. return Object.defineProperty && Object.defineProperty(t, "$options", {
  35626. value: this.buildOpt()
  35627. }),
  35628. t
  35629. }
  35630. ,
  35631. c.buildOpt = function() {
  35632. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  35633. var r = t[i]
  35634. , o = this.options[t[i]];
  35635. e[r] = o
  35636. }
  35637. return e
  35638. }
  35639. ,
  35640. c.getOption = function(e) {
  35641. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  35642. }
  35643. ,
  35644. o.Namespace = l;
  35645. var h = function(t, i, n, r) {
  35646. if (this.type = t,
  35647. this.resolvedType = i,
  35648. this.isMapKey = n,
  35649. this.syntax = r,
  35650. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  35651. throw Error("Invalid map key type: " + t.name)
  35652. }
  35653. , u = h.prototype;
  35654. h.defaultFieldValue = i,
  35655. u.verifyValue = function(i) {
  35656. function r(e, t) {
  35657. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  35658. }
  35659. var o = this;
  35660. switch (this.type) {
  35661. case e.TYPES.int32:
  35662. case e.TYPES.sint32:
  35663. case e.TYPES.sfixed32:
  35664. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35665. i > 4294967295 ? 0 | i : i;
  35666. case e.TYPES.uint32:
  35667. case e.TYPES.fixed32:
  35668. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35669. i < 0 ? i >>> 0 : i;
  35670. case e.TYPES.int64:
  35671. case e.TYPES.sint64:
  35672. case e.TYPES.sfixed64:
  35673. if (e.Long)
  35674. try {
  35675. return n(i, !1)
  35676. } catch (e) {
  35677. r(typeof i, e.message)
  35678. }
  35679. else
  35680. r(typeof i, "requires Long.js");
  35681. case e.TYPES.uint64:
  35682. case e.TYPES.fixed64:
  35683. if (e.Long)
  35684. try {
  35685. return n(i, !0)
  35686. } catch (e) {
  35687. r(typeof i, e.message)
  35688. }
  35689. else
  35690. r(typeof i, "requires Long.js");
  35691. case e.TYPES.bool:
  35692. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  35693. i;
  35694. case e.TYPES.float:
  35695. case e.TYPES.double:
  35696. return "number" != typeof i && r(typeof i, "not a number"),
  35697. i;
  35698. case e.TYPES.string:
  35699. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  35700. "" + i;
  35701. case e.TYPES.bytes:
  35702. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  35703. case e.TYPES.enum:
  35704. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  35705. for (l = 0; l < a.length; l++) {
  35706. if (a[l].name == i)
  35707. return a[l].id;
  35708. if (a[l].id == i)
  35709. return a[l].id
  35710. }
  35711. if ("proto3" === this.syntax)
  35712. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  35713. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  35714. i;
  35715. r(i, "not a valid enum value");
  35716. case e.TYPES.group:
  35717. case e.TYPES.message:
  35718. if (i && "object" == typeof i || r(typeof i, "object expected"),
  35719. i instanceof this.resolvedType.clazz)
  35720. return i;
  35721. if (i instanceof e.Builder.Message) {
  35722. var s = {};
  35723. for (var l in i)
  35724. i.hasOwnProperty(l) && (s[l] = i[l]);
  35725. i = s
  35726. }
  35727. return new this.resolvedType.clazz(i)
  35728. }
  35729. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  35730. }
  35731. ,
  35732. u.calculateLength = function(i, n) {
  35733. if (null === n)
  35734. return 0;
  35735. var r;
  35736. switch (this.type) {
  35737. case e.TYPES.int32:
  35738. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  35739. case e.TYPES.uint32:
  35740. return t.calculateVarint32(n);
  35741. case e.TYPES.sint32:
  35742. return t.calculateVarint32(t.zigZagEncode32(n));
  35743. case e.TYPES.fixed32:
  35744. case e.TYPES.sfixed32:
  35745. case e.TYPES.float:
  35746. return 4;
  35747. case e.TYPES.int64:
  35748. case e.TYPES.uint64:
  35749. return t.calculateVarint64(n);
  35750. case e.TYPES.sint64:
  35751. return t.calculateVarint64(t.zigZagEncode64(n));
  35752. case e.TYPES.fixed64:
  35753. case e.TYPES.sfixed64:
  35754. return 8;
  35755. case e.TYPES.bool:
  35756. return 1;
  35757. case e.TYPES.enum:
  35758. return t.calculateVarint32(n);
  35759. case e.TYPES.double:
  35760. return 8;
  35761. case e.TYPES.string:
  35762. return r = t.calculateUTF8Bytes(n),
  35763. t.calculateVarint32(r) + r;
  35764. case e.TYPES.bytes:
  35765. if (n.remaining() < 0)
  35766. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35767. return t.calculateVarint32(n.remaining()) + n.remaining();
  35768. case e.TYPES.message:
  35769. return r = this.resolvedType.calculate(n),
  35770. t.calculateVarint32(r) + r;
  35771. case e.TYPES.group:
  35772. return r = this.resolvedType.calculate(n),
  35773. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  35774. }
  35775. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35776. }
  35777. ,
  35778. u.encodeValue = function(i, n, r) {
  35779. if (null === n)
  35780. return r;
  35781. switch (this.type) {
  35782. case e.TYPES.int32:
  35783. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  35784. break;
  35785. case e.TYPES.uint32:
  35786. r.writeVarint32(n);
  35787. break;
  35788. case e.TYPES.sint32:
  35789. r.writeVarint32ZigZag(n);
  35790. break;
  35791. case e.TYPES.fixed32:
  35792. r.writeUint32(n);
  35793. break;
  35794. case e.TYPES.sfixed32:
  35795. r.writeInt32(n);
  35796. break;
  35797. case e.TYPES.int64:
  35798. case e.TYPES.uint64:
  35799. r.writeVarint64(n);
  35800. break;
  35801. case e.TYPES.sint64:
  35802. r.writeVarint64ZigZag(n);
  35803. break;
  35804. case e.TYPES.fixed64:
  35805. r.writeUint64(n);
  35806. break;
  35807. case e.TYPES.sfixed64:
  35808. r.writeInt64(n);
  35809. break;
  35810. case e.TYPES.bool:
  35811. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  35812. break;
  35813. case e.TYPES.enum:
  35814. r.writeVarint32(n);
  35815. break;
  35816. case e.TYPES.float:
  35817. r.writeFloat32(n);
  35818. break;
  35819. case e.TYPES.double:
  35820. r.writeFloat64(n);
  35821. break;
  35822. case e.TYPES.string:
  35823. r.writeVString(n);
  35824. break;
  35825. case e.TYPES.bytes:
  35826. if (n.remaining() < 0)
  35827. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  35828. var o = n.offset;
  35829. r.writeVarint32(n.remaining()),
  35830. r.append(n),
  35831. n.offset = o;
  35832. break;
  35833. case e.TYPES.message:
  35834. var a = (new t).LE();
  35835. this.resolvedType.encode(n, a),
  35836. r.writeVarint32(a.offset),
  35837. r.append(a.flip());
  35838. break;
  35839. case e.TYPES.group:
  35840. this.resolvedType.encode(n, r),
  35841. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  35842. break;
  35843. default:
  35844. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  35845. }
  35846. return r
  35847. }
  35848. ,
  35849. u.decode = function(t, i, n) {
  35850. if (i != this.type.wireType)
  35851. throw Error("Unexpected wire type for element");
  35852. var r, o;
  35853. switch (this.type) {
  35854. case e.TYPES.int32:
  35855. return 0 | t.readVarint32();
  35856. case e.TYPES.uint32:
  35857. return t.readVarint32() >>> 0;
  35858. case e.TYPES.sint32:
  35859. return 0 | t.readVarint32ZigZag();
  35860. case e.TYPES.fixed32:
  35861. return t.readUint32() >>> 0;
  35862. case e.TYPES.sfixed32:
  35863. return 0 | t.readInt32();
  35864. case e.TYPES.int64:
  35865. return t.readVarint64();
  35866. case e.TYPES.uint64:
  35867. return t.readVarint64().toUnsigned();
  35868. case e.TYPES.sint64:
  35869. return t.readVarint64ZigZag();
  35870. case e.TYPES.fixed64:
  35871. return t.readUint64();
  35872. case e.TYPES.sfixed64:
  35873. return t.readInt64();
  35874. case e.TYPES.bool:
  35875. return !!t.readVarint32();
  35876. case e.TYPES.enum:
  35877. return t.readVarint32();
  35878. case e.TYPES.float:
  35879. return t.readFloat();
  35880. case e.TYPES.double:
  35881. return t.readDouble();
  35882. case e.TYPES.string:
  35883. return t.readVString();
  35884. case e.TYPES.bytes:
  35885. if (o = t.readVarint32(),
  35886. t.remaining() < o)
  35887. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  35888. return r = t.clone(),
  35889. r.limit = r.offset + o,
  35890. t.offset += o,
  35891. r;
  35892. case e.TYPES.message:
  35893. return o = t.readVarint32(),
  35894. this.resolvedType.decode(t, o);
  35895. case e.TYPES.group:
  35896. return this.resolvedType.decode(t, -1, n)
  35897. }
  35898. throw Error("[INTERNAL] Illegal decode type")
  35899. }
  35900. ,
  35901. u.valueFromString = function(i) {
  35902. if (!this.isMapKey)
  35903. throw Error("valueFromString() called on non-map-key element");
  35904. switch (this.type) {
  35905. case e.TYPES.int32:
  35906. case e.TYPES.sint32:
  35907. case e.TYPES.sfixed32:
  35908. case e.TYPES.uint32:
  35909. case e.TYPES.fixed32:
  35910. return this.verifyValue(parseInt(i));
  35911. case e.TYPES.int64:
  35912. case e.TYPES.sint64:
  35913. case e.TYPES.sfixed64:
  35914. case e.TYPES.uint64:
  35915. case e.TYPES.fixed64:
  35916. return this.verifyValue(i);
  35917. case e.TYPES.bool:
  35918. return "true" === i;
  35919. case e.TYPES.string:
  35920. return this.verifyValue(i);
  35921. case e.TYPES.bytes:
  35922. return t.fromBinary(i)
  35923. }
  35924. }
  35925. ,
  35926. u.valueToString = function(t) {
  35927. if (!this.isMapKey)
  35928. throw Error("valueToString() called on non-map-key element");
  35929. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  35930. }
  35931. ,
  35932. o.Element = h;
  35933. var d = function(e, t, i, n, r, o) {
  35934. l.call(this, e, t, i, n, o),
  35935. this.className = "Message",
  35936. this.extensions = void 0,
  35937. this.clazz = null,
  35938. this.isGroup = !!r,
  35939. this._fields = null,
  35940. this._fieldsById = null,
  35941. this._fieldsByName = null
  35942. }
  35943. , p = d.prototype = Object.create(l.prototype);
  35944. p.build = function(i) {
  35945. if (this.clazz && !i)
  35946. return this.clazz;
  35947. var n = function(e, i) {
  35948. function n(i, r, o, a) {
  35949. if (null === i || "object" != typeof i) {
  35950. if (a && a instanceof e.Reflect.Enum) {
  35951. var s = e.Reflect.Enum.getName(a.object, i);
  35952. if (null !== s)
  35953. return s
  35954. }
  35955. return i
  35956. }
  35957. if (t.isByteBuffer(i))
  35958. return r ? i.toBase64() : i.toBuffer();
  35959. if (e.Long.isLong(i))
  35960. return o ? i.toString() : e.Long.fromValue(i);
  35961. var l;
  35962. if (Array.isArray(i))
  35963. return l = [],
  35964. i.forEach(function(e, t) {
  35965. l[t] = n(e, r, o, a)
  35966. }),
  35967. l;
  35968. if (l = {},
  35969. i instanceof e.Map) {
  35970. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  35971. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  35972. return l
  35973. }
  35974. var u = i.$type
  35975. , d = void 0;
  35976. for (var p in i)
  35977. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  35978. return l
  35979. }
  35980. var r = i.getChildren(e.Reflect.Message.Field)
  35981. , o = i.getChildren(e.Reflect.Message.OneOf)
  35982. , a = function(n, s) {
  35983. e.Builder.Message.call(this);
  35984. for (var l = 0, c = o.length; l < c; ++l)
  35985. this[o[l].name] = null;
  35986. for (l = 0,
  35987. c = r.length; l < c; ++l) {
  35988. var h = r[l];
  35989. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  35990. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  35991. }
  35992. if (arguments.length > 0) {
  35993. var u;
  35994. 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)
  35995. for (l = 0,
  35996. c = arguments.length; l < c; ++l)
  35997. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  35998. else
  35999. this.$set(n)
  36000. }
  36001. }
  36002. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  36003. s.add = function(t, n, r) {
  36004. var o = i._fieldsByName[t];
  36005. if (!r) {
  36006. if (!o)
  36007. throw Error(this + "#" + t + " is undefined");
  36008. if (!(o instanceof e.Reflect.Message.Field))
  36009. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  36010. if (!o.repeated)
  36011. throw Error(this + "#" + t + " is not a repeated field");
  36012. n = o.verifyValue(n, !0)
  36013. }
  36014. return null === this[t] && (this[t] = []),
  36015. this[t].push(n),
  36016. this
  36017. }
  36018. ,
  36019. s.$add = s.add,
  36020. s.set = function(t, n, r) {
  36021. if (t && "object" == typeof t) {
  36022. r = n;
  36023. for (var o in t)
  36024. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  36025. return this
  36026. }
  36027. var a = i._fieldsByName[t];
  36028. if (r)
  36029. this[t] = n;
  36030. else {
  36031. if (!a)
  36032. throw Error(this + "#" + t + " is not a field: undefined");
  36033. if (!(a instanceof e.Reflect.Message.Field))
  36034. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  36035. this[a.name] = n = a.verifyValue(n)
  36036. }
  36037. if (a && a.oneof) {
  36038. var s = this[a.oneof.name];
  36039. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  36040. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  36041. }
  36042. return this
  36043. }
  36044. ,
  36045. s.$set = s.set,
  36046. s.get = function(t, n) {
  36047. if (n)
  36048. return this[t];
  36049. var r = i._fieldsByName[t];
  36050. if (!(r && r instanceof e.Reflect.Message.Field))
  36051. throw Error(this + "#" + t + " is not a field: undefined");
  36052. if (!(r instanceof e.Reflect.Message.Field))
  36053. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  36054. return this[r.name]
  36055. }
  36056. ,
  36057. s.$get = s.get;
  36058. for (var l = 0; l < r.length; l++) {
  36059. var c = r[l];
  36060. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  36061. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  36062. return e.toUpperCase().replace("_", "")
  36063. });
  36064. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  36065. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  36066. return "_" + e
  36067. })
  36068. , r = function(t, i) {
  36069. return this[e.name] = i ? t : e.verifyValue(t),
  36070. this
  36071. }
  36072. , o = function() {
  36073. return this[e.name]
  36074. };
  36075. null === i.getChild("set" + t) && (s["set" + t] = r),
  36076. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  36077. null === i.getChild("get" + t) && (s["get" + t] = o),
  36078. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  36079. }(c)
  36080. }
  36081. s.encode = function(e, n) {
  36082. "boolean" == typeof e && (n = e,
  36083. e = void 0);
  36084. var r = !1;
  36085. e || (e = new t,
  36086. r = !0);
  36087. var o = e.littleEndian;
  36088. try {
  36089. return i.encode(this, e.LE(), n),
  36090. (r ? e.flip() : e).LE(o)
  36091. } catch (t) {
  36092. throw e.LE(o),
  36093. t
  36094. }
  36095. }
  36096. ,
  36097. a.encode = function(e, t, i) {
  36098. return new a(e).encode(t, i)
  36099. }
  36100. ,
  36101. s.calculate = function() {
  36102. return i.calculate(this)
  36103. }
  36104. ,
  36105. s.encodeDelimited = function(e, n) {
  36106. var r = !1;
  36107. e || (e = new t,
  36108. r = !0);
  36109. var o = (new t).LE();
  36110. return i.encode(this, o, n).flip(),
  36111. e.writeVarint32(o.remaining()),
  36112. e.append(o),
  36113. r ? e.flip() : e
  36114. }
  36115. ,
  36116. s.encodeAB = function() {
  36117. try {
  36118. return this.encode().toArrayBuffer()
  36119. } catch (e) {
  36120. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  36121. e
  36122. }
  36123. }
  36124. ,
  36125. s.toArrayBuffer = s.encodeAB,
  36126. s.encodeNB = function() {
  36127. try {
  36128. return this.encode().toBuffer()
  36129. } catch (e) {
  36130. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  36131. e
  36132. }
  36133. }
  36134. ,
  36135. s.toBuffer = s.encodeNB,
  36136. s.encode64 = function() {
  36137. try {
  36138. return this.encode().toBase64()
  36139. } catch (e) {
  36140. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  36141. e
  36142. }
  36143. }
  36144. ,
  36145. s.toBase64 = s.encode64,
  36146. s.encodeHex = function() {
  36147. try {
  36148. return this.encode().toHex()
  36149. } catch (e) {
  36150. throw e.encoded && (e.encoded = e.encoded.toHex()),
  36151. e
  36152. }
  36153. }
  36154. ,
  36155. s.toHex = s.encodeHex,
  36156. s.toRaw = function(e, t) {
  36157. return n(this, !!e, !!t, this.$type)
  36158. }
  36159. ,
  36160. s.encodeJSON = function() {
  36161. return JSON.stringify(n(this, !0, !0, this.$type))
  36162. }
  36163. ,
  36164. a.decode = function(e, n, r) {
  36165. "string" == typeof n && (r = n,
  36166. n = -1),
  36167. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  36168. e = t.isByteBuffer(e) ? e : t.wrap(e);
  36169. var o = e.littleEndian;
  36170. try {
  36171. var a = i.decode(e.LE());
  36172. return e.LE(o),
  36173. a
  36174. } catch (t) {
  36175. throw e.LE(o),
  36176. t
  36177. }
  36178. }
  36179. ,
  36180. a.decodeDelimited = function(e, n) {
  36181. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  36182. e = t.isByteBuffer(e) ? e : t.wrap(e),
  36183. e.remaining() < 1)
  36184. return null;
  36185. var r = e.offset
  36186. , o = e.readVarint32();
  36187. if (e.remaining() < o)
  36188. return e.offset = r,
  36189. null;
  36190. try {
  36191. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  36192. return e.offset += o,
  36193. a
  36194. } catch (t) {
  36195. throw e.offset += o,
  36196. t
  36197. }
  36198. }
  36199. ,
  36200. a.decode64 = function(e) {
  36201. return a.decode(e, "base64")
  36202. }
  36203. ,
  36204. a.decodeHex = function(e) {
  36205. return a.decode(e, "hex")
  36206. }
  36207. ,
  36208. a.decodeJSON = function(e) {
  36209. return new a(JSON.parse(e))
  36210. }
  36211. ,
  36212. s.toString = function() {
  36213. return i.toString()
  36214. }
  36215. ;
  36216. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  36217. value: i.buildOpt()
  36218. }),
  36219. Object.defineProperty(s, "$options", {
  36220. value: a.$options
  36221. }),
  36222. Object.defineProperty(a, "$type", {
  36223. value: i
  36224. }),
  36225. Object.defineProperty(s, "$type", {
  36226. value: i
  36227. })),
  36228. a
  36229. }(e, this);
  36230. this._fields = [],
  36231. this._fieldsById = {},
  36232. this._fieldsByName = {};
  36233. for (var r, o = 0, a = this.children.length; o < a; o++)
  36234. if (r = this.children[o],
  36235. r instanceof A || r instanceof d || r instanceof E) {
  36236. if (n.hasOwnProperty(r.name))
  36237. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  36238. n[r.name] = r.build()
  36239. } else if (r instanceof d.Field)
  36240. r.build(),
  36241. this._fields.push(r),
  36242. this._fieldsById[r.id] = r,
  36243. this._fieldsByName[r.name] = r;
  36244. else if (!(r instanceof d.OneOf || r instanceof I))
  36245. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  36246. return this.clazz = n
  36247. }
  36248. ,
  36249. p.encode = function(e, t, i) {
  36250. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  36251. n = this._fields[a],
  36252. r = e[n.name],
  36253. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  36254. if (null !== o) {
  36255. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  36256. throw l.encoded = t,
  36257. l
  36258. }
  36259. return t
  36260. }
  36261. ,
  36262. p.calculate = function(e) {
  36263. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  36264. if (t = this._fields[r],
  36265. i = e[t.name],
  36266. t.required && null === i)
  36267. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  36268. n += t.calculate(i, e)
  36269. }
  36270. return n
  36271. }
  36272. ,
  36273. p.decode = function(t, i, n) {
  36274. i = "number" == typeof i ? i : -1;
  36275. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  36276. if (o = t.readVarint32(),
  36277. a = 7 & o,
  36278. s = o >>> 3,
  36279. a === e.WIRE_TYPES.ENDGROUP) {
  36280. if (s !== n)
  36281. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  36282. break
  36283. }
  36284. if (l = this._fieldsById[s]) {
  36285. if (l.repeated && !l.options.packed)
  36286. h[l.name].push(l.decode(a, t));
  36287. else if (l.map) {
  36288. var u = l.decode(a, t);
  36289. h[l.name].set(u[0], u[1])
  36290. } else if (h[l.name] = l.decode(a, t),
  36291. l.oneof) {
  36292. var d = h[l.oneof.name];
  36293. null !== d && d !== l.name && (h[d] = null),
  36294. h[l.oneof.name] = l.name
  36295. }
  36296. } else
  36297. switch (a) {
  36298. case e.WIRE_TYPES.VARINT:
  36299. t.readVarint32();
  36300. break;
  36301. case e.WIRE_TYPES.BITS32:
  36302. t.offset += 4;
  36303. break;
  36304. case e.WIRE_TYPES.BITS64:
  36305. t.offset += 8;
  36306. break;
  36307. case e.WIRE_TYPES.LDELIM:
  36308. var p = t.readVarint32();
  36309. t.offset += p;
  36310. break;
  36311. case e.WIRE_TYPES.STARTGROUP:
  36312. for (; r(s, t); )
  36313. ;
  36314. break;
  36315. default:
  36316. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  36317. }
  36318. }
  36319. for (var f = 0, g = this._fields.length; f < g; ++f)
  36320. if (l = this._fields[f],
  36321. null === h[l.name])
  36322. if ("proto3" === this.syntax)
  36323. h[l.name] = l.defaultValue;
  36324. else {
  36325. if (l.required) {
  36326. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  36327. throw m.decoded = h,
  36328. m
  36329. }
  36330. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  36331. }
  36332. return h
  36333. }
  36334. ,
  36335. o.Message = d;
  36336. var f = function(t, i, n, r, o, s, l, c, h, u) {
  36337. a.call(this, t, i, s),
  36338. this.className = "Message.Field",
  36339. this.required = "required" === n,
  36340. this.repeated = "repeated" === n,
  36341. this.map = "map" === n,
  36342. this.keyType = r || null,
  36343. this.type = o,
  36344. this.resolvedType = null,
  36345. this.id = l,
  36346. this.options = c || {},
  36347. this.defaultValue = null,
  36348. this.oneof = h || null,
  36349. this.syntax = u || "proto2",
  36350. this.originalName = this.name,
  36351. this.element = null,
  36352. this.keyElement = null,
  36353. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  36354. }
  36355. , g = f.prototype = Object.create(a.prototype);
  36356. g.build = function() {
  36357. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  36358. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  36359. "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)
  36360. }
  36361. ,
  36362. g.verifyValue = function(t, i) {
  36363. function n(e, t) {
  36364. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  36365. }
  36366. i = i || !1;
  36367. var r = this;
  36368. if (null === t)
  36369. return this.required && n(typeof t, "required"),
  36370. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  36371. null;
  36372. var o;
  36373. if (this.repeated && !i) {
  36374. Array.isArray(t) || (t = [t]);
  36375. var a = [];
  36376. for (o = 0; o < t.length; o++)
  36377. a.push(this.element.verifyValue(t[o]));
  36378. return a
  36379. }
  36380. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  36381. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  36382. this.element.verifyValue(t))
  36383. }
  36384. ,
  36385. g.hasWirePresence = function(t, i) {
  36386. if ("proto3" !== this.syntax)
  36387. return null !== t;
  36388. if (this.oneof && i[this.oneof.name] === this.name)
  36389. return !0;
  36390. switch (this.type) {
  36391. case e.TYPES.int32:
  36392. case e.TYPES.sint32:
  36393. case e.TYPES.sfixed32:
  36394. case e.TYPES.uint32:
  36395. case e.TYPES.fixed32:
  36396. return 0 !== t;
  36397. case e.TYPES.int64:
  36398. case e.TYPES.sint64:
  36399. case e.TYPES.sfixed64:
  36400. case e.TYPES.uint64:
  36401. case e.TYPES.fixed64:
  36402. return 0 !== t.low || 0 !== t.high;
  36403. case e.TYPES.bool:
  36404. return t;
  36405. case e.TYPES.float:
  36406. case e.TYPES.double:
  36407. return 0 !== t;
  36408. case e.TYPES.string:
  36409. return t.length > 0;
  36410. case e.TYPES.bytes:
  36411. return t.remaining() > 0;
  36412. case e.TYPES.enum:
  36413. return 0 !== t;
  36414. case e.TYPES.message:
  36415. return null !== t;
  36416. default:
  36417. return !0
  36418. }
  36419. }
  36420. ,
  36421. g.encode = function(i, n, r) {
  36422. if (null === this.type || "object" != typeof this.type)
  36423. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36424. if (null === i || this.repeated && 0 == i.length)
  36425. return n;
  36426. try {
  36427. if (this.repeated) {
  36428. var o;
  36429. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36430. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36431. n.ensureCapacity(n.offset += 1);
  36432. var a = n.offset;
  36433. for (o = 0; o < i.length; o++)
  36434. this.element.encodeValue(this.id, i[o], n);
  36435. var s = n.offset - a
  36436. , l = t.calculateVarint32(s);
  36437. if (l > 1) {
  36438. var c = n.slice(a, n.offset);
  36439. a += l - 1,
  36440. n.offset = a,
  36441. n.append(c)
  36442. }
  36443. n.writeVarint32(s, a - l)
  36444. } else
  36445. for (o = 0; o < i.length; o++)
  36446. n.writeVarint32(this.id << 3 | this.type.wireType),
  36447. this.element.encodeValue(this.id, i[o], n)
  36448. } else
  36449. this.map ? i.forEach(function(i, r, o) {
  36450. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36451. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36452. n.writeVarint32(a),
  36453. n.writeVarint32(8 | this.keyType.wireType),
  36454. this.keyElement.encodeValue(1, r, n),
  36455. n.writeVarint32(16 | this.type.wireType),
  36456. this.element.encodeValue(2, i, n)
  36457. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  36458. this.element.encodeValue(this.id, i, n))
  36459. } catch (e) {
  36460. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36461. }
  36462. return n
  36463. }
  36464. ,
  36465. g.calculate = function(i, n) {
  36466. if (i = this.verifyValue(i),
  36467. null === this.type || "object" != typeof this.type)
  36468. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  36469. if (null === i || this.repeated && 0 == i.length)
  36470. return 0;
  36471. var r = 0;
  36472. try {
  36473. if (this.repeated) {
  36474. var o, a;
  36475. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  36476. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36477. a = 0,
  36478. o = 0; o < i.length; o++)
  36479. a += this.element.calculateLength(this.id, i[o]);
  36480. r += t.calculateVarint32(a),
  36481. r += a
  36482. } else
  36483. for (o = 0; o < i.length; o++)
  36484. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36485. r += this.element.calculateLength(this.id, i[o])
  36486. } else
  36487. this.map ? i.forEach(function(i, n, o) {
  36488. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  36489. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  36490. r += t.calculateVarint32(a),
  36491. r += a
  36492. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  36493. r += this.element.calculateLength(this.id, i))
  36494. } catch (e) {
  36495. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  36496. }
  36497. return r
  36498. }
  36499. ,
  36500. g.decode = function(t, i, n) {
  36501. 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;
  36502. if (!a)
  36503. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  36504. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  36505. o = i.readVarint32(),
  36506. o = i.offset + o;
  36507. for (var s = []; i.offset < o; )
  36508. s.push(this.decode(this.type.wireType, i, !0));
  36509. return s
  36510. }
  36511. if (this.map) {
  36512. var l = h.defaultFieldValue(this.keyType);
  36513. if (r = h.defaultFieldValue(this.type),
  36514. o = i.readVarint32(),
  36515. i.remaining() < o)
  36516. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  36517. var c = i.clone();
  36518. for (c.limit = c.offset + o,
  36519. i.offset += o; c.remaining() > 0; ) {
  36520. var u = c.readVarint32();
  36521. t = 7 & u;
  36522. var d = u >>> 3;
  36523. if (1 === d)
  36524. l = this.keyElement.decode(c, t, d);
  36525. else {
  36526. if (2 !== d)
  36527. throw Error("Unexpected tag in map field key/value submessage");
  36528. r = this.element.decode(c, t, d)
  36529. }
  36530. }
  36531. return [l, r]
  36532. }
  36533. return this.element.decode(i, t, this.id)
  36534. }
  36535. ,
  36536. o.Message.Field = f;
  36537. var m = function(e, t, i, n, r, o, a) {
  36538. f.call(this, e, t, i, null, n, r, o, a),
  36539. this.extension
  36540. };
  36541. m.prototype = Object.create(f.prototype),
  36542. o.Message.ExtensionField = m;
  36543. var v = function(e, t, i) {
  36544. a.call(this, e, t, i),
  36545. this.fields = []
  36546. };
  36547. o.Message.OneOf = v;
  36548. var A = function(e, t, i, n, r) {
  36549. l.call(this, e, t, i, n, r),
  36550. this.className = "Enum",
  36551. this.object = null
  36552. };
  36553. A.getName = function(e, t) {
  36554. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  36555. if (e[i = n[r]] === t)
  36556. return i;
  36557. return null
  36558. }
  36559. ;
  36560. var y = A.prototype = Object.create(l.prototype);
  36561. y.build = function(t) {
  36562. if (this.object && !t)
  36563. return this.object;
  36564. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  36565. i[n[r].name] = n[r].id;
  36566. return Object.defineProperty && Object.defineProperty(i, "$options", {
  36567. value: this.buildOpt(),
  36568. enumerable: !1
  36569. }),
  36570. this.object = i
  36571. }
  36572. ,
  36573. o.Enum = A;
  36574. var C = function(e, t, i, n) {
  36575. a.call(this, e, t, i),
  36576. this.className = "Enum.Value",
  36577. this.id = n
  36578. };
  36579. C.prototype = Object.create(a.prototype),
  36580. o.Enum.Value = C;
  36581. var I = function(e, t, i, n) {
  36582. a.call(this, e, t, i),
  36583. this.field = n
  36584. };
  36585. I.prototype = Object.create(a.prototype),
  36586. o.Extension = I;
  36587. var E = function(e, t, i, n) {
  36588. l.call(this, e, t, i, n),
  36589. this.className = "Service",
  36590. this.clazz = null
  36591. }
  36592. , b = E.prototype = Object.create(l.prototype);
  36593. b.build = function(i) {
  36594. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  36595. for (var n = function(t) {
  36596. e.Builder.Service.call(this),
  36597. this.rpcImpl = t || function(e, t, i) {
  36598. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  36599. }
  36600. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  36601. !function(e) {
  36602. r[e.name] = function(n, r) {
  36603. try {
  36604. try {
  36605. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  36606. } catch (e) {
  36607. if (!(e instanceof TypeError))
  36608. throw e
  36609. }
  36610. if (null === n || "object" != typeof n)
  36611. throw Error("Illegal arguments");
  36612. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  36613. this.rpcImpl(e.fqn(), n, function(t, n) {
  36614. if (t)
  36615. return void r(t);
  36616. null === n && (n = "");
  36617. try {
  36618. n = e.resolvedResponseType.clazz.decode(n)
  36619. } catch (e) {}
  36620. 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))
  36621. })
  36622. } catch (e) {
  36623. setTimeout(r.bind(this, e), 0)
  36624. }
  36625. }
  36626. ,
  36627. n[e.name] = function(t, i, r) {
  36628. new n(t)[e.name](i, r)
  36629. }
  36630. ,
  36631. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  36632. value: e.buildOpt()
  36633. }),
  36634. Object.defineProperty(r[e.name], "$options", {
  36635. value: n[e.name].$options
  36636. }))
  36637. }(o[a]);
  36638. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  36639. value: i.buildOpt()
  36640. }),
  36641. Object.defineProperty(r, "$options", {
  36642. value: n.$options
  36643. }),
  36644. Object.defineProperty(n, "$type", {
  36645. value: i
  36646. }),
  36647. Object.defineProperty(r, "$type", {
  36648. value: i
  36649. })),
  36650. n
  36651. }(e, this)
  36652. }
  36653. ,
  36654. o.Service = E;
  36655. var w = function(e, t, i, n) {
  36656. a.call(this, e, t, i),
  36657. this.className = "Service.Method",
  36658. this.options = n || {}
  36659. }
  36660. , _ = w.prototype = Object.create(a.prototype);
  36661. _.buildOpt = c.buildOpt,
  36662. o.Service.Method = w;
  36663. var T = function(e, t, i, n, r, o, a, s) {
  36664. w.call(this, e, t, i, s),
  36665. this.className = "Service.RPCMethod",
  36666. this.requestName = n,
  36667. this.responseName = r,
  36668. this.requestStream = o,
  36669. this.responseStream = a,
  36670. this.resolvedRequestType = null,
  36671. this.resolvedResponseType = null
  36672. };
  36673. return T.prototype = Object.create(w.prototype),
  36674. o.Service.RPCMethod = T,
  36675. o
  36676. }(r),
  36677. r.Builder = function(t, i, n) {
  36678. function r(e) {
  36679. e.messages && e.messages.forEach(function(t) {
  36680. t.syntax = e.syntax,
  36681. r(t)
  36682. }),
  36683. e.enums && e.enums.forEach(function(t) {
  36684. t.syntax = e.syntax
  36685. })
  36686. }
  36687. var o = function(e) {
  36688. this.ns = new n.Namespace(this,null,""),
  36689. this.ptr = this.ns,
  36690. this.resolved = !1,
  36691. this.result = null,
  36692. this.files = {},
  36693. this.importRoot = null,
  36694. this.options = e || {}
  36695. }
  36696. , a = o.prototype;
  36697. return o.isMessage = function(e) {
  36698. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  36699. }
  36700. ,
  36701. o.isMessageField = function(e) {
  36702. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  36703. }
  36704. ,
  36705. o.isEnum = function(e) {
  36706. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  36707. }
  36708. ,
  36709. o.isService = function(e) {
  36710. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  36711. }
  36712. ,
  36713. o.isExtend = function(e) {
  36714. return "string" == typeof e.ref
  36715. }
  36716. ,
  36717. a.reset = function() {
  36718. return this.ptr = this.ns,
  36719. this
  36720. }
  36721. ,
  36722. a.define = function(e) {
  36723. if ("string" != typeof e || !i.TYPEREF.test(e))
  36724. throw Error("illegal namespace: " + e);
  36725. return e.split(".").forEach(function(e) {
  36726. var t = this.ptr.getChild(e);
  36727. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  36728. this.ptr = t
  36729. }, this),
  36730. this
  36731. }
  36732. ,
  36733. a.create = function(e) {
  36734. if (!e)
  36735. return this;
  36736. if (Array.isArray(e)) {
  36737. if (0 === e.length)
  36738. return this;
  36739. e = e.slice()
  36740. } else
  36741. e = [e];
  36742. for (var i = [e]; i.length > 0; ) {
  36743. if (e = i.pop(),
  36744. !Array.isArray(e))
  36745. throw Error("not a valid namespace: " + JSON.stringify(e));
  36746. for (; e.length > 0; ) {
  36747. var r = e.shift();
  36748. if (o.isMessage(r)) {
  36749. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  36750. , s = {};
  36751. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  36752. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  36753. }, this),
  36754. r.fields && r.fields.forEach(function(e) {
  36755. if (null !== a.getChild(0 | e.id))
  36756. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  36757. if (e.options && "object" != typeof e.options)
  36758. throw Error("illegal field options in " + a.name + "#" + e.name);
  36759. var t = null;
  36760. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  36761. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  36762. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  36763. t && t.fields.push(e),
  36764. a.addChild(e)
  36765. }, this);
  36766. var l = [];
  36767. if (r.enums && r.enums.forEach(function(e) {
  36768. l.push(e)
  36769. }),
  36770. r.messages && r.messages.forEach(function(e) {
  36771. l.push(e)
  36772. }),
  36773. r.services && r.services.forEach(function(e) {
  36774. l.push(e)
  36775. }),
  36776. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  36777. this.ptr.addChild(a),
  36778. l.length > 0) {
  36779. i.push(e),
  36780. e = l,
  36781. l = null,
  36782. this.ptr = a,
  36783. a = null;
  36784. continue
  36785. }
  36786. l = null
  36787. } else if (o.isEnum(r))
  36788. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  36789. r.values.forEach(function(e) {
  36790. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  36791. }, this),
  36792. this.ptr.addChild(a);
  36793. else if (o.isService(r))
  36794. a = new n.Service(this,this.ptr,r.name,r.options),
  36795. Object.keys(r.rpc).forEach(function(e) {
  36796. var t = r.rpc[e];
  36797. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  36798. }, this),
  36799. this.ptr.addChild(a);
  36800. else {
  36801. if (!o.isExtend(r))
  36802. throw Error("not a valid definition: " + JSON.stringify(r));
  36803. if (a = this.ptr.resolve(r.ref, !0))
  36804. r.fields.forEach(function(e) {
  36805. if (null !== a.getChild(0 | e.id))
  36806. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  36807. if (a.extensions) {
  36808. var i = !1;
  36809. if (a.extensions.forEach(function(t) {
  36810. e.id >= t[0] && e.id <= t[1] && (i = !0)
  36811. }),
  36812. !i)
  36813. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  36814. }
  36815. var r = e.name;
  36816. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  36817. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  36818. , s = new n.Extension(this,this.ptr,e.name,o);
  36819. o.extension = s,
  36820. this.ptr.addChild(s),
  36821. a.addChild(o)
  36822. }, this);
  36823. else if (!/\.?google\.protobuf\./.test(r.ref))
  36824. throw Error("extended message " + r.ref + " is not defined")
  36825. }
  36826. r = null,
  36827. a = null
  36828. }
  36829. e = null,
  36830. this.ptr = this.ptr.parent
  36831. }
  36832. return this.resolved = !1,
  36833. this.result = null,
  36834. this
  36835. }
  36836. ,
  36837. a.import = function(i, n) {
  36838. var o = "/";
  36839. if ("string" == typeof n) {
  36840. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  36841. this.files[n] === !0)
  36842. return this.reset();
  36843. this.files[n] = !0
  36844. } else if ("object" == typeof n) {
  36845. var a = n.root;
  36846. t.Util.IS_NODE && (a = e("path").resolve(a)),
  36847. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  36848. var s = a + o + n.file;
  36849. if (this.files[s] === !0)
  36850. return this.reset();
  36851. this.files[s] = !0
  36852. }
  36853. if (i.imports && i.imports.length > 0) {
  36854. var l, c = !1;
  36855. "object" == typeof n ? (this.importRoot = n.root,
  36856. c = !0,
  36857. l = this.importRoot,
  36858. n = n.file,
  36859. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  36860. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  36861. o = "\\") : l = "." : l = null;
  36862. for (var h = 0; h < i.imports.length; h++)
  36863. if ("string" == typeof i.imports[h]) {
  36864. if (!l)
  36865. throw Error("cannot determine import root");
  36866. var u = i.imports[h];
  36867. if ("google/protobuf/descriptor.proto" === u)
  36868. continue;
  36869. if (u = l + o + u,
  36870. this.files[u] === !0)
  36871. continue;
  36872. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  36873. var d = t.Util.fetch(u);
  36874. if (null === d)
  36875. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  36876. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  36877. } else
  36878. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  36879. return t + "_import" + h + "." + i
  36880. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  36881. c && (this.importRoot = null)
  36882. }
  36883. i.package && this.define(i.package),
  36884. i.syntax && r(i);
  36885. var p = this.ptr;
  36886. return i.options && Object.keys(i.options).forEach(function(e) {
  36887. p.options[e] = i.options[e]
  36888. }),
  36889. i.messages && (this.create(i.messages),
  36890. this.ptr = p),
  36891. i.enums && (this.create(i.enums),
  36892. this.ptr = p),
  36893. i.services && (this.create(i.services),
  36894. this.ptr = p),
  36895. i.extends && this.create(i.extends),
  36896. this.reset()
  36897. }
  36898. ,
  36899. a.resolveAll = function() {
  36900. var e;
  36901. if (null == this.ptr || "object" == typeof this.ptr.type)
  36902. return this;
  36903. if (this.ptr instanceof n.Namespace)
  36904. this.ptr.children.forEach(function(e) {
  36905. this.ptr = e,
  36906. this.resolveAll()
  36907. }, this);
  36908. else if (this.ptr instanceof n.Message.Field) {
  36909. if (i.TYPE.test(this.ptr.type))
  36910. this.ptr.type = t.TYPES[this.ptr.type];
  36911. else {
  36912. if (!i.TYPEREF.test(this.ptr.type))
  36913. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36914. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  36915. !e)
  36916. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36917. if (this.ptr.resolvedType = e,
  36918. e instanceof n.Enum) {
  36919. if (this.ptr.type = t.TYPES.enum,
  36920. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  36921. throw Error("proto3 message cannot reference proto2 enum")
  36922. } else {
  36923. if (!(e instanceof n.Message))
  36924. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  36925. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  36926. }
  36927. }
  36928. if (this.ptr.map) {
  36929. if (!i.TYPE.test(this.ptr.keyType))
  36930. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  36931. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  36932. }
  36933. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  36934. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  36935. throw Error("illegal service type in " + this.ptr.toString(!0));
  36936. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  36937. !(e && e instanceof t.Reflect.Message))
  36938. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  36939. if (this.ptr.resolvedRequestType = e,
  36940. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  36941. !(e && e instanceof t.Reflect.Message))
  36942. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  36943. this.ptr.resolvedResponseType = e
  36944. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  36945. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  36946. return this.reset()
  36947. }
  36948. ,
  36949. a.build = function(e) {
  36950. if (this.reset(),
  36951. this.resolved || (this.resolveAll(),
  36952. this.resolved = !0,
  36953. this.result = null),
  36954. null === this.result && (this.result = this.ns.build()),
  36955. !e)
  36956. return this.result;
  36957. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  36958. if (!i[t[n]]) {
  36959. i = null;
  36960. break
  36961. }
  36962. i = i[t[n]]
  36963. }
  36964. return i
  36965. }
  36966. ,
  36967. a.lookup = function(e, t) {
  36968. return e ? this.ns.resolve(e, t) : this.ns
  36969. }
  36970. ,
  36971. a.toString = function() {
  36972. return "Builder"
  36973. }
  36974. ,
  36975. o.Message = function() {}
  36976. ,
  36977. o.Enum = function() {}
  36978. ,
  36979. o.Service = function() {}
  36980. ,
  36981. o
  36982. }(r, r.Lang, r.Reflect),
  36983. r.Map = function(e, t) {
  36984. function i(e) {
  36985. var t = 0;
  36986. return {
  36987. next: function() {
  36988. return t < e.length ? {
  36989. done: !1,
  36990. value: e[t++]
  36991. } : {
  36992. done: !0
  36993. }
  36994. }
  36995. }
  36996. }
  36997. var n = function(e, i) {
  36998. if (!e.map)
  36999. throw Error("field is not a map");
  37000. if (this.field = e,
  37001. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  37002. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  37003. this.map = {},
  37004. Object.defineProperty(this, "size", {
  37005. get: function() {
  37006. return Object.keys(this.map).length
  37007. }
  37008. }),
  37009. i)
  37010. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  37011. var o = this.keyElem.valueFromString(n[r])
  37012. , a = this.valueElem.verifyValue(i[n[r]]);
  37013. this.map[this.keyElem.valueToString(o)] = {
  37014. key: o,
  37015. value: a
  37016. }
  37017. }
  37018. }
  37019. , r = n.prototype;
  37020. return r.clear = function() {
  37021. this.map = {}
  37022. }
  37023. ,
  37024. r.delete = function(e) {
  37025. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  37026. , i = t in this.map;
  37027. return delete this.map[t],
  37028. i
  37029. }
  37030. ,
  37031. r.entries = function() {
  37032. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  37033. t.push([(e = this.map[n[r]]).key, e.value]);
  37034. return i(t)
  37035. }
  37036. ,
  37037. r.keys = function() {
  37038. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37039. e.push(this.map[t[n]].key);
  37040. return i(e)
  37041. }
  37042. ,
  37043. r.values = function() {
  37044. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  37045. e.push(this.map[t[n]].value);
  37046. return i(e)
  37047. }
  37048. ,
  37049. r.forEach = function(e, t) {
  37050. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  37051. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  37052. }
  37053. ,
  37054. r.set = function(e, t) {
  37055. var i = this.keyElem.verifyValue(e)
  37056. , n = this.valueElem.verifyValue(t);
  37057. return this.map[this.keyElem.valueToString(i)] = {
  37058. key: i,
  37059. value: n
  37060. },
  37061. this
  37062. }
  37063. ,
  37064. r.get = function(e) {
  37065. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37066. if (t in this.map)
  37067. return this.map[t].value
  37068. }
  37069. ,
  37070. r.has = function(e) {
  37071. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  37072. return t in this.map
  37073. }
  37074. ,
  37075. n
  37076. }(r, r.Reflect),
  37077. r.loadProto = function(e, t, i) {
  37078. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37079. t = void 0),
  37080. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  37081. }
  37082. ,
  37083. r.protoFromString = r.loadProto,
  37084. r.loadProtoFile = function(e, t, i) {
  37085. if (t && "object" == typeof t ? (i = t,
  37086. t = null) : t && "function" == typeof t || (t = null),
  37087. t)
  37088. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37089. if (null === n)
  37090. return void t(Error("Failed to fetch file"));
  37091. try {
  37092. t(null, r.loadProto(n, i, e))
  37093. } catch (e) {
  37094. t(e)
  37095. }
  37096. });
  37097. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37098. return null === n ? null : r.loadProto(n, i, e)
  37099. }
  37100. ,
  37101. r.protoFromFile = r.loadProtoFile,
  37102. r.newBuilder = function(e) {
  37103. return e = e || {},
  37104. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  37105. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  37106. new r.Builder(e)
  37107. }
  37108. ,
  37109. r.loadJson = function(e, t, i) {
  37110. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  37111. t = null),
  37112. t && "object" == typeof t || (t = r.newBuilder()),
  37113. "string" == typeof e && (e = JSON.parse(e)),
  37114. t.import(e, i),
  37115. t.resolveAll(),
  37116. t
  37117. }
  37118. ,
  37119. r.loadJsonFile = function(e, t, i) {
  37120. if (t && "object" == typeof t ? (i = t,
  37121. t = null) : t && "function" == typeof t || (t = null),
  37122. t)
  37123. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  37124. if (null === n)
  37125. return void t(Error("Failed to fetch file"));
  37126. try {
  37127. t(null, r.loadJson(JSON.parse(n), i, e))
  37128. } catch (e) {
  37129. t(e)
  37130. }
  37131. });
  37132. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  37133. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  37134. }
  37135. ,
  37136. r
  37137. })
  37138. }
  37139. ).call(this, e("_process"))
  37140. }
  37141. , {
  37142. _process: 203,
  37143. bytebuffer: 215,
  37144. fs: 197,
  37145. path: 197
  37146. }],
  37147. 215: [function(e, t, i) {
  37148. !function(i, n) {
  37149. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  37150. var t;
  37151. try {
  37152. t = e("long")
  37153. } catch (e) {}
  37154. return n(t)
  37155. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  37156. }(this, function(e) {
  37157. "use strict";
  37158. function t(e) {
  37159. var t = 0;
  37160. return function() {
  37161. return t < e.length ? e.charCodeAt(t++) : null
  37162. }
  37163. }
  37164. function i() {
  37165. var e = []
  37166. , t = [];
  37167. return function() {
  37168. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  37169. e.length = 0),
  37170. void Array.prototype.push.apply(e, arguments))
  37171. }
  37172. }
  37173. function n(e, t, i, n, r) {
  37174. 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];
  37175. for (u += d,
  37176. o = p & (1 << -h) - 1,
  37177. p >>= -h,
  37178. h += s; h > 0; o = 256 * o + e[t + u],
  37179. u += d,
  37180. h -= 8)
  37181. ;
  37182. for (a = o & (1 << -h) - 1,
  37183. o >>= -h,
  37184. h += n; h > 0; a = 256 * a + e[t + u],
  37185. u += d,
  37186. h -= 8)
  37187. ;
  37188. if (0 === o)
  37189. o = 1 - c;
  37190. else {
  37191. if (o === l)
  37192. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  37193. a += Math.pow(2, n),
  37194. o -= c
  37195. }
  37196. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  37197. }
  37198. function r(e, t, i, n, r, o) {
  37199. 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;
  37200. for (t = Math.abs(t),
  37201. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  37202. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  37203. t * (l = Math.pow(2, -a)) < 1 && (a--,
  37204. l *= 2),
  37205. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  37206. t * l >= 2 && (a++,
  37207. l /= 2),
  37208. a + u >= h ? (s = 0,
  37209. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  37210. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  37211. a = 0)); r >= 8; e[i + p] = 255 & s,
  37212. p += f,
  37213. s /= 256,
  37214. r -= 8)
  37215. ;
  37216. for (a = a << r | s,
  37217. c += r; c > 0; e[i + p] = 255 & a,
  37218. p += f,
  37219. a /= 256,
  37220. c -= 8)
  37221. ;
  37222. e[i + p - f] |= 128 * g
  37223. }
  37224. var o = function(e, t, i) {
  37225. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  37226. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  37227. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  37228. !i) {
  37229. if (e |= 0,
  37230. e < 0)
  37231. throw RangeError("Illegal capacity");
  37232. t = !!t,
  37233. i = !!i
  37234. }
  37235. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  37236. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  37237. this.offset = 0,
  37238. this.markedOffset = -1,
  37239. this.limit = e,
  37240. this.littleEndian = t,
  37241. this.noAssert = i
  37242. };
  37243. o.VERSION = "5.0.1",
  37244. o.LITTLE_ENDIAN = !0,
  37245. o.BIG_ENDIAN = !1,
  37246. o.DEFAULT_CAPACITY = 16,
  37247. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  37248. o.DEFAULT_NOASSERT = !1,
  37249. o.Long = e || null;
  37250. var a = o.prototype;
  37251. a.__isByteBuffer__,
  37252. Object.defineProperty(a, "__isByteBuffer__", {
  37253. value: !0,
  37254. enumerable: !1,
  37255. configurable: !1
  37256. });
  37257. var s = new ArrayBuffer(0)
  37258. , l = String.fromCharCode;
  37259. o.accessor = function() {
  37260. return Uint8Array
  37261. }
  37262. ,
  37263. o.allocate = function(e, t, i) {
  37264. return new o(e,t,i)
  37265. }
  37266. ,
  37267. o.concat = function(e, t, i, n) {
  37268. "boolean" != typeof t && "string" == typeof t || (n = i,
  37269. i = t,
  37270. t = void 0);
  37271. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  37272. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  37273. r = e[s].limit - e[s].offset,
  37274. r > 0 && (a += r);
  37275. if (0 === a)
  37276. return new o(0,i,n);
  37277. var c, h = new o(a,i,n);
  37278. for (s = 0; s < l; )
  37279. c = e[s++],
  37280. r = c.limit - c.offset,
  37281. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  37282. h.offset += r);
  37283. return h.limit = h.offset,
  37284. h.offset = 0,
  37285. h
  37286. }
  37287. ,
  37288. o.isByteBuffer = function(e) {
  37289. return (e && e.__isByteBuffer__) === !0
  37290. }
  37291. ,
  37292. o.type = function() {
  37293. return ArrayBuffer
  37294. }
  37295. ,
  37296. o.wrap = function(e, t, i, n) {
  37297. if ("string" != typeof t && (n = i,
  37298. i = t,
  37299. t = void 0),
  37300. "string" == typeof e)
  37301. switch ("undefined" == typeof t && (t = "utf8"),
  37302. t) {
  37303. case "base64":
  37304. return o.fromBase64(e, i);
  37305. case "hex":
  37306. return o.fromHex(e, i);
  37307. case "binary":
  37308. return o.fromBinary(e, i);
  37309. case "utf8":
  37310. return o.fromUTF8(e, i);
  37311. case "debug":
  37312. return o.fromDebug(e, i);
  37313. default:
  37314. throw Error("Unsupported encoding: " + t)
  37315. }
  37316. if (null === e || "object" != typeof e)
  37317. throw TypeError("Illegal buffer");
  37318. var r;
  37319. if (o.isByteBuffer(e))
  37320. return r = a.clone.call(e),
  37321. r.markedOffset = -1,
  37322. r;
  37323. if (e instanceof Uint8Array)
  37324. r = new o(0,i,n),
  37325. e.length > 0 && (r.buffer = e.buffer,
  37326. r.offset = e.byteOffset,
  37327. r.limit = e.byteOffset + e.byteLength,
  37328. r.view = new Uint8Array(e.buffer));
  37329. else if (e instanceof ArrayBuffer)
  37330. r = new o(0,i,n),
  37331. e.byteLength > 0 && (r.buffer = e,
  37332. r.offset = 0,
  37333. r.limit = e.byteLength,
  37334. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  37335. else {
  37336. if ("[object Array]" !== Object.prototype.toString.call(e))
  37337. throw TypeError("Illegal buffer");
  37338. r = new o(e.length,i,n),
  37339. r.limit = e.length;
  37340. for (var s = 0; s < e.length; ++s)
  37341. r.view[s] = e[s]
  37342. }
  37343. return r
  37344. }
  37345. ,
  37346. a.writeBitSet = function(e, t) {
  37347. var i = "undefined" == typeof t;
  37348. if (i && (t = this.offset),
  37349. !this.noAssert) {
  37350. if (!(e instanceof Array))
  37351. throw TypeError("Illegal BitSet: Not an array");
  37352. if ("number" != typeof t || t % 1 !== 0)
  37353. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37354. if (t >>>= 0,
  37355. t < 0 || t + 0 > this.buffer.byteLength)
  37356. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37357. }
  37358. var n, r = t, o = e.length, a = o >> 3, s = 0;
  37359. for (t += this.writeVarint32(o, t); a--; )
  37360. 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,
  37361. this.writeByte(n, t++);
  37362. if (s < o) {
  37363. var l = 0;
  37364. for (n = 0; s < o; )
  37365. n |= (1 & !!e[s++]) << l++;
  37366. this.writeByte(n, t++)
  37367. }
  37368. return i ? (this.offset = t,
  37369. this) : t - r
  37370. }
  37371. ,
  37372. a.readBitSet = function(e) {
  37373. var t = "undefined" == typeof e;
  37374. t && (e = this.offset);
  37375. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  37376. for (e += n.length; o--; )
  37377. i = this.readByte(e++),
  37378. s[a++] = !!(1 & i),
  37379. s[a++] = !!(2 & i),
  37380. s[a++] = !!(4 & i),
  37381. s[a++] = !!(8 & i),
  37382. s[a++] = !!(16 & i),
  37383. s[a++] = !!(32 & i),
  37384. s[a++] = !!(64 & i),
  37385. s[a++] = !!(128 & i);
  37386. if (a < r) {
  37387. var l = 0;
  37388. for (i = this.readByte(e++); a < r; )
  37389. s[a++] = !!(i >> l++ & 1)
  37390. }
  37391. return t && (this.offset = e),
  37392. s
  37393. }
  37394. ,
  37395. a.readBytes = function(e, t) {
  37396. var i = "undefined" == typeof t;
  37397. if (i && (t = this.offset),
  37398. !this.noAssert) {
  37399. if ("number" != typeof t || t % 1 !== 0)
  37400. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37401. if (t >>>= 0,
  37402. t < 0 || t + e > this.buffer.byteLength)
  37403. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  37404. }
  37405. var n = this.slice(t, t + e);
  37406. return i && (this.offset += e),
  37407. n
  37408. }
  37409. ,
  37410. a.writeBytes = a.append,
  37411. a.writeInt8 = function(e, t) {
  37412. var i = "undefined" == typeof t;
  37413. if (i && (t = this.offset),
  37414. !this.noAssert) {
  37415. if ("number" != typeof e || e % 1 !== 0)
  37416. throw TypeError("Illegal value: " + e + " (not an integer)");
  37417. if (e |= 0,
  37418. "number" != typeof t || t % 1 !== 0)
  37419. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37420. if (t >>>= 0,
  37421. t < 0 || t + 0 > this.buffer.byteLength)
  37422. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37423. }
  37424. t += 1;
  37425. var n = this.buffer.byteLength;
  37426. return t > n && this.resize((n *= 2) > t ? n : t),
  37427. t -= 1,
  37428. this.view[t] = e,
  37429. i && (this.offset += 1),
  37430. this
  37431. }
  37432. ,
  37433. a.writeByte = a.writeInt8,
  37434. a.readInt8 = function(e) {
  37435. var t = "undefined" == typeof e;
  37436. if (t && (e = this.offset),
  37437. !this.noAssert) {
  37438. if ("number" != typeof e || e % 1 !== 0)
  37439. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37440. if (e >>>= 0,
  37441. e < 0 || e + 1 > this.buffer.byteLength)
  37442. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37443. }
  37444. var i = this.view[e];
  37445. return 128 === (128 & i) && (i = -(255 - i + 1)),
  37446. t && (this.offset += 1),
  37447. i
  37448. }
  37449. ,
  37450. a.readByte = a.readInt8,
  37451. a.writeUint8 = function(e, t) {
  37452. var i = "undefined" == typeof t;
  37453. if (i && (t = this.offset),
  37454. !this.noAssert) {
  37455. if ("number" != typeof e || e % 1 !== 0)
  37456. throw TypeError("Illegal value: " + e + " (not an integer)");
  37457. if (e >>>= 0,
  37458. "number" != typeof t || t % 1 !== 0)
  37459. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37460. if (t >>>= 0,
  37461. t < 0 || t + 0 > this.buffer.byteLength)
  37462. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37463. }
  37464. t += 1;
  37465. var n = this.buffer.byteLength;
  37466. return t > n && this.resize((n *= 2) > t ? n : t),
  37467. t -= 1,
  37468. this.view[t] = e,
  37469. i && (this.offset += 1),
  37470. this
  37471. }
  37472. ,
  37473. a.writeUInt8 = a.writeUint8,
  37474. a.readUint8 = function(e) {
  37475. var t = "undefined" == typeof e;
  37476. if (t && (e = this.offset),
  37477. !this.noAssert) {
  37478. if ("number" != typeof e || e % 1 !== 0)
  37479. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37480. if (e >>>= 0,
  37481. e < 0 || e + 1 > this.buffer.byteLength)
  37482. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37483. }
  37484. var i = this.view[e];
  37485. return t && (this.offset += 1),
  37486. i
  37487. }
  37488. ,
  37489. a.readUInt8 = a.readUint8,
  37490. a.writeInt16 = function(e, t) {
  37491. var i = "undefined" == typeof t;
  37492. if (i && (t = this.offset),
  37493. !this.noAssert) {
  37494. if ("number" != typeof e || e % 1 !== 0)
  37495. throw TypeError("Illegal value: " + e + " (not an integer)");
  37496. if (e |= 0,
  37497. "number" != typeof t || t % 1 !== 0)
  37498. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37499. if (t >>>= 0,
  37500. t < 0 || t + 0 > this.buffer.byteLength)
  37501. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37502. }
  37503. t += 2;
  37504. var n = this.buffer.byteLength;
  37505. return t > n && this.resize((n *= 2) > t ? n : t),
  37506. t -= 2,
  37507. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37508. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37509. this.view[t + 1] = 255 & e),
  37510. i && (this.offset += 2),
  37511. this
  37512. }
  37513. ,
  37514. a.writeShort = a.writeInt16,
  37515. a.readInt16 = 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 + 2 > this.buffer.byteLength)
  37523. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37524. }
  37525. var i = 0;
  37526. return this.littleEndian ? (i = this.view[e],
  37527. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37528. i |= this.view[e + 1]),
  37529. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  37530. t && (this.offset += 2),
  37531. i
  37532. }
  37533. ,
  37534. a.readShort = a.readInt16,
  37535. a.writeUint16 = function(e, t) {
  37536. var i = "undefined" == typeof t;
  37537. if (i && (t = this.offset),
  37538. !this.noAssert) {
  37539. if ("number" != typeof e || e % 1 !== 0)
  37540. throw TypeError("Illegal value: " + e + " (not an integer)");
  37541. if (e >>>= 0,
  37542. "number" != typeof t || t % 1 !== 0)
  37543. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37544. if (t >>>= 0,
  37545. t < 0 || t + 0 > this.buffer.byteLength)
  37546. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37547. }
  37548. t += 2;
  37549. var n = this.buffer.byteLength;
  37550. return t > n && this.resize((n *= 2) > t ? n : t),
  37551. t -= 2,
  37552. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  37553. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  37554. this.view[t + 1] = 255 & e),
  37555. i && (this.offset += 2),
  37556. this
  37557. }
  37558. ,
  37559. a.writeUInt16 = a.writeUint16,
  37560. a.readUint16 = function(e) {
  37561. var t = "undefined" == typeof e;
  37562. if (t && (e = this.offset),
  37563. !this.noAssert) {
  37564. if ("number" != typeof e || e % 1 !== 0)
  37565. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37566. if (e >>>= 0,
  37567. e < 0 || e + 2 > this.buffer.byteLength)
  37568. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  37569. }
  37570. var i = 0;
  37571. return this.littleEndian ? (i = this.view[e],
  37572. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  37573. i |= this.view[e + 1]),
  37574. t && (this.offset += 2),
  37575. i
  37576. }
  37577. ,
  37578. a.readUInt16 = a.readUint16,
  37579. a.writeInt32 = function(e, t) {
  37580. var i = "undefined" == typeof t;
  37581. if (i && (t = this.offset),
  37582. !this.noAssert) {
  37583. if ("number" != typeof e || e % 1 !== 0)
  37584. throw TypeError("Illegal value: " + e + " (not an integer)");
  37585. if (e |= 0,
  37586. "number" != typeof t || t % 1 !== 0)
  37587. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37588. if (t >>>= 0,
  37589. t < 0 || t + 0 > this.buffer.byteLength)
  37590. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37591. }
  37592. t += 4;
  37593. var n = this.buffer.byteLength;
  37594. return t > n && this.resize((n *= 2) > t ? n : t),
  37595. t -= 4,
  37596. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37597. this.view[t + 2] = e >>> 16 & 255,
  37598. this.view[t + 1] = e >>> 8 & 255,
  37599. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37600. this.view[t + 1] = e >>> 16 & 255,
  37601. this.view[t + 2] = e >>> 8 & 255,
  37602. this.view[t + 3] = 255 & e),
  37603. i && (this.offset += 4),
  37604. this
  37605. }
  37606. ,
  37607. a.writeInt = a.writeInt32,
  37608. a.readInt32 = function(e) {
  37609. var t = "undefined" == typeof e;
  37610. if (t && (e = this.offset),
  37611. !this.noAssert) {
  37612. if ("number" != typeof e || e % 1 !== 0)
  37613. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37614. if (e >>>= 0,
  37615. e < 0 || e + 4 > this.buffer.byteLength)
  37616. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37617. }
  37618. var i = 0;
  37619. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37620. i |= this.view[e + 1] << 8,
  37621. i |= this.view[e],
  37622. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37623. i |= this.view[e + 2] << 8,
  37624. i |= this.view[e + 3],
  37625. i += this.view[e] << 24 >>> 0),
  37626. i |= 0,
  37627. t && (this.offset += 4),
  37628. i
  37629. }
  37630. ,
  37631. a.readInt = a.readInt32,
  37632. a.writeUint32 = function(e, t) {
  37633. var i = "undefined" == typeof t;
  37634. if (i && (t = this.offset),
  37635. !this.noAssert) {
  37636. if ("number" != typeof e || e % 1 !== 0)
  37637. throw TypeError("Illegal value: " + e + " (not an integer)");
  37638. if (e >>>= 0,
  37639. "number" != typeof t || t % 1 !== 0)
  37640. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37641. if (t >>>= 0,
  37642. t < 0 || t + 0 > this.buffer.byteLength)
  37643. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37644. }
  37645. t += 4;
  37646. var n = this.buffer.byteLength;
  37647. return t > n && this.resize((n *= 2) > t ? n : t),
  37648. t -= 4,
  37649. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  37650. this.view[t + 2] = e >>> 16 & 255,
  37651. this.view[t + 1] = e >>> 8 & 255,
  37652. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  37653. this.view[t + 1] = e >>> 16 & 255,
  37654. this.view[t + 2] = e >>> 8 & 255,
  37655. this.view[t + 3] = 255 & e),
  37656. i && (this.offset += 4),
  37657. this
  37658. }
  37659. ,
  37660. a.writeUInt32 = a.writeUint32,
  37661. a.readUint32 = function(e) {
  37662. var t = "undefined" == typeof e;
  37663. if (t && (e = this.offset),
  37664. !this.noAssert) {
  37665. if ("number" != typeof e || e % 1 !== 0)
  37666. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37667. if (e >>>= 0,
  37668. e < 0 || e + 4 > this.buffer.byteLength)
  37669. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37670. }
  37671. var i = 0;
  37672. return this.littleEndian ? (i = this.view[e + 2] << 16,
  37673. i |= this.view[e + 1] << 8,
  37674. i |= this.view[e],
  37675. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  37676. i |= this.view[e + 2] << 8,
  37677. i |= this.view[e + 3],
  37678. i += this.view[e] << 24 >>> 0),
  37679. t && (this.offset += 4),
  37680. i
  37681. }
  37682. ,
  37683. a.readUInt32 = a.readUint32,
  37684. e && (a.writeInt64 = function(t, i) {
  37685. var n = "undefined" == typeof i;
  37686. if (n && (i = this.offset),
  37687. !this.noAssert) {
  37688. if ("number" == typeof t)
  37689. t = e.fromNumber(t);
  37690. else if ("string" == typeof t)
  37691. t = e.fromString(t);
  37692. else if (!(t && t instanceof e))
  37693. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37694. if ("number" != typeof i || i % 1 !== 0)
  37695. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37696. if (i >>>= 0,
  37697. i < 0 || i + 0 > this.buffer.byteLength)
  37698. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37699. }
  37700. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37701. i += 8;
  37702. var r = this.buffer.byteLength;
  37703. i > r && this.resize((r *= 2) > i ? r : i),
  37704. i -= 8;
  37705. var o = t.low
  37706. , a = t.high;
  37707. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37708. this.view[i + 2] = o >>> 16 & 255,
  37709. this.view[i + 1] = o >>> 8 & 255,
  37710. this.view[i] = 255 & o,
  37711. i += 4,
  37712. this.view[i + 3] = a >>> 24 & 255,
  37713. this.view[i + 2] = a >>> 16 & 255,
  37714. this.view[i + 1] = a >>> 8 & 255,
  37715. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37716. this.view[i + 1] = a >>> 16 & 255,
  37717. this.view[i + 2] = a >>> 8 & 255,
  37718. this.view[i + 3] = 255 & a,
  37719. i += 4,
  37720. this.view[i] = o >>> 24 & 255,
  37721. this.view[i + 1] = o >>> 16 & 255,
  37722. this.view[i + 2] = o >>> 8 & 255,
  37723. this.view[i + 3] = 255 & o),
  37724. n && (this.offset += 8),
  37725. this
  37726. }
  37727. ,
  37728. a.writeLong = a.writeInt64,
  37729. a.readInt64 = function(t) {
  37730. var i = "undefined" == typeof t;
  37731. if (i && (t = this.offset),
  37732. !this.noAssert) {
  37733. if ("number" != typeof t || t % 1 !== 0)
  37734. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37735. if (t >>>= 0,
  37736. t < 0 || t + 8 > this.buffer.byteLength)
  37737. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37738. }
  37739. var n = 0
  37740. , r = 0;
  37741. this.littleEndian ? (n = this.view[t + 2] << 16,
  37742. n |= this.view[t + 1] << 8,
  37743. n |= this.view[t],
  37744. n += this.view[t + 3] << 24 >>> 0,
  37745. t += 4,
  37746. r = this.view[t + 2] << 16,
  37747. r |= this.view[t + 1] << 8,
  37748. r |= this.view[t],
  37749. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37750. r |= this.view[t + 2] << 8,
  37751. r |= this.view[t + 3],
  37752. r += this.view[t] << 24 >>> 0,
  37753. t += 4,
  37754. n = this.view[t + 1] << 16,
  37755. n |= this.view[t + 2] << 8,
  37756. n |= this.view[t + 3],
  37757. n += this.view[t] << 24 >>> 0);
  37758. var o = new e(n,r,!1);
  37759. return i && (this.offset += 8),
  37760. o
  37761. }
  37762. ,
  37763. a.readLong = a.readInt64,
  37764. a.writeUint64 = function(t, i) {
  37765. var n = "undefined" == typeof i;
  37766. if (n && (i = this.offset),
  37767. !this.noAssert) {
  37768. if ("number" == typeof t)
  37769. t = e.fromNumber(t);
  37770. else if ("string" == typeof t)
  37771. t = e.fromString(t);
  37772. else if (!(t && t instanceof e))
  37773. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  37774. if ("number" != typeof i || i % 1 !== 0)
  37775. throw TypeError("Illegal offset: " + i + " (not an integer)");
  37776. if (i >>>= 0,
  37777. i < 0 || i + 0 > this.buffer.byteLength)
  37778. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  37779. }
  37780. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  37781. i += 8;
  37782. var r = this.buffer.byteLength;
  37783. i > r && this.resize((r *= 2) > i ? r : i),
  37784. i -= 8;
  37785. var o = t.low
  37786. , a = t.high;
  37787. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  37788. this.view[i + 2] = o >>> 16 & 255,
  37789. this.view[i + 1] = o >>> 8 & 255,
  37790. this.view[i] = 255 & o,
  37791. i += 4,
  37792. this.view[i + 3] = a >>> 24 & 255,
  37793. this.view[i + 2] = a >>> 16 & 255,
  37794. this.view[i + 1] = a >>> 8 & 255,
  37795. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  37796. this.view[i + 1] = a >>> 16 & 255,
  37797. this.view[i + 2] = a >>> 8 & 255,
  37798. this.view[i + 3] = 255 & a,
  37799. i += 4,
  37800. this.view[i] = o >>> 24 & 255,
  37801. this.view[i + 1] = o >>> 16 & 255,
  37802. this.view[i + 2] = o >>> 8 & 255,
  37803. this.view[i + 3] = 255 & o),
  37804. n && (this.offset += 8),
  37805. this
  37806. }
  37807. ,
  37808. a.writeUInt64 = a.writeUint64,
  37809. a.readUint64 = function(t) {
  37810. var i = "undefined" == typeof t;
  37811. if (i && (t = this.offset),
  37812. !this.noAssert) {
  37813. if ("number" != typeof t || t % 1 !== 0)
  37814. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37815. if (t >>>= 0,
  37816. t < 0 || t + 8 > this.buffer.byteLength)
  37817. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  37818. }
  37819. var n = 0
  37820. , r = 0;
  37821. this.littleEndian ? (n = this.view[t + 2] << 16,
  37822. n |= this.view[t + 1] << 8,
  37823. n |= this.view[t],
  37824. n += this.view[t + 3] << 24 >>> 0,
  37825. t += 4,
  37826. r = this.view[t + 2] << 16,
  37827. r |= this.view[t + 1] << 8,
  37828. r |= this.view[t],
  37829. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  37830. r |= this.view[t + 2] << 8,
  37831. r |= this.view[t + 3],
  37832. r += this.view[t] << 24 >>> 0,
  37833. t += 4,
  37834. n = this.view[t + 1] << 16,
  37835. n |= this.view[t + 2] << 8,
  37836. n |= this.view[t + 3],
  37837. n += this.view[t] << 24 >>> 0);
  37838. var o = new e(n,r,!0);
  37839. return i && (this.offset += 8),
  37840. o
  37841. }
  37842. ,
  37843. a.readUInt64 = a.readUint64),
  37844. a.writeFloat32 = function(e, t) {
  37845. var i = "undefined" == typeof t;
  37846. if (i && (t = this.offset),
  37847. !this.noAssert) {
  37848. if ("number" != typeof e)
  37849. throw TypeError("Illegal value: " + e + " (not a number)");
  37850. if ("number" != typeof t || t % 1 !== 0)
  37851. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37852. if (t >>>= 0,
  37853. t < 0 || t + 0 > this.buffer.byteLength)
  37854. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37855. }
  37856. t += 4;
  37857. var n = this.buffer.byteLength;
  37858. return t > n && this.resize((n *= 2) > t ? n : t),
  37859. t -= 4,
  37860. r(this.view, e, t, this.littleEndian, 23, 4),
  37861. i && (this.offset += 4),
  37862. this
  37863. }
  37864. ,
  37865. a.writeFloat = a.writeFloat32,
  37866. a.readFloat32 = function(e) {
  37867. var t = "undefined" == typeof e;
  37868. if (t && (e = this.offset),
  37869. !this.noAssert) {
  37870. if ("number" != typeof e || e % 1 !== 0)
  37871. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37872. if (e >>>= 0,
  37873. e < 0 || e + 4 > this.buffer.byteLength)
  37874. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  37875. }
  37876. var i = n(this.view, e, this.littleEndian, 23, 4);
  37877. return t && (this.offset += 4),
  37878. i
  37879. }
  37880. ,
  37881. a.readFloat = a.readFloat32,
  37882. a.writeFloat64 = function(e, t) {
  37883. var i = "undefined" == typeof t;
  37884. if (i && (t = this.offset),
  37885. !this.noAssert) {
  37886. if ("number" != typeof e)
  37887. throw TypeError("Illegal value: " + e + " (not a number)");
  37888. if ("number" != typeof t || t % 1 !== 0)
  37889. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37890. if (t >>>= 0,
  37891. t < 0 || t + 0 > this.buffer.byteLength)
  37892. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37893. }
  37894. t += 8;
  37895. var n = this.buffer.byteLength;
  37896. return t > n && this.resize((n *= 2) > t ? n : t),
  37897. t -= 8,
  37898. r(this.view, e, t, this.littleEndian, 52, 8),
  37899. i && (this.offset += 8),
  37900. this
  37901. }
  37902. ,
  37903. a.writeDouble = a.writeFloat64,
  37904. a.readFloat64 = function(e) {
  37905. var t = "undefined" == typeof e;
  37906. if (t && (e = this.offset),
  37907. !this.noAssert) {
  37908. if ("number" != typeof e || e % 1 !== 0)
  37909. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37910. if (e >>>= 0,
  37911. e < 0 || e + 8 > this.buffer.byteLength)
  37912. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  37913. }
  37914. var i = n(this.view, e, this.littleEndian, 52, 8);
  37915. return t && (this.offset += 8),
  37916. i
  37917. }
  37918. ,
  37919. a.readDouble = a.readFloat64,
  37920. o.MAX_VARINT32_BYTES = 5,
  37921. o.calculateVarint32 = function(e) {
  37922. return e >>>= 0,
  37923. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  37924. }
  37925. ,
  37926. o.zigZagEncode32 = function(e) {
  37927. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  37928. }
  37929. ,
  37930. o.zigZagDecode32 = function(e) {
  37931. return e >>> 1 ^ -(1 & e) | 0
  37932. }
  37933. ,
  37934. a.writeVarint32 = function(e, t) {
  37935. var i = "undefined" == typeof t;
  37936. if (i && (t = this.offset),
  37937. !this.noAssert) {
  37938. if ("number" != typeof e || e % 1 !== 0)
  37939. throw TypeError("Illegal value: " + e + " (not an integer)");
  37940. if (e |= 0,
  37941. "number" != typeof t || t % 1 !== 0)
  37942. throw TypeError("Illegal offset: " + t + " (not an integer)");
  37943. if (t >>>= 0,
  37944. t < 0 || t + 0 > this.buffer.byteLength)
  37945. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  37946. }
  37947. var n, r = o.calculateVarint32(e);
  37948. t += r;
  37949. var a = this.buffer.byteLength;
  37950. for (t > a && this.resize((a *= 2) > t ? a : t),
  37951. t -= r,
  37952. e >>>= 0; e >= 128; )
  37953. n = 127 & e | 128,
  37954. this.view[t++] = n,
  37955. e >>>= 7;
  37956. return this.view[t++] = e,
  37957. i ? (this.offset = t,
  37958. this) : r
  37959. }
  37960. ,
  37961. a.writeVarint32ZigZag = function(e, t) {
  37962. return this.writeVarint32(o.zigZagEncode32(e), t)
  37963. }
  37964. ,
  37965. a.readVarint32 = function(e) {
  37966. var t = "undefined" == typeof e;
  37967. if (t && (e = this.offset),
  37968. !this.noAssert) {
  37969. if ("number" != typeof e || e % 1 !== 0)
  37970. throw TypeError("Illegal offset: " + e + " (not an integer)");
  37971. if (e >>>= 0,
  37972. e < 0 || e + 1 > this.buffer.byteLength)
  37973. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  37974. }
  37975. var i, n = 0, r = 0;
  37976. do {
  37977. if (!this.noAssert && e > this.limit) {
  37978. var o = Error("Truncated");
  37979. throw o.truncated = !0,
  37980. o
  37981. }
  37982. i = this.view[e++],
  37983. n < 5 && (r |= (127 & i) << 7 * n),
  37984. ++n
  37985. } while (0 !== (128 & i));return r |= 0,
  37986. t ? (this.offset = e,
  37987. r) : {
  37988. value: r,
  37989. length: n
  37990. }
  37991. }
  37992. ,
  37993. a.readVarint32ZigZag = function(e) {
  37994. var t = this.readVarint32(e);
  37995. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  37996. t
  37997. }
  37998. ,
  37999. e && (o.MAX_VARINT64_BYTES = 10,
  38000. o.calculateVarint64 = function(t) {
  38001. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  38002. var i = t.toInt() >>> 0
  38003. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  38004. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  38005. 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
  38006. }
  38007. ,
  38008. o.zigZagEncode64 = function(t) {
  38009. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38010. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  38011. }
  38012. ,
  38013. o.zigZagDecode64 = function(t) {
  38014. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  38015. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  38016. }
  38017. ,
  38018. a.writeVarint64 = function(t, i) {
  38019. var n = "undefined" == typeof i;
  38020. if (n && (i = this.offset),
  38021. !this.noAssert) {
  38022. if ("number" == typeof t)
  38023. t = e.fromNumber(t);
  38024. else if ("string" == typeof t)
  38025. t = e.fromString(t);
  38026. else if (!(t && t instanceof e))
  38027. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  38028. if ("number" != typeof i || i % 1 !== 0)
  38029. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38030. if (i >>>= 0,
  38031. i < 0 || i + 0 > this.buffer.byteLength)
  38032. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38033. }
  38034. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  38035. var r = o.calculateVarint64(t)
  38036. , a = t.toInt() >>> 0
  38037. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  38038. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  38039. i += r;
  38040. var c = this.buffer.byteLength;
  38041. switch (i > c && this.resize((c *= 2) > i ? c : i),
  38042. i -= r,
  38043. r) {
  38044. case 10:
  38045. this.view[i + 9] = l >>> 7 & 1;
  38046. case 9:
  38047. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  38048. case 8:
  38049. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  38050. case 7:
  38051. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  38052. case 6:
  38053. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  38054. case 5:
  38055. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  38056. case 4:
  38057. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  38058. case 3:
  38059. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  38060. case 2:
  38061. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  38062. case 1:
  38063. this.view[i] = 1 !== r ? 128 | a : 127 & a
  38064. }
  38065. return n ? (this.offset += r,
  38066. this) : r
  38067. }
  38068. ,
  38069. a.writeVarint64ZigZag = function(e, t) {
  38070. return this.writeVarint64(o.zigZagEncode64(e), t)
  38071. }
  38072. ,
  38073. a.readVarint64 = function(t) {
  38074. var i = "undefined" == typeof t;
  38075. if (i && (t = this.offset),
  38076. !this.noAssert) {
  38077. if ("number" != typeof t || t % 1 !== 0)
  38078. throw TypeError("Illegal offset: " + t + " (not an integer)");
  38079. if (t >>>= 0,
  38080. t < 0 || t + 1 > this.buffer.byteLength)
  38081. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  38082. }
  38083. var n = t
  38084. , r = 0
  38085. , o = 0
  38086. , a = 0
  38087. , s = 0;
  38088. if (s = this.view[t++],
  38089. r = 127 & s,
  38090. 128 & s && (s = this.view[t++],
  38091. r |= (127 & s) << 7,
  38092. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38093. r |= (127 & s) << 14,
  38094. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38095. r |= (127 & s) << 21,
  38096. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38097. o = 127 & s,
  38098. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38099. o |= (127 & s) << 7,
  38100. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38101. o |= (127 & s) << 14,
  38102. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38103. o |= (127 & s) << 21,
  38104. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38105. a = 127 & s,
  38106. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  38107. a |= (127 & s) << 7,
  38108. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  38109. throw Error("Buffer overrun");
  38110. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  38111. return i ? (this.offset = t,
  38112. l) : {
  38113. value: l,
  38114. length: t - n
  38115. }
  38116. }
  38117. ,
  38118. a.readVarint64ZigZag = function(t) {
  38119. var i = this.readVarint64(t);
  38120. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  38121. i
  38122. }
  38123. ),
  38124. a.writeCString = function(e, i) {
  38125. var n = "undefined" == typeof i;
  38126. n && (i = this.offset);
  38127. var r, o = e.length;
  38128. if (!this.noAssert) {
  38129. if ("string" != typeof e)
  38130. throw TypeError("Illegal str: Not a string");
  38131. for (r = 0; r < o; ++r)
  38132. if (0 === e.charCodeAt(r))
  38133. throw RangeError("Illegal str: Contains NULL-characters");
  38134. if ("number" != typeof i || i % 1 !== 0)
  38135. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38136. if (i >>>= 0,
  38137. i < 0 || i + 0 > this.buffer.byteLength)
  38138. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38139. }
  38140. o = h.calculateUTF16asUTF8(t(e))[1],
  38141. i += o + 1;
  38142. var a = this.buffer.byteLength;
  38143. return i > a && this.resize((a *= 2) > i ? a : i),
  38144. i -= o + 1,
  38145. h.encodeUTF16toUTF8(t(e), function(e) {
  38146. this.view[i++] = e
  38147. }
  38148. .bind(this)),
  38149. this.view[i++] = 0,
  38150. n ? (this.offset = i,
  38151. this) : o
  38152. }
  38153. ,
  38154. a.readCString = function(e) {
  38155. var t = "undefined" == typeof e;
  38156. if (t && (e = this.offset),
  38157. !this.noAssert) {
  38158. if ("number" != typeof e || e % 1 !== 0)
  38159. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38160. if (e >>>= 0,
  38161. e < 0 || e + 1 > this.buffer.byteLength)
  38162. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38163. }
  38164. var n, r = e, o = -1;
  38165. return h.decodeUTF8toUTF16(function() {
  38166. if (0 === o)
  38167. return null;
  38168. if (e >= this.limit)
  38169. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  38170. return o = this.view[e++],
  38171. 0 === o ? null : o
  38172. }
  38173. .bind(this), n = i(), !0),
  38174. t ? (this.offset = e,
  38175. n()) : {
  38176. string: n(),
  38177. length: e - r
  38178. }
  38179. }
  38180. ,
  38181. a.writeIString = function(e, i) {
  38182. var n = "undefined" == typeof i;
  38183. if (n && (i = this.offset),
  38184. !this.noAssert) {
  38185. if ("string" != typeof e)
  38186. throw TypeError("Illegal str: Not a string");
  38187. if ("number" != typeof i || i % 1 !== 0)
  38188. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38189. if (i >>>= 0,
  38190. i < 0 || i + 0 > this.buffer.byteLength)
  38191. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38192. }
  38193. var r, o = i;
  38194. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38195. i += 4 + r;
  38196. var a = this.buffer.byteLength;
  38197. if (i > a && this.resize((a *= 2) > i ? a : i),
  38198. i -= 4 + r,
  38199. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  38200. this.view[i + 2] = r >>> 16 & 255,
  38201. this.view[i + 1] = r >>> 8 & 255,
  38202. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  38203. this.view[i + 1] = r >>> 16 & 255,
  38204. this.view[i + 2] = r >>> 8 & 255,
  38205. this.view[i + 3] = 255 & r),
  38206. i += 4,
  38207. h.encodeUTF16toUTF8(t(e), function(e) {
  38208. this.view[i++] = e
  38209. }
  38210. .bind(this)),
  38211. i !== o + 4 + r)
  38212. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  38213. return n ? (this.offset = i,
  38214. this) : i - o
  38215. }
  38216. ,
  38217. a.readIString = function(e) {
  38218. var t = "undefined" == typeof e;
  38219. if (t && (e = this.offset),
  38220. !this.noAssert) {
  38221. if ("number" != typeof e || e % 1 !== 0)
  38222. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38223. if (e >>>= 0,
  38224. e < 0 || e + 4 > this.buffer.byteLength)
  38225. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  38226. }
  38227. var i = e
  38228. , n = this.readUint32(e)
  38229. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  38230. return e += r.length,
  38231. t ? (this.offset = e,
  38232. r.string) : {
  38233. string: r.string,
  38234. length: e - i
  38235. }
  38236. }
  38237. ,
  38238. o.METRICS_CHARS = "c",
  38239. o.METRICS_BYTES = "b",
  38240. a.writeUTF8String = function(e, i) {
  38241. var n = "undefined" == typeof i;
  38242. if (n && (i = this.offset),
  38243. !this.noAssert) {
  38244. if ("number" != typeof i || i % 1 !== 0)
  38245. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38246. if (i >>>= 0,
  38247. i < 0 || i + 0 > this.buffer.byteLength)
  38248. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38249. }
  38250. var r, o = i;
  38251. r = h.calculateUTF16asUTF8(t(e))[1],
  38252. i += r;
  38253. var a = this.buffer.byteLength;
  38254. return i > a && this.resize((a *= 2) > i ? a : i),
  38255. i -= r,
  38256. h.encodeUTF16toUTF8(t(e), function(e) {
  38257. this.view[i++] = e
  38258. }
  38259. .bind(this)),
  38260. n ? (this.offset = i,
  38261. this) : i - o
  38262. }
  38263. ,
  38264. a.writeString = a.writeUTF8String,
  38265. o.calculateUTF8Chars = function(e) {
  38266. return h.calculateUTF16asUTF8(t(e))[0]
  38267. }
  38268. ,
  38269. o.calculateUTF8Bytes = function(e) {
  38270. return h.calculateUTF16asUTF8(t(e))[1]
  38271. }
  38272. ,
  38273. o.calculateString = o.calculateUTF8Bytes,
  38274. a.readUTF8String = function(e, t, n) {
  38275. "number" == typeof t && (n = t,
  38276. t = void 0);
  38277. var r = "undefined" == typeof n;
  38278. if (r && (n = this.offset),
  38279. "undefined" == typeof t && (t = o.METRICS_CHARS),
  38280. !this.noAssert) {
  38281. if ("number" != typeof e || e % 1 !== 0)
  38282. throw TypeError("Illegal length: " + e + " (not an integer)");
  38283. if (e |= 0,
  38284. "number" != typeof n || n % 1 !== 0)
  38285. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38286. if (n >>>= 0,
  38287. n < 0 || n + 0 > this.buffer.byteLength)
  38288. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  38289. }
  38290. var a, s = 0, l = n;
  38291. if (t === o.METRICS_CHARS) {
  38292. if (a = i(),
  38293. h.decodeUTF8(function() {
  38294. return s < e && n < this.limit ? this.view[n++] : null
  38295. }
  38296. .bind(this), function(e) {
  38297. ++s,
  38298. h.UTF8toUTF16(e, a)
  38299. }),
  38300. s !== e)
  38301. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  38302. return r ? (this.offset = n,
  38303. a()) : {
  38304. string: a(),
  38305. length: n - l
  38306. }
  38307. }
  38308. if (t === o.METRICS_BYTES) {
  38309. if (!this.noAssert) {
  38310. if ("number" != typeof n || n % 1 !== 0)
  38311. throw TypeError("Illegal offset: " + n + " (not an integer)");
  38312. if (n >>>= 0,
  38313. n < 0 || n + e > this.buffer.byteLength)
  38314. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  38315. }
  38316. var c = n + e;
  38317. if (h.decodeUTF8toUTF16(function() {
  38318. return n < c ? this.view[n++] : null
  38319. }
  38320. .bind(this), a = i(), this.noAssert),
  38321. n !== c)
  38322. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  38323. return r ? (this.offset = n,
  38324. a()) : {
  38325. string: a(),
  38326. length: n - l
  38327. }
  38328. }
  38329. throw TypeError("Unsupported metrics: " + t)
  38330. }
  38331. ,
  38332. a.readString = a.readUTF8String,
  38333. a.writeVString = function(e, i) {
  38334. var n = "undefined" == typeof i;
  38335. if (n && (i = this.offset),
  38336. !this.noAssert) {
  38337. if ("string" != typeof e)
  38338. throw TypeError("Illegal str: Not a string");
  38339. if ("number" != typeof i || i % 1 !== 0)
  38340. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38341. if (i >>>= 0,
  38342. i < 0 || i + 0 > this.buffer.byteLength)
  38343. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38344. }
  38345. var r, a, s = i;
  38346. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  38347. a = o.calculateVarint32(r),
  38348. i += a + r;
  38349. var l = this.buffer.byteLength;
  38350. if (i > l && this.resize((l *= 2) > i ? l : i),
  38351. i -= a + r,
  38352. i += this.writeVarint32(r, i),
  38353. h.encodeUTF16toUTF8(t(e), function(e) {
  38354. this.view[i++] = e
  38355. }
  38356. .bind(this)),
  38357. i !== s + r + a)
  38358. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  38359. return n ? (this.offset = i,
  38360. this) : i - s
  38361. }
  38362. ,
  38363. a.readVString = function(e) {
  38364. var t = "undefined" == typeof e;
  38365. if (t && (e = this.offset),
  38366. !this.noAssert) {
  38367. if ("number" != typeof e || e % 1 !== 0)
  38368. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38369. if (e >>>= 0,
  38370. e < 0 || e + 1 > this.buffer.byteLength)
  38371. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  38372. }
  38373. var i = e
  38374. , n = this.readVarint32(e)
  38375. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  38376. return e += r.length,
  38377. t ? (this.offset = e,
  38378. r.string) : {
  38379. string: r.string,
  38380. length: e - i
  38381. }
  38382. }
  38383. ,
  38384. a.append = function(e, t, i) {
  38385. "number" != typeof t && "string" == typeof t || (i = t,
  38386. t = void 0);
  38387. var n = "undefined" == typeof i;
  38388. if (n && (i = this.offset),
  38389. !this.noAssert) {
  38390. if ("number" != typeof i || i % 1 !== 0)
  38391. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38392. if (i >>>= 0,
  38393. i < 0 || i + 0 > this.buffer.byteLength)
  38394. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38395. }
  38396. e instanceof o || (e = o.wrap(e, t));
  38397. var r = e.limit - e.offset;
  38398. if (r <= 0)
  38399. return this;
  38400. i += r;
  38401. var a = this.buffer.byteLength;
  38402. return i > a && this.resize((a *= 2) > i ? a : i),
  38403. i -= r,
  38404. this.view.set(e.view.subarray(e.offset, e.limit), i),
  38405. e.offset += r,
  38406. n && (this.offset += r),
  38407. this
  38408. }
  38409. ,
  38410. a.appendTo = function(e, t) {
  38411. return e.append(this, t),
  38412. this
  38413. }
  38414. ,
  38415. a.assert = function(e) {
  38416. return this.noAssert = !e,
  38417. this
  38418. }
  38419. ,
  38420. a.capacity = function() {
  38421. return this.buffer.byteLength
  38422. }
  38423. ,
  38424. a.clear = function() {
  38425. return this.offset = 0,
  38426. this.limit = this.buffer.byteLength,
  38427. this.markedOffset = -1,
  38428. this
  38429. }
  38430. ,
  38431. a.clone = function(e) {
  38432. var t = new o(0,this.littleEndian,this.noAssert);
  38433. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  38434. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  38435. t.view = this.view),
  38436. t.offset = this.offset,
  38437. t.markedOffset = this.markedOffset,
  38438. t.limit = this.limit,
  38439. t
  38440. }
  38441. ,
  38442. a.compact = function(e, t) {
  38443. if ("undefined" == typeof e && (e = this.offset),
  38444. "undefined" == typeof t && (t = this.limit),
  38445. !this.noAssert) {
  38446. if ("number" != typeof e || e % 1 !== 0)
  38447. throw TypeError("Illegal begin: Not an integer");
  38448. if (e >>>= 0,
  38449. "number" != typeof t || t % 1 !== 0)
  38450. throw TypeError("Illegal end: Not an integer");
  38451. if (t >>>= 0,
  38452. e < 0 || e > t || t > this.buffer.byteLength)
  38453. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38454. }
  38455. if (0 === e && t === this.buffer.byteLength)
  38456. return this;
  38457. var i = t - e;
  38458. if (0 === i)
  38459. return this.buffer = s,
  38460. this.view = null,
  38461. this.markedOffset >= 0 && (this.markedOffset -= e),
  38462. this.offset = 0,
  38463. this.limit = 0,
  38464. this;
  38465. var n = new ArrayBuffer(i)
  38466. , r = new Uint8Array(n);
  38467. return r.set(this.view.subarray(e, t)),
  38468. this.buffer = n,
  38469. this.view = r,
  38470. this.markedOffset >= 0 && (this.markedOffset -= e),
  38471. this.offset = 0,
  38472. this.limit = i,
  38473. this
  38474. }
  38475. ,
  38476. a.copy = function(e, t) {
  38477. if ("undefined" == typeof e && (e = this.offset),
  38478. "undefined" == typeof t && (t = this.limit),
  38479. !this.noAssert) {
  38480. if ("number" != typeof e || e % 1 !== 0)
  38481. throw TypeError("Illegal begin: Not an integer");
  38482. if (e >>>= 0,
  38483. "number" != typeof t || t % 1 !== 0)
  38484. throw TypeError("Illegal end: Not an integer");
  38485. if (t >>>= 0,
  38486. e < 0 || e > t || t > this.buffer.byteLength)
  38487. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38488. }
  38489. if (e === t)
  38490. return new o(0,this.littleEndian,this.noAssert);
  38491. var i = t - e
  38492. , n = new o(i,this.littleEndian,this.noAssert);
  38493. return n.offset = 0,
  38494. n.limit = i,
  38495. n.markedOffset >= 0 && (n.markedOffset -= e),
  38496. this.copyTo(n, 0, e, t),
  38497. n
  38498. }
  38499. ,
  38500. a.copyTo = function(e, t, i, n) {
  38501. var r, a;
  38502. if (!this.noAssert && !o.isByteBuffer(e))
  38503. throw TypeError("Illegal target: Not a ByteBuffer");
  38504. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  38505. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  38506. n = "undefined" == typeof n ? this.limit : 0 | n,
  38507. t < 0 || t > e.buffer.byteLength)
  38508. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  38509. if (i < 0 || n > this.buffer.byteLength)
  38510. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  38511. var s = n - i;
  38512. return 0 === s ? e : (e.ensureCapacity(t + s),
  38513. e.view.set(this.view.subarray(i, n), t),
  38514. r && (this.offset += s),
  38515. a && (e.offset += s),
  38516. this)
  38517. }
  38518. ,
  38519. a.ensureCapacity = function(e) {
  38520. var t = this.buffer.byteLength;
  38521. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  38522. }
  38523. ,
  38524. a.fill = function(e, t, i) {
  38525. var n = "undefined" == typeof t;
  38526. if (n && (t = this.offset),
  38527. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  38528. "undefined" == typeof t && (t = this.offset),
  38529. "undefined" == typeof i && (i = this.limit),
  38530. !this.noAssert) {
  38531. if ("number" != typeof e || e % 1 !== 0)
  38532. throw TypeError("Illegal value: " + e + " (not an integer)");
  38533. if (e |= 0,
  38534. "number" != typeof t || t % 1 !== 0)
  38535. throw TypeError("Illegal begin: Not an integer");
  38536. if (t >>>= 0,
  38537. "number" != typeof i || i % 1 !== 0)
  38538. throw TypeError("Illegal end: Not an integer");
  38539. if (i >>>= 0,
  38540. t < 0 || t > i || i > this.buffer.byteLength)
  38541. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38542. }
  38543. if (t >= i)
  38544. return this;
  38545. for (; t < i; )
  38546. this.view[t++] = e;
  38547. return n && (this.offset = t),
  38548. this
  38549. }
  38550. ,
  38551. a.flip = function() {
  38552. return this.limit = this.offset,
  38553. this.offset = 0,
  38554. this
  38555. }
  38556. ,
  38557. a.mark = function(e) {
  38558. if (e = "undefined" == typeof e ? this.offset : e,
  38559. !this.noAssert) {
  38560. if ("number" != typeof e || e % 1 !== 0)
  38561. throw TypeError("Illegal offset: " + e + " (not an integer)");
  38562. if (e >>>= 0,
  38563. e < 0 || e + 0 > this.buffer.byteLength)
  38564. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  38565. }
  38566. return this.markedOffset = e,
  38567. this
  38568. }
  38569. ,
  38570. a.order = function(e) {
  38571. if (!this.noAssert && "boolean" != typeof e)
  38572. throw TypeError("Illegal littleEndian: Not a boolean");
  38573. return this.littleEndian = !!e,
  38574. this
  38575. }
  38576. ,
  38577. a.LE = function(e) {
  38578. return this.littleEndian = "undefined" == typeof e || !!e,
  38579. this
  38580. }
  38581. ,
  38582. a.BE = function(e) {
  38583. return this.littleEndian = "undefined" != typeof e && !e,
  38584. this
  38585. }
  38586. ,
  38587. a.prepend = function(e, t, i) {
  38588. "number" != typeof t && "string" == typeof t || (i = t,
  38589. t = void 0);
  38590. var n = "undefined" == typeof i;
  38591. if (n && (i = this.offset),
  38592. !this.noAssert) {
  38593. if ("number" != typeof i || i % 1 !== 0)
  38594. throw TypeError("Illegal offset: " + i + " (not an integer)");
  38595. if (i >>>= 0,
  38596. i < 0 || i + 0 > this.buffer.byteLength)
  38597. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  38598. }
  38599. e instanceof o || (e = o.wrap(e, t));
  38600. var r = e.limit - e.offset;
  38601. if (r <= 0)
  38602. return this;
  38603. var a = r - i;
  38604. if (a > 0) {
  38605. var s = new ArrayBuffer(this.buffer.byteLength + a)
  38606. , l = new Uint8Array(s);
  38607. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  38608. this.buffer = s,
  38609. this.view = l,
  38610. this.offset += a,
  38611. this.markedOffset >= 0 && (this.markedOffset += a),
  38612. this.limit += a,
  38613. i += a
  38614. } else {
  38615. new Uint8Array(this.buffer)
  38616. }
  38617. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  38618. e.offset = e.limit,
  38619. n && (this.offset -= r),
  38620. this
  38621. }
  38622. ,
  38623. a.prependTo = function(e, t) {
  38624. return e.prepend(this, t),
  38625. this
  38626. }
  38627. ,
  38628. a.printDebug = function(e) {
  38629. "function" != typeof e && (e = console.log.bind(console)),
  38630. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  38631. }
  38632. ,
  38633. a.remaining = function() {
  38634. return this.limit - this.offset
  38635. }
  38636. ,
  38637. a.reset = function() {
  38638. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  38639. this.markedOffset = -1) : this.offset = 0,
  38640. this
  38641. }
  38642. ,
  38643. a.resize = function(e) {
  38644. if (!this.noAssert) {
  38645. if ("number" != typeof e || e % 1 !== 0)
  38646. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  38647. if (e |= 0,
  38648. e < 0)
  38649. throw RangeError("Illegal capacity: 0 <= " + e)
  38650. }
  38651. if (this.buffer.byteLength < e) {
  38652. var t = new ArrayBuffer(e)
  38653. , i = new Uint8Array(t);
  38654. i.set(this.view),
  38655. this.buffer = t,
  38656. this.view = i
  38657. }
  38658. return this
  38659. }
  38660. ,
  38661. a.reverse = function(e, t) {
  38662. if ("undefined" == typeof e && (e = this.offset),
  38663. "undefined" == typeof t && (t = this.limit),
  38664. !this.noAssert) {
  38665. if ("number" != typeof e || e % 1 !== 0)
  38666. throw TypeError("Illegal begin: Not an integer");
  38667. if (e >>>= 0,
  38668. "number" != typeof t || t % 1 !== 0)
  38669. throw TypeError("Illegal end: Not an integer");
  38670. if (t >>>= 0,
  38671. e < 0 || e > t || t > this.buffer.byteLength)
  38672. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38673. }
  38674. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  38675. this)
  38676. }
  38677. ,
  38678. a.skip = function(e) {
  38679. if (!this.noAssert) {
  38680. if ("number" != typeof e || e % 1 !== 0)
  38681. throw TypeError("Illegal length: " + e + " (not an integer)");
  38682. e |= 0
  38683. }
  38684. var t = this.offset + e;
  38685. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  38686. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  38687. return this.offset = t,
  38688. this
  38689. }
  38690. ,
  38691. a.slice = function(e, t) {
  38692. if ("undefined" == typeof e && (e = this.offset),
  38693. "undefined" == typeof t && (t = this.limit),
  38694. !this.noAssert) {
  38695. if ("number" != typeof e || e % 1 !== 0)
  38696. throw TypeError("Illegal begin: Not an integer");
  38697. if (e >>>= 0,
  38698. "number" != typeof t || t % 1 !== 0)
  38699. throw TypeError("Illegal end: Not an integer");
  38700. if (t >>>= 0,
  38701. e < 0 || e > t || t > this.buffer.byteLength)
  38702. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  38703. }
  38704. var i = this.clone();
  38705. return i.offset = e,
  38706. i.limit = t,
  38707. i
  38708. }
  38709. ,
  38710. a.toBuffer = function(e) {
  38711. var t = this.offset
  38712. , i = this.limit;
  38713. if (!this.noAssert) {
  38714. if ("number" != typeof t || t % 1 !== 0)
  38715. throw TypeError("Illegal offset: Not an integer");
  38716. if (t >>>= 0,
  38717. "number" != typeof i || i % 1 !== 0)
  38718. throw TypeError("Illegal limit: Not an integer");
  38719. if (i >>>= 0,
  38720. t < 0 || t > i || i > this.buffer.byteLength)
  38721. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  38722. }
  38723. if (!e && 0 === t && i === this.buffer.byteLength)
  38724. return this.buffer;
  38725. if (t === i)
  38726. return s;
  38727. var n = new ArrayBuffer(i - t);
  38728. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  38729. n
  38730. }
  38731. ,
  38732. a.toArrayBuffer = a.toBuffer,
  38733. a.toString = function(e, t, i) {
  38734. if ("undefined" == typeof e)
  38735. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  38736. switch ("number" == typeof e && (e = "utf8",
  38737. t = e,
  38738. i = t),
  38739. e) {
  38740. case "utf8":
  38741. return this.toUTF8(t, i);
  38742. case "base64":
  38743. return this.toBase64(t, i);
  38744. case "hex":
  38745. return this.toHex(t, i);
  38746. case "binary":
  38747. return this.toBinary(t, i);
  38748. case "debug":
  38749. return this.toDebug();
  38750. case "columns":
  38751. return this.toColumns();
  38752. default:
  38753. throw Error("Unsupported encoding: " + e)
  38754. }
  38755. }
  38756. ;
  38757. var c = function() {
  38758. 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)
  38759. i[t[n]] = n;
  38760. return e.encode = function(e, i) {
  38761. for (var n, r; null !== (n = e()); )
  38762. i(t[n >> 2 & 63]),
  38763. r = (3 & n) << 4,
  38764. null !== (n = e()) ? (r |= n >> 4 & 15,
  38765. i(t[63 & (r | n >> 4 & 15)]),
  38766. r = (15 & n) << 2,
  38767. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  38768. i(t[63 & n])) : (i(t[63 & r]),
  38769. i(61))) : (i(t[63 & r]),
  38770. i(61),
  38771. i(61))
  38772. }
  38773. ,
  38774. e.decode = function(e, t) {
  38775. function n(e) {
  38776. throw Error("Illegal character code: " + e)
  38777. }
  38778. for (var r, o, a; null !== (r = e()); )
  38779. if (o = i[r],
  38780. "undefined" == typeof o && n(r),
  38781. null !== (r = e()) && (a = i[r],
  38782. "undefined" == typeof a && n(r),
  38783. t(o << 2 >>> 0 | (48 & a) >> 4),
  38784. null !== (r = e()))) {
  38785. if (o = i[r],
  38786. "undefined" == typeof o) {
  38787. if (61 === r)
  38788. break;
  38789. n(r)
  38790. }
  38791. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  38792. null !== (r = e())) {
  38793. if (a = i[r],
  38794. "undefined" == typeof a) {
  38795. if (61 === r)
  38796. break;
  38797. n(r)
  38798. }
  38799. t((3 & o) << 6 >>> 0 | a)
  38800. }
  38801. }
  38802. }
  38803. ,
  38804. e.test = function(e) {
  38805. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  38806. }
  38807. ,
  38808. e
  38809. }();
  38810. a.toBase64 = function(e, t) {
  38811. if ("undefined" == typeof e && (e = this.offset),
  38812. "undefined" == typeof t && (t = this.limit),
  38813. e |= 0,
  38814. t |= 0,
  38815. e < 0 || t > this.capacity || e > t)
  38816. throw RangeError("begin, end");
  38817. var n;
  38818. return c.encode(function() {
  38819. return e < t ? this.view[e++] : null
  38820. }
  38821. .bind(this), n = i()),
  38822. n()
  38823. }
  38824. ,
  38825. o.fromBase64 = function(e, i) {
  38826. if ("string" != typeof e)
  38827. throw TypeError("str");
  38828. var n = new o(e.length / 4 * 3,i)
  38829. , r = 0;
  38830. return c.decode(t(e), function(e) {
  38831. n.view[r++] = e
  38832. }),
  38833. n.limit = r,
  38834. n
  38835. }
  38836. ,
  38837. o.btoa = function(e) {
  38838. return o.fromBinary(e).toBase64()
  38839. }
  38840. ,
  38841. o.atob = function(e) {
  38842. return o.fromBase64(e).toBinary()
  38843. }
  38844. ,
  38845. a.toBinary = function(e, t) {
  38846. if ("undefined" == typeof e && (e = this.offset),
  38847. "undefined" == typeof t && (t = this.limit),
  38848. e |= 0,
  38849. t |= 0,
  38850. e < 0 || t > this.capacity() || e > t)
  38851. throw RangeError("begin, end");
  38852. if (e === t)
  38853. return "";
  38854. for (var i = [], n = []; e < t; )
  38855. i.push(this.view[e++]),
  38856. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  38857. i = []);
  38858. return n.join("") + String.fromCharCode.apply(String, i)
  38859. }
  38860. ,
  38861. o.fromBinary = function(e, t) {
  38862. if ("string" != typeof e)
  38863. throw TypeError("str");
  38864. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  38865. if (i = e.charCodeAt(n),
  38866. i > 255)
  38867. throw RangeError("illegal char code: " + i);
  38868. a.view[n++] = i
  38869. }
  38870. return a.limit = r,
  38871. a
  38872. }
  38873. ,
  38874. a.toDebug = function(e) {
  38875. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  38876. if (i !== -1 && (t = this.view[i],
  38877. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  38878. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  38879. ++i,
  38880. e && i > 0 && i % 16 === 0 && i !== n) {
  38881. for (; r.length < 51; )
  38882. r += " ";
  38883. a += r + o + "\n",
  38884. r = o = ""
  38885. }
  38886. 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 ? " " : ""
  38887. }
  38888. if (e && " " !== r) {
  38889. for (; r.length < 51; )
  38890. r += " ";
  38891. a += r + o + "\n"
  38892. }
  38893. return e ? a : r
  38894. }
  38895. ,
  38896. o.fromDebug = function(e, t, i) {
  38897. 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; ) {
  38898. switch (n = e.charAt(l++)) {
  38899. case "!":
  38900. if (!i) {
  38901. if (u || d || p) {
  38902. f = !0;
  38903. break
  38904. }
  38905. u = d = p = !0
  38906. }
  38907. s.offset = s.markedOffset = s.limit = c,
  38908. h = !1;
  38909. break;
  38910. case "|":
  38911. if (!i) {
  38912. if (u || p) {
  38913. f = !0;
  38914. break
  38915. }
  38916. u = p = !0
  38917. }
  38918. s.offset = s.limit = c,
  38919. h = !1;
  38920. break;
  38921. case "[":
  38922. if (!i) {
  38923. if (u || d) {
  38924. f = !0;
  38925. break
  38926. }
  38927. u = d = !0
  38928. }
  38929. s.offset = s.markedOffset = c,
  38930. h = !1;
  38931. break;
  38932. case "<":
  38933. if (!i) {
  38934. if (u) {
  38935. f = !0;
  38936. break
  38937. }
  38938. u = !0
  38939. }
  38940. s.offset = c,
  38941. h = !1;
  38942. break;
  38943. case "]":
  38944. if (!i) {
  38945. if (p || d) {
  38946. f = !0;
  38947. break
  38948. }
  38949. p = d = !0
  38950. }
  38951. s.limit = s.markedOffset = c,
  38952. h = !1;
  38953. break;
  38954. case ">":
  38955. if (!i) {
  38956. if (p) {
  38957. f = !0;
  38958. break
  38959. }
  38960. p = !0
  38961. }
  38962. s.limit = c,
  38963. h = !1;
  38964. break;
  38965. case "'":
  38966. if (!i) {
  38967. if (d) {
  38968. f = !0;
  38969. break
  38970. }
  38971. d = !0
  38972. }
  38973. s.markedOffset = c,
  38974. h = !1;
  38975. break;
  38976. case " ":
  38977. h = !1;
  38978. break;
  38979. default:
  38980. if (!i && h) {
  38981. f = !0;
  38982. break
  38983. }
  38984. if (r = parseInt(n + e.charAt(l++), 16),
  38985. !i && (isNaN(r) || r < 0 || r > 255))
  38986. throw TypeError("Illegal str: Not a debug encoded string");
  38987. s.view[c++] = r,
  38988. h = !0
  38989. }
  38990. if (f)
  38991. throw TypeError("Illegal str: Invalid symbol at " + l)
  38992. }
  38993. if (!i) {
  38994. if (!u || !p)
  38995. throw TypeError("Illegal str: Missing offset or limit");
  38996. if (c < s.buffer.byteLength)
  38997. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  38998. }
  38999. return s
  39000. }
  39001. ,
  39002. a.toHex = function(e, t) {
  39003. if (e = "undefined" == typeof e ? this.offset : e,
  39004. t = "undefined" == typeof t ? this.limit : t,
  39005. !this.noAssert) {
  39006. if ("number" != typeof e || e % 1 !== 0)
  39007. throw TypeError("Illegal begin: Not an integer");
  39008. if (e >>>= 0,
  39009. "number" != typeof t || t % 1 !== 0)
  39010. throw TypeError("Illegal end: Not an integer");
  39011. if (t >>>= 0,
  39012. e < 0 || e > t || t > this.buffer.byteLength)
  39013. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39014. }
  39015. for (var i, n = new Array(t - e); e < t; )
  39016. i = this.view[e++],
  39017. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  39018. return n.join("")
  39019. }
  39020. ,
  39021. o.fromHex = function(e, t, i) {
  39022. if (!i) {
  39023. if ("string" != typeof e)
  39024. throw TypeError("Illegal str: Not a string");
  39025. if (e.length % 2 !== 0)
  39026. throw TypeError("Illegal str: Length not a multiple of 2")
  39027. }
  39028. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  39029. if (n = parseInt(e.substring(s, s + 2), 16),
  39030. !i && (!isFinite(n) || n < 0 || n > 255))
  39031. throw TypeError("Illegal str: Contains non-hex characters");
  39032. a.view[l++] = n
  39033. }
  39034. return a.limit = l,
  39035. a
  39036. }
  39037. ;
  39038. var h = function() {
  39039. var e = {};
  39040. return e.MAX_CODEPOINT = 1114111,
  39041. e.encodeUTF8 = function(e, t) {
  39042. var i = null;
  39043. for ("number" == typeof e && (i = e,
  39044. e = function() {
  39045. return null
  39046. }
  39047. ); null !== i || null !== (i = e()); )
  39048. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  39049. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  39050. t(i >> 6 & 63 | 128),
  39051. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  39052. t(i >> 12 & 63 | 128),
  39053. t(i >> 6 & 63 | 128),
  39054. t(63 & i | 128)),
  39055. i = null
  39056. }
  39057. ,
  39058. e.decodeUTF8 = function(e, t) {
  39059. for (var i, n, r, o, a = function(e) {
  39060. e = e.slice(0, e.indexOf(null));
  39061. var t = Error(e.toString());
  39062. throw t.name = "TruncatedError",
  39063. t.bytes = e,
  39064. t
  39065. }; null !== (i = e()); )
  39066. if (0 === (128 & i))
  39067. t(i);
  39068. else if (192 === (224 & i))
  39069. null === (n = e()) && a([i, n]),
  39070. t((31 & i) << 6 | 63 & n);
  39071. else if (224 === (240 & i))
  39072. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  39073. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  39074. else {
  39075. if (240 !== (248 & i))
  39076. throw RangeError("Illegal starting byte: " + i);
  39077. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  39078. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  39079. }
  39080. }
  39081. ,
  39082. e.UTF16toUTF8 = function(e, t) {
  39083. for (var i, n = null; ; ) {
  39084. if (null === (i = null !== n ? n : e()))
  39085. break;
  39086. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  39087. n = null) : t(i)
  39088. }
  39089. null !== n && t(n)
  39090. }
  39091. ,
  39092. e.UTF8toUTF16 = function(e, t) {
  39093. var i = null;
  39094. for ("number" == typeof e && (i = e,
  39095. e = function() {
  39096. return null
  39097. }
  39098. ); null !== i || null !== (i = e()); )
  39099. i <= 65535 ? t(i) : (i -= 65536,
  39100. t((i >> 10) + 55296),
  39101. t(i % 1024 + 56320)),
  39102. i = null
  39103. }
  39104. ,
  39105. e.encodeUTF16toUTF8 = function(t, i) {
  39106. e.UTF16toUTF8(t, function(t) {
  39107. e.encodeUTF8(t, i)
  39108. })
  39109. }
  39110. ,
  39111. e.decodeUTF8toUTF16 = function(t, i) {
  39112. e.decodeUTF8(t, function(t) {
  39113. e.UTF8toUTF16(t, i)
  39114. })
  39115. }
  39116. ,
  39117. e.calculateCodePoint = function(e) {
  39118. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39119. }
  39120. ,
  39121. e.calculateUTF8 = function(e) {
  39122. for (var t, i = 0; null !== (t = e()); )
  39123. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  39124. return i
  39125. }
  39126. ,
  39127. e.calculateUTF16asUTF8 = function(t) {
  39128. var i = 0
  39129. , n = 0;
  39130. return e.UTF16toUTF8(t, function(e) {
  39131. ++i,
  39132. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  39133. }),
  39134. [i, n]
  39135. }
  39136. ,
  39137. e
  39138. }();
  39139. return a.toUTF8 = function(e, t) {
  39140. if ("undefined" == typeof e && (e = this.offset),
  39141. "undefined" == typeof t && (t = this.limit),
  39142. !this.noAssert) {
  39143. if ("number" != typeof e || e % 1 !== 0)
  39144. throw TypeError("Illegal begin: Not an integer");
  39145. if (e >>>= 0,
  39146. "number" != typeof t || t % 1 !== 0)
  39147. throw TypeError("Illegal end: Not an integer");
  39148. if (t >>>= 0,
  39149. e < 0 || e > t || t > this.buffer.byteLength)
  39150. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  39151. }
  39152. var n;
  39153. try {
  39154. h.decodeUTF8toUTF16(function() {
  39155. return e < t ? this.view[e++] : null
  39156. }
  39157. .bind(this), n = i())
  39158. } catch (i) {
  39159. if (e !== t)
  39160. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  39161. }
  39162. return n()
  39163. }
  39164. ,
  39165. o.fromUTF8 = function(e, i, n) {
  39166. if (!n && "string" != typeof e)
  39167. throw TypeError("Illegal str: Not a string");
  39168. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  39169. , a = 0;
  39170. return h.encodeUTF16toUTF8(t(e), function(e) {
  39171. r.view[a++] = e
  39172. }),
  39173. r.limit = a,
  39174. r
  39175. }
  39176. ,
  39177. o
  39178. })
  39179. }
  39180. , {
  39181. long: 216
  39182. }],
  39183. 216: [function(e, t, i) {
  39184. !function(i, n) {
  39185. "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()
  39186. }(this, function() {
  39187. "use strict";
  39188. function e(e, t, i) {
  39189. this.low = 0 | e,
  39190. this.high = 0 | t,
  39191. this.unsigned = !!i
  39192. }
  39193. function t(e) {
  39194. return (e && e.__isLong__) === !0
  39195. }
  39196. function i(e, t) {
  39197. var i, n, o;
  39198. return t ? (e >>>= 0,
  39199. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  39200. o && (l[e] = i),
  39201. i)) : (e |= 0,
  39202. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  39203. o && (s[e] = i),
  39204. i))
  39205. }
  39206. function n(e, t) {
  39207. if (isNaN(e) || !isFinite(e))
  39208. return t ? m : g;
  39209. if (t) {
  39210. if (e < 0)
  39211. return m;
  39212. if (e >= d)
  39213. return I
  39214. } else {
  39215. if (e <= -p)
  39216. return E;
  39217. if (e + 1 >= p)
  39218. return C
  39219. }
  39220. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  39221. }
  39222. function r(t, i, n) {
  39223. return new e(t,i,n)
  39224. }
  39225. function o(e, t, i) {
  39226. if (0 === e.length)
  39227. throw Error("empty string");
  39228. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  39229. return g;
  39230. if ("number" == typeof t ? (i = t,
  39231. t = !1) : t = !!t,
  39232. i = i || 10,
  39233. i < 2 || 36 < i)
  39234. throw RangeError("radix");
  39235. var r;
  39236. if ((r = e.indexOf("-")) > 0)
  39237. throw Error("interior hyphen");
  39238. if (0 === r)
  39239. return o(e.substring(1), t, i).neg();
  39240. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  39241. var h = Math.min(8, e.length - l)
  39242. , u = parseInt(e.substring(l, l + h), i);
  39243. if (h < 8) {
  39244. var d = n(c(i, h));
  39245. s = s.mul(d).add(n(u))
  39246. } else
  39247. s = s.mul(a),
  39248. s = s.add(n(u))
  39249. }
  39250. return s.unsigned = t,
  39251. s
  39252. }
  39253. function a(t) {
  39254. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  39255. }
  39256. e.prototype.__isLong__,
  39257. Object.defineProperty(e.prototype, "__isLong__", {
  39258. value: !0,
  39259. enumerable: !1,
  39260. configurable: !1
  39261. }),
  39262. e.isLong = t;
  39263. var s = {}
  39264. , l = {};
  39265. e.fromInt = i,
  39266. e.fromNumber = n,
  39267. e.fromBits = r;
  39268. var c = Math.pow;
  39269. e.fromString = o,
  39270. e.fromValue = a;
  39271. var h = 1 << 24
  39272. , u = 4294967296
  39273. , d = 0x10000000000000000
  39274. , p = d / 2
  39275. , f = i(h)
  39276. , g = i(0);
  39277. e.ZERO = g;
  39278. var m = i(0, !0);
  39279. e.UZERO = m;
  39280. var v = i(1);
  39281. e.ONE = v;
  39282. var A = i(1, !0);
  39283. e.UONE = A;
  39284. var y = i(-1);
  39285. e.NEG_ONE = y;
  39286. var C = r(-1, 2147483647, !1);
  39287. e.MAX_VALUE = C;
  39288. var I = r(-1, -1, !0);
  39289. e.MAX_UNSIGNED_VALUE = I;
  39290. var E = r(0, -2147483648, !1);
  39291. e.MIN_VALUE = E;
  39292. var b = e.prototype;
  39293. return b.toInt = function() {
  39294. return this.unsigned ? this.low >>> 0 : this.low
  39295. }
  39296. ,
  39297. b.toNumber = function() {
  39298. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  39299. }
  39300. ,
  39301. b.toString = function(e) {
  39302. if (e = e || 10,
  39303. e < 2 || 36 < e)
  39304. throw RangeError("radix");
  39305. if (this.isZero())
  39306. return "0";
  39307. if (this.isNegative()) {
  39308. if (this.eq(E)) {
  39309. var t = n(e)
  39310. , i = this.div(t)
  39311. , r = i.mul(t).sub(this);
  39312. return i.toString(e) + r.toInt().toString(e)
  39313. }
  39314. return "-" + this.neg().toString(e)
  39315. }
  39316. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  39317. var l = a.div(o)
  39318. , h = a.sub(l.mul(o)).toInt() >>> 0
  39319. , u = h.toString(e);
  39320. if (a = l,
  39321. a.isZero())
  39322. return u + s;
  39323. for (; u.length < 6; )
  39324. u = "0" + u;
  39325. s = "" + u + s
  39326. }
  39327. }
  39328. ,
  39329. b.getHighBits = function() {
  39330. return this.high
  39331. }
  39332. ,
  39333. b.getHighBitsUnsigned = function() {
  39334. return this.high >>> 0
  39335. }
  39336. ,
  39337. b.getLowBits = function() {
  39338. return this.low
  39339. }
  39340. ,
  39341. b.getLowBitsUnsigned = function() {
  39342. return this.low >>> 0
  39343. }
  39344. ,
  39345. b.getNumBitsAbs = function() {
  39346. if (this.isNegative())
  39347. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  39348. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  39349. ;
  39350. return 0 != this.high ? t + 33 : t + 1
  39351. }
  39352. ,
  39353. b.isZero = function() {
  39354. return 0 === this.high && 0 === this.low
  39355. }
  39356. ,
  39357. b.isNegative = function() {
  39358. return !this.unsigned && this.high < 0
  39359. }
  39360. ,
  39361. b.isPositive = function() {
  39362. return this.unsigned || this.high >= 0
  39363. }
  39364. ,
  39365. b.isOdd = function() {
  39366. return 1 === (1 & this.low)
  39367. }
  39368. ,
  39369. b.isEven = function() {
  39370. return 0 === (1 & this.low)
  39371. }
  39372. ,
  39373. b.equals = function(e) {
  39374. return t(e) || (e = a(e)),
  39375. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  39376. }
  39377. ,
  39378. b.eq = b.equals,
  39379. b.notEquals = function(e) {
  39380. return !this.eq(e)
  39381. }
  39382. ,
  39383. b.neq = b.notEquals,
  39384. b.lessThan = function(e) {
  39385. return this.comp(e) < 0
  39386. }
  39387. ,
  39388. b.lt = b.lessThan,
  39389. b.lessThanOrEqual = function(e) {
  39390. return this.comp(e) <= 0
  39391. }
  39392. ,
  39393. b.lte = b.lessThanOrEqual,
  39394. b.greaterThan = function(e) {
  39395. return this.comp(e) > 0
  39396. }
  39397. ,
  39398. b.gt = b.greaterThan,
  39399. b.greaterThanOrEqual = function(e) {
  39400. return this.comp(e) >= 0
  39401. }
  39402. ,
  39403. b.gte = b.greaterThanOrEqual,
  39404. b.compare = function(e) {
  39405. if (t(e) || (e = a(e)),
  39406. this.eq(e))
  39407. return 0;
  39408. var i = this.isNegative()
  39409. , n = e.isNegative();
  39410. 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
  39411. }
  39412. ,
  39413. b.comp = b.compare,
  39414. b.negate = function() {
  39415. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  39416. }
  39417. ,
  39418. b.neg = b.negate,
  39419. b.add = function(e) {
  39420. t(e) || (e = a(e));
  39421. var i = this.high >>> 16
  39422. , n = 65535 & this.high
  39423. , o = this.low >>> 16
  39424. , s = 65535 & this.low
  39425. , l = e.high >>> 16
  39426. , c = 65535 & e.high
  39427. , h = e.low >>> 16
  39428. , u = 65535 & e.low
  39429. , d = 0
  39430. , p = 0
  39431. , f = 0
  39432. , g = 0;
  39433. return g += s + u,
  39434. f += g >>> 16,
  39435. g &= 65535,
  39436. f += o + h,
  39437. p += f >>> 16,
  39438. f &= 65535,
  39439. p += n + c,
  39440. d += p >>> 16,
  39441. p &= 65535,
  39442. d += i + l,
  39443. d &= 65535,
  39444. r(f << 16 | g, d << 16 | p, this.unsigned)
  39445. }
  39446. ,
  39447. b.subtract = function(e) {
  39448. return t(e) || (e = a(e)),
  39449. this.add(e.neg())
  39450. }
  39451. ,
  39452. b.sub = b.subtract,
  39453. b.multiply = function(e) {
  39454. if (this.isZero())
  39455. return g;
  39456. if (t(e) || (e = a(e)),
  39457. e.isZero())
  39458. return g;
  39459. if (this.eq(E))
  39460. return e.isOdd() ? E : g;
  39461. if (e.eq(E))
  39462. return this.isOdd() ? E : g;
  39463. if (this.isNegative())
  39464. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  39465. if (e.isNegative())
  39466. return this.mul(e.neg()).neg();
  39467. if (this.lt(f) && e.lt(f))
  39468. return n(this.toNumber() * e.toNumber(), this.unsigned);
  39469. var i = this.high >>> 16
  39470. , o = 65535 & this.high
  39471. , s = this.low >>> 16
  39472. , l = 65535 & this.low
  39473. , c = e.high >>> 16
  39474. , h = 65535 & e.high
  39475. , u = e.low >>> 16
  39476. , d = 65535 & e.low
  39477. , p = 0
  39478. , m = 0
  39479. , v = 0
  39480. , A = 0;
  39481. return A += l * d,
  39482. v += A >>> 16,
  39483. A &= 65535,
  39484. v += s * d,
  39485. m += v >>> 16,
  39486. v &= 65535,
  39487. v += l * u,
  39488. m += v >>> 16,
  39489. v &= 65535,
  39490. m += o * d,
  39491. p += m >>> 16,
  39492. m &= 65535,
  39493. m += s * u,
  39494. p += m >>> 16,
  39495. m &= 65535,
  39496. m += l * h,
  39497. p += m >>> 16,
  39498. m &= 65535,
  39499. p += i * d + o * u + s * h + l * c,
  39500. p &= 65535,
  39501. r(v << 16 | A, p << 16 | m, this.unsigned)
  39502. }
  39503. ,
  39504. b.mul = b.multiply,
  39505. b.divide = function(e) {
  39506. if (t(e) || (e = a(e)),
  39507. e.isZero())
  39508. throw Error("division by zero");
  39509. if (this.isZero())
  39510. return this.unsigned ? m : g;
  39511. var i, r, o;
  39512. if (this.unsigned) {
  39513. if (e.unsigned || (e = e.toUnsigned()),
  39514. e.gt(this))
  39515. return m;
  39516. if (e.gt(this.shru(1)))
  39517. return A;
  39518. o = m
  39519. } else {
  39520. if (this.eq(E)) {
  39521. if (e.eq(v) || e.eq(y))
  39522. return E;
  39523. if (e.eq(E))
  39524. return v;
  39525. var s = this.shr(1);
  39526. return i = s.div(e).shl(1),
  39527. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  39528. o = i.add(r.div(e)))
  39529. }
  39530. if (e.eq(E))
  39531. return this.unsigned ? m : g;
  39532. if (this.isNegative())
  39533. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  39534. if (e.isNegative())
  39535. return this.div(e.neg()).neg();
  39536. o = g
  39537. }
  39538. for (r = this; r.gte(e); ) {
  39539. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  39540. 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); )
  39541. i -= h,
  39542. u = n(i, this.unsigned),
  39543. d = u.mul(e);
  39544. u.isZero() && (u = v),
  39545. o = o.add(u),
  39546. r = r.sub(d)
  39547. }
  39548. return o
  39549. }
  39550. ,
  39551. b.div = b.divide,
  39552. b.modulo = function(e) {
  39553. return t(e) || (e = a(e)),
  39554. this.sub(this.div(e).mul(e))
  39555. }
  39556. ,
  39557. b.mod = b.modulo,
  39558. b.not = function() {
  39559. return r(~this.low, ~this.high, this.unsigned)
  39560. }
  39561. ,
  39562. b.and = function(e) {
  39563. return t(e) || (e = a(e)),
  39564. r(this.low & e.low, this.high & e.high, this.unsigned)
  39565. }
  39566. ,
  39567. b.or = function(e) {
  39568. return t(e) || (e = a(e)),
  39569. r(this.low | e.low, this.high | e.high, this.unsigned)
  39570. }
  39571. ,
  39572. b.xor = function(e) {
  39573. return t(e) || (e = a(e)),
  39574. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  39575. }
  39576. ,
  39577. b.shiftLeft = function(e) {
  39578. return t(e) && (e = e.toInt()),
  39579. 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)
  39580. }
  39581. ,
  39582. b.shl = b.shiftLeft,
  39583. b.shiftRight = function(e) {
  39584. return t(e) && (e = e.toInt()),
  39585. 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)
  39586. }
  39587. ,
  39588. b.shr = b.shiftRight,
  39589. b.shiftRightUnsigned = function(e) {
  39590. if (t(e) && (e = e.toInt()),
  39591. e &= 63,
  39592. 0 === e)
  39593. return this;
  39594. var i = this.high;
  39595. if (e < 32) {
  39596. var n = this.low;
  39597. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  39598. }
  39599. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  39600. }
  39601. ,
  39602. b.shru = b.shiftRightUnsigned,
  39603. b.toSigned = function() {
  39604. return this.unsigned ? r(this.low, this.high, !1) : this
  39605. }
  39606. ,
  39607. b.toUnsigned = function() {
  39608. return this.unsigned ? this : r(this.low, this.high, !0)
  39609. }
  39610. ,
  39611. b.toBytes = function(e) {
  39612. return e ? this.toBytesLE() : this.toBytesBE()
  39613. }
  39614. ,
  39615. b.toBytesLE = function() {
  39616. var e = this.high
  39617. , t = this.low;
  39618. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  39619. }
  39620. ,
  39621. b.toBytesBE = function() {
  39622. var e = this.high
  39623. , t = this.low;
  39624. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  39625. }
  39626. ,
  39627. e
  39628. })
  39629. }
  39630. , {}],
  39631. 217: [function(e, t, i) {
  39632. var n = {
  39633. REVISION: "75"
  39634. };
  39635. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  39636. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  39637. void 0 === Math.sign && (Math.sign = function(e) {
  39638. return e < 0 ? -1 : e > 0 ? 1 : +e
  39639. }
  39640. ),
  39641. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  39642. get: function() {
  39643. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  39644. }
  39645. }),
  39646. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  39647. writable: !0,
  39648. configurable: !0,
  39649. value: function(e) {
  39650. "use strict";
  39651. if (void 0 === e || null === e)
  39652. throw new TypeError("Cannot convert first argument to object");
  39653. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  39654. var r = arguments[i];
  39655. if (void 0 !== r && null !== r) {
  39656. r = Object(r);
  39657. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  39658. var l = o[a]
  39659. , c = Object.getOwnPropertyDescriptor(r, l);
  39660. void 0 !== c && c.enumerable && (t[l] = r[l])
  39661. }
  39662. }
  39663. }
  39664. return t
  39665. }
  39666. }),
  39667. n.MOUSE = {
  39668. LEFT: 0,
  39669. MIDDLE: 1,
  39670. RIGHT: 2
  39671. },
  39672. n.CullFaceNone = 0,
  39673. n.CullFaceBack = 1,
  39674. n.CullFaceFront = 2,
  39675. n.CullFaceFrontBack = 3,
  39676. n.FrontFaceDirectionCW = 0,
  39677. n.FrontFaceDirectionCCW = 1,
  39678. n.BasicShadowMap = 0,
  39679. n.PCFShadowMap = 1,
  39680. n.PCFSoftShadowMap = 2,
  39681. n.FrontSide = 0,
  39682. n.BackSide = 1,
  39683. n.DoubleSide = 2,
  39684. n.FlatShading = 1,
  39685. n.SmoothShading = 2,
  39686. n.NoColors = 0,
  39687. n.FaceColors = 1,
  39688. n.VertexColors = 2,
  39689. n.NoBlending = 0,
  39690. n.NormalBlending = 1,
  39691. n.AdditiveBlending = 2,
  39692. n.SubtractiveBlending = 3,
  39693. n.MultiplyBlending = 4,
  39694. n.CustomBlending = 5,
  39695. n.AddEquation = 100,
  39696. n.SubtractEquation = 101,
  39697. n.ReverseSubtractEquation = 102,
  39698. n.MinEquation = 103,
  39699. n.MaxEquation = 104,
  39700. n.ZeroFactor = 200,
  39701. n.OneFactor = 201,
  39702. n.SrcColorFactor = 202,
  39703. n.OneMinusSrcColorFactor = 203,
  39704. n.SrcAlphaFactor = 204,
  39705. n.OneMinusSrcAlphaFactor = 205,
  39706. n.DstAlphaFactor = 206,
  39707. n.OneMinusDstAlphaFactor = 207,
  39708. n.DstColorFactor = 208,
  39709. n.OneMinusDstColorFactor = 209,
  39710. n.SrcAlphaSaturateFactor = 210,
  39711. n.NeverDepth = 0,
  39712. n.AlwaysDepth = 1,
  39713. n.LessDepth = 2,
  39714. n.LessEqualDepth = 3,
  39715. n.EqualDepth = 4,
  39716. n.GreaterEqualDepth = 5,
  39717. n.GreaterDepth = 6,
  39718. n.NotEqualDepth = 7,
  39719. n.MultiplyOperation = 0,
  39720. n.MixOperation = 1,
  39721. n.AddOperation = 2,
  39722. n.NoToneMapping = 0,
  39723. n.LinearToneMapping = 1,
  39724. n.ReinhardToneMapping = 2,
  39725. n.Uncharted2ToneMapping = 3,
  39726. n.CineonToneMapping = 4,
  39727. n.UVMapping = 300,
  39728. n.CubeReflectionMapping = 301,
  39729. n.CubeRefractionMapping = 302,
  39730. n.EquirectangularReflectionMapping = 303,
  39731. n.EquirectangularRefractionMapping = 304,
  39732. n.SphericalReflectionMapping = 305,
  39733. n.CubeUVReflectionMapping = 306,
  39734. n.CubeUVRefractionMapping = 307,
  39735. n.RepeatWrapping = 1e3,
  39736. n.ClampToEdgeWrapping = 1001,
  39737. n.MirroredRepeatWrapping = 1002,
  39738. n.NearestFilter = 1003,
  39739. n.NearestMipMapNearestFilter = 1004,
  39740. n.NearestMipMapLinearFilter = 1005,
  39741. n.LinearFilter = 1006,
  39742. n.LinearMipMapNearestFilter = 1007,
  39743. n.LinearMipMapLinearFilter = 1008,
  39744. n.UnsignedByteType = 1009,
  39745. n.ByteType = 1010,
  39746. n.ShortType = 1011,
  39747. n.UnsignedShortType = 1012,
  39748. n.IntType = 1013,
  39749. n.UnsignedIntType = 1014,
  39750. n.FloatType = 1015,
  39751. n.HalfFloatType = 1025,
  39752. n.UnsignedShort4444Type = 1016,
  39753. n.UnsignedShort5551Type = 1017,
  39754. n.UnsignedShort565Type = 1018,
  39755. n.AlphaFormat = 1019,
  39756. n.RGBFormat = 1020,
  39757. n.RGBAFormat = 1021,
  39758. n.LuminanceFormat = 1022,
  39759. n.LuminanceAlphaFormat = 1023,
  39760. n.RGBEFormat = n.RGBAFormat,
  39761. n.RGB_S3TC_DXT1_Format = 2001,
  39762. n.RGBA_S3TC_DXT1_Format = 2002,
  39763. n.RGBA_S3TC_DXT3_Format = 2003,
  39764. n.RGBA_S3TC_DXT5_Format = 2004,
  39765. n.RGB_PVRTC_4BPPV1_Format = 2100,
  39766. n.RGB_PVRTC_2BPPV1_Format = 2101,
  39767. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  39768. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  39769. n.RGB_ETC1_Format = 2151,
  39770. n.LoopOnce = 2200,
  39771. n.LoopRepeat = 2201,
  39772. n.LoopPingPong = 2202,
  39773. n.InterpolateDiscrete = 2300,
  39774. n.InterpolateLinear = 2301,
  39775. n.InterpolateSmooth = 2302,
  39776. n.ZeroCurvatureEnding = 2400,
  39777. n.ZeroSlopeEnding = 2401,
  39778. n.WrapAroundEnding = 2402,
  39779. n.TrianglesDrawMode = 0,
  39780. n.TriangleStripDrawMode = 1,
  39781. n.TriangleFanDrawMode = 2,
  39782. n.LinearEncoding = 3e3,
  39783. n.sRGBEncoding = 3001,
  39784. n.GammaEncoding = 3007,
  39785. n.RGBEEncoding = 3002,
  39786. n.LogLuvEncoding = 3003,
  39787. n.RGBM7Encoding = 3004,
  39788. n.RGBM16Encoding = 3005,
  39789. n.RGBDEncoding = 3006,
  39790. n.Color = function(e) {
  39791. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  39792. }
  39793. ,
  39794. n.Color.prototype = {
  39795. constructor: n.Color,
  39796. r: 1,
  39797. g: 1,
  39798. b: 1,
  39799. set: function(e) {
  39800. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  39801. this
  39802. },
  39803. setScalar: function(e) {
  39804. this.r = e,
  39805. this.g = e,
  39806. this.b = e
  39807. },
  39808. setHex: function(e) {
  39809. return e = Math.floor(e),
  39810. this.r = (e >> 16 & 255) / 255,
  39811. this.g = (e >> 8 & 255) / 255,
  39812. this.b = (255 & e) / 255,
  39813. this
  39814. },
  39815. setRGB: function(e, t, i) {
  39816. return this.r = e,
  39817. this.g = t,
  39818. this.b = i,
  39819. this
  39820. },
  39821. setHSL: function() {
  39822. function e(e, t, i) {
  39823. return i < 0 && (i += 1),
  39824. i > 1 && (i -= 1),
  39825. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  39826. }
  39827. return function(t, i, r) {
  39828. if (t = n.Math.euclideanModulo(t, 1),
  39829. i = n.Math.clamp(i, 0, 1),
  39830. r = n.Math.clamp(r, 0, 1),
  39831. 0 === i)
  39832. this.r = this.g = this.b = r;
  39833. else {
  39834. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  39835. , a = 2 * r - o;
  39836. this.r = e(a, o, t + 1 / 3),
  39837. this.g = e(a, o, t),
  39838. this.b = e(a, o, t - 1 / 3)
  39839. }
  39840. return this
  39841. }
  39842. }(),
  39843. setStyle: function(e) {
  39844. function t(t) {
  39845. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  39846. }
  39847. var i;
  39848. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  39849. var r, o = i[1], a = i[2];
  39850. switch (o) {
  39851. case "rgb":
  39852. case "rgba":
  39853. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39854. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  39855. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  39856. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  39857. t(r[5]),
  39858. this;
  39859. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  39860. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  39861. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  39862. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  39863. t(r[5]),
  39864. this;
  39865. break;
  39866. case "hsl":
  39867. case "hsla":
  39868. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  39869. var s = parseFloat(r[1]) / 360
  39870. , l = parseInt(r[2], 10) / 100
  39871. , c = parseInt(r[3], 10) / 100;
  39872. return t(r[5]),
  39873. this.setHSL(s, l, c)
  39874. }
  39875. }
  39876. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  39877. var h = i[1]
  39878. , u = h.length;
  39879. if (3 === u)
  39880. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  39881. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  39882. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  39883. this;
  39884. if (6 === u)
  39885. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  39886. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  39887. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  39888. this
  39889. }
  39890. if (e && e.length > 0) {
  39891. var h = n.ColorKeywords[e];
  39892. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  39893. }
  39894. return this
  39895. },
  39896. clone: function() {
  39897. return new this.constructor(this.r,this.g,this.b)
  39898. },
  39899. copy: function(e) {
  39900. return this.r = e.r,
  39901. this.g = e.g,
  39902. this.b = e.b,
  39903. this
  39904. },
  39905. copyGammaToLinear: function(e, t) {
  39906. return void 0 === t && (t = 2),
  39907. this.r = Math.pow(e.r, t),
  39908. this.g = Math.pow(e.g, t),
  39909. this.b = Math.pow(e.b, t),
  39910. this
  39911. },
  39912. copyLinearToGamma: function(e, t) {
  39913. void 0 === t && (t = 2);
  39914. var i = t > 0 ? 1 / t : 1;
  39915. return this.r = Math.pow(e.r, i),
  39916. this.g = Math.pow(e.g, i),
  39917. this.b = Math.pow(e.b, i),
  39918. this
  39919. },
  39920. convertGammaToLinear: function() {
  39921. var e = this.r
  39922. , t = this.g
  39923. , i = this.b;
  39924. return this.r = e * e,
  39925. this.g = t * t,
  39926. this.b = i * i,
  39927. this
  39928. },
  39929. convertLinearToGamma: function() {
  39930. return this.r = Math.sqrt(this.r),
  39931. this.g = Math.sqrt(this.g),
  39932. this.b = Math.sqrt(this.b),
  39933. this
  39934. },
  39935. getHex: function() {
  39936. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  39937. },
  39938. getHexString: function() {
  39939. return ("000000" + this.getHex().toString(16)).slice(-6)
  39940. },
  39941. getHSL: function(e) {
  39942. var t, i, n = e || {
  39943. h: 0,
  39944. s: 0,
  39945. l: 0
  39946. }, 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;
  39947. if (l === s)
  39948. t = 0,
  39949. i = 0;
  39950. else {
  39951. var h = s - l;
  39952. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  39953. s) {
  39954. case r:
  39955. t = (o - a) / h + (o < a ? 6 : 0);
  39956. break;
  39957. case o:
  39958. t = (a - r) / h + 2;
  39959. break;
  39960. case a:
  39961. t = (r - o) / h + 4
  39962. }
  39963. t /= 6
  39964. }
  39965. return n.h = t,
  39966. n.s = i,
  39967. n.l = c,
  39968. n
  39969. },
  39970. getStyle: function() {
  39971. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  39972. },
  39973. offsetHSL: function(e, t, i) {
  39974. var n = this.getHSL();
  39975. return n.h += e,
  39976. n.s += t,
  39977. n.l += i,
  39978. this.setHSL(n.h, n.s, n.l),
  39979. this
  39980. },
  39981. add: function(e) {
  39982. return this.r += e.r,
  39983. this.g += e.g,
  39984. this.b += e.b,
  39985. this
  39986. },
  39987. addColors: function(e, t) {
  39988. return this.r = e.r + t.r,
  39989. this.g = e.g + t.g,
  39990. this.b = e.b + t.b,
  39991. this
  39992. },
  39993. addScalar: function(e) {
  39994. return this.r += e,
  39995. this.g += e,
  39996. this.b += e,
  39997. this
  39998. },
  39999. multiply: function(e) {
  40000. return this.r *= e.r,
  40001. this.g *= e.g,
  40002. this.b *= e.b,
  40003. this
  40004. },
  40005. multiplyScalar: function(e) {
  40006. return this.r *= e,
  40007. this.g *= e,
  40008. this.b *= e,
  40009. this
  40010. },
  40011. lerp: function(e, t) {
  40012. return this.r += (e.r - this.r) * t,
  40013. this.g += (e.g - this.g) * t,
  40014. this.b += (e.b - this.b) * t,
  40015. this
  40016. },
  40017. equals: function(e) {
  40018. return e.r === this.r && e.g === this.g && e.b === this.b
  40019. },
  40020. fromArray: function(e, t) {
  40021. return void 0 === t && (t = 0),
  40022. this.r = e[t],
  40023. this.g = e[t + 1],
  40024. this.b = e[t + 2],
  40025. this
  40026. },
  40027. toArray: function(e, t) {
  40028. return void 0 === e && (e = []),
  40029. void 0 === t && (t = 0),
  40030. e[t] = this.r,
  40031. e[t + 1] = this.g,
  40032. e[t + 2] = this.b,
  40033. e
  40034. }
  40035. },
  40036. n.ColorKeywords = {
  40037. aliceblue: 15792383,
  40038. antiquewhite: 16444375,
  40039. aqua: 65535,
  40040. aquamarine: 8388564,
  40041. azure: 15794175,
  40042. beige: 16119260,
  40043. bisque: 16770244,
  40044. black: 0,
  40045. blanchedalmond: 16772045,
  40046. blue: 255,
  40047. blueviolet: 9055202,
  40048. brown: 10824234,
  40049. burlywood: 14596231,
  40050. cadetblue: 6266528,
  40051. chartreuse: 8388352,
  40052. chocolate: 13789470,
  40053. coral: 16744272,
  40054. cornflowerblue: 6591981,
  40055. cornsilk: 16775388,
  40056. crimson: 14423100,
  40057. cyan: 65535,
  40058. darkblue: 139,
  40059. darkcyan: 35723,
  40060. darkgoldenrod: 12092939,
  40061. darkgray: 11119017,
  40062. darkgreen: 25600,
  40063. darkgrey: 11119017,
  40064. darkkhaki: 12433259,
  40065. darkmagenta: 9109643,
  40066. darkolivegreen: 5597999,
  40067. darkorange: 16747520,
  40068. darkorchid: 10040012,
  40069. darkred: 9109504,
  40070. darksalmon: 15308410,
  40071. darkseagreen: 9419919,
  40072. darkslateblue: 4734347,
  40073. darkslategray: 3100495,
  40074. darkslategrey: 3100495,
  40075. darkturquoise: 52945,
  40076. darkviolet: 9699539,
  40077. deeppink: 16716947,
  40078. deepskyblue: 49151,
  40079. dimgray: 6908265,
  40080. dimgrey: 6908265,
  40081. dodgerblue: 2003199,
  40082. firebrick: 11674146,
  40083. floralwhite: 16775920,
  40084. forestgreen: 2263842,
  40085. fuchsia: 16711935,
  40086. gainsboro: 14474460,
  40087. ghostwhite: 16316671,
  40088. gold: 16766720,
  40089. goldenrod: 14329120,
  40090. gray: 8421504,
  40091. green: 32768,
  40092. greenyellow: 11403055,
  40093. grey: 8421504,
  40094. honeydew: 15794160,
  40095. hotpink: 16738740,
  40096. indianred: 13458524,
  40097. indigo: 4915330,
  40098. ivory: 16777200,
  40099. khaki: 15787660,
  40100. lavender: 15132410,
  40101. lavenderblush: 16773365,
  40102. lawngreen: 8190976,
  40103. lemonchiffon: 16775885,
  40104. lightblue: 11393254,
  40105. lightcoral: 15761536,
  40106. lightcyan: 14745599,
  40107. lightgoldenrodyellow: 16448210,
  40108. lightgray: 13882323,
  40109. lightgreen: 9498256,
  40110. lightgrey: 13882323,
  40111. lightpink: 16758465,
  40112. lightsalmon: 16752762,
  40113. lightseagreen: 2142890,
  40114. lightskyblue: 8900346,
  40115. lightslategray: 7833753,
  40116. lightslategrey: 7833753,
  40117. lightsteelblue: 11584734,
  40118. lightyellow: 16777184,
  40119. lime: 65280,
  40120. limegreen: 3329330,
  40121. linen: 16445670,
  40122. magenta: 16711935,
  40123. maroon: 8388608,
  40124. mediumaquamarine: 6737322,
  40125. mediumblue: 205,
  40126. mediumorchid: 12211667,
  40127. mediumpurple: 9662683,
  40128. mediumseagreen: 3978097,
  40129. mediumslateblue: 8087790,
  40130. mediumspringgreen: 64154,
  40131. mediumturquoise: 4772300,
  40132. mediumvioletred: 13047173,
  40133. midnightblue: 1644912,
  40134. mintcream: 16121850,
  40135. mistyrose: 16770273,
  40136. moccasin: 16770229,
  40137. navajowhite: 16768685,
  40138. navy: 128,
  40139. oldlace: 16643558,
  40140. olive: 8421376,
  40141. olivedrab: 7048739,
  40142. orange: 16753920,
  40143. orangered: 16729344,
  40144. orchid: 14315734,
  40145. palegoldenrod: 15657130,
  40146. palegreen: 10025880,
  40147. paleturquoise: 11529966,
  40148. palevioletred: 14381203,
  40149. papayawhip: 16773077,
  40150. peachpuff: 16767673,
  40151. peru: 13468991,
  40152. pink: 16761035,
  40153. plum: 14524637,
  40154. powderblue: 11591910,
  40155. purple: 8388736,
  40156. red: 16711680,
  40157. rosybrown: 12357519,
  40158. royalblue: 4286945,
  40159. saddlebrown: 9127187,
  40160. salmon: 16416882,
  40161. sandybrown: 16032864,
  40162. seagreen: 3050327,
  40163. seashell: 16774638,
  40164. sienna: 10506797,
  40165. silver: 12632256,
  40166. skyblue: 8900331,
  40167. slateblue: 6970061,
  40168. slategray: 7372944,
  40169. slategrey: 7372944,
  40170. snow: 16775930,
  40171. springgreen: 65407,
  40172. steelblue: 4620980,
  40173. tan: 13808780,
  40174. teal: 32896,
  40175. thistle: 14204888,
  40176. tomato: 16737095,
  40177. turquoise: 4251856,
  40178. violet: 15631086,
  40179. wheat: 16113331,
  40180. white: 16777215,
  40181. whitesmoke: 16119285,
  40182. yellow: 16776960,
  40183. yellowgreen: 10145074
  40184. },
  40185. n.Quaternion = function(e, t, i, n) {
  40186. this._x = e || 0,
  40187. this._y = t || 0,
  40188. this._z = i || 0,
  40189. this._w = void 0 !== n ? n : 1
  40190. }
  40191. ,
  40192. n.Quaternion.prototype = {
  40193. constructor: n.Quaternion,
  40194. get x() {
  40195. return this._x
  40196. },
  40197. set x(e) {
  40198. this._x = e,
  40199. this.onChangeCallback()
  40200. },
  40201. get y() {
  40202. return this._y
  40203. },
  40204. set y(e) {
  40205. this._y = e,
  40206. this.onChangeCallback()
  40207. },
  40208. get z() {
  40209. return this._z
  40210. },
  40211. set z(e) {
  40212. this._z = e,
  40213. this.onChangeCallback()
  40214. },
  40215. get w() {
  40216. return this._w
  40217. },
  40218. set w(e) {
  40219. this._w = e,
  40220. this.onChangeCallback()
  40221. },
  40222. set: function(e, t, i, n) {
  40223. return this._x = e,
  40224. this._y = t,
  40225. this._z = i,
  40226. this._w = n,
  40227. this.onChangeCallback(),
  40228. this
  40229. },
  40230. clone: function() {
  40231. return new this.constructor(this._x,this._y,this._z,this._w)
  40232. },
  40233. copy: function(e) {
  40234. return this._x = e.x,
  40235. this._y = e.y,
  40236. this._z = e.z,
  40237. this._w = e.w,
  40238. this.onChangeCallback(),
  40239. this
  40240. },
  40241. setFromEuler: function(e, t) {
  40242. if (e instanceof n.Euler == !1)
  40243. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  40244. var i = Math.cos(e._x / 2)
  40245. , r = Math.cos(e._y / 2)
  40246. , o = Math.cos(e._z / 2)
  40247. , a = Math.sin(e._x / 2)
  40248. , s = Math.sin(e._y / 2)
  40249. , l = Math.sin(e._z / 2)
  40250. , c = e.order;
  40251. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  40252. this._y = i * s * o - a * r * l,
  40253. this._z = i * r * l + a * s * o,
  40254. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  40255. this._y = i * s * o - a * r * l,
  40256. this._z = i * r * l - a * s * o,
  40257. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  40258. this._y = i * s * o + a * r * l,
  40259. this._z = i * r * l + a * s * o,
  40260. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  40261. this._y = i * s * o + a * r * l,
  40262. this._z = i * r * l - a * s * o,
  40263. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  40264. this._y = i * s * o + a * r * l,
  40265. this._z = i * r * l - a * s * o,
  40266. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  40267. this._y = i * s * o - a * r * l,
  40268. this._z = i * r * l + a * s * o,
  40269. this._w = i * r * o + a * s * l),
  40270. t !== !1 && this.onChangeCallback(),
  40271. this
  40272. },
  40273. setFromAxisAngle: function(e, t) {
  40274. var i = t / 2
  40275. , n = Math.sin(i);
  40276. return this._x = e.x * n,
  40277. this._y = e.y * n,
  40278. this._z = e.z * n,
  40279. this._w = Math.cos(i),
  40280. this.onChangeCallback(),
  40281. this
  40282. },
  40283. setFromRotationMatrix: function(e) {
  40284. 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;
  40285. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  40286. this._w = .25 / t,
  40287. this._x = (h - l) * t,
  40288. this._y = (o - c) * t,
  40289. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  40290. this._w = (h - l) / t,
  40291. this._x = .25 * t,
  40292. this._y = (r + a) / t,
  40293. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  40294. this._w = (o - c) / t,
  40295. this._x = (r + a) / t,
  40296. this._y = .25 * t,
  40297. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  40298. this._w = (a - r) / t,
  40299. this._x = (o + c) / t,
  40300. this._y = (l + h) / t,
  40301. this._z = .25 * t),
  40302. this.onChangeCallback(),
  40303. this
  40304. },
  40305. setFromUnitVectors: function() {
  40306. var e, t, i = 1e-6;
  40307. return function(r, o) {
  40308. return void 0 === e && (e = new n.Vector3),
  40309. t = r.dot(o) + 1,
  40310. t < i ? (t = 0,
  40311. 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),
  40312. this._x = e.x,
  40313. this._y = e.y,
  40314. this._z = e.z,
  40315. this._w = t,
  40316. this.normalize(),
  40317. this
  40318. }
  40319. }(),
  40320. inverse: function() {
  40321. return this.conjugate().normalize(),
  40322. this
  40323. },
  40324. conjugate: function() {
  40325. return this._x *= -1,
  40326. this._y *= -1,
  40327. this._z *= -1,
  40328. this.onChangeCallback(),
  40329. this
  40330. },
  40331. dot: function(e) {
  40332. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  40333. },
  40334. lengthSq: function() {
  40335. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  40336. },
  40337. length: function() {
  40338. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  40339. },
  40340. normalize: function() {
  40341. var e = this.length();
  40342. return 0 === e ? (this._x = 0,
  40343. this._y = 0,
  40344. this._z = 0,
  40345. this._w = 1) : (e = 1 / e,
  40346. this._x = this._x * e,
  40347. this._y = this._y * e,
  40348. this._z = this._z * e,
  40349. this._w = this._w * e),
  40350. this.onChangeCallback(),
  40351. this
  40352. },
  40353. multiply: function(e, t) {
  40354. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  40355. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  40356. },
  40357. multiplyQuaternions: function(e, t) {
  40358. var i = e._x
  40359. , n = e._y
  40360. , r = e._z
  40361. , o = e._w
  40362. , a = t._x
  40363. , s = t._y
  40364. , l = t._z
  40365. , c = t._w;
  40366. return this._x = i * c + o * a + n * l - r * s,
  40367. this._y = n * c + o * s + r * a - i * l,
  40368. this._z = r * c + o * l + i * s - n * a,
  40369. this._w = o * c - i * a - n * s - r * l,
  40370. this.onChangeCallback(),
  40371. this
  40372. },
  40373. slerp: function(e, t) {
  40374. if (0 === t)
  40375. return this;
  40376. if (1 === t)
  40377. return this.copy(e);
  40378. var i = this._x
  40379. , n = this._y
  40380. , r = this._z
  40381. , o = this._w
  40382. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  40383. if (a < 0 ? (this._w = -e._w,
  40384. this._x = -e._x,
  40385. this._y = -e._y,
  40386. this._z = -e._z,
  40387. a = -a) : this.copy(e),
  40388. a >= 1)
  40389. return this._w = o,
  40390. this._x = i,
  40391. this._y = n,
  40392. this._z = r,
  40393. this;
  40394. var s = Math.sqrt(1 - a * a);
  40395. if (Math.abs(s) < .001)
  40396. return this._w = .5 * (o + this._w),
  40397. this._x = .5 * (i + this._x),
  40398. this._y = .5 * (n + this._y),
  40399. this._z = .5 * (r + this._z),
  40400. this;
  40401. var l = Math.atan2(s, a)
  40402. , c = Math.sin((1 - t) * l) / s
  40403. , h = Math.sin(t * l) / s;
  40404. return this._w = o * c + this._w * h,
  40405. this._x = i * c + this._x * h,
  40406. this._y = n * c + this._y * h,
  40407. this._z = r * c + this._z * h,
  40408. this.onChangeCallback(),
  40409. this
  40410. },
  40411. equals: function(e) {
  40412. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  40413. },
  40414. fromArray: function(e, t) {
  40415. return void 0 === t && (t = 0),
  40416. this._x = e[t],
  40417. this._y = e[t + 1],
  40418. this._z = e[t + 2],
  40419. this._w = e[t + 3],
  40420. this.onChangeCallback(),
  40421. this
  40422. },
  40423. toArray: function(e, t) {
  40424. return void 0 === e && (e = []),
  40425. void 0 === t && (t = 0),
  40426. e[t] = this._x,
  40427. e[t + 1] = this._y,
  40428. e[t + 2] = this._z,
  40429. e[t + 3] = this._w,
  40430. e
  40431. },
  40432. onChange: function(e) {
  40433. return this.onChangeCallback = e,
  40434. this
  40435. },
  40436. onChangeCallback: function() {}
  40437. },
  40438. Object.assign(n.Quaternion, {
  40439. slerp: function(e, t, i, n) {
  40440. return i.copy(e).slerp(t, n)
  40441. },
  40442. slerpFlat: function(e, t, i, n, r, o, a) {
  40443. var s = i[n + 0]
  40444. , l = i[n + 1]
  40445. , c = i[n + 2]
  40446. , h = i[n + 3]
  40447. , u = r[o + 0]
  40448. , d = r[o + 1]
  40449. , p = r[o + 2]
  40450. , f = r[o + 3];
  40451. if (h !== f || s !== u || l !== d || c !== p) {
  40452. var g = 1 - a
  40453. , m = s * u + l * d + c * p + h * f
  40454. , v = m >= 0 ? 1 : -1
  40455. , A = 1 - m * m;
  40456. if (A > Number.EPSILON) {
  40457. var y = Math.sqrt(A)
  40458. , C = Math.atan2(y, m * v);
  40459. g = Math.sin(g * C) / y,
  40460. a = Math.sin(a * C) / y
  40461. }
  40462. var I = a * v;
  40463. if (s = s * g + u * I,
  40464. l = l * g + d * I,
  40465. c = c * g + p * I,
  40466. h = h * g + f * I,
  40467. g === 1 - a) {
  40468. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  40469. s *= E,
  40470. l *= E,
  40471. c *= E,
  40472. h *= E
  40473. }
  40474. }
  40475. e[t] = s,
  40476. e[t + 1] = l,
  40477. e[t + 2] = c,
  40478. e[t + 3] = h
  40479. }
  40480. }),
  40481. n.Vector2 = function(e, t) {
  40482. this.x = e || 0,
  40483. this.y = t || 0
  40484. }
  40485. ,
  40486. n.Vector2.prototype = {
  40487. constructor: n.Vector2,
  40488. get width() {
  40489. return this.x
  40490. },
  40491. set width(e) {
  40492. this.x = e
  40493. },
  40494. get height() {
  40495. return this.y
  40496. },
  40497. set height(e) {
  40498. this.y = e
  40499. },
  40500. set: function(e, t) {
  40501. return this.x = e,
  40502. this.y = t,
  40503. this
  40504. },
  40505. setScalar: function(e) {
  40506. return this.x = e,
  40507. this.y = e,
  40508. this
  40509. },
  40510. setX: function(e) {
  40511. return this.x = e,
  40512. this
  40513. },
  40514. setY: function(e) {
  40515. return this.y = e,
  40516. this
  40517. },
  40518. setComponent: function(e, t) {
  40519. switch (e) {
  40520. case 0:
  40521. this.x = t;
  40522. break;
  40523. case 1:
  40524. this.y = t;
  40525. break;
  40526. default:
  40527. throw new Error("index is out of range: " + e)
  40528. }
  40529. },
  40530. getComponent: function(e) {
  40531. switch (e) {
  40532. case 0:
  40533. return this.x;
  40534. case 1:
  40535. return this.y;
  40536. default:
  40537. throw new Error("index is out of range: " + e)
  40538. }
  40539. },
  40540. clone: function() {
  40541. return new this.constructor(this.x,this.y)
  40542. },
  40543. copy: function(e) {
  40544. return this.x = e.x,
  40545. this.y = e.y,
  40546. this
  40547. },
  40548. add: function(e, t) {
  40549. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40550. this.addVectors(e, t)) : (this.x += e.x,
  40551. this.y += e.y,
  40552. this)
  40553. },
  40554. addScalar: function(e) {
  40555. return this.x += e,
  40556. this.y += e,
  40557. this
  40558. },
  40559. addVectors: function(e, t) {
  40560. return this.x = e.x + t.x,
  40561. this.y = e.y + t.y,
  40562. this
  40563. },
  40564. addScaledVector: function(e, t) {
  40565. return this.x += e.x * t,
  40566. this.y += e.y * t,
  40567. this
  40568. },
  40569. sub: function(e, t) {
  40570. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40571. this.subVectors(e, t)) : (this.x -= e.x,
  40572. this.y -= e.y,
  40573. this)
  40574. },
  40575. subScalar: function(e) {
  40576. return this.x -= e,
  40577. this.y -= e,
  40578. this
  40579. },
  40580. subVectors: function(e, t) {
  40581. return this.x = e.x - t.x,
  40582. this.y = e.y - t.y,
  40583. this
  40584. },
  40585. multiply: function(e) {
  40586. return this.x *= e.x,
  40587. this.y *= e.y,
  40588. this
  40589. },
  40590. multiplyScalar: function(e) {
  40591. return isFinite(e) ? (this.x *= e,
  40592. this.y *= e) : (this.x = 0,
  40593. this.y = 0),
  40594. this
  40595. },
  40596. divide: function(e) {
  40597. return this.x /= e.x,
  40598. this.y /= e.y,
  40599. this
  40600. },
  40601. divideScalar: function(e) {
  40602. return this.multiplyScalar(1 / e)
  40603. },
  40604. min: function(e) {
  40605. return this.x = Math.min(this.x, e.x),
  40606. this.y = Math.min(this.y, e.y),
  40607. this
  40608. },
  40609. max: function(e) {
  40610. return this.x = Math.max(this.x, e.x),
  40611. this.y = Math.max(this.y, e.y),
  40612. this
  40613. },
  40614. clamp: function(e, t) {
  40615. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40616. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40617. this
  40618. },
  40619. clampScalar: function() {
  40620. var e, t;
  40621. return function(i, r) {
  40622. return void 0 === e && (e = new n.Vector2,
  40623. t = new n.Vector2),
  40624. e.set(i, i),
  40625. t.set(r, r),
  40626. this.clamp(e, t)
  40627. }
  40628. }(),
  40629. clampLength: function(e, t) {
  40630. var i = this.length();
  40631. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40632. this
  40633. },
  40634. floor: function() {
  40635. return this.x = Math.floor(this.x),
  40636. this.y = Math.floor(this.y),
  40637. this
  40638. },
  40639. ceil: function() {
  40640. return this.x = Math.ceil(this.x),
  40641. this.y = Math.ceil(this.y),
  40642. this
  40643. },
  40644. round: function() {
  40645. return this.x = Math.round(this.x),
  40646. this.y = Math.round(this.y),
  40647. this
  40648. },
  40649. roundToZero: function() {
  40650. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  40651. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  40652. this
  40653. },
  40654. negate: function() {
  40655. return this.x = -this.x,
  40656. this.y = -this.y,
  40657. this
  40658. },
  40659. dot: function(e) {
  40660. return this.x * e.x + this.y * e.y
  40661. },
  40662. lengthSq: function() {
  40663. return this.x * this.x + this.y * this.y
  40664. },
  40665. length: function() {
  40666. return Math.sqrt(this.x * this.x + this.y * this.y)
  40667. },
  40668. lengthManhattan: function() {
  40669. return Math.abs(this.x) + Math.abs(this.y)
  40670. },
  40671. normalize: function() {
  40672. return this.divideScalar(this.length())
  40673. },
  40674. angle: function() {
  40675. var e = Math.atan2(this.y, this.x);
  40676. return e < 0 && (e += 2 * Math.PI),
  40677. e
  40678. },
  40679. distanceTo: function(e) {
  40680. return Math.sqrt(this.distanceToSquared(e))
  40681. },
  40682. distanceToSquared: function(e) {
  40683. var t = this.x - e.x
  40684. , i = this.y - e.y;
  40685. return t * t + i * i
  40686. },
  40687. setLength: function(e) {
  40688. return this.multiplyScalar(e / this.length())
  40689. },
  40690. lerp: function(e, t) {
  40691. return this.x += (e.x - this.x) * t,
  40692. this.y += (e.y - this.y) * t,
  40693. this
  40694. },
  40695. lerpVectors: function(e, t, i) {
  40696. return this.subVectors(t, e).multiplyScalar(i).add(e),
  40697. this
  40698. },
  40699. equals: function(e) {
  40700. return e.x === this.x && e.y === this.y
  40701. },
  40702. fromArray: function(e, t) {
  40703. return void 0 === t && (t = 0),
  40704. this.x = e[t],
  40705. this.y = e[t + 1],
  40706. this
  40707. },
  40708. toArray: function(e, t) {
  40709. return void 0 === e && (e = []),
  40710. void 0 === t && (t = 0),
  40711. e[t] = this.x,
  40712. e[t + 1] = this.y,
  40713. e
  40714. },
  40715. fromAttribute: function(e, t, i) {
  40716. return void 0 === i && (i = 0),
  40717. t = t * e.itemSize + i,
  40718. this.x = e.array[t],
  40719. this.y = e.array[t + 1],
  40720. this
  40721. },
  40722. rotateAround: function(e, t) {
  40723. var i = Math.cos(t)
  40724. , n = Math.sin(t)
  40725. , r = this.x - e.x
  40726. , o = this.y - e.y;
  40727. return this.x = r * i - o * n + e.x,
  40728. this.y = r * n + o * i + e.y,
  40729. this
  40730. }
  40731. },
  40732. n.Vector3 = function(e, t, i) {
  40733. this.x = e || 0,
  40734. this.y = t || 0,
  40735. this.z = i || 0
  40736. }
  40737. ,
  40738. n.Vector3.prototype = {
  40739. constructor: n.Vector3,
  40740. set: function(e, t, i) {
  40741. return this.x = e,
  40742. this.y = t,
  40743. this.z = i,
  40744. this
  40745. },
  40746. setScalar: function(e) {
  40747. return this.x = e,
  40748. this.y = e,
  40749. this.z = e,
  40750. this
  40751. },
  40752. setX: function(e) {
  40753. return this.x = e,
  40754. this
  40755. },
  40756. setY: function(e) {
  40757. return this.y = e,
  40758. this
  40759. },
  40760. setZ: function(e) {
  40761. return this.z = e,
  40762. this
  40763. },
  40764. setComponent: function(e, t) {
  40765. switch (e) {
  40766. case 0:
  40767. this.x = t;
  40768. break;
  40769. case 1:
  40770. this.y = t;
  40771. break;
  40772. case 2:
  40773. this.z = t;
  40774. break;
  40775. default:
  40776. throw new Error("index is out of range: " + e)
  40777. }
  40778. },
  40779. getComponent: function(e) {
  40780. switch (e) {
  40781. case 0:
  40782. return this.x;
  40783. case 1:
  40784. return this.y;
  40785. case 2:
  40786. return this.z;
  40787. default:
  40788. throw new Error("index is out of range: " + e)
  40789. }
  40790. },
  40791. clone: function() {
  40792. return new this.constructor(this.x,this.y,this.z)
  40793. },
  40794. copy: function(e) {
  40795. return this.x = e.x,
  40796. this.y = e.y,
  40797. this.z = e.z,
  40798. this
  40799. },
  40800. add: function(e, t) {
  40801. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  40802. this.addVectors(e, t)) : (this.x += e.x,
  40803. this.y += e.y,
  40804. this.z += e.z,
  40805. this)
  40806. },
  40807. addScalar: function(e) {
  40808. return this.x += e,
  40809. this.y += e,
  40810. this.z += e,
  40811. this
  40812. },
  40813. addVectors: function(e, t) {
  40814. return this.x = e.x + t.x,
  40815. this.y = e.y + t.y,
  40816. this.z = e.z + t.z,
  40817. this
  40818. },
  40819. addScaledVector: function(e, t) {
  40820. return this.x += e.x * t,
  40821. this.y += e.y * t,
  40822. this.z += e.z * t,
  40823. this
  40824. },
  40825. sub: function(e, t) {
  40826. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  40827. this.subVectors(e, t)) : (this.x -= e.x,
  40828. this.y -= e.y,
  40829. this.z -= e.z,
  40830. this)
  40831. },
  40832. subScalar: function(e) {
  40833. return this.x -= e,
  40834. this.y -= e,
  40835. this.z -= e,
  40836. this
  40837. },
  40838. subVectors: function(e, t) {
  40839. return this.x = e.x - t.x,
  40840. this.y = e.y - t.y,
  40841. this.z = e.z - t.z,
  40842. this
  40843. },
  40844. multiply: function(e, t) {
  40845. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  40846. this.multiplyVectors(e, t)) : (this.x *= e.x,
  40847. this.y *= e.y,
  40848. this.z *= e.z,
  40849. this)
  40850. },
  40851. multiplyScalar: function(e) {
  40852. return isFinite(e) ? (this.x *= e,
  40853. this.y *= e,
  40854. this.z *= e) : (this.x = 0,
  40855. this.y = 0,
  40856. this.z = 0),
  40857. this
  40858. },
  40859. multiplyVectors: function(e, t) {
  40860. return this.x = e.x * t.x,
  40861. this.y = e.y * t.y,
  40862. this.z = e.z * t.z,
  40863. this
  40864. },
  40865. applyEuler: function() {
  40866. var e;
  40867. return function(t) {
  40868. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  40869. void 0 === e && (e = new n.Quaternion),
  40870. this.applyQuaternion(e.setFromEuler(t)),
  40871. this
  40872. }
  40873. }(),
  40874. applyAxisAngle: function() {
  40875. var e;
  40876. return function(t, i) {
  40877. return void 0 === e && (e = new n.Quaternion),
  40878. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  40879. this
  40880. }
  40881. }(),
  40882. applyMatrix3: function(e) {
  40883. var t = this.x
  40884. , i = this.y
  40885. , n = this.z
  40886. , r = e.elements;
  40887. return this.x = r[0] * t + r[3] * i + r[6] * n,
  40888. this.y = r[1] * t + r[4] * i + r[7] * n,
  40889. this.z = r[2] * t + r[5] * i + r[8] * n,
  40890. this
  40891. },
  40892. applyMatrix4: function(e) {
  40893. var t = this.x
  40894. , i = this.y
  40895. , n = this.z
  40896. , r = e.elements;
  40897. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  40898. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  40899. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  40900. this
  40901. },
  40902. applyProjection: function(e) {
  40903. var t = this.x
  40904. , i = this.y
  40905. , n = this.z
  40906. , r = e.elements
  40907. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  40908. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  40909. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  40910. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  40911. this
  40912. },
  40913. applyQuaternion: function(e) {
  40914. var t = this.x
  40915. , i = this.y
  40916. , n = this.z
  40917. , r = e.x
  40918. , o = e.y
  40919. , a = e.z
  40920. , s = e.w
  40921. , l = s * t + o * n - a * i
  40922. , c = s * i + a * t - r * n
  40923. , h = s * n + r * i - o * t
  40924. , u = -r * t - o * i - a * n;
  40925. return this.x = l * s + u * -r + c * -a - h * -o,
  40926. this.y = c * s + u * -o + h * -r - l * -a,
  40927. this.z = h * s + u * -a + l * -o - c * -r,
  40928. this
  40929. },
  40930. project: function() {
  40931. var e;
  40932. return function(t) {
  40933. return void 0 === e && (e = new n.Matrix4),
  40934. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  40935. this.applyProjection(e)
  40936. }
  40937. }(),
  40938. unproject: function() {
  40939. var e;
  40940. return function(t) {
  40941. return void 0 === e && (e = new n.Matrix4),
  40942. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  40943. this.applyProjection(e)
  40944. }
  40945. }(),
  40946. transformDirection: function(e) {
  40947. var t = this.x
  40948. , i = this.y
  40949. , n = this.z
  40950. , r = e.elements;
  40951. return this.x = r[0] * t + r[4] * i + r[8] * n,
  40952. this.y = r[1] * t + r[5] * i + r[9] * n,
  40953. this.z = r[2] * t + r[6] * i + r[10] * n,
  40954. this.normalize(),
  40955. this
  40956. },
  40957. divide: function(e) {
  40958. return this.x /= e.x,
  40959. this.y /= e.y,
  40960. this.z /= e.z,
  40961. this
  40962. },
  40963. divideScalar: function(e) {
  40964. return this.multiplyScalar(1 / e)
  40965. },
  40966. min: function(e) {
  40967. return this.x = Math.min(this.x, e.x),
  40968. this.y = Math.min(this.y, e.y),
  40969. this.z = Math.min(this.z, e.z),
  40970. this
  40971. },
  40972. max: function(e) {
  40973. return this.x = Math.max(this.x, e.x),
  40974. this.y = Math.max(this.y, e.y),
  40975. this.z = Math.max(this.z, e.z),
  40976. this
  40977. },
  40978. clamp: function(e, t) {
  40979. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  40980. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  40981. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  40982. this
  40983. },
  40984. clampScalar: function() {
  40985. var e, t;
  40986. return function(i, r) {
  40987. return void 0 === e && (e = new n.Vector3,
  40988. t = new n.Vector3),
  40989. e.set(i, i, i),
  40990. t.set(r, r, r),
  40991. this.clamp(e, t)
  40992. }
  40993. }(),
  40994. clampLength: function(e, t) {
  40995. var i = this.length();
  40996. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  40997. this
  40998. },
  40999. floor: function() {
  41000. return this.x = Math.floor(this.x),
  41001. this.y = Math.floor(this.y),
  41002. this.z = Math.floor(this.z),
  41003. this
  41004. },
  41005. ceil: function() {
  41006. return this.x = Math.ceil(this.x),
  41007. this.y = Math.ceil(this.y),
  41008. this.z = Math.ceil(this.z),
  41009. this
  41010. },
  41011. round: function() {
  41012. return this.x = Math.round(this.x),
  41013. this.y = Math.round(this.y),
  41014. this.z = Math.round(this.z),
  41015. this
  41016. },
  41017. roundToZero: function() {
  41018. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41019. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41020. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41021. this
  41022. },
  41023. negate: function() {
  41024. return this.x = -this.x,
  41025. this.y = -this.y,
  41026. this.z = -this.z,
  41027. this
  41028. },
  41029. dot: function(e) {
  41030. return this.x * e.x + this.y * e.y + this.z * e.z
  41031. },
  41032. lengthSq: function() {
  41033. return this.x * this.x + this.y * this.y + this.z * this.z
  41034. },
  41035. length: function() {
  41036. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  41037. },
  41038. lengthManhattan: function() {
  41039. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  41040. },
  41041. normalize: function() {
  41042. return this.divideScalar(this.length())
  41043. },
  41044. setLength: function(e) {
  41045. return this.multiplyScalar(e / this.length())
  41046. },
  41047. lerp: function(e, t) {
  41048. return this.x += (e.x - this.x) * t,
  41049. this.y += (e.y - this.y) * t,
  41050. this.z += (e.z - this.z) * t,
  41051. this
  41052. },
  41053. lerpVectors: function(e, t, i) {
  41054. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41055. this
  41056. },
  41057. cross: function(e, t) {
  41058. if (void 0 !== t)
  41059. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  41060. this.crossVectors(e, t);
  41061. var i = this.x
  41062. , n = this.y
  41063. , r = this.z;
  41064. return this.x = n * e.z - r * e.y,
  41065. this.y = r * e.x - i * e.z,
  41066. this.z = i * e.y - n * e.x,
  41067. this
  41068. },
  41069. crossVectors: function(e, t) {
  41070. var i = e.x
  41071. , n = e.y
  41072. , r = e.z
  41073. , o = t.x
  41074. , a = t.y
  41075. , s = t.z;
  41076. return this.x = n * s - r * a,
  41077. this.y = r * o - i * s,
  41078. this.z = i * a - n * o,
  41079. this
  41080. },
  41081. projectOnVector: function() {
  41082. var e, t;
  41083. return function(i) {
  41084. return void 0 === e && (e = new n.Vector3),
  41085. e.copy(i).normalize(),
  41086. t = this.dot(e),
  41087. this.copy(e).multiplyScalar(t)
  41088. }
  41089. }(),
  41090. projectOnPlane: function() {
  41091. var e;
  41092. return function(t) {
  41093. return void 0 === e && (e = new n.Vector3),
  41094. e.copy(this).projectOnVector(t),
  41095. this.sub(e)
  41096. }
  41097. }(),
  41098. reflect: function() {
  41099. var e;
  41100. return function(t) {
  41101. return void 0 === e && (e = new n.Vector3),
  41102. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  41103. }
  41104. }(),
  41105. angleTo: function(e) {
  41106. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  41107. return Math.acos(n.Math.clamp(t, -1, 1))
  41108. },
  41109. distanceTo: function(e) {
  41110. return Math.sqrt(this.distanceToSquared(e))
  41111. },
  41112. distanceToSquared: function(e) {
  41113. var t = this.x - e.x
  41114. , i = this.y - e.y
  41115. , n = this.z - e.z;
  41116. return t * t + i * i + n * n
  41117. },
  41118. setFromSpherical: function(e) {
  41119. var t = Math.sin(e.phi) * e.radius;
  41120. return this.x = t * Math.sin(e.theta),
  41121. this.y = Math.cos(e.phi) * e.radius,
  41122. this.z = t * Math.cos(e.theta),
  41123. this
  41124. },
  41125. setFromMatrixPosition: function(e) {
  41126. return this.setFromMatrixColumn(e, 3)
  41127. },
  41128. setFromMatrixScale: function(e) {
  41129. var t = this.setFromMatrixColumn(e, 0).length()
  41130. , i = this.setFromMatrixColumn(e, 1).length()
  41131. , n = this.setFromMatrixColumn(e, 2).length();
  41132. return this.x = t,
  41133. this.y = i,
  41134. this.z = n,
  41135. this
  41136. },
  41137. setFromMatrixColumn: function(e, t) {
  41138. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  41139. e = arguments[1],
  41140. t = arguments[0]),
  41141. this.fromArray(e.elements, 4 * t)
  41142. },
  41143. equals: function(e) {
  41144. return e.x === this.x && e.y === this.y && e.z === this.z
  41145. },
  41146. fromArray: function(e, t) {
  41147. return void 0 === t && (t = 0),
  41148. this.x = e[t],
  41149. this.y = e[t + 1],
  41150. this.z = e[t + 2],
  41151. this
  41152. },
  41153. toArray: function(e, t) {
  41154. return void 0 === e && (e = []),
  41155. void 0 === t && (t = 0),
  41156. e[t] = this.x,
  41157. e[t + 1] = this.y,
  41158. e[t + 2] = this.z,
  41159. e
  41160. },
  41161. fromAttribute: function(e, t, i) {
  41162. return void 0 === i && (i = 0),
  41163. t = t * e.itemSize + i,
  41164. this.x = e.array[t],
  41165. this.y = e.array[t + 1],
  41166. this.z = e.array[t + 2],
  41167. this
  41168. }
  41169. },
  41170. n.Vector4 = function(e, t, i, n) {
  41171. this.x = e || 0,
  41172. this.y = t || 0,
  41173. this.z = i || 0,
  41174. this.w = void 0 !== n ? n : 1
  41175. }
  41176. ,
  41177. n.Vector4.prototype = {
  41178. constructor: n.Vector4,
  41179. set: function(e, t, i, n) {
  41180. return this.x = e,
  41181. this.y = t,
  41182. this.z = i,
  41183. this.w = n,
  41184. this
  41185. },
  41186. setScalar: function(e) {
  41187. return this.x = e,
  41188. this.y = e,
  41189. this.z = e,
  41190. this.w = e,
  41191. this
  41192. },
  41193. setX: function(e) {
  41194. return this.x = e,
  41195. this
  41196. },
  41197. setY: function(e) {
  41198. return this.y = e,
  41199. this
  41200. },
  41201. setZ: function(e) {
  41202. return this.z = e,
  41203. this
  41204. },
  41205. setW: function(e) {
  41206. return this.w = e,
  41207. this
  41208. },
  41209. setComponent: function(e, t) {
  41210. switch (e) {
  41211. case 0:
  41212. this.x = t;
  41213. break;
  41214. case 1:
  41215. this.y = t;
  41216. break;
  41217. case 2:
  41218. this.z = t;
  41219. break;
  41220. case 3:
  41221. this.w = t;
  41222. break;
  41223. default:
  41224. throw new Error("index is out of range: " + e)
  41225. }
  41226. },
  41227. getComponent: function(e) {
  41228. switch (e) {
  41229. case 0:
  41230. return this.x;
  41231. case 1:
  41232. return this.y;
  41233. case 2:
  41234. return this.z;
  41235. case 3:
  41236. return this.w;
  41237. default:
  41238. throw new Error("index is out of range: " + e)
  41239. }
  41240. },
  41241. clone: function() {
  41242. return new this.constructor(this.x,this.y,this.z,this.w)
  41243. },
  41244. copy: function(e) {
  41245. return this.x = e.x,
  41246. this.y = e.y,
  41247. this.z = e.z,
  41248. this.w = void 0 !== e.w ? e.w : 1,
  41249. this
  41250. },
  41251. add: function(e, t) {
  41252. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  41253. this.addVectors(e, t)) : (this.x += e.x,
  41254. this.y += e.y,
  41255. this.z += e.z,
  41256. this.w += e.w,
  41257. this)
  41258. },
  41259. addScalar: function(e) {
  41260. return this.x += e,
  41261. this.y += e,
  41262. this.z += e,
  41263. this.w += e,
  41264. this
  41265. },
  41266. addVectors: function(e, t) {
  41267. return this.x = e.x + t.x,
  41268. this.y = e.y + t.y,
  41269. this.z = e.z + t.z,
  41270. this.w = e.w + t.w,
  41271. this
  41272. },
  41273. addScaledVector: function(e, t) {
  41274. return this.x += e.x * t,
  41275. this.y += e.y * t,
  41276. this.z += e.z * t,
  41277. this.w += e.w * t,
  41278. this
  41279. },
  41280. sub: function(e, t) {
  41281. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  41282. this.subVectors(e, t)) : (this.x -= e.x,
  41283. this.y -= e.y,
  41284. this.z -= e.z,
  41285. this.w -= e.w,
  41286. this)
  41287. },
  41288. subScalar: function(e) {
  41289. return this.x -= e,
  41290. this.y -= e,
  41291. this.z -= e,
  41292. this.w -= e,
  41293. this
  41294. },
  41295. subVectors: function(e, t) {
  41296. return this.x = e.x - t.x,
  41297. this.y = e.y - t.y,
  41298. this.z = e.z - t.z,
  41299. this.w = e.w - t.w,
  41300. this
  41301. },
  41302. multiplyScalar: function(e) {
  41303. return isFinite(e) ? (this.x *= e,
  41304. this.y *= e,
  41305. this.z *= e,
  41306. this.w *= e) : (this.x = 0,
  41307. this.y = 0,
  41308. this.z = 0,
  41309. this.w = 0),
  41310. this
  41311. },
  41312. applyMatrix4: function(e) {
  41313. var t = this.x
  41314. , i = this.y
  41315. , n = this.z
  41316. , r = this.w
  41317. , o = e.elements;
  41318. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  41319. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  41320. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  41321. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  41322. this
  41323. },
  41324. divideScalar: function(e) {
  41325. return this.multiplyScalar(1 / e)
  41326. },
  41327. setAxisAngleFromQuaternion: function(e) {
  41328. this.w = 2 * Math.acos(e.w);
  41329. var t = Math.sqrt(1 - e.w * e.w);
  41330. return t < 1e-4 ? (this.x = 1,
  41331. this.y = 0,
  41332. this.z = 0) : (this.x = e.x / t,
  41333. this.y = e.y / t,
  41334. this.z = e.z / t),
  41335. this
  41336. },
  41337. setAxisAngleFromRotationMatrix: function(e) {
  41338. 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];
  41339. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  41340. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  41341. return this.set(1, 0, 0, 0),
  41342. this;
  41343. t = Math.PI;
  41344. var v = (l + 1) / 2
  41345. , A = (d + 1) / 2
  41346. , y = (m + 1) / 2
  41347. , C = (c + u) / 4
  41348. , I = (h + f) / 4
  41349. , E = (p + g) / 4;
  41350. return v > A && v > y ? v < o ? (i = 0,
  41351. n = .707106781,
  41352. r = .707106781) : (i = Math.sqrt(v),
  41353. n = C / i,
  41354. r = I / i) : A > y ? A < o ? (i = .707106781,
  41355. n = 0,
  41356. r = .707106781) : (n = Math.sqrt(A),
  41357. i = C / n,
  41358. r = E / n) : y < o ? (i = .707106781,
  41359. n = .707106781,
  41360. r = 0) : (r = Math.sqrt(y),
  41361. i = I / r,
  41362. n = E / r),
  41363. this.set(i, n, r, t),
  41364. this
  41365. }
  41366. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  41367. return Math.abs(b) < .001 && (b = 1),
  41368. this.x = (g - p) / b,
  41369. this.y = (h - f) / b,
  41370. this.z = (u - c) / b,
  41371. this.w = Math.acos((l + d + m - 1) / 2),
  41372. this
  41373. },
  41374. min: function(e) {
  41375. return this.x = Math.min(this.x, e.x),
  41376. this.y = Math.min(this.y, e.y),
  41377. this.z = Math.min(this.z, e.z),
  41378. this.w = Math.min(this.w, e.w),
  41379. this
  41380. },
  41381. max: function(e) {
  41382. return this.x = Math.max(this.x, e.x),
  41383. this.y = Math.max(this.y, e.y),
  41384. this.z = Math.max(this.z, e.z),
  41385. this.w = Math.max(this.w, e.w),
  41386. this
  41387. },
  41388. clamp: function(e, t) {
  41389. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  41390. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  41391. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  41392. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  41393. this
  41394. },
  41395. clampScalar: function() {
  41396. var e, t;
  41397. return function(i, r) {
  41398. return void 0 === e && (e = new n.Vector4,
  41399. t = new n.Vector4),
  41400. e.set(i, i, i, i),
  41401. t.set(r, r, r, r),
  41402. this.clamp(e, t)
  41403. }
  41404. }(),
  41405. floor: function() {
  41406. return this.x = Math.floor(this.x),
  41407. this.y = Math.floor(this.y),
  41408. this.z = Math.floor(this.z),
  41409. this.w = Math.floor(this.w),
  41410. this
  41411. },
  41412. ceil: function() {
  41413. return this.x = Math.ceil(this.x),
  41414. this.y = Math.ceil(this.y),
  41415. this.z = Math.ceil(this.z),
  41416. this.w = Math.ceil(this.w),
  41417. this
  41418. },
  41419. round: function() {
  41420. return this.x = Math.round(this.x),
  41421. this.y = Math.round(this.y),
  41422. this.z = Math.round(this.z),
  41423. this.w = Math.round(this.w),
  41424. this
  41425. },
  41426. roundToZero: function() {
  41427. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  41428. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  41429. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  41430. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  41431. this
  41432. },
  41433. negate: function() {
  41434. return this.x = -this.x,
  41435. this.y = -this.y,
  41436. this.z = -this.z,
  41437. this.w = -this.w,
  41438. this
  41439. },
  41440. dot: function(e) {
  41441. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  41442. },
  41443. lengthSq: function() {
  41444. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  41445. },
  41446. length: function() {
  41447. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  41448. },
  41449. lengthManhattan: function() {
  41450. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  41451. },
  41452. normalize: function() {
  41453. return this.divideScalar(this.length())
  41454. },
  41455. setLength: function(e) {
  41456. return this.multiplyScalar(e / this.length())
  41457. },
  41458. lerp: function(e, t) {
  41459. return this.x += (e.x - this.x) * t,
  41460. this.y += (e.y - this.y) * t,
  41461. this.z += (e.z - this.z) * t,
  41462. this.w += (e.w - this.w) * t,
  41463. this
  41464. },
  41465. lerpVectors: function(e, t, i) {
  41466. return this.subVectors(t, e).multiplyScalar(i).add(e),
  41467. this
  41468. },
  41469. equals: function(e) {
  41470. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  41471. },
  41472. fromArray: function(e, t) {
  41473. return void 0 === t && (t = 0),
  41474. this.x = e[t],
  41475. this.y = e[t + 1],
  41476. this.z = e[t + 2],
  41477. this.w = e[t + 3],
  41478. this
  41479. },
  41480. toArray: function(e, t) {
  41481. return void 0 === e && (e = []),
  41482. void 0 === t && (t = 0),
  41483. e[t] = this.x,
  41484. e[t + 1] = this.y,
  41485. e[t + 2] = this.z,
  41486. e[t + 3] = this.w,
  41487. e
  41488. },
  41489. fromAttribute: function(e, t, i) {
  41490. return void 0 === i && (i = 0),
  41491. t = t * e.itemSize + i,
  41492. this.x = e.array[t],
  41493. this.y = e.array[t + 1],
  41494. this.z = e.array[t + 2],
  41495. this.w = e.array[t + 3],
  41496. this
  41497. }
  41498. },
  41499. n.Euler = function(e, t, i, r) {
  41500. this._x = e || 0,
  41501. this._y = t || 0,
  41502. this._z = i || 0,
  41503. this._order = r || n.Euler.DefaultOrder
  41504. }
  41505. ,
  41506. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  41507. n.Euler.DefaultOrder = "XYZ",
  41508. n.Euler.prototype = {
  41509. constructor: n.Euler,
  41510. get x() {
  41511. return this._x
  41512. },
  41513. set x(e) {
  41514. this._x = e,
  41515. this.onChangeCallback()
  41516. },
  41517. get y() {
  41518. return this._y
  41519. },
  41520. set y(e) {
  41521. this._y = e,
  41522. this.onChangeCallback()
  41523. },
  41524. get z() {
  41525. return this._z
  41526. },
  41527. set z(e) {
  41528. this._z = e,
  41529. this.onChangeCallback()
  41530. },
  41531. get order() {
  41532. return this._order
  41533. },
  41534. set order(e) {
  41535. this._order = e,
  41536. this.onChangeCallback()
  41537. },
  41538. set: function(e, t, i, n) {
  41539. return this._x = e,
  41540. this._y = t,
  41541. this._z = i,
  41542. this._order = n || this._order,
  41543. this.onChangeCallback(),
  41544. this
  41545. },
  41546. clone: function() {
  41547. return new this.constructor(this._x,this._y,this._z,this._order)
  41548. },
  41549. copy: function(e) {
  41550. return this._x = e._x,
  41551. this._y = e._y,
  41552. this._z = e._z,
  41553. this._order = e._order,
  41554. this.onChangeCallback(),
  41555. this
  41556. },
  41557. setFromRotationMatrix: function(e, t, i) {
  41558. var r = n.Math.clamp
  41559. , o = e.elements
  41560. , a = o[0]
  41561. , s = o[4]
  41562. , l = o[8]
  41563. , c = o[1]
  41564. , h = o[5]
  41565. , u = o[9]
  41566. , d = o[2]
  41567. , p = o[6]
  41568. , f = o[10];
  41569. return t = t || this._order,
  41570. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  41571. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  41572. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  41573. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  41574. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  41575. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  41576. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  41577. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  41578. this._z = Math.atan2(-s, h)) : (this._y = 0,
  41579. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  41580. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  41581. this._z = Math.atan2(c, a)) : (this._x = 0,
  41582. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  41583. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  41584. this._y = Math.atan2(-d, a)) : (this._x = 0,
  41585. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  41586. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  41587. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  41588. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  41589. this._order = t,
  41590. i !== !1 && this.onChangeCallback(),
  41591. this
  41592. },
  41593. setFromQuaternion: function() {
  41594. var e;
  41595. return function(t, i, r) {
  41596. return void 0 === e && (e = new n.Matrix4),
  41597. e.makeRotationFromQuaternion(t),
  41598. this.setFromRotationMatrix(e, i, r),
  41599. this
  41600. }
  41601. }(),
  41602. setFromVector3: function(e, t) {
  41603. return this.set(e.x, e.y, e.z, t || this._order)
  41604. },
  41605. reorder: function() {
  41606. var e = new n.Quaternion;
  41607. return function(t) {
  41608. e.setFromEuler(this),
  41609. this.setFromQuaternion(e, t)
  41610. }
  41611. }(),
  41612. equals: function(e) {
  41613. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  41614. },
  41615. fromArray: function(e) {
  41616. return this._x = e[0],
  41617. this._y = e[1],
  41618. this._z = e[2],
  41619. void 0 !== e[3] && (this._order = e[3]),
  41620. this.onChangeCallback(),
  41621. this
  41622. },
  41623. toArray: function(e, t) {
  41624. return void 0 === e && (e = []),
  41625. void 0 === t && (t = 0),
  41626. e[t] = this._x,
  41627. e[t + 1] = this._y,
  41628. e[t + 2] = this._z,
  41629. e[t + 3] = this._order,
  41630. e
  41631. },
  41632. toVector3: function(e) {
  41633. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  41634. },
  41635. onChange: function(e) {
  41636. return this.onChangeCallback = e,
  41637. this
  41638. },
  41639. onChangeCallback: function() {}
  41640. },
  41641. n.Line3 = function(e, t) {
  41642. this.start = void 0 !== e ? e : new n.Vector3,
  41643. this.end = void 0 !== t ? t : new n.Vector3
  41644. }
  41645. ,
  41646. n.Line3.prototype = {
  41647. constructor: n.Line3,
  41648. set: function(e, t) {
  41649. return this.start.copy(e),
  41650. this.end.copy(t),
  41651. this
  41652. },
  41653. clone: function() {
  41654. return (new this.constructor).copy(this)
  41655. },
  41656. copy: function(e) {
  41657. return this.start.copy(e.start),
  41658. this.end.copy(e.end),
  41659. this
  41660. },
  41661. center: function(e) {
  41662. var t = e || new n.Vector3;
  41663. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  41664. },
  41665. delta: function(e) {
  41666. var t = e || new n.Vector3;
  41667. return t.subVectors(this.end, this.start)
  41668. },
  41669. distanceSq: function() {
  41670. return this.start.distanceToSquared(this.end)
  41671. },
  41672. distance: function() {
  41673. return this.start.distanceTo(this.end)
  41674. },
  41675. at: function(e, t) {
  41676. var i = t || new n.Vector3;
  41677. return this.delta(i).multiplyScalar(e).add(this.start)
  41678. },
  41679. closestPointToPointParameter: function() {
  41680. var e = new n.Vector3
  41681. , t = new n.Vector3;
  41682. return function(i, r) {
  41683. e.subVectors(i, this.start),
  41684. t.subVectors(this.end, this.start);
  41685. var o = t.dot(t)
  41686. , a = t.dot(e)
  41687. , s = a / o;
  41688. return r && (s = n.Math.clamp(s, 0, 1)),
  41689. s
  41690. }
  41691. }(),
  41692. closestPointToPoint: function(e, t, i) {
  41693. var r = this.closestPointToPointParameter(e, t)
  41694. , o = i || new n.Vector3;
  41695. return this.delta(o).multiplyScalar(r).add(this.start)
  41696. },
  41697. applyMatrix4: function(e) {
  41698. return this.start.applyMatrix4(e),
  41699. this.end.applyMatrix4(e),
  41700. this
  41701. },
  41702. equals: function(e) {
  41703. return e.start.equals(this.start) && e.end.equals(this.end)
  41704. }
  41705. },
  41706. n.Box2 = function(e, t) {
  41707. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  41708. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  41709. }
  41710. ,
  41711. n.Box2.prototype = {
  41712. constructor: n.Box2,
  41713. set: function(e, t) {
  41714. return this.min.copy(e),
  41715. this.max.copy(t),
  41716. this
  41717. },
  41718. setFromPoints: function(e) {
  41719. this.makeEmpty();
  41720. for (var t = 0, i = e.length; t < i; t++)
  41721. this.expandByPoint(e[t]);
  41722. return this
  41723. },
  41724. setFromCenterAndSize: function() {
  41725. var e = new n.Vector2;
  41726. return function(t, i) {
  41727. var n = e.copy(i).multiplyScalar(.5);
  41728. return this.min.copy(t).sub(n),
  41729. this.max.copy(t).add(n),
  41730. this
  41731. }
  41732. }(),
  41733. clone: function() {
  41734. return (new this.constructor).copy(this)
  41735. },
  41736. copy: function(e) {
  41737. return this.min.copy(e.min),
  41738. this.max.copy(e.max),
  41739. this
  41740. },
  41741. makeEmpty: function() {
  41742. return this.min.x = this.min.y = +(1 / 0),
  41743. this.max.x = this.max.y = -(1 / 0),
  41744. this
  41745. },
  41746. isEmpty: function() {
  41747. return this.max.x < this.min.x || this.max.y < this.min.y
  41748. },
  41749. center: function(e) {
  41750. var t = e || new n.Vector2;
  41751. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41752. },
  41753. size: function(e) {
  41754. var t = e || new n.Vector2;
  41755. return t.subVectors(this.max, this.min)
  41756. },
  41757. expandByPoint: function(e) {
  41758. return this.min.min(e),
  41759. this.max.max(e),
  41760. this
  41761. },
  41762. expandByVector: function(e) {
  41763. return this.min.sub(e),
  41764. this.max.add(e),
  41765. this
  41766. },
  41767. expandByScalar: function(e) {
  41768. return this.min.addScalar(-e),
  41769. this.max.addScalar(e),
  41770. this
  41771. },
  41772. containsPoint: function(e) {
  41773. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  41774. },
  41775. containsBox: function(e) {
  41776. 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
  41777. },
  41778. getParameter: function(e, t) {
  41779. var i = t || new n.Vector2;
  41780. 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))
  41781. },
  41782. intersectsBox: function(e) {
  41783. 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)
  41784. },
  41785. clampPoint: function(e, t) {
  41786. var i = t || new n.Vector2;
  41787. return i.copy(e).clamp(this.min, this.max)
  41788. },
  41789. distanceToPoint: function() {
  41790. var e = new n.Vector2;
  41791. return function(t) {
  41792. var i = e.copy(t).clamp(this.min, this.max);
  41793. return i.sub(t).length()
  41794. }
  41795. }(),
  41796. intersect: function(e) {
  41797. return this.min.max(e.min),
  41798. this.max.min(e.max),
  41799. this
  41800. },
  41801. union: function(e) {
  41802. return this.min.min(e.min),
  41803. this.max.max(e.max),
  41804. this
  41805. },
  41806. translate: function(e) {
  41807. return this.min.add(e),
  41808. this.max.add(e),
  41809. this
  41810. },
  41811. equals: function(e) {
  41812. return e.min.equals(this.min) && e.max.equals(this.max)
  41813. }
  41814. },
  41815. n.Box3 = function(e, t) {
  41816. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  41817. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  41818. }
  41819. ,
  41820. n.Box3.prototype = {
  41821. constructor: n.Box3,
  41822. set: function(e, t) {
  41823. return this.min.copy(e),
  41824. this.max.copy(t),
  41825. this
  41826. },
  41827. setFromArray: function(e) {
  41828. this.makeEmpty();
  41829. 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) {
  41830. var c = e[s]
  41831. , h = e[s + 1]
  41832. , u = e[s + 2];
  41833. c < t && (t = c),
  41834. h < i && (i = h),
  41835. u < n && (n = u),
  41836. c > r && (r = c),
  41837. h > o && (o = h),
  41838. u > a && (a = u)
  41839. }
  41840. this.min.set(t, i, n),
  41841. this.max.set(r, o, a)
  41842. },
  41843. setFromPoints: function(e) {
  41844. this.makeEmpty();
  41845. for (var t = 0, i = e.length; t < i; t++)
  41846. this.expandByPoint(e[t]);
  41847. return this
  41848. },
  41849. setFromCenterAndSize: function() {
  41850. var e = new n.Vector3;
  41851. return function(t, i) {
  41852. var n = e.copy(i).multiplyScalar(.5);
  41853. return this.min.copy(t).sub(n),
  41854. this.max.copy(t).add(n),
  41855. this
  41856. }
  41857. }(),
  41858. setFromObject: function() {
  41859. var e;
  41860. return function(t) {
  41861. void 0 === e && (e = new n.Box3);
  41862. var i = this;
  41863. return this.makeEmpty(),
  41864. t.updateMatrixWorld(!0),
  41865. t.traverse(function(t) {
  41866. var n = t.geometry;
  41867. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  41868. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  41869. e.applyMatrix4(t.matrixWorld),
  41870. i.union(e)))
  41871. }),
  41872. this
  41873. }
  41874. }(),
  41875. clone: function() {
  41876. return (new this.constructor).copy(this)
  41877. },
  41878. copy: function(e) {
  41879. return this.min.copy(e.min),
  41880. this.max.copy(e.max),
  41881. this
  41882. },
  41883. makeEmpty: function() {
  41884. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  41885. this.max.x = this.max.y = this.max.z = -(1 / 0),
  41886. this
  41887. },
  41888. isEmpty: function() {
  41889. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  41890. },
  41891. center: function(e) {
  41892. var t = e || new n.Vector3;
  41893. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  41894. },
  41895. size: function(e) {
  41896. var t = e || new n.Vector3;
  41897. return t.subVectors(this.max, this.min)
  41898. },
  41899. expandByPoint: function(e) {
  41900. return this.min.min(e),
  41901. this.max.max(e),
  41902. this
  41903. },
  41904. expandByVector: function(e) {
  41905. return this.min.sub(e),
  41906. this.max.add(e),
  41907. this
  41908. },
  41909. expandByScalar: function(e) {
  41910. return this.min.addScalar(-e),
  41911. this.max.addScalar(e),
  41912. this
  41913. },
  41914. containsPoint: function(e) {
  41915. 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)
  41916. },
  41917. containsBox: function(e) {
  41918. 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
  41919. },
  41920. getParameter: function(e, t) {
  41921. var i = t || new n.Vector3;
  41922. 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))
  41923. },
  41924. intersectsBox: function(e) {
  41925. 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)
  41926. },
  41927. intersectsSphere: function() {
  41928. var e;
  41929. return function(t) {
  41930. return void 0 === e && (e = new n.Vector3),
  41931. this.clampPoint(t.center, e),
  41932. e.distanceToSquared(t.center) <= t.radius * t.radius
  41933. }
  41934. }(),
  41935. intersectsPlane: function(e) {
  41936. var t, i;
  41937. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  41938. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  41939. i = e.normal.x * this.min.x),
  41940. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  41941. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  41942. i += e.normal.y * this.min.y),
  41943. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  41944. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  41945. i += e.normal.z * this.min.z),
  41946. t <= e.constant && i >= e.constant
  41947. },
  41948. clampPoint: function(e, t) {
  41949. var i = t || new n.Vector3;
  41950. return i.copy(e).clamp(this.min, this.max)
  41951. },
  41952. distanceToPoint: function() {
  41953. var e = new n.Vector3;
  41954. return function(t) {
  41955. var i = e.copy(t).clamp(this.min, this.max);
  41956. return i.sub(t).length()
  41957. }
  41958. }(),
  41959. getBoundingSphere: function() {
  41960. var e = new n.Vector3;
  41961. return function(t) {
  41962. var i = t || new n.Sphere;
  41963. return i.center = this.center(),
  41964. i.radius = .5 * this.size(e).length(),
  41965. i
  41966. }
  41967. }(),
  41968. intersect: function(e) {
  41969. return this.min.max(e.min),
  41970. this.max.min(e.max),
  41971. this
  41972. },
  41973. union: function(e) {
  41974. return this.min.min(e.min),
  41975. this.max.max(e.max),
  41976. this
  41977. },
  41978. applyMatrix4: function() {
  41979. 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];
  41980. return function(t) {
  41981. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  41982. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  41983. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  41984. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  41985. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  41986. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  41987. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  41988. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  41989. this.makeEmpty(),
  41990. this.setFromPoints(e),
  41991. this
  41992. }
  41993. }(),
  41994. translate: function(e) {
  41995. return this.min.add(e),
  41996. this.max.add(e),
  41997. this
  41998. },
  41999. equals: function(e) {
  42000. return e.min.equals(this.min) && e.max.equals(this.max)
  42001. }
  42002. },
  42003. n.Matrix3 = function() {
  42004. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  42005. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  42006. }
  42007. ,
  42008. n.Matrix3.prototype = {
  42009. constructor: n.Matrix3,
  42010. set: function(e, t, i, n, r, o, a, s, l) {
  42011. var c = this.elements;
  42012. return c[0] = e,
  42013. c[1] = n,
  42014. c[2] = a,
  42015. c[3] = t,
  42016. c[4] = r,
  42017. c[5] = s,
  42018. c[6] = i,
  42019. c[7] = o,
  42020. c[8] = l,
  42021. this
  42022. },
  42023. identity: function() {
  42024. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  42025. this
  42026. },
  42027. clone: function() {
  42028. return (new this.constructor).fromArray(this.elements)
  42029. },
  42030. copy: function(e) {
  42031. var t = e.elements;
  42032. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  42033. this
  42034. },
  42035. setFromMatrix4: function(e) {
  42036. var t = e.elements;
  42037. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  42038. this
  42039. },
  42040. applyToVector3Array: function() {
  42041. var e;
  42042. return function(t, i, r) {
  42043. void 0 === e && (e = new n.Vector3),
  42044. void 0 === i && (i = 0),
  42045. void 0 === r && (r = t.length);
  42046. for (var o = 0, a = i; o < r; o += 3,
  42047. a += 3)
  42048. e.fromArray(t, a),
  42049. e.applyMatrix3(this),
  42050. e.toArray(t, a);
  42051. return t
  42052. }
  42053. }(),
  42054. applyToBuffer: function() {
  42055. var e;
  42056. return function(t, i, r) {
  42057. void 0 === e && (e = new n.Vector3),
  42058. void 0 === i && (i = 0),
  42059. void 0 === r && (r = t.length / t.itemSize);
  42060. for (var o = 0, a = i; o < r; o++,
  42061. a++)
  42062. e.x = t.getX(a),
  42063. e.y = t.getY(a),
  42064. e.z = t.getZ(a),
  42065. e.applyMatrix3(this),
  42066. t.setXYZ(e.x, e.y, e.z);
  42067. return t
  42068. }
  42069. }(),
  42070. multiplyScalar: function(e) {
  42071. var t = this.elements;
  42072. return t[0] *= e,
  42073. t[3] *= e,
  42074. t[6] *= e,
  42075. t[1] *= e,
  42076. t[4] *= e,
  42077. t[7] *= e,
  42078. t[2] *= e,
  42079. t[5] *= e,
  42080. t[8] *= e,
  42081. this
  42082. },
  42083. determinant: function() {
  42084. var e = this.elements
  42085. , t = e[0]
  42086. , i = e[1]
  42087. , n = e[2]
  42088. , r = e[3]
  42089. , o = e[4]
  42090. , a = e[5]
  42091. , s = e[6]
  42092. , l = e[7]
  42093. , c = e[8];
  42094. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  42095. },
  42096. getInverse: function(e, t) {
  42097. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  42098. var i = e.elements
  42099. , r = this.elements
  42100. , o = i[0]
  42101. , a = i[1]
  42102. , s = i[2]
  42103. , l = i[3]
  42104. , c = i[4]
  42105. , h = i[5]
  42106. , u = i[6]
  42107. , d = i[7]
  42108. , p = i[8]
  42109. , f = p * c - h * d
  42110. , g = h * u - p * l
  42111. , m = d * l - c * u
  42112. , v = o * f + a * g + s * m;
  42113. if (0 === v) {
  42114. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  42115. if (t)
  42116. throw new Error(A);
  42117. return console.warn(A),
  42118. this.identity()
  42119. }
  42120. return r[0] = f,
  42121. r[1] = s * d - p * a,
  42122. r[2] = h * a - s * c,
  42123. r[3] = g,
  42124. r[4] = p * o - s * u,
  42125. r[5] = s * l - h * o,
  42126. r[6] = m,
  42127. r[7] = a * u - d * o,
  42128. r[8] = c * o - a * l,
  42129. this.multiplyScalar(1 / v)
  42130. },
  42131. transpose: function() {
  42132. var e, t = this.elements;
  42133. return e = t[1],
  42134. t[1] = t[3],
  42135. t[3] = e,
  42136. e = t[2],
  42137. t[2] = t[6],
  42138. t[6] = e,
  42139. e = t[5],
  42140. t[5] = t[7],
  42141. t[7] = e,
  42142. this
  42143. },
  42144. flattenToArrayOffset: function(e, t) {
  42145. var i = this.elements;
  42146. return e[t] = i[0],
  42147. e[t + 1] = i[1],
  42148. e[t + 2] = i[2],
  42149. e[t + 3] = i[3],
  42150. e[t + 4] = i[4],
  42151. e[t + 5] = i[5],
  42152. e[t + 6] = i[6],
  42153. e[t + 7] = i[7],
  42154. e[t + 8] = i[8],
  42155. e
  42156. },
  42157. getNormalMatrix: function(e) {
  42158. return this.setFromMatrix4(e).getInverse(this).transpose()
  42159. },
  42160. transposeIntoArray: function(e) {
  42161. var t = this.elements;
  42162. return e[0] = t[0],
  42163. e[1] = t[3],
  42164. e[2] = t[6],
  42165. e[3] = t[1],
  42166. e[4] = t[4],
  42167. e[5] = t[7],
  42168. e[6] = t[2],
  42169. e[7] = t[5],
  42170. e[8] = t[8],
  42171. this
  42172. },
  42173. fromArray: function(e) {
  42174. return this.elements.set(e),
  42175. this
  42176. },
  42177. toArray: function() {
  42178. var e = this.elements;
  42179. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  42180. }
  42181. },
  42182. n.Matrix4 = function() {
  42183. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  42184. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  42185. }
  42186. ,
  42187. n.Matrix4.prototype = {
  42188. constructor: n.Matrix4,
  42189. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  42190. var m = this.elements;
  42191. return m[0] = e,
  42192. m[4] = t,
  42193. m[8] = i,
  42194. m[12] = n,
  42195. m[1] = r,
  42196. m[5] = o,
  42197. m[9] = a,
  42198. m[13] = s,
  42199. m[2] = l,
  42200. m[6] = c,
  42201. m[10] = h,
  42202. m[14] = u,
  42203. m[3] = d,
  42204. m[7] = p,
  42205. m[11] = f,
  42206. m[15] = g,
  42207. this
  42208. },
  42209. identity: function() {
  42210. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42211. this
  42212. },
  42213. clone: function() {
  42214. return (new n.Matrix4).fromArray(this.elements)
  42215. },
  42216. copy: function(e) {
  42217. return this.elements.set(e.elements),
  42218. this
  42219. },
  42220. copyPosition: function(e) {
  42221. var t = this.elements
  42222. , i = e.elements;
  42223. return t[12] = i[12],
  42224. t[13] = i[13],
  42225. t[14] = i[14],
  42226. this
  42227. },
  42228. extractBasis: function(e, t, i) {
  42229. return e.setFromMatrixColumn(this, 0),
  42230. t.setFromMatrixColumn(this, 1),
  42231. i.setFromMatrixColumn(this, 2),
  42232. this
  42233. },
  42234. makeBasis: function(e, t, i) {
  42235. 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),
  42236. this
  42237. },
  42238. extractRotation: function() {
  42239. var e;
  42240. return function(t) {
  42241. void 0 === e && (e = new n.Vector3);
  42242. var i = this.elements
  42243. , r = t.elements
  42244. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  42245. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  42246. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  42247. return i[0] = r[0] * o,
  42248. i[1] = r[1] * o,
  42249. i[2] = r[2] * o,
  42250. i[4] = r[4] * a,
  42251. i[5] = r[5] * a,
  42252. i[6] = r[6] * a,
  42253. i[8] = r[8] * s,
  42254. i[9] = r[9] * s,
  42255. i[10] = r[10] * s,
  42256. this
  42257. }
  42258. }(),
  42259. makeRotationFromEuler: function(e) {
  42260. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  42261. var t = this.elements
  42262. , i = e.x
  42263. , r = e.y
  42264. , o = e.z
  42265. , a = Math.cos(i)
  42266. , s = Math.sin(i)
  42267. , l = Math.cos(r)
  42268. , c = Math.sin(r)
  42269. , h = Math.cos(o)
  42270. , u = Math.sin(o);
  42271. if ("XYZ" === e.order) {
  42272. var d = a * h
  42273. , p = a * u
  42274. , f = s * h
  42275. , g = s * u;
  42276. t[0] = l * h,
  42277. t[4] = -l * u,
  42278. t[8] = c,
  42279. t[1] = p + f * c,
  42280. t[5] = d - g * c,
  42281. t[9] = -s * l,
  42282. t[2] = g - d * c,
  42283. t[6] = f + p * c,
  42284. t[10] = a * l
  42285. } else if ("YXZ" === e.order) {
  42286. var m = l * h
  42287. , v = l * u
  42288. , A = c * h
  42289. , y = c * u;
  42290. t[0] = m + y * s,
  42291. t[4] = A * s - v,
  42292. t[8] = a * c,
  42293. t[1] = a * u,
  42294. t[5] = a * h,
  42295. t[9] = -s,
  42296. t[2] = v * s - A,
  42297. t[6] = y + m * s,
  42298. t[10] = a * l
  42299. } else if ("ZXY" === e.order) {
  42300. var m = l * h
  42301. , v = l * u
  42302. , A = c * h
  42303. , y = c * u;
  42304. t[0] = m - y * s,
  42305. t[4] = -a * u,
  42306. t[8] = A + v * s,
  42307. t[1] = v + A * s,
  42308. t[5] = a * h,
  42309. t[9] = y - m * s,
  42310. t[2] = -a * c,
  42311. t[6] = s,
  42312. t[10] = a * l
  42313. } else if ("ZYX" === e.order) {
  42314. var d = a * h
  42315. , p = a * u
  42316. , f = s * h
  42317. , g = s * u;
  42318. t[0] = l * h,
  42319. t[4] = f * c - p,
  42320. t[8] = d * c + g,
  42321. t[1] = l * u,
  42322. t[5] = g * c + d,
  42323. t[9] = p * c - f,
  42324. t[2] = -c,
  42325. t[6] = s * l,
  42326. t[10] = a * l
  42327. } else if ("YZX" === e.order) {
  42328. var C = a * l
  42329. , I = a * c
  42330. , E = s * l
  42331. , b = s * c;
  42332. t[0] = l * h,
  42333. t[4] = b - C * u,
  42334. t[8] = E * u + I,
  42335. t[1] = u,
  42336. t[5] = a * h,
  42337. t[9] = -s * h,
  42338. t[2] = -c * h,
  42339. t[6] = I * u + E,
  42340. t[10] = C - b * u
  42341. } else if ("XZY" === e.order) {
  42342. var C = a * l
  42343. , I = a * c
  42344. , E = s * l
  42345. , b = s * c;
  42346. t[0] = l * h,
  42347. t[4] = -u,
  42348. t[8] = c * h,
  42349. t[1] = C * u + b,
  42350. t[5] = a * h,
  42351. t[9] = I * u - E,
  42352. t[2] = E * u - I,
  42353. t[6] = s * h,
  42354. t[10] = b * u + C
  42355. }
  42356. return t[3] = 0,
  42357. t[7] = 0,
  42358. t[11] = 0,
  42359. t[12] = 0,
  42360. t[13] = 0,
  42361. t[14] = 0,
  42362. t[15] = 1,
  42363. this
  42364. },
  42365. makeRotationFromQuaternion: function(e) {
  42366. var t = this.elements
  42367. , i = e.x
  42368. , n = e.y
  42369. , r = e.z
  42370. , o = e.w
  42371. , a = i + i
  42372. , s = n + n
  42373. , l = r + r
  42374. , c = i * a
  42375. , h = i * s
  42376. , u = i * l
  42377. , d = n * s
  42378. , p = n * l
  42379. , f = r * l
  42380. , g = o * a
  42381. , m = o * s
  42382. , v = o * l;
  42383. return t[0] = 1 - (d + f),
  42384. t[4] = h - v,
  42385. t[8] = u + m,
  42386. t[1] = h + v,
  42387. t[5] = 1 - (c + f),
  42388. t[9] = p - g,
  42389. t[2] = u - m,
  42390. t[6] = p + g,
  42391. t[10] = 1 - (c + d),
  42392. t[3] = 0,
  42393. t[7] = 0,
  42394. t[11] = 0,
  42395. t[12] = 0,
  42396. t[13] = 0,
  42397. t[14] = 0,
  42398. t[15] = 1,
  42399. this
  42400. },
  42401. lookAt: function() {
  42402. var e, t, i;
  42403. return function(r, o, a) {
  42404. void 0 === e && (e = new n.Vector3),
  42405. void 0 === t && (t = new n.Vector3),
  42406. void 0 === i && (i = new n.Vector3);
  42407. var s = this.elements;
  42408. return i.subVectors(r, o).normalize(),
  42409. 0 === i.lengthSq() && (i.z = 1),
  42410. e.crossVectors(a, i).normalize(),
  42411. 0 === e.lengthSq() && (i.x += 1e-4,
  42412. e.crossVectors(a, i).normalize()),
  42413. t.crossVectors(i, e),
  42414. s[0] = e.x,
  42415. s[4] = t.x,
  42416. s[8] = i.x,
  42417. s[1] = e.y,
  42418. s[5] = t.y,
  42419. s[9] = i.y,
  42420. s[2] = e.z,
  42421. s[6] = t.z,
  42422. s[10] = i.z,
  42423. this
  42424. }
  42425. }(),
  42426. multiply: function(e, t) {
  42427. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  42428. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  42429. },
  42430. multiplyMatrices: function(e, t) {
  42431. var i = e.elements
  42432. , n = t.elements
  42433. , r = this.elements
  42434. , o = i[0]
  42435. , a = i[4]
  42436. , s = i[8]
  42437. , l = i[12]
  42438. , c = i[1]
  42439. , h = i[5]
  42440. , u = i[9]
  42441. , d = i[13]
  42442. , p = i[2]
  42443. , f = i[6]
  42444. , g = i[10]
  42445. , m = i[14]
  42446. , v = i[3]
  42447. , A = i[7]
  42448. , y = i[11]
  42449. , C = i[15]
  42450. , I = n[0]
  42451. , E = n[4]
  42452. , b = n[8]
  42453. , w = n[12]
  42454. , _ = n[1]
  42455. , T = n[5]
  42456. , x = n[9]
  42457. , S = n[13]
  42458. , M = n[2]
  42459. , R = n[6]
  42460. , P = n[10]
  42461. , O = n[14]
  42462. , L = n[3]
  42463. , D = n[7]
  42464. , N = n[11]
  42465. , B = n[15];
  42466. return r[0] = o * I + a * _ + s * M + l * L,
  42467. r[4] = o * E + a * T + s * R + l * D,
  42468. r[8] = o * b + a * x + s * P + l * N,
  42469. r[12] = o * w + a * S + s * O + l * B,
  42470. r[1] = c * I + h * _ + u * M + d * L,
  42471. r[5] = c * E + h * T + u * R + d * D,
  42472. r[9] = c * b + h * x + u * P + d * N,
  42473. r[13] = c * w + h * S + u * O + d * B,
  42474. r[2] = p * I + f * _ + g * M + m * L,
  42475. r[6] = p * E + f * T + g * R + m * D,
  42476. r[10] = p * b + f * x + g * P + m * N,
  42477. r[14] = p * w + f * S + g * O + m * B,
  42478. r[3] = v * I + A * _ + y * M + C * L,
  42479. r[7] = v * E + A * T + y * R + C * D,
  42480. r[11] = v * b + A * x + y * P + C * N,
  42481. r[15] = v * w + A * S + y * O + C * B,
  42482. this
  42483. },
  42484. multiplyToArray: function(e, t, i) {
  42485. var n = this.elements;
  42486. return this.multiplyMatrices(e, t),
  42487. i[0] = n[0],
  42488. i[1] = n[1],
  42489. i[2] = n[2],
  42490. i[3] = n[3],
  42491. i[4] = n[4],
  42492. i[5] = n[5],
  42493. i[6] = n[6],
  42494. i[7] = n[7],
  42495. i[8] = n[8],
  42496. i[9] = n[9],
  42497. i[10] = n[10],
  42498. i[11] = n[11],
  42499. i[12] = n[12],
  42500. i[13] = n[13],
  42501. i[14] = n[14],
  42502. i[15] = n[15],
  42503. this
  42504. },
  42505. multiplyScalar: function(e) {
  42506. var t = this.elements;
  42507. return t[0] *= e,
  42508. t[4] *= e,
  42509. t[8] *= e,
  42510. t[12] *= e,
  42511. t[1] *= e,
  42512. t[5] *= e,
  42513. t[9] *= e,
  42514. t[13] *= e,
  42515. t[2] *= e,
  42516. t[6] *= e,
  42517. t[10] *= e,
  42518. t[14] *= e,
  42519. t[3] *= e,
  42520. t[7] *= e,
  42521. t[11] *= e,
  42522. t[15] *= e,
  42523. this
  42524. },
  42525. applyToVector3Array: function() {
  42526. var e;
  42527. return function(t, i, r) {
  42528. void 0 === e && (e = new n.Vector3),
  42529. void 0 === i && (i = 0),
  42530. void 0 === r && (r = t.length);
  42531. for (var o = 0, a = i; o < r; o += 3,
  42532. a += 3)
  42533. e.fromArray(t, a),
  42534. e.applyMatrix4(this),
  42535. e.toArray(t, a);
  42536. return t
  42537. }
  42538. }(),
  42539. applyToBuffer: function() {
  42540. var e;
  42541. return function(t, i, r) {
  42542. void 0 === e && (e = new n.Vector3),
  42543. void 0 === i && (i = 0),
  42544. void 0 === r && (r = t.length / t.itemSize);
  42545. for (var o = 0, a = i; o < r; o++,
  42546. a++)
  42547. e.x = t.getX(a),
  42548. e.y = t.getY(a),
  42549. e.z = t.getZ(a),
  42550. e.applyMatrix4(this),
  42551. t.setXYZ(e.x, e.y, e.z);
  42552. return t
  42553. }
  42554. }(),
  42555. determinant: function() {
  42556. var e = this.elements
  42557. , t = e[0]
  42558. , i = e[4]
  42559. , n = e[8]
  42560. , r = e[12]
  42561. , o = e[1]
  42562. , a = e[5]
  42563. , s = e[9]
  42564. , l = e[13]
  42565. , c = e[2]
  42566. , h = e[6]
  42567. , u = e[10]
  42568. , d = e[14]
  42569. , p = e[3]
  42570. , f = e[7]
  42571. , g = e[11]
  42572. , m = e[15];
  42573. 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)
  42574. },
  42575. transpose: function() {
  42576. var e, t = this.elements;
  42577. return e = t[1],
  42578. t[1] = t[4],
  42579. t[4] = e,
  42580. e = t[2],
  42581. t[2] = t[8],
  42582. t[8] = e,
  42583. e = t[6],
  42584. t[6] = t[9],
  42585. t[9] = e,
  42586. e = t[3],
  42587. t[3] = t[12],
  42588. t[12] = e,
  42589. e = t[7],
  42590. t[7] = t[13],
  42591. t[13] = e,
  42592. e = t[11],
  42593. t[11] = t[14],
  42594. t[14] = e,
  42595. this
  42596. },
  42597. flattenToArrayOffset: function(e, t) {
  42598. var i = this.elements;
  42599. return e[t] = i[0],
  42600. e[t + 1] = i[1],
  42601. e[t + 2] = i[2],
  42602. e[t + 3] = i[3],
  42603. e[t + 4] = i[4],
  42604. e[t + 5] = i[5],
  42605. e[t + 6] = i[6],
  42606. e[t + 7] = i[7],
  42607. e[t + 8] = i[8],
  42608. e[t + 9] = i[9],
  42609. e[t + 10] = i[10],
  42610. e[t + 11] = i[11],
  42611. e[t + 12] = i[12],
  42612. e[t + 13] = i[13],
  42613. e[t + 14] = i[14],
  42614. e[t + 15] = i[15],
  42615. e
  42616. },
  42617. getPosition: function() {
  42618. var e;
  42619. return function() {
  42620. return void 0 === e && (e = new n.Vector3),
  42621. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  42622. e.setFromMatrixColumn(this, 3)
  42623. }
  42624. }(),
  42625. setPosition: function(e) {
  42626. var t = this.elements;
  42627. return t[12] = e.x,
  42628. t[13] = e.y,
  42629. t[14] = e.z,
  42630. this
  42631. },
  42632. getInverse: function(e, t) {
  42633. var i = this.elements
  42634. , n = e.elements
  42635. , r = n[0]
  42636. , o = n[1]
  42637. , a = n[2]
  42638. , s = n[3]
  42639. , l = n[4]
  42640. , c = n[5]
  42641. , h = n[6]
  42642. , u = n[7]
  42643. , d = n[8]
  42644. , p = n[9]
  42645. , f = n[10]
  42646. , g = n[11]
  42647. , m = n[12]
  42648. , v = n[13]
  42649. , A = n[14]
  42650. , y = n[15]
  42651. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  42652. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  42653. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  42654. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  42655. , w = r * C + o * I + a * E + s * b;
  42656. if (0 === w) {
  42657. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  42658. if (t)
  42659. throw new Error(_);
  42660. return console.warn(_),
  42661. this.identity()
  42662. }
  42663. return i[0] = C,
  42664. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  42665. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  42666. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  42667. i[4] = I,
  42668. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  42669. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  42670. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  42671. i[8] = E,
  42672. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  42673. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  42674. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  42675. i[12] = b,
  42676. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  42677. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  42678. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  42679. this.multiplyScalar(1 / w)
  42680. },
  42681. scale: function(e) {
  42682. var t = this.elements
  42683. , i = e.x
  42684. , n = e.y
  42685. , r = e.z;
  42686. return t[0] *= i,
  42687. t[4] *= n,
  42688. t[8] *= r,
  42689. t[1] *= i,
  42690. t[5] *= n,
  42691. t[9] *= r,
  42692. t[2] *= i,
  42693. t[6] *= n,
  42694. t[10] *= r,
  42695. t[3] *= i,
  42696. t[7] *= n,
  42697. t[11] *= r,
  42698. this
  42699. },
  42700. getMaxScaleOnAxis: function() {
  42701. var e = this.elements
  42702. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  42703. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  42704. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  42705. return Math.sqrt(Math.max(t, i, n))
  42706. },
  42707. makeTranslation: function(e, t, i) {
  42708. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  42709. this
  42710. },
  42711. makeRotationX: function(e) {
  42712. var t = Math.cos(e)
  42713. , i = Math.sin(e);
  42714. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  42715. this
  42716. },
  42717. makeRotationY: function(e) {
  42718. var t = Math.cos(e)
  42719. , i = Math.sin(e);
  42720. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  42721. this
  42722. },
  42723. makeRotationZ: function(e) {
  42724. var t = Math.cos(e)
  42725. , i = Math.sin(e);
  42726. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  42727. this
  42728. },
  42729. makeRotationAxis: function(e, t) {
  42730. var i = Math.cos(t)
  42731. , n = Math.sin(t)
  42732. , r = 1 - i
  42733. , o = e.x
  42734. , a = e.y
  42735. , s = e.z
  42736. , l = r * o
  42737. , c = r * a;
  42738. 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),
  42739. this
  42740. },
  42741. makeScale: function(e, t, i) {
  42742. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  42743. this
  42744. },
  42745. compose: function(e, t, i) {
  42746. return this.makeRotationFromQuaternion(t),
  42747. this.scale(i),
  42748. this.setPosition(e),
  42749. this
  42750. },
  42751. decompose: function() {
  42752. var e, t;
  42753. return function(i, r, o) {
  42754. void 0 === e && (e = new n.Vector3),
  42755. void 0 === t && (t = new n.Matrix4);
  42756. var a = this.elements
  42757. , s = e.set(a[0], a[1], a[2]).length()
  42758. , l = e.set(a[4], a[5], a[6]).length()
  42759. , c = e.set(a[8], a[9], a[10]).length()
  42760. , h = this.determinant();
  42761. h < 0 && (s = -s),
  42762. i.x = a[12],
  42763. i.y = a[13],
  42764. i.z = a[14],
  42765. t.elements.set(this.elements);
  42766. var u = 1 / s
  42767. , d = 1 / l
  42768. , p = 1 / c;
  42769. return t.elements[0] *= u,
  42770. t.elements[1] *= u,
  42771. t.elements[2] *= u,
  42772. t.elements[4] *= d,
  42773. t.elements[5] *= d,
  42774. t.elements[6] *= d,
  42775. t.elements[8] *= p,
  42776. t.elements[9] *= p,
  42777. t.elements[10] *= p,
  42778. r.setFromRotationMatrix(t),
  42779. o.x = s,
  42780. o.y = l,
  42781. o.z = c,
  42782. this
  42783. }
  42784. }(),
  42785. makeFrustum: function(e, t, i, n, r, o) {
  42786. var a = this.elements
  42787. , s = 2 * r / (t - e)
  42788. , l = 2 * r / (n - i)
  42789. , c = (t + e) / (t - e)
  42790. , h = (n + i) / (n - i)
  42791. , u = -(o + r) / (o - r)
  42792. , d = -2 * o * r / (o - r);
  42793. return a[0] = s,
  42794. a[4] = 0,
  42795. a[8] = c,
  42796. a[12] = 0,
  42797. a[1] = 0,
  42798. a[5] = l,
  42799. a[9] = h,
  42800. a[13] = 0,
  42801. a[2] = 0,
  42802. a[6] = 0,
  42803. a[10] = u,
  42804. a[14] = d,
  42805. a[3] = 0,
  42806. a[7] = 0,
  42807. a[11] = -1,
  42808. a[15] = 0,
  42809. this
  42810. },
  42811. makePerspective: function(e, t, i, r) {
  42812. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  42813. , a = -o
  42814. , s = a * t
  42815. , l = o * t;
  42816. return this.makeFrustum(s, l, a, o, i, r)
  42817. },
  42818. makeOrthographic: function(e, t, i, n, r, o) {
  42819. var a = this.elements
  42820. , s = 1 / (t - e)
  42821. , l = 1 / (i - n)
  42822. , c = 1 / (o - r)
  42823. , h = (t + e) * s
  42824. , u = (i + n) * l
  42825. , d = (o + r) * c;
  42826. return a[0] = 2 * s,
  42827. a[4] = 0,
  42828. a[8] = 0,
  42829. a[12] = -h,
  42830. a[1] = 0,
  42831. a[5] = 2 * l,
  42832. a[9] = 0,
  42833. a[13] = -u,
  42834. a[2] = 0,
  42835. a[6] = 0,
  42836. a[10] = -2 * c,
  42837. a[14] = -d,
  42838. a[3] = 0,
  42839. a[7] = 0,
  42840. a[11] = 0,
  42841. a[15] = 1,
  42842. this
  42843. },
  42844. equals: function(e) {
  42845. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  42846. if (t[n] !== i[n])
  42847. return !1;
  42848. return !0
  42849. },
  42850. fromArray: function(e) {
  42851. return this.elements.set(e),
  42852. this
  42853. },
  42854. toArray: function() {
  42855. var e = this.elements;
  42856. 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]]
  42857. }
  42858. },
  42859. n.Ray = function(e, t) {
  42860. this.origin = void 0 !== e ? e : new n.Vector3,
  42861. this.direction = void 0 !== t ? t : new n.Vector3
  42862. }
  42863. ,
  42864. n.Ray.prototype = {
  42865. constructor: n.Ray,
  42866. set: function(e, t) {
  42867. return this.origin.copy(e),
  42868. this.direction.copy(t),
  42869. this
  42870. },
  42871. clone: function() {
  42872. return (new this.constructor).copy(this)
  42873. },
  42874. copy: function(e) {
  42875. return this.origin.copy(e.origin),
  42876. this.direction.copy(e.direction),
  42877. this
  42878. },
  42879. at: function(e, t) {
  42880. var i = t || new n.Vector3;
  42881. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  42882. },
  42883. lookAt: function(e) {
  42884. this.direction.copy(e).sub(this.origin).normalize()
  42885. },
  42886. recast: function() {
  42887. var e = new n.Vector3;
  42888. return function(t) {
  42889. return this.origin.copy(this.at(t, e)),
  42890. this
  42891. }
  42892. }(),
  42893. closestPointToPoint: function(e, t) {
  42894. var i = t || new n.Vector3;
  42895. i.subVectors(e, this.origin);
  42896. var r = i.dot(this.direction);
  42897. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  42898. },
  42899. distanceToPoint: function(e) {
  42900. return Math.sqrt(this.distanceSqToPoint(e))
  42901. },
  42902. distanceSqToPoint: function() {
  42903. var e = new n.Vector3;
  42904. return function(t) {
  42905. var i = e.subVectors(t, this.origin).dot(this.direction);
  42906. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  42907. e.distanceToSquared(t))
  42908. }
  42909. }(),
  42910. distanceSqToSegment: function() {
  42911. var e = new n.Vector3
  42912. , t = new n.Vector3
  42913. , i = new n.Vector3;
  42914. return function(n, r, o, a) {
  42915. e.copy(n).add(r).multiplyScalar(.5),
  42916. t.copy(r).sub(n).normalize(),
  42917. i.copy(this.origin).sub(e);
  42918. 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);
  42919. if (m > 0)
  42920. if (s = d * f - p,
  42921. l = d * p - f,
  42922. h = u * m,
  42923. s >= 0)
  42924. if (l >= -h)
  42925. if (l <= h) {
  42926. var v = 1 / m;
  42927. s *= v,
  42928. l *= v,
  42929. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  42930. } else
  42931. l = u,
  42932. s = Math.max(0, -(d * l + p)),
  42933. c = -s * s + l * (l + 2 * f) + g;
  42934. else
  42935. l = -u,
  42936. s = Math.max(0, -(d * l + p)),
  42937. c = -s * s + l * (l + 2 * f) + g;
  42938. else
  42939. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  42940. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  42941. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  42942. l = Math.min(Math.max(-u, -f), u),
  42943. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  42944. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  42945. c = -s * s + l * (l + 2 * f) + g);
  42946. else
  42947. l = d > 0 ? -u : u,
  42948. s = Math.max(0, -(d * l + p)),
  42949. c = -s * s + l * (l + 2 * f) + g;
  42950. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  42951. a && a.copy(t).multiplyScalar(l).add(e),
  42952. c
  42953. }
  42954. }(),
  42955. intersectSphere: function() {
  42956. var e = new n.Vector3;
  42957. return function(t, i) {
  42958. e.subVectors(t.center, this.origin);
  42959. var n = e.dot(this.direction)
  42960. , r = e.dot(e) - n * n
  42961. , o = t.radius * t.radius;
  42962. if (r > o)
  42963. return null;
  42964. var a = Math.sqrt(o - r)
  42965. , s = n - a
  42966. , l = n + a;
  42967. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  42968. }
  42969. }(),
  42970. intersectsSphere: function(e) {
  42971. return this.distanceToPoint(e.center) <= e.radius
  42972. },
  42973. distanceToPlane: function(e) {
  42974. var t = e.normal.dot(this.direction);
  42975. if (0 === t)
  42976. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  42977. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  42978. return i >= 0 ? i : null
  42979. },
  42980. intersectPlane: function(e, t) {
  42981. var i = this.distanceToPlane(e);
  42982. return null === i ? null : this.at(i, t)
  42983. },
  42984. intersectsPlane: function(e) {
  42985. var t = e.distanceToPoint(this.origin);
  42986. if (0 === t)
  42987. return !0;
  42988. var i = e.normal.dot(this.direction);
  42989. return i * t < 0
  42990. },
  42991. intersectBox: function(e, t) {
  42992. 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;
  42993. return l >= 0 ? (i = (e.min.x - u.x) * l,
  42994. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  42995. n = (e.min.x - u.x) * l),
  42996. c >= 0 ? (r = (e.min.y - u.y) * c,
  42997. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  42998. o = (e.min.y - u.y) * c),
  42999. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  43000. (o < n || n !== n) && (n = o),
  43001. h >= 0 ? (a = (e.min.z - u.z) * h,
  43002. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  43003. s = (e.min.z - u.z) * h),
  43004. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  43005. (s < n || n !== n) && (n = s),
  43006. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  43007. },
  43008. intersectsBox: function() {
  43009. var e = new n.Vector3;
  43010. return function(t) {
  43011. return null !== this.intersectBox(t, e)
  43012. }
  43013. }(),
  43014. intersectTriangle: function() {
  43015. var e = new n.Vector3
  43016. , t = new n.Vector3
  43017. , i = new n.Vector3
  43018. , r = new n.Vector3;
  43019. return function(n, o, a, s, l) {
  43020. t.subVectors(o, n),
  43021. i.subVectors(a, n),
  43022. r.crossVectors(t, i);
  43023. var c, h = this.direction.dot(r);
  43024. if (h > 0) {
  43025. if (s)
  43026. return null;
  43027. c = 1
  43028. } else {
  43029. if (!(h < 0))
  43030. return null;
  43031. c = -1,
  43032. h = -h
  43033. }
  43034. e.subVectors(this.origin, n);
  43035. var u = c * this.direction.dot(i.crossVectors(e, i));
  43036. if (u < 0)
  43037. return null;
  43038. var d = c * this.direction.dot(t.cross(e));
  43039. if (d < 0)
  43040. return null;
  43041. if (u + d > h)
  43042. return null;
  43043. var p = -c * e.dot(r);
  43044. return p < 0 ? null : this.at(p / h, l)
  43045. }
  43046. }(),
  43047. applyMatrix4: function(e) {
  43048. return this.direction.add(this.origin).applyMatrix4(e),
  43049. this.origin.applyMatrix4(e),
  43050. this.direction.sub(this.origin),
  43051. this.direction.normalize(),
  43052. this
  43053. },
  43054. equals: function(e) {
  43055. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  43056. }
  43057. },
  43058. n.Sphere = function(e, t) {
  43059. this.center = void 0 !== e ? e : new n.Vector3,
  43060. this.radius = void 0 !== t ? t : 0
  43061. }
  43062. ,
  43063. n.Sphere.prototype = {
  43064. constructor: n.Sphere,
  43065. set: function(e, t) {
  43066. return this.center.copy(e),
  43067. this.radius = t,
  43068. this
  43069. },
  43070. setFromPoints: function() {
  43071. var e = new n.Box3;
  43072. return function(t, i) {
  43073. var n = this.center;
  43074. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  43075. for (var r = 0, o = 0, a = t.length; o < a; o++)
  43076. r = Math.max(r, n.distanceToSquared(t[o]));
  43077. return this.radius = Math.sqrt(r),
  43078. this
  43079. }
  43080. }(),
  43081. clone: function() {
  43082. return (new this.constructor).copy(this)
  43083. },
  43084. copy: function(e) {
  43085. return this.center.copy(e.center),
  43086. this.radius = e.radius,
  43087. this
  43088. },
  43089. empty: function() {
  43090. return this.radius <= 0
  43091. },
  43092. containsPoint: function(e) {
  43093. return e.distanceToSquared(this.center) <= this.radius * this.radius
  43094. },
  43095. distanceToPoint: function(e) {
  43096. return e.distanceTo(this.center) - this.radius
  43097. },
  43098. intersectsSphere: function(e) {
  43099. var t = this.radius + e.radius;
  43100. return e.center.distanceToSquared(this.center) <= t * t
  43101. },
  43102. intersectsBox: function(e) {
  43103. return e.intersectsSphere(this)
  43104. },
  43105. intersectsPlane: function(e) {
  43106. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  43107. },
  43108. clampPoint: function(e, t) {
  43109. var i = this.center.distanceToSquared(e)
  43110. , r = t || new n.Vector3;
  43111. return r.copy(e),
  43112. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  43113. r.multiplyScalar(this.radius).add(this.center)),
  43114. r
  43115. },
  43116. getBoundingBox: function(e) {
  43117. var t = e || new n.Box3;
  43118. return t.set(this.center, this.center),
  43119. t.expandByScalar(this.radius),
  43120. t
  43121. },
  43122. applyMatrix4: function(e) {
  43123. return this.center.applyMatrix4(e),
  43124. this.radius = this.radius * e.getMaxScaleOnAxis(),
  43125. this
  43126. },
  43127. translate: function(e) {
  43128. return this.center.add(e),
  43129. this
  43130. },
  43131. equals: function(e) {
  43132. return e.center.equals(this.center) && e.radius === this.radius
  43133. }
  43134. },
  43135. n.Frustum = function(e, t, i, r, o, a) {
  43136. 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]
  43137. }
  43138. ,
  43139. n.Frustum.prototype = {
  43140. constructor: n.Frustum,
  43141. set: function(e, t, i, n, r, o) {
  43142. var a = this.planes;
  43143. return a[0].copy(e),
  43144. a[1].copy(t),
  43145. a[2].copy(i),
  43146. a[3].copy(n),
  43147. a[4].copy(r),
  43148. a[5].copy(o),
  43149. this
  43150. },
  43151. clone: function() {
  43152. return (new this.constructor).copy(this)
  43153. },
  43154. copy: function(e) {
  43155. for (var t = this.planes, i = 0; i < 6; i++)
  43156. t[i].copy(e.planes[i]);
  43157. return this
  43158. },
  43159. setFromMatrix: function(e) {
  43160. var t = this.planes
  43161. , i = e.elements
  43162. , n = i[0]
  43163. , r = i[1]
  43164. , o = i[2]
  43165. , a = i[3]
  43166. , s = i[4]
  43167. , l = i[5]
  43168. , c = i[6]
  43169. , h = i[7]
  43170. , u = i[8]
  43171. , d = i[9]
  43172. , p = i[10]
  43173. , f = i[11]
  43174. , g = i[12]
  43175. , m = i[13]
  43176. , v = i[14]
  43177. , A = i[15];
  43178. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  43179. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  43180. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  43181. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  43182. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  43183. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  43184. this
  43185. },
  43186. intersectsObject: function() {
  43187. var e = new n.Sphere;
  43188. return function(t) {
  43189. var i = t.geometry;
  43190. return null === i.boundingSphere && i.computeBoundingSphere(),
  43191. e.copy(i.boundingSphere),
  43192. e.applyMatrix4(t.matrixWorld),
  43193. this.intersectsSphere(e)
  43194. }
  43195. }(),
  43196. intersectsSphere: function(e) {
  43197. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  43198. var o = t[r].distanceToPoint(i);
  43199. if (o < n)
  43200. return !1
  43201. }
  43202. return !0
  43203. },
  43204. intersectsBox: function() {
  43205. var e = new n.Vector3
  43206. , t = new n.Vector3;
  43207. return function(i) {
  43208. for (var n = this.planes, r = 0; r < 6; r++) {
  43209. var o = n[r];
  43210. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  43211. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  43212. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  43213. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  43214. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  43215. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  43216. var a = o.distanceToPoint(e)
  43217. , s = o.distanceToPoint(t);
  43218. if (a < 0 && s < 0)
  43219. return !1
  43220. }
  43221. return !0
  43222. }
  43223. }(),
  43224. containsPoint: function(e) {
  43225. for (var t = this.planes, i = 0; i < 6; i++)
  43226. if (t[i].distanceToPoint(e) < 0)
  43227. return !1;
  43228. return !0
  43229. }
  43230. },
  43231. n.Plane = function(e, t) {
  43232. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  43233. this.constant = void 0 !== t ? t : 0
  43234. }
  43235. ,
  43236. n.Plane.prototype = {
  43237. constructor: n.Plane,
  43238. set: function(e, t) {
  43239. return this.normal.copy(e),
  43240. this.constant = t,
  43241. this
  43242. },
  43243. setComponents: function(e, t, i, n) {
  43244. return this.normal.set(e, t, i),
  43245. this.constant = n,
  43246. this
  43247. },
  43248. setFromNormalAndCoplanarPoint: function(e, t) {
  43249. return this.normal.copy(e),
  43250. this.constant = -t.dot(this.normal),
  43251. this
  43252. },
  43253. setFromCoplanarPoints: function() {
  43254. var e = new n.Vector3
  43255. , t = new n.Vector3;
  43256. return function(i, n, r) {
  43257. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  43258. return this.setFromNormalAndCoplanarPoint(o, i),
  43259. this
  43260. }
  43261. }(),
  43262. clone: function() {
  43263. return (new this.constructor).copy(this)
  43264. },
  43265. copy: function(e) {
  43266. return this.normal.copy(e.normal),
  43267. this.constant = e.constant,
  43268. this
  43269. },
  43270. normalize: function() {
  43271. var e = 1 / this.normal.length();
  43272. return this.normal.multiplyScalar(e),
  43273. this.constant *= e,
  43274. this
  43275. },
  43276. negate: function() {
  43277. return this.constant *= -1,
  43278. this.normal.negate(),
  43279. this
  43280. },
  43281. distanceToPoint: function(e) {
  43282. return this.normal.dot(e) + this.constant
  43283. },
  43284. distanceToSphere: function(e) {
  43285. return this.distanceToPoint(e.center) - e.radius
  43286. },
  43287. projectPoint: function(e, t) {
  43288. return this.orthoPoint(e, t).sub(e).negate()
  43289. },
  43290. orthoPoint: function(e, t) {
  43291. var i = this.distanceToPoint(e)
  43292. , r = t || new n.Vector3;
  43293. return r.copy(this.normal).multiplyScalar(i)
  43294. },
  43295. intersectLine: function() {
  43296. var e = new n.Vector3;
  43297. return function(t, i) {
  43298. var r = i || new n.Vector3
  43299. , o = t.delta(e)
  43300. , a = this.normal.dot(o);
  43301. if (0 !== a) {
  43302. var s = -(t.start.dot(this.normal) + this.constant) / a;
  43303. if (!(s < 0 || s > 1))
  43304. return r.copy(o).multiplyScalar(s).add(t.start)
  43305. } else if (0 === this.distanceToPoint(t.start))
  43306. return r.copy(t.start)
  43307. }
  43308. }(),
  43309. intersectsLine: function(e) {
  43310. var t = this.distanceToPoint(e.start)
  43311. , i = this.distanceToPoint(e.end);
  43312. return t < 0 && i > 0 || i < 0 && t > 0
  43313. },
  43314. intersectsBox: function(e) {
  43315. return e.intersectsPlane(this)
  43316. },
  43317. intersectsSphere: function(e) {
  43318. return e.intersectsPlane(this)
  43319. },
  43320. coplanarPoint: function(e) {
  43321. var t = e || new n.Vector3;
  43322. return t.copy(this.normal).multiplyScalar(-this.constant)
  43323. },
  43324. applyMatrix4: function() {
  43325. var e = new n.Vector3
  43326. , t = new n.Vector3
  43327. , i = new n.Matrix3;
  43328. return function(n, r) {
  43329. var o = r || i.getNormalMatrix(n)
  43330. , a = e.copy(this.normal).applyMatrix3(o)
  43331. , s = this.coplanarPoint(t);
  43332. return s.applyMatrix4(n),
  43333. this.setFromNormalAndCoplanarPoint(a, s),
  43334. this
  43335. }
  43336. }(),
  43337. translate: function(e) {
  43338. return this.constant = this.constant - e.dot(this.normal),
  43339. this
  43340. },
  43341. equals: function(e) {
  43342. return e.normal.equals(this.normal) && e.constant === this.constant
  43343. }
  43344. },
  43345. n.Spherical = function(e, t, i) {
  43346. return this.radius = void 0 !== e ? e : 1,
  43347. this.phi = void 0 !== t ? t : 0,
  43348. this.theta = void 0 !== i ? i : 0,
  43349. this
  43350. }
  43351. ,
  43352. n.Spherical.prototype = {
  43353. constructor: n.Spherical,
  43354. set: function(e, t, i) {
  43355. this.radius = e,
  43356. this.phi = t,
  43357. this.theta = i
  43358. },
  43359. clone: function() {
  43360. return (new this.constructor).copy(this)
  43361. },
  43362. copy: function(e) {
  43363. return this.radius.copy(e.radius),
  43364. this.phi.copy(e.phi),
  43365. this.theta.copy(e.theta),
  43366. this
  43367. },
  43368. makeSafe: function() {
  43369. var e = 1e-6;
  43370. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  43371. },
  43372. setFromVector3: function(e) {
  43373. return this.radius = e.length(),
  43374. 0 === this.radius ? (this.theta = 0,
  43375. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  43376. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  43377. this
  43378. }
  43379. },
  43380. n.Math = {
  43381. generateUUID: function() {
  43382. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  43383. return function() {
  43384. for (var r = 0; r < 36; r++)
  43385. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  43386. e = 15 & n,
  43387. n >>= 4,
  43388. i[r] = t[19 === r ? 3 & e | 8 : e]);
  43389. return i.join("")
  43390. }
  43391. }(),
  43392. clamp: function(e, t, i) {
  43393. return Math.max(t, Math.min(i, e))
  43394. },
  43395. euclideanModulo: function(e, t) {
  43396. return (e % t + t) % t
  43397. },
  43398. mapLinear: function(e, t, i, n, r) {
  43399. return n + (e - t) * (r - n) / (i - t)
  43400. },
  43401. smoothstep: function(e, t, i) {
  43402. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43403. e * e * (3 - 2 * e))
  43404. },
  43405. smootherstep: function(e, t, i) {
  43406. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  43407. e * e * e * (e * (6 * e - 15) + 10))
  43408. },
  43409. random16: function() {
  43410. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  43411. Math.random()
  43412. },
  43413. randInt: function(e, t) {
  43414. return e + Math.floor(Math.random() * (t - e + 1))
  43415. },
  43416. randFloat: function(e, t) {
  43417. return e + Math.random() * (t - e)
  43418. },
  43419. randFloatSpread: function(e) {
  43420. return e * (.5 - Math.random())
  43421. },
  43422. degToRad: function() {
  43423. var e = Math.PI / 180;
  43424. return function(t) {
  43425. return t * e
  43426. }
  43427. }(),
  43428. radToDeg: function() {
  43429. var e = 180 / Math.PI;
  43430. return function(t) {
  43431. return t * e
  43432. }
  43433. }(),
  43434. isPowerOfTwo: function(e) {
  43435. return 0 === (e & e - 1) && 0 !== e
  43436. },
  43437. nearestPowerOfTwo: function(e) {
  43438. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  43439. },
  43440. nextPowerOfTwo: function(e) {
  43441. return e--,
  43442. e |= e >> 1,
  43443. e |= e >> 2,
  43444. e |= e >> 4,
  43445. e |= e >> 8,
  43446. e |= e >> 16,
  43447. e++,
  43448. e
  43449. }
  43450. },
  43451. n.Spline = function(e) {
  43452. function t(e, t, i, n, r, o, a) {
  43453. var s = .5 * (i - e)
  43454. , l = .5 * (n - t);
  43455. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  43456. }
  43457. this.points = e;
  43458. var i, r, o, a, s, l, c, h, u, d = [], p = {
  43459. x: 0,
  43460. y: 0,
  43461. z: 0
  43462. };
  43463. this.initFromArray = function(e) {
  43464. this.points = [];
  43465. for (var t = 0; t < e.length; t++)
  43466. this.points[t] = {
  43467. x: e[t][0],
  43468. y: e[t][1],
  43469. z: e[t][2]
  43470. }
  43471. }
  43472. ,
  43473. this.getPoint = function(e) {
  43474. return i = (this.points.length - 1) * e,
  43475. r = Math.floor(i),
  43476. o = i - r,
  43477. d[0] = 0 === r ? r : r - 1,
  43478. d[1] = r,
  43479. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  43480. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  43481. l = this.points[d[0]],
  43482. c = this.points[d[1]],
  43483. h = this.points[d[2]],
  43484. u = this.points[d[3]],
  43485. a = o * o,
  43486. s = o * a,
  43487. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  43488. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  43489. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  43490. p
  43491. }
  43492. ,
  43493. this.getControlPointsArray = function() {
  43494. var e, t, i = this.points.length, n = [];
  43495. for (e = 0; e < i; e++)
  43496. t = this.points[e],
  43497. n[e] = [t.x, t.y, t.z];
  43498. return n
  43499. }
  43500. ,
  43501. this.getLength = function(e) {
  43502. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  43503. for (u[0] = 0,
  43504. e || (e = 100),
  43505. r = this.points.length * e,
  43506. c.copy(this.points[0]),
  43507. t = 1; t < r; t++)
  43508. i = t / r,
  43509. o = this.getPoint(i),
  43510. h.copy(o),
  43511. d += h.distanceTo(c),
  43512. c.copy(o),
  43513. a = (this.points.length - 1) * i,
  43514. s = Math.floor(a),
  43515. s !== l && (u[s] = d,
  43516. l = s);
  43517. return u[u.length] = d,
  43518. {
  43519. chunks: u,
  43520. total: d
  43521. }
  43522. }
  43523. ,
  43524. this.reparametrizeByArcLength = function(e) {
  43525. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  43526. for (h.push(u.copy(this.points[0]).clone()),
  43527. t = 1; t < this.points.length; t++) {
  43528. for (s = d.chunks[t] - d.chunks[t - 1],
  43529. l = Math.ceil(e * s / d.total),
  43530. o = (t - 1) / (this.points.length - 1),
  43531. a = t / (this.points.length - 1),
  43532. i = 1; i < l - 1; i++)
  43533. r = o + i * (1 / l) * (a - o),
  43534. c = this.getPoint(r),
  43535. h.push(u.copy(c).clone());
  43536. h.push(u.copy(this.points[t]).clone())
  43537. }
  43538. this.points = h
  43539. }
  43540. }
  43541. ,
  43542. n.Triangle = function(e, t, i) {
  43543. this.a = void 0 !== e ? e : new n.Vector3,
  43544. this.b = void 0 !== t ? t : new n.Vector3,
  43545. this.c = void 0 !== i ? i : new n.Vector3
  43546. }
  43547. ,
  43548. n.Triangle.normal = function() {
  43549. var e = new n.Vector3;
  43550. return function(t, i, r, o) {
  43551. var a = o || new n.Vector3;
  43552. a.subVectors(r, i),
  43553. e.subVectors(t, i),
  43554. a.cross(e);
  43555. var s = a.lengthSq();
  43556. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  43557. }
  43558. }(),
  43559. n.Triangle.barycoordFromPoint = function() {
  43560. var e = new n.Vector3
  43561. , t = new n.Vector3
  43562. , i = new n.Vector3;
  43563. return function(r, o, a, s, l) {
  43564. e.subVectors(s, o),
  43565. t.subVectors(a, o),
  43566. i.subVectors(r, o);
  43567. var c = e.dot(e)
  43568. , h = e.dot(t)
  43569. , u = e.dot(i)
  43570. , d = t.dot(t)
  43571. , p = t.dot(i)
  43572. , f = c * d - h * h
  43573. , g = l || new n.Vector3;
  43574. if (0 === f)
  43575. return g.set(-2, -1, -1);
  43576. var m = 1 / f
  43577. , v = (d * u - h * p) * m
  43578. , A = (c * p - h * u) * m;
  43579. return g.set(1 - v - A, A, v)
  43580. }
  43581. }(),
  43582. n.Triangle.containsPoint = function() {
  43583. var e = new n.Vector3;
  43584. return function(t, i, r, o) {
  43585. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  43586. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  43587. }
  43588. }(),
  43589. n.Triangle.prototype = {
  43590. constructor: n.Triangle,
  43591. set: function(e, t, i) {
  43592. return this.a.copy(e),
  43593. this.b.copy(t),
  43594. this.c.copy(i),
  43595. this
  43596. },
  43597. setFromPointsAndIndices: function(e, t, i, n) {
  43598. return this.a.copy(e[t]),
  43599. this.b.copy(e[i]),
  43600. this.c.copy(e[n]),
  43601. this
  43602. },
  43603. clone: function() {
  43604. return (new this.constructor).copy(this)
  43605. },
  43606. copy: function(e) {
  43607. return this.a.copy(e.a),
  43608. this.b.copy(e.b),
  43609. this.c.copy(e.c),
  43610. this
  43611. },
  43612. area: function() {
  43613. var e = new n.Vector3
  43614. , t = new n.Vector3;
  43615. return function() {
  43616. return e.subVectors(this.c, this.b),
  43617. t.subVectors(this.a, this.b),
  43618. .5 * e.cross(t).length()
  43619. }
  43620. }(),
  43621. midpoint: function(e) {
  43622. var t = e || new n.Vector3;
  43623. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  43624. },
  43625. normal: function(e) {
  43626. return n.Triangle.normal(this.a, this.b, this.c, e)
  43627. },
  43628. plane: function(e) {
  43629. var t = e || new n.Plane;
  43630. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  43631. },
  43632. barycoordFromPoint: function(e, t) {
  43633. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  43634. },
  43635. containsPoint: function(e) {
  43636. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  43637. },
  43638. equals: function(e) {
  43639. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  43640. }
  43641. },
  43642. n.Interpolant = function(e, t, i, n) {
  43643. this.parameterPositions = e,
  43644. this._cachedIndex = 0,
  43645. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  43646. this.sampleValues = t,
  43647. this.valueSize = i
  43648. }
  43649. ,
  43650. n.Interpolant.prototype = {
  43651. constructor: n.Interpolant,
  43652. evaluate: function(e) {
  43653. var t = this.parameterPositions
  43654. , i = this._cachedIndex
  43655. , n = t[i]
  43656. , r = t[i - 1];
  43657. e: {
  43658. t: {
  43659. var o;
  43660. i: {
  43661. n: if (!(e < n)) {
  43662. for (var a = i + 2; ; ) {
  43663. if (void 0 === n) {
  43664. if (e < r)
  43665. break n;
  43666. return i = t.length,
  43667. this._cachedIndex = i,
  43668. this.afterEnd_(i - 1, e, r)
  43669. }
  43670. if (i === a)
  43671. break;
  43672. if (r = n,
  43673. n = t[++i],
  43674. e < n)
  43675. break t
  43676. }
  43677. o = t.length;
  43678. break i
  43679. }
  43680. {
  43681. if (e >= r)
  43682. break e;
  43683. var s = t[1];
  43684. e < s && (i = 2,
  43685. r = s);
  43686. for (var a = i - 2; ; ) {
  43687. if (void 0 === r)
  43688. return this._cachedIndex = 0,
  43689. this.beforeStart_(0, e, n);
  43690. if (i === a)
  43691. break;
  43692. if (n = r,
  43693. r = t[--i - 1],
  43694. e >= r)
  43695. break t
  43696. }
  43697. o = i,
  43698. i = 0
  43699. }
  43700. }
  43701. for (; i < o; ) {
  43702. var l = i + o >>> 1;
  43703. e < t[l] ? o = l : i = l + 1
  43704. }
  43705. if (n = t[i],
  43706. r = t[i - 1],
  43707. void 0 === r)
  43708. return this._cachedIndex = 0,
  43709. this.beforeStart_(0, e, n);
  43710. if (void 0 === n)
  43711. return i = t.length,
  43712. this._cachedIndex = i,
  43713. this.afterEnd_(i - 1, r, e)
  43714. }
  43715. this._cachedIndex = i,
  43716. this.intervalChanged_(i, r, n)
  43717. }
  43718. return this.interpolate_(i, r, e, n)
  43719. },
  43720. settings: null,
  43721. DefaultSettings_: {},
  43722. getSettings_: function() {
  43723. return this.settings || this.DefaultSettings_
  43724. },
  43725. copySampleValue_: function(e) {
  43726. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  43727. t[o] = i[r + o];
  43728. return t
  43729. },
  43730. interpolate_: function(e, t, i, n) {
  43731. throw new Error("call to abstract method")
  43732. },
  43733. intervalChanged_: function(e, t, i) {}
  43734. },
  43735. Object.assign(n.Interpolant.prototype, {
  43736. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  43737. afterEnd_: n.Interpolant.prototype.copySampleValue_
  43738. }),
  43739. n.CubicInterpolant = function(e, t, i, r) {
  43740. n.Interpolant.call(this, e, t, i, r),
  43741. this._weightPrev = -0,
  43742. this._offsetPrev = -0,
  43743. this._weightNext = -0,
  43744. this._offsetNext = -0
  43745. }
  43746. ,
  43747. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43748. constructor: n.CubicInterpolant,
  43749. DefaultSettings_: {
  43750. endingStart: n.ZeroCurvatureEnding,
  43751. endingEnd: n.ZeroCurvatureEnding
  43752. },
  43753. intervalChanged_: function(e, t, i) {
  43754. var r = this.parameterPositions
  43755. , o = e - 2
  43756. , a = e + 1
  43757. , s = r[o]
  43758. , l = r[a];
  43759. if (void 0 === s)
  43760. switch (this.getSettings_().endingStart) {
  43761. case n.ZeroSlopeEnding:
  43762. o = e,
  43763. s = 2 * t - i;
  43764. break;
  43765. case n.WrapAroundEnding:
  43766. o = r.length - 2,
  43767. s = t + r[o] - r[o + 1];
  43768. break;
  43769. default:
  43770. o = e,
  43771. s = i
  43772. }
  43773. if (void 0 === l)
  43774. switch (this.getSettings_().endingEnd) {
  43775. case n.ZeroSlopeEnding:
  43776. a = e,
  43777. l = 2 * i - t;
  43778. break;
  43779. case n.WrapAroundEnding:
  43780. a = 1,
  43781. l = i + r[1] - r[0];
  43782. break;
  43783. default:
  43784. a = e - 1,
  43785. l = t
  43786. }
  43787. var c = .5 * (i - t)
  43788. , h = this.valueSize;
  43789. this._weightPrev = c / (t - s),
  43790. this._weightNext = c / (l - i),
  43791. this._offsetPrev = o * h,
  43792. this._offsetNext = a * h
  43793. },
  43794. interpolate_: function(e, t, i, n) {
  43795. 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)
  43796. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  43797. return r
  43798. }
  43799. }),
  43800. n.DiscreteInterpolant = function(e, t, i, r) {
  43801. n.Interpolant.call(this, e, t, i, r)
  43802. }
  43803. ,
  43804. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43805. constructor: n.DiscreteInterpolant,
  43806. interpolate_: function(e, t, i, n) {
  43807. return this.copySampleValue_(e - 1)
  43808. }
  43809. }),
  43810. n.LinearInterpolant = function(e, t, i, r) {
  43811. n.Interpolant.call(this, e, t, i, r)
  43812. }
  43813. ,
  43814. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43815. constructor: n.LinearInterpolant,
  43816. interpolate_: function(e, t, i, n) {
  43817. 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)
  43818. r[u] = o[l + u] * h + o[s + u] * c;
  43819. return r
  43820. }
  43821. }),
  43822. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  43823. n.Interpolant.call(this, e, t, i, r)
  43824. }
  43825. ,
  43826. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  43827. constructor: n.QuaternionLinearInterpolant,
  43828. interpolate_: function(e, t, i, r) {
  43829. 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)
  43830. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  43831. return o
  43832. }
  43833. }),
  43834. n.Clock = function(e) {
  43835. this.autoStart = void 0 === e || e,
  43836. this.startTime = 0,
  43837. this.oldTime = 0,
  43838. this.elapsedTime = 0,
  43839. this.running = !1
  43840. }
  43841. ,
  43842. n.Clock.prototype = {
  43843. constructor: n.Clock,
  43844. start: function() {
  43845. this.startTime = performance.now(),
  43846. this.oldTime = this.startTime,
  43847. this.running = !0
  43848. },
  43849. stop: function() {
  43850. this.getElapsedTime(),
  43851. this.running = !1
  43852. },
  43853. getElapsedTime: function() {
  43854. return this.getDelta(),
  43855. this.elapsedTime
  43856. },
  43857. getDelta: function() {
  43858. var e = 0;
  43859. if (this.autoStart && !this.running && this.start(),
  43860. this.running) {
  43861. var t = performance.now();
  43862. e = .001 * (t - this.oldTime),
  43863. this.oldTime = t,
  43864. this.elapsedTime += e
  43865. }
  43866. return e
  43867. }
  43868. },
  43869. n.EventDispatcher = function() {}
  43870. ,
  43871. n.EventDispatcher.prototype = {
  43872. constructor: n.EventDispatcher,
  43873. apply: function(e) {
  43874. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  43875. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  43876. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  43877. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  43878. },
  43879. addEventListener: function(e, t) {
  43880. void 0 === this._listeners && (this._listeners = {});
  43881. var i = this._listeners;
  43882. void 0 === i[e] && (i[e] = []),
  43883. i[e].indexOf(t) === -1 && i[e].push(t)
  43884. },
  43885. hasEventListener: function(e, t) {
  43886. if (void 0 === this._listeners)
  43887. return !1;
  43888. var i = this._listeners;
  43889. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  43890. },
  43891. removeEventListener: function(e, t) {
  43892. if (void 0 !== this._listeners) {
  43893. var i = this._listeners
  43894. , n = i[e];
  43895. if (void 0 !== n) {
  43896. var r = n.indexOf(t);
  43897. r !== -1 && n.splice(r, 1)
  43898. }
  43899. }
  43900. },
  43901. dispatchEvent: function(e) {
  43902. if (void 0 !== this._listeners) {
  43903. var t = this._listeners
  43904. , i = t[e.type];
  43905. if (void 0 !== i) {
  43906. e.target = this;
  43907. for (var n = [], r = i.length, o = 0; o < r; o++)
  43908. n[o] = i[o];
  43909. for (var o = 0; o < r; o++)
  43910. n[o].call(this, e)
  43911. }
  43912. }
  43913. }
  43914. },
  43915. n.Layers = function() {
  43916. this.mask = 1
  43917. }
  43918. ,
  43919. n.Layers.prototype = {
  43920. constructor: n.Layers,
  43921. set: function(e) {
  43922. this.mask = 1 << e
  43923. },
  43924. enable: function(e) {
  43925. this.mask |= 1 << e
  43926. },
  43927. toggle: function(e) {
  43928. this.mask ^= 1 << e
  43929. },
  43930. disable: function(e) {
  43931. this.mask &= ~(1 << e)
  43932. },
  43933. test: function(e) {
  43934. return 0 !== (this.mask & e.mask)
  43935. }
  43936. },
  43937. function(e) {
  43938. function t(e, t) {
  43939. return e.distance - t.distance
  43940. }
  43941. function i(e, t, n, r) {
  43942. if (e.visible !== !1 && (e.raycast(t, n),
  43943. r === !0))
  43944. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  43945. i(o[a], t, n, !0)
  43946. }
  43947. e.Raycaster = function(t, i, n, r) {
  43948. this.ray = new e.Ray(t,i),
  43949. this.near = n || 0,
  43950. this.far = r || 1 / 0,
  43951. this.params = {
  43952. Mesh: {},
  43953. Line: {},
  43954. LOD: {},
  43955. Points: {
  43956. threshold: 1
  43957. },
  43958. Sprite: {}
  43959. },
  43960. Object.defineProperties(this.params, {
  43961. PointCloud: {
  43962. get: function() {
  43963. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  43964. this.Points
  43965. }
  43966. }
  43967. })
  43968. }
  43969. ,
  43970. e.Raycaster.prototype = {
  43971. constructor: e.Raycaster,
  43972. linePrecision: 1,
  43973. set: function(e, t) {
  43974. this.ray.set(e, t)
  43975. },
  43976. setFromCamera: function(t, i) {
  43977. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  43978. 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),
  43979. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  43980. },
  43981. intersectObject: function(e, n) {
  43982. var r = [];
  43983. return i(e, this, r, n),
  43984. r.sort(t),
  43985. r
  43986. },
  43987. intersectObjects: function(e, n) {
  43988. var r = [];
  43989. if (Array.isArray(e) === !1)
  43990. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  43991. r;
  43992. for (var o = 0, a = e.length; o < a; o++)
  43993. i(e[o], this, r, n);
  43994. return r.sort(t),
  43995. r
  43996. }
  43997. }
  43998. }(n),
  43999. n.Object3D = function() {
  44000. function e() {
  44001. o.setFromEuler(r, !1)
  44002. }
  44003. function t() {
  44004. r.setFromQuaternion(o, void 0, !1)
  44005. }
  44006. Object.defineProperty(this, "id", {
  44007. value: n.Object3DIdCount++
  44008. }),
  44009. this.uuid = n.Math.generateUUID(),
  44010. this.name = "",
  44011. this.type = "Object3D",
  44012. this.parent = null,
  44013. this.children = [],
  44014. this.up = n.Object3D.DefaultUp.clone();
  44015. var i = new n.Vector3
  44016. , r = new n.Euler
  44017. , o = new n.Quaternion
  44018. , a = new n.Vector3(1,1,1);
  44019. r.onChange(e),
  44020. o.onChange(t),
  44021. Object.defineProperties(this, {
  44022. position: {
  44023. enumerable: !0,
  44024. value: i
  44025. },
  44026. rotation: {
  44027. enumerable: !0,
  44028. value: r
  44029. },
  44030. quaternion: {
  44031. enumerable: !0,
  44032. value: o
  44033. },
  44034. scale: {
  44035. enumerable: !0,
  44036. value: a
  44037. },
  44038. modelViewMatrix: {
  44039. value: new n.Matrix4
  44040. },
  44041. normalMatrix: {
  44042. value: new n.Matrix3
  44043. }
  44044. }),
  44045. this.rotationAutoUpdate = !0,
  44046. this.matrix = new n.Matrix4,
  44047. this.matrixWorld = new n.Matrix4,
  44048. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  44049. this.matrixWorldNeedsUpdate = !1,
  44050. this.layers = new n.Layers,
  44051. this.visible = !0,
  44052. this.castShadow = !1,
  44053. this.receiveShadow = !1,
  44054. this.frustumCulled = !0,
  44055. this.renderOrder = 0,
  44056. this.userData = {}
  44057. }
  44058. ,
  44059. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  44060. n.Object3D.DefaultMatrixAutoUpdate = !0,
  44061. n.Object3D.prototype = {
  44062. constructor: n.Object3D,
  44063. applyMatrix: function(e) {
  44064. this.matrix.multiplyMatrices(e, this.matrix),
  44065. this.matrix.decompose(this.position, this.quaternion, this.scale)
  44066. },
  44067. setRotationFromAxisAngle: function(e, t) {
  44068. this.quaternion.setFromAxisAngle(e, t)
  44069. },
  44070. setRotationFromEuler: function(e) {
  44071. this.quaternion.setFromEuler(e, !0)
  44072. },
  44073. setRotationFromMatrix: function(e) {
  44074. this.quaternion.setFromRotationMatrix(e)
  44075. },
  44076. setRotationFromQuaternion: function(e) {
  44077. this.quaternion.copy(e)
  44078. },
  44079. rotateOnAxis: function() {
  44080. var e = new n.Quaternion;
  44081. return function(t, i) {
  44082. return e.setFromAxisAngle(t, i),
  44083. this.quaternion.multiply(e),
  44084. this
  44085. }
  44086. }(),
  44087. rotateX: function() {
  44088. var e = new n.Vector3(1,0,0);
  44089. return function(t) {
  44090. return this.rotateOnAxis(e, t)
  44091. }
  44092. }(),
  44093. rotateY: function() {
  44094. var e = new n.Vector3(0,1,0);
  44095. return function(t) {
  44096. return this.rotateOnAxis(e, t)
  44097. }
  44098. }(),
  44099. rotateZ: function() {
  44100. var e = new n.Vector3(0,0,1);
  44101. return function(t) {
  44102. return this.rotateOnAxis(e, t)
  44103. }
  44104. }(),
  44105. translateOnAxis: function() {
  44106. var e = new n.Vector3;
  44107. return function(t, i) {
  44108. return e.copy(t).applyQuaternion(this.quaternion),
  44109. this.position.add(e.multiplyScalar(i)),
  44110. this
  44111. }
  44112. }(),
  44113. translateX: function() {
  44114. var e = new n.Vector3(1,0,0);
  44115. return function(t) {
  44116. return this.translateOnAxis(e, t)
  44117. }
  44118. }(),
  44119. translateY: function() {
  44120. var e = new n.Vector3(0,1,0);
  44121. return function(t) {
  44122. return this.translateOnAxis(e, t)
  44123. }
  44124. }(),
  44125. translateZ: function() {
  44126. var e = new n.Vector3(0,0,1);
  44127. return function(t) {
  44128. return this.translateOnAxis(e, t)
  44129. }
  44130. }(),
  44131. localToWorld: function(e) {
  44132. return e.applyMatrix4(this.matrixWorld)
  44133. },
  44134. worldToLocal: function() {
  44135. var e = new n.Matrix4;
  44136. return function(t) {
  44137. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  44138. }
  44139. }(),
  44140. lookAt: function() {
  44141. var e = new n.Matrix4;
  44142. return function(t) {
  44143. e.lookAt(t, this.position, this.up),
  44144. this.quaternion.setFromRotationMatrix(e)
  44145. }
  44146. }(),
  44147. add: function(e) {
  44148. if (arguments.length > 1) {
  44149. for (var t = 0; t < arguments.length; t++)
  44150. this.add(arguments[t]);
  44151. return this
  44152. }
  44153. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  44154. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  44155. e.parent = this,
  44156. e.dispatchEvent({
  44157. type: "added"
  44158. }),
  44159. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  44160. this)
  44161. },
  44162. remove: function(e) {
  44163. if (arguments.length > 1)
  44164. for (var t = 0; t < arguments.length; t++)
  44165. this.remove(arguments[t]);
  44166. var i = this.children.indexOf(e);
  44167. i !== -1 && (e.parent = null,
  44168. e.dispatchEvent({
  44169. type: "removed"
  44170. }),
  44171. this.children.splice(i, 1))
  44172. },
  44173. getObjectById: function(e) {
  44174. return this.getObjectByProperty("id", e)
  44175. },
  44176. getObjectByName: function(e) {
  44177. return this.getObjectByProperty("name", e)
  44178. },
  44179. getObjectByProperty: function(e, t) {
  44180. if (this[e] === t)
  44181. return this;
  44182. for (var i = 0, n = this.children.length; i < n; i++) {
  44183. var r = this.children[i]
  44184. , o = r.getObjectByProperty(e, t);
  44185. if (void 0 !== o)
  44186. return o
  44187. }
  44188. },
  44189. getWorldPosition: function(e) {
  44190. var t = e || new n.Vector3;
  44191. return this.updateMatrixWorld(!0),
  44192. t.setFromMatrixPosition(this.matrixWorld)
  44193. },
  44194. getWorldQuaternion: function() {
  44195. var e = new n.Vector3
  44196. , t = new n.Vector3;
  44197. return function(i) {
  44198. var r = i || new n.Quaternion;
  44199. return this.updateMatrixWorld(!0),
  44200. this.matrixWorld.decompose(e, r, t),
  44201. r
  44202. }
  44203. }(),
  44204. getWorldRotation: function() {
  44205. var e = new n.Quaternion;
  44206. return function(t) {
  44207. var i = t || new n.Euler;
  44208. return this.getWorldQuaternion(e),
  44209. i.setFromQuaternion(e, this.rotation.order, !1)
  44210. }
  44211. }(),
  44212. getWorldScale: function() {
  44213. var e = new n.Vector3
  44214. , t = new n.Quaternion;
  44215. return function(i) {
  44216. var r = i || new n.Vector3;
  44217. return this.updateMatrixWorld(!0),
  44218. this.matrixWorld.decompose(e, t, r),
  44219. r
  44220. }
  44221. }(),
  44222. getWorldDirection: function() {
  44223. var e = new n.Quaternion;
  44224. return function(t) {
  44225. var i = t || new n.Vector3;
  44226. return this.getWorldQuaternion(e),
  44227. i.set(0, 0, 1).applyQuaternion(e)
  44228. }
  44229. }(),
  44230. raycast: function() {},
  44231. traverse: function(e) {
  44232. e(this);
  44233. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44234. t[i].traverse(e)
  44235. },
  44236. traverseVisible: function(e) {
  44237. if (this.visible !== !1) {
  44238. e(this);
  44239. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  44240. t[i].traverseVisible(e)
  44241. }
  44242. },
  44243. traverseAncestors: function(e) {
  44244. var t = this.parent;
  44245. null !== t && (e(t),
  44246. t.traverseAncestors(e))
  44247. },
  44248. updateMatrix: function() {
  44249. this.matrix.compose(this.position, this.quaternion, this.scale),
  44250. this.matrixWorldNeedsUpdate = !0
  44251. },
  44252. updateMatrixWorld: function(e) {
  44253. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  44254. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  44255. this.matrixWorldNeedsUpdate = !1,
  44256. e = !0);
  44257. for (var t = 0, i = this.children.length; t < i; t++)
  44258. this.children[t].updateMatrixWorld(e)
  44259. },
  44260. toJSON: function(e) {
  44261. function t(e) {
  44262. var t = [];
  44263. for (var i in e) {
  44264. var n = e[i];
  44265. delete n.metadata,
  44266. t.push(n)
  44267. }
  44268. return t
  44269. }
  44270. var i = void 0 === e
  44271. , n = {};
  44272. i && (e = {
  44273. geometries: {},
  44274. materials: {},
  44275. textures: {},
  44276. images: {}
  44277. },
  44278. n.metadata = {
  44279. version: 4.4,
  44280. type: "Object",
  44281. generator: "Object3D.toJSON"
  44282. });
  44283. var r = {};
  44284. if (r.uuid = this.uuid,
  44285. r.type = this.type,
  44286. "" !== this.name && (r.name = this.name),
  44287. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  44288. this.castShadow === !0 && (r.castShadow = !0),
  44289. this.receiveShadow === !0 && (r.receiveShadow = !0),
  44290. this.visible === !1 && (r.visible = !1),
  44291. r.matrix = this.matrix.toArray(),
  44292. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  44293. r.geometry = this.geometry.uuid),
  44294. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  44295. r.material = this.material.uuid),
  44296. this.children.length > 0) {
  44297. r.children = [];
  44298. for (var o = 0; o < this.children.length; o++)
  44299. r.children.push(this.children[o].toJSON(e).object)
  44300. }
  44301. if (i) {
  44302. var a = t(e.geometries)
  44303. , s = t(e.materials)
  44304. , l = t(e.textures)
  44305. , c = t(e.images);
  44306. a.length > 0 && (n.geometries = a),
  44307. s.length > 0 && (n.materials = s),
  44308. l.length > 0 && (n.textures = l),
  44309. c.length > 0 && (n.images = c)
  44310. }
  44311. return n.object = r,
  44312. n
  44313. },
  44314. clone: function(e) {
  44315. return (new this.constructor).copy(this, e)
  44316. },
  44317. copy: function(e, t) {
  44318. if (void 0 === t && (t = !0),
  44319. this.name = e.name,
  44320. this.up.copy(e.up),
  44321. this.position.copy(e.position),
  44322. this.quaternion.copy(e.quaternion),
  44323. this.scale.copy(e.scale),
  44324. this.rotationAutoUpdate = e.rotationAutoUpdate,
  44325. this.matrix.copy(e.matrix),
  44326. this.matrixWorld.copy(e.matrixWorld),
  44327. this.matrixAutoUpdate = e.matrixAutoUpdate,
  44328. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  44329. this.visible = e.visible,
  44330. this.castShadow = e.castShadow,
  44331. this.receiveShadow = e.receiveShadow,
  44332. this.frustumCulled = e.frustumCulled,
  44333. this.renderOrder = e.renderOrder,
  44334. this.userData = JSON.parse(JSON.stringify(e.userData)),
  44335. t === !0)
  44336. for (var i = 0; i < e.children.length; i++) {
  44337. var n = e.children[i];
  44338. this.add(n.clone())
  44339. }
  44340. return this
  44341. }
  44342. },
  44343. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  44344. n.Object3DIdCount = 0,
  44345. n.Face3 = function(e, t, i, r, o, a) {
  44346. this.a = e,
  44347. this.b = t,
  44348. this.c = i,
  44349. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  44350. this.vertexNormals = Array.isArray(r) ? r : [],
  44351. this.color = o instanceof n.Color ? o : new n.Color,
  44352. this.vertexColors = Array.isArray(o) ? o : [],
  44353. this.materialIndex = void 0 !== a ? a : 0
  44354. }
  44355. ,
  44356. n.Face3.prototype = {
  44357. constructor: n.Face3,
  44358. clone: function() {
  44359. return (new this.constructor).copy(this)
  44360. },
  44361. copy: function(e) {
  44362. this.a = e.a,
  44363. this.b = e.b,
  44364. this.c = e.c,
  44365. this.normal.copy(e.normal),
  44366. this.color.copy(e.color),
  44367. this.materialIndex = e.materialIndex;
  44368. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  44369. this.vertexNormals[t] = e.vertexNormals[t].clone();
  44370. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  44371. this.vertexColors[t] = e.vertexColors[t].clone();
  44372. return this
  44373. }
  44374. },
  44375. n.BufferAttribute = function(e, t) {
  44376. this.uuid = n.Math.generateUUID(),
  44377. this.array = e,
  44378. this.itemSize = t,
  44379. this.dynamic = !1,
  44380. this.updateRange = {
  44381. offset: 0,
  44382. count: -1
  44383. },
  44384. this.version = 0
  44385. }
  44386. ,
  44387. n.BufferAttribute.prototype = {
  44388. constructor: n.BufferAttribute,
  44389. get count() {
  44390. return this.array.length / this.itemSize
  44391. },
  44392. set needsUpdate(e) {
  44393. e === !0 && this.version++
  44394. },
  44395. setDynamic: function(e) {
  44396. return this.dynamic = e,
  44397. this
  44398. },
  44399. copy: function(e) {
  44400. return this.array = new e.array.constructor(e.array),
  44401. this.itemSize = e.itemSize,
  44402. this.dynamic = e.dynamic,
  44403. this
  44404. },
  44405. copyAt: function(e, t, i) {
  44406. e *= this.itemSize,
  44407. i *= t.itemSize;
  44408. for (var n = 0, r = this.itemSize; n < r; n++)
  44409. this.array[e + n] = t.array[i + n];
  44410. return this
  44411. },
  44412. copyArray: function(e) {
  44413. return this.array.set(e),
  44414. this
  44415. },
  44416. copyColorsArray: function(e) {
  44417. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44418. var a = e[r];
  44419. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  44420. a = new n.Color),
  44421. t[i++] = a.r,
  44422. t[i++] = a.g,
  44423. t[i++] = a.b
  44424. }
  44425. return this
  44426. },
  44427. copyIndicesArray: function(e) {
  44428. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  44429. var o = e[n];
  44430. t[i++] = o.a,
  44431. t[i++] = o.b,
  44432. t[i++] = o.c
  44433. }
  44434. return this
  44435. },
  44436. copyVector2sArray: function(e) {
  44437. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44438. var a = e[r];
  44439. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  44440. a = new n.Vector2),
  44441. t[i++] = a.x,
  44442. t[i++] = a.y
  44443. }
  44444. return this
  44445. },
  44446. copyVector3sArray: function(e) {
  44447. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  44448. var a = e[r];
  44449. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  44450. a = new n.Vector3),
  44451. t[i++] = a.x,
  44452. t[i++] = a.y,
  44453. t[i++] = a.z
  44454. }
  44455. return this
  44456. },
  44457. copyVector4sArray: 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.copyVector4sArray(): vector is undefined", r),
  44461. a = new n.Vector4),
  44462. t[i++] = a.x,
  44463. t[i++] = a.y,
  44464. t[i++] = a.z,
  44465. t[i++] = a.w
  44466. }
  44467. return this
  44468. },
  44469. set: function(e, t) {
  44470. return void 0 === t && (t = 0),
  44471. this.array.set(e, t),
  44472. this
  44473. },
  44474. getX: function(e) {
  44475. return this.array[e * this.itemSize]
  44476. },
  44477. setX: function(e, t) {
  44478. return this.array[e * this.itemSize] = t,
  44479. this
  44480. },
  44481. getY: function(e) {
  44482. return this.array[e * this.itemSize + 1]
  44483. },
  44484. setY: function(e, t) {
  44485. return this.array[e * this.itemSize + 1] = t,
  44486. this
  44487. },
  44488. getZ: function(e) {
  44489. return this.array[e * this.itemSize + 2]
  44490. },
  44491. setZ: function(e, t) {
  44492. return this.array[e * this.itemSize + 2] = t,
  44493. this
  44494. },
  44495. getW: function(e) {
  44496. return this.array[e * this.itemSize + 3]
  44497. },
  44498. setW: function(e, t) {
  44499. return this.array[e * this.itemSize + 3] = t,
  44500. this
  44501. },
  44502. setXY: function(e, t, i) {
  44503. return e *= this.itemSize,
  44504. this.array[e + 0] = t,
  44505. this.array[e + 1] = i,
  44506. this
  44507. },
  44508. setXYZ: function(e, t, i, n) {
  44509. return e *= this.itemSize,
  44510. this.array[e + 0] = t,
  44511. this.array[e + 1] = i,
  44512. this.array[e + 2] = n,
  44513. this
  44514. },
  44515. setXYZW: function(e, t, i, n, r) {
  44516. return e *= this.itemSize,
  44517. this.array[e + 0] = t,
  44518. this.array[e + 1] = i,
  44519. this.array[e + 2] = n,
  44520. this.array[e + 3] = r,
  44521. this
  44522. },
  44523. clone: function() {
  44524. return (new this.constructor).copy(this)
  44525. }
  44526. },
  44527. n.Int8Attribute = function(e, t) {
  44528. return new n.BufferAttribute(new Int8Array(e),t)
  44529. }
  44530. ,
  44531. n.Uint8Attribute = function(e, t) {
  44532. return new n.BufferAttribute(new Uint8Array(e),t)
  44533. }
  44534. ,
  44535. n.Uint8ClampedAttribute = function(e, t) {
  44536. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  44537. }
  44538. ,
  44539. n.Int16Attribute = function(e, t) {
  44540. return new n.BufferAttribute(new Int16Array(e),t)
  44541. }
  44542. ,
  44543. n.Uint16Attribute = function(e, t) {
  44544. return new n.BufferAttribute(new Uint16Array(e),t)
  44545. }
  44546. ;
  44547. n.Int32Attribute = function(e, t) {
  44548. return new n.BufferAttribute(new Int32Array(e),t)
  44549. }
  44550. ;
  44551. n.Uint32Attribute = function(e, t) {
  44552. return new n.BufferAttribute(new Uint32Array(e),t)
  44553. }
  44554. ,
  44555. n.Float32Attribute = function(e, t) {
  44556. return new n.BufferAttribute(new Float32Array(e),t)
  44557. }
  44558. ,
  44559. n.Float64Attribute = function(e, t) {
  44560. return new n.BufferAttribute(new Float64Array(e),t)
  44561. }
  44562. ,
  44563. n.DynamicBufferAttribute = function(e, t) {
  44564. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  44565. new n.BufferAttribute(e,t).setDynamic(!0)
  44566. }
  44567. ,
  44568. n.InstancedBufferAttribute = function(e, t, i) {
  44569. n.BufferAttribute.call(this, e, t),
  44570. this.meshPerAttribute = i || 1
  44571. }
  44572. ,
  44573. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  44574. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  44575. n.InstancedBufferAttribute.prototype.copy = function(e) {
  44576. return n.BufferAttribute.prototype.copy.call(this, e),
  44577. this.meshPerAttribute = e.meshPerAttribute,
  44578. this
  44579. }
  44580. ,
  44581. n.InterleavedBuffer = function(e, t) {
  44582. this.uuid = n.Math.generateUUID(),
  44583. this.array = e,
  44584. this.stride = t,
  44585. this.dynamic = !1,
  44586. this.updateRange = {
  44587. offset: 0,
  44588. count: -1
  44589. },
  44590. this.version = 0
  44591. }
  44592. ,
  44593. n.InterleavedBuffer.prototype = {
  44594. constructor: n.InterleavedBuffer,
  44595. get length() {
  44596. return this.array.length
  44597. },
  44598. get count() {
  44599. return this.array.length / this.stride
  44600. },
  44601. set needsUpdate(e) {
  44602. e === !0 && this.version++
  44603. },
  44604. setDynamic: function(e) {
  44605. return this.dynamic = e,
  44606. this
  44607. },
  44608. copy: function(e) {
  44609. return this.array = new e.array.constructor(e.array),
  44610. this.stride = e.stride,
  44611. this.dynamic = e.dynamic,
  44612. this
  44613. },
  44614. copyAt: function(e, t, i) {
  44615. e *= this.stride,
  44616. i *= t.stride;
  44617. for (var n = 0, r = this.stride; n < r; n++)
  44618. this.array[e + n] = t.array[i + n];
  44619. return this
  44620. },
  44621. set: function(e, t) {
  44622. return void 0 === t && (t = 0),
  44623. this.array.set(e, t),
  44624. this
  44625. },
  44626. clone: function() {
  44627. return (new this.constructor).copy(this)
  44628. }
  44629. },
  44630. n.InstancedInterleavedBuffer = function(e, t, i) {
  44631. n.InterleavedBuffer.call(this, e, t),
  44632. this.meshPerAttribute = i || 1
  44633. }
  44634. ,
  44635. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  44636. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  44637. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  44638. return n.InterleavedBuffer.prototype.copy.call(this, e),
  44639. this.meshPerAttribute = e.meshPerAttribute,
  44640. this
  44641. }
  44642. ,
  44643. n.InterleavedBufferAttribute = function(e, t, i) {
  44644. this.uuid = n.Math.generateUUID(),
  44645. this.data = e,
  44646. this.itemSize = t,
  44647. this.offset = i
  44648. }
  44649. ,
  44650. n.InterleavedBufferAttribute.prototype = {
  44651. constructor: n.InterleavedBufferAttribute,
  44652. get length() {
  44653. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  44654. this.array.length
  44655. },
  44656. get count() {
  44657. return this.data.count
  44658. },
  44659. setX: function(e, t) {
  44660. return this.data.array[e * this.data.stride + this.offset] = t,
  44661. this
  44662. },
  44663. setY: function(e, t) {
  44664. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  44665. this
  44666. },
  44667. setZ: function(e, t) {
  44668. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  44669. this
  44670. },
  44671. setW: function(e, t) {
  44672. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  44673. this
  44674. },
  44675. getX: function(e) {
  44676. return this.data.array[e * this.data.stride + this.offset]
  44677. },
  44678. getY: function(e) {
  44679. return this.data.array[e * this.data.stride + this.offset + 1]
  44680. },
  44681. getZ: function(e) {
  44682. return this.data.array[e * this.data.stride + this.offset + 2]
  44683. },
  44684. getW: function(e) {
  44685. return this.data.array[e * this.data.stride + this.offset + 3]
  44686. },
  44687. setXY: function(e, t, i) {
  44688. return e = e * this.data.stride + this.offset,
  44689. this.data.array[e + 0] = t,
  44690. this.data.array[e + 1] = i,
  44691. this
  44692. },
  44693. setXYZ: function(e, t, i, n) {
  44694. return e = e * this.data.stride + this.offset,
  44695. this.data.array[e + 0] = t,
  44696. this.data.array[e + 1] = i,
  44697. this.data.array[e + 2] = n,
  44698. this
  44699. },
  44700. setXYZW: function(e, t, i, n, r) {
  44701. return e = e * this.data.stride + this.offset,
  44702. this.data.array[e + 0] = t,
  44703. this.data.array[e + 1] = i,
  44704. this.data.array[e + 2] = n,
  44705. this.data.array[e + 3] = r,
  44706. this
  44707. }
  44708. },
  44709. n.Geometry = function() {
  44710. Object.defineProperty(this, "id", {
  44711. value: n.GeometryIdCount++
  44712. }),
  44713. this.uuid = n.Math.generateUUID(),
  44714. this.name = "",
  44715. this.type = "Geometry",
  44716. this.vertices = [],
  44717. this.colors = [],
  44718. this.faces = [],
  44719. this.faceVertexUvs = [[]],
  44720. this.morphTargets = [],
  44721. this.morphNormals = [],
  44722. this.skinWeights = [],
  44723. this.skinIndices = [],
  44724. this.lineDistances = [],
  44725. this.boundingBox = null,
  44726. this.boundingSphere = null,
  44727. this.verticesNeedUpdate = !1,
  44728. this.elementsNeedUpdate = !1,
  44729. this.uvsNeedUpdate = !1,
  44730. this.normalsNeedUpdate = !1,
  44731. this.colorsNeedUpdate = !1,
  44732. this.lineDistancesNeedUpdate = !1,
  44733. this.groupsNeedUpdate = !1
  44734. }
  44735. ,
  44736. n.Geometry.prototype = {
  44737. constructor: n.Geometry,
  44738. applyMatrix: function(e) {
  44739. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  44740. var o = this.vertices[i];
  44741. o.applyMatrix4(e)
  44742. }
  44743. for (var i = 0, r = this.faces.length; i < r; i++) {
  44744. var a = this.faces[i];
  44745. a.normal.applyMatrix3(t).normalize();
  44746. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  44747. a.vertexNormals[s].applyMatrix3(t).normalize()
  44748. }
  44749. return null !== this.boundingBox && this.computeBoundingBox(),
  44750. null !== this.boundingSphere && this.computeBoundingSphere(),
  44751. this.verticesNeedUpdate = !0,
  44752. this.normalsNeedUpdate = !0,
  44753. this
  44754. },
  44755. rotateX: function() {
  44756. var e;
  44757. return function(t) {
  44758. return void 0 === e && (e = new n.Matrix4),
  44759. e.makeRotationX(t),
  44760. this.applyMatrix(e),
  44761. this
  44762. }
  44763. }(),
  44764. rotateY: function() {
  44765. var e;
  44766. return function(t) {
  44767. return void 0 === e && (e = new n.Matrix4),
  44768. e.makeRotationY(t),
  44769. this.applyMatrix(e),
  44770. this
  44771. }
  44772. }(),
  44773. rotateZ: function() {
  44774. var e;
  44775. return function(t) {
  44776. return void 0 === e && (e = new n.Matrix4),
  44777. e.makeRotationZ(t),
  44778. this.applyMatrix(e),
  44779. this
  44780. }
  44781. }(),
  44782. translate: function() {
  44783. var e;
  44784. return function(t, i, r) {
  44785. return void 0 === e && (e = new n.Matrix4),
  44786. e.makeTranslation(t, i, r),
  44787. this.applyMatrix(e),
  44788. this
  44789. }
  44790. }(),
  44791. scale: function() {
  44792. var e;
  44793. return function(t, i, r) {
  44794. return void 0 === e && (e = new n.Matrix4),
  44795. e.makeScale(t, i, r),
  44796. this.applyMatrix(e),
  44797. this
  44798. }
  44799. }(),
  44800. lookAt: function() {
  44801. var e;
  44802. return function(t) {
  44803. void 0 === e && (e = new n.Object3D),
  44804. e.lookAt(t),
  44805. e.updateMatrix(),
  44806. this.applyMatrix(e.matrix)
  44807. }
  44808. }(),
  44809. fromBufferGeometry: function(e) {
  44810. function t(e, t, r, o) {
  44811. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  44812. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  44813. , g = new n.Face3(e,t,r,a,f,o);
  44814. i.faces.push(g),
  44815. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  44816. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  44817. }
  44818. var i = this
  44819. , r = null !== e.index ? e.index.array : void 0
  44820. , o = e.attributes
  44821. , a = o.position.array
  44822. , s = void 0 !== o.normal ? o.normal.array : void 0
  44823. , l = void 0 !== o.color ? o.color.array : void 0
  44824. , c = void 0 !== o.uv ? o.uv.array : void 0
  44825. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  44826. void 0 !== h && (this.faceVertexUvs[1] = []);
  44827. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  44828. g += 2)
  44829. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  44830. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  44831. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  44832. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  44833. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  44834. if (void 0 !== r) {
  44835. var m = e.groups;
  44836. if (m.length > 0)
  44837. for (var f = 0; f < m.length; f++)
  44838. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  44839. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  44840. else
  44841. for (var f = 0; f < r.length; f += 3)
  44842. t(r[f], r[f + 1], r[f + 2])
  44843. } else
  44844. for (var f = 0; f < a.length / 3; f += 3)
  44845. t(f, f + 1, f + 2);
  44846. return this.computeFaceNormals(),
  44847. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  44848. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  44849. this
  44850. },
  44851. center: function() {
  44852. this.computeBoundingBox();
  44853. var e = this.boundingBox.center().negate();
  44854. return this.translate(e.x, e.y, e.z),
  44855. e
  44856. },
  44857. normalize: function() {
  44858. this.computeBoundingSphere();
  44859. var e = this.boundingSphere.center
  44860. , t = this.boundingSphere.radius
  44861. , i = 0 === t ? 1 : 1 / t
  44862. , r = new n.Matrix4;
  44863. 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),
  44864. this.applyMatrix(r),
  44865. this
  44866. },
  44867. computeFaceNormals: function() {
  44868. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  44869. var o = this.faces[i]
  44870. , a = this.vertices[o.a]
  44871. , s = this.vertices[o.b]
  44872. , l = this.vertices[o.c];
  44873. e.subVectors(l, s),
  44874. t.subVectors(a, s),
  44875. e.cross(t),
  44876. e.normalize(),
  44877. o.normal.copy(e)
  44878. }
  44879. },
  44880. computeVertexNormals: function(e) {
  44881. void 0 === e && (e = !0);
  44882. var t, i, r, o, a, s;
  44883. for (s = new Array(this.vertices.length),
  44884. t = 0,
  44885. i = this.vertices.length; t < i; t++)
  44886. s[t] = new n.Vector3;
  44887. if (e) {
  44888. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  44889. for (r = 0,
  44890. o = this.faces.length; r < o; r++)
  44891. a = this.faces[r],
  44892. l = this.vertices[a.a],
  44893. c = this.vertices[a.b],
  44894. h = this.vertices[a.c],
  44895. u.subVectors(h, c),
  44896. d.subVectors(l, c),
  44897. u.cross(d),
  44898. s[a.a].add(u),
  44899. s[a.b].add(u),
  44900. s[a.c].add(u)
  44901. } else
  44902. for (r = 0,
  44903. o = this.faces.length; r < o; r++)
  44904. a = this.faces[r],
  44905. s[a.a].add(a.normal),
  44906. s[a.b].add(a.normal),
  44907. s[a.c].add(a.normal);
  44908. for (t = 0,
  44909. i = this.vertices.length; t < i; t++)
  44910. s[t].normalize();
  44911. for (r = 0,
  44912. o = this.faces.length; r < o; r++) {
  44913. a = this.faces[r];
  44914. var p = a.vertexNormals;
  44915. 3 === p.length ? (p[0].copy(s[a.a]),
  44916. p[1].copy(s[a.b]),
  44917. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  44918. p[1] = s[a.b].clone(),
  44919. p[2] = s[a.c].clone())
  44920. }
  44921. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  44922. },
  44923. computeMorphNormals: function() {
  44924. var e, t, i, r, o;
  44925. for (i = 0,
  44926. r = this.faces.length; i < r; i++)
  44927. for (o = this.faces[i],
  44928. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  44929. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  44930. e = 0,
  44931. t = o.vertexNormals.length; e < t; e++)
  44932. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  44933. var a = new n.Geometry;
  44934. for (a.faces = this.faces,
  44935. e = 0,
  44936. t = this.morphTargets.length; e < t; e++) {
  44937. if (!this.morphNormals[e]) {
  44938. this.morphNormals[e] = {},
  44939. this.morphNormals[e].faceNormals = [],
  44940. this.morphNormals[e].vertexNormals = [];
  44941. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  44942. for (i = 0,
  44943. r = this.faces.length; i < r; i++)
  44944. s = new n.Vector3,
  44945. l = {
  44946. a: new n.Vector3,
  44947. b: new n.Vector3,
  44948. c: new n.Vector3
  44949. },
  44950. c.push(s),
  44951. h.push(l)
  44952. }
  44953. var u = this.morphNormals[e];
  44954. a.vertices = this.morphTargets[e].vertices,
  44955. a.computeFaceNormals(),
  44956. a.computeVertexNormals();
  44957. var s, l;
  44958. for (i = 0,
  44959. r = this.faces.length; i < r; i++)
  44960. o = this.faces[i],
  44961. s = u.faceNormals[i],
  44962. l = u.vertexNormals[i],
  44963. s.copy(o.normal),
  44964. l.a.copy(o.vertexNormals[0]),
  44965. l.b.copy(o.vertexNormals[1]),
  44966. l.c.copy(o.vertexNormals[2])
  44967. }
  44968. for (i = 0,
  44969. r = this.faces.length; i < r; i++)
  44970. o = this.faces[i],
  44971. o.normal = o.__originalFaceNormal,
  44972. o.vertexNormals = o.__originalVertexNormals
  44973. },
  44974. computeTangents: function() {
  44975. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  44976. },
  44977. computeLineDistances: function() {
  44978. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  44979. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  44980. this.lineDistances[i] = e
  44981. },
  44982. computeBoundingBox: function() {
  44983. null === this.boundingBox && (this.boundingBox = new n.Box3),
  44984. this.boundingBox.setFromPoints(this.vertices)
  44985. },
  44986. computeBoundingSphere: function() {
  44987. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  44988. this.boundingSphere.setFromPoints(this.vertices)
  44989. },
  44990. merge: function(e, t, i) {
  44991. if (e instanceof n.Geometry == !1)
  44992. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  44993. 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];
  44994. void 0 === i && (i = 0),
  44995. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  44996. for (var d = 0, p = s.length; d < p; d++) {
  44997. var f = s[d]
  44998. , g = f.clone();
  44999. void 0 !== t && g.applyMatrix4(t),
  45000. a.push(g)
  45001. }
  45002. for (d = 0,
  45003. p = c.length; d < p; d++) {
  45004. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  45005. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  45006. m.normal.copy(y.normal),
  45007. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  45008. for (var E = 0, b = C.length; E < b; E++)
  45009. v = C[E].clone(),
  45010. void 0 !== r && v.applyMatrix3(r).normalize(),
  45011. m.vertexNormals.push(v);
  45012. m.color.copy(y.color);
  45013. for (var E = 0, b = I.length; E < b; E++)
  45014. A = I[E],
  45015. m.vertexColors.push(A.clone());
  45016. m.materialIndex = y.materialIndex + i,
  45017. l.push(m)
  45018. }
  45019. for (d = 0,
  45020. p = u.length; d < p; d++) {
  45021. var w = u[d]
  45022. , _ = [];
  45023. if (void 0 !== w) {
  45024. for (var E = 0, b = w.length; E < b; E++)
  45025. _.push(w[E].clone());
  45026. h.push(_)
  45027. }
  45028. }
  45029. },
  45030. mergeMesh: function(e) {
  45031. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  45032. void this.merge(e.geometry, e.matrix))
  45033. },
  45034. mergeVertices: function() {
  45035. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  45036. for (i = 0,
  45037. n = this.vertices.length; i < n; i++)
  45038. e = this.vertices[i],
  45039. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  45040. void 0 === l[t] ? (l[t] = i,
  45041. c.push(this.vertices[i]),
  45042. h[i] = c.length - 1) : h[i] = h[l[t]];
  45043. var p = [];
  45044. for (i = 0,
  45045. n = this.faces.length; i < n; i++) {
  45046. r = this.faces[i],
  45047. r.a = h[r.a],
  45048. r.b = h[r.b],
  45049. r.c = h[r.c],
  45050. o = [r.a, r.b, r.c];
  45051. for (var f = -1, g = 0; g < 3; g++)
  45052. if (o[g] === o[(g + 1) % 3]) {
  45053. f = g,
  45054. p.push(i);
  45055. break
  45056. }
  45057. }
  45058. for (i = p.length - 1; i >= 0; i--) {
  45059. var m = p[i];
  45060. for (this.faces.splice(m, 1),
  45061. a = 0,
  45062. s = this.faceVertexUvs.length; a < s; a++)
  45063. this.faceVertexUvs[a].splice(m, 1)
  45064. }
  45065. var v = this.vertices.length - c.length;
  45066. return this.vertices = c,
  45067. v
  45068. },
  45069. sortFacesByMaterialIndex: function() {
  45070. function e(e, t) {
  45071. return e.materialIndex - t.materialIndex
  45072. }
  45073. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  45074. t[n]._id = n;
  45075. t.sort(e);
  45076. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  45077. a && a.length === i && (r = []),
  45078. s && s.length === i && (o = []);
  45079. for (var n = 0; n < i; n++) {
  45080. var l = t[n]._id;
  45081. r && r.push(a[l]),
  45082. o && o.push(s[l])
  45083. }
  45084. r && (this.faceVertexUvs[0] = r),
  45085. o && (this.faceVertexUvs[1] = o)
  45086. },
  45087. toJSON: function() {
  45088. function e(e, t, i) {
  45089. return i ? e | 1 << t : e & ~(1 << t)
  45090. }
  45091. function t(e) {
  45092. var t = e.x.toString() + e.y.toString() + e.z.toString();
  45093. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  45094. u.push(e.x, e.y, e.z),
  45095. d[t])
  45096. }
  45097. function i(e) {
  45098. var t = e.r.toString() + e.g.toString() + e.b.toString();
  45099. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  45100. p.push(e.getHex()),
  45101. f[t])
  45102. }
  45103. function n(e) {
  45104. var t = e.x.toString() + e.y.toString();
  45105. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  45106. g.push(e.x, e.y),
  45107. m[t])
  45108. }
  45109. var r = {
  45110. metadata: {
  45111. version: 4.4,
  45112. type: "Geometry",
  45113. generator: "Geometry.toJSON"
  45114. }
  45115. };
  45116. if (r.uuid = this.uuid,
  45117. r.type = this.type,
  45118. "" !== this.name && (r.name = this.name),
  45119. void 0 !== this.parameters) {
  45120. var o = this.parameters;
  45121. for (var a in o)
  45122. void 0 !== o[a] && (r[a] = o[a]);
  45123. return r
  45124. }
  45125. for (var s = [], l = 0; l < this.vertices.length; l++) {
  45126. var c = this.vertices[l];
  45127. s.push(c.x, c.y, c.z)
  45128. }
  45129. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  45130. var v = this.faces[l]
  45131. , A = !0
  45132. , y = !1
  45133. , C = void 0 !== this.faceVertexUvs[0][l]
  45134. , I = v.normal.length() > 0
  45135. , E = v.vertexNormals.length > 0
  45136. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  45137. , w = v.vertexColors.length > 0
  45138. , _ = 0;
  45139. if (_ = e(_, 0, 0),
  45140. _ = e(_, 1, A),
  45141. _ = e(_, 2, y),
  45142. _ = e(_, 3, C),
  45143. _ = e(_, 4, I),
  45144. _ = e(_, 5, E),
  45145. _ = e(_, 6, b),
  45146. _ = e(_, 7, w),
  45147. h.push(_),
  45148. h.push(v.a, v.b, v.c),
  45149. h.push(v.materialIndex),
  45150. C) {
  45151. var T = this.faceVertexUvs[0][l];
  45152. h.push(n(T[0]), n(T[1]), n(T[2]))
  45153. }
  45154. if (I && h.push(t(v.normal)),
  45155. E) {
  45156. var x = v.vertexNormals;
  45157. h.push(t(x[0]), t(x[1]), t(x[2]))
  45158. }
  45159. if (b && h.push(i(v.color)),
  45160. w) {
  45161. var S = v.vertexColors;
  45162. h.push(i(S[0]), i(S[1]), i(S[2]))
  45163. }
  45164. }
  45165. return r.data = {},
  45166. r.data.vertices = s,
  45167. r.data.normals = u,
  45168. p.length > 0 && (r.data.colors = p),
  45169. g.length > 0 && (r.data.uvs = [g]),
  45170. r.data.faces = h,
  45171. r
  45172. },
  45173. clone: function() {
  45174. return (new n.Geometry).copy(this)
  45175. },
  45176. copy: function(e) {
  45177. this.vertices = [],
  45178. this.faces = [],
  45179. this.faceVertexUvs = [[]];
  45180. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  45181. this.vertices.push(t[i].clone());
  45182. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  45183. this.faces.push(r[i].clone());
  45184. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  45185. var o = e.faceVertexUvs[i];
  45186. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  45187. for (var a = 0, s = o.length; a < s; a++) {
  45188. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  45189. var d = l[h];
  45190. c.push(d.clone())
  45191. }
  45192. this.faceVertexUvs[i].push(c)
  45193. }
  45194. }
  45195. return this
  45196. },
  45197. dispose: function() {
  45198. this.dispatchEvent({
  45199. type: "dispose"
  45200. })
  45201. }
  45202. },
  45203. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  45204. n.GeometryIdCount = 0,
  45205. n.DirectGeometry = function() {
  45206. Object.defineProperty(this, "id", {
  45207. value: n.GeometryIdCount++
  45208. }),
  45209. this.uuid = n.Math.generateUUID(),
  45210. this.name = "",
  45211. this.type = "DirectGeometry",
  45212. this.indices = [],
  45213. this.vertices = [],
  45214. this.normals = [],
  45215. this.colors = [],
  45216. this.uvs = [],
  45217. this.uvs2 = [],
  45218. this.groups = [],
  45219. this.morphTargets = {},
  45220. this.skinWeights = [],
  45221. this.skinIndices = [],
  45222. this.boundingBox = null,
  45223. this.boundingSphere = null,
  45224. this.verticesNeedUpdate = !1,
  45225. this.normalsNeedUpdate = !1,
  45226. this.colorsNeedUpdate = !1,
  45227. this.uvsNeedUpdate = !1,
  45228. this.groupsNeedUpdate = !1
  45229. }
  45230. ,
  45231. n.DirectGeometry.prototype = {
  45232. constructor: n.DirectGeometry,
  45233. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  45234. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  45235. computeFaceNormals: function() {
  45236. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  45237. },
  45238. computeVertexNormals: function() {
  45239. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  45240. },
  45241. computeGroups: function(e) {
  45242. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  45243. var a = r[o];
  45244. a.materialIndex !== i && (i = a.materialIndex,
  45245. void 0 !== t && (t.count = 3 * o - t.start,
  45246. n.push(t)),
  45247. t = {
  45248. start: 3 * o,
  45249. materialIndex: i
  45250. })
  45251. }
  45252. void 0 !== t && (t.count = 3 * o - t.start,
  45253. n.push(t)),
  45254. this.groups = n
  45255. },
  45256. fromGeometry: function(e) {
  45257. 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;
  45258. if (c > 0) {
  45259. t = [];
  45260. for (var h = 0; h < c; h++)
  45261. t[h] = [];
  45262. this.morphTargets.position = t
  45263. }
  45264. var u, d = e.morphNormals, p = d.length;
  45265. if (p > 0) {
  45266. u = [];
  45267. for (var h = 0; h < p; h++)
  45268. u[h] = [];
  45269. this.morphTargets.normal = u
  45270. }
  45271. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  45272. var A = i[h];
  45273. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  45274. var y = A.vertexNormals;
  45275. if (3 === y.length)
  45276. this.normals.push(y[0], y[1], y[2]);
  45277. else {
  45278. var C = A.normal;
  45279. this.normals.push(C, C, C)
  45280. }
  45281. var I = A.vertexColors;
  45282. if (3 === I.length)
  45283. this.colors.push(I[0], I[1], I[2]);
  45284. else {
  45285. var E = A.color;
  45286. this.colors.push(E, E, E)
  45287. }
  45288. if (a === !0) {
  45289. var b = o[0][h];
  45290. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  45291. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45292. }
  45293. if (s === !0) {
  45294. var b = o[1][h];
  45295. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  45296. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  45297. }
  45298. for (var w = 0; w < c; w++) {
  45299. var _ = l[w].vertices;
  45300. t[w].push(_[A.a], _[A.b], _[A.c])
  45301. }
  45302. for (var w = 0; w < p; w++) {
  45303. var T = d[w].vertexNormals[h];
  45304. u[w].push(T.a, T.b, T.c)
  45305. }
  45306. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  45307. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  45308. }
  45309. return this.computeGroups(e),
  45310. this.verticesNeedUpdate = e.verticesNeedUpdate,
  45311. this.normalsNeedUpdate = e.normalsNeedUpdate,
  45312. this.colorsNeedUpdate = e.colorsNeedUpdate,
  45313. this.uvsNeedUpdate = e.uvsNeedUpdate,
  45314. this.groupsNeedUpdate = e.groupsNeedUpdate,
  45315. this
  45316. },
  45317. dispose: function() {
  45318. this.dispatchEvent({
  45319. type: "dispose"
  45320. })
  45321. }
  45322. },
  45323. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  45324. n.BufferGeometry = function() {
  45325. Object.defineProperty(this, "id", {
  45326. value: n.GeometryIdCount++
  45327. }),
  45328. this.uuid = n.Math.generateUUID(),
  45329. this.name = "",
  45330. this.type = "BufferGeometry",
  45331. this.index = null,
  45332. this.attributes = {},
  45333. this.morphAttributes = {},
  45334. this.groups = [],
  45335. this.boundingBox = null,
  45336. this.boundingSphere = null,
  45337. this.drawRange = {
  45338. start: 0,
  45339. count: 1 / 0
  45340. }
  45341. }
  45342. ,
  45343. n.BufferGeometry.prototype = {
  45344. constructor: n.BufferGeometry,
  45345. getIndex: function() {
  45346. return this.index
  45347. },
  45348. setIndex: function(e) {
  45349. this.index = e
  45350. },
  45351. addAttribute: function(e, t) {
  45352. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  45353. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  45354. void this.setIndex(t)) : (this.attributes[e] = t,
  45355. this)
  45356. },
  45357. getAttribute: function(e) {
  45358. return this.attributes[e]
  45359. },
  45360. removeAttribute: function(e) {
  45361. return delete this.attributes[e],
  45362. this
  45363. },
  45364. addGroup: function(e, t, i) {
  45365. this.groups.push({
  45366. start: e,
  45367. count: t,
  45368. materialIndex: void 0 !== i ? i : 0
  45369. })
  45370. },
  45371. clearGroups: function() {
  45372. this.groups = []
  45373. },
  45374. setDrawRange: function(e, t) {
  45375. this.drawRange.start = e,
  45376. this.drawRange.count = t
  45377. },
  45378. applyMatrix: function(e) {
  45379. var t = this.attributes.position;
  45380. void 0 !== t && (e.applyToVector3Array(t.array),
  45381. t.needsUpdate = !0);
  45382. var i = this.attributes.normal;
  45383. if (void 0 !== i) {
  45384. var r = (new n.Matrix3).getNormalMatrix(e);
  45385. r.applyToVector3Array(i.array),
  45386. i.needsUpdate = !0
  45387. }
  45388. return null !== this.boundingBox && this.computeBoundingBox(),
  45389. null !== this.boundingSphere && this.computeBoundingSphere(),
  45390. this
  45391. },
  45392. rotateX: function() {
  45393. var e;
  45394. return function(t) {
  45395. return void 0 === e && (e = new n.Matrix4),
  45396. e.makeRotationX(t),
  45397. this.applyMatrix(e),
  45398. this
  45399. }
  45400. }(),
  45401. rotateY: function() {
  45402. var e;
  45403. return function(t) {
  45404. return void 0 === e && (e = new n.Matrix4),
  45405. e.makeRotationY(t),
  45406. this.applyMatrix(e),
  45407. this
  45408. }
  45409. }(),
  45410. rotateZ: function() {
  45411. var e;
  45412. return function(t) {
  45413. return void 0 === e && (e = new n.Matrix4),
  45414. e.makeRotationZ(t),
  45415. this.applyMatrix(e),
  45416. this
  45417. }
  45418. }(),
  45419. translate: function() {
  45420. var e;
  45421. return function(t, i, r) {
  45422. return void 0 === e && (e = new n.Matrix4),
  45423. e.makeTranslation(t, i, r),
  45424. this.applyMatrix(e),
  45425. this
  45426. }
  45427. }(),
  45428. scale: function() {
  45429. var e;
  45430. return function(t, i, r) {
  45431. return void 0 === e && (e = new n.Matrix4),
  45432. e.makeScale(t, i, r),
  45433. this.applyMatrix(e),
  45434. this
  45435. }
  45436. }(),
  45437. lookAt: function() {
  45438. var e;
  45439. return function(t) {
  45440. void 0 === e && (e = new n.Object3D),
  45441. e.lookAt(t),
  45442. e.updateMatrix(),
  45443. this.applyMatrix(e.matrix)
  45444. }
  45445. }(),
  45446. center: function() {
  45447. this.computeBoundingBox();
  45448. var e = this.boundingBox.center().negate();
  45449. return this.translate(e.x, e.y, e.z),
  45450. e
  45451. },
  45452. setFromObject: function(e) {
  45453. var t = e.geometry;
  45454. if (e instanceof n.Points || e instanceof n.Line) {
  45455. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  45456. , r = new n.Float32Attribute(3 * t.colors.length,3);
  45457. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  45458. this.addAttribute("color", r.copyColorsArray(t.colors)),
  45459. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  45460. var o = new n.Float32Attribute(t.lineDistances.length,1);
  45461. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  45462. }
  45463. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  45464. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  45465. } else
  45466. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  45467. return this
  45468. },
  45469. updateFromObject: function(e) {
  45470. var t = e.geometry;
  45471. if (e instanceof n.Mesh) {
  45472. var i = t.__directGeometry;
  45473. if (void 0 === i)
  45474. return this.fromGeometry(t);
  45475. i.verticesNeedUpdate = t.verticesNeedUpdate,
  45476. i.normalsNeedUpdate = t.normalsNeedUpdate,
  45477. i.colorsNeedUpdate = t.colorsNeedUpdate,
  45478. i.uvsNeedUpdate = t.uvsNeedUpdate,
  45479. i.groupsNeedUpdate = t.groupsNeedUpdate,
  45480. t.verticesNeedUpdate = !1,
  45481. t.normalsNeedUpdate = !1,
  45482. t.colorsNeedUpdate = !1,
  45483. t.uvsNeedUpdate = !1,
  45484. t.groupsNeedUpdate = !1,
  45485. t = i
  45486. }
  45487. if (t.verticesNeedUpdate === !0) {
  45488. var r = this.attributes.position;
  45489. void 0 !== r && (r.copyVector3sArray(t.vertices),
  45490. r.needsUpdate = !0),
  45491. t.verticesNeedUpdate = !1
  45492. }
  45493. if (t.normalsNeedUpdate === !0) {
  45494. var r = this.attributes.normal;
  45495. void 0 !== r && (r.copyVector3sArray(t.normals),
  45496. r.needsUpdate = !0),
  45497. t.normalsNeedUpdate = !1
  45498. }
  45499. if (t.colorsNeedUpdate === !0) {
  45500. var r = this.attributes.color;
  45501. void 0 !== r && (r.copyColorsArray(t.colors),
  45502. r.needsUpdate = !0),
  45503. t.colorsNeedUpdate = !1
  45504. }
  45505. if (t.uvsNeedUpdate) {
  45506. var r = this.attributes.uv;
  45507. void 0 !== r && (r.copyVector2sArray(t.uvs),
  45508. r.needsUpdate = !0),
  45509. t.uvsNeedUpdate = !1
  45510. }
  45511. if (t.lineDistancesNeedUpdate) {
  45512. var r = this.attributes.lineDistance;
  45513. void 0 !== r && (r.copyArray(t.lineDistances),
  45514. r.needsUpdate = !0),
  45515. t.lineDistancesNeedUpdate = !1
  45516. }
  45517. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  45518. this.groups = t.groups,
  45519. t.groupsNeedUpdate = !1),
  45520. this
  45521. },
  45522. fromGeometry: function(e) {
  45523. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  45524. this.fromDirectGeometry(e.__directGeometry)
  45525. },
  45526. fromDirectGeometry: function(e) {
  45527. var t = new Float32Array(3 * e.vertices.length);
  45528. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  45529. e.normals.length > 0) {
  45530. var i = new Float32Array(3 * e.normals.length);
  45531. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  45532. }
  45533. if (e.colors.length > 0) {
  45534. var r = new Float32Array(3 * e.colors.length);
  45535. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  45536. }
  45537. if (e.uvs.length > 0) {
  45538. var o = new Float32Array(2 * e.uvs.length);
  45539. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  45540. }
  45541. if (e.uvs2.length > 0) {
  45542. var a = new Float32Array(2 * e.uvs2.length);
  45543. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  45544. }
  45545. if (e.indices.length > 0) {
  45546. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  45547. , l = new s(3 * e.indices.length);
  45548. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  45549. }
  45550. this.groups = e.groups;
  45551. for (var c in e.morphTargets) {
  45552. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  45553. var f = u[d]
  45554. , g = new n.Float32Attribute(3 * f.length,3);
  45555. h.push(g.copyVector3sArray(f))
  45556. }
  45557. this.morphAttributes[c] = h
  45558. }
  45559. if (e.skinIndices.length > 0) {
  45560. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  45561. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  45562. }
  45563. if (e.skinWeights.length > 0) {
  45564. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  45565. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  45566. }
  45567. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  45568. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  45569. this
  45570. },
  45571. computeBoundingBox: function() {
  45572. new n.Vector3;
  45573. return function() {
  45574. null === this.boundingBox && (this.boundingBox = new n.Box3);
  45575. var e = this.attributes.position.array;
  45576. e && this.boundingBox.setFromArray(e),
  45577. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  45578. this.boundingBox.max.set(0, 0, 0)),
  45579. (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)
  45580. }
  45581. }(),
  45582. computeBoundingSphere: function() {
  45583. var e = new n.Box3
  45584. , t = new n.Vector3;
  45585. return function() {
  45586. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  45587. var i = this.attributes.position.array;
  45588. if (i) {
  45589. var r = this.boundingSphere.center;
  45590. e.setFromArray(i),
  45591. e.center(r);
  45592. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  45593. t.fromArray(i, a),
  45594. o = Math.max(o, r.distanceToSquared(t));
  45595. this.boundingSphere.radius = Math.sqrt(o),
  45596. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  45597. }
  45598. }
  45599. }(),
  45600. computeFaceNormals: function() {},
  45601. computeVertexNormals: function() {
  45602. var e = this.index
  45603. , t = this.attributes
  45604. , i = this.groups;
  45605. if (t.position) {
  45606. var r = t.position.array;
  45607. if (void 0 === t.normal)
  45608. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  45609. else
  45610. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  45611. o[a] = 0;
  45612. 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;
  45613. if (e) {
  45614. var v = e.array;
  45615. 0 === i.length && this.addGroup(0, v.length);
  45616. for (var A = 0, y = i.length; A < y; ++A)
  45617. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  45618. l = 3 * v[a + 0],
  45619. c = 3 * v[a + 1],
  45620. h = 3 * v[a + 2],
  45621. d.fromArray(r, l),
  45622. p.fromArray(r, c),
  45623. f.fromArray(r, h),
  45624. g.subVectors(f, p),
  45625. m.subVectors(d, p),
  45626. g.cross(m),
  45627. u[l] += g.x,
  45628. u[l + 1] += g.y,
  45629. u[l + 2] += g.z,
  45630. u[c] += g.x,
  45631. u[c + 1] += g.y,
  45632. u[c + 2] += g.z,
  45633. u[h] += g.x,
  45634. u[h + 1] += g.y,
  45635. u[h + 2] += g.z
  45636. } else
  45637. for (var a = 0, s = r.length; a < s; a += 9)
  45638. d.fromArray(r, a),
  45639. p.fromArray(r, a + 3),
  45640. f.fromArray(r, a + 6),
  45641. g.subVectors(f, p),
  45642. m.subVectors(d, p),
  45643. g.cross(m),
  45644. u[a] = g.x,
  45645. u[a + 1] = g.y,
  45646. u[a + 2] = g.z,
  45647. u[a + 3] = g.x,
  45648. u[a + 4] = g.y,
  45649. u[a + 5] = g.z,
  45650. u[a + 6] = g.x,
  45651. u[a + 7] = g.y,
  45652. u[a + 8] = g.z;
  45653. this.normalizeNormals(),
  45654. t.normal.needsUpdate = !0
  45655. }
  45656. },
  45657. merge: function(e, t) {
  45658. if (e instanceof n.BufferGeometry == !1)
  45659. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  45660. void 0 === t && (t = 0);
  45661. var i = this.attributes;
  45662. for (var r in i)
  45663. if (void 0 !== e.attributes[r])
  45664. 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++,
  45665. u++)
  45666. a[u] = l[h];
  45667. return this
  45668. },
  45669. normalizeNormals: function() {
  45670. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  45671. e = r[o],
  45672. t = r[o + 1],
  45673. i = r[o + 2],
  45674. n = 1 / Math.sqrt(e * e + t * t + i * i),
  45675. r[o] *= n,
  45676. r[o + 1] *= n,
  45677. r[o + 2] *= n
  45678. },
  45679. toNonIndexed: function() {
  45680. if (null === this.index)
  45681. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  45682. this;
  45683. var e = new n.BufferGeometry
  45684. , t = this.index.array
  45685. , i = this.attributes;
  45686. for (var r in i) {
  45687. 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++) {
  45688. c = t[u] * s;
  45689. for (var p = 0; p < s; p++)
  45690. l[h++] = a[c++]
  45691. }
  45692. e.addAttribute(r, new n.BufferAttribute(l,s))
  45693. }
  45694. return e
  45695. },
  45696. toJSON: function() {
  45697. var e = {
  45698. metadata: {
  45699. version: 4.4,
  45700. type: "BufferGeometry",
  45701. generator: "BufferGeometry.toJSON"
  45702. }
  45703. };
  45704. if (e.uuid = this.uuid,
  45705. e.type = this.type,
  45706. "" !== this.name && (e.name = this.name),
  45707. void 0 !== this.parameters) {
  45708. var t = this.parameters;
  45709. for (var i in t)
  45710. void 0 !== t[i] && (e[i] = t[i]);
  45711. return e
  45712. }
  45713. e.data = {
  45714. attributes: {}
  45715. };
  45716. var n = this.index;
  45717. if (null !== n) {
  45718. var r = Array.prototype.slice.call(n.array);
  45719. e.data.index = {
  45720. type: n.array.constructor.name,
  45721. array: r
  45722. }
  45723. }
  45724. var o = this.attributes;
  45725. for (var i in o) {
  45726. var a = o[i]
  45727. , r = Array.prototype.slice.call(a.array);
  45728. e.data.attributes[i] = {
  45729. itemSize: a.itemSize,
  45730. type: a.array.constructor.name,
  45731. array: r
  45732. }
  45733. }
  45734. var s = this.groups;
  45735. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  45736. var l = this.boundingSphere;
  45737. return null !== l && (e.data.boundingSphere = {
  45738. center: l.center.toArray(),
  45739. radius: l.radius
  45740. }),
  45741. e
  45742. },
  45743. clone: function() {
  45744. return (new n.BufferGeometry).copy(this)
  45745. },
  45746. copy: function(e) {
  45747. var t = e.index;
  45748. null !== t && this.setIndex(t.clone());
  45749. var i = e.attributes;
  45750. for (var n in i) {
  45751. var r = i[n];
  45752. this.addAttribute(n, r.clone())
  45753. }
  45754. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45755. var l = o[a];
  45756. this.addGroup(l.start, l.count)
  45757. }
  45758. return this
  45759. },
  45760. dispose: function() {
  45761. this.dispatchEvent({
  45762. type: "dispose"
  45763. })
  45764. }
  45765. },
  45766. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  45767. n.BufferGeometry.MaxIndex = 65535,
  45768. n.InstancedBufferGeometry = function() {
  45769. n.BufferGeometry.call(this),
  45770. this.type = "InstancedBufferGeometry",
  45771. this.maxInstancedCount = void 0
  45772. }
  45773. ,
  45774. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  45775. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  45776. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  45777. this.groups.push({
  45778. start: e,
  45779. count: t,
  45780. instances: i
  45781. })
  45782. }
  45783. ,
  45784. n.InstancedBufferGeometry.prototype.copy = function(e) {
  45785. var t = e.index;
  45786. null !== t && this.setIndex(t.clone());
  45787. var i = e.attributes;
  45788. for (var n in i) {
  45789. var r = i[n];
  45790. this.addAttribute(n, r.clone())
  45791. }
  45792. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  45793. var l = o[a];
  45794. this.addGroup(l.start, l.count, l.instances)
  45795. }
  45796. return this
  45797. }
  45798. ,
  45799. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  45800. n.Uniform = function(e, t) {
  45801. this.type = e,
  45802. this.value = t,
  45803. this.dynamic = !1
  45804. }
  45805. ,
  45806. n.Uniform.prototype = {
  45807. constructor: n.Uniform,
  45808. onUpdate: function(e) {
  45809. return this.dynamic = !0,
  45810. this.onUpdateCallback = e,
  45811. this
  45812. }
  45813. },
  45814. n.AnimationClip = function(e, t, i) {
  45815. this.name = e || n.Math.generateUUID(),
  45816. this.tracks = i,
  45817. this.duration = void 0 !== t ? t : -1,
  45818. this.duration < 0 && this.resetDuration(),
  45819. this.trim(),
  45820. this.optimize()
  45821. }
  45822. ,
  45823. n.AnimationClip.prototype = {
  45824. constructor: n.AnimationClip,
  45825. resetDuration: function() {
  45826. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  45827. var r = this.tracks[i];
  45828. t = Math.max(t, r.times[r.times.length - 1])
  45829. }
  45830. this.duration = t
  45831. },
  45832. trim: function() {
  45833. for (var e = 0; e < this.tracks.length; e++)
  45834. this.tracks[e].trim(0, this.duration);
  45835. return this
  45836. },
  45837. optimize: function() {
  45838. for (var e = 0; e < this.tracks.length; e++)
  45839. this.tracks[e].optimize();
  45840. return this
  45841. }
  45842. },
  45843. Object.assign(n.AnimationClip, {
  45844. parse: function(e) {
  45845. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  45846. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  45847. return new n.AnimationClip(e.name,e.duration,t)
  45848. },
  45849. toJSON: function(e) {
  45850. for (var t = [], i = e.tracks, r = {
  45851. name: e.name,
  45852. duration: e.duration,
  45853. tracks: t
  45854. }, o = 0, a = i.length; o !== a; ++o)
  45855. t.push(n.KeyframeTrack.toJSON(i[o]));
  45856. return r
  45857. },
  45858. CreateFromMorphTargetSequence: function(e, t, i) {
  45859. for (var r = t.length, o = [], a = 0; a < r; a++) {
  45860. var s = []
  45861. , l = [];
  45862. s.push((a + r - 1) % r, a, (a + 1) % r),
  45863. l.push(0, 1, 0);
  45864. var c = n.AnimationUtils.getKeyframeOrder(s);
  45865. s = n.AnimationUtils.sortedArray(s, 1, c),
  45866. l = n.AnimationUtils.sortedArray(l, 1, c),
  45867. 0 === s[0] && (s.push(r),
  45868. l.push(l[0])),
  45869. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  45870. }
  45871. return new n.AnimationClip(e,-1,o)
  45872. },
  45873. findByName: function(e, t) {
  45874. for (var i = 0; i < e.length; i++)
  45875. if (e[i].name === t)
  45876. return e[i];
  45877. return null
  45878. },
  45879. CreateClipsFromMorphTargetSequences: function(e, t) {
  45880. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  45881. var s = e[o]
  45882. , l = s.name.match(r);
  45883. if (l && l.length > 1) {
  45884. var c = l[1]
  45885. , h = i[c];
  45886. h || (i[c] = h = []),
  45887. h.push(s)
  45888. }
  45889. }
  45890. var u = [];
  45891. for (var c in i)
  45892. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  45893. return u
  45894. },
  45895. parseAnimation: function(e, t, i) {
  45896. if (!e)
  45897. return console.error(" no animation in JSONLoader data"),
  45898. null;
  45899. for (var r = function(e, t, i, r, o) {
  45900. if (0 !== i.length) {
  45901. var a = []
  45902. , s = [];
  45903. n.AnimationUtils.flattenJSON(i, a, s, r),
  45904. 0 !== a.length && o.push(new e(t,a,s))
  45905. }
  45906. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  45907. var u = c[h].keys;
  45908. if (u && 0 != u.length)
  45909. if (u[0].morphTargets) {
  45910. for (var d = {}, p = 0; p < u.length; p++)
  45911. if (u[p].morphTargets)
  45912. for (var f = 0; f < u[p].morphTargets.length; f++)
  45913. d[u[p].morphTargets[f]] = -1;
  45914. for (var g in d) {
  45915. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  45916. var A = u[p];
  45917. m.push(A.time),
  45918. v.push(A.morphTarget === g ? 1 : 0)
  45919. }
  45920. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  45921. }
  45922. s = d.length * (l || 1)
  45923. } else {
  45924. var y = ".bones[" + t[h].name + "]";
  45925. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  45926. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  45927. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  45928. }
  45929. }
  45930. if (0 === o.length)
  45931. return null;
  45932. var C = new n.AnimationClip(a,s,o);
  45933. return C
  45934. }
  45935. }),
  45936. n.AnimationMixer = function(e) {
  45937. this._root = e,
  45938. this._initMemoryManager(),
  45939. this._accuIndex = 0,
  45940. this.time = 0,
  45941. this.timeScale = 1
  45942. }
  45943. ,
  45944. n.AnimationMixer.prototype = {
  45945. constructor: n.AnimationMixer,
  45946. clipAction: function(e, t) {
  45947. 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];
  45948. if (void 0 !== l) {
  45949. var c = l.actionByRoot[o];
  45950. if (void 0 !== c)
  45951. return c;
  45952. if (i = l.knownActions[0],
  45953. s = i._clip,
  45954. e !== a && e !== s)
  45955. throw new Error("Different clips with the same name detected!")
  45956. }
  45957. if (null === s)
  45958. return null;
  45959. var h = new n.AnimationMixer._Action(this,s,t);
  45960. return this._bindAction(h, i),
  45961. this._addInactiveAction(h, a, o),
  45962. h
  45963. },
  45964. existingAction: function(e, t) {
  45965. var i = t || this._root
  45966. , n = i.uuid
  45967. , r = "string" == typeof e ? e : e.name
  45968. , o = this._actionsByClip[r];
  45969. return void 0 !== o ? o.actionByRoot[n] || null : null
  45970. },
  45971. stopAllAction: function() {
  45972. var e = this._actions
  45973. , t = this._nActiveActions
  45974. , i = this._bindings
  45975. , n = this._nActiveBindings;
  45976. this._nActiveActions = 0,
  45977. this._nActiveBindings = 0;
  45978. for (var r = 0; r !== t; ++r)
  45979. e[r].reset();
  45980. for (var r = 0; r !== n; ++r)
  45981. i[r].useCount = 0;
  45982. return this
  45983. },
  45984. update: function(e) {
  45985. e *= this.timeScale;
  45986. 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) {
  45987. var s = t[a];
  45988. s.enabled && s._update(n, e, r, o)
  45989. }
  45990. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  45991. l[a].apply(o);
  45992. return this
  45993. },
  45994. getRoot: function() {
  45995. return this._root
  45996. },
  45997. uncacheClip: function(e) {
  45998. var t = this._actions
  45999. , i = e.name
  46000. , n = this._actionsByClip
  46001. , r = n[i];
  46002. if (void 0 !== r) {
  46003. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  46004. var l = o[a];
  46005. this._deactivateAction(l);
  46006. var c = l._cacheIndex
  46007. , h = t[t.length - 1];
  46008. l._cacheIndex = null,
  46009. l._byClipCacheIndex = null,
  46010. h._cacheIndex = c,
  46011. t[c] = h,
  46012. t.pop(),
  46013. this._removeInactiveBindingsForAction(l)
  46014. }
  46015. delete n[i]
  46016. }
  46017. },
  46018. uncacheRoot: function(e) {
  46019. var t = e.uuid
  46020. , i = this._actionsByClip;
  46021. for (var n in i) {
  46022. var r = i[n].actionByRoot
  46023. , o = r[t];
  46024. void 0 !== o && (this._deactivateAction(o),
  46025. this._removeInactiveAction(o))
  46026. }
  46027. var a = this._bindingsByRootAndName
  46028. , s = a[t];
  46029. if (void 0 !== s)
  46030. for (var l in s) {
  46031. var c = s[l];
  46032. c.restoreOriginalState(),
  46033. this._removeInactiveBinding(c)
  46034. }
  46035. },
  46036. uncacheAction: function(e, t) {
  46037. var i = this.existingAction(e, t);
  46038. null !== i && (this._deactivateAction(i),
  46039. this._removeInactiveAction(i))
  46040. }
  46041. },
  46042. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  46043. n.AnimationMixer._Action = function(e, t, i) {
  46044. this._mixer = e,
  46045. this._clip = t,
  46046. this._localRoot = i || null;
  46047. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  46048. endingStart: n.ZeroCurvatureEnding,
  46049. endingEnd: n.ZeroCurvatureEnding
  46050. }, l = 0; l !== o; ++l) {
  46051. var c = r[l].createInterpolant(null);
  46052. a[l] = c,
  46053. c.settings = s
  46054. }
  46055. this._interpolantSettings = s,
  46056. this._interpolants = a,
  46057. this._propertyBindings = new Array(o),
  46058. this._cacheIndex = null,
  46059. this._byClipCacheIndex = null,
  46060. this._timeScaleInterpolant = null,
  46061. this._weightInterpolant = null,
  46062. this.loop = n.LoopRepeat,
  46063. this._loopCount = -1,
  46064. this._startTime = null,
  46065. this.time = 0,
  46066. this.timeScale = 1,
  46067. this._effectiveTimeScale = 1,
  46068. this.weight = 1,
  46069. this._effectiveWeight = 1,
  46070. this.repetitions = 1 / 0,
  46071. this.paused = !1,
  46072. this.enabled = !0,
  46073. this.clampWhenFinished = !1,
  46074. this.zeroSlopeAtStart = !0,
  46075. this.zeroSlopeAtEnd = !0
  46076. }
  46077. ,
  46078. n.AnimationMixer._Action.prototype = {
  46079. constructor: n.AnimationMixer._Action,
  46080. play: function() {
  46081. return this._mixer._activateAction(this),
  46082. this
  46083. },
  46084. stop: function() {
  46085. return this._mixer._deactivateAction(this),
  46086. this.reset()
  46087. },
  46088. reset: function() {
  46089. return this.paused = !1,
  46090. this.enabled = !0,
  46091. this.time = 0,
  46092. this._loopCount = -1,
  46093. this._startTime = null,
  46094. this.stopFading().stopWarping()
  46095. },
  46096. isRunning: function() {
  46097. this._startTime;
  46098. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  46099. },
  46100. isScheduled: function() {
  46101. return this._mixer._isActiveAction(this)
  46102. },
  46103. startAt: function(e) {
  46104. return this._startTime = e,
  46105. this
  46106. },
  46107. setLoop: function(e, t) {
  46108. return this.loop = e,
  46109. this.repetitions = t,
  46110. this
  46111. },
  46112. setEffectiveWeight: function(e) {
  46113. return this.weight = e,
  46114. this._effectiveWeight = this.enabled ? e : 0,
  46115. this.stopFading()
  46116. },
  46117. getEffectiveWeight: function() {
  46118. return this._effectiveWeight
  46119. },
  46120. fadeIn: function(e) {
  46121. return this._scheduleFading(e, 0, 1)
  46122. },
  46123. fadeOut: function(e) {
  46124. return this._scheduleFading(e, 1, 0)
  46125. },
  46126. crossFadeFrom: function(e, t, i) {
  46127. this._mixer;
  46128. if (e.fadeOut(t),
  46129. this.fadeIn(t),
  46130. i) {
  46131. var n = this._clip.duration
  46132. , r = e._clip.duration
  46133. , o = r / n
  46134. , a = n / r;
  46135. e.warp(1, o, t),
  46136. this.warp(a, 1, t)
  46137. }
  46138. return this
  46139. },
  46140. crossFadeTo: function(e, t, i) {
  46141. return e.crossFadeFrom(this, t, i)
  46142. },
  46143. stopFading: function() {
  46144. var e = this._weightInterpolant;
  46145. return null !== e && (this._weightInterpolant = null,
  46146. this._mixer._takeBackControlInterpolant(e)),
  46147. this
  46148. },
  46149. setEffectiveTimeScale: function(e) {
  46150. return this.timeScale = e,
  46151. this._effectiveTimeScale = this.paused ? 0 : e,
  46152. this.stopWarping()
  46153. },
  46154. getEffectiveTimeScale: function() {
  46155. return this._effectiveTimeScale
  46156. },
  46157. setDuration: function(e) {
  46158. return this.timeScale = this._clip.duration / e,
  46159. this.stopWarping()
  46160. },
  46161. syncWith: function(e) {
  46162. return this.time = e.time,
  46163. this.timeScale = e.timeScale,
  46164. this.stopWarping()
  46165. },
  46166. halt: function(e) {
  46167. return this.warp(this._currentTimeScale, 0, e)
  46168. },
  46169. warp: function(e, t, i) {
  46170. var n = this._mixer
  46171. , r = n.time
  46172. , o = this._timeScaleInterpolant
  46173. , a = this.timeScale;
  46174. null === o && (o = n._lendControlInterpolant(),
  46175. this._timeScaleInterpolant = o);
  46176. var s = o.parameterPositions
  46177. , l = o.sampleValues;
  46178. return s[0] = r,
  46179. s[1] = r + i,
  46180. l[0] = e / a,
  46181. l[1] = t / a,
  46182. this
  46183. },
  46184. stopWarping: function() {
  46185. var e = this._timeScaleInterpolant;
  46186. return null !== e && (this._timeScaleInterpolant = null,
  46187. this._mixer._takeBackControlInterpolant(e)),
  46188. this
  46189. },
  46190. getMixer: function() {
  46191. return this._mixer
  46192. },
  46193. getClip: function() {
  46194. return this._clip
  46195. },
  46196. getRoot: function() {
  46197. return this._localRoot || this._mixer._root
  46198. },
  46199. _update: function(e, t, i, n) {
  46200. var r = this._startTime;
  46201. if (null !== r) {
  46202. var o = (e - r) * i;
  46203. if (o < 0 || 0 === i)
  46204. return;
  46205. this._startTime = null,
  46206. t = i * o
  46207. }
  46208. t *= this._updateTimeScale(e);
  46209. var a = this._updateTime(t)
  46210. , s = this._updateWeight(e);
  46211. if (s > 0)
  46212. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  46213. l[h].evaluate(a),
  46214. c[h].accumulate(n, s)
  46215. },
  46216. _updateWeight: function(e) {
  46217. var t = 0;
  46218. if (this.enabled) {
  46219. t = this.weight;
  46220. var i = this._weightInterpolant;
  46221. if (null !== i) {
  46222. var n = i.evaluate(e)[0];
  46223. t *= n,
  46224. e > i.parameterPositions[1] && (this.stopFading(),
  46225. 0 === n && (this.enabled = !1))
  46226. }
  46227. }
  46228. return this._effectiveWeight = t,
  46229. t
  46230. },
  46231. _updateTimeScale: function(e) {
  46232. var t = 0;
  46233. if (!this.paused) {
  46234. t = this.timeScale;
  46235. var i = this._timeScaleInterpolant;
  46236. if (null !== i) {
  46237. var n = i.evaluate(e)[0];
  46238. t *= n,
  46239. e > i.parameterPositions[1] && (this.stopWarping(),
  46240. 0 === t ? this.pause = !0 : this.timeScale = t)
  46241. }
  46242. }
  46243. return this._effectiveTimeScale = t,
  46244. t
  46245. },
  46246. _updateTime: function(e) {
  46247. var t = this.time + e;
  46248. if (0 === e)
  46249. return t;
  46250. var i = this._clip.duration
  46251. , r = this.loop
  46252. , o = this._loopCount
  46253. , a = !1;
  46254. switch (r) {
  46255. case n.LoopOnce:
  46256. if (o === -1 && (this.loopCount = 0,
  46257. this._setEndings(!0, !0, !1)),
  46258. t >= i)
  46259. t = i;
  46260. else {
  46261. if (!(t < 0))
  46262. break;
  46263. t = 0
  46264. }
  46265. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  46266. this._mixer.dispatchEvent({
  46267. type: "finished",
  46268. action: this,
  46269. direction: e < 0 ? -1 : 1
  46270. });
  46271. break;
  46272. case n.LoopPingPong:
  46273. a = !0;
  46274. case n.LoopRepeat:
  46275. if (o === -1 && (e > 0 ? (o = 0,
  46276. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  46277. t >= i || t < 0) {
  46278. var s = Math.floor(t / i);
  46279. t -= i * s,
  46280. o += Math.abs(s);
  46281. var l = this.repetitions - o;
  46282. if (l < 0) {
  46283. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  46284. t = e > 0 ? i : 0,
  46285. this._mixer.dispatchEvent({
  46286. type: "finished",
  46287. action: this,
  46288. direction: e > 0 ? 1 : -1
  46289. });
  46290. break
  46291. }
  46292. if (0 === l) {
  46293. var c = e < 0;
  46294. this._setEndings(c, !c, a)
  46295. } else
  46296. this._setEndings(!1, !1, a);
  46297. this._loopCount = o,
  46298. this._mixer.dispatchEvent({
  46299. type: "loop",
  46300. action: this,
  46301. loopDelta: s
  46302. })
  46303. }
  46304. if (r === n.LoopPingPong && 1 === (1 & o))
  46305. return this.time = t,
  46306. i - t
  46307. }
  46308. return this.time = t,
  46309. t
  46310. },
  46311. _setEndings: function(e, t, i) {
  46312. var r = this._interpolantSettings;
  46313. i ? (r.endingStart = n.ZeroSlopeEnding,
  46314. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  46315. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  46316. },
  46317. _scheduleFading: function(e, t, i) {
  46318. var n = this._mixer
  46319. , r = n.time
  46320. , o = this._weightInterpolant;
  46321. null === o && (o = n._lendControlInterpolant(),
  46322. this._weightInterpolant = o);
  46323. var a = o.parameterPositions
  46324. , s = o.sampleValues;
  46325. return a[0] = r,
  46326. s[0] = t,
  46327. a[1] = r + e,
  46328. s[1] = i,
  46329. this
  46330. }
  46331. },
  46332. Object.assign(n.AnimationMixer.prototype, {
  46333. _bindAction: function(e, t) {
  46334. var i = e._localRoot || this._root
  46335. , r = e._clip.tracks
  46336. , o = r.length
  46337. , a = e._propertyBindings
  46338. , s = e._interpolants
  46339. , l = i.uuid
  46340. , c = this._bindingsByRootAndName
  46341. , h = c[l];
  46342. void 0 === h && (h = {},
  46343. c[l] = h);
  46344. for (var u = 0; u !== o; ++u) {
  46345. var d = r[u]
  46346. , p = d.name
  46347. , f = h[p];
  46348. if (void 0 !== f)
  46349. a[u] = f;
  46350. else {
  46351. if (f = a[u],
  46352. void 0 !== f) {
  46353. null === f._cacheIndex && (++f.referenceCount,
  46354. this._addInactiveBinding(f, l, p));
  46355. continue
  46356. }
  46357. var g = t && t._propertyBindings[u].binding.parsedPath;
  46358. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  46359. ++f.referenceCount,
  46360. this._addInactiveBinding(f, l, p),
  46361. a[u] = f
  46362. }
  46363. s[u].resultBuffer = f.buffer
  46364. }
  46365. },
  46366. _activateAction: function(e) {
  46367. if (!this._isActiveAction(e)) {
  46368. if (null === e._cacheIndex) {
  46369. var t = (e._localRoot || this._root).uuid
  46370. , i = e._clip.name
  46371. , n = this._actionsByClip[i];
  46372. this._bindAction(e, n && n.knownActions[0]),
  46373. this._addInactiveAction(e, i, t)
  46374. }
  46375. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  46376. var s = r[o];
  46377. 0 === s.useCount++ && (this._lendBinding(s),
  46378. s.saveOriginalState())
  46379. }
  46380. this._lendAction(e)
  46381. }
  46382. },
  46383. _deactivateAction: function(e) {
  46384. if (this._isActiveAction(e)) {
  46385. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46386. var r = t[i];
  46387. 0 === --r.useCount && (r.restoreOriginalState(),
  46388. this._takeBackBinding(r))
  46389. }
  46390. this._takeBackAction(e)
  46391. }
  46392. },
  46393. _initMemoryManager: function() {
  46394. this._actions = [],
  46395. this._nActiveActions = 0,
  46396. this._actionsByClip = {},
  46397. this._bindings = [],
  46398. this._nActiveBindings = 0,
  46399. this._bindingsByRootAndName = {},
  46400. this._controlInterpolants = [],
  46401. this._nActiveControlInterpolants = 0;
  46402. var e = this;
  46403. this.stats = {
  46404. actions: {
  46405. get total() {
  46406. return e._actions.length
  46407. },
  46408. get inUse() {
  46409. return e._nActiveActions
  46410. }
  46411. },
  46412. bindings: {
  46413. get total() {
  46414. return e._bindings.length
  46415. },
  46416. get inUse() {
  46417. return e._nActiveBindings
  46418. }
  46419. },
  46420. controlInterpolants: {
  46421. get total() {
  46422. return e._controlInterpolants.length
  46423. },
  46424. get inUse() {
  46425. return e._nActiveControlInterpolants
  46426. }
  46427. }
  46428. }
  46429. },
  46430. _isActiveAction: function(e) {
  46431. var t = e._cacheIndex;
  46432. return null !== t && t < this._nActiveActions
  46433. },
  46434. _addInactiveAction: function(e, t, i) {
  46435. var n = this._actions
  46436. , r = this._actionsByClip
  46437. , o = r[t];
  46438. if (void 0 === o)
  46439. o = {
  46440. knownActions: [e],
  46441. actionByRoot: {}
  46442. },
  46443. e._byClipCacheIndex = 0,
  46444. r[t] = o;
  46445. else {
  46446. var a = o.knownActions;
  46447. e._byClipCacheIndex = a.length,
  46448. a.push(e)
  46449. }
  46450. e._cacheIndex = n.length,
  46451. n.push(e),
  46452. o.actionByRoot[i] = e
  46453. },
  46454. _removeInactiveAction: function(e) {
  46455. var t = this._actions
  46456. , i = t[t.length - 1]
  46457. , n = e._cacheIndex;
  46458. i._cacheIndex = n,
  46459. t[n] = i,
  46460. t.pop(),
  46461. e._cacheIndex = null;
  46462. var r = e._clip.name
  46463. , o = this._actionsByClip
  46464. , a = o[r]
  46465. , s = a.knownActions
  46466. , l = s[s.length - 1]
  46467. , c = e._byClipCacheIndex;
  46468. l._byClipCacheIndex = c,
  46469. s[c] = l,
  46470. s.pop(),
  46471. e._byClipCacheIndex = null;
  46472. var h = a.actionByRoot
  46473. , u = (t._localRoot || this._root).uuid;
  46474. delete h[u],
  46475. 0 === s.length && delete o[r],
  46476. this._removeInactiveBindingsForAction(e)
  46477. },
  46478. _removeInactiveBindingsForAction: function(e) {
  46479. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  46480. var r = t[i];
  46481. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  46482. }
  46483. },
  46484. _lendAction: function(e) {
  46485. var t = this._actions
  46486. , i = e._cacheIndex
  46487. , n = this._nActiveActions++
  46488. , r = t[n];
  46489. e._cacheIndex = n,
  46490. t[n] = e,
  46491. r._cacheIndex = i,
  46492. t[i] = r
  46493. },
  46494. _takeBackAction: function(e) {
  46495. var t = this._actions
  46496. , i = e._cacheIndex
  46497. , n = --this._nActiveActions
  46498. , r = t[n];
  46499. e._cacheIndex = n,
  46500. t[n] = e,
  46501. r._cacheIndex = i,
  46502. t[i] = r
  46503. },
  46504. _addInactiveBinding: function(e, t, i) {
  46505. var n = this._bindingsByRootAndName
  46506. , r = n[t]
  46507. , o = this._bindings;
  46508. void 0 === r && (r = {},
  46509. n[t] = r),
  46510. r[i] = e,
  46511. e._cacheIndex = o.length,
  46512. o.push(e)
  46513. },
  46514. _removeInactiveBinding: function(e) {
  46515. var t = this._bindings
  46516. , i = e.binding
  46517. , n = i.rootNode.uuid
  46518. , r = i.path
  46519. , o = this._bindingsByRootAndName
  46520. , a = o[n]
  46521. , s = t[t.length - 1]
  46522. , l = e._cacheIndex;
  46523. s._cacheIndex = l,
  46524. t[l] = s,
  46525. t.pop(),
  46526. delete a[r];
  46527. e: {
  46528. for (var c in a)
  46529. break e;
  46530. delete o[n]
  46531. }
  46532. },
  46533. _lendBinding: function(e) {
  46534. var t = this._bindings
  46535. , i = e._cacheIndex
  46536. , n = this._nActiveBindings++
  46537. , r = t[n];
  46538. e._cacheIndex = n,
  46539. t[n] = e,
  46540. r._cacheIndex = i,
  46541. t[i] = r
  46542. },
  46543. _takeBackBinding: function(e) {
  46544. var t = this._bindings
  46545. , i = e._cacheIndex
  46546. , n = --this._nActiveBindings
  46547. , r = t[n];
  46548. e._cacheIndex = n,
  46549. t[n] = e,
  46550. r._cacheIndex = i,
  46551. t[i] = r
  46552. },
  46553. _lendControlInterpolant: function() {
  46554. var e = this._controlInterpolants
  46555. , t = this._nActiveControlInterpolants++
  46556. , i = e[t];
  46557. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  46558. i.__cacheIndex = t,
  46559. e[t] = i),
  46560. i
  46561. },
  46562. _takeBackControlInterpolant: function(e) {
  46563. var t = this._controlInterpolants
  46564. , i = e.__cacheIndex
  46565. , n = --this._nActiveControlInterpolants
  46566. , r = t[n];
  46567. e.__cacheIndex = n,
  46568. t[n] = e,
  46569. r.__cacheIndex = i,
  46570. t[i] = r
  46571. },
  46572. _controlInterpolantsResultBuffer: new Float32Array(1)
  46573. }),
  46574. n.AnimationObjectGroup = function(e) {
  46575. this.uuid = n.Math.generateUUID(),
  46576. this._objects = Array.prototype.slice.call(arguments),
  46577. this.nCachedObjects_ = 0;
  46578. var t = {};
  46579. this._indicesByUUID = t;
  46580. for (var i = 0, r = arguments.length; i !== r; ++i)
  46581. t[arguments[i].uuid] = i;
  46582. this._paths = [],
  46583. this._parsedPaths = [],
  46584. this._bindings = [],
  46585. this._bindingsIndicesByPath = {};
  46586. var o = this;
  46587. this.stats = {
  46588. objects: {
  46589. get total() {
  46590. return o._objects.length
  46591. },
  46592. get inUse() {
  46593. return this.total - o.nCachedObjects_
  46594. }
  46595. },
  46596. get bindingsPerObject() {
  46597. return o._bindings.length
  46598. }
  46599. }
  46600. }
  46601. ,
  46602. n.AnimationObjectGroup.prototype = {
  46603. constructor: n.AnimationObjectGroup,
  46604. add: function(e) {
  46605. 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) {
  46606. var d = arguments[h]
  46607. , p = d.uuid
  46608. , f = o[p];
  46609. if (void 0 === f) {
  46610. f = i++,
  46611. o[p] = f,
  46612. t.push(d);
  46613. for (var g = 0, m = c; g !== m; ++g)
  46614. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  46615. } else if (f < r) {
  46616. var v = t[f]
  46617. , A = --r
  46618. , y = t[A];
  46619. o[y.uuid] = f,
  46620. t[f] = y,
  46621. o[p] = A,
  46622. t[A] = d;
  46623. for (var g = 0, m = c; g !== m; ++g) {
  46624. var C = l[g]
  46625. , I = C[A]
  46626. , E = C[f];
  46627. C[f] = I,
  46628. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  46629. C[A] = E
  46630. }
  46631. } else
  46632. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  46633. }
  46634. this.nCachedObjects_ = r
  46635. },
  46636. remove: function(e) {
  46637. for (var t = this._objects, i = (t.length,
  46638. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  46639. var l = arguments[a]
  46640. , c = l.uuid
  46641. , h = n[c];
  46642. if (void 0 !== h && h >= i) {
  46643. var u = i++
  46644. , d = t[u];
  46645. n[d.uuid] = h,
  46646. t[h] = d,
  46647. n[c] = u,
  46648. t[u] = l;
  46649. for (var p = 0, f = o; p !== f; ++p) {
  46650. var g = r[p]
  46651. , m = g[u]
  46652. , v = g[h];
  46653. g[h] = m,
  46654. g[u] = v
  46655. }
  46656. }
  46657. }
  46658. this.nCachedObjects_ = i
  46659. },
  46660. uncache: function(e) {
  46661. 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) {
  46662. var c = arguments[s]
  46663. , h = c.uuid
  46664. , u = r[h];
  46665. if (void 0 !== u)
  46666. if (delete r[h],
  46667. u < n) {
  46668. var d = --n
  46669. , p = t[d]
  46670. , f = --i
  46671. , g = t[f];
  46672. r[p.uuid] = u,
  46673. t[u] = p,
  46674. r[g.uuid] = d,
  46675. t[d] = g,
  46676. t.pop();
  46677. for (var m = 0, v = a; m !== v; ++m) {
  46678. var A = o[m]
  46679. , y = A[d]
  46680. , C = A[f];
  46681. A[u] = y,
  46682. A[d] = C,
  46683. A.pop()
  46684. }
  46685. } else {
  46686. var f = --i
  46687. , g = t[f];
  46688. r[g.uuid] = u,
  46689. t[u] = g,
  46690. t.pop();
  46691. for (var m = 0, v = a; m !== v; ++m) {
  46692. var A = o[m];
  46693. A[u] = A[f],
  46694. A.pop()
  46695. }
  46696. }
  46697. }
  46698. this.nCachedObjects_ = n
  46699. },
  46700. subscribe_: function(e, t) {
  46701. var i = this._bindingsIndicesByPath
  46702. , r = i[e]
  46703. , o = this._bindings;
  46704. if (void 0 !== r)
  46705. return o[r];
  46706. var a = this._paths
  46707. , s = this._parsedPaths
  46708. , l = this._objects
  46709. , c = l.length
  46710. , h = this.nCachedObjects_
  46711. , u = new Array(c);
  46712. r = o.length,
  46713. i[e] = r,
  46714. a.push(e),
  46715. s.push(t),
  46716. o.push(u);
  46717. for (var d = h, p = l.length; d !== p; ++d) {
  46718. var f = l[d];
  46719. u[d] = new n.PropertyBinding(f,e,t)
  46720. }
  46721. return u
  46722. },
  46723. unsubscribe_: function(e) {
  46724. var t = this._bindingsIndicesByPath
  46725. , i = t[e];
  46726. if (void 0 !== i) {
  46727. var n = this._paths
  46728. , r = this._parsedPaths
  46729. , o = this._bindings
  46730. , a = o.length - 1
  46731. , s = o[a]
  46732. , l = e[a];
  46733. t[l] = i,
  46734. o[i] = s,
  46735. o.pop(),
  46736. r[i] = r[a],
  46737. r.pop(),
  46738. n[i] = n[a],
  46739. n.pop()
  46740. }
  46741. }
  46742. },
  46743. n.AnimationUtils = {
  46744. arraySlice: function(e, t, i) {
  46745. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  46746. },
  46747. convertArray: function(e, t, i) {
  46748. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  46749. },
  46750. isTypedArray: function(e) {
  46751. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  46752. },
  46753. getKeyframeOrder: function(e) {
  46754. function t(t, i) {
  46755. return e[t] - e[i]
  46756. }
  46757. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  46758. n[r] = r;
  46759. return n.sort(t),
  46760. n
  46761. },
  46762. sortedArray: function(e, t, i) {
  46763. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  46764. for (var s = i[o] * t, l = 0; l !== t; ++l)
  46765. r[a++] = e[s + l];
  46766. return r
  46767. },
  46768. flattenJSON: function(e, t, i, n) {
  46769. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  46770. o = e[r++];
  46771. if (void 0 !== o) {
  46772. var a = o[n];
  46773. if (void 0 !== a)
  46774. if (Array.isArray(a)) {
  46775. do
  46776. a = o[n],
  46777. void 0 !== a && (t.push(o.time),
  46778. i.push.apply(i, a)),
  46779. o = e[r++];
  46780. while (void 0 !== o)
  46781. } else if (void 0 !== a.toArray) {
  46782. do
  46783. a = o[n],
  46784. void 0 !== a && (t.push(o.time),
  46785. a.toArray(i, i.length)),
  46786. o = e[r++];
  46787. while (void 0 !== o)
  46788. } else
  46789. do
  46790. a = o[n],
  46791. void 0 !== a && (t.push(o.time),
  46792. i.push(a)),
  46793. o = e[r++];
  46794. while (void 0 !== o)
  46795. }
  46796. }
  46797. },
  46798. n.KeyframeTrack = function(e, t, i, r) {
  46799. if (void 0 === e)
  46800. throw new Error("track name is undefined");
  46801. if (void 0 === t || 0 === t.length)
  46802. throw new Error("no keyframes in track named " + e);
  46803. this.name = e,
  46804. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  46805. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  46806. this.setInterpolation(r || this.DefaultInterpolation),
  46807. this.validate(),
  46808. this.optimize()
  46809. }
  46810. ,
  46811. n.KeyframeTrack.prototype = {
  46812. constructor: n.KeyframeTrack,
  46813. TimeBufferType: Float32Array,
  46814. ValueBufferType: Float32Array,
  46815. DefaultInterpolation: n.InterpolateLinear,
  46816. InterpolantFactoryMethodDiscrete: function(e) {
  46817. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  46818. },
  46819. InterpolantFactoryMethodLinear: function(e) {
  46820. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  46821. },
  46822. InterpolantFactoryMethodSmooth: function(e) {
  46823. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  46824. },
  46825. setInterpolation: function(e) {
  46826. var t = void 0;
  46827. switch (e) {
  46828. case n.InterpolateDiscrete:
  46829. t = this.InterpolantFactoryMethodDiscrete;
  46830. break;
  46831. case n.InterpolateLinear:
  46832. t = this.InterpolantFactoryMethodLinear;
  46833. break;
  46834. case n.InterpolateSmooth:
  46835. t = this.InterpolantFactoryMethodSmooth
  46836. }
  46837. if (void 0 === t) {
  46838. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  46839. if (void 0 === this.createInterpolant) {
  46840. if (e === this.DefaultInterpolation)
  46841. throw new Error(i);
  46842. this.setInterpolation(this.DefaultInterpolation)
  46843. }
  46844. return void console.warn(i)
  46845. }
  46846. this.createInterpolant = t
  46847. },
  46848. getInterpolation: function() {
  46849. switch (this.createInterpolant) {
  46850. case this.InterpolantFactoryMethodDiscrete:
  46851. return n.InterpolateDiscrete;
  46852. case this.InterpolantFactoryMethodLinear:
  46853. return n.InterpolateLinear;
  46854. case this.InterpolantFactoryMethodSmooth:
  46855. return n.InterpolateSmooth
  46856. }
  46857. },
  46858. getValueSize: function() {
  46859. return this.values.length / this.times.length
  46860. },
  46861. shift: function(e) {
  46862. if (0 !== e)
  46863. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46864. t[i] += e;
  46865. return this
  46866. },
  46867. scale: function(e) {
  46868. if (1 !== e)
  46869. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  46870. t[i] *= e;
  46871. return this
  46872. },
  46873. trim: function(e, t) {
  46874. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  46875. ++o;
  46876. for (; a !== -1 && i[a] > t; )
  46877. --a;
  46878. if (++a,
  46879. 0 !== o || a !== r) {
  46880. o >= a && (a = Math.max(a, 1),
  46881. o = a - 1);
  46882. var s = this.getValueSize();
  46883. this.times = n.AnimationUtils.arraySlice(i, o, a),
  46884. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  46885. }
  46886. return this
  46887. },
  46888. validate: function() {
  46889. var e = !0
  46890. , t = this.getValueSize();
  46891. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  46892. e = !1);
  46893. var i = this.times
  46894. , r = this.values
  46895. , o = i.length;
  46896. 0 === o && (console.error("track is empty", this),
  46897. e = !1);
  46898. for (var a = null, s = 0; s !== o; s++) {
  46899. var l = i[s];
  46900. if ("number" == typeof l && isNaN(l)) {
  46901. console.error("time is not a valid number", this, s, l),
  46902. e = !1;
  46903. break
  46904. }
  46905. if (null !== a && a > l) {
  46906. console.error("out of order keys", this, s, l, a),
  46907. e = !1;
  46908. break
  46909. }
  46910. a = l
  46911. }
  46912. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  46913. for (var s = 0, c = r.length; s !== c; ++s) {
  46914. var h = r[s];
  46915. if (isNaN(h)) {
  46916. console.error("value is not a valid number", this, s, h),
  46917. e = !1;
  46918. break
  46919. }
  46920. }
  46921. return e
  46922. },
  46923. optimize: function() {
  46924. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  46925. var s = !1
  46926. , l = e[o]
  46927. , c = e[o + 1];
  46928. if (l !== c && (1 !== o || l !== l[0]))
  46929. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  46930. var f = t[h + p];
  46931. if (f !== t[u + p] || f !== t[d + p]) {
  46932. s = !0;
  46933. break
  46934. }
  46935. }
  46936. if (s) {
  46937. if (o !== r) {
  46938. e[r] = e[o];
  46939. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  46940. t[m + p] = t[g + p]
  46941. }
  46942. ++r
  46943. }
  46944. }
  46945. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  46946. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  46947. this
  46948. }
  46949. },
  46950. Object.assign(n.KeyframeTrack, {
  46951. parse: function(e) {
  46952. if (void 0 === e.type)
  46953. throw new Error("track type undefined, can not parse");
  46954. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  46955. if (void 0 === e.times) {
  46956. console.warn("legacy JSON format detected, converting");
  46957. var i = []
  46958. , r = [];
  46959. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  46960. e.times = i,
  46961. e.values = r
  46962. }
  46963. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  46964. },
  46965. toJSON: function(e) {
  46966. var t, i = e.constructor;
  46967. if (void 0 !== i.toJSON)
  46968. t = i.toJSON(e);
  46969. else {
  46970. t = {
  46971. name: e.name,
  46972. times: n.AnimationUtils.convertArray(e.times, Array),
  46973. values: n.AnimationUtils.convertArray(e.values, Array)
  46974. };
  46975. var r = e.getInterpolation();
  46976. r !== e.DefaultInterpolation && (t.interpolation = r)
  46977. }
  46978. return t.type = e.ValueTypeName,
  46979. t
  46980. },
  46981. _getTrackTypeForValueTypeName: function(e) {
  46982. switch (e.toLowerCase()) {
  46983. case "scalar":
  46984. case "double":
  46985. case "float":
  46986. case "number":
  46987. case "integer":
  46988. return n.NumberKeyframeTrack;
  46989. case "vector":
  46990. case "vector2":
  46991. case "vector3":
  46992. case "vector4":
  46993. return n.VectorKeyframeTrack;
  46994. case "color":
  46995. return n.ColorKeyframeTrack;
  46996. case "quaternion":
  46997. return n.QuaternionKeyframeTrack;
  46998. case "bool":
  46999. case "boolean":
  47000. return n.BooleanKeyframeTrack;
  47001. case "string":
  47002. return n.StringKeyframeTrack
  47003. }
  47004. throw new Error("Unsupported typeName: " + e)
  47005. }
  47006. }),
  47007. n.PropertyBinding = function(e, t, i) {
  47008. this.path = t,
  47009. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  47010. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  47011. this.rootNode = e
  47012. }
  47013. ,
  47014. n.PropertyBinding.prototype = {
  47015. constructor: n.PropertyBinding,
  47016. getValue: function(e, t) {
  47017. this.bind(),
  47018. this.getValue(e, t)
  47019. },
  47020. setValue: function(e, t) {
  47021. this.bind(),
  47022. this.setValue(e, t)
  47023. },
  47024. bind: function() {
  47025. var e = this.node
  47026. , t = this.parsedPath
  47027. , i = t.objectName
  47028. , r = t.propertyName
  47029. , o = t.propertyIndex;
  47030. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  47031. this.node = e),
  47032. this.getValue = this._getValue_unavailable,
  47033. this.setValue = this._setValue_unavailable,
  47034. !e)
  47035. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  47036. if (i) {
  47037. var a = t.objectIndex;
  47038. switch (i) {
  47039. case "materials":
  47040. if (!e.material)
  47041. return void console.error(" can not bind to material as node does not have a material", this);
  47042. if (!e.material.materials)
  47043. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  47044. e = e.material.materials;
  47045. break;
  47046. case "bones":
  47047. if (!e.skeleton)
  47048. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  47049. e = e.skeleton.bones;
  47050. for (var s = 0; s < e.length; s++)
  47051. if (e[s].name === a) {
  47052. a = s;
  47053. break
  47054. }
  47055. break;
  47056. default:
  47057. if (void 0 === e[i])
  47058. return void console.error(" can not bind to objectName of node, undefined", this);
  47059. e = e[i]
  47060. }
  47061. if (void 0 !== a) {
  47062. if (void 0 === e[a])
  47063. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  47064. e = e[a]
  47065. }
  47066. }
  47067. var l = e[r];
  47068. if (!l) {
  47069. var c = t.nodeName;
  47070. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  47071. }
  47072. var h = this.Versioning.None;
  47073. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  47074. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  47075. this.targetObject = e);
  47076. var u = this.BindingType.Direct;
  47077. if (void 0 !== o) {
  47078. if ("morphTargetInfluences" === r) {
  47079. if (!e.geometry)
  47080. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  47081. if (!e.geometry.morphTargets)
  47082. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  47083. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  47084. if (e.geometry.morphTargets[s].name === o) {
  47085. o = s;
  47086. break
  47087. }
  47088. }
  47089. u = this.BindingType.ArrayElement,
  47090. this.resolvedProperty = l,
  47091. this.propertyIndex = o
  47092. } else
  47093. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  47094. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  47095. this.resolvedProperty = l) : this.propertyName = r;
  47096. this.getValue = this.GetterByBindingType[u],
  47097. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  47098. },
  47099. unbind: function() {
  47100. this.node = null,
  47101. this.getValue = this._getValue_unbound,
  47102. this.setValue = this._setValue_unbound
  47103. }
  47104. },
  47105. Object.assign(n.PropertyBinding.prototype, {
  47106. _getValue_unavailable: function() {},
  47107. _setValue_unavailable: function() {},
  47108. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  47109. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  47110. BindingType: {
  47111. Direct: 0,
  47112. EntireArray: 1,
  47113. ArrayElement: 2,
  47114. HasFromToArray: 3
  47115. },
  47116. Versioning: {
  47117. None: 0,
  47118. NeedsUpdate: 1,
  47119. MatrixWorldNeedsUpdate: 2
  47120. },
  47121. GetterByBindingType: [function(e, t) {
  47122. e[t] = this.node[this.propertyName]
  47123. }
  47124. , function(e, t) {
  47125. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47126. e[t++] = i[n]
  47127. }
  47128. , function(e, t) {
  47129. e[t] = this.resolvedProperty[this.propertyIndex]
  47130. }
  47131. , function(e, t) {
  47132. this.resolvedProperty.toArray(e, t)
  47133. }
  47134. ],
  47135. SetterByBindingTypeAndVersioning: [[function(e, t) {
  47136. this.node[this.propertyName] = e[t]
  47137. }
  47138. , function(e, t) {
  47139. this.node[this.propertyName] = e[t],
  47140. this.targetObject.needsUpdate = !0
  47141. }
  47142. , function(e, t) {
  47143. this.node[this.propertyName] = e[t],
  47144. this.targetObject.matrixWorldNeedsUpdate = !0
  47145. }
  47146. ], [function(e, t) {
  47147. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47148. i[n] = e[t++]
  47149. }
  47150. , function(e, t) {
  47151. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47152. i[n] = e[t++];
  47153. this.targetObject.needsUpdate = !0
  47154. }
  47155. , function(e, t) {
  47156. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  47157. i[n] = e[t++];
  47158. this.targetObject.matrixWorldNeedsUpdate = !0
  47159. }
  47160. ], [function(e, t) {
  47161. this.resolvedProperty[this.propertyIndex] = e[t]
  47162. }
  47163. , function(e, t) {
  47164. this.resolvedProperty[this.propertyIndex] = e[t],
  47165. this.targetObject.needsUpdate = !0
  47166. }
  47167. , function(e, t) {
  47168. this.resolvedProperty[this.propertyIndex] = e[t],
  47169. this.targetObject.matrixWorldNeedsUpdate = !0
  47170. }
  47171. ], [function(e, t) {
  47172. this.resolvedProperty.fromArray(e, t)
  47173. }
  47174. , function(e, t) {
  47175. this.resolvedProperty.fromArray(e, t),
  47176. this.targetObject.needsUpdate = !0
  47177. }
  47178. , function(e, t) {
  47179. this.resolvedProperty.fromArray(e, t),
  47180. this.targetObject.matrixWorldNeedsUpdate = !0
  47181. }
  47182. ]]
  47183. }),
  47184. n.PropertyBinding.Composite = function(e, t, i) {
  47185. var r = i || n.PropertyBinding.parseTrackName(t);
  47186. this._targetGroup = e,
  47187. this._bindings = e.subscribe_(t, r)
  47188. }
  47189. ,
  47190. n.PropertyBinding.Composite.prototype = {
  47191. constructor: n.PropertyBinding.Composite,
  47192. getValue: function(e, t) {
  47193. this.bind();
  47194. var i = this._targetGroup.nCachedObjects_
  47195. , n = this._bindings[i];
  47196. void 0 !== n && n.getValue(e, t)
  47197. },
  47198. setValue: function(e, t) {
  47199. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  47200. i[n].setValue(e, t)
  47201. },
  47202. bind: function() {
  47203. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47204. e[t].bind()
  47205. },
  47206. unbind: function() {
  47207. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  47208. e[t].unbind()
  47209. }
  47210. },
  47211. n.PropertyBinding.create = function(e, t, i) {
  47212. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  47213. }
  47214. ,
  47215. n.PropertyBinding.parseTrackName = function(e) {
  47216. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  47217. , i = t.exec(e);
  47218. if (!i)
  47219. throw new Error("cannot parse trackName at all: " + e);
  47220. i.index === t.lastIndex && t.lastIndex++;
  47221. var n = {
  47222. nodeName: i[3],
  47223. objectName: i[5],
  47224. objectIndex: i[7],
  47225. propertyName: i[9],
  47226. propertyIndex: i[11]
  47227. };
  47228. if (null === n.propertyName || 0 === n.propertyName.length)
  47229. throw new Error("can not parse propertyName from trackName: " + e);
  47230. return n
  47231. }
  47232. ,
  47233. n.PropertyBinding.findNode = function(e, t) {
  47234. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  47235. return e;
  47236. if (e.skeleton) {
  47237. var i = function(e) {
  47238. for (var i = 0; i < e.bones.length; i++) {
  47239. var n = e.bones[i];
  47240. if (n.name === t)
  47241. return n
  47242. }
  47243. return null
  47244. }
  47245. , n = i(e.skeleton);
  47246. if (n)
  47247. return n
  47248. }
  47249. if (e.children) {
  47250. var r = function(e) {
  47251. for (var i = 0; i < e.length; i++) {
  47252. var n = e[i];
  47253. if (n.name === t || n.uuid === t)
  47254. return n;
  47255. var o = r(n.children);
  47256. if (o)
  47257. return o
  47258. }
  47259. return null
  47260. }
  47261. , o = r(e.children);
  47262. if (o)
  47263. return o
  47264. }
  47265. return null
  47266. }
  47267. ,
  47268. n.PropertyMixer = function(e, t, i) {
  47269. this.binding = e,
  47270. this.valueSize = i;
  47271. var n, r = Float64Array;
  47272. switch (t) {
  47273. case "quaternion":
  47274. n = this._slerp;
  47275. break;
  47276. case "string":
  47277. case "bool":
  47278. r = Array,
  47279. n = this._select;
  47280. break;
  47281. default:
  47282. n = this._lerp
  47283. }
  47284. this.buffer = new r(4 * i),
  47285. this._mixBufferRegion = n,
  47286. this.cumulativeWeight = 0,
  47287. this.useCount = 0,
  47288. this.referenceCount = 0
  47289. }
  47290. ,
  47291. n.PropertyMixer.prototype = {
  47292. constructor: n.PropertyMixer,
  47293. accumulate: function(e, t) {
  47294. var i = this.buffer
  47295. , n = this.valueSize
  47296. , r = e * n + n
  47297. , o = this.cumulativeWeight;
  47298. if (0 === o) {
  47299. for (var a = 0; a !== n; ++a)
  47300. i[r + a] = i[a];
  47301. o = t
  47302. } else {
  47303. o += t;
  47304. var s = t / o;
  47305. this._mixBufferRegion(i, r, 0, s, n)
  47306. }
  47307. this.cumulativeWeight = o
  47308. },
  47309. apply: function(e) {
  47310. var t = this.valueSize
  47311. , i = this.buffer
  47312. , n = e * t + t
  47313. , r = this.cumulativeWeight
  47314. , o = this.binding;
  47315. if (this.cumulativeWeight = 0,
  47316. r < 1) {
  47317. var a = 3 * t;
  47318. this._mixBufferRegion(i, n, a, 1 - r, t)
  47319. }
  47320. for (var s = t, l = t + t; s !== l; ++s)
  47321. if (i[s] !== i[s + t]) {
  47322. o.setValue(i, n);
  47323. break
  47324. }
  47325. },
  47326. saveOriginalState: function() {
  47327. var e = this.binding
  47328. , t = this.buffer
  47329. , i = this.valueSize
  47330. , n = 3 * i;
  47331. e.getValue(t, n);
  47332. for (var r = i, o = n; r !== o; ++r)
  47333. t[r] = t[n + r % i];
  47334. this.cumulativeWeight = 0
  47335. },
  47336. restoreOriginalState: function() {
  47337. var e = 3 * this.valueSize;
  47338. this.binding.setValue(this.buffer, e)
  47339. },
  47340. _select: function(e, t, i, n, r) {
  47341. if (n >= .5)
  47342. for (var o = 0; o !== r; ++o)
  47343. e[t + o] = e[i + o]
  47344. },
  47345. _slerp: function(e, t, i, r, o) {
  47346. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  47347. },
  47348. _lerp: function(e, t, i, n, r) {
  47349. for (var o = 1 - n, a = 0; a !== r; ++a) {
  47350. var s = t + a;
  47351. e[s] = e[s] * o + e[i + a] * n
  47352. }
  47353. }
  47354. },
  47355. n.BooleanKeyframeTrack = function(e, t, i) {
  47356. n.KeyframeTrack.call(this, e, t, i)
  47357. }
  47358. ,
  47359. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47360. constructor: n.BooleanKeyframeTrack,
  47361. ValueTypeName: "bool",
  47362. ValueBufferType: Array,
  47363. DefaultInterpolation: n.IntepolateDiscrete,
  47364. InterpolantFactoryMethodLinear: void 0,
  47365. InterpolantFactoryMethodSmooth: void 0
  47366. }),
  47367. n.NumberKeyframeTrack = function(e, t, i, r) {
  47368. n.KeyframeTrack.call(this, e, t, i, r)
  47369. }
  47370. ,
  47371. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47372. constructor: n.NumberKeyframeTrack,
  47373. ValueTypeName: "number"
  47374. }),
  47375. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  47376. n.KeyframeTrack.call(this, e, t, i, r)
  47377. }
  47378. ,
  47379. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47380. constructor: n.QuaternionKeyframeTrack,
  47381. ValueTypeName: "quaternion",
  47382. DefaultInterpolation: n.InterpolateLinear,
  47383. InterpolantFactoryMethodLinear: function(e) {
  47384. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  47385. },
  47386. InterpolantFactoryMethodSmooth: void 0
  47387. }),
  47388. n.StringKeyframeTrack = function(e, t, i, r) {
  47389. n.KeyframeTrack.call(this, e, t, i, r)
  47390. }
  47391. ,
  47392. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47393. constructor: n.StringKeyframeTrack,
  47394. ValueTypeName: "string",
  47395. ValueBufferType: Array,
  47396. DefaultInterpolation: n.IntepolateDiscrete,
  47397. InterpolantFactoryMethodLinear: void 0,
  47398. InterpolantFactoryMethodSmooth: void 0
  47399. }),
  47400. n.VectorKeyframeTrack = function(e, t, i, r) {
  47401. n.KeyframeTrack.call(this, e, t, i, r)
  47402. }
  47403. ,
  47404. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  47405. constructor: n.VectorKeyframeTrack,
  47406. ValueTypeName: "vector"
  47407. }),
  47408. n.Audio = function(e) {
  47409. n.Object3D.call(this),
  47410. this.type = "Audio",
  47411. this.context = e.context,
  47412. this.source = this.context.createBufferSource(),
  47413. this.source.onended = this.onEnded.bind(this),
  47414. this.gain = this.context.createGain(),
  47415. this.gain.connect(e.getInput()),
  47416. this.autoplay = !1,
  47417. this.startTime = 0,
  47418. this.playbackRate = 1,
  47419. this.isPlaying = !1,
  47420. this.hasPlaybackControl = !0,
  47421. this.sourceType = "empty",
  47422. this.filter = null
  47423. }
  47424. ,
  47425. n.Audio.prototype = Object.create(n.Object3D.prototype),
  47426. n.Audio.prototype.constructor = n.Audio,
  47427. n.Audio.prototype.getOutput = function() {
  47428. return this.gain
  47429. }
  47430. ,
  47431. n.Audio.prototype.load = function(e) {
  47432. var t = new n.AudioBuffer(this.context);
  47433. return t.load(e),
  47434. this.setBuffer(t),
  47435. this
  47436. }
  47437. ,
  47438. n.Audio.prototype.setNodeSource = function(e) {
  47439. return this.hasPlaybackControl = !1,
  47440. this.sourceType = "audioNode",
  47441. this.source = e,
  47442. this.connect(),
  47443. this
  47444. }
  47445. ,
  47446. n.Audio.prototype.setBuffer = function(e) {
  47447. var t = this;
  47448. return e.onReady(function(e) {
  47449. t.source.buffer = e,
  47450. t.sourceType = "buffer",
  47451. t.autoplay && t.play()
  47452. }),
  47453. this
  47454. }
  47455. ,
  47456. n.Audio.prototype.play = function() {
  47457. if (this.isPlaying === !0)
  47458. return void console.warn("THREE.Audio: Audio is already playing.");
  47459. if (this.hasPlaybackControl === !1)
  47460. return void console.warn("THREE.Audio: this Audio has no playback control.");
  47461. var e = this.context.createBufferSource();
  47462. e.buffer = this.source.buffer,
  47463. e.loop = this.source.loop,
  47464. e.onended = this.source.onended,
  47465. e.start(0, this.startTime),
  47466. e.playbackRate.value = this.playbackRate,
  47467. this.isPlaying = !0,
  47468. this.source = e,
  47469. this.connect()
  47470. }
  47471. ,
  47472. n.Audio.prototype.pause = function() {
  47473. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47474. void (this.startTime = this.context.currentTime))
  47475. }
  47476. ,
  47477. n.Audio.prototype.stop = function() {
  47478. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  47479. void (this.startTime = 0))
  47480. }
  47481. ,
  47482. n.Audio.prototype.connect = function() {
  47483. null !== this.filter ? (this.source.connect(this.filter),
  47484. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  47485. }
  47486. ,
  47487. n.Audio.prototype.disconnect = function() {
  47488. null !== this.filter ? (this.source.disconnect(this.filter),
  47489. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  47490. }
  47491. ,
  47492. n.Audio.prototype.getFilter = function() {
  47493. return this.filter
  47494. }
  47495. ,
  47496. n.Audio.prototype.setFilter = function(e) {
  47497. void 0 === e && (e = null),
  47498. this.isPlaying === !0 ? (this.disconnect(),
  47499. this.filter = e,
  47500. this.connect()) : this.filter = e
  47501. }
  47502. ,
  47503. n.Audio.prototype.setPlaybackRate = function(e) {
  47504. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  47505. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  47506. }
  47507. ,
  47508. n.Audio.prototype.getPlaybackRate = function() {
  47509. return this.playbackRate
  47510. }
  47511. ,
  47512. n.Audio.prototype.onEnded = function() {
  47513. this.isPlaying = !1
  47514. }
  47515. ,
  47516. n.Audio.prototype.setLoop = function(e) {
  47517. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  47518. }
  47519. ,
  47520. n.Audio.prototype.getLoop = function() {
  47521. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  47522. !1) : this.source.loop
  47523. }
  47524. ,
  47525. n.Audio.prototype.setVolume = function(e) {
  47526. this.gain.gain.value = e
  47527. }
  47528. ,
  47529. n.Audio.prototype.getVolume = function() {
  47530. return this.gain.gain.value
  47531. }
  47532. ,
  47533. n.AudioAnalyser = function(e, t) {
  47534. this.analyser = e.context.createAnalyser(),
  47535. this.analyser.fftSize = void 0 !== t ? t : 2048,
  47536. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  47537. e.getOutput().connect(this.analyser)
  47538. }
  47539. ,
  47540. n.AudioAnalyser.prototype = {
  47541. constructor: n.AudioAnalyser,
  47542. getData: function() {
  47543. return this.analyser.getByteFrequencyData(this.data),
  47544. this.data
  47545. }
  47546. },
  47547. n.AudioBuffer = function(e) {
  47548. this.context = e,
  47549. this.ready = !1,
  47550. this.readyCallbacks = []
  47551. }
  47552. ,
  47553. n.AudioBuffer.prototype.load = function(e) {
  47554. var t = this
  47555. , i = new XMLHttpRequest;
  47556. return i.open("GET", e, !0),
  47557. i.responseType = "arraybuffer",
  47558. i.onload = function(e) {
  47559. t.context.decodeAudioData(this.response, function(e) {
  47560. t.buffer = e,
  47561. t.ready = !0;
  47562. for (var i = 0; i < t.readyCallbacks.length; i++)
  47563. t.readyCallbacks[i](t.buffer);
  47564. t.readyCallbacks = []
  47565. })
  47566. }
  47567. ,
  47568. i.send(),
  47569. this
  47570. }
  47571. ,
  47572. n.AudioBuffer.prototype.onReady = function(e) {
  47573. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  47574. }
  47575. ,
  47576. n.PositionalAudio = function(e) {
  47577. n.Audio.call(this, e),
  47578. this.panner = this.context.createPanner(),
  47579. this.panner.connect(this.gain)
  47580. }
  47581. ,
  47582. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  47583. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  47584. n.PositionalAudio.prototype.getOutput = function() {
  47585. return this.panner
  47586. }
  47587. ,
  47588. n.PositionalAudio.prototype.setRefDistance = function(e) {
  47589. this.panner.refDistance = e
  47590. }
  47591. ,
  47592. n.PositionalAudio.prototype.getRefDistance = function() {
  47593. return this.panner.refDistance
  47594. }
  47595. ,
  47596. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  47597. this.panner.rolloffFactor = e
  47598. }
  47599. ,
  47600. n.PositionalAudio.prototype.getRolloffFactor = function() {
  47601. return this.panner.rolloffFactor
  47602. }
  47603. ,
  47604. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  47605. this.panner.distanceModel = e
  47606. }
  47607. ,
  47608. n.PositionalAudio.prototype.getDistanceModel = function() {
  47609. return this.panner.distanceModel
  47610. }
  47611. ,
  47612. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  47613. this.panner.maxDistance = e
  47614. }
  47615. ,
  47616. n.PositionalAudio.prototype.getMaxDistance = function() {
  47617. return this.panner.maxDistance
  47618. }
  47619. ,
  47620. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  47621. var e = new n.Vector3;
  47622. return function(t) {
  47623. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  47624. e.setFromMatrixPosition(this.matrixWorld),
  47625. this.panner.setPosition(e.x, e.y, e.z)
  47626. }
  47627. }(),
  47628. n.AudioListener = function() {
  47629. n.Object3D.call(this),
  47630. this.type = "AudioListener",
  47631. this.context = new (window.AudioContext || window.webkitAudioContext),
  47632. this.gain = this.context.createGain(),
  47633. this.gain.connect(this.context.destination),
  47634. this.filter = null
  47635. }
  47636. ,
  47637. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  47638. n.AudioListener.prototype.constructor = n.AudioListener,
  47639. n.AudioListener.prototype.getInput = function() {
  47640. return this.gain
  47641. }
  47642. ,
  47643. n.AudioListener.prototype.removeFilter = function() {
  47644. null !== this.filter && (this.gain.disconnect(this.filter),
  47645. this.filter.disconnect(this.context.destination),
  47646. this.gain.connect(this.context.destination),
  47647. this.filter = null)
  47648. }
  47649. ,
  47650. n.AudioListener.prototype.setFilter = function(e) {
  47651. null !== this.filter ? (this.gain.disconnect(this.filter),
  47652. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  47653. this.filter = e,
  47654. this.gain.connect(this.filter),
  47655. this.filter.connect(this.context.destination)
  47656. }
  47657. ,
  47658. n.AudioListener.prototype.getFilter = function() {
  47659. return this.filter
  47660. }
  47661. ,
  47662. n.AudioListener.prototype.setMasterVolume = function(e) {
  47663. this.gain.gain.value = e
  47664. }
  47665. ,
  47666. n.AudioListener.prototype.getMasterVolume = function() {
  47667. return this.gain.gain.value
  47668. }
  47669. ,
  47670. n.AudioListener.prototype.updateMatrixWorld = function() {
  47671. var e = new n.Vector3
  47672. , t = new n.Quaternion
  47673. , i = new n.Vector3
  47674. , r = new n.Vector3;
  47675. return function(o) {
  47676. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  47677. var a = this.context.listener
  47678. , s = this.up;
  47679. this.matrixWorld.decompose(e, t, i),
  47680. r.set(0, 0, -1).applyQuaternion(t),
  47681. a.setPosition(e.x, e.y, e.z),
  47682. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  47683. }
  47684. }(),
  47685. n.Camera = function() {
  47686. n.Object3D.call(this),
  47687. this.type = "Camera",
  47688. this.matrixWorldInverse = new n.Matrix4,
  47689. this.projectionMatrix = new n.Matrix4
  47690. }
  47691. ,
  47692. n.Camera.prototype = Object.create(n.Object3D.prototype),
  47693. n.Camera.prototype.constructor = n.Camera,
  47694. n.Camera.prototype.getWorldDirection = function() {
  47695. var e = new n.Quaternion;
  47696. return function(t) {
  47697. var i = t || new n.Vector3;
  47698. return this.getWorldQuaternion(e),
  47699. i.set(0, 0, -1).applyQuaternion(e)
  47700. }
  47701. }(),
  47702. n.Camera.prototype.lookAt = function() {
  47703. var e = new n.Matrix4;
  47704. return function(t) {
  47705. e.lookAt(this.position, t, this.up),
  47706. this.quaternion.setFromRotationMatrix(e)
  47707. }
  47708. }(),
  47709. n.Camera.prototype.clone = function() {
  47710. return (new this.constructor).copy(this)
  47711. }
  47712. ,
  47713. n.Camera.prototype.copy = function(e) {
  47714. return n.Object3D.prototype.copy.call(this, e),
  47715. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  47716. this.projectionMatrix.copy(e.projectionMatrix),
  47717. this
  47718. }
  47719. ,
  47720. n.CubeCamera = function(e, t, i) {
  47721. n.Object3D.call(this),
  47722. this.type = "CubeCamera";
  47723. var r = 90
  47724. , o = 1
  47725. , a = new n.PerspectiveCamera(r,o,e,t);
  47726. a.up.set(0, -1, 0),
  47727. a.lookAt(new n.Vector3(1,0,0)),
  47728. this.add(a);
  47729. var s = new n.PerspectiveCamera(r,o,e,t);
  47730. s.up.set(0, -1, 0),
  47731. s.lookAt(new n.Vector3(-1,0,0)),
  47732. this.add(s);
  47733. var l = new n.PerspectiveCamera(r,o,e,t);
  47734. l.up.set(0, 0, 1),
  47735. l.lookAt(new n.Vector3(0,1,0)),
  47736. this.add(l);
  47737. var c = new n.PerspectiveCamera(r,o,e,t);
  47738. c.up.set(0, 0, -1),
  47739. c.lookAt(new n.Vector3(0,-1,0)),
  47740. this.add(c);
  47741. var h = new n.PerspectiveCamera(r,o,e,t);
  47742. h.up.set(0, -1, 0),
  47743. h.lookAt(new n.Vector3(0,0,1)),
  47744. this.add(h);
  47745. var u = new n.PerspectiveCamera(r,o,e,t);
  47746. u.up.set(0, -1, 0),
  47747. u.lookAt(new n.Vector3(0,0,-1)),
  47748. this.add(u);
  47749. var d = {
  47750. format: n.RGBFormat,
  47751. magFilter: n.LinearFilter,
  47752. minFilter: n.LinearFilter
  47753. };
  47754. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  47755. this.updateCubeMap = function(e, t) {
  47756. null === this.parent && this.updateMatrixWorld();
  47757. var i = this.renderTarget
  47758. , n = i.texture.generateMipmaps;
  47759. i.texture.generateMipmaps = !1,
  47760. i.activeCubeFace = 0,
  47761. e.render(t, a, i),
  47762. i.activeCubeFace = 1,
  47763. e.render(t, s, i),
  47764. i.activeCubeFace = 2,
  47765. e.render(t, l, i),
  47766. i.activeCubeFace = 3,
  47767. e.render(t, c, i),
  47768. i.activeCubeFace = 4,
  47769. e.render(t, h, i),
  47770. i.texture.generateMipmaps = n,
  47771. i.activeCubeFace = 5,
  47772. e.render(t, u, i),
  47773. e.setRenderTarget(null)
  47774. }
  47775. }
  47776. ,
  47777. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  47778. n.CubeCamera.prototype.constructor = n.CubeCamera,
  47779. n.OrthographicCamera = function(e, t, i, r, o, a) {
  47780. n.Camera.call(this),
  47781. this.type = "OrthographicCamera",
  47782. this.zoom = 1,
  47783. this.left = e,
  47784. this.right = t,
  47785. this.top = i,
  47786. this.bottom = r,
  47787. this.near = void 0 !== o ? o : .1,
  47788. this.far = void 0 !== a ? a : 2e3,
  47789. this.updateProjectionMatrix()
  47790. }
  47791. ,
  47792. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  47793. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  47794. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  47795. var e = (this.right - this.left) / (2 * this.zoom)
  47796. , t = (this.top - this.bottom) / (2 * this.zoom)
  47797. , i = (this.right + this.left) / 2
  47798. , n = (this.top + this.bottom) / 2;
  47799. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  47800. }
  47801. ,
  47802. n.OrthographicCamera.prototype.copy = function(e) {
  47803. return n.Camera.prototype.copy.call(this, e),
  47804. this.left = e.left,
  47805. this.right = e.right,
  47806. this.top = e.top,
  47807. this.bottom = e.bottom,
  47808. this.near = e.near,
  47809. this.far = e.far,
  47810. this.zoom = e.zoom,
  47811. this
  47812. }
  47813. ,
  47814. n.OrthographicCamera.prototype.toJSON = function(e) {
  47815. var t = n.Object3D.prototype.toJSON.call(this, e);
  47816. return t.object.zoom = this.zoom,
  47817. t.object.left = this.left,
  47818. t.object.right = this.right,
  47819. t.object.top = this.top,
  47820. t.object.bottom = this.bottom,
  47821. t.object.near = this.near,
  47822. t.object.far = this.far,
  47823. t
  47824. }
  47825. ,
  47826. n.PerspectiveCamera = function(e, t, i, r) {
  47827. n.Camera.call(this),
  47828. this.type = "PerspectiveCamera",
  47829. this.focalLength = 10,
  47830. this.zoom = 1,
  47831. this.fov = void 0 !== e ? e : 50,
  47832. this.aspect = void 0 !== t ? t : 1,
  47833. this.near = void 0 !== i ? i : .1,
  47834. this.far = void 0 !== r ? r : 2e3,
  47835. this.updateProjectionMatrix()
  47836. }
  47837. ,
  47838. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  47839. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  47840. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  47841. void 0 === t && (t = 24),
  47842. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  47843. this.updateProjectionMatrix()
  47844. }
  47845. ,
  47846. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  47847. this.fullWidth = e,
  47848. this.fullHeight = t,
  47849. this.x = i,
  47850. this.y = n,
  47851. this.width = r,
  47852. this.height = o,
  47853. this.updateProjectionMatrix()
  47854. }
  47855. ,
  47856. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  47857. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  47858. if (this.fullWidth) {
  47859. var t = this.fullWidth / this.fullHeight
  47860. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  47861. , r = -i
  47862. , o = t * r
  47863. , a = t * i
  47864. , s = Math.abs(a - o)
  47865. , l = Math.abs(i - r);
  47866. 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)
  47867. } else
  47868. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  47869. }
  47870. ,
  47871. n.PerspectiveCamera.prototype.copy = function(e) {
  47872. return n.Camera.prototype.copy.call(this, e),
  47873. this.focalLength = e.focalLength,
  47874. this.zoom = e.zoom,
  47875. this.fov = e.fov,
  47876. this.aspect = e.aspect,
  47877. this.near = e.near,
  47878. this.far = e.far,
  47879. this
  47880. }
  47881. ,
  47882. n.PerspectiveCamera.prototype.toJSON = function(e) {
  47883. var t = n.Object3D.prototype.toJSON.call(this, e);
  47884. return t.object.focalLength = this.focalLength,
  47885. t.object.zoom = this.zoom,
  47886. t.object.fov = this.fov,
  47887. t.object.aspect = this.aspect,
  47888. t.object.near = this.near,
  47889. t.object.far = this.far,
  47890. t
  47891. }
  47892. ,
  47893. n.StereoCamera = function() {
  47894. this.type = "StereoCamera",
  47895. this.aspect = 1,
  47896. this.cameraL = new n.PerspectiveCamera,
  47897. this.cameraL.layers.enable(1),
  47898. this.cameraL.matrixAutoUpdate = !1,
  47899. this.cameraR = new n.PerspectiveCamera,
  47900. this.cameraR.layers.enable(2),
  47901. this.cameraR.matrixAutoUpdate = !1
  47902. }
  47903. ,
  47904. n.StereoCamera.prototype = {
  47905. constructor: n.StereoCamera,
  47906. update: function() {
  47907. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  47908. return function(l) {
  47909. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  47910. if (c) {
  47911. e = l.focalLength,
  47912. t = l.fov,
  47913. i = l.aspect * this.aspect,
  47914. r = l.near,
  47915. o = l.far;
  47916. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  47917. s.elements[12] = -p,
  47918. a.elements[12] = p,
  47919. h = -g * i + f,
  47920. u = g * i + f,
  47921. d.elements[0] = 2 * r / (u - h),
  47922. d.elements[8] = (u + h) / (u - h),
  47923. this.cameraL.projectionMatrix.copy(d),
  47924. h = -g * i - f,
  47925. u = g * i - f,
  47926. d.elements[0] = 2 * r / (u - h),
  47927. d.elements[8] = (u + h) / (u - h),
  47928. this.cameraR.projectionMatrix.copy(d)
  47929. }
  47930. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  47931. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  47932. }
  47933. }()
  47934. },
  47935. n.Light = function(e, t) {
  47936. n.Object3D.call(this),
  47937. this.type = "Light",
  47938. this.color = new n.Color(e),
  47939. this.intensity = void 0 !== t ? t : 1,
  47940. this.receiveShadow = void 0
  47941. }
  47942. ,
  47943. n.Light.prototype = Object.create(n.Object3D.prototype),
  47944. n.Light.prototype.constructor = n.Light,
  47945. n.Light.prototype.copy = function(e) {
  47946. return n.Object3D.prototype.copy.call(this, e),
  47947. this.color.copy(e.color),
  47948. this.intensity = e.intensity,
  47949. this
  47950. }
  47951. ,
  47952. n.Light.prototype.toJSON = function(e) {
  47953. var t = n.Object3D.prototype.toJSON.call(this, e);
  47954. return t.object.color = this.color.getHex(),
  47955. t.object.intensity = this.intensity,
  47956. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  47957. void 0 !== this.distance && (t.object.distance = this.distance),
  47958. void 0 !== this.angle && (t.object.angle = this.angle),
  47959. void 0 !== this.decay && (t.object.decay = this.decay),
  47960. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  47961. t
  47962. }
  47963. ,
  47964. n.LightShadow = function(e) {
  47965. this.camera = e,
  47966. this.bias = 0,
  47967. this.radius = 1,
  47968. this.mapSize = new n.Vector2(512,512),
  47969. this.map = null,
  47970. this.matrix = new n.Matrix4
  47971. }
  47972. ,
  47973. n.LightShadow.prototype = {
  47974. constructor: n.LightShadow,
  47975. copy: function(e) {
  47976. return this.camera = e.camera.clone(),
  47977. this.bias = e.bias,
  47978. this.radius = e.radius,
  47979. this.mapSize.copy(e.mapSize),
  47980. this
  47981. },
  47982. clone: function() {
  47983. return (new this.constructor).copy(this)
  47984. }
  47985. },
  47986. n.AmbientLight = function(e, t) {
  47987. n.Light.call(this, e, t),
  47988. this.type = "AmbientLight",
  47989. this.castShadow = void 0
  47990. }
  47991. ,
  47992. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  47993. n.AmbientLight.prototype.constructor = n.AmbientLight,
  47994. n.DirectionalLight = function(e, t) {
  47995. n.Light.call(this, e, t),
  47996. this.type = "DirectionalLight",
  47997. this.position.set(0, 1, 0),
  47998. this.updateMatrix(),
  47999. this.target = new n.Object3D,
  48000. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  48001. }
  48002. ,
  48003. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  48004. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  48005. n.DirectionalLight.prototype.copy = function(e) {
  48006. return n.Light.prototype.copy.call(this, e),
  48007. this.target = e.target.clone(),
  48008. this.shadow = e.shadow.clone(),
  48009. this
  48010. }
  48011. ,
  48012. n.HemisphereLight = function(e, t, i) {
  48013. n.Light.call(this, e, i),
  48014. this.type = "HemisphereLight",
  48015. this.castShadow = void 0,
  48016. this.position.set(0, 1, 0),
  48017. this.updateMatrix(),
  48018. this.groundColor = new n.Color(t)
  48019. }
  48020. ,
  48021. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  48022. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  48023. n.HemisphereLight.prototype.copy = function(e) {
  48024. return n.Light.prototype.copy.call(this, e),
  48025. this.groundColor.copy(e.groundColor),
  48026. this
  48027. }
  48028. ,
  48029. n.PointLight = function(e, t, i, r) {
  48030. n.Light.call(this, e, t),
  48031. this.type = "PointLight",
  48032. this.distance = void 0 !== i ? i : 0,
  48033. this.decay = void 0 !== r ? r : 1,
  48034. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  48035. }
  48036. ,
  48037. n.PointLight.prototype = Object.create(n.Light.prototype),
  48038. n.PointLight.prototype.constructor = n.PointLight,
  48039. Object.defineProperty(n.PointLight.prototype, "power", {
  48040. get: function() {
  48041. return 4 * this.intensity * Math.PI
  48042. },
  48043. set: function(e) {
  48044. this.intensity = e / (4 * Math.PI)
  48045. }
  48046. }),
  48047. n.PointLight.prototype.copy = function(e) {
  48048. return n.Light.prototype.copy.call(this, e),
  48049. this.distance = e.distance,
  48050. this.decay = e.decay,
  48051. this.shadow = e.shadow.clone(),
  48052. this
  48053. }
  48054. ,
  48055. n.SpotLight = function(e, t, i, r, o, a) {
  48056. n.Light.call(this, e, t),
  48057. this.type = "SpotLight",
  48058. this.position.set(0, 1, 0),
  48059. this.updateMatrix(),
  48060. this.target = new n.Object3D,
  48061. this.distance = void 0 !== i ? i : 0,
  48062. this.angle = void 0 !== r ? r : Math.PI / 3,
  48063. this.penumbra = void 0 !== o ? o : 0,
  48064. this.decay = void 0 !== a ? a : 1,
  48065. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  48066. }
  48067. ,
  48068. n.SpotLight.prototype = Object.create(n.Light.prototype),
  48069. n.SpotLight.prototype.constructor = n.SpotLight,
  48070. Object.defineProperty(n.SpotLight.prototype, "power", {
  48071. get: function() {
  48072. return this.intensity * Math.PI
  48073. },
  48074. set: function(e) {
  48075. this.intensity = e / Math.PI
  48076. }
  48077. }),
  48078. n.SpotLight.prototype.copy = function(e) {
  48079. return n.Light.prototype.copy.call(this, e),
  48080. this.distance = e.distance,
  48081. this.angle = e.angle,
  48082. this.penumbra = e.penumbra,
  48083. this.decay = e.decay,
  48084. this.target = e.target.clone(),
  48085. this.shadow = e.shadow.clone(),
  48086. this
  48087. }
  48088. ,
  48089. n.Cache = {
  48090. enabled: !1,
  48091. files: {},
  48092. add: function(e, t) {
  48093. this.enabled !== !1 && (this.files[e] = t)
  48094. },
  48095. get: function(e) {
  48096. if (this.enabled !== !1)
  48097. return this.files[e]
  48098. },
  48099. remove: function(e) {
  48100. delete this.files[e]
  48101. },
  48102. clear: function() {
  48103. this.files = {}
  48104. }
  48105. },
  48106. n.Loader = function() {
  48107. this.onLoadStart = function() {}
  48108. ,
  48109. this.onLoadProgress = function() {}
  48110. ,
  48111. this.onLoadComplete = function() {}
  48112. }
  48113. ,
  48114. n.Loader.prototype = {
  48115. constructor: n.Loader,
  48116. crossOrigin: void 0,
  48117. extractUrlBase: function(e) {
  48118. var t = e.split("/");
  48119. return 1 === t.length ? "./" : (t.pop(),
  48120. t.join("/") + "/")
  48121. },
  48122. initMaterials: function(e, t, i) {
  48123. for (var n = [], r = 0; r < e.length; ++r)
  48124. n[r] = this.createMaterial(e[r], t, i);
  48125. return n
  48126. },
  48127. createMaterial: function() {
  48128. var e, t, i;
  48129. return function(r, o, a) {
  48130. function s(e, i, r, s, c) {
  48131. var h, u = o + e, d = n.Loader.Handlers.get(u);
  48132. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  48133. h = t.load(u)),
  48134. void 0 !== i && (h.repeat.fromArray(i),
  48135. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  48136. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  48137. void 0 !== r && h.offset.fromArray(r),
  48138. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  48139. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  48140. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  48141. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  48142. void 0 !== c && (h.anisotropy = c);
  48143. var p = n.Math.generateUUID();
  48144. return l[p] = h,
  48145. p
  48146. }
  48147. void 0 === e && (e = new n.Color),
  48148. void 0 === t && (t = new n.TextureLoader),
  48149. void 0 === i && (i = new n.MaterialLoader);
  48150. var l = {}
  48151. , c = {
  48152. uuid: n.Math.generateUUID(),
  48153. type: "MeshLambertMaterial"
  48154. };
  48155. for (var h in r) {
  48156. var u = r[h];
  48157. switch (h) {
  48158. case "DbgColor":
  48159. case "DbgIndex":
  48160. case "opticalDensity":
  48161. case "illumination":
  48162. break;
  48163. case "DbgName":
  48164. c.name = u;
  48165. break;
  48166. case "blending":
  48167. c.blending = n[u];
  48168. break;
  48169. case "colorAmbient":
  48170. case "mapAmbient":
  48171. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  48172. break;
  48173. case "colorDiffuse":
  48174. c.color = e.fromArray(u).getHex();
  48175. break;
  48176. case "colorSpecular":
  48177. c.specular = e.fromArray(u).getHex();
  48178. break;
  48179. case "colorEmissive":
  48180. c.emissive = e.fromArray(u).getHex();
  48181. break;
  48182. case "specularCoef":
  48183. c.shininess = u;
  48184. break;
  48185. case "shading":
  48186. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  48187. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  48188. break;
  48189. case "mapDiffuse":
  48190. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  48191. break;
  48192. case "mapDiffuseRepeat":
  48193. case "mapDiffuseOffset":
  48194. case "mapDiffuseWrap":
  48195. case "mapDiffuseAnisotropy":
  48196. break;
  48197. case "mapLight":
  48198. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  48199. break;
  48200. case "mapLightRepeat":
  48201. case "mapLightOffset":
  48202. case "mapLightWrap":
  48203. case "mapLightAnisotropy":
  48204. break;
  48205. case "mapAO":
  48206. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  48207. break;
  48208. case "mapAORepeat":
  48209. case "mapAOOffset":
  48210. case "mapAOWrap":
  48211. case "mapAOAnisotropy":
  48212. break;
  48213. case "mapBump":
  48214. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  48215. break;
  48216. case "mapBumpScale":
  48217. c.bumpScale = u;
  48218. break;
  48219. case "mapBumpRepeat":
  48220. case "mapBumpOffset":
  48221. case "mapBumpWrap":
  48222. case "mapBumpAnisotropy":
  48223. break;
  48224. case "mapNormal":
  48225. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  48226. break;
  48227. case "mapNormalFactor":
  48228. c.normalScale = [u, u];
  48229. break;
  48230. case "mapNormalRepeat":
  48231. case "mapNormalOffset":
  48232. case "mapNormalWrap":
  48233. case "mapNormalAnisotropy":
  48234. break;
  48235. case "mapSpecular":
  48236. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  48237. break;
  48238. case "mapSpecularRepeat":
  48239. case "mapSpecularOffset":
  48240. case "mapSpecularWrap":
  48241. case "mapSpecularAnisotropy":
  48242. break;
  48243. case "mapAlpha":
  48244. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  48245. break;
  48246. case "mapAlphaRepeat":
  48247. case "mapAlphaOffset":
  48248. case "mapAlphaWrap":
  48249. case "mapAlphaAnisotropy":
  48250. break;
  48251. case "flipSided":
  48252. c.side = n.BackSide;
  48253. break;
  48254. case "doubleSided":
  48255. c.side = n.DoubleSide;
  48256. break;
  48257. case "transparency":
  48258. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  48259. c.opacity = u;
  48260. break;
  48261. case "depthTest":
  48262. case "depthWrite":
  48263. case "colorWrite":
  48264. case "opacity":
  48265. case "reflectivity":
  48266. case "transparent":
  48267. case "visible":
  48268. case "wireframe":
  48269. c[h] = u;
  48270. break;
  48271. case "vertexColors":
  48272. u === !0 && (c.vertexColors = n.VertexColors),
  48273. "face" === u && (c.vertexColors = n.FaceColors);
  48274. break;
  48275. default:
  48276. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  48277. }
  48278. }
  48279. return "MeshBasicMaterial" === c.type && delete c.emissive,
  48280. "MeshPhongMaterial" !== c.type && delete c.specular,
  48281. c.opacity < 1 && (c.transparent = !0),
  48282. i.setTextures(l),
  48283. i.parse(c)
  48284. }
  48285. }()
  48286. },
  48287. n.Loader.Handlers = {
  48288. handlers: [],
  48289. add: function(e, t) {
  48290. this.handlers.push(e, t)
  48291. },
  48292. get: function(e) {
  48293. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  48294. var r = t[i]
  48295. , o = t[i + 1];
  48296. if (r.test(e))
  48297. return o
  48298. }
  48299. return null
  48300. }
  48301. },
  48302. n.XHRLoader = function(e) {
  48303. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48304. }
  48305. ,
  48306. n.XHRLoader.prototype = {
  48307. constructor: n.XHRLoader,
  48308. load: function(e, t, i, r) {
  48309. void 0 !== this.path && (e = this.path + e);
  48310. var o = this
  48311. , a = n.Cache.get(e);
  48312. if (void 0 !== a)
  48313. return t && setTimeout(function() {
  48314. t(a)
  48315. }, 0),
  48316. a;
  48317. var s = new XMLHttpRequest;
  48318. return s.overrideMimeType("text/plain"),
  48319. s.open("GET", e, !0),
  48320. s.addEventListener("load", function(i) {
  48321. var a = i.target.response;
  48322. n.Cache.add(e, a),
  48323. 200 === this.status ? (t && t(a),
  48324. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  48325. t && t(a),
  48326. o.manager.itemEnd(e)) : (r && r(i),
  48327. o.manager.itemError(e))
  48328. }, !1),
  48329. void 0 !== i && s.addEventListener("progress", function(e) {
  48330. i(e)
  48331. }, !1),
  48332. s.addEventListener("error", function(t) {
  48333. r && r(t),
  48334. o.manager.itemError(e)
  48335. }, !1),
  48336. void 0 !== this.responseType && (s.responseType = this.responseType),
  48337. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  48338. s.send(null),
  48339. o.manager.itemStart(e),
  48340. s
  48341. },
  48342. setPath: function(e) {
  48343. this.path = e
  48344. },
  48345. setResponseType: function(e) {
  48346. this.responseType = e
  48347. },
  48348. setWithCredentials: function(e) {
  48349. this.withCredentials = e
  48350. }
  48351. },
  48352. n.FontLoader = function(e) {
  48353. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48354. }
  48355. ,
  48356. n.FontLoader.prototype = {
  48357. constructor: n.FontLoader,
  48358. load: function(e, t, i, r) {
  48359. var o = new n.XHRLoader(this.manager);
  48360. o.load(e, function(e) {
  48361. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  48362. }, i, r)
  48363. }
  48364. },
  48365. n.ImageLoader = function(e) {
  48366. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48367. }
  48368. ,
  48369. n.ImageLoader.prototype = {
  48370. constructor: n.ImageLoader,
  48371. load: function(e, t, i, r) {
  48372. void 0 !== this.path && (e = this.path + e);
  48373. var o = this
  48374. , a = n.Cache.get(e);
  48375. if (void 0 !== a)
  48376. return o.manager.itemStart(e),
  48377. t ? setTimeout(function() {
  48378. t(a),
  48379. o.manager.itemEnd(e)
  48380. }, 0) : o.manager.itemEnd(e),
  48381. a;
  48382. var s = document.createElement("img");
  48383. return s.addEventListener("load", function(i) {
  48384. n.Cache.add(e, this),
  48385. t && t(this),
  48386. o.manager.itemEnd(e)
  48387. }, !1),
  48388. void 0 !== i && s.addEventListener("progress", function(e) {
  48389. i(e)
  48390. }, !1),
  48391. s.addEventListener("error", function(t) {
  48392. r && r(t),
  48393. o.manager.itemError(e)
  48394. }, !1),
  48395. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  48396. o.manager.itemStart(e),
  48397. s.src = e,
  48398. s
  48399. },
  48400. setCrossOrigin: function(e) {
  48401. this.crossOrigin = e
  48402. },
  48403. setPath: function(e) {
  48404. this.path = e
  48405. }
  48406. },
  48407. n.JSONLoader = function(e) {
  48408. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  48409. e = void 0),
  48410. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48411. this.withCredentials = !1
  48412. }
  48413. ,
  48414. n.JSONLoader.prototype = {
  48415. constructor: n.JSONLoader,
  48416. get statusDomElement() {
  48417. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  48418. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  48419. this._statusDomElement
  48420. },
  48421. load: function(e, t, i, r) {
  48422. var o = this
  48423. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  48424. , s = new n.XHRLoader(this.manager);
  48425. s.setWithCredentials(this.withCredentials),
  48426. s.load(e, function(i) {
  48427. var n = JSON.parse(i)
  48428. , r = n.metadata;
  48429. if (void 0 !== r) {
  48430. var s = r.type;
  48431. if (void 0 !== s) {
  48432. if ("object" === s.toLowerCase())
  48433. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  48434. if ("scene" === s.toLowerCase())
  48435. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  48436. }
  48437. }
  48438. var l = o.parse(n, a);
  48439. t(l.geometry, l.materials)
  48440. }, i, r)
  48441. },
  48442. setTexturePath: function(e) {
  48443. this.texturePath = e
  48444. },
  48445. parse: function(e, t) {
  48446. function i(t) {
  48447. function i(e, t) {
  48448. return e & 1 << t
  48449. }
  48450. 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;
  48451. if (void 0 !== e.uvs) {
  48452. for (r = 0; r < e.uvs.length; r++)
  48453. e.uvs[r].length && B++;
  48454. for (r = 0; r < B; r++)
  48455. s.faceVertexUvs[r] = []
  48456. }
  48457. for (l = 0,
  48458. c = L.length; l < c; )
  48459. E = new n.Vector3,
  48460. E.x = L[l++] * t,
  48461. E.y = L[l++] * t,
  48462. E.z = L[l++] * t,
  48463. s.vertices.push(E);
  48464. for (l = 0,
  48465. c = O.length; l < c; )
  48466. if (f = O[l++],
  48467. g = i(f, 0),
  48468. m = i(f, 1),
  48469. v = i(f, 3),
  48470. A = i(f, 4),
  48471. y = i(f, 5),
  48472. C = i(f, 6),
  48473. I = i(f, 7),
  48474. g) {
  48475. if (w = new n.Face3,
  48476. w.a = O[l],
  48477. w.b = O[l + 1],
  48478. w.c = O[l + 3],
  48479. _ = new n.Face3,
  48480. _.a = O[l + 1],
  48481. _.b = O[l + 2],
  48482. _.c = O[l + 3],
  48483. l += 4,
  48484. m && (p = O[l++],
  48485. w.materialIndex = p,
  48486. _.materialIndex = p),
  48487. a = s.faces.length,
  48488. v)
  48489. for (r = 0; r < B; r++)
  48490. for (S = e.uvs[r],
  48491. s.faceVertexUvs[r][a] = [],
  48492. s.faceVertexUvs[r][a + 1] = [],
  48493. o = 0; o < 4; o++)
  48494. d = O[l++],
  48495. R = S[2 * d],
  48496. P = S[2 * d + 1],
  48497. M = new n.Vector2(R,P),
  48498. 2 !== o && s.faceVertexUvs[r][a].push(M),
  48499. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  48500. if (A && (u = 3 * O[l++],
  48501. w.normal.set(D[u++], D[u++], D[u]),
  48502. _.normal.copy(w.normal)),
  48503. y)
  48504. for (r = 0; r < 4; r++)
  48505. u = 3 * O[l++],
  48506. x = new n.Vector3(D[u++],D[u++],D[u]),
  48507. 2 !== r && w.vertexNormals.push(x),
  48508. 0 !== r && _.vertexNormals.push(x);
  48509. if (C && (h = O[l++],
  48510. T = N[h],
  48511. w.color.setHex(T),
  48512. _.color.setHex(T)),
  48513. I)
  48514. for (r = 0; r < 4; r++)
  48515. h = O[l++],
  48516. T = N[h],
  48517. 2 !== r && w.vertexColors.push(new n.Color(T)),
  48518. 0 !== r && _.vertexColors.push(new n.Color(T));
  48519. s.faces.push(w),
  48520. s.faces.push(_)
  48521. } else {
  48522. if (b = new n.Face3,
  48523. b.a = O[l++],
  48524. b.b = O[l++],
  48525. b.c = O[l++],
  48526. m && (p = O[l++],
  48527. b.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. o = 0; o < 3; o++)
  48534. d = O[l++],
  48535. R = S[2 * d],
  48536. P = S[2 * d + 1],
  48537. M = new n.Vector2(R,P),
  48538. s.faceVertexUvs[r][a].push(M);
  48539. if (A && (u = 3 * O[l++],
  48540. b.normal.set(D[u++], D[u++], D[u])),
  48541. y)
  48542. for (r = 0; r < 3; r++)
  48543. u = 3 * O[l++],
  48544. x = new n.Vector3(D[u++],D[u++],D[u]),
  48545. b.vertexNormals.push(x);
  48546. if (C && (h = O[l++],
  48547. b.color.setHex(N[h])),
  48548. I)
  48549. for (r = 0; r < 3; r++)
  48550. h = O[l++],
  48551. b.vertexColors.push(new n.Color(N[h]));
  48552. s.faces.push(b)
  48553. }
  48554. }
  48555. function r() {
  48556. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  48557. if (e.skinWeights)
  48558. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  48559. var o = e.skinWeights[i]
  48560. , a = t > 1 ? e.skinWeights[i + 1] : 0
  48561. , l = t > 2 ? e.skinWeights[i + 2] : 0
  48562. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  48563. s.skinWeights.push(new n.Vector4(o,a,l,c))
  48564. }
  48565. if (e.skinIndices)
  48566. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  48567. var h = e.skinIndices[i]
  48568. , u = t > 1 ? e.skinIndices[i + 1] : 0
  48569. , d = t > 2 ? e.skinIndices[i + 2] : 0
  48570. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  48571. s.skinIndices.push(new n.Vector4(h,u,d,p))
  48572. }
  48573. s.bones = e.bones,
  48574. 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.")
  48575. }
  48576. function o(t) {
  48577. if (void 0 !== e.morphTargets)
  48578. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  48579. s.morphTargets[i] = {},
  48580. s.morphTargets[i].name = e.morphTargets[i].name,
  48581. s.morphTargets[i].vertices = [];
  48582. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  48583. var h = new n.Vector3;
  48584. h.x = a[l] * t,
  48585. h.y = a[l + 1] * t,
  48586. h.z = a[l + 2] * t,
  48587. o.push(h)
  48588. }
  48589. }
  48590. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  48591. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  48592. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  48593. u[i].color.fromArray(d, 3 * i)
  48594. }
  48595. }
  48596. function a() {
  48597. var t = []
  48598. , i = [];
  48599. void 0 !== e.animation && i.push(e.animation),
  48600. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  48601. for (var r = 0; r < i.length; r++) {
  48602. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  48603. o && t.push(o)
  48604. }
  48605. if (s.morphTargets) {
  48606. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  48607. t = t.concat(a)
  48608. }
  48609. t.length > 0 && (s.animations = t)
  48610. }
  48611. var s = new n.Geometry
  48612. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  48613. if (i(l),
  48614. r(),
  48615. o(l),
  48616. a(),
  48617. s.computeFaceNormals(),
  48618. s.computeBoundingSphere(),
  48619. void 0 === e.materials || 0 === e.materials.length)
  48620. return {
  48621. geometry: s
  48622. };
  48623. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  48624. return {
  48625. geometry: s,
  48626. materials: c
  48627. }
  48628. }
  48629. },
  48630. n.LoadingManager = function(e, t, i) {
  48631. var n = this
  48632. , r = !1
  48633. , o = 0
  48634. , a = 0;
  48635. this.onStart = void 0,
  48636. this.onLoad = e,
  48637. this.onProgress = t,
  48638. this.onError = i,
  48639. this.itemStart = function(e) {
  48640. a++,
  48641. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  48642. r = !0
  48643. }
  48644. ,
  48645. this.itemEnd = function(e) {
  48646. o++,
  48647. void 0 !== n.onProgress && n.onProgress(e, o, a),
  48648. o === a && (r = !1,
  48649. void 0 !== n.onLoad && n.onLoad())
  48650. }
  48651. ,
  48652. this.itemError = function(e) {
  48653. void 0 !== n.onError && n.onError(e)
  48654. }
  48655. }
  48656. ,
  48657. n.DefaultLoadingManager = new n.LoadingManager,
  48658. n.BufferGeometryLoader = function(e) {
  48659. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  48660. }
  48661. ,
  48662. n.BufferGeometryLoader.prototype = {
  48663. constructor: n.BufferGeometryLoader,
  48664. load: function(e, t, i, r) {
  48665. var o = this
  48666. , a = new n.XHRLoader(o.manager);
  48667. a.load(e, function(e) {
  48668. t(o.parse(JSON.parse(e)))
  48669. }, i, r)
  48670. },
  48671. parse: function(e) {
  48672. var t = new n.BufferGeometry
  48673. , i = e.data.index
  48674. , r = {
  48675. Int8Array: Int8Array,
  48676. Uint8Array: Uint8Array,
  48677. Uint8ClampedArray: Uint8ClampedArray,
  48678. Int16Array: Int16Array,
  48679. Uint16Array: Uint16Array,
  48680. Int32Array: Int32Array,
  48681. Uint32Array: Uint32Array,
  48682. Float32Array: Float32Array,
  48683. Float64Array: Float64Array
  48684. };
  48685. if (void 0 !== i) {
  48686. var o = new r[i.type](i.array);
  48687. t.setIndex(new n.BufferAttribute(o,1))
  48688. }
  48689. var a = e.data.attributes;
  48690. for (var s in a) {
  48691. var l = a[s]
  48692. , o = new r[l.type](l.array);
  48693. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  48694. }
  48695. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  48696. if (void 0 !== c)
  48697. for (var h = 0, u = c.length; h !== u; ++h) {
  48698. var d = c[h];
  48699. t.addGroup(d.start, d.count, d.materialIndex)
  48700. }
  48701. var p = e.data.boundingSphere;
  48702. if (void 0 !== p) {
  48703. var f = new n.Vector3;
  48704. void 0 !== p.center && f.fromArray(p.center),
  48705. t.boundingSphere = new n.Sphere(f,p.radius)
  48706. }
  48707. return t
  48708. }
  48709. },
  48710. n.MaterialLoader = function(e) {
  48711. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48712. this.textures = {}
  48713. }
  48714. ,
  48715. n.MaterialLoader.prototype = {
  48716. constructor: n.MaterialLoader,
  48717. load: function(e, t, i, r) {
  48718. var o = this
  48719. , a = new n.XHRLoader(o.manager);
  48720. a.load(e, function(e) {
  48721. t(o.parse(JSON.parse(e)))
  48722. }, i, r)
  48723. },
  48724. setTextures: function(e) {
  48725. this.textures = e
  48726. },
  48727. getTexture: function(e) {
  48728. var t = this.textures;
  48729. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  48730. t[e]
  48731. },
  48732. parse: function(e) {
  48733. var t = new n[e.type];
  48734. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  48735. void 0 !== e.name && (t.name = e.name),
  48736. void 0 !== e.color && t.color.setHex(e.color),
  48737. void 0 !== e.roughness && (t.roughness = e.roughness),
  48738. void 0 !== e.metalness && (t.metalness = e.metalness),
  48739. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  48740. void 0 !== e.specular && t.specular.setHex(e.specular),
  48741. void 0 !== e.shininess && (t.shininess = e.shininess),
  48742. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  48743. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  48744. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  48745. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  48746. void 0 !== e.shading && (t.shading = e.shading),
  48747. void 0 !== e.blending && (t.blending = e.blending),
  48748. void 0 !== e.side && (t.side = e.side),
  48749. void 0 !== e.opacity && (t.opacity = e.opacity),
  48750. void 0 !== e.transparent && (t.transparent = e.transparent),
  48751. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  48752. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  48753. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  48754. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  48755. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  48756. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  48757. void 0 !== e.size && (t.size = e.size),
  48758. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  48759. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  48760. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  48761. t.transparent = !0),
  48762. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  48763. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  48764. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  48765. void 0 !== e.normalScale) {
  48766. var i = e.normalScale;
  48767. Array.isArray(i) === !1 && (i = [i, i]),
  48768. t.normalScale = (new n.Vector2).fromArray(i)
  48769. }
  48770. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  48771. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  48772. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  48773. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  48774. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  48775. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  48776. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  48777. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  48778. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  48779. t.combine = n.MultiplyOperation),
  48780. e.reflectivity && (t.reflectivity = e.reflectivity),
  48781. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  48782. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  48783. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  48784. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  48785. void 0 !== e.materials)
  48786. for (var r = 0, o = e.materials.length; r < o; r++)
  48787. t.materials.push(this.parse(e.materials[r]));
  48788. return t
  48789. }
  48790. },
  48791. n.ObjectLoader = function(e) {
  48792. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  48793. this.texturePath = ""
  48794. }
  48795. ,
  48796. n.ObjectLoader.prototype = {
  48797. constructor: n.ObjectLoader,
  48798. load: function(e, t, i, r) {
  48799. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  48800. var o = this
  48801. , a = new n.XHRLoader(o.manager);
  48802. a.load(e, function(e) {
  48803. o.parse(JSON.parse(e), t)
  48804. }, i, r)
  48805. },
  48806. setTexturePath: function(e) {
  48807. this.texturePath = e
  48808. },
  48809. setCrossOrigin: function(e) {
  48810. this.crossOrigin = e
  48811. },
  48812. parse: function(e, t) {
  48813. var i = this.parseGeometries(e.geometries)
  48814. , n = this.parseImages(e.images, function() {
  48815. void 0 !== t && t(a)
  48816. })
  48817. , r = this.parseTextures(e.textures, n)
  48818. , o = this.parseMaterials(e.materials, r)
  48819. , a = this.parseObject(e.object, i, o);
  48820. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  48821. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  48822. a
  48823. },
  48824. parseGeometries: function(e) {
  48825. var t = {};
  48826. if (void 0 !== e)
  48827. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  48828. var s, l = e[o];
  48829. switch (l.type) {
  48830. case "PlaneGeometry":
  48831. case "PlaneBufferGeometry":
  48832. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  48833. break;
  48834. case "BoxGeometry":
  48835. case "BoxBufferGeometry":
  48836. case "CubeGeometry":
  48837. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  48838. break;
  48839. case "CircleGeometry":
  48840. case "CircleBufferGeometry":
  48841. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  48842. break;
  48843. case "CylinderGeometry":
  48844. case "CylinderBufferGeometry":
  48845. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  48846. break;
  48847. case "SphereGeometry":
  48848. case "SphereBufferGeometry":
  48849. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  48850. break;
  48851. case "DodecahedronGeometry":
  48852. s = new n.DodecahedronGeometry(l.radius,l.detail);
  48853. break;
  48854. case "IcosahedronGeometry":
  48855. s = new n.IcosahedronGeometry(l.radius,l.detail);
  48856. break;
  48857. case "OctahedronGeometry":
  48858. s = new n.OctahedronGeometry(l.radius,l.detail);
  48859. break;
  48860. case "TetrahedronGeometry":
  48861. s = new n.TetrahedronGeometry(l.radius,l.detail);
  48862. break;
  48863. case "RingGeometry":
  48864. case "RingBufferGeometry":
  48865. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  48866. break;
  48867. case "TorusGeometry":
  48868. case "TorusBufferGeometry":
  48869. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  48870. break;
  48871. case "TorusKnotGeometry":
  48872. case "TorusKnotBufferGeometry":
  48873. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  48874. break;
  48875. case "LatheGeometry":
  48876. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  48877. break;
  48878. case "BufferGeometry":
  48879. s = r.parse(l);
  48880. break;
  48881. case "Geometry":
  48882. s = i.parse(l.data, this.texturePath).geometry;
  48883. break;
  48884. default:
  48885. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  48886. continue
  48887. }
  48888. s.uuid = l.uuid,
  48889. void 0 !== l.name && (s.name = l.name),
  48890. t[l.uuid] = s
  48891. }
  48892. return t
  48893. },
  48894. parseMaterials: function(e, t) {
  48895. var i = {};
  48896. if (void 0 !== e) {
  48897. var r = new n.MaterialLoader;
  48898. r.setTextures(t);
  48899. for (var o = 0, a = e.length; o < a; o++) {
  48900. var s = r.parse(e[o]);
  48901. i[s.uuid] = s
  48902. }
  48903. }
  48904. return i
  48905. },
  48906. parseAnimations: function(e) {
  48907. for (var t = [], i = 0; i < e.length; i++) {
  48908. var r = n.AnimationClip.parse(e[i]);
  48909. t.push(r)
  48910. }
  48911. return t
  48912. },
  48913. parseImages: function(e, t) {
  48914. function i(e) {
  48915. return r.manager.itemStart(e),
  48916. s.load(e, function() {
  48917. r.manager.itemEnd(e)
  48918. })
  48919. }
  48920. var r = this
  48921. , o = {};
  48922. if (void 0 !== e && e.length > 0) {
  48923. var a = new n.LoadingManager(t)
  48924. , s = new n.ImageLoader(a);
  48925. s.setCrossOrigin(this.crossOrigin);
  48926. for (var l = 0, c = e.length; l < c; l++) {
  48927. var h = e[l]
  48928. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  48929. o[h.uuid] = i(u)
  48930. }
  48931. }
  48932. return o
  48933. },
  48934. parseTextures: function(e, t) {
  48935. function i(e) {
  48936. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  48937. n[e])
  48938. }
  48939. var r = {};
  48940. if (void 0 !== e)
  48941. for (var o = 0, a = e.length; o < a; o++) {
  48942. var s = e[o];
  48943. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  48944. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  48945. var l = new n.Texture(t[s.image]);
  48946. l.needsUpdate = !0,
  48947. l.uuid = s.uuid,
  48948. void 0 !== s.name && (l.name = s.name),
  48949. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  48950. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  48951. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  48952. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  48953. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  48954. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  48955. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  48956. l.wrapT = i(s.wrap[1])),
  48957. r[s.uuid] = l
  48958. }
  48959. return r
  48960. },
  48961. parseObject: function() {
  48962. var e = new n.Matrix4;
  48963. return function(t, i, r) {
  48964. function o(e) {
  48965. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  48966. i[e]
  48967. }
  48968. function a(e) {
  48969. if (void 0 !== e)
  48970. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  48971. r[e]
  48972. }
  48973. var s;
  48974. switch (t.type) {
  48975. case "Scene":
  48976. s = new n.Scene;
  48977. break;
  48978. case "PerspectiveCamera":
  48979. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  48980. break;
  48981. case "OrthographicCamera":
  48982. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  48983. break;
  48984. case "AmbientLight":
  48985. s = new n.AmbientLight(t.color,t.intensity);
  48986. break;
  48987. case "DirectionalLight":
  48988. s = new n.DirectionalLight(t.color,t.intensity);
  48989. break;
  48990. case "PointLight":
  48991. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  48992. break;
  48993. case "SpotLight":
  48994. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  48995. break;
  48996. case "HemisphereLight":
  48997. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  48998. break;
  48999. case "Mesh":
  49000. var l = o(t.geometry)
  49001. , c = a(t.material);
  49002. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  49003. break;
  49004. case "LOD":
  49005. s = new n.LOD;
  49006. break;
  49007. case "Line":
  49008. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  49009. break;
  49010. case "PointCloud":
  49011. case "Points":
  49012. s = new n.Points(o(t.geometry),a(t.material));
  49013. break;
  49014. case "Sprite":
  49015. s = new n.Sprite(a(t.material));
  49016. break;
  49017. case "Group":
  49018. s = new n.Group;
  49019. break;
  49020. default:
  49021. s = new n.Object3D
  49022. }
  49023. if (s.uuid = t.uuid,
  49024. void 0 !== t.name && (s.name = t.name),
  49025. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  49026. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  49027. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  49028. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  49029. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  49030. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  49031. void 0 !== t.visible && (s.visible = t.visible),
  49032. void 0 !== t.userData && (s.userData = t.userData),
  49033. void 0 !== t.children)
  49034. for (var h in t.children)
  49035. s.add(this.parseObject(t.children[h], i, r));
  49036. if ("LOD" === t.type)
  49037. for (var u = t.levels, d = 0; d < u.length; d++) {
  49038. var p = u[d]
  49039. , h = s.getObjectByProperty("uuid", p.object);
  49040. void 0 !== h && s.addLevel(h, p.distance)
  49041. }
  49042. return s
  49043. }
  49044. }()
  49045. },
  49046. n.TextureLoader = function(e) {
  49047. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49048. }
  49049. ,
  49050. n.TextureLoader.prototype = {
  49051. constructor: n.TextureLoader,
  49052. load: function(e, t, i, r) {
  49053. var o = new n.Texture
  49054. , a = new n.ImageLoader(this.manager);
  49055. return a.setCrossOrigin(this.crossOrigin),
  49056. a.setPath(this.path),
  49057. a.load(e, function(e) {
  49058. o.image = e,
  49059. o.needsUpdate = !0,
  49060. void 0 !== t && t(o)
  49061. }, i, r),
  49062. o
  49063. },
  49064. setCrossOrigin: function(e) {
  49065. this.crossOrigin = e
  49066. },
  49067. setPath: function(e) {
  49068. this.path = e
  49069. }
  49070. },
  49071. n.CubeTextureLoader = function(e) {
  49072. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  49073. }
  49074. ,
  49075. n.CubeTextureLoader.prototype = {
  49076. constructor: n.CubeTextureLoader,
  49077. load: function(e, t, i, r) {
  49078. function o(i) {
  49079. s.load(e[i], function(e) {
  49080. a.images[i] = e,
  49081. l++,
  49082. 6 === l && (a.needsUpdate = !0,
  49083. t && t(a))
  49084. }, void 0, r)
  49085. }
  49086. var a = new n.CubeTexture
  49087. , s = new n.ImageLoader(this.manager);
  49088. s.setCrossOrigin(this.crossOrigin),
  49089. s.setPath(this.path);
  49090. for (var l = 0, c = 0; c < e.length; ++c)
  49091. o(c);
  49092. return a
  49093. },
  49094. setCrossOrigin: function(e) {
  49095. this.crossOrigin = e
  49096. },
  49097. setPath: function(e) {
  49098. this.path = e
  49099. }
  49100. },
  49101. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  49102. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49103. this._parser = null
  49104. }
  49105. ,
  49106. n.BinaryTextureLoader.prototype = {
  49107. constructor: n.BinaryTextureLoader,
  49108. load: function(e, t, i, r) {
  49109. var o = this
  49110. , a = new n.DataTexture
  49111. , s = new n.XHRLoader(this.manager);
  49112. return s.setResponseType("arraybuffer"),
  49113. s.load(e, function(e) {
  49114. var i = o._parser(e);
  49115. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  49116. a.image.height = i.height,
  49117. a.image.data = i.data),
  49118. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  49119. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  49120. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  49121. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  49122. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  49123. void 0 !== i.format && (a.format = i.format),
  49124. void 0 !== i.type && (a.type = i.type),
  49125. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  49126. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  49127. a.needsUpdate = !0,
  49128. t && t(a, i))
  49129. }, i, r),
  49130. a
  49131. }
  49132. },
  49133. n.CompressedTextureLoader = function(e) {
  49134. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  49135. this._parser = null
  49136. }
  49137. ;
  49138. n.CompressedTextureLoader.prototype = {
  49139. constructor: n.CompressedTextureLoader,
  49140. load: function(e, t, i, r) {
  49141. function o(o) {
  49142. c.load(e[o], function(e) {
  49143. var i = a._parser(e, !0);
  49144. s[o] = {
  49145. width: i.width,
  49146. height: i.height,
  49147. format: i.format,
  49148. mipmaps: i.mipmaps
  49149. },
  49150. h += 1,
  49151. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49152. l.format = i.format,
  49153. l.needsUpdate = !0,
  49154. t && t(l))
  49155. }, i, r)
  49156. }
  49157. var a = this
  49158. , s = []
  49159. , l = new n.CompressedTexture;
  49160. l.image = s;
  49161. var c = new n.XHRLoader(this.manager);
  49162. if (c.setPath(this.path),
  49163. c.setResponseType("arraybuffer"),
  49164. Array.isArray(e))
  49165. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  49166. o(u);
  49167. else
  49168. c.load(e, function(e) {
  49169. var i = a._parser(e, !0);
  49170. if (i.isCubemap)
  49171. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  49172. s[o] = {
  49173. mipmaps: []
  49174. };
  49175. for (var c = 0; c < i.mipmapCount; c++)
  49176. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  49177. s[o].format = i.format,
  49178. s[o].width = i.width,
  49179. s[o].height = i.height
  49180. }
  49181. else
  49182. l.image.width = i.width,
  49183. l.image.height = i.height,
  49184. l.mipmaps = i.mipmaps;
  49185. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  49186. l.format = i.format,
  49187. l.needsUpdate = !0,
  49188. t && t(l)
  49189. }, i, r);
  49190. return l
  49191. },
  49192. setPath: function(e) {
  49193. this.path = e
  49194. }
  49195. };
  49196. n.Material = function() {
  49197. Object.defineProperty(this, "id", {
  49198. value: n.MaterialIdCount++
  49199. }),
  49200. this.uuid = n.Math.generateUUID(),
  49201. this.name = "",
  49202. this.type = "Material",
  49203. this.side = n.FrontSide,
  49204. this.opacity = 1,
  49205. this.transparent = !1,
  49206. this.blending = n.NormalBlending,
  49207. this.blendSrc = n.SrcAlphaFactor,
  49208. this.blendDst = n.OneMinusSrcAlphaFactor,
  49209. this.blendEquation = n.AddEquation,
  49210. this.blendSrcAlpha = null,
  49211. this.blendDstAlpha = null,
  49212. this.blendEquationAlpha = null,
  49213. this.depthFunc = n.LessEqualDepth,
  49214. this.depthTest = !0,
  49215. this.depthWrite = !0,
  49216. this.colorWrite = !0,
  49217. this.precision = null,
  49218. this.polygonOffset = !1,
  49219. this.polygonOffsetFactor = 0,
  49220. this.polygonOffsetUnits = 0,
  49221. this.alphaTest = 0,
  49222. this.premultipliedAlpha = !1,
  49223. this.overdraw = 0,
  49224. this.visible = !0,
  49225. this._needsUpdate = !0
  49226. }
  49227. ,
  49228. n.Material.prototype = {
  49229. constructor: n.Material,
  49230. get needsUpdate() {
  49231. return this._needsUpdate
  49232. },
  49233. set needsUpdate(e) {
  49234. e === !0 && this.update(),
  49235. this._needsUpdate = e
  49236. },
  49237. setValues: function(e) {
  49238. if (void 0 !== e)
  49239. for (var t in e) {
  49240. var i = e[t];
  49241. if (void 0 !== i) {
  49242. var r = this[t];
  49243. 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.")
  49244. } else
  49245. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  49246. }
  49247. },
  49248. toJSON: function(e) {
  49249. function t(e) {
  49250. var t = [];
  49251. for (var i in e) {
  49252. var n = e[i];
  49253. delete n.metadata,
  49254. t.push(n)
  49255. }
  49256. return t
  49257. }
  49258. var i = void 0 === e;
  49259. i && (e = {
  49260. textures: {},
  49261. images: {}
  49262. });
  49263. var r = {
  49264. metadata: {
  49265. version: 4.4,
  49266. type: "Material",
  49267. generator: "Material.toJSON"
  49268. }
  49269. };
  49270. if (r.uuid = this.uuid,
  49271. r.type = this.type,
  49272. "" !== this.name && (r.name = this.name),
  49273. this.color instanceof n.Color && (r.color = this.color.getHex()),
  49274. .5 !== this.roughness && (r.roughness = this.roughness),
  49275. .5 !== this.metalness && (r.metalness = this.metalness),
  49276. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  49277. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  49278. void 0 !== this.shininess && (r.shininess = this.shininess),
  49279. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  49280. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  49281. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  49282. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  49283. r.bumpScale = this.bumpScale),
  49284. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  49285. r.normalScale = this.normalScale.toArray()),
  49286. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  49287. r.displacementScale = this.displacementScale,
  49288. r.displacementBias = this.displacementBias),
  49289. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  49290. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  49291. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  49292. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  49293. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  49294. r.reflectivity = this.reflectivity),
  49295. void 0 !== this.size && (r.size = this.size),
  49296. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  49297. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  49298. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  49299. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  49300. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  49301. this.opacity < 1 && (r.opacity = this.opacity),
  49302. this.transparent === !0 && (r.transparent = this.transparent),
  49303. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  49304. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  49305. this.wireframe === !0 && (r.wireframe = this.wireframe),
  49306. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  49307. i) {
  49308. var o = t(e.textures)
  49309. , a = t(e.images);
  49310. o.length > 0 && (r.textures = o),
  49311. a.length > 0 && (r.images = a)
  49312. }
  49313. return r
  49314. },
  49315. clone: function() {
  49316. return (new this.constructor).copy(this)
  49317. },
  49318. copy: function(e) {
  49319. return this.name = e.name,
  49320. this.side = e.side,
  49321. this.opacity = e.opacity,
  49322. this.transparent = e.transparent,
  49323. this.blending = e.blending,
  49324. this.blendSrc = e.blendSrc,
  49325. this.blendDst = e.blendDst,
  49326. this.blendEquation = e.blendEquation,
  49327. this.blendSrcAlpha = e.blendSrcAlpha,
  49328. this.blendDstAlpha = e.blendDstAlpha,
  49329. this.blendEquationAlpha = e.blendEquationAlpha,
  49330. this.depthFunc = e.depthFunc,
  49331. this.depthTest = e.depthTest,
  49332. this.depthWrite = e.depthWrite,
  49333. this.colorWrite = e.colorWrite,
  49334. this.precision = e.precision,
  49335. this.polygonOffset = e.polygonOffset,
  49336. this.polygonOffsetFactor = e.polygonOffsetFactor,
  49337. this.polygonOffsetUnits = e.polygonOffsetUnits,
  49338. this.alphaTest = e.alphaTest,
  49339. this.premultipliedAlpha = e.premultipliedAlpha,
  49340. this.overdraw = e.overdraw,
  49341. this.visible = e.visible,
  49342. this
  49343. },
  49344. update: function() {
  49345. this.dispatchEvent({
  49346. type: "update"
  49347. })
  49348. },
  49349. dispose: function() {
  49350. this.dispatchEvent({
  49351. type: "dispose"
  49352. })
  49353. }
  49354. },
  49355. n.EventDispatcher.prototype.apply(n.Material.prototype),
  49356. n.MaterialIdCount = 0,
  49357. n.LineBasicMaterial = function(e) {
  49358. n.Material.call(this),
  49359. this.type = "LineBasicMaterial",
  49360. this.color = new n.Color(16777215),
  49361. this.linewidth = 1,
  49362. this.linecap = "round",
  49363. this.linejoin = "round",
  49364. this.blending = n.NormalBlending,
  49365. this.vertexColors = n.NoColors,
  49366. this.fog = !0,
  49367. this.setValues(e)
  49368. }
  49369. ,
  49370. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  49371. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  49372. n.LineBasicMaterial.prototype.copy = function(e) {
  49373. return n.Material.prototype.copy.call(this, e),
  49374. this.color.copy(e.color),
  49375. this.linewidth = e.linewidth,
  49376. this.linecap = e.linecap,
  49377. this.linejoin = e.linejoin,
  49378. this.vertexColors = e.vertexColors,
  49379. this.fog = e.fog,
  49380. this
  49381. }
  49382. ,
  49383. n.LineDashedMaterial = function(e) {
  49384. n.Material.call(this),
  49385. this.type = "LineDashedMaterial",
  49386. this.color = new n.Color(16777215),
  49387. this.linewidth = 1,
  49388. this.scale = 1,
  49389. this.dashSize = 3,
  49390. this.gapSize = 1,
  49391. this.blending = n.NormalBlending,
  49392. this.vertexColors = n.NoColors,
  49393. this.fog = !0,
  49394. this.setValues(e)
  49395. }
  49396. ,
  49397. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  49398. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  49399. n.LineDashedMaterial.prototype.copy = function(e) {
  49400. return n.Material.prototype.copy.call(this, e),
  49401. this.color.copy(e.color),
  49402. this.linewidth = e.linewidth,
  49403. this.scale = e.scale,
  49404. this.dashSize = e.dashSize,
  49405. this.gapSize = e.gapSize,
  49406. this.vertexColors = e.vertexColors,
  49407. this.fog = e.fog,
  49408. this
  49409. }
  49410. ,
  49411. n.MeshBasicMaterial = function(e) {
  49412. n.Material.call(this),
  49413. this.type = "MeshBasicMaterial",
  49414. this.color = new n.Color(16777215),
  49415. this.map = null,
  49416. this.aoMap = null,
  49417. this.aoMapIntensity = 1,
  49418. this.specularMap = null,
  49419. this.alphaMap = null,
  49420. this.envMap = null,
  49421. this.combine = n.MultiplyOperation,
  49422. this.reflectivity = 1,
  49423. this.refractionRatio = .98,
  49424. this.fog = !0,
  49425. this.shading = n.SmoothShading,
  49426. this.blending = n.NormalBlending,
  49427. this.wireframe = !1,
  49428. this.wireframeLinewidth = 1,
  49429. this.wireframeLinecap = "round",
  49430. this.wireframeLinejoin = "round",
  49431. this.vertexColors = n.NoColors,
  49432. this.skinning = !1,
  49433. this.morphTargets = !1,
  49434. this.setValues(e)
  49435. }
  49436. ,
  49437. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  49438. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  49439. n.MeshBasicMaterial.prototype.copy = function(e) {
  49440. return n.Material.prototype.copy.call(this, e),
  49441. this.color.copy(e.color),
  49442. this.map = e.map,
  49443. this.aoMap = e.aoMap,
  49444. this.aoMapIntensity = e.aoMapIntensity,
  49445. this.specularMap = e.specularMap,
  49446. this.alphaMap = e.alphaMap,
  49447. this.envMap = e.envMap,
  49448. this.combine = e.combine,
  49449. this.reflectivity = e.reflectivity,
  49450. this.refractionRatio = e.refractionRatio,
  49451. this.fog = e.fog,
  49452. this.shading = e.shading,
  49453. this.wireframe = e.wireframe,
  49454. this.wireframeLinewidth = e.wireframeLinewidth,
  49455. this.wireframeLinecap = e.wireframeLinecap,
  49456. this.wireframeLinejoin = e.wireframeLinejoin,
  49457. this.vertexColors = e.vertexColors,
  49458. this.skinning = e.skinning,
  49459. this.morphTargets = e.morphTargets,
  49460. this
  49461. }
  49462. ,
  49463. n.MeshLambertMaterial = function(e) {
  49464. n.Material.call(this),
  49465. this.type = "MeshLambertMaterial",
  49466. this.color = new n.Color(16777215),
  49467. this.map = null,
  49468. this.lightMap = null,
  49469. this.lightMapIntensity = 1,
  49470. this.aoMap = null,
  49471. this.aoMapIntensity = 1,
  49472. this.emissive = new n.Color(0),
  49473. this.emissiveIntensity = 1,
  49474. this.emissiveMap = null,
  49475. this.specularMap = null,
  49476. this.alphaMap = null,
  49477. this.envMap = null,
  49478. this.combine = n.MultiplyOperation,
  49479. this.reflectivity = 1,
  49480. this.refractionRatio = .98,
  49481. this.fog = !0,
  49482. this.blending = n.NormalBlending,
  49483. this.wireframe = !1,
  49484. this.wireframeLinewidth = 1,
  49485. this.wireframeLinecap = "round",
  49486. this.wireframeLinejoin = "round",
  49487. this.vertexColors = n.NoColors,
  49488. this.skinning = !1,
  49489. this.morphTargets = !1,
  49490. this.morphNormals = !1,
  49491. this.setValues(e)
  49492. }
  49493. ,
  49494. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  49495. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  49496. n.MeshLambertMaterial.prototype.copy = function(e) {
  49497. return n.Material.prototype.copy.call(this, e),
  49498. this.color.copy(e.color),
  49499. this.map = e.map,
  49500. this.lightMap = e.lightMap,
  49501. this.lightMapIntensity = e.lightMapIntensity,
  49502. this.aoMap = e.aoMap,
  49503. this.aoMapIntensity = e.aoMapIntensity,
  49504. this.emissive.copy(e.emissive),
  49505. this.emissiveMap = e.emissiveMap,
  49506. this.emissiveIntensity = e.emissiveIntensity,
  49507. this.specularMap = e.specularMap,
  49508. this.alphaMap = e.alphaMap,
  49509. this.envMap = e.envMap,
  49510. this.combine = e.combine,
  49511. this.reflectivity = e.reflectivity,
  49512. this.refractionRatio = e.refractionRatio,
  49513. this.fog = e.fog,
  49514. this.wireframe = e.wireframe,
  49515. this.wireframeLinewidth = e.wireframeLinewidth,
  49516. this.wireframeLinecap = e.wireframeLinecap,
  49517. this.wireframeLinejoin = e.wireframeLinejoin,
  49518. this.vertexColors = e.vertexColors,
  49519. this.skinning = e.skinning,
  49520. this.morphTargets = e.morphTargets,
  49521. this.morphNormals = e.morphNormals,
  49522. this
  49523. }
  49524. ,
  49525. n.MeshPhongMaterial = function(e) {
  49526. n.Material.call(this),
  49527. this.type = "MeshPhongMaterial",
  49528. this.color = new n.Color(16777215),
  49529. this.specular = new n.Color(1118481),
  49530. this.shininess = 30,
  49531. this.map = null,
  49532. this.lightMap = null,
  49533. this.lightMapIntensity = 1,
  49534. this.aoMap = null,
  49535. this.aoMapIntensity = 1,
  49536. this.emissive = new n.Color(0),
  49537. this.emissiveIntensity = 1,
  49538. this.emissiveMap = null,
  49539. this.bumpMap = null,
  49540. this.bumpScale = 1,
  49541. this.normalMap = null,
  49542. this.normalScale = new n.Vector2(1,1),
  49543. this.displacementMap = null,
  49544. this.displacementScale = 1,
  49545. this.displacementBias = 0,
  49546. this.specularMap = null,
  49547. this.alphaMap = null,
  49548. this.envMap = null,
  49549. this.combine = n.MultiplyOperation,
  49550. this.reflectivity = 1,
  49551. this.refractionRatio = .98,
  49552. this.fog = !0,
  49553. this.shading = n.SmoothShading,
  49554. this.blending = n.NormalBlending,
  49555. this.wireframe = !1,
  49556. this.wireframeLinewidth = 1,
  49557. this.wireframeLinecap = "round",
  49558. this.wireframeLinejoin = "round",
  49559. this.vertexColors = n.NoColors,
  49560. this.skinning = !1,
  49561. this.morphTargets = !1,
  49562. this.morphNormals = !1,
  49563. this.setValues(e)
  49564. }
  49565. ,
  49566. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  49567. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  49568. n.MeshPhongMaterial.prototype.copy = function(e) {
  49569. return n.Material.prototype.copy.call(this, e),
  49570. this.color.copy(e.color),
  49571. this.specular.copy(e.specular),
  49572. this.shininess = e.shininess,
  49573. this.map = e.map,
  49574. this.lightMap = e.lightMap,
  49575. this.lightMapIntensity = e.lightMapIntensity,
  49576. this.aoMap = e.aoMap,
  49577. this.aoMapIntensity = e.aoMapIntensity,
  49578. this.emissive.copy(e.emissive),
  49579. this.emissiveMap = e.emissiveMap,
  49580. this.emissiveIntensity = e.emissiveIntensity,
  49581. this.bumpMap = e.bumpMap,
  49582. this.bumpScale = e.bumpScale,
  49583. this.normalMap = e.normalMap,
  49584. this.normalScale.copy(e.normalScale),
  49585. this.displacementMap = e.displacementMap,
  49586. this.displacementScale = e.displacementScale,
  49587. this.displacementBias = e.displacementBias,
  49588. this.specularMap = e.specularMap,
  49589. this.alphaMap = e.alphaMap,
  49590. this.envMap = e.envMap,
  49591. this.combine = e.combine,
  49592. this.reflectivity = e.reflectivity,
  49593. this.refractionRatio = e.refractionRatio,
  49594. this.fog = e.fog,
  49595. this.shading = e.shading,
  49596. this.wireframe = e.wireframe,
  49597. this.wireframeLinewidth = e.wireframeLinewidth,
  49598. this.wireframeLinecap = e.wireframeLinecap,
  49599. this.wireframeLinejoin = e.wireframeLinejoin,
  49600. this.vertexColors = e.vertexColors,
  49601. this.skinning = e.skinning,
  49602. this.morphTargets = e.morphTargets,
  49603. this.morphNormals = e.morphNormals,
  49604. this
  49605. }
  49606. ,
  49607. n.MeshStandardMaterial = function(e) {
  49608. n.Material.call(this),
  49609. this.type = "MeshStandardMaterial",
  49610. this.color = new n.Color(16777215),
  49611. this.roughness = .5,
  49612. this.metalness = .5,
  49613. this.map = null,
  49614. this.lightMap = null,
  49615. this.lightMapIntensity = 1,
  49616. this.aoMap = null,
  49617. this.aoMapIntensity = 1,
  49618. this.emissive = new n.Color(0),
  49619. this.emissiveIntensity = 1,
  49620. this.emissiveMap = null,
  49621. this.bumpMap = null,
  49622. this.bumpScale = 1,
  49623. this.normalMap = null,
  49624. this.normalScale = new n.Vector2(1,1),
  49625. this.displacementMap = null,
  49626. this.displacementScale = 1,
  49627. this.displacementBias = 0,
  49628. this.roughnessMap = null,
  49629. this.metalnessMap = null,
  49630. this.alphaMap = null,
  49631. this.envMap = null,
  49632. this.envMapIntensity = 1,
  49633. this.refractionRatio = .98,
  49634. this.fog = !0,
  49635. this.shading = n.SmoothShading,
  49636. this.blending = n.NormalBlending,
  49637. this.wireframe = !1,
  49638. this.wireframeLinewidth = 1,
  49639. this.wireframeLinecap = "round",
  49640. this.wireframeLinejoin = "round",
  49641. this.vertexColors = n.NoColors,
  49642. this.skinning = !1,
  49643. this.morphTargets = !1,
  49644. this.morphNormals = !1,
  49645. this.setValues(e)
  49646. }
  49647. ,
  49648. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  49649. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  49650. n.MeshStandardMaterial.prototype.copy = function(e) {
  49651. return n.Material.prototype.copy.call(this, e),
  49652. this.color.copy(e.color),
  49653. this.roughness = e.roughness,
  49654. this.metalness = e.metalness,
  49655. this.map = e.map,
  49656. this.lightMap = e.lightMap,
  49657. this.lightMapIntensity = e.lightMapIntensity,
  49658. this.aoMap = e.aoMap,
  49659. this.aoMapIntensity = e.aoMapIntensity,
  49660. this.emissive.copy(e.emissive),
  49661. this.emissiveMap = e.emissiveMap,
  49662. this.emissiveIntensity = e.emissiveIntensity,
  49663. this.bumpMap = e.bumpMap,
  49664. this.bumpScale = e.bumpScale,
  49665. this.normalMap = e.normalMap,
  49666. this.normalScale.copy(e.normalScale),
  49667. this.displacementMap = e.displacementMap,
  49668. this.displacementScale = e.displacementScale,
  49669. this.displacementBias = e.displacementBias,
  49670. this.roughnessMap = e.roughnessMap,
  49671. this.metalnessMap = e.metalnessMap,
  49672. this.alphaMap = e.alphaMap,
  49673. this.envMap = e.envMap,
  49674. this.envMapIntensity = e.envMapIntensity,
  49675. this.refractionRatio = e.refractionRatio,
  49676. this.fog = e.fog,
  49677. this.shading = e.shading,
  49678. this.wireframe = e.wireframe,
  49679. this.wireframeLinewidth = e.wireframeLinewidth,
  49680. this.wireframeLinecap = e.wireframeLinecap,
  49681. this.wireframeLinejoin = e.wireframeLinejoin,
  49682. this.vertexColors = e.vertexColors,
  49683. this.skinning = e.skinning,
  49684. this.morphTargets = e.morphTargets,
  49685. this.morphNormals = e.morphNormals,
  49686. this
  49687. }
  49688. ,
  49689. n.MeshDepthMaterial = function(e) {
  49690. n.Material.call(this),
  49691. this.type = "MeshDepthMaterial",
  49692. this.morphTargets = !1,
  49693. this.wireframe = !1,
  49694. this.wireframeLinewidth = 1,
  49695. this.setValues(e)
  49696. }
  49697. ,
  49698. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  49699. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  49700. n.MeshDepthMaterial.prototype.copy = function(e) {
  49701. return n.Material.prototype.copy.call(this, e),
  49702. this.wireframe = e.wireframe,
  49703. this.wireframeLinewidth = e.wireframeLinewidth,
  49704. this
  49705. }
  49706. ,
  49707. n.MeshNormalMaterial = function(e) {
  49708. n.Material.call(this, e),
  49709. this.type = "MeshNormalMaterial",
  49710. this.wireframe = !1,
  49711. this.wireframeLinewidth = 1,
  49712. this.morphTargets = !1,
  49713. this.setValues(e)
  49714. }
  49715. ,
  49716. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  49717. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  49718. n.MeshNormalMaterial.prototype.copy = function(e) {
  49719. return n.Material.prototype.copy.call(this, e),
  49720. this.wireframe = e.wireframe,
  49721. this.wireframeLinewidth = e.wireframeLinewidth,
  49722. this
  49723. }
  49724. ,
  49725. n.MultiMaterial = function(e) {
  49726. this.uuid = n.Math.generateUUID(),
  49727. this.type = "MultiMaterial",
  49728. this.materials = e instanceof Array ? e : [],
  49729. this.visible = !0
  49730. }
  49731. ,
  49732. n.MultiMaterial.prototype = {
  49733. constructor: n.MultiMaterial,
  49734. toJSON: function(e) {
  49735. for (var t = {
  49736. metadata: {
  49737. version: 4.2,
  49738. type: "material",
  49739. generator: "MaterialExporter"
  49740. },
  49741. uuid: this.uuid,
  49742. type: this.type,
  49743. materials: []
  49744. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  49745. var o = i[n].toJSON(e);
  49746. delete o.metadata,
  49747. t.materials.push(o)
  49748. }
  49749. return t.visible = this.visible,
  49750. t
  49751. },
  49752. clone: function() {
  49753. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  49754. e.materials.push(this.materials[t].clone());
  49755. return e.visible = this.visible,
  49756. e
  49757. }
  49758. },
  49759. n.PointsMaterial = function(e) {
  49760. n.Material.call(this),
  49761. this.type = "PointsMaterial",
  49762. this.color = new n.Color(16777215),
  49763. this.map = null,
  49764. this.size = 1,
  49765. this.sizeAttenuation = !0,
  49766. this.blending = n.NormalBlending,
  49767. this.vertexColors = n.NoColors,
  49768. this.fog = !0,
  49769. this.setValues(e)
  49770. }
  49771. ,
  49772. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  49773. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  49774. n.PointsMaterial.prototype.copy = function(e) {
  49775. return n.Material.prototype.copy.call(this, e),
  49776. this.color.copy(e.color),
  49777. this.map = e.map,
  49778. this.size = e.size,
  49779. this.sizeAttenuation = e.sizeAttenuation,
  49780. this.vertexColors = e.vertexColors,
  49781. this.fog = e.fog,
  49782. this
  49783. }
  49784. ,
  49785. n.ShaderMaterial = function(e) {
  49786. n.Material.call(this),
  49787. this.type = "ShaderMaterial",
  49788. this.defines = {},
  49789. this.uniforms = {},
  49790. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  49791. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  49792. this.shading = n.SmoothShading,
  49793. this.linewidth = 1,
  49794. this.wireframe = !1,
  49795. this.wireframeLinewidth = 1,
  49796. this.fog = !1,
  49797. this.lights = !1,
  49798. this.vertexColors = n.NoColors,
  49799. this.skinning = !1,
  49800. this.morphTargets = !1,
  49801. this.morphNormals = !1,
  49802. this.extensions = {
  49803. derivatives: !1,
  49804. fragDepth: !1,
  49805. drawBuffers: !1,
  49806. shaderTextureLOD: !1
  49807. },
  49808. this.defaultAttributeValues = {
  49809. color: [1, 1, 1],
  49810. uv: [0, 0],
  49811. uv2: [0, 0]
  49812. },
  49813. this.index0AttributeName = void 0,
  49814. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  49815. this.setValues(e))
  49816. }
  49817. ,
  49818. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  49819. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  49820. n.ShaderMaterial.prototype.copy = function(e) {
  49821. return n.Material.prototype.copy.call(this, e),
  49822. this.fragmentShader = e.fragmentShader,
  49823. this.vertexShader = e.vertexShader,
  49824. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  49825. this.defines = e.defines,
  49826. this.shading = e.shading,
  49827. this.wireframe = e.wireframe,
  49828. this.wireframeLinewidth = e.wireframeLinewidth,
  49829. this.fog = e.fog,
  49830. this.lights = e.lights,
  49831. this.vertexColors = e.vertexColors,
  49832. this.skinning = e.skinning,
  49833. this.morphTargets = e.morphTargets,
  49834. this.morphNormals = e.morphNormals,
  49835. this.extensions = e.extensions,
  49836. this
  49837. }
  49838. ,
  49839. n.ShaderMaterial.prototype.toJSON = function(e) {
  49840. var t = n.Material.prototype.toJSON.call(this, e);
  49841. return t.uniforms = this.uniforms,
  49842. t.vertexShader = this.vertexShader,
  49843. t.fragmentShader = this.fragmentShader,
  49844. t
  49845. }
  49846. ,
  49847. n.RawShaderMaterial = function(e) {
  49848. n.ShaderMaterial.call(this, e),
  49849. this.type = "RawShaderMaterial"
  49850. }
  49851. ,
  49852. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  49853. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  49854. n.SpriteMaterial = function(e) {
  49855. n.Material.call(this),
  49856. this.type = "SpriteMaterial",
  49857. this.color = new n.Color(16777215),
  49858. this.map = null,
  49859. this.rotation = 0,
  49860. this.fog = !1,
  49861. this.setValues(e)
  49862. }
  49863. ,
  49864. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  49865. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  49866. n.SpriteMaterial.prototype.copy = function(e) {
  49867. return n.Material.prototype.copy.call(this, e),
  49868. this.color.copy(e.color),
  49869. this.map = e.map,
  49870. this.rotation = e.rotation,
  49871. this.fog = e.fog,
  49872. this
  49873. }
  49874. ,
  49875. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  49876. Object.defineProperty(this, "id", {
  49877. value: n.TextureIdCount++
  49878. }),
  49879. this.uuid = n.Math.generateUUID(),
  49880. this.name = "",
  49881. this.sourceFile = "",
  49882. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  49883. this.mipmaps = [],
  49884. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  49885. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  49886. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  49887. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  49888. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  49889. this.anisotropy = void 0 !== c ? c : 1,
  49890. this.format = void 0 !== s ? s : n.RGBAFormat,
  49891. this.type = void 0 !== l ? l : n.UnsignedByteType,
  49892. this.offset = new n.Vector2(0,0),
  49893. this.repeat = new n.Vector2(1,1),
  49894. this.generateMipmaps = !0,
  49895. this.premultiplyAlpha = !1,
  49896. this.flipY = !0,
  49897. this.unpackAlignment = 4,
  49898. this.encoding = n.LinearEncoding,
  49899. this.version = 0,
  49900. this.onUpdate = null
  49901. }
  49902. ,
  49903. n.Texture.DEFAULT_IMAGE = void 0,
  49904. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  49905. n.Texture.prototype = {
  49906. constructor: n.Texture,
  49907. set needsUpdate(e) {
  49908. e === !0 && this.version++
  49909. },
  49910. clone: function() {
  49911. return (new this.constructor).copy(this)
  49912. },
  49913. copy: function(e) {
  49914. return this.image = e.image,
  49915. this.mipmaps = e.mipmaps.slice(0),
  49916. this.mapping = e.mapping,
  49917. this.wrapS = e.wrapS,
  49918. this.wrapT = e.wrapT,
  49919. this.magFilter = e.magFilter,
  49920. this.minFilter = e.minFilter,
  49921. this.anisotropy = e.anisotropy,
  49922. this.format = e.format,
  49923. this.type = e.type,
  49924. this.offset.copy(e.offset),
  49925. this.repeat.copy(e.repeat),
  49926. this.generateMipmaps = e.generateMipmaps,
  49927. this.premultiplyAlpha = e.premultiplyAlpha,
  49928. this.flipY = e.flipY,
  49929. this.unpackAlignment = e.unpackAlignment,
  49930. this.encoding = e.encoding,
  49931. this
  49932. },
  49933. toJSON: function(e) {
  49934. function t(e) {
  49935. var t;
  49936. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  49937. t.width = e.width,
  49938. t.height = e.height,
  49939. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  49940. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  49941. }
  49942. if (void 0 !== e.textures[this.uuid])
  49943. return e.textures[this.uuid];
  49944. var i = {
  49945. metadata: {
  49946. version: 4.4,
  49947. type: "Texture",
  49948. generator: "Texture.toJSON"
  49949. },
  49950. uuid: this.uuid,
  49951. name: this.name,
  49952. mapping: this.mapping,
  49953. repeat: [this.repeat.x, this.repeat.y],
  49954. offset: [this.offset.x, this.offset.y],
  49955. wrap: [this.wrapS, this.wrapT],
  49956. minFilter: this.minFilter,
  49957. magFilter: this.magFilter,
  49958. anisotropy: this.anisotropy
  49959. };
  49960. if (void 0 !== this.image) {
  49961. var r = this.image;
  49962. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  49963. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  49964. uuid: r.uuid,
  49965. url: t(r)
  49966. }),
  49967. i.image = r.uuid
  49968. }
  49969. return e.textures[this.uuid] = i,
  49970. i
  49971. },
  49972. dispose: function() {
  49973. this.dispatchEvent({
  49974. type: "dispose"
  49975. })
  49976. },
  49977. transformUv: function(e) {
  49978. if (this.mapping === n.UVMapping) {
  49979. if (e.multiply(this.repeat),
  49980. e.add(this.offset),
  49981. e.x < 0 || e.x > 1)
  49982. switch (this.wrapS) {
  49983. case n.RepeatWrapping:
  49984. e.x = e.x - Math.floor(e.x);
  49985. break;
  49986. case n.ClampToEdgeWrapping:
  49987. e.x = e.x < 0 ? 0 : 1;
  49988. break;
  49989. case n.MirroredRepeatWrapping:
  49990. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  49991. }
  49992. if (e.y < 0 || e.y > 1)
  49993. switch (this.wrapT) {
  49994. case n.RepeatWrapping:
  49995. e.y = e.y - Math.floor(e.y);
  49996. break;
  49997. case n.ClampToEdgeWrapping:
  49998. e.y = e.y < 0 ? 0 : 1;
  49999. break;
  50000. case n.MirroredRepeatWrapping:
  50001. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  50002. }
  50003. this.flipY && (e.y = 1 - e.y)
  50004. }
  50005. }
  50006. },
  50007. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  50008. n.TextureIdCount = 0,
  50009. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  50010. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50011. this.needsUpdate = !0
  50012. }
  50013. ,
  50014. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  50015. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  50016. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  50017. e = void 0 !== e ? e : [],
  50018. t = void 0 !== t ? t : n.CubeReflectionMapping,
  50019. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50020. this.flipY = !1
  50021. }
  50022. ,
  50023. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  50024. n.CubeTexture.prototype.constructor = n.CubeTexture,
  50025. Object.defineProperty(n.CubeTexture.prototype, "images", {
  50026. get: function() {
  50027. return this.image
  50028. },
  50029. set: function(e) {
  50030. this.image = e
  50031. }
  50032. }),
  50033. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50034. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50035. this.image = {
  50036. width: t,
  50037. height: i
  50038. },
  50039. this.mipmaps = e,
  50040. this.flipY = !1,
  50041. this.generateMipmaps = !1
  50042. }
  50043. ,
  50044. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  50045. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  50046. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  50047. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  50048. this.image = {
  50049. data: e,
  50050. width: t,
  50051. height: i
  50052. },
  50053. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  50054. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  50055. this.flipY = !1,
  50056. this.generateMipmaps = !1
  50057. }
  50058. ,
  50059. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  50060. n.DataTexture.prototype.constructor = n.DataTexture,
  50061. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  50062. function h() {
  50063. requestAnimationFrame(h)
  50064. if( !e.paused && e.readyState === e.HAVE_ENOUGH_DATA){//改 add !e.paused
  50065. u.needsUpdate = !0
  50066. }
  50067. }
  50068. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  50069. this.generateMipmaps = !1;
  50070. var u = this;
  50071. h()
  50072. }
  50073. ,
  50074. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  50075. n.VideoTexture.prototype.constructor = n.VideoTexture,
  50076. n.Group = function() {
  50077. n.Object3D.call(this),
  50078. this.type = "Group"
  50079. }
  50080. ,
  50081. n.Group.prototype = Object.create(n.Object3D.prototype),
  50082. n.Group.prototype.constructor = n.Group,
  50083. n.Points = function(e, t) {
  50084. n.Object3D.call(this),
  50085. this.type = "Points",
  50086. this.geometry = void 0 !== e ? e : new n.Geometry,
  50087. this.material = void 0 !== t ? t : new n.PointsMaterial({
  50088. color: 16777215 * Math.random()
  50089. })
  50090. }
  50091. ,
  50092. n.Points.prototype = Object.create(n.Object3D.prototype),
  50093. n.Points.prototype.constructor = n.Points,
  50094. n.Points.prototype.raycast = function() {
  50095. var e = new n.Matrix4
  50096. , t = new n.Ray
  50097. , i = new n.Sphere;
  50098. return function(r, o) {
  50099. function a(e, i) {
  50100. var n = t.distanceSqToPoint(e);
  50101. if (n < d) {
  50102. var a = t.closestPointToPoint(e);
  50103. a.applyMatrix4(c);
  50104. var l = r.ray.origin.distanceTo(a);
  50105. if (l < r.near || l > r.far)
  50106. return;
  50107. o.push({
  50108. distance: l,
  50109. distanceToRay: Math.sqrt(n),
  50110. point: a.clone(),
  50111. index: i,
  50112. face: null,
  50113. object: s
  50114. })
  50115. }
  50116. }
  50117. var s = this
  50118. , l = this.geometry
  50119. , c = this.matrixWorld
  50120. , h = r.params.Points.threshold;
  50121. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50122. i.copy(l.boundingSphere),
  50123. i.applyMatrix4(c),
  50124. r.ray.intersectsSphere(i) !== !1) {
  50125. e.getInverse(c),
  50126. t.copy(r.ray).applyMatrix4(e);
  50127. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  50128. , d = u * u
  50129. , p = new n.Vector3;
  50130. if (l instanceof n.BufferGeometry) {
  50131. var f = l.index
  50132. , g = l.attributes
  50133. , m = g.position.array;
  50134. if (null !== f)
  50135. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  50136. var C = v[A];
  50137. p.fromArray(m, 3 * C),
  50138. a(p, C)
  50139. }
  50140. else
  50141. for (var A = 0, I = m.length / 3; A < I; A++)
  50142. p.fromArray(m, 3 * A),
  50143. a(p, A)
  50144. } else
  50145. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  50146. a(E[A], A)
  50147. }
  50148. }
  50149. }(),
  50150. n.Points.prototype.clone = function() {
  50151. return new this.constructor(this.geometry,this.material).copy(this)
  50152. }
  50153. ,
  50154. n.Line = function(e, t, i) {
  50155. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  50156. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  50157. this.type = "Line",
  50158. this.geometry = void 0 !== e ? e : new n.Geometry,
  50159. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  50160. color: 16777215 * Math.random()
  50161. })))
  50162. }
  50163. ,
  50164. n.Line.prototype = Object.create(n.Object3D.prototype),
  50165. n.Line.prototype.constructor = n.Line,
  50166. n.Line.prototype.raycast = function() {
  50167. var e = new n.Matrix4
  50168. , t = new n.Ray
  50169. , i = new n.Sphere;
  50170. return function(r, o) {
  50171. var a = r.linePrecision
  50172. , s = a * a
  50173. , l = this.geometry
  50174. , c = this.matrixWorld;
  50175. if (null === l.boundingSphere && l.computeBoundingSphere(),
  50176. i.copy(l.boundingSphere),
  50177. i.applyMatrix4(c),
  50178. r.ray.intersectsSphere(i) !== !1) {
  50179. e.getInverse(c),
  50180. t.copy(r.ray).applyMatrix4(e);
  50181. var h = new n.Vector3
  50182. , u = new n.Vector3
  50183. , d = new n.Vector3
  50184. , p = new n.Vector3
  50185. , f = this instanceof n.LineSegments ? 2 : 1;
  50186. if (l instanceof n.BufferGeometry) {
  50187. var g = l.index
  50188. , m = l.attributes
  50189. , v = m.position.array;
  50190. if (null !== g)
  50191. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  50192. var I = A[y]
  50193. , E = A[y + 1];
  50194. h.fromArray(v, 3 * I),
  50195. u.fromArray(v, 3 * E);
  50196. var b = t.distanceSqToSegment(h, u, p, d);
  50197. if (!(b > s)) {
  50198. p.applyMatrix4(this.matrixWorld);
  50199. var w = r.ray.origin.distanceTo(p);
  50200. w < r.near || w > r.far || o.push({
  50201. distance: w,
  50202. point: d.clone().applyMatrix4(this.matrixWorld),
  50203. index: y,
  50204. face: null,
  50205. faceIndex: null,
  50206. object: this
  50207. })
  50208. }
  50209. }
  50210. else
  50211. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  50212. h.fromArray(v, 3 * y),
  50213. u.fromArray(v, 3 * y + 3);
  50214. var b = t.distanceSqToSegment(h, u, p, d);
  50215. if (!(b > s)) {
  50216. p.applyMatrix4(this.matrixWorld);
  50217. var w = r.ray.origin.distanceTo(p);
  50218. w < r.near || w > r.far || o.push({
  50219. distance: w,
  50220. point: d.clone().applyMatrix4(this.matrixWorld),
  50221. index: y,
  50222. face: null,
  50223. faceIndex: null,
  50224. object: this
  50225. })
  50226. }
  50227. }
  50228. } else if (l instanceof n.Geometry)
  50229. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  50230. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  50231. if (!(b > s)) {
  50232. p.applyMatrix4(this.matrixWorld);
  50233. var w = r.ray.origin.distanceTo(p);
  50234. w < r.near || w > r.far || o.push({
  50235. distance: w,
  50236. point: d.clone().applyMatrix4(this.matrixWorld),
  50237. index: y,
  50238. face: null,
  50239. faceIndex: null,
  50240. object: this
  50241. })
  50242. }
  50243. }
  50244. }
  50245. }
  50246. }(),
  50247. n.Line.prototype.clone = function() {
  50248. return new this.constructor(this.geometry,this.material).copy(this)
  50249. }
  50250. ,
  50251. n.LineStrip = 0,
  50252. n.LinePieces = 1,
  50253. n.LineSegments = function(e, t) {
  50254. n.Line.call(this, e, t),
  50255. this.type = "LineSegments"
  50256. }
  50257. ,
  50258. n.LineSegments.prototype = Object.create(n.Line.prototype),
  50259. n.LineSegments.prototype.constructor = n.LineSegments,
  50260. n.Mesh = function(e, t) {
  50261. n.Object3D.call(this),
  50262. this.type = "Mesh",
  50263. this.geometry = void 0 !== e ? e : new n.Geometry,
  50264. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  50265. color: 16777215 * Math.random()
  50266. }),
  50267. this.drawMode = n.TrianglesDrawMode,
  50268. this.updateMorphTargets()
  50269. }
  50270. ,
  50271. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  50272. n.Mesh.prototype.constructor = n.Mesh,
  50273. n.Mesh.prototype.setDrawMode = function(e) {
  50274. this.drawMode = e
  50275. }
  50276. ,
  50277. n.Mesh.prototype.updateMorphTargets = function() {
  50278. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  50279. this.morphTargetBase = -1,
  50280. this.morphTargetInfluences = [],
  50281. this.morphTargetDictionary = {};
  50282. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  50283. this.morphTargetInfluences.push(0),
  50284. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  50285. }
  50286. }
  50287. ,
  50288. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  50289. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  50290. 0)
  50291. }
  50292. ,
  50293. n.Mesh.prototype.raycast = function() {
  50294. function e(e, t, i, r, o, a, s) {
  50295. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  50296. o.multiplyScalar(m.x),
  50297. a.multiplyScalar(m.y),
  50298. s.multiplyScalar(m.z),
  50299. o.add(a).add(s),
  50300. o.clone()
  50301. }
  50302. function t(e, t, i, r, o, a, s) {
  50303. var l, c = e.material;
  50304. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  50305. null === l)
  50306. return null;
  50307. A.copy(s),
  50308. A.applyMatrix4(e.matrixWorld);
  50309. var h = t.ray.origin.distanceTo(A);
  50310. return h < t.near || h > t.far ? null : {
  50311. distance: h,
  50312. point: A.clone(),
  50313. object: e
  50314. }
  50315. }
  50316. function i(i, r, o, a, h, u, d, m) {
  50317. s.fromArray(a, 3 * u),
  50318. l.fromArray(a, 3 * d),
  50319. c.fromArray(a, 3 * m);
  50320. var A = t(i, r, o, s, l, c, v);
  50321. return A && (h && (p.fromArray(h, 2 * u),
  50322. f.fromArray(h, 2 * d),
  50323. g.fromArray(h, 2 * m),
  50324. A.uv = e(v, s, l, c, p, f, g)),
  50325. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  50326. A.faceIndex = u),
  50327. A
  50328. }
  50329. var r = new n.Matrix4
  50330. , o = new n.Ray
  50331. , a = new n.Sphere
  50332. , s = new n.Vector3
  50333. , l = new n.Vector3
  50334. , c = new n.Vector3
  50335. , h = new n.Vector3
  50336. , u = new n.Vector3
  50337. , d = new n.Vector3
  50338. , p = new n.Vector2
  50339. , f = new n.Vector2
  50340. , g = new n.Vector2
  50341. , m = new n.Vector3
  50342. , v = new n.Vector3
  50343. , A = new n.Vector3;
  50344. return function(m, A) {
  50345. var y = this.geometry
  50346. , C = this.material
  50347. , I = this.matrixWorld;
  50348. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  50349. a.copy(y.boundingSphere),
  50350. a.applyMatrix4(I),
  50351. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  50352. o.copy(m.ray).applyMatrix4(r),
  50353. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  50354. var E, b;
  50355. if (y instanceof n.BufferGeometry) {
  50356. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  50357. if (void 0 !== S.uv && (E = S.uv.array),
  50358. null !== x)
  50359. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  50360. w = R[P],
  50361. _ = R[P + 1],
  50362. T = R[P + 2],
  50363. b = i(this, m, o, M, E, w, _, T),
  50364. b && (b.faceIndex = Math.floor(P / 3),
  50365. A.push(b));
  50366. else
  50367. for (var P = 0, O = M.length; P < O; P += 9)
  50368. w = P / 3,
  50369. _ = w + 1,
  50370. T = w + 2,
  50371. b = i(this, m, o, M, E, w, _, T),
  50372. b && (b.index = w,
  50373. A.push(b))
  50374. } else if (y instanceof n.Geometry) {
  50375. 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];
  50376. k.length > 0 && (E = k);
  50377. for (var H = 0, G = U.length; H < G; H++) {
  50378. var z = U[H]
  50379. , W = B === !0 ? F[z.materialIndex] : C;
  50380. if (void 0 !== W) {
  50381. if (L = V[z.a],
  50382. D = V[z.b],
  50383. N = V[z.c],
  50384. W.morphTargets === !0) {
  50385. var j = y.morphTargets
  50386. , Y = this.morphTargetInfluences;
  50387. s.set(0, 0, 0),
  50388. l.set(0, 0, 0),
  50389. c.set(0, 0, 0);
  50390. for (var X = 0, Z = j.length; X < Z; X++) {
  50391. var q = Y[X];
  50392. if (0 !== q) {
  50393. var K = j[X].vertices;
  50394. s.addScaledVector(h.subVectors(K[z.a], L), q),
  50395. l.addScaledVector(u.subVectors(K[z.b], D), q),
  50396. c.addScaledVector(d.subVectors(K[z.c], N), q)
  50397. }
  50398. }
  50399. s.add(L),
  50400. l.add(D),
  50401. c.add(N),
  50402. L = s,
  50403. D = l,
  50404. N = c
  50405. }
  50406. if (b = t(this, m, o, L, D, N, v)) {
  50407. if (E) {
  50408. var Q = E[H];
  50409. p.copy(Q[0]),
  50410. f.copy(Q[1]),
  50411. g.copy(Q[2]),
  50412. b.uv = e(v, L, D, N, p, f, g)
  50413. }
  50414. b.face = z,
  50415. b.faceIndex = H,
  50416. A.push(b)
  50417. }
  50418. }
  50419. }
  50420. }
  50421. }
  50422. }
  50423. }(),
  50424. n.Mesh.prototype.clone = function() {
  50425. return new this.constructor(this.geometry,this.material).copy(this)
  50426. }
  50427. ,
  50428. n.Bone = function(e) {
  50429. n.Object3D.call(this),
  50430. this.type = "Bone",
  50431. this.skin = e
  50432. }
  50433. ,
  50434. n.Bone.prototype = Object.create(n.Object3D.prototype),
  50435. n.Bone.prototype.constructor = n.Bone,
  50436. n.Bone.prototype.copy = function(e) {
  50437. return n.Object3D.prototype.copy.call(this, e),
  50438. this.skin = e.skin,
  50439. this
  50440. }
  50441. ,
  50442. n.Skeleton = function(e, t, i) {
  50443. if (this.useVertexTexture = void 0 === i || i,
  50444. this.identityMatrix = new n.Matrix4,
  50445. e = e || [],
  50446. this.bones = e.slice(0),
  50447. this.useVertexTexture) {
  50448. var r = Math.sqrt(4 * this.bones.length);
  50449. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  50450. r = Math.max(r, 4),
  50451. this.boneTextureWidth = r,
  50452. this.boneTextureHeight = r,
  50453. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  50454. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  50455. } else
  50456. this.boneMatrices = new Float32Array(16 * this.bones.length);
  50457. if (void 0 === t)
  50458. this.calculateInverses();
  50459. else if (this.bones.length === t.length)
  50460. this.boneInverses = t.slice(0);
  50461. else {
  50462. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  50463. this.boneInverses = [];
  50464. for (var o = 0, a = this.bones.length; o < a; o++)
  50465. this.boneInverses.push(new n.Matrix4)
  50466. }
  50467. }
  50468. ,
  50469. n.Skeleton.prototype.calculateInverses = function() {
  50470. this.boneInverses = [];
  50471. for (var e = 0, t = this.bones.length; e < t; e++) {
  50472. var i = new n.Matrix4;
  50473. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  50474. this.boneInverses.push(i)
  50475. }
  50476. }
  50477. ,
  50478. n.Skeleton.prototype.pose = function() {
  50479. for (var e, t = 0, i = this.bones.length; t < i; t++)
  50480. e = this.bones[t],
  50481. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  50482. for (var t = 0, i = this.bones.length; t < i; t++)
  50483. e = this.bones[t],
  50484. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  50485. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  50486. e.matrix.decompose(e.position, e.quaternion, e.scale));
  50487. }
  50488. ,
  50489. n.Skeleton.prototype.update = function() {
  50490. var e = new n.Matrix4;
  50491. return function() {
  50492. for (var t = 0, i = this.bones.length; t < i; t++) {
  50493. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  50494. e.multiplyMatrices(n, this.boneInverses[t]),
  50495. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  50496. }
  50497. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  50498. }
  50499. }(),
  50500. n.Skeleton.prototype.clone = function() {
  50501. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  50502. }
  50503. ,
  50504. n.SkinnedMesh = function(e, t, i) {
  50505. n.Mesh.call(this, e, t),
  50506. this.type = "SkinnedMesh",
  50507. this.bindMode = "attached",
  50508. this.bindMatrix = new n.Matrix4,
  50509. this.bindMatrixInverse = new n.Matrix4;
  50510. var r = [];
  50511. if (this.geometry && void 0 !== this.geometry.bones) {
  50512. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  50513. a = this.geometry.bones[s],
  50514. o = new n.Bone(this),
  50515. r.push(o),
  50516. o.name = a.name,
  50517. o.position.fromArray(a.pos),
  50518. o.quaternion.fromArray(a.rotq),
  50519. void 0 !== a.scl && o.scale.fromArray(a.scl);
  50520. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  50521. a = this.geometry.bones[s],
  50522. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  50523. }
  50524. this.normalizeSkinWeights(),
  50525. this.updateMatrixWorld(!0),
  50526. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  50527. }
  50528. ,
  50529. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  50530. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  50531. n.SkinnedMesh.prototype.bind = function(e, t) {
  50532. this.skeleton = e,
  50533. void 0 === t && (this.updateMatrixWorld(!0),
  50534. this.skeleton.calculateInverses(),
  50535. t = this.matrixWorld),
  50536. this.bindMatrix.copy(t),
  50537. this.bindMatrixInverse.getInverse(t)
  50538. }
  50539. ,
  50540. n.SkinnedMesh.prototype.pose = function() {
  50541. this.skeleton.pose()
  50542. }
  50543. ,
  50544. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  50545. if (this.geometry instanceof n.Geometry)
  50546. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  50547. var t = this.geometry.skinWeights[e]
  50548. , i = 1 / t.lengthManhattan();
  50549. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  50550. }
  50551. else if (this.geometry instanceof n.BufferGeometry)
  50552. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  50553. r.x = o.getX(e),
  50554. r.y = o.getY(e),
  50555. r.z = o.getZ(e),
  50556. r.w = o.getW(e);
  50557. var i = 1 / r.lengthManhattan();
  50558. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  50559. o.setXYZW(e, r.x, r.y, r.z, r.w)
  50560. }
  50561. }
  50562. ,
  50563. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  50564. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  50565. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  50566. }
  50567. ,
  50568. n.SkinnedMesh.prototype.clone = function() {
  50569. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  50570. }
  50571. ,
  50572. n.LOD = function() {
  50573. n.Object3D.call(this),
  50574. this.type = "LOD",
  50575. Object.defineProperties(this, {
  50576. levels: {
  50577. enumerable: !0,
  50578. value: []
  50579. },
  50580. objects: {
  50581. get: function() {
  50582. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  50583. this.levels
  50584. }
  50585. }
  50586. })
  50587. }
  50588. ,
  50589. n.LOD.prototype = Object.create(n.Object3D.prototype),
  50590. n.LOD.prototype.constructor = n.LOD,
  50591. n.LOD.prototype.addLevel = function(e, t) {
  50592. void 0 === t && (t = 0),
  50593. t = Math.abs(t);
  50594. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  50595. ;
  50596. i.splice(n, 0, {
  50597. distance: t,
  50598. object: e
  50599. }),
  50600. this.add(e)
  50601. }
  50602. ,
  50603. n.LOD.prototype.getObjectForDistance = function(e) {
  50604. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  50605. ;
  50606. return t[i - 1].object
  50607. }
  50608. ,
  50609. n.LOD.prototype.raycast = function() {
  50610. var e = new n.Vector3;
  50611. return function(t, i) {
  50612. e.setFromMatrixPosition(this.matrixWorld);
  50613. var n = t.ray.origin.distanceTo(e);
  50614. this.getObjectForDistance(n).raycast(t, i)
  50615. }
  50616. }(),
  50617. n.LOD.prototype.update = function() {
  50618. var e = new n.Vector3
  50619. , t = new n.Vector3;
  50620. return function(i) {
  50621. var n = this.levels;
  50622. if (n.length > 1) {
  50623. e.setFromMatrixPosition(i.matrixWorld),
  50624. t.setFromMatrixPosition(this.matrixWorld);
  50625. var r = e.distanceTo(t);
  50626. n[0].object.visible = !0;
  50627. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  50628. n[o - 1].object.visible = !1,
  50629. n[o].object.visible = !0;
  50630. for (; o < a; o++)
  50631. n[o].object.visible = !1
  50632. }
  50633. }
  50634. }(),
  50635. n.LOD.prototype.copy = function(e) {
  50636. n.Object3D.prototype.copy.call(this, e, !1);
  50637. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  50638. var o = t[i];
  50639. this.addLevel(o.object.clone(), o.distance)
  50640. }
  50641. return this
  50642. }
  50643. ,
  50644. n.LOD.prototype.toJSON = function(e) {
  50645. var t = n.Object3D.prototype.toJSON.call(this, e);
  50646. t.object.levels = [];
  50647. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  50648. var a = i[r];
  50649. t.object.levels.push({
  50650. object: a.object.uuid,
  50651. distance: a.distance
  50652. })
  50653. }
  50654. return t
  50655. }
  50656. ,
  50657. n.Sprite = function() {
  50658. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  50659. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  50660. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  50661. , r = new n.BufferGeometry;
  50662. return r.setIndex(new n.BufferAttribute(e,1)),
  50663. r.addAttribute("position", new n.BufferAttribute(t,3)),
  50664. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  50665. function(e) {
  50666. n.Object3D.call(this),
  50667. this.type = "Sprite",
  50668. this.geometry = r,
  50669. this.material = void 0 !== e ? e : new n.SpriteMaterial
  50670. }
  50671. }(),
  50672. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  50673. n.Sprite.prototype.constructor = n.Sprite,
  50674. n.Sprite.prototype.raycast = function() {
  50675. var e = new n.Vector3;
  50676. return function(t, i) {
  50677. e.setFromMatrixPosition(this.matrixWorld);
  50678. var n = t.ray.distanceSqToPoint(e)
  50679. , r = this.scale.x * this.scale.y;
  50680. n > r || i.push({
  50681. distance: Math.sqrt(n),
  50682. point: this.position,
  50683. face: null,
  50684. object: this
  50685. })
  50686. }
  50687. }(),
  50688. n.Sprite.prototype.clone = function() {
  50689. return new this.constructor(this.material).copy(this)
  50690. }
  50691. ,
  50692. n.Particle = n.Sprite,
  50693. n.LensFlare = function(e, t, i, r, o) {
  50694. n.Object3D.call(this),
  50695. this.lensFlares = [],
  50696. this.positionScreen = new n.Vector3,
  50697. this.customUpdateCallback = void 0,
  50698. void 0 !== e && this.add(e, t, i, r, o)
  50699. }
  50700. ,
  50701. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  50702. n.LensFlare.prototype.constructor = n.LensFlare,
  50703. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  50704. void 0 === t && (t = -1),
  50705. void 0 === i && (i = 0),
  50706. void 0 === a && (a = 1),
  50707. void 0 === o && (o = new n.Color(16777215)),
  50708. void 0 === r && (r = n.NormalBlending),
  50709. i = Math.min(i, Math.max(0, i)),
  50710. this.lensFlares.push({
  50711. texture: e,
  50712. size: t,
  50713. distance: i,
  50714. x: 0,
  50715. y: 0,
  50716. z: 0,
  50717. scale: 1,
  50718. rotation: 0,
  50719. opacity: a,
  50720. color: o,
  50721. blending: r
  50722. })
  50723. }
  50724. ,
  50725. n.LensFlare.prototype.updateLensFlares = function() {
  50726. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  50727. for (e = 0; e < i; e++)
  50728. t = this.lensFlares[e],
  50729. t.x = this.positionScreen.x + n * t.distance,
  50730. t.y = this.positionScreen.y + r * t.distance,
  50731. t.wantedRotation = t.x * Math.PI * .25,
  50732. t.rotation += .25 * (t.wantedRotation - t.rotation)
  50733. }
  50734. ,
  50735. n.LensFlare.prototype.copy = function(e) {
  50736. n.Object3D.prototype.copy.call(this, e),
  50737. this.positionScreen.copy(e.positionScreen),
  50738. this.customUpdateCallback = e.customUpdateCallback;
  50739. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  50740. this.lensFlares.push(e.lensFlares[t]);
  50741. return this
  50742. }
  50743. ,
  50744. n.Scene = function() {
  50745. n.Object3D.call(this),
  50746. this.type = "Scene",
  50747. this.fog = null,
  50748. this.overrideMaterial = null,
  50749. this.autoUpdate = !0
  50750. }
  50751. ,
  50752. n.Scene.prototype = Object.create(n.Object3D.prototype),
  50753. n.Scene.prototype.constructor = n.Scene,
  50754. n.Scene.prototype.copy = function(e, t) {
  50755. return n.Object3D.prototype.copy.call(this, e, t),
  50756. null !== e.fog && (this.fog = e.fog.clone()),
  50757. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  50758. this.autoUpdate = e.autoUpdate,
  50759. this.matrixAutoUpdate = e.matrixAutoUpdate,
  50760. this
  50761. }
  50762. ,
  50763. n.Fog = function(e, t, i) {
  50764. this.name = "",
  50765. this.color = new n.Color(e),
  50766. this.near = void 0 !== t ? t : 1,
  50767. this.far = void 0 !== i ? i : 1e3
  50768. }
  50769. ,
  50770. n.Fog.prototype.clone = function() {
  50771. return new n.Fog(this.color.getHex(),this.near,this.far)
  50772. }
  50773. ,
  50774. n.FogExp2 = function(e, t) {
  50775. this.name = "",
  50776. this.color = new n.Color(e),
  50777. this.density = void 0 !== t ? t : 25e-5
  50778. }
  50779. ,
  50780. n.FogExp2.prototype.clone = function() {
  50781. return new n.FogExp2(this.color.getHex(),this.density)
  50782. }
  50783. ,
  50784. n.ShaderChunk = {},
  50785. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  50786. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  50787. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  50788. 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",
  50789. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  50790. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  50791. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  50792. 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",
  50793. 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",
  50794. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  50795. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  50796. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  50797. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  50798. 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",
  50799. 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",
  50800. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  50801. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  50802. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  50803. 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",
  50804. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  50805. 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",
  50806. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  50807. 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",
  50808. 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",
  50809. 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",
  50810. 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",
  50811. 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",
  50812. 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",
  50813. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  50814. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  50815. 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",
  50816. 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",
  50817. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  50818. 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",
  50819. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  50820. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  50821. 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",
  50822. 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",
  50823. 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",
  50824. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  50825. 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",
  50826. 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",
  50827. 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",
  50828. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  50829. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  50830. 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",
  50831. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  50832. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  50833. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  50834. 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",
  50835. 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";
  50836. 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";
  50837. 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",
  50838. 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",
  50839. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  50840. 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",
  50841. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  50842. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  50843. 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",
  50844. 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",
  50845. 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",
  50846. 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",
  50847. 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",
  50848. 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",
  50849. 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",
  50850. 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",
  50851. 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",
  50852. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  50853. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  50854. 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",
  50855. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  50856. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  50857. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  50858. 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",
  50859. 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",
  50860. 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",
  50861. 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",
  50862. n.UniformsUtils = {
  50863. merge: function(e) {
  50864. for (var t = {}, i = 0; i < e.length; i++) {
  50865. var n = this.clone(e[i]);
  50866. for (var r in n)
  50867. t[r] = n[r]
  50868. }
  50869. return t
  50870. },
  50871. clone: function(e) {
  50872. var t = {};
  50873. for (var i in e) {
  50874. t[i] = {};
  50875. for (var r in e[i]) {
  50876. var o = e[i][r];
  50877. 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
  50878. }
  50879. }
  50880. return t
  50881. }
  50882. },
  50883. n.UniformsLib = {
  50884. common: {
  50885. diffuse: {
  50886. type: "c",
  50887. value: new n.Color(15658734)
  50888. },
  50889. opacity: {
  50890. type: "f",
  50891. value: 1
  50892. },
  50893. map: {
  50894. type: "t",
  50895. value: null
  50896. },
  50897. offsetRepeat: {
  50898. type: "v4",
  50899. value: new n.Vector4(0,0,1,1)
  50900. },
  50901. specularMap: {
  50902. type: "t",
  50903. value: null
  50904. },
  50905. alphaMap: {
  50906. type: "t",
  50907. value: null
  50908. },
  50909. envMap: {
  50910. type: "t",
  50911. value: null
  50912. },
  50913. flipEnvMap: {
  50914. type: "f",
  50915. value: -1
  50916. },
  50917. reflectivity: {
  50918. type: "f",
  50919. value: 1
  50920. },
  50921. refractionRatio: {
  50922. type: "f",
  50923. value: .98
  50924. }
  50925. },
  50926. aomap: {
  50927. aoMap: {
  50928. type: "t",
  50929. value: null
  50930. },
  50931. aoMapIntensity: {
  50932. type: "f",
  50933. value: 1
  50934. }
  50935. },
  50936. lightmap: {
  50937. lightMap: {
  50938. type: "t",
  50939. value: null
  50940. },
  50941. lightMapIntensity: {
  50942. type: "f",
  50943. value: 1
  50944. }
  50945. },
  50946. emissivemap: {
  50947. emissiveMap: {
  50948. type: "t",
  50949. value: null
  50950. }
  50951. },
  50952. bumpmap: {
  50953. bumpMap: {
  50954. type: "t",
  50955. value: null
  50956. },
  50957. bumpScale: {
  50958. type: "f",
  50959. value: 1
  50960. }
  50961. },
  50962. normalmap: {
  50963. normalMap: {
  50964. type: "t",
  50965. value: null
  50966. },
  50967. normalScale: {
  50968. type: "v2",
  50969. value: new n.Vector2(1,1)
  50970. }
  50971. },
  50972. displacementmap: {
  50973. displacementMap: {
  50974. type: "t",
  50975. value: null
  50976. },
  50977. displacementScale: {
  50978. type: "f",
  50979. value: 1
  50980. },
  50981. displacementBias: {
  50982. type: "f",
  50983. value: 0
  50984. }
  50985. },
  50986. roughnessmap: {
  50987. roughnessMap: {
  50988. type: "t",
  50989. value: null
  50990. }
  50991. },
  50992. metalnessmap: {
  50993. metalnessMap: {
  50994. type: "t",
  50995. value: null
  50996. }
  50997. },
  50998. fog: {
  50999. fogDensity: {
  51000. type: "f",
  51001. value: 25e-5
  51002. },
  51003. fogNear: {
  51004. type: "f",
  51005. value: 1
  51006. },
  51007. fogFar: {
  51008. type: "f",
  51009. value: 2e3
  51010. },
  51011. fogColor: {
  51012. type: "c",
  51013. value: new n.Color(16777215)
  51014. }
  51015. },
  51016. lights: {
  51017. ambientLightColor: {
  51018. type: "fv",
  51019. value: []
  51020. },
  51021. directionalLights: {
  51022. type: "sa",
  51023. value: [],
  51024. properties: {
  51025. direction: {
  51026. type: "v3"
  51027. },
  51028. color: {
  51029. type: "c"
  51030. },
  51031. shadow: {
  51032. type: "i"
  51033. },
  51034. shadowBias: {
  51035. type: "f"
  51036. },
  51037. shadowRadius: {
  51038. type: "f"
  51039. },
  51040. shadowMapSize: {
  51041. type: "v2"
  51042. }
  51043. }
  51044. },
  51045. directionalShadowMap: {
  51046. type: "tv",
  51047. value: []
  51048. },
  51049. directionalShadowMatrix: {
  51050. type: "m4v",
  51051. value: []
  51052. },
  51053. spotLights: {
  51054. type: "sa",
  51055. value: [],
  51056. properties: {
  51057. color: {
  51058. type: "c"
  51059. },
  51060. position: {
  51061. type: "v3"
  51062. },
  51063. direction: {
  51064. type: "v3"
  51065. },
  51066. distance: {
  51067. type: "f"
  51068. },
  51069. coneCos: {
  51070. type: "f"
  51071. },
  51072. penumbraCos: {
  51073. type: "f"
  51074. },
  51075. decay: {
  51076. type: "f"
  51077. },
  51078. shadow: {
  51079. type: "i"
  51080. },
  51081. shadowBias: {
  51082. type: "f"
  51083. },
  51084. shadowRadius: {
  51085. type: "f"
  51086. },
  51087. shadowMapSize: {
  51088. type: "v2"
  51089. }
  51090. }
  51091. },
  51092. spotShadowMap: {
  51093. type: "tv",
  51094. value: []
  51095. },
  51096. spotShadowMatrix: {
  51097. type: "m4v",
  51098. value: []
  51099. },
  51100. pointLights: {
  51101. type: "sa",
  51102. value: [],
  51103. properties: {
  51104. color: {
  51105. type: "c"
  51106. },
  51107. position: {
  51108. type: "v3"
  51109. },
  51110. decay: {
  51111. type: "f"
  51112. },
  51113. distance: {
  51114. type: "f"
  51115. },
  51116. shadow: {
  51117. type: "i"
  51118. },
  51119. shadowBias: {
  51120. type: "f"
  51121. },
  51122. shadowRadius: {
  51123. type: "f"
  51124. },
  51125. shadowMapSize: {
  51126. type: "v2"
  51127. }
  51128. }
  51129. },
  51130. pointShadowMap: {
  51131. type: "tv",
  51132. value: []
  51133. },
  51134. pointShadowMatrix: {
  51135. type: "m4v",
  51136. value: []
  51137. },
  51138. hemisphereLights: {
  51139. type: "sa",
  51140. value: [],
  51141. properties: {
  51142. direction: {
  51143. type: "v3"
  51144. },
  51145. skyColor: {
  51146. type: "c"
  51147. },
  51148. groundColor: {
  51149. type: "c"
  51150. }
  51151. }
  51152. }
  51153. },
  51154. points: {
  51155. diffuse: {
  51156. type: "c",
  51157. value: new n.Color(15658734)
  51158. },
  51159. opacity: {
  51160. type: "f",
  51161. value: 1
  51162. },
  51163. size: {
  51164. type: "f",
  51165. value: 1
  51166. },
  51167. scale: {
  51168. type: "f",
  51169. value: 1
  51170. },
  51171. map: {
  51172. type: "t",
  51173. value: null
  51174. },
  51175. offsetRepeat: {
  51176. type: "v4",
  51177. value: new n.Vector4(0,0,1,1)
  51178. }
  51179. }
  51180. },
  51181. 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",
  51182. 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",
  51183. 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",
  51184. 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",
  51185. 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",
  51186. 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",
  51187. 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",
  51188. 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",
  51189. 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",
  51190. 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",
  51191. 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",
  51192. 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",
  51193. 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",
  51194. 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",
  51195. 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",
  51196. 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",
  51197. 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",
  51198. 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",
  51199. 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",
  51200. 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",
  51201. 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",
  51202. 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",
  51203. 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",
  51204. 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",
  51205. n.ShaderLib = {
  51206. basic: {
  51207. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  51208. vertexShader: n.ShaderChunk.meshbasic_vert,
  51209. fragmentShader: n.ShaderChunk.meshbasic_frag
  51210. },
  51211. lambert: {
  51212. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  51213. emissive: {
  51214. type: "c",
  51215. value: new n.Color(0)
  51216. }
  51217. }]),
  51218. vertexShader: n.ShaderChunk.meshlambert_vert,
  51219. fragmentShader: n.ShaderChunk.meshlambert_frag
  51220. },
  51221. phong: {
  51222. 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, {
  51223. emissive: {
  51224. type: "c",
  51225. value: new n.Color(0)
  51226. },
  51227. specular: {
  51228. type: "c",
  51229. value: new n.Color(1118481)
  51230. },
  51231. shininess: {
  51232. type: "f",
  51233. value: 30
  51234. }
  51235. }]),
  51236. vertexShader: n.ShaderChunk.meshphong_vert,
  51237. fragmentShader: n.ShaderChunk.meshphong_frag
  51238. },
  51239. standard: {
  51240. 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, {
  51241. emissive: {
  51242. type: "c",
  51243. value: new n.Color(0)
  51244. },
  51245. roughness: {
  51246. type: "f",
  51247. value: .5
  51248. },
  51249. metalness: {
  51250. type: "f",
  51251. value: 0
  51252. },
  51253. envMapIntensity: {
  51254. type: "f",
  51255. value: 1
  51256. }
  51257. }]),
  51258. vertexShader: n.ShaderChunk.meshstandard_vert,
  51259. fragmentShader: n.ShaderChunk.meshstandard_frag
  51260. },
  51261. points: {
  51262. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  51263. vertexShader: n.ShaderChunk.points_vert,
  51264. fragmentShader: n.ShaderChunk.points_frag
  51265. },
  51266. dashed: {
  51267. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  51268. scale: {
  51269. type: "f",
  51270. value: 1
  51271. },
  51272. dashSize: {
  51273. type: "f",
  51274. value: 1
  51275. },
  51276. totalSize: {
  51277. type: "f",
  51278. value: 2
  51279. }
  51280. }]),
  51281. vertexShader: n.ShaderChunk.linedashed_vert,
  51282. fragmentShader: n.ShaderChunk.linedashed_frag
  51283. },
  51284. depth: {
  51285. uniforms: {
  51286. mNear: {
  51287. type: "f",
  51288. value: 1
  51289. },
  51290. mFar: {
  51291. type: "f",
  51292. value: 2e3
  51293. },
  51294. opacity: {
  51295. type: "f",
  51296. value: 1
  51297. }
  51298. },
  51299. vertexShader: n.ShaderChunk.depth_vert,
  51300. fragmentShader: n.ShaderChunk.depth_frag
  51301. },
  51302. normal: {
  51303. uniforms: {
  51304. opacity: {
  51305. type: "f",
  51306. value: 1
  51307. }
  51308. },
  51309. vertexShader: n.ShaderChunk.normal_vert,
  51310. fragmentShader: n.ShaderChunk.normal_frag
  51311. },
  51312. cube: {
  51313. uniforms: {
  51314. tCube: {
  51315. type: "t",
  51316. value: null
  51317. },
  51318. tFlip: {
  51319. type: "f",
  51320. value: -1
  51321. }
  51322. },
  51323. vertexShader: n.ShaderChunk.cube_vert,
  51324. fragmentShader: n.ShaderChunk.cube_frag
  51325. },
  51326. equirect: {
  51327. uniforms: {
  51328. tEquirect: {
  51329. type: "t",
  51330. value: null
  51331. },
  51332. tFlip: {
  51333. type: "f",
  51334. value: -1
  51335. }
  51336. },
  51337. vertexShader: n.ShaderChunk.equirect_vert,
  51338. fragmentShader: n.ShaderChunk.equirect_frag
  51339. },
  51340. depthRGBA: {
  51341. uniforms: {},
  51342. vertexShader: n.ShaderChunk.depthRGBA_vert,
  51343. fragmentShader: n.ShaderChunk.depthRGBA_frag
  51344. },
  51345. distanceRGBA: {
  51346. uniforms: {
  51347. lightPos: {
  51348. type: "v3",
  51349. value: new n.Vector3(0,0,0)
  51350. }
  51351. },
  51352. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  51353. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  51354. }
  51355. },
  51356. n.WebGLRenderer = function(e) {
  51357. function t() {
  51358. return null === ye ? Oe : 1
  51359. }
  51360. function i(e, t, i, n) {
  51361. se === !0 && (e *= n,
  51362. t *= n,
  51363. i *= n),
  51364. Ye.clearColor(e, t, i, n)
  51365. }
  51366. function r() {
  51367. Ye.init(),
  51368. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  51369. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  51370. i(Se.r, Se.g, Se.b, Me)
  51371. }
  51372. function o() {
  51373. Ae = null,
  51374. be = null,
  51375. Ee = "",
  51376. Ie = -1,
  51377. Ye.reset()
  51378. }
  51379. function a(e) {
  51380. e.preventDefault(),
  51381. o(),
  51382. r(),
  51383. Xe.clear()
  51384. }
  51385. function s(e) {
  51386. var t = e.target;
  51387. t.removeEventListener("dispose", s),
  51388. h(t),
  51389. ke.textures--
  51390. }
  51391. function l(e) {
  51392. var t = e.target;
  51393. t.removeEventListener("dispose", l),
  51394. u(t),
  51395. ke.textures--
  51396. }
  51397. function c(e) {
  51398. var t = e.target;
  51399. t.removeEventListener("dispose", c),
  51400. d(t)
  51401. }
  51402. function h(e) {
  51403. var t = Xe.get(e);
  51404. if (e.image && t.__image__webglTextureCube)
  51405. Ge.deleteTexture(t.__image__webglTextureCube);
  51406. else {
  51407. if (void 0 === t.__webglInit)
  51408. return;
  51409. Ge.deleteTexture(t.__webglTexture)
  51410. }
  51411. Xe.delete(e)
  51412. }
  51413. function u(e) {
  51414. var t = Xe.get(e)
  51415. , i = Xe.get(e.texture);
  51416. if (e && void 0 !== i.__webglTexture) {
  51417. if (Ge.deleteTexture(i.__webglTexture),
  51418. e instanceof n.WebGLRenderTargetCube)
  51419. for (var r = 0; r < 6; r++)
  51420. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  51421. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  51422. else
  51423. Ge.deleteFramebuffer(t.__webglFramebuffer),
  51424. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  51425. Xe.delete(e.texture),
  51426. Xe.delete(e)
  51427. }
  51428. }
  51429. function d(e) {
  51430. p(e),
  51431. Xe.delete(e)
  51432. }
  51433. function p(e) {
  51434. var t = Xe.get(e).program;
  51435. e.program = void 0,
  51436. void 0 !== t && qe.releaseProgram(t)
  51437. }
  51438. function f(e, t, i, r) {
  51439. var o;
  51440. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  51441. null === o))
  51442. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  51443. void 0 === r && (r = 0),
  51444. Ye.initAttributes();
  51445. var a = i.attributes
  51446. , s = t.getAttributes()
  51447. , l = e.defaultAttributeValues;
  51448. for (var c in s) {
  51449. var h = s[c];
  51450. if (h >= 0) {
  51451. var u = a[c];
  51452. if (void 0 !== u) {
  51453. var d = u.itemSize
  51454. , p = Ze.getAttributeBuffer(u);
  51455. if (u instanceof n.InterleavedBufferAttribute) {
  51456. var f = u.data
  51457. , g = f.stride
  51458. , m = u.offset;
  51459. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  51460. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  51461. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51462. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  51463. } else
  51464. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  51465. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  51466. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  51467. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  51468. } else if (void 0 !== l) {
  51469. var v = l[c];
  51470. if (void 0 !== v)
  51471. switch (v.length) {
  51472. case 2:
  51473. Ge.vertexAttrib2fv(h, v);
  51474. break;
  51475. case 3:
  51476. Ge.vertexAttrib3fv(h, v);
  51477. break;
  51478. case 4:
  51479. Ge.vertexAttrib4fv(h, v);
  51480. break;
  51481. default:
  51482. Ge.vertexAttrib1fv(h, v)
  51483. }
  51484. }
  51485. }
  51486. }
  51487. Ye.disableUnusedAttributes()
  51488. }
  51489. function g(e, t) {
  51490. return Math.abs(t[0]) - Math.abs(e[0])
  51491. }
  51492. function m(e, t) {
  51493. 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
  51494. }
  51495. function v(e, t) {
  51496. 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
  51497. }
  51498. function A(e, t, i, n, r) {
  51499. var o, a;
  51500. i.transparent ? (o = de,
  51501. a = ++pe) : (o = he,
  51502. a = ++ue);
  51503. var s = o[a];
  51504. void 0 !== s ? (s.id = e.id,
  51505. s.object = e,
  51506. s.geometry = t,
  51507. s.material = i,
  51508. s.z = Ve.z,
  51509. s.group = r) : (s = {
  51510. id: e.id,
  51511. object: e,
  51512. geometry: t,
  51513. material: i,
  51514. z: Ve.z,
  51515. group: r
  51516. },
  51517. o.push(s))
  51518. }
  51519. function y(e, t) {
  51520. if (e.visible !== !1) {
  51521. if (e.layers.test(t.layers))
  51522. if (e instanceof n.Light)
  51523. ce.push(e);
  51524. else if (e instanceof n.Sprite)
  51525. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  51526. else if (e instanceof n.LensFlare)
  51527. me.push(e);
  51528. else if (e instanceof n.ImmediateRenderObject)
  51529. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51530. Ve.applyProjection(Fe)),
  51531. A(e, null, e.material, Ve.z, null);
  51532. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  51533. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  51534. var i = e.material;
  51535. if (i.visible === !0) {
  51536. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  51537. Ve.applyProjection(Fe));
  51538. var r = Ze.update(e);
  51539. if (i instanceof n.MultiMaterial)
  51540. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  51541. var c = o[s]
  51542. , h = a[c.materialIndex];
  51543. h.visible === !0 && A(e, r, h, Ve.z, c)
  51544. }
  51545. else
  51546. A(e, r, i, Ve.z, null)
  51547. }
  51548. }
  51549. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  51550. y(u[s], t)
  51551. }
  51552. }
  51553. function C(e, t, i, r) {
  51554. for (var o = 0, a = e.length; o < a; o++) {
  51555. var s = e[o]
  51556. , l = s.object
  51557. , c = s.geometry
  51558. , h = void 0 === r ? s.material : r
  51559. , u = s.group;
  51560. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  51561. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  51562. l instanceof n.ImmediateRenderObject) {
  51563. E(h);
  51564. var d = w(t, i, h, l);
  51565. Ee = "",
  51566. l.render(function(e) {
  51567. ve.renderBufferImmediate(e, d, h)
  51568. })
  51569. } else
  51570. ve.renderBufferDirect(t, i, c, h, l, u)
  51571. }
  51572. }
  51573. function I(e, t, i) {
  51574. var r = Xe.get(e)
  51575. , o = qe.getParameters(e, Ue, t, i)
  51576. , a = qe.getProgramCode(e, o)
  51577. , s = r.program
  51578. , l = !0;
  51579. if (void 0 === s)
  51580. e.addEventListener("dispose", c);
  51581. else if (s.code !== a)
  51582. p(e);
  51583. else {
  51584. if (void 0 !== o.shaderID)
  51585. return;
  51586. l = !1
  51587. }
  51588. if (l) {
  51589. if (o.shaderID) {
  51590. var h = n.ShaderLib[o.shaderID];
  51591. r.__webglShader = {
  51592. name: e.type,
  51593. uniforms: n.UniformsUtils.clone(h.uniforms),
  51594. vertexShader: h.vertexShader,
  51595. fragmentShader: h.fragmentShader
  51596. }
  51597. } else
  51598. r.__webglShader = {
  51599. name: e.type,
  51600. uniforms: e.uniforms,
  51601. vertexShader: e.vertexShader,
  51602. fragmentShader: e.fragmentShader
  51603. };
  51604. e.__webglShader = r.__webglShader,
  51605. s = qe.acquireProgram(e, o, a),
  51606. r.program = s,
  51607. e.program = s
  51608. }
  51609. var u = s.getAttributes();
  51610. if (e.morphTargets) {
  51611. e.numSupportedMorphTargets = 0;
  51612. for (var d = 0; d < ve.maxMorphTargets; d++)
  51613. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  51614. }
  51615. if (e.morphNormals) {
  51616. e.numSupportedMorphNormals = 0;
  51617. for (var d = 0; d < ve.maxMorphNormals; d++)
  51618. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  51619. }
  51620. r.uniformsList = [];
  51621. var f = r.__webglShader.uniforms
  51622. , g = r.program.getUniforms();
  51623. for (var m in f) {
  51624. var v = g[m];
  51625. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  51626. }
  51627. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  51628. f.ambientLightColor.value = Ue.ambient,
  51629. f.directionalLights.value = Ue.directional,
  51630. f.spotLights.value = Ue.spot,
  51631. f.pointLights.value = Ue.point,
  51632. f.hemisphereLights.value = Ue.hemi,
  51633. f.directionalShadowMap.value = Ue.directionalShadowMap,
  51634. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  51635. f.spotShadowMap.value = Ue.spotShadowMap,
  51636. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  51637. f.pointShadowMap.value = Ue.pointShadowMap,
  51638. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  51639. r.hasDynamicUniforms = !1;
  51640. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  51641. var C = r.uniformsList[A][0];
  51642. if (C.dynamic === !0) {
  51643. r.hasDynamicUniforms = !0;
  51644. break
  51645. }
  51646. }
  51647. }
  51648. function E(e) {
  51649. b(e),
  51650. 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),
  51651. Ye.setDepthFunc(e.depthFunc),
  51652. Ye.setDepthTest(e.depthTest),
  51653. Ye.setDepthWrite(e.depthWrite),
  51654. Ye.setColorWrite(e.colorWrite),
  51655. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  51656. }
  51657. function b(e) {
  51658. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  51659. Ye.setFlipSided(e.side === n.BackSide)
  51660. }
  51661. function w(e, t, i, r) {
  51662. xe = 0;
  51663. var o = Xe.get(i);
  51664. void 0 === o.program && (i.needsUpdate = !0),
  51665. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  51666. i.needsUpdate && (I(i, t, r),
  51667. i.needsUpdate = !1);
  51668. var a = !1
  51669. , s = !1
  51670. , l = !1
  51671. , c = o.program
  51672. , h = c.getUniforms()
  51673. , u = o.__webglShader.uniforms;
  51674. if (c.id !== Ae && (Ge.useProgram(c.program),
  51675. Ae = c.id,
  51676. a = !0,
  51677. s = !0,
  51678. l = !0),
  51679. i.id !== Ie && (Ie = i.id,
  51680. s = !0),
  51681. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  51682. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  51683. e !== be && (be = e,
  51684. s = !0,
  51685. l = !0),
  51686. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  51687. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  51688. (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),
  51689. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  51690. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  51691. i.skinning)
  51692. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  51693. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  51694. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  51695. if (void 0 !== h.boneTexture) {
  51696. var d = B();
  51697. Ge.uniform1i(h.boneTexture, d),
  51698. ve.setTexture(r.skeleton.boneTexture, d)
  51699. }
  51700. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  51701. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  51702. } else
  51703. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  51704. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  51705. t && i.fog && R(u, t),
  51706. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  51707. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  51708. 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,
  51709. u.mFar.value = e.far,
  51710. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  51711. V(o.uniformsList)),
  51712. N(h, r),
  51713. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  51714. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  51715. c
  51716. }
  51717. function _(e, t, i) {
  51718. for (var n = [], r = 0, o = e.length; r < o; r++) {
  51719. var a = e[r][0]
  51720. , s = a.onUpdateCallback;
  51721. void 0 !== s && (s.bind(a)(t, i),
  51722. n.push(e[r]))
  51723. }
  51724. V(n)
  51725. }
  51726. function T(e, t) {
  51727. e.opacity.value = t.opacity,
  51728. e.diffuse.value = t.color,
  51729. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  51730. e.map.value = t.map,
  51731. e.specularMap.value = t.specularMap,
  51732. e.alphaMap.value = t.alphaMap,
  51733. t.aoMap && (e.aoMap.value = t.aoMap,
  51734. e.aoMapIntensity.value = t.aoMapIntensity);
  51735. var i;
  51736. 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),
  51737. void 0 !== i) {
  51738. i instanceof n.WebGLRenderTarget && (i = i.texture);
  51739. var r = i.offset
  51740. , o = i.repeat;
  51741. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  51742. }
  51743. e.envMap.value = t.envMap,
  51744. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  51745. e.reflectivity.value = t.reflectivity,
  51746. e.refractionRatio.value = t.refractionRatio
  51747. }
  51748. function x(e, t) {
  51749. e.diffuse.value = t.color,
  51750. e.opacity.value = t.opacity
  51751. }
  51752. function S(e, t) {
  51753. e.dashSize.value = t.dashSize,
  51754. e.totalSize.value = t.dashSize + t.gapSize,
  51755. e.scale.value = t.scale
  51756. }
  51757. function M(e, t) {
  51758. if (e.diffuse.value = t.color,
  51759. e.opacity.value = t.opacity,
  51760. e.size.value = t.size * Oe,
  51761. e.scale.value = te.clientHeight / 2,
  51762. e.map.value = t.map,
  51763. null !== t.map) {
  51764. var i = t.map.offset
  51765. , n = t.map.repeat;
  51766. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  51767. }
  51768. }
  51769. function R(e, t) {
  51770. e.fogColor.value = t.color,
  51771. t instanceof n.Fog ? (e.fogNear.value = t.near,
  51772. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  51773. }
  51774. function P(e, t) {
  51775. t.lightMap && (e.lightMap.value = t.lightMap,
  51776. e.lightMapIntensity.value = t.lightMapIntensity),
  51777. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  51778. }
  51779. function O(e, t) {
  51780. e.specular.value = t.specular,
  51781. e.shininess.value = Math.max(t.shininess, 1e-4),
  51782. t.lightMap && (e.lightMap.value = t.lightMap,
  51783. e.lightMapIntensity.value = t.lightMapIntensity),
  51784. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51785. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51786. e.bumpScale.value = t.bumpScale),
  51787. t.normalMap && (e.normalMap.value = t.normalMap,
  51788. e.normalScale.value.copy(t.normalScale)),
  51789. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51790. e.displacementScale.value = t.displacementScale,
  51791. e.displacementBias.value = t.displacementBias)
  51792. }
  51793. function L(e, t) {
  51794. e.roughness.value = t.roughness,
  51795. e.metalness.value = t.metalness,
  51796. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  51797. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  51798. t.lightMap && (e.lightMap.value = t.lightMap,
  51799. e.lightMapIntensity.value = t.lightMapIntensity),
  51800. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  51801. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  51802. e.bumpScale.value = t.bumpScale),
  51803. t.normalMap && (e.normalMap.value = t.normalMap,
  51804. e.normalScale.value.copy(t.normalScale)),
  51805. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  51806. e.displacementScale.value = t.displacementScale,
  51807. e.displacementBias.value = t.displacementBias),
  51808. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  51809. }
  51810. function D(e, t) {
  51811. e.ambientLightColor.needsUpdate = t,
  51812. e.directionalLights.needsUpdate = t,
  51813. e.pointLights.needsUpdate = t,
  51814. e.spotLights.needsUpdate = t,
  51815. e.hemisphereLights.needsUpdate = t
  51816. }
  51817. function N(e, t) {
  51818. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  51819. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  51820. }
  51821. function B() {
  51822. var e = xe;
  51823. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  51824. xe += 1,
  51825. e
  51826. }
  51827. function F(e, t, i, r) {
  51828. var o, a;
  51829. if ("1i" === t)
  51830. Ge.uniform1i(i, r);
  51831. else if ("1f" === t)
  51832. Ge.uniform1f(i, r);
  51833. else if ("2f" === t)
  51834. Ge.uniform2f(i, r[0], r[1]);
  51835. else if ("3f" === t)
  51836. Ge.uniform3f(i, r[0], r[1], r[2]);
  51837. else if ("4f" === t)
  51838. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  51839. else if ("1iv" === t)
  51840. Ge.uniform1iv(i, r);
  51841. else if ("3iv" === t)
  51842. Ge.uniform3iv(i, r);
  51843. else if ("1fv" === t)
  51844. Ge.uniform1fv(i, r);
  51845. else if ("2fv" === t)
  51846. Ge.uniform2fv(i, r);
  51847. else if ("3fv" === t)
  51848. Ge.uniform3fv(i, r);
  51849. else if ("4fv" === t)
  51850. Ge.uniform4fv(i, r);
  51851. else if ("Matrix2fv" === t)
  51852. Ge.uniformMatrix2fv(i, !1, r);
  51853. else if ("Matrix3fv" === t)
  51854. Ge.uniformMatrix3fv(i, !1, r);
  51855. else if ("Matrix4fv" === t)
  51856. Ge.uniformMatrix4fv(i, !1, r);
  51857. else if ("i" === t)
  51858. Ge.uniform1i(i, r);
  51859. else if ("f" === t)
  51860. Ge.uniform1f(i, r);
  51861. else if ("v2" === t)
  51862. Ge.uniform2f(i, r.x, r.y);
  51863. else if ("v3" === t)
  51864. Ge.uniform3f(i, r.x, r.y, r.z);
  51865. else if ("v4" === t)
  51866. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  51867. else if ("c" === t)
  51868. Ge.uniform3f(i, r.r, r.g, r.b);
  51869. else if ("s" === t) {
  51870. var s = e.properties;
  51871. for (var l in s) {
  51872. var c = s[l]
  51873. , h = i[l]
  51874. , u = r[l];
  51875. F(c, c.type, h, u)
  51876. }
  51877. } else if ("sa" === t)
  51878. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  51879. for (var l in s) {
  51880. var c = s[l]
  51881. , h = i[d][l]
  51882. , u = r[d][l];
  51883. F(c, c.type, h, u)
  51884. }
  51885. else if ("iv1" === t)
  51886. Ge.uniform1iv(i, r);
  51887. else if ("iv" === t)
  51888. Ge.uniform3iv(i, r);
  51889. else if ("fv1" === t)
  51890. Ge.uniform1fv(i, r);
  51891. else if ("fv" === t)
  51892. Ge.uniform3fv(i, r);
  51893. else if ("v2v" === t) {
  51894. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  51895. for (var d = 0, f = 0, g = r.length; d < g; d++,
  51896. f += 2)
  51897. e._array[f + 0] = r[d].x,
  51898. e._array[f + 1] = r[d].y;
  51899. Ge.uniform2fv(i, e._array)
  51900. } else if ("v3v" === t) {
  51901. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  51902. for (var d = 0, m = 0, g = r.length; d < g; d++,
  51903. m += 3)
  51904. e._array[m + 0] = r[d].x,
  51905. e._array[m + 1] = r[d].y,
  51906. e._array[m + 2] = r[d].z;
  51907. Ge.uniform3fv(i, e._array)
  51908. } else if ("v4v" === t) {
  51909. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  51910. for (var d = 0, v = 0, g = r.length; d < g; d++,
  51911. v += 4)
  51912. e._array[v + 0] = r[d].x,
  51913. e._array[v + 1] = r[d].y,
  51914. e._array[v + 2] = r[d].z,
  51915. e._array[v + 3] = r[d].w;
  51916. Ge.uniform4fv(i, e._array)
  51917. } else if ("m2" === t)
  51918. Ge.uniformMatrix2fv(i, !1, r.elements);
  51919. else if ("m3" === t)
  51920. Ge.uniformMatrix3fv(i, !1, r.elements);
  51921. else if ("m3v" === t) {
  51922. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  51923. for (var d = 0, g = r.length; d < g; d++)
  51924. r[d].flattenToArrayOffset(e._array, 9 * d);
  51925. Ge.uniformMatrix3fv(i, !1, e._array)
  51926. } else if ("m4" === t)
  51927. Ge.uniformMatrix4fv(i, !1, r.elements);
  51928. else if ("m4v" === t) {
  51929. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  51930. for (var d = 0, g = r.length; d < g; d++)
  51931. r[d].flattenToArrayOffset(e._array, 16 * d);
  51932. Ge.uniformMatrix4fv(i, !1, e._array)
  51933. } else if ("t" === t) {
  51934. if (o = r,
  51935. a = B(),
  51936. Ge.uniform1i(i, a),
  51937. !o)
  51938. return;
  51939. 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)
  51940. } else if ("tv" === t) {
  51941. void 0 === e._array && (e._array = []);
  51942. for (var d = 0, g = e.value.length; d < g; d++)
  51943. e._array[d] = B();
  51944. Ge.uniform1iv(i, e._array);
  51945. for (var d = 0, g = e.value.length; d < g; d++)
  51946. o = e.value[d],
  51947. a = e._array[d],
  51948. 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))
  51949. } else
  51950. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  51951. }
  51952. function V(e) {
  51953. for (var t = 0, i = e.length; t < i; t++) {
  51954. var n = e[t][0];
  51955. if (n.needsUpdate !== !1) {
  51956. var r = n.type
  51957. , o = e[t][1]
  51958. , a = n.value;
  51959. F(n, r, o, a)
  51960. }
  51961. }
  51962. }
  51963. function U(e, t) {
  51964. 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;
  51965. for (Ue.shadowsPointLight = 0,
  51966. i = 0,
  51967. r = e.length; i < r; i++)
  51968. if (o = e[i],
  51969. a = o.color,
  51970. s = o.intensity,
  51971. l = o.distance,
  51972. o instanceof n.AmbientLight)
  51973. c += a.r * s,
  51974. h += a.g * s,
  51975. u += a.b * s;
  51976. else if (o instanceof n.DirectionalLight) {
  51977. var A = Ke.get(o);
  51978. A.color.copy(o.color).multiplyScalar(o.intensity),
  51979. A.direction.setFromMatrixPosition(o.matrixWorld),
  51980. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51981. A.direction.sub(Ve),
  51982. A.direction.transformDirection(d),
  51983. A.shadow = o.castShadow,
  51984. o.castShadow && (A.shadowBias = o.shadow.bias,
  51985. A.shadowRadius = o.shadow.radius,
  51986. A.shadowMapSize = o.shadow.mapSize,
  51987. Ue.shadows[v++] = o),
  51988. Ue.directionalShadowMap[p] = o.shadow.map,
  51989. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  51990. Ue.directional[p++] = A
  51991. } else if (o instanceof n.SpotLight) {
  51992. var A = Ke.get(o);
  51993. A.position.setFromMatrixPosition(o.matrixWorld),
  51994. A.position.applyMatrix4(d),
  51995. A.color.copy(a).multiplyScalar(s),
  51996. A.distance = l,
  51997. A.direction.setFromMatrixPosition(o.matrixWorld),
  51998. Ve.setFromMatrixPosition(o.target.matrixWorld),
  51999. A.direction.sub(Ve),
  52000. A.direction.transformDirection(d),
  52001. A.coneCos = Math.cos(o.angle),
  52002. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  52003. A.decay = 0 === o.distance ? 0 : o.decay,
  52004. A.shadow = o.castShadow,
  52005. o.castShadow && (A.shadowBias = o.shadow.bias,
  52006. A.shadowRadius = o.shadow.radius,
  52007. A.shadowMapSize = o.shadow.mapSize,
  52008. Ue.shadows[v++] = o),
  52009. Ue.spotShadowMap[g] = o.shadow.map,
  52010. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  52011. Ue.spot[g++] = A
  52012. } else if (o instanceof n.PointLight) {
  52013. var A = Ke.get(o);
  52014. A.position.setFromMatrixPosition(o.matrixWorld),
  52015. A.position.applyMatrix4(d),
  52016. A.color.copy(o.color).multiplyScalar(o.intensity),
  52017. A.distance = o.distance,
  52018. A.decay = 0 === o.distance ? 0 : o.decay,
  52019. A.shadow = o.castShadow,
  52020. o.castShadow && (A.shadowBias = o.shadow.bias,
  52021. A.shadowRadius = o.shadow.radius,
  52022. A.shadowMapSize = o.shadow.mapSize,
  52023. Ue.shadows[v++] = o),
  52024. Ue.pointShadowMap[f] = o.shadow.map,
  52025. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  52026. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  52027. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  52028. Ue.point[f++] = A
  52029. } else if (o instanceof n.HemisphereLight) {
  52030. var A = Ke.get(o);
  52031. A.direction.setFromMatrixPosition(o.matrixWorld),
  52032. A.direction.transformDirection(d),
  52033. A.direction.normalize(),
  52034. A.skyColor.copy(o.color).multiplyScalar(s),
  52035. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  52036. Ue.hemi[m++] = A
  52037. }
  52038. Ue.ambient[0] = c,
  52039. Ue.ambient[1] = h,
  52040. Ue.ambient[2] = u,
  52041. Ue.directional.length = p,
  52042. Ue.spot.length = g,
  52043. Ue.point.length = f,
  52044. Ue.hemi.length = m,
  52045. Ue.shadows.length = v,
  52046. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  52047. }
  52048. function k(e, t, i) {
  52049. var r;
  52050. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  52051. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  52052. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  52053. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  52054. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  52055. 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),
  52056. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  52057. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  52058. 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)),
  52059. r = We.get("EXT_texture_filter_anisotropic")) {
  52060. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  52061. return;
  52062. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  52063. return;
  52064. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  52065. Xe.get(t).__currentAnisotropy = t.anisotropy)
  52066. }
  52067. }
  52068. function H(e, t, i) {
  52069. void 0 === e.__webglInit && (e.__webglInit = !0,
  52070. t.addEventListener("dispose", s),
  52071. e.__webglTexture = Ge.createTexture(),
  52072. ke.textures++),
  52073. Ye.activeTexture(Ge.TEXTURE0 + i),
  52074. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  52075. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  52076. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  52077. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  52078. var r = G(t.image, je.maxTextureSize);
  52079. W(t) && z(r) === !1 && (r = j(r));
  52080. var o = z(r)
  52081. , a = ee(t.format)
  52082. , l = ee(t.type);
  52083. k(Ge.TEXTURE_2D, t, o);
  52084. var c, h = t.mipmaps;
  52085. if (t instanceof n.DataTexture)
  52086. if (h.length > 0 && o) {
  52087. for (var u = 0, d = h.length; u < d; u++)
  52088. c = h[u],
  52089. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  52090. t.generateMipmaps = !1
  52091. } else
  52092. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  52093. else if (t instanceof n.CompressedTexture)
  52094. for (var u = 0, d = h.length; u < d; u++)
  52095. c = h[u],
  52096. 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);
  52097. else if (h.length > 0 && o) {
  52098. for (var u = 0, d = h.length; u < d; u++)
  52099. c = h[u],
  52100. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  52101. t.generateMipmaps = !1
  52102. } else
  52103. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  52104. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52105. e.__version = t.version,
  52106. t.onUpdate && t.onUpdate(t)
  52107. }
  52108. function G(e, t) {
  52109. if (e.width > t || e.height > t) {
  52110. var i = t / Math.max(e.width, e.height)
  52111. , n = document.createElement("canvas");
  52112. n.width = Math.floor(e.width * i),
  52113. n.height = Math.floor(e.height * i);
  52114. var r = n.getContext("2d");
  52115. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  52116. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  52117. n
  52118. }
  52119. return e
  52120. }
  52121. function z(e) {
  52122. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  52123. }
  52124. function W(e) {
  52125. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  52126. }
  52127. function j(e) {
  52128. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  52129. var t = document.createElement("canvas");
  52130. t.width = n.Math.nearestPowerOfTwo(e.width),
  52131. t.height = n.Math.nearestPowerOfTwo(e.height);
  52132. var i = t.getContext("2d");
  52133. return i.drawImage(e, 0, 0, t.width, t.height),
  52134. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  52135. t
  52136. }
  52137. return e
  52138. }
  52139. function Y(e, t) {
  52140. var i = Xe.get(e);
  52141. if (6 === e.image.length)
  52142. if (e.version > 0 && i.__version !== e.version) {
  52143. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  52144. i.__image__webglTextureCube = Ge.createTexture(),
  52145. ke.textures++),
  52146. Ye.activeTexture(Ge.TEXTURE0 + t),
  52147. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  52148. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  52149. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  52150. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  52151. var c = a[0]
  52152. , h = z(c)
  52153. , u = ee(e.format)
  52154. , d = ee(e.type);
  52155. k(Ge.TEXTURE_CUBE_MAP, e, h);
  52156. for (var l = 0; l < 6; l++)
  52157. if (r)
  52158. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  52159. p = f[g],
  52160. 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);
  52161. else
  52162. 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]);
  52163. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52164. i.__version = e.version,
  52165. e.onUpdate && e.onUpdate(e)
  52166. } else
  52167. Ye.activeTexture(Ge.TEXTURE0 + t),
  52168. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  52169. }
  52170. function X(e, t) {
  52171. Ye.activeTexture(Ge.TEXTURE0 + t),
  52172. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  52173. }
  52174. function Z(e, t, i, n) {
  52175. var r = ee(t.texture.format)
  52176. , o = ee(t.texture.type);
  52177. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  52178. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  52179. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  52180. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52181. }
  52182. function q(e, t) {
  52183. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  52184. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  52185. 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),
  52186. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  52187. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  52188. }
  52189. function K(e) {
  52190. var t = Xe.get(e)
  52191. , i = e instanceof n.WebGLRenderTargetCube;
  52192. if (i) {
  52193. t.__webglDepthbuffer = [];
  52194. for (var r = 0; r < 6; r++)
  52195. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  52196. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  52197. q(t.__webglDepthbuffer[r], e)
  52198. } else
  52199. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  52200. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  52201. q(t.__webglDepthbuffer, e);
  52202. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  52203. }
  52204. function Q(e) {
  52205. var t = Xe.get(e)
  52206. , i = Xe.get(e.texture);
  52207. e.addEventListener("dispose", l),
  52208. i.__webglTexture = Ge.createTexture(),
  52209. ke.textures++;
  52210. var r = e instanceof n.WebGLRenderTargetCube
  52211. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  52212. if (r) {
  52213. t.__webglFramebuffer = [];
  52214. for (var a = 0; a < 6; a++)
  52215. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  52216. } else
  52217. t.__webglFramebuffer = Ge.createFramebuffer();
  52218. if (r) {
  52219. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  52220. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  52221. for (var a = 0; a < 6; a++)
  52222. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  52223. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  52224. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  52225. } else
  52226. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  52227. k(Ge.TEXTURE_2D, e.texture, o),
  52228. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  52229. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  52230. Ye.bindTexture(Ge.TEXTURE_2D, null);
  52231. e.depthBuffer && K(e)
  52232. }
  52233. function J(e) {
  52234. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  52235. , i = Xe.get(e.texture).__webglTexture;
  52236. Ye.bindTexture(t, i),
  52237. Ge.generateMipmap(t),
  52238. Ye.bindTexture(t, null)
  52239. }
  52240. function $(e) {
  52241. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  52242. }
  52243. function ee(e) {
  52244. var t;
  52245. if (e === n.RepeatWrapping)
  52246. return Ge.REPEAT;
  52247. if (e === n.ClampToEdgeWrapping)
  52248. return Ge.CLAMP_TO_EDGE;
  52249. if (e === n.MirroredRepeatWrapping)
  52250. return Ge.MIRRORED_REPEAT;
  52251. if (e === n.NearestFilter)
  52252. return Ge.NEAREST;
  52253. if (e === n.NearestMipMapNearestFilter)
  52254. return Ge.NEAREST_MIPMAP_NEAREST;
  52255. if (e === n.NearestMipMapLinearFilter)
  52256. return Ge.NEAREST_MIPMAP_LINEAR;
  52257. if (e === n.LinearFilter)
  52258. return Ge.LINEAR;
  52259. if (e === n.LinearMipMapNearestFilter)
  52260. return Ge.LINEAR_MIPMAP_NEAREST;
  52261. if (e === n.LinearMipMapLinearFilter)
  52262. return Ge.LINEAR_MIPMAP_LINEAR;
  52263. if (e === n.UnsignedByteType)
  52264. return Ge.UNSIGNED_BYTE;
  52265. if (e === n.UnsignedShort4444Type)
  52266. return Ge.UNSIGNED_SHORT_4_4_4_4;
  52267. if (e === n.UnsignedShort5551Type)
  52268. return Ge.UNSIGNED_SHORT_5_5_5_1;
  52269. if (e === n.UnsignedShort565Type)
  52270. return Ge.UNSIGNED_SHORT_5_6_5;
  52271. if (e === n.ByteType)
  52272. return Ge.BYTE;
  52273. if (e === n.ShortType)
  52274. return Ge.SHORT;
  52275. if (e === n.UnsignedShortType)
  52276. return Ge.UNSIGNED_SHORT;
  52277. if (e === n.IntType)
  52278. return Ge.INT;
  52279. if (e === n.UnsignedIntType)
  52280. return Ge.UNSIGNED_INT;
  52281. if (e === n.FloatType)
  52282. return Ge.FLOAT;
  52283. if (t = We.get("OES_texture_half_float"),
  52284. null !== t && e === n.HalfFloatType)
  52285. return t.HALF_FLOAT_OES;
  52286. if (e === n.AlphaFormat)
  52287. return Ge.ALPHA;
  52288. if (e === n.RGBFormat)
  52289. return Ge.RGB;
  52290. if (e === n.RGBAFormat)
  52291. return Ge.RGBA;
  52292. if (e === n.LuminanceFormat)
  52293. return Ge.LUMINANCE;
  52294. if (e === n.LuminanceAlphaFormat)
  52295. return Ge.LUMINANCE_ALPHA;
  52296. if (e === n.AddEquation)
  52297. return Ge.FUNC_ADD;
  52298. if (e === n.SubtractEquation)
  52299. return Ge.FUNC_SUBTRACT;
  52300. if (e === n.ReverseSubtractEquation)
  52301. return Ge.FUNC_REVERSE_SUBTRACT;
  52302. if (e === n.ZeroFactor)
  52303. return Ge.ZERO;
  52304. if (e === n.OneFactor)
  52305. return Ge.ONE;
  52306. if (e === n.SrcColorFactor)
  52307. return Ge.SRC_COLOR;
  52308. if (e === n.OneMinusSrcColorFactor)
  52309. return Ge.ONE_MINUS_SRC_COLOR;
  52310. if (e === n.SrcAlphaFactor)
  52311. return Ge.SRC_ALPHA;
  52312. if (e === n.OneMinusSrcAlphaFactor)
  52313. return Ge.ONE_MINUS_SRC_ALPHA;
  52314. if (e === n.DstAlphaFactor)
  52315. return Ge.DST_ALPHA;
  52316. if (e === n.OneMinusDstAlphaFactor)
  52317. return Ge.ONE_MINUS_DST_ALPHA;
  52318. if (e === n.DstColorFactor)
  52319. return Ge.DST_COLOR;
  52320. if (e === n.OneMinusDstColorFactor)
  52321. return Ge.ONE_MINUS_DST_COLOR;
  52322. if (e === n.SrcAlphaSaturateFactor)
  52323. return Ge.SRC_ALPHA_SATURATE;
  52324. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  52325. null !== t) {
  52326. if (e === n.RGB_S3TC_DXT1_Format)
  52327. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  52328. if (e === n.RGBA_S3TC_DXT1_Format)
  52329. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  52330. if (e === n.RGBA_S3TC_DXT3_Format)
  52331. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  52332. if (e === n.RGBA_S3TC_DXT5_Format)
  52333. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  52334. }
  52335. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  52336. null !== t) {
  52337. if (e === n.RGB_PVRTC_4BPPV1_Format)
  52338. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  52339. if (e === n.RGB_PVRTC_2BPPV1_Format)
  52340. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  52341. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  52342. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  52343. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  52344. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  52345. }
  52346. if (t = We.get("WEBGL_compressed_texture_etc1"),
  52347. null !== t && e === n.RGB_ETC1_Format)
  52348. return t.COMPRESSED_RGB_ETC1_WEBGL;
  52349. if (t = We.get("EXT_blend_minmax"),
  52350. null !== t) {
  52351. if (e === n.MinEquation)
  52352. return t.MIN_EXT;
  52353. if (e === n.MaxEquation)
  52354. return t.MAX_EXT
  52355. }
  52356. return 0
  52357. }
  52358. console.log("THREE.WebGLRenderer", n.REVISION),
  52359. e = e || {};
  52360. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  52361. , ie = void 0 !== e.context ? e.context : null
  52362. , ne = void 0 !== e.alpha && e.alpha
  52363. , re = void 0 === e.depth || e.depth
  52364. , oe = void 0 === e.stencil || e.stencil
  52365. , ae = void 0 !== e.antialias && e.antialias
  52366. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  52367. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  52368. , ce = []
  52369. , he = []
  52370. , ue = -1
  52371. , de = []
  52372. , pe = -1
  52373. , fe = new Float32Array(8)
  52374. , ge = []
  52375. , me = [];
  52376. this.domElement = te,
  52377. this.context = null,
  52378. this.autoClear = !0,
  52379. this.autoClearColor = !0,
  52380. this.autoClearDepth = !0,
  52381. this.autoClearStencil = !0,
  52382. this.sortObjects = !0,
  52383. this.gammaFactor = 2,
  52384. this.gammaInput = !1,
  52385. this.gammaOutput = !1,
  52386. this.physicallyCorrectLights = !1,
  52387. this.toneMapping = n.LinearToneMapping,
  52388. this.toneMappingExposure = 1,
  52389. this.toneMappingWhitePoint = 1,
  52390. this.maxMorphTargets = 8,
  52391. this.maxMorphNormals = 4,
  52392. this.autoScaleCubemaps = !0;
  52393. var ve = this
  52394. , Ae = null
  52395. , ye = null
  52396. , Ce = null
  52397. , Ie = -1
  52398. , Ee = ""
  52399. , be = null
  52400. , we = new n.Vector4
  52401. , _e = null
  52402. , Te = new n.Vector4
  52403. , xe = 0
  52404. , Se = new n.Color(0)
  52405. , Me = 0
  52406. , Re = te.width
  52407. , Pe = te.height
  52408. , Oe = 1
  52409. , Le = new n.Vector4(0,0,Re,Pe)
  52410. , De = !1
  52411. , Ne = new n.Vector4(0,0,Re,Pe)
  52412. , Be = new n.Frustum
  52413. , Fe = new n.Matrix4
  52414. , Ve = new n.Vector3
  52415. , Ue = {
  52416. hash: "",
  52417. ambient: [0, 0, 0],
  52418. directional: [],
  52419. directionalShadowMap: [],
  52420. directionalShadowMatrix: [],
  52421. spot: [],
  52422. spotShadowMap: [],
  52423. spotShadowMatrix: [],
  52424. point: [],
  52425. pointShadowMap: [],
  52426. pointShadowMatrix: [],
  52427. hemi: [],
  52428. shadows: [],
  52429. shadowsPointLight: 0
  52430. }
  52431. , ke = {
  52432. geometries: 0,
  52433. textures: 0
  52434. }
  52435. , He = {
  52436. calls: 0,
  52437. vertices: 0,
  52438. faces: 0,
  52439. points: 0
  52440. };
  52441. this.info = {
  52442. render: He,
  52443. memory: ke,
  52444. programs: null
  52445. };
  52446. var Ge;
  52447. try {
  52448. var ze = {
  52449. alpha: ne,
  52450. depth: re,
  52451. stencil: oe,
  52452. antialias: ae,
  52453. premultipliedAlpha: se,
  52454. preserveDrawingBuffer: le
  52455. };
  52456. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  52457. null === Ge)
  52458. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  52459. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  52460. return {
  52461. rangeMin: 1,
  52462. rangeMax: 1,
  52463. precision: 1
  52464. }
  52465. }
  52466. ),
  52467. te.addEventListener("webglcontextlost", a, !1)
  52468. } catch (e) {
  52469. console.error("THREE.WebGLRenderer: " + e)
  52470. }
  52471. var We = new n.WebGLExtensions(Ge);
  52472. We.get("OES_texture_float"),
  52473. We.get("OES_texture_float_linear"),
  52474. We.get("OES_texture_half_float"),
  52475. We.get("OES_texture_half_float_linear"),
  52476. We.get("OES_standard_derivatives"),
  52477. We.get("ANGLE_instanced_arrays"),
  52478. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  52479. var je = new n.WebGLCapabilities(Ge,We,e)
  52480. , Ye = new n.WebGLState(Ge,We,ee)
  52481. , Xe = new n.WebGLProperties
  52482. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  52483. , qe = new n.WebGLPrograms(this,je)
  52484. , Ke = new n.WebGLLights;
  52485. this.info.programs = qe.programs;
  52486. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  52487. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  52488. r(),
  52489. this.context = Ge,
  52490. this.capabilities = je,
  52491. this.extensions = We,
  52492. this.properties = Xe,
  52493. this.state = Ye;
  52494. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  52495. this.shadowMap = $e;
  52496. var et = new n.SpritePlugin(this,ge)
  52497. , tt = new n.LensFlarePlugin(this,me);
  52498. this.getContext = function() {
  52499. return Ge
  52500. }
  52501. ,
  52502. this.getContextAttributes = function() {
  52503. return Ge.getContextAttributes()
  52504. }
  52505. ,
  52506. this.forceContextLoss = function() {
  52507. We.get("WEBGL_lose_context").loseContext()
  52508. }
  52509. ,
  52510. this.getMaxAnisotropy = function() {
  52511. var e;
  52512. return function() {
  52513. if (void 0 !== e)
  52514. return e;
  52515. var t = We.get("EXT_texture_filter_anisotropic");
  52516. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  52517. }
  52518. }(),
  52519. this.getPrecision = function() {
  52520. return je.precision
  52521. }
  52522. ,
  52523. this.getPixelRatio = function() {
  52524. return Oe
  52525. }
  52526. ,
  52527. this.setPixelRatio = function(e) {
  52528. void 0 !== e && (Oe = e,
  52529. this.setSize(Ne.z, Ne.w, !1))
  52530. }
  52531. ,
  52532. this.getSize = function() {
  52533. return {
  52534. width: Re,
  52535. height: Pe
  52536. }
  52537. }
  52538. ,
  52539. this.setSize = function(e, t, i, devicePixelRatio) {
  52540. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  52541. Re = e,
  52542. Pe = t,
  52543. te.width = e * Oe,
  52544. te.height = t * Oe,
  52545. i !== !1 && (te.style.width = e + "px",
  52546. te.style.height = t + "px"),
  52547. this.setViewport(0, 0, e, t)
  52548. }
  52549. ,
  52550. this.setViewport = function(e, t, i, n) {
  52551. Ye.viewport(Ne.set(e, t, i, n))
  52552. }
  52553. ,
  52554. this.setScissor = function(e, t, i, n) {
  52555. Ye.scissor(Le.set(e, t, i, n))
  52556. }
  52557. ,
  52558. this.setScissorTest = function(e) {
  52559. Ye.setScissorTest(De = e)
  52560. }
  52561. ,
  52562. this.getClearColor = function() {
  52563. return Se
  52564. }
  52565. ,
  52566. this.setClearColor = function(e, t) {
  52567. Se.set(e),
  52568. Me = void 0 !== t ? t : 1,
  52569. i(Se.r, Se.g, Se.b, Me)
  52570. }
  52571. ,
  52572. this.getClearAlpha = function() {
  52573. return Me
  52574. }
  52575. ,
  52576. this.setClearAlpha = function(e) {
  52577. Me = e,
  52578. i(Se.r, Se.g, Se.b, Me)
  52579. }
  52580. ,
  52581. this.clear = function(e, t, i) {
  52582. var n = 0;
  52583. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  52584. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  52585. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  52586. Ge.clear(n)
  52587. }
  52588. ,
  52589. this.clearColor = function() {
  52590. this.clear(!0, !1, !1)
  52591. }
  52592. ,
  52593. this.clearDepth = function() {
  52594. this.clear(!1, !0, !1)
  52595. }
  52596. ,
  52597. this.clearStencil = function() {
  52598. this.clear(!1, !1, !0)
  52599. }
  52600. ,
  52601. this.clearTarget = function(e, t, i, n) {
  52602. this.setRenderTarget(e),
  52603. this.clear(t, i, n)
  52604. }
  52605. ,
  52606. this.resetGLState = o,
  52607. this.dispose = function() {
  52608. te.removeEventListener("webglcontextlost", a, !1)
  52609. }
  52610. ,
  52611. this.renderBufferImmediate = function(e, t, i) {
  52612. Ye.initAttributes();
  52613. var r = Xe.get(e);
  52614. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  52615. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  52616. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  52617. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  52618. var o = t.getAttributes();
  52619. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  52620. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  52621. Ye.enableAttribute(o.position),
  52622. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  52623. e.hasNormals) {
  52624. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  52625. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  52626. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  52627. var l = e.normalArray
  52628. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  52629. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  52630. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  52631. l[a + 0] = c,
  52632. l[a + 1] = h,
  52633. l[a + 2] = u,
  52634. l[a + 3] = c,
  52635. l[a + 4] = h,
  52636. l[a + 5] = u,
  52637. l[a + 6] = c,
  52638. l[a + 7] = h,
  52639. l[a + 8] = u
  52640. }
  52641. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  52642. Ye.enableAttribute(o.normal),
  52643. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  52644. }
  52645. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  52646. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  52647. Ye.enableAttribute(o.uv),
  52648. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  52649. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  52650. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  52651. Ye.enableAttribute(o.color),
  52652. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  52653. Ye.disableUnusedAttributes(),
  52654. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  52655. e.count = 0
  52656. }
  52657. ,
  52658. this.renderBufferDirect = function(e, i, r, o, a, s) {
  52659. E(o);
  52660. var l = w(e, i, o, a)
  52661. , c = !1
  52662. , h = r.id + "_" + l.id + "_" + o.wireframe;
  52663. h !== Ee && (Ee = h,
  52664. c = !0);
  52665. var u = a.morphTargetInfluences;
  52666. if (void 0 !== u) {
  52667. for (var d = [], p = 0, m = u.length; p < m; p++) {
  52668. var v = u[p];
  52669. d.push([v, p])
  52670. }
  52671. d.sort(g),
  52672. d.length > 8 && (d.length = 8);
  52673. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  52674. var v = d[p];
  52675. if (fe[p] = v[0],
  52676. 0 !== v[0]) {
  52677. var y = v[1];
  52678. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  52679. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  52680. } else
  52681. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  52682. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  52683. }
  52684. var C = l.getUniforms();
  52685. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  52686. c = !0
  52687. }
  52688. var y = r.index
  52689. , I = r.attributes.position;
  52690. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  52691. var b;
  52692. null !== y ? (b = Je,
  52693. b.setIndex(y)) : b = Qe,
  52694. c && (f(o, l, r),
  52695. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  52696. var _ = 0
  52697. , T = 1 / 0;
  52698. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  52699. var x = r.drawRange.start
  52700. , S = r.drawRange.count
  52701. , M = null !== s ? s.start : 0
  52702. , R = null !== s ? s.count : 1 / 0
  52703. , P = Math.max(_, x, M)
  52704. , O = Math.min(_ + T, x + S, M + R) - 1
  52705. , L = Math.max(0, O - P + 1);
  52706. if (a instanceof n.Mesh)
  52707. if (o.wireframe === !0)
  52708. Ye.setLineWidth(o.wireframeLinewidth * t()),
  52709. b.setMode(Ge.LINES);
  52710. else
  52711. switch (a.drawMode) {
  52712. case n.TrianglesDrawMode:
  52713. b.setMode(Ge.TRIANGLES);
  52714. break;
  52715. case n.TriangleStripDrawMode:
  52716. b.setMode(Ge.TRIANGLE_STRIP);
  52717. break;
  52718. case n.TriangleFanDrawMode:
  52719. b.setMode(Ge.TRIANGLE_FAN)
  52720. }
  52721. else if (a instanceof n.Line) {
  52722. var D = o.linewidth;
  52723. void 0 === D && (D = 1),
  52724. Ye.setLineWidth(D * t()),
  52725. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  52726. } else
  52727. a instanceof n.Points && b.setMode(Ge.POINTS);
  52728. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  52729. }
  52730. ,
  52731. this.render = function(e, t, i, r) {
  52732. if (t instanceof n.Camera == !1)
  52733. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  52734. var o = e.fog;
  52735. if (Ee = "",
  52736. Ie = -1,
  52737. be = null,
  52738. e.autoUpdate === !0 && e.updateMatrixWorld(),
  52739. null === t.parent && t.updateMatrixWorld(),
  52740. t.matrixWorldInverse.getInverse(t.matrixWorld),
  52741. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  52742. Be.setFromMatrix(Fe),
  52743. ce.length = 0,
  52744. ue = -1,
  52745. pe = -1,
  52746. ge.length = 0,
  52747. me.length = 0,
  52748. y(e, t),
  52749. he.length = ue + 1,
  52750. de.length = pe + 1,
  52751. ve.sortObjects === !0 && (he.sort(m),
  52752. de.sort(v)),
  52753. U(ce, t),
  52754. $e.render(e, t),
  52755. He.calls = 0,
  52756. He.vertices = 0,
  52757. He.faces = 0,
  52758. He.points = 0,
  52759. void 0 === i && (i = null),
  52760. this.setRenderTarget(i),
  52761. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  52762. e.overrideMaterial) {
  52763. var a = e.overrideMaterial;
  52764. C(he, t, o, a),
  52765. C(de, t, o, a)
  52766. } else
  52767. Ye.setBlending(n.NoBlending),
  52768. C(he, t, o),
  52769. C(de, t, o);
  52770. if (et.render(e, t),
  52771. tt.render(e, t, Te),
  52772. i) {
  52773. var s = i.texture;
  52774. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  52775. }
  52776. Ye.setDepthTest(!0),
  52777. Ye.setDepthWrite(!0),
  52778. Ye.setColorWrite(!0)
  52779. }
  52780. ,
  52781. this.setFaceCulling = function(e, t) {
  52782. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  52783. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  52784. Ye.enable(Ge.CULL_FACE))
  52785. }
  52786. ,
  52787. this.setTexture = function(e, t) {
  52788. var i = Xe.get(e);
  52789. if (e.version > 0 && i.__version !== e.version) {
  52790. var n = e.image;
  52791. 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)
  52792. }
  52793. Ye.activeTexture(Ge.TEXTURE0 + t),
  52794. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  52795. }
  52796. ,
  52797. this.getCurrentRenderTarget = function() {
  52798. return ye
  52799. }
  52800. ,
  52801. this.setRenderTargetFramebuffer = function ( renderTarget, defaultFramebuffer ) {//add
  52802. const renderTargetProperties = Xe.get( renderTarget );
  52803. renderTargetProperties.__webglFramebuffer = defaultFramebuffer;
  52804. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined;
  52805. },
  52806. this.setFramebuffer = function ( value ) {//add
  52807. if ( Ce !== value && ye === null ) Ge.bindFramebuffer( 36160, value );
  52808. Ce = value;
  52809. },
  52810. this.setRenderTarget = function(e) {
  52811. ye = e,
  52812. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  52813. var t, i = e instanceof n.WebGLRenderTargetCube;
  52814. if (e) {
  52815. var r = Xe.get(e);
  52816. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  52817. we.copy(e.scissor),
  52818. _e = e.scissorTest,
  52819. Te.copy(e.viewport)
  52820. } else
  52821. t = null,
  52822. we.copy(Le).multiplyScalar(Oe),
  52823. _e = De,
  52824. Te.copy(Ne).multiplyScalar(Oe);
  52825. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  52826. Ce = t),
  52827. Ye.scissor(we),
  52828. Ye.setScissorTest(_e),
  52829. Ye.viewport(Te),
  52830. i) {
  52831. var o = Xe.get(e.texture);
  52832. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  52833. }
  52834. }
  52835. ,
  52836. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  52837. if (e instanceof n.WebGLRenderTarget == !1)
  52838. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  52839. var s = Xe.get(e).__webglFramebuffer;
  52840. if (s) {
  52841. var l = !1;
  52842. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  52843. l = !0);
  52844. try {
  52845. var c = e.texture;
  52846. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  52847. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  52848. 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")))
  52849. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  52850. 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.")
  52851. } finally {
  52852. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  52853. }
  52854. }
  52855. }
  52856. }
  52857. ,
  52858. n.WebGLRenderTarget = function(e, t, i) {
  52859. this.uuid = n.Math.generateUUID(),
  52860. this.width = e,
  52861. this.height = t,
  52862. this.scissor = new n.Vector4(0,0,e,t),
  52863. this.scissorTest = !1,
  52864. this.viewport = new n.Vector4(0,0,e,t),
  52865. i = i || {},
  52866. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  52867. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  52868. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  52869. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  52870. }
  52871. ,
  52872. n.WebGLRenderTarget.prototype = {
  52873. constructor: n.WebGLRenderTarget,
  52874. setSize: function(e, t) {
  52875. this.width === e && this.height === t || (this.width = e,
  52876. this.height = t,
  52877. this.dispose()),
  52878. this.viewport.set(0, 0, e, t),
  52879. this.scissor.set(0, 0, e, t)
  52880. },
  52881. clone: function() {
  52882. return (new this.constructor).copy(this)
  52883. },
  52884. copy: function(e) {
  52885. return this.width = e.width,
  52886. this.height = e.height,
  52887. this.viewport.copy(e.viewport),
  52888. this.texture = e.texture.clone(),
  52889. this.depthBuffer = e.depthBuffer,
  52890. this.stencilBuffer = e.stencilBuffer,
  52891. this
  52892. },
  52893. dispose: function() {
  52894. this.dispatchEvent({
  52895. type: "dispose"
  52896. })
  52897. }
  52898. },
  52899. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  52900. n.WebGLRenderTargetCube = function(e, t, i) {
  52901. n.WebGLRenderTarget.call(this, e, t, i),
  52902. this.activeCubeFace = 0,
  52903. this.activeMipMapLevel = 0
  52904. }
  52905. ,
  52906. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  52907. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  52908. n.WebGLBufferRenderer = function(e, t, i) {
  52909. function r(e) {
  52910. s = e
  52911. }
  52912. function o(t, n) {
  52913. e.drawArrays(s, t, n),
  52914. i.calls++,
  52915. i.vertices += n,
  52916. s === e.TRIANGLES && (i.faces += n / 3)
  52917. }
  52918. function a(r) {
  52919. var o = t.get("ANGLE_instanced_arrays");
  52920. if (null === o)
  52921. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  52922. var a = r.attributes.position
  52923. , l = 0;
  52924. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  52925. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  52926. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  52927. i.calls++,
  52928. i.vertices += l * r.maxInstancedCount,
  52929. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  52930. }
  52931. var s;
  52932. this.setMode = r,
  52933. this.render = o,
  52934. this.renderInstances = a
  52935. }
  52936. ,
  52937. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  52938. function n(e) {
  52939. s = e
  52940. }
  52941. function r(i) {
  52942. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  52943. c = 4) : (l = e.UNSIGNED_SHORT,
  52944. c = 2)
  52945. }
  52946. function o(t, n) {
  52947. e.drawElements(s, n, l, t * c),
  52948. i.calls++,
  52949. i.vertices += n,
  52950. s === e.TRIANGLES && (i.faces += n / 3)
  52951. }
  52952. function a(n, r, o) {
  52953. var a = t.get("ANGLE_instanced_arrays");
  52954. 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),
  52955. i.calls++,
  52956. i.vertices += o * n.maxInstancedCount,
  52957. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  52958. }
  52959. var s, l, c;
  52960. this.setMode = n,
  52961. this.setIndex = r,
  52962. this.render = o,
  52963. this.renderInstances = a
  52964. }
  52965. ,
  52966. n.WebGLExtensions = function(e) {
  52967. var t = {};
  52968. this.get = function(i) {
  52969. if (void 0 !== t[i])
  52970. return t[i];
  52971. var n;
  52972. switch (i) {
  52973. case "EXT_texture_filter_anisotropic":
  52974. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  52975. break;
  52976. case "WEBGL_compressed_texture_s3tc":
  52977. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  52978. break;
  52979. case "WEBGL_compressed_texture_pvrtc":
  52980. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  52981. break;
  52982. case "WEBGL_compressed_texture_etc1":
  52983. n = e.getExtension("WEBGL_compressed_texture_etc1");
  52984. break;
  52985. default:
  52986. n = e.getExtension(i)
  52987. }
  52988. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  52989. t[i] = n,
  52990. n
  52991. }
  52992. }
  52993. ,
  52994. n.WebGLCapabilities = function(e, t, i) {
  52995. function n(t) {
  52996. if ("highp" === t) {
  52997. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  52998. return "highp";
  52999. t = "mediump"
  53000. }
  53001. 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"
  53002. }
  53003. this.getMaxPrecision = n,
  53004. this.precision = void 0 !== i.precision ? i.precision : "highp",
  53005. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  53006. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  53007. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  53008. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  53009. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  53010. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  53011. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  53012. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  53013. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  53014. this.vertexTextures = this.maxVertexTextures > 0,
  53015. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  53016. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  53017. var r = n(this.precision);
  53018. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  53019. this.precision = r),
  53020. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  53021. }
  53022. ,
  53023. n.WebGLGeometries = function(e, t, i) {
  53024. function r(e) {
  53025. var t = e.geometry;
  53026. if (void 0 !== h[t.id])
  53027. return h[t.id];
  53028. t.addEventListener("dispose", o);
  53029. var r;
  53030. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  53031. r = t._bufferGeometry),
  53032. h[t.id] = r,
  53033. i.memory.geometries++,
  53034. r
  53035. }
  53036. function o(e) {
  53037. var n = e.target
  53038. , r = h[n.id];
  53039. null !== r.index && s(r.index),
  53040. l(r.attributes),
  53041. n.removeEventListener("dispose", o),
  53042. delete h[n.id];
  53043. var a = t.get(n);
  53044. a.wireframe && s(a.wireframe),
  53045. t.delete(n);
  53046. var c = t.get(r);
  53047. c.wireframe && s(c.wireframe),
  53048. t.delete(r),
  53049. i.memory.geometries--
  53050. }
  53051. function a(e) {
  53052. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53053. }
  53054. function s(t) {
  53055. var i = a(t);
  53056. void 0 !== i && (e.deleteBuffer(i),
  53057. c(t))
  53058. }
  53059. function l(e) {
  53060. for (var t in e)
  53061. s(e[t])
  53062. }
  53063. function c(e) {
  53064. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  53065. }
  53066. var h = {};
  53067. this.get = r
  53068. }
  53069. ,
  53070. n.WebGLLights = function() {
  53071. var e = {};
  53072. this.get = function(t) {
  53073. if (void 0 !== e[t.id])
  53074. return e[t.id];
  53075. var i;
  53076. switch (t.type) {
  53077. case "DirectionalLight":
  53078. i = {
  53079. direction: new n.Vector3,
  53080. color: new n.Color,
  53081. shadow: !1,
  53082. shadowBias: 0,
  53083. shadowRadius: 1,
  53084. shadowMapSize: new n.Vector2
  53085. };
  53086. break;
  53087. case "SpotLight":
  53088. i = {
  53089. position: new n.Vector3,
  53090. direction: new n.Vector3,
  53091. color: new n.Color,
  53092. distance: 0,
  53093. coneCos: 0,
  53094. penumbraCos: 0,
  53095. decay: 0,
  53096. shadow: !1,
  53097. shadowBias: 0,
  53098. shadowRadius: 1,
  53099. shadowMapSize: new n.Vector2
  53100. };
  53101. break;
  53102. case "PointLight":
  53103. i = {
  53104. position: new n.Vector3,
  53105. color: new n.Color,
  53106. distance: 0,
  53107. decay: 0,
  53108. shadow: !1,
  53109. shadowBias: 0,
  53110. shadowRadius: 1,
  53111. shadowMapSize: new n.Vector2
  53112. };
  53113. break;
  53114. case "HemisphereLight":
  53115. i = {
  53116. direction: new n.Vector3,
  53117. skyColor: new n.Color,
  53118. groundColor: new n.Color
  53119. }
  53120. }
  53121. return e[t.id] = i,
  53122. i
  53123. }
  53124. }
  53125. ,
  53126. n.WebGLObjects = function(e, t, i) {
  53127. function r(t) {
  53128. var i = u.get(t);
  53129. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  53130. var r = i.index
  53131. , a = i.attributes;
  53132. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  53133. for (var s in a)
  53134. o(a[s], e.ARRAY_BUFFER);
  53135. var l = i.morphAttributes;
  53136. for (var s in l)
  53137. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  53138. o(c[h], e.ARRAY_BUFFER);
  53139. return i
  53140. }
  53141. function o(e, i) {
  53142. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  53143. , o = t.get(r);
  53144. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  53145. }
  53146. function a(t, i, n) {
  53147. t.__webglBuffer = e.createBuffer(),
  53148. e.bindBuffer(n, t.__webglBuffer);
  53149. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  53150. e.bufferData(n, i.array, r),
  53151. t.version = i.version
  53152. }
  53153. function s(t, i, n) {
  53154. e.bindBuffer(n, t.__webglBuffer),
  53155. 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)),
  53156. i.updateRange.count = 0),
  53157. t.version = i.version
  53158. }
  53159. function l(e) {
  53160. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  53161. }
  53162. function c(i) {
  53163. var r = t.get(i);
  53164. if (void 0 !== r.wireframe)
  53165. return r.wireframe;
  53166. var a = []
  53167. , s = i.index
  53168. , l = i.attributes
  53169. , c = l.position;
  53170. if (null !== s)
  53171. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  53172. var g = d[p + 0]
  53173. , m = d[p + 1]
  53174. , v = d[p + 2];
  53175. h(u, g, m) && a.push(g, m),
  53176. h(u, m, v) && a.push(m, v),
  53177. h(u, v, g) && a.push(v, g)
  53178. }
  53179. else
  53180. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  53181. var g = p + 0
  53182. , m = p + 1
  53183. , v = p + 2;
  53184. a.push(g, m, m, v, v, g)
  53185. }
  53186. var A = c.count > 65535 ? Uint32Array : Uint16Array
  53187. , y = new n.BufferAttribute(new A(a),1);
  53188. return o(y, e.ELEMENT_ARRAY_BUFFER),
  53189. r.wireframe = y,
  53190. y
  53191. }
  53192. function h(e, t, i) {
  53193. if (t > i) {
  53194. var n = t;
  53195. t = i,
  53196. i = n
  53197. }
  53198. var r = e[t];
  53199. return void 0 === r ? (e[t] = [i],
  53200. !0) : r.indexOf(i) === -1 && (r.push(i),
  53201. !0)
  53202. }
  53203. var u = new n.WebGLGeometries(e,t,i);
  53204. this.getAttributeBuffer = l,
  53205. this.getWireframeAttribute = c,
  53206. this.update = r
  53207. }
  53208. ,
  53209. n.WebGLProgram = function() {
  53210. function e(e) {
  53211. switch (e) {
  53212. case n.LinearEncoding:
  53213. return ["Linear", "( value )"];
  53214. case n.sRGBEncoding:
  53215. return ["sRGB", "( value )"];
  53216. case n.RGBEEncoding:
  53217. return ["RGBE", "( value )"];
  53218. case n.RGBM7Encoding:
  53219. return ["RGBM", "( value, 7.0 )"];
  53220. case n.RGBM16Encoding:
  53221. return ["RGBM", "( value, 16.0 )"];
  53222. case n.RGBDEncoding:
  53223. return ["RGBD", "( value, 256.0 )"];
  53224. case n.GammaEncoding:
  53225. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  53226. default:
  53227. throw new Error("unsupported encoding: " + e)
  53228. }
  53229. }
  53230. function t(t, i) {
  53231. var n = e(i);
  53232. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  53233. }
  53234. function i(t, i) {
  53235. var n = e(i);
  53236. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  53237. }
  53238. function r(e, t) {
  53239. var i;
  53240. switch (t) {
  53241. case n.LinearToneMapping:
  53242. i = "Linear";
  53243. break;
  53244. case n.ReinhardToneMapping:
  53245. i = "Reinhard";
  53246. break;
  53247. case n.Uncharted2ToneMapping:
  53248. i = "Uncharted2";
  53249. break;
  53250. case n.CineonToneMapping:
  53251. i = "OptimizedCineon";
  53252. break;
  53253. default:
  53254. throw new Error("unsupported toneMapping: " + t)
  53255. }
  53256. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  53257. }
  53258. function o(e, t, i) {
  53259. e = e || {};
  53260. 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" : ""];
  53261. return n.filter(c).join("\n")
  53262. }
  53263. function a(e) {
  53264. var t = [];
  53265. for (var i in e) {
  53266. var n = e[i];
  53267. n !== !1 && t.push("#define " + i + " " + n)
  53268. }
  53269. return t.join("\n")
  53270. }
  53271. function s(e, t, i) {
  53272. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  53273. var a = e.getActiveUniform(t, o)
  53274. , s = a.name
  53275. , l = e.getUniformLocation(t, s)
  53276. , c = f.exec(s);
  53277. if (c) {
  53278. var h = c[1]
  53279. , u = c[2]
  53280. , d = n[h];
  53281. d || (d = n[h] = {}),
  53282. d[u] = l
  53283. } else if (c = g.exec(s)) {
  53284. var p = c[1]
  53285. , v = c[2]
  53286. , A = c[3]
  53287. , y = n[p];
  53288. y || (y = n[p] = []);
  53289. var C = y[v];
  53290. C || (C = y[v] = {}),
  53291. C[A] = l
  53292. } else if (c = m.exec(s)) {
  53293. var p = c[1];
  53294. n[p] = l
  53295. } else
  53296. n[s] = l
  53297. }
  53298. return n
  53299. }
  53300. function l(e, t, i) {
  53301. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  53302. var a = e.getActiveAttrib(t, o)
  53303. , s = a.name;
  53304. n[s] = e.getAttribLocation(t, s)
  53305. }
  53306. return n
  53307. }
  53308. function c(e) {
  53309. return "" !== e
  53310. }
  53311. function h(e, t) {
  53312. 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)
  53313. }
  53314. function u(e) {
  53315. function t(e, t) {
  53316. var i = n.ShaderChunk[t];
  53317. if (void 0 === i)
  53318. throw new Error("Can not resolve #include <" + t + ">");
  53319. return u(i)
  53320. }
  53321. var i = /#include +<([\w\d.]+)>/g;
  53322. return e.replace(i, t)
  53323. }
  53324. function d(e) {
  53325. function t(e, t, i, n) {
  53326. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  53327. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  53328. return r
  53329. }
  53330. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  53331. return e.replace(i, t)
  53332. }
  53333. var p = 0
  53334. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  53335. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  53336. , m = /^([\w\d_]+)\[0\]$/;
  53337. return function(e, f, g, m) {
  53338. var v = e.context
  53339. , A = g.extensions
  53340. , y = g.defines
  53341. , C = g.__webglShader.vertexShader
  53342. , I = g.__webglShader.fragmentShader
  53343. , E = "SHADOWMAP_TYPE_BASIC";
  53344. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  53345. var b = "ENVMAP_TYPE_CUBE"
  53346. , w = "ENVMAP_MODE_REFLECTION"
  53347. , _ = "ENVMAP_BLENDING_MULTIPLY";
  53348. if (m.envMap) {
  53349. switch (g.envMap.mapping) {
  53350. case n.CubeReflectionMapping:
  53351. case n.CubeRefractionMapping:
  53352. b = "ENVMAP_TYPE_CUBE";
  53353. break;
  53354. case n.CubeUVReflectionMapping:
  53355. case n.CubeUVRefractionMapping:
  53356. b = "ENVMAP_TYPE_CUBE_UV";
  53357. break;
  53358. case n.EquirectangularReflectionMapping:
  53359. case n.EquirectangularRefractionMapping:
  53360. b = "ENVMAP_TYPE_EQUIREC";
  53361. break;
  53362. case n.SphericalReflectionMapping:
  53363. b = "ENVMAP_TYPE_SPHERE"
  53364. }
  53365. switch (g.envMap.mapping) {
  53366. case n.CubeRefractionMapping:
  53367. case n.EquirectangularRefractionMapping:
  53368. w = "ENVMAP_MODE_REFRACTION"
  53369. }
  53370. switch (g.combine) {
  53371. case n.MultiplyOperation:
  53372. _ = "ENVMAP_BLENDING_MULTIPLY";
  53373. break;
  53374. case n.MixOperation:
  53375. _ = "ENVMAP_BLENDING_MIX";
  53376. break;
  53377. case n.AddOperation:
  53378. _ = "ENVMAP_BLENDING_ADD"
  53379. }
  53380. }
  53381. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  53382. g instanceof n.RawShaderMaterial ? (T = "",
  53383. 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"),
  53384. 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")),
  53385. C = u(C, m),
  53386. C = h(C, m),
  53387. I = u(I, m),
  53388. I = h(I, m),
  53389. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  53390. I = d(I));
  53391. var O = T + C
  53392. , L = x + I
  53393. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  53394. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  53395. v.attachShader(P, D),
  53396. v.attachShader(P, N),
  53397. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  53398. v.linkProgram(P);
  53399. var B = v.getProgramInfoLog(P)
  53400. , F = v.getShaderInfoLog(D)
  53401. , V = v.getShaderInfoLog(N)
  53402. , U = !0
  53403. , k = !0;
  53404. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  53405. 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),
  53406. k && (this.diagnostics = {
  53407. runnable: U,
  53408. material: g,
  53409. programLog: B,
  53410. vertexShader: {
  53411. log: F,
  53412. prefix: T
  53413. },
  53414. fragmentShader: {
  53415. log: V,
  53416. prefix: x
  53417. }
  53418. }),
  53419. v.deleteShader(D),
  53420. v.deleteShader(N);
  53421. var H;
  53422. this.getUniforms = function() {
  53423. return void 0 === H && (H = s(v, P)),
  53424. H
  53425. }
  53426. ;
  53427. var G;
  53428. return this.getAttributes = function() {
  53429. return void 0 === G && (G = l(v, P)),
  53430. G
  53431. }
  53432. ,
  53433. this.destroy = function() {
  53434. v.deleteProgram(P),
  53435. this.program = void 0
  53436. }
  53437. ,
  53438. Object.defineProperties(this, {
  53439. uniforms: {
  53440. get: function() {
  53441. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  53442. this.getUniforms()
  53443. }
  53444. },
  53445. attributes: {
  53446. get: function() {
  53447. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  53448. this.getAttributes()
  53449. }
  53450. }
  53451. }),
  53452. this.id = p++,
  53453. this.code = f,
  53454. this.usedTimes = 1,
  53455. this.program = P,
  53456. this.vertexShader = D,
  53457. this.fragmentShader = N,
  53458. this
  53459. }
  53460. }(),
  53461. n.WebGLPrograms = function(e, t) {
  53462. function i(e) {
  53463. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  53464. return 1024;
  53465. var i = t.maxVertexUniforms
  53466. , r = Math.floor((i - 20) / 4)
  53467. , o = r;
  53468. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  53469. 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)")),
  53470. o
  53471. }
  53472. function r(e, t) {
  53473. var i;
  53474. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  53475. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  53476. i
  53477. }
  53478. var o = []
  53479. , a = {
  53480. MeshDepthMaterial: "depth",
  53481. MeshNormalMaterial: "normal",
  53482. MeshBasicMaterial: "basic",
  53483. MeshLambertMaterial: "lambert",
  53484. MeshPhongMaterial: "phong",
  53485. MeshStandardMaterial: "standard",
  53486. LineBasicMaterial: "basic",
  53487. LineDashedMaterial: "dashed",
  53488. PointsMaterial: "points"
  53489. }
  53490. , 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"];
  53491. this.getParameters = function(o, s, l, c) {
  53492. var h = a[o.type]
  53493. , u = i(c)
  53494. , d = e.getPrecision();
  53495. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  53496. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  53497. var p = {
  53498. shaderID: h,
  53499. precision: d,
  53500. supportsVertexTextures: t.vertexTextures,
  53501. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  53502. map: !!o.map,
  53503. mapEncoding: r(o.map, e.gammaInput),
  53504. envMap: !!o.envMap,
  53505. envMapMode: o.envMap && o.envMap.mapping,
  53506. envMapEncoding: r(o.envMap, e.gammaInput),
  53507. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  53508. lightMap: !!o.lightMap,
  53509. aoMap: !!o.aoMap,
  53510. emissiveMap: !!o.emissiveMap,
  53511. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  53512. bumpMap: !!o.bumpMap,
  53513. normalMap: !!o.normalMap,
  53514. displacementMap: !!o.displacementMap,
  53515. roughnessMap: !!o.roughnessMap,
  53516. metalnessMap: !!o.metalnessMap,
  53517. specularMap: !!o.specularMap,
  53518. alphaMap: !!o.alphaMap,
  53519. combine: o.combine,
  53520. vertexColors: o.vertexColors,
  53521. fog: l,
  53522. useFog: o.fog,
  53523. fogExp: l instanceof n.FogExp2,
  53524. flatShading: o.shading === n.FlatShading,
  53525. sizeAttenuation: o.sizeAttenuation,
  53526. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  53527. skinning: o.skinning,
  53528. maxBones: u,
  53529. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  53530. morphTargets: o.morphTargets,
  53531. morphNormals: o.morphNormals,
  53532. maxMorphTargets: e.maxMorphTargets,
  53533. maxMorphNormals: e.maxMorphNormals,
  53534. numDirLights: s.directional.length,
  53535. numPointLights: s.point.length,
  53536. numSpotLights: s.spot.length,
  53537. numHemiLights: s.hemi.length,
  53538. pointLightShadows: s.shadowsPointLight,
  53539. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  53540. shadowMapType: e.shadowMap.type,
  53541. toneMapping: e.toneMapping,
  53542. physicallyCorrectLights: e.physicallyCorrectLights,
  53543. premultipliedAlpha: o.premultipliedAlpha,
  53544. alphaTest: o.alphaTest,
  53545. doubleSided: o.side === n.DoubleSide,
  53546. flipSided: o.side === n.BackSide
  53547. };
  53548. return p
  53549. }
  53550. ,
  53551. this.getProgramCode = function(e, t) {
  53552. var i = [];
  53553. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  53554. i.push(e.vertexShader)),
  53555. void 0 !== e.defines)
  53556. for (var n in e.defines)
  53557. i.push(n),
  53558. i.push(e.defines[n]);
  53559. for (var r = 0; r < s.length; r++) {
  53560. var o = s[r];
  53561. i.push(o),
  53562. i.push(t[o])
  53563. }
  53564. return i.join()
  53565. }
  53566. ,
  53567. this.acquireProgram = function(t, i, r) {
  53568. for (var a, s = 0, l = o.length; s < l; s++) {
  53569. var c = o[s];
  53570. if (c.code === r) {
  53571. a = c,
  53572. ++a.usedTimes;
  53573. break
  53574. }
  53575. }
  53576. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  53577. o.push(a)),
  53578. a
  53579. }
  53580. ,
  53581. this.releaseProgram = function(e) {
  53582. if (0 === --e.usedTimes) {
  53583. var t = o.indexOf(e);
  53584. o[t] = o[o.length - 1],
  53585. o.pop(),
  53586. e.destroy()
  53587. }
  53588. }
  53589. ,
  53590. this.programs = o
  53591. }
  53592. ,
  53593. n.WebGLProperties = function() {
  53594. var e = {};
  53595. this.get = function(t) {
  53596. var i = t.uuid
  53597. , n = e[i];
  53598. return void 0 === n && (n = {},
  53599. e[i] = n),
  53600. n
  53601. }
  53602. ,
  53603. this.delete = function(t) {
  53604. delete e[t.uuid]
  53605. }
  53606. ,
  53607. this.clear = function() {
  53608. e = {}
  53609. }
  53610. }
  53611. ,
  53612. n.WebGLShader = function() {
  53613. function e(e) {
  53614. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  53615. t[i] = i + 1 + ": " + t[i];
  53616. return t.join("\n")
  53617. }
  53618. return function(t, i, n) {
  53619. var r = t.createShader(i);
  53620. return t.shaderSource(r, n),
  53621. t.compileShader(r),
  53622. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  53623. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  53624. r
  53625. }
  53626. }(),
  53627. n.WebGLShadowMap = function(e, t, i) {
  53628. function r(e, t, i, r) {
  53629. var o = e.geometry
  53630. , a = null
  53631. , s = v
  53632. , l = e.customDepthMaterial;
  53633. if (i && (s = A,
  53634. l = e.customDistanceMaterial),
  53635. l)
  53636. a = l;
  53637. else {
  53638. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  53639. , h = e instanceof n.SkinnedMesh && t.skinning
  53640. , u = 0;
  53641. c && (u |= f),
  53642. h && (u |= g),
  53643. a = s[u]
  53644. }
  53645. return a.visible = t.visible,
  53646. a.wireframe = t.wireframe,
  53647. a.wireframeLinewidth = t.wireframeLinewidth,
  53648. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  53649. a
  53650. }
  53651. function o(e, t, i) {
  53652. if (e.visible !== !1) {
  53653. 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)) {
  53654. var r = e.material;
  53655. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  53656. p.push(e))
  53657. }
  53658. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  53659. o(a[s], t, i)
  53660. }
  53661. }
  53662. 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) {
  53663. var x = 0 !== (T & f)
  53664. , S = 0 !== (T & g)
  53665. , M = new n.ShaderMaterial({
  53666. uniforms: b,
  53667. vertexShader: E.vertexShader,
  53668. fragmentShader: E.fragmentShader,
  53669. morphTargets: x,
  53670. skinning: S
  53671. });
  53672. v[T] = M;
  53673. var R = new n.ShaderMaterial({
  53674. defines: {
  53675. USE_SHADOWMAP: ""
  53676. },
  53677. uniforms: _,
  53678. vertexShader: w.vertexShader,
  53679. fragmentShader: w.fragmentShader,
  53680. morphTargets: x,
  53681. skinning: S
  53682. });
  53683. A[T] = R
  53684. }
  53685. var P = this;
  53686. this.enabled = !1,
  53687. this.autoUpdate = !0,
  53688. this.needsUpdate = !1,
  53689. this.type = n.PCFShadowMap,
  53690. this.cullFace = n.CullFaceFront,
  53691. this.render = function(f, g) {
  53692. var m, v, A = t.shadows;
  53693. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  53694. s.clearColor(1, 1, 1, 1),
  53695. s.disable(a.BLEND),
  53696. s.enable(a.CULL_FACE),
  53697. a.frontFace(a.CCW),
  53698. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  53699. s.setDepthTest(!0),
  53700. s.setScissorTest(!1);
  53701. for (var E = 0, b = A.length; E < b; E++) {
  53702. var w = A[E]
  53703. , _ = w.shadow
  53704. , T = _.camera;
  53705. if (h.copy(_.mapSize),
  53706. w instanceof n.PointLight) {
  53707. m = 6,
  53708. v = !0;
  53709. var x = h.x
  53710. , S = h.y;
  53711. I[0].set(2 * x, S, x, S),
  53712. I[1].set(0, S, x, S),
  53713. I[2].set(3 * x, S, x, S),
  53714. I[3].set(x, S, x, S),
  53715. I[4].set(3 * x, 0, x, S),
  53716. I[5].set(x, 0, x, S),
  53717. h.x *= 4,
  53718. h.y *= 2
  53719. } else
  53720. m = 1,
  53721. v = !1;
  53722. if (null === _.map) {
  53723. var M = {
  53724. minFilter: n.NearestFilter,
  53725. magFilter: n.NearestFilter,
  53726. format: n.RGBAFormat
  53727. };
  53728. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  53729. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  53730. T.updateProjectionMatrix()
  53731. }
  53732. var R = _.map
  53733. , O = _.matrix;
  53734. d.setFromMatrixPosition(w.matrixWorld),
  53735. T.position.copy(d),
  53736. e.setRenderTarget(R),
  53737. e.clear();
  53738. for (var L = 0; L < m; L++) {
  53739. if (v) {
  53740. u.copy(T.position),
  53741. u.add(y[L]),
  53742. T.up.copy(C[L]),
  53743. T.lookAt(u);
  53744. var D = I[L];
  53745. s.viewport(D)
  53746. } else
  53747. u.setFromMatrixPosition(w.target.matrixWorld),
  53748. T.lookAt(u);
  53749. T.updateMatrixWorld(),
  53750. T.matrixWorldInverse.getInverse(T.matrixWorld),
  53751. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  53752. O.multiply(T.projectionMatrix),
  53753. O.multiply(T.matrixWorldInverse),
  53754. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  53755. l.setFromMatrix(c),
  53756. p.length = 0,
  53757. o(f, g, T);
  53758. for (var N = 0, B = p.length; N < B; N++) {
  53759. var F = p[N]
  53760. , V = i.update(F)
  53761. , U = F.material;
  53762. if (U instanceof n.MultiMaterial)
  53763. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  53764. var W = k[G]
  53765. , j = H[W.materialIndex];
  53766. if (j.visible === !0) {
  53767. var Y = r(F, j, v, d);
  53768. e.renderBufferDirect(T, null, V, Y, F, W)
  53769. }
  53770. }
  53771. else {
  53772. var Y = r(F, U, v, d);
  53773. e.renderBufferDirect(T, null, V, Y, F, null)
  53774. }
  53775. }
  53776. }
  53777. }
  53778. var X = e.getClearColor()
  53779. , Z = e.getClearAlpha();
  53780. e.setClearColor(X, Z),
  53781. s.enable(a.BLEND),
  53782. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  53783. P.needsUpdate = !1
  53784. }
  53785. }
  53786. }
  53787. ,
  53788. n.WebGLState = function(e, t, i) {
  53789. var r = this
  53790. , o = new n.Vector4
  53791. , a = new Uint8Array(16)
  53792. , s = new Uint8Array(16)
  53793. , l = new Uint8Array(16)
  53794. , c = {}
  53795. , h = null
  53796. , u = null
  53797. , d = null
  53798. , p = null
  53799. , f = null
  53800. , g = null
  53801. , m = null
  53802. , v = null
  53803. , A = !1
  53804. , y = null
  53805. , C = null
  53806. , I = null
  53807. , E = null
  53808. , b = null
  53809. , w = null
  53810. , _ = null
  53811. , T = null
  53812. , x = null
  53813. , S = null
  53814. , M = null
  53815. , R = null
  53816. , P = null
  53817. , O = null
  53818. , L = null
  53819. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  53820. , N = void 0
  53821. , B = {}
  53822. , F = new n.Vector4
  53823. , V = null
  53824. , U = null
  53825. , k = new n.Vector4
  53826. , H = new n.Vector4
  53827. , G = e.createTexture();
  53828. e.bindTexture(e.TEXTURE_2D, G),
  53829. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  53830. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  53831. this.init = function() {
  53832. this.clearColor(0, 0, 0, 1),
  53833. this.clearDepth(1),
  53834. this.clearStencil(0),
  53835. this.enable(e.DEPTH_TEST),
  53836. e.depthFunc(e.LEQUAL),
  53837. e.frontFace(e.CCW),
  53838. e.cullFace(e.BACK),
  53839. this.enable(e.CULL_FACE),
  53840. this.enable(e.BLEND),
  53841. e.blendEquation(e.FUNC_ADD),
  53842. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  53843. }
  53844. ,
  53845. this.initAttributes = function() {
  53846. for (var e = 0, t = a.length; e < t; e++)
  53847. a[e] = 0
  53848. }
  53849. ,
  53850. this.enableAttribute = function(i) {
  53851. if (a[i] = 1,
  53852. 0 === s[i] && (e.enableVertexAttribArray(i),
  53853. s[i] = 1),
  53854. 0 !== l[i]) {
  53855. var n = t.get("ANGLE_instanced_arrays");
  53856. n.vertexAttribDivisorANGLE(i, 0),
  53857. l[i] = 0
  53858. }
  53859. }
  53860. ,
  53861. this.enableAttributeAndDivisor = function(t, i, n) {
  53862. a[t] = 1,
  53863. 0 === s[t] && (e.enableVertexAttribArray(t),
  53864. s[t] = 1),
  53865. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  53866. l[t] = i)
  53867. }
  53868. ,
  53869. this.disableUnusedAttributes = function() {
  53870. for (var t = 0, i = s.length; t < i; t++)
  53871. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  53872. s[t] = 0)
  53873. }
  53874. ,
  53875. this.enable = function(t) {
  53876. c[t] !== !0 && (e.enable(t),
  53877. c[t] = !0)
  53878. }
  53879. ,
  53880. this.disable = function(t) {
  53881. c[t] !== !1 && (e.disable(t),
  53882. c[t] = !1)
  53883. }
  53884. ,
  53885. this.getCompressedTextureFormats = function() {
  53886. if (null === h && (h = [],
  53887. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  53888. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  53889. h.push(i[n]);
  53890. return h
  53891. }
  53892. ,
  53893. this.setBlending = function(t, r, o, a, s, l, c, h) {
  53894. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  53895. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53896. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  53897. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53898. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53899. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53900. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  53901. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53902. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  53903. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  53904. u = t,
  53905. A = h),
  53906. t === n.CustomBlending ? (s = s || r,
  53907. l = l || o,
  53908. c = c || a,
  53909. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  53910. d = r,
  53911. g = s),
  53912. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  53913. p = o,
  53914. f = a,
  53915. m = l,
  53916. v = c)) : (d = null,
  53917. p = null,
  53918. f = null,
  53919. g = null,
  53920. m = null,
  53921. v = null)
  53922. }
  53923. ,
  53924. this.setDepthFunc = function(t) {
  53925. if (y !== t) {
  53926. if (t)
  53927. switch (t) {
  53928. case n.NeverDepth:
  53929. e.depthFunc(e.NEVER);
  53930. break;
  53931. case n.AlwaysDepth:
  53932. e.depthFunc(e.ALWAYS);
  53933. break;
  53934. case n.LessDepth:
  53935. e.depthFunc(e.LESS);
  53936. break;
  53937. case n.LessEqualDepth:
  53938. e.depthFunc(e.LEQUAL);
  53939. break;
  53940. case n.EqualDepth:
  53941. e.depthFunc(e.EQUAL);
  53942. break;
  53943. case n.GreaterEqualDepth:
  53944. e.depthFunc(e.GEQUAL);
  53945. break;
  53946. case n.GreaterDepth:
  53947. e.depthFunc(e.GREATER);
  53948. break;
  53949. case n.NotEqualDepth:
  53950. e.depthFunc(e.NOTEQUAL);
  53951. break;
  53952. default:
  53953. e.depthFunc(e.LEQUAL)
  53954. }
  53955. else
  53956. e.depthFunc(e.LEQUAL);
  53957. y = t
  53958. }
  53959. }
  53960. ,
  53961. this.setDepthTest = function(t) {
  53962. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  53963. }
  53964. ,
  53965. this.setDepthWrite = function(t) {
  53966. C !== t && (e.depthMask(t),
  53967. C = t)
  53968. }
  53969. ,
  53970. this.setColorWrite = function(t) {
  53971. I !== t && (e.colorMask(t, t, t, t),
  53972. I = t)
  53973. }
  53974. ,
  53975. this.setStencilFunc = function(t, i, n) {
  53976. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  53977. b = t,
  53978. w = i,
  53979. _ = n)
  53980. }
  53981. ,
  53982. this.setStencilOp = function(t, i, n) {
  53983. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  53984. T = t,
  53985. x = i,
  53986. S = n)
  53987. }
  53988. ,
  53989. this.setStencilTest = function(t) {
  53990. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  53991. }
  53992. ,
  53993. this.setStencilWrite = function(t) {
  53994. E !== t && (e.stencilMask(t),
  53995. E = t)
  53996. }
  53997. ,
  53998. this.setFlipSided = function(t) {
  53999. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  54000. M = t)
  54001. }
  54002. ,
  54003. this.setLineWidth = function(t) {
  54004. t !== R && (e.lineWidth(t),
  54005. R = t)
  54006. }
  54007. ,
  54008. this.setPolygonOffset = function(t, i, n) {
  54009. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  54010. !t || P === i && O === n || (e.polygonOffset(i, n),
  54011. P = i,
  54012. O = n)
  54013. }
  54014. ,
  54015. this.getScissorTest = function() {
  54016. return L
  54017. }
  54018. ,
  54019. this.setScissorTest = function(t) {
  54020. L = t,
  54021. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  54022. }
  54023. ,
  54024. this.activeTexture = function(t) {
  54025. void 0 === t && (t = e.TEXTURE0 + D - 1),
  54026. N !== t && (e.activeTexture(t),
  54027. N = t)
  54028. }
  54029. ,
  54030. this.bindTexture = function(t, i) {
  54031. void 0 === N && r.activeTexture();
  54032. var n = B[N];
  54033. void 0 === n && (n = {
  54034. type: void 0,
  54035. texture: void 0
  54036. },
  54037. B[N] = n),
  54038. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  54039. n.type = t,
  54040. n.texture = i)
  54041. }
  54042. ,
  54043. this.compressedTexImage2D = function() {
  54044. try {
  54045. e.compressedTexImage2D.apply(e, arguments)
  54046. } catch (e) {
  54047. console.error(e)
  54048. }
  54049. }
  54050. ,
  54051. this.texImage2D = function() {
  54052. try {
  54053. e.texImage2D.apply(e, arguments)
  54054. } catch (e) {
  54055. console.error(e)
  54056. }
  54057. }
  54058. ,
  54059. this.clearColor = function(t, i, n, r) {
  54060. o.set(t, i, n, r),
  54061. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  54062. F.copy(o))
  54063. }
  54064. ,
  54065. this.clearDepth = function(t) {
  54066. V !== t && (e.clearDepth(t),
  54067. V = t)
  54068. }
  54069. ,
  54070. this.clearStencil = function(t) {
  54071. U !== t && (e.clearStencil(t),
  54072. U = t)
  54073. }
  54074. ,
  54075. this.scissor = function(t) {
  54076. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  54077. k.copy(t))
  54078. }
  54079. ,
  54080. this.viewport = function(t) {
  54081. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  54082. H.copy(t))
  54083. }
  54084. ,
  54085. this.reset = function() {
  54086. for (var t = 0; t < s.length; t++)
  54087. 1 === s[t] && (e.disableVertexAttribArray(t),
  54088. s[t] = 0);
  54089. c = {},
  54090. h = null,
  54091. N = void 0,
  54092. B = {},
  54093. u = null,
  54094. I = null,
  54095. C = null,
  54096. E = null,
  54097. M = null
  54098. }
  54099. }
  54100. ,
  54101. n.LensFlarePlugin = function(e, t) {
  54102. function i() {
  54103. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  54104. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54105. o = p.createBuffer(),
  54106. a = p.createBuffer(),
  54107. p.bindBuffer(p.ARRAY_BUFFER, o),
  54108. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  54109. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54110. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  54111. u = p.createTexture(),
  54112. d = p.createTexture(),
  54113. f.bindTexture(p.TEXTURE_2D, u),
  54114. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  54115. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54116. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54117. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54118. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54119. f.bindTexture(p.TEXTURE_2D, d),
  54120. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  54121. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  54122. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  54123. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  54124. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  54125. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  54126. var i;
  54127. i = h ? {
  54128. 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"),
  54129. 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")
  54130. } : {
  54131. 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"),
  54132. 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")
  54133. },
  54134. s = r(i),
  54135. l = {
  54136. vertex: p.getAttribLocation(s, "position"),
  54137. uv: p.getAttribLocation(s, "uv")
  54138. },
  54139. c = {
  54140. renderType: p.getUniformLocation(s, "renderType"),
  54141. map: p.getUniformLocation(s, "map"),
  54142. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  54143. opacity: p.getUniformLocation(s, "opacity"),
  54144. color: p.getUniformLocation(s, "color"),
  54145. scale: p.getUniformLocation(s, "scale"),
  54146. rotation: p.getUniformLocation(s, "rotation"),
  54147. screenPosition: p.getUniformLocation(s, "screenPosition")
  54148. }
  54149. }
  54150. function r(t) {
  54151. var i = p.createProgram()
  54152. , n = p.createShader(p.FRAGMENT_SHADER)
  54153. , r = p.createShader(p.VERTEX_SHADER)
  54154. , o = "precision " + e.getPrecision() + " float;\n";
  54155. return p.shaderSource(n, o + t.fragmentShader),
  54156. p.shaderSource(r, o + t.vertexShader),
  54157. p.compileShader(n),
  54158. p.compileShader(r),
  54159. p.attachShader(i, n),
  54160. p.attachShader(i, r),
  54161. p.linkProgram(i),
  54162. i
  54163. }
  54164. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  54165. this.render = function(r, g, m) {
  54166. if (0 !== t.length) {
  54167. var v = new n.Vector3
  54168. , A = m.w / m.z
  54169. , y = .5 * m.z
  54170. , C = .5 * m.w
  54171. , I = 16 / m.w
  54172. , E = new n.Vector2(I * A,I)
  54173. , b = new n.Vector3(1,1,0)
  54174. , w = new n.Vector2(1,1);
  54175. void 0 === s && i(),
  54176. p.useProgram(s),
  54177. f.initAttributes(),
  54178. f.enableAttribute(l.vertex),
  54179. f.enableAttribute(l.uv),
  54180. f.disableUnusedAttributes(),
  54181. p.uniform1i(c.occlusionMap, 0),
  54182. p.uniform1i(c.map, 1),
  54183. p.bindBuffer(p.ARRAY_BUFFER, o),
  54184. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  54185. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  54186. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  54187. f.disable(p.CULL_FACE),
  54188. f.setDepthWrite(!1);
  54189. for (var _ = 0, T = t.length; _ < T; _++) {
  54190. I = 16 / m.w,
  54191. E.set(I * A, I);
  54192. var x = t[_];
  54193. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  54194. v.applyMatrix4(g.matrixWorldInverse),
  54195. v.applyProjection(g.projectionMatrix),
  54196. b.copy(v),
  54197. w.x = b.x * y + y,
  54198. w.y = b.y * C + C,
  54199. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  54200. f.activeTexture(p.TEXTURE0),
  54201. f.bindTexture(p.TEXTURE_2D, null),
  54202. f.activeTexture(p.TEXTURE1),
  54203. f.bindTexture(p.TEXTURE_2D, u),
  54204. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54205. p.uniform1i(c.renderType, 0),
  54206. p.uniform2f(c.scale, E.x, E.y),
  54207. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54208. f.disable(p.BLEND),
  54209. f.enable(p.DEPTH_TEST),
  54210. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54211. f.activeTexture(p.TEXTURE0),
  54212. f.bindTexture(p.TEXTURE_2D, d),
  54213. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  54214. p.uniform1i(c.renderType, 1),
  54215. f.disable(p.DEPTH_TEST),
  54216. f.activeTexture(p.TEXTURE1),
  54217. f.bindTexture(p.TEXTURE_2D, u),
  54218. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  54219. x.positionScreen.copy(b),
  54220. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  54221. p.uniform1i(c.renderType, 2),
  54222. f.enable(p.BLEND);
  54223. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  54224. var R = x.lensFlares[S];
  54225. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  54226. b.y = R.y,
  54227. b.z = R.z,
  54228. I = R.size * R.scale / m.w,
  54229. E.x = I * A,
  54230. E.y = I,
  54231. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  54232. p.uniform2f(c.scale, E.x, E.y),
  54233. p.uniform1f(c.rotation, R.rotation),
  54234. p.uniform1f(c.opacity, R.opacity),
  54235. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  54236. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  54237. e.setTexture(R.texture, 1),
  54238. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  54239. }
  54240. }
  54241. }
  54242. f.enable(p.CULL_FACE),
  54243. f.enable(p.DEPTH_TEST),
  54244. f.setDepthWrite(!0),
  54245. e.resetGLState()
  54246. }
  54247. }
  54248. }
  54249. ,
  54250. n.SpritePlugin = function(e, t) {
  54251. function i() {
  54252. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  54253. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  54254. a = d.createBuffer(),
  54255. s = d.createBuffer(),
  54256. d.bindBuffer(d.ARRAY_BUFFER, a),
  54257. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  54258. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54259. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  54260. l = r(),
  54261. c = {
  54262. position: d.getAttribLocation(l, "position"),
  54263. uv: d.getAttribLocation(l, "uv")
  54264. },
  54265. h = {
  54266. uvOffset: d.getUniformLocation(l, "uvOffset"),
  54267. uvScale: d.getUniformLocation(l, "uvScale"),
  54268. rotation: d.getUniformLocation(l, "rotation"),
  54269. scale: d.getUniformLocation(l, "scale"),
  54270. color: d.getUniformLocation(l, "color"),
  54271. map: d.getUniformLocation(l, "map"),
  54272. opacity: d.getUniformLocation(l, "opacity"),
  54273. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  54274. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  54275. fogType: d.getUniformLocation(l, "fogType"),
  54276. fogDensity: d.getUniformLocation(l, "fogDensity"),
  54277. fogNear: d.getUniformLocation(l, "fogNear"),
  54278. fogFar: d.getUniformLocation(l, "fogFar"),
  54279. fogColor: d.getUniformLocation(l, "fogColor"),
  54280. alphaTest: d.getUniformLocation(l, "alphaTest")
  54281. };
  54282. var i = document.createElement("canvas");
  54283. i.width = 8,
  54284. i.height = 8;
  54285. var o = i.getContext("2d");
  54286. o.fillStyle = "white",
  54287. o.fillRect(0, 0, 8, 8),
  54288. u = new n.Texture(i),
  54289. u.needsUpdate = !0
  54290. }
  54291. function r() {
  54292. var t = d.createProgram()
  54293. , i = d.createShader(d.VERTEX_SHADER)
  54294. , n = d.createShader(d.FRAGMENT_SHADER);
  54295. 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")),
  54296. 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")),
  54297. d.compileShader(i),
  54298. d.compileShader(n),
  54299. d.attachShader(t, i),
  54300. d.attachShader(t, n),
  54301. d.linkProgram(t),
  54302. t
  54303. }
  54304. function o(e, t) {
  54305. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  54306. }
  54307. 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;
  54308. this.render = function(r, v) {
  54309. if (0 !== t.length) {
  54310. void 0 === l && i(),
  54311. d.useProgram(l),
  54312. p.initAttributes(),
  54313. p.enableAttribute(c.position),
  54314. p.enableAttribute(c.uv),
  54315. p.disableUnusedAttributes(),
  54316. p.disable(d.CULL_FACE),
  54317. p.enable(d.BLEND),
  54318. d.bindBuffer(d.ARRAY_BUFFER, a),
  54319. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  54320. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  54321. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  54322. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  54323. p.activeTexture(d.TEXTURE0),
  54324. d.uniform1i(h.map, 0);
  54325. var A = 0
  54326. , y = 0
  54327. , C = r.fog;
  54328. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  54329. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  54330. d.uniform1f(h.fogFar, C.far),
  54331. d.uniform1i(h.fogType, 1),
  54332. A = 1,
  54333. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  54334. d.uniform1i(h.fogType, 2),
  54335. A = 2,
  54336. y = 2)) : (d.uniform1i(h.fogType, 0),
  54337. A = 0,
  54338. y = 0);
  54339. for (var I = 0, E = t.length; I < E; I++) {
  54340. var b = t[I];
  54341. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  54342. b.z = -b.modelViewMatrix.elements[14]
  54343. }
  54344. t.sort(o);
  54345. for (var w = [], I = 0, E = t.length; I < E; I++) {
  54346. var b = t[I]
  54347. , _ = b.material;
  54348. d.uniform1f(h.alphaTest, _.alphaTest),
  54349. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  54350. b.matrixWorld.decompose(f, g, m),
  54351. w[0] = m.x,
  54352. w[1] = m.y;
  54353. var T = 0;
  54354. r.fog && _.fog && (T = y),
  54355. A !== T && (d.uniform1i(h.fogType, T),
  54356. A = T),
  54357. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  54358. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  54359. d.uniform2f(h.uvScale, 1, 1)),
  54360. d.uniform1f(h.opacity, _.opacity),
  54361. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  54362. d.uniform1f(h.rotation, _.rotation),
  54363. d.uniform2fv(h.scale, w),
  54364. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  54365. p.setDepthTest(_.depthTest),
  54366. p.setDepthWrite(_.depthWrite),
  54367. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  54368. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  54369. }
  54370. p.enable(d.CULL_FACE),
  54371. e.resetGLState()
  54372. }
  54373. }
  54374. }
  54375. ,
  54376. Object.defineProperties(n.Box2.prototype, {
  54377. empty: {
  54378. value: function() {
  54379. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  54380. this.isEmpty()
  54381. }
  54382. },
  54383. isIntersectionBox: {
  54384. value: function(e) {
  54385. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54386. this.intersectsBox(e)
  54387. }
  54388. }
  54389. }),
  54390. Object.defineProperties(n.Box3.prototype, {
  54391. empty: {
  54392. value: function() {
  54393. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  54394. this.isEmpty()
  54395. }
  54396. },
  54397. isIntersectionBox: {
  54398. value: function(e) {
  54399. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54400. this.intersectsBox(e)
  54401. }
  54402. },
  54403. isIntersectionSphere: {
  54404. value: function(e) {
  54405. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54406. this.intersectsSphere(e)
  54407. }
  54408. }
  54409. }),
  54410. Object.defineProperties(n.Matrix3.prototype, {
  54411. multiplyVector3: {
  54412. value: function(e) {
  54413. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  54414. e.applyMatrix3(this)
  54415. }
  54416. },
  54417. multiplyVector3Array: {
  54418. value: function(e) {
  54419. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54420. this.applyToVector3Array(e)
  54421. }
  54422. }
  54423. }),
  54424. Object.defineProperties(n.Matrix4.prototype, {
  54425. extractPosition: {
  54426. value: function(e) {
  54427. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  54428. this.copyPosition(e)
  54429. }
  54430. },
  54431. setRotationFromQuaternion: {
  54432. value: function(e) {
  54433. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  54434. this.makeRotationFromQuaternion(e)
  54435. }
  54436. },
  54437. multiplyVector3: {
  54438. value: function(e) {
  54439. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  54440. e.applyProjection(this)
  54441. }
  54442. },
  54443. multiplyVector4: {
  54444. value: function(e) {
  54445. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54446. e.applyMatrix4(this)
  54447. }
  54448. },
  54449. multiplyVector3Array: {
  54450. value: function(e) {
  54451. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  54452. this.applyToVector3Array(e)
  54453. }
  54454. },
  54455. rotateAxis: {
  54456. value: function(e) {
  54457. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  54458. e.transformDirection(this)
  54459. }
  54460. },
  54461. crossVector: {
  54462. value: function(e) {
  54463. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  54464. e.applyMatrix4(this)
  54465. }
  54466. },
  54467. translate: {
  54468. value: function(e) {
  54469. console.error("THREE.Matrix4: .translate() has been removed.")
  54470. }
  54471. },
  54472. rotateX: {
  54473. value: function(e) {
  54474. console.error("THREE.Matrix4: .rotateX() has been removed.")
  54475. }
  54476. },
  54477. rotateY: {
  54478. value: function(e) {
  54479. console.error("THREE.Matrix4: .rotateY() has been removed.")
  54480. }
  54481. },
  54482. rotateZ: {
  54483. value: function(e) {
  54484. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  54485. }
  54486. },
  54487. rotateByAxis: {
  54488. value: function(e, t) {
  54489. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  54490. }
  54491. }
  54492. }),
  54493. Object.defineProperties(n.Plane.prototype, {
  54494. isIntersectionLine: {
  54495. value: function(e) {
  54496. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  54497. this.intersectsLine(e)
  54498. }
  54499. }
  54500. }),
  54501. Object.defineProperties(n.Quaternion.prototype, {
  54502. multiplyVector3: {
  54503. value: function(e) {
  54504. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  54505. e.applyQuaternion(this)
  54506. }
  54507. }
  54508. }),
  54509. Object.defineProperties(n.Ray.prototype, {
  54510. isIntersectionBox: {
  54511. value: function(e) {
  54512. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  54513. this.intersectsBox(e)
  54514. }
  54515. },
  54516. isIntersectionPlane: {
  54517. value: function(e) {
  54518. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  54519. this.intersectsPlane(e)
  54520. }
  54521. },
  54522. isIntersectionSphere: {
  54523. value: function(e) {
  54524. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  54525. this.intersectsSphere(e)
  54526. }
  54527. }
  54528. }),
  54529. Object.defineProperties(n.Vector3.prototype, {
  54530. setEulerFromRotationMatrix: {
  54531. value: function() {
  54532. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  54533. }
  54534. },
  54535. setEulerFromQuaternion: {
  54536. value: function() {
  54537. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  54538. }
  54539. },
  54540. getPositionFromMatrix: {
  54541. value: function(e) {
  54542. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  54543. this.setFromMatrixPosition(e)
  54544. }
  54545. },
  54546. getScaleFromMatrix: {
  54547. value: function(e) {
  54548. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  54549. this.setFromMatrixScale(e)
  54550. }
  54551. },
  54552. getColumnFromMatrix: {
  54553. value: function(e, t) {
  54554. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  54555. this.setFromMatrixColumn(e, t)
  54556. }
  54557. }
  54558. }),
  54559. n.Face4 = function(e, t, i, r, o, a, s) {
  54560. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  54561. new n.Face3(e,t,i,o,a,s)
  54562. }
  54563. ,
  54564. n.Vertex = function(e, t, i) {
  54565. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  54566. new n.Vector3(e,t,i)
  54567. }
  54568. ,
  54569. Object.defineProperties(n.Object3D.prototype, {
  54570. eulerOrder: {
  54571. get: function() {
  54572. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54573. this.rotation.order
  54574. },
  54575. set: function(e) {
  54576. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  54577. this.rotation.order = e
  54578. }
  54579. },
  54580. getChildByName: {
  54581. value: function(e) {
  54582. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  54583. this.getObjectByName(e)
  54584. }
  54585. },
  54586. renderDepth: {
  54587. set: function(e) {
  54588. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  54589. }
  54590. },
  54591. translate: {
  54592. value: function(e, t) {
  54593. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  54594. this.translateOnAxis(t, e)
  54595. }
  54596. },
  54597. useQuaternion: {
  54598. get: function() {
  54599. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54600. },
  54601. set: function(e) {
  54602. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  54603. }
  54604. }
  54605. }),
  54606. Object.defineProperties(n, {
  54607. PointCloud: {
  54608. value: function(e, t) {
  54609. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  54610. new n.Points(e,t)
  54611. }
  54612. },
  54613. ParticleSystem: {
  54614. value: function(e, t) {
  54615. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  54616. new n.Points(e,t)
  54617. }
  54618. }
  54619. }),
  54620. Object.defineProperties(n.Light.prototype, {
  54621. onlyShadow: {
  54622. set: function(e) {
  54623. console.warn("THREE.Light: .onlyShadow has been removed.")
  54624. }
  54625. },
  54626. shadowCameraFov: {
  54627. set: function(e) {
  54628. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  54629. this.shadow.camera.fov = e
  54630. }
  54631. },
  54632. shadowCameraLeft: {
  54633. set: function(e) {
  54634. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  54635. this.shadow.camera.left = e
  54636. }
  54637. },
  54638. shadowCameraRight: {
  54639. set: function(e) {
  54640. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  54641. this.shadow.camera.right = e
  54642. }
  54643. },
  54644. shadowCameraTop: {
  54645. set: function(e) {
  54646. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  54647. this.shadow.camera.top = e
  54648. }
  54649. },
  54650. shadowCameraBottom: {
  54651. set: function(e) {
  54652. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  54653. this.shadow.camera.bottom = e
  54654. }
  54655. },
  54656. shadowCameraNear: {
  54657. set: function(e) {
  54658. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  54659. this.shadow.camera.near = e
  54660. }
  54661. },
  54662. shadowCameraFar: {
  54663. set: function(e) {
  54664. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  54665. this.shadow.camera.far = e
  54666. }
  54667. },
  54668. shadowCameraVisible: {
  54669. set: function(e) {
  54670. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  54671. }
  54672. },
  54673. shadowBias: {
  54674. set: function(e) {
  54675. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  54676. this.shadow.bias = e
  54677. }
  54678. },
  54679. shadowDarkness: {
  54680. set: function(e) {
  54681. console.warn("THREE.Light: .shadowDarkness has been removed.")
  54682. }
  54683. },
  54684. shadowMapWidth: {
  54685. set: function(e) {
  54686. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  54687. this.shadow.mapSize.width = e
  54688. }
  54689. },
  54690. shadowMapHeight: {
  54691. set: function(e) {
  54692. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  54693. this.shadow.mapSize.height = e
  54694. }
  54695. }
  54696. }),
  54697. Object.defineProperties(n.BufferAttribute.prototype, {
  54698. length: {
  54699. get: function() {
  54700. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  54701. this.array.length
  54702. }
  54703. }
  54704. }),
  54705. Object.defineProperties(n.BufferGeometry.prototype, {
  54706. drawcalls: {
  54707. get: function() {
  54708. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  54709. this.groups
  54710. }
  54711. },
  54712. offsets: {
  54713. get: function() {
  54714. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  54715. this.groups
  54716. }
  54717. },
  54718. addIndex: {
  54719. value: function(e) {
  54720. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  54721. this.setIndex(e)
  54722. }
  54723. },
  54724. addDrawCall: {
  54725. value: function(e, t, i) {
  54726. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  54727. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  54728. this.addGroup(e, t)
  54729. }
  54730. },
  54731. clearDrawCalls: {
  54732. value: function() {
  54733. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  54734. this.clearGroups()
  54735. }
  54736. },
  54737. computeTangents: {
  54738. value: function() {
  54739. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  54740. }
  54741. },
  54742. computeOffsets: {
  54743. value: function() {
  54744. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  54745. }
  54746. }
  54747. }),
  54748. Object.defineProperties(n.Material.prototype, {
  54749. wrapAround: {
  54750. get: function() {
  54751. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54752. },
  54753. set: function(e) {
  54754. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  54755. }
  54756. },
  54757. wrapRGB: {
  54758. get: function() {
  54759. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  54760. new n.Color
  54761. }
  54762. }
  54763. }),
  54764. Object.defineProperties(n, {
  54765. PointCloudMaterial: {
  54766. value: function(e) {
  54767. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  54768. new n.PointsMaterial(e)
  54769. }
  54770. },
  54771. ParticleBasicMaterial: {
  54772. value: function(e) {
  54773. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  54774. new n.PointsMaterial(e)
  54775. }
  54776. },
  54777. ParticleSystemMaterial: {
  54778. value: function(e) {
  54779. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  54780. new n.PointsMaterial(e)
  54781. }
  54782. }
  54783. }),
  54784. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  54785. metal: {
  54786. get: function() {
  54787. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  54788. !1
  54789. },
  54790. set: function(e) {
  54791. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  54792. }
  54793. }
  54794. }),
  54795. Object.defineProperties(n.ShaderMaterial.prototype, {
  54796. derivatives: {
  54797. get: function() {
  54798. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54799. this.extensions.derivatives
  54800. },
  54801. set: function(e) {
  54802. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  54803. this.extensions.derivatives = e
  54804. }
  54805. }
  54806. }),
  54807. Object.defineProperties(n.WebGLRenderer.prototype, {
  54808. supportsFloatTextures: {
  54809. value: function() {
  54810. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  54811. this.extensions.get("OES_texture_float")
  54812. }
  54813. },
  54814. supportsHalfFloatTextures: {
  54815. value: function() {
  54816. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  54817. this.extensions.get("OES_texture_half_float")
  54818. }
  54819. },
  54820. supportsStandardDerivatives: {
  54821. value: function() {
  54822. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  54823. this.extensions.get("OES_standard_derivatives")
  54824. }
  54825. },
  54826. supportsCompressedTextureS3TC: {
  54827. value: function() {
  54828. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  54829. this.extensions.get("WEBGL_compressed_texture_s3tc")
  54830. }
  54831. },
  54832. supportsCompressedTexturePVRTC: {
  54833. value: function() {
  54834. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  54835. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  54836. }
  54837. },
  54838. supportsBlendMinMax: {
  54839. value: function() {
  54840. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  54841. this.extensions.get("EXT_blend_minmax")
  54842. }
  54843. },
  54844. supportsVertexTextures: {
  54845. value: function() {
  54846. return this.capabilities.vertexTextures
  54847. }
  54848. },
  54849. supportsInstancedArrays: {
  54850. value: function() {
  54851. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  54852. this.extensions.get("ANGLE_instanced_arrays")
  54853. }
  54854. },
  54855. enableScissorTest: {
  54856. value: function(e) {
  54857. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  54858. this.setScissorTest(e)
  54859. }
  54860. },
  54861. initMaterial: {
  54862. value: function() {
  54863. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  54864. }
  54865. },
  54866. addPrePlugin: {
  54867. value: function() {
  54868. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  54869. }
  54870. },
  54871. addPostPlugin: {
  54872. value: function() {
  54873. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  54874. }
  54875. },
  54876. updateShadowMap: {
  54877. value: function() {
  54878. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  54879. }
  54880. },
  54881. shadowMapEnabled: {
  54882. get: function() {
  54883. return this.shadowMap.enabled
  54884. },
  54885. set: function(e) {
  54886. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  54887. this.shadowMap.enabled = e
  54888. }
  54889. },
  54890. shadowMapType: {
  54891. get: function() {
  54892. return this.shadowMap.type
  54893. },
  54894. set: function(e) {
  54895. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  54896. this.shadowMap.type = e
  54897. }
  54898. },
  54899. shadowMapCullFace: {
  54900. get: function() {
  54901. return this.shadowMap.cullFace
  54902. },
  54903. set: function(e) {
  54904. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  54905. this.shadowMap.cullFace = e
  54906. }
  54907. }
  54908. }),
  54909. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  54910. wrapS: {
  54911. get: function() {
  54912. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54913. this.texture.wrapS
  54914. },
  54915. set: function(e) {
  54916. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  54917. this.texture.wrapS = e
  54918. }
  54919. },
  54920. wrapT: {
  54921. get: function() {
  54922. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54923. this.texture.wrapT
  54924. },
  54925. set: function(e) {
  54926. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  54927. this.texture.wrapT = e
  54928. }
  54929. },
  54930. magFilter: {
  54931. get: function() {
  54932. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54933. this.texture.magFilter
  54934. },
  54935. set: function(e) {
  54936. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  54937. this.texture.magFilter = e
  54938. }
  54939. },
  54940. minFilter: {
  54941. get: function() {
  54942. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54943. this.texture.minFilter
  54944. },
  54945. set: function(e) {
  54946. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  54947. this.texture.minFilter = e
  54948. }
  54949. },
  54950. anisotropy: {
  54951. get: function() {
  54952. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54953. this.texture.anisotropy
  54954. },
  54955. set: function(e) {
  54956. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  54957. this.texture.anisotropy = e
  54958. }
  54959. },
  54960. offset: {
  54961. get: function() {
  54962. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54963. this.texture.offset
  54964. },
  54965. set: function(e) {
  54966. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  54967. this.texture.offset = e
  54968. }
  54969. },
  54970. repeat: {
  54971. get: function() {
  54972. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54973. this.texture.repeat
  54974. },
  54975. set: function(e) {
  54976. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  54977. this.texture.repeat = e
  54978. }
  54979. },
  54980. format: {
  54981. get: function() {
  54982. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54983. this.texture.format
  54984. },
  54985. set: function(e) {
  54986. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  54987. this.texture.format = e
  54988. }
  54989. },
  54990. type: {
  54991. get: function() {
  54992. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54993. this.texture.type
  54994. },
  54995. set: function(e) {
  54996. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  54997. this.texture.type = e
  54998. }
  54999. },
  55000. generateMipmaps: {
  55001. get: function() {
  55002. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55003. this.texture.generateMipmaps
  55004. },
  55005. set: function(e) {
  55006. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  55007. this.texture.generateMipmaps = e
  55008. }
  55009. }
  55010. }),
  55011. n.GeometryUtils = {
  55012. merge: function(e, t, i) {
  55013. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  55014. var r;
  55015. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  55016. r = t.matrix,
  55017. t = t.geometry),
  55018. e.merge(t, r, i)
  55019. },
  55020. center: function(e) {
  55021. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  55022. e.center()
  55023. }
  55024. },
  55025. n.ImageUtils = {
  55026. crossOrigin: void 0,
  55027. loadTexture: function(e, t, i, r) {
  55028. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  55029. var o = new n.TextureLoader;
  55030. o.setCrossOrigin(this.crossOrigin);
  55031. var a = o.load(e, i, void 0, r);
  55032. return t && (a.mapping = t),
  55033. a
  55034. },
  55035. loadTextureCube: function(e, t, i, r) {
  55036. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  55037. var o = new n.CubeTextureLoader;
  55038. o.setCrossOrigin(this.crossOrigin);
  55039. var a = o.load(e, i, void 0, r);
  55040. return t && (a.mapping = t),
  55041. a
  55042. },
  55043. loadCompressedTexture: function() {
  55044. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  55045. },
  55046. loadCompressedTextureCube: function() {
  55047. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  55048. }
  55049. },
  55050. n.Projector = function() {
  55051. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  55052. this.projectVector = function(e, t) {
  55053. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  55054. e.project(t)
  55055. }
  55056. ,
  55057. this.unprojectVector = function(e, t) {
  55058. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  55059. e.unproject(t)
  55060. }
  55061. ,
  55062. this.pickingRay = function(e, t) {
  55063. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  55064. }
  55065. }
  55066. ,
  55067. n.CanvasRenderer = function() {
  55068. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  55069. this.domElement = document.createElement("canvas"),
  55070. this.clear = function() {}
  55071. ,
  55072. this.render = function() {}
  55073. ,
  55074. this.setClearColor = function() {}
  55075. ,
  55076. this.setSize = function() {}
  55077. }
  55078. ,
  55079. n.MeshFaceMaterial = n.MultiMaterial,
  55080. n.CurveUtils = {
  55081. tangentQuadraticBezier: function(e, t, i, n) {
  55082. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  55083. },
  55084. tangentCubicBezier: function(e, t, i, n, r) {
  55085. 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
  55086. },
  55087. tangentSpline: function(e, t, i, n, r) {
  55088. var o = 6 * e * e - 6 * e
  55089. , a = 3 * e * e - 4 * e + 1
  55090. , s = -6 * e * e + 6 * e
  55091. , l = 3 * e * e - 2 * e;
  55092. return o + a + s + l
  55093. },
  55094. interpolate: function(e, t, i, n, r) {
  55095. var o = .5 * (i - e)
  55096. , a = .5 * (n - t)
  55097. , s = r * r
  55098. , l = r * s;
  55099. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  55100. }
  55101. },
  55102. n.SceneUtils = {
  55103. createMultiMaterialObject: function(e, t) {
  55104. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  55105. i.add(new n.Mesh(e,t[r]));
  55106. return i
  55107. },
  55108. detach: function(e, t, i) {
  55109. e.applyMatrix(t.matrixWorld),
  55110. t.remove(e),
  55111. i.add(e)
  55112. },
  55113. attach: function(e, t, i) {
  55114. var r = new n.Matrix4;
  55115. r.getInverse(i.matrixWorld),
  55116. e.applyMatrix(r),
  55117. t.remove(e),
  55118. i.add(e)
  55119. }
  55120. },
  55121. n.ShapeUtils = {
  55122. area: function(e) {
  55123. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  55124. i += e[n].x * e[r].y - e[r].x * e[n].y;
  55125. return .5 * i
  55126. },
  55127. triangulate: function() {
  55128. function e(e, t, i, n, r, o) {
  55129. var a, s, l, c, h, u, d, p, f;
  55130. if (s = e[o[t]].x,
  55131. l = e[o[t]].y,
  55132. c = e[o[i]].x,
  55133. h = e[o[i]].y,
  55134. u = e[o[n]].x,
  55135. d = e[o[n]].y,
  55136. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  55137. return !1;
  55138. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  55139. for (g = u - c,
  55140. m = d - h,
  55141. v = s - u,
  55142. A = l - d,
  55143. y = c - s,
  55144. C = h - l,
  55145. a = 0; a < r; a++)
  55146. if (p = e[o[a]].x,
  55147. f = e[o[a]].y,
  55148. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  55149. E = f - l,
  55150. b = p - c,
  55151. w = f - h,
  55152. _ = p - u,
  55153. T = f - d,
  55154. M = g * w - m * b,
  55155. x = y * E - C * I,
  55156. S = v * T - A * _,
  55157. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  55158. return !1;
  55159. return !0
  55160. }
  55161. return function(t, i) {
  55162. var r = t.length;
  55163. if (r < 3)
  55164. return null;
  55165. var o, a, s, l = [], c = [], h = [];
  55166. if (n.ShapeUtils.area(t) > 0)
  55167. for (a = 0; a < r; a++)
  55168. c[a] = a;
  55169. else
  55170. for (a = 0; a < r; a++)
  55171. c[a] = r - 1 - a;
  55172. var u = r
  55173. , d = 2 * u;
  55174. for (a = u - 1; u > 2; ) {
  55175. if (d-- <= 0)
  55176. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  55177. i ? h : l;
  55178. if (o = a,
  55179. u <= o && (o = 0),
  55180. a = o + 1,
  55181. u <= a && (a = 0),
  55182. s = a + 1,
  55183. u <= s && (s = 0),
  55184. e(t, o, a, s, u, c)) {
  55185. var p, f, g, m, v;
  55186. for (p = c[o],
  55187. f = c[a],
  55188. g = c[s],
  55189. l.push([t[p], t[f], t[g]]),
  55190. h.push([c[o], c[a], c[s]]),
  55191. m = a,
  55192. v = a + 1; v < u; m++,
  55193. v++)
  55194. c[m] = c[v];
  55195. u--,
  55196. d = 2 * u
  55197. }
  55198. }
  55199. return i ? h : l
  55200. }
  55201. }(),
  55202. triangulateShape: function(e, t) {
  55203. function i(e, t, i) {
  55204. 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
  55205. }
  55206. function r(e, t, n, r, o) {
  55207. var a = t.x - e.x
  55208. , s = t.y - e.y
  55209. , l = r.x - n.x
  55210. , c = r.y - n.y
  55211. , h = e.x - n.x
  55212. , u = e.y - n.y
  55213. , d = s * l - a * c
  55214. , p = s * h - a * u;
  55215. if (Math.abs(d) > Number.EPSILON) {
  55216. var f;
  55217. if (d > 0) {
  55218. if (p < 0 || p > d)
  55219. return [];
  55220. if (f = c * h - l * u,
  55221. f < 0 || f > d)
  55222. return []
  55223. } else {
  55224. if (p > 0 || p < d)
  55225. return [];
  55226. if (f = c * h - l * u,
  55227. f > 0 || f < d)
  55228. return []
  55229. }
  55230. if (0 === f)
  55231. return !o || 0 !== p && p !== d ? [e] : [];
  55232. if (f === d)
  55233. return !o || 0 !== p && p !== d ? [t] : [];
  55234. if (0 === p)
  55235. return [n];
  55236. if (p === d)
  55237. return [r];
  55238. var g = f / d;
  55239. return [{
  55240. x: e.x + g * a,
  55241. y: e.y + g * s
  55242. }]
  55243. }
  55244. if (0 !== p || c * h !== l * u)
  55245. return [];
  55246. var m = 0 === a && 0 === s
  55247. , v = 0 === l && 0 === c;
  55248. if (m && v)
  55249. return e.x !== n.x || e.y !== n.y ? [] : [e];
  55250. if (m)
  55251. return i(n, r, e) ? [e] : [];
  55252. if (v)
  55253. return i(e, t, n) ? [n] : [];
  55254. var A, y, C, I, E, b, w, _;
  55255. return 0 !== a ? (e.x < t.x ? (A = e,
  55256. C = e.x,
  55257. y = t,
  55258. I = t.x) : (A = t,
  55259. C = t.x,
  55260. y = e,
  55261. I = e.x),
  55262. n.x < r.x ? (E = n,
  55263. w = n.x,
  55264. b = r,
  55265. _ = r.x) : (E = r,
  55266. w = r.x,
  55267. b = n,
  55268. _ = n.x)) : (e.y < t.y ? (A = e,
  55269. C = e.y,
  55270. y = t,
  55271. I = t.y) : (A = t,
  55272. C = t.y,
  55273. y = e,
  55274. I = e.y),
  55275. n.y < r.y ? (E = n,
  55276. w = n.y,
  55277. b = r,
  55278. _ = r.y) : (E = r,
  55279. w = r.y,
  55280. b = n,
  55281. _ = n.y)),
  55282. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  55283. }
  55284. function o(e, t, i, n) {
  55285. var r = t.x - e.x
  55286. , o = t.y - e.y
  55287. , a = i.x - e.x
  55288. , s = i.y - e.y
  55289. , l = n.x - e.x
  55290. , c = n.y - e.y
  55291. , h = r * s - o * a
  55292. , u = r * c - o * l;
  55293. if (Math.abs(h) > Number.EPSILON) {
  55294. var d = l * s - c * a;
  55295. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  55296. }
  55297. return u > 0
  55298. }
  55299. function a(e, t) {
  55300. function i(e, t) {
  55301. var i = A.length - 1
  55302. , n = e - 1;
  55303. n < 0 && (n = i);
  55304. var r = e + 1;
  55305. r > i && (r = 0);
  55306. var a = o(A[e], A[n], A[r], s[t]);
  55307. if (!a)
  55308. return !1;
  55309. var l = s.length - 1
  55310. , c = t - 1;
  55311. c < 0 && (c = l);
  55312. var h = t + 1;
  55313. return h > l && (h = 0),
  55314. a = o(s[t], s[c], s[h], A[e]),
  55315. !!a
  55316. }
  55317. function n(e, t) {
  55318. var i, n, o;
  55319. for (i = 0; i < A.length; i++)
  55320. if (n = i + 1,
  55321. n %= A.length,
  55322. o = r(e, t, A[i], A[n], !0),
  55323. o.length > 0)
  55324. return !0;
  55325. return !1
  55326. }
  55327. function a(e, i) {
  55328. var n, o, a, s, l;
  55329. for (n = 0; n < y.length; n++)
  55330. for (o = t[y[n]],
  55331. a = 0; a < o.length; a++)
  55332. if (s = a + 1,
  55333. s %= o.length,
  55334. l = r(e, i, o[a], o[s], !0),
  55335. l.length > 0)
  55336. return !0;
  55337. return !1
  55338. }
  55339. 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++)
  55340. y.push(I);
  55341. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  55342. if (w--,
  55343. w < 0) {
  55344. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  55345. break
  55346. }
  55347. for (c = b; c < A.length; c++) {
  55348. h = A[c],
  55349. l = -1;
  55350. for (var I = 0; I < y.length; I++)
  55351. if (d = y[I],
  55352. p = h.x + ":" + h.y + ":" + d,
  55353. void 0 === C[p]) {
  55354. s = t[d];
  55355. for (var _ = 0; _ < s.length; _++)
  55356. if (u = s[_],
  55357. i(c, _) && !n(h, u) && !a(h, u)) {
  55358. l = _,
  55359. y.splice(I, 1),
  55360. f = A.slice(0, c + 1),
  55361. g = A.slice(c),
  55362. m = s.slice(l),
  55363. v = s.slice(0, l + 1),
  55364. A = f.concat(m).concat(v).concat(g),
  55365. b = c;
  55366. break
  55367. }
  55368. if (l >= 0)
  55369. break;
  55370. C[p] = !0
  55371. }
  55372. if (l >= 0)
  55373. break
  55374. }
  55375. }
  55376. return A
  55377. }
  55378. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  55379. Array.prototype.push.apply(f, t[g]);
  55380. for (s = 0,
  55381. l = f.length; s < l; s++)
  55382. u = f[s].x + ":" + f[s].y,
  55383. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  55384. p[u] = s;
  55385. var v = a(e, t)
  55386. , A = n.ShapeUtils.triangulate(v, !1);
  55387. for (s = 0,
  55388. l = A.length; s < l; s++)
  55389. for (h = A[s],
  55390. c = 0; c < 3; c++)
  55391. u = h[c].x + ":" + h[c].y,
  55392. d = p[u],
  55393. void 0 !== d && (h[c] = d);
  55394. return A.concat()
  55395. },
  55396. isClockWise: function(e) {
  55397. return n.ShapeUtils.area(e) < 0
  55398. },
  55399. b2: function() {
  55400. function e(e, t) {
  55401. var i = 1 - e;
  55402. return i * i * t
  55403. }
  55404. function t(e, t) {
  55405. return 2 * (1 - e) * e * t
  55406. }
  55407. function i(e, t) {
  55408. return e * e * t
  55409. }
  55410. return function(n, r, o, a) {
  55411. return e(n, r) + t(n, o) + i(n, a)
  55412. }
  55413. }(),
  55414. b3: function() {
  55415. function e(e, t) {
  55416. var i = 1 - e;
  55417. return i * i * i * t
  55418. }
  55419. function t(e, t) {
  55420. var i = 1 - e;
  55421. return 3 * i * i * e * t
  55422. }
  55423. function i(e, t) {
  55424. var i = 1 - e;
  55425. return 3 * i * e * e * t
  55426. }
  55427. function n(e, t) {
  55428. return e * e * e * t
  55429. }
  55430. return function(r, o, a, s, l) {
  55431. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  55432. }
  55433. }()
  55434. },
  55435. n.Curve = function() {}
  55436. ,
  55437. n.Curve.prototype = {
  55438. constructor: n.Curve,
  55439. getPoint: function(e) {
  55440. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  55441. null
  55442. },
  55443. getPointAt: function(e) {
  55444. var t = this.getUtoTmapping(e);
  55445. return this.getPoint(t)
  55446. },
  55447. getPoints: function(e) {
  55448. e || (e = 5);
  55449. var t, i = [];
  55450. for (t = 0; t <= e; t++)
  55451. i.push(this.getPoint(t / e));
  55452. return i
  55453. },
  55454. getSpacedPoints: function(e) {
  55455. e || (e = 5);
  55456. var t, i = [];
  55457. for (t = 0; t <= e; t++)
  55458. i.push(this.getPointAt(t / e));
  55459. return i
  55460. },
  55461. getLength: function() {
  55462. var e = this.getLengths();
  55463. return e[e.length - 1]
  55464. },
  55465. getLengths: function(e) {
  55466. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  55467. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  55468. return this.cacheArcLengths;
  55469. this.needsUpdate = !1;
  55470. var t, i, n = [], r = this.getPoint(0), o = 0;
  55471. for (n.push(0),
  55472. i = 1; i <= e; i++)
  55473. t = this.getPoint(i / e),
  55474. o += t.distanceTo(r),
  55475. n.push(o),
  55476. r = t;
  55477. return this.cacheArcLengths = n,
  55478. n
  55479. },
  55480. updateArcLengths: function() {
  55481. this.needsUpdate = !0,
  55482. this.getLengths()
  55483. },
  55484. getUtoTmapping: function(e, t) {
  55485. var i, n = this.getLengths(), r = 0, o = n.length;
  55486. i = t ? t : e * n[o - 1];
  55487. for (var a, s = 0, l = o - 1; s <= l; )
  55488. if (r = Math.floor(s + (l - s) / 2),
  55489. a = n[r] - i,
  55490. a < 0)
  55491. s = r + 1;
  55492. else {
  55493. if (!(a > 0)) {
  55494. l = r;
  55495. break
  55496. }
  55497. l = r - 1
  55498. }
  55499. if (r = l,
  55500. n[r] === i) {
  55501. var c = r / (o - 1);
  55502. return c
  55503. }
  55504. var h = n[r]
  55505. , u = n[r + 1]
  55506. , d = u - h
  55507. , p = (i - h) / d
  55508. , c = (r + p) / (o - 1);
  55509. return c
  55510. },
  55511. getTangent: function(e) {
  55512. var t = 1e-4
  55513. , i = e - t
  55514. , n = e + t;
  55515. i < 0 && (i = 0),
  55516. n > 1 && (n = 1);
  55517. var r = this.getPoint(i)
  55518. , o = this.getPoint(n)
  55519. , a = o.clone().sub(r);
  55520. return a.normalize()
  55521. },
  55522. getTangentAt: function(e) {
  55523. var t = this.getUtoTmapping(e);
  55524. return this.getTangent(t)
  55525. }
  55526. },
  55527. n.Curve.create = function(e, t) {
  55528. return e.prototype = Object.create(n.Curve.prototype),
  55529. e.prototype.constructor = e,
  55530. e.prototype.getPoint = t,
  55531. e
  55532. }
  55533. ,
  55534. n.CurvePath = function() {
  55535. this.curves = [],
  55536. this.autoClose = !1
  55537. }
  55538. ,
  55539. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  55540. n.CurvePath.prototype.constructor = n.CurvePath,
  55541. n.CurvePath.prototype.add = function(e) {
  55542. this.curves.push(e)
  55543. }
  55544. ,
  55545. n.CurvePath.prototype.closePath = function() {
  55546. var e = this.curves[0].getPoint(0)
  55547. , t = this.curves[this.curves.length - 1].getPoint(1);
  55548. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  55549. }
  55550. ,
  55551. n.CurvePath.prototype.getPoint = function(e) {
  55552. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  55553. if (i[n] >= t) {
  55554. var r = i[n] - t
  55555. , o = this.curves[n]
  55556. , a = 1 - r / o.getLength();
  55557. return o.getPointAt(a)
  55558. }
  55559. n++
  55560. }
  55561. return null
  55562. }
  55563. ,
  55564. n.CurvePath.prototype.getLength = function() {
  55565. var e = this.getCurveLengths();
  55566. return e[e.length - 1]
  55567. }
  55568. ,
  55569. n.CurvePath.prototype.getCurveLengths = function() {
  55570. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  55571. return this.cacheLengths;
  55572. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  55573. t += this.curves[i].getLength(),
  55574. e.push(t);
  55575. return this.cacheLengths = e,
  55576. e
  55577. }
  55578. ,
  55579. n.CurvePath.prototype.createPointsGeometry = function(e) {
  55580. var t = this.getPoints(e);
  55581. return this.createGeometry(t)
  55582. }
  55583. ,
  55584. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  55585. var t = this.getSpacedPoints(e);
  55586. return this.createGeometry(t)
  55587. }
  55588. ,
  55589. n.CurvePath.prototype.createGeometry = function(e) {
  55590. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  55591. var o = e[i];
  55592. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  55593. }
  55594. return t
  55595. }
  55596. ,
  55597. n.Font = function(e) {
  55598. this.data = e
  55599. }
  55600. ,
  55601. n.Font.prototype = {
  55602. constructor: n.Font,
  55603. generateShapes: function(e, t, i) {
  55604. function r(e) {
  55605. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  55606. var c = o(i[l], n, r);
  55607. r += c.offset,
  55608. s.push(c.path)
  55609. }
  55610. return s
  55611. }
  55612. function o(e, t, r) {
  55613. var o = a.glyphs[e] || a.glyphs["?"];
  55614. if (o) {
  55615. 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;
  55616. if (o.o)
  55617. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  55618. var _ = E[b++];
  55619. switch (_) {
  55620. case "m":
  55621. s = E[b++] * t + r,
  55622. l = E[b++] * t,
  55623. A.moveTo(s, l);
  55624. break;
  55625. case "l":
  55626. s = E[b++] * t + r,
  55627. l = E[b++] * t,
  55628. A.lineTo(s, l);
  55629. break;
  55630. case "q":
  55631. if (c = E[b++] * t + r,
  55632. h = E[b++] * t,
  55633. p = E[b++] * t + r,
  55634. f = E[b++] * t,
  55635. A.quadraticCurveTo(p, f, c, h),
  55636. v = y[y.length - 1]) {
  55637. u = v.x,
  55638. d = v.y;
  55639. for (var T = 1; T <= i; T++) {
  55640. var x = T / i;
  55641. C(x, u, p, c),
  55642. C(x, d, f, h)
  55643. }
  55644. }
  55645. break;
  55646. case "b":
  55647. if (c = E[b++] * t + r,
  55648. h = E[b++] * t,
  55649. p = E[b++] * t + r,
  55650. f = E[b++] * t,
  55651. g = E[b++] * t + r,
  55652. m = E[b++] * t,
  55653. A.bezierCurveTo(p, f, g, m, c, h),
  55654. v = y[y.length - 1]) {
  55655. u = v.x,
  55656. d = v.y;
  55657. for (var T = 1; T <= i; T++) {
  55658. var x = T / i;
  55659. I(x, u, p, g, c),
  55660. I(x, d, f, m, h)
  55661. }
  55662. }
  55663. }
  55664. }
  55665. return {
  55666. offset: o.ha * t,
  55667. path: A
  55668. }
  55669. }
  55670. }
  55671. void 0 === t && (t = 100),
  55672. void 0 === i && (i = 4);
  55673. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  55674. Array.prototype.push.apply(l, s[c].toShapes());
  55675. return l
  55676. }
  55677. },
  55678. n.Path = function(e) {
  55679. n.CurvePath.call(this),
  55680. this.actions = [],
  55681. e && this.fromPoints(e)
  55682. }
  55683. ,
  55684. n.Path.prototype = Object.create(n.CurvePath.prototype),
  55685. n.Path.prototype.constructor = n.Path,
  55686. n.Path.prototype.fromPoints = function(e) {
  55687. this.moveTo(e[0].x, e[0].y);
  55688. for (var t = 1, i = e.length; t < i; t++)
  55689. this.lineTo(e[t].x, e[t].y)
  55690. }
  55691. ,
  55692. n.Path.prototype.moveTo = function(e, t) {
  55693. this.actions.push({
  55694. action: "moveTo",
  55695. args: [e, t]
  55696. })
  55697. }
  55698. ,
  55699. n.Path.prototype.lineTo = function(e, t) {
  55700. var i = this.actions[this.actions.length - 1].args
  55701. , r = i[i.length - 2]
  55702. , o = i[i.length - 1]
  55703. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  55704. this.curves.push(a),
  55705. this.actions.push({
  55706. action: "lineTo",
  55707. args: [e, t]
  55708. })
  55709. }
  55710. ,
  55711. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  55712. var o = this.actions[this.actions.length - 1].args
  55713. , a = o[o.length - 2]
  55714. , s = o[o.length - 1]
  55715. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  55716. this.curves.push(l),
  55717. this.actions.push({
  55718. action: "quadraticCurveTo",
  55719. args: [e, t, i, r]
  55720. })
  55721. }
  55722. ,
  55723. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  55724. var s = this.actions[this.actions.length - 1].args
  55725. , l = s[s.length - 2]
  55726. , c = s[s.length - 1]
  55727. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  55728. this.curves.push(h),
  55729. this.actions.push({
  55730. action: "bezierCurveTo",
  55731. args: [e, t, i, r, o, a]
  55732. })
  55733. }
  55734. ,
  55735. n.Path.prototype.splineThru = function(e) {
  55736. var t = Array.prototype.slice.call(arguments)
  55737. , i = this.actions[this.actions.length - 1].args
  55738. , r = i[i.length - 2]
  55739. , o = i[i.length - 1]
  55740. , a = [new n.Vector2(r,o)];
  55741. Array.prototype.push.apply(a, e);
  55742. var s = new n.SplineCurve(a);
  55743. this.curves.push(s),
  55744. this.actions.push({
  55745. action: "splineThru",
  55746. args: t
  55747. })
  55748. }
  55749. ,
  55750. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  55751. var a = this.actions[this.actions.length - 1].args
  55752. , s = a[a.length - 2]
  55753. , l = a[a.length - 1];
  55754. this.absarc(e + s, t + l, i, n, r, o)
  55755. }
  55756. ,
  55757. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  55758. this.absellipse(e, t, i, i, n, r, o)
  55759. }
  55760. ,
  55761. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  55762. var l = this.actions[this.actions.length - 1].args
  55763. , c = l[l.length - 2]
  55764. , h = l[l.length - 1];
  55765. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  55766. }
  55767. ,
  55768. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  55769. var c = [e, t, i, r, o, a, s, l || 0]
  55770. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  55771. this.curves.push(h);
  55772. var u = h.getPoint(1);
  55773. c.push(u.x),
  55774. c.push(u.y),
  55775. this.actions.push({
  55776. action: "ellipse",
  55777. args: c
  55778. })
  55779. }
  55780. ,
  55781. n.Path.prototype.getSpacedPoints = function(e) {
  55782. e || (e = 40);
  55783. for (var t = [], i = 0; i < e; i++)
  55784. t.push(this.getPoint(i / e));
  55785. return this.autoClose && t.push(t[0]),
  55786. t
  55787. }
  55788. ,
  55789. n.Path.prototype.getPoints = function(e) {
  55790. e = e || 12;
  55791. 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++) {
  55792. var A = this.actions[m]
  55793. , y = A.action
  55794. , C = A.args;
  55795. switch (y) {
  55796. case "moveTo":
  55797. g.push(new n.Vector2(C[0],C[1]));
  55798. break;
  55799. case "lineTo":
  55800. g.push(new n.Vector2(C[0],C[1]));
  55801. break;
  55802. case "quadraticCurveTo":
  55803. t = C[2],
  55804. i = C[3],
  55805. a = C[0],
  55806. s = C[1],
  55807. g.length > 0 ? (h = g[g.length - 1],
  55808. l = h.x,
  55809. c = h.y) : (h = this.actions[m - 1].args,
  55810. l = h[h.length - 2],
  55811. c = h[h.length - 1]);
  55812. for (var I = 1; I <= e; I++) {
  55813. var E = I / e;
  55814. u = p(E, l, a, t),
  55815. d = p(E, c, s, i),
  55816. g.push(new n.Vector2(u,d))
  55817. }
  55818. break;
  55819. case "bezierCurveTo":
  55820. t = C[4],
  55821. i = C[5],
  55822. a = C[0],
  55823. s = C[1],
  55824. r = C[2],
  55825. o = C[3],
  55826. g.length > 0 ? (h = g[g.length - 1],
  55827. l = h.x,
  55828. c = h.y) : (h = this.actions[m - 1].args,
  55829. l = h[h.length - 2],
  55830. c = h[h.length - 1]);
  55831. for (var I = 1; I <= e; I++) {
  55832. var E = I / e;
  55833. u = f(E, l, a, r, t),
  55834. d = f(E, c, s, o, i),
  55835. g.push(new n.Vector2(u,d))
  55836. }
  55837. break;
  55838. case "splineThru":
  55839. h = this.actions[m - 1].args;
  55840. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  55841. , w = [b]
  55842. , _ = e * C[0].length;
  55843. w = w.concat(C[0]);
  55844. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  55845. g.push(T.getPointAt(I / _));
  55846. break;
  55847. case "arc":
  55848. 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++) {
  55849. var E = I / N;
  55850. L || (E = 1 - E),
  55851. x = P + E * D,
  55852. u = S + R * Math.cos(x),
  55853. d = M + R * Math.sin(x),
  55854. g.push(new n.Vector2(u,d))
  55855. }
  55856. break;
  55857. case "ellipse":
  55858. 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;
  55859. 0 !== k && (B = Math.cos(k),
  55860. F = Math.sin(k));
  55861. for (var I = 1; I <= N; I++) {
  55862. var E = I / N;
  55863. if (L || (E = 1 - E),
  55864. x = P + E * D,
  55865. u = S + V * Math.cos(x),
  55866. d = M + U * Math.sin(x),
  55867. 0 !== k) {
  55868. var H = u
  55869. , G = d;
  55870. u = (H - S) * B - (G - M) * F + S,
  55871. d = (H - S) * F + (G - M) * B + M
  55872. }
  55873. g.push(new n.Vector2(u,d))
  55874. }
  55875. }
  55876. }
  55877. var z = g[g.length - 1];
  55878. 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),
  55879. this.autoClose && g.push(g[0]),
  55880. g
  55881. }
  55882. ,
  55883. n.Path.prototype.toShapes = function(e, t) {
  55884. function i(e) {
  55885. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  55886. var a = e[r]
  55887. , s = a.args
  55888. , l = a.action;
  55889. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  55890. i = new n.Path),
  55891. i[l].apply(i, s)
  55892. }
  55893. return 0 !== i.actions.length && t.push(i),
  55894. t
  55895. }
  55896. function r(e) {
  55897. for (var t = [], i = 0, r = e.length; i < r; i++) {
  55898. var o = e[i]
  55899. , a = new n.Shape;
  55900. a.actions = o.actions,
  55901. a.curves = o.curves,
  55902. t.push(a)
  55903. }
  55904. return t
  55905. }
  55906. function o(e, t) {
  55907. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  55908. var a = t[r]
  55909. , s = t[o]
  55910. , l = s.x - a.x
  55911. , c = s.y - a.y;
  55912. if (Math.abs(c) > Number.EPSILON) {
  55913. if (c < 0 && (a = t[o],
  55914. l = -l,
  55915. s = t[r],
  55916. c = -c),
  55917. e.y < a.y || e.y > s.y)
  55918. continue;
  55919. if (e.y === a.y) {
  55920. if (e.x === a.x)
  55921. return !0
  55922. } else {
  55923. var h = c * (e.x - a.x) - l * (e.y - a.y);
  55924. if (0 === h)
  55925. return !0;
  55926. if (h < 0)
  55927. continue;
  55928. n = !n
  55929. }
  55930. } else {
  55931. if (e.y !== a.y)
  55932. continue;
  55933. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  55934. return !0
  55935. }
  55936. }
  55937. return n
  55938. }
  55939. var a = n.ShapeUtils.isClockWise
  55940. , s = i(this.actions);
  55941. if (0 === s.length)
  55942. return [];
  55943. if (t === !0)
  55944. return r(s);
  55945. var l, c, h, u = [];
  55946. if (1 === s.length)
  55947. return c = s[0],
  55948. h = new n.Shape,
  55949. h.actions = c.actions,
  55950. h.curves = c.curves,
  55951. u.push(h),
  55952. u;
  55953. var d = !a(s[0].getPoints());
  55954. d = e ? !d : d;
  55955. var p, f = [], g = [], m = [], v = 0;
  55956. g[v] = void 0,
  55957. m[v] = [];
  55958. for (var A = 0, y = s.length; A < y; A++)
  55959. c = s[A],
  55960. p = c.getPoints(),
  55961. l = a(p),
  55962. l = e ? !l : l,
  55963. l ? (!d && g[v] && v++,
  55964. g[v] = {
  55965. s: new n.Shape,
  55966. p: p
  55967. },
  55968. g[v].s.actions = c.actions,
  55969. g[v].s.curves = c.curves,
  55970. d && v++,
  55971. m[v] = []) : m[v].push({
  55972. h: c,
  55973. p: p[0]
  55974. });
  55975. if (!g[0])
  55976. return r(s);
  55977. if (g.length > 1) {
  55978. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  55979. f[E] = [];
  55980. for (var E = 0, b = g.length; E < b; E++)
  55981. for (var w = m[E], _ = 0; _ < w.length; _++) {
  55982. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  55983. o(T.p, g[S].p) && (E !== S && I.push({
  55984. froms: E,
  55985. tos: S,
  55986. hole: _
  55987. }),
  55988. x ? (x = !1,
  55989. f[S].push(T)) : C = !0);
  55990. x && f[E].push(T)
  55991. }
  55992. I.length > 0 && (C || (m = f))
  55993. }
  55994. for (var M, A = 0, R = g.length; A < R; A++) {
  55995. h = g[A].s,
  55996. u.push(h),
  55997. M = m[A];
  55998. for (var P = 0, O = M.length; P < O; P++)
  55999. h.holes.push(M[P].h)
  56000. }
  56001. return u
  56002. }
  56003. ,
  56004. n.Shape = function() {
  56005. n.Path.apply(this, arguments),
  56006. this.holes = []
  56007. }
  56008. ,
  56009. n.Shape.prototype = Object.create(n.Path.prototype),
  56010. n.Shape.prototype.constructor = n.Shape,
  56011. n.Shape.prototype.extrude = function(e) {
  56012. return new n.ExtrudeGeometry(this,e)
  56013. }
  56014. ,
  56015. n.Shape.prototype.makeGeometry = function(e) {
  56016. return new n.ShapeGeometry(this,e)
  56017. }
  56018. ,
  56019. n.Shape.prototype.getPointsHoles = function(e) {
  56020. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  56021. t[i] = this.holes[i].getPoints(e);
  56022. return t
  56023. }
  56024. ,
  56025. n.Shape.prototype.extractAllPoints = function(e) {
  56026. return {
  56027. shape: this.getPoints(e),
  56028. holes: this.getPointsHoles(e)
  56029. }
  56030. }
  56031. ,
  56032. n.Shape.prototype.extractPoints = function(e) {
  56033. return this.extractAllPoints(e)
  56034. }
  56035. ,
  56036. n.LineCurve = function(e, t) {
  56037. this.v1 = e,
  56038. this.v2 = t
  56039. }
  56040. ,
  56041. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  56042. n.LineCurve.prototype.constructor = n.LineCurve,
  56043. n.LineCurve.prototype.getPoint = function(e) {
  56044. var t = this.v2.clone().sub(this.v1);
  56045. return t.multiplyScalar(e).add(this.v1),
  56046. t
  56047. }
  56048. ,
  56049. n.LineCurve.prototype.getPointAt = function(e) {
  56050. return this.getPoint(e)
  56051. }
  56052. ,
  56053. n.LineCurve.prototype.getTangent = function(e) {
  56054. var t = this.v2.clone().sub(this.v1);
  56055. return t.normalize()
  56056. }
  56057. ,
  56058. n.QuadraticBezierCurve = function(e, t, i) {
  56059. this.v0 = e,
  56060. this.v1 = t,
  56061. this.v2 = i
  56062. }
  56063. ,
  56064. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  56065. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  56066. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  56067. var t = n.ShapeUtils.b2;
  56068. 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))
  56069. }
  56070. ,
  56071. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  56072. var t = n.CurveUtils.tangentQuadraticBezier;
  56073. 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()
  56074. }
  56075. ,
  56076. n.CubicBezierCurve = function(e, t, i, n) {
  56077. this.v0 = e,
  56078. this.v1 = t,
  56079. this.v2 = i,
  56080. this.v3 = n
  56081. }
  56082. ,
  56083. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  56084. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  56085. n.CubicBezierCurve.prototype.getPoint = function(e) {
  56086. var t = n.ShapeUtils.b3;
  56087. 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))
  56088. }
  56089. ,
  56090. n.CubicBezierCurve.prototype.getTangent = function(e) {
  56091. var t = n.CurveUtils.tangentCubicBezier;
  56092. 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()
  56093. }
  56094. ,
  56095. n.SplineCurve = function(e) {
  56096. this.points = void 0 == e ? [] : e
  56097. }
  56098. ,
  56099. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  56100. n.SplineCurve.prototype.constructor = n.SplineCurve,
  56101. n.SplineCurve.prototype.getPoint = function(e) {
  56102. var t = this.points
  56103. , i = (t.length - 1) * e
  56104. , r = Math.floor(i)
  56105. , o = i - r
  56106. , a = t[0 === r ? r : r - 1]
  56107. , s = t[r]
  56108. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56109. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56110. , h = n.CurveUtils.interpolate;
  56111. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  56112. }
  56113. ,
  56114. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  56115. this.aX = e,
  56116. this.aY = t,
  56117. this.xRadius = i,
  56118. this.yRadius = n,
  56119. this.aStartAngle = r,
  56120. this.aEndAngle = o,
  56121. this.aClockwise = a,
  56122. this.aRotation = s || 0
  56123. }
  56124. ,
  56125. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  56126. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  56127. n.EllipseCurve.prototype.getPoint = function(e) {
  56128. var t = this.aEndAngle - this.aStartAngle;
  56129. t < 0 && (t += 2 * Math.PI),
  56130. t > 2 * Math.PI && (t -= 2 * Math.PI);
  56131. var i;
  56132. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  56133. var r = this.aX + this.xRadius * Math.cos(i)
  56134. , o = this.aY + this.yRadius * Math.sin(i);
  56135. if (0 !== this.aRotation) {
  56136. var a = Math.cos(this.aRotation)
  56137. , s = Math.sin(this.aRotation)
  56138. , l = r
  56139. , c = o;
  56140. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  56141. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  56142. }
  56143. return new n.Vector2(r,o)
  56144. }
  56145. ,
  56146. n.ArcCurve = function(e, t, i, r, o, a) {
  56147. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  56148. }
  56149. ,
  56150. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  56151. n.ArcCurve.prototype.constructor = n.ArcCurve,
  56152. n.LineCurve3 = n.Curve.create(function(e, t) {
  56153. this.v1 = e,
  56154. this.v2 = t
  56155. }, function(e) {
  56156. var t = new n.Vector3;
  56157. return t.subVectors(this.v2, this.v1),
  56158. t.multiplyScalar(e),
  56159. t.add(this.v1),
  56160. t
  56161. }),
  56162. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  56163. this.v0 = e,
  56164. this.v1 = t,
  56165. this.v2 = i
  56166. }, function(e) {
  56167. var t = n.ShapeUtils.b2;
  56168. 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))
  56169. }),
  56170. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  56171. this.v0 = e,
  56172. this.v1 = t,
  56173. this.v2 = i,
  56174. this.v3 = n
  56175. }, function(e) {
  56176. var t = n.ShapeUtils.b3;
  56177. 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))
  56178. }),
  56179. n.SplineCurve3 = n.Curve.create(function(e) {
  56180. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  56181. this.points = void 0 == e ? [] : e
  56182. }, function(e) {
  56183. var t = this.points
  56184. , i = (t.length - 1) * e
  56185. , r = Math.floor(i)
  56186. , o = i - r
  56187. , a = t[0 == r ? r : r - 1]
  56188. , s = t[r]
  56189. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  56190. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  56191. , h = n.CurveUtils.interpolate;
  56192. 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))
  56193. }),
  56194. n.CatmullRomCurve3 = function() {
  56195. function e() {}
  56196. var t = new n.Vector3
  56197. , i = new e
  56198. , r = new e
  56199. , o = new e;
  56200. return e.prototype.init = function(e, t, i, n) {
  56201. this.c0 = e,
  56202. this.c1 = i,
  56203. this.c2 = -3 * e + 3 * t - 2 * i - n,
  56204. this.c3 = 2 * e - 2 * t + i + n
  56205. }
  56206. ,
  56207. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  56208. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  56209. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  56210. s *= o,
  56211. l *= o,
  56212. this.init(t, i, s, l)
  56213. }
  56214. ,
  56215. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  56216. this.init(t, i, r * (i - e), r * (n - t))
  56217. }
  56218. ,
  56219. e.prototype.calc = function(e) {
  56220. var t = e * e
  56221. , i = t * e;
  56222. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  56223. }
  56224. ,
  56225. n.Curve.create(function(e) {
  56226. this.points = e || [],
  56227. this.closed = !1
  56228. }, function(e) {
  56229. var a, s, l, c, h = this.points;
  56230. c = h.length,
  56231. c < 2 && console.log("duh, you need at least 2 points"),
  56232. a = (c - (this.closed ? 0 : 1)) * e,
  56233. s = Math.floor(a),
  56234. l = a - s,
  56235. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  56236. l = 1);
  56237. var u, d, p, f;
  56238. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  56239. u = t),
  56240. d = h[s % c],
  56241. p = h[(s + 1) % c],
  56242. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  56243. f = t),
  56244. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  56245. var g = "chordal" === this.type ? .5 : .25
  56246. , m = Math.pow(u.distanceToSquared(d), g)
  56247. , v = Math.pow(d.distanceToSquared(p), g)
  56248. , A = Math.pow(p.distanceToSquared(f), g);
  56249. v < 1e-4 && (v = 1),
  56250. m < 1e-4 && (m = v),
  56251. A < 1e-4 && (A = v),
  56252. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  56253. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  56254. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  56255. } else if ("catmullrom" === this.type) {
  56256. var y = void 0 !== this.tension ? this.tension : .5;
  56257. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  56258. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  56259. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  56260. }
  56261. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  56262. return C
  56263. })
  56264. }(),
  56265. n.ClosedSplineCurve3 = function(e) {
  56266. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  56267. n.CatmullRomCurve3.call(this, e),
  56268. this.type = "catmullrom",
  56269. this.closed = !0
  56270. }
  56271. ,
  56272. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  56273. n.BoxGeometry = function(e, t, i, r, o, a) {
  56274. n.Geometry.call(this),
  56275. this.type = "BoxGeometry",
  56276. this.parameters = {
  56277. width: e,
  56278. height: t,
  56279. depth: i,
  56280. widthSegments: r,
  56281. heightSegments: o,
  56282. depthSegments: a
  56283. },
  56284. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  56285. this.mergeVertices()
  56286. }
  56287. ,
  56288. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  56289. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  56290. n.CubeGeometry = n.BoxGeometry,
  56291. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  56292. function s(e, t, i) {
  56293. var n = 0;
  56294. return n += e * t * 2,
  56295. n += e * i * 2,
  56296. n += i * t * 2,
  56297. 4 * n
  56298. }
  56299. function l(e, t, i, r, o, a, s, l, h, u, I) {
  56300. 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++)
  56301. for (var L = O * b - _, D = 0; D < x; D++) {
  56302. var N = D * E - w;
  56303. P[e] = N * r,
  56304. P[t] = L * o,
  56305. P[i] = T,
  56306. p[m] = P.x,
  56307. p[m + 1] = P.y,
  56308. p[m + 2] = P.z,
  56309. P[e] = 0,
  56310. P[t] = 0,
  56311. P[i] = l > 0 ? 1 : -1,
  56312. f[m] = P.x,
  56313. f[m + 1] = P.y,
  56314. f[m + 2] = P.z,
  56315. g[v] = D / h,
  56316. g[v + 1] = 1 - O / u,
  56317. m += 3,
  56318. v += 2,
  56319. M += 1
  56320. }
  56321. for (O = 0; O < u; O++)
  56322. for (D = 0; D < h; D++) {
  56323. var B = y + D + x * O
  56324. , F = y + D + x * (O + 1)
  56325. , V = y + (D + 1) + x * (O + 1)
  56326. , U = y + (D + 1) + x * O;
  56327. d[A] = B,
  56328. d[A + 1] = F,
  56329. d[A + 2] = U,
  56330. d[A + 3] = F,
  56331. d[A + 4] = V,
  56332. d[A + 5] = U,
  56333. A += 6,
  56334. R += 6
  56335. }
  56336. c.addGroup(C, R, I),
  56337. C += R,
  56338. y += M
  56339. }
  56340. n.BufferGeometry.call(this),
  56341. this.type = "BoxBufferGeometry",
  56342. this.parameters = {
  56343. width: e,
  56344. height: t,
  56345. depth: i,
  56346. widthSegments: r,
  56347. heightSegments: o,
  56348. depthSegments: a
  56349. };
  56350. var c = this;
  56351. r = Math.floor(r) || 1,
  56352. o = Math.floor(o) || 1,
  56353. a = Math.floor(a) || 1;
  56354. var h = s(r, o, a)
  56355. , u = h / 4 * 6
  56356. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  56357. , p = new Float32Array(3 * h)
  56358. , f = new Float32Array(3 * h)
  56359. , g = new Float32Array(2 * h)
  56360. , m = 0
  56361. , v = 0
  56362. , A = 0
  56363. , y = 0
  56364. , C = 0;
  56365. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  56366. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  56367. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  56368. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  56369. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  56370. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  56371. this.setIndex(new n.BufferAttribute(d,1)),
  56372. this.addAttribute("position", new n.BufferAttribute(p,3)),
  56373. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  56374. this.addAttribute("uv", new n.BufferAttribute(g,2))
  56375. }
  56376. ,
  56377. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56378. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  56379. n.CircleGeometry = function(e, t, i, r) {
  56380. n.Geometry.call(this),
  56381. this.type = "CircleGeometry",
  56382. this.parameters = {
  56383. radius: e,
  56384. segments: t,
  56385. thetaStart: i,
  56386. thetaLength: r
  56387. },
  56388. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  56389. }
  56390. ,
  56391. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  56392. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  56393. n.CircleBufferGeometry = function(e, t, i, r) {
  56394. n.BufferGeometry.call(this),
  56395. this.type = "CircleBufferGeometry",
  56396. this.parameters = {
  56397. radius: e,
  56398. segments: t,
  56399. thetaStart: i,
  56400. thetaLength: r
  56401. },
  56402. e = e || 50,
  56403. t = void 0 !== t ? Math.max(3, t) : 8,
  56404. i = void 0 !== i ? i : 0,
  56405. r = void 0 !== r ? r : 2 * Math.PI;
  56406. var o = t + 2
  56407. , a = new Float32Array(3 * o)
  56408. , s = new Float32Array(3 * o)
  56409. , l = new Float32Array(2 * o);
  56410. s[2] = 1,
  56411. l[0] = .5,
  56412. l[1] = .5;
  56413. for (var c = 0, h = 3, u = 2; c <= t; c++,
  56414. h += 3,
  56415. u += 2) {
  56416. var d = i + c / t * r;
  56417. a[h] = e * Math.cos(d),
  56418. a[h + 1] = e * Math.sin(d),
  56419. s[h + 2] = 1,
  56420. l[u] = (a[h] / e + 1) / 2,
  56421. l[u + 1] = (a[h + 1] / e + 1) / 2
  56422. }
  56423. for (var p = [], h = 1; h <= t; h++)
  56424. p.push(h, h + 1, 0);
  56425. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  56426. this.addAttribute("position", new n.BufferAttribute(a,3)),
  56427. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  56428. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  56429. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  56430. }
  56431. ,
  56432. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56433. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  56434. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  56435. function c() {
  56436. var e = (r + 1) * (o + 1);
  56437. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  56438. e
  56439. }
  56440. function h() {
  56441. var e = r * o * 2 * 3;
  56442. return a === !1 && (e += 2 * r * 3),
  56443. e
  56444. }
  56445. function u() {
  56446. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  56447. for (c = 0; c <= o; c++) {
  56448. var p = []
  56449. , f = c / o
  56450. , b = f * (t - e) + e;
  56451. for (a = 0; a <= r; a++) {
  56452. var w = a / r;
  56453. u.x = b * Math.sin(w * l + s),
  56454. u.y = -f * i + E,
  56455. u.z = b * Math.cos(w * l + s),
  56456. m.setXYZ(y, u.x, u.y, u.z),
  56457. h.copy(u),
  56458. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  56459. h.z = Math.cos(w * l + s)),
  56460. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  56461. v.setXYZ(y, h.x, h.y, h.z),
  56462. A.setXY(y, w, 1 - f),
  56463. p.push(y),
  56464. y++
  56465. }
  56466. I.push(p)
  56467. }
  56468. for (a = 0; a < r; a++)
  56469. for (c = 0; c < o; c++) {
  56470. var _ = I[c][a]
  56471. , T = I[c + 1][a]
  56472. , x = I[c + 1][a + 1]
  56473. , S = I[c][a + 1];
  56474. g.setX(C, _),
  56475. C++,
  56476. g.setX(C, T),
  56477. C++,
  56478. g.setX(C, S),
  56479. C++,
  56480. g.setX(C, T),
  56481. C++,
  56482. g.setX(C, x),
  56483. C++,
  56484. g.setX(C, S),
  56485. C++
  56486. }
  56487. }
  56488. function d(i) {
  56489. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  56490. for (a = y,
  56491. o = 1; o <= r; o++)
  56492. m.setXYZ(y, 0, E * p, 0),
  56493. v.setXYZ(y, 0, p, 0),
  56494. i === !0 ? (h.x = o / r,
  56495. h.y = 0) : (h.x = (o - 1) / r,
  56496. h.y = 1),
  56497. A.setXY(y, h.x, h.y),
  56498. y++;
  56499. for (c = y,
  56500. o = 0; o <= r; o++) {
  56501. var f = o / r;
  56502. u.x = d * Math.sin(f * l + s),
  56503. u.y = E * p,
  56504. u.z = d * Math.cos(f * l + s),
  56505. m.setXYZ(y, u.x, u.y, u.z),
  56506. v.setXYZ(y, 0, p, 0),
  56507. A.setXY(y, f, i === !0 ? 1 : 0),
  56508. y++
  56509. }
  56510. for (o = 0; o < r; o++) {
  56511. var I = a + o
  56512. , b = c + o;
  56513. i === !0 ? (g.setX(C, b),
  56514. C++,
  56515. g.setX(C, b + 1),
  56516. C++,
  56517. g.setX(C, I),
  56518. C++) : (g.setX(C, b + 1),
  56519. C++,
  56520. g.setX(C, b),
  56521. C++,
  56522. g.setX(C, I),
  56523. C++)
  56524. }
  56525. }
  56526. n.BufferGeometry.call(this),
  56527. this.type = "CylinderBufferGeometry",
  56528. this.parameters = {
  56529. radiusTop: e,
  56530. radiusBottom: t,
  56531. height: i,
  56532. radialSegments: r,
  56533. heightSegments: o,
  56534. openEnded: a,
  56535. thetaStart: s,
  56536. thetaLength: l
  56537. },
  56538. e = void 0 !== e ? e : 20,
  56539. t = void 0 !== t ? t : 20,
  56540. i = void 0 !== i ? i : 100,
  56541. r = Math.floor(r) || 8,
  56542. o = Math.floor(o) || 1,
  56543. a = void 0 !== a && a,
  56544. s = void 0 !== s ? s : 0,
  56545. l = void 0 !== l ? l : 2 * Math.PI;
  56546. var p = c()
  56547. , f = h()
  56548. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  56549. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  56550. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  56551. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  56552. , y = 0
  56553. , C = 0
  56554. , I = []
  56555. , E = i / 2;
  56556. u(),
  56557. a === !1 && (e > 0 && d(!0),
  56558. t > 0 && d(!1)),
  56559. this.setIndex(g),
  56560. this.addAttribute("position", m),
  56561. this.addAttribute("normal", v),
  56562. this.addAttribute("uv", A)
  56563. }
  56564. ,
  56565. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56566. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  56567. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  56568. n.Geometry.call(this),
  56569. this.type = "CylinderGeometry",
  56570. this.parameters = {
  56571. radiusTop: e,
  56572. radiusBottom: t,
  56573. height: i,
  56574. radialSegments: r,
  56575. heightSegments: o,
  56576. openEnded: a,
  56577. thetaStart: s,
  56578. thetaLength: l
  56579. },
  56580. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  56581. this.mergeVertices()
  56582. }
  56583. ,
  56584. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  56585. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  56586. n.EdgesGeometry = function(e, t) {
  56587. function i(e, t) {
  56588. return e - t
  56589. }
  56590. n.BufferGeometry.call(this),
  56591. t = void 0 !== t ? t : 1;
  56592. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  56593. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  56594. r.fromBufferGeometry(e)) : r = e.clone(),
  56595. r.mergeVertices(),
  56596. r.computeFaceNormals();
  56597. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  56598. for (var p = h[u], f = 0; f < 3; f++) {
  56599. a[0] = p[l[f]],
  56600. a[1] = p[l[(f + 1) % 3]],
  56601. a.sort(i);
  56602. var g = a.toString();
  56603. void 0 === s[g] ? s[g] = {
  56604. vert1: a[0],
  56605. vert2: a[1],
  56606. face1: u,
  56607. face2: void 0
  56608. } : s[g].face2 = u
  56609. }
  56610. var m = [];
  56611. for (var g in s) {
  56612. var v = s[g];
  56613. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  56614. var A = c[v.vert1];
  56615. m.push(A.x),
  56616. m.push(A.y),
  56617. m.push(A.z),
  56618. A = c[v.vert2],
  56619. m.push(A.x),
  56620. m.push(A.y),
  56621. m.push(A.z)
  56622. }
  56623. }
  56624. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  56625. }
  56626. ,
  56627. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56628. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  56629. n.ExtrudeGeometry = function(e, t) {
  56630. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  56631. this.type = "ExtrudeGeometry",
  56632. e = Array.isArray(e) ? e : [e],
  56633. this.addShapeList(e, t),
  56634. void this.computeFaceNormals())
  56635. }
  56636. ;
  56637. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  56638. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  56639. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  56640. for (var i = e.length, n = 0; n < i; n++) {
  56641. var r = e[n];
  56642. this.addShape(r, t)
  56643. }
  56644. }
  56645. ,
  56646. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  56647. function i(e, t, i) {
  56648. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  56649. t.clone().multiplyScalar(i).add(e)
  56650. }
  56651. function r(e, t, i) {
  56652. 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;
  56653. if (Math.abs(d) > Number.EPSILON) {
  56654. var p = Math.sqrt(u)
  56655. , f = Math.sqrt(c * c + h * h)
  56656. , g = t.x - l / p
  56657. , m = t.y + s / p
  56658. , v = i.x - h / f
  56659. , A = i.y + c / f
  56660. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  56661. r = g + s * y - e.x,
  56662. o = m + l * y - e.y;
  56663. var C = r * r + o * o;
  56664. if (C <= 2)
  56665. return new n.Vector2(r,o);
  56666. a = Math.sqrt(C / 2)
  56667. } else {
  56668. var I = !1;
  56669. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  56670. I ? (r = -l,
  56671. o = s,
  56672. a = Math.sqrt(u)) : (r = s,
  56673. o = l,
  56674. a = Math.sqrt(u / 2))
  56675. }
  56676. return new n.Vector2(r / a,o / a)
  56677. }
  56678. function o() {
  56679. if (C) {
  56680. var e = 0
  56681. , t = z * e;
  56682. for (Y = 0; Y < W; Y++)
  56683. G = N[Y],
  56684. c(G[2] + t, G[1] + t, G[0] + t);
  56685. for (e = E + 2 * y,
  56686. t = z * e,
  56687. Y = 0; Y < W; Y++)
  56688. G = N[Y],
  56689. c(G[0] + t, G[1] + t, G[2] + t)
  56690. } else {
  56691. for (Y = 0; Y < W; Y++)
  56692. G = N[Y],
  56693. c(G[2], G[1], G[0]);
  56694. for (Y = 0; Y < W; Y++)
  56695. G = N[Y],
  56696. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  56697. }
  56698. }
  56699. function a() {
  56700. var e = 0;
  56701. for (s(B, e),
  56702. e += B.length,
  56703. x = 0,
  56704. S = L.length; x < S; x++)
  56705. T = L[x],
  56706. s(T, e),
  56707. e += T.length
  56708. }
  56709. function s(e, t) {
  56710. var i, n;
  56711. for (Y = e.length; --Y >= 0; ) {
  56712. i = Y,
  56713. n = Y - 1,
  56714. n < 0 && (n = e.length - 1);
  56715. var r = 0
  56716. , o = E + 2 * y;
  56717. for (r = 0; r < o; r++) {
  56718. var a = z * r
  56719. , s = z * (r + 1)
  56720. , l = t + i + a
  56721. , c = t + n + a
  56722. , u = t + n + s
  56723. , d = t + i + s;
  56724. h(l, c, u, d, e, r, o, i, n)
  56725. }
  56726. }
  56727. }
  56728. function l(e, t, i) {
  56729. M.vertices.push(new n.Vector3(e,t,i))
  56730. }
  56731. function c(e, t, i) {
  56732. e += R,
  56733. t += R,
  56734. i += R,
  56735. M.faces.push(new n.Face3(e,t,i,null,null,0));
  56736. var r = _.generateTopUV(M, e, t, i);
  56737. M.faceVertexUvs[0].push(r)
  56738. }
  56739. function h(e, t, i, r, o, a, s, l, c) {
  56740. e += R,
  56741. t += R,
  56742. i += R,
  56743. r += R,
  56744. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  56745. M.faces.push(new n.Face3(t,i,r,null,null,1));
  56746. var h = _.generateSideWallUV(M, e, t, i, r);
  56747. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  56748. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  56749. }
  56750. 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;
  56751. b && (u = b.getSpacedPoints(E),
  56752. w = !0,
  56753. C = !1,
  56754. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  56755. p = new n.Vector3,
  56756. f = new n.Vector3,
  56757. g = new n.Vector3),
  56758. C || (y = 0,
  56759. v = 0,
  56760. A = 0);
  56761. 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);
  56762. if (D) {
  56763. for (O = O.reverse(),
  56764. x = 0,
  56765. S = L.length; x < S; x++)
  56766. T = L[x],
  56767. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  56768. D = !1
  56769. }
  56770. var N = n.ShapeUtils.triangulateShape(O, L)
  56771. , B = O;
  56772. for (x = 0,
  56773. S = L.length; x < S; x++)
  56774. T = L[x],
  56775. O = O.concat(T);
  56776. 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++,
  56777. Z++,
  56778. q++)
  56779. Z === X && (Z = 0),
  56780. q === X && (q = 0),
  56781. j[Y] = r(B[Y], B[Z], B[q]);
  56782. var K, Q = [], J = j.concat();
  56783. for (x = 0,
  56784. S = L.length; x < S; x++) {
  56785. for (T = L[x],
  56786. K = [],
  56787. Y = 0,
  56788. X = T.length,
  56789. Z = X - 1,
  56790. q = Y + 1; Y < X; Y++,
  56791. Z++,
  56792. q++)
  56793. Z === X && (Z = 0),
  56794. q === X && (q = 0),
  56795. K[Y] = r(T[Y], T[Z], T[q]);
  56796. Q.push(K),
  56797. J = J.concat(K)
  56798. }
  56799. for (F = 0; F < y; F++) {
  56800. for (U = F / y,
  56801. k = v * (1 - U),
  56802. V = A * Math.sin(U * Math.PI / 2),
  56803. Y = 0,
  56804. X = B.length; Y < X; Y++)
  56805. H = i(B[Y], j[Y], V),
  56806. l(H.x, H.y, -k);
  56807. for (x = 0,
  56808. S = L.length; x < S; x++)
  56809. for (T = L[x],
  56810. K = Q[x],
  56811. Y = 0,
  56812. X = T.length; Y < X; Y++)
  56813. H = i(T[Y], K[Y], V),
  56814. l(H.x, H.y, -k)
  56815. }
  56816. for (V = A,
  56817. Y = 0; Y < z; Y++)
  56818. H = C ? i(O[Y], J[Y], V) : O[Y],
  56819. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  56820. p.copy(d.binormals[0]).multiplyScalar(H.y),
  56821. g.copy(u[0]).add(f).add(p),
  56822. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  56823. var $;
  56824. for ($ = 1; $ <= E; $++)
  56825. for (Y = 0; Y < z; Y++)
  56826. H = C ? i(O[Y], J[Y], V) : O[Y],
  56827. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  56828. p.copy(d.binormals[$]).multiplyScalar(H.y),
  56829. g.copy(u[$]).add(f).add(p),
  56830. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  56831. for (F = y - 1; F >= 0; F--) {
  56832. for (U = F / y,
  56833. k = v * (1 - U),
  56834. V = A * Math.sin(U * Math.PI / 2),
  56835. Y = 0,
  56836. X = B.length; Y < X; Y++)
  56837. H = i(B[Y], j[Y], V),
  56838. l(H.x, H.y, m + k);
  56839. for (x = 0,
  56840. S = L.length; x < S; x++)
  56841. for (T = L[x],
  56842. K = Q[x],
  56843. Y = 0,
  56844. X = T.length; Y < X; Y++)
  56845. H = i(T[Y], K[Y], V),
  56846. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  56847. }
  56848. o(),
  56849. a()
  56850. }
  56851. ,
  56852. n.ExtrudeGeometry.WorldUVGenerator = {
  56853. generateTopUV: function(e, t, i, r) {
  56854. var o = e.vertices
  56855. , a = o[t]
  56856. , s = o[i]
  56857. , l = o[r];
  56858. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  56859. },
  56860. generateSideWallUV: function(e, t, i, r, o) {
  56861. var a = e.vertices
  56862. , s = a[t]
  56863. , l = a[i]
  56864. , c = a[r]
  56865. , h = a[o];
  56866. 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)]
  56867. }
  56868. },
  56869. n.ShapeGeometry = function(e, t) {
  56870. n.Geometry.call(this),
  56871. this.type = "ShapeGeometry",
  56872. Array.isArray(e) === !1 && (e = [e]),
  56873. this.addShapeList(e, t),
  56874. this.computeFaceNormals()
  56875. }
  56876. ,
  56877. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  56878. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  56879. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  56880. for (var i = 0, n = e.length; i < n; i++)
  56881. this.addShape(e[i], t);
  56882. return this
  56883. }
  56884. ,
  56885. n.ShapeGeometry.prototype.addShape = function(e, t) {
  56886. void 0 === t && (t = {});
  56887. 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);
  56888. if (p) {
  56889. for (u = u.reverse(),
  56890. i = 0,
  56891. r = d.length; i < r; i++)
  56892. o = d[i],
  56893. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  56894. p = !1
  56895. }
  56896. var f = n.ShapeUtils.triangulateShape(u, d);
  56897. for (i = 0,
  56898. r = d.length; i < r; i++)
  56899. o = d[i],
  56900. u = u.concat(o);
  56901. var g, m, v = u.length, A = f.length;
  56902. for (i = 0; i < v; i++)
  56903. g = u[i],
  56904. this.vertices.push(new n.Vector3(g.x,g.y,0));
  56905. for (i = 0; i < A; i++) {
  56906. m = f[i];
  56907. var y = m[0] + c
  56908. , C = m[1] + c
  56909. , I = m[2] + c;
  56910. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  56911. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  56912. }
  56913. }
  56914. ,
  56915. n.LatheBufferGeometry = function(e, t, i, r) {
  56916. n.BufferGeometry.call(this),
  56917. this.type = "LatheBufferGeometry",
  56918. this.parameters = {
  56919. points: e,
  56920. segments: t,
  56921. phiStart: i,
  56922. phiLength: r
  56923. },
  56924. t = Math.floor(t) || 12,
  56925. i = i || 0,
  56926. r = r || 2 * Math.PI,
  56927. r = n.Math.clamp(r, 0, 2 * Math.PI);
  56928. 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),
  56929. 1 / t), m = new n.Vector3, v = new n.Vector2;
  56930. for (a = 0; a <= t; a++) {
  56931. var A = i + a * g * r
  56932. , y = Math.sin(A)
  56933. , C = Math.cos(A);
  56934. for (s = 0; s <= e.length - 1; s++)
  56935. m.x = e[s].x * y,
  56936. m.y = e[s].y,
  56937. m.z = e[s].x * C,
  56938. u.setXYZ(p, m.x, m.y, m.z),
  56939. v.x = a / t,
  56940. v.y = s / (e.length - 1),
  56941. d.setXY(p, v.x, v.y),
  56942. p++
  56943. }
  56944. for (a = 0; a < t; a++)
  56945. for (s = 0; s < e.length - 1; s++) {
  56946. o = s + a * e.length;
  56947. var I = o
  56948. , E = o + e.length
  56949. , b = o + e.length + 1
  56950. , w = o + 1;
  56951. h.setX(f, I),
  56952. f++,
  56953. h.setX(f, E),
  56954. f++,
  56955. h.setX(f, w),
  56956. f++,
  56957. h.setX(f, E),
  56958. f++,
  56959. h.setX(f, b),
  56960. f++,
  56961. h.setX(f, w),
  56962. f++
  56963. }
  56964. if (this.setIndex(h),
  56965. this.addAttribute("position", u),
  56966. this.addAttribute("uv", d),
  56967. this.computeVertexNormals(),
  56968. r === 2 * Math.PI) {
  56969. var _ = this.attributes.normal.array
  56970. , T = new n.Vector3
  56971. , x = new n.Vector3
  56972. , S = new n.Vector3;
  56973. for (o = t * e.length * 3,
  56974. a = 0,
  56975. s = 0; a < e.length; a++,
  56976. s += 3)
  56977. T.x = _[s + 0],
  56978. T.y = _[s + 1],
  56979. T.z = _[s + 2],
  56980. x.x = _[o + s + 0],
  56981. x.y = _[o + s + 1],
  56982. x.z = _[o + s + 2],
  56983. S.addVectors(T, x).normalize(),
  56984. _[s + 0] = _[o + s + 0] = S.x,
  56985. _[s + 1] = _[o + s + 1] = S.y,
  56986. _[s + 2] = _[o + s + 2] = S.z
  56987. }
  56988. }
  56989. ,
  56990. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  56991. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  56992. n.LatheGeometry = function(e, t, i, r) {
  56993. n.Geometry.call(this),
  56994. this.type = "LatheGeometry",
  56995. this.parameters = {
  56996. points: e,
  56997. segments: t,
  56998. phiStart: i,
  56999. phiLength: r
  57000. },
  57001. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  57002. this.mergeVertices()
  57003. }
  57004. ,
  57005. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  57006. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  57007. n.PlaneGeometry = function(e, t, i, r) {
  57008. n.Geometry.call(this),
  57009. this.type = "PlaneGeometry",
  57010. this.parameters = {
  57011. width: e,
  57012. height: t,
  57013. widthSegments: i,
  57014. heightSegments: r
  57015. },
  57016. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  57017. }
  57018. ,
  57019. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  57020. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  57021. n.PlaneBufferGeometry = function(e, t, i, r) {
  57022. n.BufferGeometry.call(this),
  57023. this.type = "PlaneBufferGeometry",
  57024. this.parameters = {
  57025. width: e,
  57026. height: t,
  57027. widthSegments: i,
  57028. heightSegments: r
  57029. };
  57030. 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++)
  57031. for (var y = A * d - a, C = 0; C < c; C++) {
  57032. var I = C * u - o;
  57033. p[m] = I,
  57034. p[m + 1] = -y,
  57035. f[m + 2] = 1,
  57036. g[v] = C / s,
  57037. g[v + 1] = 1 - A / l,
  57038. m += 3,
  57039. v += 2
  57040. }
  57041. m = 0;
  57042. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  57043. for (var C = 0; C < s; C++) {
  57044. var b = C + c * A
  57045. , w = C + c * (A + 1)
  57046. , _ = C + 1 + c * (A + 1)
  57047. , T = C + 1 + c * A;
  57048. E[m] = b,
  57049. E[m + 1] = w,
  57050. E[m + 2] = T,
  57051. E[m + 3] = w,
  57052. E[m + 4] = _,
  57053. E[m + 5] = T,
  57054. m += 6
  57055. }
  57056. this.setIndex(new n.BufferAttribute(E,1)),
  57057. this.addAttribute("position", new n.BufferAttribute(p,3)),
  57058. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  57059. this.addAttribute("uv", new n.BufferAttribute(g,2))
  57060. }
  57061. ,
  57062. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57063. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  57064. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  57065. n.BufferGeometry.call(this),
  57066. this.type = "RingBufferGeometry",
  57067. this.parameters = {
  57068. innerRadius: e,
  57069. outerRadius: t,
  57070. thetaSegments: i,
  57071. phiSegments: r,
  57072. thetaStart: o,
  57073. thetaLength: a
  57074. },
  57075. e = e || 20,
  57076. t = t || 50,
  57077. o = void 0 !== o ? o : 0,
  57078. a = void 0 !== a ? a : 2 * Math.PI,
  57079. i = void 0 !== i ? Math.max(3, i) : 8,
  57080. r = void 0 !== r ? Math.max(1, r) : 1;
  57081. 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;
  57082. for (l = 0; l <= r; l++) {
  57083. for (c = 0; c <= i; c++)
  57084. s = o + c / i * a,
  57085. C.x = A * Math.cos(s),
  57086. C.y = A * Math.sin(s),
  57087. p.setXYZ(m, C.x, C.y, C.z),
  57088. f.setXYZ(m, 0, 0, 1),
  57089. I.x = (C.x / t + 1) / 2,
  57090. I.y = (C.y / t + 1) / 2,
  57091. g.setXY(m, I.x, I.y),
  57092. m++;
  57093. A += y
  57094. }
  57095. for (l = 0; l < r; l++) {
  57096. var E = l * (i + 1);
  57097. for (c = 0; c < i; c++) {
  57098. s = c + E;
  57099. var b = s
  57100. , w = s + i + 1
  57101. , _ = s + i + 2
  57102. , T = s + 1;
  57103. d.setX(v, b),
  57104. v++,
  57105. d.setX(v, w),
  57106. v++,
  57107. d.setX(v, _),
  57108. v++,
  57109. d.setX(v, b),
  57110. v++,
  57111. d.setX(v, _),
  57112. v++,
  57113. d.setX(v, T),
  57114. v++
  57115. }
  57116. }
  57117. this.setIndex(d),
  57118. this.addAttribute("position", p),
  57119. this.addAttribute("normal", f),
  57120. this.addAttribute("uv", g)
  57121. }
  57122. ,
  57123. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57124. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  57125. n.RingGeometry = function(e, t, i, r, o, a) {
  57126. n.Geometry.call(this),
  57127. this.type = "RingGeometry",
  57128. this.parameters = {
  57129. innerRadius: e,
  57130. outerRadius: t,
  57131. thetaSegments: i,
  57132. phiSegments: r,
  57133. thetaStart: o,
  57134. thetaLength: a
  57135. },
  57136. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  57137. }
  57138. ,
  57139. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  57140. n.RingGeometry.prototype.constructor = n.RingGeometry,
  57141. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  57142. n.Geometry.call(this),
  57143. this.type = "SphereGeometry",
  57144. this.parameters = {
  57145. radius: e,
  57146. widthSegments: t,
  57147. heightSegments: i,
  57148. phiStart: r,
  57149. phiLength: o,
  57150. thetaStart: a,
  57151. thetaLength: s
  57152. },
  57153. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  57154. }
  57155. ,
  57156. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  57157. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  57158. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  57159. n.BufferGeometry.call(this),
  57160. this.type = "SphereBufferGeometry",
  57161. this.parameters = {
  57162. radius: e,
  57163. widthSegments: t,
  57164. heightSegments: i,
  57165. phiStart: r,
  57166. phiLength: o,
  57167. thetaStart: a,
  57168. thetaLength: s
  57169. },
  57170. e = e || 50,
  57171. t = Math.max(3, Math.floor(t) || 8),
  57172. i = Math.max(2, Math.floor(i) || 6),
  57173. r = void 0 !== r ? r : 0,
  57174. o = void 0 !== o ? o : 2 * Math.PI,
  57175. a = void 0 !== a ? a : 0,
  57176. s = void 0 !== s ? s : Math.PI;
  57177. 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++) {
  57178. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  57179. var C = y / t
  57180. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  57181. , E = e * Math.cos(a + A * s)
  57182. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  57183. g.set(I, E, b).normalize(),
  57184. h.setXYZ(p, I, E, b),
  57185. u.setXYZ(p, g.x, g.y, g.z),
  57186. d.setXY(p, C, 1 - A),
  57187. v.push(p),
  57188. p++
  57189. }
  57190. f.push(v)
  57191. }
  57192. for (var w = [], m = 0; m < i; m++)
  57193. for (var y = 0; y < t; y++) {
  57194. var _ = f[m][y + 1]
  57195. , T = f[m][y]
  57196. , x = f[m + 1][y]
  57197. , S = f[m + 1][y + 1];
  57198. (0 !== m || a > 0) && w.push(_, T, S),
  57199. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  57200. }
  57201. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  57202. this.addAttribute("position", h),
  57203. this.addAttribute("normal", u),
  57204. this.addAttribute("uv", d),
  57205. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  57206. }
  57207. ,
  57208. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57209. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  57210. n.TextGeometry = function(e, t) {
  57211. t = t || {};
  57212. var i = t.font;
  57213. if (i instanceof n.Font == !1)
  57214. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  57215. new n.Geometry;
  57216. var r = i.generateShapes(e, t.size, t.curveSegments);
  57217. t.amount = void 0 !== t.height ? t.height : 50,
  57218. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  57219. void 0 === t.bevelSize && (t.bevelSize = 8),
  57220. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  57221. n.ExtrudeGeometry.call(this, r, t),
  57222. this.type = "TextGeometry"
  57223. }
  57224. ,
  57225. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  57226. n.TextGeometry.prototype.constructor = n.TextGeometry,
  57227. n.TorusBufferGeometry = function(e, t, i, r, o) {
  57228. n.BufferGeometry.call(this),
  57229. this.type = "TorusBufferGeometry",
  57230. this.parameters = {
  57231. radius: e,
  57232. tube: t,
  57233. radialSegments: i,
  57234. tubularSegments: r,
  57235. arc: o
  57236. },
  57237. e = e || 100,
  57238. t = t || 40,
  57239. i = Math.floor(i) || 8,
  57240. r = Math.floor(r) || 6,
  57241. o = o || 2 * Math.PI;
  57242. 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;
  57243. for (a = 0; a <= i; a++)
  57244. for (s = 0; s <= r; s++) {
  57245. var C = s / r * o
  57246. , I = a / i * Math.PI * 2;
  57247. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  57248. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  57249. A.z = t * Math.sin(I),
  57250. u[f] = A.x,
  57251. u[f + 1] = A.y,
  57252. u[f + 2] = A.z,
  57253. v.x = e * Math.cos(C),
  57254. v.y = e * Math.sin(C),
  57255. y.subVectors(A, v).normalize(),
  57256. d[f] = y.x,
  57257. d[f + 1] = y.y,
  57258. d[f + 2] = y.z,
  57259. p[g] = s / r,
  57260. p[g + 1] = a / i,
  57261. f += 3,
  57262. g += 2
  57263. }
  57264. for (a = 1; a <= i; a++)
  57265. for (s = 1; s <= r; s++) {
  57266. var E = (r + 1) * a + s - 1
  57267. , b = (r + 1) * (a - 1) + s - 1
  57268. , w = (r + 1) * (a - 1) + s
  57269. , _ = (r + 1) * a + s;
  57270. h[m] = E,
  57271. h[m + 1] = b,
  57272. h[m + 2] = _,
  57273. h[m + 3] = b,
  57274. h[m + 4] = w,
  57275. h[m + 5] = _,
  57276. m += 6
  57277. }
  57278. this.setIndex(new n.BufferAttribute(h,1)),
  57279. this.addAttribute("position", new n.BufferAttribute(u,3)),
  57280. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  57281. this.addAttribute("uv", new n.BufferAttribute(p,2))
  57282. }
  57283. ,
  57284. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57285. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  57286. n.TorusGeometry = function(e, t, i, r, o) {
  57287. n.Geometry.call(this),
  57288. this.type = "TorusGeometry",
  57289. this.parameters = {
  57290. radius: e,
  57291. tube: t,
  57292. radialSegments: i,
  57293. tubularSegments: r,
  57294. arc: o
  57295. },
  57296. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  57297. }
  57298. ,
  57299. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  57300. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  57301. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  57302. function s(e, t, i, n, r) {
  57303. var o = Math.cos(e)
  57304. , a = Math.sin(e)
  57305. , s = i / t * e
  57306. , l = Math.cos(s);
  57307. r.x = n * (2 + l) * .5 * o,
  57308. r.y = n * (2 + l) * a * .5,
  57309. r.z = n * Math.sin(s) * .5
  57310. }
  57311. n.BufferGeometry.call(this),
  57312. this.type = "TorusKnotBufferGeometry",
  57313. this.parameters = {
  57314. radius: e,
  57315. tube: t,
  57316. tubularSegments: i,
  57317. radialSegments: r,
  57318. p: o,
  57319. q: a
  57320. },
  57321. e = e || 100,
  57322. t = t || 40,
  57323. i = Math.floor(i) || 64,
  57324. r = Math.floor(r) || 8,
  57325. o = o || 2,
  57326. a = a || 3;
  57327. 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;
  57328. for (l = 0; l <= i; ++l) {
  57329. var T = l / i * o * Math.PI * 2;
  57330. for (s(T, o, a, e, I),
  57331. s(T + .01, o, a, e, E),
  57332. w.subVectors(E, I),
  57333. _.addVectors(E, I),
  57334. b.crossVectors(w, _),
  57335. _.crossVectors(b, w),
  57336. b.normalize(),
  57337. _.normalize(),
  57338. c = 0; c <= r; ++c) {
  57339. var x = c / r * Math.PI * 2
  57340. , S = -t * Math.cos(x)
  57341. , M = t * Math.sin(x);
  57342. A.x = I.x + (S * _.x + M * b.x),
  57343. A.y = I.y + (S * _.y + M * b.y),
  57344. A.z = I.z + (S * _.z + M * b.z),
  57345. p.setXYZ(m, A.x, A.y, A.z),
  57346. y.subVectors(A, I).normalize(),
  57347. f.setXYZ(m, y.x, y.y, y.z),
  57348. C.x = l / i,
  57349. C.y = c / r,
  57350. g.setXY(m, C.x, C.y),
  57351. m++
  57352. }
  57353. }
  57354. for (c = 1; c <= i; c++)
  57355. for (l = 1; l <= r; l++) {
  57356. var R = (r + 1) * (c - 1) + (l - 1)
  57357. , P = (r + 1) * c + (l - 1)
  57358. , O = (r + 1) * c + l
  57359. , L = (r + 1) * (c - 1) + l;
  57360. d.setX(v, R),
  57361. v++,
  57362. d.setX(v, P),
  57363. v++,
  57364. d.setX(v, L),
  57365. v++,
  57366. d.setX(v, P),
  57367. v++,
  57368. d.setX(v, O),
  57369. v++,
  57370. d.setX(v, L),
  57371. v++
  57372. }
  57373. this.setIndex(d),
  57374. this.addAttribute("position", p),
  57375. this.addAttribute("normal", f),
  57376. this.addAttribute("uv", g)
  57377. }
  57378. ,
  57379. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57380. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  57381. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  57382. n.Geometry.call(this),
  57383. this.type = "TorusKnotGeometry",
  57384. this.parameters = {
  57385. radius: e,
  57386. tube: t,
  57387. tubularSegments: i,
  57388. radialSegments: r,
  57389. p: o,
  57390. q: a
  57391. },
  57392. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  57393. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  57394. this.mergeVertices()
  57395. }
  57396. ,
  57397. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  57398. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  57399. n.TubeGeometry = function(e, t, i, r, o, a) {
  57400. function s(e, t, i) {
  57401. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  57402. }
  57403. n.Geometry.call(this),
  57404. this.type = "TubeGeometry",
  57405. this.parameters = {
  57406. path: e,
  57407. segments: t,
  57408. radius: i,
  57409. radialSegments: r,
  57410. closed: o,
  57411. taper: a
  57412. },
  57413. t = t || 64,
  57414. i = i || 1,
  57415. r = r || 8,
  57416. o = o || !1,
  57417. a = a || n.TubeGeometry.NoTaper;
  57418. 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;
  57419. for (this.tangents = D,
  57420. this.normals = N,
  57421. this.binormals = B,
  57422. v = 0; v < P; v++)
  57423. for (M[v] = [],
  57424. u = v / (P - 1),
  57425. m = e.getPointAt(u),
  57426. l = D[v],
  57427. c = N[v],
  57428. h = B[v],
  57429. p = i * a(u),
  57430. A = 0; A < r; A++)
  57431. d = A / r * 2 * Math.PI,
  57432. f = -p * Math.cos(d),
  57433. g = p * Math.sin(d),
  57434. O.copy(m),
  57435. O.x += f * c.x + g * h.x,
  57436. O.y += f * c.y + g * h.y,
  57437. O.z += f * c.z + g * h.z,
  57438. M[v][A] = s(O.x, O.y, O.z);
  57439. for (v = 0; v < t; v++)
  57440. for (A = 0; A < r; A++)
  57441. y = o ? (v + 1) % t : v + 1,
  57442. C = (A + 1) % r,
  57443. I = M[v][A],
  57444. E = M[y][A],
  57445. b = M[y][C],
  57446. w = M[v][C],
  57447. _ = new n.Vector2(v / t,A / r),
  57448. T = new n.Vector2((v + 1) / t,A / r),
  57449. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  57450. S = new n.Vector2(v / t,(A + 1) / r),
  57451. this.faces.push(new n.Face3(I,E,w)),
  57452. this.faceVertexUvs[0].push([_, T, S]),
  57453. this.faces.push(new n.Face3(E,b,w)),
  57454. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  57455. this.computeFaceNormals(),
  57456. this.computeVertexNormals()
  57457. }
  57458. ,
  57459. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  57460. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  57461. n.TubeGeometry.NoTaper = function(e) {
  57462. return 1
  57463. }
  57464. ,
  57465. n.TubeGeometry.SinusoidalTaper = function(e) {
  57466. return Math.sin(Math.PI * e)
  57467. }
  57468. ,
  57469. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  57470. function r() {
  57471. f[0] = new n.Vector3,
  57472. g[0] = new n.Vector3,
  57473. a = Number.MAX_VALUE,
  57474. s = Math.abs(p[0].x),
  57475. l = Math.abs(p[0].y),
  57476. c = Math.abs(p[0].z),
  57477. s <= a && (a = s,
  57478. d.set(1, 0, 0)),
  57479. l <= a && (a = l,
  57480. d.set(0, 1, 0)),
  57481. c <= a && d.set(0, 0, 1),
  57482. m.crossVectors(p[0], d).normalize(),
  57483. f[0].crossVectors(p[0], m),
  57484. g[0].crossVectors(p[0], f[0])
  57485. }
  57486. 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;
  57487. for (this.tangents = p,
  57488. this.normals = f,
  57489. this.binormals = g,
  57490. h = 0; h < A; h++)
  57491. u = h / (A - 1),
  57492. p[h] = e.getTangentAt(u),
  57493. p[h].normalize();
  57494. for (r(),
  57495. h = 1; h < A; h++)
  57496. f[h] = f[h - 1].clone(),
  57497. g[h] = g[h - 1].clone(),
  57498. m.crossVectors(p[h - 1], p[h]),
  57499. m.length() > Number.EPSILON && (m.normalize(),
  57500. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  57501. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  57502. g[h].crossVectors(p[h], f[h]);
  57503. if (i)
  57504. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  57505. o /= A - 1,
  57506. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  57507. h = 1; h < A; h++)
  57508. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  57509. g[h].crossVectors(p[h], f[h])
  57510. }
  57511. ,
  57512. n.PolyhedronGeometry = function(e, t, i, r) {
  57513. function o(e) {
  57514. var t = e.normalize().clone();
  57515. t.index = u.vertices.push(t) - 1;
  57516. var i = l(e) / 2 / Math.PI + .5
  57517. , r = c(e) / Math.PI + .5;
  57518. return t.uv = new n.Vector2(i,1 - r),
  57519. t
  57520. }
  57521. function a(e, t, i, r) {
  57522. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  57523. u.faces.push(o),
  57524. C.copy(e).add(t).add(i).divideScalar(3);
  57525. var a = l(C);
  57526. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  57527. }
  57528. function s(e, t) {
  57529. 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++) {
  57530. l[h] = [];
  57531. 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++)
  57532. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  57533. }
  57534. for (var h = 0; h < i; h++)
  57535. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  57536. var m = Math.floor(g / 2);
  57537. 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)
  57538. }
  57539. }
  57540. function l(e) {
  57541. return Math.atan2(e.z, -e.x)
  57542. }
  57543. function c(e) {
  57544. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  57545. }
  57546. function h(e, t, i) {
  57547. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  57548. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  57549. e.clone()
  57550. }
  57551. n.Geometry.call(this),
  57552. this.type = "PolyhedronGeometry",
  57553. this.parameters = {
  57554. vertices: e,
  57555. indices: t,
  57556. radius: i,
  57557. detail: r
  57558. },
  57559. i = i || 1,
  57560. r = r || 0;
  57561. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  57562. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  57563. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  57564. m++) {
  57565. var v = f[t[d]]
  57566. , A = f[t[d + 1]]
  57567. , y = f[t[d + 2]];
  57568. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  57569. }
  57570. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  57571. s(g[d], r);
  57572. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  57573. var I = this.faceVertexUvs[0][d]
  57574. , E = I[0].x
  57575. , b = I[1].x
  57576. , w = I[2].x
  57577. , _ = Math.max(E, b, w)
  57578. , T = Math.min(E, b, w);
  57579. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  57580. b < .2 && (I[1].x += 1),
  57581. w < .2 && (I[2].x += 1))
  57582. }
  57583. for (var d = 0, p = this.vertices.length; d < p; d++)
  57584. this.vertices[d].multiplyScalar(i);
  57585. this.mergeVertices(),
  57586. this.computeFaceNormals(),
  57587. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  57588. }
  57589. ,
  57590. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  57591. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  57592. n.DodecahedronGeometry = function(e, t) {
  57593. var i = (1 + Math.sqrt(5)) / 2
  57594. , r = 1 / i
  57595. , 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]
  57596. , 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];
  57597. n.PolyhedronGeometry.call(this, o, a, e, t),
  57598. this.type = "DodecahedronGeometry",
  57599. this.parameters = {
  57600. radius: e,
  57601. detail: t
  57602. }
  57603. }
  57604. ,
  57605. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57606. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  57607. n.IcosahedronGeometry = function(e, t) {
  57608. var i = (1 + Math.sqrt(5)) / 2
  57609. , 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]
  57610. , 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];
  57611. n.PolyhedronGeometry.call(this, r, o, e, t),
  57612. this.type = "IcosahedronGeometry",
  57613. this.parameters = {
  57614. radius: e,
  57615. detail: t
  57616. }
  57617. }
  57618. ,
  57619. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57620. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  57621. n.OctahedronGeometry = function(e, t) {
  57622. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  57623. , 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];
  57624. n.PolyhedronGeometry.call(this, i, r, e, t),
  57625. this.type = "OctahedronGeometry",
  57626. this.parameters = {
  57627. radius: e,
  57628. detail: t
  57629. }
  57630. }
  57631. ,
  57632. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57633. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  57634. n.TetrahedronGeometry = function(e, t) {
  57635. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  57636. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  57637. n.PolyhedronGeometry.call(this, i, r, e, t),
  57638. this.type = "TetrahedronGeometry",
  57639. this.parameters = {
  57640. radius: e,
  57641. detail: t
  57642. }
  57643. }
  57644. ,
  57645. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  57646. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  57647. n.ParametricGeometry = function(e, t, i) {
  57648. n.Geometry.call(this),
  57649. this.type = "ParametricGeometry",
  57650. this.parameters = {
  57651. func: e,
  57652. slices: t,
  57653. stacks: i
  57654. };
  57655. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  57656. for (r = 0; r <= i; r++)
  57657. for (l = r / i,
  57658. o = 0; o <= t; o++)
  57659. s = o / t,
  57660. a = e(s, l),
  57661. c.push(a);
  57662. var p, f, g, m, v, A, y, C;
  57663. for (r = 0; r < i; r++)
  57664. for (o = 0; o < t; o++)
  57665. p = r * d + o,
  57666. f = r * d + o + 1,
  57667. g = (r + 1) * d + o + 1,
  57668. m = (r + 1) * d + o,
  57669. v = new n.Vector2(o / t,r / i),
  57670. A = new n.Vector2((o + 1) / t,r / i),
  57671. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  57672. C = new n.Vector2(o / t,(r + 1) / i),
  57673. h.push(new n.Face3(p,f,m)),
  57674. u.push([v, A, C]),
  57675. h.push(new n.Face3(f,g,m)),
  57676. u.push([A.clone(), y, C.clone()]);
  57677. this.computeFaceNormals(),
  57678. this.computeVertexNormals()
  57679. }
  57680. ,
  57681. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  57682. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  57683. n.WireframeGeometry = function(e) {
  57684. function t(e, t) {
  57685. return e - t
  57686. }
  57687. n.BufferGeometry.call(this);
  57688. var i = [0, 0]
  57689. , r = {}
  57690. , o = ["a", "b", "c"];
  57691. if (e instanceof n.Geometry) {
  57692. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  57693. for (var d = s[h], p = 0; p < 3; p++) {
  57694. i[0] = d[o[p]],
  57695. i[1] = d[o[(p + 1) % 3]],
  57696. i.sort(t);
  57697. var f = i.toString();
  57698. void 0 === r[f] && (c[2 * l] = i[0],
  57699. c[2 * l + 1] = i[1],
  57700. r[f] = !0,
  57701. l++)
  57702. }
  57703. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57704. for (var p = 0; p < 2; p++) {
  57705. var m = a[c[2 * h + p]]
  57706. , v = 6 * h + 3 * p;
  57707. g[v + 0] = m.x,
  57708. g[v + 1] = m.y,
  57709. g[v + 2] = m.z
  57710. }
  57711. this.addAttribute("position", new n.BufferAttribute(g,3))
  57712. } else if (e instanceof n.BufferGeometry)
  57713. if (null !== e.index) {
  57714. var A = e.index.array
  57715. , a = e.attributes.position
  57716. , y = e.groups
  57717. , l = 0;
  57718. 0 === y.length && e.addGroup(0, A.length);
  57719. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  57720. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  57721. for (var p = 0; p < 3; p++) {
  57722. i[0] = A[h + p],
  57723. i[1] = A[h + (p + 1) % 3],
  57724. i.sort(t);
  57725. var f = i.toString();
  57726. void 0 === r[f] && (c[2 * l] = i[0],
  57727. c[2 * l + 1] = i[1],
  57728. r[f] = !0,
  57729. l++)
  57730. }
  57731. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  57732. for (var p = 0; p < 2; p++) {
  57733. var v = 6 * h + 3 * p
  57734. , T = c[2 * h + p];
  57735. g[v + 0] = a.getX(T),
  57736. g[v + 1] = a.getY(T),
  57737. g[v + 2] = a.getZ(T)
  57738. }
  57739. this.addAttribute("position", new n.BufferAttribute(g,3))
  57740. } else {
  57741. 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++)
  57742. for (var p = 0; p < 3; p++) {
  57743. var v = 18 * h + 6 * p
  57744. , S = 9 * h + 3 * p;
  57745. g[v + 0] = a[S],
  57746. g[v + 1] = a[S + 1],
  57747. g[v + 2] = a[S + 2];
  57748. var T = 9 * h + 3 * ((p + 1) % 3);
  57749. g[v + 3] = a[T],
  57750. g[v + 4] = a[T + 1],
  57751. g[v + 5] = a[T + 2]
  57752. }
  57753. this.addAttribute("position", new n.BufferAttribute(g,3))
  57754. }
  57755. }
  57756. ,
  57757. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  57758. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  57759. n.AxisHelper = function(e) {
  57760. e = e || 1;
  57761. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  57762. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  57763. , r = new n.BufferGeometry;
  57764. r.addAttribute("position", new n.BufferAttribute(t,3)),
  57765. r.addAttribute("color", new n.BufferAttribute(i,3));
  57766. var o = new n.LineBasicMaterial({
  57767. vertexColors: n.VertexColors
  57768. });
  57769. n.LineSegments.call(this, r, o)
  57770. }
  57771. ,
  57772. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  57773. n.AxisHelper.prototype.constructor = n.AxisHelper,
  57774. n.ArrowHelper = function() {
  57775. var e = new n.Geometry;
  57776. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  57777. var t = new n.CylinderGeometry(0,.5,1,5,1);
  57778. return t.translate(0, -.5, 0),
  57779. function(i, r, o, a, s, l) {
  57780. n.Object3D.call(this),
  57781. void 0 === a && (a = 16776960),
  57782. void 0 === o && (o = 1),
  57783. void 0 === s && (s = .2 * o),
  57784. void 0 === l && (l = .2 * s),
  57785. this.position.copy(r),
  57786. this.line = new n.Line(e,new n.LineBasicMaterial({
  57787. color: a
  57788. })),
  57789. this.line.matrixAutoUpdate = !1,
  57790. this.add(this.line),
  57791. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  57792. color: a
  57793. })),
  57794. this.cone.matrixAutoUpdate = !1,
  57795. this.add(this.cone),
  57796. this.setDirection(i),
  57797. this.setLength(o, s, l)
  57798. }
  57799. }(),
  57800. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  57801. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  57802. n.ArrowHelper.prototype.setDirection = function() {
  57803. var e, t = new n.Vector3;
  57804. return function(i) {
  57805. 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(),
  57806. e = Math.acos(i.y),
  57807. this.quaternion.setFromAxisAngle(t, e))
  57808. }
  57809. }(),
  57810. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  57811. void 0 === t && (t = .2 * e),
  57812. void 0 === i && (i = .2 * t),
  57813. this.line.scale.set(1, Math.max(0, e - t), 1),
  57814. this.line.updateMatrix(),
  57815. this.cone.scale.set(i, t, i),
  57816. this.cone.position.y = e,
  57817. this.cone.updateMatrix()
  57818. }
  57819. ,
  57820. n.ArrowHelper.prototype.setColor = function(e) {
  57821. this.line.material.color.set(e),
  57822. this.cone.material.color.set(e)
  57823. }
  57824. ,
  57825. n.BoxHelper = function(e) {
  57826. 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])
  57827. , i = new Float32Array(24)
  57828. , r = new n.BufferGeometry;
  57829. r.setIndex(new n.BufferAttribute(t,1)),
  57830. r.addAttribute("position", new n.BufferAttribute(i,3)),
  57831. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  57832. color: 16776960
  57833. })),
  57834. void 0 !== e && this.update(e)
  57835. }
  57836. ,
  57837. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  57838. n.BoxHelper.prototype.constructor = n.BoxHelper,
  57839. n.BoxHelper.prototype.update = function() {
  57840. var e = new n.Box3;
  57841. return function(t) {
  57842. if (e.setFromObject(t),
  57843. !e.isEmpty()) {
  57844. var i = e.min
  57845. , n = e.max
  57846. , r = this.geometry.attributes.position
  57847. , o = r.array;
  57848. o[0] = n.x,
  57849. o[1] = n.y,
  57850. o[2] = n.z,
  57851. o[3] = i.x,
  57852. o[4] = n.y,
  57853. o[5] = n.z,
  57854. o[6] = i.x,
  57855. o[7] = i.y,
  57856. o[8] = n.z,
  57857. o[9] = n.x,
  57858. o[10] = i.y,
  57859. o[11] = n.z,
  57860. o[12] = n.x,
  57861. o[13] = n.y,
  57862. o[14] = i.z,
  57863. o[15] = i.x,
  57864. o[16] = n.y,
  57865. o[17] = i.z,
  57866. o[18] = i.x,
  57867. o[19] = i.y,
  57868. o[20] = i.z,
  57869. o[21] = n.x,
  57870. o[22] = i.y,
  57871. o[23] = i.z,
  57872. r.needsUpdate = !0,
  57873. this.geometry.computeBoundingSphere()
  57874. }
  57875. }
  57876. }(),
  57877. n.BoundingBoxHelper = function(e, t) {
  57878. var i = void 0 !== t ? t : 8947848;
  57879. this.object = e,
  57880. this.box = new n.Box3,
  57881. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  57882. color: i,
  57883. wireframe: !0
  57884. }))
  57885. }
  57886. ,
  57887. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  57888. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  57889. n.BoundingBoxHelper.prototype.update = function() {
  57890. this.box.setFromObject(this.object),
  57891. this.box.size(this.scale),
  57892. this.box.center(this.position)
  57893. }
  57894. ,
  57895. n.CameraHelper = function(e) {
  57896. function t(e, t, n) {
  57897. i(e, n),
  57898. i(t, n)
  57899. }
  57900. function i(e, t) {
  57901. r.vertices.push(new n.Vector3),
  57902. r.colors.push(new n.Color(t)),
  57903. void 0 === a[e] && (a[e] = []),
  57904. a[e].push(r.vertices.length - 1)
  57905. }
  57906. var r = new n.Geometry
  57907. , o = new n.LineBasicMaterial({
  57908. color: 16777215,
  57909. vertexColors: n.FaceColors
  57910. })
  57911. , a = {}
  57912. , s = 16755200
  57913. , l = 16711680
  57914. , c = 43775
  57915. , h = 16777215
  57916. , u = 3355443;
  57917. t("n1", "n2", s),
  57918. t("n2", "n4", s),
  57919. t("n4", "n3", s),
  57920. t("n3", "n1", s),
  57921. t("f1", "f2", s),
  57922. t("f2", "f4", s),
  57923. t("f4", "f3", s),
  57924. t("f3", "f1", s),
  57925. t("n1", "f1", s),
  57926. t("n2", "f2", s),
  57927. t("n3", "f3", s),
  57928. t("n4", "f4", s),
  57929. t("p", "n1", l),
  57930. t("p", "n2", l),
  57931. t("p", "n3", l),
  57932. t("p", "n4", l),
  57933. t("u1", "u2", c),
  57934. t("u2", "u3", c),
  57935. t("u3", "u1", c),
  57936. t("c", "t", h),
  57937. t("p", "c", u),
  57938. t("cn1", "cn2", u),
  57939. t("cn3", "cn4", u),
  57940. t("cf1", "cf2", u),
  57941. t("cf3", "cf4", u),
  57942. n.LineSegments.call(this, r, o),
  57943. this.camera = e,
  57944. this.camera.updateProjectionMatrix(),
  57945. this.matrix = e.matrixWorld,
  57946. this.matrixAutoUpdate = !1,
  57947. this.pointMap = a,
  57948. this.update()
  57949. }
  57950. ,
  57951. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  57952. n.CameraHelper.prototype.constructor = n.CameraHelper,
  57953. n.CameraHelper.prototype.update = function() {
  57954. function e(e, n, a, s) {
  57955. r.set(n, a, s).unproject(o);
  57956. var l = i[e];
  57957. if (void 0 !== l)
  57958. for (var c = 0, h = l.length; c < h; c++)
  57959. t.vertices[l[c]].copy(r)
  57960. }
  57961. var t, i, r = new n.Vector3, o = new n.Camera;
  57962. return function() {
  57963. t = this.geometry,
  57964. i = this.pointMap;
  57965. var n = 1
  57966. , r = 1;
  57967. o.projectionMatrix.copy(this.camera.projectionMatrix),
  57968. e("c", 0, 0, -1),
  57969. e("t", 0, 0, 1),
  57970. e("n1", -n, -r, -1),
  57971. e("n2", n, -r, -1),
  57972. e("n3", -n, r, -1),
  57973. e("n4", n, r, -1),
  57974. e("f1", -n, -r, 1),
  57975. e("f2", n, -r, 1),
  57976. e("f3", -n, r, 1),
  57977. e("f4", n, r, 1),
  57978. e("u1", .7 * n, 1.1 * r, -1),
  57979. e("u2", .7 * -n, 1.1 * r, -1),
  57980. e("u3", 0, 2 * r, -1),
  57981. e("cf1", -n, 0, 1),
  57982. e("cf2", n, 0, 1),
  57983. e("cf3", 0, -r, 1),
  57984. e("cf4", 0, r, 1),
  57985. e("cn1", -n, 0, -1),
  57986. e("cn2", n, 0, -1),
  57987. e("cn3", 0, -r, -1),
  57988. e("cn4", 0, r, -1),
  57989. t.verticesNeedUpdate = !0
  57990. }
  57991. }(),
  57992. n.DirectionalLightHelper = function(e, t) {
  57993. n.Object3D.call(this),
  57994. this.light = e,
  57995. this.light.updateMatrixWorld(),
  57996. this.matrix = e.matrixWorld,
  57997. this.matrixAutoUpdate = !1,
  57998. t = t || 1;
  57999. var i = new n.Geometry;
  58000. 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));
  58001. var r = new n.LineBasicMaterial({
  58002. fog: !1
  58003. });
  58004. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58005. this.lightPlane = new n.Line(i,r),
  58006. this.add(this.lightPlane),
  58007. i = new n.Geometry,
  58008. i.vertices.push(new n.Vector3, new n.Vector3),
  58009. r = new n.LineBasicMaterial({
  58010. fog: !1
  58011. }),
  58012. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58013. this.targetLine = new n.Line(i,r),
  58014. this.add(this.targetLine),
  58015. this.update()
  58016. }
  58017. ,
  58018. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  58019. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  58020. n.DirectionalLightHelper.prototype.dispose = function() {
  58021. this.lightPlane.geometry.dispose(),
  58022. this.lightPlane.material.dispose(),
  58023. this.targetLine.geometry.dispose(),
  58024. this.targetLine.material.dispose()
  58025. }
  58026. ,
  58027. n.DirectionalLightHelper.prototype.update = function() {
  58028. var e = new n.Vector3
  58029. , t = new n.Vector3
  58030. , i = new n.Vector3;
  58031. return function() {
  58032. e.setFromMatrixPosition(this.light.matrixWorld),
  58033. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58034. i.subVectors(t, e),
  58035. this.lightPlane.lookAt(i),
  58036. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58037. this.targetLine.geometry.vertices[1].copy(i),
  58038. this.targetLine.geometry.verticesNeedUpdate = !0,
  58039. this.targetLine.material.color.copy(this.lightPlane.material.color)
  58040. }
  58041. }(),
  58042. n.EdgesHelper = function(e, t, i) {
  58043. var r = void 0 !== t ? t : 16777215;
  58044. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  58045. color: r
  58046. })),
  58047. this.matrix = e.matrixWorld,
  58048. this.matrixAutoUpdate = !1
  58049. }
  58050. ,
  58051. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  58052. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  58053. n.FaceNormalsHelper = function(e, t, i, r) {
  58054. this.object = e,
  58055. this.size = void 0 !== t ? t : 1;
  58056. var o = void 0 !== i ? i : 16776960
  58057. , a = void 0 !== r ? r : 1
  58058. , s = 0
  58059. , l = this.object.geometry;
  58060. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  58061. var c = new n.BufferGeometry
  58062. , h = new n.Float32Attribute(2 * s * 3,3);
  58063. c.addAttribute("position", h),
  58064. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58065. color: o,
  58066. linewidth: a
  58067. })),
  58068. this.matrixAutoUpdate = !1,
  58069. this.update()
  58070. }
  58071. ,
  58072. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58073. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  58074. n.FaceNormalsHelper.prototype.update = function() {
  58075. var e = new n.Vector3
  58076. , t = new n.Vector3
  58077. , i = new n.Matrix3;
  58078. return function() {
  58079. this.object.updateMatrixWorld(!0),
  58080. i.getNormalMatrix(this.object.matrixWorld);
  58081. 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++) {
  58082. var u = s[c]
  58083. , d = u.normal;
  58084. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  58085. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58086. r.setXYZ(l, e.x, e.y, e.z),
  58087. l += 1,
  58088. r.setXYZ(l, t.x, t.y, t.z),
  58089. l += 1
  58090. }
  58091. return r.needsUpdate = !0,
  58092. this
  58093. }
  58094. }(),
  58095. n.GridHelper = function(e, t) {
  58096. var i = new n.Geometry
  58097. , r = new n.LineBasicMaterial({
  58098. vertexColors: n.VertexColors
  58099. });
  58100. this.color1 = new n.Color(4473924),
  58101. this.color2 = new n.Color(8947848);
  58102. for (var o = -e; o <= e; o += t) {
  58103. 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));
  58104. var a = 0 === o ? this.color1 : this.color2;
  58105. i.colors.push(a, a, a, a)
  58106. }
  58107. n.LineSegments.call(this, i, r)
  58108. }
  58109. ,
  58110. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  58111. n.GridHelper.prototype.constructor = n.GridHelper,
  58112. n.GridHelper.prototype.setColors = function(e, t) {
  58113. this.color1.set(e),
  58114. this.color2.set(t),
  58115. this.geometry.colorsNeedUpdate = !0
  58116. }
  58117. ,
  58118. n.HemisphereLightHelper = function(e, t) {
  58119. n.Object3D.call(this),
  58120. this.light = e,
  58121. this.light.updateMatrixWorld(),
  58122. this.matrix = e.matrixWorld,
  58123. this.matrixAutoUpdate = !1,
  58124. this.colors = [new n.Color, new n.Color];
  58125. var i = new n.SphereGeometry(t,4,2);
  58126. i.rotateX(-Math.PI / 2);
  58127. for (var r = 0, o = 8; r < o; r++)
  58128. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  58129. var a = new n.MeshBasicMaterial({
  58130. vertexColors: n.FaceColors,
  58131. wireframe: !0
  58132. });
  58133. this.lightSphere = new n.Mesh(i,a),
  58134. this.add(this.lightSphere),
  58135. this.update()
  58136. }
  58137. ,
  58138. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  58139. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  58140. n.HemisphereLightHelper.prototype.dispose = function() {
  58141. this.lightSphere.geometry.dispose(),
  58142. this.lightSphere.material.dispose()
  58143. }
  58144. ,
  58145. n.HemisphereLightHelper.prototype.update = function() {
  58146. var e = new n.Vector3;
  58147. return function() {
  58148. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  58149. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  58150. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  58151. this.lightSphere.geometry.colorsNeedUpdate = !0
  58152. }
  58153. }(),
  58154. n.PointLightHelper = function(e, t) {
  58155. this.light = e,
  58156. this.light.updateMatrixWorld();
  58157. var i = new n.SphereGeometry(t,4,2)
  58158. , r = new n.MeshBasicMaterial({
  58159. wireframe: !0,
  58160. fog: !1
  58161. });
  58162. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  58163. n.Mesh.call(this, i, r),
  58164. this.matrix = this.light.matrixWorld,
  58165. this.matrixAutoUpdate = !1
  58166. }
  58167. ,
  58168. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  58169. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  58170. n.PointLightHelper.prototype.dispose = function() {
  58171. this.geometry.dispose(),
  58172. this.material.dispose()
  58173. }
  58174. ,
  58175. n.PointLightHelper.prototype.update = function() {
  58176. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58177. }
  58178. ,
  58179. n.SkeletonHelper = function(e) {
  58180. this.bones = this.getBoneList(e);
  58181. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  58182. var r = this.bones[i];
  58183. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  58184. t.vertices.push(new n.Vector3),
  58185. t.colors.push(new n.Color(0,0,1)),
  58186. t.colors.push(new n.Color(0,1,0)))
  58187. }
  58188. t.dynamic = !0;
  58189. var o = new n.LineBasicMaterial({
  58190. vertexColors: n.VertexColors,
  58191. depthTest: !1,
  58192. depthWrite: !1,
  58193. transparent: !0
  58194. });
  58195. n.LineSegments.call(this, t, o),
  58196. this.root = e,
  58197. this.matrix = e.matrixWorld,
  58198. this.matrixAutoUpdate = !1,
  58199. this.update()
  58200. }
  58201. ,
  58202. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  58203. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  58204. n.SkeletonHelper.prototype.getBoneList = function(e) {
  58205. var t = [];
  58206. e instanceof n.Bone && t.push(e);
  58207. for (var i = 0; i < e.children.length; i++)
  58208. t.push.apply(t, this.getBoneList(e.children[i]));
  58209. return t
  58210. }
  58211. ,
  58212. n.SkeletonHelper.prototype.update = function() {
  58213. 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++) {
  58214. var a = this.bones[o];
  58215. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  58216. e.vertices[r].setFromMatrixPosition(i),
  58217. i.multiplyMatrices(t, a.parent.matrixWorld),
  58218. e.vertices[r + 1].setFromMatrixPosition(i),
  58219. r += 2)
  58220. }
  58221. e.verticesNeedUpdate = !0,
  58222. e.computeBoundingSphere()
  58223. }
  58224. ,
  58225. n.SpotLightHelper = function(e) {
  58226. n.Object3D.call(this),
  58227. this.light = e,
  58228. this.light.updateMatrixWorld(),
  58229. this.matrix = e.matrixWorld,
  58230. this.matrixAutoUpdate = !1;
  58231. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  58232. t.translate(0, -.5, 0),
  58233. t.rotateX(-Math.PI / 2);
  58234. var i = new n.MeshBasicMaterial({
  58235. wireframe: !0,
  58236. fog: !1
  58237. });
  58238. this.cone = new n.Mesh(t,i),
  58239. this.add(this.cone),
  58240. this.update()
  58241. }
  58242. ,
  58243. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  58244. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  58245. n.SpotLightHelper.prototype.dispose = function() {
  58246. this.cone.geometry.dispose(),
  58247. this.cone.material.dispose()
  58248. }
  58249. ,
  58250. n.SpotLightHelper.prototype.update = function() {
  58251. var e = new n.Vector3
  58252. , t = new n.Vector3;
  58253. return function() {
  58254. var i = this.light.distance ? this.light.distance : 1e4
  58255. , n = i * Math.tan(this.light.angle);
  58256. this.cone.scale.set(n, n, i),
  58257. e.setFromMatrixPosition(this.light.matrixWorld),
  58258. t.setFromMatrixPosition(this.light.target.matrixWorld),
  58259. this.cone.lookAt(t.sub(e)),
  58260. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  58261. }
  58262. }(),
  58263. n.VertexNormalsHelper = function(e, t, i, r) {
  58264. this.object = e,
  58265. this.size = void 0 !== t ? t : 1;
  58266. var o = void 0 !== i ? i : 16711680
  58267. , a = void 0 !== r ? r : 1
  58268. , s = 0
  58269. , l = this.object.geometry;
  58270. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  58271. var c = new n.BufferGeometry
  58272. , h = new n.Float32Attribute(2 * s * 3,3);
  58273. c.addAttribute("position", h),
  58274. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  58275. color: o,
  58276. linewidth: a
  58277. })),
  58278. this.matrixAutoUpdate = !1,
  58279. this.update()
  58280. }
  58281. ,
  58282. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  58283. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  58284. n.VertexNormalsHelper.prototype.update = function() {
  58285. var e = new n.Vector3
  58286. , t = new n.Vector3
  58287. , i = new n.Matrix3;
  58288. return function() {
  58289. var r = ["a", "b", "c"];
  58290. this.object.updateMatrixWorld(!0),
  58291. i.getNormalMatrix(this.object.matrixWorld);
  58292. var o = this.object.matrixWorld
  58293. , a = this.geometry.attributes.position
  58294. , s = this.object.geometry;
  58295. if (s instanceof n.Geometry)
  58296. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  58297. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  58298. var m = l[p[r[f]]]
  58299. , v = p.vertexNormals[f];
  58300. e.copy(m).applyMatrix4(o),
  58301. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58302. a.setXYZ(h, e.x, e.y, e.z),
  58303. h += 1,
  58304. a.setXYZ(h, t.x, t.y, t.z),
  58305. h += 1
  58306. }
  58307. else if (s instanceof n.BufferGeometry)
  58308. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  58309. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  58310. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  58311. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  58312. a.setXYZ(h, e.x, e.y, e.z),
  58313. h += 1,
  58314. a.setXYZ(h, t.x, t.y, t.z),
  58315. h += 1;
  58316. return a.needsUpdate = !0,
  58317. this
  58318. }
  58319. }(),
  58320. n.WireframeHelper = function(e, t) {
  58321. var i = void 0 !== t ? t : 16777215;
  58322. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  58323. color: i
  58324. })),
  58325. this.matrix = e.matrixWorld,
  58326. this.matrixAutoUpdate = !1
  58327. }
  58328. ,
  58329. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  58330. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  58331. n.ImmediateRenderObject = function(e) {
  58332. n.Object3D.call(this),
  58333. this.material = e,
  58334. this.render = function(e) {}
  58335. }
  58336. ,
  58337. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  58338. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  58339. n.MorphBlendMesh = function(e, t) {
  58340. n.Mesh.call(this, e, t),
  58341. this.animationsMap = {},
  58342. this.animationsList = [];
  58343. var i = this.geometry.morphTargets.length
  58344. , r = "__default"
  58345. , o = 0
  58346. , a = i - 1
  58347. , s = i / 1;
  58348. this.createAnimation(r, o, a, s),
  58349. this.setAnimationWeight(r, 1)
  58350. }
  58351. ,
  58352. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  58353. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  58354. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  58355. var r = {
  58356. start: t,
  58357. end: i,
  58358. length: i - t + 1,
  58359. fps: n,
  58360. duration: (i - t) / n,
  58361. lastFrame: 0,
  58362. currentFrame: 0,
  58363. active: !1,
  58364. time: 0,
  58365. direction: 1,
  58366. weight: 1,
  58367. directionBackwards: !1,
  58368. mirroredLoop: !1
  58369. };
  58370. this.animationsMap[e] = r,
  58371. this.animationsList.push(r)
  58372. }
  58373. ,
  58374. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  58375. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  58376. var s = r.morphTargets[o]
  58377. , l = s.name.match(i);
  58378. if (l && l.length > 1) {
  58379. var c = l[1];
  58380. n[c] || (n[c] = {
  58381. start: 1 / 0,
  58382. end: -(1 / 0)
  58383. });
  58384. var h = n[c];
  58385. o < h.start && (h.start = o),
  58386. o > h.end && (h.end = o),
  58387. t || (t = c)
  58388. }
  58389. }
  58390. for (var c in n) {
  58391. var h = n[c];
  58392. this.createAnimation(c, h.start, h.end, e)
  58393. }
  58394. this.firstAnimation = t
  58395. }
  58396. ,
  58397. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  58398. var t = this.animationsMap[e];
  58399. t && (t.direction = 1,
  58400. t.directionBackwards = !1)
  58401. }
  58402. ,
  58403. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  58404. var t = this.animationsMap[e];
  58405. t && (t.direction = -1,
  58406. t.directionBackwards = !0)
  58407. }
  58408. ,
  58409. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  58410. var i = this.animationsMap[e];
  58411. i && (i.fps = t,
  58412. i.duration = (i.end - i.start) / i.fps)
  58413. }
  58414. ,
  58415. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  58416. var i = this.animationsMap[e];
  58417. i && (i.duration = t,
  58418. i.fps = (i.end - i.start) / i.duration)
  58419. }
  58420. ,
  58421. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  58422. var i = this.animationsMap[e];
  58423. i && (i.weight = t)
  58424. }
  58425. ,
  58426. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  58427. var i = this.animationsMap[e];
  58428. i && (i.time = t)
  58429. }
  58430. ,
  58431. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  58432. var t = 0
  58433. , i = this.animationsMap[e];
  58434. return i && (t = i.time),
  58435. t
  58436. }
  58437. ,
  58438. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  58439. var t = -1
  58440. , i = this.animationsMap[e];
  58441. return i && (t = i.duration),
  58442. t
  58443. }
  58444. ,
  58445. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  58446. var t = this.animationsMap[e];
  58447. t ? (t.time = 0,
  58448. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  58449. }
  58450. ,
  58451. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  58452. var t = this.animationsMap[e];
  58453. t && (t.active = !1)
  58454. }
  58455. ,
  58456. n.MorphBlendMesh.prototype.update = function(e) {
  58457. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  58458. var r = this.animationsList[t];
  58459. if (r.active) {
  58460. var o = r.duration / r.length;
  58461. r.time += r.direction * e,
  58462. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  58463. r.time > r.duration && (r.time = r.duration,
  58464. r.directionBackwards = !0),
  58465. r.time < 0 && (r.time = 0,
  58466. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  58467. r.time < 0 && (r.time += r.duration));
  58468. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  58469. , s = r.weight;
  58470. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  58471. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  58472. this.morphTargetInfluences[a] = 0,
  58473. r.lastFrame = r.currentFrame,
  58474. r.currentFrame = a);
  58475. var l = r.time % o / o;
  58476. r.directionBackwards && (l = 1 - l),
  58477. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  58478. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  58479. }
  58480. }
  58481. }
  58482. ,
  58483. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  58484. i.THREE = n) : this.THREE = n
  58485. window.THREE = n
  58486. getObjLoader()
  58487. initByTHREE(THREE)
  58488. //getWebXRManager()
  58489. }
  58490. , {}]
  58491. }, {}, [116]);
  58492. class PanTransGuide{
  58493. constructor(player){
  58494. this.player = player
  58495. this.currentIndex = 0
  58496. this.getNodes()
  58497. }
  58498. getNodes(){
  58499. this.nodes = []
  58500. let path = this.player.path
  58501. let last
  58502. let index = this.player.model.heroLocations.findIndex(e=>e.name == '沉浸看展') //先去掉之前旧的数据
  58503. if(index>-1){
  58504. let locations = this.player.model.heroLocations[index].heroLocations
  58505. this.player.model.heroLocations.splice(index,1)
  58506. }
  58507. let get = (e, originItem)=>{
  58508. if(e.cameraMode != 'panorama'){
  58509. e.originItem = originItem
  58510. this.nodes.push(e)
  58511. return last = null //断连
  58512. }
  58513. if(last){
  58514. e.visited = true
  58515. path.setWarpDestination(e)
  58516. path.setWarpDestPano()
  58517. let A = path.getHeroPano(last),
  58518. B = path.warpDestPano
  58519. if(e.momentTour == 'black' && A!=B){
  58520. path.nodes = [A.id,B.id];//直接加入
  58521. }else{
  58522. path.nodes = path.findShortestPath(A, B)
  58523. if(path.nodes == null){//两个点之间不相通
  58524. console.log('两个点之间不相通',A.id,B.id)
  58525. path.nodes = [A.id,B.id];//直接加入
  58526. }
  58527. }
  58528. let wholeDis = 0, disSections = []
  58529. path.nodes.forEach((cur,i)=>{
  58530. if(i==0)return
  58531. let prePano = this.player.model.panos.get(path.nodes[i-1])
  58532. let curPano = this.player.model.panos.get(cur)
  58533. let dis = prePano.position.distanceTo(curPano.position)
  58534. disSections.push(dis)
  58535. wholeDis += dis
  58536. },0)
  58537. let quaStart = last.quaternion
  58538. let quaEnd = e.quaternion
  58539. path.nodes.forEach((panoId,j)=>{
  58540. if(j == 0){
  58541. if(path.nodes.length == 1)return this.nodes.push({panoId,quaternion:quaEnd})//原地旋转
  58542. if(!last) return //和上一段末尾重复
  58543. return this.nodes.push({panoId,quaternion:quaStart})
  58544. }
  58545. let r = disSections[j-1] / wholeDis
  58546. let quaternion = quaStart.clone()
  58547. lerp.quaternion(quaternion, quaEnd)(r)
  58548. this.nodes.push({panoId, quaternion})
  58549. })
  58550. }
  58551. last = e
  58552. }
  58553. this.player.model.heroLocations.forEach((e,i)=>{
  58554. if(e.heroLocations){
  58555. e.heroLocations.forEach((a,j)=> get(a, [i,j]))
  58556. }else{
  58557. get(e,[i,0])
  58558. }
  58559. })
  58560. //补 因为last前一个可能不是panorama,导致last没加进nodes
  58561. if(last && !last.visited){
  58562. get(last)
  58563. }
  58564. }
  58565. go(axis){
  58566. if(this.player.flying)return
  58567. let aimNode
  58568. let cur = this.nodes[this.currentIndex]
  58569. if(cur.panoId != this.player.currentPano.id && player.mode == 'panorama'){//已走动){//已走动
  58570. let curs = this.nodes.filter(e=>e.panoId == this.player.currentPano)
  58571. curs.sort((a,b)=>{ //如果有多个,找到和currentIndex最接近的,可能是刚走过的
  58572. let indexA = this.nodes.indexOf(a)
  58573. let indexB = this.nodes.indexOf(b)
  58574. return Math.abs(indexA - this.currentIndex) < Math.abs(indexB - this.currentIndex)
  58575. })
  58576. cur = curs[0]
  58577. if(!cur){//不在道上 . 找离当前位置最近的node
  58578. let disMap = new Map
  58579. let nodes_ = this.nodes.filter(e=>!e.originItem)
  58580. nodes_.forEach(e=>{
  58581. disMap.set(e,player.currentPano.position.distanceToSquared(this.player.model.panos.get(e.panoId).position))
  58582. })
  58583. let sorted = nodes_.slice().sort((a,b)=>{
  58584. return disMap.get(a) - disMap.get(b)
  58585. })
  58586. this.currentIndex = this.nodes.indexOf(sorted[0])//next
  58587. if(axis == -1){
  58588. this.moveIndex(-1)
  58589. }
  58590. aimNode = this.nodes[this.currentIndex]
  58591. }
  58592. }
  58593. let lastIndex = this.currentIndex
  58594. if(!aimNode){
  58595. this.moveIndex(axis)
  58596. aimNode = this.nodes[this.currentIndex]
  58597. }
  58598. if(aimNode.originItem){//要飞出的,直接用导览飞
  58599. player.director.setDestinationItem(aimNode.originItem)
  58600. player.director.goToDestination()
  58601. return
  58602. }
  58603. //let dis = this.player.model.panos.get(aimNode.panoId).position.distanceTo(this.player.position)
  58604. let moveStyle = (lastIndex == 0 && axis == -1 || this.currentIndex == 0 && axis != -1) ? "blackToPano" : "flyToPano"
  58605. this.player[moveStyle]({pano: this.player.model.panos.get(aimNode.panoId), quaternion:aimNode.quaternion}, ()=>{
  58606. //更新导览进度条
  58607. player.director.setDestinationItem( player.director.findNearestItem(true,true) )
  58608. })
  58609. }
  58610. moveIndex(step){
  58611. this.currentIndex += (step + this.nodes.length)
  58612. this.currentIndex %= this.nodes.length
  58613. return this.currentIndex
  58614. }
  58615. }
  58616. //2025新的需求 沉浸看展直接使用导览
  58617. window.tourPlayCtl = {
  58618. go(axis){
  58619. player.guider2.go(axis)
  58620. }
  58621. }
  58622. /*
  58623. function getWebXRManager(){
  58624. class ArrayCamera extends THREE.PerspectiveCamera {
  58625. constructor(array = []) {
  58626. super();
  58627. this.isArrayCamera = true;
  58628. this.cameras = array;
  58629. }
  58630. }
  58631. function WebGLAnimation() {
  58632. let context = null;
  58633. let isAnimating = false;
  58634. let animationLoop = null;
  58635. let requestId = null;
  58636. function onAnimationFrame(time, frame) {
  58637. animationLoop(time, frame);
  58638. requestId = context.requestAnimationFrame(onAnimationFrame);
  58639. }
  58640. return {
  58641. start: function () {
  58642. if (isAnimating === true) return;
  58643. if (animationLoop === null) return;
  58644. requestId = context.requestAnimationFrame(onAnimationFrame);
  58645. isAnimating = true;
  58646. },
  58647. stop: function () {
  58648. context.cancelAnimationFrame(requestId);
  58649. isAnimating = false;
  58650. },
  58651. setAnimationLoop: function (callback) {
  58652. animationLoop = callback;
  58653. },
  58654. setContext: function (value) {
  58655. context = value;
  58656. }
  58657. };
  58658. }
  58659. function WebXRManager( renderer, gl ) {
  58660. var scope = this;
  58661. var session = null;
  58662. // var framebufferScaleFactor = 1.0;
  58663. var referenceSpace = null;
  58664. var referenceSpaceType = 'local-floor';
  58665. var pose = null;
  58666. var controllers = [];
  58667. var sortedInputSources = [];
  58668. function isPresenting() {
  58669. return session !== null && referenceSpace !== null;
  58670. }
  58671. //
  58672. var cameraL = new THREE.PerspectiveCamera();
  58673. cameraL.layers.enable( 1 );
  58674. cameraL.viewport = new THREE.Vector4();
  58675. var cameraR = new THREE.PerspectiveCamera();
  58676. cameraR.layers.enable( 2 );
  58677. cameraR.viewport = new THREE.Vector4();
  58678. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  58679. cameraVR.layers.enable( 1 );
  58680. cameraVR.layers.enable( 2 );
  58681. //
  58682. this.enabled = false;
  58683. this.getController = function ( id ) {
  58684. var controller = controllers[ id ];
  58685. if ( controller === undefined ) {
  58686. controller = new THREE.Group();
  58687. controller.matrixAutoUpdate = false;
  58688. controller.visible = false;
  58689. controllers[ id ] = controller;
  58690. }
  58691. return controller;
  58692. };
  58693. //
  58694. function onSessionEvent( event ) {
  58695. for ( var i = 0; i < controllers.length; i ++ ) {
  58696. if ( sortedInputSources[ i ] === event.inputSource ) {
  58697. controllers[ i ].dispatchEvent( { type: event.type } );
  58698. }
  58699. }
  58700. }
  58701. function onSessionEnd() {
  58702. renderer.setFramebuffer( null );
  58703. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  58704. animation.stop();
  58705. scope.dispatchEvent( { type: 'sessionend' } );
  58706. }
  58707. function onRequestReferenceSpace( value ) {
  58708. referenceSpace = value;
  58709. animation.setContext( session );
  58710. animation.start();
  58711. scope.dispatchEvent( { type: 'sessionstart' } );
  58712. }
  58713. this.setFramebufferScaleFactor = function ( ) {
  58714. // framebufferScaleFactor = value;
  58715. };
  58716. this.setReferenceSpaceType = function ( value ) {
  58717. referenceSpaceType = value;
  58718. };
  58719. this.getSession = function () {
  58720. return session;
  58721. };
  58722. this.setSession = function ( value ) {
  58723. session = value;
  58724. if ( session !== null ) {
  58725. session.addEventListener( 'select', onSessionEvent );
  58726. session.addEventListener( 'selectstart', onSessionEvent );
  58727. session.addEventListener( 'selectend', onSessionEvent );
  58728. session.addEventListener( 'end', onSessionEnd );
  58729. // eslint-disable-next-line no-undef
  58730. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  58731. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  58732. //
  58733. session.addEventListener( 'inputsourceschange', updateInputSources );
  58734. updateInputSources();
  58735. }
  58736. };
  58737. function updateInputSources() {
  58738. for ( var i = 0; i < controllers.length; i ++ ) {
  58739. sortedInputSources[ i ] = findInputSource( i );
  58740. }
  58741. }
  58742. function findInputSource( id ) {
  58743. var inputSources = session.inputSources;
  58744. for ( var i = 0; i < inputSources.length; i ++ ) {
  58745. var inputSource = inputSources[ i ];
  58746. var handedness = inputSource.handedness;
  58747. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  58748. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  58749. }
  58750. }
  58751. //
  58752. function updateCamera( camera, parent ) {
  58753. if ( parent === null ) {
  58754. camera.matrixWorld.copy( camera.matrix );
  58755. } else {
  58756. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  58757. }
  58758. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  58759. }
  58760. this.getCamera = function ( camera ) {
  58761. if ( isPresenting() ) {
  58762. var parent = camera.parent;
  58763. var cameras = cameraVR.cameras;
  58764. updateCamera( cameraVR, parent );
  58765. for ( var i = 0; i < cameras.length; i ++ ) {
  58766. updateCamera( cameras[ i ], parent );
  58767. }
  58768. // update camera and its children
  58769. camera.matrixWorld.copy( cameraVR.matrixWorld );
  58770. var children = camera.children;
  58771. for ( var i = 0, l = children.length; i < l; i ++ ) {
  58772. children[ i ].updateMatrixWorld( true );
  58773. }
  58774. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  58775. return cameraVR;
  58776. }
  58777. return camera;
  58778. };
  58779. this.isPresenting = isPresenting;
  58780. // Animation Loop
  58781. var onAnimationFrameCallback = null;
  58782. function onAnimationFrame( time, frame ) {
  58783. pose = frame.getViewerPose( referenceSpace );
  58784. if ( pose !== null ) {
  58785. var views = pose.views;
  58786. var baseLayer = session.renderState.baseLayer;
  58787. renderer.setFramebuffer( baseLayer.framebuffer );
  58788. for ( var i = 0; i < views.length; i ++ ) {
  58789. var view = views[ i ];
  58790. var viewport = baseLayer.getViewport( view );
  58791. var viewMatrix = view.transform.inverse.matrix;
  58792. var camera = cameraVR.cameras[ i ];
  58793. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  58794. camera.projectionMatrix.fromArray( view.projectionMatrix );
  58795. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  58796. if ( i === 0 ) {
  58797. cameraVR.matrix.copy( camera.matrix );
  58798. }
  58799. }
  58800. }
  58801. //
  58802. for ( var i = 0; i < controllers.length; i ++ ) {
  58803. var controller = controllers[ i ];
  58804. var inputSource = sortedInputSources[ i ];
  58805. if ( inputSource ) {
  58806. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  58807. if ( inputPose !== null ) {
  58808. controller.matrix.fromArray( inputPose.transform.matrix );
  58809. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  58810. controller.visible = true;
  58811. continue;
  58812. }
  58813. }
  58814. controller.visible = false;
  58815. }
  58816. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  58817. }
  58818. var animation = new WebGLAnimation();
  58819. animation.setAnimationLoop( onAnimationFrame );
  58820. this.setAnimationLoop = function ( callback ) {
  58821. onAnimationFrameCallback = callback;
  58822. };
  58823. this.dispose = function () {};
  58824. // DEPRECATED
  58825. this.getStandingMatrix = function () {
  58826. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  58827. return new THREE.Matrix4();
  58828. };
  58829. this.getDevice = function () {
  58830. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  58831. };
  58832. this.setDevice = function () {
  58833. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  58834. };
  58835. this.setFrameOfReferenceType = function () {
  58836. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  58837. };
  58838. this.submitFrame = function () {};
  58839. }
  58840. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  58841. THREE.WebXRManager = WebXRManager
  58842. }
  58843. function getWebXRManager(){
  58844. class ArrayCamera extends THREE.PerspectiveCamera {
  58845. constructor(array = []) {
  58846. super();
  58847. this.isArrayCamera = true;
  58848. this.cameras = array;
  58849. }
  58850. }
  58851. class WebXRController {
  58852. constructor() {
  58853. this._targetRay = null;
  58854. this._grip = null;
  58855. this._hand = null;
  58856. }
  58857. getHandSpace() {
  58858. if (this._hand === null) {
  58859. this._hand = new THREE.Group();
  58860. this._hand.matrixAutoUpdate = false;
  58861. this._hand.visible = false;
  58862. this._hand.joints = {};
  58863. this._hand.inputState = {
  58864. pinching: false
  58865. };
  58866. }
  58867. return this._hand;
  58868. }
  58869. getTargetRaySpace() {
  58870. if (this._targetRay === null) {
  58871. this._targetRay = new THREE.Group();
  58872. this._targetRay.matrixAutoUpdate = false;
  58873. this._targetRay.visible = false;
  58874. this._targetRay.hasLinearVelocity = false;
  58875. this._targetRay.linearVelocity = new THREE.Vector3();
  58876. this._targetRay.hasAngularVelocity = false;
  58877. this._targetRay.angularVelocity = new THREE.Vector3();
  58878. }
  58879. return this._targetRay;
  58880. }
  58881. getGripSpace() {
  58882. if (this._grip === null) {
  58883. this._grip = new THREE.Group();
  58884. this._grip.matrixAutoUpdate = false;
  58885. this._grip.visible = false;
  58886. this._grip.hasLinearVelocity = false;
  58887. this._grip.linearVelocity = new THREE.Vector3();
  58888. this._grip.hasAngularVelocity = false;
  58889. this._grip.angularVelocity = new THREE.Vector3();
  58890. }
  58891. return this._grip;
  58892. }
  58893. dispatchEvent(event) {
  58894. if (this._targetRay !== null) {
  58895. this._targetRay.dispatchEvent(event);
  58896. }
  58897. if (this._grip !== null) {
  58898. this._grip.dispatchEvent(event);
  58899. }
  58900. if (this._hand !== null) {
  58901. this._hand.dispatchEvent(event);
  58902. }
  58903. return this;
  58904. }
  58905. disconnect(inputSource) {
  58906. this.dispatchEvent({
  58907. type: 'disconnected',
  58908. data: inputSource
  58909. });
  58910. if (this._targetRay !== null) {
  58911. this._targetRay.visible = false;
  58912. }
  58913. if (this._grip !== null) {
  58914. this._grip.visible = false;
  58915. }
  58916. if (this._hand !== null) {
  58917. this._hand.visible = false;
  58918. }
  58919. return this;
  58920. }
  58921. update(inputSource, frame, referenceSpace) {
  58922. let inputPose = null;
  58923. let gripPose = null;
  58924. let handPose = null;
  58925. const targetRay = this._targetRay;
  58926. const grip = this._grip;
  58927. const hand = this._hand;
  58928. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  58929. if (hand && inputSource.hand) {
  58930. handPose = true;
  58931. for (const inputjoint of inputSource.hand.values()) {
  58932. // Update the joints groups with the XRJoint poses
  58933. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  58934. if (hand.joints[inputjoint.jointName] === undefined) {
  58935. // The transform of this joint will be updated with the joint pose on each frame
  58936. const joint = new THREE.Group();
  58937. joint.matrixAutoUpdate = false;
  58938. joint.visible = false;
  58939. hand.joints[inputjoint.jointName] = joint; // ??
  58940. hand.add(joint);
  58941. }
  58942. const joint = hand.joints[inputjoint.jointName];
  58943. if (jointPose !== null) {
  58944. joint.matrix.fromArray(jointPose.transform.matrix);
  58945. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  58946. joint.jointRadius = jointPose.radius;
  58947. }
  58948. joint.visible = jointPose !== null;
  58949. } // Custom events
  58950. // Check pinchz
  58951. const indexTip = hand.joints['index-finger-tip'];
  58952. const thumbTip = hand.joints['thumb-tip'];
  58953. const distance = indexTip.position.distanceTo(thumbTip.position);
  58954. const distanceToPinch = 0.02;
  58955. const threshold = 0.005;
  58956. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  58957. hand.inputState.pinching = false;
  58958. this.dispatchEvent({
  58959. type: 'pinchend',
  58960. handedness: inputSource.handedness,
  58961. target: this
  58962. });
  58963. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  58964. hand.inputState.pinching = true;
  58965. this.dispatchEvent({
  58966. type: 'pinchstart',
  58967. handedness: inputSource.handedness,
  58968. target: this
  58969. });
  58970. }
  58971. } else {
  58972. if (grip !== null && inputSource.gripSpace) {
  58973. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  58974. if (gripPose !== null) {
  58975. grip.matrix.fromArray(gripPose.transform.matrix);
  58976. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  58977. if (gripPose.linearVelocity) {
  58978. grip.hasLinearVelocity = true;
  58979. grip.linearVelocity.copy(gripPose.linearVelocity);
  58980. } else {
  58981. grip.hasLinearVelocity = false;
  58982. }
  58983. if (gripPose.angularVelocity) {
  58984. grip.hasAngularVelocity = true;
  58985. grip.angularVelocity.copy(gripPose.angularVelocity);
  58986. } else {
  58987. grip.hasAngularVelocity = false;
  58988. }
  58989. }
  58990. }
  58991. }
  58992. if (targetRay !== null) {
  58993. 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
  58994. if (inputPose === null && gripPose !== null) {
  58995. inputPose = gripPose;
  58996. }
  58997. if (inputPose !== null) {
  58998. targetRay.matrix.fromArray(inputPose.transform.matrix);
  58999. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  59000. if (inputPose.linearVelocity) {
  59001. targetRay.hasLinearVelocity = true;
  59002. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  59003. } else {
  59004. targetRay.hasLinearVelocity = false;
  59005. }
  59006. if (inputPose.angularVelocity) {
  59007. targetRay.hasAngularVelocity = true;
  59008. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  59009. } else {
  59010. targetRay.hasAngularVelocity = false;
  59011. }
  59012. this.dispatchEvent(_moveEvent);
  59013. }
  59014. }
  59015. }
  59016. if (targetRay !== null) {
  59017. targetRay.visible = inputPose !== null;
  59018. }
  59019. if (grip !== null) {
  59020. grip.visible = gripPose !== null;
  59021. }
  59022. if (hand !== null) {
  59023. hand.visible = handPose !== null;
  59024. }
  59025. return this;
  59026. }
  59027. }
  59028. function WebGLAnimation() {
  59029. let context = null;
  59030. let isAnimating = false;
  59031. let animationLoop = null;
  59032. let requestId = null;
  59033. function onAnimationFrame(time, frame) {
  59034. animationLoop(time, frame);
  59035. requestId = context.requestAnimationFrame(onAnimationFrame);
  59036. }
  59037. return {
  59038. start: function () {
  59039. if (isAnimating === true) return;
  59040. if (animationLoop === null) return;
  59041. requestId = context.requestAnimationFrame(onAnimationFrame);
  59042. isAnimating = true;
  59043. },
  59044. stop: function () {
  59045. context.cancelAnimationFrame(requestId);
  59046. isAnimating = false;
  59047. },
  59048. setAnimationLoop: function (callback) {
  59049. animationLoop = callback;
  59050. },
  59051. setContext: function (value) {
  59052. context = value;
  59053. }
  59054. };
  59055. }
  59056. class WebXRManager extends THREE.EventDispatcher {
  59057. constructor(renderer, gl) {
  59058. super();
  59059. const scope = this;
  59060. let session = null;
  59061. let framebufferScaleFactor = 1.0;
  59062. let referenceSpace = null;
  59063. let referenceSpaceType = 'local-floor';
  59064. let customReferenceSpace = null;
  59065. let pose = null;
  59066. let glBinding = null;
  59067. let glProjLayer = null;
  59068. let glBaseLayer = null;
  59069. let xrFrame = null;
  59070. const attributes = gl.getContextAttributes();
  59071. let initialRenderTarget = null;
  59072. let newRenderTarget = null;
  59073. const controllers = [];
  59074. const controllerInputSources = []; //
  59075. const cameraL = new THREE.PerspectiveCamera();
  59076. cameraL.layers.enable(1);
  59077. cameraL.viewport = new THREE.Vector4();
  59078. const cameraR = new THREE.PerspectiveCamera();
  59079. cameraR.layers.enable(2);
  59080. cameraR.viewport = new THREE.Vector4();
  59081. const cameras = [cameraL, cameraR];
  59082. const cameraVR = new ArrayCamera();
  59083. cameraVR.layers.enable(1);
  59084. cameraVR.layers.enable(2);
  59085. let _currentDepthNear = null;
  59086. let _currentDepthFar = null; //
  59087. this.cameraAutoUpdate = true;
  59088. this.enabled = false;
  59089. this.isPresenting = false;
  59090. this.getController = function (index) {
  59091. let controller = controllers[index];
  59092. if (controller === undefined) {
  59093. controller = new WebXRController();
  59094. controllers[index] = controller;
  59095. }
  59096. return controller.getTargetRaySpace();
  59097. };
  59098. this.getControllerGrip = function (index) {
  59099. let controller = controllers[index];
  59100. if (controller === undefined) {
  59101. controller = new WebXRController();
  59102. controllers[index] = controller;
  59103. }
  59104. return controller.getGripSpace();
  59105. };
  59106. this.getHand = function (index) {
  59107. let controller = controllers[index];
  59108. if (controller === undefined) {
  59109. controller = new WebXRController();
  59110. controllers[index] = controller;
  59111. }
  59112. return controller.getHandSpace();
  59113. }; //
  59114. function onSessionEvent(event) {
  59115. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  59116. if (controllerIndex === -1) {
  59117. return;
  59118. }
  59119. const controller = controllers[controllerIndex];
  59120. if (controller !== undefined) {
  59121. controller.dispatchEvent({
  59122. type: event.type,
  59123. data: event.inputSource
  59124. });
  59125. }
  59126. }
  59127. function onSessionEnd() {
  59128. session.removeEventListener('select', onSessionEvent);
  59129. session.removeEventListener('selectstart', onSessionEvent);
  59130. session.removeEventListener('selectend', onSessionEvent);
  59131. session.removeEventListener('squeeze', onSessionEvent);
  59132. session.removeEventListener('squeezestart', onSessionEvent);
  59133. session.removeEventListener('squeezeend', onSessionEvent);
  59134. session.removeEventListener('end', onSessionEnd);
  59135. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  59136. for (let i = 0; i < controllers.length; i++) {
  59137. const inputSource = controllerInputSources[i];
  59138. if (inputSource === null) continue;
  59139. controllerInputSources[i] = null;
  59140. controllers[i].disconnect(inputSource);
  59141. }
  59142. _currentDepthNear = null;
  59143. _currentDepthFar = null; // restore framebuffer/rendering state
  59144. renderer.setRenderTarget(initialRenderTarget);
  59145. glBaseLayer = null;
  59146. glProjLayer = null;
  59147. glBinding = null;
  59148. session = null;
  59149. newRenderTarget = null; //
  59150. animation.stop();
  59151. scope.isPresenting = false;
  59152. scope.dispatchEvent({
  59153. type: 'sessionend'
  59154. });
  59155. }
  59156. this.setFramebufferScaleFactor = function (value) {
  59157. framebufferScaleFactor = value;
  59158. if (scope.isPresenting === true) {
  59159. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  59160. }
  59161. };
  59162. this.setReferenceSpaceType = function (value) {
  59163. referenceSpaceType = value;
  59164. if (scope.isPresenting === true) {
  59165. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  59166. }
  59167. };
  59168. this.getReferenceSpace = function () {
  59169. return customReferenceSpace || referenceSpace;
  59170. };
  59171. this.setReferenceSpace = function (space) {
  59172. customReferenceSpace = space;
  59173. };
  59174. this.getBaseLayer = function () {
  59175. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  59176. };
  59177. this.getBinding = function () {
  59178. return glBinding;
  59179. };
  59180. this.getFrame = function () {
  59181. return xrFrame;
  59182. };
  59183. this.getSession = function () {
  59184. return session;
  59185. };
  59186. this.setSession = async function (value) {
  59187. session = value;
  59188. if (session !== null) {
  59189. initialRenderTarget = renderer.getCurrentRenderTarget();
  59190. session.addEventListener('select', onSessionEvent);
  59191. session.addEventListener('selectstart', onSessionEvent);
  59192. session.addEventListener('selectend', onSessionEvent);
  59193. session.addEventListener('squeeze', onSessionEvent);
  59194. session.addEventListener('squeezestart', onSessionEvent);
  59195. session.addEventListener('squeezeend', onSessionEvent);
  59196. session.addEventListener('end', onSessionEnd);
  59197. session.addEventListener('inputsourceschange', onInputSourcesChange);
  59198. if (attributes.xrCompatible !== true) {
  59199. await gl.makeXRCompatible();
  59200. }
  59201. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  59202. const layerInit = {
  59203. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  59204. alpha: attributes.alpha,
  59205. depth: attributes.depth,
  59206. stencil: attributes.stencil,
  59207. framebufferScaleFactor: framebufferScaleFactor
  59208. };
  59209. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  59210. session.updateRenderState({
  59211. baseLayer: glBaseLayer
  59212. });
  59213. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  59214. format: THREE.RGBAFormat,
  59215. type: THREE.UnsignedByteType,
  59216. encoding: renderer.outputEncoding
  59217. });
  59218. } else {
  59219. let depthFormat = null;
  59220. let depthType = null;
  59221. let glDepthFormat = null;
  59222. if (attributes.depth) {
  59223. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  59224. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  59225. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  59226. }
  59227. const projectionlayerInit = {
  59228. colorFormat: gl.RGBA8,
  59229. depthFormat: glDepthFormat,
  59230. scaleFactor: framebufferScaleFactor
  59231. };
  59232. glBinding = new XRWebGLBinding(session, gl);
  59233. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  59234. session.updateRenderState({
  59235. layers: [glProjLayer]
  59236. });
  59237. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  59238. format: THREE.RGBAFormat,
  59239. type: THREE.UnsignedByteType,
  59240. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  59241. stencilBuffer: attributes.stencil,
  59242. encoding: renderer.outputEncoding,
  59243. samples: attributes.antialias ? 4 : 0
  59244. });
  59245. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  59246. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  59247. }
  59248. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  59249. // Set foveation to maximum.
  59250. this.setFoveation(1.0);
  59251. customReferenceSpace = null;
  59252. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  59253. animation.setContext(session);
  59254. animation.start();
  59255. scope.isPresenting = true;
  59256. scope.dispatchEvent({
  59257. type: 'sessionstart'
  59258. });
  59259. }
  59260. };
  59261. function onInputSourcesChange(event) {
  59262. // Notify disconnected
  59263. for (let i = 0; i < event.removed.length; i++) {
  59264. const inputSource = event.removed[i];
  59265. const index = controllerInputSources.indexOf(inputSource);
  59266. if (index >= 0) {
  59267. controllerInputSources[index] = null;
  59268. controllers[index].dispatchEvent({
  59269. type: 'disconnected',
  59270. data: inputSource
  59271. });
  59272. }
  59273. } // Notify connected
  59274. for (let i = 0; i < event.added.length; i++) {
  59275. const inputSource = event.added[i];
  59276. let controllerIndex = controllerInputSources.indexOf(inputSource);
  59277. if (controllerIndex === -1) {
  59278. // Assign input source a controller that currently has no input source
  59279. for (let i = 0; i < controllers.length; i++) {
  59280. if (i >= controllerInputSources.length) {
  59281. controllerInputSources.push(inputSource);
  59282. controllerIndex = i;
  59283. break;
  59284. } else if (controllerInputSources[i] === null) {
  59285. controllerInputSources[i] = inputSource;
  59286. controllerIndex = i;
  59287. break;
  59288. }
  59289. } // If all controllers do currently receive input we ignore new ones
  59290. if (controllerIndex === -1) break;
  59291. }
  59292. const controller = controllers[controllerIndex];
  59293. if (controller) {
  59294. controller.dispatchEvent({
  59295. type: 'connected',
  59296. data: inputSource
  59297. });
  59298. }
  59299. }
  59300. } //
  59301. const cameraLPos = new THREE.Vector3();
  59302. const cameraRPos = new THREE.Vector3();
  59303. function setProjectionFromUnion(camera, cameraL, cameraR) {
  59304. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  59305. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  59306. const ipd = cameraLPos.distanceTo(cameraRPos);
  59307. const projL = cameraL.projectionMatrix.elements;
  59308. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  59309. // most likely identical top and bottom frustum extents.
  59310. // Use the left camera for these values.
  59311. const near = projL[14] / (projL[10] - 1);
  59312. const far = projL[14] / (projL[10] + 1);
  59313. const topFov = (projL[9] + 1) / projL[5];
  59314. const bottomFov = (projL[9] - 1) / projL[5];
  59315. const leftFov = (projL[8] - 1) / projL[0];
  59316. const rightFov = (projR[8] + 1) / projR[0];
  59317. const left = near * leftFov;
  59318. const right = near * rightFov; // Calculate the new camera's position offset from the
  59319. // left camera. xOffset should be roughly half `ipd`.
  59320. const zOffset = ipd / (-leftFov + rightFov);
  59321. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  59322. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  59323. camera.translateX(xOffset);
  59324. camera.translateZ(zOffset);
  59325. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  59326. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  59327. // the values so that the near plane's position does not change in world space,
  59328. // although must now be relative to the new union camera.
  59329. const near2 = near + zOffset;
  59330. const far2 = far + zOffset;
  59331. const left2 = left - xOffset;
  59332. const right2 = right + (ipd - xOffset);
  59333. const top2 = topFov * far / far2 * near2;
  59334. const bottom2 = bottomFov * far / far2 * near2;
  59335. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  59336. }
  59337. function updateCamera(camera, parent) {
  59338. if (parent === null) {
  59339. camera.matrixWorld.copy(camera.matrix);
  59340. } else {
  59341. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  59342. }
  59343. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  59344. }
  59345. this.updateCamera = function (camera) {
  59346. if (session === null) return;
  59347. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  59348. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  59349. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  59350. // Note that the new renderState won't apply until the next frame. See #18320
  59351. session.updateRenderState({
  59352. depthNear: cameraVR.near,
  59353. depthFar: cameraVR.far
  59354. });
  59355. _currentDepthNear = cameraVR.near;
  59356. _currentDepthFar = cameraVR.far;
  59357. }
  59358. const parent = camera.parent;
  59359. const cameras = cameraVR.cameras;
  59360. updateCamera(cameraVR, parent);
  59361. for (let i = 0; i < cameras.length; i++) {
  59362. updateCamera(cameras[i], parent);
  59363. }
  59364. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  59365. camera.position.copy(cameraVR.position);
  59366. camera.quaternion.copy(cameraVR.quaternion);
  59367. camera.scale.copy(cameraVR.scale);
  59368. camera.matrix.copy(cameraVR.matrix);
  59369. camera.matrixWorld.copy(cameraVR.matrixWorld);
  59370. const children = camera.children;
  59371. for (let i = 0, l = children.length; i < l; i++) {
  59372. children[i].updateMatrixWorld(true);
  59373. } // update projection matrix for proper view frustum culling
  59374. if (cameras.length === 2) {
  59375. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  59376. } else {
  59377. // assume single camera setup (AR)
  59378. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  59379. }
  59380. };
  59381. this.getCamera = function () {
  59382. return cameraVR;
  59383. };
  59384. this.getFoveation = function () {
  59385. if (glProjLayer !== null) {
  59386. return glProjLayer.fixedFoveation;
  59387. }
  59388. if (glBaseLayer !== null) {
  59389. return glBaseLayer.fixedFoveation;
  59390. }
  59391. return undefined;
  59392. };
  59393. this.setFoveation = function (foveation) {
  59394. // 0 = no foveation = full resolution
  59395. // 1 = maximum foveation = the edges render at lower resolution
  59396. if (glProjLayer !== null) {
  59397. glProjLayer.fixedFoveation = foveation;
  59398. }
  59399. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  59400. glBaseLayer.fixedFoveation = foveation;
  59401. }
  59402. }; // Animation Loop
  59403. let onAnimationFrameCallback = null;
  59404. function onAnimationFrame(time, frame) {
  59405. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  59406. xrFrame = frame;
  59407. if (pose !== null) {
  59408. const views = pose.views;
  59409. if (glBaseLayer !== null) {
  59410. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  59411. renderer.setRenderTarget(newRenderTarget);
  59412. }
  59413. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  59414. if (views.length !== cameraVR.cameras.length) {
  59415. cameraVR.cameras.length = 0;
  59416. cameraVRNeedsUpdate = true;
  59417. }
  59418. for (let i = 0; i < views.length; i++) {
  59419. const view = views[i];
  59420. let viewport = null;
  59421. if (glBaseLayer !== null) {
  59422. viewport = glBaseLayer.getViewport(view);
  59423. } else {
  59424. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  59425. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  59426. if (i === 0) {
  59427. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  59428. renderer.setRenderTarget(newRenderTarget);
  59429. }
  59430. }
  59431. let camera = cameras[i];
  59432. if (camera === undefined) {
  59433. camera = new THREE.PerspectiveCamera();
  59434. camera.layers.enable(i);
  59435. camera.viewport = new THREE.Vector4();
  59436. cameras[i] = camera;
  59437. }
  59438. camera.matrix.fromArray(view.transform.matrix);
  59439. camera.projectionMatrix.fromArray(view.projectionMatrix);
  59440. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  59441. if (i === 0) {
  59442. cameraVR.matrix.copy(camera.matrix);
  59443. }
  59444. if (cameraVRNeedsUpdate === true) {
  59445. cameraVR.cameras.push(camera);
  59446. }
  59447. }
  59448. } //
  59449. for (let i = 0; i < controllers.length; i++) {
  59450. const inputSource = controllerInputSources[i];
  59451. const controller = controllers[i];
  59452. if (inputSource !== null && controller !== undefined) {
  59453. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  59454. }
  59455. }
  59456. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  59457. xrFrame = null;
  59458. }
  59459. const animation = new WebGLAnimation();
  59460. animation.setAnimationLoop(onAnimationFrame);
  59461. this.setAnimationLoop = function (callback) {
  59462. onAnimationFrameCallback = callback;
  59463. };
  59464. this.dispose = function () {};
  59465. }
  59466. }
  59467. THREE.WebXRManager = WebXRManager
  59468. } */
  59469. /*
  59470. var addMagnifier = function(){
  59471. class Magnifier extends THREE.Object3D {
  59472. constructor () {
  59473. super()
  59474. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  59475. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  59476. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  59477. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  59478. format: THREE.RGBAFormat ,
  59479. //type: THREE.FloatType,
  59480. //minFilter: THREE.NearestFilter,
  59481. //magFilter: THREE.NearestFilter,
  59482. } )
  59483. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  59484. side: THREE.DoubleSide ,
  59485. map: this.renderTarget.texture ,
  59486. transparent:true,
  59487. depthTest: !1,
  59488. depthWrite: !1,
  59489. }))
  59490. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  59491. side: THREE.DoubleSide ,
  59492. map: Texture.load('images/crosshair.png') ,
  59493. transparent:true,
  59494. depthTest: !1,
  59495. depthWrite: !1,
  59496. }))
  59497. this.add(this.mesh)
  59498. this.add(this.overlayMesh)
  59499. player.model.add(this);
  59500. player.magnifier = this;
  59501. }
  59502. update(aimPos){
  59503. const magDistance_ = 0.3;
  59504. var playerPos = player.position
  59505. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  59506. this.camera.position.copy(aimPos.clone().add(vec))
  59507. this.camera.lookAt(aimPos)
  59508. var playerCamera = player.camera
  59509. this.quaternion.copy(playerCamera.quaternion);
  59510. var pos2d = player.mouse.clone();
  59511. var shift = 400;
  59512. var clientHeight = player.domElement.clientHeight
  59513. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  59514. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  59515. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  59516. this.position.copy(newPos)
  59517. var renderer = player.sceneRenderer.renderer
  59518. var oldAutoClear = renderer.autoClear
  59519. renderer.autoClear = false
  59520. //renderer.clear( true, true, true );
  59521. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  59522. renderer.autoClear = oldAutoClear
  59523. }
  59524. }
  59525. new Magnifier()
  59526. }
  59527. */
  59528. /*
  59529. 笔记:
  59530. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  59531. {
  59532. //到导览中某个点位(假设点位不重复)
  59533. var id = 73
  59534. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  59535. var i = player.model.heroLocations.indexOf(p)
  59536. var p1 = p.heroLocations.find(e=>e.panoId == id)
  59537. var j = p.heroLocations.indexOf(p1)
  59538. player.director.goToHighlight([i,j])
  59539. }
  59540. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  59541. 关于pc-nav 4k
  59542. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  59543. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  59544. 如果body使用transform旋转90度,需要改的地方:
  59545. convertScreenPositionToNDC: function(e, t, i) {//rotate 90 body: transform: rotate(90deg);
  59546. return i = i || new n.Vector2,
  59547. i.y = e / $("#player").height() * 2 - 1, //注意,当body旋转90度后,虽然clientX和clinetY是按照正常垂直视角,但player的长宽和原先一样,不会因为倒转而交换
  59548. i.x = t / $("#player").width() * 2 - 1,
  59549. i
  59550. },
  59551. outsideControl的 n.prototype.onTouchMove = function(e) {中的
  59552. this.pan(this.panDelta.x, this.panDelta.y) 改为 this.pan(this.panDelta.y, -this.panDelta.x), //rotate 90
  59553. 还有
  59554. this.rotateLeft(2 * Math.PI * this.rotateDelta.y / $("#player").width() * this.rotateSpeed), //rotate 90
  59555. this.rotateUp(2 * Math.PI * -this.rotateDelta.x / $("#player").height() * this.rotateSpeed),
  59556. ===================
  59557. 一些事件
  59558. player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{//楼层变化
  59559. player.on("pano.chosen", 旧的pano, 新的pano) //点位变化前
  59560. player.on("flying.ended", 新位置, 旧位置, 新的pano, 旧的pano) //点位变化后,或飞出后
  59561. 一些后缀
  59562. &panoLabel 加pano标签
  59563. director.on("tour.end") //导览结束 是否在导览播放中:player.director.tourInProgress() 不包括点击item
  59564. player.isWarping() //是否在导览中,包括点击item的fly
  59565. 我加了个 director.on("warp.end")
  59566. */