main_2020_show.js 2.5 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759247602476124762247632476424765247662476724768247692477024771247722477324774247752477624777247782477924780247812478224783247842478524786247872478824789247902479124792247932479424795247962479724798247992480024801248022480324804248052480624807248082480924810248112481224813248142481524816248172481824819248202482124822248232482424825248262482724828248292483024831248322483324834248352483624837248382483924840248412484224843248442484524846248472484824849248502485124852248532485424855248562485724858248592486024861248622486324864248652486624867248682486924870248712487224873248742487524876248772487824879248802488124882248832488424885248862488724888248892489024891248922489324894248952489624897248982489924900249012490224903249042490524906249072490824909249102491124912249132491424915249162491724918249192492024921249222492324924249252492624927249282492924930249312493224933249342493524936249372493824939249402494124942249432494424945249462494724948249492495024951249522495324954249552495624957249582495924960249612496224963249642496524966249672496824969249702497124972249732497424975249762497724978249792498024981249822498324984249852498624987249882498924990249912499224993249942499524996249972499824999250002500125002250032500425005250062500725008250092501025011250122501325014250152501625017250182501925020250212502225023250242502525026250272502825029250302503125032250332503425035250362503725038250392504025041250422504325044250452504625047250482504925050250512505225053250542505525056250572505825059250602506125062250632506425065250662506725068250692507025071250722507325074250752507625077250782507925080250812508225083250842508525086250872508825089250902509125092250932509425095250962509725098250992510025101251022510325104251052510625107251082510925110251112511225113251142511525116251172511825119251202512125122251232512425125251262512725128251292513025131251322513325134251352513625137251382513925140251412514225143251442514525146251472514825149251502515125152251532515425155251562515725158251592516025161251622516325164251652516625167251682516925170251712517225173251742517525176251772517825179251802518125182251832518425185251862518725188251892519025191251922519325194251952519625197251982519925200252012520225203252042520525206252072520825209252102521125212252132521425215252162521725218252192522025221252222522325224252252522625227252282522925230252312523225233252342523525236252372523825239252402524125242252432524425245252462524725248252492525025251252522525325254252552525625257252582525925260252612526225263252642526525266252672526825269252702527125272252732527425275252762527725278252792528025281252822528325284252852528625287252882528925290252912529225293252942529525296252972529825299253002530125302253032530425305253062530725308253092531025311253122531325314253152531625317253182531925320253212532225323253242532525326253272532825329253302533125332253332533425335253362533725338253392534025341253422534325344253452534625347253482534925350253512535225353253542535525356253572535825359253602536125362253632536425365253662536725368253692537025371253722537325374253752537625377253782537925380253812538225383253842538525386253872538825389253902539125392253932539425395253962539725398253992540025401254022540325404254052540625407254082540925410254112541225413254142541525416254172541825419254202542125422254232542425425254262542725428254292543025431254322543325434254352543625437254382543925440254412544225443254442544525446254472544825449254502545125452254532545425455254562545725458254592546025461254622546325464254652546625467254682546925470254712547225473254742547525476254772547825479254802548125482254832548425485254862548725488254892549025491254922549325494254952549625497254982549925500255012550225503255042550525506255072550825509255102551125512255132551425515255162551725518255192552025521255222552325524255252552625527255282552925530255312553225533255342553525536255372553825539255402554125542255432554425545255462554725548255492555025551255522555325554255552555625557255582555925560255612556225563255642556525566255672556825569255702557125572255732557425575255762557725578255792558025581255822558325584255852558625587255882558925590255912559225593255942559525596255972559825599256002560125602256032560425605256062560725608256092561025611256122561325614256152561625617256182561925620256212562225623256242562525626256272562825629256302563125632256332563425635256362563725638256392564025641256422564325644256452564625647256482564925650256512565225653256542565525656256572565825659256602566125662256632566425665256662566725668256692567025671256722567325674256752567625677256782567925680256812568225683256842568525686256872568825689256902569125692256932569425695256962569725698256992570025701257022570325704257052570625707257082570925710257112571225713257142571525716257172571825719257202572125722257232572425725257262572725728257292573025731257322573325734257352573625737257382573925740257412574225743257442574525746257472574825749257502575125752257532575425755257562575725758257592576025761257622576325764257652576625767257682576925770257712577225773257742577525776257772577825779257802578125782257832578425785257862578725788257892579025791257922579325794257952579625797257982579925800258012580225803258042580525806258072580825809258102581125812258132581425815258162581725818258192582025821258222582325824258252582625827258282582925830258312583225833258342583525836258372583825839258402584125842258432584425845258462584725848258492585025851258522585325854258552585625857258582585925860258612586225863258642586525866258672586825869258702587125872258732587425875258762587725878258792588025881258822588325884258852588625887258882588925890258912589225893258942589525896258972589825899259002590125902259032590425905259062590725908259092591025911259122591325914259152591625917259182591925920259212592225923259242592525926259272592825929259302593125932259332593425935259362593725938259392594025941259422594325944259452594625947259482594925950259512595225953259542595525956259572595825959259602596125962259632596425965259662596725968259692597025971259722597325974259752597625977259782597925980259812598225983259842598525986259872598825989259902599125992259932599425995259962599725998259992600026001260022600326004260052600626007260082600926010260112601226013260142601526016260172601826019260202602126022260232602426025260262602726028260292603026031260322603326034260352603626037260382603926040260412604226043260442604526046260472604826049260502605126052260532605426055260562605726058260592606026061260622606326064260652606626067260682606926070260712607226073260742607526076260772607826079260802608126082260832608426085260862608726088260892609026091260922609326094260952609626097260982609926100261012610226103261042610526106261072610826109261102611126112261132611426115261162611726118261192612026121261222612326124261252612626127261282612926130261312613226133261342613526136261372613826139261402614126142261432614426145261462614726148261492615026151261522615326154261552615626157261582615926160261612616226163261642616526166261672616826169261702617126172261732617426175261762617726178261792618026181261822618326184261852618626187261882618926190261912619226193261942619526196261972619826199262002620126202262032620426205262062620726208262092621026211262122621326214262152621626217262182621926220262212622226223262242622526226262272622826229262302623126232262332623426235262362623726238262392624026241262422624326244262452624626247262482624926250262512625226253262542625526256262572625826259262602626126262262632626426265262662626726268262692627026271262722627326274262752627626277262782627926280262812628226283262842628526286262872628826289262902629126292262932629426295262962629726298262992630026301263022630326304263052630626307263082630926310263112631226313263142631526316263172631826319263202632126322263232632426325263262632726328263292633026331263322633326334263352633626337263382633926340263412634226343263442634526346263472634826349263502635126352263532635426355263562635726358263592636026361263622636326364263652636626367263682636926370263712637226373263742637526376263772637826379263802638126382263832638426385263862638726388263892639026391263922639326394263952639626397263982639926400264012640226403264042640526406264072640826409264102641126412264132641426415264162641726418264192642026421264222642326424264252642626427264282642926430264312643226433264342643526436264372643826439264402644126442264432644426445264462644726448264492645026451264522645326454264552645626457264582645926460264612646226463264642646526466264672646826469264702647126472264732647426475264762647726478264792648026481264822648326484264852648626487264882648926490264912649226493264942649526496264972649826499265002650126502265032650426505265062650726508265092651026511265122651326514265152651626517265182651926520265212652226523265242652526526265272652826529265302653126532265332653426535265362653726538265392654026541265422654326544265452654626547265482654926550265512655226553265542655526556265572655826559265602656126562265632656426565265662656726568265692657026571265722657326574265752657626577265782657926580265812658226583265842658526586265872658826589265902659126592265932659426595265962659726598265992660026601266022660326604266052660626607266082660926610266112661226613266142661526616266172661826619266202662126622266232662426625266262662726628266292663026631266322663326634266352663626637266382663926640266412664226643266442664526646266472664826649266502665126652266532665426655266562665726658266592666026661266622666326664266652666626667266682666926670266712667226673266742667526676266772667826679266802668126682266832668426685266862668726688266892669026691266922669326694266952669626697266982669926700267012670226703267042670526706267072670826709267102671126712267132671426715267162671726718267192672026721267222672326724267252672626727267282672926730267312673226733267342673526736267372673826739267402674126742267432674426745267462674726748267492675026751267522675326754267552675626757267582675926760267612676226763267642676526766267672676826769267702677126772267732677426775267762677726778267792678026781267822678326784267852678626787267882678926790267912679226793267942679526796267972679826799268002680126802268032680426805268062680726808268092681026811268122681326814268152681626817268182681926820268212682226823268242682526826268272682826829268302683126832268332683426835268362683726838268392684026841268422684326844268452684626847268482684926850268512685226853268542685526856268572685826859268602686126862268632686426865268662686726868268692687026871268722687326874268752687626877268782687926880268812688226883268842688526886268872688826889268902689126892268932689426895268962689726898268992690026901269022690326904269052690626907269082690926910269112691226913269142691526916269172691826919269202692126922269232692426925269262692726928269292693026931269322693326934269352693626937269382693926940269412694226943269442694526946269472694826949269502695126952269532695426955269562695726958269592696026961269622696326964269652696626967269682696926970269712697226973269742697526976269772697826979269802698126982269832698426985269862698726988269892699026991269922699326994269952699626997269982699927000270012700227003270042700527006270072700827009270102701127012270132701427015270162701727018270192702027021270222702327024270252702627027270282702927030270312703227033270342703527036270372703827039270402704127042270432704427045270462704727048270492705027051270522705327054270552705627057270582705927060270612706227063270642706527066270672706827069270702707127072270732707427075270762707727078270792708027081270822708327084270852708627087270882708927090270912709227093270942709527096270972709827099271002710127102271032710427105271062710727108271092711027111271122711327114271152711627117271182711927120271212712227123271242712527126271272712827129271302713127132271332713427135271362713727138271392714027141271422714327144271452714627147271482714927150271512715227153271542715527156271572715827159271602716127162271632716427165271662716727168271692717027171271722717327174271752717627177271782717927180271812718227183271842718527186271872718827189271902719127192271932719427195271962719727198271992720027201272022720327204272052720627207272082720927210272112721227213272142721527216272172721827219272202722127222272232722427225272262722727228272292723027231272322723327234272352723627237272382723927240272412724227243272442724527246272472724827249272502725127252272532725427255272562725727258272592726027261272622726327264272652726627267272682726927270272712727227273272742727527276272772727827279272802728127282272832728427285272862728727288272892729027291272922729327294272952729627297272982729927300273012730227303273042730527306273072730827309273102731127312273132731427315273162731727318273192732027321273222732327324273252732627327273282732927330273312733227333273342733527336273372733827339273402734127342273432734427345273462734727348273492735027351273522735327354273552735627357273582735927360273612736227363273642736527366273672736827369273702737127372273732737427375273762737727378273792738027381273822738327384273852738627387273882738927390273912739227393273942739527396273972739827399274002740127402274032740427405274062740727408274092741027411274122741327414274152741627417274182741927420274212742227423274242742527426274272742827429274302743127432274332743427435274362743727438274392744027441274422744327444274452744627447274482744927450274512745227453274542745527456274572745827459274602746127462274632746427465274662746727468274692747027471274722747327474274752747627477274782747927480274812748227483274842748527486274872748827489274902749127492274932749427495274962749727498274992750027501275022750327504275052750627507275082750927510275112751227513275142751527516275172751827519275202752127522275232752427525275262752727528275292753027531275322753327534275352753627537275382753927540275412754227543275442754527546275472754827549275502755127552275532755427555275562755727558275592756027561275622756327564275652756627567275682756927570275712757227573275742757527576275772757827579275802758127582275832758427585275862758727588275892759027591275922759327594275952759627597275982759927600276012760227603276042760527606276072760827609276102761127612276132761427615276162761727618276192762027621276222762327624276252762627627276282762927630276312763227633276342763527636276372763827639276402764127642276432764427645276462764727648276492765027651276522765327654276552765627657276582765927660276612766227663276642766527666276672766827669276702767127672276732767427675276762767727678276792768027681276822768327684276852768627687276882768927690276912769227693276942769527696276972769827699277002770127702277032770427705277062770727708277092771027711277122771327714277152771627717277182771927720277212772227723277242772527726277272772827729277302773127732277332773427735277362773727738277392774027741277422774327744277452774627747277482774927750277512775227753277542775527756277572775827759277602776127762277632776427765277662776727768277692777027771277722777327774277752777627777277782777927780277812778227783277842778527786277872778827789277902779127792277932779427795277962779727798277992780027801278022780327804278052780627807278082780927810278112781227813278142781527816278172781827819278202782127822278232782427825278262782727828278292783027831278322783327834278352783627837278382783927840278412784227843278442784527846278472784827849278502785127852278532785427855278562785727858278592786027861278622786327864278652786627867278682786927870278712787227873278742787527876278772787827879278802788127882278832788427885278862788727888278892789027891278922789327894278952789627897278982789927900279012790227903279042790527906279072790827909279102791127912279132791427915279162791727918279192792027921279222792327924279252792627927279282792927930279312793227933279342793527936279372793827939279402794127942279432794427945279462794727948279492795027951279522795327954279552795627957279582795927960279612796227963279642796527966279672796827969279702797127972279732797427975279762797727978279792798027981279822798327984279852798627987279882798927990279912799227993279942799527996279972799827999280002800128002280032800428005280062800728008280092801028011280122801328014280152801628017280182801928020280212802228023280242802528026280272802828029280302803128032280332803428035280362803728038280392804028041280422804328044280452804628047280482804928050280512805228053280542805528056280572805828059280602806128062280632806428065280662806728068280692807028071280722807328074280752807628077280782807928080280812808228083280842808528086280872808828089280902809128092280932809428095280962809728098280992810028101281022810328104281052810628107281082810928110281112811228113281142811528116281172811828119281202812128122281232812428125281262812728128281292813028131281322813328134281352813628137281382813928140281412814228143281442814528146281472814828149281502815128152281532815428155281562815728158281592816028161281622816328164281652816628167281682816928170281712817228173281742817528176281772817828179281802818128182281832818428185281862818728188281892819028191281922819328194281952819628197281982819928200282012820228203282042820528206282072820828209282102821128212282132821428215282162821728218282192822028221282222822328224282252822628227282282822928230282312823228233282342823528236282372823828239282402824128242282432824428245282462824728248282492825028251282522825328254282552825628257282582825928260282612826228263282642826528266282672826828269282702827128272282732827428275282762827728278282792828028281282822828328284282852828628287282882828928290282912829228293282942829528296282972829828299283002830128302283032830428305283062830728308283092831028311283122831328314283152831628317283182831928320283212832228323283242832528326283272832828329283302833128332283332833428335283362833728338283392834028341283422834328344283452834628347283482834928350283512835228353283542835528356283572835828359283602836128362283632836428365283662836728368283692837028371283722837328374283752837628377283782837928380283812838228383283842838528386283872838828389283902839128392283932839428395283962839728398283992840028401284022840328404284052840628407284082840928410284112841228413284142841528416284172841828419284202842128422284232842428425284262842728428284292843028431284322843328434284352843628437284382843928440284412844228443284442844528446284472844828449284502845128452284532845428455284562845728458284592846028461284622846328464284652846628467284682846928470284712847228473284742847528476284772847828479284802848128482284832848428485284862848728488284892849028491284922849328494284952849628497284982849928500285012850228503285042850528506285072850828509285102851128512285132851428515285162851728518285192852028521285222852328524285252852628527285282852928530285312853228533285342853528536285372853828539285402854128542285432854428545285462854728548285492855028551285522855328554285552855628557285582855928560285612856228563285642856528566285672856828569285702857128572285732857428575285762857728578285792858028581285822858328584285852858628587285882858928590285912859228593285942859528596285972859828599286002860128602286032860428605286062860728608286092861028611286122861328614286152861628617286182861928620286212862228623286242862528626286272862828629286302863128632286332863428635286362863728638286392864028641286422864328644286452864628647286482864928650286512865228653286542865528656286572865828659286602866128662286632866428665286662866728668286692867028671286722867328674286752867628677286782867928680286812868228683286842868528686286872868828689286902869128692286932869428695286962869728698286992870028701287022870328704287052870628707287082870928710287112871228713287142871528716287172871828719287202872128722287232872428725287262872728728287292873028731287322873328734287352873628737287382873928740287412874228743287442874528746287472874828749287502875128752287532875428755287562875728758287592876028761287622876328764287652876628767287682876928770287712877228773287742877528776287772877828779287802878128782287832878428785287862878728788287892879028791287922879328794287952879628797287982879928800288012880228803288042880528806288072880828809288102881128812288132881428815288162881728818288192882028821288222882328824288252882628827288282882928830288312883228833288342883528836288372883828839288402884128842288432884428845288462884728848288492885028851288522885328854288552885628857288582885928860288612886228863288642886528866288672886828869288702887128872288732887428875288762887728878288792888028881288822888328884288852888628887288882888928890288912889228893288942889528896288972889828899289002890128902289032890428905289062890728908289092891028911289122891328914289152891628917289182891928920289212892228923289242892528926289272892828929289302893128932289332893428935289362893728938289392894028941289422894328944289452894628947289482894928950289512895228953289542895528956289572895828959289602896128962289632896428965289662896728968289692897028971289722897328974289752897628977289782897928980289812898228983289842898528986289872898828989289902899128992289932899428995289962899728998289992900029001290022900329004290052900629007290082900929010290112901229013290142901529016290172901829019290202902129022290232902429025290262902729028290292903029031290322903329034290352903629037290382903929040290412904229043290442904529046290472904829049290502905129052290532905429055290562905729058290592906029061290622906329064290652906629067290682906929070290712907229073290742907529076290772907829079290802908129082290832908429085290862908729088290892909029091290922909329094290952909629097290982909929100291012910229103291042910529106291072910829109291102911129112291132911429115291162911729118291192912029121291222912329124291252912629127291282912929130291312913229133291342913529136291372913829139291402914129142291432914429145291462914729148291492915029151291522915329154291552915629157291582915929160291612916229163291642916529166291672916829169291702917129172291732917429175291762917729178291792918029181291822918329184291852918629187291882918929190291912919229193291942919529196291972919829199292002920129202292032920429205292062920729208292092921029211292122921329214292152921629217292182921929220292212922229223292242922529226292272922829229292302923129232292332923429235292362923729238292392924029241292422924329244292452924629247292482924929250292512925229253292542925529256292572925829259292602926129262292632926429265292662926729268292692927029271292722927329274292752927629277292782927929280292812928229283292842928529286292872928829289292902929129292292932929429295292962929729298292992930029301293022930329304293052930629307293082930929310293112931229313293142931529316293172931829319293202932129322293232932429325293262932729328293292933029331293322933329334293352933629337293382933929340293412934229343293442934529346293472934829349293502935129352293532935429355293562935729358293592936029361293622936329364293652936629367293682936929370293712937229373293742937529376293772937829379293802938129382293832938429385293862938729388293892939029391293922939329394293952939629397293982939929400294012940229403294042940529406294072940829409294102941129412294132941429415294162941729418294192942029421294222942329424294252942629427294282942929430294312943229433294342943529436294372943829439294402944129442294432944429445294462944729448294492945029451294522945329454294552945629457294582945929460294612946229463294642946529466294672946829469294702947129472294732947429475294762947729478294792948029481294822948329484294852948629487294882948929490294912949229493294942949529496294972949829499295002950129502295032950429505295062950729508295092951029511295122951329514295152951629517295182951929520295212952229523295242952529526295272952829529295302953129532295332953429535295362953729538295392954029541295422954329544295452954629547295482954929550295512955229553295542955529556295572955829559295602956129562295632956429565295662956729568295692957029571295722957329574295752957629577295782957929580295812958229583295842958529586295872958829589295902959129592295932959429595295962959729598295992960029601296022960329604296052960629607296082960929610296112961229613296142961529616296172961829619296202962129622296232962429625296262962729628296292963029631296322963329634296352963629637296382963929640296412964229643296442964529646296472964829649296502965129652296532965429655296562965729658296592966029661296622966329664296652966629667296682966929670296712967229673296742967529676296772967829679296802968129682296832968429685296862968729688296892969029691296922969329694296952969629697296982969929700297012970229703297042970529706297072970829709297102971129712297132971429715297162971729718297192972029721297222972329724297252972629727297282972929730297312973229733297342973529736297372973829739297402974129742297432974429745297462974729748297492975029751297522975329754297552975629757297582975929760297612976229763297642976529766297672976829769297702977129772297732977429775297762977729778297792978029781297822978329784297852978629787297882978929790297912979229793297942979529796297972979829799298002980129802298032980429805298062980729808298092981029811298122981329814298152981629817298182981929820298212982229823298242982529826298272982829829298302983129832298332983429835298362983729838298392984029841298422984329844298452984629847298482984929850298512985229853298542985529856298572985829859298602986129862298632986429865298662986729868298692987029871298722987329874298752987629877298782987929880298812988229883298842988529886298872988829889298902989129892298932989429895298962989729898298992990029901299022990329904299052990629907299082990929910299112991229913299142991529916299172991829919299202992129922299232992429925299262992729928299292993029931299322993329934299352993629937299382993929940299412994229943299442994529946299472994829949299502995129952299532995429955299562995729958299592996029961299622996329964299652996629967299682996929970299712997229973299742997529976299772997829979299802998129982299832998429985299862998729988299892999029991299922999329994299952999629997299982999930000300013000230003300043000530006300073000830009300103001130012300133001430015300163001730018300193002030021300223002330024300253002630027300283002930030300313003230033300343003530036300373003830039300403004130042300433004430045300463004730048300493005030051300523005330054300553005630057300583005930060300613006230063300643006530066300673006830069300703007130072300733007430075300763007730078300793008030081300823008330084300853008630087300883008930090300913009230093300943009530096300973009830099301003010130102301033010430105301063010730108301093011030111301123011330114301153011630117301183011930120301213012230123301243012530126301273012830129301303013130132301333013430135301363013730138301393014030141301423014330144301453014630147301483014930150301513015230153301543015530156301573015830159301603016130162301633016430165301663016730168301693017030171301723017330174301753017630177301783017930180301813018230183301843018530186301873018830189301903019130192301933019430195301963019730198301993020030201302023020330204302053020630207302083020930210302113021230213302143021530216302173021830219302203022130222302233022430225302263022730228302293023030231302323023330234302353023630237302383023930240302413024230243302443024530246302473024830249302503025130252302533025430255302563025730258302593026030261302623026330264302653026630267302683026930270302713027230273302743027530276302773027830279302803028130282302833028430285302863028730288302893029030291302923029330294302953029630297302983029930300303013030230303303043030530306303073030830309303103031130312303133031430315303163031730318303193032030321303223032330324303253032630327303283032930330303313033230333303343033530336303373033830339303403034130342303433034430345303463034730348303493035030351303523035330354303553035630357303583035930360303613036230363303643036530366303673036830369303703037130372303733037430375303763037730378303793038030381303823038330384303853038630387303883038930390303913039230393303943039530396303973039830399304003040130402304033040430405304063040730408304093041030411304123041330414304153041630417304183041930420304213042230423304243042530426304273042830429304303043130432304333043430435304363043730438304393044030441304423044330444304453044630447304483044930450304513045230453304543045530456304573045830459304603046130462304633046430465304663046730468304693047030471304723047330474304753047630477304783047930480304813048230483304843048530486304873048830489304903049130492304933049430495304963049730498304993050030501305023050330504305053050630507305083050930510305113051230513305143051530516305173051830519305203052130522305233052430525305263052730528305293053030531305323053330534305353053630537305383053930540305413054230543305443054530546305473054830549305503055130552305533055430555305563055730558305593056030561305623056330564305653056630567305683056930570305713057230573305743057530576305773057830579305803058130582305833058430585305863058730588305893059030591305923059330594305953059630597305983059930600306013060230603306043060530606306073060830609306103061130612306133061430615306163061730618306193062030621306223062330624306253062630627306283062930630306313063230633306343063530636306373063830639306403064130642306433064430645306463064730648306493065030651306523065330654306553065630657306583065930660306613066230663306643066530666306673066830669306703067130672306733067430675306763067730678306793068030681306823068330684306853068630687306883068930690306913069230693306943069530696306973069830699307003070130702307033070430705307063070730708307093071030711307123071330714307153071630717307183071930720307213072230723307243072530726307273072830729307303073130732307333073430735307363073730738307393074030741307423074330744307453074630747307483074930750307513075230753307543075530756307573075830759307603076130762307633076430765307663076730768307693077030771307723077330774307753077630777307783077930780307813078230783307843078530786307873078830789307903079130792307933079430795307963079730798307993080030801308023080330804308053080630807308083080930810308113081230813308143081530816308173081830819308203082130822308233082430825308263082730828308293083030831308323083330834308353083630837308383083930840308413084230843308443084530846308473084830849308503085130852308533085430855308563085730858308593086030861308623086330864308653086630867308683086930870308713087230873308743087530876308773087830879308803088130882308833088430885308863088730888308893089030891308923089330894308953089630897308983089930900309013090230903309043090530906309073090830909309103091130912309133091430915309163091730918309193092030921309223092330924309253092630927309283092930930309313093230933309343093530936309373093830939309403094130942309433094430945309463094730948309493095030951309523095330954309553095630957309583095930960309613096230963309643096530966309673096830969309703097130972309733097430975309763097730978309793098030981309823098330984309853098630987309883098930990309913099230993309943099530996309973099830999310003100131002310033100431005310063100731008310093101031011310123101331014310153101631017310183101931020310213102231023310243102531026310273102831029310303103131032310333103431035310363103731038310393104031041310423104331044310453104631047310483104931050310513105231053310543105531056310573105831059310603106131062310633106431065310663106731068310693107031071310723107331074310753107631077310783107931080310813108231083310843108531086310873108831089310903109131092310933109431095310963109731098310993110031101311023110331104311053110631107311083110931110311113111231113311143111531116311173111831119311203112131122311233112431125311263112731128311293113031131311323113331134311353113631137311383113931140311413114231143311443114531146311473114831149311503115131152311533115431155311563115731158311593116031161311623116331164311653116631167311683116931170311713117231173311743117531176311773117831179311803118131182311833118431185311863118731188311893119031191311923119331194311953119631197311983119931200312013120231203312043120531206312073120831209312103121131212312133121431215312163121731218312193122031221312223122331224312253122631227312283122931230312313123231233312343123531236312373123831239312403124131242312433124431245312463124731248312493125031251312523125331254312553125631257312583125931260312613126231263312643126531266312673126831269312703127131272312733127431275312763127731278312793128031281312823128331284312853128631287312883128931290312913129231293312943129531296312973129831299313003130131302313033130431305313063130731308313093131031311313123131331314313153131631317313183131931320313213132231323313243132531326313273132831329313303133131332313333133431335313363133731338313393134031341313423134331344313453134631347313483134931350313513135231353313543135531356313573135831359313603136131362313633136431365313663136731368313693137031371313723137331374313753137631377313783137931380313813138231383313843138531386313873138831389313903139131392313933139431395313963139731398313993140031401314023140331404314053140631407314083140931410314113141231413314143141531416314173141831419314203142131422314233142431425314263142731428314293143031431314323143331434314353143631437314383143931440314413144231443314443144531446314473144831449314503145131452314533145431455314563145731458314593146031461314623146331464314653146631467314683146931470314713147231473314743147531476314773147831479314803148131482314833148431485314863148731488314893149031491314923149331494314953149631497314983149931500315013150231503315043150531506315073150831509315103151131512315133151431515315163151731518315193152031521315223152331524315253152631527315283152931530315313153231533315343153531536315373153831539315403154131542315433154431545315463154731548315493155031551315523155331554315553155631557315583155931560315613156231563315643156531566315673156831569315703157131572315733157431575315763157731578315793158031581315823158331584315853158631587315883158931590315913159231593315943159531596315973159831599316003160131602316033160431605316063160731608316093161031611316123161331614316153161631617316183161931620316213162231623316243162531626316273162831629316303163131632316333163431635316363163731638316393164031641316423164331644316453164631647316483164931650316513165231653316543165531656316573165831659316603166131662316633166431665316663166731668316693167031671316723167331674316753167631677316783167931680316813168231683316843168531686316873168831689316903169131692316933169431695316963169731698316993170031701317023170331704317053170631707317083170931710317113171231713317143171531716317173171831719317203172131722317233172431725317263172731728317293173031731317323173331734317353173631737317383173931740317413174231743317443174531746317473174831749317503175131752317533175431755317563175731758317593176031761317623176331764317653176631767317683176931770317713177231773317743177531776317773177831779317803178131782317833178431785317863178731788317893179031791317923179331794317953179631797317983179931800318013180231803318043180531806318073180831809318103181131812318133181431815318163181731818318193182031821318223182331824318253182631827318283182931830318313183231833318343183531836318373183831839318403184131842318433184431845318463184731848318493185031851318523185331854318553185631857318583185931860318613186231863318643186531866318673186831869318703187131872318733187431875318763187731878318793188031881318823188331884318853188631887318883188931890318913189231893318943189531896318973189831899319003190131902319033190431905319063190731908319093191031911319123191331914319153191631917319183191931920319213192231923319243192531926319273192831929319303193131932319333193431935319363193731938319393194031941319423194331944319453194631947319483194931950319513195231953319543195531956319573195831959319603196131962319633196431965319663196731968319693197031971319723197331974319753197631977319783197931980319813198231983319843198531986319873198831989319903199131992319933199431995319963199731998319993200032001320023200332004320053200632007320083200932010320113201232013320143201532016320173201832019320203202132022320233202432025320263202732028320293203032031320323203332034320353203632037320383203932040320413204232043320443204532046320473204832049320503205132052320533205432055320563205732058320593206032061320623206332064320653206632067320683206932070320713207232073320743207532076320773207832079320803208132082320833208432085320863208732088320893209032091320923209332094320953209632097320983209932100321013210232103321043210532106321073210832109321103211132112321133211432115321163211732118321193212032121321223212332124321253212632127321283212932130321313213232133321343213532136321373213832139321403214132142321433214432145321463214732148321493215032151321523215332154321553215632157321583215932160321613216232163321643216532166321673216832169321703217132172321733217432175321763217732178321793218032181321823218332184321853218632187321883218932190321913219232193321943219532196321973219832199322003220132202322033220432205322063220732208322093221032211322123221332214322153221632217322183221932220322213222232223322243222532226322273222832229322303223132232322333223432235322363223732238322393224032241322423224332244322453224632247322483224932250322513225232253322543225532256322573225832259322603226132262322633226432265322663226732268322693227032271322723227332274322753227632277322783227932280322813228232283322843228532286322873228832289322903229132292322933229432295322963229732298322993230032301323023230332304323053230632307323083230932310323113231232313323143231532316323173231832319323203232132322323233232432325323263232732328323293233032331323323233332334323353233632337323383233932340323413234232343323443234532346323473234832349323503235132352323533235432355323563235732358323593236032361323623236332364323653236632367323683236932370323713237232373323743237532376323773237832379323803238132382323833238432385323863238732388323893239032391323923239332394323953239632397323983239932400324013240232403324043240532406324073240832409324103241132412324133241432415324163241732418324193242032421324223242332424324253242632427324283242932430324313243232433324343243532436324373243832439324403244132442324433244432445324463244732448324493245032451324523245332454324553245632457324583245932460324613246232463324643246532466324673246832469324703247132472324733247432475324763247732478324793248032481324823248332484324853248632487324883248932490324913249232493324943249532496324973249832499325003250132502325033250432505325063250732508325093251032511325123251332514325153251632517325183251932520325213252232523325243252532526325273252832529325303253132532325333253432535325363253732538325393254032541325423254332544325453254632547325483254932550325513255232553325543255532556325573255832559325603256132562325633256432565325663256732568325693257032571325723257332574325753257632577325783257932580325813258232583325843258532586325873258832589325903259132592325933259432595325963259732598325993260032601326023260332604326053260632607326083260932610326113261232613326143261532616326173261832619326203262132622326233262432625326263262732628326293263032631326323263332634326353263632637326383263932640326413264232643326443264532646326473264832649326503265132652326533265432655326563265732658326593266032661326623266332664326653266632667326683266932670326713267232673326743267532676326773267832679326803268132682326833268432685326863268732688326893269032691326923269332694326953269632697326983269932700327013270232703327043270532706327073270832709327103271132712327133271432715327163271732718327193272032721327223272332724327253272632727327283272932730327313273232733327343273532736327373273832739327403274132742327433274432745327463274732748327493275032751327523275332754327553275632757327583275932760327613276232763327643276532766327673276832769327703277132772327733277432775327763277732778327793278032781327823278332784327853278632787327883278932790327913279232793327943279532796327973279832799328003280132802328033280432805328063280732808328093281032811328123281332814328153281632817328183281932820328213282232823328243282532826328273282832829328303283132832328333283432835328363283732838328393284032841328423284332844328453284632847328483284932850328513285232853328543285532856328573285832859328603286132862328633286432865328663286732868328693287032871328723287332874328753287632877328783287932880328813288232883328843288532886328873288832889328903289132892328933289432895328963289732898328993290032901329023290332904329053290632907329083290932910329113291232913329143291532916329173291832919329203292132922329233292432925329263292732928329293293032931329323293332934329353293632937329383293932940329413294232943329443294532946329473294832949329503295132952329533295432955329563295732958329593296032961329623296332964329653296632967329683296932970329713297232973329743297532976329773297832979329803298132982329833298432985329863298732988329893299032991329923299332994329953299632997329983299933000330013300233003330043300533006330073300833009330103301133012330133301433015330163301733018330193302033021330223302333024330253302633027330283302933030330313303233033330343303533036330373303833039330403304133042330433304433045330463304733048330493305033051330523305333054330553305633057330583305933060330613306233063330643306533066330673306833069330703307133072330733307433075330763307733078330793308033081330823308333084330853308633087330883308933090330913309233093330943309533096330973309833099331003310133102331033310433105331063310733108331093311033111331123311333114331153311633117331183311933120331213312233123331243312533126331273312833129331303313133132331333313433135331363313733138331393314033141331423314333144331453314633147331483314933150331513315233153331543315533156331573315833159331603316133162331633316433165331663316733168331693317033171331723317333174331753317633177331783317933180331813318233183331843318533186331873318833189331903319133192331933319433195331963319733198331993320033201332023320333204332053320633207332083320933210332113321233213332143321533216332173321833219332203322133222332233322433225332263322733228332293323033231332323323333234332353323633237332383323933240332413324233243332443324533246332473324833249332503325133252332533325433255332563325733258332593326033261332623326333264332653326633267332683326933270332713327233273332743327533276332773327833279332803328133282332833328433285332863328733288332893329033291332923329333294332953329633297332983329933300333013330233303333043330533306333073330833309333103331133312333133331433315333163331733318333193332033321333223332333324333253332633327333283332933330333313333233333333343333533336333373333833339333403334133342333433334433345333463334733348333493335033351333523335333354333553335633357333583335933360333613336233363333643336533366333673336833369333703337133372333733337433375333763337733378333793338033381333823338333384333853338633387333883338933390333913339233393333943339533396333973339833399334003340133402334033340433405334063340733408334093341033411334123341333414334153341633417334183341933420334213342233423334243342533426334273342833429334303343133432334333343433435334363343733438334393344033441334423344333444334453344633447334483344933450334513345233453334543345533456334573345833459334603346133462334633346433465334663346733468334693347033471334723347333474334753347633477334783347933480334813348233483334843348533486334873348833489334903349133492334933349433495334963349733498334993350033501335023350333504335053350633507335083350933510335113351233513335143351533516335173351833519335203352133522335233352433525335263352733528335293353033531335323353333534335353353633537335383353933540335413354233543335443354533546335473354833549335503355133552335533355433555335563355733558335593356033561335623356333564335653356633567335683356933570335713357233573335743357533576335773357833579335803358133582335833358433585335863358733588335893359033591335923359333594335953359633597335983359933600336013360233603336043360533606336073360833609336103361133612336133361433615336163361733618336193362033621336223362333624336253362633627336283362933630336313363233633336343363533636336373363833639336403364133642336433364433645336463364733648336493365033651336523365333654336553365633657336583365933660336613366233663336643366533666336673366833669336703367133672336733367433675336763367733678336793368033681336823368333684336853368633687336883368933690336913369233693336943369533696336973369833699337003370133702337033370433705337063370733708337093371033711337123371333714337153371633717337183371933720337213372233723337243372533726337273372833729337303373133732337333373433735337363373733738337393374033741337423374333744337453374633747337483374933750337513375233753337543375533756337573375833759337603376133762337633376433765337663376733768337693377033771337723377333774337753377633777337783377933780337813378233783337843378533786337873378833789337903379133792337933379433795337963379733798337993380033801338023380333804338053380633807338083380933810338113381233813338143381533816338173381833819338203382133822338233382433825338263382733828338293383033831338323383333834338353383633837338383383933840338413384233843338443384533846338473384833849338503385133852338533385433855338563385733858338593386033861338623386333864338653386633867338683386933870338713387233873338743387533876338773387833879338803388133882338833388433885338863388733888338893389033891338923389333894338953389633897338983389933900339013390233903339043390533906339073390833909339103391133912339133391433915339163391733918339193392033921339223392333924339253392633927339283392933930339313393233933339343393533936339373393833939339403394133942339433394433945339463394733948339493395033951339523395333954339553395633957339583395933960339613396233963339643396533966339673396833969339703397133972339733397433975339763397733978339793398033981339823398333984339853398633987339883398933990339913399233993339943399533996339973399833999340003400134002340033400434005340063400734008340093401034011340123401334014340153401634017340183401934020340213402234023340243402534026340273402834029340303403134032340333403434035340363403734038340393404034041340423404334044340453404634047340483404934050340513405234053340543405534056340573405834059340603406134062340633406434065340663406734068340693407034071340723407334074340753407634077340783407934080340813408234083340843408534086340873408834089340903409134092340933409434095340963409734098340993410034101341023410334104341053410634107341083410934110341113411234113341143411534116341173411834119341203412134122341233412434125341263412734128341293413034131341323413334134341353413634137341383413934140341413414234143341443414534146341473414834149341503415134152341533415434155341563415734158341593416034161341623416334164341653416634167341683416934170341713417234173341743417534176341773417834179341803418134182341833418434185341863418734188341893419034191341923419334194341953419634197341983419934200342013420234203342043420534206342073420834209342103421134212342133421434215342163421734218342193422034221342223422334224342253422634227342283422934230342313423234233342343423534236342373423834239342403424134242342433424434245342463424734248342493425034251342523425334254342553425634257342583425934260342613426234263342643426534266342673426834269342703427134272342733427434275342763427734278342793428034281342823428334284342853428634287342883428934290342913429234293342943429534296342973429834299343003430134302343033430434305343063430734308343093431034311343123431334314343153431634317343183431934320343213432234323343243432534326343273432834329343303433134332343333433434335343363433734338343393434034341343423434334344343453434634347343483434934350343513435234353343543435534356343573435834359343603436134362343633436434365343663436734368343693437034371343723437334374343753437634377343783437934380343813438234383343843438534386343873438834389343903439134392343933439434395343963439734398343993440034401344023440334404344053440634407344083440934410344113441234413344143441534416344173441834419344203442134422344233442434425344263442734428344293443034431344323443334434344353443634437344383443934440344413444234443344443444534446344473444834449344503445134452344533445434455344563445734458344593446034461344623446334464344653446634467344683446934470344713447234473344743447534476344773447834479344803448134482344833448434485344863448734488344893449034491344923449334494344953449634497344983449934500345013450234503345043450534506345073450834509345103451134512345133451434515345163451734518345193452034521345223452334524345253452634527345283452934530345313453234533345343453534536345373453834539345403454134542345433454434545345463454734548345493455034551345523455334554345553455634557345583455934560345613456234563345643456534566345673456834569345703457134572345733457434575345763457734578345793458034581345823458334584345853458634587345883458934590345913459234593345943459534596345973459834599346003460134602346033460434605346063460734608346093461034611346123461334614346153461634617346183461934620346213462234623346243462534626346273462834629346303463134632346333463434635346363463734638346393464034641346423464334644346453464634647346483464934650346513465234653346543465534656346573465834659346603466134662346633466434665346663466734668346693467034671346723467334674346753467634677346783467934680346813468234683346843468534686346873468834689346903469134692346933469434695346963469734698346993470034701347023470334704347053470634707347083470934710347113471234713347143471534716347173471834719347203472134722347233472434725347263472734728347293473034731347323473334734347353473634737347383473934740347413474234743347443474534746347473474834749347503475134752347533475434755347563475734758347593476034761347623476334764347653476634767347683476934770347713477234773347743477534776347773477834779347803478134782347833478434785347863478734788347893479034791347923479334794347953479634797347983479934800348013480234803348043480534806348073480834809348103481134812348133481434815348163481734818348193482034821348223482334824348253482634827348283482934830348313483234833348343483534836348373483834839348403484134842348433484434845348463484734848348493485034851348523485334854348553485634857348583485934860348613486234863348643486534866348673486834869348703487134872348733487434875348763487734878348793488034881348823488334884348853488634887348883488934890348913489234893348943489534896348973489834899349003490134902349033490434905349063490734908349093491034911349123491334914349153491634917349183491934920349213492234923349243492534926349273492834929349303493134932349333493434935349363493734938349393494034941349423494334944349453494634947349483494934950349513495234953349543495534956349573495834959349603496134962349633496434965349663496734968349693497034971349723497334974349753497634977349783497934980349813498234983349843498534986349873498834989349903499134992349933499434995349963499734998349993500035001350023500335004350053500635007350083500935010350113501235013350143501535016350173501835019350203502135022350233502435025350263502735028350293503035031350323503335034350353503635037350383503935040350413504235043350443504535046350473504835049350503505135052350533505435055350563505735058350593506035061350623506335064350653506635067350683506935070350713507235073350743507535076350773507835079350803508135082350833508435085350863508735088350893509035091350923509335094350953509635097350983509935100351013510235103351043510535106351073510835109351103511135112351133511435115351163511735118351193512035121351223512335124351253512635127351283512935130351313513235133351343513535136351373513835139351403514135142351433514435145351463514735148351493515035151351523515335154351553515635157351583515935160351613516235163351643516535166351673516835169351703517135172351733517435175351763517735178351793518035181351823518335184351853518635187351883518935190351913519235193351943519535196351973519835199352003520135202352033520435205352063520735208352093521035211352123521335214352153521635217352183521935220352213522235223352243522535226352273522835229352303523135232352333523435235352363523735238352393524035241352423524335244352453524635247352483524935250352513525235253352543525535256352573525835259352603526135262352633526435265352663526735268352693527035271352723527335274352753527635277352783527935280352813528235283352843528535286352873528835289352903529135292352933529435295352963529735298352993530035301353023530335304353053530635307353083530935310353113531235313353143531535316353173531835319353203532135322353233532435325353263532735328353293533035331353323533335334353353533635337353383533935340353413534235343353443534535346353473534835349353503535135352353533535435355353563535735358353593536035361353623536335364353653536635367353683536935370353713537235373353743537535376353773537835379353803538135382353833538435385353863538735388353893539035391353923539335394353953539635397353983539935400354013540235403354043540535406354073540835409354103541135412354133541435415354163541735418354193542035421354223542335424354253542635427354283542935430354313543235433354343543535436354373543835439354403544135442354433544435445354463544735448354493545035451354523545335454354553545635457354583545935460354613546235463354643546535466354673546835469354703547135472354733547435475354763547735478354793548035481354823548335484354853548635487354883548935490354913549235493354943549535496354973549835499355003550135502355033550435505355063550735508355093551035511355123551335514355153551635517355183551935520355213552235523355243552535526355273552835529355303553135532355333553435535355363553735538355393554035541355423554335544355453554635547355483554935550355513555235553355543555535556355573555835559355603556135562355633556435565355663556735568355693557035571355723557335574355753557635577355783557935580355813558235583355843558535586355873558835589355903559135592355933559435595355963559735598355993560035601356023560335604356053560635607356083560935610356113561235613356143561535616356173561835619356203562135622356233562435625356263562735628356293563035631356323563335634356353563635637356383563935640356413564235643356443564535646356473564835649356503565135652356533565435655356563565735658356593566035661356623566335664356653566635667356683566935670356713567235673356743567535676356773567835679356803568135682356833568435685356863568735688356893569035691356923569335694356953569635697356983569935700357013570235703357043570535706357073570835709357103571135712357133571435715357163571735718357193572035721357223572335724357253572635727357283572935730357313573235733357343573535736357373573835739357403574135742357433574435745357463574735748357493575035751357523575335754357553575635757357583575935760357613576235763357643576535766357673576835769357703577135772357733577435775357763577735778357793578035781357823578335784357853578635787357883578935790357913579235793357943579535796357973579835799358003580135802358033580435805358063580735808358093581035811358123581335814358153581635817358183581935820358213582235823358243582535826358273582835829358303583135832358333583435835358363583735838358393584035841358423584335844358453584635847358483584935850358513585235853358543585535856358573585835859358603586135862358633586435865358663586735868358693587035871358723587335874358753587635877358783587935880358813588235883358843588535886358873588835889358903589135892358933589435895358963589735898358993590035901359023590335904359053590635907359083590935910359113591235913359143591535916359173591835919359203592135922359233592435925359263592735928359293593035931359323593335934359353593635937359383593935940359413594235943359443594535946359473594835949359503595135952359533595435955359563595735958359593596035961359623596335964359653596635967359683596935970359713597235973359743597535976359773597835979359803598135982359833598435985359863598735988359893599035991359923599335994359953599635997359983599936000360013600236003360043600536006360073600836009360103601136012360133601436015360163601736018360193602036021360223602336024360253602636027360283602936030360313603236033360343603536036360373603836039360403604136042360433604436045360463604736048360493605036051360523605336054360553605636057360583605936060360613606236063360643606536066360673606836069360703607136072360733607436075360763607736078360793608036081360823608336084360853608636087360883608936090360913609236093360943609536096360973609836099361003610136102361033610436105361063610736108361093611036111361123611336114361153611636117361183611936120361213612236123361243612536126361273612836129361303613136132361333613436135361363613736138361393614036141361423614336144361453614636147361483614936150361513615236153361543615536156361573615836159361603616136162361633616436165361663616736168361693617036171361723617336174361753617636177361783617936180361813618236183361843618536186361873618836189361903619136192361933619436195361963619736198361993620036201362023620336204362053620636207362083620936210362113621236213362143621536216362173621836219362203622136222362233622436225362263622736228362293623036231362323623336234362353623636237362383623936240362413624236243362443624536246362473624836249362503625136252362533625436255362563625736258362593626036261362623626336264362653626636267362683626936270362713627236273362743627536276362773627836279362803628136282362833628436285362863628736288362893629036291362923629336294362953629636297362983629936300363013630236303363043630536306363073630836309363103631136312363133631436315363163631736318363193632036321363223632336324363253632636327363283632936330363313633236333363343633536336363373633836339363403634136342363433634436345363463634736348363493635036351363523635336354363553635636357363583635936360363613636236363363643636536366363673636836369363703637136372363733637436375363763637736378363793638036381363823638336384363853638636387363883638936390363913639236393363943639536396363973639836399364003640136402364033640436405364063640736408364093641036411364123641336414364153641636417364183641936420364213642236423364243642536426364273642836429364303643136432364333643436435364363643736438364393644036441364423644336444364453644636447364483644936450364513645236453364543645536456364573645836459364603646136462364633646436465364663646736468364693647036471364723647336474364753647636477364783647936480364813648236483364843648536486364873648836489364903649136492364933649436495364963649736498364993650036501365023650336504365053650636507365083650936510365113651236513365143651536516365173651836519365203652136522365233652436525365263652736528365293653036531365323653336534365353653636537365383653936540365413654236543365443654536546365473654836549365503655136552365533655436555365563655736558365593656036561365623656336564365653656636567365683656936570365713657236573365743657536576365773657836579365803658136582365833658436585365863658736588365893659036591365923659336594365953659636597365983659936600366013660236603366043660536606366073660836609366103661136612366133661436615366163661736618366193662036621366223662336624366253662636627366283662936630366313663236633366343663536636366373663836639366403664136642366433664436645366463664736648366493665036651366523665336654366553665636657366583665936660366613666236663366643666536666366673666836669366703667136672366733667436675366763667736678366793668036681366823668336684366853668636687366883668936690366913669236693366943669536696366973669836699367003670136702367033670436705367063670736708367093671036711367123671336714367153671636717367183671936720367213672236723367243672536726367273672836729367303673136732367333673436735367363673736738367393674036741367423674336744367453674636747367483674936750367513675236753367543675536756367573675836759367603676136762367633676436765367663676736768367693677036771367723677336774367753677636777367783677936780367813678236783367843678536786367873678836789367903679136792367933679436795367963679736798367993680036801368023680336804368053680636807368083680936810368113681236813368143681536816368173681836819368203682136822368233682436825368263682736828368293683036831368323683336834368353683636837368383683936840368413684236843368443684536846368473684836849368503685136852368533685436855368563685736858368593686036861368623686336864368653686636867368683686936870368713687236873368743687536876368773687836879368803688136882368833688436885368863688736888368893689036891368923689336894368953689636897368983689936900369013690236903369043690536906369073690836909369103691136912369133691436915369163691736918369193692036921369223692336924369253692636927369283692936930369313693236933369343693536936369373693836939369403694136942369433694436945369463694736948369493695036951369523695336954369553695636957369583695936960369613696236963369643696536966369673696836969369703697136972369733697436975369763697736978369793698036981369823698336984369853698636987369883698936990369913699236993369943699536996369973699836999370003700137002370033700437005370063700737008370093701037011370123701337014370153701637017370183701937020370213702237023370243702537026370273702837029370303703137032370333703437035370363703737038370393704037041370423704337044370453704637047370483704937050370513705237053370543705537056370573705837059370603706137062370633706437065370663706737068370693707037071370723707337074370753707637077370783707937080370813708237083370843708537086370873708837089370903709137092370933709437095370963709737098370993710037101371023710337104371053710637107371083710937110371113711237113371143711537116371173711837119371203712137122371233712437125371263712737128371293713037131371323713337134371353713637137371383713937140371413714237143371443714537146371473714837149371503715137152371533715437155371563715737158371593716037161371623716337164371653716637167371683716937170371713717237173371743717537176371773717837179371803718137182371833718437185371863718737188371893719037191371923719337194371953719637197371983719937200372013720237203372043720537206372073720837209372103721137212372133721437215372163721737218372193722037221372223722337224372253722637227372283722937230372313723237233372343723537236372373723837239372403724137242372433724437245372463724737248372493725037251372523725337254372553725637257372583725937260372613726237263372643726537266372673726837269372703727137272372733727437275372763727737278372793728037281372823728337284372853728637287372883728937290372913729237293372943729537296372973729837299373003730137302373033730437305373063730737308373093731037311373123731337314373153731637317373183731937320373213732237323373243732537326373273732837329373303733137332373333733437335373363733737338373393734037341373423734337344373453734637347373483734937350373513735237353373543735537356373573735837359373603736137362373633736437365373663736737368373693737037371373723737337374373753737637377373783737937380373813738237383373843738537386373873738837389373903739137392373933739437395373963739737398373993740037401374023740337404374053740637407374083740937410374113741237413374143741537416374173741837419374203742137422374233742437425374263742737428374293743037431374323743337434374353743637437374383743937440374413744237443374443744537446374473744837449374503745137452374533745437455374563745737458374593746037461374623746337464374653746637467374683746937470374713747237473374743747537476374773747837479374803748137482374833748437485374863748737488374893749037491374923749337494374953749637497374983749937500375013750237503375043750537506375073750837509375103751137512375133751437515375163751737518375193752037521375223752337524375253752637527375283752937530375313753237533375343753537536375373753837539375403754137542375433754437545375463754737548375493755037551375523755337554375553755637557375583755937560375613756237563375643756537566375673756837569375703757137572375733757437575375763757737578375793758037581375823758337584375853758637587375883758937590375913759237593375943759537596375973759837599376003760137602376033760437605376063760737608376093761037611376123761337614376153761637617376183761937620376213762237623376243762537626376273762837629376303763137632376333763437635376363763737638376393764037641376423764337644376453764637647376483764937650376513765237653376543765537656376573765837659376603766137662376633766437665376663766737668376693767037671376723767337674376753767637677376783767937680376813768237683376843768537686376873768837689376903769137692376933769437695376963769737698376993770037701377023770337704377053770637707377083770937710377113771237713377143771537716377173771837719377203772137722377233772437725377263772737728377293773037731377323773337734377353773637737377383773937740377413774237743377443774537746377473774837749377503775137752377533775437755377563775737758377593776037761377623776337764377653776637767377683776937770377713777237773377743777537776377773777837779377803778137782377833778437785377863778737788377893779037791377923779337794377953779637797377983779937800378013780237803378043780537806378073780837809378103781137812378133781437815378163781737818378193782037821378223782337824378253782637827378283782937830378313783237833378343783537836378373783837839378403784137842378433784437845378463784737848378493785037851378523785337854378553785637857378583785937860378613786237863378643786537866378673786837869378703787137872378733787437875378763787737878378793788037881378823788337884378853788637887378883788937890378913789237893378943789537896378973789837899379003790137902379033790437905379063790737908379093791037911379123791337914379153791637917379183791937920379213792237923379243792537926379273792837929379303793137932379333793437935379363793737938379393794037941379423794337944379453794637947379483794937950379513795237953379543795537956379573795837959379603796137962379633796437965379663796737968379693797037971379723797337974379753797637977379783797937980379813798237983379843798537986379873798837989379903799137992379933799437995379963799737998379993800038001380023800338004380053800638007380083800938010380113801238013380143801538016380173801838019380203802138022380233802438025380263802738028380293803038031380323803338034380353803638037380383803938040380413804238043380443804538046380473804838049380503805138052380533805438055380563805738058380593806038061380623806338064380653806638067380683806938070380713807238073380743807538076380773807838079380803808138082380833808438085380863808738088380893809038091380923809338094380953809638097380983809938100381013810238103381043810538106381073810838109381103811138112381133811438115381163811738118381193812038121381223812338124381253812638127381283812938130381313813238133381343813538136381373813838139381403814138142381433814438145381463814738148381493815038151381523815338154381553815638157381583815938160381613816238163381643816538166381673816838169381703817138172381733817438175381763817738178381793818038181381823818338184381853818638187381883818938190381913819238193381943819538196381973819838199382003820138202382033820438205382063820738208382093821038211382123821338214382153821638217382183821938220382213822238223382243822538226382273822838229382303823138232382333823438235382363823738238382393824038241382423824338244382453824638247382483824938250382513825238253382543825538256382573825838259382603826138262382633826438265382663826738268382693827038271382723827338274382753827638277382783827938280382813828238283382843828538286382873828838289382903829138292382933829438295382963829738298382993830038301383023830338304383053830638307383083830938310383113831238313383143831538316383173831838319383203832138322383233832438325383263832738328383293833038331383323833338334383353833638337383383833938340383413834238343383443834538346383473834838349383503835138352383533835438355383563835738358383593836038361383623836338364383653836638367383683836938370383713837238373383743837538376383773837838379383803838138382383833838438385383863838738388383893839038391383923839338394383953839638397383983839938400384013840238403384043840538406384073840838409384103841138412384133841438415384163841738418384193842038421384223842338424384253842638427384283842938430384313843238433384343843538436384373843838439384403844138442384433844438445384463844738448384493845038451384523845338454384553845638457384583845938460384613846238463384643846538466384673846838469384703847138472384733847438475384763847738478384793848038481384823848338484384853848638487384883848938490384913849238493384943849538496384973849838499385003850138502385033850438505385063850738508385093851038511385123851338514385153851638517385183851938520385213852238523385243852538526385273852838529385303853138532385333853438535385363853738538385393854038541385423854338544385453854638547385483854938550385513855238553385543855538556385573855838559385603856138562385633856438565385663856738568385693857038571385723857338574385753857638577385783857938580385813858238583385843858538586385873858838589385903859138592385933859438595385963859738598385993860038601386023860338604386053860638607386083860938610386113861238613386143861538616386173861838619386203862138622386233862438625386263862738628386293863038631386323863338634386353863638637386383863938640386413864238643386443864538646386473864838649386503865138652386533865438655386563865738658386593866038661386623866338664386653866638667386683866938670386713867238673386743867538676386773867838679386803868138682386833868438685386863868738688386893869038691386923869338694386953869638697386983869938700387013870238703387043870538706387073870838709387103871138712387133871438715387163871738718387193872038721387223872338724387253872638727387283872938730387313873238733387343873538736387373873838739387403874138742387433874438745387463874738748387493875038751387523875338754387553875638757387583875938760387613876238763387643876538766387673876838769387703877138772387733877438775387763877738778387793878038781387823878338784387853878638787387883878938790387913879238793387943879538796387973879838799388003880138802388033880438805388063880738808388093881038811388123881338814388153881638817388183881938820388213882238823388243882538826388273882838829388303883138832388333883438835388363883738838388393884038841388423884338844388453884638847388483884938850388513885238853388543885538856388573885838859388603886138862388633886438865388663886738868388693887038871388723887338874388753887638877388783887938880388813888238883388843888538886388873888838889388903889138892388933889438895388963889738898388993890038901389023890338904389053890638907389083890938910389113891238913389143891538916389173891838919389203892138922389233892438925389263892738928389293893038931389323893338934389353893638937389383893938940389413894238943389443894538946389473894838949389503895138952389533895438955389563895738958389593896038961389623896338964389653896638967389683896938970389713897238973389743897538976389773897838979389803898138982389833898438985389863898738988389893899038991389923899338994389953899638997389983899939000390013900239003390043900539006390073900839009390103901139012390133901439015390163901739018390193902039021390223902339024390253902639027390283902939030390313903239033390343903539036390373903839039390403904139042390433904439045390463904739048390493905039051390523905339054390553905639057390583905939060390613906239063390643906539066390673906839069390703907139072390733907439075390763907739078390793908039081390823908339084390853908639087390883908939090390913909239093390943909539096390973909839099391003910139102391033910439105391063910739108391093911039111391123911339114391153911639117391183911939120391213912239123391243912539126391273912839129391303913139132391333913439135391363913739138391393914039141391423914339144391453914639147391483914939150391513915239153391543915539156391573915839159391603916139162391633916439165391663916739168391693917039171391723917339174391753917639177391783917939180391813918239183391843918539186391873918839189391903919139192391933919439195391963919739198391993920039201392023920339204392053920639207392083920939210392113921239213392143921539216392173921839219392203922139222392233922439225392263922739228392293923039231392323923339234392353923639237392383923939240392413924239243392443924539246392473924839249392503925139252392533925439255392563925739258392593926039261392623926339264392653926639267392683926939270392713927239273392743927539276392773927839279392803928139282392833928439285392863928739288392893929039291392923929339294392953929639297392983929939300393013930239303393043930539306393073930839309393103931139312393133931439315393163931739318393193932039321393223932339324393253932639327393283932939330393313933239333393343933539336393373933839339393403934139342393433934439345393463934739348393493935039351393523935339354393553935639357393583935939360393613936239363393643936539366393673936839369393703937139372393733937439375393763937739378393793938039381393823938339384393853938639387393883938939390393913939239393393943939539396393973939839399394003940139402394033940439405394063940739408394093941039411394123941339414394153941639417394183941939420394213942239423394243942539426394273942839429394303943139432394333943439435394363943739438394393944039441394423944339444394453944639447394483944939450394513945239453394543945539456394573945839459394603946139462394633946439465394663946739468394693947039471394723947339474394753947639477394783947939480394813948239483394843948539486394873948839489394903949139492394933949439495394963949739498394993950039501395023950339504395053950639507395083950939510395113951239513395143951539516395173951839519395203952139522395233952439525395263952739528395293953039531395323953339534395353953639537395383953939540395413954239543395443954539546395473954839549395503955139552395533955439555395563955739558395593956039561395623956339564395653956639567395683956939570395713957239573395743957539576395773957839579395803958139582395833958439585395863958739588395893959039591395923959339594395953959639597395983959939600396013960239603396043960539606396073960839609396103961139612396133961439615396163961739618396193962039621396223962339624396253962639627396283962939630396313963239633396343963539636396373963839639396403964139642396433964439645396463964739648396493965039651396523965339654396553965639657396583965939660396613966239663396643966539666396673966839669396703967139672396733967439675396763967739678396793968039681396823968339684396853968639687396883968939690396913969239693396943969539696396973969839699397003970139702397033970439705397063970739708397093971039711397123971339714397153971639717397183971939720397213972239723397243972539726397273972839729397303973139732397333973439735397363973739738397393974039741397423974339744397453974639747397483974939750397513975239753397543975539756397573975839759397603976139762397633976439765397663976739768397693977039771397723977339774397753977639777397783977939780397813978239783397843978539786397873978839789397903979139792397933979439795397963979739798397993980039801398023980339804398053980639807398083980939810398113981239813398143981539816398173981839819398203982139822398233982439825398263982739828398293983039831398323983339834398353983639837398383983939840398413984239843398443984539846398473984839849398503985139852398533985439855398563985739858398593986039861398623986339864398653986639867398683986939870398713987239873398743987539876398773987839879398803988139882398833988439885398863988739888398893989039891398923989339894398953989639897398983989939900399013990239903399043990539906399073990839909399103991139912399133991439915399163991739918399193992039921399223992339924399253992639927399283992939930399313993239933399343993539936399373993839939399403994139942399433994439945399463994739948399493995039951399523995339954399553995639957399583995939960399613996239963399643996539966399673996839969399703997139972399733997439975399763997739978399793998039981399823998339984399853998639987399883998939990399913999239993399943999539996399973999839999400004000140002400034000440005400064000740008400094001040011400124001340014400154001640017400184001940020400214002240023400244002540026400274002840029400304003140032400334003440035400364003740038400394004040041400424004340044400454004640047400484004940050400514005240053400544005540056400574005840059400604006140062400634006440065400664006740068400694007040071400724007340074400754007640077400784007940080400814008240083400844008540086400874008840089400904009140092400934009440095400964009740098400994010040101401024010340104401054010640107401084010940110401114011240113401144011540116401174011840119401204012140122401234012440125401264012740128401294013040131401324013340134401354013640137401384013940140401414014240143401444014540146401474014840149401504015140152401534015440155401564015740158401594016040161401624016340164401654016640167401684016940170401714017240173401744017540176401774017840179401804018140182401834018440185401864018740188401894019040191401924019340194401954019640197401984019940200402014020240203402044020540206402074020840209402104021140212402134021440215402164021740218402194022040221402224022340224402254022640227402284022940230402314023240233402344023540236402374023840239402404024140242402434024440245402464024740248402494025040251402524025340254402554025640257402584025940260402614026240263402644026540266402674026840269402704027140272402734027440275402764027740278402794028040281402824028340284402854028640287402884028940290402914029240293402944029540296402974029840299403004030140302403034030440305403064030740308403094031040311403124031340314403154031640317403184031940320403214032240323403244032540326403274032840329403304033140332403334033440335403364033740338403394034040341403424034340344403454034640347403484034940350403514035240353403544035540356403574035840359403604036140362403634036440365403664036740368403694037040371403724037340374403754037640377403784037940380403814038240383403844038540386403874038840389403904039140392403934039440395403964039740398403994040040401404024040340404404054040640407404084040940410404114041240413404144041540416404174041840419404204042140422404234042440425404264042740428404294043040431404324043340434404354043640437404384043940440404414044240443404444044540446404474044840449404504045140452404534045440455404564045740458404594046040461404624046340464404654046640467404684046940470404714047240473404744047540476404774047840479404804048140482404834048440485404864048740488404894049040491404924049340494404954049640497404984049940500405014050240503405044050540506405074050840509405104051140512405134051440515405164051740518405194052040521405224052340524405254052640527405284052940530405314053240533405344053540536405374053840539405404054140542405434054440545405464054740548405494055040551405524055340554405554055640557405584055940560405614056240563405644056540566405674056840569405704057140572405734057440575405764057740578405794058040581405824058340584405854058640587405884058940590405914059240593405944059540596405974059840599406004060140602406034060440605406064060740608406094061040611406124061340614406154061640617406184061940620406214062240623406244062540626406274062840629406304063140632406334063440635406364063740638406394064040641406424064340644406454064640647406484064940650406514065240653406544065540656406574065840659406604066140662406634066440665406664066740668406694067040671406724067340674406754067640677406784067940680406814068240683406844068540686406874068840689406904069140692406934069440695406964069740698406994070040701407024070340704407054070640707407084070940710407114071240713407144071540716407174071840719407204072140722407234072440725407264072740728407294073040731407324073340734407354073640737407384073940740407414074240743407444074540746407474074840749407504075140752407534075440755407564075740758407594076040761407624076340764407654076640767407684076940770407714077240773407744077540776407774077840779407804078140782407834078440785407864078740788407894079040791407924079340794407954079640797407984079940800408014080240803408044080540806408074080840809408104081140812408134081440815408164081740818408194082040821408224082340824408254082640827408284082940830408314083240833408344083540836408374083840839408404084140842408434084440845408464084740848408494085040851408524085340854408554085640857408584085940860408614086240863408644086540866408674086840869408704087140872408734087440875408764087740878408794088040881408824088340884408854088640887408884088940890408914089240893408944089540896408974089840899409004090140902409034090440905409064090740908409094091040911409124091340914409154091640917409184091940920409214092240923409244092540926409274092840929409304093140932409334093440935409364093740938409394094040941409424094340944409454094640947409484094940950409514095240953409544095540956409574095840959409604096140962409634096440965409664096740968409694097040971409724097340974409754097640977409784097940980409814098240983409844098540986409874098840989409904099140992409934099440995409964099740998409994100041001410024100341004410054100641007410084100941010410114101241013410144101541016410174101841019410204102141022410234102441025410264102741028410294103041031410324103341034410354103641037410384103941040410414104241043410444104541046410474104841049410504105141052410534105441055410564105741058410594106041061410624106341064410654106641067410684106941070410714107241073410744107541076410774107841079410804108141082410834108441085410864108741088410894109041091410924109341094410954109641097410984109941100411014110241103411044110541106411074110841109411104111141112411134111441115411164111741118411194112041121411224112341124411254112641127411284112941130411314113241133411344113541136411374113841139411404114141142411434114441145411464114741148411494115041151411524115341154411554115641157411584115941160411614116241163411644116541166411674116841169411704117141172411734117441175411764117741178411794118041181411824118341184411854118641187411884118941190411914119241193411944119541196411974119841199412004120141202412034120441205412064120741208412094121041211412124121341214412154121641217412184121941220412214122241223412244122541226412274122841229412304123141232412334123441235412364123741238412394124041241412424124341244412454124641247412484124941250412514125241253412544125541256412574125841259412604126141262412634126441265412664126741268412694127041271412724127341274412754127641277412784127941280412814128241283412844128541286412874128841289412904129141292412934129441295412964129741298412994130041301413024130341304413054130641307413084130941310413114131241313413144131541316413174131841319413204132141322413234132441325413264132741328413294133041331413324133341334413354133641337413384133941340413414134241343413444134541346413474134841349413504135141352413534135441355413564135741358413594136041361413624136341364413654136641367413684136941370413714137241373413744137541376413774137841379413804138141382413834138441385413864138741388413894139041391413924139341394413954139641397413984139941400414014140241403414044140541406414074140841409414104141141412414134141441415414164141741418414194142041421414224142341424414254142641427414284142941430414314143241433414344143541436414374143841439414404144141442414434144441445414464144741448414494145041451414524145341454414554145641457414584145941460414614146241463414644146541466414674146841469414704147141472414734147441475414764147741478414794148041481414824148341484414854148641487414884148941490414914149241493414944149541496414974149841499415004150141502415034150441505415064150741508415094151041511415124151341514415154151641517415184151941520415214152241523415244152541526415274152841529415304153141532415334153441535415364153741538415394154041541415424154341544415454154641547415484154941550415514155241553415544155541556415574155841559415604156141562415634156441565415664156741568415694157041571415724157341574415754157641577415784157941580415814158241583415844158541586415874158841589415904159141592415934159441595415964159741598415994160041601416024160341604416054160641607416084160941610416114161241613416144161541616416174161841619416204162141622416234162441625416264162741628416294163041631416324163341634416354163641637416384163941640416414164241643416444164541646416474164841649416504165141652416534165441655416564165741658416594166041661416624166341664416654166641667416684166941670416714167241673416744167541676416774167841679416804168141682416834168441685416864168741688416894169041691416924169341694416954169641697416984169941700417014170241703417044170541706417074170841709417104171141712417134171441715417164171741718417194172041721417224172341724417254172641727417284172941730417314173241733417344173541736417374173841739417404174141742417434174441745417464174741748417494175041751417524175341754417554175641757417584175941760417614176241763417644176541766417674176841769417704177141772417734177441775417764177741778417794178041781417824178341784417854178641787417884178941790417914179241793417944179541796417974179841799418004180141802418034180441805418064180741808418094181041811418124181341814418154181641817418184181941820418214182241823418244182541826418274182841829418304183141832418334183441835418364183741838418394184041841418424184341844418454184641847418484184941850418514185241853418544185541856418574185841859418604186141862418634186441865418664186741868418694187041871418724187341874418754187641877418784187941880418814188241883418844188541886418874188841889418904189141892418934189441895418964189741898418994190041901419024190341904419054190641907419084190941910419114191241913419144191541916419174191841919419204192141922419234192441925419264192741928419294193041931419324193341934419354193641937419384193941940419414194241943419444194541946419474194841949419504195141952419534195441955419564195741958419594196041961419624196341964419654196641967419684196941970419714197241973419744197541976419774197841979419804198141982419834198441985419864198741988419894199041991419924199341994419954199641997419984199942000420014200242003420044200542006420074200842009420104201142012420134201442015420164201742018420194202042021420224202342024420254202642027420284202942030420314203242033420344203542036420374203842039420404204142042420434204442045420464204742048420494205042051420524205342054420554205642057420584205942060420614206242063420644206542066420674206842069420704207142072420734207442075420764207742078420794208042081420824208342084420854208642087420884208942090420914209242093420944209542096420974209842099421004210142102421034210442105421064210742108421094211042111421124211342114421154211642117421184211942120421214212242123421244212542126421274212842129421304213142132421334213442135421364213742138421394214042141421424214342144421454214642147421484214942150421514215242153421544215542156421574215842159421604216142162421634216442165421664216742168421694217042171421724217342174421754217642177421784217942180421814218242183421844218542186421874218842189421904219142192421934219442195421964219742198421994220042201422024220342204422054220642207422084220942210422114221242213422144221542216422174221842219422204222142222422234222442225422264222742228422294223042231422324223342234422354223642237422384223942240422414224242243422444224542246422474224842249422504225142252422534225442255422564225742258422594226042261422624226342264422654226642267422684226942270422714227242273422744227542276422774227842279422804228142282422834228442285422864228742288422894229042291422924229342294422954229642297422984229942300423014230242303423044230542306423074230842309423104231142312423134231442315423164231742318423194232042321423224232342324423254232642327423284232942330423314233242333423344233542336423374233842339423404234142342423434234442345423464234742348423494235042351423524235342354423554235642357423584235942360423614236242363423644236542366423674236842369423704237142372423734237442375423764237742378423794238042381423824238342384423854238642387423884238942390423914239242393423944239542396423974239842399424004240142402424034240442405424064240742408424094241042411424124241342414424154241642417424184241942420424214242242423424244242542426424274242842429424304243142432424334243442435424364243742438424394244042441424424244342444424454244642447424484244942450424514245242453424544245542456424574245842459424604246142462424634246442465424664246742468424694247042471424724247342474424754247642477424784247942480424814248242483424844248542486424874248842489424904249142492424934249442495424964249742498424994250042501425024250342504425054250642507425084250942510425114251242513425144251542516425174251842519425204252142522425234252442525425264252742528425294253042531425324253342534425354253642537425384253942540425414254242543425444254542546425474254842549425504255142552425534255442555425564255742558425594256042561425624256342564425654256642567425684256942570425714257242573425744257542576425774257842579425804258142582425834258442585425864258742588425894259042591425924259342594425954259642597425984259942600426014260242603426044260542606426074260842609426104261142612426134261442615426164261742618426194262042621426224262342624426254262642627426284262942630426314263242633426344263542636426374263842639426404264142642426434264442645426464264742648426494265042651426524265342654426554265642657426584265942660426614266242663426644266542666426674266842669426704267142672426734267442675426764267742678426794268042681426824268342684426854268642687426884268942690426914269242693426944269542696426974269842699427004270142702427034270442705427064270742708427094271042711427124271342714427154271642717427184271942720427214272242723427244272542726427274272842729427304273142732427334273442735427364273742738427394274042741427424274342744427454274642747427484274942750427514275242753427544275542756427574275842759427604276142762427634276442765427664276742768427694277042771427724277342774427754277642777427784277942780427814278242783427844278542786427874278842789427904279142792427934279442795427964279742798427994280042801428024280342804428054280642807428084280942810428114281242813428144281542816428174281842819428204282142822428234282442825428264282742828428294283042831428324283342834428354283642837428384283942840428414284242843428444284542846428474284842849428504285142852428534285442855428564285742858428594286042861428624286342864428654286642867428684286942870428714287242873428744287542876428774287842879428804288142882428834288442885428864288742888428894289042891428924289342894428954289642897428984289942900429014290242903429044290542906429074290842909429104291142912429134291442915429164291742918429194292042921429224292342924429254292642927429284292942930429314293242933429344293542936429374293842939429404294142942429434294442945429464294742948429494295042951429524295342954429554295642957429584295942960429614296242963429644296542966429674296842969429704297142972429734297442975429764297742978429794298042981429824298342984429854298642987429884298942990429914299242993429944299542996429974299842999430004300143002430034300443005430064300743008430094301043011430124301343014430154301643017430184301943020430214302243023430244302543026430274302843029430304303143032430334303443035430364303743038430394304043041430424304343044430454304643047430484304943050430514305243053430544305543056430574305843059430604306143062430634306443065430664306743068430694307043071430724307343074430754307643077430784307943080430814308243083430844308543086430874308843089430904309143092430934309443095430964309743098430994310043101431024310343104431054310643107431084310943110431114311243113431144311543116431174311843119431204312143122431234312443125431264312743128431294313043131431324313343134431354313643137431384313943140431414314243143431444314543146431474314843149431504315143152431534315443155431564315743158431594316043161431624316343164431654316643167431684316943170431714317243173431744317543176431774317843179431804318143182431834318443185431864318743188431894319043191431924319343194431954319643197431984319943200432014320243203432044320543206432074320843209432104321143212432134321443215432164321743218432194322043221432224322343224432254322643227432284322943230432314323243233432344323543236432374323843239432404324143242432434324443245432464324743248432494325043251432524325343254432554325643257432584325943260432614326243263432644326543266432674326843269432704327143272432734327443275432764327743278432794328043281432824328343284432854328643287432884328943290432914329243293432944329543296432974329843299433004330143302433034330443305433064330743308433094331043311433124331343314433154331643317433184331943320433214332243323433244332543326433274332843329433304333143332433334333443335433364333743338433394334043341433424334343344433454334643347433484334943350433514335243353433544335543356433574335843359433604336143362433634336443365433664336743368433694337043371433724337343374433754337643377433784337943380433814338243383433844338543386433874338843389433904339143392433934339443395433964339743398433994340043401434024340343404434054340643407434084340943410434114341243413434144341543416434174341843419434204342143422434234342443425434264342743428434294343043431434324343343434434354343643437434384343943440434414344243443434444344543446434474344843449434504345143452434534345443455434564345743458434594346043461434624346343464434654346643467434684346943470434714347243473434744347543476434774347843479434804348143482434834348443485434864348743488434894349043491434924349343494434954349643497434984349943500435014350243503435044350543506435074350843509435104351143512435134351443515435164351743518435194352043521435224352343524435254352643527435284352943530435314353243533435344353543536435374353843539435404354143542435434354443545435464354743548435494355043551435524355343554435554355643557435584355943560435614356243563435644356543566435674356843569435704357143572435734357443575435764357743578435794358043581435824358343584435854358643587435884358943590435914359243593435944359543596435974359843599436004360143602436034360443605436064360743608436094361043611436124361343614436154361643617436184361943620436214362243623436244362543626436274362843629436304363143632436334363443635436364363743638436394364043641436424364343644436454364643647436484364943650436514365243653436544365543656436574365843659436604366143662436634366443665436664366743668436694367043671436724367343674436754367643677436784367943680436814368243683436844368543686436874368843689436904369143692436934369443695436964369743698436994370043701437024370343704437054370643707437084370943710437114371243713437144371543716437174371843719437204372143722437234372443725437264372743728437294373043731437324373343734437354373643737437384373943740437414374243743437444374543746437474374843749437504375143752437534375443755437564375743758437594376043761437624376343764437654376643767437684376943770437714377243773437744377543776437774377843779437804378143782437834378443785437864378743788437894379043791437924379343794437954379643797437984379943800438014380243803438044380543806438074380843809438104381143812438134381443815438164381743818438194382043821438224382343824438254382643827438284382943830438314383243833438344383543836438374383843839438404384143842438434384443845438464384743848438494385043851438524385343854438554385643857438584385943860438614386243863438644386543866438674386843869438704387143872438734387443875438764387743878438794388043881438824388343884438854388643887438884388943890438914389243893438944389543896438974389843899439004390143902439034390443905439064390743908439094391043911439124391343914439154391643917439184391943920439214392243923439244392543926439274392843929439304393143932439334393443935439364393743938439394394043941439424394343944439454394643947439484394943950439514395243953439544395543956439574395843959439604396143962439634396443965439664396743968439694397043971439724397343974439754397643977439784397943980439814398243983439844398543986439874398843989439904399143992439934399443995439964399743998439994400044001440024400344004440054400644007440084400944010440114401244013440144401544016440174401844019440204402144022440234402444025440264402744028440294403044031440324403344034440354403644037440384403944040440414404244043440444404544046440474404844049440504405144052440534405444055440564405744058440594406044061440624406344064440654406644067440684406944070440714407244073440744407544076440774407844079440804408144082440834408444085440864408744088440894409044091440924409344094440954409644097440984409944100441014410244103441044410544106441074410844109441104411144112441134411444115441164411744118441194412044121441224412344124441254412644127441284412944130441314413244133441344413544136441374413844139441404414144142441434414444145441464414744148441494415044151441524415344154441554415644157441584415944160441614416244163441644416544166441674416844169441704417144172441734417444175441764417744178441794418044181441824418344184441854418644187441884418944190441914419244193441944419544196441974419844199442004420144202442034420444205442064420744208442094421044211442124421344214442154421644217442184421944220442214422244223442244422544226442274422844229442304423144232442334423444235442364423744238442394424044241442424424344244442454424644247442484424944250442514425244253442544425544256442574425844259442604426144262442634426444265442664426744268442694427044271442724427344274442754427644277442784427944280442814428244283442844428544286442874428844289442904429144292442934429444295442964429744298442994430044301443024430344304443054430644307443084430944310443114431244313443144431544316443174431844319443204432144322443234432444325443264432744328443294433044331443324433344334443354433644337443384433944340443414434244343443444434544346443474434844349443504435144352443534435444355443564435744358443594436044361443624436344364443654436644367443684436944370443714437244373443744437544376443774437844379443804438144382443834438444385443864438744388443894439044391443924439344394443954439644397443984439944400444014440244403444044440544406444074440844409444104441144412444134441444415444164441744418444194442044421444224442344424444254442644427444284442944430444314443244433444344443544436444374443844439444404444144442444434444444445444464444744448444494445044451444524445344454444554445644457444584445944460444614446244463444644446544466444674446844469444704447144472444734447444475444764447744478444794448044481444824448344484444854448644487444884448944490444914449244493444944449544496444974449844499445004450144502445034450444505445064450744508445094451044511445124451344514445154451644517445184451944520445214452244523445244452544526445274452844529445304453144532445334453444535445364453744538445394454044541445424454344544445454454644547445484454944550445514455244553445544455544556445574455844559445604456144562445634456444565445664456744568445694457044571445724457344574445754457644577445784457944580445814458244583445844458544586445874458844589445904459144592445934459444595445964459744598445994460044601446024460344604446054460644607446084460944610446114461244613446144461544616446174461844619446204462144622446234462444625446264462744628446294463044631446324463344634446354463644637446384463944640446414464244643446444464544646446474464844649446504465144652446534465444655446564465744658446594466044661446624466344664446654466644667446684466944670446714467244673446744467544676446774467844679446804468144682446834468444685446864468744688446894469044691446924469344694446954469644697446984469944700447014470244703447044470544706447074470844709447104471144712447134471444715447164471744718447194472044721447224472344724447254472644727447284472944730447314473244733447344473544736447374473844739447404474144742447434474444745447464474744748447494475044751447524475344754447554475644757447584475944760447614476244763447644476544766447674476844769447704477144772447734477444775447764477744778447794478044781447824478344784447854478644787447884478944790447914479244793447944479544796447974479844799448004480144802448034480444805448064480744808448094481044811448124481344814448154481644817448184481944820448214482244823448244482544826448274482844829448304483144832448334483444835448364483744838448394484044841448424484344844448454484644847448484484944850448514485244853448544485544856448574485844859448604486144862448634486444865448664486744868448694487044871448724487344874448754487644877448784487944880448814488244883448844488544886448874488844889448904489144892448934489444895448964489744898448994490044901449024490344904449054490644907449084490944910449114491244913449144491544916449174491844919449204492144922449234492444925449264492744928449294493044931449324493344934449354493644937449384493944940449414494244943449444494544946449474494844949449504495144952449534495444955449564495744958449594496044961449624496344964449654496644967449684496944970449714497244973449744497544976449774497844979449804498144982449834498444985449864498744988449894499044991449924499344994449954499644997449984499945000450014500245003450044500545006450074500845009450104501145012450134501445015450164501745018450194502045021450224502345024450254502645027450284502945030450314503245033450344503545036450374503845039450404504145042450434504445045450464504745048450494505045051450524505345054450554505645057450584505945060450614506245063450644506545066450674506845069450704507145072450734507445075450764507745078450794508045081450824508345084450854508645087450884508945090450914509245093450944509545096450974509845099451004510145102451034510445105451064510745108451094511045111451124511345114451154511645117451184511945120451214512245123451244512545126451274512845129451304513145132451334513445135451364513745138451394514045141451424514345144451454514645147451484514945150451514515245153451544515545156451574515845159451604516145162451634516445165451664516745168451694517045171451724517345174451754517645177451784517945180451814518245183451844518545186451874518845189451904519145192451934519445195451964519745198451994520045201452024520345204452054520645207452084520945210452114521245213452144521545216452174521845219452204522145222452234522445225452264522745228452294523045231452324523345234452354523645237452384523945240452414524245243452444524545246452474524845249452504525145252452534525445255452564525745258452594526045261452624526345264452654526645267452684526945270452714527245273452744527545276452774527845279452804528145282452834528445285452864528745288452894529045291452924529345294452954529645297452984529945300453014530245303453044530545306453074530845309453104531145312453134531445315453164531745318453194532045321453224532345324453254532645327453284532945330453314533245333453344533545336453374533845339453404534145342453434534445345453464534745348453494535045351453524535345354453554535645357453584535945360453614536245363453644536545366453674536845369453704537145372453734537445375453764537745378453794538045381453824538345384453854538645387453884538945390453914539245393453944539545396453974539845399454004540145402454034540445405454064540745408454094541045411454124541345414454154541645417454184541945420454214542245423454244542545426454274542845429454304543145432454334543445435454364543745438454394544045441454424544345444454454544645447454484544945450454514545245453454544545545456454574545845459454604546145462454634546445465454664546745468454694547045471454724547345474454754547645477454784547945480454814548245483454844548545486454874548845489454904549145492454934549445495454964549745498454994550045501455024550345504455054550645507455084550945510455114551245513455144551545516455174551845519455204552145522455234552445525455264552745528455294553045531455324553345534455354553645537455384553945540455414554245543455444554545546455474554845549455504555145552455534555445555455564555745558455594556045561455624556345564455654556645567455684556945570455714557245573455744557545576455774557845579455804558145582455834558445585455864558745588455894559045591455924559345594455954559645597455984559945600456014560245603456044560545606456074560845609456104561145612456134561445615456164561745618456194562045621456224562345624456254562645627456284562945630456314563245633456344563545636456374563845639456404564145642456434564445645456464564745648456494565045651456524565345654456554565645657456584565945660456614566245663456644566545666456674566845669456704567145672456734567445675456764567745678456794568045681456824568345684456854568645687456884568945690456914569245693456944569545696456974569845699457004570145702457034570445705457064570745708457094571045711457124571345714457154571645717457184571945720457214572245723457244572545726457274572845729457304573145732457334573445735457364573745738457394574045741457424574345744457454574645747457484574945750457514575245753457544575545756457574575845759457604576145762457634576445765457664576745768457694577045771457724577345774457754577645777457784577945780457814578245783457844578545786457874578845789457904579145792457934579445795457964579745798457994580045801458024580345804458054580645807458084580945810458114581245813458144581545816458174581845819458204582145822458234582445825458264582745828458294583045831458324583345834458354583645837458384583945840458414584245843458444584545846458474584845849458504585145852458534585445855458564585745858458594586045861458624586345864458654586645867458684586945870458714587245873458744587545876458774587845879458804588145882458834588445885458864588745888458894589045891458924589345894458954589645897458984589945900459014590245903459044590545906459074590845909459104591145912459134591445915459164591745918459194592045921459224592345924459254592645927459284592945930459314593245933459344593545936459374593845939459404594145942459434594445945459464594745948459494595045951459524595345954459554595645957459584595945960459614596245963459644596545966459674596845969459704597145972459734597445975459764597745978459794598045981459824598345984459854598645987459884598945990459914599245993459944599545996459974599845999460004600146002460034600446005460064600746008460094601046011460124601346014460154601646017460184601946020460214602246023460244602546026460274602846029460304603146032460334603446035460364603746038460394604046041460424604346044460454604646047460484604946050460514605246053460544605546056460574605846059460604606146062460634606446065460664606746068460694607046071460724607346074460754607646077460784607946080460814608246083460844608546086460874608846089460904609146092460934609446095460964609746098460994610046101461024610346104461054610646107461084610946110461114611246113461144611546116461174611846119461204612146122461234612446125461264612746128461294613046131461324613346134461354613646137461384613946140461414614246143461444614546146461474614846149461504615146152461534615446155461564615746158461594616046161461624616346164461654616646167461684616946170461714617246173461744617546176461774617846179461804618146182461834618446185461864618746188461894619046191461924619346194461954619646197461984619946200462014620246203462044620546206462074620846209462104621146212462134621446215462164621746218462194622046221462224622346224462254622646227462284622946230462314623246233462344623546236462374623846239462404624146242462434624446245462464624746248462494625046251462524625346254462554625646257462584625946260462614626246263462644626546266462674626846269462704627146272462734627446275462764627746278462794628046281462824628346284462854628646287462884628946290462914629246293462944629546296462974629846299463004630146302463034630446305463064630746308463094631046311463124631346314463154631646317463184631946320463214632246323463244632546326463274632846329463304633146332463334633446335463364633746338463394634046341463424634346344463454634646347463484634946350463514635246353463544635546356463574635846359463604636146362463634636446365463664636746368463694637046371463724637346374463754637646377463784637946380463814638246383463844638546386463874638846389463904639146392463934639446395463964639746398463994640046401464024640346404464054640646407464084640946410464114641246413464144641546416464174641846419464204642146422464234642446425464264642746428464294643046431464324643346434464354643646437464384643946440464414644246443464444644546446464474644846449464504645146452464534645446455464564645746458464594646046461464624646346464464654646646467464684646946470464714647246473464744647546476464774647846479464804648146482464834648446485464864648746488464894649046491464924649346494464954649646497464984649946500465014650246503465044650546506465074650846509465104651146512465134651446515465164651746518465194652046521465224652346524465254652646527465284652946530465314653246533465344653546536465374653846539465404654146542465434654446545465464654746548465494655046551465524655346554465554655646557465584655946560465614656246563465644656546566465674656846569465704657146572465734657446575465764657746578465794658046581465824658346584465854658646587465884658946590465914659246593465944659546596465974659846599466004660146602466034660446605466064660746608466094661046611466124661346614466154661646617466184661946620466214662246623466244662546626466274662846629466304663146632466334663446635466364663746638466394664046641466424664346644466454664646647466484664946650466514665246653466544665546656466574665846659466604666146662466634666446665466664666746668466694667046671466724667346674466754667646677466784667946680466814668246683466844668546686466874668846689466904669146692466934669446695466964669746698466994670046701467024670346704467054670646707467084670946710467114671246713467144671546716467174671846719467204672146722467234672446725467264672746728467294673046731467324673346734467354673646737467384673946740467414674246743467444674546746467474674846749467504675146752467534675446755467564675746758467594676046761467624676346764467654676646767467684676946770467714677246773467744677546776467774677846779467804678146782467834678446785467864678746788467894679046791467924679346794467954679646797467984679946800468014680246803468044680546806468074680846809468104681146812468134681446815468164681746818468194682046821468224682346824468254682646827468284682946830468314683246833468344683546836468374683846839468404684146842468434684446845468464684746848468494685046851468524685346854468554685646857468584685946860468614686246863468644686546866468674686846869468704687146872468734687446875468764687746878468794688046881468824688346884468854688646887468884688946890468914689246893468944689546896468974689846899469004690146902469034690446905469064690746908469094691046911469124691346914469154691646917469184691946920469214692246923469244692546926469274692846929469304693146932469334693446935469364693746938469394694046941469424694346944469454694646947469484694946950469514695246953469544695546956469574695846959469604696146962469634696446965469664696746968469694697046971469724697346974469754697646977469784697946980469814698246983469844698546986469874698846989469904699146992469934699446995469964699746998469994700047001470024700347004470054700647007470084700947010470114701247013470144701547016470174701847019470204702147022470234702447025470264702747028470294703047031470324703347034470354703647037470384703947040470414704247043470444704547046470474704847049470504705147052470534705447055470564705747058470594706047061470624706347064470654706647067470684706947070470714707247073470744707547076470774707847079470804708147082470834708447085470864708747088470894709047091470924709347094470954709647097470984709947100471014710247103471044710547106471074710847109471104711147112471134711447115471164711747118471194712047121471224712347124471254712647127471284712947130471314713247133471344713547136471374713847139471404714147142471434714447145471464714747148471494715047151471524715347154471554715647157471584715947160471614716247163471644716547166471674716847169471704717147172471734717447175471764717747178471794718047181471824718347184471854718647187471884718947190471914719247193471944719547196471974719847199472004720147202472034720447205472064720747208472094721047211472124721347214472154721647217472184721947220472214722247223472244722547226472274722847229472304723147232472334723447235472364723747238472394724047241472424724347244472454724647247472484724947250472514725247253472544725547256472574725847259472604726147262472634726447265472664726747268472694727047271472724727347274472754727647277472784727947280472814728247283472844728547286472874728847289472904729147292472934729447295472964729747298472994730047301473024730347304473054730647307473084730947310473114731247313473144731547316473174731847319473204732147322473234732447325473264732747328473294733047331473324733347334473354733647337473384733947340473414734247343473444734547346473474734847349473504735147352473534735447355473564735747358473594736047361473624736347364473654736647367473684736947370473714737247373473744737547376473774737847379473804738147382473834738447385473864738747388473894739047391473924739347394473954739647397473984739947400474014740247403474044740547406474074740847409474104741147412474134741447415474164741747418474194742047421474224742347424474254742647427474284742947430474314743247433474344743547436474374743847439474404744147442474434744447445474464744747448474494745047451474524745347454474554745647457474584745947460474614746247463474644746547466474674746847469474704747147472474734747447475474764747747478474794748047481474824748347484474854748647487474884748947490474914749247493474944749547496474974749847499475004750147502475034750447505475064750747508475094751047511475124751347514475154751647517475184751947520475214752247523475244752547526475274752847529475304753147532475334753447535475364753747538475394754047541475424754347544475454754647547475484754947550475514755247553475544755547556475574755847559475604756147562475634756447565475664756747568475694757047571475724757347574475754757647577475784757947580475814758247583475844758547586475874758847589475904759147592475934759447595475964759747598475994760047601476024760347604476054760647607476084760947610476114761247613476144761547616476174761847619476204762147622476234762447625476264762747628476294763047631476324763347634476354763647637476384763947640476414764247643476444764547646476474764847649476504765147652476534765447655476564765747658476594766047661476624766347664476654766647667476684766947670476714767247673476744767547676476774767847679476804768147682476834768447685476864768747688476894769047691476924769347694476954769647697476984769947700477014770247703477044770547706477074770847709477104771147712477134771447715477164771747718477194772047721477224772347724477254772647727477284772947730477314773247733477344773547736477374773847739477404774147742477434774447745477464774747748477494775047751477524775347754477554775647757477584775947760477614776247763477644776547766477674776847769477704777147772477734777447775477764777747778477794778047781477824778347784477854778647787477884778947790477914779247793477944779547796477974779847799478004780147802478034780447805478064780747808478094781047811478124781347814478154781647817478184781947820478214782247823478244782547826478274782847829478304783147832478334783447835478364783747838478394784047841478424784347844478454784647847478484784947850478514785247853478544785547856478574785847859478604786147862478634786447865478664786747868478694787047871478724787347874478754787647877478784787947880478814788247883478844788547886478874788847889478904789147892478934789447895478964789747898478994790047901479024790347904479054790647907479084790947910479114791247913479144791547916479174791847919479204792147922479234792447925479264792747928479294793047931479324793347934479354793647937479384793947940479414794247943479444794547946479474794847949479504795147952479534795447955479564795747958479594796047961479624796347964479654796647967479684796947970479714797247973479744797547976479774797847979479804798147982479834798447985479864798747988479894799047991479924799347994479954799647997479984799948000480014800248003480044800548006480074800848009480104801148012480134801448015480164801748018480194802048021480224802348024480254802648027480284802948030480314803248033480344803548036480374803848039480404804148042480434804448045480464804748048480494805048051480524805348054480554805648057480584805948060480614806248063480644806548066480674806848069480704807148072480734807448075480764807748078480794808048081480824808348084480854808648087480884808948090480914809248093480944809548096480974809848099481004810148102481034810448105481064810748108481094811048111481124811348114481154811648117481184811948120481214812248123481244812548126481274812848129481304813148132481334813448135481364813748138481394814048141481424814348144481454814648147481484814948150481514815248153481544815548156481574815848159481604816148162481634816448165481664816748168481694817048171481724817348174481754817648177481784817948180481814818248183481844818548186481874818848189481904819148192481934819448195481964819748198481994820048201482024820348204482054820648207482084820948210482114821248213482144821548216482174821848219482204822148222482234822448225482264822748228482294823048231482324823348234482354823648237482384823948240482414824248243482444824548246482474824848249482504825148252482534825448255482564825748258482594826048261482624826348264482654826648267482684826948270482714827248273482744827548276482774827848279482804828148282482834828448285482864828748288482894829048291482924829348294482954829648297482984829948300483014830248303483044830548306483074830848309483104831148312483134831448315483164831748318483194832048321483224832348324483254832648327483284832948330483314833248333483344833548336483374833848339483404834148342483434834448345483464834748348483494835048351483524835348354483554835648357483584835948360483614836248363483644836548366483674836848369483704837148372483734837448375483764837748378483794838048381483824838348384483854838648387483884838948390483914839248393483944839548396483974839848399484004840148402484034840448405484064840748408484094841048411484124841348414484154841648417484184841948420484214842248423484244842548426484274842848429484304843148432484334843448435484364843748438484394844048441484424844348444484454844648447484484844948450484514845248453484544845548456484574845848459484604846148462484634846448465484664846748468484694847048471484724847348474484754847648477484784847948480484814848248483484844848548486484874848848489484904849148492484934849448495484964849748498484994850048501485024850348504485054850648507485084850948510485114851248513485144851548516485174851848519485204852148522485234852448525485264852748528485294853048531485324853348534485354853648537485384853948540485414854248543485444854548546485474854848549485504855148552485534855448555485564855748558485594856048561485624856348564485654856648567485684856948570485714857248573485744857548576485774857848579485804858148582485834858448585485864858748588485894859048591485924859348594485954859648597485984859948600486014860248603486044860548606486074860848609486104861148612486134861448615486164861748618486194862048621486224862348624486254862648627486284862948630486314863248633486344863548636486374863848639486404864148642486434864448645486464864748648486494865048651486524865348654486554865648657486584865948660486614866248663486644866548666486674866848669486704867148672486734867448675486764867748678486794868048681486824868348684486854868648687486884868948690486914869248693486944869548696486974869848699487004870148702487034870448705487064870748708487094871048711487124871348714487154871648717487184871948720487214872248723487244872548726487274872848729487304873148732487334873448735487364873748738487394874048741487424874348744487454874648747487484874948750487514875248753487544875548756487574875848759487604876148762487634876448765487664876748768487694877048771487724877348774487754877648777487784877948780487814878248783487844878548786487874878848789487904879148792487934879448795487964879748798487994880048801488024880348804488054880648807488084880948810488114881248813488144881548816488174881848819488204882148822488234882448825488264882748828488294883048831488324883348834488354883648837488384883948840488414884248843488444884548846488474884848849488504885148852488534885448855488564885748858488594886048861488624886348864488654886648867488684886948870488714887248873488744887548876488774887848879488804888148882488834888448885488864888748888488894889048891488924889348894488954889648897488984889948900489014890248903489044890548906489074890848909489104891148912489134891448915489164891748918489194892048921489224892348924489254892648927489284892948930489314893248933489344893548936489374893848939489404894148942489434894448945489464894748948489494895048951489524895348954489554895648957489584895948960489614896248963489644896548966489674896848969489704897148972489734897448975489764897748978489794898048981489824898348984489854898648987489884898948990489914899248993489944899548996489974899848999490004900149002490034900449005490064900749008490094901049011490124901349014490154901649017490184901949020490214902249023490244902549026490274902849029490304903149032490334903449035490364903749038490394904049041490424904349044490454904649047490484904949050490514905249053490544905549056490574905849059490604906149062490634906449065490664906749068490694907049071490724907349074490754907649077490784907949080490814908249083490844908549086490874908849089490904909149092490934909449095490964909749098490994910049101491024910349104491054910649107491084910949110491114911249113491144911549116491174911849119491204912149122491234912449125491264912749128491294913049131491324913349134491354913649137491384913949140491414914249143491444914549146491474914849149491504915149152491534915449155491564915749158491594916049161491624916349164491654916649167491684916949170491714917249173491744917549176491774917849179491804918149182491834918449185491864918749188491894919049191491924919349194491954919649197491984919949200492014920249203492044920549206492074920849209492104921149212492134921449215492164921749218492194922049221492224922349224492254922649227492284922949230492314923249233492344923549236492374923849239492404924149242492434924449245492464924749248492494925049251492524925349254492554925649257492584925949260492614926249263492644926549266492674926849269492704927149272492734927449275492764927749278492794928049281492824928349284492854928649287492884928949290492914929249293492944929549296492974929849299493004930149302493034930449305493064930749308493094931049311493124931349314493154931649317493184931949320493214932249323493244932549326493274932849329493304933149332493334933449335493364933749338493394934049341493424934349344493454934649347493484934949350493514935249353493544935549356493574935849359493604936149362493634936449365493664936749368493694937049371493724937349374493754937649377493784937949380493814938249383493844938549386493874938849389493904939149392493934939449395493964939749398493994940049401494024940349404494054940649407494084940949410494114941249413494144941549416494174941849419494204942149422494234942449425494264942749428494294943049431494324943349434494354943649437494384943949440494414944249443494444944549446494474944849449494504945149452494534945449455494564945749458494594946049461494624946349464494654946649467494684946949470494714947249473494744947549476494774947849479494804948149482494834948449485494864948749488494894949049491494924949349494494954949649497494984949949500495014950249503495044950549506495074950849509495104951149512495134951449515495164951749518495194952049521495224952349524495254952649527495284952949530495314953249533495344953549536495374953849539495404954149542495434954449545495464954749548495494955049551495524955349554495554955649557495584955949560495614956249563495644956549566495674956849569495704957149572495734957449575495764957749578495794958049581495824958349584495854958649587495884958949590495914959249593495944959549596495974959849599496004960149602496034960449605496064960749608496094961049611496124961349614496154961649617496184961949620496214962249623496244962549626496274962849629496304963149632496334963449635496364963749638496394964049641496424964349644496454964649647496484964949650496514965249653496544965549656496574965849659496604966149662496634966449665496664966749668496694967049671496724967349674496754967649677496784967949680496814968249683496844968549686496874968849689496904969149692496934969449695496964969749698496994970049701497024970349704497054970649707497084970949710497114971249713497144971549716497174971849719497204972149722497234972449725497264972749728497294973049731497324973349734497354973649737497384973949740497414974249743497444974549746497474974849749497504975149752497534975449755497564975749758497594976049761497624976349764497654976649767497684976949770497714977249773497744977549776497774977849779497804978149782497834978449785497864978749788497894979049791497924979349794497954979649797497984979949800498014980249803498044980549806498074980849809498104981149812498134981449815498164981749818498194982049821498224982349824498254982649827498284982949830498314983249833498344983549836498374983849839498404984149842498434984449845498464984749848498494985049851498524985349854498554985649857498584985949860498614986249863498644986549866498674986849869498704987149872498734987449875498764987749878498794988049881498824988349884498854988649887498884988949890498914989249893498944989549896498974989849899499004990149902499034990449905499064990749908499094991049911499124991349914499154991649917499184991949920499214992249923499244992549926499274992849929499304993149932499334993449935499364993749938499394994049941499424994349944499454994649947499484994949950499514995249953499544995549956499574995849959499604996149962499634996449965499664996749968499694997049971499724997349974499754997649977499784997949980499814998249983499844998549986499874998849989499904999149992499934999449995499964999749998499995000050001500025000350004500055000650007500085000950010500115001250013500145001550016500175001850019500205002150022500235002450025500265002750028500295003050031500325003350034500355003650037500385003950040500415004250043500445004550046500475004850049500505005150052500535005450055500565005750058500595006050061500625006350064500655006650067500685006950070500715007250073500745007550076500775007850079500805008150082500835008450085500865008750088500895009050091500925009350094500955009650097500985009950100501015010250103501045010550106501075010850109501105011150112501135011450115501165011750118501195012050121501225012350124501255012650127501285012950130501315013250133501345013550136501375013850139501405014150142501435014450145501465014750148501495015050151501525015350154501555015650157501585015950160501615016250163501645016550166501675016850169501705017150172501735017450175501765017750178501795018050181501825018350184501855018650187501885018950190501915019250193501945019550196501975019850199502005020150202502035020450205502065020750208502095021050211502125021350214502155021650217502185021950220502215022250223502245022550226502275022850229502305023150232502335023450235502365023750238502395024050241502425024350244502455024650247502485024950250502515025250253502545025550256502575025850259502605026150262502635026450265502665026750268502695027050271502725027350274502755027650277502785027950280502815028250283502845028550286502875028850289502905029150292502935029450295502965029750298502995030050301503025030350304503055030650307503085030950310503115031250313503145031550316503175031850319503205032150322503235032450325503265032750328503295033050331503325033350334503355033650337503385033950340503415034250343503445034550346503475034850349503505035150352503535035450355503565035750358503595036050361503625036350364503655036650367503685036950370503715037250373503745037550376503775037850379503805038150382503835038450385503865038750388503895039050391503925039350394503955039650397503985039950400504015040250403504045040550406504075040850409504105041150412504135041450415504165041750418504195042050421504225042350424504255042650427504285042950430504315043250433504345043550436504375043850439504405044150442504435044450445504465044750448504495045050451504525045350454504555045650457504585045950460504615046250463504645046550466504675046850469504705047150472504735047450475504765047750478504795048050481504825048350484504855048650487504885048950490504915049250493504945049550496504975049850499505005050150502505035050450505505065050750508505095051050511505125051350514505155051650517505185051950520505215052250523505245052550526505275052850529505305053150532505335053450535505365053750538505395054050541505425054350544505455054650547505485054950550505515055250553505545055550556505575055850559505605056150562505635056450565505665056750568505695057050571505725057350574505755057650577505785057950580505815058250583505845058550586505875058850589505905059150592505935059450595505965059750598505995060050601506025060350604506055060650607506085060950610506115061250613506145061550616506175061850619506205062150622506235062450625506265062750628506295063050631506325063350634506355063650637506385063950640506415064250643506445064550646506475064850649506505065150652506535065450655506565065750658506595066050661506625066350664506655066650667506685066950670506715067250673506745067550676506775067850679506805068150682506835068450685506865068750688506895069050691506925069350694506955069650697506985069950700507015070250703507045070550706507075070850709507105071150712507135071450715507165071750718507195072050721507225072350724507255072650727507285072950730507315073250733507345073550736507375073850739507405074150742507435074450745507465074750748507495075050751507525075350754507555075650757507585075950760507615076250763507645076550766507675076850769507705077150772507735077450775507765077750778507795078050781507825078350784507855078650787507885078950790507915079250793507945079550796507975079850799508005080150802508035080450805508065080750808508095081050811508125081350814508155081650817508185081950820508215082250823508245082550826508275082850829508305083150832508335083450835508365083750838508395084050841508425084350844508455084650847508485084950850508515085250853508545085550856508575085850859508605086150862508635086450865508665086750868508695087050871508725087350874508755087650877508785087950880508815088250883508845088550886508875088850889508905089150892508935089450895508965089750898508995090050901509025090350904509055090650907509085090950910509115091250913509145091550916509175091850919509205092150922509235092450925509265092750928509295093050931509325093350934509355093650937509385093950940509415094250943509445094550946509475094850949509505095150952509535095450955509565095750958509595096050961509625096350964509655096650967509685096950970509715097250973509745097550976509775097850979509805098150982509835098450985509865098750988509895099050991509925099350994509955099650997509985099951000510015100251003510045100551006510075100851009510105101151012510135101451015510165101751018510195102051021510225102351024510255102651027510285102951030510315103251033510345103551036510375103851039510405104151042510435104451045510465104751048510495105051051510525105351054510555105651057510585105951060510615106251063510645106551066510675106851069510705107151072510735107451075510765107751078510795108051081510825108351084510855108651087510885108951090510915109251093510945109551096510975109851099511005110151102511035110451105511065110751108511095111051111511125111351114511155111651117511185111951120511215112251123511245112551126511275112851129511305113151132511335113451135511365113751138511395114051141511425114351144511455114651147511485114951150511515115251153511545115551156511575115851159511605116151162511635116451165511665116751168511695117051171511725117351174511755117651177511785117951180511815118251183511845118551186511875118851189511905119151192511935119451195511965119751198511995120051201512025120351204512055120651207512085120951210512115121251213512145121551216512175121851219512205122151222512235122451225512265122751228512295123051231512325123351234512355123651237512385123951240512415124251243512445124551246512475124851249512505125151252512535125451255512565125751258512595126051261512625126351264512655126651267512685126951270512715127251273512745127551276512775127851279512805128151282512835128451285512865128751288512895129051291512925129351294512955129651297512985129951300513015130251303513045130551306513075130851309513105131151312513135131451315513165131751318513195132051321513225132351324513255132651327513285132951330513315133251333513345133551336513375133851339513405134151342513435134451345513465134751348513495135051351513525135351354513555135651357513585135951360513615136251363513645136551366513675136851369513705137151372513735137451375513765137751378513795138051381513825138351384513855138651387513885138951390513915139251393513945139551396513975139851399514005140151402514035140451405514065140751408514095141051411514125141351414514155141651417514185141951420514215142251423514245142551426514275142851429514305143151432514335143451435514365143751438514395144051441514425144351444514455144651447514485144951450514515145251453514545145551456514575145851459514605146151462514635146451465514665146751468514695147051471514725147351474514755147651477514785147951480514815148251483514845148551486514875148851489514905149151492514935149451495514965149751498514995150051501515025150351504515055150651507515085150951510515115151251513515145151551516515175151851519515205152151522515235152451525515265152751528515295153051531515325153351534515355153651537515385153951540515415154251543515445154551546515475154851549515505155151552515535155451555515565155751558515595156051561515625156351564515655156651567515685156951570515715157251573515745157551576515775157851579515805158151582515835158451585515865158751588515895159051591515925159351594515955159651597515985159951600516015160251603516045160551606516075160851609516105161151612516135161451615516165161751618516195162051621516225162351624516255162651627516285162951630516315163251633516345163551636516375163851639516405164151642516435164451645516465164751648516495165051651516525165351654516555165651657516585165951660516615166251663516645166551666516675166851669516705167151672516735167451675516765167751678516795168051681516825168351684516855168651687516885168951690516915169251693516945169551696516975169851699517005170151702517035170451705517065170751708517095171051711517125171351714517155171651717517185171951720517215172251723517245172551726517275172851729517305173151732517335173451735517365173751738517395174051741517425174351744517455174651747517485174951750517515175251753517545175551756517575175851759517605176151762517635176451765517665176751768517695177051771517725177351774517755177651777517785177951780517815178251783517845178551786517875178851789517905179151792517935179451795517965179751798517995180051801518025180351804518055180651807518085180951810518115181251813518145181551816518175181851819518205182151822518235182451825518265182751828518295183051831518325183351834518355183651837518385183951840518415184251843518445184551846518475184851849518505185151852518535185451855518565185751858518595186051861518625186351864518655186651867518685186951870518715187251873518745187551876518775187851879518805188151882518835188451885518865188751888518895189051891518925189351894518955189651897518985189951900519015190251903519045190551906519075190851909519105191151912519135191451915519165191751918519195192051921519225192351924519255192651927519285192951930519315193251933519345193551936519375193851939519405194151942519435194451945519465194751948519495195051951519525195351954519555195651957519585195951960519615196251963519645196551966519675196851969519705197151972519735197451975519765197751978519795198051981519825198351984519855198651987519885198951990519915199251993519945199551996519975199851999520005200152002520035200452005520065200752008520095201052011520125201352014520155201652017520185201952020520215202252023520245202552026520275202852029520305203152032520335203452035520365203752038520395204052041520425204352044520455204652047520485204952050520515205252053520545205552056520575205852059520605206152062520635206452065520665206752068520695207052071520725207352074520755207652077520785207952080520815208252083520845208552086520875208852089520905209152092520935209452095520965209752098520995210052101521025210352104521055210652107521085210952110521115211252113521145211552116521175211852119521205212152122521235212452125521265212752128521295213052131521325213352134521355213652137521385213952140521415214252143521445214552146521475214852149521505215152152521535215452155521565215752158521595216052161521625216352164521655216652167521685216952170521715217252173521745217552176521775217852179521805218152182521835218452185521865218752188521895219052191521925219352194521955219652197521985219952200522015220252203522045220552206522075220852209522105221152212522135221452215522165221752218522195222052221522225222352224522255222652227522285222952230522315223252233522345223552236522375223852239522405224152242522435224452245522465224752248522495225052251522525225352254522555225652257522585225952260522615226252263522645226552266522675226852269522705227152272522735227452275522765227752278522795228052281522825228352284522855228652287522885228952290522915229252293522945229552296522975229852299523005230152302523035230452305523065230752308523095231052311523125231352314523155231652317523185231952320523215232252323523245232552326523275232852329523305233152332523335233452335523365233752338523395234052341523425234352344523455234652347523485234952350523515235252353523545235552356523575235852359523605236152362523635236452365523665236752368523695237052371523725237352374523755237652377523785237952380523815238252383523845238552386523875238852389523905239152392523935239452395523965239752398523995240052401524025240352404524055240652407524085240952410524115241252413524145241552416524175241852419524205242152422524235242452425524265242752428524295243052431524325243352434524355243652437524385243952440524415244252443524445244552446524475244852449524505245152452524535245452455524565245752458524595246052461524625246352464524655246652467524685246952470524715247252473524745247552476524775247852479524805248152482524835248452485524865248752488524895249052491524925249352494524955249652497524985249952500525015250252503525045250552506525075250852509525105251152512525135251452515525165251752518525195252052521525225252352524525255252652527525285252952530525315253252533525345253552536525375253852539525405254152542525435254452545525465254752548525495255052551525525255352554525555255652557525585255952560525615256252563525645256552566525675256852569525705257152572525735257452575525765257752578525795258052581525825258352584525855258652587525885258952590525915259252593525945259552596525975259852599526005260152602526035260452605526065260752608526095261052611526125261352614526155261652617526185261952620526215262252623526245262552626526275262852629526305263152632526335263452635526365263752638526395264052641526425264352644526455264652647526485264952650526515265252653526545265552656526575265852659526605266152662526635266452665526665266752668526695267052671526725267352674526755267652677526785267952680526815268252683526845268552686526875268852689526905269152692526935269452695526965269752698526995270052701527025270352704527055270652707527085270952710527115271252713527145271552716527175271852719527205272152722527235272452725527265272752728527295273052731527325273352734527355273652737527385273952740527415274252743527445274552746527475274852749527505275152752527535275452755527565275752758527595276052761527625276352764527655276652767527685276952770527715277252773527745277552776527775277852779527805278152782527835278452785527865278752788527895279052791527925279352794527955279652797527985279952800528015280252803528045280552806528075280852809528105281152812528135281452815528165281752818528195282052821528225282352824528255282652827528285282952830528315283252833528345283552836528375283852839528405284152842528435284452845528465284752848528495285052851528525285352854528555285652857528585285952860528615286252863528645286552866528675286852869528705287152872528735287452875528765287752878528795288052881528825288352884528855288652887528885288952890528915289252893528945289552896528975289852899529005290152902529035290452905529065290752908529095291052911529125291352914529155291652917529185291952920529215292252923529245292552926529275292852929529305293152932529335293452935529365293752938529395294052941529425294352944529455294652947529485294952950529515295252953529545295552956529575295852959529605296152962529635296452965529665296752968529695297052971529725297352974529755297652977529785297952980529815298252983529845298552986529875298852989529905299152992529935299452995529965299752998529995300053001530025300353004530055300653007530085300953010530115301253013530145301553016530175301853019530205302153022530235302453025530265302753028530295303053031530325303353034530355303653037530385303953040530415304253043530445304553046530475304853049530505305153052530535305453055530565305753058530595306053061530625306353064530655306653067530685306953070530715307253073530745307553076530775307853079530805308153082530835308453085530865308753088530895309053091530925309353094530955309653097530985309953100531015310253103531045310553106531075310853109531105311153112531135311453115531165311753118531195312053121531225312353124531255312653127531285312953130531315313253133531345313553136531375313853139531405314153142531435314453145531465314753148531495315053151531525315353154531555315653157531585315953160531615316253163531645316553166531675316853169531705317153172531735317453175531765317753178531795318053181531825318353184531855318653187531885318953190531915319253193531945319553196531975319853199532005320153202532035320453205532065320753208532095321053211532125321353214532155321653217532185321953220532215322253223532245322553226532275322853229532305323153232532335323453235532365323753238532395324053241532425324353244532455324653247532485324953250532515325253253532545325553256532575325853259532605326153262532635326453265532665326753268532695327053271532725327353274532755327653277532785327953280532815328253283532845328553286532875328853289532905329153292532935329453295532965329753298532995330053301533025330353304533055330653307533085330953310533115331253313533145331553316533175331853319533205332153322533235332453325533265332753328533295333053331533325333353334533355333653337533385333953340533415334253343533445334553346533475334853349533505335153352533535335453355533565335753358533595336053361533625336353364533655336653367533685336953370533715337253373533745337553376533775337853379533805338153382533835338453385533865338753388533895339053391533925339353394533955339653397533985339953400534015340253403534045340553406534075340853409534105341153412534135341453415534165341753418534195342053421534225342353424534255342653427534285342953430534315343253433534345343553436534375343853439534405344153442534435344453445534465344753448534495345053451534525345353454534555345653457534585345953460534615346253463534645346553466534675346853469534705347153472534735347453475534765347753478534795348053481534825348353484534855348653487534885348953490534915349253493534945349553496534975349853499535005350153502535035350453505535065350753508535095351053511535125351353514535155351653517535185351953520535215352253523535245352553526535275352853529535305353153532535335353453535535365353753538535395354053541535425354353544535455354653547535485354953550535515355253553535545355553556535575355853559535605356153562535635356453565535665356753568535695357053571535725357353574535755357653577535785357953580535815358253583535845358553586535875358853589535905359153592535935359453595535965359753598535995360053601536025360353604536055360653607536085360953610536115361253613536145361553616536175361853619536205362153622536235362453625536265362753628536295363053631536325363353634536355363653637536385363953640536415364253643536445364553646536475364853649536505365153652536535365453655536565365753658536595366053661536625366353664536655366653667536685366953670536715367253673536745367553676536775367853679536805368153682536835368453685536865368753688536895369053691536925369353694536955369653697536985369953700537015370253703537045370553706537075370853709537105371153712537135371453715537165371753718537195372053721537225372353724537255372653727537285372953730537315373253733537345373553736537375373853739537405374153742537435374453745537465374753748537495375053751537525375353754537555375653757537585375953760537615376253763537645376553766537675376853769537705377153772537735377453775537765377753778537795378053781537825378353784537855378653787537885378953790537915379253793537945379553796537975379853799538005380153802538035380453805538065380753808538095381053811538125381353814538155381653817538185381953820538215382253823538245382553826538275382853829538305383153832538335383453835538365383753838538395384053841538425384353844538455384653847538485384953850538515385253853538545385553856538575385853859538605386153862538635386453865538665386753868538695387053871538725387353874538755387653877538785387953880538815388253883538845388553886538875388853889538905389153892538935389453895538965389753898538995390053901539025390353904539055390653907539085390953910539115391253913539145391553916539175391853919539205392153922539235392453925539265392753928539295393053931539325393353934539355393653937539385393953940539415394253943539445394553946539475394853949539505395153952539535395453955539565395753958539595396053961539625396353964539655396653967539685396953970539715397253973539745397553976539775397853979539805398153982539835398453985539865398753988539895399053991539925399353994539955399653997539985399954000540015400254003540045400554006540075400854009540105401154012540135401454015540165401754018540195402054021540225402354024540255402654027540285402954030540315403254033540345403554036540375403854039540405404154042540435404454045540465404754048540495405054051540525405354054540555405654057540585405954060540615406254063540645406554066540675406854069540705407154072540735407454075540765407754078540795408054081540825408354084540855408654087540885408954090540915409254093540945409554096540975409854099541005410154102541035410454105541065410754108541095411054111541125411354114541155411654117541185411954120541215412254123541245412554126541275412854129541305413154132541335413454135541365413754138541395414054141541425414354144541455414654147541485414954150541515415254153541545415554156541575415854159541605416154162541635416454165541665416754168541695417054171541725417354174541755417654177541785417954180541815418254183541845418554186541875418854189541905419154192541935419454195541965419754198541995420054201542025420354204542055420654207542085420954210542115421254213542145421554216542175421854219542205422154222542235422454225542265422754228542295423054231542325423354234542355423654237542385423954240542415424254243542445424554246542475424854249542505425154252542535425454255542565425754258542595426054261542625426354264542655426654267542685426954270542715427254273542745427554276542775427854279542805428154282542835428454285542865428754288542895429054291542925429354294542955429654297542985429954300543015430254303543045430554306543075430854309543105431154312543135431454315543165431754318543195432054321543225432354324543255432654327543285432954330543315433254333543345433554336543375433854339543405434154342543435434454345543465434754348543495435054351543525435354354543555435654357543585435954360543615436254363543645436554366543675436854369543705437154372543735437454375543765437754378543795438054381543825438354384543855438654387543885438954390543915439254393543945439554396543975439854399544005440154402544035440454405544065440754408544095441054411544125441354414544155441654417544185441954420544215442254423544245442554426544275442854429544305443154432544335443454435544365443754438544395444054441544425444354444544455444654447544485444954450544515445254453544545445554456544575445854459544605446154462544635446454465544665446754468544695447054471544725447354474544755447654477544785447954480544815448254483544845448554486544875448854489544905449154492544935449454495544965449754498544995450054501545025450354504545055450654507545085450954510545115451254513545145451554516545175451854519545205452154522545235452454525545265452754528545295453054531545325453354534545355453654537545385453954540545415454254543545445454554546545475454854549545505455154552545535455454555545565455754558545595456054561545625456354564545655456654567545685456954570545715457254573545745457554576545775457854579545805458154582545835458454585545865458754588545895459054591545925459354594545955459654597545985459954600546015460254603546045460554606546075460854609546105461154612546135461454615546165461754618546195462054621546225462354624546255462654627546285462954630546315463254633546345463554636546375463854639546405464154642546435464454645546465464754648546495465054651546525465354654546555465654657546585465954660546615466254663546645466554666546675466854669546705467154672546735467454675546765467754678546795468054681546825468354684546855468654687546885468954690546915469254693546945469554696546975469854699547005470154702547035470454705547065470754708547095471054711547125471354714547155471654717547185471954720547215472254723547245472554726547275472854729547305473154732547335473454735547365473754738547395474054741547425474354744547455474654747547485474954750547515475254753547545475554756547575475854759547605476154762547635476454765547665476754768547695477054771547725477354774547755477654777547785477954780547815478254783547845478554786547875478854789547905479154792547935479454795547965479754798547995480054801548025480354804548055480654807548085480954810548115481254813548145481554816548175481854819548205482154822548235482454825548265482754828548295483054831548325483354834548355483654837548385483954840548415484254843548445484554846548475484854849548505485154852548535485454855548565485754858548595486054861548625486354864548655486654867548685486954870548715487254873548745487554876548775487854879548805488154882548835488454885548865488754888548895489054891548925489354894548955489654897548985489954900549015490254903549045490554906549075490854909549105491154912549135491454915549165491754918549195492054921549225492354924549255492654927549285492954930549315493254933549345493554936549375493854939549405494154942549435494454945549465494754948549495495054951549525495354954549555495654957549585495954960549615496254963549645496554966549675496854969549705497154972549735497454975549765497754978549795498054981549825498354984549855498654987549885498954990549915499254993549945499554996549975499854999550005500155002550035500455005550065500755008550095501055011550125501355014550155501655017550185501955020550215502255023550245502555026550275502855029550305503155032550335503455035550365503755038550395504055041550425504355044550455504655047550485504955050550515505255053550545505555056550575505855059550605506155062550635506455065550665506755068550695507055071550725507355074550755507655077550785507955080550815508255083550845508555086550875508855089550905509155092550935509455095550965509755098550995510055101551025510355104551055510655107551085510955110551115511255113551145511555116551175511855119551205512155122551235512455125551265512755128551295513055131551325513355134551355513655137551385513955140551415514255143551445514555146551475514855149551505515155152551535515455155551565515755158551595516055161551625516355164551655516655167551685516955170551715517255173551745517555176551775517855179551805518155182551835518455185551865518755188551895519055191551925519355194551955519655197551985519955200552015520255203552045520555206552075520855209552105521155212552135521455215552165521755218552195522055221552225522355224552255522655227552285522955230552315523255233552345523555236552375523855239552405524155242552435524455245552465524755248552495525055251552525525355254552555525655257552585525955260552615526255263552645526555266552675526855269552705527155272552735527455275552765527755278552795528055281552825528355284552855528655287552885528955290552915529255293552945529555296552975529855299553005530155302553035530455305553065530755308553095531055311553125531355314553155531655317553185531955320553215532255323553245532555326553275532855329553305533155332553335533455335553365533755338553395534055341553425534355344553455534655347553485534955350553515535255353553545535555356553575535855359553605536155362553635536455365553665536755368553695537055371553725537355374553755537655377553785537955380553815538255383553845538555386553875538855389553905539155392553935539455395553965539755398553995540055401554025540355404554055540655407554085540955410554115541255413554145541555416554175541855419554205542155422554235542455425554265542755428554295543055431554325543355434554355543655437554385543955440554415544255443554445544555446554475544855449554505545155452554535545455455554565545755458554595546055461554625546355464554655546655467554685546955470554715547255473554745547555476554775547855479554805548155482554835548455485554865548755488554895549055491554925549355494554955549655497554985549955500555015550255503555045550555506555075550855509555105551155512555135551455515555165551755518555195552055521555225552355524555255552655527555285552955530555315553255533555345553555536555375553855539555405554155542555435554455545555465554755548555495555055551555525555355554555555555655557555585555955560555615556255563555645556555566555675556855569555705557155572555735557455575555765557755578555795558055581555825558355584555855558655587555885558955590555915559255593555945559555596555975559855599556005560155602556035560455605556065560755608556095561055611556125561355614556155561655617556185561955620556215562255623556245562555626556275562855629556305563155632556335563455635556365563755638556395564055641556425564355644556455564655647556485564955650556515565255653556545565555656556575565855659556605566155662556635566455665556665566755668556695567055671556725567355674556755567655677556785567955680556815568255683556845568555686556875568855689556905569155692556935569455695556965569755698556995570055701557025570355704557055570655707557085570955710557115571255713557145571555716557175571855719557205572155722557235572455725557265572755728557295573055731557325573355734557355573655737557385573955740557415574255743557445574555746557475574855749557505575155752557535575455755557565575755758557595576055761557625576355764557655576655767557685576955770557715577255773557745577555776557775577855779557805578155782557835578455785557865578755788557895579055791
  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 (
  21. g.each(t, function (t, e) {
  22. n = i.call(e, n, t, e)
  23. }),
  24. n
  25. )
  26. }
  27. function r(t, i, n) {
  28. var e, o, r
  29. if (t === i) return !0
  30. if (!t || !i || t.constructor !== i.constructor) return !1
  31. for (e = 0, o = n.length; o > e; e += 1) {
  32. if (((r = n[e]), t[r] && y(t[r].equals) && !t[r].equals(i[r]))) return !1
  33. if (t[r] !== i[r]) return !1
  34. }
  35. return !0
  36. }
  37. function s(t, i, n, e) {
  38. ;(this.left = E(t)), (this.top = E(i)), (this.width = E(n)), (this.height = E(e)), (this.right = this.left + this.width), (this.bottom = this.top + this.height)
  39. }
  40. function h(t, i, n, e) {
  41. ;(this.visible = t || 0), (this.viewport = i || 0), (this.possible = n || 0), (this.rects = (e && T({}, e)) || null)
  42. }
  43. function l(t, i) {
  44. ;(this.els = t), (this.viewport = i)
  45. }
  46. function c(t, i, n) {
  47. var e
  48. return g.inArray(n, q) >= 0 ? (e = s.ofElement(t)) : g.inArray(n, S) >= 0 && (e = h.of(t, i)), e ? e[n] : 0
  49. }
  50. function u(t, i) {
  51. return t.val - i.val
  52. }
  53. function a(t, i) {
  54. return i.val - t.val
  55. }
  56. function f(t) {
  57. var i = s.ofContent(t, !0),
  58. n = s.ofViewport(t, !0),
  59. e = i.width - n.width,
  60. o = i.height - n.height
  61. ;(this.content = i),
  62. (this.viewport = n),
  63. (this.width = 0 >= e ? null : n.left / e),
  64. (this.height = 0 >= o ? null : n.top / o),
  65. (this.left = n.left),
  66. (this.top = n.top),
  67. (this.right = i.right - n.right),
  68. (this.bottom = i.bottom - n.bottom)
  69. }
  70. function p(t) {
  71. this.el = t || window
  72. }
  73. function d(t, i) {
  74. ;(this.context = t), (this.viewport = i), this.init()
  75. }
  76. function v(t, i, n, e) {
  77. ;(this.context = new l(t, i)), (this.property = n), (this.descending = e), this.init()
  78. }
  79. function w(t) {
  80. t && t !== window && t !== document ? ((this.context = t), (this.$autoTarget = g(t))) : (this.context = window), this.init()
  81. }
  82. var g = jQuery,
  83. m = g(window),
  84. b = g(document),
  85. T = g.extend,
  86. y = g.isFunction,
  87. k = Math.max,
  88. V = Math.min,
  89. E = Math.round,
  90. x = (function () {
  91. var t = {},
  92. i = 1
  93. return function (n) {
  94. return n ? (t[n] || ((t[n] = i), (i += 1)), t[n]) : 0
  95. }
  96. })()
  97. T(s.prototype, {
  98. equals: function (t) {
  99. return r(this, t, ['left', 'top', 'width', 'height'])
  100. },
  101. area: function () {
  102. return this.width * this.height
  103. },
  104. relativeTo: function (t) {
  105. return new s(this.left - t.left, this.top - t.top, this.width, this.height)
  106. },
  107. intersection: function (t) {
  108. if (!i(t, s)) return null
  109. var n = k(this.left, t.left),
  110. e = V(this.right, t.right),
  111. o = k(this.top, t.top),
  112. r = V(this.bottom, t.bottom),
  113. h = e - n,
  114. l = r - o
  115. return h >= 0 && l >= 0 ? new s(n, o, h, l) : null
  116. },
  117. envelope: function (t) {
  118. if (!i(t, s)) return this
  119. var n = V(this.left, t.left),
  120. e = k(this.right, t.right),
  121. o = V(this.top, t.top),
  122. r = k(this.bottom, t.bottom),
  123. h = e - n,
  124. l = r - o
  125. return new s(n, o, h, l)
  126. }
  127. }),
  128. T(s, {
  129. ofContent: function (t, i) {
  130. return t && t !== document && t !== window
  131. ? i
  132. ? new s(0, 0, t.scrollWidth, t.scrollHeight)
  133. : new s(t.offsetLeft - t.scrollLeft, t.offsetTop - t.scrollTop, t.scrollWidth, t.scrollHeight)
  134. : new s(0, 0, b.width(), b.height())
  135. },
  136. ofViewport: function (t, i) {
  137. return t && t !== document && t !== window
  138. ? i
  139. ? new s(t.scrollLeft, t.scrollTop, t.clientWidth, t.clientHeight)
  140. : new s(t.offsetLeft, t.offsetTop, t.clientWidth, t.clientHeight)
  141. : new s(m.scrollLeft(), m.scrollTop(), m.width(), m.height())
  142. },
  143. ofElement: function (t) {
  144. var i = g(t)
  145. if (!i.is(':visible')) return null
  146. var n = i.offset()
  147. return new s(n.left, n.top, i.outerWidth(), i.outerHeight())
  148. }
  149. }),
  150. T(h.prototype, {
  151. equals: function (t) {
  152. return this.fracsEqual(t) && this.rectsEqual(t)
  153. },
  154. fracsEqual: function (t) {
  155. return r(this, t, ['visible', 'viewport', 'possible'])
  156. },
  157. rectsEqual: function (t) {
  158. return r(this.rects, t.rects, ['document', 'element', 'viewport'])
  159. }
  160. }),
  161. T(h, {
  162. of: function (t, i) {
  163. var e, o, r
  164. return (
  165. (t = (n(t) && s.ofElement(t)) || t),
  166. (i = (n(i) && s.ofViewport(i)) || i || s.ofViewport()),
  167. t instanceof s && (e = t.intersection(i))
  168. ? ((o = e.area()),
  169. (r = V(t.width, i.width) * V(t.height, i.height)),
  170. new h(o / t.area(), o / i.area(), o / r, {
  171. document: e,
  172. element: e.relativeTo(t),
  173. viewport: e.relativeTo(i)
  174. }))
  175. : new h()
  176. )
  177. }
  178. })
  179. var q = ['width', 'height', 'left', 'right', 'top', 'bottom'],
  180. S = ['possible', 'visible', 'viewport']
  181. T(l.prototype, {
  182. sorted: function (t, i) {
  183. var n = this.viewport
  184. return g
  185. .map(this.els, function (i) {
  186. return {
  187. el: i,
  188. val: c(i, n, t)
  189. }
  190. })
  191. .sort(i ? a : u)
  192. },
  193. best: function (t, i) {
  194. return this.els.length ? this.sorted(t, i)[0] : null
  195. }
  196. }),
  197. T(f.prototype, {
  198. equals: function (t) {
  199. return r(this, t, ['width', 'height', 'left', 'top', 'right', 'bottom', 'content', 'viewport'])
  200. }
  201. }),
  202. T(p.prototype, {
  203. equals: function (t) {
  204. return r(this, t, ['el'])
  205. },
  206. scrollState: function () {
  207. return new f(this.el)
  208. },
  209. scrollTo: function (t, i, n) {
  210. var e = g(this.el === window ? 'html,body' : this.el)
  211. ;(t = t || 0),
  212. (i = i || 0),
  213. (n = isNaN(n) ? 1e3 : n),
  214. e.stop(!0).animate(
  215. {
  216. scrollLeft: t,
  217. scrollTop: i
  218. },
  219. n
  220. )
  221. },
  222. scroll: function (t, i, n) {
  223. var e = this.el === window ? m : g(this.el)
  224. ;(t = t || 0), (i = i || 0), this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  225. },
  226. scrollToRect: function (t, i, n, e) {
  227. ;(i = i || 0), (n = n || 0), this.scrollTo(t.left - i, t.top - n, e)
  228. },
  229. scrollToElement: function (t, i, n, e) {
  230. var o = s.ofElement(t).relativeTo(s.ofContent(this.el))
  231. this.scrollToRect(o, i, n, e)
  232. }
  233. })
  234. var C = {
  235. init: function () {
  236. ;(this.callbacks = g.Callbacks('memory unique')), (this.currVal = null), (this.prevVal = null), (this.checkProxy = g.proxy(this.check, this)), this.autoCheck()
  237. },
  238. bind: function (t) {
  239. this.callbacks.add(t)
  240. },
  241. unbind: function (t) {
  242. t ? this.callbacks.remove(t) : this.callbacks.empty()
  243. },
  244. trigger: function () {
  245. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  246. },
  247. check: function (t) {
  248. var i = this.updatedValue(t)
  249. return void 0 !== i && ((this.prevVal = this.currVal), (this.currVal = i), this.trigger(), !0)
  250. },
  251. $autoTarget: m,
  252. autoEvents: 'load resize scroll',
  253. autoCheck: function (t) {
  254. this.$autoTarget[t === !1 ? 'off' : 'on'](this.autoEvents, this.checkProxy)
  255. }
  256. }
  257. T(d.prototype, C, {
  258. updatedValue: function () {
  259. var t = h.of(this.context, this.viewport)
  260. return this.currVal && this.currVal.equals(t) ? void 0 : t
  261. }
  262. }),
  263. T(v.prototype, C, {
  264. updatedValue: function () {
  265. var t = this.context.best(this.property, this.descending)
  266. return t && ((t = t.val > 0 ? t.el : null), this.currVal !== t) ? t : void 0
  267. }
  268. }),
  269. T(w.prototype, C, {
  270. updatedValue: function () {
  271. var t = new f(this.context)
  272. return this.currVal && this.currVal.equals(t) ? void 0 : t
  273. }
  274. })
  275. var L = function (t, i) {
  276. var n = [].slice,
  277. e = jQuery,
  278. o = e.extend,
  279. r = e.isFunction,
  280. s = o({}, i),
  281. h = function (i, n, o, s) {
  282. return (o = r(o) ? o.apply(i, n) : o), r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  283. },
  284. l = function () {
  285. return h(this, n.call(arguments), s.defaultStatic, l)
  286. },
  287. c = function (t) {
  288. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  289. },
  290. u = function (t) {
  291. t && (o(l, t.statics), o(c, t.methods)), (l.modplug = u)
  292. }
  293. ;(u.prev = {
  294. statics: e[t],
  295. methods: e.fn[t]
  296. }),
  297. u(i),
  298. (e[t] = l),
  299. (e.fn[t] = c)
  300. },
  301. M = 'fracs'
  302. L(M, {
  303. statics: {
  304. version: '0.15.0',
  305. Rect: s,
  306. Fractions: h,
  307. Group: l,
  308. ScrollState: f,
  309. Viewport: p,
  310. FracsCallbacks: d,
  311. GroupCallbacks: v,
  312. ScrollStateCallbacks: w,
  313. fracs: function (t, i) {
  314. return h.of(t, i)
  315. }
  316. },
  317. methods: {
  318. content: function (t) {
  319. return this.length ? s.ofContent(this[0], t) : null
  320. },
  321. envelope: function () {
  322. return o(this, function (t) {
  323. var i = s.ofElement(this)
  324. return t ? t.envelope(i) : i
  325. })
  326. },
  327. fracs: function (i, n, o) {
  328. t(i, 'string') || ((o = n), (n = i), (i = null)), y(n) || ((o = n), (n = null)), (o = e(o))
  329. var r = M + '.fracs.' + x(o)
  330. return 'unbind' === i
  331. ? this.each(function () {
  332. var t = g(this).data(r)
  333. t && t.unbind(n)
  334. })
  335. : 'check' === i
  336. ? this.each(function () {
  337. var t = g(this).data(r)
  338. t && t.check()
  339. })
  340. : y(n)
  341. ? this.each(function () {
  342. var t = g(this),
  343. i = t.data(r)
  344. i || ((i = new d(this, o)), t.data(r, i)), i.bind(n)
  345. })
  346. : this.length
  347. ? h.of(this[0], o)
  348. : null
  349. },
  350. intersection: function () {
  351. return o(this, function (t) {
  352. var i = s.ofElement(this)
  353. return t ? t.intersection(i) : i
  354. })
  355. },
  356. max: function (t, i, n) {
  357. return y(i) || ((n = i), (i = null)), (n = e(n)), i ? (new v(this, n, t, !0).bind(i), this) : this.pushStack(new l(this, n).best(t, !0).el)
  358. },
  359. min: function (t, i, n) {
  360. return y(i) || ((n = i), (i = null)), (n = e(n)), i ? (new v(this, n, t).bind(i), this) : this.pushStack(new l(this, n).best(t).el)
  361. },
  362. rect: function () {
  363. return this.length ? s.ofElement(this[0]) : null
  364. },
  365. scrollState: function (i, n) {
  366. var e = M + '.scrollState'
  367. return (
  368. t(i, 'string') || ((n = i), (i = null)),
  369. 'unbind' === i
  370. ? this.each(function () {
  371. var t = g(this).data(e)
  372. t && t.unbind(n)
  373. })
  374. : 'check' === i
  375. ? this.each(function () {
  376. var t = g(this).data(e)
  377. t && t.check()
  378. })
  379. : y(n)
  380. ? this.each(function () {
  381. var t = g(this),
  382. i = t.data(e)
  383. i || ((i = new w(this)), t.data(e, i)), i.bind(n)
  384. })
  385. : this.length
  386. ? new f(this[0])
  387. : null
  388. )
  389. },
  390. scroll: function (t, i, n) {
  391. return this.each(function () {
  392. new p(this).scroll(t, i, n)
  393. })
  394. },
  395. scrollTo: function (t, i, n, o) {
  396. return (
  397. g.isNumeric(t) && ((o = n), (n = i), (i = t), (t = null)),
  398. (t = e(t)),
  399. this.each(function () {
  400. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  401. })
  402. )
  403. },
  404. scrollToThis: function (t, i, n, o) {
  405. return (o = new p(e(o))), o.scrollToElement(this[0], t, i, n), this
  406. },
  407. softLink: function (t, i, n, o) {
  408. return (
  409. (o = new p(e(o))),
  410. this.filter('a[href^=#]').each(function () {
  411. var e = g(this)
  412. e.on('click', function () {
  413. o.scrollToElement(g(e.attr('href'))[0], t, i, n)
  414. })
  415. })
  416. )
  417. },
  418. sort: function (i, n, o) {
  419. return (
  420. t(n, 'boolean') || ((o = n), (n = null)),
  421. (o = e(o)),
  422. this.pushStack(
  423. g.map(new l(this, o).sorted(i, !n), function (t) {
  424. return t.el
  425. })
  426. )
  427. )
  428. },
  429. viewport: function (t) {
  430. return this.length ? s.ofViewport(this[0], t) : null
  431. }
  432. },
  433. defaultStatic: 'fracs',
  434. defaultMethod: 'fracs'
  435. })
  436. })()
  437. if ('undefined' == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery")
  438. ;+(function (t) {
  439. 'use strict'
  440. function e(e) {
  441. return this.each(function () {
  442. var o = t(this),
  443. s = o.data('bs.tooltip'),
  444. n = 'object' == typeof e && e
  445. ;(s || 'destroy' != e) && (s || o.data('bs.tooltip', (s = new i(this, n))), 'string' == typeof e && s[e]())
  446. })
  447. }
  448. var i = function (t, e) {
  449. ;(this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null), this.init('tooltip', t, e)
  450. }
  451. ;(i.VERSION = '3.2.0'),
  452. (i.DEFAULTS = {
  453. animation: !0,
  454. placement: 'top',
  455. selector: !1,
  456. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  457. trigger: 'hover focus',
  458. title: '',
  459. delay: 0,
  460. html: !1,
  461. container: !1,
  462. viewport: {
  463. selector: 'body',
  464. padding: 0
  465. }
  466. }),
  467. (i.prototype.init = function (e, i, o) {
  468. ;(this.enabled = !0),
  469. (this.type = e),
  470. (this.$element = t(i)),
  471. (this.options = this.getOptions(o)),
  472. (this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport))
  473. for (var s = this.options.trigger.split(' '), n = s.length; n--; ) {
  474. var r = s[n]
  475. if ('click' == r) this.$element.on('click.' + this.type, this.options.selector, t.proxy(this.toggle, this))
  476. else if ('manual' != r) {
  477. var a = 'hover' == r ? 'mouseenter' : 'focusin',
  478. l = 'hover' == r ? 'mouseleave' : 'focusout'
  479. this.$element.on(a + '.' + this.type, this.options.selector, t.proxy(this.enter, this)), this.$element.on(l + '.' + this.type, this.options.selector, t.proxy(this.leave, this))
  480. }
  481. }
  482. this.options.selector
  483. ? (this._options = t.extend({}, this.options, {
  484. trigger: 'manual',
  485. selector: ''
  486. }))
  487. : this.fixTitle()
  488. }),
  489. (i.prototype.getDefaults = function () {
  490. return i.DEFAULTS
  491. }),
  492. (i.prototype.getOptions = function (e) {
  493. return (
  494. (e = t.extend({}, this.getDefaults(), this.$element.data(), e)),
  495. e.delay &&
  496. 'number' == typeof e.delay &&
  497. (e.delay = {
  498. show: e.delay,
  499. hide: e.delay
  500. }),
  501. e
  502. )
  503. }),
  504. (i.prototype.getDelegateOptions = function () {
  505. var e = {},
  506. i = this.getDefaults()
  507. return (
  508. this._options &&
  509. t.each(this._options, function (t, o) {
  510. i[t] != o && (e[t] = o)
  511. }),
  512. e
  513. )
  514. }),
  515. (i.prototype.enter = function (e) {
  516. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
  517. return (
  518. i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i)),
  519. clearTimeout(i.timeout),
  520. (i.hoverState = 'in'),
  521. i.options.delay && i.options.delay.show
  522. ? void (i.timeout = setTimeout(function () {
  523. // "in" == i.hoverState && i.show()
  524. }, i.options.delay.show))
  525. : i.show()
  526. )
  527. }),
  528. (i.prototype.leave = function (e) {
  529. var i = e instanceof this.constructor ? e : t(e.currentTarget).data('bs.' + this.type)
  530. return (
  531. i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i)),
  532. clearTimeout(i.timeout),
  533. (i.hoverState = 'out'),
  534. i.options.delay && i.options.delay.hide
  535. ? void (i.timeout = setTimeout(function () {
  536. 'out' == i.hoverState && i.hide()
  537. }, i.options.delay.hide))
  538. : i.hide()
  539. )
  540. }),
  541. (i.prototype.show = function () {
  542. var e = t.Event('show.bs.' + this.type)
  543. if (this.hasContent() && this.enabled) {
  544. this.$element.trigger(e)
  545. var i = t.contains(document.documentElement, this.$element[0])
  546. if (e.isDefaultPrevented() || !i) return
  547. var o = this,
  548. s = this.tip(),
  549. n = this.getUID(this.type)
  550. this.setContent(), s.attr('id', n), this.$element.attr('aria-describedby', n), this.options.animation && s.addClass('fade')
  551. var r = 'function' == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement,
  552. a = /\s?auto?\s?/i,
  553. l = a.test(r)
  554. l && (r = r.replace(a, '') || 'top'),
  555. s
  556. .detach()
  557. .css({
  558. top: 0,
  559. left: 0,
  560. display: 'block'
  561. })
  562. .addClass(r)
  563. .data('bs.' + this.type, this),
  564. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element)
  565. var p = this.getPosition(),
  566. h = s[0].offsetWidth,
  567. f = s[0].offsetHeight
  568. if (l) {
  569. var u = r,
  570. c = this.$element.parent(),
  571. d = this.getPosition(c)
  572. ;(r =
  573. 'bottom' == r && p.top + p.height + f - d.scroll > d.height
  574. ? 'top'
  575. : 'top' == r && p.top - d.scroll - f < 0
  576. ? 'bottom'
  577. : 'right' == r && p.right + h > d.width
  578. ? 'left'
  579. : 'left' == r && p.left - h < d.left
  580. ? 'right'
  581. : r),
  582. s.removeClass(u).addClass(r)
  583. }
  584. var g = this.getCalculatedOffset(r, p, h, f)
  585. this.applyPlacement(g, r)
  586. var y = function () {
  587. o.$element.trigger('shown.bs.' + o.type), (o.hoverState = null)
  588. }
  589. t.support.transition && this.$tip.hasClass('fade') ? s.one('bsTransitionEnd', y).emulateTransitionEnd(150) : y()
  590. }
  591. }),
  592. (i.prototype.applyPlacement = function (e, i) {
  593. var o = this.tip(),
  594. s = o[0].offsetWidth,
  595. n = o[0].offsetHeight,
  596. r = parseInt(o.css('margin-top'), 10),
  597. a = parseInt(o.css('margin-left'), 10)
  598. isNaN(r) && (r = 0),
  599. isNaN(a) && (a = 0),
  600. (e.top = e.top + r),
  601. (e.left = e.left + a),
  602. t.offset.setOffset(
  603. o[0],
  604. t.extend(
  605. {
  606. using: function (t) {
  607. o.css({
  608. top: Math.round(t.top),
  609. left: Math.round(t.left)
  610. })
  611. }
  612. },
  613. e
  614. ),
  615. 0
  616. ),
  617. o.addClass('in')
  618. var l = o[0].offsetWidth,
  619. p = o[0].offsetHeight
  620. 'top' == i && p != n && (e.top = e.top + n - p)
  621. var h = this.getViewportAdjustedDelta(i, e, l, p)
  622. h.left ? (e.left += h.left) : (e.top += h.top)
  623. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p,
  624. u = h.left ? 'left' : 'top',
  625. c = h.left ? 'offsetWidth' : 'offsetHeight'
  626. o.offset(e), this.replaceArrow(f, o[0][c], u)
  627. }),
  628. (i.prototype.replaceArrow = function (t, e, i) {
  629. this.arrow().css(i, t ? 50 * (1 - t / e) + '%' : '')
  630. }),
  631. (i.prototype.setContent = function () {
  632. var t = this.tip(),
  633. e = this.getTitle()
  634. t.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](e), t.removeClass('fade in top bottom left right')
  635. }),
  636. (i.prototype.hide = function () {
  637. function e() {
  638. 'in' != i.hoverState && o.detach(), i.$element.trigger('hidden.bs.' + i.type)
  639. }
  640. var i = this,
  641. o = this.tip(),
  642. s = t.Event('hide.bs.' + this.type)
  643. if ((this.$element.removeAttr('aria-describedby'), this.$element.trigger(s), !s.isDefaultPrevented()))
  644. return o.removeClass('in'), t.support.transition && this.$tip.hasClass('fade') ? o.one('bsTransitionEnd', e).emulateTransitionEnd(150) : e(), (this.hoverState = null), this
  645. }),
  646. (i.prototype.fixTitle = function () {
  647. var t = this.$element
  648. ;(t.attr('title') || 'string' != typeof t.attr('data-original-title')) && t.attr('data-original-title', t.attr('title') || '').attr('title', '')
  649. }),
  650. (i.prototype.hasContent = function () {
  651. return this.getTitle()
  652. }),
  653. (i.prototype.getPosition = function (e) {
  654. e = e || this.$element
  655. var i = e[0],
  656. o = 'BODY' == i.tagName
  657. return t.extend(
  658. {},
  659. 'function' == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null,
  660. {
  661. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  662. width: o ? t(window).width() : e.outerWidth(),
  663. height: o ? t(window).height() : e.outerHeight()
  664. },
  665. o
  666. ? {
  667. top: 0,
  668. left: 0
  669. }
  670. : e.offset()
  671. )
  672. }),
  673. (i.prototype.getCalculatedOffset = function (t, e, i, o) {
  674. return 'bottom' == t
  675. ? {
  676. top: e.top + e.height,
  677. left: e.left + e.width / 2 - i / 2
  678. }
  679. : 'top' == t
  680. ? {
  681. top: e.top - o,
  682. left: e.left + e.width / 2 - i / 2
  683. }
  684. : 'left' == t
  685. ? {
  686. top: e.top + e.height / 2 - o / 2,
  687. left: e.left - i
  688. }
  689. : {
  690. top: e.top + e.height / 2 - o / 2,
  691. left: e.left + e.width
  692. }
  693. }),
  694. (i.prototype.getViewportAdjustedDelta = function (t, e, i, o) {
  695. var s = {
  696. top: 0,
  697. left: 0
  698. }
  699. if (!this.$viewport) return s
  700. var n = (this.options.viewport && this.options.viewport.padding) || 0,
  701. r = this.getPosition(this.$viewport)
  702. if (/right|left/.test(t)) {
  703. var a = e.top - n - r.scroll,
  704. l = e.top + n - r.scroll + o
  705. a < r.top ? (s.top = r.top - a) : l > r.top + r.height && (s.top = r.top + r.height - l)
  706. } else {
  707. var p = e.left - n,
  708. h = e.left + n + i
  709. p < r.left ? (s.left = r.left - p) : h > r.width && (s.left = r.left + r.width - h)
  710. }
  711. return s
  712. }),
  713. (i.prototype.getTitle = function () {
  714. var t,
  715. e = this.$element,
  716. i = this.options
  717. return (t = e.attr('data-original-title') || ('function' == typeof i.title ? i.title.call(e[0]) : i.title))
  718. }),
  719. (i.prototype.getUID = function (t) {
  720. do t += ~~(1e6 * Math.random())
  721. while (document.getElementById(t))
  722. return t
  723. }),
  724. (i.prototype.tip = function () {
  725. return (this.$tip = this.$tip || t(this.options.template))
  726. }),
  727. (i.prototype.arrow = function () {
  728. return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow'))
  729. }),
  730. (i.prototype.validate = function () {
  731. this.$element[0].parentNode || (this.hide(), (this.$element = null), (this.options = null))
  732. }),
  733. (i.prototype.enable = function () {
  734. this.enabled = !0
  735. }),
  736. (i.prototype.disable = function () {
  737. this.enabled = !1
  738. }),
  739. (i.prototype.toggleEnabled = function () {
  740. this.enabled = !this.enabled
  741. }),
  742. (i.prototype.toggle = function (e) {
  743. var i = this
  744. e && ((i = t(e.currentTarget).data('bs.' + this.type)), i || ((i = new this.constructor(e.currentTarget, this.getDelegateOptions())), t(e.currentTarget).data('bs.' + this.type, i))),
  745. i.tip().hasClass('in') ? i.leave(i) : i.enter(i)
  746. }),
  747. (i.prototype.destroy = function () {
  748. clearTimeout(this.timeout),
  749. this.hide()
  750. .$element.off('.' + this.type)
  751. .removeData('bs.' + this.type)
  752. })
  753. var o = t.fn.tooltip
  754. ;(t.fn.tooltip = e),
  755. (t.fn.tooltip.Constructor = i),
  756. (t.fn.tooltip.noConflict = function () {
  757. return (t.fn.tooltip = o), this
  758. })
  759. })(jQuery)
  760. !(function (e, t, n) {
  761. 'undefined' != typeof module && module.exports ? (module.exports = n()) : 'function' == typeof define && define.amd ? define(n) : (t[e] = n())
  762. })('Keen', this, function () {
  763. 'use strict'
  764. function Keen() {
  765. return _init.apply(this, arguments)
  766. }
  767. function _init(e) {
  768. if (_isUndefined(e)) throw new Error('Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/')
  769. if (_isUndefined(e.projectId) || 'String' !== _type(e.projectId) || e.projectId.length < 1) throw new Error('Please provide a projectId')
  770. this.configure(e)
  771. }
  772. function _extend(e) {
  773. for (var t = 1; t < arguments.length; t++) for (var n in arguments[t]) e[n] = arguments[t][n]
  774. return e
  775. }
  776. function _isUndefined(e) {
  777. return void 0 === e
  778. }
  779. function _type(e) {
  780. var t = e && e.constructor ? e.constructor.toString() : void 0
  781. return t ? t.match(/function (.*)\(/)[1] : 'Null'
  782. }
  783. function _each(e, t, n) {
  784. var r
  785. if (!e) return 0
  786. if (((n = n ? n : e), 'array' === _type(e))) {
  787. for (r = 0; r < e.length; r++) if (t.call(n, e[r], r, e) === !1) return 0
  788. } else for (r in e) if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1) return 0
  789. return 1
  790. }
  791. function _parse_params(e) {
  792. for (
  793. var t,
  794. n = {},
  795. r = /\+/g,
  796. i = /([^&=]+)=?([^&]*)/g,
  797. o = function (e) {
  798. return decodeURIComponent(e.replace(r, ' '))
  799. },
  800. a = e.split('?')[1];
  801. (t = i.exec(a));
  802. )
  803. n[o(t[1])] = o(t[2])
  804. return n
  805. }
  806. function _set_protocol(e) {
  807. switch (e) {
  808. case 'http':
  809. return 'http'
  810. case 'auto':
  811. return location.protocol.replace(/:/g, '')
  812. case 'https':
  813. case void 0:
  814. default:
  815. return 'https'
  816. }
  817. }
  818. function _set_request_type(e) {
  819. var t = e || 'jsonp',
  820. n = !1
  821. return ('Object' === _type(XMLHttpRequest) || 'Function' === _type(XMLHttpRequest)) && 'withCredentials' in new XMLHttpRequest() && (n = !0), null == t || 'xhr' == t ? (n ? 'xhr' : 'jsonp') : t
  822. }
  823. function _build_url(e) {
  824. return this.client.endpoint + '/projects/' + this.client.projectId + e
  825. }
  826. function _uploadEvent(e, t, n, r, i) {
  827. var o = _build_url.apply(this, ['/events/' + e]),
  828. a = {}
  829. ;(n = n !== !1), this.client.globalProperties && (a = this.client.globalProperties(e))
  830. for (var c in t) t.hasOwnProperty(c) && (a[c] = t[c])
  831. switch (this.client.requestType) {
  832. case 'xhr':
  833. _request.xhr.apply(this, ['POST', o, null, a, this.client.writeKey, n, r, i])
  834. break
  835. case 'jsonp':
  836. var s = JSON.stringify(a),
  837. l = Keen.Base64.encode(s)
  838. ;(o = o + '?api_key=' + this.client.writeKey), (o = o + '&data=' + l), (o = o + '&modified=' + new Date().getTime()), _request.jsonp.apply(this, [o, this.client.writeKey, r, i])
  839. break
  840. case 'beacon':
  841. var s = JSON.stringify(a),
  842. l = Keen.Base64.encode(s)
  843. ;(o = o + '?api_key=' + encodeURIComponent(this.client.writeKey)),
  844. (o = o + '&data=' + encodeURIComponent(l)),
  845. (o = o + '&modified=' + encodeURIComponent(new Date().getTime())),
  846. (o += '&c=clv1'),
  847. _request.beacon.apply(this, [o, null, r, i])
  848. }
  849. }
  850. Keen.prototype.configure = function (e) {
  851. return (
  852. (e.host = _isUndefined(e.host) ? 'api.keen.io/3.0' : e.host.replace(/.*?:\/\//g, '')),
  853. (e.protocol = _set_protocol(e.protocol)),
  854. (e.requestType = _set_request_type(e.requestType)),
  855. (this.client = {
  856. projectId: e.projectId,
  857. writeKey: e.writeKey,
  858. readKey: e.readKey,
  859. globalProperties: null,
  860. endpoint: e.protocol + '://' + e.host,
  861. requestType: e.requestType
  862. }),
  863. Keen.trigger('client', this, e),
  864. this.trigger('ready'),
  865. this
  866. )
  867. }
  868. var _request = {
  869. xhr: function (e, t, n, r, i, o, a, c) {
  870. if (!i) return Keen.log('Please provide a writeKey for https://keen.io/project/' + this.client.projectId)
  871. var s = new XMLHttpRequest()
  872. if (
  873. ((s.onreadystatechange = function () {
  874. if (4 == s.readyState)
  875. if (s.status >= 200 && s.status < 300) {
  876. var e
  877. try {
  878. e = JSON.parse(s.responseText)
  879. } catch (e) {
  880. Keen.log('Could not JSON parse HTTP response: ' + s.responseText), c && c(s, e)
  881. }
  882. a && e && a(e)
  883. } else Keen.log('HTTP request failed.'), c && c(s, null)
  884. }),
  885. s.open(e, t, o),
  886. i && s.setRequestHeader('Authorization', i),
  887. r && s.setRequestHeader('Content-Type', 'application/json'),
  888. n)
  889. )
  890. for (var l in n) n.hasOwnProperty(l) && s.setRequestHeader(l, n[l])
  891. var u = r ? JSON.stringify(r) : null
  892. s.send(u)
  893. },
  894. jsonp: function (e, t, n, r) {
  895. if (!t) return Keen.log('Please provide a writeKey for https://keen.io/project/' + this.client.projectId)
  896. if (t && e.indexOf('api_key') < 0) {
  897. var i = e.indexOf('?') > 0 ? '&' : '?'
  898. e = e + i + 'api_key=' + t
  899. }
  900. for (var o = 'keenJSONPCallback' + new Date().getTime(); o in window; ) o += 'a'
  901. var a = !1
  902. ;(window[o] = function (e) {
  903. ;(a = !0), n && e && n(e), (window[o] = void 0)
  904. }),
  905. (e = e + '&jsonp=' + o)
  906. var c = document.createElement('script')
  907. ;(c.id = 'keen-jsonp'),
  908. (c.src = e),
  909. document.getElementsByTagName('head')[0].appendChild(c),
  910. (c.onreadystatechange = function () {
  911. a === !1 && 'loaded' === this.readyState && ((a = !0), r && r())
  912. }),
  913. (c.onerror = function () {
  914. a === !1 && ((a = !0), r && r())
  915. })
  916. },
  917. beacon: function (e, t, n, r) {
  918. if (t && e.indexOf('api_key') < 0) {
  919. var i = e.indexOf('?') > 0 ? '&' : '?'
  920. e = e + i + 'api_key=' + t
  921. }
  922. var o = !1,
  923. a = document.createElement('img')
  924. ;(a.onload = function () {
  925. if (((o = !0), 'naturalHeight' in this)) {
  926. if (this.naturalHeight + this.naturalWidth === 0) return void this.onerror()
  927. } else if (this.width + this.height === 0) return void this.onerror()
  928. n &&
  929. n({
  930. created: !0
  931. })
  932. }),
  933. (a.onerror = function () {
  934. ;(o = !0), r && r()
  935. }),
  936. (a.src = e)
  937. }
  938. },
  939. Events = (Keen.Events = {
  940. on: function (e, t) {
  941. this.listeners || (this.listeners = {})
  942. var n = this.listeners[e] || (this.listeners[e] = [])
  943. return (
  944. n.push({
  945. callback: t
  946. }),
  947. this
  948. )
  949. },
  950. off: function (e, t) {
  951. if (!e && !t) return (this.listeners = void 0), delete this.listeners, this
  952. for (var n = this.listeners[e] || [], r = n.length; r--; )
  953. t && t == n[r].callback && this.listeners[e].splice(r, 1), (t && 0 != n.length) || ((this.listeners[e] = void 0), delete this.listeners[e])
  954. return this
  955. },
  956. trigger: function (e) {
  957. if (!this.listeners) return this
  958. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++) n[r].callback.apply(this, t)
  959. return this
  960. }
  961. })
  962. _extend(Keen.prototype, Events),
  963. _extend(Keen, Events),
  964. (Keen.loaded = !0),
  965. (Keen.utils = {
  966. each: _each,
  967. extend: _extend,
  968. parseParams: _parse_params
  969. }),
  970. (Keen.ready = function (e) {
  971. Keen.loaded ? e() : Keen.on('ready', e)
  972. }),
  973. (Keen.log = function (e) {
  974. 'object' == typeof console && console.log('[Keen IO]', e)
  975. })
  976. var Plugins = (Keen.Plugins = {})
  977. ;(Keen.prototype.addEvent = function () {
  978. _uploadEvent.apply(this, arguments)
  979. }),
  980. (Keen.prototype.addEventSync = function (e, t, n, r) {
  981. _uploadEvent.apply(this, [e, t, !1, n, r])
  982. }),
  983. (Keen.prototype.trackExternalLink = function (e, t, n, r, i) {
  984. var o = e,
  985. a = o.metaKey,
  986. c = o.target,
  987. s = !1,
  988. l = function () {}
  989. return (
  990. void 0 === r && (r = 500),
  991. 'A' === c.nodeName
  992. ? (l = function () {
  993. a || s || ((s = !0), (window.location = c.href))
  994. })
  995. : 'FORM' === c.nodeName &&
  996. (l = function () {
  997. s || ((s = !0), c.submit())
  998. }),
  999. i &&
  1000. (l = function () {
  1001. s || ((s = !0), i())
  1002. }),
  1003. _uploadEvent.call(this, t, n, l, l),
  1004. setTimeout(function () {
  1005. l()
  1006. }, r),
  1007. !!a && void 0
  1008. )
  1009. }),
  1010. (Keen.prototype.setGlobalProperties = function (e) {
  1011. if (!this.client) return Keen.log('Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/')
  1012. if (!e || 'function' != typeof e) throw new Error('Invalid value for global properties: ' + e)
  1013. this.client.globalProperties = e
  1014. }),
  1015. (Keen.Base64 = {
  1016. map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  1017. encode: function (e) {
  1018. var t,
  1019. n,
  1020. r,
  1021. i,
  1022. o,
  1023. a,
  1024. c,
  1025. s = '',
  1026. l = 0,
  1027. u = this.map
  1028. for (e = this.utf8.encode(e); l < e.length; )
  1029. (t = e.charCodeAt(l++)),
  1030. (n = e.charCodeAt(l++)),
  1031. (r = e.charCodeAt(l++)),
  1032. (i = t >> 2),
  1033. (o = ((3 & t) << 4) | (n >> 4)),
  1034. (a = isNaN(n) ? 64 : ((15 & n) << 2) | (r >> 6)),
  1035. (c = isNaN(n) || isNaN(r) ? 64 : 63 & r),
  1036. (s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c))
  1037. return s
  1038. },
  1039. decode: function (e) {
  1040. var t,
  1041. n,
  1042. r,
  1043. i,
  1044. o,
  1045. a,
  1046. c,
  1047. s = '',
  1048. l = 0,
  1049. u = this.map,
  1050. f = String.fromCharCode
  1051. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ''); l < e.length; )
  1052. (t = u.indexOf(e.charAt(l++))),
  1053. (n = u.indexOf(e.charAt(l++))),
  1054. (r = u.indexOf(e.charAt(l++))),
  1055. (i = u.indexOf(e.charAt(l++))),
  1056. (o = (t << 2) | (n >> 4)),
  1057. (a = ((15 & n) << 4) | (r >> 2)),
  1058. (c = ((3 & r) << 6) | i),
  1059. (s = s + (f(o) + (64 != r ? f(a) : '')) + (64 != i ? f(c) : ''))
  1060. return this.utf8.decode(s)
  1061. },
  1062. utf8: {
  1063. encode: function (e) {
  1064. for (var t, n = '', r = 0, i = String.fromCharCode; r < e.length; )
  1065. (t = e.charCodeAt(r++)), (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))
  1066. return n
  1067. },
  1068. decode: function (e) {
  1069. for (var t, n, r = '', i = 0, o = String.fromCharCode; i < e.length; )
  1070. (n = e.charCodeAt(i)),
  1071. (r +=
  1072. 128 > n
  1073. ? [o(n), i++][0]
  1074. : n > 191 && 224 > n
  1075. ? [o(((31 & n) << 6) | (63 & (t = e.charCodeAt(i + 1)))), (i += 2)][0]
  1076. : [o(((15 & n) << 12) | ((63 & (t = e.charCodeAt(i + 1))) << 6) | (63 & (c3 = e.charCodeAt(i + 2)))), (i += 3)][0])
  1077. return r
  1078. }
  1079. }
  1080. }),
  1081. 'object' != typeof JSON && (JSON = {}),
  1082. (function () {
  1083. function f(e) {
  1084. return 10 > e ? '0' + e : e
  1085. }
  1086. function quote(e) {
  1087. return (
  1088. (escapable.lastIndex = 0),
  1089. escapable.test(e)
  1090. ? '"' +
  1091. e.replace(escapable, function (e) {
  1092. var t = meta[e]
  1093. return 'string' == typeof t ? t : '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1094. }) +
  1095. '"'
  1096. : '"' + e + '"'
  1097. )
  1098. }
  1099. function str(e, t) {
  1100. var n,
  1101. r,
  1102. i,
  1103. o,
  1104. a,
  1105. c = gap,
  1106. s = t[e]
  1107. switch ((s && 'object' == typeof s && 'function' == typeof s.toJSON && (s = s.toJSON(e)), 'function' == typeof rep && (s = rep.call(t, e, s)), typeof s)) {
  1108. case 'string':
  1109. return quote(s)
  1110. case 'number':
  1111. return isFinite(s) ? String(s) : 'null'
  1112. case 'boolean':
  1113. case 'null':
  1114. return String(s)
  1115. case 'object':
  1116. if (!s) return 'null'
  1117. if (((gap += indent), (a = []), '[object Array]' === Object.prototype.toString.apply(s))) {
  1118. for (o = s.length, n = 0; o > n; n += 1) a[n] = str(n, s) || 'null'
  1119. return (i = 0 === a.length ? '[]' : gap ? '[\n' + gap + a.join(',\n' + gap) + '\n' + c + ']' : '[' + a.join(',') + ']'), (gap = c), i
  1120. }
  1121. if (rep && 'object' == typeof rep) for (o = rep.length, n = 0; o > n; n += 1) 'string' == typeof rep[n] && ((r = rep[n]), (i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
  1122. else for (r in s) Object.prototype.hasOwnProperty.call(s, r) && ((i = str(r, s)), i && a.push(quote(r) + (gap ? ': ' : ':') + i))
  1123. return (i = 0 === a.length ? '{}' : gap ? '{\n' + gap + a.join(',\n' + gap) + '\n' + c + '}' : '{' + a.join(',') + '}'), (gap = c), i
  1124. }
  1125. }
  1126. 'function' != typeof Date.prototype.toJSON &&
  1127. ((Date.prototype.toJSON = function () {
  1128. return isFinite(this.valueOf())
  1129. ? this.getUTCFullYear() + '-' + f(this.getUTCMonth() + 1) + '-' + f(this.getUTCDate()) + 'T' + f(this.getUTCHours()) + ':' + f(this.getUTCMinutes()) + ':' + f(this.getUTCSeconds()) + 'Z'
  1130. : null
  1131. }),
  1132. (String.prototype.toJSON =
  1133. Number.prototype.toJSON =
  1134. Boolean.prototype.toJSON =
  1135. function () {
  1136. return this.valueOf()
  1137. }))
  1138. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1139. escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  1140. gap,
  1141. indent,
  1142. meta = {
  1143. '\b': '\\b',
  1144. '\t': '\\t',
  1145. '\n': '\\n',
  1146. '\f': '\\f',
  1147. '\r': '\\r',
  1148. '"': '\\"',
  1149. '\\': '\\\\'
  1150. },
  1151. rep
  1152. 'function' != typeof JSON.stringify &&
  1153. (JSON.stringify = function (e, t, n) {
  1154. var r
  1155. if (((gap = ''), (indent = ''), 'number' == typeof n)) for (r = 0; n > r; r += 1) indent += ' '
  1156. else 'string' == typeof n && (indent = n)
  1157. if (((rep = t), t && 'function' != typeof t && ('object' != typeof t || 'number' != typeof t.length))) throw new Error('JSON.stringify')
  1158. return str('', {
  1159. '': e
  1160. })
  1161. }),
  1162. 'function' != typeof JSON.parse &&
  1163. (JSON.parse = function (text, reviver) {
  1164. function walk(e, t) {
  1165. var n,
  1166. r,
  1167. i = e[t]
  1168. if (i && 'object' == typeof i) for (n in i) Object.prototype.hasOwnProperty.call(i, n) && ((r = walk(i, n)), void 0 !== r ? (i[n] = r) : delete i[n])
  1169. return reviver.call(e, t, i)
  1170. }
  1171. var j
  1172. if (
  1173. ((text = String(text)),
  1174. (cx.lastIndex = 0),
  1175. cx.test(text) &&
  1176. (text = text.replace(cx, function (e) {
  1177. return '\\u' + ('0000' + e.charCodeAt(0).toString(16)).slice(-4)
  1178. })),
  1179. /^[\],:{}\s]*$/.test(
  1180. text
  1181. .replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@')
  1182. .replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']')
  1183. .replace(/(?:^|:|,)(?:\s*\[)+/g, '')
  1184. ))
  1185. )
  1186. return (
  1187. (j = eval('(' + text + ')')),
  1188. 'function' == typeof reviver
  1189. ? walk(
  1190. {
  1191. '': j
  1192. },
  1193. ''
  1194. )
  1195. : j
  1196. )
  1197. throw new SyntaxError('JSON.parse')
  1198. })
  1199. })(),
  1200. !(function (e, t, n) {
  1201. 'undefined' != typeof module && module.exports ? (module.exports = n()) : 'function' == typeof define && define.amd ? define(n) : (t[e] = n())
  1202. })('domready', Keen.utils, function (e) {
  1203. function t(e) {
  1204. for (d = 1; (e = r.shift()); ) e()
  1205. }
  1206. var n,
  1207. r = [],
  1208. i = !1,
  1209. o = document,
  1210. a = o.documentElement,
  1211. c = a.doScroll,
  1212. s = 'DOMContentLoaded',
  1213. l = 'addEventListener',
  1214. u = 'onreadystatechange',
  1215. f = 'readyState',
  1216. p = c ? /^loaded|^c/ : /^loaded|c/,
  1217. d = p.test(o[f])
  1218. return (
  1219. o[l] &&
  1220. o[l](
  1221. s,
  1222. (n = function () {
  1223. o.removeEventListener(s, n, i), t()
  1224. }),
  1225. i
  1226. ),
  1227. c &&
  1228. o.attachEvent(
  1229. u,
  1230. (n = function () {
  1231. ;/^c/.test(o[f]) && (o.detachEvent(u, n), t())
  1232. })
  1233. ),
  1234. (e = c
  1235. ? function (t) {
  1236. self != top
  1237. ? d
  1238. ? t()
  1239. : r.push(t)
  1240. : (function () {
  1241. try {
  1242. a.doScroll('left')
  1243. } catch (n) {
  1244. return setTimeout(function () {
  1245. e(t)
  1246. }, 50)
  1247. }
  1248. t()
  1249. })()
  1250. }
  1251. : function (e) {
  1252. d ? e() : r.push(e)
  1253. })
  1254. )
  1255. })
  1256. var loaded = window.Keen,
  1257. cached = window._Keen || {},
  1258. clients,
  1259. ready
  1260. if (loaded && cached) {
  1261. ;(clients = cached.clients || {}), (ready = cached.ready || [])
  1262. for (var instance in clients)
  1263. if (clients.hasOwnProperty(instance)) {
  1264. var client = clients[instance]
  1265. for (var method in Keen.prototype) Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method])
  1266. if (
  1267. ((loaded.Query = Keen.Query ? Keen.Query : function () {}),
  1268. (loaded.Visualization = Keen.Visualization ? Keen.Visualization : function () {}),
  1269. client._config && (client.configure.call(client, client._config), delete client._config),
  1270. client._setGlobalProperties)
  1271. ) {
  1272. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++) client.setGlobalProperties.apply(client, globals[i])
  1273. delete client._setGlobalProperties
  1274. }
  1275. if (client._addEvent) {
  1276. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++) client.addEvent.apply(client, queue[i])
  1277. delete client._addEvent
  1278. }
  1279. var callback = client._on || []
  1280. if (client._on) {
  1281. for (var i = 0; i < callback.length; i++) client.on.apply(client, callback[i])
  1282. client.trigger('ready'), delete client._on
  1283. }
  1284. }
  1285. for (var i = 0; i < ready.length; i++) {
  1286. var callback = ready[i]
  1287. Keen.on('ready', function () {
  1288. callback()
  1289. })
  1290. }
  1291. }
  1292. return (
  1293. Keen.loaded &&
  1294. setTimeout(function () {
  1295. Keen.utils.domready(function () {
  1296. Keen.trigger('ready')
  1297. })
  1298. }, 0),
  1299. Keen
  1300. )
  1301. })
  1302. !(function () {
  1303. var t = (window.analytics = window.analytics || [])
  1304. if (!t.initialize) {
  1305. if (t.invoked) return void (window.console && console.error && console.error('Segment snippet included twice.'))
  1306. ;(t.invoked = !0),
  1307. (t.methods = ['trackSubmit', 'trackClick', 'trackLink', 'trackForm', 'pageview', 'identify', 'reset', 'group', 'track', 'ready', 'alias', 'debug', 'page', 'once', 'off', 'on']),
  1308. (t.factory = function (e) {
  1309. return function () {
  1310. var n = Array.prototype.slice.call(arguments)
  1311. return n.unshift(e), t.push(n), t
  1312. }
  1313. })
  1314. for (var e = 0; e < t.methods.length; e++) {
  1315. var n = t.methods[e]
  1316. t[n] = t.factory(n)
  1317. }
  1318. ;(t.load = function (t) {
  1319. var e = document.createElement('script')
  1320. ;(e.type = 'text/javascript'), (e.async = !0), (e.src = ('https:' === document.location.protocol ? 'https://' : 'http://') + 'cdn.segment.com/analytics.js/v1/' + t + '/analytics.min.js')
  1321. var n = document.getElementsByTagName('script')[0]
  1322. n.parentNode.insertBefore(e, n)
  1323. }),
  1324. (t.SNIPPET_VERSION = '4.0.0')
  1325. }
  1326. })()
  1327. !(function (i, e) {
  1328. 'use strict'
  1329. var s = '',
  1330. r = '?',
  1331. o = 'function',
  1332. a = 'undefined',
  1333. n = 'object',
  1334. t = 'major',
  1335. d = 'model',
  1336. w = 'name',
  1337. l = 'type',
  1338. p = 'vendor',
  1339. m = 'version',
  1340. c = 'architecture',
  1341. u = 'console',
  1342. g = 'mobile',
  1343. f = 'tablet',
  1344. h = 'smarttv',
  1345. b = {
  1346. has: function (i, e) {
  1347. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1348. },
  1349. lowerize: function (i) {
  1350. return i.toLowerCase()
  1351. }
  1352. },
  1353. y = {
  1354. rgx: function () {
  1355. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1356. var c = m[p],
  1357. u = m[p + 1]
  1358. if (typeof i === a) {
  1359. i = {}
  1360. for (t in u) (d = u[t]), typeof d === n ? (i[d[0]] = e) : (i[d] = e)
  1361. }
  1362. for (s = r = 0; s < c.length; s++)
  1363. if ((w = c[s].exec(this.getUA()))) {
  1364. for (t = 0; t < u.length; t++)
  1365. (l = w[++r]),
  1366. (d = u[t]),
  1367. typeof d === n && d.length > 0
  1368. ? 2 == d.length
  1369. ? typeof d[1] == o
  1370. ? (i[d[0]] = d[1].call(this, l))
  1371. : (i[d[0]] = d[1])
  1372. : 3 == d.length
  1373. ? typeof d[1] !== o || (d[1].exec && d[1].test)
  1374. ? (i[d[0]] = l ? l.replace(d[1], d[2]) : e)
  1375. : (i[d[0]] = l ? d[1].call(this, l, d[2]) : e)
  1376. : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e)
  1377. : (i[d] = l ? l : e)
  1378. break
  1379. }
  1380. if (w) break
  1381. }
  1382. return i
  1383. },
  1384. str: function (i, s) {
  1385. for (var o in s)
  1386. if (typeof s[o] === n && s[o].length > 0) {
  1387. for (var a = 0; a < s[o].length; a++) if (b.has(s[o][a], i)) return o === r ? e : o
  1388. } else if (b.has(s[o], i)) return o === r ? e : o
  1389. return i
  1390. }
  1391. },
  1392. v = {
  1393. browser: {
  1394. oldsafari: {
  1395. major: {
  1396. 1: ['/8', '/1', '/3'],
  1397. 2: '/4',
  1398. '?': '/'
  1399. },
  1400. version: {
  1401. '1.0': '/8',
  1402. 1.2: '/1',
  1403. 1.3: '/3',
  1404. '2.0': '/412',
  1405. '2.0.2': '/416',
  1406. '2.0.3': '/417',
  1407. '2.0.4': '/419',
  1408. '?': '/'
  1409. }
  1410. }
  1411. },
  1412. device: {
  1413. sprint: {
  1414. model: {
  1415. 'Evo Shift 4G': '7373KT'
  1416. },
  1417. vendor: {
  1418. HTC: 'APA',
  1419. Sprint: 'Sprint'
  1420. }
  1421. }
  1422. },
  1423. os: {
  1424. windows: {
  1425. version: {
  1426. ME: '4.90',
  1427. 'NT 3.11': 'NT3.51',
  1428. 'NT 4.0': 'NT4.0',
  1429. 2e3: 'NT 5.0',
  1430. XP: ['NT 5.1', 'NT 5.2'],
  1431. Vista: 'NT 6.0',
  1432. 7: 'NT 6.1',
  1433. 8: 'NT 6.2',
  1434. 8.1: 'NT 6.3',
  1435. RT: 'ARM'
  1436. }
  1437. }
  1438. }
  1439. },
  1440. k = {
  1441. browser: [
  1442. [/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i],
  1443. [w, m, t],
  1444. [/\s(opr)\/((\d+)?[\w\.]+)/i],
  1445. [[w, 'Opera'], m, t],
  1446. [
  1447. /(kindle)\/((\d+)?[\w\.]+)/i,
  1448. /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i,
  1449. /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i,
  1450. /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i,
  1451. /(rekonq)((?:\/)[\w\.]+)*/i,
  1452. /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i
  1453. ],
  1454. [w, m, t],
  1455. [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i],
  1456. [[w, 'IE'], m, t],
  1457. [/(yabrowser)\/((\d+)?[\w\.]+)/i],
  1458. [[w, 'Yandex'], m, t],
  1459. [/(comodo_dragon)\/((\d+)?[\w\.]+)/i],
  1460. [[w, /_/g, ' '], m, t],
  1461. [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i],
  1462. [w, m, t],
  1463. [/(dolfin)\/((\d+)?[\w\.]+)/i],
  1464. [[w, 'Dolphin'], m, t],
  1465. [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i],
  1466. [[w, 'Chrome'], m, t],
  1467. [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i],
  1468. [m, t, [w, 'Mobile Safari']],
  1469. [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i],
  1470. [m, t, w],
  1471. [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i],
  1472. [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]],
  1473. [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i],
  1474. [w, m, t],
  1475. [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i],
  1476. [[w, 'Netscape'], m, t],
  1477. [
  1478. /(swiftfox)/i,
  1479. /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i,
  1480. /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i,
  1481. /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i,
  1482. /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i,
  1483. /(links)\s\(((\d+)?[\w\.]+)/i,
  1484. /(gobrowser)\/?((\d+)?[\w\.]+)*/i,
  1485. /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i,
  1486. /(mosaic)[\/\s]((\d+)?[\w\.]+)/i
  1487. ],
  1488. [w, m, t],
  1489. [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i],
  1490. [w, m, t],
  1491. [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i],
  1492. [w, m],
  1493. [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i],
  1494. [w, m, t],
  1495. [
  1496. /(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i,
  1497. /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i,
  1498. /(lg player|nexplayer)\s((\d+)[\d\.]+)/i,
  1499. /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i
  1500. ],
  1501. [w, m, t],
  1502. [/(nexplayer)\s((\d+)[\w\.-]+)/i],
  1503. [w, m, t],
  1504. [/(flrp)\/((\d+)[\w\.-]+)/i],
  1505. [[w, 'Flip Player'], m, t],
  1506. [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i],
  1507. [w],
  1508. [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i],
  1509. [w, m, t],
  1510. [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i],
  1511. [w, m, t],
  1512. [/(htc_one_s)\/((\d+)[\d\.]+)/i],
  1513. [[w, /_/g, ' '], m, t],
  1514. [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i],
  1515. [w, m],
  1516. [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i],
  1517. [w, m, t],
  1518. [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i],
  1519. [w],
  1520. [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i],
  1521. [w, m, t],
  1522. [/(nokia\d+)\/((\d+)[\w\.-]+)/i],
  1523. [w, m, t],
  1524. [/\s(songbird)\/((\d+)[\w\.-]+)/i],
  1525. [w, m, t],
  1526. [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i],
  1527. [w, m, t],
  1528. [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i],
  1529. [w],
  1530. [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i],
  1531. [w, m, t],
  1532. [/(smp)((\d+)[\d\.]+)/i],
  1533. [w, m, t],
  1534. [/(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],
  1535. [w, m, t],
  1536. [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i],
  1537. [[w, /-/g, ' '], m, t],
  1538. [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i],
  1539. [m, t, [w, 'Windows']],
  1540. [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i],
  1541. [w, m, t],
  1542. [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i],
  1543. [[w, 'rad.io'], m, t]
  1544. ],
  1545. cpu: [
  1546. [/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i],
  1547. [[c, 'amd64']],
  1548. [/(ia32(?=;))/i],
  1549. [[c, b.lowerize]],
  1550. [/((?:i[346]|x)86)[;\)]/i],
  1551. [[c, 'ia32']],
  1552. [/windows\s(ce|mobile);\sppc;/i],
  1553. [[c, 'arm']],
  1554. [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i],
  1555. [[c, /ower/, '', b.lowerize]],
  1556. [/(sun4\w)[;\)]/i],
  1557. [[c, 'sparc']],
  1558. [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i],
  1559. [c, b.lowerize]
  1560. ],
  1561. device: [
  1562. [/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i],
  1563. [d, p, [l, f]],
  1564. [/applecoremedia\/[\w\.]+ \((ipad)/],
  1565. [d, [p, 'Apple'], [l, f]],
  1566. [/(apple\s{0,1}tv)/i],
  1567. [
  1568. [d, 'Apple TV'],
  1569. [p, 'Apple']
  1570. ],
  1571. [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i],
  1572. [p, d, [l, f]],
  1573. [/\((ip[honed|\s\w*]+);.+(apple)/i],
  1574. [d, p, [l, g]],
  1575. [/\((ip[honed|\s\w*]+);/i],
  1576. [d, [p, 'Apple'], [l, g]],
  1577. [/(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],
  1578. [p, d, [l, g]],
  1579. [/\((bb10);\s(\w+)/i],
  1580. [[p, 'BlackBerry'], d, [l, g]],
  1581. [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i],
  1582. [[p, 'Asus'], d, [l, f]],
  1583. [/(sony)\s(tablet\s[ps])/i],
  1584. [p, d, [l, f]],
  1585. [/(nintendo)\s([wids3u]+)/i],
  1586. [p, d, [l, u]],
  1587. [/((playstation)\s[3portablevi]+)/i],
  1588. [[p, 'Sony'], d, [l, u]],
  1589. [/(sprint\s(\w+))/i],
  1590. [
  1591. [p, y.str, v.device.sprint.vendor],
  1592. [d, y.str, v.device.sprint.model],
  1593. [l, g]
  1594. ],
  1595. [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i],
  1596. [p, [d, /_/g, ' '], [l, g]],
  1597. [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i],
  1598. [[p, 'Motorola'], d, [l, g]],
  1599. [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i],
  1600. [[p, 'Motorola'], d, [l, f]],
  1601. [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i],
  1602. [[p, 'Samsung'], d, [l, f]],
  1603. [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i],
  1604. [[p, 'Samsung'], d, [l, g]],
  1605. [/(sie)-(\w+)*/i],
  1606. [[p, 'Siemens'], d, [l, g]],
  1607. [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i],
  1608. [[p, 'Nokia'], d, [l, g]],
  1609. [/android\s3\.[\s\w-;]{10}((a\d{3}))/i],
  1610. [[p, 'Acer'], d, [l, f]],
  1611. [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i],
  1612. [[p, 'LG'], d, [l, f]],
  1613. [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i],
  1614. [[p, 'LG'], d, [l, g]],
  1615. [/android.+((ideatab[a-z0-9\-\s]+))/i],
  1616. [[p, 'Lenovo'], d, [l, f]],
  1617. [/(lg) netcast\.tv/i],
  1618. [p, [l, h]],
  1619. [/(mobile|tablet);.+rv\:.+gecko\//i],
  1620. [l, p, d]
  1621. ],
  1622. engine: [
  1623. [/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i],
  1624. [w, m],
  1625. [/rv\:([\w\.]+).*(gecko)/i],
  1626. [m, w]
  1627. ],
  1628. os: [
  1629. [/microsoft\s(windows)\s(vista|xp)/i],
  1630. [w, m],
  1631. [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i],
  1632. [w, [m, y.str, v.os.windows.version]],
  1633. [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i],
  1634. [
  1635. [w, 'Windows'],
  1636. [m, y.str, v.os.windows.version]
  1637. ],
  1638. [/\((bb)(10);/i],
  1639. [[w, 'BlackBerry'], m],
  1640. [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i],
  1641. [w, m],
  1642. [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i],
  1643. [[w, 'Symbian'], m],
  1644. [/mozilla.+\(mobile;.+gecko.+firefox/i],
  1645. [[w, 'Firefox OS'], m],
  1646. [
  1647. /(nintendo|playstation)\s([wids3portablevu]+)/i,
  1648. /(mint)[\/\s\(]?(\w+)*/i,
  1649. /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i,
  1650. /(hurd|linux)\s?([\w\.]+)*/i,
  1651. /(gnu)\s?([\w\.]+)*/i
  1652. ],
  1653. [w, m],
  1654. [/(cros)\s[\w]+\s([\w\.]+\w)/i],
  1655. [[w, 'Chromium OS'], m],
  1656. [/(sunos)\s?([\w\.]+\d)*/i],
  1657. [[w, 'Solaris'], m],
  1658. [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i],
  1659. [w, m],
  1660. [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i],
  1661. [
  1662. [w, 'iOS'],
  1663. [m, /_/g, '.']
  1664. ],
  1665. [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i],
  1666. [w, [m, /_/g, '.']],
  1667. [/(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],
  1668. [w, m]
  1669. ]
  1670. },
  1671. x = function (e) {
  1672. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s)
  1673. return this instanceof x
  1674. ? ((this.getBrowser = function () {
  1675. return y.rgx.apply(this, k.browser)
  1676. }),
  1677. (this.getCPU = function () {
  1678. return y.rgx.apply(this, k.cpu)
  1679. }),
  1680. (this.getDevice = function () {
  1681. return y.rgx.apply(this, k.device)
  1682. }),
  1683. (this.getEngine = function () {
  1684. return y.rgx.apply(this, k.engine)
  1685. }),
  1686. (this.getOS = function () {
  1687. return y.rgx.apply(this, k.os)
  1688. }),
  1689. (this.getResult = function () {
  1690. return {
  1691. ua: this.getUA(),
  1692. browser: this.getBrowser(),
  1693. engine: this.getEngine(),
  1694. os: this.getOS(),
  1695. device: this.getDevice(),
  1696. cpu: this.getCPU()
  1697. }
  1698. }),
  1699. (this.getUA = function () {
  1700. return r
  1701. }),
  1702. (this.setUA = function (i) {
  1703. return (r = i), this
  1704. }),
  1705. void this.setUA(r))
  1706. : new x(e).getResult()
  1707. }
  1708. if (typeof exports !== a) typeof module !== a && module.exports && (exports = module.exports = x), (exports.UAParser = x)
  1709. else if (
  1710. ((i.UAParser = x),
  1711. typeof define === o &&
  1712. define.amd &&
  1713. define(function () {
  1714. return x
  1715. }),
  1716. typeof i.jQuery !== a)
  1717. ) {
  1718. var A = i.jQuery,
  1719. _ = new x()
  1720. ;(A.ua = _.getResult()),
  1721. (A.ua.get = function () {
  1722. return _.getUA()
  1723. }),
  1724. (A.ua.set = function (i) {
  1725. _.setUA(i)
  1726. var e = _.getResult()
  1727. for (var s in e) A.ua[s] = e[s]
  1728. })
  1729. }
  1730. })(this)
  1731. window.Modernizr = (function (n, e, t) {
  1732. function o(n) {
  1733. d.cssText = n
  1734. }
  1735. function r(n, e) {
  1736. return typeof n === e
  1737. }
  1738. var i,
  1739. c,
  1740. u,
  1741. a = '2.8.2',
  1742. f = {},
  1743. s = e.documentElement,
  1744. l = 'modernizr',
  1745. p = e.createElement(l),
  1746. d = p.style,
  1747. y = ({}.toString, {}),
  1748. w = [],
  1749. b = w.slice,
  1750. v = {}.hasOwnProperty
  1751. ;(u =
  1752. r(v, 'undefined') || r(v.call, 'undefined')
  1753. ? function (n, e) {
  1754. return e in n && r(n.constructor.prototype[e], 'undefined')
  1755. }
  1756. : function (n, e) {
  1757. return v.call(n, e)
  1758. }),
  1759. Function.prototype.bind ||
  1760. (Function.prototype.bind = function (n) {
  1761. var e = this
  1762. if ('function' != typeof e) throw new TypeError()
  1763. var t = b.call(arguments, 1),
  1764. o = function () {
  1765. if (this instanceof o) {
  1766. var r = function () {}
  1767. r.prototype = e.prototype
  1768. var i = new r(),
  1769. c = e.apply(i, t.concat(b.call(arguments)))
  1770. return Object(c) === c ? c : i
  1771. }
  1772. return e.apply(n, t.concat(b.call(arguments)))
  1773. }
  1774. return o
  1775. }),
  1776. (y.webgl = function () {
  1777. return !!n.WebGLRenderingContext
  1778. })
  1779. for (var h in y) u(y, h) && ((c = h.toLowerCase()), (f[c] = y[h]()), w.push((f[c] ? '' : 'no-') + c))
  1780. return (
  1781. (f.addTest = function (n, e) {
  1782. if ('object' == typeof n) for (var o in n) u(n, o) && f.addTest(o, n[o])
  1783. else {
  1784. if (((n = n.toLowerCase()), f[n] !== t)) return f
  1785. ;(e = 'function' == typeof e ? e() : e), 'undefined' != typeof enableClasses && enableClasses && (s.className += ' ' + (e ? '' : 'no-') + n), (f[n] = e)
  1786. }
  1787. return f
  1788. }),
  1789. o(''),
  1790. (p = i = null),
  1791. (f._version = a),
  1792. f
  1793. )
  1794. })(this, this.document)
  1795. !(function (e, t, a) {
  1796. 'use strict'
  1797. function n(t, h, m) {
  1798. function H(a) {
  1799. var n = 0,
  1800. i = Ee.length
  1801. if (
  1802. ((Ce.old = e.extend({}, Ce)),
  1803. (Ie = we ? 0 : be[ge.horizontal ? 'width' : 'height']()),
  1804. (ke = Be[ge.horizontal ? 'width' : 'height']()),
  1805. (ze = we ? t : Pe[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  1806. (Ee.length = 0),
  1807. (Ce.start = 0),
  1808. (Ce.end = q(ze - Ie, 0)),
  1809. Re)
  1810. ) {
  1811. ;(n = Ne.length), (qe = Pe.children(ge.itemSelector)), (Ne.length = 0)
  1812. var r,
  1813. s = c(Pe, ge.horizontal ? 'paddingLeft' : 'paddingTop'),
  1814. o = c(Pe, ge.horizontal ? 'paddingRight' : 'paddingBottom'),
  1815. l = 'border-box' === e(qe).css('boxSizing'),
  1816. u = 'none' !== qe.css('float'),
  1817. f = 0,
  1818. v = qe.length - 1
  1819. ;(ze = 0),
  1820. qe.each(function (t, a) {
  1821. var n = e(a),
  1822. i = a.getBoundingClientRect(),
  1823. l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top),
  1824. d = c(n, ge.horizontal ? 'marginLeft' : 'marginTop'),
  1825. p = c(n, ge.horizontal ? 'marginRight' : 'marginBottom'),
  1826. h = l + d + p,
  1827. m = !d || !p,
  1828. g = {}
  1829. ;(g.el = a),
  1830. (g.size = m ? l : h),
  1831. (g.half = g.size / 2),
  1832. (g.start = ze + (m ? d : 0)),
  1833. (g.center = g.start - E(Ie / 2 - g.size / 2)),
  1834. (g.end = g.start - Ie + g.size),
  1835. t || (ze += s),
  1836. (ze += h),
  1837. ge.horizontal || u || (p && d && t > 0 && (ze -= N(d, p))),
  1838. t === v && ((g.end += o), (ze += o), (f = m ? p : 0)),
  1839. Ne.push(g),
  1840. (r = g)
  1841. }),
  1842. (Pe[0].style[ge.horizontal ? 'width' : 'height'] = (l ? ze : ze - s - o) + 'px'),
  1843. (ze -= f),
  1844. Ne.length ? ((Ce.start = Ne[0][Me ? 'center' : 'start']), (Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start)) : (Ce.start = Ce.end = 0)
  1845. }
  1846. if (
  1847. ((Ce.center = E(Ce.end / 2 + Ce.start / 2)),
  1848. Q(),
  1849. Se.length &&
  1850. ke > 0 &&
  1851. (ge.dynamicHandle
  1852. ? ((Te = Ce.start === Ce.end ? ke : E((ke * Ie) / ze)), (Te = d(Te, ge.minHandleSize, ke)), (Se[0].style[ge.horizontal ? 'width' : 'height'] = Te + 'px'))
  1853. : (Te = Se[ge.horizontal ? 'outerWidth' : 'outerHeight']()),
  1854. (xe.end = ke - Te),
  1855. it || j()),
  1856. !we && Ie > 0)
  1857. ) {
  1858. var p = Ce.start,
  1859. h = ''
  1860. if (Re)
  1861. e.each(Ne, function (e, t) {
  1862. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && ((p = t.start), Ee.push(p), (p += Ie), p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1863. })
  1864. else for (; p - Ie < Ce.end; ) Ee.push(p), (p += Ie)
  1865. if (De[0] && i !== Ee.length) {
  1866. for (var m = 0; m < Ee.length; m++) h += ge.pageBuilder.call(ye, m)
  1867. ;(Ae = De.html(h).children()), Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1868. }
  1869. }
  1870. if (((Oe.slideeSize = ze), (Oe.frameSize = Ie), (Oe.sbSize = ke), (Oe.handleSize = Te), Re)) {
  1871. a && null != ge.startAt && (W(ge.startAt), ye[Le ? 'toCenter' : 'toStart'](ge.startAt))
  1872. var g = Ne[Oe.activeItem]
  1873. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1874. } else a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end))
  1875. pe('load')
  1876. }
  1877. function X(e, t, a) {
  1878. if (Re && at.released && !a) {
  1879. var n = $(e),
  1880. i = e > Ce.start && e < Ce.end
  1881. Le ? (i && (e = Ne[n.centerItem].center), Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1882. }
  1883. 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)),
  1884. (et.start = +new Date()),
  1885. (et.time = 0),
  1886. (et.from = Ce.cur),
  1887. (et.to = e),
  1888. (et.delta = e - Ce.cur),
  1889. (et.tweesing = at.tweese || (at.init && !at.slidee)),
  1890. (et.immediate = !et.tweesing && (t || (at.init && at.slidee) || !ge.speed)),
  1891. (at.tweese = 0),
  1892. e !== Ce.dest && ((Ce.dest = e), pe('change'), it || Y()),
  1893. K(),
  1894. Q(),
  1895. Z(),
  1896. F()
  1897. }
  1898. function Y() {
  1899. if (ye.initialized) {
  1900. if (!it) return (it = w(Y)), void (at.released && pe('moveStart'))
  1901. et.immediate
  1902. ? (Ce.cur = et.to)
  1903. : et.tweesing
  1904. ? ((et.tweeseDelta = et.to - Ce.cur), x(et.tweeseDelta) < 0.1 ? (Ce.cur = et.to) : (Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)))
  1905. : ((et.time = N(+new Date() - et.start, ge.speed)), (Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed))),
  1906. et.to === Ce.cur ? ((Ce.cur = et.to), (at.tweese = it = 0)) : (it = w(Y)),
  1907. pe('move'),
  1908. 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')),
  1909. !it && at.released && pe('moveEnd'),
  1910. j()
  1911. }
  1912. }
  1913. function j() {
  1914. Se.length &&
  1915. ((xe.cur = Ce.start === Ce.end ? 0 : (((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start)) * xe.end),
  1916. (xe.cur = d(E(xe.cur), xe.start, xe.end)),
  1917. _e.hPos !== xe.cur &&
  1918. ((_e.hPos = xe.cur), f ? (Se[0].style[f] = v + (ge.horizontal ? 'translateX' : 'translateY') + '(' + xe.cur + 'px)') : (Se[0].style[ge.horizontal ? 'left' : 'top'] = xe.cur + 'px')))
  1919. }
  1920. function F() {
  1921. Ae[0] && _e.page !== Oe.activePage && ((_e.page = Oe.activePage), Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass), pe('activePage', _e.page))
  1922. }
  1923. function M() {
  1924. ;(tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start)) || ye.stop(),
  1925. (ot = at.init ? w(M) : 0),
  1926. (tt.now = +new Date()),
  1927. (tt.pos = Ce.cur + ((tt.now - tt.lastTime) / 1e3) * tt.speed),
  1928. X(at.init ? tt.pos : E(tt.pos)),
  1929. at.init || Ce.cur !== Ce.dest || pe('moveEnd'),
  1930. (tt.lastTime = tt.now)
  1931. }
  1932. function L(e, t, n) {
  1933. if (('boolean' === i(t) && ((n = t), (t = a)), t === a)) X(Ce[e], n)
  1934. else {
  1935. if (Le && 'center' !== e) return
  1936. var r = ye.getPos(t)
  1937. r && X(r[e], n, !Le)
  1938. }
  1939. }
  1940. function R(e) {
  1941. return null != e ? (l(e) ? (e >= 0 && e < Ne.length ? e : -1) : qe.index(e)) : -1
  1942. }
  1943. function U(e) {
  1944. return R(l(e) && 0 > e ? e + Ne.length : e)
  1945. }
  1946. function W(e, t) {
  1947. var a = R(e)
  1948. return (
  1949. !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass), qe.eq(a).addClass(ge.activeClass), (_e.active = Oe.activeItem = a), Z(), pe('active', a)), a)
  1950. )
  1951. }
  1952. function $(e) {
  1953. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end)
  1954. var t = {},
  1955. a = Me ? 0 : Ie / 2
  1956. if (!we)
  1957. for (var n = 0, i = Ee.length; i > n; n++) {
  1958. if (e >= Ce.end || n === Ee.length - 1) {
  1959. t.activePage = Ee.length - 1
  1960. break
  1961. }
  1962. if (e <= Ee[n] + a) {
  1963. t.activePage = n
  1964. break
  1965. }
  1966. }
  1967. if (Re) {
  1968. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1969. if ((r === !1 && e <= Ne[c].start + Ne[c].half && (r = c), o === !1 && e <= Ne[c].center + Ne[c].half && (o = c), c === u - 1 || e <= Ne[c].end + Ne[c].half)) {
  1970. s = c
  1971. break
  1972. }
  1973. ;(t.firstItem = l(r) ? r : 0), (t.centerItem = l(o) ? o : t.firstItem), (t.lastItem = l(s) ? s : t.centerItem)
  1974. }
  1975. return t
  1976. }
  1977. function Q(t) {
  1978. e.extend(Oe, $(t))
  1979. }
  1980. function Z() {
  1981. var e = Ce.dest <= Ce.start,
  1982. t = Ce.dest >= Ce.end,
  1983. a = (e ? 1 : 0) | (t ? 2 : 0)
  1984. if (
  1985. (_e.slideePosState !== a &&
  1986. ((_e.slideePosState = a),
  1987. Je.is('button,input') && Je.prop('disabled', e),
  1988. Ke.is('button,input') && Ke.prop('disabled', t),
  1989. Je.add(Qe)[e ? 'addClass' : 'removeClass'](ge.disabledClass),
  1990. Ke.add($e)[t ? 'addClass' : 'removeClass'](ge.disabledClass)),
  1991. _e.fwdbwdState !== a && at.released && ((_e.fwdbwdState = a), Qe.is('button,input') && Qe.prop('disabled', e), $e.is('button,input') && $e.prop('disabled', t)),
  1992. Re && null != Oe.activeItem)
  1993. ) {
  1994. var n = 0 === Oe.activeItem,
  1995. i = Oe.activeItem >= Ne.length - 1,
  1996. r = (n ? 1 : 0) | (i ? 2 : 0)
  1997. _e.itemsButtonState !== r &&
  1998. ((_e.itemsButtonState = r),
  1999. Ze.is('button,input') && Ze.prop('disabled', n),
  2000. Ge.is('button,input') && Ge.prop('disabled', i),
  2001. Ze[n ? 'addClass' : 'removeClass'](ge.disabledClass),
  2002. Ge[i ? 'addClass' : 'removeClass'](ge.disabledClass))
  2003. }
  2004. }
  2005. function G(e, t, a) {
  2006. if (((e = U(e)), (t = U(t)), e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1))) {
  2007. qe.eq(e)[a ? 'insertAfter' : 'insertBefore'](Ne[t].el)
  2008. var n = t > e ? e : a ? t : t - 1,
  2009. i = e > t ? e : a ? t + 1 : t,
  2010. r = e > t
  2011. null != Oe.activeItem &&
  2012. (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)),
  2013. H()
  2014. }
  2015. }
  2016. function J(e, t) {
  2017. for (var a = 0, n = Ve[e].length; n > a; a++) if (Ve[e][a] === t) return a
  2018. return -1
  2019. }
  2020. function K() {
  2021. at.released && !ye.isPaused && ye.resume()
  2022. }
  2023. function V(e) {
  2024. return E((d(e, xe.start, xe.end) / xe.end) * (Ce.end - Ce.start)) + Ce.start
  2025. }
  2026. function _() {
  2027. ;(at.history[0] = at.history[1]), (at.history[1] = at.history[2]), (at.history[2] = at.history[3]), (at.history[3] = at.delta)
  2028. }
  2029. function ee(e) {
  2030. ;(at.released = 0), (at.source = e), (at.slidee = 'slidee' === e)
  2031. }
  2032. function te(t) {
  2033. var a = 'touchstart' === t.type,
  2034. n = t.data.source,
  2035. i = 'slidee' === n
  2036. at.init ||
  2037. (!a && ie(t.target)) ||
  2038. (('handle' !== n || (ge.dragHandle && xe.start !== xe.end)) &&
  2039. (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) &&
  2040. (a || r(t),
  2041. ee(n),
  2042. (at.init = 0),
  2043. (at.$source = e(t.target)),
  2044. (at.touch = a),
  2045. (at.pointer = a ? t.originalEvent.touches[0] : t),
  2046. (at.initX = at.pointer.pageX),
  2047. (at.initY = at.pointer.pageY),
  2048. (at.initPos = i ? Ce.cur : xe.cur),
  2049. (at.start = +new Date()),
  2050. (at.time = 0),
  2051. (at.path = 0),
  2052. (at.delta = 0),
  2053. (at.locked = 0),
  2054. (at.history = [0, 0, 0, 0]),
  2055. (at.pathToLock = i ? (a ? 30 : 10) : 0),
  2056. b.on(a ? z : I, ae),
  2057. ye.pause(1),
  2058. (i ? Pe : Se).addClass(ge.draggedClass),
  2059. pe('moveStart'),
  2060. i && (rt = setInterval(_, 10))))
  2061. }
  2062. function ae(e) {
  2063. if (
  2064. ((at.released = 'mouseup' === e.type || 'touchend' === e.type),
  2065. (at.pointer = at.touch ? e.originalEvent[at.released ? 'changedTouches' : 'touches'][0] : e),
  2066. (at.pathX = at.pointer.pageX - at.initX),
  2067. (at.pathY = at.pointer.pageY - at.initY),
  2068. (at.path = D(A(at.pathX, 2) + A(at.pathY, 2))),
  2069. (at.delta = ge.horizontal ? at.pathX : at.pathY),
  2070. at.released || !(at.path < 1))
  2071. ) {
  2072. if (!at.init) {
  2073. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY))) return ne()
  2074. at.init = 1
  2075. }
  2076. r(e),
  2077. !at.locked && at.path > at.pathToLock && at.slidee && ((at.locked = 1), at.$source.on(B, s)),
  2078. at.released && (ne(), ge.releaseSwing && at.slidee && ((at.swing = ((at.delta - at.history[0]) / 40) * 300), (at.delta += at.swing), (at.tweese = x(at.swing) > 10))),
  2079. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  2080. }
  2081. }
  2082. function ne() {
  2083. clearInterval(rt),
  2084. (at.released = !0),
  2085. b.off(at.touch ? z : I, ae),
  2086. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  2087. setTimeout(function () {
  2088. at.$source.off(B, s)
  2089. }),
  2090. Ce.cur === Ce.dest && at.init && pe('moveEnd'),
  2091. ye.resume(1),
  2092. (at.init = 0)
  2093. }
  2094. function ie(t) {
  2095. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  2096. }
  2097. function re() {
  2098. ye.stop(), b.off('mouseup', re)
  2099. }
  2100. function se(e) {
  2101. switch ((r(e), this)) {
  2102. case $e[0]:
  2103. case Qe[0]:
  2104. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy), b.on('mouseup', re)
  2105. break
  2106. case Ze[0]:
  2107. ye.prev()
  2108. break
  2109. case Ge[0]:
  2110. ye.next()
  2111. break
  2112. case Je[0]:
  2113. ye.prevPage()
  2114. break
  2115. case Ke[0]:
  2116. ye.nextPage()
  2117. }
  2118. }
  2119. function oe(e) {
  2120. return (
  2121. (nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta),
  2122. (nt.curDelta /= 1 === e.deltaMode ? 3 : 100),
  2123. Re
  2124. ? ((p = +new Date()),
  2125. nt.last < p - nt.resetTime && (nt.delta = 0),
  2126. (nt.last = p),
  2127. (nt.delta += nt.curDelta),
  2128. x(nt.delta) < 1 ? (nt.finalDelta = 0) : ((nt.finalDelta = E(nt.delta / 1)), (nt.delta %= 1)),
  2129. nt.finalDelta)
  2130. : nt.curDelta
  2131. )
  2132. }
  2133. function le(e) {
  2134. e.originalEvent[g] = ye
  2135. var t = +new Date()
  2136. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window) return void (O = t)
  2137. if (ge.scrollBy && Ce.start !== Ce.end) {
  2138. var a = oe(e.originalEvent)
  2139. ;(ge.scrollTrap || (a > 0 && Ce.dest < Ce.end) || (0 > a && Ce.dest > Ce.start)) && r(e, 1), ye.slideBy(ge.scrollBy * a)
  2140. }
  2141. }
  2142. function ce(e) {
  2143. ge.clickBar && e.target === Be[0] && (r(e), X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  2144. }
  2145. function de(e) {
  2146. if (ge.keyboardNavBy)
  2147. switch (e.which) {
  2148. case ge.horizontal ? 37 : 38:
  2149. r(e), ye['pages' === ge.keyboardNavBy ? 'prevPage' : 'prev']()
  2150. break
  2151. case ge.horizontal ? 39 : 40:
  2152. r(e), ye['pages' === ge.keyboardNavBy ? 'nextPage' : 'next']()
  2153. }
  2154. }
  2155. function ue(e) {
  2156. return ie(this) ? void (e.originalEvent[g + 'ignore'] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + 'ignore'] || ye.activate(this))
  2157. }
  2158. function fe() {
  2159. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  2160. }
  2161. function ve(e) {
  2162. ge.pauseOnHover && ye['mouseenter' === e.type ? 'pause' : 'resume'](2)
  2163. }
  2164. function pe(e, t) {
  2165. if (Ve[e]) {
  2166. for (me = Ve[e].length, T.length = 0, he = 0; me > he; he++) T.push(Ve[e][he])
  2167. for (he = 0; me > he; he++) T[he].call(ye, e, t)
  2168. }
  2169. }
  2170. var he,
  2171. me,
  2172. ge = e.extend({}, n.defaults, h),
  2173. ye = this,
  2174. we = l(t),
  2175. be = e(t),
  2176. Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0),
  2177. Ie = 0,
  2178. ze = 0,
  2179. Ce = {
  2180. start: 0,
  2181. center: 0,
  2182. end: 0,
  2183. cur: 0,
  2184. dest: 0
  2185. },
  2186. Be = e(ge.scrollBar).eq(0),
  2187. Se = Be.children().eq(0),
  2188. ke = 0,
  2189. Te = 0,
  2190. xe = {
  2191. start: 0,
  2192. end: 0,
  2193. cur: 0
  2194. },
  2195. De = e(ge.pagesBar),
  2196. Ae = 0,
  2197. Ee = [],
  2198. qe = 0,
  2199. Ne = [],
  2200. Oe = {
  2201. firstItem: 0,
  2202. lastItem: 0,
  2203. centerItem: 0,
  2204. activeItem: null,
  2205. activePage: 0
  2206. },
  2207. He = new u(be[0]),
  2208. Xe = new u(Pe[0]),
  2209. Ye = new u(Be[0]),
  2210. je = new u(Se[0]),
  2211. Fe = 'basic' === ge.itemNav,
  2212. Me = 'forceCentered' === ge.itemNav,
  2213. Le = 'centered' === ge.itemNav || Me,
  2214. Re = !we && (Fe || Le || Me),
  2215. Ue = ge.scrollSource ? e(ge.scrollSource) : be,
  2216. We = ge.dragSource ? e(ge.dragSource) : be,
  2217. $e = e(ge.forward),
  2218. Qe = e(ge.backward),
  2219. Ze = e(ge.prev),
  2220. Ge = e(ge.next),
  2221. Je = e(ge.prevPage),
  2222. Ke = e(ge.nextPage),
  2223. Ve = {},
  2224. _e = {},
  2225. et = {},
  2226. tt = {},
  2227. at = {
  2228. released: 1
  2229. },
  2230. nt = {
  2231. last: 0,
  2232. delta: 0,
  2233. resetTime: 200
  2234. },
  2235. it = 0,
  2236. rt = 0,
  2237. st = 0,
  2238. ot = 0
  2239. we || (t = be[0]),
  2240. (ye.initialized = 0),
  2241. (ye.frame = t),
  2242. (ye.slidee = Pe[0]),
  2243. (ye.pos = Ce),
  2244. (ye.rel = Oe),
  2245. (ye.items = Ne),
  2246. (ye.pages = Ee),
  2247. (ye.isPaused = 0),
  2248. (ye.options = ge),
  2249. (ye.dragging = at),
  2250. (ye.reload = function () {
  2251. H()
  2252. }),
  2253. (ye.getPos = function (e) {
  2254. if (Re) {
  2255. var t = R(e)
  2256. return -1 !== t && Ne[t]
  2257. }
  2258. var a = Pe.find(e).eq(0)
  2259. if (a[0]) {
  2260. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top,
  2261. i = a[ge.horizontal ? 'outerWidth' : 'outerHeight']()
  2262. return {
  2263. start: n,
  2264. center: n - Ie / 2 + i / 2,
  2265. end: n - Ie + i,
  2266. size: i
  2267. }
  2268. }
  2269. return !1
  2270. }),
  2271. (ye.moveBy = function (e) {
  2272. ;(tt.speed = e),
  2273. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && ((tt.lastTime = +new Date()), (tt.startPos = Ce.cur), ee('button'), (at.init = 1), pe('moveStart'), y(ot), M())
  2274. }),
  2275. (ye.stop = function () {
  2276. 'button' === at.source && ((at.init = 0), (at.released = 1))
  2277. }),
  2278. (ye.prev = function () {
  2279. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2280. }),
  2281. (ye.next = function () {
  2282. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2283. }),
  2284. (ye.prevPage = function () {
  2285. ye.activatePage(Oe.activePage - 1)
  2286. }),
  2287. (ye.nextPage = function () {
  2288. ye.activatePage(Oe.activePage + 1)
  2289. }),
  2290. (ye.slideBy = function (e, t) {
  2291. e && (Re ? ye[Le ? 'toCenter' : 'toStart'](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2292. }),
  2293. (ye.slideTo = function (e, t) {
  2294. X(e, t)
  2295. }),
  2296. (ye.toStart = function (e, t) {
  2297. L('start', e, t)
  2298. }),
  2299. (ye.toEnd = function (e, t) {
  2300. L('end', e, t)
  2301. }),
  2302. (ye.toCenter = function (e, t) {
  2303. L('center', e, t)
  2304. }),
  2305. (ye.getIndex = R),
  2306. (ye.activate = function (e, t) {
  2307. var a = W(e)
  2308. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2309. }),
  2310. (ye.activatePage = function (e, t) {
  2311. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2312. }),
  2313. (ye.resume = function (e) {
  2314. ge.cycleBy &&
  2315. ge.cycleInterval &&
  2316. ('items' !== ge.cycleBy || (Ne[0] && null != Oe.activeItem)) &&
  2317. !(e < ye.isPaused) &&
  2318. ((ye.isPaused = 0),
  2319. st ? (st = clearTimeout(st)) : pe('resume'),
  2320. (st = setTimeout(function () {
  2321. switch ((pe('cycle'), ge.cycleBy)) {
  2322. case 'items':
  2323. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1)
  2324. break
  2325. case 'pages':
  2326. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2327. }
  2328. }, ge.cycleInterval)))
  2329. }),
  2330. (ye.pause = function (e) {
  2331. e < ye.isPaused || ((ye.isPaused = e || 100), st && ((st = clearTimeout(st)), pe('pause')))
  2332. }),
  2333. (ye.toggle = function () {
  2334. ye[st ? 'pause' : 'resume']()
  2335. }),
  2336. (ye.set = function (t, a) {
  2337. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2338. }),
  2339. (ye.add = function (t, a) {
  2340. var n = e(t)
  2341. Re
  2342. ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el), null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length))
  2343. : Pe.append(n),
  2344. H()
  2345. }),
  2346. (ye.remove = function (t) {
  2347. if (Re) {
  2348. var a = U(t)
  2349. if (a > -1) {
  2350. qe.eq(a).remove()
  2351. var n = a === Oe.activeItem
  2352. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem), H(), n && ((_e.active = null), ye.activate(Oe.activeItem))
  2353. }
  2354. } else e(t).remove(), H()
  2355. }),
  2356. (ye.moveAfter = function (e, t) {
  2357. G(e, t, 1)
  2358. }),
  2359. (ye.moveBefore = function (e, t) {
  2360. G(e, t)
  2361. }),
  2362. (ye.on = function (e, t) {
  2363. if ('object' === i(e)) for (var a in e) e.hasOwnProperty(a) && ye.on(a, e[a])
  2364. else if ('function' === i(t)) for (var n = e.split(' '), r = 0, s = n.length; s > r; r++) (Ve[n[r]] = Ve[n[r]] || []), -1 === J(n[r], t) && Ve[n[r]].push(t)
  2365. else if ('array' === i(t)) for (var o = 0, l = t.length; l > o; o++) ye.on(e, t[o])
  2366. }),
  2367. (ye.one = function (e, t) {
  2368. function a() {
  2369. t.apply(ye, arguments), ye.off(e, a)
  2370. }
  2371. ye.on(e, a)
  2372. }),
  2373. (ye.off = function (e, t) {
  2374. if (t instanceof Array) for (var a = 0, n = t.length; n > a; a++) ye.off(e, t[a])
  2375. else
  2376. for (var i = e.split(' '), r = 0, s = i.length; s > r; r++)
  2377. if (((Ve[i[r]] = Ve[i[r]] || []), null == t)) Ve[i[r]].length = 0
  2378. else {
  2379. var o = J(i[r], t)
  2380. ;-1 !== o && Ve[i[r]].splice(o, 1)
  2381. }
  2382. }),
  2383. (ye.destroy = function () {
  2384. return (
  2385. Ue.add(Se)
  2386. .add(Be)
  2387. .add(De)
  2388. .add($e)
  2389. .add(Qe)
  2390. .add(Ze)
  2391. .add(Ge)
  2392. .add(Je)
  2393. .add(Ke)
  2394. .off('.' + g),
  2395. b.off('keydown', de),
  2396. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2397. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2398. De.empty(),
  2399. we || (be.off('.' + g), He.restore(), Xe.restore(), Ye.restore(), je.restore(), e.removeData(t, g)),
  2400. (Ne.length = Ee.length = 0),
  2401. (_e = {}),
  2402. (ye.initialized = 0),
  2403. ye
  2404. )
  2405. }),
  2406. (ye.init = function () {
  2407. if (!ye.initialized) {
  2408. ye.on(m)
  2409. var e = ['overflow', 'position'],
  2410. t = ['position', 'webkitTransform', 'msTransform', 'transform', 'left', 'top', 'width', 'height']
  2411. He.save.apply(He, e), Ye.save.apply(Ye, e), Xe.save.apply(Xe, t), je.save.apply(je, t)
  2412. var a = Se
  2413. return (
  2414. we || ((a = a.add(Pe)), be.css('overflow', 'hidden'), f || 'static' !== be.css('position') || be.css('position', 'relative')),
  2415. f
  2416. ? v && a.css(f, v)
  2417. : ('static' === Be.css('position') && Be.css('position', 'relative'),
  2418. a.css({
  2419. position: 'absolute'
  2420. })),
  2421. ge.forward && $e.on(S, se),
  2422. ge.backward && Qe.on(S, se),
  2423. ge.prev && Ze.on(B, se),
  2424. ge.next && Ge.on(B, se),
  2425. ge.prevPage && Je.on(B, se),
  2426. ge.nextPage && Ke.on(B, se),
  2427. Ue.on(C, le), // C是 "wheel.sly" 滚动监听
  2428. Be[0] && Be.on(B, ce),
  2429. Re && ge.activateOn && be.on(ge.activateOn + '.' + g, '*', ue),
  2430. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + '.' + g, '*', fe),
  2431. We.on(
  2432. P,
  2433. {
  2434. source: 'slidee'
  2435. },
  2436. te
  2437. ),
  2438. Se &&
  2439. Se.on(
  2440. P,
  2441. {
  2442. source: 'handle'
  2443. },
  2444. te
  2445. ),
  2446. b.on('keydown', de),
  2447. we || (be.on('mouseenter.' + g + ' mouseleave.' + g, ve), be.on('scroll.' + g, o)),
  2448. (ye.initialized = 1),
  2449. H(!0),
  2450. ge.cycleBy && !we && ye[ge.startPaused ? 'pause' : 'resume'](),
  2451. ye
  2452. )
  2453. }
  2454. })
  2455. }
  2456. function i(e) {
  2457. return null == e
  2458. ? String(e)
  2459. : 'object' == typeof e || 'function' == typeof e
  2460. ? Object.prototype.toString
  2461. .call(e)
  2462. .match(/\s([a-z]+)/i)[1]
  2463. .toLowerCase() || 'object'
  2464. : typeof e
  2465. }
  2466. function r(e, t) {
  2467. e.preventDefault(), t && e.stopPropagation()
  2468. }
  2469. function s(t) {
  2470. r(t, 1), e(this).off(t.type, s)
  2471. }
  2472. function o() {
  2473. ;(this.scrollLeft = 0), (this.scrollTop = 0)
  2474. }
  2475. function l(e) {
  2476. return !isNaN(parseFloat(e)) && isFinite(e)
  2477. }
  2478. function c(e, t) {
  2479. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ''))
  2480. }
  2481. function d(e, t, a) {
  2482. return t > e ? t : e > a ? a : e
  2483. }
  2484. function u(e) {
  2485. var t = {}
  2486. return (
  2487. (t.style = {}),
  2488. (t.save = function () {
  2489. if (e && e.nodeType) {
  2490. for (var a = 0; a < arguments.length; a++) t.style[arguments[a]] = e.style[arguments[a]]
  2491. return t
  2492. }
  2493. }),
  2494. (t.restore = function () {
  2495. if (e && e.nodeType) {
  2496. for (var a in t.style) t.style.hasOwnProperty(a) && (e.style[a] = t.style[a])
  2497. return t
  2498. }
  2499. }),
  2500. t
  2501. )
  2502. }
  2503. var f,
  2504. v,
  2505. p,
  2506. h = 'sly',
  2507. m = 'Sly',
  2508. g = h,
  2509. y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame,
  2510. w = t.requestAnimationFrame,
  2511. b = e(document),
  2512. P = 'touchstart.' + g + ' mousedown.' + g,
  2513. I = 'mousemove.' + g + ' mouseup.' + g,
  2514. z = 'touchmove.' + g + ' touchend.' + g,
  2515. C = (document.implementation.hasFeature('Event.wheel', '3.0') ? 'wheel.' : 'mousewheel.') + g,
  2516. B = 'click.' + g,
  2517. S = 'mousedown.' + g,
  2518. k = ['INPUT', 'SELECT', 'BUTTON', 'TEXTAREA'],
  2519. T = [],
  2520. x = Math.abs,
  2521. D = Math.sqrt,
  2522. A = Math.pow,
  2523. E = Math.round,
  2524. q = Math.max,
  2525. N = Math.min,
  2526. O = 0
  2527. b.on(C, function (e) {
  2528. var t = e.originalEvent[g],
  2529. a = +new Date()
  2530. ;(!t || t.options.scrollHijack < a - O) && (O = a)
  2531. }),
  2532. (function (e) {
  2533. function t(e) {
  2534. var t = new Date().getTime(),
  2535. n = Math.max(0, 16 - (t - a)),
  2536. i = setTimeout(e, n)
  2537. return (a = t), i
  2538. }
  2539. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t
  2540. var a = new Date().getTime(),
  2541. n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout
  2542. y = function (t) {
  2543. n.call(e, t)
  2544. }
  2545. })(window),
  2546. (function () {
  2547. function e(e) {
  2548. for (var n = 0, i = t.length; i > n; n++) {
  2549. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e
  2550. if (null != a.style[r]) return r
  2551. }
  2552. }
  2553. var t = ['', 'webkit', 'moz', 'ms', 'o'],
  2554. a = document.createElement('div')
  2555. ;(f = e('transform')), (v = e('perspective') ? 'translateZ(0) ' : '')
  2556. })(),
  2557. (t[m] = n),
  2558. (e.fn[h] = function (t, a) {
  2559. var r, s
  2560. return (
  2561. e.isPlainObject(t) || (('string' === i(t) || t === !1) && ((r = t === !1 ? 'destroy' : t), (s = Array.prototype.slice.call(arguments, 1))), (t = {})),
  2562. this.each(function (i, o) {
  2563. var l = e.data(o, g)
  2564. l || r ? l && r && l[r] && l[r].apply(l, s) : (l = e.data(o, g, new n(o, t, a).init()))
  2565. })
  2566. )
  2567. }),
  2568. (n.defaults = {
  2569. slidee: null,
  2570. horizontal: !1,
  2571. itemNav: null,
  2572. itemSelector: null,
  2573. smart: !1,
  2574. activateOn: null,
  2575. activateMiddle: !1,
  2576. scrollSource: null,
  2577. scrollBy: 0,
  2578. scrollHijack: 300,
  2579. scrollTrap: !1,
  2580. dragSource: null,
  2581. mouseDragging: !1,
  2582. touchDragging: !1,
  2583. releaseSwing: !1,
  2584. swingSpeed: 0.2,
  2585. elasticBounds: !1,
  2586. interactive: null,
  2587. scrollBar: null,
  2588. dragHandle: !1,
  2589. dynamicHandle: !1,
  2590. minHandleSize: 50,
  2591. clickBar: !1,
  2592. syncSpeed: 0.5,
  2593. pagesBar: null,
  2594. activatePageOn: null,
  2595. pageBuilder: function (e) {
  2596. return '<li>' + (e + 1) + '</li>'
  2597. },
  2598. forward: null,
  2599. backward: null,
  2600. prev: null,
  2601. next: null,
  2602. prevPage: null,
  2603. nextPage: null,
  2604. cycleBy: null,
  2605. cycleInterval: 5e3,
  2606. pauseOnHover: !1,
  2607. startPaused: !1,
  2608. moveBy: 300,
  2609. speed: 0,
  2610. easing: 'swing',
  2611. startAt: null,
  2612. keyboardNavBy: null,
  2613. draggedClass: 'dragged',
  2614. activeClass: 'active',
  2615. disabledClass: 'disabled'
  2616. })
  2617. })(jQuery, window)
  2618. !(function e(t, i, n) {
  2619. function r(a, s) {
  2620. if (!i[a]) {
  2621. if (!t[a]) {
  2622. var l = 'function' == typeof require && require
  2623. if (!s && l) return l(a, !0)
  2624. if (o) return o(a, !0)
  2625. var c = new Error("Cannot find module '" + a + "'")
  2626. throw ((c.code = 'MODULE_NOT_FOUND'), c)
  2627. }
  2628. var h = (i[a] = {
  2629. exports: {}
  2630. })
  2631. t[a][0].call(
  2632. h.exports,
  2633. function (e) {
  2634. var i = t[a][1][e]
  2635. return r(i ? i : e)
  2636. },
  2637. h,
  2638. h.exports,
  2639. e,
  2640. t,
  2641. i,
  2642. n
  2643. )
  2644. }
  2645. return i[a].exports
  2646. }
  2647. for (var o = 'function' == typeof require && require, a = 0; a < n.length; a++) r(n[a])
  2648. return r
  2649. })(
  2650. {
  2651. 1: [
  2652. function (e, t, i) {
  2653. ;(function (i) {
  2654. 'use strict'
  2655. function n(e) {
  2656. ;(this.player = null),
  2657. (this.director = null),
  2658. (this.modelManager = null),
  2659. (this.container = null),
  2660. (this.tagManager = null),
  2661. (this.fadeInSpeed = e),
  2662. (null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed) || (this.fadeInSpeed = 0)
  2663. }
  2664. var r = e('three'),
  2665. o = e('./util/logger'),
  2666. a = (e('./util/common'), e('./enum/PlayerEvents')),
  2667. s = e('./enum/DirectorEvents'),
  2668. l = e('./settings'),
  2669. c = e('./enum/Viewmode'),
  2670. h = (e('./enum/WarpStyle'), e('./enum/BlackoutStyle'), e('./enum/ModelManagerEvents')),
  2671. u = e('./enum/tagEvents'),
  2672. d = e('./util/transitions'),
  2673. p = e('./util/lerp'),
  2674. f = new o(i)
  2675. //window.THREE = r;
  2676. ;(n.prototype.init = function (e, t, i, n, r) {
  2677. window.app = this
  2678. ;(this.player = t), (this.director = e), (this.modelManager = i), (this.tagManager = n), (this.container = r), this.updateModel(), this.bindEvents()
  2679. }),
  2680. (n.prototype.bindEvents = function () {
  2681. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2682. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2683. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2684. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2685. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2686. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2687. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2688. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2689. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2690. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2691. }),
  2692. (n.prototype.updateModel = function () {
  2693. //模型this.model
  2694. this.model = this.modelManager.getActiveModel()
  2695. }),
  2696. (n.prototype.handleWarpStarted = function () {
  2697. this.hidePlayerReticule()
  2698. }),
  2699. (n.prototype.ontagActivated = function () {
  2700. this.hidePlayerReticule()
  2701. }),
  2702. (n.prototype.onNavigationTotag = function () {
  2703. this.hidePlayerReticule()
  2704. }),
  2705. (n.prototype.handlePlayerModeChanging = function (e, t, i) {
  2706. var n = this.modelManager.getActiveModel(),
  2707. r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity
  2708. n.fadePanoMarkers(r), n.setMode(t)
  2709. }),
  2710. (n.prototype.handlePlayerModeChanged = function (e, t) {
  2711. var i = this.modelManager.getActiveModel(),
  2712. n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide
  2713. i.setSide(n), i.setMode(t)
  2714. }),
  2715. (n.prototype.handleClosestPanoChanging = function (e, t, i) {
  2716. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i), t && !this.director.tourIsPlaying && t.hoverOn(i))
  2717. }),
  2718. (n.prototype.handleActionInterruption = function () {}),
  2719. (n.prototype.handleStartInside = function (e) {
  2720. var t = l[this.player.mode],
  2721. i = e ? 0 : t.transitionTime * t.skyboxOpacityLength
  2722. this.fadeIn(this.fadeInSpeed), (this.model.alpha = 0), (this.model.skybox.material.uniforms.opacity.value = 1), this.model.fadePanoMarkers(e ? 0 : t.markerOpacity)
  2723. var n = this.player.reticule
  2724. d.start(p.property(n.material, 'opacity', 0), i, null, 0, null, 'retReOpac')
  2725. }),
  2726. (n.prototype.handleStartOutside = function (e) {
  2727. this.fadeIn(e)
  2728. }),
  2729. (n.prototype.fadeIn = function (e) {
  2730. ;(null !== e && void 0 !== e) || ((e = 2e3), f.warn('DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.')), $(this.container).fadeIn(e)
  2731. }),
  2732. (n.prototype.hidePlayerReticule = function () {
  2733. this.player.reticule.hide()
  2734. }),
  2735. (t.exports = n)
  2736. }).call(this, '/js/DisplayController.js')
  2737. },
  2738. {
  2739. './enum/BlackoutStyle': 18,
  2740. './enum/DirectorEvents': 23,
  2741. './enum/tagEvents': 32,
  2742. './enum/ModelManagerEvents': 33,
  2743. './enum/PlayerEvents': 40,
  2744. './enum/Viewmode': 51,
  2745. './enum/WarpStyle': 52,
  2746. './settings': 166,
  2747. './util/common': 185,
  2748. './util/lerp': 188,
  2749. './util/logger': 189,
  2750. './util/transitions': 195,
  2751. three: 217
  2752. }
  2753. ],
  2754. 2: [
  2755. function (e, t, i) {
  2756. 'use strict'
  2757. function n() {
  2758. ;(this.baseStartTime = performance.timing.navigationStart), (this.loadingStartTime = null), (this.waitingStartTime = null), (this.appReadyTime = null)
  2759. }
  2760. ;(n.prototype.setBaseStartTime = function (e) {
  2761. this.baseStartTime = e || Date.now()
  2762. }),
  2763. (n.prototype.setWaitingStartTime = function (e) {
  2764. this.waitingStartTime = e || Date.now()
  2765. }),
  2766. (n.prototype.setLoadingStartTime = function (e) {
  2767. this.loadingStartTime = e || Date.now()
  2768. }),
  2769. (n.prototype.setAppReadyTime = function (e) {
  2770. this.appReadyTime = e || Date.now()
  2771. }),
  2772. (n.prototype.calcFullLoadingTime = function () {
  2773. var e = this.appReadyTime - this.baseStartTime
  2774. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime), e
  2775. }),
  2776. (t.exports = n)
  2777. },
  2778. {}
  2779. ],
  2780. 3: [
  2781. function (e, t, i) {
  2782. ;(function (i) {
  2783. 'use strict'
  2784. function n() {
  2785. return 100 * Math.random()
  2786. }
  2787. var r = e('./util/logger'),
  2788. o = e('./util/browser'),
  2789. a = new r(i),
  2790. s = (window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2791. initialized: !1,
  2792. init: function (e, t) {
  2793. if (((t = t || {}), !this.initialized)) {
  2794. ;(this.initialized = !0),
  2795. o.valueFromHash('tilegen') && (t.tilegen = 1 === o.valueFromHash('tilegen', 0)),
  2796. o.valueFromHash('imgopt') && (t.imgopt = 1 === o.valueFromHash('imgopt', 0))
  2797. for (var i in e) {
  2798. var r = i.match('^sc_tilegen_([0-9]+)$')
  2799. r && (s.tilegen = n() < parseInt(r[1]))
  2800. var l = i.match('^sc_imgopt_([0-9]+)$')
  2801. l && (s.imgopt = n() < parseInt(l[1]))
  2802. }
  2803. for (var c in t) (s[c] = t[c]), a.debug('A/B override:', c, s[c])
  2804. }
  2805. },
  2806. changeIfTileGenerating: function (e) {
  2807. return s.tilegen && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e
  2808. },
  2809. changeIfImageOptimzing: function (e) {
  2810. return s.imgopt && e.indexOf('imgopt=1') === -1 && ((e += e.indexOf('?') === -1 ? '?' : '&'), (e += '')), e
  2811. },
  2812. tilegen: !1,
  2813. imgopt: !1
  2814. })
  2815. t.exports = s
  2816. }).call(this, '/js/ab.js')
  2817. },
  2818. {
  2819. './util/browser': 182,
  2820. './util/logger': 189
  2821. }
  2822. ],
  2823. 4: [
  2824. function (e, t, i) {
  2825. ;(function (i) {
  2826. 'use strict'
  2827. function n() {
  2828. return {
  2829. addons: [
  2830. {
  2831. name: 'keen:ua_parser',
  2832. input: {
  2833. ua_string: 'user_agent'
  2834. },
  2835. output: 'parsed_user_agent'
  2836. }
  2837. ]
  2838. }
  2839. }
  2840. function r(e, t, i, n) {
  2841. function r(t) {
  2842. l[t.sid] = !0
  2843. var i = t.billboard.media && t.billboard.media.type,
  2844. n = {
  2845. tag_id: t.sid,
  2846. tags_visited: Object.keys(l).length,
  2847. tag_count: Object.keys(e.tags).length,
  2848. tag_view_count: ++E,
  2849. has_media: !!i
  2850. }
  2851. i && (n.media_type = i), u('tag_opened', n)
  2852. }
  2853. var l = {},
  2854. h = Date.now() - N,
  2855. f = null
  2856. n && (f = Date.now() - window.navigationStart)
  2857. var g
  2858. try {
  2859. g = /* e.data.player_options.highlight_reel && */ e.heroLocations.length > 0
  2860. } catch (e) {
  2861. g = !1
  2862. }
  2863. var v,
  2864. A = e.supportsVR
  2865. A ||
  2866. ((v = 'VR disabled at the model/account level'),
  2867. m.valueFromHash('vr') === _.NONE
  2868. ? (v = 'VR disabled, using &vr=0')
  2869. : m.detectAndroid()
  2870. ? b.isDeviceSupported(w.Android) || (v = 'VR disabled, unsupported Android version')
  2871. : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = 'VR disabled, unsupported iOS version'))),
  2872. u('model_loaded', {
  2873. duration: h,
  2874. duration_from_navigation_start: f,
  2875. has_hlr: g,
  2876. has_vr: A,
  2877. vr_reason: v
  2878. })
  2879. var I = 0
  2880. e.panos.forEach(function (e) {
  2881. e.on('enter', function () {
  2882. c('pano_viewed', {
  2883. pano_id: e.id,
  2884. pano_view_count: ++I,
  2885. alignment_type: e.alignmentType,
  2886. interaction_source: O,
  2887. navigation_source: p
  2888. })
  2889. })
  2890. })
  2891. var E = 0
  2892. for (var T in e.tags) e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]))
  2893. t.on('tour_auto', function (e) {
  2894. p = 'tour_' + e
  2895. }),
  2896. t.on('tour_manual', function (e) {
  2897. ;(O = 'gui-' + e), (p = 'tour_manual')
  2898. }),
  2899. i.on(C.InteractionKey, function () {
  2900. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2901. }),
  2902. i.on(C.InteractionDirect, function () {
  2903. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2904. }),
  2905. o(t),
  2906. a(),
  2907. s()
  2908. }
  2909. function o(e) {
  2910. I.on(T.OPENED, function () {
  2911. c('showcase_share_intent', {
  2912. pano_id: e.currentPano && e.currentPano.id
  2913. })
  2914. }),
  2915. I.on(T.LINK_CLICKED, function (t) {
  2916. c('showcase_share_action', {
  2917. channel: t.channel,
  2918. pano_id: e.currentPano && e.currentPano.id
  2919. })
  2920. }),
  2921. E.on(x.ORIGIN_LINK_CLICKED, function () {
  2922. c('showcase_share_origin_link_clicked')
  2923. })
  2924. }
  2925. function a() {}
  2926. function s() {
  2927. b.on(
  2928. S.OPENED,
  2929. c.bind(this, 'showcase_gui', {
  2930. gui_action: 'click_vr_button'
  2931. })
  2932. ),
  2933. b.on(S.LAUNCH, function (e) {
  2934. c('showcase_gui', {
  2935. gui_action: 'launch_vr',
  2936. vr_platform: e.vr_platform,
  2937. vr_app: e.vr_app
  2938. })
  2939. }),
  2940. b.on(
  2941. S.PREV,
  2942. c.bind(this, 'showcase_gui', {
  2943. gui_action: 'vr_modal_prev'
  2944. })
  2945. ),
  2946. b.on(S.NEXT, function (e) {
  2947. c('showcase_gui', {
  2948. gui_action: e.nextAction
  2949. })
  2950. }),
  2951. b.on(
  2952. S.CLOSED,
  2953. c.bind(this, 'showcase_gui', {
  2954. gui_action: 'vr_modal_close'
  2955. })
  2956. ),
  2957. b.on(S.falseICECHOSEN, function (e) {
  2958. c('showcase_gui', {
  2959. gui_action: e.name + ' '
  2960. })
  2961. }),
  2962. b.on(S.STORE, function (e) {
  2963. c('showcase_gui', {
  2964. gui_action: 'launch_store',
  2965. store: e
  2966. })
  2967. })
  2968. }
  2969. function l(e, t) {
  2970. if (f)
  2971. try {
  2972. f.addEvent(
  2973. e,
  2974. v.extendObject(
  2975. {
  2976. host: window.location.host,
  2977. keen: n(),
  2978. user_agent: '${keen.user_agent}',
  2979. referrer: {
  2980. url: v.normalizeUrl(document.referrer),
  2981. domain: v.domainFromUrl(document.referrer),
  2982. url_original: document.referrer
  2983. },
  2984. embedded: m.inIframe(),
  2985. is_mobile: m.isMobile(),
  2986. version: '2.25.6-0-gd87e5b1'
  2987. },
  2988. t
  2989. )
  2990. )
  2991. } catch (e) {
  2992. P.warn('analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: ' + e)
  2993. }
  2994. }
  2995. function c(e, t) {
  2996. if (((t = t || {}), L))
  2997. try {
  2998. window.analytics.track(e, v.extendObject(t, B), {
  2999. context: {
  3000. app: {
  3001. name: 'showcase',
  3002. version: '2.25.6-0-gd87e5b1'
  3003. },
  3004. screen: {
  3005. width: window.screen.width,
  3006. height: window.screen.height,
  3007. density: window.devicePixelRatio
  3008. }
  3009. }
  3010. })
  3011. } catch (t) {
  3012. console.warn('Failed to send data to segment for ' + e)
  3013. }
  3014. }
  3015. function h(e, t) {
  3016. if (((t = t || {}), navigator.sendBeacon && L))
  3017. try {
  3018. navigator.sendBeacon(
  3019. 'https://api.segment.io/v1/t',
  3020. JSON.stringify({
  3021. event: e,
  3022. anonymousId: window.analytics.user().anonymousId(),
  3023. properties: v.extendObject(t, B),
  3024. writeKey: L,
  3025. sentAt: Date.now(),
  3026. type: 'track',
  3027. context: {
  3028. userAgent: m.userAgent(),
  3029. library: {
  3030. name: 'showcase-beacon',
  3031. version: '2.25.6-0-gd87e5b1'
  3032. },
  3033. app: {
  3034. name: 'showcase',
  3035. version: '2.25.6-0-gd87e5b1'
  3036. }
  3037. }
  3038. })
  3039. )
  3040. } catch (e) {
  3041. console.warn('Failed to send async segment request')
  3042. }
  3043. }
  3044. function u(e, t) {
  3045. ;(t = t || {}), c(e, t)
  3046. }
  3047. function d(e, t) {
  3048. ;(O = e === C.InteractionGui ? 'gui-' + t : e), (p = 'self_guided')
  3049. }
  3050. var p,
  3051. f,
  3052. g = (e('three'), e('./util/ajax'), e('./ab')),
  3053. m = e('./util/browser'),
  3054. v = e('./util/common'),
  3055. A = e('./settings'),
  3056. y = (e('./localization/localize'), e('./enum/Viewmode')),
  3057. C = e('./enum/ControlEvents'),
  3058. I = e('./gui/sharing/modal'),
  3059. E = e('./gui/title/titleBar'),
  3060. b = e('./gui/vr/vrModal'),
  3061. w = e('./enum/VRPlatforms'),
  3062. _ = e('./enum/VROption'),
  3063. T = e('./gui/sharing/ShareEvents'),
  3064. x = e('./gui/title/TitleEvents'),
  3065. S = e('./gui/vr/vrEvent'),
  3066. M = e('./tag/Billboard/BillboardEvent'),
  3067. R = e('./util/logger'),
  3068. P = new R(i),
  3069. O = (e('./enum/PlayerEvents'), 'direct'),
  3070. L = null,
  3071. D = !1,
  3072. N = null,
  3073. B = null,
  3074. F = v.uuid4()
  3075. t.exports = {
  3076. report: function (e, t, i, n) {
  3077. l('Session starts', {
  3078. model: e,
  3079. status: t,
  3080. loadtime: Date.now() - (N || Date.now()),
  3081. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  3082. autoplay: i,
  3083. quickstart: n,
  3084. ab_tilegen: g.tilegen,
  3085. ab_imgopt: g.imgopt
  3086. })
  3087. },
  3088. impression: function (e) {
  3089. e = e || {}
  3090. var t = void 0 === e.isVisible || e.isVisible,
  3091. i = (void 0 !== e.immediate && e.immediate, window.location.search.substr(1).split('&'))
  3092. u('impression', {
  3093. visible: t,
  3094. url_params: i
  3095. })
  3096. },
  3097. initKeen: function (e) {
  3098. return e.token && e.appId
  3099. ? void (f = new Keen({
  3100. projectId: e.appId,
  3101. writeKey: e.token,
  3102. readKey: '',
  3103. requestType: 'xhr'
  3104. }))
  3105. : void P.warn('no keen token/appId')
  3106. },
  3107. initSegment: function (e) {
  3108. return e.token
  3109. ? ((L = e.token),
  3110. window.analytics.load(e.token),
  3111. (B = {
  3112. model_id: e.model,
  3113. start_source: e.startSource,
  3114. autoplay: e.autoplay,
  3115. quickstart: e.quickstart,
  3116. language_tag: A.languageTag,
  3117. is_mobile: m.isMobile(),
  3118. iframe: m.inIframe(),
  3119. aspect_ratio: m.aspectRatio(),
  3120. session_id: F,
  3121. window: {
  3122. width: $('#player').width(),
  3123. height: $('#player').height()
  3124. },
  3125. platform: {
  3126. browser: {
  3127. name: $.ua.browser.name,
  3128. major: $.ua.browser.major,
  3129. version: $.ua.browser.version
  3130. },
  3131. os: {
  3132. name: $.ua.os.name,
  3133. version: $.ua.os.version
  3134. },
  3135. device: {
  3136. vendor: $.ua.device.vendor,
  3137. model: $.ua.device.model,
  3138. type: $.ua.device.type
  3139. }
  3140. }
  3141. }),
  3142. (D = Math.random() < A.analytics.sessionTrackingRate),
  3143. P.debug('tracking sample rate = ' + A.analytics.sessionTrackingRate),
  3144. void P.debug('tracking this session = ' + D))
  3145. : void P.warn('no segment token')
  3146. },
  3147. sessionStart: function (e) {
  3148. P.debug('analytics user_session_start'),
  3149. c('session_started'),
  3150. (N = Date.now()),
  3151. window.addEventListener('unload', function () {
  3152. h('session_ended', {
  3153. duration: Date.now() - N
  3154. })
  3155. })
  3156. },
  3157. modelLoaded: function (e, t, i, n) {
  3158. r(e, t, i, n)
  3159. },
  3160. loadComplete: function (e) {
  3161. var t = {
  3162. time_to_app_start: e
  3163. }
  3164. c('load_times', t)
  3165. },
  3166. track: function (e, t) {
  3167. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t))
  3168. },
  3169. trackAlways: function (e, t) {
  3170. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + ' )'), c(e, t)
  3171. },
  3172. getSessionId: function () {
  3173. return F
  3174. },
  3175. updateInteraction: d
  3176. }
  3177. }).call(this, '/js/analytics.js')
  3178. },
  3179. {
  3180. './ab': 3,
  3181. './enum/ControlEvents': 21,
  3182. './enum/PlayerEvents': 40,
  3183. './enum/VROption': 47,
  3184. './enum/VRPlatforms': 49,
  3185. './enum/Viewmode': 51,
  3186. './gui/sharing/ShareEvents': 76,
  3187. './gui/sharing/modal': 77,
  3188. './gui/title/TitleEvents': 80,
  3189. './gui/title/titleBar': 82,
  3190. './gui/vr/vrEvent': 85,
  3191. './gui/vr/vrModal': 87,
  3192. './localization/localize': 108,
  3193. './tag/Billboard/BillboardEvent': 120,
  3194. './settings': 166,
  3195. './util/ajax': 181,
  3196. './util/browser': 182,
  3197. './util/common': 185,
  3198. './util/logger': 189,
  3199. three: 217
  3200. }
  3201. ],
  3202. 5: [
  3203. function (e, t, i) {
  3204. 'use strict'
  3205. function n() {
  3206. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $('#player').width() / $('#player').height(), o.dollhouseNear, o.dollhouseFar), (this.controls = null)
  3207. }
  3208. var r = e('three'),
  3209. o = e('../constants'),
  3210. a = e('../util/cameraLight')
  3211. ;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3212. (n.prototype.updateAspect = function (e) {
  3213. ;(this.aspect = e), this.updateProjectionMatrix()
  3214. }),
  3215. (t.exports = n)
  3216. },
  3217. {
  3218. '../constants': 8,
  3219. '../util/cameraLight': 184,
  3220. three: 217
  3221. }
  3222. ],
  3223. 6: [
  3224. function (e, t, i) {
  3225. 'use strict'
  3226. function n() {
  3227. var e = $('#player').width() / $('#player').height()
  3228. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar), (this.controls = null), this.updateAspect(e)
  3229. }
  3230. var r = e('three'),
  3231. o = e('../constants')
  3232. ;(n.prototype = Object.create(r.OrthographicCamera.prototype)),
  3233. (n.prototype.updateAspect = function (e) {
  3234. ;(this.aspect = e), (this.top = o.orthoBase / e), (this.bottom = -o.orthoBase / e), this.updateProjectionMatrix()
  3235. }),
  3236. (t.exports = n)
  3237. },
  3238. {
  3239. '../constants': 8,
  3240. three: 217
  3241. }
  3242. ],
  3243. 7: [
  3244. function (e, t, i) {
  3245. 'use strict'
  3246. function n() {
  3247. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $('#player').width() / $('#player').height(), o.insideNear, o.insideFar), (this.controls = null)
  3248. }
  3249. var r = e('three'),
  3250. o = e('../settings'),
  3251. a = e('../util/cameraLight')
  3252. ;(n.prototype = Object.create(r.PerspectiveCamera.prototype)),
  3253. (n.prototype.updateAspect = function (e) {
  3254. ;(this.aspect = e), this.updateProjectionMatrix()
  3255. }),
  3256. (t.exports = n)
  3257. },
  3258. {
  3259. '../settings': 166,
  3260. '../util/cameraLight': 184,
  3261. three: 217
  3262. }
  3263. ],
  3264. 8: [
  3265. function (e, t, i) {
  3266. 'use strict'
  3267. t.exports = {
  3268. signedUrlDefaultExpireTime: 24e4,
  3269. signedUrlCheckInterval: 1e4,
  3270. signedUrlRefreshBuffer: 15e3,
  3271. dollhouseFOV: 70,
  3272. dollhouseNear: 1,
  3273. dollhouseFar: 5e3,
  3274. insideFOV: 70,
  3275. insideFOVMax: 120,
  3276. insideNear: 0.1,
  3277. insideFar: 5e3,
  3278. insideLookSpeed: 0.12,
  3279. insideLookLimitUp: 40, //视角
  3280. insideLookLimitDown: -40,
  3281. orthoNear: 1,
  3282. orthoFar: 5e3,
  3283. orthoBase: 10,
  3284. narrowLandscapeHeight: 290,
  3285. reallyNarrowLandscapeHeight: 250,
  3286. visionTilingStartDate: new Date('8/26/2016'),
  3287. visionTilingStartVersion: '1.1.407.13667',
  3288. windowHeightHighQualityThreshold: 900,
  3289. tourStepDelayDefault: 3500,
  3290. tourStepDelaySlideShow: 5e3,
  3291. workshopApsect: 9 / 16,
  3292. highQualityMaxZoom: 2,
  3293. ultraHighQualityMaxZoom: 3
  3294. }
  3295. },
  3296. {}
  3297. ],
  3298. 9: [
  3299. function (e, t, i) {
  3300. 'use strict'
  3301. function n() {
  3302. ;(this.activeControl = null), (this.controls = {}), (this.cameras = {})
  3303. }
  3304. var r = e('./PanoramaControls'),
  3305. o = e('./DollhouseControls'),
  3306. a = e('./FloorplanControls'),
  3307. s = e('../cameras/PanoramaCamera'),
  3308. l = e('../cameras/DollhouseCamera'),
  3309. c = e('../cameras/FloorplanCamera'),
  3310. h = e('events').EventEmitter,
  3311. u = e('../enum/ControlEvents'),
  3312. d = e('../enum/ModelManagerEvents'),
  3313. p = e('../enum/Viewmode'),
  3314. f = e('../settings')
  3315. ;(n.prototype = Object.create(h.prototype)),
  3316. (n.prototype.init = function (e, t) {
  3317. this.setUpControls(), this.bindEvents(e, t)
  3318. }),
  3319. (n.prototype.activateControls = function (e) {
  3320. this.activeControl && (this.activeControl.reset(), (this.activeControl.enabled = !1)), this.controls[e] && (this.controls[e].enabled = !0), (this.activeControl = this.controls[e])
  3321. }),
  3322. (n.prototype.setUpControls = function () {
  3323. var e = {},
  3324. t = {},
  3325. i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN],
  3326. n = [s, l, c],
  3327. h = [r, o, a]
  3328. i.forEach(
  3329. function (i, r) {
  3330. ;(e[i] = new n[r]()),
  3331. (t[i] = new h[r](e[i])),
  3332. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3333. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3334. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3335. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3336. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3337. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3338. }.bind(this)
  3339. ),
  3340. (this.controls = t),
  3341. (this.cameras = e)
  3342. }),
  3343. (n.prototype.bindEvents = function (e, t) {
  3344. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  3345. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  3346. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  3347. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  3348. f.useWheel && (e.addEventListener('mousewheel', this.onMouseWheel.bind(this), { passive: false }), e.addEventListener('DOMMouseScroll', this.onMouseWheel.bind(this))),
  3349. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  3350. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  3351. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  3352. e.addEventListener('contextmenu', function (e) {
  3353. e.preventDefault()
  3354. }),
  3355. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  3356. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  3357. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  3358. e.addEventListener('pointerout', this.onPointerCancel.bind(this)),
  3359. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  3360. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  3361. document.addEventListener('keyup', this.onKeyUp.bind(this)),
  3362. t.on(
  3363. d.ActiveModelChanged,
  3364. function (e) {
  3365. this.setModelForControls(e.model)
  3366. }.bind(this)
  3367. )
  3368. }),
  3369. (n.prototype.setModelForControls = function (e) {
  3370. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox)
  3371. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding)
  3372. ;[p.DOLLHOUSE, p.FLOORPLAN].forEach(
  3373. function (e) {
  3374. this.controls[e].setBounds(t)
  3375. }.bind(this)
  3376. )
  3377. }),
  3378. (n.prototype.onMouseDown = function (e) {
  3379. e.preventDefault(), this.activeControl && this.activeControl.onMouseDown(e)
  3380. }),
  3381. (n.prototype.onMouseMove = function (e) {
  3382. e.preventDefault(), this.activeControl && this.activeControl.onMouseMove(e)
  3383. }),
  3384. (n.prototype.onMouseUp = function (e) {
  3385. e.preventDefault(), this.activeControl && this.activeControl.onMouseUp(e)
  3386. }),
  3387. (n.prototype.onMouseOver = function (e) {
  3388. e.preventDefault(), this.activeControl && this.activeControl.onMouseOver(e)
  3389. }),
  3390. (n.prototype.onMouseWheel = function (e) {
  3391. e.preventDefault(), this.activeControl && this.activeControl.onMouseWheel(e)
  3392. }),
  3393. (n.prototype.onTouchStart = function (e) {
  3394. e.preventDefault(), this.activeControl && this.activeControl.onTouchStart(e)
  3395. var hotList = $('#hotListWrap')[0]
  3396. hotList.classList.remove('hotListActive')
  3397. $('#hotListContent ul .active').removeClass('active')
  3398. $('#hotList')[0].classList.remove('active')
  3399. }),
  3400. (n.prototype.onTouchMove = function (e) {
  3401. e.preventDefault(), this.activeControl && this.activeControl.onTouchMove(e)
  3402. }),
  3403. (n.prototype.onTouchEnd = function (e) {
  3404. e.preventDefault(), this.activeControl && this.activeControl.onTouchEnd(e)
  3405. }),
  3406. (n.prototype.onPointerDown = function (e) {
  3407. if ((e.preventDefault(), this.activeControl))
  3408. switch (e.pointerType) {
  3409. case 'mouse':
  3410. this.activeControl.onMouseDown(e)
  3411. break
  3412. default:
  3413. this.activeControl.onPointerDown(e)
  3414. }
  3415. }),
  3416. (n.prototype.onPointerMove = function (e) {
  3417. if ((e.preventDefault(), this.activeControl))
  3418. switch (e.pointerType) {
  3419. case 'mouse':
  3420. this.activeControl.onMouseMove(e)
  3421. break
  3422. default:
  3423. this.activeControl.onPointerMove(e)
  3424. }
  3425. }),
  3426. (n.prototype.onPointerUp = function (e) {
  3427. if ((e.preventDefault(), this.activeControl))
  3428. switch (e.pointerType) {
  3429. case 'mouse':
  3430. this.activeControl.onMouseUp(e)
  3431. break
  3432. default:
  3433. this.activeControl.onPointerUp(e)
  3434. }
  3435. }),
  3436. (n.prototype.onPointerCancel = function (e) {
  3437. e.preventDefault(), this.activeControl && 'mouse' !== e.pointerType && this.activeControl.onPointerUp(e)
  3438. }),
  3439. (n.prototype.onKeyDown = function (e) {
  3440. e.metaKey || e.ctrlKey || (e.preventDefault(), this.activeControl && this.activeControl.onKeyDown(e))
  3441. }),
  3442. (n.prototype.onKeyUp = function (e) {
  3443. e.preventDefault(), this.activeControl && this.activeControl.onKeyUp(e)
  3444. }),
  3445. (t.exports = n)
  3446. },
  3447. {
  3448. '../cameras/DollhouseCamera': 5,
  3449. '../cameras/FloorplanCamera': 6,
  3450. '../cameras/PanoramaCamera': 7,
  3451. '../enum/ControlEvents': 21,
  3452. '../enum/ModelManagerEvents': 33,
  3453. '../enum/Viewmode': 51,
  3454. '../settings': 166,
  3455. './DollhouseControls': 10,
  3456. './FloorplanControls': 11,
  3457. './PanoramaControls': 13,
  3458. events: 202
  3459. }
  3460. ],
  3461. 10: [
  3462. function (e, t, i) {
  3463. 'use strict'
  3464. function n(e) {
  3465. a.call(this, e),
  3466. (this.minPolarAngle = o.dollhouseDefault.minPolarAngle),
  3467. (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle),
  3468. (this.minDistance = o.dollhouseDefault.minDistance),
  3469. (this.maxDistance = o.dollhouseDefault.maxDistance),
  3470. (this.adjustedMinDistance = this.minDistance),
  3471. (this.adjustedMaxDistance = this.maxDistance)
  3472. }
  3473. var r = e('three'),
  3474. o = e('../settings'),
  3475. a = e('./OutsideControls')
  3476. ;(n.prototype = Object.create(a.prototype)),
  3477. (n.prototype.pan = function (e, t) {
  3478. this.camera.updateMatrix()
  3479. var i = this.camera.position.clone().sub(this.target).length()
  3480. ;(i *= Math.tan(((this.camera.fov / 2) * Math.PI) / 180)), this.panLeft((2 * e * i) / $('#player').height()), this.panUp((-2 * t * i) / $('#player').height())
  3481. }),
  3482. (n.prototype.updateZoom = function () {
  3483. var e = this.offset.length()
  3484. return e * this.scale
  3485. }),
  3486. (n.prototype.setZoomBounds = function (e) {
  3487. var t = e.min.distanceTo(e.max)
  3488. ;(this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0)),
  3489. (this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius)),
  3490. (this.minDistance = this.adjustedMinDistance),
  3491. (this.maxDistance = this.adjustedMaxDistance)
  3492. }),
  3493. (n.prototype.resetRanges = function (e, t) {
  3494. e
  3495. ? ((this.minDistance = Math.min(e, this.minDistance)), (this.maxDistance = Math.max(e, this.maxDistance)))
  3496. : ((this.minDistance = this.adjustedMinDistance), (this.maxDistance = this.adjustedMaxDistance)),
  3497. t
  3498. ? ((this.minPolarAngle = r.Math.degToRad(-15)), (this.maxPolarAngle = r.Math.degToRad(89.9)))
  3499. : ((this.minPolarAngle = o.dollhouseDefault.minPolarAngle), (this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle))
  3500. }),
  3501. (n.prototype.toJSON = function () {
  3502. return a.prototype.toJSON.call(this)
  3503. }),
  3504. (t.exports = n)
  3505. },
  3506. {
  3507. '../settings': 166,
  3508. './OutsideControls': 12,
  3509. three: 217
  3510. }
  3511. ],
  3512. 11: [
  3513. function (e, t, i) {
  3514. 'use strict'
  3515. function n(e) {
  3516. a.call(this, e),
  3517. (this.minDistance = 15),
  3518. (this.maxDistance = 50),
  3519. (this.noRotateUpDown = !0),
  3520. (this.minPolarAngle = 0),
  3521. (this.maxPolarAngle = 0),
  3522. (this.mouseActions[l.LEFT] = s.PAN),
  3523. (this.mouseActions[l.MIDDLE] = s.DOLLY),
  3524. (this.mouseActions[l.RIGHT] = s.ROTATE),
  3525. (this.touchActions[1] = s.PAN),
  3526. (this.touchActions[2] = s.ROTATE_DOLLY),
  3527. (this.absoluteScale = 1),
  3528. (this.currentScale = 1)
  3529. }
  3530. var r = e('three'),
  3531. o = e('../settings'),
  3532. a = e('./OutsideControls'),
  3533. s = e('../enum/ControlActions'),
  3534. l = e('../enum/MouseButton'),
  3535. c = e('../util/math'),
  3536. h = e('../util/browser')
  3537. ;(n.prototype = Object.create(a.prototype)),
  3538. (n.prototype.zoomToContain = function (e) {
  3539. this.absoluteScale = this.getDefaultAbsoluteScale(e)
  3540. this.currentScale = this.absoluteScale
  3541. }),
  3542. (n.prototype.getDefaultAbsoluteScale = function (modelSize, ratio) {
  3543. let defaultRatio = 1.2,
  3544. absoluteScale
  3545. if (_settings.floorPlanAngle) {
  3546. //指定了角度的话,就和browser.aspectRatio()无关,总使用纵向
  3547. var angle = parseFloat(_settings.floorPlanAngle)
  3548. modelSize = modelSize.clone().applyEuler(new THREE.Euler(0, angle, 0))
  3549. var n = Math.max(Math.abs(modelSize.x), Math.abs(modelSize.z) * this.camera.aspect) //视口宽高比 >= 1 情况下,模型所占最大视口尺寸
  3550. var screenSize = Math.min($('#player').width(), $('#player').height())
  3551. var maxSize = 800 //模型最大占据像素
  3552. ratio = ratio != void 0 ? ratio : Math.max((screenSize * defaultRatio) / maxSize, defaultRatio)
  3553. absoluteScale = (n / 2 / o.orthoBase) * ratio //根据模型所占最大视口尺寸调整缩放
  3554. } else {
  3555. var t = Math.max(modelSize.x, modelSize.z),
  3556. i = Math.min(modelSize.x, modelSize.z),
  3557. n = Math.max(t, i * this.camera.aspect),
  3558. r = Math.max(i, t * this.camera.aspect)
  3559. absoluteScale = ((h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase) * defaultRatio
  3560. }
  3561. return absoluteScale
  3562. }),
  3563. /* n.prototype.rotateToView = function(e, t) {
  3564. var i = 0
  3565. , n = h.aspectRatio() < 1
  3566. , r = e.x < e.z;
  3567. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3568. this.rotateLeft(i),
  3569. this.update(0)
  3570. },
  3571. */
  3572. (n.prototype.rotateToView = function (modelSize, direction) {
  3573. let i = 0,
  3574. n = h.aspectRatio() < 1 //是否模型尺寸显“细长”
  3575. if (_settings.floorPlanAngle) {
  3576. //规定了cadImage旋转值的话 (0是无效的,将不设置)
  3577. i = parseFloat(_settings.floorPlanAngle)
  3578. } else {
  3579. let r = modelSize.x < modelSize.z //是否视口为“窄屏”
  3580. if (n === r) {
  3581. //“细长” 且 “窄屏”,说明模型尺寸比例与视口比例匹配,相机坐标只需要调转“前”“后”
  3582. if (direction.z > 0) {
  3583. //(第一种情况)相机是否位于背面。 注:在默认情况下webgl的相机朝向-z, direction.z > 0 说明相机视野已经偏向+z,说明相机位于模型“背面”
  3584. i = Math.PI //经度上做180度轨道角位移,使相机移到静止模型的“前面”
  3585. }
  3586. //(第二种情况) 不做处理
  3587. } else if (direction.x > 0) {
  3588. i = Math.PI / 2
  3589. } else {
  3590. i = -Math.PI / 2
  3591. }
  3592. }
  3593. this.rotateLeft(i)
  3594. this.update(0)
  3595. }),
  3596. (n.prototype.rotateToAngle = function (angle) {
  3597. //add 旋转到特定角度
  3598. this.rotateLeft(angle + this.lon)
  3599. this.update(0)
  3600. }),
  3601. (n.prototype.pan = function (e, t) {
  3602. this.camera.updateMatrix(),
  3603. this.panLeft((e * (this.camera.right - this.camera.left)) / $('#player').width()),
  3604. this.panUp((-t * (this.camera.top - this.camera.bottom)) / $('#player').height())
  3605. }),
  3606. (n.prototype.updateZoom = function () {
  3607. return (
  3608. (this.absoluteScale *= this.scale - 0.03 * this.keyboardZoomSpeed),
  3609. (this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit))),
  3610. (this.currentScale = 0.8 * this.currentScale + 0.2 * this.absoluteScale),
  3611. (this.camera.left = -o.orthoBase * this.currentScale),
  3612. (this.camera.right = o.orthoBase * this.currentScale),
  3613. (this.camera.top = (o.orthoBase * this.currentScale) / this.camera.aspect),
  3614. (this.camera.bottom = (-o.orthoBase * this.currentScale) / this.camera.aspect),
  3615. this.camera.updateProjectionMatrix(),
  3616. this.offset.length()
  3617. )
  3618. }),
  3619. (n.prototype.toJSON = (function () {
  3620. var e = new r.Quaternion(),
  3621. t = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90)),
  3622. i = new r.Quaternion()
  3623. return function () {
  3624. var n = a.prototype.toJSON.call(this)
  3625. return (
  3626. e.copy(n.camera_quaternion),
  3627. i.copy(t),
  3628. i.multiply(e),
  3629. (n.camera_quaternion.x = c.toPrecision(i.x, 4)),
  3630. (n.camera_quaternion.y = c.toPrecision(i.y, 4)),
  3631. (n.camera_quaternion.z = c.toPrecision(i.z, 4)),
  3632. (n.camera_quaternion.w = c.toPrecision(i.w, 4)),
  3633. (n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4)),
  3634. n
  3635. )
  3636. }
  3637. })()),
  3638. (t.exports = n)
  3639. },
  3640. {
  3641. '../enum/ControlActions': 20,
  3642. '../enum/MouseButton': 34,
  3643. '../settings': 166,
  3644. '../util/browser': 182,
  3645. '../util/math': 190,
  3646. './OutsideControls': 12,
  3647. three: 217
  3648. }
  3649. ],
  3650. 12: [
  3651. function (e, t, i) {
  3652. 'use strict'
  3653. function n(e) {
  3654. ;(this.camera = e),
  3655. (this.camera.controls = this),
  3656. (this.enabled = !1),
  3657. (this.target = new r.Vector3()),
  3658. (this.targetBounds = new r.Box3()),
  3659. (this.zoomSpeed = 1),
  3660. (this.minDistance = 0),
  3661. (this.maxDistance = 1 / 0),
  3662. (this.noRotateUpDown = !1),
  3663. (this.rotateSpeed = 1),
  3664. (this.keyboardZoomSpeed = 0),
  3665. (this.keyPanSpeed = 7),
  3666. (this.autoRotate = !1),
  3667. (this.autoRotateSpeed = 2),
  3668. (this.autoPan = !1),
  3669. (this.autoPanPosition = new r.Vector3()),
  3670. (this.minPolarAngle = r.Math.degToRad(25)),
  3671. (this.maxPolarAngle = r.Math.degToRad(65)),
  3672. (this.rotationAcceleration = new r.Vector2()),
  3673. (this.rotationSpeed = new r.Vector2()),
  3674. (this.panAcceleration = new r.Vector2()),
  3675. (this.panSpeed = new r.Vector2()),
  3676. (this.rotateStart = new r.Vector2()),
  3677. (this.rotateEnd = new r.Vector2()),
  3678. (this.rotateDelta = new r.Vector2()),
  3679. (this.panStart = new r.Vector2()),
  3680. (this.panEnd = new r.Vector2()),
  3681. (this.panDelta = new r.Vector2()),
  3682. (this.panOffset = new r.Vector3()),
  3683. (this.offset = new r.Vector3()),
  3684. (this.dollyStart = new r.Vector2()),
  3685. (this.dollyEnd = new r.Vector2()),
  3686. (this.dollyDelta = new r.Vector2()),
  3687. (this.phiDelta = 0),
  3688. (this.thetaDelta = 0),
  3689. (this.scale = 1),
  3690. (this.panVector = new r.Vector3()),
  3691. (this.lastPosition = new r.Vector3()),
  3692. (this.state = c.NONE),
  3693. (this.mouseActions = {}),
  3694. (this.mouseActions[h.LEFT] = c.ROTATE),
  3695. (this.mouseActions[h.MIDDLE] = c.DOLLY),
  3696. (this.mouseActions[h.RIGHT] = c.PAN),
  3697. (this.touchActions = {}),
  3698. (this.touchActions[1] = c.ROTATE),
  3699. (this.touchActions[2] = c.PAN_DOLLY),
  3700. (this.lastMoveTime = 0),
  3701. (this.pointersLimit = 2),
  3702. (this.pointers = [])
  3703. }
  3704. var r = e('three'),
  3705. o = e('../settings'),
  3706. a = e('../util/common'),
  3707. s = e('../util/math'),
  3708. l = e('../enum/Vectors'),
  3709. c = e('../enum/ControlActions'),
  3710. h = e('../enum/MouseButton'),
  3711. u = e('../enum/Keys'),
  3712. d = e('../enum/ControlEvents'),
  3713. p = e('events').EventEmitter,
  3714. f = 1e-6
  3715. ;(n.prototype = Object.create(p.prototype)),
  3716. (n.prototype.setBounds = function (e) {
  3717. this.targetBounds = e
  3718. }),
  3719. (n.prototype.isEngaged = function () {
  3720. return this.state !== c.NONE
  3721. }),
  3722. (n.prototype.rotateLeft = function (e) {
  3723. void 0 === e && (e = this.getAutoRotationAngle()), (this.thetaDelta -= e)
  3724. }),
  3725. (n.prototype.rotateUp = function (e) {
  3726. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()), (this.phiDelta -= e))
  3727. }),
  3728. (n.prototype.panLeft = function (e) {
  3729. var t = this.camera.matrix.elements
  3730. this.panOffset.set(t[0], 0, t[2]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  3731. }),
  3732. (n.prototype.panUp = function (e) {
  3733. var t = this.camera.matrix.elements
  3734. this.panOffset.set(t[4], 0, t[6]).normalize(), this.panOffset.multiplyScalar(-e), this.panVector.add(this.panOffset)
  3735. }),
  3736. (n.prototype.startRotating = function (e, t) {
  3737. e && this.navRotationAcc('x', e), t && this.navRotationAcc('y', t)
  3738. }),
  3739. (n.prototype.stopRotating = function (e) {
  3740. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.navRotationAcc('x', 0), this.navRotationAcc('y', 0)
  3741. }),
  3742. (n.prototype.setAutoPanPosition = (function (e, t) {
  3743. var i = new r.Vector3(),
  3744. n = new r.Vector3()
  3745. return function (e, t) {
  3746. i.copy(this.camera.position), (void 0 === e && null === e) || i.setX(e), (void 0 === t && null === t) || i.setZ(t)
  3747. var r = this.camera.position.distanceTo(this.target),
  3748. o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion)
  3749. ;(this.targetClamped = !1),
  3750. n.copy(i).addScaledVector(o, r),
  3751. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n), i.copy(n).addScaledVector(o, -r), (this.targetClamped = !0)),
  3752. (this.autoPanPosition.x = i.x),
  3753. (this.autoPanPosition.z = i.z),
  3754. this.autoPan && this.stopAutoPanning()
  3755. }
  3756. })()),
  3757. (n.prototype.stopAutoPanning = function () {
  3758. var e = this.autoPan
  3759. ;(this.autoPan = !1), this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3760. }),
  3761. (n.prototype.dollyIn = function (e) {
  3762. void 0 === e && (e = this.getZoomScale()), (this.scale /= e)
  3763. }),
  3764. (n.prototype.dollyOut = function (e) {
  3765. void 0 === e && (e = this.getZoomScale()), (this.scale *= e)
  3766. }),
  3767. (n.prototype.updatePan = function (e) {
  3768. if ((this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e), this.pan(-this.panSpeed.x, this.panSpeed.y), this.autoPan)) {
  3769. var t = new r.Vector3().copy(this.autoPanPosition).sub(this.camera.position)
  3770. t.setY(0).clampLength(0, 50 * e),
  3771. this.target.add(t),
  3772. this.camera.position.add(t),
  3773. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && ((this.autoPan = !1), this.stopAutoPanning())
  3774. }
  3775. }),
  3776. (n.prototype.update = function (e) {
  3777. e || (e = 1 / 60)
  3778. var friction = Math.min(1, o.rotationFriction * e * 60) //add 如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  3779. this.rotationSpeed.multiplyScalar(1 - friction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3780. this.rotateLeft(-this.rotationSpeed.x),
  3781. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3782. this.updatePan(e)
  3783. var t = this.camera.position
  3784. this.offset.copy(t).sub(this.target)
  3785. var i = Math.atan2(this.offset.x, this.offset.z),
  3786. n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y)
  3787. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3788. (i += this.thetaDelta),
  3789. (n += this.phiDelta),
  3790. (n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n))),
  3791. (n = Math.max(f, Math.min(Math.PI - f, n)))
  3792. ;(this.lon = i), (this.lat = n) //add
  3793. var r = this.updateZoom()
  3794. ;(r = Math.max(this.minDistance, Math.min(this.maxDistance, r))),
  3795. this.target.add(this.panVector),
  3796. this.targetBounds.clampPoint(this.target, this.target),
  3797. (this.offset.x = r * Math.sin(n) * Math.sin(i)),
  3798. (this.offset.y = r * Math.cos(n)),
  3799. (this.offset.z = r * Math.sin(n) * Math.cos(i)),
  3800. t.copy(this.target).add(this.offset),
  3801. this.camera.lookAt(this.target),
  3802. (this.thetaDelta = 0),
  3803. (this.phiDelta = 0),
  3804. (this.scale = 1),
  3805. this.panVector.set(0, 0, 0),
  3806. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3807. }),
  3808. (n.prototype.getAutoRotationAngle = function () {
  3809. return ((2 * Math.PI) / 60 / 60) * this.autoRotateSpeed
  3810. }),
  3811. (n.prototype.getZoomScale = function () {
  3812. return Math.pow(0.95, this.zoomSpeed)
  3813. }),
  3814. (n.prototype.onMouseDown = function (e) {
  3815. if (this.enabled) {
  3816. switch ((e.preventDefault(), this.stopAutoPanning(), (this.mouseDown = !0), (this.state = this.mouseActions[e.button]), this.state)) {
  3817. case c.ROTATE:
  3818. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY), this.rotationSpeed.set(0, 0)
  3819. break
  3820. case c.DOLLY:
  3821. this.dollyStart.set(e.clientX, e.clientY)
  3822. break
  3823. case c.PAN:
  3824. this.panStart.set(e.clientX, e.clientY)
  3825. }
  3826. this.emit(d.InputStart, 'mouse')
  3827. }
  3828. }),
  3829. (n.prototype.onMouseMove = function (e) {
  3830. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3831. switch ((e.preventDefault(), this.state)) {
  3832. case c.ROTATE:
  3833. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3834. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3835. this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
  3836. this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
  3837. this.rotateStart.copy(this.rotateEnd)
  3838. break
  3839. case c.DOLLY:
  3840. this.dollyEnd.set(e.clientX, e.clientY), this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart)
  3841. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut
  3842. t.call(this), this.dollyStart.copy(this.dollyEnd)
  3843. break
  3844. case c.PAN:
  3845. this.panEnd.set(e.clientX, e.clientY), this.panDelta.subVectors(this.panEnd, this.panStart), this.pan(this.panDelta.x, this.panDelta.y), this.panStart.copy(this.panEnd)
  3846. }
  3847. this.emit(d.Move, 'mouse'), (this.lastMoveTime = e.timeStamp), this.update()
  3848. }
  3849. }),
  3850. (n.prototype.onMouseUp = function (e) {
  3851. this.enabled &&
  3852. ((this.mouseDown = !1),
  3853. (this.state = c.NONE),
  3854. 'mouseover' !== e.type &&
  3855. (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3856. this.update(),
  3857. this.rotationAcceleration.set(0, 0),
  3858. this.rotateDelta.set(0, 0)))
  3859. }),
  3860. (n.prototype.onMouseOver = function (e) {
  3861. ;(0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  3862. }),
  3863. (n.prototype.onMouseWheel = function (e) {
  3864. if (this.enabled && o.useWheel) {
  3865. this.emit(d.Move, 'wheel')
  3866. var t = e.wheelDelta || -e.detail,
  3867. i = t > 0 ? this.dollyOut : this.dollyIn
  3868. i.call(this), this.update()
  3869. }
  3870. }),
  3871. (n.prototype.onKeyDown = function (e) {
  3872. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  3873. }),
  3874. (n.prototype.navRotationAcc = function (e, t) {
  3875. 'y' === e ? (this.noRotateUpDown ? (this.keyboardZoomSpeed = t) : (this.rotationAcceleration.y = t)) : (this.rotationAcceleration.x = t)
  3876. }),
  3877. (n.prototype.navPanAcc = function (e, t) {
  3878. this.stopAutoPanning(), (this.panAcceleration[e] = t)
  3879. }),
  3880. (n.prototype.handleKeyDown = function (e) {
  3881. var t = !0
  3882. switch (e) {
  3883. case u.UPARROW:
  3884. case u.I:
  3885. this.navRotationAcc('y', 1)
  3886. break
  3887. case u.DOWNARROW:
  3888. case u.K:
  3889. this.navRotationAcc('y', -1)
  3890. break
  3891. case u.LEFTARROW:
  3892. case u.J:
  3893. this.navRotationAcc('x', -1)
  3894. break
  3895. case u.RIGHTARROW:
  3896. case u.L:
  3897. this.navRotationAcc('x', 1)
  3898. break
  3899. case u.W:
  3900. this.navPanAcc('y', 1)
  3901. break
  3902. case u.S:
  3903. this.navPanAcc('y', -1)
  3904. break
  3905. case u.A:
  3906. this.navPanAcc('x', -1)
  3907. break
  3908. case u.D:
  3909. this.navPanAcc('x', 1)
  3910. break
  3911. default:
  3912. t = !1
  3913. }
  3914. t && this.emit(d.Move, 'key')
  3915. }),
  3916. (n.prototype.onKeyUp = function (e) {
  3917. this.enabled && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  3918. }),
  3919. (n.prototype.handleKeyUp = function (e) {
  3920. switch (e) {
  3921. case u.I:
  3922. case u.K:
  3923. case u.UPARROW:
  3924. case u.DOWNARROW:
  3925. ;(this.keyboardZoomSpeed = 0), (this.rotationAcceleration.y = 0)
  3926. break
  3927. case u.J:
  3928. case u.L:
  3929. case u.LEFTARROW:
  3930. case u.RIGHTARROW:
  3931. this.rotationAcceleration.x = 0
  3932. break
  3933. case u.S:
  3934. case u.W:
  3935. this.panAcceleration.y = 0
  3936. break
  3937. case u.A:
  3938. case u.D:
  3939. this.panAcceleration.x = 0
  3940. }
  3941. }),
  3942. (n.prototype.onTouchStart = function (e) {
  3943. if (this.enabled || this.state === c.NONE) {
  3944. e.preventDefault(), e.stopPropagation(), this.stopAutoPanning()
  3945. var t = function () {
  3946. if (2 === e.touches.length) {
  3947. var t = e.touches[0].pageX - e.touches[1].pageX,
  3948. i = e.touches[0].pageY - e.touches[1].pageY
  3949. this.dollyStart.set(t, i)
  3950. }
  3951. }.bind(this),
  3952. i = function () {
  3953. this.panStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
  3954. }.bind(this),
  3955. n = function () {
  3956. this.rotateStart.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY'))
  3957. }.bind(this)
  3958. switch (((this.state = this.touchActions[e.touches.length]), this.state)) {
  3959. case c.PAN_DOLLY:
  3960. t()
  3961. case c.PAN:
  3962. i()
  3963. break
  3964. case c.ROTATE_DOLLY:
  3965. t()
  3966. case c.ROTATE:
  3967. n()
  3968. }
  3969. this.rotationSpeed.set(0, 0), this.emit(d.InputStart, 'touch')
  3970. }
  3971. }),
  3972. (n.prototype.onTouchMove = function (e) {
  3973. if (this.enabled && this.state !== c.NONE) {
  3974. e.preventDefault(), e.stopPropagation()
  3975. var t = function () {
  3976. var t = e.touches[0].pageX - e.touches[1].pageX,
  3977. i = e.touches[0].pageY - e.touches[1].pageY
  3978. this.dollyEnd.set(t, i)
  3979. var n = this.dollyStart.length() - this.dollyEnd.length()
  3980. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500), this.dollyStart.copy(this.dollyEnd)
  3981. }.bind(this),
  3982. i = function () {
  3983. this.panEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  3984. this.panDelta.subVectors(this.panEnd, this.panStart),
  3985. this.pan(this.panDelta.x, this.panDelta.y),
  3986. this.panStart.copy(this.panEnd),
  3987. this.rotateDelta.set(0, 0)
  3988. }.bind(this),
  3989. n = function () {
  3990. this.rotateEnd.set(a.average(e.touches, 'pageX'), a.average(e.touches, 'pageY')),
  3991. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3992. this.rotateLeft(((2 * Math.PI * this.rotateDelta.x) / $('#player').width()) * this.rotateSpeed),
  3993. this.rotateUp(((2 * Math.PI * this.rotateDelta.y) / $('#player').height()) * this.rotateSpeed),
  3994. this.rotateStart.copy(this.rotateEnd)
  3995. }.bind(this),
  3996. r = function () {
  3997. if (2 === e.touches.length) {
  3998. var i = window.devicePixelRatio || 1,
  3999. r = e.touches[1].pageX - e.touches[0].pageX,
  4000. s = e.touches[1].pageY - e.touches[0].pageY,
  4001. l = Math.sqrt(r * r + s * s),
  4002. h = Math.abs(this.dollyStart.length() - l)
  4003. if (h > o.input.touchMoveThreshold * i) (this.state = c.DOLLY), t()
  4004. else {
  4005. var u = a.average(e.touches, 'pageX'),
  4006. d = a.average(e.touches, 'pageY'),
  4007. p = this.rotateDelta.set(u, d).sub(this.rotateStart).length()
  4008. p > o.input.touchMoveThreshold && ((this.state = c.ROTATE), this.rotateStart.set(u, d), n())
  4009. }
  4010. }
  4011. }.bind(this)
  4012. switch (this.state) {
  4013. case c.PAN_DOLLY:
  4014. t()
  4015. case c.PAN:
  4016. i()
  4017. break
  4018. case c.ROTATE_DOLLY:
  4019. r()
  4020. break
  4021. case c.DOLLY:
  4022. t()
  4023. break
  4024. case c.ROTATE:
  4025. n()
  4026. break
  4027. default:
  4028. this.state = c.NONE
  4029. }
  4030. ;(this.lastMoveTime = e.timeStamp), this.emit(d.Move, 'touch')
  4031. }
  4032. }),
  4033. (n.prototype.onTouchEnd = function (e) {
  4034. this.enabled &&
  4035. (this.state === c.ROTATE &&
  4036. (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  4037. (this.state = c.NONE),
  4038. this.update(),
  4039. this.rotationAcceleration.set(0, 0),
  4040. this.rotateDelta.set(0, 0))
  4041. }),
  4042. (n.prototype.onPointerDown = function (e) {
  4043. this.enabled &&
  4044. ('touch' === e.pointerType &&
  4045. (this.pointers.length < this.pointersLimit &&
  4046. this.pointers.push({
  4047. id: e.pointerId,
  4048. pageX: e.pageX,
  4049. pageY: e.pageY
  4050. }),
  4051. (e.touches = this.pointers),
  4052. this.onTouchStart(e)),
  4053. this.emit(d.InputStart, 'pointer'))
  4054. }),
  4055. (n.prototype.onPointerMove = function (e) {
  4056. this.enabled &&
  4057. 'touch' === e.pointerType &&
  4058. (this.pointers.forEach(function (t) {
  4059. e.pointerId === t.id && ((t.pageX = e.pageX), (t.pageY = e.pageY))
  4060. }),
  4061. (e.touches = this.pointers),
  4062. this.onTouchMove(e))
  4063. }),
  4064. (n.prototype.onPointerUp = function (e) {
  4065. this.enabled &&
  4066. 'touch' === e.pointerType &&
  4067. (this.pointers.forEach(
  4068. function (t, i) {
  4069. e.pointerId === t.id && this.pointers.splice(i, 1)
  4070. }.bind(this)
  4071. ),
  4072. (e.touches = this.pointers),
  4073. this.onTouchEnd(e))
  4074. }),
  4075. (n.prototype.reset = function () {
  4076. ;(this.state = c.NONE), this.stopAutoPanning(), this.rotationSpeed.set(0, 0), this.rotationAcceleration.set(0, 0), this.panSpeed.set(0, 0), this.panAcceleration.set(0, 0)
  4077. }),
  4078. (n.prototype.toJSON = function () {
  4079. var e = {
  4080. camera_position: {
  4081. x: s.toPrecision(this.camera.position.x, 4),
  4082. y: s.toPrecision(this.camera.position.y, 4),
  4083. z: s.toPrecision(this.camera.position.z, 4)
  4084. },
  4085. camera_quaternion: {
  4086. x: s.toPrecision(this.camera.quaternion.x, 4),
  4087. y: s.toPrecision(this.camera.quaternion.y, 4),
  4088. z: s.toPrecision(this.camera.quaternion.z, 4),
  4089. w: s.toPrecision(this.camera.quaternion.w, 4)
  4090. }
  4091. }
  4092. return e
  4093. }),
  4094. (t.exports = n)
  4095. },
  4096. {
  4097. '../enum/ControlActions': 20,
  4098. '../enum/ControlEvents': 21,
  4099. '../enum/Keys': 30,
  4100. '../enum/MouseButton': 34,
  4101. '../enum/Vectors': 50,
  4102. '../settings': 166,
  4103. '../util/common': 185,
  4104. '../util/math': 190,
  4105. events: 202,
  4106. three: 217
  4107. }
  4108. ],
  4109. 13: [
  4110. function (e, t, i) {
  4111. ;(function (i) {
  4112. 'use strict'
  4113. function n(e) {
  4114. ;(this.camera = e),
  4115. (this.camera.controls = this),
  4116. (this.target = new r.Vector3(0, 0, 0)),
  4117. (this.lookVector = new r.Vector3()),
  4118. (this.lookSpeed = 0.05),
  4119. (this.rotationAcc = new r.Vector2()),
  4120. (this.rotationSpeed = new r.Vector2()),
  4121. (this.lat = 0),
  4122. (this.lon = 0),
  4123. (this.phi = 0),
  4124. (this.theta = 0),
  4125. (this.enabled = !1),
  4126. (this.locked = !1),
  4127. (this.pointer = new r.Vector2(0, 0)),
  4128. (this.rotationHistory = []),
  4129. (this.rotationDifference = new r.Vector2()),
  4130. (this.pointerDragOn = !1),
  4131. (this.pointerDragStart = new r.Vector2(0, 0)),
  4132. (this.pinchDistance = 0),
  4133. (this.moveStart = new r.Vector2()),
  4134. (this.moveTolerance = 0.01),
  4135. (this.pointersLimit = 2),
  4136. (this.pointers = [])
  4137. }
  4138. var r = e('three'),
  4139. o = e('../util/logger'),
  4140. a = e('../settings'),
  4141. s = e('../util/common'),
  4142. l = e('../util/math'),
  4143. c = (e('../enum/Vectors'), e('../enum/MouseButton')),
  4144. h = e('../enum/Keys'),
  4145. u = e('../enum/ControlEvents'),
  4146. d = e('events').EventEmitter
  4147. new o(i)
  4148. ;(n.prototype = Object.create(d.prototype)),
  4149. (n.prototype.usable = function () {
  4150. return this.enabled && !this.locked
  4151. }),
  4152. /* n.prototype.lookAt = function(e) {
  4153. var t = this.camera.position.clone().sub(e)
  4154. , i = Math.atan(t.z / t.x);
  4155. i += t.x < 0 ? Math.PI : 0,
  4156. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4157. this.lon = r.Math.radToDeg(i) + 180;
  4158. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4159. , o = Math.atan(t.y / n);
  4160. this.lat = -r.Math.radToDeg(o)
  4161. }
  4162. */
  4163. (n.prototype.lookAt = function (aim, dir) {
  4164. var t = dir || this.camera.position.clone().sub(aim) //aim所指点的笛卡尔坐标系
  4165. var i = Math.atan(t.z / t.x)
  4166. i += t.x < 0 ? Math.PI : 0
  4167. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0
  4168. this.lon = r.Math.radToDeg(i) + 180
  4169. var n = Math.sqrt(t.x * t.x + t.z * t.z),
  4170. o = Math.atan(t.y / n)
  4171. this.lat = -r.Math.radToDeg(o)
  4172. }),
  4173. (n.prototype.startRotationFrom = function (e, t) {
  4174. l.convertScreenPositionToNDC(e, t, this.pointer),
  4175. (this.pointerDragOn = !0),
  4176. this.pointerDragStart.copy(this.pointer),
  4177. this.moveStart.copy(this.pointer),
  4178. (this.rotationHistory = []),
  4179. this.rotationSpeed.set(0, 0)
  4180. }),
  4181. (n.prototype.onMouseOver = function (e) {
  4182. !this.pointerDragOn || (0 !== e.which && 0 !== e.buttons) || this.onMouseUp(e)
  4183. }),
  4184. (n.prototype.onTouchStart = function (e) {
  4185. if (this.usable()) {
  4186. switch ((e.preventDefault(), e.stopPropagation(), e.touches.length)) {
  4187. case 1:
  4188. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY)
  4189. break
  4190. case 2:
  4191. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4192. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height()
  4193. this.pinchDistance = Math.sqrt(t * t + i * i)
  4194. }
  4195. this.emit(u.InputStart, 'touch')
  4196. }
  4197. }),
  4198. (n.prototype.onPointerDown = function (e) {
  4199. this.usable() &&
  4200. 'touch' === e.pointerType &&
  4201. (this.pointers.length < this.pointersLimit &&
  4202. this.pointers.push({
  4203. id: e.pointerId,
  4204. clientX: e.clientX,
  4205. clientY: e.clientY
  4206. }),
  4207. (e.touches = this.pointers),
  4208. this.onTouchStart(e),
  4209. this.emit(u.InputStart, 'pointer'))
  4210. }),
  4211. (n.prototype.onMouseDown = function (e) {
  4212. if (this.usable()) {
  4213. switch ((e.preventDefault(), e.stopPropagation(), e.button)) {
  4214. case c.LEFT:
  4215. this.startRotationFrom(e.clientX, e.clientY)
  4216. }
  4217. SoundManager.pause('tour') // zeg 点击场景时停止语音
  4218. this.emit(u.InputStart, 'mouse')
  4219. }
  4220. }),
  4221. (n.prototype.updateRotation = function () {
  4222. if (this.usable() && this.pointerDragOn) {
  4223. var e = new r.Vector3(this.pointerDragStart.x, this.pointerDragStart.y, -1).unproject(this.camera),
  4224. t = new r.Vector3(this.pointer.x, this.pointer.y, -1).unproject(this.camera),
  4225. i = Math.sqrt(e.x * e.x + e.z * e.z),
  4226. n = Math.sqrt(t.x * t.x + t.z * t.z),
  4227. o = Math.atan2(e.y, i),
  4228. a = Math.atan2(t.y, n)
  4229. ;(this.rotationDifference.y = r.Math.radToDeg(o - a)), (e.y = 0), (t.y = 0)
  4230. var s = Math.acos(e.dot(t) / e.length() / t.length())
  4231. isNaN(s) || ((this.rotationDifference.x = r.Math.radToDeg(s)), this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)), this.pointerDragStart.copy(this.pointer)
  4232. }
  4233. }),
  4234. (n.prototype.onMouseMove = function (e) {
  4235. this.usable() &&
  4236. (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4237. this.pointerDragOn &&
  4238. (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) &&
  4239. this.emit(u.Move, 'mouse'))
  4240. }),
  4241. (n.prototype.onTouchMove = function (e) {
  4242. if (this.usable())
  4243. switch ((this.emit(u.Move, 'touch'), e.touches.length)) {
  4244. case 1:
  4245. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer)
  4246. break
  4247. case 2:
  4248. var t = (e.touches[0].clientX - e.touches[1].clientX) / $('#player').width(),
  4249. i = (e.touches[0].clientY - e.touches[1].clientY) / $('#player').height(),
  4250. n = this.pinchDistance - Math.sqrt(t * t + i * i)
  4251. Math.abs(n) > 0.01 && (this.emit(u.InteractionDirect), this.emit(u.Pinch, n), (this.pinchDistance -= n))
  4252. }
  4253. }),
  4254. (n.prototype.onPointerMove = function (e) {
  4255. this.usable() &&
  4256. 'touch' === e.pointerType &&
  4257. (this.pointers.forEach(function (t) {
  4258. e.pointerId === t.id && ((t.clientX = e.clientX), (t.clientY = e.clientY))
  4259. }),
  4260. (e.touches = this.pointers),
  4261. this.onTouchMove(e))
  4262. }),
  4263. (n.prototype.endRotation = function () {
  4264. this.pointerDragOn = !1
  4265. var e = s.averageVectors(this.rotationHistory)
  4266. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4267. }),
  4268. (n.prototype.onTouchEnd = function (e) {
  4269. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4270. }),
  4271. (n.prototype.onMouseUp = function (e) {
  4272. this.usable() && (e.preventDefault(), e.stopPropagation(), this.endRotation())
  4273. }),
  4274. (n.prototype.onPointerUp = function (e) {
  4275. this.usable() &&
  4276. 'touch' === e.pointerType &&
  4277. (this.pointers.forEach(
  4278. function (t, i) {
  4279. e.pointerId === t.id && this.pointers.splice(i, 1)
  4280. }.bind(this)
  4281. ),
  4282. (e.touches = this.pointers),
  4283. this.onTouchEnd(e))
  4284. }),
  4285. (n.prototype.update = function (e) {
  4286. this.lon, this.lat
  4287. for (this.updateRotation(), this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; ) this.rotationHistory.shift()
  4288. ;(this.lon += this.rotationDifference.x), (this.lat += this.rotationDifference.y), this.rotationDifference.set(0, 0)
  4289. //改
  4290. var friction = Math.min(1, a.rotationFriction * e * 60) //如果deltaTime > 1/ 60 (比较卡),就增加rotationFriction, 以防止转动过久
  4291. ;(this.rotationSpeed.x = this.rotationSpeed.x * (1 - friction) + this.rotationAcc.x * a.rotationAccelerationInside),
  4292. (this.rotationSpeed.y = this.rotationSpeed.y * (1 - friction) + this.rotationAcc.y * a.rotationAccelerationInside),
  4293. (this.lon += this.rotationSpeed.x * e),
  4294. (this.lat += this.rotationSpeed.y * e)
  4295. //this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4296. let insideLookLimitDown = this.insideLookLimitDown != void 0 ? this.insideLookLimitDown : a.insideLookLimitDown
  4297. let insideLookLimitUp = this.insideLookLimitUp != void 0 ? this.insideLookLimitUp : a.insideLookLimitUp
  4298. insideLookLimitDown = insideLookLimitDown - a.insideFOV / 2 + this.camera.fov / 2
  4299. insideLookLimitUp = insideLookLimitUp + a.insideFOV / 2 - this.camera.fov / 2
  4300. 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 );
  4301. ;(this.phi = r.Math.degToRad(90 - this.lat)),
  4302. (this.theta = r.Math.degToRad(this.lon)),
  4303. (this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta)),
  4304. (this.lookVector.y = Math.cos(this.phi)),
  4305. (this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta)),
  4306. this.target.copy(this.lookVector).add(this.camera.position),
  4307. this.camera.lookAt(this.target)
  4308. }),
  4309. (n.prototype.onMouseWheel = function (e) {
  4310. if (this.usable()) {
  4311. var t = e.wheelDelta || -e.detail
  4312. this.emit(u.InteractionDirect), this.emit(u.Scroll, t)
  4313. }
  4314. }),
  4315. (n.prototype.onKeyDown = function (e) {
  4316. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(), this.handleKeyDown(e.which)))
  4317. }),
  4318. (n.prototype.handleKeyDown = function (e) {
  4319. var t = function (e, t) {
  4320. this.rotationAcc[e] = t
  4321. }.bind(this)
  4322. this.emit(u.InteractionKey)
  4323. var i = !0
  4324. switch (e) {
  4325. case h.LEFTARROW:
  4326. case h.J:
  4327. t('x', -1)
  4328. break
  4329. case h.RIGHTARROW:
  4330. case h.L:
  4331. t('x', 1)
  4332. break
  4333. case h.I:
  4334. t('y', 1)
  4335. break
  4336. case h.K:
  4337. t('y', -1)
  4338. break
  4339. default:
  4340. i = !1
  4341. }
  4342. i && this.emit(u.Move, 'key')
  4343. }),
  4344. (n.prototype.onKeyUp = function (e) {
  4345. this.usable() && (e.preventDefault(), e.stopPropagation(), this.handleKeyUp(e.which))
  4346. }),
  4347. (n.prototype.handleKeyUp = function (e) {
  4348. switch (e) {
  4349. case h.LEFTARROW:
  4350. case h.J:
  4351. case h.RIGHTARROW:
  4352. case h.L:
  4353. this.rotationAcc.x = 0
  4354. break
  4355. case h.I:
  4356. case h.K:
  4357. this.rotationAcc.y = 0
  4358. }
  4359. }),
  4360. (n.prototype.startRotating = function (e, t) {
  4361. e && (this.rotationAcc.x = e), t && (this.rotationAcc.y = t)
  4362. }),
  4363. (n.prototype.stopRotating = function (e) {
  4364. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0), this.rotationAcc.set(0, 0)
  4365. }),
  4366. (n.prototype.reset = function () {
  4367. ;(this.pointerDragOn = !1), this.rotationAcc.set(0, 0), this.rotationSpeed.set(0, 0), (this.pointers = [])
  4368. }),
  4369. (n.prototype.toJSON = function () {
  4370. var e = {
  4371. camera_position: {
  4372. x: l.toPrecision(this.camera.position.x, 4),
  4373. y: l.toPrecision(this.camera.position.y, 4),
  4374. z: l.toPrecision(this.camera.position.z, 4)
  4375. },
  4376. camera_quaternion: {
  4377. x: l.toPrecision(this.camera.quaternion.x, 4),
  4378. y: l.toPrecision(this.camera.quaternion.y, 4),
  4379. z: l.toPrecision(this.camera.quaternion.z, 4),
  4380. w: l.toPrecision(this.camera.quaternion.w, 4)
  4381. }
  4382. }
  4383. return e
  4384. }),
  4385. (n.prototype.setStateFromJSON = function (e) {
  4386. this.camera.position.copy(e.camera_position), this.camera.quaternion.copy(e.camera_quaternion)
  4387. }),
  4388. (t.exports = n)
  4389. }).call(this, '/js/controls/PanoramaControls.js')
  4390. },
  4391. {
  4392. '../enum/ControlEvents': 21,
  4393. '../enum/Keys': 30,
  4394. '../enum/MouseButton': 34,
  4395. '../enum/Vectors': 50,
  4396. '../settings': 166,
  4397. '../util/common': 185,
  4398. '../util/logger': 189,
  4399. '../util/math': 190,
  4400. events: 202,
  4401. three: 217
  4402. }
  4403. ],
  4404. 14: [
  4405. function (e, t, i) {
  4406. ;(function (i) {
  4407. 'use strict'
  4408. var n = e('three'),
  4409. r = e('../enum/Viewmode'),
  4410. o = e('../util/logger'),
  4411. a = new o(i)
  4412. t.exports = {
  4413. serialize: function (e) {
  4414. return encodeURI(JSON.stringify(e))
  4415. },
  4416. deserialize: function (e) {
  4417. function t(e) {
  4418. function t(e, t) {
  4419. return e && 'number' == typeof t && !isNaN(t)
  4420. }
  4421. return e.reduce(t, !0)
  4422. }
  4423. try {
  4424. var i = JSON.parse(decodeURI(e)),
  4425. o = {
  4426. mode: r.fromInt(i.camera_mode),
  4427. panoId: i.scan_id,
  4428. position: new n.Vector3().copy(i.camera_position),
  4429. quaternion: new n.Quaternion().copy(i.camera_quaternion),
  4430. zoom: i.ortho_zoom,
  4431. floorVisibility: i.floor_visibility
  4432. },
  4433. s = o.position
  4434. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0)
  4435. var l = o.quaternion
  4436. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1), o
  4437. } catch (i) {
  4438. a.debug('Not able to parse start location as JSON; falling back to old array style parsing')
  4439. try {
  4440. var c = e.split(','),
  4441. h = {
  4442. x: parseFloat(c[2]),
  4443. y: parseFloat(c[3]),
  4444. z: parseFloat(c[4])
  4445. },
  4446. u = {
  4447. x: parseFloat(c[5]),
  4448. y: parseFloat(c[6]),
  4449. z: parseFloat(c[7]),
  4450. w: parseFloat(c[8])
  4451. }
  4452. return (
  4453. t([h.x, h.y, h.z]) || ((h.x = 0), (h.y = 0), (h.z = 0)),
  4454. t([u.x, u.y, u.z, u.w]) || ((u.x = 0), (u.y = 0), (u.z = 0), (u.w = 1)),
  4455. {
  4456. mode: r.fromInt(c[0]),
  4457. panoId: c[1],
  4458. position: new n.Vector3().copy(h),
  4459. quaternion: new n.Quaternion().copy(u)
  4460. }
  4461. )
  4462. } catch (t) {
  4463. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4464. }
  4465. }
  4466. return null
  4467. }
  4468. }
  4469. }).call(this, '/js/controls/serializer.js')
  4470. },
  4471. {
  4472. '../enum/Viewmode': 51,
  4473. '../util/logger': 189,
  4474. three: 217
  4475. }
  4476. ],
  4477. 15: [
  4478. function (e, t, i) {
  4479. ;(function (i) {
  4480. 'use strict'
  4481. function n() {
  4482. ;(this.endlessLoop = a.warp.loop),
  4483. (this.clock = new r.Clock(!0)),
  4484. (this.model = null),
  4485. (this.player = null),
  4486. (this.currentItem = null),
  4487. (this.destinationItem = null),
  4488. (this.tourIsPlaying = !1),
  4489. (this.transitionStage = y.None),
  4490. (this.nextFunc = null),
  4491. (this.onTheBus = !1),
  4492. (this.tourInProgress = !1),
  4493. (this.reachSource = null),
  4494. (this.interrupted = !1),
  4495. (this.nItems = 0),
  4496. (this.walkingSectionPaused = !1)
  4497. }
  4498. var r = e('three'),
  4499. o = e('./util/logger'),
  4500. a = e('./settings'),
  4501. s = e('./util/transitions'),
  4502. l = e('events').EventEmitter,
  4503. c = e('./enum/Viewmode'),
  4504. h = e('./analytics'),
  4505. u = e('./enum/WarpStyle'),
  4506. s = e('./util/transitions'),
  4507. d = (e('./model/ModelManager'), e('./enum/ModelManagerEvents')),
  4508. p = e('./enum/DirectorEvents'),
  4509. f = e('./enum/PlayerEvents'),
  4510. g = (e('./enum/ControlEvents'), e('./enum/BlackoutStyle')),
  4511. m = e('./enum/PathDiscardMode'),
  4512. v = e('./enum/PathDisplayMode'),
  4513. A = (e('./player'), new o(i)),
  4514. y = Object.freeze({
  4515. None: 0,
  4516. Moving: 1,
  4517. Aiming: 2,
  4518. Interlude: 3
  4519. }),
  4520. C = Object.freeze({
  4521. Forward: 1,
  4522. NoChange: 0,
  4523. Backwards: -1
  4524. }),
  4525. I = s.getUniqueId()
  4526. ;(n.prototype = Object.create(l.prototype)),
  4527. (n.prototype.init = function (e, t) {
  4528. ;(this.player = e), (this.modelManager = t), this.updateModel(), this.resetAll(), this.bindEvents()
  4529. // // zeg 查询pano对应的导览片段
  4530. // if(!this.panoIdMap) {
  4531. // this.panoIdMap = new Map()
  4532. // this.model.heroLocations.forEach( (value, index) => {
  4533. // // value.heroLocations.forEach( hl => {
  4534. // if(!value.heroLocations) return
  4535. // let hl = value.heroLocations[0]
  4536. // let arr = this.panoIdMap.get(hl.panoId)
  4537. // if(arr){
  4538. // this.panoIdMap.set(hl.panoId, [...arr, index])
  4539. // } else {
  4540. // this.panoIdMap.set(hl.panoId, [index])
  4541. // }
  4542. // // })
  4543. // })
  4544. // }
  4545. }),
  4546. (n.prototype.resetAll = function () {
  4547. if (
  4548. ((this.currentItem = null),
  4549. (this.destinationItem = null),
  4550. (this.tourIsPlaying = !1),
  4551. //this.bgmReplay(),//xzw
  4552. (this.transitionStage = y.None),
  4553. (this.nextFunc = null),
  4554. (this.onTheBus = !1),
  4555. (this.reachSource = null),
  4556. (this.interrupted = !1),
  4557. this.model)
  4558. ) {
  4559. var e = a.path.typ === u.WALK ? u.WALK : u.STD
  4560. this.defaultWarpStyle = this.model.data.hasOwnProperty('player_options') && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4561. } else (this.defaultWarpStyle = u.BLACK), A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions')
  4562. this.resetSpecialTransition()
  4563. }),
  4564. (n.prototype.updateModel = function () {
  4565. ;(this.model = this.modelManager.getActiveModel()), (this.nItems = this.model.heroLocations.length)
  4566. }),
  4567. (n.prototype.bindEvents = function () {
  4568. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4569. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4570. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4571. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4572. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4573. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4574. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4575. this.player.once(f.Move, function () {
  4576. s.cancelById(I)
  4577. })
  4578. }),
  4579. (n.prototype.checkAndHandleWalkingtourInterruption = function (e) {
  4580. //快速停止。 改:去掉判断nextWarpStyle,因为这个属性改乱了,导致点击停止按钮不执行
  4581. return /* e === u.WALK && ( */ this.interrupt(g.NONE), this.pauseWalkingSection(), this.player.fastForwardActivePanoFlight(), !0 /* ) */
  4582. }),
  4583. (n.prototype.handlePlayerMove = function (e) {
  4584. this.transitionStage === y.Interlude && this.interrupt(g.NONE), this.emit('update.controls')
  4585. }),
  4586. (n.prototype.handlePlayerPanoChosen = function (e, t) {
  4587. this.intermediateState() || e.id === t.id || ((this.onTheBus = !1), this.emit('update.controls'))
  4588. }),
  4589. (n.prototype.handlePlayerModeChanged = function (e, t) {
  4590. this.intermediateState() || e === t || ((this.onTheBus = !1), this.emit('update.controls'))
  4591. }),
  4592. (n.prototype.handlePlayerInputStart = function (e) {
  4593. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4594. }),
  4595. (n.prototype.handlePlayerFlyingStarted = function () {
  4596. this.clearWalkingSectionPaused()
  4597. }),
  4598. (n.prototype.describe = function () {
  4599. return {
  4600. nItems: this.nItems,
  4601. currentItem: this.currentItem,
  4602. destinationItem: this.destinationItem,
  4603. tourIsPlaying: this.tourIsPlaying,
  4604. onTheBus: this.onTheBus,
  4605. endlessLoop: this.endlessLoop,
  4606. viewMode: this.player.mode,
  4607. inTransition: this._inTransition(),
  4608. transitionStage: this.transitionStage,
  4609. tourInProgress: this.tourInProgress
  4610. }
  4611. }),
  4612. (n.prototype._inTransition = function () {
  4613. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4614. }),
  4615. (n.prototype.bounceable = function () {
  4616. var e = this.clock.getDelta()
  4617. return this.isInterrupted() || (e < 0.9 && e > 0.01) || (this.player.flying && !this.player.isWarping())
  4618. }),
  4619. (n.prototype.itemCompare = function (item1, item2, type) {
  4620. //add
  4621. if (type == 'equal') {
  4622. //==
  4623. return item1 && item2 && item1[0] == item2[0] && item1[1] == item2[1]
  4624. } else if (type == 'less') {
  4625. //<
  4626. return (item1 && item2 && item1[0] < item2[0]) || (item1[0] == item2[0] && item1[1] < item2[1])
  4627. }
  4628. })
  4629. ;(n.prototype.currentMoveDirection = function () {
  4630. //return null === this.currentItem || void 0 === this.currentItem ? y.Forward : this.destinationItem === this.currentItem ? y.NoChange : this.destinationItem > this.currentItem ? y.Forward : y.Backwards
  4631. return null === this.currentItem || void 0 === this.currentItem
  4632. ? y.Forward
  4633. : this.itemCompare(this.destinationItem, this.currentItem, 'equal')
  4634. ? y.NoChange
  4635. : this.itemCompare(this.currentItem, this.destinationItem, 'less')
  4636. ? y.Forward
  4637. : y.Backwards
  4638. }),
  4639. (n.prototype.clearPath = function () {
  4640. this._inTransition() || this.player.path.discardPathObject()
  4641. }),
  4642. (n.prototype.allFloors = function () {
  4643. this.model.toggleAllFloors()
  4644. }),
  4645. (n.prototype.actionComplete = function (e) {
  4646. if (
  4647. ((this.interrupted = !1),
  4648. (this.transitionStage = y.None),
  4649. this.resetSpecialTransition(),
  4650. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4651. this.tourIsPlaying || (this.player.disablePreRendering(), this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4652. this.emit('update.controls'),
  4653. this.nextFunc)
  4654. ) {
  4655. var t = this.nextFunc
  4656. ;(this.nextFunc = null), t()
  4657. }
  4658. }),
  4659. (n.prototype.awaitCompletion = function (e, t) {
  4660. ;(this.nextFunc = t), e()
  4661. }),
  4662. (n.prototype.updateSuccessFunction = function (e) {
  4663. this.nextFunc = e
  4664. }),
  4665. (n.prototype.interrupt = function (e, t) {
  4666. //滑动屏幕或按下键盘等
  4667. return (
  4668. !!this.wouldInterrupt() &&
  4669. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4670. (this.tourIsPlaying = !1),
  4671. //this.bgmReplay(),//xzw
  4672. (this.interrupted = !0),
  4673. (this.nextFunc = null),
  4674. this.emit(p.ActionInterrupted),
  4675. (null !== e && void 0 !== e) || (e = g.BEGINNING),
  4676. this.player.interruptAndFastForward(e, t),
  4677. !0)
  4678. )
  4679. }),
  4680. (n.prototype.wouldInterrupt = function () {
  4681. return this.transitionStage !== y.None
  4682. }),
  4683. (n.prototype.intermediateState = function () {
  4684. return this.transitionStage !== y.None
  4685. }),
  4686. (n.prototype.isInterrupted = function () {
  4687. return this.interrupted
  4688. }),
  4689. (n.prototype.pauseWalkingSection = function () {
  4690. this.walkingSectionPaused = !0
  4691. }),
  4692. (n.prototype.clearWalkingSectionPaused = function () {
  4693. this.walkingSectionPaused = !1
  4694. }),
  4695. (n.prototype.autoTour = function () {
  4696. var e = Date.now()
  4697. this.model.auxDataPromise.then(
  4698. function () {
  4699. e = Date.now() - e
  4700. var t = a.warp.auto,
  4701. i = this.model.data && this.model.data.player_options /* && this.model.data.player_options.highlight_reel */
  4702. t >= 0 &&
  4703. this.model.heroCount() > 1 &&
  4704. i &&
  4705. s.trigger({
  4706. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4707. done: function () {
  4708. this.playTour()
  4709. }.bind(this),
  4710. name: '_atr',
  4711. id: I
  4712. })
  4713. }.bind(this)
  4714. )
  4715. }),
  4716. (n.prototype.atDestinationPano = function (pano) {
  4717. if (null === this.destinationItem) return !1
  4718. pano = pano || this.player.currentPano
  4719. if (!pano) {
  4720. return !1
  4721. }
  4722. var destination = this.destinationItem && this.model.getHeroDescriptorByIndex(this.destinationItem)
  4723. return destination && destination.panoId == pano.id
  4724. }),
  4725. (n.prototype.redirectToItem = function (e, t) {
  4726. if (null === e || void 0 === e) return void A.warn('Director.redirectToItem() -> Redirecting to null item.')
  4727. if (!this.wouldInterrupt()) return void A.warn('Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.')
  4728. if (this.player.mode === c.TRANSITIONING) return void A.debug('Director.redirectToItem() -> Cannot redirect while transitioning.')
  4729. A.debug('Director.redirectToItem() -> Redirecting to ' + e + ' via ' + t)
  4730. var i = function () {
  4731. s.setTimeout(
  4732. function () {
  4733. this.setDestinationItem(e), this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4734. }.bind(this),
  4735. 0
  4736. )
  4737. }.bind(this)
  4738. this.interrupt(g.END, 0), this.updateSuccessFunction(i)
  4739. }),
  4740. (n.prototype.useSpecialTransition = function (e) {
  4741. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug('useSpecialTransition(): ' + e), (this.nextWarpStyle = u.BLACK)
  4742. }),
  4743. (n.prototype.resetSpecialTransition = function () {
  4744. this.nextWarpStyle = this.defaultWarpStyle
  4745. }),
  4746. (n.prototype.arrivedAtDestination = function (e) {
  4747. if (this.player.flying || this.player.isWarping()) A.warn('Cannot advance to interlude or aiming while player is flying or warping.')
  4748. else {
  4749. this.transitionStage = y.Aiming
  4750. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null
  4751. this.player.model.fadePanoMarkers(0),
  4752. this.awaitCompletion(
  4753. function () {
  4754. this.resetSpecialTransition(), e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4755. }.bind(this),
  4756. t
  4757. )
  4758. }
  4759. }),
  4760. (n.prototype.goToDestination = function (e, t, i, n) {
  4761. //音频
  4762. var musicInfo = this.model.heroLocations[this.destinationItem[0]].musicInfo
  4763. // zeg 手动导览不播放音频
  4764. if (musicInfo && musicInfo.music && !e) {
  4765. let musicType = localStorage.getItem('xunirole') || 'male'
  4766. let isMale = musicType.indexOf('female') < 0
  4767. let fixMusic = isMale ? musicInfo.music : musicInfo.fmusic || musicInfo.music
  4768. // let src = musicInfo.music.includes(g_Prefix.slice(-10)) ? musicInfo.music : g_Prefix + musicInfo.music;
  4769. let src = fixMusic
  4770. let audioObj = SoundManager.list.find(e => e.name == 'tour')
  4771. let audioSrc1 = common.getFileNameFromUrl(audioObj.src)
  4772. let audioSrc2 = common.getFileNameFromUrl(src)
  4773. if (audioSrc1 == audioSrc2) {
  4774. //应该是继续播放该folder
  4775. if (this.destinationItem[1] == 0) {
  4776. //从头开始播放 因为可能暂停后然后再点该缩略图播
  4777. SoundManager.play('tour', null, 0) // currentTime = 0;
  4778. } else if (audioObj.audio.paused && audioObj.audio.currentTime < audioObj.audio.duration) {
  4779. //未播完
  4780. SoundManager.play('tour') //继续播。为什么会有暂停的情况?如果手动切换到bgm了呢?
  4781. }
  4782. } else {
  4783. //很可能是该folder的起始
  4784. SoundManager.play('tour', manage.dealURL(src))
  4785. }
  4786. }
  4787. let oldPos = this.player.position.clone()
  4788. let oldPano = this.player.currentPano
  4789. if (((this.onTheBus = !0), this.emit('update.controls'), this.player.updateLastView(), !n && this.atDestinationPano())) {
  4790. /*
  4791. // 原地旋转时, 写到_warpCameraAim里,因那有时间
  4792. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4793. if(r.zoom && r.zoom != this.player.zoomLevel){//add
  4794. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4795. } */
  4796. return void this.arrivedAtDestination(!0)
  4797. }
  4798. if (this.player.flying || this.player.isWarping()) A.warn('Cannot go to new destination while player is flying or warping.')
  4799. else {
  4800. var r = this.model.getHeroDescriptorByIndex(this.destinationItem),
  4801. o = null,
  4802. a1 = null
  4803. if (r.isPano()) {
  4804. //var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4805. //var walk = window.DATA.black ? 'black' : 'walk';
  4806. //若是点击item,直接瞬间过渡。
  4807. var s = e ? 'black' : this.getMomentTour(this.destinationItem) //window.DATA.momentTour || "walk";
  4808. if (this.destinationItem[0] == 0 && this.destinationItem[1] == 0)
  4809. s = 'black' // 周恩光加 返回最初导览点是瞬间过渡
  4810. ;(a1 = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, true, i, this.actionComplete.bind(this))),
  4811. (o = this.arrivedAtDestination.bind(this, !0))
  4812. if (s == 'black' && r.zoom && r.zoom != this.player.zoomLevel) {
  4813. //add
  4814. this.player.smoothZoomFovTo(null, r.zoom, a.warp.teleportTime) //瞬间过渡的时间
  4815. }
  4816. } else {
  4817. ;(a1 = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this))), (o = this.arrivedAtDestination.bind(this, !1))
  4818. }
  4819. ;(this.transitionStage = y.Moving),
  4820. this.model.fadePanoMarkers(0),
  4821. this.awaitCompletion(
  4822. function () {
  4823. a1()
  4824. }.bind(this),
  4825. o
  4826. ),
  4827. this.emit('update.controls')
  4828. }
  4829. }),
  4830. (n.prototype.tourInterlude = function () {
  4831. if (
  4832. (h.trackAlways('reach_highlight', {
  4833. reach_source: this.reachSource
  4834. }),
  4835. this.model.fadePanoMarkers(0),
  4836. this.emit('update.controls'),
  4837. this.tourIsPlaying)
  4838. )
  4839. return this.atEndOfTour() && !this.endlessLoop
  4840. ? ((this.tourInProgress = !1),
  4841. void this.awaitCompletion(
  4842. function () {
  4843. ;(this.transitionStage = y.Interlude), this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4844. }.bind(this),
  4845. function () {
  4846. ;(this.currentItem = [0, 0]), this.stopTour(true), this.emit(p.TourEnd)
  4847. }.bind(this)
  4848. ),
  4849. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity)))
  4850. : void this.awaitCompletion(
  4851. function () {
  4852. ;(this.transitionStage = y.Interlude), this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4853. }.bind(this),
  4854. this.goNext.bind(this)
  4855. )
  4856. }),
  4857. (n.prototype.findNearestItem = function (endToStart = true) {
  4858. //找到离currentPano最近的导览
  4859. /* if(this.atDestinationPano(this.player.currentPano)){//在终点直接从头。但有的场景可能不希望如此,就想跳到所属的展区开始。
  4860. return [0,0] //2023.7.7发现在点击item后播放会从头开始
  4861. } */
  4862. //注:没有判断此刻是否在panorama模式,就使用currentPano
  4863. var result = { item: [0, 0], dis: Infinity }
  4864. var compare = (location, item) => {
  4865. if (location.panoId != void 0 && location.panoId != 'outside') {
  4866. var pano = this.model.panos.index[location.panoId]
  4867. var dis = pano.position.distanceTo(this.player.currentPano.position)
  4868. if (dis < result.dis) {
  4869. ;(result.item = item), (result.dis = dis)
  4870. } else if (dis == result.dis) {
  4871. //如果两个位置相同,优先播放在导览条上离激活的最近的那段导览
  4872. /* if(this.itemCompare(item, this.currentItem, 'equal')){
  4873. result.item = item, result.dis = dis
  4874. } */
  4875. if (this.currentItem && Math.abs(item[0] - this.currentItem[0]) < Math.abs(result.item[0] - this.currentItem[0])) {
  4876. ;(result.item = item), (result.dis = dis)
  4877. }
  4878. }
  4879. }
  4880. }
  4881. this.model.heroLocations.forEach((e, i) => {
  4882. if (e.heroLocations) {
  4883. /* e.heroLocations.forEach((a,j)=>{
  4884. compare(a, [i,j])
  4885. }) */
  4886. var location = e.heroLocations.find(e => e.panoId != void 0)
  4887. location && compare(location, [i, 0]) //跳到此区域开头
  4888. } else {
  4889. compare(e, [i, 0])
  4890. }
  4891. })
  4892. if (endToStart && this.atEndOfTour(result.item)) {
  4893. //如果是最后一个点,直接跳到开头,否则导览开始就在终点的话不会从头开始
  4894. return [0, 0] //但注意最后是区域的话result.item是区域开头,除非站在最末最末尾的位置,上面的atDestinationPano直接返回
  4895. }
  4896. return result.item
  4897. })
  4898. n.prototype.playTour = function () {
  4899. if (!this.bounceable() && this.model.heroLocations.length) {
  4900. // ------------这部分处理逻辑目前已由playTourNearBy()取代------------------------------------
  4901. // if(!this.currentItem) this.currentItem = []
  4902. // if(this.currentItem[0] != 0 || this.destinationItem[0]!= this.nItems-1){
  4903. // // zeg 从当前pano进行自动导览
  4904. // let currentPanoDestinations = this.panoIdMap.get(this.player.currentPano.id)
  4905. // // this.model.heroLocations.forEach( (value, index) => {
  4906. // // if(value.heroLocations.find( hl => hl.panoId == this.player.currentPano.id )) {
  4907. // // currentPanoDestinations.push(index)
  4908. // // }
  4909. // // })
  4910. // if(!currentPanoDestinations) {
  4911. // // let panoIndex = this.model.panos.list.findIndex( pano => pano.id == this.player.currentPano.id )
  4912. // let panoIndex = this.model.panos.list.indexOf( this.player.currentPano )
  4913. // let neighbourIndex = [ panoIndex + 1, panoIndex - 1, panoIndex + 2, panoIndex - 2, panoIndex + 3, panoIndex - 3 ]
  4914. // for(var i = 0; i < neighbourIndex.length; i++) {
  4915. // currentPanoDestinations = this.panoIdMap.get(this.model.panos.list[neighbourIndex[i]]&&this.model.panos.list[neighbourIndex[i]].id)
  4916. // if(currentPanoDestinations && currentPanoDestinations[0] != 0) break
  4917. // }
  4918. // if(!currentPanoDestinations) currentPanoDestinations = [0];
  4919. // }
  4920. // if(currentPanoDestinations.indexOf(this.currentItem[0]) == -1) {
  4921. // this.currentItem[0] = currentPanoDestinations[0]
  4922. // }
  4923. // }
  4924. return this.tourIsPlaying
  4925. ? void A.info('tour is already playing')
  4926. : void (
  4927. this.wouldInterrupt() ||
  4928. (this.player.emit('tour_auto', this.defaultWarpStyle),
  4929. (this.tourInProgress = !0),
  4930. (this.reachSource = 'play'),
  4931. (this.tourIsPlaying = !0),
  4932. (this.wasZoomEnabled = this.player.zoomEnabled),
  4933. (this.player.zoomEnabled = !1),
  4934. this.resetSpecialTransition(),
  4935. this.emit('update.controls'),
  4936. this.emit(p.TourStart),
  4937. this.player.enablePreRendering(),
  4938. // this.currentItem[1] = null,
  4939. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(), this.goToDestination()) : /* this.goNext() */ (this.tourAdvance(0), this.goToDestination()))
  4940. ) //xzw: 不要直接跳到下一个点开始,从当前点开始,否则当一段区域内只有一个导览时播放会立刻跳到下一个缩略图进行。
  4941. }
  4942. }
  4943. ;(n.prototype.playTourNearBy = function () {
  4944. //就近导览
  4945. if (!this.bounceable()) {
  4946. return this.tourIsPlaying
  4947. ? void A.info('tour is already playing')
  4948. : void (
  4949. this.wouldInterrupt() ||
  4950. (this.player.emit('tour_auto', this.defaultWarpStyle),
  4951. (this.tourInProgress = !0),
  4952. (this.reachSource = 'play'),
  4953. (this.tourIsPlaying = !0),
  4954. (this.wasZoomEnabled = this.player.zoomEnabled),
  4955. (this.player.zoomEnabled = !1),
  4956. this.resetSpecialTransition(),
  4957. this.emit('update.controls'),
  4958. this.emit(p.TourStart),
  4959. this.player.enablePreRendering(),
  4960. /* this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4961. this.goToDestination()) : this.goNext())) */
  4962. this.setDestinationItem(this.findNearestItem()),
  4963. this.goToDestination())
  4964. )
  4965. }
  4966. }),
  4967. /* n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4968. } */
  4969. (n.prototype.stopTour = function (isAutoStop) {
  4970. //停止导览 isAutoStop 希望仅在飞完结束自动停止时的stopTour不停止tourSound, 这样才能完整播放tourSound. 不过似乎会在倒数第二个片段点击按钮停止导览时也视作自动结束的(执行this.interrupt() )。
  4971. SoundManager.pause('tour'), // zeg 自动导览暂停时同时停止语音
  4972. this.isInterrupted() ||
  4973. (this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle)) ||
  4974. (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4975. (this.tourIsPlaying = !1),
  4976. this.interrupt(),
  4977. this.clearWalkingSectionPaused(),
  4978. this.resetSpecialTransition(),
  4979. this.emit('update.controls'))
  4980. }),
  4981. (n.prototype.endTourProgress = function () {
  4982. ;(this.tourInProgress = !1), this.emit('update.controls'), this.emit(p.TourEnd)
  4983. }),
  4984. (n.prototype.goToHighlight = function (e) {
  4985. if (this.wouldInterrupt()) this.itemCompare(this.destinationItem, e, 'equal') ? this.interrupt() : this.redirectToItem(e, 'goToHighlight')
  4986. else {
  4987. if ((A.debug('<tour.goto ' + e + '>'), this.isInterrupted())) return
  4988. this.clearWalkingSectionPaused(), this.setDestinationItem(e), this.useSpecialTransition('Hilight')
  4989. this.goToDestination(true), //add true
  4990. h.trackAlways('reach_highlight', {
  4991. reach_source: 'thumb'
  4992. })
  4993. }
  4994. }),
  4995. (n.prototype.prevHighlight = function () {
  4996. this.bounceable() ||
  4997. (this.player.emit('tour_manual', 'prev'), this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'prev'), this.goPrev()))
  4998. }),
  4999. (n.prototype.nextHighlight = function () {
  5000. this.bounceable() ||
  5001. (this.player.emit('tour_manual', 'next'), this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(), (this.reachSource = 'next'), this.goNext()))
  5002. }),
  5003. (n.prototype.changeMode = function (e) {
  5004. var t = $.Deferred(),
  5005. i = t.resolve.bind(t),
  5006. n = t.reject.bind(t)
  5007. this.emit(p.StartModeChange)
  5008. var r = function () {
  5009. return this.clearWalkingSectionPaused(), !!this.wouldInterrupt() && (this.interrupt(), !0)
  5010. }.bind(this)
  5011. if (!r()) {
  5012. switch (e) {
  5013. case c.PANORAMA:
  5014. this.player.mode === c.PANORAMA
  5015. ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n)
  5016. : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n)
  5017. break
  5018. case c.DOLLHOUSE:
  5019. case c.FLOORPLAN:
  5020. this.player
  5021. .flyToNewMode({
  5022. mode: e
  5023. })
  5024. .done(i)
  5025. .fail(n)
  5026. break
  5027. case c.OUTDOOR:
  5028. this.player.model.has360Views &&
  5029. (this.player.mode !== c.PANORAMA || (this.player.mode === c.PANORAMA && this.player.currentPano.isAligned())) &&
  5030. this.player.goToLastView(!1).done(i).fail(n)
  5031. }
  5032. return t.promise()
  5033. }
  5034. }),
  5035. (n.prototype.atEndOfTour = function (currentItem = this.currentItem) {
  5036. var end = currentItem && currentItem[0] >= this.nItems - 1
  5037. if (end) {
  5038. var heroLocations = this.model.heroLocations[this.nItems - 1].heroLocations
  5039. if (heroLocations) {
  5040. end = currentItem[1] >= heroLocations.length - 1
  5041. }
  5042. }
  5043. return end
  5044. }),
  5045. (n.prototype.firstDestination = function () {
  5046. //return 0 < this.nItems ? 0 : null
  5047. return 0 < this.nItems ? [0, 0] : null
  5048. }),
  5049. (n.prototype.finalDestination = function () {
  5050. //return 0 < this.nItems ? this.nItems - 1 : null
  5051. return 0 < this.nItems ? [this.nItems - 1, 0] : null
  5052. }),
  5053. (n.prototype.goPrev = function () {
  5054. this.tourAdvance(-1)
  5055. }),
  5056. (n.prototype.goNext = function () {
  5057. this.tourAdvance(1)
  5058. }),
  5059. (n.prototype.setDestinationItem = function (e) {
  5060. ;(this.destinationItem = e), this.emit('update.controls')
  5061. }),
  5062. (n.prototype.setCurrentItem = function (e) {
  5063. ;(this.currentItem = e), this.emit('update.controls')
  5064. }),
  5065. (n.prototype.nextItem = function (currentItem) {
  5066. //return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  5067. if (currentItem == void 0) return this.firstDestination()
  5068. var currentLocation = this.model.heroLocations[currentItem[0]]
  5069. var currentChildNum = currentLocation.heroLocations ? currentLocation.heroLocations.length : 1
  5070. var item
  5071. if (this.currentItem[1] >= currentChildNum - 1) {
  5072. //子目录中最后一个
  5073. item = [currentItem[0] + 1, 0] //结果可能超出nItems
  5074. } else {
  5075. item = [currentItem[0], currentItem[1] + 1]
  5076. }
  5077. if (item[0] >= this.nItems) {
  5078. item = this.firstDestination()
  5079. }
  5080. return item
  5081. //暂时不理会endlessLoop,默认为false
  5082. }),
  5083. (n.prototype.prevItem = function (currentItem) {
  5084. //return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  5085. if (currentItem == void 0) return this.firstDestination()
  5086. var item
  5087. var lastLocation = this.model.heroLocations[currentItem[0] - 1]
  5088. if (!lastLocation) return this.finalDestination() //[-1, 0]//this.setDestinationItem([-1, 0]) //结果小于0
  5089. else {
  5090. var lastChildNum = lastLocation.heroLocations ? lastLocation.heroLocations.length : 1
  5091. if (this.currentItem[1] == 0) {
  5092. //子目录中第一个
  5093. return [currentItem[0] - 1, lastChildNum - 1]
  5094. } else {
  5095. return [currentItem[0], currentItem[1] - 1]
  5096. }
  5097. }
  5098. }),
  5099. (n.prototype.tourAdvance = function (e) {
  5100. //e是1或-1 或 0
  5101. A.debug('tourAdvance(' + e + ')')
  5102. // // zeg改
  5103. if (null === this.currentItem || void 0 === this.currentItem) {
  5104. // this.setDestinationItem(this.firstDestination())
  5105. // this.setDestinationItem([currentPanoDestinations[0], 0])
  5106. this.setDestinationItem([this.currentItem[0], 0])
  5107. }
  5108. // else if(this.currentItem[1] == null) {
  5109. // this.setDestinationItem([this.currentItem[0], 0])
  5110. // }
  5111. else {
  5112. var item = this.currentItem
  5113. if (e == 1) {
  5114. item = this.nextItem(this.currentItem)
  5115. } else if (e == -1) {
  5116. item = this.prevItem(this.currentItem)
  5117. }
  5118. this.setDestinationItem(item)
  5119. }
  5120. if (this.itemCompare(this.destinationItem, this.finalDestination(), 'equal')) {
  5121. this.useSpecialTransition('reverse-looping to end')
  5122. } else if (this.itemCompare(this.destinationItem, this.firstDestination(), 'equal')) {
  5123. this.useSpecialTransition('looping back to start')
  5124. }
  5125. /* var momentTour = this.getMomentTour(this.destinationItem);
  5126. if ( "black" === momentTour) { // 方奕卓 瞬间过渡, 相机缩放至1
  5127. var zoomLevel = this.player.zoomLevel;
  5128. this.player.zoomEnabled = true;
  5129. var zoom = function(e, d) {
  5130. this.player.zoomTo((1-e)*zoomLevel, true)
  5131. }.bind(this)
  5132. s.start(zoom, 1500, function(){
  5133. }, 0, d.easeOutQuad, "zoom")
  5134. } */
  5135. this.goToDestination()
  5136. }),
  5137. (n.prototype.getMomentTour = function (destinationItem) {
  5138. //add
  5139. var wholeMomentTour = window.DATA.momentTour || 'walk' //最外层 还有一种是'std'
  5140. if (!destinationItem) return wholeMomentTour
  5141. else {
  5142. var currentLocation = this.model.getHeroDescriptorByIndex(destinationItem) //最内层。 如果有使用最内层
  5143. if (currentLocation.momentTour) return currentLocation.momentTour
  5144. var currentLocation_ = this.model.heroLocations[destinationItem[0]]
  5145. return currentLocation_.momentTour || wholeMomentTour //若中间层或最内层有就使用,否则使用最外层
  5146. }
  5147. }),
  5148. (t.exports = n)
  5149. }).call(this, '/js/director.js')
  5150. },
  5151. {
  5152. './analytics': 4,
  5153. './enum/BlackoutStyle': 18,
  5154. './enum/ControlEvents': 21,
  5155. './enum/DirectorEvents': 23,
  5156. './enum/ModelManagerEvents': 33,
  5157. './enum/PathDiscardMode': 38,
  5158. './enum/PathDisplayMode': 39,
  5159. './enum/PlayerEvents': 40,
  5160. './enum/Viewmode': 51,
  5161. './enum/WarpStyle': 52,
  5162. './model/ModelManager': 140,
  5163. './player': 155,
  5164. './settings': 166,
  5165. './util/logger': 189,
  5166. './util/transitions': 195,
  5167. events: 202,
  5168. three: 217
  5169. }
  5170. ],
  5171. 16: [
  5172. function (e, t, i) {
  5173. 'use strict'
  5174. var n = e('three'),
  5175. r = e('./enum/Viewmode'),
  5176. o = (e('./settings'), e('./util/transitions')),
  5177. a = e('./enum/PlayerEvents'),
  5178. s = new n.ShaderPass(n.HorizontalBlurShader),
  5179. l = new n.ShaderPass(n.VerticalBlurShader)
  5180. l.renderToScreen = !0
  5181. var c = $('#player').width() / $('#player').height()
  5182. isNaN(c) && (c = 1)
  5183. var h = {
  5184. currentBlur: 0,
  5185. aspect: c,
  5186. blurStrength: 1,
  5187. hblurPass: s,
  5188. vblurPass: l,
  5189. fastTranMaskPass: new n.TransitionPass(),
  5190. bindEvents: function (e) {
  5191. e.on(a.ModeChanged, function (e, t) {
  5192. e === r.PANORAMA && (o.cancel(h.blur), o.cancel(h.addBlur), o.start(h.removeBlur, 500, null, 0, null, 'deblur'))
  5193. })
  5194. },
  5195. blur: function (e) {
  5196. h.currentBlur = e
  5197. var t = e * h.blurStrength
  5198. ;(l.uniforms.v.value = (t / 512) * h.aspect), (s.uniforms.h.value = t / 512)
  5199. },
  5200. addBlur: function (e) {
  5201. ;(e = Math.max(e, h.currentBlur)), h.blur(e)
  5202. },
  5203. removeBlur: function (e) {
  5204. ;(e = Math.min(1 - e, h.currentBlur)), h.blur(e)
  5205. }
  5206. }
  5207. h.blur(0), (t.exports = h)
  5208. },
  5209. {
  5210. './enum/PlayerEvents': 40,
  5211. './enum/Viewmode': 51,
  5212. './settings': 166,
  5213. './util/transitions': 195,
  5214. three: 217
  5215. }
  5216. ],
  5217. 17: [
  5218. function (e, t, i) {
  5219. 'use strict'
  5220. t.exports = {
  5221. UNKNOWN: 0,
  5222. ALIGNED: 1,
  5223. UNALIGNED: 2,
  5224. PLACED: 3
  5225. }
  5226. },
  5227. {}
  5228. ],
  5229. 18: [
  5230. function (e, t, i) {
  5231. 'use strict'
  5232. t.exports = {
  5233. NONE: 0,
  5234. MIDDLE: 1,
  5235. END: 2,
  5236. BEGINNING: 3,
  5237. FADEIN: 4
  5238. }
  5239. },
  5240. {}
  5241. ],
  5242. 19: [
  5243. function (e, t, i) {
  5244. 'use strict'
  5245. var n = e('three')
  5246. t.exports = {
  5247. newBlue: new n.Color(4967932),
  5248. altBlue: new n.Color(47355),
  5249. tagDefault: new n.Color(223357),
  5250. classicBlue: new n.Color(53759),
  5251. mpYellow: new n.Color(16502016),
  5252. mpOrange: new n.Color(16428055),
  5253. mpBlue: new n.Color(12096),
  5254. mpLtGrey: new n.Color(13751252),
  5255. mpDkGrey: new n.Color(10000019),
  5256. mpRed: new n.Color(12525854),
  5257. mpOrangeDesat: new n.Color(16764529),
  5258. mpBlueDesat: new n.Color(4034734),
  5259. mpRedDesat: new n.Color(14705505),
  5260. white: new n.Color(16777215),
  5261. black: new n.Color(0),
  5262. _desat: function (e, t) {
  5263. var i = t || 0.3,
  5264. r = new n.Color().copy(e).getHSL()
  5265. return new n.Color().setHSL(r.h, r.s * (1 - i), r.l)
  5266. },
  5267. _darken: function (e, t) {
  5268. var i = t || 0.2,
  5269. r = e.getHSL()
  5270. return new n.Color().setHSL(r.h, r.s, r.l * (1 - i))
  5271. }
  5272. }
  5273. },
  5274. {
  5275. three: 217
  5276. }
  5277. ],
  5278. 20: [
  5279. function (e, t, i) {
  5280. 'use strict'
  5281. t.exports = {
  5282. NONE: -1,
  5283. ROTATE: 0,
  5284. DOLLY: 1,
  5285. PAN: 2,
  5286. ROTATE_DOLLY: 3,
  5287. PAN_DOLLY: 4
  5288. }
  5289. },
  5290. {}
  5291. ],
  5292. 21: [
  5293. function (e, t, i) {
  5294. 'use strict'
  5295. t.exports = {
  5296. Move: 'move',
  5297. InteractionDirect: 'interaction.direct',
  5298. InteractionKey: 'interaction.key',
  5299. InteractionGui: 'interaction.gui',
  5300. FlyInDirection: 'fly.direction',
  5301. InputStart: 'input.start',
  5302. Pinch: 'input.pinch',
  5303. Scroll: 'input.scroll',
  5304. AutoPanInterrupt: 'autopan.interrupt',
  5305. AutoPanComplete: 'autopan.complete',
  5306. AutoPanClamped: 'autopan.clamped',
  5307. LongTap: 'longtap'
  5308. }
  5309. },
  5310. {}
  5311. ],
  5312. 22: [
  5313. function (e, t, i) {
  5314. 'use strict'
  5315. t.exports = Object.freeze({
  5316. FORWARD: 'FORWARD',
  5317. LEFT: 'LEFT',
  5318. RIGHT: 'RIGHT',
  5319. BACK: 'BACK',
  5320. UP: 'UP',
  5321. DOWN: 'DOWN'
  5322. })
  5323. },
  5324. {}
  5325. ],
  5326. 23: [
  5327. function (e, t, i) {
  5328. 'use strict'
  5329. t.exports = {
  5330. ActionInterrupted: 'action.interrupted',
  5331. TourStart: 'tour.start',
  5332. TourEnd: 'tour.end',
  5333. StartModeChange: 'mode.startChange'
  5334. }
  5335. },
  5336. {}
  5337. ],
  5338. 24: [
  5339. function (e, t, i) {
  5340. 'use strict'
  5341. t.exports = Object.freeze({
  5342. None: 0,
  5343. Queued: 1,
  5344. ForceQueued: 2,
  5345. Downloading: 3,
  5346. Downloaded: 4,
  5347. DownloadFailed: 5
  5348. })
  5349. },
  5350. {}
  5351. ],
  5352. 25: [
  5353. function (e, t, i) {
  5354. 'use strict'
  5355. t.exports = {
  5356. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5357. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5358. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5359. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5360. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5361. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5362. }
  5363. },
  5364. {}
  5365. ],
  5366. 26: [
  5367. function (e, t, i) {
  5368. 'use strict'
  5369. t.exports = {
  5370. Texture2D: 0,
  5371. TextureCube: 1
  5372. }
  5373. },
  5374. {}
  5375. ],
  5376. 27: [
  5377. function (e, t, i) {
  5378. 'use strict'
  5379. t.exports = {
  5380. SMALL: 'small',
  5381. LARGE: 'large'
  5382. }
  5383. },
  5384. {}
  5385. ],
  5386. 28: [
  5387. function (e, t, i) {
  5388. 'use strict'
  5389. var n = e('./Viewmode'),
  5390. r = {
  5391. LANDING: {},
  5392. NAVIGATION: 'navigation',
  5393. MORE_HELP: 'moreHelp',
  5394. TOUR_INTERACTION: {}
  5395. }
  5396. ;(r.LANDING[n.PANORAMA] = 'panorama.landing'),
  5397. (r.LANDING[n.OUTDOOR] = 'outdoor.landing'),
  5398. (r.LANDING[n.DOLLHOUSE] = 'dollhouse.landing'),
  5399. (r.LANDING[n.FLOORPLAN] = 'floorplan.landing'),
  5400. (r.TOUR_INTERACTION.standard = 'standard.tour'),
  5401. (r.TOUR_INTERACTION[n.OUTDOOR] = 'outdoor.tour'),
  5402. (r.TOUR_INTERACTION[n.FLOORPLAN] = 'floorplan.tour'),
  5403. (t.exports = r)
  5404. },
  5405. {
  5406. './Viewmode': 51
  5407. }
  5408. ],
  5409. 29: [
  5410. function (e, t, i) {
  5411. 'use strict'
  5412. var n = {
  5413. UP: 1,
  5414. DOWN: -1,
  5415. LEFT: 'L',
  5416. RIGHT: 'R',
  5417. FORWARD: 'F',
  5418. BACK: 'B',
  5419. reverse: {},
  5420. opposite: function (e) {
  5421. return this.reverse[e.toString()]
  5422. }
  5423. }
  5424. !(function () {
  5425. ;(n.reverse[n.UP] = n.DOWN), (n.reverse[n.DOWN] = n.UP), (n.reverse[n.LEFT] = n.RIGHT), (n.reverse[n.RIGHT] = n.LEFT), (n.reverse[n.FORWARD] = n.BACK), (n.reverse[n.BACK] = n.FORWARD)
  5426. })(),
  5427. (t.exports = n)
  5428. },
  5429. {}
  5430. ],
  5431. 30: [
  5432. function (e, t, i) {
  5433. 'use strict'
  5434. var n = e('../util/browser'),
  5435. r = {
  5436. ZERO: 48,
  5437. ONE: 49,
  5438. TWO: 50,
  5439. THREE: 51,
  5440. FOUR: 52,
  5441. FIVE: 53,
  5442. SIX: 54,
  5443. SEVEN: 55,
  5444. EIGHT: 56,
  5445. NINE: 57,
  5446. LEFTARROW: 37,
  5447. UPARROW: 38,
  5448. RIGHTARROW: 39,
  5449. DOWNARROW: 40,
  5450. A: 65,
  5451. B: 66,
  5452. C: 67,
  5453. D: 68,
  5454. E: 69,
  5455. F: 70,
  5456. G: 71,
  5457. H: 72,
  5458. I: 73,
  5459. J: 74,
  5460. K: 75,
  5461. L: 76,
  5462. M: 77,
  5463. N: 78,
  5464. O: 79,
  5465. P: 80,
  5466. Q: 81,
  5467. R: 82,
  5468. S: 83,
  5469. T: 84,
  5470. U: 85,
  5471. V: 86,
  5472. W: 87,
  5473. X: 88,
  5474. Y: 89,
  5475. Z: 90,
  5476. SPACE: 32,
  5477. RETURN: 13,
  5478. SEMICOLON: 186,
  5479. PLUSEQUALS: 187,
  5480. DASHUNDERSCORE: 189,
  5481. OPENBRACKET: 219
  5482. }
  5483. n.detectFirefox() && ((r.SEMICOLON = 59), (r.PLUSEQUALS = 61), (r.DASHUNDERSCORE = 173)), (t.exports = r)
  5484. },
  5485. {
  5486. '../util/browser': 182
  5487. }
  5488. ],
  5489. 31: [
  5490. function (e, t, i) {
  5491. 'use strict'
  5492. t.exports = {
  5493. EN_US: 'en-US',
  5494. ES_MX: 'es-MX',
  5495. FR_FR: 'fr-FR',
  5496. DE_DE: 'de-DE',
  5497. RU_RU: 'ru-RU',
  5498. CN_CN: 'cn-CN',
  5499. JP_JP: 'jp-JP'
  5500. }
  5501. },
  5502. {}
  5503. ],
  5504. 32: [
  5505. function (e, t, i) {
  5506. 'use strict'
  5507. t.exports = {
  5508. TagActivated: 'tag.activated',
  5509. TagDismissed: 'tag.dismissed',
  5510. TagNavigation: 'tag.navigation'
  5511. }
  5512. },
  5513. {}
  5514. ],
  5515. 33: [
  5516. function (e, t, i) {
  5517. 'use strict'
  5518. t.exports = {
  5519. ModelAdded: 'model-added',
  5520. ActiveModelChanged: 'active-model-changed'
  5521. }
  5522. },
  5523. {}
  5524. ],
  5525. 34: [
  5526. function (e, t, i) {
  5527. 'use strict'
  5528. t.exports = {
  5529. LEFT: 0,
  5530. MIDDLE: 1,
  5531. RIGHT: 2
  5532. }
  5533. },
  5534. {}
  5535. ],
  5536. 35: [
  5537. function (e, t, i) {
  5538. 'use strict'
  5539. t.exports = {
  5540. PanoRenderComplete: 'panorama.render.complete',
  5541. TileRenderFailure: 'panorama.tile.render.failed',
  5542. TileRenderSuccess: 'panorama.tile.render.success',
  5543. TileUploadAttempted: 'panorama.tile.upload.attempted',
  5544. UploadAttemptedForAllTiles: 'panorama.upload.attempted.all.tiles',
  5545. ZoomLevelRenderStarted: 'panorama.zoom.render.started'
  5546. }
  5547. },
  5548. {}
  5549. ],
  5550. 36: [
  5551. function (e, t, i) {
  5552. 'use strict'
  5553. t.exports = {
  5554. BASE: 1,
  5555. STANDARD: 2,
  5556. HIGH: 3,
  5557. ULTRAHIGH: 4
  5558. }
  5559. },
  5560. {}
  5561. ],
  5562. 37: [
  5563. function (e, t, i) {
  5564. 'use strict'
  5565. t.exports = {
  5566. LoadComplete: 'panorama.load.complete',
  5567. LoadFailed: 'panorama.load.failed',
  5568. TileLoaded: 'panorama.tile.loaded'
  5569. }
  5570. },
  5571. {}
  5572. ],
  5573. 38: [
  5574. function (e, t, i) {
  5575. 'use strict'
  5576. t.exports = Object.freeze({
  5577. Standard: 0,
  5578. Slow: 1,
  5579. Retain: 2
  5580. })
  5581. },
  5582. {}
  5583. ],
  5584. 39: [
  5585. function (e, t, i) {
  5586. 'use strict'
  5587. t.exports = Object.freeze({
  5588. Show: 0,
  5589. Hide: 1,
  5590. Retain: 2
  5591. })
  5592. },
  5593. {}
  5594. ],
  5595. 40: [
  5596. function (e, t, i) {
  5597. 'use strict'
  5598. t.exports = {
  5599. Move: 'move',
  5600. MoveComplete: 'move.complete',
  5601. ModeChanged: 'mode.changed',
  5602. ModeChanging: 'mode.changing',
  5603. PanoChosen: 'pano.chosen',
  5604. ClosestPanoChanging: 'closest.pano.changing',
  5605. WarpStarted: 'warp.started',
  5606. WarpInterrupted: 'warp.interrupted',
  5607. WarpEnded: 'warp.ended',
  5608. FlyinFinished: 'flyin.finished',
  5609. FlyingStarted: 'flying.started',
  5610. FlyingInterrupted: 'flying.interrupted',
  5611. FlyingEnded: 'flying.ended',
  5612. Ready: 'ready',
  5613. StartInside: 'start.inside',
  5614. StartOutside: 'start.outside',
  5615. ViewChanged: 'view.changed',
  5616. WarpInterruptedWithFlyTo: 'warp.interrupted.flyto',
  5617. InputStart: 'input.start'
  5618. }
  5619. },
  5620. {}
  5621. ],
  5622. 41: [
  5623. function (e, t, i) {
  5624. 'use strict'
  5625. t.exports = Object.freeze({
  5626. DEFAULT: 0,
  5627. PANOMARKERS: 1,
  5628. RETICULE: 2,
  5629. TAG: 3
  5630. })
  5631. },
  5632. {}
  5633. ],
  5634. 42: [
  5635. function (e, t, i) {
  5636. 'use strict'
  5637. t.exports = {
  5638. visibleFloor: 1,
  5639. ghostFloor: 3,
  5640. boundingSkybox: 1,
  5641. panoMarker: 2,
  5642. reticule: 3,
  5643. tagStem: 4,
  5644. tagDisc: 5,
  5645. ribbon: 100
  5646. }
  5647. },
  5648. {}
  5649. ],
  5650. 43: [
  5651. function (e, t, i) {
  5652. 'use strict'
  5653. t.exports = {
  5654. ContextCreated: 'scene-renderer-context-created',
  5655. AfterRender: 'after-render',
  5656. MemoryUsageUpdated: 'scene-renderer-memory-usage-updated'
  5657. }
  5658. },
  5659. {}
  5660. ],
  5661. 44: [
  5662. function (e, t, i) {
  5663. 'use strict'
  5664. t.exports = {
  5665. IDLE: 'idle',
  5666. BROWSE: 'browse',
  5667. EXAMINE: 'examine'
  5668. }
  5669. },
  5670. {}
  5671. ],
  5672. 45: [
  5673. function (e, t, i) {
  5674. 'use strict'
  5675. t.exports = {
  5676. TileDownloadSuccess: 'tiledownloader.download.success',
  5677. TileDownloadFailure: 'tiledownloader.download.failure',
  5678. PanoDownloadComplete: 'tiledownloader.pano.download.complete'
  5679. }
  5680. },
  5681. {}
  5682. ],
  5683. 46: [
  5684. function (e, t, i) {
  5685. 'use strict'
  5686. t.exports = {
  5687. CardboardAndroid: 'googlevr',
  5688. GearVR: 'gearvr',
  5689. CardboardIOS: 'googlevrios',
  5690. Cardboard: 'googlevr'
  5691. }
  5692. },
  5693. {}
  5694. ],
  5695. 47: [
  5696. function (e, t, i) {
  5697. 'use strict'
  5698. t.exports = {
  5699. NONE: 0,
  5700. CONTEXTUAL: 1,
  5701. ANDROID: 2
  5702. }
  5703. },
  5704. {}
  5705. ],
  5706. 48: [
  5707. function (e, t, i) {
  5708. 'use strict'
  5709. var n = {
  5710. Title: 0,
  5711. Cardboard: 1
  5712. },
  5713. r = {
  5714. Title: 0,
  5715. Cardboard: 1,
  5716. Gear: 2
  5717. }
  5718. !(function () {
  5719. ;[n, r].forEach(function (e) {
  5720. e.pageCount = Object.keys(e).length
  5721. })
  5722. })(),
  5723. (t.exports.ios = n),
  5724. (t.exports.standard = r)
  5725. },
  5726. {}
  5727. ],
  5728. 49: [
  5729. function (e, t, i) {
  5730. 'use strict'
  5731. t.exports = {
  5732. Android: 'android',
  5733. IOS: 'ios',
  5734. Desktop: 'desktop',
  5735. UnsupportedAndroid: 'android-unsupported'
  5736. }
  5737. },
  5738. {}
  5739. ],
  5740. 50: [
  5741. function (e, t, i) {
  5742. 'use strict'
  5743. var n = e('three')
  5744. t.exports = {
  5745. UP: new n.Vector3(0, 1, 0),
  5746. DOWN: new n.Vector3(0, -1, 0),
  5747. LEFT: new n.Vector3(-1, 0, 0),
  5748. RIGHT: new n.Vector3(1, 0, 0),
  5749. FORWARD: new n.Vector3(0, 0, -1),
  5750. BACK: new n.Vector3(0, 0, 1)
  5751. }
  5752. },
  5753. {
  5754. three: 217
  5755. }
  5756. ],
  5757. 51: [
  5758. function (e, t, i) {
  5759. 'use strict'
  5760. var n = e('../exception/ViewmodeConvertException'),
  5761. r = e('./coreViewmodes'),
  5762. o = e('../util/common'),
  5763. a = {
  5764. MESH: 'mesh',
  5765. OUTDOOR: 'outdoor',
  5766. TRANSITIONING: 'transitioning',
  5767. toInt: function (e) {
  5768. switch (e) {
  5769. case this.PANORAMA:
  5770. return 1
  5771. case this.DOLLHOUSE:
  5772. return 2
  5773. case this.FLOORPLAN:
  5774. return 3
  5775. case this.OUTDOOR:
  5776. return 4
  5777. case this.TRANSITIONING:
  5778. return -1
  5779. }
  5780. throw new n('No known conversion for Viewmode to int for mode: ' + e)
  5781. },
  5782. fromInt: function (e) {
  5783. switch (e) {
  5784. case '1':
  5785. case 1:
  5786. return this.PANORAMA
  5787. case '2':
  5788. case 2:
  5789. return this.DOLLHOUSE
  5790. case '3':
  5791. case 3:
  5792. return this.FLOORPLAN
  5793. case '4':
  5794. case 4:
  5795. return this.OUTDOOR
  5796. }
  5797. throw new n('No known conversion for int to viewmode for int: ' + e)
  5798. },
  5799. convertWorkshopModeInt: function (e) {
  5800. switch (e) {
  5801. case '0':
  5802. case 0:
  5803. case undefined: //xzw add
  5804. return this.PANORAMA
  5805. case '1':
  5806. case 1:
  5807. return this.FLOORPLAN
  5808. case '2':
  5809. case 2:
  5810. return this.DOLLHOUSE
  5811. case '3':
  5812. case 3:
  5813. return this.MESH
  5814. }
  5815. throw new n('No known conversion for Workshop int to viewmode for int: ' + e)
  5816. }
  5817. }
  5818. o.extendObject(a, r), (t.exports = a)
  5819. },
  5820. {
  5821. '../exception/ViewmodeConvertException': 58,
  5822. '../util/common': 185,
  5823. './coreViewmodes': 54
  5824. }
  5825. ],
  5826. 52: [
  5827. function (e, t, i) {
  5828. 'use strict'
  5829. t.exports = {
  5830. BLACK: 'black',
  5831. STD: 'std',
  5832. WALK: 'walk'
  5833. }
  5834. },
  5835. {}
  5836. ],
  5837. 53: [
  5838. function (e, t, i) {
  5839. 'use strict'
  5840. t.exports = {
  5841. ZoomIn: 'zoom.in',
  5842. ZoomOut: 'zoom.out',
  5843. ZoomMax: 'zoom.max',
  5844. ZoomMin: 'zoom.min'
  5845. }
  5846. },
  5847. {}
  5848. ],
  5849. 54: [
  5850. function (e, t, i) {
  5851. 'use strict'
  5852. t.exports = {
  5853. PANORAMA: 'panorama',
  5854. DOLLHOUSE: 'dollhouse',
  5855. FLOORPLAN: 'floorplan'
  5856. }
  5857. },
  5858. {}
  5859. ],
  5860. 55: [
  5861. function (e, t, i) {
  5862. 'use strict'
  5863. function n(e) {
  5864. this.message = e
  5865. }
  5866. t.exports = n
  5867. },
  5868. {}
  5869. ],
  5870. 56: [
  5871. function (e, t, i) {
  5872. 'use strict'
  5873. function n(e) {
  5874. r.call(this, e)
  5875. }
  5876. var r = e('./BasicException')
  5877. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5878. },
  5879. {
  5880. './BasicException': 55
  5881. }
  5882. ],
  5883. 57: [
  5884. function (e, t, i) {
  5885. 'use strict'
  5886. function n(e) {
  5887. r.call(this, e)
  5888. }
  5889. var r = e('./BasicException')
  5890. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5891. },
  5892. {
  5893. './BasicException': 55
  5894. }
  5895. ],
  5896. 58: [
  5897. function (e, t, i) {
  5898. 'use strict'
  5899. function n(e) {
  5900. r.call(this, e)
  5901. }
  5902. var r = e('./BasicException')
  5903. ;(n.prototype = Object.create(r.prototype)), (t.exports = n)
  5904. },
  5905. {
  5906. './BasicException': 55
  5907. }
  5908. ],
  5909. 59: [
  5910. function (e, t, i) {
  5911. ;(function (i) {
  5912. 'use strict'
  5913. function n(e) {
  5914. var t = {}
  5915. if (e) {
  5916. var i = e.flags
  5917. if (i) for (var n in i) i.hasOwnProperty(n) && (t[i[n]] = !0)
  5918. return t
  5919. }
  5920. return l.debug('Feature flags -> parseFeatureFlags: rawData is null.'), null
  5921. }
  5922. var r = e('./util/ajax'),
  5923. o = e('./util/showcase'),
  5924. a = e('./util/logger'),
  5925. s = '',
  5926. l = new a(i),
  5927. c = {}
  5928. t.exports = {
  5929. loadFeatureFlags: function (e) {
  5930. var t = $.Deferred()
  5931. return (
  5932. r
  5933. .get(e.urlBase + s, {
  5934. responseType: 'json',
  5935. prefetchFrom: 'user',
  5936. auth: o.getAuthorizationHeader()
  5937. })
  5938. .done(function (e) {
  5939. ;(c = n(e)), c ? t.resolve(c) : t.reject('loading-failed')
  5940. })
  5941. .fail(function () {
  5942. l.debug('Retrieval of feature flags failed.'), t.reject('loading-failed')
  5943. }),
  5944. t.promise()
  5945. )
  5946. },
  5947. getFlags: function () {
  5948. return c
  5949. },
  5950. updateDependentSettings: function (e, t) {
  5951. ;(e = e || c),
  5952. e.labels && (t.labels.enabled = !0),
  5953. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5954. e.showcase_sdk && (t.sdkInit = !0),
  5955. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5956. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5957. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5958. e.hide_sc_sharing && (t.share.enabled = !1)
  5959. }
  5960. }
  5961. }).call(this, '/js/featureflags.js')
  5962. },
  5963. {
  5964. './util/ajax': 181,
  5965. './util/logger': 189,
  5966. './util/showcase': 193
  5967. }
  5968. ],
  5969. 60: [
  5970. function (e, t, i) {
  5971. 'use strict'
  5972. var n =
  5973. (e('../util/common'),
  5974. {
  5975. status: 0,
  5976. set: function (e) {
  5977. if (isNaN(e)) return !1
  5978. var t = $('.progressbar')
  5979. 0 > e && (e = 0)
  5980. e > 100 && (e = 100)
  5981. var width = parseInt(t.css('width').replace('px', '')) / 100 //获取进度条总长度除以100
  5982. var barperc = e * width
  5983. var perc = Math.round(e)
  5984. var labelpos = parseInt(barperc) - 15
  5985. t.find('.bar').css('width', barperc) //已经再跑颜色的百分比
  5986. t.find('.label').css('left', labelpos) //上面跟着的字的百分比
  5987. t.find('.perc').text(perc + '%') //具体数字的百分比
  5988. this.status = e
  5989. },
  5990. done: function (e) {
  5991. return e || this.status ? ((this.status = null), this.set(100)) : this
  5992. }
  5993. })
  5994. t.exports.circleLoader = n
  5995. },
  5996. {
  5997. '../util/common': 185
  5998. }
  5999. ],
  6000. 61: [
  6001. function (e, t, i) {
  6002. 'use strict'
  6003. t.exports = Object.freeze({
  6004. CLOSE: 'modal.closer.close'
  6005. })
  6006. },
  6007. {}
  6008. ],
  6009. 62: [
  6010. function (e, t, i) {
  6011. 'use strict'
  6012. function n(e, t) {
  6013. t && (t.stopPropagation(), t.preventDefault()), e && this.emit(l.CLOSE, e), g.reset()
  6014. }
  6015. function r(e, t) {
  6016. function i() {
  6017. var t = e.offsetHeight >= $('#player').height() && e.offsetWidth >= $('#player').width()
  6018. t !== f && ((f = t), t ? (e.classList.add('closeByFooter'), h.classList.add('closeByFooter')) : (e.classList.remove('closeByFooter'), h.classList.remove('closeByFooter')))
  6019. }
  6020. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  6021. }
  6022. var o = e('../../settings'),
  6023. a = (e('../../tag/Media/MediaEvent'), e('../../util/browser')),
  6024. s = e('../../util/common'),
  6025. l = e('./ModalCloserEvent'),
  6026. c = e('events').EventEmitter,
  6027. h = document.getElementsByClassName('footer')[0],
  6028. u = h.querySelectorAll('.close')[0],
  6029. d = null,
  6030. p = null,
  6031. f = null,
  6032. g =
  6033. (a.isMobile(),
  6034. {
  6035. open: function (e) {
  6036. e &&
  6037. (r(e),
  6038. d && u.removeEventListener('click', d, !0),
  6039. (d = n.bind(this, e.id)),
  6040. u.addEventListener('click', d, !0),
  6041. p && window.removeEventListener('resize', p, !0),
  6042. (p = r.bind(this, e)),
  6043. window.addEventListener('resize', p, !0))
  6044. },
  6045. reset: function () {
  6046. h.classList.remove('closeByFooter'), u.removeEventListener('click', d, !0), window.removeEventListener('resize', p, !0), (d = p = f = null)
  6047. }
  6048. })
  6049. s.extendObject(g, c.prototype), (t.exports = g)
  6050. },
  6051. {
  6052. '../../tag/Media/MediaEvent': 131,
  6053. '../../settings': 166,
  6054. '../../util/browser': 182,
  6055. '../../util/common': 185,
  6056. './ModalCloserEvent': 61,
  6057. events: 202
  6058. }
  6059. ],
  6060. 63: [
  6061. function (e, t, i) {
  6062. 'use strict'
  6063. function n(e, t, i) {
  6064. var n = new r.GUI({
  6065. width: 400
  6066. }),
  6067. u = n.addFolder('Flydown from Dollhouse')
  6068. u.add(h.flydown, 'movementEasing', Object.keys(a)),
  6069. u.add(h.flydown, 'movementDelay', 0, 1).step(0.01),
  6070. u.add(h.flydown, 'rotationEasing', Object.keys(a)),
  6071. u.add(h.flydown, 'rotationDelay', 0, 1).step(0.01),
  6072. u.add(h.flydown, 'modelTextureDelay', 0, 1).step(0.01),
  6073. u.add(h.flydown, 'skyboxDelay', 0, 1).step(0.01),
  6074. u.add(h.dollhouseDefault, 'minPolarAngle', 0, o.Math.degToRad(50)),
  6075. u.add(h.dollhouseDefault, 'maxPolarAngle', o.Math.degToRad(50), o.Math.degToRad(170))
  6076. var d = n.addFolder('Transition between panos')
  6077. d.add(h.transition, 'blur', 0, 10).onFinishChange(function () {}),
  6078. d
  6079. .add(h.transition, 'flySpeed', 0, 10)
  6080. .step(0.01)
  6081. .onFinishChange(function () {
  6082. ;(h.transition.flyTime = 0),
  6083. d.__controllers.forEach(function (e) {
  6084. e.updateDisplay()
  6085. })
  6086. }),
  6087. d.add(h.transition, 'flyTime', 0, 5e3).onFinishChange(function () {
  6088. ;(h.transition.flySpeed = 0),
  6089. d.__controllers.forEach(function (e) {
  6090. e.updateDisplay()
  6091. })
  6092. }),
  6093. d.add(h.transition, 'aimTime', 500, 2500).step(50),
  6094. d.add(h.transition, 'aimSlowFactor', 1, 3).step(0.1),
  6095. d.add(h.transition, 'movementEasing', Object.keys(a))
  6096. var p = n.addFolder('Path Display')
  6097. p
  6098. .add(h.path, 'opacity', 0, 1)
  6099. .step(0.01)
  6100. .onFinishChange(function () {}),
  6101. p
  6102. .add(h.path, 'height', 0, 0.2)
  6103. .step(0.01)
  6104. .onFinishChange(function () {}),
  6105. p
  6106. .add(h.path, 'outsideHeight', 0, 2)
  6107. .step(0.01)
  6108. .onFinishChange(function () {}),
  6109. p
  6110. .add(h.path, 'ribbonWidth', 0.01, 0.35)
  6111. .step(0.01)
  6112. .onFinishChange(function () {}),
  6113. p
  6114. .add(h.path, 'waypointRadius', 0.01, 1.2)
  6115. .step(0.01)
  6116. .onFinishChange(function () {}),
  6117. p
  6118. .add(h.path, 'waypointPulse', 0, 3600)
  6119. .step(20)
  6120. .onFinishChange(function () {}),
  6121. p
  6122. .add(h.path, 'waypointIndoorRadius', 0.01, 1.2)
  6123. .step(0.01)
  6124. .onFinishChange(function () {}),
  6125. p
  6126. .add(h.path, 'fadeInTime', 0, 1200)
  6127. .step(10)
  6128. .onFinishChange(function () {}),
  6129. p
  6130. .add(h.path, 'fadeOutTime', 0, 1200)
  6131. .step(10)
  6132. .onFinishChange(function () {}),
  6133. p.add(h.path, 'color', Object.keys(l)).onFinishChange(function () {
  6134. ;(h.path.color = l[h.path.color]), (h.path.colorUp = l._desat(h.path.color)), (h.path.colorDown = l.darken(h.path.color))
  6135. }),
  6136. p.add(h, 'reticuleColor', Object.keys(l)).onFinishChange(function () {
  6137. h.reticuleColor = l[h.reticuleColor]
  6138. })
  6139. var f = n.addFolder('Warping'),
  6140. g = f.addFolder('Warp/Teleport')
  6141. g.add(h.warp, 'softPushDist', 0, 2).onFinishChange(function () {}),
  6142. g
  6143. .add(h.warp, 'softPushEnd', 0, 1)
  6144. .step(0.01)
  6145. .onFinishChange(function () {}),
  6146. g.add(h.warp, 'softBendAngle', 0, 45).onFinishChange(function () {}),
  6147. g.add(h.warp, 'softBendTilt', 0, 45).onFinishChange(function () {}),
  6148. g
  6149. .add(h.warp, 'softBendEnd', 0, 1)
  6150. .step(0.01)
  6151. .onFinishChange(function () {}),
  6152. g.add(h.warp, 'burnsAngle', 0, 30).onFinishChange(function () {}),
  6153. g.add(h.warp, 'minBurnsAngle', 0, 10).onFinishChange(function () {}),
  6154. g.add(h.warp, 'brakeStrength', 1, 8).onFinishChange(function () {}),
  6155. g
  6156. .add(h.warp, 'minBrakeAngle', 0, 5)
  6157. .step(0.01)
  6158. .onFinishChange(function () {}),
  6159. g
  6160. .add(h.warp, 'maxBrakeAngle', 0, 5)
  6161. .step(0.01)
  6162. .onFinishChange(function () {}),
  6163. g.add(h.path, 'mapGuides').onFinishChange(function () {}),
  6164. g
  6165. .add(h.warp, 'teleportTime', 0, 5e3)
  6166. .step(10)
  6167. .onFinishChange(function () {}),
  6168. g
  6169. .add(h.warp, 'outsideTime', 0, 5e3)
  6170. .step(10)
  6171. .onFinishChange(function () {}),
  6172. g.add(h.path, 'typ', Object.keys(c)).onFinishChange(function () {
  6173. h.path.typ = c[h.path.typ]
  6174. }),
  6175. g
  6176. .add(h.warp, 'loop')
  6177. .onChange(function () {})
  6178. .onFinishChange(function () {
  6179. t.endlessLoop = h.warp.loop
  6180. }),
  6181. g
  6182. .add(h.warp, 'walkSlideShowThreshhold', 1, 1e4)
  6183. .step(1)
  6184. .onFinishChange(function () {}),
  6185. g
  6186. .add(h.warp, 'walkExtraPanosDistance', 0, 3)
  6187. .step(0.1)
  6188. .onFinishChange(function () {}),
  6189. g
  6190. .add(h.transition, 'fastForwardFactor', 1, 10)
  6191. .step(1)
  6192. .onFinishChange(function () {})
  6193. var m = f.addFolder('Long Warp Only')
  6194. m
  6195. .add(h.warp, 'minWarpTime', 0, 5e3)
  6196. .step(10)
  6197. .onFinishChange(function () {
  6198. ;(h.warp.flySpeed = 0),
  6199. m.__controllers.forEach(function (e) {
  6200. e.updateDisplay()
  6201. })
  6202. }),
  6203. m
  6204. .add(h.warp, 'timePerMeter', 0, 5e3)
  6205. .step(10)
  6206. .onFinishChange(function () {}),
  6207. m
  6208. .add(h.warp, 'lookAheadMax', 0.01, 1)
  6209. .step(0.01)
  6210. .onFinishChange(function () {}),
  6211. m
  6212. .add(h.warp, 'lookAheadDist', 0.01, 4)
  6213. .step(0.01)
  6214. .onFinishChange(function () {}),
  6215. m
  6216. .add(h.warp, 'maxTurnPerSec', 0, 720)
  6217. .step(1)
  6218. .onFinishChange(function () {}),
  6219. m
  6220. .add(h.warp, 'maxAimPerSec', 0, 720)
  6221. .step(1)
  6222. .onFinishChange(function () {}),
  6223. m
  6224. .add(h.warp, 'turnFriction', 0, 1)
  6225. .step(0.01)
  6226. .onFinishChange(function () {}),
  6227. m
  6228. .add(h.warp, 'walkDelay', 0, 2e3)
  6229. .step(10)
  6230. .onFinishChange(function () {}),
  6231. m
  6232. .add(h.transition, 'flytimeMaxDistanceThreshold', 0, 25)
  6233. .step(10)
  6234. .onFinishChange(function () {}),
  6235. m
  6236. .add(h.warp, 'walkMaxDist', 0, 100)
  6237. .step(1)
  6238. .onFinishChange(function () {})
  6239. var v = n.addFolder('Warp Esoterica')
  6240. v
  6241. .add(h.warp, 'nearPanoDist', 0.01, 12)
  6242. .step(0)
  6243. .onFinishChange(function () {}),
  6244. v.add(h.warp, 'blur', 0.01, 1).onFinishChange(function () {}),
  6245. v
  6246. .add(h.warp, 'flySpeed', 0, 10)
  6247. .step(0.01)
  6248. .onFinishChange(function () {
  6249. ;(h.warp.minWarpTime = 0),
  6250. v.__controllers.forEach(function (e) {
  6251. e.updateDisplay()
  6252. })
  6253. }),
  6254. v.add(h.warp, 'showBunny').onFinishChange(function () {}),
  6255. v
  6256. .add(h.warp, 'fastTime', 0, 2500)
  6257. .step(10)
  6258. .onFinishChange(function () {}),
  6259. v.add(h.warp, 'movementEasing', Object.keys(a))
  6260. var A = n.addFolder('Misc')
  6261. A.add(h, 'dollhouseFOV', 10, 180).onChange(function () {
  6262. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  6263. }),
  6264. A.add(h, 'insideFOV', 10, 180).onChange(function () {
  6265. i.cameras[s.PANORAMA].fov = h.insideFOV
  6266. }),
  6267. A.add(h, 'insideLookSpeed', 0.01, 0.3)
  6268. .step(0.01)
  6269. .onChange(function () {}),
  6270. A.add(h, 'rotationAccelerationInside', 0.1, 10)
  6271. .step(0.1)
  6272. .onChange(function () {}),
  6273. A.add(h, 'rotationAccelerationOutside', 0.1, 10)
  6274. .step(0.1)
  6275. .onChange(function () {})
  6276. var y = n.addFolder('Navigation')
  6277. y.add(h.navigation, 'panoScores').onFinishChange(function () {
  6278. h.navigation.panoScores ||
  6279. e.panos.forEach(function (e) {
  6280. e.floor.remove(e.text3d), (e.text3d = null)
  6281. })
  6282. }),
  6283. y.add(h.navigation, 'mouseDirection'),
  6284. y.add(h.navigation, 'filterStrictness', 0, 1),
  6285. y.add(h.navigation, 'angleFactor', -60, 0),
  6286. y.add(h.navigation, 'directionFactor', 1, 20),
  6287. y.add(h.navigation, 'distanceFactor', -5, 5),
  6288. y.add(h.navigation, 'optionalityFactor', 0.1, 10)
  6289. var C = n.addFolder('tags'),
  6290. I = C.addFolder('Tag Creation')
  6291. I.add(h.tags.pole, 'enabled').name('poleEnabled'),
  6292. I.add(h.tags.pole, 'height', 0, 2.5).step(0.01).name('poleHeight'),
  6293. I.add(h.tags.pole, 'width', 1, 10).step(1).name('poleWidth'),
  6294. I.add(h.tags.pole, 'opacity', 0.1, 1).step(0.1).name('poleOpacity')
  6295. var E = C.addFolder('Visibility')
  6296. E.add(h.tags.visibility, 'anyDistance'),
  6297. E.add(h.tags.visibility, 'visibleDistance', 0.1, 30).step(0.1),
  6298. E.add(h.tags.visibility, 'cameraClearance', 0, 1).step(0.01),
  6299. E.add(h.tags.visibility, 'hideViaFloor'),
  6300. E.add(h.tags.visibility, 'hideOffScreenDisc').name('hideEdgeDisc'),
  6301. E.add(h.tags.visibility, 'hideOffScreenObject').name('hideEdgeObject')
  6302. var b = C.addFolder('Disc Parameters')
  6303. b.add(h.tags.disc.scale, 'nearBound', 0.1, 10).step(0.1),
  6304. b.add(h.tags.disc.scale, 'farBound', 0.1, 20).step(0.1).listen(),
  6305. b.add(h.tags.disc.scale, 'linkFarBound').onChange(function (e) {
  6306. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  6307. }),
  6308. b
  6309. .add(h.tags.disc.scale, 'linkPercent', 0, 100)
  6310. .step(1)
  6311. .onChange(function (e) {
  6312. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  6313. }),
  6314. b.add(h.tags.disc.scale, 'maxSize', 40, 200).step(1),
  6315. b.add(h.tags.disc.scale, 'minSize', 20, 100).step(1),
  6316. b.add(h.tags.disc.scale, 'responsiveness', 0, 100).step(1)
  6317. var w = C.addFolder('Navigate')
  6318. w.add(h.tags.navigate, 'nearestPano').name('nearestPano'),
  6319. w.add(h.tags.navigate, 'lineOfSight').name('lineOfSight'),
  6320. w.add(h.tags.navigate, 'reactivate').name('reactivate'),
  6321. w.add(h.tags.navigate, 'aimAt', ['disc', 'object', 'pole', 'nothing']).name('aim at'),
  6322. w.add(h.tags.navigate, 'tiltTolerance', 0, 50).step(1),
  6323. w.add(h.tags.navigate, 'rotateSpeedFactor', 0, 5).step(0.1)
  6324. var _ = n.addFolder('Debug')
  6325. _.add(h, 'wireframe').onFinishChange(function () {
  6326. e.chunks.forEach(function (t) {
  6327. t.material &&
  6328. (t.wireframeTwin ||
  6329. ((t.wireframeTwin = new o.WireframeHelper(t)),
  6330. (t.wireframeTwin.material.depthWrite = !1),
  6331. (t.wireframeTwin.material.depthTest = !1),
  6332. (t.wireframeTwin.material.opacity = 0.5),
  6333. (t.wireframeTwin.material.transparent = !0)),
  6334. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  6335. })
  6336. }),
  6337. _.add(h, 'skyboxWireframe').onFinishChange(function () {
  6338. h.skyboxWireframe ? ((e.skybox.wireframe = new o.WireframeHelper(e.skybox)), e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe), (e.skybox.wireframe = null))
  6339. }),
  6340. _.add(h, 'showSweeps').onFinishChange(function () {
  6341. e.setSweepVisibility(h.showSweeps)
  6342. }),
  6343. _.add(h, 'showMesh').onFinishChange(function () {
  6344. e.chunks.forEach(function (e) {
  6345. e.visible = h.showMesh
  6346. })
  6347. }),
  6348. _.add(h, 'showFloors').onFinishChange(function () {
  6349. e.floors.forEach(function (e) {
  6350. e.collider.children.forEach(function (e) {
  6351. e.material.visible = h.showFloors
  6352. })
  6353. })
  6354. }),
  6355. _.add(h, 'showSkyboxes').onFinishChange(function () {
  6356. e.panos.forEach(function (e) {
  6357. e.skyboxMesh.visible = h.showSkyboxes
  6358. })
  6359. }),
  6360. _.add(h, 'showNeighbors').onChange(function () {}),
  6361. _.add(e, 'alpha', 0, 1)
  6362. }
  6363. var r = e('../lib/dat.gui'),
  6364. o = e('three'),
  6365. a = e('../util/easing'),
  6366. s = e('../enum/Viewmode'),
  6367. l = e('../enum/Colors'),
  6368. c = e('../enum/WarpStyle'),
  6369. h = e('../settings')
  6370. e('../tag/tag')
  6371. ;(r.GUI.prototype.removeFolder = function (e) {
  6372. var t = this.__folders[e]
  6373. t && (t.close(), this.__ul.removeChild(t.domElement.parentNode), delete this.__folders[e], this.onResize())
  6374. }),
  6375. (t.exports.toggle = n)
  6376. },
  6377. {
  6378. '../enum/Colors': 19,
  6379. '../enum/Viewmode': 51,
  6380. '../enum/WarpStyle': 52,
  6381. '../lib/dat.gui': 93,
  6382. '../tag/tag': 123,
  6383. '../settings': 166,
  6384. '../util/easing': 186,
  6385. three: 217
  6386. }
  6387. ],
  6388. 64: [
  6389. function (e, t, i) {
  6390. ;(function (i) {
  6391. 'use strict'
  6392. function n(e, t, i, n) {
  6393. $('.gui-error .error-problem-text').text(e),
  6394. $('.gui-error .error-solution-text').text(t),
  6395. $('.gui-error .error-explanation').text(i),
  6396. $('.gui-error .error-actions').html(n),
  6397. $(window).resize(),
  6398. $('.gui-error').fadeIn(),
  6399. $('#bottom-logo').fadeIn()
  6400. }
  6401. function r(e) {
  6402. var t = [
  6403. '<div class="browser-tiles">',
  6404. '<div class="tile">',
  6405. '<a href="https://www.google.com/chrome/browser/" target="_blank">',
  6406. '<img class="icon" src="images/icon_Google_Chrome_2011.png" ',
  6407. 'rel="tiletip" title="Chrome"></a>',
  6408. '</div>',
  6409. '<div class="tile">',
  6410. '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">',
  6411. '<img class="icon" src="images/icon_Mozilla_Firefox.png" ',
  6412. 'rel="tiletip" title="Firefox"></a>',
  6413. '</div>',
  6414. '<div class="tile">',
  6415. '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">',
  6416. '<img class="icon" src="images/icon_Internet_Explorer_10.png" ',
  6417. 'rel="tiletip" title="Internet Explorer"></a>',
  6418. '</div>',
  6419. '<div class="tile">',
  6420. '<a href="https://support.apple.com/en-us/HT204416" target="_blank">',
  6421. '<img class="icon" src="images/icon_MacOSX_Safari.png" ',
  6422. 'rel="tiletip" title="Safari"></a>',
  6423. '</div>',
  6424. '</div>'
  6425. ].join('')
  6426. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  6427. s.isMobile() ||
  6428. $('[rel=tiletip]').tooltip({
  6429. placement: 'bottom',
  6430. delay: {
  6431. show: 50,
  6432. hide: 0
  6433. },
  6434. trigger: 'hover',
  6435. viewport: {
  6436. selector: 'body',
  6437. padding: 10
  6438. }
  6439. })
  6440. }
  6441. function o() {
  6442. var e = s.isMobile() ? '' : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + '</span>' + h.ERROR_GENERIC_ACTIONS_3,
  6443. t = [h.ERROR_GENERIC_ACTIONS_1, e].join('')
  6444. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, '', t),
  6445. s.isMobile() ||
  6446. $('.install-browser').on('click touchstart', function (e) {
  6447. e.preventDefault(), e.stopPropagation(), r(' ')
  6448. })
  6449. }
  6450. function a(e) {
  6451. if (
  6452. ($('head title').text(c.pageTitle),
  6453. $('#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo').hide(),
  6454. $('#gui-loading').fadeOut(250),
  6455. $('#quick-blackout').hide(),
  6456. l.track('showcase_error', {
  6457. error_key: e
  6458. }),
  6459. h.locale || h.init(),
  6460. 'webgl-unsupported' === e)
  6461. )
  6462. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM)
  6463. else if ('webgl-ios' === e) 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>.')
  6464. else if ('webgl-safari' === e)
  6465. n(
  6466. h.ERROR_WEBGL_SAFARI_PROBLEM,
  6467. '',
  6468. '',
  6469. h.ERROR_WEBGL_SAFARI_ACTIONS_1 +
  6470. '<strong>' +
  6471. h.ERROR_WEBGL_SAFARI_ACTIONS_2 +
  6472. '</strong>. ' +
  6473. h.ERROR_WEBGL_SAFARI_ACTIONS_3 +
  6474. '<strong>' +
  6475. h.ERROR_WEBGL_SAFARI_ACTIONS_4 +
  6476. '</strong>.'
  6477. )
  6478. else if ('webgl-generic' === e) o()
  6479. else if ('missing-urls' === e) n(h.ERROR_MISSING_URLS_PROBLEM, '', h.ERROR_MISSING_URLS_EXPLANATION)
  6480. else if ('loading-failed' === e)
  6481. 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>.')
  6482. else {
  6483. if ('loading-failed-maintenance' !== e) return void d.error('Unhandled error: ' + e)
  6484. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6485. }
  6486. }
  6487. var s = e('./../util/browser'),
  6488. l = e('./../analytics'),
  6489. c = e('./../settings'),
  6490. h = e('../localization/localize'),
  6491. u = e('./../util/logger'),
  6492. d = new u(i),
  6493. p = '"https://support.port.com/hc/articles/208220058"'
  6494. t.exports.error = a
  6495. }).call(this, '/js/gui/error.js')
  6496. },
  6497. {
  6498. '../localization/localize': 108,
  6499. './../analytics': 4,
  6500. './../settings': 166,
  6501. './../util/browser': 182,
  6502. './../util/logger': 189
  6503. }
  6504. ],
  6505. 65: [
  6506. function (e, t, i) {
  6507. ;(function (i) {
  6508. 'use strict'
  6509. function n() {
  6510. ;(Ue = []), je.floors.visible && Ue.push('.gui-floor', '.gui-floor-title'), Ue.push('.hideTarget', '.pinTop.right')
  6511. }
  6512. function r() {
  6513. for (var e in je)
  6514. if (je.hasOwnProperty(e)) {
  6515. var t = je[e]
  6516. if (!t.visible) for (var i = 0; i < t.elements.length; i++) $(t.elements[i]).hide()
  6517. }
  6518. je.highlight.visible && $('.pinBottom').addClass('highlightExists'), je.tourControls.visible === !1 && $('#drawer').addClass('fullWidth'), n()
  6519. }
  6520. function o(e, t) {
  6521. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying
  6522. $('#gui-zoomin').toggle(i), $('#gui-zoomout').toggle(i)
  6523. }
  6524. function a() {
  6525. c(),
  6526. $('.pinBottom').toggleClass('open'),
  6527. $('#drawer').toggleClass('open'),
  6528. $('.footer').toggleClass('open'),
  6529. $('#drawer').hasClass('open')
  6530. ? ($('#pullTab .icon').attr('data-original-title', Re.CLOSE_HIGHLIGHTS), Ze('highlights'))
  6531. : ($('#pullTab .icon').attr('data-original-title', Re.OPEN_HIGHLIGHTS), ie.resetDrawer()),
  6532. setTimeout(
  6533. function () {
  6534. $('#pullTab').toggleClass('opened')
  6535. },
  6536. $('#drawer').hasClass('open') ? 0 : Q.highlightAnimationDuration
  6537. ),
  6538. $('.pinBottom').hasClass('open') && s($('.vr-popup')) && $('.vr-popup').is(':visible') && Ae.dismiss()
  6539. }
  6540. function s(e) {
  6541. var t
  6542. 'none' !== e.css('display') ? (t = e.position().top + e.outerHeight()) : (e.attr('style', 'visibility: hidden'), (t = e.position().top + e.outerHeight()), e.attr('style', 'display: none'))
  6543. var i = $('#player').outerHeight(),
  6544. n = i - 130
  6545. return n < t + 25
  6546. }
  6547. function l(e) {
  6548. 'touchstart' === e.type && e.preventDefault(), e.stopPropagation()
  6549. }
  6550. function c() {
  6551. W && (W.reload(), W.init())
  6552. }
  6553. function h(e) {
  6554. ne.show(e), r()
  6555. }
  6556. function u(e) {
  6557. ne.progress(e)
  6558. }
  6559. function d(e, t, i) {
  6560. var n = t.player
  6561. $('#gui-thumb').fadeOut(2500),
  6562. ne.hide(function () {
  6563. Ge = !1
  6564. }),
  6565. me.init(e, i),
  6566. de.finishSetup(Object.keys(e.tags).length),
  6567. i.on(Te.IMAGE_OPENED, Ze.bind(this, 'tag'))
  6568. var s = function () {
  6569. i.dismissExaminedTag(), i.disableHovering()
  6570. }
  6571. Ae.on(ye.OPENED, s), Ce.on(Me.OPENED, s), he.on(ue.OPENED, s), fe.on(ge.OPENED, s)
  6572. var l = i.enableHovering.bind(i)
  6573. if (
  6574. (Ae.on(ye.CLOSED, l),
  6575. Ce.on(Me.CLOSED, l),
  6576. he.on(ue.CLOSED, l),
  6577. fe.on(ge.CLOSED, l),
  6578. Q.labels.enabled && Object.keys(e.labels).length,
  6579. e.floors.length <= 1 || !je.floors.visible ? (je.floors.visible = !1) : (y(e, t), C(e.currentFloor, n.mode)),
  6580. getQueryVariable('m') === '372' && ((je.floors.visible = 1), y(e, t)),
  6581. r(),
  6582. o(t, t.player),
  6583. $('#gui').fadeIn(1500),
  6584. je.highlight.visible &&
  6585. (2 !== Q.startHighlights || e.has360Views) &&
  6586. setTimeout(function () {
  6587. a(), ((!e.has360Views && 1 !== Q.startHighlights) || (e.has360Views && 0 === Q.startHighlights)) && setTimeout(a, 2e3)
  6588. }, 2e3),
  6589. !K.isMobile())
  6590. )
  6591. for (var c = ['a', '#title-toggle', '.next-button', '.prev-button', '.gui-floor', '.meta-toggle', '.thumbImg', 'logo-button'], h = 0; h < c.length; h++) $(c[h]).addClass('hasHover')
  6592. O(e), de.setupToggling()
  6593. //xzw:
  6594. window.editHotPanel && editHotPanel()
  6595. //czj
  6596. navBorderRadius(e)
  6597. //czj 编辑界面
  6598. //window.EditingInterface && new EditingInterface(n.sceneRenderer);
  6599. window.EditTools && new EditTools(n.sceneRenderer)
  6600. }
  6601. function navBorderRadius(e) {
  6602. var pullTab = $('#pullTab'),
  6603. mobileRadius = {
  6604. bottom: {
  6605. 'border-bottom-left-radius': '10px',
  6606. 'border-bottom-right-radius': '10px'
  6607. },
  6608. top: { 'border-top-left-radius': '10px', 'border-top-right-radius': '10px' }
  6609. },
  6610. topRadius = {
  6611. bottom: { 'border-top-right-radius': '10px', 'border-bottom-right-radius': '10px' },
  6612. top: { 'border-bottom-left-radius': '10px', 'border-top-left-radius': '10px' }
  6613. }
  6614. function BorderRadius(bottom, top) {
  6615. $('#gui-modes-map > div:visible:last').css(bottom)
  6616. if (pullTab.is(':visible')) {
  6617. $('.viewContainer > div:visible:first').css(top)
  6618. } else {
  6619. $('#gui-modes-map > div:visible:first').css(top)
  6620. }
  6621. }
  6622. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  6623. BorderRadius(mobileRadius.bottom, mobileRadius.top)
  6624. } else {
  6625. BorderRadius(topRadius.bottom, topRadius.top)
  6626. }
  6627. //判断someData里面是否有special字段,如果有就会处理这些特殊的大场景
  6628. if (window.DATA.model.special || window.DATA.special) {
  6629. window.specialScene && specialScene.special().afterImplement()
  6630. }
  6631. }
  6632. function p(e) {
  6633. e || (e = 0),
  6634. (We = !1),
  6635. window.setTimeout(
  6636. function () {
  6637. We || ((ze = !0), $('#gui-spinner').stop(!0, !0).show())
  6638. }.bind(this),
  6639. e
  6640. )
  6641. }
  6642. function f() {
  6643. $('#gui-spinner').stop(!0, !0), $('#gui-spinner').fadeOut(1e3), (We = !0), (ze = !1)
  6644. }
  6645. function g(e, t) {
  6646. var i = e.mode,
  6647. n = t || e.currentPano
  6648. $('#gui-modes-dollhouse').toggleClass('active', i === _e.DOLLHOUSE),
  6649. $('#gui-modes-floorplan').toggleClass('active', i === _e.FLOORPLAN),
  6650. $('#gui-modes-inside').toggleClass('active', i === _e.PANORAMA),
  6651. i === _e.PANORAMA
  6652. ? ($('#view-controllers').slideUp(500),
  6653. Q.show360Views.enabled && !n.isAligned()
  6654. ? ($('.gui-floor').addClass('hidden'), $('#gui-modes-outside').addClass('desktop-only'))
  6655. : ($('.gui-floor').removeClass('hidden'), $('#gui-modes-outside').removeClass('desktop-only')),
  6656. $('#gui-modes-outside').removeClass('hidden'))
  6657. : i !== _e.TRANSITIONING &&
  6658. (f(),
  6659. (Be = i),
  6660. $('#gui-modes-outside').addClass('hidden'),
  6661. e.model.has360Views && $('.gui-floor').removeClass('hidden'),
  6662. $('#view-controllers').is(':visible') || $('#view-controllers').slideDown(Q.guiAnimationSpeed))
  6663. }
  6664. function m(e, t) {
  6665. var i = t.player
  6666. $('#gui-modes-inside').on('mousedown touchstart', function (e) {
  6667. l(e),
  6668. J.updateInteraction(Se.InteractionGui, 'inside-button'),
  6669. J.track('USER', {
  6670. event_type: 'showcase_gui',
  6671. gui_action: 'click_inside_mode_button'
  6672. }),
  6673. t.changeMode(_e.PANORAMA)
  6674. }),
  6675. $('#gui-modes-outside')
  6676. .find('a')
  6677. .on('click', function (e) {
  6678. l(e),
  6679. J.track('showcase_gui', {
  6680. gui_action: 'click_outside_mode_button'
  6681. }),
  6682. t.changeMode(Be)
  6683. }),
  6684. $('#gui-modes-floorplan').on('click', function (e) {
  6685. l(e),
  6686. i.mode !== _e.FLOORPLAN &&
  6687. (J.track('showcase_gui', {
  6688. gui_action: 'click_floorplan_mode_button'
  6689. }),
  6690. t.changeMode(_e.FLOORPLAN))
  6691. }),
  6692. $('#gui-modes-dollhouse').on('click', function (e) {
  6693. l(e),
  6694. i.mode !== _e.DOLLHOUSE &&
  6695. (J.track('showcase_gui', {
  6696. gui_action: 'click_dollhouse_mode_button'
  6697. }),
  6698. t.changeMode(_e.DOLLHOUSE))
  6699. })
  6700. }
  6701. function v(e, t) {
  6702. function i() {
  6703. document.getElementById('vr').classList.remove('hidden'),
  6704. Q.vr.allowWebVR
  6705. ? K.getVRDisplay().then(
  6706. function (e) {
  6707. K.supportsFullscreen() ? n(e) : (De.warn('Unable to use WebVR when full screen is not supported'), $('.improper-embed').toggleClass('hidden', !1), r())
  6708. },
  6709. function (e) {
  6710. r()
  6711. }
  6712. )
  6713. : r()
  6714. }
  6715. function n(i) {
  6716. De.info(i.displayName + ' detected, VR button activates WebVR experience'), Ie.init(e.data, t, i, q), Ie.on(Ee.OPENED, Ze.bind(gui, 'vr')), Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6717. }
  6718. function r() {
  6719. De.info('WebVR support not found, VR button activates native app VR modal'),
  6720. Ae.init(e.data, q),
  6721. Ae.on(
  6722. ye.OPENED,
  6723. (function () {
  6724. var e = document.getElementById('vr-modal')
  6725. return function () {
  6726. Ze('vr'), le.open(e)
  6727. }
  6728. })()
  6729. ),
  6730. Ae.on(ye.CLOSED, le.reset)
  6731. }
  6732. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash('mls', 0)) {
  6733. /*********************** 方奕卓 VR功能事件监听 ********************/
  6734. K.isMobile() && $('#vr').css('display', '') // 显示vr功能按钮
  6735. switch (Q.vr.option) {
  6736. case Pe.CONTEXTUAL:
  6737. i()
  6738. break
  6739. case Pe.ANDROID:
  6740. K.detectAndroid() && i()
  6741. break
  6742. case Pe.NONE:
  6743. }
  6744. }
  6745. }
  6746. function A(e, t) {
  6747. $('#play').on('mousedown touchstart', function (e) {
  6748. l(e)
  6749. Ze('tour')
  6750. ve.play()
  6751. J.trackAlways('showcase_gui', {
  6752. gui_action: 'play_highlights'
  6753. })
  6754. }),
  6755. (window.startAndPlay = function (e) {
  6756. // l(e);
  6757. Ze('tour')
  6758. ve.play()
  6759. J.trackAlways('showcase_gui', {
  6760. gui_action: 'play_highlights'
  6761. })
  6762. })
  6763. $('#pause').on('mousedown touchstart', function (e) {
  6764. l(e),
  6765. ve.pause(),
  6766. J.trackAlways('showcase_gui', {
  6767. gui_action: 'pause_highlights'
  6768. })
  6769. }),
  6770. $('#gui-zoomin')
  6771. .find('a')
  6772. .on('click', function (e) {
  6773. l(e), t.player.zoomInIncrementally()
  6774. }),
  6775. $('#gui-zoomout')
  6776. .find('a')
  6777. .on('click', function (e) {
  6778. l(e), t.player.zoomOutIncrementally()
  6779. })
  6780. }
  6781. function y(e, t) {
  6782. for (var i = $('.gui-floor'), n = 0; n < e.floors.length; n++) {
  6783. if (getQueryVariable('m') === '372') continue
  6784. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name)
  6785. $('.gui-floor').find('.container').prepend(r)
  6786. //cxz 本来一开始是prepend 后来改了append 按顺序插入
  6787. }
  6788. i.find('.container').prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + '</div>'),
  6789. i.on('click', function (e) {
  6790. l(e), Ze('floor'), i.toggleClass('open')
  6791. }),
  6792. $('.floorChoice').on('click', function (e) {
  6793. l(e)
  6794. var n = $(this).data('index')
  6795. 'all' !== n
  6796. ? (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  6797. t.player.gotoFloor(n),
  6798. J.track('showcase_gui', {
  6799. gui_action: 'click_floor_select_button',
  6800. interaction_source: 'gui'
  6801. }))
  6802. : (J.updateInteraction(Se.InteractionGui, 'floor-control'),
  6803. Ze('move'),
  6804. t.allFloors(),
  6805. J.track('showcase_gui', {
  6806. gui_action: 'click_toggle_all_floors_button',
  6807. interaction_source: 'gui'
  6808. })),
  6809. i.removeClass('open')
  6810. })
  6811. }
  6812. function C(e, t) {
  6813. e &&
  6814. (t === _e.DOLLHOUSE || t === _e.FLOORPLAN
  6815. ? ($('.allFloorBtn').show(), $('.gui-floor-icon').hide(), $('.gui-floor-title').show())
  6816. : ($('.allFloorBtn').hide(), $('.gui-floor-icon').show(), $('.gui-floor-title').hide()),
  6817. e.model.allFloorsVisible
  6818. ? ($('.gui-floor-title').text(Re.FLOOR_ALL), $('.gui-floor-number').text(Re.FLOOR_ALL), $('.floorChoice').removeClass('active'), $('.floorChoice[data-index="all"]').addClass('active'))
  6819. : ($('.gui-floor-title').text(e.name),
  6820. $('.gui-floor-number').text(' ' + (e.floorIndex + 1)),
  6821. $('.floorChoice').removeClass('active'),
  6822. $('.floorChoice[data-index=' + e.floorIndex + ']').addClass('active')))
  6823. }
  6824. function I(e) {
  6825. return e.describe().inTransition
  6826. }
  6827. function b(e, t, i) {
  6828. Fe = e.heroLocations.length
  6829. var n = '<li class="thumbImg" data-index=""><img src=""></li>',
  6830. r = 100 / Fe + '%',
  6831. o = $('#thumb-container'),
  6832. a = $('#progressBar')
  6833. $('#status').find('.totalSteps').text(Fe)
  6834. for (var s = 0; s < Fe; s++) {
  6835. var c = e.heroLocations[s],
  6836. h = $(n)
  6837. var thumbUrl
  6838. if (c.heroLocations) {
  6839. //有子项,选第一张截图
  6840. thumbUrl = manage.dealURL(c.heroLocations[0].thumbUrl) //.replace('https://','').replace('http://','')
  6841. } else {
  6842. thumbUrl = manage.dealURL(c.thumbUrl) //.replace('https://','').replace('http://','')
  6843. }
  6844. h.attr('data-index', s)
  6845. je.highlight.visible && h.find('img').attr('src', thumbUrl)
  6846. if (c.name) {
  6847. var u = $('<div class="overlay"></div>').text(c.name)
  6848. h.prepend(u)
  6849. }
  6850. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6851. var d = e.panos.get(c.panoId),
  6852. p = d && !d.isAligned(),
  6853. 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>'
  6854. h.prepend(f)
  6855. }
  6856. o.append(h), a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6857. }
  6858. ;(j = 144 * Fe),
  6859. (Y = 111 * Fe),
  6860. $('.thumbImg').on('mouseover', function () {
  6861. I(t) || i.showPathToHeroLocation([$(this).data('index'), 0]) //改
  6862. }),
  6863. $('.thumbImg').on('mouseout', function () {
  6864. t.clearPath()
  6865. }),
  6866. $('.thumbImg').on('click', function (e) {
  6867. l(e)
  6868. var i = $(this)
  6869. J.updateInteraction(Se.InteractionGui, 'thumbnail'),
  6870. J.trackAlways('showcase_gui', {
  6871. gui_action: 'click_highlight'
  6872. }),
  6873. t.goToHighlight([i.data('index'), 0]) //改
  6874. }),
  6875. $('.sectionCont').on('click', function (e) {
  6876. const imgActIndex = $(this).data('index')
  6877. console.log('imgActIndex')
  6878. t.goToHighlight([imgActIndex, 0])
  6879. }),
  6880. $('.previous')
  6881. .find('a')
  6882. .on('click', function (e) {
  6883. l(e),
  6884. J.trackAlways('showcase_gui', {
  6885. gui_action: 'prev_highlight'
  6886. }),
  6887. t.prevHighlight()
  6888. }),
  6889. $('.next')
  6890. .find('a')
  6891. .on('click', function (e) {
  6892. l(e),
  6893. J.trackAlways('showcase_gui', {
  6894. gui_action: 'next_highlight'
  6895. }),
  6896. t.nextHighlight()
  6897. }),
  6898. $('#drawer').on('mouseleave', function (e) {
  6899. l(e)
  6900. var t
  6901. try {
  6902. t = new MouseEvent('mouseup', {
  6903. clientX: e.clientX,
  6904. clientY: e.clientY,
  6905. screenX: e.screenX,
  6906. screenY: e.screenY
  6907. })
  6908. } catch (i) {
  6909. ;(t = document.createEvent('MouseEvents')),
  6910. t.initMouseEvent(
  6911. 'mouseup',
  6912. e.bubbles,
  6913. e.cancelable,
  6914. e.view,
  6915. e.detail,
  6916. e.screenX,
  6917. e.screenY,
  6918. e.clientX,
  6919. e.clientY,
  6920. e.ctrlKey,
  6921. e.altKey,
  6922. e.shiftKey,
  6923. e.metaKey,
  6924. e.button,
  6925. e.relatedTarget
  6926. )
  6927. }
  6928. document.dispatchEvent(t)
  6929. }),
  6930. (W = new Sly($('#scrollFrame'), {
  6931. horizontal: !0,
  6932. itemNav: 'centered',
  6933. smart: !0,
  6934. scrollTrap: !0,
  6935. scrollBy: 1,
  6936. mouseDragging: !0,
  6937. touchDragging: !0,
  6938. speed: 300,
  6939. dragHandle: !0,
  6940. dynamicHandle: !0,
  6941. clickBar: !0,
  6942. scrollBar: $('#scroller'),
  6943. activateOn: null
  6944. }).init()),
  6945. W.on('active', function (e, t) {
  6946. ;(Ve = t),
  6947. Ze('tour'),
  6948. $('.step').removeClass('active'),
  6949. $('#status')
  6950. .find('.curIdx')
  6951. .text(t + 1)
  6952. for (var i = 0; i <= t; i++)
  6953. $('#progressBar')
  6954. .find("[data-idx='" + i + "']")
  6955. .addClass('active')
  6956. }),
  6957. w()
  6958. //add :
  6959. let scrollFrame = $(W.frame)
  6960. scrollFrame.on('wheel.sly', function () {
  6961. lastMoveScrollTime = Date.now()
  6962. })
  6963. let dragstart
  6964. /* scrollFrame.on("pointerdown", function() {
  6965. dragstart = true
  6966. })
  6967. scrollFrame.on("pointerup", function() {
  6968. dragstart = false
  6969. }) */
  6970. scrollFrame.on('pointermove', function () {
  6971. //if(dragstart){
  6972. lastMoveScrollTime = Date.now()
  6973. //}
  6974. })
  6975. }
  6976. function w() {
  6977. var e = $('#player').width() - 20,
  6978. t = $('#scroller'),
  6979. i = $('#drawer'),
  6980. n = $('.pinBottom')
  6981. if ($('#player').width() < 488 || $('#player').height() < 488) t.addClass('hidden'), i.addClass('noScroll'), n.addClass('noScroll')
  6982. else {
  6983. var r = j > e,
  6984. o = !i.hasClass('noScroll'),
  6985. a = r !== o
  6986. a && (t.toggleClass('hidden'), i.toggleClass('noScroll'), n.toggleClass('noScroll'))
  6987. }
  6988. }
  6989. function _(e) {
  6990. je.tourControls.visible = true //e.tour_buttons && K.valueFromHash("gt", 1),
  6991. ;(je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash('mls', !1)),
  6992. (je.highlight.visible = /* e.highlight_reel && */ 1 !== Q.specialEdition && Q.showHighlights)
  6993. }
  6994. function T(e) {
  6995. function t(t, i) {
  6996. return !!e.player_options[t] && e[i || t]
  6997. }
  6998. $('.model-title').text(e.name)
  6999. var i = Q.pageTitle
  7000. // 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  7001. 2 !== K.valueFromHash('mls', 0) && e.name && (i = e.name),
  7002. (document.title = i),
  7003. K.isMobile()
  7004. ? $('#gui-fullscreen').css('display', 'none')
  7005. : ($('[rel=tooltip]').tooltip({
  7006. delay: {
  7007. show: 50,
  7008. hide: 0
  7009. },
  7010. trigger: 'hover',
  7011. html: !1,
  7012. viewport: {
  7013. selector: 'body',
  7014. padding: 10
  7015. }
  7016. }),
  7017. K.inIframe() && document.getElementsByClassName('pinBottom-container')[0].classList.add('embed')),
  7018. // 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"),
  7019. de.populate({
  7020. name: t('model_name', 'name'),
  7021. coBrand: t('presented_by'),
  7022. description: t('model_summary', 'summary') || '暂无内容',
  7023. contactName: t('contact_name'),
  7024. address: t('address'),
  7025. phone: t('contact_phone'),
  7026. formattedPhone: e.formatted_contact_phone,
  7027. email: t('contact_email'),
  7028. url: t('external_url'),
  7029. socialSharing: e.enable_social_sharing && e.is_public
  7030. })
  7031. }
  7032. function x(e, t, i, n, r, o) {
  7033. function a() {
  7034. o.setLoadingStartTime(), H(), r ? (re.showMessage(t, i, je.coBrand.visible), l()) : h(l)
  7035. }
  7036. var s = $.Deferred(),
  7037. l = s.resolve.bind(s)
  7038. return (
  7039. (Ge = !0),
  7040. O(e),
  7041. e.data.player_options && _(e.data.player_options),
  7042. 1 === Q.specialEdition && $('body').addClass('specialEdition'),
  7043. Re.localizeGUI(),
  7044. T(e.data),
  7045. r || $('.quick').addClass('hidden'),
  7046. //e.data.image && !r && E(e.data.image),
  7047. n ? (J.impression(), a()) : (o.setWaitingStartTime(), oe.show(r, a)),
  7048. s
  7049. )
  7050. }
  7051. function S(e, t, i, n, r, a, s) {
  7052. ;(q = s),
  7053. e.outsideAllowed() || $('#gui-modes-outside').addClass('invisible'),
  7054. e.supportedModes[_e.PANORAMA] || $('#gui-modes-inside').addClass('invisible'),
  7055. ae.init(),
  7056. re.init(e, a),
  7057. Oe.init(e, t, n),
  7058. $('.icon').on('mouseover', function () {
  7059. t.player && t.player.reticule.hide()
  7060. }),
  7061. m(e, t),
  7062. A(e, t),
  7063. e.data.enable_social_sharing &&
  7064. e.data.is_public &&
  7065. Q.share.enabled &&
  7066. (Ce.init(window.DATA.name /* e.data.name */),
  7067. Ce.on(
  7068. Me.OPENED,
  7069. (function () {
  7070. var e = document.getElementById('share-modal')
  7071. return function () {
  7072. Ze('share'), le.open(e)
  7073. }
  7074. })()
  7075. ),
  7076. Ce.on(Me.CLOSED, le.reset)),
  7077. e.heroLocations.length > 0 ? b(e, t, i) : ((je.highlight.visible = !1), (je.tourControls.visible = !1)),
  7078. de.on(pe.OPEN_INFO, Ze.bind(this, 'info')),
  7079. z(),
  7080. g(i),
  7081. v(e, r),
  7082. e.on('floor.changed', C),
  7083. e.on('waiting', R.bind(this, e)),
  7084. e.on('waiting-done', P.bind(this, e)),
  7085. i.on(xe.ModeChanged, function (e, n) {
  7086. g(i), o(t, i), n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR), he.updateMode(n)
  7087. }),
  7088. n.on(Se.Move, Ze.bind(this, 'move')),
  7089. i.on(xe.Ready, function () {
  7090. ie.init(n, i, i.tagManager, t),
  7091. i.on(xe.ModeChanged, function (e, t) {
  7092. e !== t && $('.vr-popup').is(':visible') && Ae.dismiss()
  7093. })
  7094. }),
  7095. i.on(xe.PanoChosen, function (e, t) {
  7096. g(i, t), he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  7097. }),
  7098. le.on(ce.CLOSE, function (e) {
  7099. switch (e) {
  7100. case 'vr-modal':
  7101. Ae.dismiss()
  7102. break
  7103. case 'share-modal':
  7104. Ce.hide()
  7105. break
  7106. case 'terms-modal':
  7107. fe.hide()
  7108. }
  7109. })
  7110. var l = $('#play').eq(0),
  7111. c = $('#pause').eq(0),
  7112. h = $('.pinBottom').toArray(),
  7113. u = $('#drawer').eq(0),
  7114. d = $('#playHead').eq(0),
  7115. p = $('#progressBar').eq(0),
  7116. f = $('#thumb-container').eq(0),
  7117. y = f.children(),
  7118. I = p.children()
  7119. t.on('update.controls', function () {
  7120. //导览控制
  7121. var n = t.describe()
  7122. n.tourIsPlaying || i.isWarping()
  7123. ? (je.tourControls.visible && (l.hide(), c.show()),
  7124. n.tourInProgress &&
  7125. (h.forEach(function (e) {
  7126. e.classList.add('playing')
  7127. }),
  7128. u.addClass('playing'),
  7129. d.addClass('playing')))
  7130. : (je.tourControls.visible && (l.show(), c.hide()),
  7131. n.tourInProgress ||
  7132. (ve.stopTour(),
  7133. h.forEach(function (e) {
  7134. e.classList.remove('playing')
  7135. }),
  7136. u.removeClass('playing'),
  7137. d.removeClass('playing')))
  7138. var r, a, s
  7139. if (null !== n.currentItem) {
  7140. var p, f
  7141. $('#status')
  7142. .find('.curIdx')
  7143. .text(n.currentItem[0] + 1),
  7144. n.onTheBus ? ((p = 'active'), (f = 'recent')) : ((f = 'active'), (p = 'recent'))
  7145. var g = null === n.destinationItem || n.currentItem[0] === n.destinationItem[0]
  7146. /* for (r = 0; r < e.heroLocations.length; r += 1)
  7147. s = y.eq(r),
  7148. a = I.eq(r),
  7149. s.removeClass(f),
  7150. a.removeClass(f),
  7151. n.onTheBus && r === n.destinationItem[0] ? (s.addClass(p),
  7152. a.addClass(p),
  7153. W.activate(r)) : n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p),
  7154. a.addClass(p)) : (s.removeClass(p),
  7155. a.removeClass(p)) */
  7156. for (r = 0; r < e.heroLocations.length; r += 1) {
  7157. ;(s = y.eq(r)), (a = I.eq(r)), s.removeClass(f), a.removeClass(f)
  7158. if (n.onTheBus && r === n.destinationItem[0]) {
  7159. s.addClass(p)
  7160. a.addClass(p)
  7161. if (Date.now() - lastMoveScrollTime > 2000) {
  7162. //add 如果一段时间内用户不操作scrollbar,才focus回这个item
  7163. W.activate(r) // scrollbar slide to this
  7164. }
  7165. } else {
  7166. n.onTheBus && g && r === n.currentItem[0] ? (s.addClass(p), a.addClass(p)) : (s.removeClass(p), a.removeClass(p))
  7167. }
  7168. }
  7169. } else for (r = 0; r < e.heroLocations.length; r += 1) (s = y.eq(r)), (a = I.eq(r)), s.removeClass('active recent'), a.removeClass('active recent')
  7170. o(t, i)
  7171. }),
  7172. document.addEventListener(
  7173. 'keydown',
  7174. function (n) {
  7175. switch ((J.updateInteraction(Se.InteractionKey), n.which)) {
  7176. case we.ZERO:
  7177. Q.debug && e.toggleAlpha()
  7178. break
  7179. case we.NINE:
  7180. Q.debug && se.toggle()
  7181. break
  7182. case we.ONE:
  7183. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA)
  7184. break
  7185. case we.TWO:
  7186. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE)
  7187. break
  7188. case we.THREE:
  7189. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN)
  7190. break
  7191. case we.FOUR:
  7192. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR)
  7193. break
  7194. case we.SPACE:
  7195. je.tourControls.visible && ($('#playHead').hasClass('playing') || Ze('tour'))
  7196. break
  7197. case we.RETURN:
  7198. Q.debug && e.toggleExplodeUp()
  7199. break
  7200. case we.P:
  7201. k()
  7202. break
  7203. case we.U:
  7204. B()
  7205. break
  7206. case we.X:
  7207. Q.debug && e.toggleExplode()
  7208. break
  7209. case we.PLUSEQUALS:
  7210. t.player.activatePersistentZooming(!0), ie.hideUi()
  7211. break
  7212. case we.DASHUNDERSCORE:
  7213. t.player.activatePersistentZooming(!1), ie.hideUi()
  7214. break
  7215. case we.SEVEN:
  7216. De.info('Zoom level: ' + t.player.zoomLevel + ', FOV: ' + t.player.zoomFov)
  7217. break
  7218. case we.EIGHT:
  7219. t.player.decreaseZoomSpeed()
  7220. break
  7221. case we.NINE:
  7222. t.player.increaseZoomSpeed()
  7223. }
  7224. return i && i.reticule.hide(), !0
  7225. }.bind(this)
  7226. ),
  7227. document.addEventListener(
  7228. 'keyup',
  7229. function (e) {
  7230. switch (e.which) {
  7231. case we.PLUSEQUALS:
  7232. t.player.deactivatePersistentZooming()
  7233. break
  7234. case we.DASHUNDERSCORE:
  7235. t.player.deactivatePersistentZooming()
  7236. }
  7237. }.bind(this)
  7238. ),
  7239. F(e),
  7240. L(e, t.player),
  7241. M(i),
  7242. te.setAutoPlay(e.heroCount()),
  7243. he.init(i, a.mode),
  7244. he.on(ue.OPENED, Ze.bind(this, 'help')),
  7245. fe.init(),
  7246. fe.on(
  7247. ge.OPENED,
  7248. (function () {
  7249. var e = document.getElementById('terms-modal')
  7250. return function () {
  7251. Ze('terms'), le.open(e)
  7252. }
  7253. })()
  7254. ),
  7255. fe.on(ge.CLOSED, le.reset),
  7256. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  7257. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  7258. Q.profiling.enabled && se.show(),
  7259. ve.init(t)
  7260. }
  7261. function M(e) {
  7262. var t = function (e, t) {
  7263. $(e)
  7264. .find('a')
  7265. .each(function (e, i) {
  7266. t ? $(i).removeClass('buttonZoomDisabled').addClass('buttonZoomEnabled') : $(i).addClass('buttonZoomDisabled').removeClass('buttonZoomEnabled'),
  7267. (i.style.pointerEvents = t ? 'auto' : 'none')
  7268. })
  7269. },
  7270. i = function () {
  7271. e.zoomLevel >= Q.zoom.max ? t('#gui-zoomin', !1) : t('#gui-zoomin', !0), e.zoomLevel <= Q.zoom.min ? t('#gui-zoomout', !1) : t('#gui-zoomout', !0)
  7272. }
  7273. e.on(Ne.ZoomMax, function () {
  7274. t('#gui-zoomin', !1), t('#gui-zoomout', !0)
  7275. }),
  7276. e.on(Ne.ZoomMin, function () {
  7277. t('#gui-zoomin', !0), t('#gui-zoomout', !1)
  7278. }),
  7279. e.on(Ne.ZoomIn, function () {
  7280. t('#gui-zoomout', !0)
  7281. }),
  7282. e.on(Ne.ZoomOut, function () {
  7283. t('#gui-zoomin', !0)
  7284. }),
  7285. i()
  7286. }
  7287. function R(e) {
  7288. O(e)
  7289. }
  7290. function P(e) {
  7291. O(e)
  7292. }
  7293. function O(e) {
  7294. var t = e.waitQueue.length
  7295. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  7296. }
  7297. function L(e, t) {
  7298. He = {
  7299. gui: null,
  7300. visible: !1,
  7301. model: e,
  7302. player: t
  7303. }
  7304. }
  7305. function D(e, t) {
  7306. function i() {
  7307. var i = t.toJSON()
  7308. ;(n.linkToLocation = window.location.protocol + '//' + window.location.host + window.location.pathname + '?m=' + e.sid + '&start=' + be.serialize(i)),
  7309. t.tagManager.activeTag && (n.linkToLocation += '&tag=' + t.tagManager.activeTag.sid)
  7310. }
  7311. var n = {},
  7312. r = new Le.GUI({
  7313. autoPlace: !0,
  7314. width: '60%'
  7315. })
  7316. i(), t.on(xe.ViewChanged, i), r.add(n, 'linkToLocation').name(Re.LINK_TO_LOCATION).listen(), (r.domElement.id = 'datLinks')
  7317. var o = [].slice.call(r.domElement.querySelectorAll('.property-name'))
  7318. return (
  7319. o.forEach(function (e) {
  7320. if (!K.detectSafari()) {
  7321. var t = document.createElement('button')
  7322. t.classList.add('btn-deep-link'), (t.innerText = Re.MENU_COPY), e.nextSibling.appendChild(t)
  7323. var i = function () {
  7324. alert(Re.LINK_ALERT_COPY), t.hide()
  7325. }
  7326. t.addEventListener('click', function (e) {
  7327. try {
  7328. var t = e.target.parentNode.childNodes[0]
  7329. t.select()
  7330. var n = document.execCommand('copy')
  7331. t.blur(), n || i()
  7332. } catch (e) {
  7333. i()
  7334. }
  7335. })
  7336. }
  7337. }),
  7338. $(r.__closeButton).hide(),
  7339. r
  7340. )
  7341. }
  7342. function N(e) {
  7343. He.gui || (He.gui = D(He.model, He.player)), (He.visible = e), e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  7344. }
  7345. function B() {
  7346. N(!He.visible)
  7347. }
  7348. function F(e) {
  7349. ke = {
  7350. gui: null,
  7351. visible: !1,
  7352. model: e
  7353. }
  7354. }
  7355. function V(e) {
  7356. var t = new Le.GUI()
  7357. return (
  7358. t
  7359. .add(Q, 'showSweeps')
  7360. .name('Show sweeps')
  7361. .onFinishChange(function () {
  7362. e.setSweepVisibility(Q.showSweeps)
  7363. }),
  7364. t.add(Q, 'rotationAccelerationInside', 0.1, 10).name('Rotation speed').step(0.1),
  7365. t
  7366. .add(Q.transition, 'flyTime', 0, 5e3)
  7367. .name('Transition time')
  7368. .onFinishChange(function () {
  7369. ;(Q.transition.flySpeed = 0),
  7370. t.__controllers.forEach(function (e) {
  7371. e.updateDisplay()
  7372. })
  7373. }),
  7374. t.add(Q.path, 'opacity', 0, 1).name('Path opacity'),
  7375. $(t.__closeButton).hide(),
  7376. t
  7377. )
  7378. }
  7379. function U(e) {
  7380. ke.gui || (ke.gui = V(ke.model)), (ke.visible = e), e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  7381. }
  7382. function k() {
  7383. U(!ke.visible)
  7384. }
  7385. function H() {
  7386. function e(e) {
  7387. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) /* || e.preventDefault()*/
  7388. }
  7389. $('body').css('touch-action', 'none'),
  7390. $('#gui-parent')
  7391. .find('*:not(#tag-billboards)')
  7392. .on('touchmove', function (e) {
  7393. // e.preventDefault()
  7394. })
  7395. var t = document.getElementById('terms-text'),
  7396. i = document.getElementById('more-help-wrapper'),
  7397. n = (document.getElementById('navigation-help-wrapper'), document.getElementById('help-dialog'), document.getElementById('tag-billboards'))
  7398. Q.useWheel && (document.body.addEventListener('mousewheel', e, { passive: false }), document.body.addEventListener('DOMMouseScroll', e)),
  7399. $('#terms-text, #more-help-wrapper, #navigation-help-wrapper')
  7400. .off('touchmove')
  7401. .on('touchmove', function (e) {
  7402. e.stopPropagation()
  7403. })
  7404. }
  7405. function G(e, t) {
  7406. for (var i = []; e; ) i.push(e), (e = e.parentNode)
  7407. for (; t && i.indexOf(t) === -1; ) t = t.parentNode
  7408. return t
  7409. }
  7410. function z() {
  7411. var e,
  7412. t = function (t) {
  7413. e = 0 === t.button || 1 === t.which ? t.target : null
  7414. },
  7415. i = function (t) {
  7416. e !== t.target && (e = G(e, t.target))
  7417. var i = document.getElementById('gui-parent')
  7418. if ((G(i, e) !== i && (e = null), e)) {
  7419. var n
  7420. try {
  7421. n = new MouseEvent('click', t)
  7422. } catch (e) {
  7423. ;(n = document.createEvent('MouseEvents')),
  7424. n.initMouseEvent(
  7425. 'click',
  7426. t.bubbles,
  7427. t.cancelable,
  7428. t.view,
  7429. t.detail,
  7430. t.screenX,
  7431. t.screenY,
  7432. t.clientX,
  7433. t.clientY,
  7434. t.ctrlKey,
  7435. t.altKey,
  7436. t.shiftKey,
  7437. t.metaKey,
  7438. t.button,
  7439. t.relatedTarget
  7440. )
  7441. }
  7442. ;(n.syntheticClick = !0), e.dispatchEvent(n), (e = null)
  7443. }
  7444. }
  7445. document.body.addEventListener('mousedown', t, !0),
  7446. document.body.addEventListener('mouseup', i, !0),
  7447. document.getElementById('gui-parent').addEventListener(
  7448. 'click',
  7449. function (e) {
  7450. e.syntheticClick || (e.stopPropagation(), 'A' === e.target.nodeName && e.preventDefault())
  7451. },
  7452. !0
  7453. )
  7454. }
  7455. var lastMoveScrollTime = 0 //add
  7456. var W,
  7457. j,
  7458. Y,
  7459. X,
  7460. Z,
  7461. q,
  7462. K = (e('three'), e('../util/ajax'), e('../util/browser')),
  7463. Q = e('../settings'),
  7464. J = e('../analytics'),
  7465. ee = (e('../util/transitions'), e('../util/camera'), e('../util/logger')),
  7466. te = (e('../objects/Snapshot'), e('./helpManager')),
  7467. ie = e('./immersiveMode'),
  7468. ne = e('./loadingScreen'),
  7469. re = e('./landingScreen'),
  7470. oe = e('./playButton'),
  7471. ae = e('./populateModal'),
  7472. se = e('./memoryUsage'),
  7473. le = e('./closer/modalCloser'),
  7474. ce = e('./closer/ModalCloserEvent'),
  7475. he = e('./help/help'),
  7476. ue = e('./help/HelpEvent'),
  7477. de = e('./title/titleBar'),
  7478. pe = e('./title/TitleEvents'),
  7479. fe = e('./terms/terms'),
  7480. ge = e('./terms/TermsEvent'),
  7481. me = e('./title/tagToggle'),
  7482. ve = e('./tourInteraction'),
  7483. Ae = e('./vr/vrModal'),
  7484. ye = e('./vr/vrEvent'),
  7485. Ce = e('./sharing/modal'),
  7486. Ie = e('./webvr/webVRgui'),
  7487. Ee = e('./webvr/WebVrEvent'),
  7488. be = e('../controls/serializer'),
  7489. we = e('../enum/Keys'),
  7490. _e = e('../enum/Viewmode'),
  7491. Te = (e('../enum/BlackoutStyle'), e('../tag/Media/MediaEvent')),
  7492. xe = (e('../enum/PathDiscardMode'), e('../enum/PathDisplayMode'), e('../enum/DirectorEvents'), e('../enum/PlayerEvents')),
  7493. Se = e('../enum/ControlEvents'),
  7494. Me = e('./sharing/ShareEvents'),
  7495. Re = e('../localization/localize'),
  7496. Pe = (e('../enum/Vectors'), e('../enum/WarpStyle'), e('../enum/AlignmentType'), e('../enum/VROption')),
  7497. Oe = e('./konami'),
  7498. Le = e('../lib/dat.gui'),
  7499. De = new ee(i),
  7500. Ne = (e('../util/showcase'), e('../enum/ZoomEvents')),
  7501. Be = _e.DOLLHOUSE,
  7502. Fe = 0,
  7503. Ve = 0,
  7504. Ue = ['.hideTarget'],
  7505. ke = null,
  7506. He = null,
  7507. Ge = !1,
  7508. ze = !1,
  7509. We = !1,
  7510. je = {
  7511. coBrand: {
  7512. visible: !0,
  7513. elements: ['.co-brand', '#loaderCoBrand']
  7514. },
  7515. help: {
  7516. visible: !0,
  7517. elements: ['.nav-help', '#nav-help']
  7518. },
  7519. tourControls: {
  7520. visible: !0,
  7521. elements: ['.next', '.previous', '#play']
  7522. },
  7523. highlight: {
  7524. visible: !0,
  7525. elements: ['#drawer', '#pullTab']
  7526. },
  7527. share: {
  7528. visible: !0,
  7529. elements: ['.socialButton', '#share']
  7530. },
  7531. fullScreen: {
  7532. visible: !0,
  7533. elements: ['#gui-fullscreen']
  7534. },
  7535. floors: {
  7536. visible: !0,
  7537. elements: ['.gui-floor']
  7538. }
  7539. },
  7540. Ye = (function () {
  7541. var e = document.getElementById('drawer')
  7542. return function () {
  7543. $('#player').height() < 400 && e.classList.contains('open') && a()
  7544. }
  7545. })(),
  7546. Xe = (function () {
  7547. var e = document.getElementById('meta-info')
  7548. return function () {
  7549. $('#player').height() < 400 && e.classList.contains('expand') && de.toggleMeta(!0)
  7550. }
  7551. })(),
  7552. Ze = (function (e) {
  7553. function t() {
  7554. u.classList.contains('expand') && de.toggleMeta(!0)
  7555. }
  7556. function i() {
  7557. fe.hide()
  7558. }
  7559. function n() {
  7560. he.close()
  7561. }
  7562. function r() {
  7563. Ae.dismiss()
  7564. }
  7565. function o() {
  7566. p.hasClass('open') && a(!0)
  7567. }
  7568. function l() {
  7569. Ce.hide()
  7570. }
  7571. function c() {
  7572. f.hasClass('open') && f.removeClass('open')
  7573. }
  7574. function h() {
  7575. d.classList.contains('fadeIn') && (d.classList.contains('landing') ? re.dismissModal() : d.classList.contains('tour') && ve.dismissModal())
  7576. }
  7577. var u = document.getElementById('meta-info'),
  7578. d = document.getElementById('interaction-modal'),
  7579. p = $('#drawer').eq(0),
  7580. f = $('.gui-floor').eq(0),
  7581. g = $('.vr-popup').eq(0)
  7582. return function (e) {
  7583. switch (e) {
  7584. case 'info':
  7585. i(), n(), Ye(), l(), c(), r(), h()
  7586. break
  7587. case 'terms':
  7588. t(), n(), o(), l(), c(), r(), h()
  7589. break
  7590. case 'help':
  7591. t(), i(), l(), c(), r(), h()
  7592. break
  7593. case 'vr':
  7594. t(), i(), l(), c(), n(), h(), s(g) && o()
  7595. break
  7596. case 'highlights':
  7597. Xe(), i(), l(), c()
  7598. break
  7599. case 'share':
  7600. t(), i(), n(), c(), r(), h()
  7601. break
  7602. case 'floor':
  7603. i(), l(), r()
  7604. break
  7605. case 'view':
  7606. c(), l(), i(), r()
  7607. break
  7608. case 'tour':
  7609. i(), l(), c(), r()
  7610. break
  7611. case 'move':
  7612. i(), l(), c(), r()
  7613. break
  7614. case 'resize':
  7615. t(), Ye(), c()
  7616. break
  7617. case 'tag':
  7618. i(), n(), l(), c(), r()
  7619. }
  7620. }
  7621. })()
  7622. $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', function (e) {
  7623. $('#gui-fullscreen').toggle(!K.isFullscreen()),
  7624. $('#gui-fullscreen-exit').toggle(!!K.isFullscreen()),
  7625. setTimeout(function () {
  7626. $('.icon:visible').hide().show(0)
  7627. }, 100)
  7628. }),
  7629. $('#gui-fullscreen')
  7630. .find('a')
  7631. .on('click', function (e) {
  7632. l(e),
  7633. K.requestFullscreen($('body')[0]),
  7634. J.track('showcase_gui', {
  7635. gui_action: 'click_enter_fullscreen',
  7636. interaction_source: 'gui'
  7637. })
  7638. //czj
  7639. //W.reload()
  7640. }),
  7641. $('#gui-fullscreen-exit')
  7642. .find('a')
  7643. .on('click', function (e) {
  7644. l(e),
  7645. K.exitFullscreen(),
  7646. J.track('showcase_gui', {
  7647. gui_action: 'click_exit_fullscreen',
  7648. interaction_source: 'gui'
  7649. })
  7650. })
  7651. $(window)
  7652. .on('resize', function (e) {
  7653. var t = e.target.innerHeight,
  7654. i = e.target.innerWidth
  7655. ;(t === X && i === Z) || (je.highlight.visible && w(), Ze('resize'), $('.pinTop.right').removeClass('hideUnderMeta'), c(), (X = t), (Z = i))
  7656. })
  7657. .resize(),
  7658. K.supportsFullscreen() || $('#gui-fullscreen').hide(),
  7659. $('#pullTab').on('click', function (e) {
  7660. l(e),
  7661. $('#drawer').hasClass('open')
  7662. ? (J.trackAlways('showcase_gui', {
  7663. gui_action: 'hide_highlight_reel'
  7664. }),
  7665. $(this).addClass('open').children('img').attr('src', 'images/auto.png'))
  7666. : (J.trackAlways('showcase_gui', {
  7667. gui_action: 'show_highlight_reel'
  7668. }),
  7669. $(this).removeClass('open').children('img').attr('src', 'images/auto-suspend.png'))
  7670. a()
  7671. })
  7672. /***********************方奕卓 热点列表事件监听 ************************/
  7673. if (window.DATA.showHotListSta) {
  7674. $('#hotList').css('display', '')
  7675. $('#hotList').on('click', function (e) {
  7676. l(e)
  7677. var hotList = $('#hotListWrap')[0]
  7678. var isActive = hotList.classList.contains('hotListActive')
  7679. if (isActive) {
  7680. hotList.classList.remove('hotListActive')
  7681. this.classList.remove('active')
  7682. } else {
  7683. hotList.classList.add('hotListActive')
  7684. this.classList.add('active')
  7685. }
  7686. }),
  7687. $('#hotListContent ul').on('mouseover', function (e) {
  7688. l(e)
  7689. var target = e.target
  7690. var hotList = document.getElementById('hotListWrap')
  7691. if (target.tagName === 'SPAN') {
  7692. var targetParent = target.parentElement.parentElement
  7693. if (target.offsetWidth + 116 >= targetParent.clientWidth) {
  7694. hotList.style.width = target.offsetWidth + 116 + 'px'
  7695. } else {
  7696. hotList.style.width = ''
  7697. }
  7698. } else if (target.tagName === 'LI') {
  7699. var targetParent = target.parentElement
  7700. if (target.children[0].offsetWidth + 116 >= targetParent.clientWidth) {
  7701. hotList.style.width = target.children[0].offsetWidth + 116 + 'px'
  7702. } else {
  7703. hotList.style.width = ''
  7704. }
  7705. } else {
  7706. hotList.style.width = ''
  7707. }
  7708. })
  7709. $('#hotListContent ul').on('click', function (e) {
  7710. l(e)
  7711. this.preElem && this.preElem.classList.remove('active')
  7712. if (e.target.tagName === 'SPAN') {
  7713. e.target.parentElement.classList.add('active')
  7714. e.target.parentElement.hot && e.target.parentElement.hot.examine(window.player, true) // 打开热点
  7715. this.preElem = e.target.parentElement
  7716. } else {
  7717. e.target.classList.add('active')
  7718. e.target.hot && e.target.hot.examine(window.player, true) // 打开热点
  7719. this.preElem = e.target
  7720. }
  7721. })
  7722. $('#hotListClose').on('click', function (e) {
  7723. l(e)
  7724. var hotList = $('#hotListWrap')[0]
  7725. hotList.classList.remove('hotListActive')
  7726. $('#hotListContent ul .active').removeClass('active')
  7727. $('#hotList')[0].classList.remove('active')
  7728. })
  7729. }
  7730. /*****************************************************************/
  7731. $('#more-menu-button').on('click', function (e) {
  7732. l(e)
  7733. var t = $('#more-menu')
  7734. t.toggleClass('open')
  7735. }),
  7736. (t.exports.init = S),
  7737. (t.exports.startLoading = x),
  7738. (t.exports.endLoading = d),
  7739. (t.exports.onProgress = u)
  7740. }).call(this, '/js/gui/gui.js')
  7741. },
  7742. {
  7743. '../analytics': 4,
  7744. '../controls/serializer': 14,
  7745. '../enum/AlignmentType': 17,
  7746. '../enum/BlackoutStyle': 18,
  7747. '../enum/ControlEvents': 21,
  7748. '../enum/DirectorEvents': 23,
  7749. '../enum/Keys': 30,
  7750. '../enum/PathDiscardMode': 38,
  7751. '../enum/PathDisplayMode': 39,
  7752. '../enum/PlayerEvents': 40,
  7753. '../enum/VROption': 47,
  7754. '../enum/Vectors': 50,
  7755. '../enum/Viewmode': 51,
  7756. '../enum/WarpStyle': 52,
  7757. '../enum/ZoomEvents': 53,
  7758. '../lib/dat.gui': 93,
  7759. '../localization/localize': 108,
  7760. '../tag/Media/MediaEvent': 131,
  7761. '../objects/Snapshot': 153,
  7762. '../settings': 166,
  7763. '../util/ajax': 181,
  7764. '../util/browser': 182,
  7765. '../util/camera': 183,
  7766. '../util/logger': 189,
  7767. '../util/showcase': 193,
  7768. '../util/transitions': 195,
  7769. './closer/ModalCloserEvent': 61,
  7770. './closer/modalCloser': 62,
  7771. './help/HelpEvent': 66,
  7772. './help/help': 67,
  7773. './helpManager': 68,
  7774. './immersiveMode': 69,
  7775. './konami': 70,
  7776. './landingScreen': 71,
  7777. './loadingScreen': 72,
  7778. './memoryUsage': 73,
  7779. './playButton': 74,
  7780. './populateModal': 75,
  7781. './sharing/ShareEvents': 76,
  7782. './sharing/modal': 77,
  7783. './terms/TermsEvent': 78,
  7784. './terms/terms': 79,
  7785. './title/TitleEvents': 80,
  7786. './title/tagToggle': 81,
  7787. './title/titleBar': 82,
  7788. './tourInteraction': 84,
  7789. './vr/vrEvent': 85,
  7790. './vr/vrModal': 87,
  7791. './webvr/WebVrEvent': 88,
  7792. './webvr/webVRgui': 89,
  7793. three: 217
  7794. }
  7795. ],
  7796. 66: [
  7797. function (e, t, i) {
  7798. 'use strict'
  7799. t.exports = Object.freeze({
  7800. OPENED: 'help.opened',
  7801. CLOSED: 'help.closed'
  7802. })
  7803. },
  7804. {}
  7805. ],
  7806. 67: [
  7807. function (e, t, i) {
  7808. 'use strict'
  7809. function n() {
  7810. g.on('click', function (e) {
  7811. if (S && S !== l.TRANSITIONING) {
  7812. var t = window.getComputedStyle(y).getPropertyValue('opacity') > 0
  7813. t && !M ? R.close() : r()
  7814. }
  7815. }),
  7816. w.on('click', function (e) {
  7817. R.close()
  7818. }),
  7819. E.on('click', function (e) {
  7820. S && S !== l.TRANSITIONING && (s(), o())
  7821. }),
  7822. b.on('click', function (e) {
  7823. s(), a()
  7824. })
  7825. }
  7826. function r() {
  7827. S &&
  7828. S !== l.TRANSITIONING &&
  7829. ((M = !0),
  7830. setTimeout(function () {
  7831. M = !1
  7832. }, d.help.modalStayDuration),
  7833. R.emit(h.OPENED),
  7834. m.addClass('open ' + S),
  7835. g.addClass('open'),
  7836. s(),
  7837. o(),
  7838. y.style.removeProperty ? y.style.removeProperty('display') : y.style.removeAttribute('display'),
  7839. y.classList.add('fadeIn'))
  7840. }
  7841. function o() {
  7842. E.addClass('underline-tab'), u.fill(_, c.NAVIGATION, S), m.addClass(S)
  7843. }
  7844. function a() {
  7845. b.addClass('underline-tab'), u.fill(T, c.MORE_HELP), m.addClass('more-help')
  7846. }
  7847. function s(e, t) {
  7848. m.removeClass('more-help ' + l.PANORAMA + ' ' + l.DOLLHOUSE + ' ' + l.FLOORPLAN + ' ' + l.OUTDOOR),
  7849. I.forEach(function (e) {
  7850. e.classList.remove('underline-tab')
  7851. })
  7852. }
  7853. var l = e('../../enum/Viewmode'),
  7854. c = e('../../enum/HelpModalType'),
  7855. h = e('./HelpEvent'),
  7856. u = (e('../helpManager'), e('./../populateModal')),
  7857. d = e('../../settings'),
  7858. p = e('../../util/common'),
  7859. f = e('events').EventEmitter,
  7860. g = $('.footer-help').eq(0),
  7861. m = $('#help-dialog').eq(0),
  7862. v = document.querySelector('#quick-logo'),
  7863. A = document.querySelector('#loaderCoBrand'),
  7864. y = document.querySelector('#help-dialog'),
  7865. C = document.querySelector('.footer'),
  7866. I = $('.help-tabs').children().toArray(),
  7867. E = $('.navigation-tab').eq(0),
  7868. b = $('.more-help-tab').eq(0),
  7869. w = ($('#interaction-modal').eq(0).find('.interaction').toArray(), m.find('.close').eq(0)),
  7870. _ = m.find('.interactions').toArray(),
  7871. T = m.find('.ui-instructions').toArray(),
  7872. x = l.PANORAMA,
  7873. S = l.PANORAMA,
  7874. M = !1,
  7875. R = {
  7876. init: function (e, t) {
  7877. ;(S = t),
  7878. (x = t),
  7879. [y, A, v, C].forEach(function (e) {
  7880. e.classList.add(u.deviceType)
  7881. }),
  7882. n()
  7883. },
  7884. close: function () {
  7885. if (m.hasClass('open') && (this.emit(h.CLOSED), g.removeClass('open'), m.removeClass('open'), y.classList.contains('fadeIn'))) {
  7886. y.classList.remove('fadeIn')
  7887. var e = S === l.TRANSITIONING ? x : S
  7888. u.clear(_, c.NAVIGATION, e)
  7889. }
  7890. },
  7891. updateMode: function (e) {
  7892. ;(x = S), (S = e)
  7893. }
  7894. }
  7895. p.extendObject(R, f.prototype), (t.exports = R)
  7896. },
  7897. {
  7898. '../../enum/HelpModalType': 28,
  7899. '../../enum/Viewmode': 51,
  7900. '../../settings': 166,
  7901. '../../util/common': 185,
  7902. '../helpManager': 68,
  7903. './../populateModal': 75,
  7904. './HelpEvent': 66,
  7905. events: 202
  7906. }
  7907. ],
  7908. 68: [
  7909. function (e, t, i) {
  7910. ;(function (i) {
  7911. 'use strict'
  7912. var n = e('../util/browser'),
  7913. r = e('./../util/logger'),
  7914. o = e('./../settings'),
  7915. a = new r(i),
  7916. s = (function () {
  7917. var e
  7918. try {
  7919. return (e = window.localStorage.getItem('visitCount') || '0'), (e = (parseFloat(e) + 1).toString()), window.localStorage.setItem('visitCount', e), a.debug('visitCount = ' + e), e
  7920. } catch (t) {
  7921. ;(e = '1'), a.debug("couldn't set local storage")
  7922. }
  7923. })(),
  7924. l = !1
  7925. t.exports = {
  7926. isHelpDisabled: function () {
  7927. return '0' === n.valueFromHash('help', null) || l
  7928. },
  7929. isLargeHelpEnabled: function () {
  7930. return ('1' === s || '1' === n.valueFromHash('help', null)) && !this.isHelpDisabled()
  7931. },
  7932. isSmallHelpEnabled: function () {
  7933. return '2' === n.valueFromHash('help', null) && !this.isHelpDisabled()
  7934. },
  7935. isHelpEnabled: function () {
  7936. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7937. },
  7938. setAutoPlay: function (e) {
  7939. l = o.warp.auto >= 0 && e > 1
  7940. }
  7941. }
  7942. }).call(this, '/js/gui/helpManager.js')
  7943. },
  7944. {
  7945. '../util/browser': 182,
  7946. './../settings': 166,
  7947. './../util/logger': 189
  7948. }
  7949. ],
  7950. 69: [
  7951. function (e, t, i) {
  7952. 'use strict'
  7953. function n(e, t, i, n) {
  7954. ;(F = n), r(e, t, i, F), o(), (N = t.mode)
  7955. }
  7956. function r(e, t, i, n) {
  7957. ;[C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function (t) {
  7958. e.controls[t].on(v.Move, a), e.controls[t].on(v.LongTap, c)
  7959. }),
  7960. M.on('mousewheel DOMMouseScroll', a),
  7961. i.on(m.TagActivated, a),
  7962. i.on(m.TagNavigation, a),
  7963. t.on(A.FlyingEnded, s),
  7964. t.on(A.ModeChanging, function (e, t) {
  7965. B = t !== C.PANORAMA && e !== C.PANORAMA
  7966. }),
  7967. t.on(A.ModeChanged, function (e, i) {
  7968. // 备注sg 漫游状态通信
  7969. if (window.threeReact.state3d) window.threeReact.state3d(t.mode)
  7970. ;(N = t.mode), i !== C.TRANSITIONING ? l() : a('modeChange')
  7971. }),
  7972. n.on(y.TourStart, function () {
  7973. ;(L = !0), a()
  7974. }),
  7975. n.on(y.TourEnd, function () {
  7976. ;(L = !1), l()
  7977. }),
  7978. n.on(y.ActionInterrupted, function () {
  7979. L = !1
  7980. }),
  7981. R.addEventListener(
  7982. 'touchend',
  7983. function () {
  7984. $('#pullTab').hasClass('opened') && !L && l()
  7985. },
  7986. !0
  7987. )
  7988. }
  7989. function o() {
  7990. p.isMobile()
  7991. ? (b.forEach(function (e) {
  7992. e.classList.add('mobile')
  7993. }),
  7994. w.click(l))
  7995. : (b.forEach(function (e) {
  7996. e.addEventListener(
  7997. 'mouseleave',
  7998. function () {
  7999. !M.is(':hover') && b[0].classList.contains('detectHover') && l()
  8000. },
  8001. !0
  8002. )
  8003. }),
  8004. M.mouseleave(function () {
  8005. b[0].classList.contains('detectHover') && l()
  8006. }))
  8007. }
  8008. function a(e) {
  8009. D ||
  8010. (d(e) && _.hasClass('playing')) ||
  8011. (clearTimeout(O),
  8012. (P = !0),
  8013. g.close(),
  8014. h(e),
  8015. N !== C.DOLLHOUSE &&
  8016. N !== C.FLOORPLAN &&
  8017. ((x.hasClass('expand') && !S.hasClass('closed')) || 2 === p.valueFromHash('title', 1),
  8018. _.hasClass('playing') ||
  8019. (b.forEach(function (e) {
  8020. e.classList.add('detectHover')
  8021. }),
  8022. (O = setTimeout(l, f.immersive.timeToShowAgain)))))
  8023. }
  8024. function s() {
  8025. _.hasClass('playing') || (clearTimeout(O), (O = setTimeout(l, f.immersive.timeToShowAgain)))
  8026. }
  8027. function l() {
  8028. clearTimeout(O),
  8029. (P = !1),
  8030. I.forEach(function (e) {
  8031. e.classList.remove('drawerOpen')
  8032. }),
  8033. L ||
  8034. E.forEach(function (e) {
  8035. e.classList.remove('duringTour')
  8036. }),
  8037. b.forEach(function (e) {
  8038. e.classList.remove('detectHover')
  8039. })
  8040. }
  8041. function c() {
  8042. P ? l() : a(),
  8043. (D = !0),
  8044. setTimeout(function () {
  8045. D = !1
  8046. }, f.immersive.uiStayDuration)
  8047. }
  8048. function h(e) {
  8049. !d(e) && L
  8050. ? E.forEach(function (e) {
  8051. e.classList.remove('drawerOpen'), e.classList.add('duringTour')
  8052. })
  8053. : _.hasClass('open')
  8054. ? E.forEach(function (e) {
  8055. e.classList.remove('duringTour'), e.classList.add('drawerOpen')
  8056. })
  8057. : B ||
  8058. N === C.FLOORPLAN ||
  8059. N === C.DOLLHOUSE ||
  8060. E.forEach(function (e) {
  8061. e.classList.add('fadeOut')
  8062. })
  8063. }
  8064. function u() {
  8065. T.hasClass('duringTour') || ((L = !1), a('gui'), l())
  8066. }
  8067. function d(e) {
  8068. return 'mouse' === e || 'touch' === e || 'key' === e || 'gui' === e
  8069. }
  8070. var p = e('../util/browser'),
  8071. f = e('../settings'),
  8072. g = e('./help/help'),
  8073. m = e('../enum/tagEvents'),
  8074. v = e('../enum/ControlEvents'),
  8075. A = e('../enum/PlayerEvents'),
  8076. y = e('../enum/DirectorEvents'),
  8077. A = e('../enum/PlayerEvents'),
  8078. C = e('../enum/Viewmode'),
  8079. I = $('.pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(),
  8080. E = $('.pinBottom-container, #drawer-container, .footer').toArray(),
  8081. b = $('#hover-bottom, #hover-top').toArray(),
  8082. w = ($('#pullTab').eq(0), $('#playHead').eq(0), $('.pinBottom-container').eq(0)),
  8083. _ = $('#drawer').eq(0),
  8084. T = $('#drawer-container').eq(0),
  8085. x = $('#meta-info').eq(0),
  8086. S = $('.pinTop.left').eq(0),
  8087. M = $('#player').eq(0),
  8088. R = document.getElementById('pullTab'),
  8089. P = !1,
  8090. O = null,
  8091. L = !1,
  8092. D = !1,
  8093. N = null,
  8094. B = !1,
  8095. F = null
  8096. ;(t.exports.init = n), (t.exports.hideUi = a), (t.exports.resetDrawer = u)
  8097. },
  8098. {
  8099. '../enum/ControlEvents': 21,
  8100. '../enum/DirectorEvents': 23,
  8101. '../enum/tagEvents': 32,
  8102. '../enum/PlayerEvents': 40,
  8103. '../enum/Viewmode': 51,
  8104. '../settings': 166,
  8105. '../util/browser': 182,
  8106. './help/help': 67
  8107. }
  8108. ],
  8109. 70: [
  8110. function (e, t, i) {
  8111. ;(function (i) {
  8112. 'use strict'
  8113. function n(e, t, i) {
  8114. l.debug('konami has the modelInstance')
  8115. var n = []
  8116. $(window).on('keydown', function (e) {
  8117. n.push(e.which), n.length > o.secretPanelWord.length && n.shift(), s.equalLists(n, o.secretPanelWord) && (l.debug('Developer mode active.'), (o.debug = !0))
  8118. }),
  8119. $(window).on('keydown', function n(r) {
  8120. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i), $(window).off('keydown', n)) : console.warn("sorry we're not ready yet"))
  8121. })
  8122. }
  8123. var r = e('./../util/logger'),
  8124. o = e('./../settings'),
  8125. a = e('./debug'),
  8126. s = e('./../util/common'),
  8127. l = (e('./gui'), new r(i))
  8128. o.console && $('body').append('<div id="debug-console"></div>'), (t.exports.init = n)
  8129. }).call(this, '/js/gui/konami.js')
  8130. },
  8131. {
  8132. './../settings': 166,
  8133. './../util/common': 185,
  8134. './../util/logger': 189,
  8135. './debug': 63,
  8136. './gui': 65
  8137. }
  8138. ],
  8139. 71: [
  8140. function (e, t, i) {
  8141. 'use strict'
  8142. function n(e, t) {
  8143. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  8144. }
  8145. function r(e) {
  8146. var t = $.Deferred()
  8147. e || t.resolve()
  8148. var i = c.startupFlyinDelay
  8149. return e === p.PANORAMA && (i += c.dollhouse.transitionTime), setTimeout(t.resolve.bind(t), i), t
  8150. }
  8151. function o(e, t, i) {
  8152. var n = 0
  8153. c.quickstart.enabled && (a(i), (n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay))
  8154. var r = function () {
  8155. e.once(g.Move, l), t.once(f.TourStart, l)
  8156. }
  8157. s(n, r)
  8158. }
  8159. function a(e) {
  8160. return /* e && (y.addClass("quick-brand"), //quick-brand样式有问题 会遮住屏幕
  8161. v.before(y),
  8162. A = $(".quick-brand").toArray()),*/
  8163. m.addClass('fadeOut'),
  8164. setTimeout(function () {
  8165. A.forEach(function (e) {
  8166. e.classList.add('fadeIn')
  8167. })
  8168. }, c.quickstart.showTextDelay),
  8169. setTimeout(function () {
  8170. A.forEach(function (e) {
  8171. e.classList.add('fadeOut')
  8172. })
  8173. }, c.quickstart.fadeOutDelay),
  8174. !0
  8175. }
  8176. function s(e, t) {
  8177. setTimeout(function () {
  8178. if (h.isHelpEnabled()) {
  8179. if ((t(), u.init(), C.addClass('fadeIn landing ' + u.deviceType), h.isSmallHelpEnabled())) return void C.addClass('small')
  8180. u.fill(I, d.LANDING[E]), C.addClass(E)
  8181. }
  8182. }, e)
  8183. //csz 用户引导界面
  8184. var helpData = {
  8185. pc: ['images/pc_step1.png', 'images/pc_step2.png', 'images/pc_step3.png'],
  8186. mobile: ['images/phone_step1.png', 'images/phone_step2.png', 'images/phone_step3.png']
  8187. }
  8188. var navIcon = $('.nav-icon .icon')
  8189. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr('src', helpData.mobile[0])
  8190. function paging(id) {
  8191. id.on('click', function () {
  8192. var navPage = null
  8193. $(this).attr('data-id') == 'plus' ? (navPage = +navIcon.attr('data-page') + 1) : (navPage = +navIcon.attr('data-page') - 1)
  8194. if (navPage > helpData.length || navPage < 1) return false
  8195. if (/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) {
  8196. navIcon.attr({ 'data-page': navPage, src: helpData.mobile[navPage - 1] })
  8197. } else {
  8198. navIcon.attr({ 'data-page': navPage, src: helpData.pc[navPage - 1] })
  8199. }
  8200. })
  8201. }
  8202. paging($('.next-button'))
  8203. paging($('.prev-button'))
  8204. }
  8205. function l() {
  8206. u.clear(I, d.LANDING[E]), C.removeClass('fadeIn')
  8207. }
  8208. var c = e('../settings'),
  8209. h = (e('./help/help'), e('./helpManager')),
  8210. u = e('./populateModal'),
  8211. d = e('../enum/HelpModalType'),
  8212. p = e('../enum/Viewmode'),
  8213. f = e('../enum/DirectorEvents'),
  8214. g = e('../enum/PlayerEvents'),
  8215. m = $('#quick-blackout').eq(0),
  8216. v = $('#quick-logo').eq(0),
  8217. A = $('.quick-brand').toArray(),
  8218. y = $('#loaderCoBrand').eq(0),
  8219. C = $('#interaction-modal').eq(0),
  8220. I = C.find('.interaction').toArray(),
  8221. E = ($('#model-title, .pinBottom-container, #drawer-container, #drawer, .footer').toArray(), '')
  8222. ;(t.exports.delayLanding = r), (t.exports.showMessage = o), (t.exports.init = n), (t.exports.dismissModal = l)
  8223. },
  8224. {
  8225. '../enum/DirectorEvents': 23,
  8226. '../enum/HelpModalType': 28,
  8227. '../enum/PlayerEvents': 40,
  8228. '../enum/Viewmode': 51,
  8229. '../settings': 166,
  8230. './help/help': 67,
  8231. './helpManager': 68,
  8232. './populateModal': 75
  8233. }
  8234. ],
  8235. 72: [
  8236. function (e, t, i) {
  8237. 'use strict'
  8238. var n = e('./circleLoader').circleLoader
  8239. t.exports = {
  8240. element: $('#gui-loading'),
  8241. hide: function (e) {
  8242. n.done(), this.element.fadeOut(1500, e)
  8243. },
  8244. show: function (e) {
  8245. this.element.fadeIn(
  8246. 500,
  8247. function () {
  8248. this.element.css('display', 'table'), e && e()
  8249. }.bind(this)
  8250. )
  8251. },
  8252. progress: function (e) {
  8253. n.set(e)
  8254. }
  8255. }
  8256. },
  8257. {
  8258. './circleLoader': 60
  8259. }
  8260. ],
  8261. 73: [
  8262. function (e, t, i) {
  8263. 'use strict'
  8264. var n = e('../settings'),
  8265. r = $('#memory-info'),
  8266. o = r.find('#memory-gpu'),
  8267. a = !1
  8268. t.exports = {
  8269. show: function () {
  8270. n.profiling.enabled && (r.show(), (a = !0))
  8271. },
  8272. hide: function () {
  8273. r.hide(), (a = !1)
  8274. },
  8275. toggle: function () {
  8276. a ? this.hide() : this.show()
  8277. },
  8278. update: function (e) {
  8279. n.profiling.enabled && o.text(Math.floor(e / 1e6) + 'MB')
  8280. }
  8281. }
  8282. },
  8283. {
  8284. '../settings': 166
  8285. }
  8286. ],
  8287. 74: [
  8288. function (e, t, i) {
  8289. 'use strict'
  8290. var n = e('../util/browser'),
  8291. r = e('../analytics')
  8292. e('../settings')
  8293. t.exports = {
  8294. show: function (e, t) {
  8295. $('#gui-message').fadeOut(500, function () {
  8296. t()
  8297. })
  8298. }
  8299. }
  8300. },
  8301. {
  8302. '../analytics': 4,
  8303. '../settings': 166,
  8304. '../util/browser': 182
  8305. }
  8306. ],
  8307. 75: [
  8308. function (e, t, i) {
  8309. 'use strict'
  8310. function n(e, t, i, n) {
  8311. function r(e) {
  8312. return e.classList.contains(a)
  8313. }
  8314. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType]
  8315. //for (var a in o) {
  8316. //var s = e.find(r);
  8317. //for (var l in o[a]) {
  8318. //var c = o[a][l];
  8319. //if ("top-info" === l || "bottom-info" === l) {
  8320. //var h = n ? c : "";
  8321. //czj 注释掉第一次打开的用户引导
  8322. //s.querySelector("." + l).textContent = h
  8323. //} else {
  8324. //var u = n ? c : "";
  8325. //, d = s.querySelector("." + l);
  8326. //d.src = u,
  8327. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  8328. //}
  8329. //}
  8330. //}
  8331. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  8332. // p.forEach(function(e) {
  8333. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  8334. // })
  8335. }
  8336. var r = e('../util/browser'),
  8337. o = e('../localization/localize'),
  8338. a = e('../enum/HelpModalType'),
  8339. s = (e('../enum/HelpModalSize'), e('../enum/Viewmode'))
  8340. t.exports = {
  8341. init: function () {
  8342. if (!this.hasInitialized) {
  8343. ;(this.hasInitialized = !0),
  8344. (this.deviceType = r.isMobile() ? 'mobile' : 'desktop'),
  8345. (this.assets = {}),
  8346. (this.assets[a.LANDING[s.PANORAMA]] = {
  8347. desktop: {
  8348. left: {
  8349. 'top-info': o.ROTATE,
  8350. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8351. keyboard: 'images/nav_help_keyboard_left_right.png'
  8352. },
  8353. middle: {
  8354. 'top-info': o.MOVE,
  8355. 'big-image': 'images/nav_help_mouse_click.png',
  8356. keyboard: 'images/nav_help_keyboard_up_down.png'
  8357. },
  8358. right: {
  8359. 'top-info': o.ZOOM,
  8360. 'big-image': 'images/nav_help_mouse_zoom.png',
  8361. keyboard: 'images/nav_help_zoom_keys.png'
  8362. }
  8363. },
  8364. mobile: {
  8365. left: {
  8366. 'top-info': o.ROTATE,
  8367. 'big-image': 'images/nav_help_gesture_drag.png'
  8368. },
  8369. middle: {
  8370. 'top-info': o.MOVE,
  8371. 'big-image': 'images/nav_help_gesture_tap.png'
  8372. },
  8373. right: {
  8374. 'top-info': o.ZOOM,
  8375. 'big-image': 'images/nav_help_gesture_pinch.png'
  8376. }
  8377. }
  8378. }),
  8379. (this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]]))),
  8380. (this.assets[a.LANDING[s.DOLLHOUSE]] = {
  8381. desktop: {
  8382. left: {
  8383. 'top-info': o.ROTATE,
  8384. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8385. keyboard: 'images/nav_help_keyboard_left_right.png'
  8386. },
  8387. middle: {
  8388. 'top-info': o.MOVE,
  8389. 'big-image': 'images/nav_help_mouse_position_right.png'
  8390. }
  8391. },
  8392. mobile: {
  8393. left: {
  8394. 'top-info': o.ROTATE,
  8395. 'big-image': 'images/nav_help_gesture_drag.png'
  8396. },
  8397. middle: {
  8398. 'top-info': o.MOVE,
  8399. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  8400. }
  8401. }
  8402. }),
  8403. (this.assets[a.LANDING[s.FLOORPLAN]] = {
  8404. desktop: {
  8405. left: {
  8406. 'top-info': o.MOVE,
  8407. 'big-image': 'images/nav_help_mouse_position_left.png'
  8408. },
  8409. middle: {
  8410. 'top-info': o.ROTATE,
  8411. 'big-image': 'images/nav_help_mouse_drag_right.png',
  8412. keyboard: 'images/nav_help_keyboard_left_right.png'
  8413. }
  8414. },
  8415. mobile: {
  8416. left: {
  8417. 'top-info': o.MOVE,
  8418. 'big-image': 'images/nav_help_gesture_position.png'
  8419. },
  8420. middle: {
  8421. 'top-info': o.ROTATE,
  8422. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  8423. }
  8424. }
  8425. })
  8426. var e = {
  8427. 'top-info': o.INSIDE,
  8428. 'big-image': 'images/nav_help_click_inside.png',
  8429. keyboard: 'images/nav_help_inside_key.png'
  8430. }
  8431. ;(this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e), (this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e), (this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e)
  8432. var t = {
  8433. 'top-info': o.INSIDE,
  8434. 'big-image': 'images/nav_help_tap_inside.png'
  8435. }
  8436. ;(this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t),
  8437. (this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t),
  8438. (this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t),
  8439. (this.assets[a.NAVIGATION] = {}),
  8440. (this.assets[a.NAVIGATION][s.PANORAMA] = {
  8441. desktop: {
  8442. left: {
  8443. 'top-info': o.HELP_DESKTOP_PANORAMA_1A,
  8444. 'bottom-info': o.HELP_DESKTOP_PANORAMA_1B,
  8445. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8446. keyboard: 'images/nav_help_keyboard_left_right.png'
  8447. },
  8448. middle: {
  8449. 'top-info': o.HELP_DESKTOP_PANORAMA_2A,
  8450. 'bottom-info': o.HELP_DESKTOP_PANORAMA_2B,
  8451. 'big-image': 'images/nav_help_mouse_click.png',
  8452. keyboard: 'images/nav_help_keyboard_up_down.png'
  8453. },
  8454. right: {
  8455. 'top-info': o.HELP_DESKTOP_PANORAMA_3A,
  8456. 'bottom-info': o.HELP_DESKTOP_PANORAMA_3B,
  8457. 'big-image': 'images/nav_help_mouse_zoom.png',
  8458. keyboard: 'images/nav_help_zoom_keys.png'
  8459. }
  8460. },
  8461. mobile: {
  8462. left: {
  8463. 'top-info': o.HELP_MOBILE_PANORAMA_1,
  8464. 'big-image': 'images/nav_help_gesture_drag.png'
  8465. },
  8466. middle: {
  8467. 'top-info': o.HELP_MOBILE_PANORAMA_2,
  8468. 'big-image': 'images/nav_help_gesture_tap.png'
  8469. },
  8470. right: {
  8471. 'top-info': o.HELP_MOBILE_3,
  8472. 'big-image': 'images/nav_help_gesture_pinch.png'
  8473. }
  8474. }
  8475. }),
  8476. (this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  8477. desktop: {
  8478. left: {
  8479. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_1A,
  8480. 'bottom-info': o.HELP_DESKTOP_DOLLHOUSE_1B,
  8481. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8482. keyboard: 'images/nav_help_keyboard_all.png'
  8483. },
  8484. middle: {
  8485. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_2A,
  8486. 'big-image': 'images/nav_help_mouse_position_right.png'
  8487. },
  8488. right: {
  8489. 'top-info': o.HELP_DESKTOP_DOLLHOUSE_3A,
  8490. 'big-image': 'images/nav_help_mouse_zoom.png'
  8491. }
  8492. },
  8493. mobile: {
  8494. left: {
  8495. 'top-info': o.HELP_MOBILE_DOLLHOUSE_1,
  8496. 'big-image': 'images/nav_help_gesture_drag.png'
  8497. },
  8498. middle: {
  8499. 'top-info': o.HELP_MOBILE_DOLLHOUSE_2,
  8500. 'big-image': 'images/nav_help_gesture_position_two_finger.png'
  8501. },
  8502. right: {
  8503. 'top-info': o.HELP_MOBILE_3,
  8504. 'big-image': 'images/nav_help_gesture_pinch.png'
  8505. }
  8506. }
  8507. }),
  8508. (this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  8509. desktop: {
  8510. left: {
  8511. 'top-info': o.HELP_DESKTOP_FLOORPLAN_1A,
  8512. 'big-image': 'images/nav_help_mouse_position_left.png'
  8513. },
  8514. middle: {
  8515. 'top-info': o.HELP_DESKTOP_FLOORPLAN_2A,
  8516. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_2B,
  8517. 'big-image': 'images/nav_help_mouse_drag_right.png',
  8518. keyboard: 'images/nav_help_keyboard_left_right.png'
  8519. },
  8520. right: {
  8521. 'top-info': o.HELP_DESKTOP_FLOORPLAN_3A,
  8522. 'bottom-info': o.HELP_DESKTOP_FLOORPLAN_3B,
  8523. 'big-image': 'images/nav_help_mouse_zoom.png',
  8524. keyboard: 'images/nav_help_keyboard_up_down.png'
  8525. }
  8526. },
  8527. mobile: {
  8528. left: {
  8529. 'top-info': o.HELP_MOBILE_FLOORPLAN_1,
  8530. 'big-image': 'images/nav_help_gesture_position.png'
  8531. },
  8532. middle: {
  8533. 'top-info': o.HELP_MOBILE_FLOORPLAN_2,
  8534. 'big-image': 'images/nav_help_gesture_drag_two_finger.png'
  8535. },
  8536. right: {
  8537. 'top-info': o.HELP_MOBILE_3,
  8538. 'big-image': 'images/nav_help_gesture_pinch.png'
  8539. }
  8540. }
  8541. }),
  8542. (this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA]))),
  8543. (this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  8544. 'top-info': o.HELP_DESKTOP_360_2A,
  8545. 'bottom-info': o.HELP_DESKTOP_360_2B,
  8546. 'big-image': 'images/nav_help_click_inside.png',
  8547. keyboard: 'images/nav_help_inside_key.png'
  8548. }),
  8549. (this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  8550. 'top-info': o.HELP_MOBILE_360_2,
  8551. 'big-image': 'images/nav_help_tap_inside.png'
  8552. }),
  8553. (this.assets[a.MORE_HELP] = {
  8554. desktop: {
  8555. 'more-help-hlr': {
  8556. 'top-info': o.HELP_MORE_HLR_A,
  8557. 'big-image': 'images/nav_help_expand.svg',
  8558. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  8559. },
  8560. 'more-help-dollhouse': {
  8561. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  8562. 'big-image': 'images/nav_help_dollhouse.svg',
  8563. 'bottom-info': o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  8564. },
  8565. 'more-help-floors': {
  8566. 'top-info': o.HELP_MORE_FLOORS_A,
  8567. 'big-image': 'images/nav_help_floor picker.svg',
  8568. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  8569. },
  8570. 'more-help-tag': {
  8571. 'top-info': o.HELP_MORE_TAG_A,
  8572. 'big-image': 'images/nav_help_tag.svg',
  8573. 'bottom-info': o.HELP_DESKTOP_MORE_TAG_B
  8574. },
  8575. 'more-help-zoom': {
  8576. 'top-info': o.HELP_MORE_ZOOM_A,
  8577. 'big-image': 'images/nav_help_zoom.svg',
  8578. 'bottom-info': o.HELP_DESKTOP_MORE_ZOOM_B
  8579. },
  8580. 'more-help-tour': {
  8581. 'top-info': o.HELP_MORE_TOUR_A,
  8582. 'big-image': 'images/nav_help_play.png',
  8583. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  8584. },
  8585. 'more-help-inside': {
  8586. 'top-info': o.HELP_MORE_INSIDE_A,
  8587. 'big-image': 'images/nav_help_inside.svg',
  8588. 'bottom-info': o.HELP_DESKTOP_MORE_INSIDE_B
  8589. },
  8590. 'more-help-vr': {
  8591. 'top-info': o.HELP_MORE_VR_A,
  8592. 'big-image': 'images/nav_help_vr.svg',
  8593. 'bottom-info': o.HELP_DESKTOP_MORE_VR_B
  8594. },
  8595. 'more-help-360': {
  8596. 'top-info': o.HELP_MORE_360_A,
  8597. 'big-image': 'images/nav_help_360.svg',
  8598. 'bottom-info': o.HELP_DESKTOP_MORE_360_B
  8599. },
  8600. 'more-help-fullscreen': {
  8601. 'top-info': o.HELP_MORE_FULLSCREEN_A,
  8602. 'big-image': 'images/nav_help_fullscreen.svg',
  8603. 'bottom-info': o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8604. }
  8605. },
  8606. mobile: {
  8607. 'more-help-hlr': {
  8608. 'top-info': o.HELP_MORE_HLR_A,
  8609. 'big-image': 'images/nav_help_expand.svg',
  8610. 'bottom-info': o.HELP_DESKTOP_MORE_HLR_B
  8611. },
  8612. 'more-help-dollhouse': {
  8613. 'top-info': o.HELP_MORE_DOLLHOUSE_A,
  8614. 'big-image': 'images/nav_help_dollhouse.svg',
  8615. 'bottom-info': o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8616. },
  8617. 'more-help-floors': {
  8618. 'top-info': o.HELP_MORE_FLOORS_A,
  8619. 'big-image': 'images/nav_help_floor picker.svg',
  8620. 'bottom-info': o.HELP_DESKTOP_MORE_FLOORS_B
  8621. },
  8622. 'more-help-tag': {
  8623. 'top-info': o.HELP_MORE_TAG_A,
  8624. 'big-image': 'images/nav_help_tag.svg',
  8625. 'bottom-info': o.HELP_MOBILE_MORE_TAG_B
  8626. },
  8627. 'more-help-tour': {
  8628. 'top-info': o.HELP_MORE_TOUR_A,
  8629. 'big-image': 'images/nav_help_play.png',
  8630. 'bottom-info': o.HELP_DESKTOP_MORE_TOUR_B
  8631. },
  8632. 'more-help-inside': {
  8633. 'top-info': o.HELP_MORE_INSIDE_A,
  8634. 'big-image': 'images/nav_help_inside.svg',
  8635. 'bottom-info': o.HELP_MOBILE_MORE_INSIDE_B
  8636. },
  8637. 'more-help-vr': {
  8638. 'top-info': o.HELP_MORE_VR_A,
  8639. 'big-image': 'images/webvr.svg',
  8640. 'bottom-info': o.HELP_MOBILE_MORE_VR_B
  8641. },
  8642. 'more-help-360': {
  8643. 'top-info': o.HELP_MORE_360_A,
  8644. 'big-image': 'images/nav_help_360.svg',
  8645. 'bottom-info': o.HELP_MOBILE_MORE_360_B
  8646. }
  8647. }
  8648. }),
  8649. (this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8650. desktop: {
  8651. left: {
  8652. 'top-info': o.ROTATE,
  8653. 'big-image': 'images/nav_help_mouse_drag_left.png',
  8654. keyboard: 'images/nav_help_keyboard_left_right.png'
  8655. },
  8656. middle: {
  8657. 'top-info': o.MOVE,
  8658. 'big-image': 'images/nav_help_mouse_click.png',
  8659. keyboard: 'images/nav_help_keyboard_up_down.png'
  8660. },
  8661. right: {
  8662. 'top-info': o.PLAY,
  8663. 'big-image': 'images/Desktop-help-play-button.svg',
  8664. keyboard: 'images/Desktop-help-spacebar-2.svg'
  8665. }
  8666. },
  8667. mobile: {
  8668. left: {
  8669. 'top-info': o.ROTATE,
  8670. 'big-image': 'images/nav_help_gesture_drag.png'
  8671. },
  8672. middle: {
  8673. 'top-info': o.MOVE,
  8674. 'big-image': 'images/nav_help_gesture_tap.png'
  8675. },
  8676. right: {
  8677. 'top-info': o.PLAY,
  8678. 'big-image': 'images/mobile-help-play-button.svg'
  8679. }
  8680. }
  8681. }),
  8682. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]]))),
  8683. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle),
  8684. (this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle),
  8685. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]]))),
  8686. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left),
  8687. (this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left)
  8688. }
  8689. },
  8690. fill: function (e, t, i) {
  8691. n.call(this, e, t, i, !0)
  8692. },
  8693. clear: function (e, t, i) {
  8694. n.call(this, e, t, i, !1)
  8695. }
  8696. }
  8697. },
  8698. {
  8699. '../enum/HelpModalSize': 27,
  8700. '../enum/HelpModalType': 28,
  8701. '../enum/Viewmode': 51,
  8702. '../localization/localize': 108,
  8703. '../util/browser': 182
  8704. }
  8705. ],
  8706. 76: [
  8707. function (e, t, i) {
  8708. 'use strict'
  8709. t.exports = Object.freeze({
  8710. OPENED: 'share.open',
  8711. CLOSED: 'share.closed',
  8712. LINK_CLICKED: 'share.linked'
  8713. })
  8714. },
  8715. {}
  8716. ],
  8717. 77: [
  8718. function (e, t, i) {
  8719. 'use strict'
  8720. function n(e) {
  8721. function t(t, i) {
  8722. var n = window.screenY + ($('#player').height() - i) / 2,
  8723. r = window.screenX + ($('#player').width() - t) / 2,
  8724. o = 'top=' + n + ',left=' + r + ',width=' + t + ',height=' + i
  8725. I.emit(l.LINK_CLICKED, {
  8726. channel: e
  8727. }),
  8728. window.open(C[e], 'shareWindow', o)
  8729. }
  8730. switch (e) {
  8731. case y.FACEBOOK:
  8732. t(580, 420)
  8733. break
  8734. case y.TWITTER:
  8735. t(550, 440)
  8736. break
  8737. case y.MAIL:
  8738. I.emit(l.LINK_CLICKED, {
  8739. channel: 'email'
  8740. }),
  8741. window.open(C[e], '_blank')
  8742. break
  8743. case y.LINKEDIN:
  8744. }
  8745. }
  8746. function r(e) {
  8747. I.emit(l.LINK_CLICKED, {
  8748. channel: 'copylink'
  8749. })
  8750. var t = document.createRange()
  8751. t.selectNodeContents(v)
  8752. var i = window.getSelection()
  8753. i.removeAllRanges(), i.addRange(t), document.execCommand('copy'), A.classList.remove('hidden'), v.classList.add('highlighted')
  8754. }
  8755. function o(e) {
  8756. ;(e && (e.stopPropagation(), e.target === v)) || (window.getSelection().removeAllRanges(), v.classList.remove('highlighted'), A.classList.add('hidden'))
  8757. }
  8758. var a = e('../../util/browser'),
  8759. s = e('../../localization/localize'),
  8760. l = e('./ShareEvents'),
  8761. c = e('../../util/common'),
  8762. h = e('events').EventEmitter,
  8763. u = document.getElementById('sharing'),
  8764. d = document.getElementById('share-modal'),
  8765. p = document.getElementById('share-close'),
  8766. f = document.getElementById('facebook-share'),
  8767. g = document.getElementById('twitter-share'),
  8768. m = document.getElementById('mail-share'),
  8769. v = document.getElementById('share-url-text'),
  8770. A = document.getElementById('copy-success'),
  8771. y = Object.freeze({
  8772. FACEBOOK: 'facebook',
  8773. TWITTER: 'twitter',
  8774. MAIL: 'mail',
  8775. LINKEDIN: 'linkedin'
  8776. }),
  8777. C = {}
  8778. ;(C[y.FACEBOOK] = 'http://www.facebook.com/sharer.php?u=' + encodeURIComponent(window.location.href + '&utm_source=1') + '&t='),
  8779. (C[y.TWITTER] = 'http://twitter.com/intent/tweet?text='),
  8780. (C[y.MAIL] = 'mailto:?subject=')
  8781. var I = {
  8782. init: function (e) {
  8783. var t = encodeURIComponent(s.SHARE_EXPLORE + e + ' ' + s.SHARE_AT + ' ')
  8784. ;(C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + '&utm_source=1')),
  8785. (C[y.TWITTER] += t + encodeURIComponent(window.location.href + '&utm_source=2 ' + s.SHARE_WITH + ' #port')),
  8786. (C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + '&body=' + t + encodeURIComponent(window.location.href + '&utm_source=3')),
  8787. u.addEventListener('click', this.toggle.bind(this)),
  8788. p.addEventListener('click', this.hide.bind(this)),
  8789. v.addEventListener('click', r),
  8790. d.addEventListener('click', o),
  8791. f.addEventListener('click', n.bind(this, y.FACEBOOK)),
  8792. g.addEventListener('click', n.bind(this, y.TWITTER)),
  8793. m.addEventListener('click', n.bind(this, y.MAIL)),
  8794. (v.textContent = window.location.href + '&utm_source=4'),
  8795. d.classList.add(a.isMobile() ? 'mobile' : 'desktop'),
  8796. u.classList.remove('hidden')
  8797. },
  8798. show: function () {
  8799. this.emit(l.OPENED), d.classList.add('fadeIn')
  8800. },
  8801. hide: function () {
  8802. d.classList.contains('fadeIn') && (this.emit(l.CLOSED), document.selection && document.selection.empty(), window.getSelection().removeAllRanges(), o(), d.classList.remove('fadeIn'))
  8803. },
  8804. toggle: function () {
  8805. d.classList.contains('fadeIn') ? this.hide() : this.show()
  8806. }
  8807. }
  8808. c.extendObject(I, h.prototype), (t.exports = I)
  8809. },
  8810. {
  8811. '../../localization/localize': 108,
  8812. '../../util/browser': 182,
  8813. '../../util/common': 185,
  8814. './ShareEvents': 76,
  8815. events: 202
  8816. }
  8817. ],
  8818. 78: [
  8819. function (e, t, i) {
  8820. 'use strict'
  8821. t.exports = Object.freeze({
  8822. OPENED: 'terms.opened',
  8823. CLOSED: 'terms.closed'
  8824. })
  8825. },
  8826. {}
  8827. ],
  8828. 79: [
  8829. function (e, t, i) {
  8830. 'use strict'
  8831. var n = e('./TermsEvent'),
  8832. r = e('../../localization/localize'),
  8833. o = e('../../analytics'),
  8834. a = e('../../util/ajax'),
  8835. s = e('../../util/common'),
  8836. l = e('events').EventEmitter,
  8837. c = document.getElementById('terms-modal'),
  8838. h = {
  8839. init: function () {
  8840. $('.footer-terms').on(
  8841. 'click',
  8842. function (e) {
  8843. e.preventDefault(), this.show()
  8844. }.bind(this)
  8845. ),
  8846. $('#terms-modal .close').on('click', this.hide.bind(this))
  8847. },
  8848. show: function () {
  8849. this.emit(n.OPENED),
  8850. a
  8851. .get('static/' + r.TERMS_TEXT_FILE)
  8852. .done(function (e) {
  8853. var t = $('#terms-text').html(e)
  8854. o.track('showcase_gui', {
  8855. gui_action: 'click_terms_button',
  8856. interaction_source: 'gui'
  8857. }),
  8858. t.find('a').attr('target', '_blank')
  8859. })
  8860. .fail(function () {
  8861. $('#terms-text').html('<h1>' + r.TERMS_OF_USE + '</h1><p>' + r.TERMS_FAIL)
  8862. }),
  8863. c.classList.add('fadeIn')
  8864. },
  8865. hide: function (e) {
  8866. e && e.preventDefault(), c.classList.contains('fadeIn') && this.emit(n.CLOSED), c.classList.remove('fadeIn')
  8867. }
  8868. }
  8869. s.extendObject(h, l.prototype), (t.exports = h)
  8870. },
  8871. {
  8872. '../../analytics': 4,
  8873. '../../localization/localize': 108,
  8874. '../../util/ajax': 181,
  8875. '../../util/common': 185,
  8876. './TermsEvent': 78,
  8877. events: 202
  8878. }
  8879. ],
  8880. 80: [
  8881. function (e, t, i) {
  8882. 'use strict'
  8883. t.exports = Object.freeze({
  8884. OPEN_INFO: 'title.open.info',
  8885. CLOSE_INFO: 'title.close.info',
  8886. SHOW_INFO: 'title.show.info',
  8887. HIDE_INFO: 'title.hide.info',
  8888. LINK_CLICKED: 'title.link.click',
  8889. CONTACT_LINK_CLICKED: 'title.contact.click',
  8890. ORIGIN_LINK_CLICKED: 'title.origin.click'
  8891. })
  8892. },
  8893. {}
  8894. ],
  8895. 81: [
  8896. function (e, t, i) {
  8897. 'use strict'
  8898. function n(e, t) {
  8899. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8900. }
  8901. function r(e, t) {
  8902. function i(i) {
  8903. ;(e.shouldShowtags = 'show' === this.value), e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8904. }
  8905. document.getElementById('tag-toggles').classList.remove('hidden'), (document.getElementById('radio-tag-show').checked = !0)
  8906. for (var n = document.getElementById('tag-inputs').querySelectorAll('input'), r = 0; r < n.length; r++) n[r].addEventListener('change', i)
  8907. }
  8908. var o = e('../../settings')
  8909. t.exports.init = n
  8910. },
  8911. {
  8912. '../../settings': 166
  8913. }
  8914. ],
  8915. 82: [
  8916. function (e, t, i) {
  8917. ;(function (i) {
  8918. 'use strict'
  8919. function n(e, t) {
  8920. return e && u.valueFromHash('title', 1) && 2 !== u.valueFromHash('mls', 0)
  8921. ? ((document.getElementsByClassName('titleText')[0].innerText = e),
  8922. (g_weixinObj.title = e),
  8923. e.length > g.minTooltipCharacters && I.parentElement.setAttribute('data-original-title', e),
  8924. t && 1 !== m.specialEdition && m.brand && !m.mls
  8925. ? (document.getElementById('cobrandTitle').innerText = t)
  8926. : (document.getElementsByClassName('co-brand')[0].classList.add('hidden'),
  8927. document.getElementById('gui-name').classList.add('noCoBrand'),
  8928. document.getElementById('cobrandTitle').classList.add('hidden')),
  8929. !0)
  8930. : (document.getElementById('model-title').classList.add('hidden'), !1)
  8931. }
  8932. function r(e) {
  8933. return e ? ((L = !0), void (_.innerHTML = e)) : void _.classList.add('hidden')
  8934. }
  8935. function o(e, t, i, n) {
  8936. if ((!e && !t && !i) || !m.brand || u.valueFromHash('mls', !1)) return void T.classList.add('hidden')
  8937. L = !0
  8938. var r = [],
  8939. o = c(r, '<br>')
  8940. if ((e && o('<span id="contactName">' + e + '</span>'), t)) {
  8941. var a = n || t,
  8942. s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + '</a>' : '<span>' + a + '</span>'
  8943. o(s)
  8944. }
  8945. i && o('<a id="email" href="mailTo:' + i + '">' + i + '</a>'), (r[0] = ''), (x.innerHTML = r.join(''))
  8946. }
  8947. function a(e) {
  8948. if ('string' == typeof e)
  8949. try {
  8950. e = JSON.parse(e)
  8951. } catch (e) {
  8952. return y.warn('Unable to parse address data'), void S.parentElement.classList.add('hidden')
  8953. }
  8954. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip))) return void S.parentElement.classList.add('hidden')
  8955. L = !0
  8956. var t = [],
  8957. i = c(t, ' ')
  8958. e.address_1 && i(e.address_1),
  8959. e.address_2 && i(e.address_2),
  8960. e.city && i(e.city, ', '),
  8961. e.state && i(e.state, ', '),
  8962. e.zip && i(e.zip, e.state ? ' ' : ', '),
  8963. (t[0] = ''),
  8964. (S.innerText = t.join(''))
  8965. }
  8966. function s(e) {
  8967. var t = document.createElement('a')
  8968. return (t.id = 'url'), (t.target = '_blank'), (t.href = e), (t.innerText = e), t.addEventListener('click', N.emit.bind(N, v.ORIGIN_LINK_CLICKED)), t
  8969. }
  8970. function l(e) {
  8971. return (
  8972. !(!e || (u.inIframe() && document.referrer === e)) &&
  8973. (R.classList.remove('hidden'),
  8974. (P.innerHTML = f.WEBVR_LEARN_MORE + ': '),
  8975. P.appendChild(s(e)),
  8976. O.forEach(function (e) {
  8977. e.classList.add('share-link')
  8978. }),
  8979. !0)
  8980. )
  8981. }
  8982. function c(e, t) {
  8983. var i = e,
  8984. n = t
  8985. return function (e, t) {
  8986. i.push(t || n, e)
  8987. }
  8988. }
  8989. function h() {
  8990. document.getElementById('title-toggle').addEventListener('click', N.toggleTitle.bind(N)), L && I.addEventListener('click', N.toggleMeta.bind(N, !1))
  8991. var e = [].slice.call(_.querySelectorAll('a'))
  8992. e.forEach(function (e) {
  8993. e.addEventListener('click', N.emit.bind(N, v.LINK_CLICKED))
  8994. })
  8995. var t = [].slice.call(T.querySelectorAll('a'))
  8996. t.forEach(function (e) {
  8997. e.addEventListener(
  8998. 'click',
  8999. N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  9000. contact_type: e.getAttribute('id')
  9001. })
  9002. )
  9003. })
  9004. }
  9005. var u = e('../../util/browser'),
  9006. d = e('../../util/common'),
  9007. p = e('../../util/logger'),
  9008. f = e('../../localization/localize'),
  9009. g = e('./titleBarSettings'),
  9010. m = e('../../settings'),
  9011. v = e('./TitleEvents'),
  9012. A = e('events').EventEmitter,
  9013. y = new p(i),
  9014. C = document.querySelector('.pinTop.left'),
  9015. I = document.getElementsByClassName('title-container')[0],
  9016. E = document.getElementById('title-toggle').querySelector('i'),
  9017. b = document.getElementById('meta-info-wrapper'),
  9018. w = document.getElementById('meta-info'),
  9019. _ = document.getElementById('meta-description'),
  9020. T = document.getElementsByClassName('contact-info')[0],
  9021. x = document.getElementById('contact-data'),
  9022. S = document.getElementById('addressTxt'),
  9023. M = document.getElementById('tag-toggles'),
  9024. R = document.getElementById('share-origin'),
  9025. P = document.getElementById('share-link-wrapper'),
  9026. O = [w, b, I],
  9027. L = !1,
  9028. D = !1,
  9029. N = {
  9030. populate: function (e) {
  9031. if (n(window.DATA.name, e.coBrand)) {
  9032. if ((r(e.description), o(e.contactName, e.phone, e.email, e.formatted_contact_phone), a(e.address), L)) {
  9033. var t = document.createElement('br')
  9034. M.insertBefore(t, M.firstElementChild)
  9035. }
  9036. e.socialSharing && m.share.enabled && (D = l(e.url))
  9037. }
  9038. },
  9039. finishSetup: function (e) {
  9040. ;(L = L || !!e), h(), L || (D ? I.classList.add('share-only') : I.classList.add('no-meta'))
  9041. },
  9042. toggleMeta: function (e, t) {
  9043. var title = document.getElementById('model-title')
  9044. t && t.preventDefault()
  9045. var i = w.classList.contains('expand')
  9046. ;(e && !i) ||
  9047. (i
  9048. ? (O.forEach(function (e) {
  9049. e.classList.remove('expand')
  9050. }),
  9051. this.emit(v.CLOSE_INFO),
  9052. title.classList.remove('expand'))
  9053. : (O.forEach(function (e) {
  9054. e.classList.add('expand')
  9055. }),
  9056. title.classList.add('expand'),
  9057. this.emit(v.OPEN_INFO)))
  9058. },
  9059. setupToggling: function () {
  9060. ;(b.style.height = w.offsetHeight + 'px'),
  9061. w.addEventListener('transitionend', function () {
  9062. b.style.height = w.offsetHeight + 'px'
  9063. })
  9064. },
  9065. toggleTitle: function (e) {
  9066. e && e.preventDefault(),
  9067. C.classList.contains('closed')
  9068. ? (C.classList.add('open'),
  9069. E.classList.remove('icon-dpad-right'),
  9070. E.classList.add('icon-dpad-left'),
  9071. this.emit(v.SHOW_INFO),
  9072. setTimeout(function () {
  9073. C.classList.remove('closed'), C.classList.remove('open')
  9074. }, g.removeAnimationClasses))
  9075. : (C.classList.add('closed'), E.classList.remove('icon-dpad-left'), E.classList.add('icon-dpad-right'), this.emit(v.HIDE_INFO))
  9076. }
  9077. }
  9078. d.extendObject(N, A.prototype), (t.exports = N)
  9079. }).call(this, '/js/gui/title/titleBar.js')
  9080. },
  9081. {
  9082. '../../localization/localize': 108,
  9083. '../../settings': 166,
  9084. '../../util/browser': 182,
  9085. '../../util/common': 185,
  9086. '../../util/logger': 189,
  9087. './TitleEvents': 80,
  9088. './titleBarSettings': 83,
  9089. events: 202
  9090. }
  9091. ],
  9092. 83: [
  9093. function (e, t, i) {
  9094. 'use strict'
  9095. t.exports = Object.freeze({
  9096. minTooltipCharacters: 19,
  9097. removeAnimationClasses: 500
  9098. })
  9099. },
  9100. {}
  9101. ],
  9102. 84: [
  9103. function (e, t, i) {
  9104. 'use strict'
  9105. function n(e) {
  9106. ;(C = e),
  9107. P.forEach(function (e) {
  9108. b.addEventListener(e, u.bind(this, !1), !0), w.addEventListener(e, u.bind(this, !0), !0), E.addEventListener(e, stopTour2, !0)
  9109. S.forEach(function (t) {
  9110. //会触发导览停止
  9111. t.addEventListener(e, stopTour, !0)
  9112. })
  9113. $('#drawer img').on(e, stopTour)
  9114. })
  9115. document.addEventListener('keydown', u.bind(this, !1), !0)
  9116. C.on(v.TourStart, function () {
  9117. E.classList.add('playing')
  9118. })
  9119. }
  9120. function play() {
  9121. //r
  9122. // C.playTour(),
  9123. C.playTourNearBy(), I && clearTimeout(I), d(), _.removeClass('fadeIn')
  9124. }
  9125. function stopTour2() {
  9126. //o
  9127. E.classList.contains('playing') &&
  9128. (C.stopTour(),
  9129. _.addClass('fadeIn'),
  9130. setTimeout(function () {
  9131. _.removeClass('fadeIn')
  9132. }, p.tourInteraction.showPauseButton),
  9133. O || (clearTimeout(I), (I = setTimeout(h, p.tourInteraction.showModal))),
  9134. setTimeout(function () {
  9135. E.classList.remove('playing')
  9136. }, p.tourInteraction.allowNextClick))
  9137. }
  9138. function stopTour() {
  9139. //a
  9140. C.tourInProgress && (C.stopTour(), C.endTourProgress(), E.classList.remove('playing'))
  9141. }
  9142. function togglePlay() {
  9143. //s
  9144. T.is(':visible') ? play() : stopTour2()
  9145. }
  9146. function l() {
  9147. x.hasClass('playing') && (clearTimeout(I), C.atEndOfTour() ? c() : _.removeClass('fadeIn'))
  9148. }
  9149. function c() {
  9150. E.classList.remove('playing'), h()
  9151. }
  9152. function h() {
  9153. //去掉导览结束时的提示
  9154. /* if (!p.tourInteraction.disabled) {
  9155. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  9156. M.addClass("fadeIn tour " + m.deviceType);
  9157. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  9158. if (!p.tourInteraction.smallModal) {
  9159. var t;
  9160. 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,
  9161. m.fill(R, A.TOUR_INTERACTION[t]),
  9162. M.addClass(t)
  9163. }
  9164. M.addClass(e)
  9165. } */
  9166. }
  9167. function u(e, t) {
  9168. if (t) {
  9169. var i = 'keydown' === t.type,
  9170. n = t.which === f.SPACE || C.tourIsPlaying
  9171. ;(i && n) || e || (O = !0), C.atEndOfTour() && d(), !C.tourIsPlaying && C.tourInProgress && (_.removeClass('fadeIn'), d(), t.which !== f.SPACE && stopTour()), i && n && togglePlay() //空格键播放或暂停
  9172. }
  9173. }
  9174. function d() {
  9175. M.removeClass('fadeIn')
  9176. }
  9177. var p = (e('../util/browser'), e('../settings')),
  9178. f = e('../enum/Keys'),
  9179. g = e('../enum/Viewmode'),
  9180. m = (e('./helpManager'), e('./populateModal')),
  9181. v = e('../enum/DirectorEvents'),
  9182. A = e('../enum/HelpModalType'),
  9183. y = e('../enum/HelpModalSize'),
  9184. C = null,
  9185. I = null,
  9186. E = document.getElementById('pause-overlay'),
  9187. b = document.getElementById('player'),
  9188. w = document.getElementById('gui'),
  9189. _ = $('#pause-icon').eq(0),
  9190. T = $('#play').eq(0),
  9191. x = $('#playHead').eq(0),
  9192. S = $('.rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan').toArray(),
  9193. M = $('#interaction-modal').eq(0),
  9194. R = $('#interaction-modal .interaction').toArray(),
  9195. P = ['touchstart', 'mousedown', 'pointerdown'],
  9196. O = !1
  9197. ;(t.exports.init = n),
  9198. (t.exports.play = play),
  9199. (t.exports.pause = stopTour2),
  9200. (t.exports.pauseWithoutCTA = stopTour),
  9201. (t.exports.togglePlay = togglePlay),
  9202. (t.exports.stopTour = l),
  9203. (t.exports.dismissModal = d)
  9204. },
  9205. {
  9206. '../enum/DirectorEvents': 23,
  9207. '../enum/HelpModalSize': 27,
  9208. '../enum/HelpModalType': 28,
  9209. '../enum/Keys': 30,
  9210. '../enum/Viewmode': 51,
  9211. '../settings': 166,
  9212. '../util/browser': 182,
  9213. './helpManager': 68,
  9214. './populateModal': 75
  9215. }
  9216. ],
  9217. 85: [
  9218. function (e, t, i) {
  9219. 'use strict'
  9220. t.exports = Object.freeze({
  9221. OPENED: 'vr.modal.opened',
  9222. LAUNCH: 'vr.modal.launch',
  9223. CLOSED: 'vr.modal.closed',
  9224. NEXT: 'vr.modal.next',
  9225. PREV: 'vr.modal.prev',
  9226. STORE: 'vr.modal.store',
  9227. falseICECHOSEN: 'vr.modal.device'
  9228. })
  9229. },
  9230. {}
  9231. ],
  9232. 86: [
  9233. function (e, t, i) {
  9234. 'use strict'
  9235. function n(e, t, i) {
  9236. function n(e, t, n, r) {
  9237. function o() {
  9238. return p + '&m=' + t + '&display=' + e
  9239. }
  9240. function s() {
  9241. var e = '&utm_medium=' + (a.inIframe() ? 'embed' : 'direct'),
  9242. t = '&utm_source=' + u,
  9243. n = '&utm_showcase_session_id=' + i
  9244. return e + t + n
  9245. }
  9246. function l() {
  9247. return d + '&sids=' + t + '&lsid=' + t + '&ln=' + encodeURIComponent(n) + '&ld=' + encodeURIComponent(r) + '&display=' + e
  9248. }
  9249. return a.valueFromHash('vrcoll', !1) ? l() + s() : o() + s()
  9250. }
  9251. function r(e, t, i, r) {
  9252. var o = 'https://api.branch.io/v1/url',
  9253. a = n(e, t, i, r),
  9254. s = {
  9255. responseType: 'json',
  9256. data: {
  9257. branch_key: h.appConfig.branch_key,
  9258. data: {
  9259. m: t,
  9260. full_url: a,
  9261. $desktop_url: m,
  9262. $og_app_id: '331853976762864119',
  9263. $og_title: i,
  9264. $og_description: r,
  9265. $og_image_url: location.origin + '/api/v1/player/models/' + t + '/thumb',
  9266. $canonical_url: window.location.href
  9267. }
  9268. }
  9269. }
  9270. c.post(o, s)
  9271. .done(function (t) {
  9272. f[e] = t.url
  9273. })
  9274. .fail(
  9275. function (t) {
  9276. f[e] = t
  9277. }.bind(this, a)
  9278. )
  9279. }
  9280. function o(e, t, i) {
  9281. for (var r in s) {
  9282. var o = s[r],
  9283. a = n(o, e, t, i)
  9284. f[o] = a
  9285. }
  9286. }
  9287. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href),
  9288. d = g + '/vr/dlist/?ret=' + u,
  9289. p = g + '/vr/show/?ret=' + u,
  9290. m = ''
  9291. switch (e) {
  9292. case l.IOS:
  9293. r(s.CardboardIOS, t.sid, t.name, t.summary)
  9294. break
  9295. default:
  9296. o(t.sid, t.name, t.summary)
  9297. }
  9298. }
  9299. function r(e) {
  9300. var t = f[e]
  9301. window.open(t, '_blank')
  9302. }
  9303. function o(e) {
  9304. var t = u[e]
  9305. window.open(t, '_blank')
  9306. }
  9307. var a = e('../../util/browser'),
  9308. s = e('../../enum/VRApps'),
  9309. l = e('../../enum/VRPlatforms'),
  9310. c = e('../../util/ajax'),
  9311. h = e('../../settings'),
  9312. u = {}
  9313. ;(u[s.CardboardAndroid] = 'https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri='),
  9314. (u[s.CardboardIOS] = 'https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri='),
  9315. (u[s.GearVR] = 'https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=')
  9316. for (var d in s) {
  9317. var p = s[d]
  9318. u[p] += encodeURIComponent(document.referrer + '&display=' + p)
  9319. }
  9320. var f = {},
  9321. g = (function () {
  9322. var e = window.location.host
  9323. return e.indexOf('.port.com') === -1 && e.indexOf('localhost') === -1 && (e = 'my.port.com'), 'https://' + e
  9324. })()
  9325. ;(t.exports.init = n), (t.exports.launch = r), (t.exports.launchStore = o)
  9326. },
  9327. {
  9328. '../../enum/VRApps': 46,
  9329. '../../enum/VRPlatforms': 49,
  9330. '../../settings': 166,
  9331. '../../util/ajax': 181,
  9332. '../../util/browser': 182
  9333. }
  9334. ],
  9335. 87: [
  9336. function (e, t, i) {
  9337. 'use strict'
  9338. function n(e) {
  9339. var t
  9340. switch (e) {
  9341. case m.IOS:
  9342. return (t = p.iosVersion()), t.major > 9 || (9 === t.major && t.minor >= 1)
  9343. case m.Android:
  9344. return (t = p.androidVersion()), t.major > 4 || (4 === t.major && t.minor > 4) || (4 === t.major && 4 === t.minor && t.patch >= 4)
  9345. }
  9346. return !1
  9347. }
  9348. function r(e, t) {
  9349. function i(e) {
  9350. K.emit(A.STORE, {
  9351. type: e
  9352. }),
  9353. f.launchStore(e)
  9354. }
  9355. function r(e) {
  9356. switch ((e !== _.pageCount && (a(e), N.text(e + 1 + ' / ' + _.pageCount)), e)) {
  9357. case _.Title:
  9358. O.css('display', 'none'), L.text(u[e]), o(s)
  9359. break
  9360. case _.Cardboard:
  9361. O.css('display', 'block'), L.text(u[e]), M.filter('.cardboard').off(), M.filter('.gearvr').off(), c(e, s), h(H, X, Z)
  9362. break
  9363. case _.Gear:
  9364. L.text(u[e]), c(e, s), T.addClass('lastPage'), h(G, X, Z)
  9365. break
  9366. case _.pageCount:
  9367. T.removeClass('fadeIn'), K.emit(A.CLOSED)
  9368. }
  9369. B.filter("[src='']").hide()
  9370. }
  9371. var s = (function () {
  9372. return p.detectAndroid()
  9373. ? p.detectAndroidMobile() && n(m.Android)
  9374. ? (T.addClass('supported'), (w = '.show-supported'), m.Android)
  9375. : (T.addClass('unsupported'), (w = '.show-unsupported'), m.UnsupportedAndroid)
  9376. : p.detectIPhone() || p.detectIPod()
  9377. ? (T.addClass('ios'), (w = '.show-ios'), (_ = v.ios), m.IOS)
  9378. : (T.addClass('desktop'), (w = '.show-desktop'), m.Desktop)
  9379. })()
  9380. f.init(s, e, t), s !== m.Desktop && T.addClass('mobile')
  9381. var l = function (e) {
  9382. K.emit(A.LAUNCH, {
  9383. vr_platform: s,
  9384. vr_app: e
  9385. }),
  9386. f.launch(e)
  9387. }
  9388. ;(q.cardboardAndroid = l.bind(this, g.CardboardAndroid)),
  9389. (q.gear = l.bind(this, g.GearVR)),
  9390. (q.cardboardIOS = l.bind(this, g.CardboardIOS)),
  9391. d(),
  9392. $('.show-supported, .show-unsupported, .show-ios, .show-desktop').hide(),
  9393. $(w).show()
  9394. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS],
  9395. y = ['vr_modal_learn_more', 'vr_modal_next', 'vr_modal_done']
  9396. s === m.IOS && (u.splice(1, 1), y.splice(1, 1)),
  9397. $('#vr').on('click', function (e) {
  9398. e.preventDefault()
  9399. player.FlyToMode('panorama', () => {
  9400. if (!window.vrEnabled) {
  9401. // 开启VR
  9402. window.vrEnabled = true
  9403. this.classList.add('active')
  9404. $('#gui div').not('#vrOff').addClass('vrHide')
  9405. $('#vrOffImg').css({ display: 'inline-block' })
  9406. } else {
  9407. }
  9408. })
  9409. })
  9410. let exitVR = function () {
  9411. $('#gui div').not('#vrOff').removeClass('vrHide')
  9412. $('#vrOffImg').css({ display: 'none' })
  9413. $('#player canvas').css({ width: '', height: '' }) // 清楚vr下给canvas设置的宽高, 避免横竖屏切换的时候出现宽高错误的现象
  9414. $('#vr').removeClass('active') // 清除vr按钮的激活样式
  9415. }
  9416. $('#vrOff').on('click', function () {
  9417. window.vrEnabled = false
  9418. exitVR()
  9419. })
  9420. window.bus.addEventListener('exitWebXR', e => {
  9421. exitVR()
  9422. })
  9423. var I = 'https://my.port.com/vr/show/?m=' + e.sid
  9424. s === m.IOS ? $('.cardboardLink').on('click', i.bind(this, g.CardboardIOS)) : $('.cardboardLink').on('click', i.bind(this, g.CardboardAndroid)),
  9425. $('.gearLink').on('click', i.bind(this, g.GearVR)),
  9426. $('span.modelLink').text(I),
  9427. O.on('click', function (e) {
  9428. K.emit(A.PREV), b--, r(b)
  9429. }),
  9430. L.on('click', function (e) {
  9431. L.text()
  9432. K.emit(A.NEXT, {
  9433. nextAction: y[b]
  9434. }),
  9435. b++,
  9436. r(b)
  9437. }),
  9438. T.find('.close').on('click', K.dismiss)
  9439. }
  9440. function o(e) {
  9441. switch (e) {
  9442. case m.Android:
  9443. M.filter('.cardboard').off().on('click', q.cardboardAndroid), M.filter('.gearvr').off().on('click', q.gear), s(H, G, 'logo-button', 'same-line')
  9444. break
  9445. case m.UnsupportedAndroid:
  9446. s('', z, '', '')
  9447. break
  9448. case m.IOS:
  9449. M.filter('.cardboard').off().on('click', q.cardboardIOS), s(H, '', 'logo-button', '')
  9450. break
  9451. case m.Desktop:
  9452. M.filter('.cardboard').off().on('click', l.bind(this, null, F, U)), M.filter('.gearvr').off().on('click', l.bind(this, G, V, null)), s(H, G, 'logo-button', 'same-line'), Q.cardboard()
  9453. }
  9454. }
  9455. function a(e) {
  9456. $('.p1, .p2, .p3').hide(),
  9457. x.insertAfter(S),
  9458. T.removeClass('front-page'),
  9459. T.removeClass('details-page'),
  9460. T.removeClass('lastPage'),
  9461. M.removeClass('logo-button'),
  9462. M.removeClass('same-line'),
  9463. S.removeClass('headsetOptions'),
  9464. R.attr('src', ''),
  9465. R.filter('.second').removeClass('gear'),
  9466. R.css('display', 'inline-block'),
  9467. R.off(),
  9468. P.filter('.second').css('display', ''),
  9469. D.css('display', 'none'),
  9470. $('.p' + (e + 1) + w).show(),
  9471. R.filter('.third').insertBefore(P.filter('.third'))
  9472. }
  9473. function s(e, t, i, n) {
  9474. T.addClass('front-page'),
  9475. R.filter('.first').attr('src', e),
  9476. R.filter('.second').attr('src', t),
  9477. M.filter('.first').addClass(i),
  9478. M.filter('.second').addClass(i),
  9479. M.addClass(n),
  9480. '.show-desktop' === w && S.insertAfter(x)
  9481. }
  9482. function l(e, t, i) {
  9483. S.addClass('headsetOptions'),
  9484. M.off(),
  9485. R.filter('.second').attr('src', t),
  9486. D.css('display', 'block'),
  9487. P.filter('.second').css('display', 'none'),
  9488. D.on('click', function () {
  9489. a(_.Title), o(m.Desktop)
  9490. }),
  9491. e &&
  9492. (K.emit(A.falseICECHOSEN, {
  9493. name: g.GearVR
  9494. }),
  9495. R.filter('.first').attr('src', e),
  9496. R.filter('.second').addClass('gear'),
  9497. R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)),
  9498. Q.gearvr()),
  9499. i &&
  9500. (K.emit(A.falseICECHOSEN, {
  9501. name: g.Cardboard
  9502. }),
  9503. R.filter('.third').attr('src', i),
  9504. R.filter('.third').show(),
  9505. R.filter('.third').insertAfter(R.filter('.second')),
  9506. R.filter('.third').addClass('link'),
  9507. R.filter('.second').addClass('link'),
  9508. R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)),
  9509. R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)),
  9510. Q.cardboard())
  9511. }
  9512. function c(e, t) {
  9513. switch (t) {
  9514. case m.IOS:
  9515. ;(X = Y), (Z = j)
  9516. break
  9517. case m.Desktop:
  9518. e === _.Cardboard
  9519. ? ((X = F), (Z = U), R.filter('.second').on('click', f.launchStore.bind(this, g.CardboardIOS)), R.filter('.third').on('click', f.launchStore.bind(this, g.CardboardAndroid)))
  9520. : ((X = V), R.filter('.second').on('click', f.launchStore.bind(this, g.GearVR)), (Z = ''))
  9521. break
  9522. default:
  9523. e === _.Cardboard ? ((X = z), (Z = j)) : ((X = k), (Z = W))
  9524. }
  9525. }
  9526. function h(e, t, i) {
  9527. T.find('.inner').addClass('details-page'), T.addClass('details-page'), R.filter('.first').attr('src', e), R.filter('.second').attr('src', t), R.filter('.third').attr('src', i)
  9528. }
  9529. function u() {
  9530. T.hasClass('fadeIn') && (T.removeClass('fadeIn'), K.emit(A.CLOSED))
  9531. }
  9532. function d() {
  9533. var e = p.aspectRatio() > 1 && p.isMobile()
  9534. T.toggleClass('landscape', e).toggleClass('portrait', !e),
  9535. T.toggleClass('tiny', $('#player').height() <= y.narrowLandscapeHeight),
  9536. T.toggleClass('tinier', $('#player').height() <= y.reallyNarrowLandscapeHeight)
  9537. }
  9538. var p = e('../../util/browser'),
  9539. f = e('./vrLink'),
  9540. g = e('../../enum/VRApps'),
  9541. m = e('../../enum/VRPlatforms'),
  9542. v = e('../../enum/VRPages'),
  9543. A = e('./vrEvent'),
  9544. y = (e('../../settings'), e('../../constants')),
  9545. C = e('../../localization/localize'),
  9546. I = e('../../util/common'),
  9547. E = e('events').EventEmitter,
  9548. b = 0,
  9549. w = null,
  9550. _ = v.standard,
  9551. T = $('.vr-popup'),
  9552. x = T.find('.vr-popup-body'),
  9553. S = T.find('.vr-images'),
  9554. M = T.find('.img-container'),
  9555. R = T.find('.vr-sm-image'),
  9556. P = M.find('.vr-img-caption'),
  9557. O = $('.vr-buttons').find('.prev-button'),
  9558. L = $('.vr-buttons').find('.next-button'),
  9559. D = S.find('.front-close'),
  9560. N = $('.vr-page'),
  9561. B = T.find('img'),
  9562. F = 'images/apple-store.png',
  9563. V = 'images/badge-oculus.png',
  9564. U = 'images/badge-cardboard.png',
  9565. k = 'images/logo-samsung.png',
  9566. H = 'images/headset-cardboard.png',
  9567. G = 'images/headset-gearvr.png',
  9568. z = 'images/ico-android-robot.png',
  9569. W = 'images/ico-gearvr.png',
  9570. j = 'images/ico-vr.png',
  9571. Y = 'images/apple-logo-white.svg',
  9572. X = null,
  9573. Z = null,
  9574. q = {},
  9575. K = {
  9576. init: r,
  9577. dismiss: u,
  9578. isDeviceSupported: n
  9579. }
  9580. I.extendObject(K, E.prototype), $(window).resize(d)
  9581. var Q = (function () {
  9582. var e = P.filter('.first').find('.cardboard'),
  9583. t = P.filter('.first').find('.gearvr')
  9584. return {
  9585. cardboard: function () {
  9586. t.addClass('hidden'), e.removeClass('hidden')
  9587. },
  9588. gearvr: function () {
  9589. e.addClass('hidden'), t.removeClass('hidden')
  9590. }
  9591. }
  9592. })()
  9593. t.exports = K
  9594. },
  9595. {
  9596. '../../constants': 8,
  9597. '../../enum/VRApps': 46,
  9598. '../../enum/VRPages': 48,
  9599. '../../enum/VRPlatforms': 49,
  9600. '../../localization/localize': 108,
  9601. '../../settings': 166,
  9602. '../../util/browser': 182,
  9603. '../../util/common': 185,
  9604. './vrEvent': 85,
  9605. './vrLink': 86,
  9606. events: 202
  9607. }
  9608. ],
  9609. 88: [
  9610. function (e, t, i) {
  9611. 'use strict'
  9612. t.exports = Object.freeze({
  9613. OPENED: 'webvr.modal.opened',
  9614. SHOW_TERMS: 'webvr.footer.show.terms'
  9615. })
  9616. },
  9617. {}
  9618. ],
  9619. 89: [
  9620. function (e, t, i) {
  9621. ;(function (i) {
  9622. 'use strict'
  9623. function n(e, t, i, n) {
  9624. function r(e) {
  9625. e.preventDefault(), a(e.currentTarget.id)
  9626. }
  9627. function a(e) {
  9628. ne[e](),
  9629. Object.keys(ne).map(function (t, i) {
  9630. $('#' + t).toggleClass('tabs-underlined', t === e)
  9631. })
  9632. }
  9633. ;(y = i), (v = t), w.init(E.Android, e, n), m()
  9634. var l = new RegExp('daydream', 'i'),
  9635. c = l.test(y.displayName)
  9636. c
  9637. ? (a('tabdaydream'), B.filter('.device-headset-side').attr('src', H), D.find('.title').text(x.localizeText('WEBVR_FOR_DAYDREAM')))
  9638. : (a('tabcardboard'), B.filter('.device-headset-side').attr('src', Y), D.find('.title').text(x.localizeText('WEBVR_FOR_CARDBOARD'))),
  9639. $('#vr').on('click', function (e) {
  9640. e.preventDefault(), g('click_webvr_button'), L.is(':hidden') && (ie.emit(_.OPENED), o())
  9641. }),
  9642. $('.webvr-popup .close').on('click', function (e) {
  9643. e.preventDefault(), D.hasClass('hidden') ? (g('webvr_help_close'), p()) : s()
  9644. }),
  9645. $('#tabcardboard').on('click', r),
  9646. $('#tabdaydream').on('click', r),
  9647. $('#tabnative').on('click', r),
  9648. $('.webvr-popup .open-with-app').on('click', function (e) {
  9649. e.preventDefault(), g('webvr_learn_more'), a('tabnative'), p()
  9650. }),
  9651. $('.webvr-popup .help').on('click', function (e) {
  9652. e.preventDefault(), g(D.hasClass('hidden') ? 'webvr_help_close' : 'webvr_help_show'), p()
  9653. }),
  9654. $('.webvr-popup .terms').on('click', function (e) {
  9655. e.preventDefault(), g('webvr_click_terms'), s(), ie.emit(_.SHOW_TERMS)
  9656. }),
  9657. F.on('click', function (e) {
  9658. e.preventDefault(), g(ee), window.open(J, '_blank')
  9659. }),
  9660. V.on('click', function (e) {
  9661. e.preventDefault(), g('webvr_phone_link'), window.open(te, '_blank')
  9662. }),
  9663. $('.webvr-popup .badge-cardboard').on('click', function (e) {
  9664. e.preventDefault(), g('webvr_cardboard_link'), w.launch(b.CardboardAndroid)
  9665. }),
  9666. $('.webvr-popup .badge-oculus').on('click', function (e) {
  9667. e.preventDefault(), g('webvr_oculus_link'), w.launch(b.GearVR)
  9668. })
  9669. }
  9670. function r() {
  9671. function e() {
  9672. y.isPresenting || (f(), window.removeEventListener('vrdisplaypresentchange', e))
  9673. }
  9674. R.info('Headset mounted'), v.suspend()
  9675. var t = document.createElement('canvas')
  9676. for (t.getContext('webgl'), t.className = 'webvr-canvas', document.bgColor = '#000', document.body.style.backgroundColor = '#000'; document.body.firstChild; )
  9677. document.body.removeChild(document.body.firstChild)
  9678. document.body.appendChild(t),
  9679. g('webvr_enter_app'),
  9680. y
  9681. .requestPresent([
  9682. {
  9683. source: t,
  9684. predistorted: !0
  9685. }
  9686. ])
  9687. .catch(function (t) {
  9688. R.error('Failed to present: ' + t), g('webvr_exit_calibrate'), e()
  9689. }),
  9690. A.then(function () {
  9691. window.dispatchEvent(new Event('vrapp-start'))
  9692. }),
  9693. window.addEventListener('vrdisplaypresentchange', e)
  9694. }
  9695. function o() {
  9696. O.fadeOut(I.guiAnimationSpeed), L.fadeIn(I.guiAnimationSpeed), a()
  9697. }
  9698. function a() {
  9699. if (!A) {
  9700. var e = C.valueFromHash('webvr') || I.appConfig.webvr_version,
  9701. t = 'https://static.port.com/webvr/' + e + '/js/main.js'
  9702. A = new Promise(function (e, i) {
  9703. var n = document.createElement('script')
  9704. ;(n.type = 'text/javascript'), (n.src = t), (n.onload = e), document.head.appendChild(n)
  9705. })
  9706. }
  9707. D.find('.enter-button').on('click', r)
  9708. }
  9709. function s() {
  9710. g('webvr_modal_close'),
  9711. D.find('.enter-button').off('click', r),
  9712. L.fadeOut(I.guiAnimationSpeed, function () {
  9713. D.toggleClass('hidden', !1), N.toggleClass('hidden', !0), C.exitFullscreen()
  9714. }),
  9715. O.fadeIn(I.guiAnimationSpeed)
  9716. }
  9717. function l() {
  9718. k.toggleClass('hidden', !1), U.toggleClass('hidden', !0)
  9719. }
  9720. function c() {
  9721. k.toggleClass('hidden', !0), U.toggleClass('hidden', !1)
  9722. }
  9723. function h() {
  9724. B.filter('.device-headset').attr('src', G),
  9725. B.filter('.device-phone').attr('src', z),
  9726. (J = Z),
  9727. (ee = K),
  9728. F.text(x.localizeText('WEBVR_DAYDREAM_VIEW')),
  9729. V.text(x.localizeText('VR_NEED_DAYDREAM_PHONE')),
  9730. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !1),
  9731. c()
  9732. }
  9733. function u() {
  9734. B.filter('.badge-cardboard').attr('src', j), B.filter('.badge-oculus').attr('src', X), l()
  9735. }
  9736. function d() {
  9737. B.filter('.device-headset').attr('src', Y),
  9738. B.filter('.device-phone').attr('src', W),
  9739. (J = q),
  9740. (ee = Q),
  9741. F.text(x.localizeText('VR_GOOGLE_CARDBOARD')),
  9742. V.text(x.localizeText('VR_COMPATIBLE_ANDROID_LONG')),
  9743. $('.webvr-popup .detail.daydream-label').toggleClass('hidden', !0),
  9744. c()
  9745. }
  9746. function p() {
  9747. D.toggleClass('hidden'), N.toggleClass('hidden')
  9748. }
  9749. function f() {
  9750. R.info('exiting webVR'), g('webvr_exit_app'), window.location.search.indexOf('&qs=1') === -1 ? (window.location = window.location + '&qs=1') : (window.location = window.location)
  9751. }
  9752. function g(e) {
  9753. var t = C.isLandscape() ? 'landscape' : 'portrait'
  9754. T.trackAlways('showcase_gui', {
  9755. gui_action: e,
  9756. orientation: t
  9757. })
  9758. }
  9759. function m() {
  9760. var e = C.isLandscape()
  9761. L.toggleClass('landscape', e).toggleClass('portrait', !e)
  9762. }
  9763. var v,
  9764. A,
  9765. y,
  9766. C = e('../../util/browser'),
  9767. I = e('../../settings'),
  9768. E = (e('./../gui'), e('../../enum/VRPlatforms')),
  9769. b = e('../../enum/VRApps'),
  9770. w = e('./../vr/vrLink'),
  9771. _ = e('./WebVrEvent'),
  9772. T = e('../../analytics'),
  9773. x = (e('../../constants'), e('../../localization/localize')),
  9774. S = e('../../util/common'),
  9775. M = e('../../util/logger'),
  9776. R = new M(i),
  9777. P = e('events').EventEmitter,
  9778. O = $('#gui'),
  9779. L = $('.webvr-popup'),
  9780. D = $('.webvr-popup .page.p1'),
  9781. N = $('.webvr-popup .page.p2'),
  9782. B = L.find('.image'),
  9783. F = $('.webvr-popup .detail.headset'),
  9784. V = $('.webvr-popup .detail.phone'),
  9785. U = $('.webvr-popup .tab-content.webvr'),
  9786. k = $('.webvr-popup .tab-content.native'),
  9787. H = 'images/device-daydream-side.png',
  9788. G = 'images/device-daydream.png',
  9789. z = 'images/device-pixel.png',
  9790. W = 'images/ico-android-robot.png',
  9791. j = 'images/badge-cardboard.png',
  9792. Y = 'images/headset-cardboard.png',
  9793. X = 'images/badge-oculus.png',
  9794. Z = 'https://madeby.google.com/vr/',
  9795. q = 'https://vr.google.com/cardboard/get-cardboard/',
  9796. K = 'webvr_daydream_link',
  9797. Q = 'webvr_cardboard_link',
  9798. J = Z,
  9799. ee = K,
  9800. te = 'https://vr.google.com/daydream/phones/',
  9801. ie = {
  9802. init: n
  9803. },
  9804. ne = {
  9805. tabcardboard: d,
  9806. tabdaydream: h,
  9807. tabnative: u
  9808. }
  9809. S.extendObject(ie, P.prototype), $(window).resize(m), (t.exports = ie)
  9810. }).call(this, '/js/gui/webvr/webVRgui.js')
  9811. },
  9812. {
  9813. '../../analytics': 4,
  9814. '../../constants': 8,
  9815. '../../enum/VRApps': 46,
  9816. '../../enum/VRPlatforms': 49,
  9817. '../../localization/localize': 108,
  9818. '../../settings': 166,
  9819. '../../util/browser': 182,
  9820. '../../util/common': 185,
  9821. '../../util/logger': 189,
  9822. './../gui': 65,
  9823. './../vr/vrLink': 86,
  9824. './WebVrEvent': 88,
  9825. events: 202
  9826. }
  9827. ],
  9828. 90: [
  9829. function (e, t, i) {
  9830. 'use strict'
  9831. function n(e, t, i, n, o) {
  9832. n || 0 === n ? (this.floorId = n) : (this.floorId = -1), (this.roomId = o || ''), (this.labelId = e), (this.position = new r.Vector3().copy(t)), (this.text = i)
  9833. }
  9834. var r = e('three'),
  9835. o = e('../util/browser')
  9836. ;(n.prototype.build = function () {
  9837. var e = window.document.createElement('div')
  9838. o.isMobile() ? e.setAttribute('class', 'gui-floorplan-label gui-floorplan-label-mobile') : e.setAttribute('class', 'gui-floorplan-label')
  9839. var t = window.document.createElement('div')
  9840. t.setAttribute('class', 'gui-floorplan-label-text')
  9841. var i = window.document.createTextNode(this.text)
  9842. t.appendChild(i), e.appendChild(t), window.document.body.appendChild(e), (this.labelGui = e), (this.textBlock = t), $(this.labelGui).hide()
  9843. var n = window.getComputedStyle(this.labelGui)
  9844. this.initialTransform = n.transform || n.webkitTransform
  9845. }),
  9846. (t.exports = n)
  9847. },
  9848. {
  9849. '../util/browser': 182,
  9850. three: 217
  9851. }
  9852. ],
  9853. 91: [
  9854. function (e, t, i) {
  9855. 'use strict'
  9856. function n() {
  9857. ;(this.player = null), (this.modelManager = null), (this.container = null)
  9858. }
  9859. var r = e('three'),
  9860. o = (e('../util/common'), e('../enum/PlayerEvents')),
  9861. a = (e('../enum/DirectorEvents'), e('../enum/ModelManagerEvents')),
  9862. s = e('../settings'),
  9863. l = e('../enum/Viewmode'),
  9864. c = (e('../enum/WarpStyle'), e('../util/transitions'), e('../util/lerp'), e('../util/browser'))
  9865. //场景初始化
  9866. ;(n.prototype.init = function (e, t, i) {
  9867. ;(this.player = e), (this.modelManager = t), (this.container = i), this.updateModel(), this.bindEvents()
  9868. }),
  9869. (n.prototype.bindEvents = function () {
  9870. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9871. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9872. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9873. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9874. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9875. }),
  9876. (n.prototype.updateModel = function () {
  9877. this.model = this.modelManager.getActiveModel()
  9878. }),
  9879. (n.prototype.handlePlayerViewChanged = function () {
  9880. this.updateLabelVisibility(), this.updateLabelDisplay()
  9881. }),
  9882. (n.prototype.getLabelsForFloor = function (e, t) {
  9883. return (
  9884. (t = t || []),
  9885. (t.length = 0),
  9886. this.model.labels.forEach(
  9887. function (i) {
  9888. this.labelVisibleForFloor(i, e) && t.push(i)
  9889. }.bind(this)
  9890. ),
  9891. t
  9892. )
  9893. }),
  9894. (n.prototype.getLabelsForCurrentFloor = function (e) {
  9895. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9896. }),
  9897. (n.prototype.labelVisibleForFloor = function (e, t) {
  9898. var i =
  9899. (c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile) || (!c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop)
  9900. if (!this.model.showingLabels || !e.labelGui || !i) return !1
  9901. var n = e.floorId === this.model.floors.size() - 1
  9902. return this.model.allFloorsVisible ? n : e.floorId === t
  9903. }),
  9904. (n.prototype.updateLabelVisibility = function (e) {
  9905. this.model.labels.forEach(
  9906. function (e) {
  9907. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex)
  9908. ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration)
  9909. : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9910. }.bind(this)
  9911. )
  9912. }),
  9913. (n.prototype.showAllLabels = function (e, t) {
  9914. this.model.labels.forEach(
  9915. function (i) {
  9916. this.showLabel(i, e, t)
  9917. }.bind(this)
  9918. )
  9919. }),
  9920. (n.prototype.hideAllLabels = function (e, t) {
  9921. this.model.labels.forEach(
  9922. function (i) {
  9923. this.hideLabel(i, e, t)
  9924. }.bind(this)
  9925. )
  9926. }),
  9927. (n.prototype.showLabel = function (e, t, i) {
  9928. this.model.showingLabels && (e.visible || ((e.visible = !0), (e.labelGui.style.display = 'block'), (e.labelGui.style.opacity = 0), $(e.labelGui).delay(t).fadeTo(i, 1)))
  9929. }),
  9930. (n.prototype.hideLabel = function (e, t, i) {
  9931. e.visible && ((e.visible = !1), c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9932. }),
  9933. (n.prototype.supportedMode = function () {
  9934. return this.player.mode === l.FLOORPLAN
  9935. }),
  9936. (n.prototype.updateLabelDisplay = (function () {
  9937. var e = (new r.Vector3(), new r.Vector3(), [])
  9938. return function () {
  9939. var t = this.player.getLabelScaleFactor(),
  9940. i = 0.6,
  9941. n = 1.2,
  9942. r = (1 - t) * n + i,
  9943. o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop
  9944. this.getLabelsForCurrentFloor(e)
  9945. for (var a = 0; a < e.length; a++) {
  9946. var l = e[a]
  9947. this.supportedMode() &&
  9948. l.labelGui &&
  9949. (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9950. t >= o && l.text.length >= s.labels.minLengthForTruncate
  9951. ? (l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix)
  9952. : (l.textBlock.innerText = l.text))
  9953. }
  9954. }
  9955. })()),
  9956. (n.prototype.updateProjectedGuiElement = (function () {
  9957. var e = new r.Vector3()
  9958. new r.Vector3()
  9959. return function (t, i, n, r, o) {
  9960. i.style.fontSize = 100 * o + '%'
  9961. var a = $('#player').width(),
  9962. s = $('#player').height(),
  9963. l = 0.5 * a,
  9964. c = 0.5 * s
  9965. e.copy(n), e.project(this.player.camera)
  9966. var h = e.x * l + l,
  9967. u = -(e.y * c) + c
  9968. ;(h -= t.offsetWidth / 2), (u -= t.offsetHeight / 2), (t.style.left = h + 'px'), (t.style.top = u + 'px')
  9969. }
  9970. })()),
  9971. (n.prototype.handleStartInside = function (e) {
  9972. this.updateLabelVisibility()
  9973. }),
  9974. (n.prototype.handleStartOutside = function () {
  9975. this.updateLabelVisibility()
  9976. }),
  9977. (t.exports = n)
  9978. },
  9979. {
  9980. '../enum/DirectorEvents': 23,
  9981. '../enum/ModelManagerEvents': 33,
  9982. '../enum/PlayerEvents': 40,
  9983. '../enum/Viewmode': 51,
  9984. '../enum/WarpStyle': 52,
  9985. '../settings': 166,
  9986. '../util/browser': 182,
  9987. '../util/common': 185,
  9988. '../util/lerp': 188,
  9989. '../util/transitions': 195,
  9990. three: 217
  9991. }
  9992. ],
  9993. 92: [
  9994. function (e, t, i) {
  9995. 'use strict'
  9996. Array.prototype.findIndex ||
  9997. (Array.prototype.findIndex = function (e) {
  9998. if (null == this) throw new TypeError('Array.prototype.findIndex called on null or undefined')
  9999. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  10000. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++) if (((t = i[o]), e.call(r, t, o, i))) return o
  10001. return -1
  10002. }),
  10003. Array.prototype.find ||
  10004. Object.defineProperty(Array.prototype, 'find', {
  10005. value: function (e) {
  10006. if (null == this) throw new TypeError('"this" is null or not defined')
  10007. var t = Object(this),
  10008. i = t.length >>> 0
  10009. if ('function' != typeof e) throw new TypeError('predicate must be a function')
  10010. for (var n = arguments[1], r = 0; r < i; ) {
  10011. var o = t[r]
  10012. if (e.call(n, o, r, t)) return o
  10013. r++
  10014. }
  10015. }
  10016. })
  10017. },
  10018. {}
  10019. ],
  10020. 93: [
  10021. function (e, t, i) {
  10022. 'use strict'
  10023. var n = n || {}
  10024. ;(t.exports = n),
  10025. (n.gui = n.gui || {}),
  10026. (n.utils = n.utils || {}),
  10027. (n.controllers = n.controllers || {}),
  10028. (n.dom = n.dom || {}),
  10029. (n.color = n.color || {}),
  10030. (n.utils.css = (function () {
  10031. return {
  10032. load: function (e, t) {
  10033. t = t || document
  10034. var i = t.createElement('link')
  10035. ;(i.type = 'text/css'), (i.rel = 'stylesheet'), (i.href = e), t.getElementsByTagName('head')[0].appendChild(i)
  10036. },
  10037. inject: function (e, t) {
  10038. t = t || document
  10039. var i = document.createElement('style')
  10040. ;(i.type = 'text/css'), (i.innerHTML = e), t.getElementsByTagName('head')[0].appendChild(i)
  10041. }
  10042. }
  10043. })()),
  10044. (n.utils.common = (function () {
  10045. var e = Array.prototype.forEach,
  10046. t = Array.prototype.slice
  10047. return {
  10048. BREAK: {},
  10049. extend: function (e) {
  10050. return (
  10051. this.each(
  10052. t.call(arguments, 1),
  10053. function (t) {
  10054. for (var i in t) this.isUndefined(t[i]) || (e[i] = t[i])
  10055. },
  10056. this
  10057. ),
  10058. e
  10059. )
  10060. },
  10061. defaults: function (e) {
  10062. return (
  10063. this.each(
  10064. t.call(arguments, 1),
  10065. function (t) {
  10066. for (var i in t) this.isUndefined(e[i]) && (e[i] = t[i])
  10067. },
  10068. this
  10069. ),
  10070. e
  10071. )
  10072. },
  10073. compose: function () {
  10074. var e = t.call(arguments)
  10075. return function () {
  10076. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--) i = [e[n].apply(this, i)]
  10077. return i[0]
  10078. }
  10079. },
  10080. each: function (t, i, n) {
  10081. if (t)
  10082. if (e && t.forEach && t.forEach === e) t.forEach(i, n)
  10083. else if (t.length === t.length + 0) {
  10084. for (var r = 0, o = t.length; r < o; r++) if (r in t && i.call(n, t[r], r) === this.BREAK) return
  10085. } else for (var r in t) if (i.call(n, t[r], r) === this.BREAK) return
  10086. },
  10087. defer: function (e) {
  10088. setTimeout(e, 0)
  10089. },
  10090. toArray: function (e) {
  10091. return e.toArray ? e.toArray() : t.call(e)
  10092. },
  10093. isUndefined: function (e) {
  10094. return void 0 === e
  10095. },
  10096. isNull: function (e) {
  10097. return null === e
  10098. },
  10099. isNaN: function (e) {
  10100. return e !== e
  10101. },
  10102. isArray:
  10103. Array.isArray ||
  10104. function (e) {
  10105. return e.constructor === Array
  10106. },
  10107. isObject: function (e) {
  10108. return e === Object(e)
  10109. },
  10110. isNumber: function (e) {
  10111. return e === e + 0
  10112. },
  10113. isString: function (e) {
  10114. return e === e + ''
  10115. },
  10116. isBoolean: function (e) {
  10117. return e === !1 || e === !0
  10118. },
  10119. isFunction: function (e) {
  10120. return '[object Function]' === Object.prototype.toString.call(e)
  10121. }
  10122. }
  10123. })()),
  10124. (n.controllers.Controller = (function (e) {
  10125. var t = function (e, t) {
  10126. ;(this.initialValue = e[t]), (this.domElement = document.createElement('div')), (this.object = e), (this.property = t), (this.__onChange = void 0), (this.__onFinishChange = void 0)
  10127. }
  10128. return (
  10129. e.extend(t.prototype, {
  10130. onChange: function (e) {
  10131. return (this.__onChange = e), this
  10132. },
  10133. onFinishChange: function (e) {
  10134. return (this.__onFinishChange = e), this
  10135. },
  10136. setValue: function (e) {
  10137. return (this.object[this.property] = e), this.__onChange && this.__onChange.call(this, e), this.updateDisplay(), this
  10138. },
  10139. getValue: function () {
  10140. return this.object[this.property]
  10141. },
  10142. updateDisplay: function () {
  10143. return this
  10144. },
  10145. isModified: function () {
  10146. return this.initialValue !== this.getValue()
  10147. }
  10148. }),
  10149. t
  10150. )
  10151. })(n.utils.common)),
  10152. (n.dom.dom = (function (e) {
  10153. function t(t) {
  10154. if ('0' === t || e.isUndefined(t)) return 0
  10155. var i = t.match(r)
  10156. return e.isNull(i) ? 0 : parseFloat(i[1])
  10157. }
  10158. var i = {
  10159. HTMLEvents: ['change'],
  10160. MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'],
  10161. KeyboardEvents: ['keydown']
  10162. },
  10163. n = {}
  10164. e.each(i, function (t, i) {
  10165. e.each(t, function (e) {
  10166. n[e] = i
  10167. })
  10168. })
  10169. var r = /(\d+(\.\d+)?)px/,
  10170. o = {
  10171. makeSelectable: function (e, t) {
  10172. void 0 !== e &&
  10173. void 0 !== e.style &&
  10174. ((e.onselectstart = t
  10175. ? function () {
  10176. return !1
  10177. }
  10178. : function () {}),
  10179. (e.style.MozUserSelect = t ? 'auto' : 'none'),
  10180. (e.style.KhtmlUserSelect = t ? 'auto' : 'none'),
  10181. (e.unselectable = t ? 'on' : 'off'))
  10182. },
  10183. makeFullscreen: function (t, i, n) {
  10184. e.isUndefined(i) && (i = !0),
  10185. e.isUndefined(n) && (n = !0),
  10186. (t.style.position = 'absolute'),
  10187. i && ((t.style.left = 0), (t.style.right = 0)),
  10188. n && ((t.style.top = 0), (t.style.bottom = 0))
  10189. },
  10190. fakeEvent: function (t, i, r, o) {
  10191. r = r || {}
  10192. var a = n[i]
  10193. if (!a) throw new Error('Event type ' + i + ' not supported.')
  10194. var s = document.createEvent(a)
  10195. switch (a) {
  10196. case 'MouseEvents':
  10197. var l = r.x || r.clientX || 0,
  10198. c = r.y || r.clientY || 0
  10199. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null)
  10200. break
  10201. case 'KeyboardEvents':
  10202. var h = s.initKeyboardEvent || s.initKeyEvent
  10203. e.defaults(r, {
  10204. cancelable: !0,
  10205. ctrlKey: !1,
  10206. altKey: !1,
  10207. shiftKey: !1,
  10208. metaKey: !1,
  10209. keyCode: void 0,
  10210. charCode: void 0
  10211. }),
  10212. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode)
  10213. break
  10214. default:
  10215. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  10216. }
  10217. e.defaults(s, o), t.dispatchEvent(s)
  10218. },
  10219. bind: function (e, t, i, n) {
  10220. return (n = n || !1), e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent('on' + t, i), o
  10221. },
  10222. unbind: function (e, t, i, n) {
  10223. return (n = n || !1), e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent('on' + t, i), o
  10224. },
  10225. addClass: function (e, t) {
  10226. if (void 0 === e.className) e.className = t
  10227. else if (e.className !== t) {
  10228. var i = e.className.split(/ +/)
  10229. i.indexOf(t) == -1 && (i.push(t), (e.className = i.join(' ').replace(/^\s+/, '').replace(/\s+$/, '')))
  10230. }
  10231. return o
  10232. },
  10233. removeClass: function (e, t) {
  10234. if (t)
  10235. if (void 0 === e.className);
  10236. else if (e.className === t) e.removeAttribute('class')
  10237. else {
  10238. var i = e.className.split(/ +/),
  10239. n = i.indexOf(t)
  10240. n != -1 && (i.splice(n, 1), (e.className = i.join(' ')))
  10241. }
  10242. else e.className = void 0
  10243. return o
  10244. },
  10245. hasClass: function (e, t) {
  10246. return new RegExp('(?:^|\\s+)' + t + '(?:\\s+|$)').test(e.className) || !1
  10247. },
  10248. getWidth: function (e) {
  10249. var i = getComputedStyle(e)
  10250. return t(i['border-left-width']) + t(i['border-right-width']) + t(i['padding-left']) + t(i['padding-right']) + t(i.width)
  10251. },
  10252. getHeight: function (e) {
  10253. var i = getComputedStyle(e)
  10254. return t(i['border-top-width']) + t(i['border-bottom-width']) + t(i['padding-top']) + t(i['padding-bottom']) + t(i.height)
  10255. },
  10256. getOffset: function (e) {
  10257. var t = {
  10258. left: 0,
  10259. top: 0
  10260. }
  10261. if (e.offsetParent)
  10262. do (t.left += e.offsetLeft), (t.top += e.offsetTop)
  10263. while ((e = e.offsetParent))
  10264. return t
  10265. },
  10266. isActive: function (e) {
  10267. return e === document.activeElement && (e.type || e.href)
  10268. }
  10269. }
  10270. return o
  10271. })(n.utils.common)),
  10272. (n.controllers.OptionController = (function (e, t, i) {
  10273. var n = function (e, r, o) {
  10274. n.superclass.call(this, e, r)
  10275. var a = this
  10276. if (((this.__select = document.createElement('select')), i.isArray(o))) {
  10277. var s = {}
  10278. i.each(o, function (e) {
  10279. s[e] = e
  10280. }),
  10281. (o = s)
  10282. }
  10283. i.each(o, function (e, t) {
  10284. var i = document.createElement('option')
  10285. ;(i.innerHTML = t), i.setAttribute('value', e), a.__select.appendChild(i)
  10286. }),
  10287. this.updateDisplay(),
  10288. t.bind(this.__select, 'change', function () {
  10289. var e = this.options[this.selectedIndex].value
  10290. a.setValue(e)
  10291. }),
  10292. this.domElement.appendChild(this.__select)
  10293. }
  10294. return (
  10295. (n.superclass = e),
  10296. i.extend(n.prototype, e.prototype, {
  10297. setValue: function (e) {
  10298. var t = n.superclass.prototype.setValue.call(this, e)
  10299. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), t
  10300. },
  10301. updateDisplay: function () {
  10302. return (this.__select.value = this.getValue()), n.superclass.prototype.updateDisplay.call(this)
  10303. }
  10304. }),
  10305. n
  10306. )
  10307. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  10308. (n.controllers.NumberController = (function (e, t) {
  10309. function i(e) {
  10310. return (e = e.toString()), e.indexOf('.') > -1 ? e.length - e.indexOf('.') - 1 : 0
  10311. }
  10312. var n = function (e, r, o) {
  10313. n.superclass.call(this, e, r),
  10314. (o = o || {}),
  10315. (this.__min = o.min),
  10316. (this.__max = o.max),
  10317. (this.__step = o.step),
  10318. t.isUndefined(this.__step)
  10319. ? 0 == this.initialValue
  10320. ? (this.__impliedStep = 1)
  10321. : (this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10)
  10322. : (this.__impliedStep = this.__step),
  10323. (this.__precision = i(this.__impliedStep))
  10324. }
  10325. return (
  10326. (n.superclass = e),
  10327. t.extend(n.prototype, e.prototype, {
  10328. setValue: function (e) {
  10329. return (
  10330. void 0 !== this.__min && e < this.__min ? (e = this.__min) : void 0 !== this.__max && e > this.__max && (e = this.__max),
  10331. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  10332. n.superclass.prototype.setValue.call(this, e)
  10333. )
  10334. },
  10335. min: function (e) {
  10336. return (this.__min = e), this
  10337. },
  10338. max: function (e) {
  10339. return (this.__max = e), this
  10340. },
  10341. step: function (e) {
  10342. return (this.__step = e), (this.__impliedStep = e), (this.__precision = i(e)), this
  10343. }
  10344. }),
  10345. n
  10346. )
  10347. })(n.controllers.Controller, n.utils.common)),
  10348. (n.controllers.NumberControllerBox = (function (e, t, i) {
  10349. function n(e, t) {
  10350. var i = Math.pow(10, t)
  10351. return Math.round(e * i) / i
  10352. }
  10353. var r = function (e, n, o) {
  10354. function a() {
  10355. var e = parseFloat(d.__input.value)
  10356. i.isNaN(e) || d.setValue(e)
  10357. }
  10358. function s() {
  10359. a(), d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  10360. }
  10361. function l(e) {
  10362. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), (u = e.clientY)
  10363. }
  10364. function c(e) {
  10365. var t = u - e.clientY
  10366. d.setValue(d.getValue() + t * d.__impliedStep), (u = e.clientY)
  10367. }
  10368. function h() {
  10369. t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h)
  10370. }
  10371. ;(this.__truncationSuspended = !1), r.superclass.call(this, e, n, o)
  10372. var u,
  10373. d = this
  10374. ;(this.__input = document.createElement('input')),
  10375. this.__input.setAttribute('type', 'text'),
  10376. t.bind(this.__input, 'change', a),
  10377. t.bind(this.__input, 'blur', s),
  10378. t.bind(this.__input, 'mousedown', l),
  10379. t.bind(this.__input, 'keydown', function (e) {
  10380. 13 === e.keyCode && ((d.__truncationSuspended = !0), this.blur(), (d.__truncationSuspended = !1))
  10381. }),
  10382. this.updateDisplay(),
  10383. this.domElement.appendChild(this.__input)
  10384. }
  10385. return (
  10386. (r.superclass = e),
  10387. i.extend(r.prototype, e.prototype, {
  10388. updateDisplay: function () {
  10389. return (this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision)), r.superclass.prototype.updateDisplay.call(this)
  10390. }
  10391. }),
  10392. r
  10393. )
  10394. })(n.controllers.NumberController, n.dom.dom, n.utils.common)),
  10395. (n.controllers.NumberControllerSlider = (function (e, t, i, n, r) {
  10396. function o(e, t, i, n, r) {
  10397. return n + (r - n) * ((e - t) / (i - t))
  10398. }
  10399. var a = function (e, i, n, r, s) {
  10400. function l(e) {
  10401. t.bind(window, 'mousemove', c), t.bind(window, 'mouseup', h), c(e)
  10402. }
  10403. function c(e) {
  10404. e.preventDefault()
  10405. var i = t.getOffset(u.__background),
  10406. n = t.getWidth(u.__background)
  10407. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)), !1
  10408. }
  10409. function h() {
  10410. t.unbind(window, 'mousemove', c), t.unbind(window, 'mouseup', h), u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  10411. }
  10412. a.superclass.call(this, e, i, {
  10413. min: n,
  10414. max: r,
  10415. step: s
  10416. })
  10417. var u = this
  10418. ;(this.__background = document.createElement('div')),
  10419. (this.__foreground = document.createElement('div')),
  10420. t.bind(this.__background, 'mousedown', l),
  10421. t.addClass(this.__background, 'slider'),
  10422. t.addClass(this.__foreground, 'slider-fg'),
  10423. this.updateDisplay(),
  10424. this.__background.appendChild(this.__foreground),
  10425. this.domElement.appendChild(this.__background)
  10426. }
  10427. return (
  10428. (a.superclass = e),
  10429. (a.useDefaultStyles = function () {
  10430. i.inject(r)
  10431. }),
  10432. n.extend(a.prototype, e.prototype, {
  10433. updateDisplay: function () {
  10434. var e = (this.getValue() - this.__min) / (this.__max - this.__min)
  10435. return (this.__foreground.style.width = 100 * e + '%'), a.superclass.prototype.updateDisplay.call(this)
  10436. }
  10437. }),
  10438. a
  10439. )
  10440. })(
  10441. n.controllers.NumberController,
  10442. n.dom.dom,
  10443. n.utils.css,
  10444. n.utils.common,
  10445. '/**\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}'
  10446. )),
  10447. (n.controllers.FunctionController = (function (e, t, i) {
  10448. var n = function (e, i, r) {
  10449. n.superclass.call(this, e, i)
  10450. var o = this
  10451. ;(this.__button = document.createElement('div')),
  10452. (this.__button.innerHTML = void 0 === r ? 'Fire' : r),
  10453. t.bind(this.__button, 'click', function (e) {
  10454. return e.preventDefault(), o.fire(), !1
  10455. }),
  10456. t.addClass(this.__button, 'button'),
  10457. this.domElement.appendChild(this.__button)
  10458. }
  10459. return (
  10460. (n.superclass = e),
  10461. i.extend(n.prototype, e.prototype, {
  10462. fire: function () {
  10463. this.__onChange && this.__onChange.call(this), this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), this.getValue().call(this.object)
  10464. }
  10465. }),
  10466. n
  10467. )
  10468. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  10469. (n.controllers.BooleanController = (function (e, t, i) {
  10470. var n = function (e, i) {
  10471. function r() {
  10472. o.setValue(!o.__prev)
  10473. }
  10474. n.superclass.call(this, e, i)
  10475. var o = this
  10476. ;(this.__prev = this.getValue()),
  10477. (this.__checkbox = document.createElement('input')),
  10478. this.__checkbox.setAttribute('type', 'checkbox'),
  10479. t.bind(this.__checkbox, 'change', r, !1),
  10480. this.domElement.appendChild(this.__checkbox),
  10481. this.updateDisplay()
  10482. }
  10483. return (
  10484. (n.superclass = e),
  10485. i.extend(n.prototype, e.prototype, {
  10486. setValue: function (e) {
  10487. var t = n.superclass.prototype.setValue.call(this, e)
  10488. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()), (this.__prev = this.getValue()), t
  10489. },
  10490. updateDisplay: function () {
  10491. return (
  10492. this.getValue() === !0 ? (this.__checkbox.setAttribute('checked', 'checked'), (this.__checkbox.checked = !0)) : (this.__checkbox.checked = !1),
  10493. n.superclass.prototype.updateDisplay.call(this)
  10494. )
  10495. }
  10496. }),
  10497. n
  10498. )
  10499. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  10500. (n.color.toString = (function (e) {
  10501. return function (t) {
  10502. if (1 == t.a || e.isUndefined(t.a)) {
  10503. for (var i = t.hex.toString(16); i.length < 6; ) i = '0' + i
  10504. return '#' + i
  10505. }
  10506. return 'rgba(' + Math.round(t.r) + ',' + Math.round(t.g) + ',' + Math.round(t.b) + ',' + t.a + ')'
  10507. }
  10508. })(n.utils.common)),
  10509. (n.color.interpret = (function (e, t) {
  10510. var i,
  10511. n,
  10512. r = function () {
  10513. n = !1
  10514. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0]
  10515. return (
  10516. t.each(o, function (r) {
  10517. if (r.litmus(e))
  10518. return (
  10519. t.each(r.conversions, function (r, o) {
  10520. if (((i = r.read(e)), n === !1 && i !== !1)) return (n = i), (i.conversionName = o), (i.conversion = r), t.BREAK
  10521. }),
  10522. t.BREAK
  10523. )
  10524. }),
  10525. n
  10526. )
  10527. },
  10528. o = [
  10529. {
  10530. litmus: t.isString,
  10531. conversions: {
  10532. THREE_CHAR_HEX: {
  10533. read: function (e) {
  10534. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i)
  10535. return (
  10536. null !== t && {
  10537. space: 'HEX',
  10538. hex: parseInt('0x' + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10539. }
  10540. )
  10541. },
  10542. write: e
  10543. },
  10544. SIX_CHAR_HEX: {
  10545. read: function (e) {
  10546. var t = e.match(/^#([A-F0-9]{6})$/i)
  10547. return (
  10548. null !== t && {
  10549. space: 'HEX',
  10550. hex: parseInt('0x' + t[1].toString())
  10551. }
  10552. )
  10553. },
  10554. write: e
  10555. },
  10556. CSS_RGB: {
  10557. read: function (e) {
  10558. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/)
  10559. return (
  10560. null !== t && {
  10561. space: 'RGB',
  10562. r: parseFloat(t[1]),
  10563. g: parseFloat(t[2]),
  10564. b: parseFloat(t[3])
  10565. }
  10566. )
  10567. },
  10568. write: e
  10569. },
  10570. CSS_RGBA: {
  10571. read: function (e) {
  10572. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/)
  10573. return (
  10574. null !== t && {
  10575. space: 'RGB',
  10576. r: parseFloat(t[1]),
  10577. g: parseFloat(t[2]),
  10578. b: parseFloat(t[3]),
  10579. a: parseFloat(t[4])
  10580. }
  10581. )
  10582. },
  10583. write: e
  10584. }
  10585. }
  10586. },
  10587. {
  10588. litmus: t.isNumber,
  10589. conversions: {
  10590. HEX: {
  10591. read: function (e) {
  10592. return {
  10593. space: 'HEX',
  10594. hex: e,
  10595. conversionName: 'HEX'
  10596. }
  10597. },
  10598. write: function (e) {
  10599. return e.hex
  10600. }
  10601. }
  10602. }
  10603. },
  10604. {
  10605. litmus: t.isArray,
  10606. conversions: {
  10607. RGB_ARRAY: {
  10608. read: function (e) {
  10609. return (
  10610. 3 == e.length && {
  10611. space: 'RGB',
  10612. r: e[0],
  10613. g: e[1],
  10614. b: e[2]
  10615. }
  10616. )
  10617. },
  10618. write: function (e) {
  10619. return [e.r, e.g, e.b]
  10620. }
  10621. },
  10622. RGBA_ARRAY: {
  10623. read: function (e) {
  10624. return (
  10625. 4 == e.length && {
  10626. space: 'RGB',
  10627. r: e[0],
  10628. g: e[1],
  10629. b: e[2],
  10630. a: e[3]
  10631. }
  10632. )
  10633. },
  10634. write: function (e) {
  10635. return [e.r, e.g, e.b, e.a]
  10636. }
  10637. }
  10638. }
  10639. },
  10640. {
  10641. litmus: t.isObject,
  10642. conversions: {
  10643. RGBA_OBJ: {
  10644. read: function (e) {
  10645. return (
  10646. !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10647. space: 'RGB',
  10648. r: e.r,
  10649. g: e.g,
  10650. b: e.b,
  10651. a: e.a
  10652. }
  10653. )
  10654. },
  10655. write: function (e) {
  10656. return {
  10657. r: e.r,
  10658. g: e.g,
  10659. b: e.b,
  10660. a: e.a
  10661. }
  10662. }
  10663. },
  10664. RGB_OBJ: {
  10665. read: function (e) {
  10666. return (
  10667. !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10668. space: 'RGB',
  10669. r: e.r,
  10670. g: e.g,
  10671. b: e.b
  10672. }
  10673. )
  10674. },
  10675. write: function (e) {
  10676. return {
  10677. r: e.r,
  10678. g: e.g,
  10679. b: e.b
  10680. }
  10681. }
  10682. },
  10683. HSVA_OBJ: {
  10684. read: function (e) {
  10685. return (
  10686. !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10687. space: 'HSV',
  10688. h: e.h,
  10689. s: e.s,
  10690. v: e.v,
  10691. a: e.a
  10692. }
  10693. )
  10694. },
  10695. write: function (e) {
  10696. return {
  10697. h: e.h,
  10698. s: e.s,
  10699. v: e.v,
  10700. a: e.a
  10701. }
  10702. }
  10703. },
  10704. HSV_OBJ: {
  10705. read: function (e) {
  10706. return (
  10707. !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10708. space: 'HSV',
  10709. h: e.h,
  10710. s: e.s,
  10711. v: e.v
  10712. }
  10713. )
  10714. },
  10715. write: function (e) {
  10716. return {
  10717. h: e.h,
  10718. s: e.s,
  10719. v: e.v
  10720. }
  10721. }
  10722. }
  10723. }
  10724. }
  10725. ]
  10726. return r
  10727. })(n.color.toString, n.utils.common)),
  10728. (n.GUI = n.gui.GUI =
  10729. (function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10730. function g(e, t, i, o) {
  10731. if (void 0 === t[i]) throw new Error('Object ' + t + ' has no property "' + i + '"')
  10732. var a
  10733. if (o.color) a = new h(t, i)
  10734. else {
  10735. var s = [t, i].concat(o.factoryArgs)
  10736. a = n.apply(e, s)
  10737. }
  10738. o.before instanceof r && (o.before = o.before.__li), A(e, a), p.addClass(a.domElement, 'c')
  10739. var l = document.createElement('span')
  10740. p.addClass(l, 'property-name'), (l.innerHTML = a.property)
  10741. var c = document.createElement('div')
  10742. c.appendChild(l), c.appendChild(a.domElement)
  10743. var u = m(e, c, o.before)
  10744. return p.addClass(u, V.CLASS_CONTROLLER_ROW), p.addClass(u, typeof a.getValue()), v(e, u, a), e.__controllers.push(a), a
  10745. }
  10746. function m(e, t, i) {
  10747. var n = document.createElement('li')
  10748. return t && n.appendChild(t), i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n), e.onResize(), n
  10749. }
  10750. function v(e, t, i) {
  10751. if (
  10752. ((i.__li = t),
  10753. (i.__gui = e),
  10754. f.extend(i, {
  10755. options: function (t) {
  10756. return arguments.length > 1
  10757. ? (i.remove(),
  10758. g(e, i.object, i.property, {
  10759. before: i.__li.nextElementSibling,
  10760. factoryArgs: [f.toArray(arguments)]
  10761. }))
  10762. : f.isArray(t) || f.isObject(t)
  10763. ? (i.remove(),
  10764. g(e, i.object, i.property, {
  10765. before: i.__li.nextElementSibling,
  10766. factoryArgs: [t]
  10767. }))
  10768. : void 0
  10769. },
  10770. name: function (e) {
  10771. return (i.__li.firstElementChild.firstElementChild.innerHTML = e), i
  10772. },
  10773. listen: function () {
  10774. return i.__gui.listen(i), i
  10775. },
  10776. remove: function () {
  10777. return i.__gui.remove(i), i
  10778. }
  10779. }),
  10780. i instanceof l)
  10781. ) {
  10782. var n = new s(i.object, i.property, {
  10783. min: i.__min,
  10784. max: i.__max,
  10785. step: i.__step
  10786. })
  10787. f.each(['updateDisplay', 'onChange', 'onFinishChange'], function (e) {
  10788. var t = i[e],
  10789. r = n[e]
  10790. i[e] = n[e] = function () {
  10791. var e = Array.prototype.slice.call(arguments)
  10792. return t.apply(i, e), r.apply(n, e)
  10793. }
  10794. }),
  10795. p.addClass(t, 'has-slider'),
  10796. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10797. } else if (i instanceof s) {
  10798. var r = function (t) {
  10799. return f.isNumber(i.__min) && f.isNumber(i.__max)
  10800. ? (i.remove(),
  10801. g(e, i.object, i.property, {
  10802. before: i.__li.nextElementSibling,
  10803. factoryArgs: [i.__min, i.__max, i.__step]
  10804. }))
  10805. : t
  10806. }
  10807. ;(i.min = f.compose(r, i.min)), (i.max = f.compose(r, i.max))
  10808. } else
  10809. i instanceof o
  10810. ? (p.bind(t, 'click', function () {
  10811. p.fakeEvent(i.__checkbox, 'click')
  10812. }),
  10813. p.bind(i.__checkbox, 'click', function (e) {
  10814. e.stopPropagation()
  10815. }))
  10816. : i instanceof a
  10817. ? (p.bind(t, 'click', function () {
  10818. p.fakeEvent(i.__button, 'click')
  10819. }),
  10820. p.bind(t, 'mouseover', function () {
  10821. p.addClass(i.__button, 'hover')
  10822. }),
  10823. p.bind(t, 'mouseout', function () {
  10824. p.removeClass(i.__button, 'hover')
  10825. }))
  10826. : i instanceof h &&
  10827. (p.addClass(t, 'color'),
  10828. (i.updateDisplay = f.compose(function (e) {
  10829. return (t.style.borderLeftColor = i.__color.toString()), e
  10830. }, i.updateDisplay)),
  10831. i.updateDisplay())
  10832. i.setValue = f.compose(function (t) {
  10833. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0), t
  10834. }, i.setValue)
  10835. }
  10836. function A(e, t) {
  10837. var i = e.getRoot(),
  10838. n = i.__rememberedObjects.indexOf(t.object)
  10839. if (n != -1) {
  10840. var r = i.__rememberedObjectIndecesToControllers[n]
  10841. if ((void 0 === r && ((r = {}), (i.__rememberedObjectIndecesToControllers[n] = r)), (r[t.property] = t), i.load && i.load.remembered)) {
  10842. var o,
  10843. a = i.load.remembered
  10844. if (a[e.preset]) o = a[e.preset]
  10845. else {
  10846. if (!a[L]) return
  10847. o = a[L]
  10848. }
  10849. if (o[n] && void 0 !== o[n][t.property]) {
  10850. var s = o[n][t.property]
  10851. ;(t.initialValue = s), t.setValue(s)
  10852. }
  10853. }
  10854. }
  10855. }
  10856. function y(e, t) {
  10857. return document.location.href + '.' + t
  10858. }
  10859. function C(e) {
  10860. var t = (e.__save_row = document.createElement('li'))
  10861. p.addClass(e.domElement, 'has-save'), e.__ul.insertBefore(t, e.__ul.firstChild), p.addClass(t, 'save-row')
  10862. var i = document.createElement('span')
  10863. ;(i.innerHTML = '&nbsp;'), p.addClass(i, 'button gears')
  10864. var n = document.createElement('span')
  10865. ;(n.innerHTML = 'Save'), p.addClass(n, 'button'), p.addClass(n, 'save')
  10866. var r = document.createElement('span')
  10867. ;(r.innerHTML = 'New'), p.addClass(r, 'button'), p.addClass(r, 'save-as')
  10868. var o = document.createElement('span')
  10869. ;(o.innerHTML = 'Revert'), p.addClass(o, 'button'), p.addClass(o, 'revert')
  10870. var a = (e.__preset_select = document.createElement('select'))
  10871. if (
  10872. (e.load && e.load.remembered
  10873. ? f.each(e.load.remembered, function (t, i) {
  10874. w(e, i, i == e.preset)
  10875. })
  10876. : w(e, L, !1),
  10877. p.bind(a, 'change', function () {
  10878. for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].innerHTML = e.__preset_select[t].value
  10879. e.preset = this.value
  10880. }),
  10881. t.appendChild(a),
  10882. t.appendChild(i),
  10883. t.appendChild(n),
  10884. t.appendChild(r),
  10885. t.appendChild(o),
  10886. D)
  10887. ) {
  10888. var s = document.getElementById('dg-save-locally'),
  10889. l = document.getElementById('dg-local-explain')
  10890. s.style.display = 'block'
  10891. var c = document.getElementById('dg-local-storage')
  10892. 'true' === localStorage.getItem(y(e, 'isLocal')) && c.setAttribute('checked', 'checked')
  10893. var h = function () {
  10894. l.style.display = e.useLocalStorage ? 'block' : 'none'
  10895. }
  10896. h(),
  10897. p.bind(c, 'change', function () {
  10898. ;(e.useLocalStorage = !e.useLocalStorage), h()
  10899. })
  10900. }
  10901. var u = document.getElementById('dg-new-constructor')
  10902. p.bind(u, 'keydown', function (e) {
  10903. !e.metaKey || (67 !== e.which && 67 != e.keyCode) || S.hide()
  10904. }),
  10905. p.bind(i, 'click', function () {
  10906. ;(u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2)), S.show(), u.focus(), u.select()
  10907. }),
  10908. p.bind(n, 'click', function () {
  10909. e.save()
  10910. }),
  10911. p.bind(r, 'click', function () {
  10912. var t = prompt('Enter a new preset name.')
  10913. t && e.saveAs(t)
  10914. }),
  10915. p.bind(o, 'click', function () {
  10916. e.revert()
  10917. })
  10918. }
  10919. function I(e) {
  10920. function t(t) {
  10921. return t.preventDefault(), (r = t.clientX), p.addClass(e.__closeButton, V.CLASS_DRAG), p.bind(window, 'mousemove', i), p.bind(window, 'mouseup', n), !1
  10922. }
  10923. function i(t) {
  10924. return t.preventDefault(), (e.width += r - t.clientX), e.onResize(), (r = t.clientX), !1
  10925. }
  10926. function n() {
  10927. p.removeClass(e.__closeButton, V.CLASS_DRAG), p.unbind(window, 'mousemove', i), p.unbind(window, 'mouseup', n)
  10928. }
  10929. ;(e.__resize_handle = document.createElement('div')),
  10930. f.extend(e.__resize_handle.style, {
  10931. width: '6px',
  10932. marginLeft: '-3px',
  10933. height: '200px',
  10934. cursor: 'ew-resize',
  10935. position: 'absolute'
  10936. })
  10937. var r
  10938. p.bind(e.__resize_handle, 'mousedown', t), p.bind(e.__closeButton, 'mousedown', t), e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10939. }
  10940. function E(e, t) {
  10941. ;(e.domElement.style.width = t + 'px'), e.__save_row && e.autoPlace && (e.__save_row.style.width = t + 'px'), e.__closeButton && (e.__closeButton.style.width = t + 'px')
  10942. }
  10943. function b(e, t) {
  10944. var i = {}
  10945. return (
  10946. f.each(e.__rememberedObjects, function (n, r) {
  10947. var o = {},
  10948. a = e.__rememberedObjectIndecesToControllers[r]
  10949. f.each(a, function (e, i) {
  10950. o[i] = t ? e.initialValue : e.getValue()
  10951. }),
  10952. (i[r] = o)
  10953. }),
  10954. i
  10955. )
  10956. }
  10957. function w(e, t, i) {
  10958. var n = document.createElement('option')
  10959. ;(n.innerHTML = t), (n.value = t), e.__preset_select.appendChild(n), i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10960. }
  10961. function _(e) {
  10962. for (var t = 0; t < e.__preset_select.length; t++) e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10963. }
  10964. function T(e, t) {
  10965. var i = e.__preset_select[e.__preset_select.selectedIndex]
  10966. t ? (i.innerHTML = i.value + '*') : (i.innerHTML = i.value)
  10967. }
  10968. function x(e) {
  10969. 0 != e.length &&
  10970. u(function () {
  10971. x(e)
  10972. }),
  10973. f.each(e, function (e) {
  10974. e.updateDisplay()
  10975. })
  10976. }
  10977. e.inject(i)
  10978. var S,
  10979. M,
  10980. R = 'dg',
  10981. P = 72,
  10982. O = 20,
  10983. L = 'Default',
  10984. D = (function () {
  10985. try {
  10986. return 'localStorage' in window && null !== window.localStorage
  10987. } catch (e) {
  10988. return !1
  10989. }
  10990. })(),
  10991. N = !0,
  10992. B = !1,
  10993. F = [],
  10994. V = function (e) {
  10995. function t() {
  10996. var e = i.getRoot()
  10997. ;(e.width += 1),
  10998. f.defer(function () {
  10999. e.width -= 1
  11000. })
  11001. }
  11002. var i = this
  11003. ;(this.domElement = document.createElement('div')),
  11004. (this.__ul = document.createElement('ul')),
  11005. this.domElement.appendChild(this.__ul),
  11006. p.addClass(this.domElement, R),
  11007. (this.__folders = {}),
  11008. (this.__controllers = []),
  11009. (this.__rememberedObjects = []),
  11010. (this.__rememberedObjectIndecesToControllers = []),
  11011. (this.__listening = []),
  11012. (e = e || {}),
  11013. (e = f.defaults(e, {
  11014. autoPlace: !0,
  11015. width: V.DEFAULT_WIDTH
  11016. })),
  11017. (e = f.defaults(e, {
  11018. resizable: e.autoPlace,
  11019. hideable: e.autoPlace
  11020. })),
  11021. f.isUndefined(e.load)
  11022. ? (e.load = {
  11023. preset: L
  11024. })
  11025. : e.preset && (e.load.preset = e.preset),
  11026. f.isUndefined(e.parent) && e.hideable && F.push(this),
  11027. (e.resizable = f.isUndefined(e.parent) && e.resizable),
  11028. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0)
  11029. var n,
  11030. r = D && 'true' === localStorage.getItem(y(this, 'isLocal'))
  11031. if (
  11032. (Object.defineProperties(this, {
  11033. parent: {
  11034. get: function () {
  11035. return e.parent
  11036. }
  11037. },
  11038. scrollable: {
  11039. get: function () {
  11040. return e.scrollable
  11041. }
  11042. },
  11043. autoPlace: {
  11044. get: function () {
  11045. return e.autoPlace
  11046. }
  11047. },
  11048. preset: {
  11049. get: function () {
  11050. return i.parent ? i.getRoot().preset : e.load.preset
  11051. },
  11052. set: function (t) {
  11053. i.parent ? (i.getRoot().preset = t) : (e.load.preset = t), _(this), i.revert()
  11054. }
  11055. },
  11056. width: {
  11057. get: function () {
  11058. return e.width
  11059. },
  11060. set: function (t) {
  11061. ;(e.width = t), E(i, t)
  11062. }
  11063. },
  11064. name: {
  11065. get: function () {
  11066. return e.name
  11067. },
  11068. set: function (t) {
  11069. ;(e.name = t), a && (a.innerHTML = e.name)
  11070. }
  11071. },
  11072. closed: {
  11073. get: function () {
  11074. return e.closed
  11075. },
  11076. set: function (t) {
  11077. ;(e.closed = t),
  11078. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  11079. this.onResize(),
  11080. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  11081. }
  11082. },
  11083. load: {
  11084. get: function () {
  11085. return e.load
  11086. }
  11087. },
  11088. useLocalStorage: {
  11089. get: function () {
  11090. return r
  11091. },
  11092. set: function (e) {
  11093. D && ((r = e), e ? p.bind(window, 'unload', n) : p.unbind(window, 'unload', n), localStorage.setItem(y(i, 'isLocal'), e))
  11094. }
  11095. }
  11096. }),
  11097. f.isUndefined(e.parent))
  11098. ) {
  11099. if (((e.closed = !1), p.addClass(this.domElement, V.CLASS_MAIN), p.makeSelectable(this.domElement, !1), D && r)) {
  11100. i.useLocalStorage = !0
  11101. var o = localStorage.getItem(y(this, 'gui'))
  11102. o && (e.load = JSON.parse(o))
  11103. }
  11104. ;(this.__closeButton = document.createElement('div')),
  11105. (this.__closeButton.innerHTML = V.TEXT_CLOSED),
  11106. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  11107. this.domElement.appendChild(this.__closeButton),
  11108. p.bind(this.__closeButton, 'click', function () {
  11109. i.closed = !i.closed
  11110. })
  11111. } else {
  11112. void 0 === e.closed && (e.closed = !0)
  11113. var a = document.createTextNode(e.name)
  11114. p.addClass(a, 'controller-name')
  11115. var s = m(i, a),
  11116. l = function (e) {
  11117. return e.preventDefault(), (i.closed = !i.closed), !1
  11118. }
  11119. p.addClass(this.__ul, V.CLASS_CLOSED), p.addClass(s, 'title'), p.bind(s, 'click', l), e.closed || (this.closed = !1)
  11120. }
  11121. e.autoPlace &&
  11122. (f.isUndefined(e.parent) &&
  11123. (N && ((M = document.createElement('div')), p.addClass(M, R), p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER), document.body.appendChild(M), (N = !1)),
  11124. M.appendChild(this.domElement),
  11125. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  11126. this.parent || E(i, e.width)),
  11127. p.bind(window, 'resize', function () {
  11128. i.onResize()
  11129. }),
  11130. p.bind(this.__ul, 'webkitTransitionEnd', function () {
  11131. i.onResize()
  11132. }),
  11133. p.bind(this.__ul, 'transitionend', function () {
  11134. i.onResize()
  11135. }),
  11136. p.bind(this.__ul, 'oTransitionEnd', function () {
  11137. i.onResize()
  11138. }),
  11139. this.onResize(),
  11140. e.resizable && I(this),
  11141. (n = function () {
  11142. D && 'true' === localStorage.getItem(y(i, 'isLocal')) && localStorage.setItem(y(i, 'gui'), JSON.stringify(i.getSaveObject()))
  11143. }),
  11144. (this.saveToLocalStorageIfPossible = n)
  11145. i.getRoot()
  11146. e.parent || t()
  11147. }
  11148. return (
  11149. (V.toggleHide = function () {
  11150. ;(B = !B),
  11151. f.each(F, function (e) {
  11152. ;(e.domElement.style.zIndex = B ? -999 : 999), (e.domElement.style.opacity = B ? 0 : 1)
  11153. })
  11154. }),
  11155. (V.CLASS_AUTO_PLACE = 'a'),
  11156. (V.CLASS_AUTO_PLACE_CONTAINER = 'ac'),
  11157. (V.CLASS_MAIN = 'main'),
  11158. (V.CLASS_CONTROLLER_ROW = 'cr'),
  11159. (V.CLASS_TOO_TALL = 'taller-than-window'),
  11160. (V.CLASS_CLOSED = 'closed'),
  11161. (V.CLASS_CLOSE_BUTTON = 'close-button'),
  11162. (V.CLASS_DRAG = 'drag'),
  11163. (V.DEFAULT_WIDTH = 245),
  11164. (V.TEXT_CLOSED = 'Close Controls'),
  11165. (V.TEXT_OPEN = 'Open Controls'),
  11166. p.bind(
  11167. window,
  11168. 'keydown',
  11169. function (e) {
  11170. 'text' === document.activeElement.type || (e.which !== P && e.keyCode != P) || V.toggleHide()
  11171. },
  11172. !1
  11173. ),
  11174. f.extend(V.prototype, {
  11175. add: function (e, t) {
  11176. return g(this, e, t, {
  11177. factoryArgs: Array.prototype.slice.call(arguments, 2)
  11178. })
  11179. },
  11180. addColor: function (e, t) {
  11181. return g(this, e, t, {
  11182. color: !0
  11183. })
  11184. },
  11185. remove: function (e) {
  11186. this.__ul.removeChild(e.__li), this.__controllers.slice(this.__controllers.indexOf(e), 1)
  11187. var t = this
  11188. f.defer(function () {
  11189. t.onResize()
  11190. })
  11191. },
  11192. destroy: function () {
  11193. this.autoPlace && M.removeChild(this.domElement)
  11194. },
  11195. addFolder: function (e) {
  11196. if (void 0 !== this.__folders[e]) throw new Error('You already have a folder in this GUI by the name "' + e + '"')
  11197. var t = {
  11198. name: e,
  11199. parent: this
  11200. }
  11201. ;(t.autoPlace = this.autoPlace), this.load && this.load.folders && this.load.folders[e] && ((t.closed = this.load.folders[e].closed), (t.load = this.load.folders[e]))
  11202. var i = new V(t)
  11203. this.__folders[e] = i
  11204. var n = m(this, i.domElement)
  11205. return p.addClass(n, 'folder'), i
  11206. },
  11207. open: function () {
  11208. this.closed = !1
  11209. },
  11210. close: function () {
  11211. this.closed = !0
  11212. },
  11213. onResize: function () {
  11214. var e = this.getRoot()
  11215. if (e.scrollable) {
  11216. var t = p.getOffset(e.__ul).top,
  11217. i = 0
  11218. f.each(e.__ul.childNodes, function (t) {
  11219. ;(e.autoPlace && t === e.__save_row) || (i += p.getHeight(t))
  11220. }),
  11221. $('#player').height() - t - O < i
  11222. ? (p.addClass(e.domElement, V.CLASS_TOO_TALL), (e.__ul.style.height = $('#player').height() - t - O + 'px'))
  11223. : (p.removeClass(e.domElement, V.CLASS_TOO_TALL), (e.__ul.style.height = 'auto'))
  11224. }
  11225. e.__resize_handle &&
  11226. f.defer(function () {
  11227. e.__resize_handle.style.height = e.__ul.offsetHeight + 'px'
  11228. }),
  11229. e.__closeButton && (e.__closeButton.style.width = e.width + 'px')
  11230. },
  11231. remember: function () {
  11232. if ((f.isUndefined(S) && ((S = new d()), (S.domElement.innerHTML = t)), this.parent)) throw new Error('You can only call remember on a top level GUI.')
  11233. var e = this
  11234. f.each(Array.prototype.slice.call(arguments), function (t) {
  11235. 0 == e.__rememberedObjects.length && C(e), e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  11236. }),
  11237. this.autoPlace && E(this, this.width)
  11238. },
  11239. getRoot: function () {
  11240. for (var e = this; e.parent; ) e = e.parent
  11241. return e
  11242. },
  11243. getSaveObject: function () {
  11244. var e = this.load
  11245. return (
  11246. (e.closed = this.closed),
  11247. this.__rememberedObjects.length > 0 && ((e.preset = this.preset), e.remembered || (e.remembered = {}), (e.remembered[this.preset] = b(this))),
  11248. (e.folders = {}),
  11249. f.each(this.__folders, function (t, i) {
  11250. e.folders[i] = t.getSaveObject()
  11251. }),
  11252. e
  11253. )
  11254. },
  11255. save: function () {
  11256. this.load.remembered || (this.load.remembered = {}), (this.load.remembered[this.preset] = b(this)), T(this, !1), this.saveToLocalStorageIfPossible()
  11257. },
  11258. saveAs: function (e) {
  11259. this.load.remembered || ((this.load.remembered = {}), (this.load.remembered[L] = b(this, !0))),
  11260. (this.load.remembered[e] = b(this)),
  11261. (this.preset = e),
  11262. w(this, e, !0),
  11263. this.saveToLocalStorageIfPossible()
  11264. },
  11265. revert: function (e) {
  11266. f.each(
  11267. this.__controllers,
  11268. function (t) {
  11269. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  11270. },
  11271. this
  11272. ),
  11273. f.each(this.__folders, function (e) {
  11274. e.revert(e)
  11275. }),
  11276. e || T(this.getRoot(), !1)
  11277. },
  11278. listen: function (e) {
  11279. var t = 0 == this.__listening.length
  11280. this.__listening.push(e), t && x(this.__listening)
  11281. }
  11282. }),
  11283. V
  11284. )
  11285. })(
  11286. n.utils.css,
  11287. '<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>',
  11288. ".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",
  11289. (n.controllers.factory = (function (e, t, i, n, r, o, a) {
  11290. return function (s, l) {
  11291. var c = s[l]
  11292. return a.isArray(arguments[2]) || a.isObject(arguments[2])
  11293. ? new e(s, l, arguments[2])
  11294. : a.isNumber(c)
  11295. ? a.isNumber(arguments[2]) && a.isNumber(arguments[3])
  11296. ? new i(s, l, arguments[2], arguments[3])
  11297. : new t(s, l, {
  11298. min: arguments[2],
  11299. max: arguments[3]
  11300. })
  11301. : a.isString(c)
  11302. ? new n(s, l)
  11303. : a.isFunction(c)
  11304. ? new r(s, l, '')
  11305. : a.isBoolean(c)
  11306. ? new o(s, l)
  11307. : void 0
  11308. }
  11309. })(
  11310. n.controllers.OptionController,
  11311. n.controllers.NumberControllerBox,
  11312. n.controllers.NumberControllerSlider,
  11313. (n.controllers.StringController = (function (e, t, i) {
  11314. var n = function (e, i) {
  11315. function r() {
  11316. a.setValue(a.__input.value)
  11317. }
  11318. function o() {
  11319. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  11320. }
  11321. n.superclass.call(this, e, i)
  11322. var a = this
  11323. ;(this.__input = document.createElement('input')),
  11324. this.__input.setAttribute('type', 'text'),
  11325. t.bind(this.__input, 'keyup', r),
  11326. t.bind(this.__input, 'change', r),
  11327. t.bind(this.__input, 'blur', o),
  11328. t.bind(this.__input, 'keydown', function (e) {
  11329. 13 === e.keyCode && this.blur()
  11330. }),
  11331. this.updateDisplay(),
  11332. this.domElement.appendChild(this.__input)
  11333. }
  11334. return (
  11335. (n.superclass = e),
  11336. i.extend(n.prototype, e.prototype, {
  11337. updateDisplay: function () {
  11338. return t.isActive(this.__input) || (this.__input.value = this.getValue()), n.superclass.prototype.updateDisplay.call(this)
  11339. }
  11340. }),
  11341. n
  11342. )
  11343. })(n.controllers.Controller, n.dom.dom, n.utils.common)),
  11344. n.controllers.FunctionController,
  11345. n.controllers.BooleanController,
  11346. n.utils.common
  11347. )),
  11348. n.controllers.Controller,
  11349. n.controllers.BooleanController,
  11350. n.controllers.FunctionController,
  11351. n.controllers.NumberControllerBox,
  11352. n.controllers.NumberControllerSlider,
  11353. n.controllers.OptionController,
  11354. (n.controllers.ColorController = (function (e, t, i, n, r) {
  11355. function o(e, t, i, n) {
  11356. ;(e.style.background = ''),
  11357. r.each(l, function (r) {
  11358. e.style.cssText += 'background: ' + r + 'linear-gradient(' + t + ', ' + i + ' 0%, ' + n + ' 100%); '
  11359. })
  11360. }
  11361. function a(e) {
  11362. ;(e.style.background = ''),
  11363. (e.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'),
  11364. (e.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11365. (e.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11366. (e.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'),
  11367. (e.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);')
  11368. }
  11369. var s = function (e, l) {
  11370. function c(e) {
  11371. p(e), t.bind(window, 'mousemove', p), t.bind(window, 'mouseup', h)
  11372. }
  11373. function h() {
  11374. t.unbind(window, 'mousemove', p), t.unbind(window, 'mouseup', h)
  11375. }
  11376. function u() {
  11377. var e = n(this.value)
  11378. e !== !1 ? ((g.__color.__state = e), g.setValue(g.__color.toOriginal())) : (this.value = g.__color.toString())
  11379. }
  11380. function d() {
  11381. t.unbind(window, 'mousemove', f), t.unbind(window, 'mouseup', d)
  11382. }
  11383. function p(e) {
  11384. e.preventDefault()
  11385. var i = t.getWidth(g.__saturation_field),
  11386. n = t.getOffset(g.__saturation_field),
  11387. r = (e.clientX - n.left + document.body.scrollLeft) / i,
  11388. o = 1 - (e.clientY - n.top + document.body.scrollTop) / i
  11389. return o > 1 ? (o = 1) : o < 0 && (o = 0), r > 1 ? (r = 1) : r < 0 && (r = 0), (g.__color.v = o), (g.__color.s = r), g.setValue(g.__color.toOriginal()), !1
  11390. }
  11391. function f(e) {
  11392. e.preventDefault()
  11393. var i = t.getHeight(g.__hue_field),
  11394. n = t.getOffset(g.__hue_field),
  11395. r = 1 - (e.clientY - n.top + document.body.scrollTop) / i
  11396. return r > 1 ? (r = 1) : r < 0 && (r = 0), (g.__color.h = 360 * r), g.setValue(g.__color.toOriginal()), !1
  11397. }
  11398. s.superclass.call(this, e, l), (this.__color = new i(this.getValue())), (this.__temp = new i(0))
  11399. var g = this
  11400. ;(this.domElement = document.createElement('div')),
  11401. t.makeSelectable(this.domElement, !1),
  11402. (this.__selector = document.createElement('div')),
  11403. (this.__selector.className = 'selector'),
  11404. (this.__saturation_field = document.createElement('div')),
  11405. (this.__saturation_field.className = 'saturation-field'),
  11406. (this.__field_knob = document.createElement('div')),
  11407. (this.__field_knob.className = 'field-knob'),
  11408. (this.__field_knob_border = '2px solid '),
  11409. (this.__hue_knob = document.createElement('div')),
  11410. (this.__hue_knob.className = 'hue-knob'),
  11411. (this.__hue_field = document.createElement('div')),
  11412. (this.__hue_field.className = 'hue-field'),
  11413. (this.__input = document.createElement('input')),
  11414. (this.__input.type = 'text'),
  11415. (this.__input_textShadow = '0 1px 1px '),
  11416. t.bind(this.__input, 'keydown', function (e) {
  11417. 13 === e.keyCode && u.call(this)
  11418. }),
  11419. t.bind(this.__input, 'blur', u),
  11420. t.bind(this.__selector, 'mousedown', function (e) {
  11421. t.addClass(this, 'drag').bind(window, 'mouseup', function (e) {
  11422. t.removeClass(g.__selector, 'drag')
  11423. })
  11424. })
  11425. var m = document.createElement('div')
  11426. r.extend(this.__selector.style, {
  11427. width: '122px',
  11428. height: '102px',
  11429. padding: '3px',
  11430. backgroundColor: '#222',
  11431. boxShadow: '0px 1px 3px rgba(0,0,0,0.3)'
  11432. }),
  11433. r.extend(this.__field_knob.style, {
  11434. position: 'absolute',
  11435. width: '12px',
  11436. height: '12px',
  11437. border: this.__field_knob_border + (this.__color.v < 0.5 ? '#fff' : '#000'),
  11438. boxShadow: '0px 1px 3px rgba(0,0,0,0.5)',
  11439. borderRadius: '12px',
  11440. zIndex: 1
  11441. }),
  11442. r.extend(this.__hue_knob.style, {
  11443. position: 'absolute',
  11444. width: '15px',
  11445. height: '2px',
  11446. borderRight: '4px solid #fff',
  11447. zIndex: 1
  11448. }),
  11449. r.extend(this.__saturation_field.style, {
  11450. width: '100px',
  11451. height: '100px',
  11452. border: '1px solid #555',
  11453. marginRight: '3px',
  11454. display: 'inline-block',
  11455. cursor: 'pointer'
  11456. }),
  11457. r.extend(m.style, {
  11458. width: '100%',
  11459. height: '100%',
  11460. background: 'none'
  11461. }),
  11462. o(m, 'top', 'rgba(0,0,0,0)', '#000'),
  11463. r.extend(this.__hue_field.style, {
  11464. width: '15px',
  11465. height: '100px',
  11466. display: 'inline-block',
  11467. border: '1px solid #555',
  11468. cursor: 'ns-resize'
  11469. }),
  11470. a(this.__hue_field),
  11471. r.extend(this.__input.style, {
  11472. outline: 'none',
  11473. textAlign: 'center',
  11474. color: '#fff',
  11475. border: 0,
  11476. fontWeight: 'bold',
  11477. textShadow: this.__input_textShadow + 'rgba(0,0,0,0.7)'
  11478. }),
  11479. t.bind(this.__saturation_field, 'mousedown', c),
  11480. t.bind(this.__field_knob, 'mousedown', c),
  11481. t.bind(this.__hue_field, 'mousedown', function (e) {
  11482. f(e), t.bind(window, 'mousemove', f), t.bind(window, 'mouseup', d)
  11483. }),
  11484. this.__saturation_field.appendChild(m),
  11485. this.__selector.appendChild(this.__field_knob),
  11486. this.__selector.appendChild(this.__saturation_field),
  11487. this.__selector.appendChild(this.__hue_field),
  11488. this.__hue_field.appendChild(this.__hue_knob),
  11489. this.domElement.appendChild(this.__input),
  11490. this.domElement.appendChild(this.__selector),
  11491. this.updateDisplay()
  11492. }
  11493. ;(s.superclass = e),
  11494. r.extend(s.prototype, e.prototype, {
  11495. updateDisplay: function () {
  11496. var e = n(this.getValue())
  11497. if (e !== !1) {
  11498. var t = !1
  11499. r.each(
  11500. i.COMPONENTS,
  11501. function (i) {
  11502. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i]) return (t = !0), {}
  11503. },
  11504. this
  11505. ),
  11506. t && r.extend(this.__color.__state, e)
  11507. }
  11508. r.extend(this.__temp.__state, this.__color.__state), (this.__temp.a = 1)
  11509. var a = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0,
  11510. s = 255 - a
  11511. r.extend(this.__field_knob.style, {
  11512. marginLeft: 100 * this.__color.s - 7 + 'px',
  11513. marginTop: 100 * (1 - this.__color.v) - 7 + 'px',
  11514. backgroundColor: this.__temp.toString(),
  11515. border: this.__field_knob_border + 'rgb(' + a + ',' + a + ',' + a + ')'
  11516. }),
  11517. (this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + 'px'),
  11518. (this.__temp.s = 1),
  11519. (this.__temp.v = 1),
  11520. o(this.__saturation_field, 'left', '#fff', this.__temp.toString()),
  11521. r.extend(this.__input.style, {
  11522. backgroundColor: (this.__input.value = this.__color.toString()),
  11523. color: 'rgb(' + a + ',' + a + ',' + a + ')',
  11524. textShadow: this.__input_textShadow + 'rgba(' + s + ',' + s + ',' + s + ',.7)'
  11525. })
  11526. }
  11527. })
  11528. var l = ['-moz-', '-o-', '-webkit-', '-ms-', '']
  11529. return s
  11530. })(
  11531. n.controllers.Controller,
  11532. n.dom.dom,
  11533. (n.color.Color = (function (e, t, i, n) {
  11534. function r(e, t, i) {
  11535. Object.defineProperty(e, t, {
  11536. get: function () {
  11537. return 'RGB' === this.__state.space ? this.__state[t] : (a(this, t, i), this.__state[t])
  11538. },
  11539. set: function (e) {
  11540. 'RGB' !== this.__state.space && (a(this, t, i), (this.__state.space = 'RGB')), (this.__state[t] = e)
  11541. }
  11542. })
  11543. }
  11544. function o(e, t) {
  11545. Object.defineProperty(e, t, {
  11546. get: function () {
  11547. return 'HSV' === this.__state.space ? this.__state[t] : (s(this), this.__state[t])
  11548. },
  11549. set: function (e) {
  11550. 'HSV' !== this.__state.space && (s(this), (this.__state.space = 'HSV')), (this.__state[t] = e)
  11551. }
  11552. })
  11553. }
  11554. function a(e, i, r) {
  11555. if ('HEX' === e.__state.space) e.__state[i] = t.component_from_hex(e.__state.hex, r)
  11556. else {
  11557. if ('HSV' !== e.__state.space) throw 'Corrupted color state'
  11558. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11559. }
  11560. }
  11561. function s(e) {
  11562. var i = t.rgb_to_hsv(e.r, e.g, e.b)
  11563. n.extend(e.__state, {
  11564. s: i.s,
  11565. v: i.v
  11566. }),
  11567. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : (e.__state.h = i.h)
  11568. }
  11569. var l = function () {
  11570. if (((this.__state = e.apply(this, arguments)), this.__state === !1)) throw 'Failed to interpret color arguments'
  11571. this.__state.a = this.__state.a || 1
  11572. }
  11573. return (
  11574. (l.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']),
  11575. n.extend(l.prototype, {
  11576. toString: function () {
  11577. return i(this)
  11578. },
  11579. toOriginal: function () {
  11580. return this.__state.conversion.write(this)
  11581. }
  11582. }),
  11583. r(l.prototype, 'r', 2),
  11584. r(l.prototype, 'g', 1),
  11585. r(l.prototype, 'b', 0),
  11586. o(l.prototype, 'h'),
  11587. o(l.prototype, 's'),
  11588. o(l.prototype, 'v'),
  11589. Object.defineProperty(l.prototype, 'a', {
  11590. get: function () {
  11591. return this.__state.a
  11592. },
  11593. set: function (e) {
  11594. this.__state.a = e
  11595. }
  11596. }),
  11597. Object.defineProperty(l.prototype, 'hex', {
  11598. get: function () {
  11599. return 'HEX' !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)), this.__state.hex
  11600. },
  11601. set: function (e) {
  11602. ;(this.__state.space = 'HEX'), (this.__state.hex = e)
  11603. }
  11604. }),
  11605. l
  11606. )
  11607. })(
  11608. n.color.interpret,
  11609. (n.color.math = (function () {
  11610. var e
  11611. return {
  11612. hsv_to_rgb: function (e, t, i) {
  11613. var n = Math.floor(e / 60) % 6,
  11614. r = e / 60 - Math.floor(e / 60),
  11615. o = i * (1 - t),
  11616. a = i * (1 - r * t),
  11617. s = i * (1 - (1 - r) * t),
  11618. l = [
  11619. [i, s, o],
  11620. [a, i, o],
  11621. [o, i, s],
  11622. [o, a, i],
  11623. [s, o, i],
  11624. [i, o, a]
  11625. ][n]
  11626. return {
  11627. r: 255 * l[0],
  11628. g: 255 * l[1],
  11629. b: 255 * l[2]
  11630. }
  11631. },
  11632. rgb_to_hsv: function (e, t, i) {
  11633. var n,
  11634. r,
  11635. o = Math.min(e, t, i),
  11636. a = Math.max(e, t, i),
  11637. s = a - o
  11638. return 0 == a
  11639. ? {
  11640. h: NaN,
  11641. s: 0,
  11642. v: 0
  11643. }
  11644. : ((r = s / a),
  11645. (n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s),
  11646. (n /= 6),
  11647. n < 0 && (n += 1),
  11648. {
  11649. h: 360 * n,
  11650. s: r,
  11651. v: a / 255
  11652. })
  11653. },
  11654. rgb_to_hex: function (e, t, i) {
  11655. var n = this.hex_with_component(0, 2, e)
  11656. return (n = this.hex_with_component(n, 1, t)), (n = this.hex_with_component(n, 0, i))
  11657. },
  11658. component_from_hex: function (e, t) {
  11659. return (e >> (8 * t)) & 255
  11660. },
  11661. hex_with_component: function (t, i, n) {
  11662. return (n << (e = 8 * i)) | (t & ~(255 << e))
  11663. }
  11664. }
  11665. })()),
  11666. n.color.toString,
  11667. n.utils.common
  11668. )),
  11669. n.color.interpret,
  11670. n.utils.common
  11671. )),
  11672. (n.utils.requestAnimationFrame = (function () {
  11673. return (
  11674. window.requestAnimationFrame ||
  11675. window.webkitRequestAnimationFrame ||
  11676. window.mozRequestAnimationFrame ||
  11677. window.oRequestAnimationFrame ||
  11678. window.msRequestAnimationFrame ||
  11679. function (e, t) {
  11680. window.setTimeout(e, 1e3 / 60)
  11681. }
  11682. )
  11683. })()),
  11684. (n.dom.CenteredDiv = (function (e, t) {
  11685. var i = function () {
  11686. ;(this.backgroundElement = document.createElement('div')),
  11687. t.extend(this.backgroundElement.style, {
  11688. backgroundColor: 'rgba(0,0,0,0.8)',
  11689. top: 0,
  11690. left: 0,
  11691. display: 'none',
  11692. zIndex: '1000',
  11693. opacity: 0,
  11694. WebkitTransition: 'opacity 0.2s linear'
  11695. }),
  11696. e.makeFullscreen(this.backgroundElement),
  11697. (this.backgroundElement.style.position = 'fixed'),
  11698. (this.domElement = document.createElement('div')),
  11699. t.extend(this.domElement.style, {
  11700. position: 'fixed',
  11701. display: 'none',
  11702. zIndex: '1001',
  11703. opacity: 0,
  11704. WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear'
  11705. }),
  11706. document.body.appendChild(this.backgroundElement),
  11707. document.body.appendChild(this.domElement)
  11708. var i = this
  11709. e.bind(this.backgroundElement, 'click', function () {
  11710. i.hide()
  11711. })
  11712. }
  11713. return (
  11714. (i.prototype.show = function () {
  11715. var e = this
  11716. ;(this.backgroundElement.style.display = 'block'),
  11717. (this.domElement.style.display = 'block'),
  11718. (this.domElement.style.opacity = 0),
  11719. (this.domElement.style.webkitTransform = 'scale(1.1)'),
  11720. this.layout(),
  11721. t.defer(function () {
  11722. ;(e.backgroundElement.style.opacity = 1), (e.domElement.style.opacity = 1), (e.domElement.style.webkitTransform = 'scale(1)')
  11723. })
  11724. }),
  11725. (i.prototype.hide = function () {
  11726. var t = this,
  11727. i = function () {
  11728. ;(t.domElement.style.display = 'none'),
  11729. (t.backgroundElement.style.display = 'none'),
  11730. e.unbind(t.domElement, 'webkitTransitionEnd', i),
  11731. e.unbind(t.domElement, 'transitionend', i),
  11732. e.unbind(t.domElement, 'oTransitionEnd', i)
  11733. }
  11734. e.bind(this.domElement, 'webkitTransitionEnd', i),
  11735. e.bind(this.domElement, 'transitionend', i),
  11736. e.bind(this.domElement, 'oTransitionEnd', i),
  11737. (this.backgroundElement.style.opacity = 0),
  11738. (this.domElement.style.opacity = 0),
  11739. (this.domElement.style.webkitTransform = 'scale(1.1)')
  11740. }),
  11741. (i.prototype.layout = function () {
  11742. ;(this.domElement.style.left = $('#player').width() / 2 - e.getWidth(this.domElement) / 2 + 'px'),
  11743. (this.domElement.style.top = $('#player').height() / 2 - e.getHeight(this.domElement) / 2 + 'px')
  11744. }),
  11745. i
  11746. )
  11747. })(n.dom.dom, n.utils.common)),
  11748. n.dom.dom,
  11749. n.utils.common
  11750. ))
  11751. },
  11752. {}
  11753. ],
  11754. 94: [
  11755. function (e, t, i) {
  11756. ;(function (e) {
  11757. 'use strict'
  11758. function i(t) {
  11759. function i(e) {
  11760. for (
  11761. var t = [
  11762. 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,
  11763. 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99
  11764. ],
  11765. i = 0;
  11766. i < 64;
  11767. i++
  11768. ) {
  11769. var n = _((t[i] * e + 50) / 100)
  11770. n < 1 ? (n = 1) : n > 255 && (n = 255), (T[G[i]] = n)
  11771. }
  11772. for (
  11773. var r = [
  11774. 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,
  11775. 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99
  11776. ],
  11777. o = 0;
  11778. o < 64;
  11779. o++
  11780. ) {
  11781. var a = _((r[o] * e + 50) / 100)
  11782. a < 1 ? (a = 1) : a > 255 && (a = 255), (x[G[o]] = a)
  11783. }
  11784. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], l = 0, c = 0; c < 8; c++)
  11785. for (var h = 0; h < 8; h++) (S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8)), (M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8)), l++
  11786. }
  11787. function n(e, t) {
  11788. for (var i = 0, n = 0, r = new Array(), o = 1; o <= 16; o++) {
  11789. for (var a = 1; a <= e[o]; a++) (r[t[n]] = []), (r[t[n]][0] = i), (r[t[n]][1] = o), n++, i++
  11790. i *= 2
  11791. }
  11792. return r
  11793. }
  11794. function r() {
  11795. ;(C = n(z, W)), (I = n(X, Z)), (E = n(j, Y)), (b = n(q, K))
  11796. }
  11797. function o() {
  11798. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11799. for (var n = e; n < t; n++) (P[32767 + n] = i), (R[32767 + n] = []), (R[32767 + n][1] = i), (R[32767 + n][0] = n)
  11800. for (var r = -(t - 1); r <= -e; r++) (P[32767 + r] = i), (R[32767 + r] = []), (R[32767 + r][1] = i), (R[32767 + r][0] = t - 1 + r)
  11801. ;(e <<= 1), (t <<= 1)
  11802. }
  11803. }
  11804. function a() {
  11805. for (var e = 0; e < 256; e++)
  11806. (H[e] = 19595 * e),
  11807. (H[(e + 256) >> 0] = 38470 * e),
  11808. (H[(e + 512) >> 0] = 7471 * e + 32768),
  11809. (H[(e + 768) >> 0] = -11059 * e),
  11810. (H[(e + 1024) >> 0] = -21709 * e),
  11811. (H[(e + 1280) >> 0] = 32768 * e + 8421375),
  11812. (H[(e + 1536) >> 0] = -27439 * e),
  11813. (H[(e + 1792) >> 0] = -5329 * e)
  11814. }
  11815. function s(e) {
  11816. for (var t = e[0], i = e[1] - 1; i >= 0; ) t & (1 << i) && (N |= 1 << B), i--, B--, B < 0 && (255 == N ? (l(255), l(0)) : l(N), (B = 7), (N = 0))
  11817. }
  11818. function l(e) {
  11819. D.push(e)
  11820. }
  11821. function c(e) {
  11822. l((e >> 8) & 255), l(255 & e)
  11823. }
  11824. function h(e, t) {
  11825. var i,
  11826. n,
  11827. r,
  11828. o,
  11829. a,
  11830. s,
  11831. l,
  11832. c,
  11833. h,
  11834. u = 0,
  11835. d = 8,
  11836. p = 64
  11837. for (h = 0; h < d; ++h) {
  11838. ;(i = e[u]), (n = e[u + 1]), (r = e[u + 2]), (o = e[u + 3]), (a = e[u + 4]), (s = e[u + 5]), (l = e[u + 6]), (c = e[u + 7])
  11839. var f = i + c,
  11840. g = i - c,
  11841. m = n + l,
  11842. v = n - l,
  11843. A = r + s,
  11844. y = r - s,
  11845. C = o + a,
  11846. I = o - a,
  11847. E = f + C,
  11848. b = f - C,
  11849. w = m + A,
  11850. _ = m - A
  11851. ;(e[u] = E + w), (e[u + 4] = E - w)
  11852. var T = 0.707106781 * (_ + b)
  11853. ;(e[u + 2] = b + T), (e[u + 6] = b - T), (E = I + y), (w = y + v), (_ = v + g)
  11854. var x = 0.382683433 * (E - _),
  11855. S = 0.5411961 * E + x,
  11856. M = 1.306562965 * _ + x,
  11857. R = 0.707106781 * w,
  11858. P = g + R,
  11859. L = g - R
  11860. ;(e[u + 5] = L + S), (e[u + 3] = L - S), (e[u + 1] = P + M), (e[u + 7] = P - M), (u += 8)
  11861. }
  11862. for (u = 0, h = 0; h < d; ++h) {
  11863. ;(i = e[u]), (n = e[u + 8]), (r = e[u + 16]), (o = e[u + 24]), (a = e[u + 32]), (s = e[u + 40]), (l = e[u + 48]), (c = e[u + 56])
  11864. var D = i + c,
  11865. N = i - c,
  11866. B = n + l,
  11867. F = n - l,
  11868. V = r + s,
  11869. U = r - s,
  11870. k = o + a,
  11871. H = o - a,
  11872. G = D + k,
  11873. z = D - k,
  11874. W = B + V,
  11875. j = B - V
  11876. ;(e[u] = G + W), (e[u + 32] = G - W)
  11877. var Y = 0.707106781 * (j + z)
  11878. ;(e[u + 16] = z + Y), (e[u + 48] = z - Y), (G = H + U), (W = U + F), (j = F + N)
  11879. var X = 0.382683433 * (G - j),
  11880. Z = 0.5411961 * G + X,
  11881. q = 1.306562965 * j + X,
  11882. K = 0.707106781 * W,
  11883. Q = N + K,
  11884. J = N - K
  11885. ;(e[u + 40] = J + Z), (e[u + 24] = J - Z), (e[u + 8] = Q + q), (e[u + 56] = Q - q), u++
  11886. }
  11887. var $
  11888. for (h = 0; h < p; ++h) ($ = e[h] * t[h]), (O[h] = $ > 0 ? ($ + 0.5) | 0 : ($ - 0.5) | 0)
  11889. return O
  11890. }
  11891. function u() {
  11892. c(65504), c(16), l(74), l(70), l(73), l(70), l(0), l(1), l(1), l(0), c(1), c(1), l(0), l(0)
  11893. }
  11894. function d(e, t) {
  11895. c(65472), c(17), l(8), c(t), c(e), l(3), l(1), l(17), l(0), l(2), l(17), l(1), l(3), l(17), l(1)
  11896. }
  11897. function p() {
  11898. c(65499), c(132), l(0)
  11899. for (var e = 0; e < 64; e++) l(T[e])
  11900. l(1)
  11901. for (var t = 0; t < 64; t++) l(x[t])
  11902. }
  11903. function f() {
  11904. c(65476), c(418), l(0)
  11905. for (var e = 0; e < 16; e++) l(z[e + 1])
  11906. for (var t = 0; t <= 11; t++) l(W[t])
  11907. l(16)
  11908. for (var i = 0; i < 16; i++) l(j[i + 1])
  11909. for (var n = 0; n <= 161; n++) l(Y[n])
  11910. l(1)
  11911. for (var r = 0; r < 16; r++) l(X[r + 1])
  11912. for (var o = 0; o <= 11; o++) l(Z[o])
  11913. l(17)
  11914. for (var a = 0; a < 16; a++) l(q[a + 1])
  11915. for (var s = 0; s <= 161; s++) l(K[s])
  11916. }
  11917. function g() {
  11918. c(65498), c(12), l(3), l(1), l(0), l(2), l(17), l(3), l(17), l(0), l(63), l(0)
  11919. }
  11920. function m(e, t, i, n, r) {
  11921. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f) L[G[f]] = p[f]
  11922. var g = L[0] - i
  11923. ;(i = L[0]), 0 == g ? s(n[0]) : ((o = 32767 + g), s(n[P[o]]), s(R[o]))
  11924. for (var m = 63; m > 0 && 0 == L[m]; m--);
  11925. if (0 == m) return s(a), i
  11926. for (var v, A = 1; A <= m; ) {
  11927. for (var y = A; 0 == L[A] && A <= m; ++A);
  11928. var C = A - y
  11929. if (C >= c) {
  11930. v = C >> 4
  11931. for (var I = 1; I <= v; ++I) s(l)
  11932. C &= 15
  11933. }
  11934. ;(o = 32767 + L[A]), s(r[(C << 4) + P[o]]), s(R[o]), A++
  11935. }
  11936. return m != u && s(a), i
  11937. }
  11938. function v() {
  11939. for (var e = String.fromCharCode, t = 0; t < 256; t++) k[t] = e(t)
  11940. }
  11941. function A(e) {
  11942. if ((e <= 0 && (e = 1), e > 100 && (e = 100), w != e)) {
  11943. var t = 0
  11944. ;(t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e)), i(t), (w = e)
  11945. }
  11946. }
  11947. function y() {
  11948. var e = new Date().getTime()
  11949. t || (t = 50), v(), r(), o(), a(), A(t)
  11950. new Date().getTime() - e
  11951. }
  11952. var C,
  11953. I,
  11954. E,
  11955. b,
  11956. w,
  11957. _ = (Math.round, Math.floor),
  11958. T = new Array(64),
  11959. x = new Array(64),
  11960. S = new Array(64),
  11961. M = new Array(64),
  11962. R = new Array(65535),
  11963. P = new Array(65535),
  11964. O = new Array(64),
  11965. L = new Array(64),
  11966. D = [],
  11967. N = 0,
  11968. B = 7,
  11969. F = new Array(64),
  11970. V = new Array(64),
  11971. U = new Array(64),
  11972. k = new Array(256),
  11973. H = new Array(2048),
  11974. G = [
  11975. 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,
  11976. 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63
  11977. ],
  11978. z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0],
  11979. W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  11980. j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125],
  11981. Y = [
  11982. 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,
  11983. 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,
  11984. 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,
  11985. 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
  11986. ],
  11987. X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
  11988. Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11],
  11989. q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119],
  11990. K = [
  11991. 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,
  11992. 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,
  11993. 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,
  11994. 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
  11995. ]
  11996. ;(this.encode = function (t, i) {
  11997. var n = (new Date().getTime(), i.quality)
  11998. n && A(n), (D = new Array()), (N = 0), (B = 7), c(65496), u(), p(), d(t.width, t.height), f(), g()
  11999. var r = 0,
  12000. o = 0,
  12001. a = 0
  12002. ;(N = 0), (B = 7), (this.encode.displayName = '_encode_')
  12003. 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); ) {
  12004. for (l = 0; l < G; ) {
  12005. for (w = G * z + l, _ = w, T = -1, x = 0, R = 0; R < 64; R++)
  12006. (x = (k ? 63 - R : R) >> 3),
  12007. (T = 4 * (7 & R)),
  12008. (_ = w + x * G + T),
  12009. z + x >= L && (_ -= G * (z + 1 + x - L)),
  12010. l + T >= G && (_ -= l + T - G + 4),
  12011. (h = P[_++]),
  12012. (v = P[_++]),
  12013. (y = P[_++]),
  12014. (F[R] = ((H[h] + H[(v + 256) >> 0] + H[(y + 512) >> 0]) >> 16) - 128),
  12015. (V[R] = ((H[(h + 768) >> 0] + H[(v + 1024) >> 0] + H[(y + 1280) >> 0]) >> 16) - 128),
  12016. (U[R] = ((H[(h + 1280) >> 0] + H[(v + 1536) >> 0] + H[(y + 1792) >> 0]) >> 16) - 128)
  12017. ;(r = m(F, S, r, C, E)), (o = m(V, M, o, I, b)), (a = m(U, M, a, I, b)), (l += 32)
  12018. }
  12019. z += W
  12020. }
  12021. if (B >= 0) {
  12022. var j = []
  12023. ;(j[1] = B + 1), (j[0] = (1 << (B + 1)) - 1), s(j)
  12024. }
  12025. return c(65497), new e(D)
  12026. }),
  12027. y()
  12028. }
  12029. function n(e, t) {
  12030. ;(t = t || {}), (t.quality = t.quality || 50)
  12031. var n = t.quality,
  12032. r = new i(n),
  12033. o = r.encode(e, t)
  12034. return {
  12035. data: o,
  12036. width: e.width,
  12037. height: e.height
  12038. }
  12039. }
  12040. t.exports.encode = n
  12041. }).call(this, e('buffer').Buffer)
  12042. },
  12043. {
  12044. buffer: 198
  12045. }
  12046. ],
  12047. 95: [
  12048. function (e, t, i) {
  12049. 'use strict'
  12050. !(function () {
  12051. if (
  12052. ('performance' in window == !1 && (window.performance = {}),
  12053. (Date.now =
  12054. Date.now ||
  12055. function () {
  12056. return new Date().getTime()
  12057. }),
  12058. 'now' in window.performance == !1)
  12059. ) {
  12060. var e = Date.now()
  12061. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12062. (window.performance.now = function () {
  12063. return Date.now() - e
  12064. })
  12065. }
  12066. })()
  12067. },
  12068. {}
  12069. ],
  12070. 96: [
  12071. function (e, t, i) {
  12072. 'use strict'
  12073. var n = e('three')
  12074. ;(n.EffectComposer = function (e, t) {
  12075. if (((this.renderer = e), void 0 === t)) {
  12076. var i = {
  12077. minFilter: n.LinearFilter,
  12078. magFilter: n.LinearFilter,
  12079. format: n.RGBAFormat,
  12080. stencilBuffer: !1
  12081. },
  12082. r = e.getSize()
  12083. t = new n.WebGLRenderTarget(r.width, r.height, i)
  12084. }
  12085. ;(this.renderTarget1 = t),
  12086. (this.renderTarget2 = t.clone()),
  12087. (this.writeBuffer = this.renderTarget1),
  12088. (this.readBuffer = this.renderTarget2),
  12089. (this.passes = []),
  12090. void 0 === n.CopyShader && console.error('THREE.EffectComposer relies on THREE.CopyShader'),
  12091. (this.copyPass = new n.ShaderPass(n.CopyShader))
  12092. }),
  12093. (n.EffectComposer.prototype = {
  12094. swapBuffers: function () {
  12095. var e = this.readBuffer
  12096. ;(this.readBuffer = this.writeBuffer), (this.writeBuffer = e)
  12097. },
  12098. addPass: function (e) {
  12099. this.passes.push(e)
  12100. },
  12101. insertPass: function (e, t) {
  12102. this.passes.splice(t, 0, e)
  12103. },
  12104. render: function (e) {
  12105. ;(this.writeBuffer = this.renderTarget1), (this.readBuffer = this.renderTarget2)
  12106. var t,
  12107. i,
  12108. r = !1,
  12109. o = this.passes.length
  12110. for (i = 0; i < o; i++)
  12111. if (((t = this.passes[i]), t.enabled)) {
  12112. if ((t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r), t.needsSwap)) {
  12113. if (r) {
  12114. var a = this.renderer.context
  12115. a.stencilFunc(a.NOTEQUAL, 1, 4294967295), this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e), a.stencilFunc(a.EQUAL, 1, 4294967295)
  12116. }
  12117. this.swapBuffers()
  12118. }
  12119. t instanceof n.MaskPass ? (r = !0) : t instanceof n.ClearMaskPass && (r = !1)
  12120. }
  12121. },
  12122. reset: function (e) {
  12123. if (void 0 === e) {
  12124. var t = this.renderer.getSize()
  12125. ;(e = this.renderTarget1.clone()), e.setSize(t.width, t.height)
  12126. }
  12127. this.renderTarget1.dispose(),
  12128. this.renderTarget2.dispose(),
  12129. (this.renderTarget1 = e),
  12130. (this.renderTarget2 = e.clone()),
  12131. (this.writeBuffer = this.renderTarget1),
  12132. (this.readBuffer = this.renderTarget2)
  12133. },
  12134. setSize: function (e, t) {
  12135. this.renderTarget1.setSize(e, t), this.renderTarget2.setSize(e, t)
  12136. this.passes.forEach(a => {
  12137. //add for TransitionPass
  12138. a.setSize && a.setSize(e, t)
  12139. })
  12140. }
  12141. })
  12142. },
  12143. {
  12144. three: 217
  12145. }
  12146. ],
  12147. 97: [
  12148. function (e, t, i) {
  12149. 'use strict'
  12150. var n = e('three')
  12151. ;(n.MaskPass = function (e, t) {
  12152. ;(this.scene = e), (this.camera = t), (this.enabled = !0), (this.clear = !0), (this.needsSwap = !1), (this.inverse = !1)
  12153. }),
  12154. (n.MaskPass.prototype = {
  12155. render: function (e, t, i, n) {
  12156. var r = e.context
  12157. r.colorMask(!1, !1, !1, !1), r.depthMask(!1)
  12158. var o, a
  12159. this.inverse ? ((o = 0), (a = 1)) : ((o = 1), (a = 0)),
  12160. r.enable(r.STENCIL_TEST),
  12161. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  12162. r.stencilFunc(r.ALWAYS, o, 4294967295),
  12163. r.clearStencil(a),
  12164. e.render(this.scene, this.camera, i, this.clear),
  12165. e.render(this.scene, this.camera, t, this.clear),
  12166. r.colorMask(!0, !0, !0, !0),
  12167. r.depthMask(!0),
  12168. r.stencilFunc(r.EQUAL, 1, 4294967295),
  12169. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  12170. }
  12171. }),
  12172. (n.ClearMaskPass = function () {
  12173. this.enabled = !0
  12174. }),
  12175. (n.ClearMaskPass.prototype = {
  12176. render: function (e, t, i, n) {
  12177. var r = e.context
  12178. r.disable(r.STENCIL_TEST)
  12179. }
  12180. })
  12181. },
  12182. {
  12183. three: 217
  12184. }
  12185. ],
  12186. 98: [
  12187. function (e, t, i) {
  12188. 'use strict'
  12189. var n = e('three')
  12190. ;(n.RenderPass = function (e, t, i, r, o) {
  12191. ;(this.scene = e),
  12192. (this.camera = t),
  12193. (this.overrideMaterial = i),
  12194. (this.clearColor = r),
  12195. (this.clearAlpha = void 0 !== o ? o : 1),
  12196. (this.oldClearColor = new n.Color()),
  12197. (this.oldClearAlpha = 1),
  12198. (this.enabled = !0),
  12199. (this.clear = !0),
  12200. (this.needsSwap = !1)
  12201. }),
  12202. (n.RenderPass.prototype = {
  12203. render: function (e, t, i, n) {
  12204. ;(this.scene.overrideMaterial = this.overrideMaterial),
  12205. this.clearColor && (this.oldClearColor.copy(e.getClearColor()), (this.oldClearAlpha = e.getClearAlpha()), e.setClearColor(this.clearColor, this.clearAlpha)),
  12206. e.render(this.scene, this.camera, i, this.clear),
  12207. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  12208. (this.scene.overrideMaterial = null)
  12209. }
  12210. })
  12211. },
  12212. {
  12213. three: 217
  12214. }
  12215. ],
  12216. 99: [
  12217. function (e, t, i) {
  12218. 'use strict'
  12219. var n = e('three')
  12220. ;(n.ShaderPass = function (e, t) {
  12221. ;(this.textureID = void 0 !== t ? t : 'tDiffuse'),
  12222. e instanceof n.ShaderMaterial
  12223. ? ((this.uniforms = e.uniforms), (this.material = e))
  12224. : e &&
  12225. ((this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  12226. (this.material = new n.ShaderMaterial({
  12227. defines: e.defines || {},
  12228. uniforms: this.uniforms,
  12229. vertexShader: e.vertexShader,
  12230. fragmentShader: e.fragmentShader
  12231. }))),
  12232. (this.renderToScreen = !1),
  12233. (this.enabled = !0),
  12234. (this.needsSwap = !0),
  12235. (this.clear = !1),
  12236. (this.camera = new n.OrthographicCamera(-1, 1, 1, -1, 0, 1)),
  12237. (this.scene = new n.Scene()),
  12238. (this.quad = new n.Mesh(new n.PlaneBufferGeometry(2, 2), null)),
  12239. this.scene.add(this.quad)
  12240. }),
  12241. (n.ShaderPass.prototype = {
  12242. render: function (e, t, i, n) {
  12243. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  12244. (this.quad.material = this.material),
  12245. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  12246. }
  12247. })
  12248. },
  12249. {
  12250. three: 217
  12251. }
  12252. ],
  12253. 100: [
  12254. function (e, t, i) {
  12255. 'use strict'
  12256. var n = e('three')
  12257. n.CopyShader = {
  12258. uniforms: {
  12259. tDiffuse: {
  12260. type: 't',
  12261. value: null
  12262. },
  12263. opacity: {
  12264. type: 'f',
  12265. value: 1
  12266. }
  12267. },
  12268. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12269. fragmentShader: [
  12270. 'uniform float opacity;',
  12271. 'uniform sampler2D tDiffuse;',
  12272. 'varying vec2 vUv;',
  12273. 'void main() {',
  12274. 'vec4 texel = texture2D( tDiffuse, vUv );',
  12275. 'gl_FragColor = opacity * texel;',
  12276. '}'
  12277. ].join('\n')
  12278. }
  12279. },
  12280. {
  12281. three: 217
  12282. }
  12283. ],
  12284. 101: [
  12285. function (e, t, i) {
  12286. 'use strict'
  12287. var n = e('three')
  12288. n.HorizontalBlurShader = {
  12289. uniforms: {
  12290. tDiffuse: {
  12291. type: 't',
  12292. value: null
  12293. },
  12294. h: {
  12295. type: 'f',
  12296. value: 1 / 512
  12297. }
  12298. },
  12299. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12300. fragmentShader: [
  12301. 'uniform sampler2D tDiffuse;',
  12302. 'uniform float h;',
  12303. 'varying vec2 vUv;',
  12304. 'void main() {',
  12305. 'vec4 sum = vec4( 0.0 );',
  12306. 'sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;',
  12307. 'sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;',
  12308. 'sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;',
  12309. 'sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;',
  12310. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  12311. 'sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;',
  12312. 'sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;',
  12313. 'sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;',
  12314. 'sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;',
  12315. 'gl_FragColor = sum;',
  12316. '}'
  12317. ].join('\n')
  12318. }
  12319. },
  12320. {
  12321. three: 217
  12322. }
  12323. ],
  12324. 102: [
  12325. function (e, t, i) {
  12326. 'use strict'
  12327. var n = e('three')
  12328. n.VerticalBlurShader = {
  12329. uniforms: {
  12330. tDiffuse: {
  12331. type: 't',
  12332. value: null
  12333. },
  12334. v: {
  12335. type: 'f',
  12336. value: 1 / 512
  12337. }
  12338. },
  12339. vertexShader: ['varying vec2 vUv;', 'void main() {', 'vUv = uv;', 'gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );', '}'].join('\n'),
  12340. fragmentShader: [
  12341. 'uniform sampler2D tDiffuse;',
  12342. 'uniform float v;',
  12343. 'varying vec2 vUv;',
  12344. 'void main() {',
  12345. 'vec4 sum = vec4( 0.0 );',
  12346. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;',
  12347. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;',
  12348. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;',
  12349. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;',
  12350. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;',
  12351. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;',
  12352. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;',
  12353. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;',
  12354. 'sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;',
  12355. 'gl_FragColor = sum;',
  12356. '}'
  12357. ].join('\n')
  12358. }
  12359. },
  12360. {
  12361. three: 217
  12362. }
  12363. ],
  12364. 103: [
  12365. function (e, t, i) {
  12366. 'use strict'
  12367. var n = e('three')
  12368. !(function () {
  12369. if (('performance' in window == 0 && (window.performance = {}), 'now' in window.performance == 0)) {
  12370. var e = Date.now()
  12371. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  12372. (window.performance.now = function () {
  12373. return Date.now() - e
  12374. })
  12375. }
  12376. })(),
  12377. (n.WebGLRenderer.prototype.paramThreeToGL = function (e) {
  12378. var t,
  12379. i = this.extensions,
  12380. r = this.context
  12381. if (e === n.RepeatWrapping) return r.REPEAT
  12382. if (e === n.ClampToEdgeWrapping) return r.CLAMP_TO_EDGE
  12383. if (e === n.MirroredRepeatWrapping) return r.MIRRORED_REPEAT
  12384. if (e === n.NearestFilter) return r.NEAREST
  12385. if (e === n.NearestMipMapNearestFilter) return r.NEAREST_MIPMAP_NEAREST
  12386. if (e === n.NearestMipMapLinearFilter) return r.NEAREST_MIPMAP_LINEAR
  12387. if (e === n.LinearFilter) return r.LINEAR
  12388. if (e === n.LinearMipMapNearestFilter) return r.LINEAR_MIPMAP_NEAREST
  12389. if (e === n.LinearMipMapLinearFilter) return r.LINEAR_MIPMAP_LINEAR
  12390. if (e === n.UnsignedByteType) return r.UNSIGNED_BYTE
  12391. if (e === n.UnsignedShort4444Type) return r.UNSIGNED_SHORT_4_4_4_4
  12392. if (e === n.UnsignedShort5551Type) return r.UNSIGNED_SHORT_5_5_5_1
  12393. if (e === n.UnsignedShort565Type) return r.UNSIGNED_SHORT_5_6_5
  12394. if (e === n.ByteType) return r.BYTE
  12395. if (e === n.ShortType) return r.SHORT
  12396. if (e === n.UnsignedShortType) return r.UNSIGNED_SHORT
  12397. if (e === n.IntType) return r.INT
  12398. if (e === n.UnsignedIntType) return r.UNSIGNED_INT
  12399. if (e === n.FloatType) return r.FLOAT
  12400. if (((t = i.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType)) return t.HALF_FLOAT_OES
  12401. if (e === n.AlphaFormat) return r.ALPHA
  12402. if (e === n.RGBFormat) return r.RGB
  12403. if (e === n.RGBAFormat) return r.RGBA
  12404. if (e === n.LuminanceFormat) return r.LUMINANCE
  12405. if (e === n.LuminanceAlphaFormat) return r.LUMINANCE_ALPHA
  12406. if (e === n.AddEquation) return r.FUNC_ADD
  12407. if (e === n.SubtractEquation) return r.FUNC_SUBTRACT
  12408. if (e === n.ReverseSubtractEquation) return r.FUNC_REVERSE_SUBTRACT
  12409. if (e === n.ZeroFactor) return r.ZERO
  12410. if (e === n.OneFactor) return r.ONE
  12411. if (e === n.SrcColorFactor) return r.SRC_COLOR
  12412. if (e === n.OneMinusSrcColorFactor) return r.ONE_MINUS_SRC_COLOR
  12413. if (e === n.SrcAlphaFactor) return r.SRC_ALPHA
  12414. if (e === n.OneMinusSrcAlphaFactor) return r.ONE_MINUS_SRC_ALPHA
  12415. if (e === n.DstAlphaFactor) return r.DST_ALPHA
  12416. if (e === n.OneMinusDstAlphaFactor) return r.ONE_MINUS_DST_ALPHA
  12417. if (e === n.DstColorFactor) return r.DST_COLOR
  12418. if (e === n.OneMinusDstColorFactor) return r.ONE_MINUS_DST_COLOR
  12419. if (e === n.SrcAlphaSaturateFactor) return r.SRC_ALPHA_SATURATE
  12420. if (((t = i.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  12421. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  12422. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  12423. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  12424. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12425. }
  12426. if (((t = i.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  12427. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  12428. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  12429. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  12430. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12431. }
  12432. if (((t = i.get('WEBGL_compressed_texture_etc1')), null !== t && e === n.RGB_ETC1_Format)) return t.COMPRESSED_RGB_ETC1_WEBGL
  12433. if (((t = i.get('EXT_blend_minmax')), null !== t)) {
  12434. if (e === n.MinEquation) return t.MIN_EXT
  12435. if (e === n.MaxEquation) return t.MAX_EXT
  12436. }
  12437. return 0
  12438. }),
  12439. (n.WebGLState = function (e, t, i) {
  12440. var r = this,
  12441. o = new n.Vector4(),
  12442. a = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  12443. s = new Uint8Array(a),
  12444. l = new Uint8Array(a),
  12445. c = new Uint8Array(a),
  12446. h = {},
  12447. u = null,
  12448. d = null,
  12449. p = null,
  12450. f = null,
  12451. g = null,
  12452. m = null,
  12453. v = null,
  12454. A = null,
  12455. y = !1,
  12456. C = null,
  12457. I = null,
  12458. E = null,
  12459. b = null,
  12460. w = null,
  12461. _ = null,
  12462. T = null,
  12463. x = null,
  12464. S = null,
  12465. M = null,
  12466. R = null,
  12467. P = null,
  12468. O = null,
  12469. L = null,
  12470. D = null,
  12471. N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  12472. B = void 0,
  12473. F = {},
  12474. V = new n.Vector4(),
  12475. U = null,
  12476. k = null,
  12477. H = new n.Vector4(),
  12478. G = new n.Vector4()
  12479. ;(this.init = function () {
  12480. this.clearColor(0, 0, 0, 1),
  12481. this.clearDepth(1),
  12482. this.clearStencil(0),
  12483. this.enable(e.DEPTH_TEST),
  12484. e.depthFunc(e.LEQUAL),
  12485. e.frontFace(e.CCW),
  12486. e.cullFace(e.BACK),
  12487. this.enable(e.CULL_FACE),
  12488. this.enable(e.BLEND),
  12489. e.blendEquation(e.FUNC_ADD),
  12490. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12491. }),
  12492. (this.initAttributes = function () {
  12493. for (var e = 0, t = s.length; e < t; e++) s[e] = 0
  12494. }),
  12495. (this.enableAttribute = function (i) {
  12496. if (((s[i] = 1), 0 === l[i] && (e.enableVertexAttribArray(i), (l[i] = 1)), 0 !== c[i])) {
  12497. var n = t.get('ANGLE_instanced_arrays')
  12498. n.vertexAttribDivisorANGLE(i, 0), (c[i] = 0)
  12499. }
  12500. }),
  12501. (this.enableAttributeAndDivisor = function (t, i, n) {
  12502. ;(s[t] = 1), 0 === l[t] && (e.enableVertexAttribArray(t), (l[t] = 1)), c[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (c[t] = i))
  12503. }),
  12504. (this.disableUnusedAttributes = function () {
  12505. for (var t = 0, i = l.length; t < i; t++) l[t] !== s[t] && (e.disableVertexAttribArray(t), (l[t] = 0))
  12506. }),
  12507. (this.enable = function (t) {
  12508. h[t] !== !0 && (e.enable(t), (h[t] = !0))
  12509. }),
  12510. (this.disable = function (t) {
  12511. h[t] !== !1 && (e.disable(t), (h[t] = !1))
  12512. }),
  12513. (this.getCompressedTextureFormats = function () {
  12514. if (null === u && ((u = []), t.get('WEBGL_compressed_texture_pvrtc') || t.get('WEBGL_compressed_texture_s3tc') || t.get('WEBGL_compressed_texture_etc1')))
  12515. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++) u.push(i[n])
  12516. return u
  12517. }),
  12518. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  12519. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12520. (t === d && h === y) ||
  12521. (t === n.AdditiveBlending
  12522. ? h
  12523. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  12524. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  12525. : t === n.SubtractiveBlending
  12526. ? h
  12527. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA))
  12528. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  12529. : t === n.MultiplyBlending
  12530. ? h
  12531. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  12532. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  12533. : h
  12534. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA))
  12535. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12536. (d = t),
  12537. (y = h)),
  12538. t === n.CustomBlending
  12539. ? ((s = s || r),
  12540. (l = l || o),
  12541. (c = c || a),
  12542. (r === p && s === m) || (e.blendEquationSeparate(i(r), i(s)), (p = r), (m = s)),
  12543. (o === f && a === g && l === v && c === A) || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)), (f = o), (g = a), (v = l), (A = c)))
  12544. : ((p = null), (f = null), (g = null), (m = null), (v = null), (A = null))
  12545. }),
  12546. (this.setDepthFunc = function (t) {
  12547. if (C !== t) {
  12548. if (t)
  12549. switch (t) {
  12550. case n.NeverDepth:
  12551. e.depthFunc(e.NEVER)
  12552. break
  12553. case n.AlwaysDepth:
  12554. e.depthFunc(e.ALWAYS)
  12555. break
  12556. case n.LessDepth:
  12557. e.depthFunc(e.LESS)
  12558. break
  12559. case n.LessEqualDepth:
  12560. e.depthFunc(e.LEQUAL)
  12561. break
  12562. case n.EqualDepth:
  12563. e.depthFunc(e.EQUAL)
  12564. break
  12565. case n.GreaterEqualDepth:
  12566. e.depthFunc(e.GEQUAL)
  12567. break
  12568. case n.GreaterDepth:
  12569. e.depthFunc(e.GREATER)
  12570. break
  12571. case n.NotEqualDepth:
  12572. e.depthFunc(e.NOTEQUAL)
  12573. break
  12574. default:
  12575. e.depthFunc(e.LEQUAL)
  12576. }
  12577. else e.depthFunc(e.LEQUAL)
  12578. C = t
  12579. }
  12580. }),
  12581. (this.setDepthTest = function (t) {
  12582. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12583. }),
  12584. (this.setDepthWrite = function (t) {
  12585. I !== t && (e.depthMask(t), (I = t))
  12586. }),
  12587. (this.setColorWrite = function (t) {
  12588. E !== t && (e.colorMask(t, t, t, t), (E = t))
  12589. }),
  12590. (this.setStencilFunc = function (t, i, n) {
  12591. ;(w === t && _ === i && T === n) || (e.stencilFunc(t, i, n), (w = t), (_ = i), (T = n))
  12592. }),
  12593. (this.setStencilOp = function (t, i, n) {
  12594. ;(x === t && S === i && M === n) || (e.stencilOp(t, i, n), (x = t), (S = i), (M = n))
  12595. }),
  12596. (this.setStencilTest = function (t) {
  12597. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12598. }),
  12599. (this.setStencilWrite = function (t) {
  12600. b !== t && (e.stencilMask(t), (b = t))
  12601. }),
  12602. (this.setFlipSided = function (t) {
  12603. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (R = t))
  12604. }),
  12605. (this.setLineWidth = function (t) {
  12606. t !== P && (e.lineWidth(t), (P = t))
  12607. }),
  12608. (this.setPolygonOffset = function (t, i, n) {
  12609. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL), !t || (O === i && L === n) || (e.polygonOffset(i, n), (O = i), (L = n))
  12610. }),
  12611. (this.getScissorTest = function () {
  12612. return D
  12613. }),
  12614. (this.setScissorTest = function (t) {
  12615. ;(D = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12616. }),
  12617. (this.activeTexture = function (t) {
  12618. void 0 === t && (t = e.TEXTURE0 + N - 1), B !== t && (e.activeTexture(t), (B = t))
  12619. }),
  12620. (this.bindTexture = function (t, i) {
  12621. void 0 === B && r.activeTexture()
  12622. var n = F[B]
  12623. void 0 === n &&
  12624. ((n = {
  12625. type: void 0,
  12626. texture: void 0
  12627. }),
  12628. (F[B] = n)),
  12629. (n.type === t && n.texture === i) || (e.bindTexture(t, i), (n.type = t), (n.texture = i))
  12630. }),
  12631. (this.compressedTexImage2D = function () {
  12632. try {
  12633. e.compressedTexImage2D.apply(e, arguments)
  12634. } catch (e) {
  12635. console.error(e)
  12636. }
  12637. }),
  12638. (this.texImage2D = function () {
  12639. try {
  12640. e.texImage2D.apply(e, arguments)
  12641. } catch (e) {
  12642. console.error(e)
  12643. }
  12644. }),
  12645. (this.clearColor = function (t, i, n, r) {
  12646. o.set(t, i, n, r), V.equals(o) === !1 && (e.clearColor(t, i, n, r), V.copy(o))
  12647. }),
  12648. (this.clearDepth = function (t) {
  12649. U !== t && (e.clearDepth(t), (U = t))
  12650. }),
  12651. (this.clearStencil = function (t) {
  12652. k !== t && (e.clearStencil(t), (k = t))
  12653. }),
  12654. (this.scissor = function (t) {
  12655. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), H.copy(t))
  12656. }),
  12657. (this.viewport = function (t) {
  12658. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), G.copy(t))
  12659. }),
  12660. (this.reset = function () {
  12661. for (var t = 0; t < l.length; t++) 1 === l[t] && (e.disableVertexAttribArray(t), (l[t] = 0))
  12662. ;(h = {}), (u = null), (B = void 0), (F = {}), (d = null), (E = null), (I = null), (b = null), (R = null)
  12663. })
  12664. })
  12665. },
  12666. {
  12667. three: 217
  12668. }
  12669. ],
  12670. 104: [
  12671. function (e, t, i) {
  12672. ;(function (i, n) {
  12673. 'use strict'
  12674. function r(e) {
  12675. this.urls = e
  12676. var t = i(
  12677. 'bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==',
  12678. 'base64'
  12679. )
  12680. ;(this.builder = a.loadProto(t)), (this.decoder = this.builder.build('binary_mesh'))
  12681. }
  12682. var o = e('three'),
  12683. a = e('protobufjs'),
  12684. s = e('../util/logger'),
  12685. l = (e('../util/common'), e('../util/ajax')),
  12686. c = e('../objects/Chunk'),
  12687. h = new s(n)
  12688. ;(r.prototype = {
  12689. constructor: r,
  12690. load: function (e, t, i, n) {
  12691. return (
  12692. h.time('download'),
  12693. l
  12694. .get(e, {
  12695. responseType: 'arraybuffer'
  12696. })
  12697. .done(
  12698. function (r) {
  12699. h.timeEnd('download'), this.parse(r, e, t, i, n)
  12700. }.bind(this)
  12701. )
  12702. .fail(n)
  12703. )
  12704. },
  12705. parse: function (e, t, i, n, r) {
  12706. var o = this.readProtobuf(e)
  12707. if (!o) return r()
  12708. try {
  12709. h.time('convert to webgl'), this.convertProtobufToSceneObject(o, t, i, n, r), h.timeEnd('convert to webgl')
  12710. } catch (e) {
  12711. return h.error('failed parsing .dam'), h.error(e.message), r()
  12712. }
  12713. },
  12714. readProtobuf: function (e) {
  12715. var t
  12716. try {
  12717. h.time('parse proto'), (t = this.decoder.decode(e)), h.timeEnd('parse proto')
  12718. } catch (e) {
  12719. return h.error('failed parsing proto for .dam'), h.error(e.message), null
  12720. }
  12721. return t
  12722. },
  12723. convertProtobufToSceneObject: function (e, t, i, n, r) {
  12724. function a(e) {
  12725. var i = new o.BufferGeometry()
  12726. return (
  12727. i.addAttribute('position', new o.BufferAttribute(new Float32Array(e.vertices.xyz, 0, 3), 3)),
  12728. e.vertices.uv.length > 0 && i.addAttribute('uv', new o.BufferAttribute(new Float32Array(e.vertices.uv, 0, 2), 2)),
  12729. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces, 0, 1), 1)),
  12730. i.applyMatrix(s),
  12731. i.computeBoundingBox(),
  12732. new c({
  12733. geometry: i,
  12734. textureName: e.material_name,
  12735. name: e.chunk_name,
  12736. meshUrl: t
  12737. })
  12738. )
  12739. }
  12740. if (0 === e.chunk.length) return h.warn('No chunks in damfile...'), i([])
  12741. var s = new o.Matrix4()
  12742. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1)
  12743. var l = e.chunk.map(a)
  12744. return l ? i(l) : (h.error('.dam protobuf came out with no chunks...'), r())
  12745. }
  12746. }),
  12747. (t.exports = r)
  12748. }).call(this, e('buffer').Buffer, '/js/loaders/DamLoader.js')
  12749. },
  12750. {
  12751. '../objects/Chunk': 144,
  12752. '../util/ajax': 181,
  12753. '../util/common': 185,
  12754. '../util/logger': 189,
  12755. buffer: 198,
  12756. protobufjs: 214,
  12757. three: 217
  12758. }
  12759. ],
  12760. 105: [
  12761. function (e, t, i) {
  12762. ;(function (i) {
  12763. 'use strict'
  12764. var n = (e('three'), e('../settings'), e('../util/browser'), e('./DamLoader')),
  12765. r = e('../util/logger'),
  12766. o = (e('../ab'), new r(i))
  12767. t.exports = {
  12768. getLoaders: function () {
  12769. return [
  12770. ['_50k', '.dam', n],
  12771. ['', '.dam', n]
  12772. ]
  12773. },
  12774. load: function (e, t, i, n, r, a) {
  12775. var s = this.getLoaders()
  12776. a = a || 0
  12777. var l = s[a]
  12778. if (!l) return void (r && r('No suitable model file found...'))
  12779. var c = l[0],
  12780. h = l[1],
  12781. u = new l[2](t),
  12782. d = t.get(e + c + h)
  12783. d
  12784. ? (o.debug('Trying ' + c + h),
  12785. u.load(
  12786. d,
  12787. i,
  12788. n,
  12789. function () {
  12790. this.load(e, t, i, n, r, ++a)
  12791. }.bind(this)
  12792. ))
  12793. : (o.debug('Skipping ' + h + ', not available'), this.load(e, t, i, n, r, ++a))
  12794. }
  12795. }
  12796. }).call(this, '/js/loaders/ModelLoader.js')
  12797. },
  12798. {
  12799. '../ab': 3,
  12800. '../settings': 166,
  12801. '../util/browser': 182,
  12802. '../util/logger': 189,
  12803. './DamLoader': 104,
  12804. three: 217
  12805. }
  12806. ],
  12807. 106: [
  12808. function (e, t, i) {
  12809. ;(function (i) {
  12810. 'use strict'
  12811. var n = e('../util/common'),
  12812. r = e('../util/texture'),
  12813. o = e('../util/browser'),
  12814. a = e('../util/logger'),
  12815. s = e('../settings'),
  12816. l = new a(i)
  12817. t.exports = {
  12818. load: function (e, t) {
  12819. function i(e, i) {
  12820. e || (t.push(i), p++, d.notify(p, a), p === a && d.resolve())
  12821. }
  12822. if (!e.chunks[0] || !e.chunks[0].meshUrl) return $.when()
  12823. var a = n.countUnique(
  12824. e.chunks.map(function (e) {
  12825. return e.textureName
  12826. })
  12827. ),
  12828. c = e.chunks[0].meshUrl.indexOf('_50k') !== -1 ? '_50k' : '',
  12829. h = '_50k' === c ? 'high' : 'low'
  12830. s.minimalMemoryMode &&
  12831. 'high' === h &&
  12832. (o.detectSamsungS6()
  12833. ? (l.warn('Galaxy S6 cannot handle large textures, turning down quality.'), (h = 'low'))
  12834. : a > s.maxMobileTextures && (l.warn('Model probably too large for mobile, turning down quality.'), (h = 'low')))
  12835. var u = e.data.job.uuid + c + '_texture_jpg_' + h + '/',
  12836. d = $.Deferred(),
  12837. p = 0
  12838. return (
  12839. e.chunks.forEach(function (t) {
  12840. if (!t.material.map && t.textureName) {
  12841. var n = e.urls.get(u + t.textureName)
  12842. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12843. }
  12844. }),
  12845. d.promise()
  12846. )
  12847. }
  12848. }
  12849. }).call(this, '/js/loaders/ModelTextureLoader.js')
  12850. },
  12851. {
  12852. '../settings': 166,
  12853. '../util/browser': 182,
  12854. '../util/common': 185,
  12855. '../util/logger': 189,
  12856. '../util/texture': 194
  12857. }
  12858. ],
  12859. 107: [
  12860. function (e, t, i) {
  12861. ;(function (i, n) {
  12862. 'use strict'
  12863. function r(e) {
  12864. ;(this.model = e), (this.modelDataPath = this.model.urls.get('vision.modeldata') + '?m=' + new Date().getTime()), (this.sweepLocationsPath = this.model.urls.get('sweep_locations.csv'))
  12865. var t = i(
  12866. 'Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K',
  12867. 'base64'
  12868. ),
  12869. n = o.loadProto(t)
  12870. this.decoder = n.build('VisionModeldata')
  12871. }
  12872. var o = e('protobufjs'),
  12873. a = e('../util/ajax'),
  12874. s = (e('../util/common'), e('../util/math')),
  12875. l = e('../util/logger'),
  12876. c = new l(n)
  12877. ;(r.prototype.load = function () {
  12878. return this.modelDataPath
  12879. ? (c.info('Using vision.modeldata'), this.loadVisionModelData())
  12880. : this.sweepLocationsPath
  12881. ? (c.warn('Using sweep_locations.csv'), this.loadSweepLocationsCSV())
  12882. : (c.warn('No sweep file found'), $.when([]))
  12883. }),
  12884. (r.prototype.loadVisionModelData = function () {
  12885. return a
  12886. .get(this.modelDataPath, {
  12887. responseType: 'arraybuffer'
  12888. })
  12889. .then(
  12890. function (e) {
  12891. var t
  12892. try {
  12893. t = this.decoder.decode(e)
  12894. } catch (e) {
  12895. return c.warn('Could not decode vision.modeldata, trying sweep_locations.csv'), this.loadSweepLocationsCSV()
  12896. }
  12897. var i = t.sweepLocations
  12898. .map(function (e) {
  12899. return {
  12900. uuid: e.uuid.toUTF8().replace(/-/g, ''),
  12901. position: {
  12902. x: e.pose.translation.x,
  12903. y: e.pose.translation.y,
  12904. z: e.pose.translation.z
  12905. },
  12906. quaternion: {
  12907. x: e.pose.rotation.x,
  12908. y: e.pose.rotation.y,
  12909. z: e.pose.rotation.z,
  12910. w: e.pose.rotation.w
  12911. },
  12912. puck: {
  12913. x: e.puck.x,
  12914. y: e.puck.y,
  12915. z: e.puck.z
  12916. },
  12917. floor: window.sceneFrom == 'kankan' ? e.subgroup : e.group,
  12918. neighbours: e.visibles,
  12919. alignmentType: e.alignment_type
  12920. }
  12921. })
  12922. .map(function (e) {
  12923. return (e.position = s.convertVisionVector(e.position)), (e.quaternion = s.convertVisionQuaternion(e.quaternion)), (e.puck = s.convertVisionVector(e.puck)), e
  12924. })
  12925. return (
  12926. i.forEach(function (e) {
  12927. e.neighbours = e.neighbours.map(function (e) {
  12928. return i[e].uuid
  12929. })
  12930. }),
  12931. i
  12932. )
  12933. }.bind(this),
  12934. function () {
  12935. return c.warn('Could not load vision.modeldata, trying sweep_locations.csv'), this.loadSweepLocationsCSV()
  12936. }.bind(this)
  12937. )
  12938. }),
  12939. (r.prototype.loadSweepLocationsCSV = function () {
  12940. return a
  12941. .get(this.sweepLocationsPath)
  12942. .then(function (e) {
  12943. var t = e
  12944. .split('\n')
  12945. .map(function (e) {
  12946. return e.split(', ')
  12947. })
  12948. .filter(function (e) {
  12949. return e.length > 1
  12950. })
  12951. .map(function (e) {
  12952. return {
  12953. uuid: e[0],
  12954. position: {
  12955. x: parseFloat(e[1]),
  12956. y: parseFloat(e[2]),
  12957. z: parseFloat(e[3])
  12958. },
  12959. quaternion: {
  12960. x: parseFloat(e[4]),
  12961. y: parseFloat(e[5]),
  12962. z: parseFloat(e[6]),
  12963. w: parseFloat(e[7])
  12964. }
  12965. }
  12966. })
  12967. .map(function (e) {
  12968. return (e.position = s.convertVisionVector(e.position)), (e.quaternion = s.convertVisionQuaternion(e.quaternion)), e
  12969. })
  12970. return t
  12971. })
  12972. .fail(function () {
  12973. c.warn('Could not load sweep_locations.csv, no sweeps loaded.')
  12974. })
  12975. }),
  12976. (t.exports = r)
  12977. }).call(this, e('buffer').Buffer, '/js/loaders/SweepDataLoader.js')
  12978. },
  12979. {
  12980. '../util/ajax': 181,
  12981. '../util/common': 185,
  12982. '../util/logger': 189,
  12983. '../util/math': 190,
  12984. buffer: 198,
  12985. protobufjs: 214
  12986. }
  12987. ],
  12988. 108: [
  12989. function (e, t, i) {
  12990. ;(function (i) {
  12991. 'use strict'
  12992. function n() {
  12993. this.locale = null
  12994. }
  12995. var r = e('../settings'),
  12996. o = e('../util/common'),
  12997. a = e('../util/logger'),
  12998. s = e('../enum/Locale'),
  12999. l = new a(i)
  13000. ;(n.prototype.init = function () {
  13001. var t
  13002. switch (r.languageTag) {
  13003. case null:
  13004. case 'en':
  13005. case s.EN_US:
  13006. ;(this.locale = s.EN_US), (t = e('./strings-en-US'))
  13007. break
  13008. case 'es':
  13009. case s.ES_MX:
  13010. ;(this.locale = s.ES_MX), (t = e('./strings-es-MX'))
  13011. break
  13012. case 'fr':
  13013. case s.FR_FR:
  13014. ;(this.locale = s.FR_FR), (t = e('./strings-fr-FR'))
  13015. break
  13016. case 'de':
  13017. case s.DE_DE:
  13018. ;(this.locale = s.DE_DE), (t = e('./strings-de-DE'))
  13019. break
  13020. case 'ru':
  13021. case s.RU_RU:
  13022. ;(this.locale = s.RU_RU), (t = e('./strings-ru-RU'))
  13023. break
  13024. case 'cn':
  13025. case s.CN_CN:
  13026. ;(this.locale = s.CN_CN), (t = e('./strings-cn-CN'))
  13027. break
  13028. case 'jp':
  13029. case s.JP_JP:
  13030. ;(this.locale = s.JP_JP), (t = e('./strings-jp-JP'))
  13031. break
  13032. default:
  13033. l.info("Unsupported language tag, defaulting to 'en-US'"), (this.locale = s.EN_US), (t = e('./strings-en-US'))
  13034. }
  13035. l.info("Using locale '" + this.locale + "'"), o.extendObject(this, t)
  13036. }),
  13037. (n.prototype.localizeGUI = function () {
  13038. var e = document.querySelector('#gui-parent')
  13039. this.localizeTree(e), this.localizeLoadingText()
  13040. }),
  13041. (n.prototype.localizeLoadingText = function () {
  13042. // var e = document.querySelector("#loader-cont")
  13043. // , t = e.getAttribute("title");
  13044. // e.removeAttribute("title"),
  13045. // e.setAttribute("data-status", t),
  13046. // e.classList.add(this.locale),
  13047. document.querySelector('#help-dialog').classList.add(this.locale),
  13048. document.querySelector('#interaction-modal').classList.add(this.locale),
  13049. document.querySelector('#gui').classList.add(this.locale)
  13050. }),
  13051. (n.prototype.localizeTree = function (e) {
  13052. var t,
  13053. i,
  13054. n = /{\[{ ?(\w+) ?}\]}/
  13055. if (e.nodeType === Node.TEXT_NODE) (t = e.data.match(n)), t && ((i = t[1]), (e.data = this.localizeText(i) || i))
  13056. else if (e.nodeType === Node.ELEMENT_NODE) {
  13057. var r = e.getAttribute('title')
  13058. r && ((t = r.match(n)), t && ((i = t[1]), e.setAttribute('title', this.localizeText(i) || i)))
  13059. }
  13060. for (e = e.firstChild; e; ) this.localizeTree(e), (e = e.nextSibling)
  13061. }),
  13062. (n.prototype.localizeText = function (t) {
  13063. var i = this[t]
  13064. return (
  13065. i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."), (i = e('./strings-en-US')[t])),
  13066. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  13067. i
  13068. )
  13069. }),
  13070. (t.exports = new n())
  13071. }).call(this, '/js/localization/localize.js')
  13072. },
  13073. {
  13074. '../enum/Locale': 31,
  13075. '../settings': 166,
  13076. '../util/common': 185,
  13077. '../util/logger': 189,
  13078. './strings-cn-CN': 109,
  13079. './strings-de-DE': 110,
  13080. './strings-en-US': 111,
  13081. './strings-es-MX': 112,
  13082. './strings-fr-FR': 113,
  13083. './strings-jp-JP': 114,
  13084. './strings-ru-RU': 115
  13085. }
  13086. ],
  13087. 109: [
  13088. function (e, t, i) {
  13089. 'use strict'
  13090. t.exports = {
  13091. PAGE_TITLE: '',
  13092. LOADING: '正在加载',
  13093. PRESENTED_BY_CAPS: '呈现者:',
  13094. POWERED_BY: '技术支持:',
  13095. POWERED_BY_CAPS: '技术支持:',
  13096. DESKTOP_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  13097. MOBILE_SHORT_CTA: '点击一次以探索这个 3D 空间。',
  13098. PRESENTED_BY: '呈现者:',
  13099. MORE: '更多 ',
  13100. LESS: '更少 ',
  13101. TAG_CONTENT: 'tag™ 内容',
  13102. SHOW: '显示',
  13103. HIDE: '隐藏',
  13104. DOLLHOUSE: '场景屋',
  13105. FLOOR_PLAN: '楼层平面图',
  13106. OPEN_HIGHLIGHTS: '打开精彩片段',
  13107. CLOSE_HIGHLIGHTS: '关闭',
  13108. PREVIOUS: '上一个',
  13109. PLAY: '播放',
  13110. PAUSE: '暂停',
  13111. NEXT: '下一个',
  13112. EXPLORE_3D_SPACE: '探索 3D 空间',
  13113. VIEW_DOLLHOUSE: '观看场景屋',
  13114. SOCIAL_SHARING: '分享这个空间',
  13115. VIEW_IN_VR: '以 VR 观看',
  13116. VIEW_FULLSCREEN: '全屏观看',
  13117. EXIT_FULLSCREEN: ' 退出全屏',
  13118. ZOOM_IN: '放大',
  13119. ZOOM_OUT: '缩小',
  13120. FLOOR_NAME: '楼层',
  13121. FLOOR_ALL: 'ALL',
  13122. FLOOR_Lang: ['Floor', ''],
  13123. TERMS: '条款',
  13124. PORT_TERMS: 'port 条款',
  13125. TERMS_OF_USE: '使用条款',
  13126. CLOSE_TERMS: '关闭',
  13127. TERMS_TEXT_FILE: 'terms-cn-CN.html',
  13128. TERMS_FAIL: '无法获取条款。请确保您有互联网连接以查看使用条款。',
  13129. WEBVR_FOR_DAYDREAM: '用于 Daydream 视图',
  13130. WEBVR_ENTER_WEBVR: '进入 VR',
  13131. WEBVR_DIFFERENT_HEADSET: '有其他耳机吗?',
  13132. WEBVR_LEARN_MORE: '了解更多',
  13133. WEBVR_VIEW_SPACE: '在 VR 中观看空间',
  13134. WEBVR_DAYDREAM_VIEW: 'Daydream 视图',
  13135. WEBVR_DAYDREAM_PHONE: '支持 Daydream 的手机',
  13136. WEBVR_FOR_CARDBOARD: '用于 Google Cardboard',
  13137. WEBVR_VIEW_CARDBOARD: '或在 Google Cardboard 上观看',
  13138. VR_VIEW_SPACE: '在虚拟现实中观看空间',
  13139. VR_LEARN_MORE_CAPS: '了解更多',
  13140. VR_PREVIOUS_CAPS: '上一个’,',
  13141. VR_NEXT_CAPS: '下一个',
  13142. VR_GOT_IT_CAPS: '明白了',
  13143. VR_SHOW_SUPPORTED: '点击以使用 VR 观看空间',
  13144. VR_SHOW_UNSUPPORTED: '很遗憾,您的设备不符合在 VR 中观看空间的最低要求。',
  13145. VR_SHOW_IOS_1: '点击以使用 VR 观看空间',
  13146. VR_SHOW_IOS_2: '需要有 port VR 应用程序和兼容的 iPhone 才能观看',
  13147. VR_WHAT_YOU_NEED: '关于...您需要什么',
  13148. VR_NEED_CARDBOARD: '您使用 Google Cardboard 时需要什么',
  13149. VR_NEED_SAMSUNG: '您使用 Samsung Gear VR 时需要什么',
  13150. VR_NEED_DAYDREAM: '需要事先与 DAYDREAM VIEW 配对',
  13151. VR_NEED_DAYDREAM_PHONE: '支持 Daydream 的手机',
  13152. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13153. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13154. VR_APP: 'port VR 应用程序',
  13155. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13156. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13157. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本',
  13158. VR_COMPATIBLE_IPHONES_3: '兼容的 iPhone',
  13159. VR_COMPATIBLE_ANDROID: '兼容的 Android 设备',
  13160. VR_COMPATIBLE_ANDROID_LONG: '4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏',
  13161. VR_ANDROID_DETAIL: '4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏',
  13162. VR_ANDROID_DVICES: 'Android 设备',
  13163. VR_COMPATIBLE_SAMSUNG: '兼容的 Samsung 设备',
  13164. VR_SAMSUNG_DETAIL: 'Galaxy S6 和更高版本',
  13165. VR_APP_FOR_CARDBOARD: '用于 Google Cardboard 的 port VR 应用程序',
  13166. VR_APP_FOR_SAMSUNG: '用于 Gear VR 的 port VR 应用程序',
  13167. VR_APP_FOR_ANDROID: '用于 Android 手机的 port VR 应用程序',
  13168. VR_APP_OPEN: '请使用 port VR 应用程序打开',
  13169. VR_DOWNLOAD_HERE: '在此下载',
  13170. VR_REQUIRE_HEADSET: '需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序',
  13171. VR_REDIRECT_TO_STORE: '如果未安装应用程序,您将跳转到应用程序商店。',
  13172. VR_IMPROPER_EMBED: 'port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。',
  13173. VR_OPEN_ANDROID_LINK: '在您的手机上打开链接',
  13174. VR_ANDROID_OPTIONS: '可用的 VR 耳机选项',
  13175. SHARE_TO: '分享到',
  13176. SHARE_LINK: '直接链接',
  13177. SHARE_EXPLORE: '探索',
  13178. SHARE_AT: '在',
  13179. SHARE_WITH: '使用',
  13180. SHARE_3D: '以 3D',
  13181. SHARE_COPIED: '已复制!',
  13182. ERROR_BROWSER_SOLUTION: '安装更新的浏览器以探索 3D。',
  13183. ERROR_BROWSER_EXPLANATION: 'WebGL 需要现代的浏览器。',
  13184. ERROR_GENERIC_PROBLEM: '糟糕,出现问题。',
  13185. ERROR_GENERIC_SOLUTION: '重新启动您的浏览器。',
  13186. ERROR_GENERIC_ACTIONS_1: '如果问题仍然存在,',
  13187. ERROR_GENERIC_ACTIONS_2: '请安装支持的浏览器',
  13188. ERROR_GENERIC_ACTIONS_3: ' 或',
  13189. ERROR_GENERIC_ACTIONS_4: '查看我们的故障排除指南',
  13190. ERROR_WEBGL_UNSUPPORTED_PROBLEM: '浏览器不受支持。',
  13191. ERROR_WEBGL_IOS_PROBLEM: 'iOS 版本不受支持。',
  13192. ERROR_WEBGL_IOS_SOLUTION: '升级到 iOS 8 或更高版本以在 3D 中探索。',
  13193. ERROR_WEBGL_IOS_ACTIONS_1: '点击 ',
  13194. ERROR_WEBGL_IOS_ACTIONS_2: '设置 > 通用 > 软件更新',
  13195. ERROR_WEBGL_SAFARI_PROBLEM: '启用 WebGL 以在 3D 中探索。',
  13196. ERROR_WEBGL_SAFARI_ACTIONS_1: '单击',
  13197. ERROR_WEBGL_SAFARI_ACTIONS_2: '菜单栏中的首选项 > 高级 > 显示开发菜单',
  13198. ERROR_WEBGL_SAFARI_ACTIONS_3: '然后单击',
  13199. ERROR_WEBGL_SAFARI_ACTIONS_4: '开发 > 启用 WebGL',
  13200. ERROR_MISSING_URLS_PROBLEM: '糟糕,没有此模型的全景。',
  13201. ERROR_MISSING_URLS_EXPLANATION: '这是较早的模型。网站所有者可能正在开发一种新模型。',
  13202. ERROR_LOADING_FAILED_PROBLEM: '糟糕,模式不可用。',
  13203. ERROR_LOADING_FAILED_ACTIONS_1: '如果问题仍然存在,',
  13204. ERROR_LOADING_FAILED_ACTIONS_2: '查看我们的故障排除指南',
  13205. ERROR_MAINTENANCE_PROBLEM: '正在进行维护',
  13206. ERROR_MAINTENANCE_SOLUTION: '请过几分钟再来。',
  13207. LINK_TO_LOCATION: '地点链接',
  13208. MENU_COPY: '复制',
  13209. LINK_ALERT_COPY: '请使用 CTRL/CMD + C 复制。',
  13210. ROTATE: '旋转',
  13211. MOVE: '移动',
  13212. INSIDE: '内部',
  13213. ZOOM: '缩放',
  13214. HELP: '小帮手',
  13215. HELP_NAVIGATION_TAB: '导航',
  13216. HELP_MORE_HELP_TAB: '更多帮助',
  13217. HELP_DESKTOP_PANORAMA_1A: '单击并拖动以环顾空间。',
  13218. HELP_DESKTOP_PANORAMA_2A: '单击整个空间内的圆环以四处移动。',
  13219. HELP_DESKTOP_PANORAMA_3A: '使用鼠标滚轮来放大和缩小。',
  13220. HELP_DESKTOP_PANORAMA_1B: '或者,使用箭头键向左向右转。',
  13221. HELP_DESKTOP_PANORAMA_2B: '或者,使用箭头键向前移动和向后移动。',
  13222. HELP_DESKTOP_PANORAMA_3B: '或者,使用加号和减号键来放大和缩小。',
  13223. HELP_DESKTOP_360_2A: '单击内部视图图标以进入空间。',
  13224. HELP_DESKTOP_360_2B: '或者,按 1 号键进入内部视图。 ',
  13225. HELP_DESKTOP_DOLLHOUSE_1A: '左键单击并向左、向右、向上和向下拖动以旋转场景屋。',
  13226. HELP_DESKTOP_DOLLHOUSE_2A: '右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。',
  13227. HELP_DESKTOP_DOLLHOUSE_3A: '使用鼠标滚轮来放大和缩小。',
  13228. HELP_DESKTOP_DOLLHOUSE_1B: '或者,使用箭头键来旋转场景屋。',
  13229. HELP_DESKTOP_FLOORPLAN_1A: '左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。',
  13230. HELP_DESKTOP_FLOORPLAN_2A: '右键单击并向左或向右拖动以旋转楼层平面图。',
  13231. HELP_DESKTOP_FLOORPLAN_3A: '使用鼠标滚轮来放大和缩小。',
  13232. HELP_DESKTOP_FLOORPLAN_2B: '或者,使用箭头键以向左或向右旋转。',
  13233. HELP_DESKTOP_FLOORPLAN_3B: '或者,使用箭头键来放大和缩小。',
  13234. HELP_MOBILE_PANORAMA_1: '触摸并拖动以环顾空间。',
  13235. HELP_MOBILE_PANORAMA_2: '点击整个空间内的圆环以四处移动。',
  13236. HELP_MOBILE_3: '使用捏合手势来放大和缩小。',
  13237. HELP_MOBILE_360_2: '点击内部视图图标以进入空间。',
  13238. HELP_MOBILE_DOLLHOUSE_1: '触摸并向上、向下、向左和向右拖动以旋转场景屋。',
  13239. HELP_MOBILE_DOLLHOUSE_2: '用两指触摸并拖动以定位场景屋。',
  13240. HELP_MOBILE_FLOORPLAN_1: '触摸并拖动以定位楼层平面图。',
  13241. HELP_MOBILE_FLOORPLAN_2: '用两指触摸并拖动以旋转楼层平面图。',
  13242. HELP_MORE_HLR_A: '精彩片段集锦',
  13243. HELP_DESKTOP_MORE_HLR_B: '打开以使用缩略图图像在空间中流览。',
  13244. HELP_MORE_DOLLHOUSE_A: '场景屋',
  13245. HELP_DESKTOP_MORE_DOLLHOUSE_B: '单击以查看和旋转 3D 内整个空间的俯视图。',
  13246. HELP_MOBILE_MORE_DOLLHOUSE_B: '点击以查看和旋转 3D 内整个空间的俯视图。',
  13247. HELP_MORE_FLOORS_A: '楼层选择器',
  13248. HELP_DESKTOP_MORE_FLOORS_B: '在空间中的楼层之间切换。',
  13249. HELP_MORE_TAG_A: 'tag™ 贴文',
  13250. HELP_DESKTOP_MORE_TAG_B: '单击或悬停鼠标以查看空间中的功能信息。',
  13251. HELP_MOBILE_MORE_TAG_B: '点击以查看空间中的功能信息。',
  13252. HELP_MORE_ZOOM_A: '缩放控件',
  13253. HELP_DESKTOP_MORE_ZOOM_B: '使用这些控件来放大和缩小或使用滚轮。',
  13254. HELP_MORE_TOUR_A: '导览控件',
  13255. HELP_DESKTOP_MORE_TOUR_B: '通过导览播放、暂停以及向前和向后流览。',
  13256. HELP_MORE_INSIDE_A: '内部视图',
  13257. HELP_DESKTOP_MORE_INSIDE_B: '单击以探索空间内部。',
  13258. HELP_MOBILE_MORE_INSIDE_B: '点击以探索空间内部。',
  13259. HELP_MORE_VR_A: 'VR 模式',
  13260. HELP_DESKTOP_MORE_VR_B: '单击以在虚拟现实中启动空间。',
  13261. HELP_MOBILE_MORE_VR_B: '点击以在虚拟现实中启动空间。',
  13262. HELP_MORE_360_A: '360° 视图',
  13263. HELP_DESKTOP_MORE_360_B: '单击精彩片段集锦中的 360 视图中以观看室外场景。',
  13264. HELP_MOBILE_MORE_360_B: '点击精彩片段集锦中的 360 视图中以观看室外场景。',
  13265. HELP_MORE_FULLSCREEN_A: '全屏',
  13266. HELP_DESKTOP_MORE_FULLSCREEN_B: '将 3D Showcase 扩展到全屏。',
  13267. CLOSE: '关闭'
  13268. }
  13269. },
  13270. {}
  13271. ],
  13272. 110: [
  13273. function (e, t, i) {
  13274. 'use strict'
  13275. t.exports = {
  13276. PAGE_TITLE: '',
  13277. LOADING: 'Lädt',
  13278. PRESENTED_BY_CAPS: 'PRÄSENTIERT VON',
  13279. POWERED_BY: 'Angetrieben von',
  13280. POWERED_BY_CAPS: 'ANGETRIEBEN VON',
  13281. DESKTOP_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  13282. MOBILE_SHORT_CTA: 'Sehen sie sich in diesem 3D Raum um.',
  13283. PRESENTED_BY: 'Präsentiert von ',
  13284. MORE: 'Mehr ',
  13285. LESS: 'Weniger ',
  13286. TAG_CONTENT: 'tag™ Inhalt',
  13287. SHOW: 'Anzeigen',
  13288. HIDE: 'Verbergen',
  13289. DOLLHOUSE: 'Puppenhaus',
  13290. FLOOR_PLAN: 'Grundriss',
  13291. OPEN_HIGHLIGHTS: 'Highlights anzeigen',
  13292. CLOSE_HIGHLIGHTS: 'Schließen',
  13293. PREVIOUS: 'Vorheriges',
  13294. PLAY: 'Abspielen',
  13295. PAUSE: 'Pausieren',
  13296. NEXT: 'Nächstes',
  13297. EXPLORE_3D_SPACE: 'Innenraum betreten',
  13298. VIEW_DOLLHOUSE: 'Puppenhaus ansehen',
  13299. SOCIAL_SHARING: 'Teilen Sie diesen Raum',
  13300. VIEW_IN_VR: 'In VR ansehen',
  13301. VIEW_FULLSCREEN: 'Ansicht im Vollbildmodus',
  13302. EXIT_FULLSCREEN: 'Beenden des Vollbildmodus',
  13303. ZOOM_IN: 'Vergrößern',
  13304. ZOOM_OUT: 'Verkleinern',
  13305. FLOOR_NAME: 'Etage ',
  13306. FLOOR_ALL: 'Alle',
  13307. TERMS: 'Bedingungen',
  13308. PORT_TERMS: 'port Bedingungen',
  13309. TERMS_OF_USE: 'Nutzungsbedingungen',
  13310. TERMS_TEXT_FILE: 'terms-de-DE.html',
  13311. CLOSE_TERMS: 'Schließen',
  13312. TERMS_FAIL: 'Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.',
  13313. HELP: 'Hilfe',
  13314. HELP_NAVIGATION_TAB: 'Navigation',
  13315. HELP_MORE_HELP_TAB: 'Hilfe-Details',
  13316. CLOSE: 'Schließen',
  13317. HELP_DESKTOP_PANORAMA_1A: 'Klicken und ziehen Sie um sich im Raum umzusehen.',
  13318. HELP_DESKTOP_PANORAMA_2A: 'Klicken Sie auf die Ringe im Raum um sich zu bewegen.',
  13319. HELP_DESKTOP_PANORAMA_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13320. HELP_DESKTOP_PANORAMA_1B: 'Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.',
  13321. HELP_DESKTOP_PANORAMA_2B: 'Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.',
  13322. HELP_DESKTOP_PANORAMA_3B: 'Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.',
  13323. HELP_DESKTOP_360_2A: 'Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .',
  13324. HELP_DESKTOP_360_2B: 'Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.',
  13325. HELP_DESKTOP_DOLLHOUSE_1A: 'Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.',
  13326. 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.',
  13327. HELP_DESKTOP_DOLLHOUSE_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13328. HELP_DESKTOP_DOLLHOUSE_1B: 'Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.',
  13329. 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.',
  13330. HELP_DESKTOP_FLOORPLAN_2A: 'Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.',
  13331. HELP_DESKTOP_FLOORPLAN_3A: 'Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.',
  13332. HELP_DESKTOP_FLOORPLAN_2B: 'Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.',
  13333. HELP_DESKTOP_FLOORPLAN_3B: 'Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.',
  13334. HELP_MOBILE_PANORAMA_1: 'Berühren und ziehen an dem Raum um sich umzusehen.',
  13335. HELP_MOBILE_PANORAMA_2: 'Klicken Sie auf die Ringe im Raum, um sich zu bewegen.',
  13336. HELP_MOBILE_3: 'Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.',
  13337. HELP_MOBILE_360_2: 'Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.',
  13338. HELP_MOBILE_DOLLHOUSE_1: 'Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.',
  13339. HELP_MOBILE_DOLLHOUSE_2: 'Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.',
  13340. HELP_MOBILE_FLOORPLAN_1: 'Berühren und ziehen, um den Grundriss zu positionieren.',
  13341. HELP_MOBILE_FLOORPLAN_2: 'Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.',
  13342. HELP_MORE_HLR_A: 'Liste das Highlight',
  13343. HELP_DESKTOP_MORE_HLR_B: 'Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.',
  13344. HELP_MORE_DOLLHOUSE_A: 'Puppenhaus Ansicht',
  13345. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  13346. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.',
  13347. HELP_MORE_FLOORS_A: 'Etage auswählen',
  13348. HELP_DESKTOP_MORE_FLOORS_B: 'Zwischen den Etagen im Raum wechseln.',
  13349. HELP_MORE_TAG_A: 'tag™ Posts',
  13350. HELP_DESKTOP_MORE_TAG_B: 'Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.',
  13351. HELP_MOBILE_MORE_TAG_B: 'Tippen Sie für Informationen über die Funktionen im Raum.',
  13352. HELP_MORE_ZOOM_A: 'Zoom Steuerung',
  13353. HELP_DESKTOP_MORE_ZOOM_B: 'Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.',
  13354. HELP_MORE_TOUR_A: 'Tour Steuerung',
  13355. HELP_DESKTOP_MORE_TOUR_B: 'Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.',
  13356. HELP_MORE_INSIDE_A: 'Innenansicht',
  13357. HELP_DESKTOP_MORE_INSIDE_B: 'Klicken Sie hier um sich im Raum umzusehen.',
  13358. HELP_MOBILE_MORE_INSIDE_B: 'Sehen Sie sich in diesen 3D Raum um.',
  13359. HELP_MORE_VR_A: 'VR Modus',
  13360. HELP_DESKTOP_MORE_VR_B: 'Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.',
  13361. HELP_MOBILE_MORE_VR_B: 'Tippen Sie um den Raum in der virtuellen Realität zu starten.',
  13362. HELP_MORE_360_A: '360° Views Ansicht ',
  13363. HELP_DESKTOP_MORE_360_B: 'Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  13364. HELP_MOBILE_MORE_360_B: 'Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.',
  13365. HELP_MORE_FULLSCREEN_A: 'Vollbild',
  13366. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Erweitern Sie 3D Showcase im Vollbildmodus.',
  13367. WEBVR_FOR_CARDBOARD: 'Für Google Cardboard',
  13368. WEBVR_FOR_DAYDREAM: 'Für Daydream View',
  13369. WEBVR_ENTER_WEBVR: 'Starten Sie VR',
  13370. WEBVR_DIFFERENT_HEADSET: 'Haben Sie anderes Headset?',
  13371. WEBVR_LEARN_MORE: 'Mehr Infos',
  13372. WEBVR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  13373. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13374. WEBVR_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  13375. WEBVR_VIEW_CARDBOARD: 'Oder mit Google Cardboard ansehen',
  13376. VR_WHAT_YOU_NEED: 'Was Sie dafür brauchen...',
  13377. VR_NEED_DAYDREAM_PHONE: 'Daydream-fähiges Handy',
  13378. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13379. VR_APP: 'port VR App',
  13380. VR_APP_OPEN: 'Oder öffnen Sie die port VR App',
  13381. 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',
  13382. VR_SAMSUNG_DETAIL: 'Galaxy S6 und neuer',
  13383. VR_APP_FOR_ANDROID: 'port VR app für Android',
  13384. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13385. VR_VIEW_SPACE: 'Ansicht des Raumes in VR',
  13386. VR_LEARN_MORE_CAPS: 'MEHR INFOS',
  13387. VR_PREVIOUS_CAPS: 'ZURÜCK',
  13388. VR_NEXT_CAPS: 'WEITER',
  13389. VR_GOT_IT_CAPS: 'VERSTANDEN',
  13390. VR_SHOW_SUPPORTED: 'Tippen Sie um den Raum in VR zu sehen',
  13391. VR_SHOW_UNSUPPORTED: 'Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.',
  13392. VR_SHOW_IOS_1: 'Tippen Sie um den Raum in VR zu sehen',
  13393. VR_SHOW_IOS_2: 'port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen',
  13394. VR_NEED_CARDBOARD: 'Was Sie dafür brauchen ist Google Cardboard',
  13395. VR_NEED_SAMSUNG: 'Was Sie dafür brauchen ist Samsung Gear VR',
  13396. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13397. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13398. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13399. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s oder neuer, mit iOS 9.1 und später',
  13400. VR_COMPATIBLE_IPHONES_3: 'Kompatibles iPhones',
  13401. VR_COMPATIBLE_ANDROID: 'Kompatibles Android Gerät',
  13402. VR_ANDROID_DETAIL: 'Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer',
  13403. VR_ANDROID_DVICES: 'Android Geräte',
  13404. VR_COMPATIBLE_SAMSUNG: 'Kompatible Samsung Geräte',
  13405. VR_APP_FOR_CARDBOARD: 'port VR App für Google Cardboard',
  13406. VR_APP_FOR_SAMSUNG: 'port VR App für Gear VR',
  13407. VR_DOWNLOAD_HERE: 'Hier runterladen',
  13408. VR_REQUIRE_HEADSET: 'Benötigt das ein VR-Headset und port VR App für Android installiert wird',
  13409. VR_REDIRECT_TO_STORE: 'Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.',
  13410. VR_IMPROPER_EMBED: 'Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.',
  13411. VR_OPEN_ANDROID_LINK: 'Öffnen Sie den Link auf Ihrem Handy',
  13412. VR_ANDROID_OPTIONS: 'VR Headset Optionen',
  13413. SHARE_TO: 'Teilen auf',
  13414. SHARE_LINK: 'Direkter Link',
  13415. SHARE_EXPLORE: 'Umsehen',
  13416. SHARE_AT: 'auf',
  13417. SHARE_WITH: 'mit',
  13418. SHARE_3D: 'in 3D',
  13419. SHARE_COPIED: 'Kopiert!',
  13420. ERROR_BROWSER_SOLUTION: 'Installieren Sie einen neueren Browser um sich in 3D umzusehen.',
  13421. ERROR_BROWSER_EXPLANATION: 'WebGL benötigt einen modernen Browser.',
  13422. ERROR_GENERIC_PROBLEM: 'Huch, etwas ist schief gelaufen.',
  13423. ERROR_GENERIC_SOLUTION: 'Starten Sie Ihren Browser neu.',
  13424. ERROR_GENERIC_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  13425. ERROR_GENERIC_ACTIONS_2: 'Installieren Sie einen unterstützten Browser',
  13426. ERROR_GENERIC_ACTIONS_3: ' oder ',
  13427. ERROR_GENERIC_ACTIONS_4: 'Sehen Sie unseren Leitfaden zur Fehlerbehebung',
  13428. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser wird nicht unterstützt.',
  13429. ERROR_WEBGL_IOS_PROBLEM: 'iOS-Version wird nicht unterstützt.',
  13430. ERROR_WEBGL_IOS_SOLUTION: 'Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.',
  13431. ERROR_WEBGL_IOS_ACTIONS_1: 'Tippen ',
  13432. ERROR_WEBGL_IOS_ACTIONS_2: 'Einstellungen > Allgemein > Softwareaktualisierung',
  13433. ERROR_WEBGL_SAFARI_PROBLEM: 'Aktivieren Sie WebVR um sich in 3D umzusehen.',
  13434. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Klicken ',
  13435. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen',
  13436. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Klicken Sie dann ',
  13437. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Entwickler > WebGL Aktivieren',
  13438. ERROR_MISSING_URLS_PROBLEM: 'Huch, es gibt keine Panoramen für dieses Modell .',
  13439. ERROR_MISSING_URLS_EXPLANATION: 'Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.',
  13440. ERROR_LOADING_FAILED_PROBLEM: 'Huch, das Modell ist nicht verfügbar.',
  13441. ERROR_LOADING_FAILED_ACTIONS_1: 'Wenn das Problem weiterhin besteht, ',
  13442. ERROR_LOADING_FAILED_ACTIONS_2: 'sehen Sie unseren Leitfaden zur Fehlerbehebung',
  13443. ERROR_MAINTENANCE_PROBLEM: 'Wartung im Gange.',
  13444. ERROR_MAINTENANCE_SOLUTION: 'Bitte versuchen Sie es in ein paar Minuten nochmal.',
  13445. LINK_TO_LOCATION: 'Link zu',
  13446. MENU_COPY: 'Kopieren',
  13447. LINK_ALERT_COPY: 'Bitte benutzen Sie CTRL/CMD + C zum kopieren.',
  13448. ROTATE: 'Drehen',
  13449. INSIDE: 'Drinnen',
  13450. MOVE: 'Bewegen',
  13451. ZOOM: 'Vergrößern'
  13452. }
  13453. },
  13454. {}
  13455. ],
  13456. 111: [
  13457. function (e, t, i) {
  13458. 'use strict'
  13459. t.exports = {
  13460. PAGE_TITLE: '',
  13461. LOADING: 'Loading',
  13462. PRESENTED_BY_CAPS: 'PRESENTED BY',
  13463. POWERED_BY: 'powered by ',
  13464. POWERED_BY_CAPS: 'POWERED BY',
  13465. DESKTOP_SHORT_CTA: 'Click to explore this 3D space.',
  13466. MOBILE_SHORT_CTA: 'Tap to explore this 3D space.',
  13467. PRESENTED_BY: 'Presented by ',
  13468. MORE: 'More ',
  13469. LESS: 'Less ',
  13470. TAG_CONTENT: 'tag™ Content',
  13471. SHOW: 'Show',
  13472. HIDE: 'Hide',
  13473. DOLLHOUSE: 'Dollhouse',
  13474. FLOOR_PLAN: 'Floor plan',
  13475. OPEN_HIGHLIGHTS: 'Open Highlights',
  13476. CLOSE_HIGHLIGHTS: 'Close',
  13477. PREVIOUS: 'Previous',
  13478. PLAY: 'Play',
  13479. PAUSE: 'Pause',
  13480. NEXT: 'Next',
  13481. EXPLORE_3D_SPACE: 'Explore 3D Space',
  13482. VIEW_DOLLHOUSE: 'View dollhouse',
  13483. SOCIAL_SHARING: 'Share this Space',
  13484. VIEW_IN_VR: 'View in VR',
  13485. VIEW_FULLSCREEN: '全屏',
  13486. EXIT_FULLSCREEN: '退出全屏',
  13487. ZOOM_IN: 'Zoom in',
  13488. ZOOM_OUT: 'Zoom out',
  13489. FLOOR_NAME: 'Floor ',
  13490. FLOOR_ALL: '全部',
  13491. TERMS: 'Terms',
  13492. PORT_TERMS: 'port terms',
  13493. TERMS_OF_USE: 'Terms of Use',
  13494. TERMS_TEXT_FILE: 'terms-en-US.html',
  13495. CLOSE_TERMS: 'Close',
  13496. TERMS_FAIL: 'Could not fetch terms. Please make sure you have an internet connection to view the terms of use.',
  13497. HELP: 'Help',
  13498. HELP_NAVIGATION_TAB: 'Navigation',
  13499. HELP_MORE_HELP_TAB: 'More Help',
  13500. CLOSE: 'Close',
  13501. HELP_DESKTOP_PANORAMA_1A: 'Click and Drag to look around the Space.',
  13502. HELP_DESKTOP_PANORAMA_2A: 'Click on the rings throughout the space to move around.',
  13503. HELP_DESKTOP_PANORAMA_3A: 'Use the scroll wheel to zoom in and out.',
  13504. HELP_DESKTOP_PANORAMA_1B: 'Or, use the arrow keys to turn left and right.',
  13505. HELP_DESKTOP_PANORAMA_2B: 'Or, use the arrow keys to move forward and back.',
  13506. HELP_DESKTOP_PANORAMA_3B: 'Or, use the plus and minus keys to zoom in and out.',
  13507. HELP_DESKTOP_360_2A: 'Click the Inside View icon to enter the Space.',
  13508. HELP_DESKTOP_360_2B: 'Or, press the number 1 key to enter Inside View.',
  13509. HELP_DESKTOP_DOLLHOUSE_1A: 'Left click and drag left, right, up, and down to rotate the Dollhouse.',
  13510. HELP_DESKTOP_DOLLHOUSE_2A: 'Right click and drag left, right, up, and down to change the Dollhouse position on screen.',
  13511. HELP_DESKTOP_DOLLHOUSE_3A: 'Use the scroll wheel to zoom in and out.',
  13512. HELP_DESKTOP_DOLLHOUSE_1B: 'Or, use the arrow keys to rotate the Dollhouse.',
  13513. HELP_DESKTOP_FLOORPLAN_1A: 'Left click and drag left, right, up, and down to change the Floorplan position on screen.',
  13514. HELP_DESKTOP_FLOORPLAN_2A: 'Right click and drag left or right to rotate the Floorplan.',
  13515. HELP_DESKTOP_FLOORPLAN_3A: 'Use the scroll wheel to zoom in and out.',
  13516. HELP_DESKTOP_FLOORPLAN_2B: 'Or, use the arrow keys to rotate left or right.',
  13517. HELP_DESKTOP_FLOORPLAN_3B: 'Or, use the arrow keys to zoom in and out.',
  13518. HELP_MOBILE_PANORAMA_1: 'Touch and Drag to look around the Space.',
  13519. HELP_MOBILE_PANORAMA_2: 'Tap on the rings throughout the Space to move around.',
  13520. HELP_MOBILE_3: 'Use a pinch gesture to zoom in and out.',
  13521. HELP_MOBILE_360_2: 'Tap the Inside View icon to enter the Space.',
  13522. HELP_MOBILE_DOLLHOUSE_1: 'Touch and drag up, down, left, and right to rotate the Dollhouse.',
  13523. HELP_MOBILE_DOLLHOUSE_2: 'Touch and drag with two fingers to position the Dollhouse.',
  13524. HELP_MOBILE_FLOORPLAN_1: 'Touch and drag to position the Floorplan.',
  13525. HELP_MOBILE_FLOORPLAN_2: 'Touch and drag with two fingers to rotate the Floorplan.',
  13526. HELP_MORE_HLR_A: 'Highlight Reel',
  13527. HELP_DESKTOP_MORE_HLR_B: 'Open to navigate through the Space using thumbnail images.',
  13528. HELP_MORE_DOLLHOUSE_A: 'Dollhouse View',
  13529. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Click to view and rotate a top-down view of the entire Space in 3D.',
  13530. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tap to view and rotate a top-down view of the entire Space in 3D.',
  13531. HELP_MORE_FLOORS_A: 'Floor Selector',
  13532. HELP_DESKTOP_MORE_FLOORS_B: 'Switch between floors in the Space.',
  13533. HELP_MORE_TAG_A: 'tag™ Posts',
  13534. HELP_DESKTOP_MORE_TAG_B: 'Click or hover over for information about features in the Space.',
  13535. HELP_MOBILE_MORE_TAG_B: 'Tap for information about features in the Space.',
  13536. HELP_MORE_ZOOM_A: 'Zoom Controls',
  13537. HELP_DESKTOP_MORE_ZOOM_B: 'Use these controls to zoom in and out or use the scroll wheel.',
  13538. HELP_MORE_TOUR_A: 'Tour Controls',
  13539. HELP_DESKTOP_MORE_TOUR_B: 'Play, pause, and navigate forward and backward through a Guided Tour.',
  13540. HELP_MORE_INSIDE_A: 'Inside View',
  13541. HELP_DESKTOP_MORE_INSIDE_B: 'Click to explore inside the Space.',
  13542. HELP_MOBILE_MORE_INSIDE_B: 'Tap to explore inside the Space.',
  13543. HELP_MORE_VR_A: 'VR Mode',
  13544. HELP_DESKTOP_MORE_VR_B: 'Click to launch the Space in virtual reality.',
  13545. HELP_MOBILE_MORE_VR_B: 'Tap to launch the Space in virtual reality.',
  13546. HELP_MORE_360_A: '360° Views',
  13547. HELP_DESKTOP_MORE_360_B: 'Click 360 Views in the Highlight Reel to view outdoor scenes.',
  13548. HELP_MOBILE_MORE_360_B: 'Tap 360 Views in the Highlight Reel to view outdoor scenes.',
  13549. HELP_MORE_FULLSCREEN_A: 'Full screen',
  13550. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expand 3D Showcase to full screen.',
  13551. WEBVR_FOR_CARDBOARD: 'For Google Cardboard',
  13552. WEBVR_VIEW_CARDBOARD: 'Or View on Google Cardboard',
  13553. WEBVR_FOR_DAYDREAM: 'For Daydream View',
  13554. WEBVR_ENTER_WEBVR: 'ENTER VR',
  13555. WEBVR_DIFFERENT_HEADSET: 'Have a different headset?',
  13556. WEBVR_LEARN_MORE: 'Learn more',
  13557. WEBVR_VIEW_SPACE: 'View Space in VR',
  13558. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13559. WEBVR_DAYDREAM_PHONE: 'Daydream-ready phone',
  13560. VR_VIEW_SPACE: 'View Space in Virtual Reality',
  13561. VR_LEARN_MORE_CAPS: 'LEARN MORE',
  13562. VR_PREVIOUS_CAPS: 'PREVIOUS',
  13563. VR_NEXT_CAPS: 'NEXT',
  13564. VR_GOT_IT_CAPS: 'GOT IT',
  13565. VR_SHOW_SUPPORTED: 'Tap to view the Space in VR with',
  13566. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13567. VR_SHOW_IOS_1: 'Tap to view the space in VR',
  13568. VR_SHOW_IOS_2: 'Requires port VR app and compatible iPhone to view',
  13569. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13570. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13571. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13572. VR_NEED_DAYDREAM: 'NEEDS PRIOR PAIRING WITH DAYDREAM VIEW',
  13573. VR_NEED_DAYDREAM_PHONE: 'Daydream-ready phone',
  13574. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13575. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13576. VR_APP: 'port VR App',
  13577. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13578. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13579. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s and newer, running iOS 9.1 and higher',
  13580. VR_COMPATIBLE_IPHONES_3: 'Compatible iPhones',
  13581. VR_COMPATIBLE_ANDROID: 'Compatible Android Devices',
  13582. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13583. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13584. VR_ANDROID_DVICES: 'Android Devices',
  13585. VR_COMPATIBLE_SAMSUNG: 'Compatible Samsung Devices',
  13586. VR_SAMSUNG_DETAIL: 'Galaxy S6 and Above',
  13587. VR_APP_FOR_CARDBOARD: 'port VR app for Google Cardboard',
  13588. VR_APP_FOR_SAMSUNG: 'port VR app for Gear VR',
  13589. VR_APP_FOR_ANDROID: 'port VR app for Android Phones',
  13590. VR_APP_OPEN: 'Open with the port VR app instead',
  13591. VR_DOWNLOAD_HERE: 'Download here',
  13592. VR_REQUIRE_HEADSET: 'Requires a VR headset and port VR app for Android to be installed',
  13593. VR_REDIRECT_TO_STORE: 'If app is not installed, you will be redirected to the app store.',
  13594. VR_IMPROPER_EMBED: 'The port Space is not embedded properly to support VR in your web browser.',
  13595. VR_OPEN_ANDROID_LINK: 'Open the Link on Your Mobile Phone',
  13596. VR_ANDROID_OPTIONS: 'Available VR Headset Options',
  13597. SHARE_TO: 'Share to',
  13598. SHARE_LINK: 'Direct Link',
  13599. SHARE_EXPLORE: 'Explore ',
  13600. SHARE_AT: 'at',
  13601. SHARE_WITH: 'with',
  13602. SHARE_3D: ' in 3D',
  13603. SHARE_COPIED: 'Copied!',
  13604. ERROR_BROWSER_SOLUTION: 'Install a new browser to explore in 3D.',
  13605. ERROR_BROWSER_EXPLANATION: 'WebGL requires a modern browser.',
  13606. ERROR_GENERIC_PROBLEM: 'Oops, something went wrong.',
  13607. ERROR_GENERIC_SOLUTION: 'Restart your browser.',
  13608. ERROR_GENERIC_ACTIONS_1: 'If the problem persists, ',
  13609. ERROR_GENERIC_ACTIONS_2: 'install a supported browser',
  13610. ERROR_GENERIC_ACTIONS_3: ' or ',
  13611. ERROR_GENERIC_ACTIONS_4: 'see our troubleshooting guide',
  13612. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Browser not supported.',
  13613. ERROR_WEBGL_IOS_PROBLEM: 'iOS version not supported.',
  13614. ERROR_WEBGL_IOS_SOLUTION: 'Upgrade to iOS 8 or higher to explore in 3D.',
  13615. ERROR_WEBGL_IOS_ACTIONS_1: 'Tap ',
  13616. ERROR_WEBGL_IOS_ACTIONS_2: 'Settings > General > Software Update',
  13617. ERROR_WEBGL_SAFARI_PROBLEM: 'Enable WebGL to explore in 3D.',
  13618. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Click ',
  13619. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferences > Advanced > Show Develop menu',
  13620. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Then click ',
  13621. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Develop > Enable WebGL',
  13622. ERROR_MISSING_URLS_PROBLEM: 'Oops, there are no panoramas for this model.',
  13623. ERROR_MISSING_URLS_EXPLANATION: 'This is an older model. The website owner may have a new model on the way.',
  13624. ERROR_LOADING_FAILED_PROBLEM: '模型不可用.',
  13625. ERROR_LOADING_FAILED_ACTIONS_1: 'If the problem persists, ',
  13626. ERROR_LOADING_FAILED_ACTIONS_2: 'see our troubleshooting guide',
  13627. ERROR_MAINTENANCE_PROBLEM: 'Maintenance in progress.',
  13628. ERROR_MAINTENANCE_SOLUTION: 'Please come back in a few minutes.',
  13629. LINK_TO_LOCATION: 'Link to location',
  13630. MENU_COPY: 'Copy',
  13631. LINK_ALERT_COPY: 'Please use CTRL/CMD + C to copy.',
  13632. ROTATE: 'Rotate',
  13633. INSIDE: 'Inside',
  13634. MOVE: 'Move',
  13635. ZOOM: 'Zoom'
  13636. }
  13637. },
  13638. {}
  13639. ],
  13640. 112: [
  13641. function (e, t, i) {
  13642. 'use strict'
  13643. t.exports = {
  13644. PAGE_TITLE: '',
  13645. LOADING: 'Cargando',
  13646. PRESENTED_BY_CAPS: 'PRESENTADO POR',
  13647. POWERED_BY: 'potenciando por ',
  13648. POWERED_BY_CAPS: 'POTENCIADO POR ',
  13649. DESKTOP_SHORT_CTA: 'Haga clic para explorar este Espacio 3D.',
  13650. MOBILE_SHORT_CTA: 'Pulse para explorar este Espacio 3D.',
  13651. PRESENTED_BY: 'Presentado por ',
  13652. MORE: 'Más ',
  13653. LESS: 'Menos ',
  13654. TAG_CONTENT: 'Contenido de tag™',
  13655. SHOW: 'Mostrar',
  13656. HIDE: 'Ocultar',
  13657. DOLLHOUSE: 'Dollhouse',
  13658. FLOOR_PLAN: 'Planos',
  13659. OPEN_HIGHLIGHTS: 'Aspectos Destacados',
  13660. CLOSE_HIGHLIGHTS: 'Cerrar',
  13661. PREVIOUS: 'Anterior',
  13662. PLAY: 'Play',
  13663. PAUSE: 'Pausa',
  13664. NEXT: 'Siguiente',
  13665. EXPLORE_3D_SPACE: 'Explorar el Espacio 3D',
  13666. VIEW_DOLLHOUSE: 'Ver dollhouse',
  13667. SOCIAL_SHARING: 'Compartir este espacio',
  13668. VIEW_IN_VR: 'Ver en realidad virtual',
  13669. VIEW_FULLSCREEN: 'Ver en pantalla completa',
  13670. EXIT_FULLSCREEN: 'Salir de pantalla completa',
  13671. ZOOM_IN: 'Acercar',
  13672. ZOOM_OUT: 'Alejar',
  13673. FLOOR_NAME: 'Piso ',
  13674. FLOOR_ALL: 'Todas',
  13675. TERMS: 'Condiciones',
  13676. PORT_TERMS: 'port términos de uso',
  13677. TERMS_OF_USE: 'Términos de uso',
  13678. TERMS_TEXT_FILE: 'terms-es-MX.html',
  13679. CLOSE_TERMS: 'Cerrar',
  13680. 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.',
  13681. HELP: 'Ayuda',
  13682. HELP_NAVIGATION_TAB: 'Navegación',
  13683. HELP_MORE_HELP_TAB: 'Más Ayuda',
  13684. CLOSE: 'Cerrar',
  13685. HELP_DESKTOP_PANORAMA_1A: 'Haga clic y arrastre para mirar alrededor del espacio.',
  13686. HELP_DESKTOP_PANORAMA_2A: 'Haga clic en los aros a lo largo del espacio para moverse.',
  13687. HELP_DESKTOP_PANORAMA_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13688. HELP_DESKTOP_PANORAMA_1B: 'O use las teclas de flecha para girar a la izquierda y a la derecha.',
  13689. HELP_DESKTOP_PANORAMA_2B: 'O use las teclas de dirección para adelantar o retroceder.',
  13690. HELP_DESKTOP_PANORAMA_3B: 'O use la tecla más para acercar y la tecla menos para alejar.',
  13691. HELP_DESKTOP_360_2A: 'Haga clic en el icono Vista Interior para ingresar al Espacio.',
  13692. HELP_DESKTOP_360_2B: 'O bien, presione la tecla numero 1 para entrar en la Vista Interior.',
  13693. HELP_DESKTOP_DOLLHOUSE_1A: 'Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.',
  13694. HELP_DESKTOP_DOLLHOUSE_2A: 'Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.',
  13695. HELP_DESKTOP_DOLLHOUSE_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13696. HELP_DESKTOP_DOLLHOUSE_1B: 'O use las teclas de dirección para girar la Dollhouse.',
  13697. 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.',
  13698. HELP_DESKTOP_FLOORPLAN_2A: 'Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.',
  13699. HELP_DESKTOP_FLOORPLAN_3A: 'Use la rueda de desplazamiento para acercar o alejar.',
  13700. HELP_DESKTOP_FLOORPLAN_2B: 'O use las teclas para girar hacia la izquierda o derecha.',
  13701. HELP_DESKTOP_FLOORPLAN_3B: 'O use las teclas de dirección para acercar o alejar.',
  13702. HELP_MOBILE_PANORAMA_1: 'Toque y arrastre para mirar alrededor del espacio.',
  13703. HELP_MOBILE_PANORAMA_2: 'Toque en los aros a lo largo del espacio para moverse.',
  13704. HELP_MOBILE_3: 'Use el gesto de pellizcar para acercar o alejar.',
  13705. HELP_MOBILE_360_2: 'Toque el ícono Vista Interior para entrar en el Espacio.',
  13706. HELP_MOBILE_DOLLHOUSE_1: 'Toque y arrastre con dos dedos para cambiar la posición della dollhouse.',
  13707. HELP_MOBILE_DOLLHOUSE_2: 'Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.',
  13708. HELP_MOBILE_FLOORPLAN_1: 'Toque y arrastre para cambiar la posición de la planta.',
  13709. HELP_MOBILE_FLOORPLAN_2: 'Toque y arrastre con dos dedos para girar la planta.',
  13710. HELP_MORE_HLR_A: 'Galería destacada',
  13711. HELP_DESKTOP_MORE_HLR_B: 'Abra para navegar a través del espacio utilizando imágenes en miniatura.',
  13712. HELP_MORE_DOLLHOUSE_A: 'Vista aérea por pisos',
  13713. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Haga clic para ver y girar la Dollhouse del espacio completo en 3D.',
  13714. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Toque para ver y girar la vista Dollhouse del espacio completo en 3D.',
  13715. HELP_MORE_FLOORS_A: 'Seleccionador de plantas',
  13716. HELP_DESKTOP_MORE_FLOORS_B: 'Cambie de una planta a otra en el espacio.',
  13717. HELP_MORE_TAG_A: 'tag™ Posts',
  13718. HELP_DESKTOP_MORE_TAG_B: 'Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.',
  13719. HELP_MOBILE_MORE_TAG_B: 'Toque para obtener más información acerca de las características del espacio.',
  13720. HELP_MORE_ZOOM_A: 'Controles de zoom',
  13721. HELP_DESKTOP_MORE_ZOOM_B: 'Use estos controles o la rueda de desplazamiento para acercar o alejar.',
  13722. HELP_MORE_TOUR_A: 'Controles de recorrido',
  13723. HELP_DESKTOP_MORE_TOUR_B: 'Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.',
  13724. HELP_MORE_INSIDE_A: 'Vista interior',
  13725. HELP_DESKTOP_MORE_INSIDE_B: 'Haga clic para explorar el interior del espacio.',
  13726. HELP_MOBILE_MORE_INSIDE_B: 'Toque para explorar el interior del espacio.',
  13727. HELP_MORE_VR_A: 'Modo de realidad virtual',
  13728. HELP_DESKTOP_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  13729. HELP_MOBILE_MORE_VR_B: 'Toque para ver el espacio en realidad virtual.',
  13730. HELP_MORE_360_A: '360° Views',
  13731. HELP_DESKTOP_MORE_360_B: 'Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.',
  13732. HELP_MOBILE_MORE_360_B: 'Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.',
  13733. HELP_MORE_FULLSCREEN_A: 'Pantalla completa',
  13734. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Expanda el escenario 3D para verlo en pantalla completa.',
  13735. WEBVR_FOR_CARDBOARD: 'Para Google Cardboard',
  13736. WEBVR_FOR_DAYDREAM: 'Para Daydream View',
  13737. WEBVR_ENTER_WEBVR: 'ENTRAR VR',
  13738. WEBVR_DIFFERENT_HEADSET: '¿Tiene un auricular diferente?',
  13739. WEBVR_LEARN_MORE: 'Más información',
  13740. WEBVR_VIEW_SPACE: 'Ver Espacio en VR',
  13741. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13742. WEBVR_DAYDREAM_PHONE: 'Daydream Teléfono listos',
  13743. WEBVR_VIEW_CARDBOARD: 'O Ver en Google Cardboard',
  13744. VR_NEED_DAYDREAM: 'Necesidades antes de acoplarse con Daydream View',
  13745. VR_NEED_DAYDREAM_PHONE: 'Teléfono listo para Daydream',
  13746. VR_GOOGLE_DAYDREAM: 'Daydream de Google',
  13747. VR_APP: 'port VR App',
  13748. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13749. VR_APP_FOR_ANDROID: 'Aplicación port VR para Teléfonos Android',
  13750. VR_APP_OPEN: 'Abrir con la aplicación port VR en su lugar',
  13751. VR_VIEW_SPACE: 'Ver Espacio en realidad virtual',
  13752. VR_LEARN_MORE_CAPS: 'SABER MÁS',
  13753. VR_PREVIOUS_CAPS: 'ANTERIOR',
  13754. VR_NEXT_CAPS: 'SIGUIENTE',
  13755. VR_GOT_IT_CAPS: 'COMPRENDIDO',
  13756. VR_SHOW_SUPPORTED: 'Pulse para ver el Espacio en realidad virtual con',
  13757. VR_SHOW_UNSUPPORTED: 'Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.',
  13758. VR_SHOW_IOS_1: 'Pulse para ver el Espacio en realidad virtual',
  13759. VR_SHOW_IOS_2: 'Necesita la aplicación port VR y un iPhone compatible para ver',
  13760. VR_WHAT_YOU_NEED: 'Lo que necesitaras...',
  13761. VR_NEED_CARDBOARD: 'Lo que necesitaras con Google Cardboard',
  13762. VR_NEED_SAMSUNG: 'Lo que necesitaras con el Samsung Gear VR',
  13763. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13764. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13765. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13766. VR_COMPATIBLE_IPHONES_2: 'Compatible con iPhone 6S o superior y con iOS 9.1 en adelante',
  13767. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  13768. VR_COMPATIBLE_ANDROID: 'Dispositivos Android compatibles',
  13769. VR_ANDROID_DETAIL: 'Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante',
  13770. VR_ANDROID_DVICES: 'Dispositivos Android',
  13771. VR_COMPATIBLE_SAMSUNG: 'Dispositivos compatibles del Samsung',
  13772. VR_SAMSUNG_DETAIL: 'Galaxy S5 en adelante',
  13773. VR_APP_FOR_CARDBOARD: 'Aplicación port VR para Google Cardboard',
  13774. VR_APP_FOR_SAMSUNG: 'Aplicación port VR para Gear VR',
  13775. VR_DOWNLOAD_HERE: 'Descargar aquí',
  13776. VR_REQUIRE_HEADSET: 'Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android',
  13777. VR_REDIRECT_TO_STORE: 'Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.',
  13778. VR_IMPROPER_EMBED: 'El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.',
  13779. VR_OPEN_ANDROID_LINK: 'Abre el enlace en tu teléfono móvil',
  13780. VR_ANDROID_OPTIONS: 'Opciones de auriculares en RV disponibles',
  13781. SHARE_TO: 'Compartir en',
  13782. SHARE_LINK: 'Enlace directo',
  13783. SHARE_EXPLORE: 'Explorar ',
  13784. SHARE_AT: 'en',
  13785. SHARE_WITH: 'con',
  13786. SHARE_3D: ' en 3D',
  13787. SHARE_COPIED: '¡Copiado!',
  13788. ERROR_BROWSER_SOLUTION: 'Instale un nuevo navegador para explorar en 3D.',
  13789. ERROR_BROWSER_EXPLANATION: 'WebGL requiere un navegador moderno.',
  13790. ERROR_GENERIC_PROBLEM: 'Vaya, algo ha ido mal.',
  13791. ERROR_GENERIC_SOLUTION: 'Reinicie su navegador.',
  13792. ERROR_GENERIC_ACTIONS_1: 'Si el problema persiste, ',
  13793. ERROR_GENERIC_ACTIONS_2: 'instale un navegador compatible',
  13794. ERROR_GENERIC_ACTIONS_3: ' o ',
  13795. ERROR_GENERIC_ACTIONS_4: 'consulte nuestra guía de solución de problemas',
  13796. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navegador no compatible.',
  13797. ERROR_WEBGL_IOS_PROBLEM: 'Versión de iOS no compatible.',
  13798. ERROR_WEBGL_IOS_SOLUTION: 'Actualice a iOS 8 o superior para explorar en 3D.',
  13799. ERROR_WEBGL_IOS_ACTIONS_1: 'Pulse ',
  13800. ERROR_WEBGL_IOS_ACTIONS_2: 'Ajustes > General > Actualización de software',
  13801. ERROR_WEBGL_SAFARI_PROBLEM: 'Habilite WebGL para explorar en 3D.',
  13802. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Haga clic en ',
  13803. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Preferencias > Avanzado > Mostrar el menú Desarrollar',
  13804. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Después, haga clic en ',
  13805. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Desarrollar > Habilitar WebGL',
  13806. ERROR_MISSING_URLS_PROBLEM: 'Vaya, no hay panoramas para este modelo.',
  13807. ERROR_MISSING_URLS_EXPLANATION: 'Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.',
  13808. ERROR_LOADING_FAILED_PROBLEM: 'Vaya, modelo no disponible.',
  13809. ERROR_LOADING_FAILED_ACTIONS_1: 'Si el problema persiste, ',
  13810. ERROR_LOADING_FAILED_ACTIONS_2: 'consulte nuestra guía de solución de problemas',
  13811. ERROR_MAINTENANCE_PROBLEM: 'Mantenimiento en progreso.',
  13812. ERROR_MAINTENANCE_SOLUTION: 'Regrese en unos minutos.',
  13813. LINK_TO_LOCATION: 'Enlace a la ubicación',
  13814. MENU_COPY: 'Copiar',
  13815. LINK_ALERT_COPY: 'Utilice CTRL/CMD + C para copiar.',
  13816. ROTATE: 'Girar',
  13817. INSIDE: 'Interior',
  13818. MOVE: 'Moverse',
  13819. ZOOM: 'Acercar o alejar'
  13820. }
  13821. },
  13822. {}
  13823. ],
  13824. 113: [
  13825. function (e, t, i) {
  13826. 'use strict'
  13827. t.exports = {
  13828. PAGE_TITLE: '',
  13829. LOADING: 'Chargement',
  13830. PRESENTED_BY_CAPS: 'PRÉSENTÉ PAR',
  13831. POWERED_BY: 'alimenté par ',
  13832. POWERED_BY_CAPS: 'ALIMENTÉ PAR',
  13833. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13834. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13835. PRESENTED_BY: 'Présenté par ',
  13836. MORE: 'Plus ',
  13837. LESS: 'Moins ',
  13838. TAG_CONTENT: 'Contenu tag™',
  13839. SHOW: 'Montrer',
  13840. HIDE: 'Cacher',
  13841. DOLLHOUSE: 'Dollhouse',
  13842. FLOOR_PLAN: 'Plan de sol',
  13843. OPEN_HIGHLIGHTS: 'Ouvrir les faits saillants',
  13844. CLOSE_HIGHLIGHTS: 'Fermer',
  13845. PREVIOUS: 'Précédent',
  13846. PLAY: 'Lecture',
  13847. PAUSE: 'Pause',
  13848. NEXT: 'Suivant',
  13849. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13850. VIEW_DOLLHOUSE: 'Voir dollhouse',
  13851. SOCIAL_SHARING: 'Partager cet espace',
  13852. VIEW_IN_VR: 'Voir en VR',
  13853. VIEW_FULLSCREEN: 'Plein écran',
  13854. EXIT_FULLSCREEN: 'Fermer plein écran',
  13855. ZOOM_IN: 'Zoom avant',
  13856. ZOOM_OUT: 'Zoom arrière',
  13857. FLOOR_NAME: 'Étage ',
  13858. FLOOR_ALL: 'Tous',
  13859. TERMS: 'Mentions légales',
  13860. PORT_TERMS: 'port mentions légales',
  13861. TERMS_OF_USE: "Conditions d'utilisation",
  13862. TERMS_TEXT_FILE: 'terms-fr-FR.html',
  13863. CLOSE_TERMS: 'Fermer',
  13864. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13865. HELP: 'Aide',
  13866. HELP_NAVIGATION_TAB: 'Navigation',
  13867. HELP_MORE_HELP_TAB: 'Aide',
  13868. CLOSE: 'Fermer',
  13869. HELP_DESKTOP_PANORAMA_1A: 'Cliquez et faites glisser pour regarder autour de l’espace.',
  13870. HELP_DESKTOP_PANORAMA_2A: 'Cliquez sur les anneaux pour vous déplacer.',
  13871. HELP_DESKTOP_PANORAMA_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13872. HELP_DESKTOP_PANORAMA_1B: 'Ou utilisez les touches pour tourner.',
  13873. HELP_DESKTOP_PANORAMA_2B: 'Ou utilisez les touches pour avancer et reculer.',
  13874. HELP_DESKTOP_PANORAMA_3B: 'Ou utilisez les touches plus et moins pour zoomer.',
  13875. HELP_DESKTOP_360_2A: 'Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  13876. HELP_DESKTOP_360_2B: 'Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.',
  13877. HELP_DESKTOP_DOLLHOUSE_1A: 'Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.',
  13878. HELP_DESKTOP_DOLLHOUSE_2A: 'Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.',
  13879. HELP_DESKTOP_DOLLHOUSE_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13880. HELP_DESKTOP_DOLLHOUSE_1B: 'Ou utilisez les touches pour faire pivoter la vue Dollhouse.',
  13881. HELP_DESKTOP_FLOORPLAN_1A: 'Faites un clic droit pour changer la position du plan sur l’écran.',
  13882. HELP_DESKTOP_FLOORPLAN_2A: 'Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.',
  13883. HELP_DESKTOP_FLOORPLAN_3A: 'Utilisez la molette de votre souris pour zoomer.',
  13884. HELP_DESKTOP_FLOORPLAN_2B: 'Ou utilisez les touches pour faire pivoter à gauche ou à droite.',
  13885. HELP_DESKTOP_FLOORPLAN_3B: 'Ou utilisez les touches pour effectuer un zoom avant ou arrière.',
  13886. HELP_MOBILE_PANORAMA_1: 'Touchez et faites glisser pour regarder autour de l’espace.',
  13887. HELP_MOBILE_PANORAMA_2: 'Tapez sur les anneaux dans tout l’espace pour vous déplacer.',
  13888. HELP_MOBILE_3: 'Utilisez un geste de pincement pour zoomer avant/arrière.',
  13889. HELP_MOBILE_360_2: 'Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.',
  13890. HELP_MOBILE_DOLLHOUSE_1: 'Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.',
  13891. HELP_MOBILE_DOLLHOUSE_2: 'Touchez et faites glisser avec deux doigts pour positionner vue en coupe.',
  13892. HELP_MOBILE_FLOORPLAN_1: 'Touchez et faites glisser pour positionner le plan.',
  13893. HELP_MOBILE_FLOORPLAN_2: 'Touchez et faites glisser avec deux doigts pour faire pivoter le plan.',
  13894. HELP_MORE_HLR_A: 'Carrousel',
  13895. HELP_DESKTOP_MORE_HLR_B: 'Ouvrez pour naviguer dans l’espace en utilisant les vignettes.',
  13896. HELP_MORE_DOLLHOUSE_A: 'Vue en coupe',
  13897. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Cliquez pour afficher et faire pivoter l’espace entier en 3D.',
  13898. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Tapez pour afficher et faire pivoter l’espace entier en 3D.',
  13899. HELP_MORE_FLOORS_A: 'Sélecteur d’étage',
  13900. HELP_DESKTOP_MORE_FLOORS_B: 'Basculer entre les étages dans l’espace.',
  13901. HELP_MORE_TAG_A: 'tag™ Posts',
  13902. HELP_DESKTOP_MORE_TAG_B: 'Cliquez ou survolez pour obtenir des informations sur l’espace.',
  13903. HELP_MOBILE_MORE_TAG_B: 'Tapez pour obtenir des informations sur l’espace.',
  13904. HELP_MORE_ZOOM_A: 'Commandes de zoom',
  13905. HELP_DESKTOP_MORE_ZOOM_B: 'Utilisez votre clavier ou la molette de votre souris pour zoomer.',
  13906. HELP_MORE_TOUR_A: 'Commandes de la visite',
  13907. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13908. HELP_MORE_INSIDE_A: 'Vue intérieure',
  13909. HELP_DESKTOP_MORE_INSIDE_B: 'Cliquez pour explorer l’intérieur de l’espace.',
  13910. HELP_MOBILE_MORE_INSIDE_B: 'Tapez pour explorer l’intérieur de l’espace.',
  13911. HELP_MORE_VR_A: 'Mode RV',
  13912. HELP_DESKTOP_MORE_VR_B: 'Cliquez pour lancer l’espace en réalité virtuelle.',
  13913. HELP_MOBILE_MORE_VR_B: 'Tapez pour lancer l’espace en réalité virtuelle.',
  13914. HELP_MORE_360_A: 'Vues 360°',
  13915. HELP_DESKTOP_MORE_360_B: 'Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  13916. HELP_MOBILE_MORE_360_B: 'Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.',
  13917. HELP_MORE_FULLSCREEN_A: 'Plein écran',
  13918. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Voir 3D Showcase en plein écran.',
  13919. WEBVR_FOR_CARDBOARD: 'Pour Google Cardboard',
  13920. WEBVR_FOR_DAYDREAM: 'Pour Daydream View',
  13921. WEBVR_ENTER_WEBVR: 'ENTRER VR',
  13922. WEBVR_DIFFERENT_HEADSET: 'Avez-vous un casque différent?',
  13923. WEBVR_LEARN_MORE: 'En savoir plus',
  13924. WEBVR_VIEW_SPACE: 'Voir Espace en VR',
  13925. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  13926. WEBVR_DAYDREAM_PHONE: 'Téléphone compatibles Daydream',
  13927. WEBVR_VIEW_CARDBOARD: 'Ou Afficher sur Google Cardboard',
  13928. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13929. VR_LEARN_MORE_CAPS: 'EN SAVOIR PLUS',
  13930. VR_PREVIOUS_CAPS: 'PRÉCÉDENT',
  13931. VR_NEXT_CAPS: 'SUIVANT',
  13932. VR_GOT_IT_CAPS: 'BIEN COMPRIS',
  13933. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13934. VR_SHOW_UNSUPPORTED: 'Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.',
  13935. VR_SHOW_IOS_1: 'Taper pour voir l’Espace en Realité Virtuelle',
  13936. VR_SHOW_IOS_2: 'Nécessite l’application port VR et un iPhone compatible pour voir',
  13937. VR_WHAT_YOU_NEED: 'Ce dont vous aurez besoin pour...',
  13938. VR_NEED_CARDBOARD: 'Ce dont vous aurez besoin avec Google Cardboard',
  13939. VR_NEED_SAMSUNG: 'Ce dont vous aurez besoin avec Samsung Gear VR',
  13940. VR_NEED_DAYDREAM: 'BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW',
  13941. VR_NEED_DAYDREAM_PHONE: 'Téléphone compatible avec Daydream',
  13942. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  13943. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  13944. VR_APP: 'port VR App',
  13945. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  13946. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  13947. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s et plus récent, avec iOS 9.1 et plus récent',
  13948. VR_COMPATIBLE_IPHONES_3: 'iPhones compatibles',
  13949. VR_COMPATIBLE_ANDROID: 'Appareils Android compatibles',
  13950. 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',
  13951. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13952. VR_ANDROID_DVICES: 'Appareils Android',
  13953. VR_COMPATIBLE_SAMSUNG: 'Appareils Samsung Compatibles',
  13954. VR_SAMSUNG_DETAIL: 'Galaxy S6 et plus récents',
  13955. VR_APP_FOR_CARDBOARD: 'Application port VR pour Google Cardboard',
  13956. VR_APP_FOR_SAMSUNG: 'Application port VR pour Gear VR',
  13957. VR_APP_FOR_ANDROID: 'Application port VR pour téléphones Android',
  13958. VR_APP_OPEN: 'Ouvrir plutôt avec l’application port VR',
  13959. VR_DOWNLOAD_HERE: 'Télécharger ici',
  13960. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13961. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13962. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13963. VR_OPEN_ANDROID_LINK: 'Ouvrez ce lien avec votre appareil mobile',
  13964. VR_ANDROID_OPTIONS: 'Options disponibles pour casque VR sous',
  13965. SHARE_TO: 'Partager sur',
  13966. SHARE_LINK: 'Lien direct',
  13967. SHARE_EXPLORE: 'Explorer ',
  13968. SHARE_AT: 'à',
  13969. SHARE_WITH: 'avec',
  13970. SHARE_3D: ' en 3D',
  13971. SHARE_COPIED: 'Copié!',
  13972. ERROR_BROWSER_SOLUTION: 'Installer un nouveau navigateur pour explorer en 3D.',
  13973. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13974. ERROR_GENERIC_PROBLEM: 'Il y eu un problème.',
  13975. ERROR_GENERIC_SOLUTION: 'Redémarrer votre navigateur.',
  13976. ERROR_GENERIC_ACTIONS_1: 'Si le problème persiste, ',
  13977. ERROR_GENERIC_ACTIONS_2: 'installez un navigateur plus récent',
  13978. ERROR_GENERIC_ACTIONS_3: ' ou ',
  13979. ERROR_GENERIC_ACTIONS_4: 'voir notre guide de dépannage',
  13980. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Navigateur non-supporté.',
  13981. ERROR_WEBGL_IOS_PROBLEM: 'Version iOS non-supportée.',
  13982. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13983. ERROR_WEBGL_IOS_ACTIONS_1: 'Tapez ',
  13984. ERROR_WEBGL_IOS_ACTIONS_2: 'Paramètres > Général > Mise à jour Software',
  13985. ERROR_WEBGL_SAFARI_PROBLEM: 'Activez WegGL pour explorer en 3D.',
  13986. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Cliquez ',
  13987. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Préferences > Avancés > Voir menu développeur',
  13988. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Puis cliquez ',
  13989. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Développe > Activé WebGL',
  13990. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13991. ERROR_MISSING_URLS_EXPLANATION: 'Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.',
  13992. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13993. ERROR_LOADING_FAILED_ACTIONS_1: 'Si le problème persiste, ',
  13994. ERROR_LOADING_FAILED_ACTIONS_2: 'voir notre guide de dépannage',
  13995. ERROR_MAINTENANCE_PROBLEM: 'Maintenance en cours.',
  13996. ERROR_MAINTENANCE_SOLUTION: 'Revenez dans quelques instants.',
  13997. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13998. MENU_COPY: 'Copie',
  13999. LINK_ALERT_COPY: 'Utiliser CTRL+CMD C pour copier.',
  14000. ROTATE: 'Faire pivoter',
  14001. INSIDE: 'Intérieure',
  14002. MOVE: 'Se déplacer',
  14003. ZOOM: 'Zoom'
  14004. }
  14005. },
  14006. {}
  14007. ],
  14008. 114: [
  14009. function (e, t, i) {
  14010. 'use strict'
  14011. t.exports = {
  14012. PAGE_TITLE: '',
  14013. LOADING: '読み込み中',
  14014. PRESENTED_BY_CAPS: 'PRESENTED BY',
  14015. POWERED_BY: 'powered by',
  14016. POWERED_BY_CAPS: 'POWERED BY',
  14017. DESKTOP_SHORT_CTA: 'クリックしてこの3D Spaceを探索',
  14018. MOBILE_SHORT_CTA: 'タップしてこの3D Spaceを探索',
  14019. PRESENTED_BY: 'Presented by ',
  14020. MORE: '全て表示 ',
  14021. LESS: '閉じる ',
  14022. TAG_CONTENT: 'tag™コンテンツ ',
  14023. SHOW: '表示',
  14024. HIDE: '非表示',
  14025. DOLLHOUSE: 'ドールハウス',
  14026. FLOOR_PLAN: 'フロアプラン',
  14027. OPEN_HIGHLIGHTS: 'ハイライトを開く',
  14028. CLOSE_HIGHLIGHTS: '閉じる',
  14029. PREVIOUS: '前へ',
  14030. PLAY: '再生',
  14031. PAUSE: '一時停止',
  14032. NEXT: '次へ',
  14033. EXPLORE_3D_SPACE: '3DSpaceの探索',
  14034. VIEW_DOLLHOUSE: 'ドールハウスの表示',
  14035. SOCIAL_SHARING: 'このSpaceを共有する',
  14036. VIEW_IN_VR: 'VRで表示',
  14037. VIEW_FULLSCREEN: 'フルスクリーン表示',
  14038. EXIT_FULLSCREEN: 'フルスクリーン表示を終了',
  14039. ZOOM_IN: 'ズームイン',
  14040. ZOOM_OUT: 'ズームアウト',
  14041. FLOOR_NAME: 'フロア ',
  14042. FLOOR_ALL: 'すべて',
  14043. TERMS: '規約',
  14044. PORT_TERMS: 'port規約',
  14045. TERMS_OF_USE: '利用規約',
  14046. CLOSE_TERMS: '閉じる',
  14047. TERMS_TEXT_FILE: 'terms-jp-JP.html',
  14048. TERMS_FAIL: '規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。',
  14049. WEBVR_FOR_DAYDREAM: 'Daydream View用',
  14050. WEBVR_ENTER_WEBVR: 'VRに入る',
  14051. WEBVR_DIFFERENT_HEADSET: '別のヘッドセットをお持ちですか?',
  14052. WEBVR_LEARN_MORE: 'もっと詳しく',
  14053. WEBVR_VIEW_SPACE: 'VRでSpaceを表示',
  14054. WEBVR_DAYDREAM_VIEW: 'Daydream View',
  14055. WEBVR_DAYDREAM_PHONE: 'Daydream対応スマホ',
  14056. WEBVR_FOR_CARDBOARD: 'Google Cardboard用',
  14057. WEBVR_VIEW_CARDBOARD: 'またはGoogle Cardboardで表示',
  14058. VR_VIEW_SPACE: 'バーチャルリアリティでSpaceを表示',
  14059. VR_LEARN_MORE_CAPS: 'もっと詳しく',
  14060. VR_PREVIOUS_CAPS: '前へ',
  14061. VR_NEXT_CAPS: '次へ',
  14062. VR_GOT_IT_CAPS: '了解',
  14063. VR_SHOW_SUPPORTED: 'タップして次を使用してVRでSpaceを表示: ',
  14064. VR_SHOW_UNSUPPORTED: 'お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません',
  14065. VR_SHOW_IOS_1: 'タップしてVRでSpaceを表示',
  14066. VR_SHOW_IOS_2: '表示するにはport VRアプリと互換性のあるiPhoneが必要です',
  14067. VR_WHAT_YOU_NEED: '必要なもの',
  14068. VR_NEED_CARDBOARD: 'Google Cardboardに必要なもの',
  14069. VR_NEED_SAMSUNG: 'Samsung Gear VRに必要なもの',
  14070. VR_NEED_DAYDREAM: '事前にDaydream Viewとのペアリングが必要です',
  14071. VR_NEED_DAYDREAM_PHONE: 'Daydream対応スマホ',
  14072. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14073. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14074. VR_APP: 'port VRアプリ',
  14075. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14076. VR_COMPATIBLE_IPHONES_1: 'iPhone',
  14077. VR_COMPATIBLE_IPHONES_2: 'iOS 9.1以降で動作するiPhone 5s以降のモデル',
  14078. VR_COMPATIBLE_IPHONES_3: '互換性のあるiPhone',
  14079. VR_COMPATIBLE_ANDROID: '互換性のあるAndroidデバイス',
  14080. VR_COMPATIBLE_ANDROID_LONG: 'Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ',
  14081. VR_ANDROID_DETAIL: 'Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ',
  14082. VR_ANDROID_DVICES: 'Androidデバイス',
  14083. VR_COMPATIBLE_SAMSUNG: '互換性のあるSamsungデバイス',
  14084. VR_SAMSUNG_DETAIL: 'Galaxy S5以降のモデル',
  14085. VR_APP_FOR_CARDBOARD: 'Google Cardboard用のport VRアプリ',
  14086. VR_APP_FOR_SAMSUNG: 'Gear VR 用のport VRアプリ',
  14087. VR_APP_FOR_ANDROID: 'Androidフォン用のport VRアプリ',
  14088. VR_APP_OPEN: 'port VRアプリで開く',
  14089. VR_DOWNLOAD_HERE: 'ここからダウンロード',
  14090. VR_REQUIRE_HEADSET: 'Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります',
  14091. VR_REDIRECT_TO_STORE: 'アプリがインストールされていない場合、App Storeにリダイレクトされます',
  14092. VR_IMPROPER_EMBED: 'お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。',
  14093. VR_OPEN_ANDROID_LINK: 'お使いの携帯電話でリンクを開いてください',
  14094. VR_ANDROID_OPTIONS: '利用可能なVRヘッドセットオプション',
  14095. SHARE_TO: '共有先',
  14096. SHARE_LINK: 'ダイレクトリンク',
  14097. SHARE_EXPLORE: '探索',
  14098. SHARE_AT: '場所',
  14099. SHARE_WITH: '使用アプリ',
  14100. SHARE_3D: '3Dで',
  14101. SHARE_COPIED: 'コピーされました!',
  14102. ERROR_BROWSER_SOLUTION: '3D探索するには、新しいバージョンのブラウザをインストールしてください',
  14103. ERROR_BROWSER_EXPLANATION: 'WebGLにはモダンブラウザが必要です。',
  14104. ERROR_GENERIC_PROBLEM: '問題が発生しました。',
  14105. ERROR_GENERIC_SOLUTION: 'ブラウザを再起動してください。',
  14106. ERROR_GENERIC_ACTIONS_1: '問題が解決しない場合は、',
  14107. ERROR_GENERIC_ACTIONS_2: 'サポートされているブラウザをインストールしてください',
  14108. ERROR_GENERIC_ACTIONS_3: 'または',
  14109. ERROR_GENERIC_ACTIONS_4: 'トラブルシューティングガイドを参照してください',
  14110. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'ブラウザがサポートされていません。',
  14111. ERROR_WEBGL_IOS_PROBLEM: 'サポートされていないiOSバージョンです。',
  14112. ERROR_WEBGL_IOS_SOLUTION: '3D探索するには、iOS 8以降にアップグレードしてください。',
  14113. ERROR_WEBGL_IOS_ACTIONS_1: '以下の順にタップします:',
  14114. ERROR_WEBGL_IOS_ACTIONS_2: '設定 > 全般 > ソフトウェアの更新',
  14115. ERROR_WEBGL_SAFARI_PROBLEM: 'WebGLを有効にして3Dで探索します。',
  14116. ERROR_WEBGL_SAFARI_ACTIONS_1: '以下の順にクリックします:',
  14117. ERROR_WEBGL_SAFARI_ACTIONS_2: '環境設定 > 詳細 > メニューバーに開発メニューを表示',
  14118. ERROR_WEBGL_SAFARI_ACTIONS_3: 'その後、以下の順にクリックします:',
  14119. ERROR_WEBGL_SAFARI_ACTIONS_4: '開発 > WebGLを有効にする',
  14120. ERROR_MISSING_URLS_PROBLEM: 'このモデルではパノラマを使用できません。',
  14121. ERROR_MISSING_URLS_EXPLANATION: 'これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。',
  14122. ERROR_LOADING_FAILED_PROBLEM: 'モデルは利用できません。',
  14123. ERROR_LOADING_FAILED_ACTIONS_1: '問題が解決しない場合は、',
  14124. ERROR_LOADING_FAILED_ACTIONS_2: 'トラブルシューティングガイドを参照してください',
  14125. ERROR_MAINTENANCE_PROBLEM: 'メンテナンスは進行中です。',
  14126. ERROR_MAINTENANCE_SOLUTION: 'しばらくしてからやり直し てください。',
  14127. LINK_TO_LOCATION: 'ロケーションへのリンク',
  14128. MENU_COPY: 'コピー',
  14129. LINK_ALERT_COPY: 'コピーするにはCTRL/CMD + Cを使用してください。',
  14130. ROTATE: '回転',
  14131. MOVE: '移動',
  14132. INSIDE: '内側',
  14133. ZOOM: 'ズーム',
  14134. HELP: 'ヘルプ',
  14135. HELP_NAVIGATION_TAB: 'ナビゲーション',
  14136. HELP_MORE_HELP_TAB: 'その他のヘルプ',
  14137. HELP_DESKTOP_PANORAMA_1A: 'Spaceを見回すには、クリックしてドラッグします。',
  14138. HELP_DESKTOP_PANORAMA_2A: '移動するには、Space全体にあるリングをクリックします。',
  14139. HELP_DESKTOP_PANORAMA_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  14140. HELP_DESKTOP_PANORAMA_1B: 'または、矢印キーを使用して左右に向きを変えます。',
  14141. HELP_DESKTOP_PANORAMA_2B: 'または、矢印キーを使用して前後に向きを変えます。',
  14142. HELP_DESKTOP_PANORAMA_3B: 'あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。',
  14143. HELP_DESKTOP_360_2A: '内側ビューアイコンをクリックしてSpaceに入ります。',
  14144. HELP_DESKTOP_360_2B: 'または、数字キー1を押して内側ビューに入ります。',
  14145. HELP_DESKTOP_DOLLHOUSE_1A: '左クリックと左右、上下のドラッグでドールハウスを回転します。',
  14146. HELP_DESKTOP_DOLLHOUSE_2A: '右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。',
  14147. HELP_DESKTOP_DOLLHOUSE_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  14148. HELP_DESKTOP_DOLLHOUSE_1B: 'または、矢印キーを使用してドールハウスを回転します。',
  14149. HELP_DESKTOP_FLOORPLAN_1A: '左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。',
  14150. HELP_DESKTOP_FLOORPLAN_2A: '右ボタンを押しながら左右にドラッグして、フロアプランを回転します。',
  14151. HELP_DESKTOP_FLOORPLAN_3A: 'スクロールホイールを使用してズームイン、ズームアウトします。',
  14152. HELP_DESKTOP_FLOORPLAN_2B: 'または、矢印キーを使用して左右に回転します。',
  14153. HELP_DESKTOP_FLOORPLAN_3B: 'または、矢印キーを使用して、ズームイン、ズームアウトします。',
  14154. HELP_MOBILE_PANORAMA_1: 'Spaceを見回すには、タッチしてドラッグします。',
  14155. HELP_MOBILE_PANORAMA_2: '移動するには、Space全体にあるリングをタップします。',
  14156. HELP_MOBILE_3: 'ピンチジェスチャーを使用してズームイン、ズームアウトします。',
  14157. HELP_MOBILE_360_2: '内側ビューアイコンをタップしてSpaceに入ります。',
  14158. HELP_MOBILE_DOLLHOUSE_1: 'タッチして上下左右にドラッグしてドールハウスを回転します。',
  14159. HELP_MOBILE_DOLLHOUSE_2: 'タッチして、2本指でドラッグしてドールハウスを配置します。',
  14160. HELP_MOBILE_FLOORPLAN_1: 'タッチ&ドラッグしてフロアプランを配置します。',
  14161. HELP_MOBILE_FLOORPLAN_2: 'タッチして、2本指でドラッグしてフロアプランを回転します。',
  14162. HELP_MORE_HLR_A: 'ハイライト',
  14163. HELP_DESKTOP_MORE_HLR_B: 'サムネイル画像を使用してSpaceを移動するために開きます。',
  14164. HELP_MORE_DOLLHOUSE_A: 'ドールハウス',
  14165. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'クリックして3DでSpace全体のトップダウンビューを表示して回転します。',
  14166. HELP_MOBILE_MORE_DOLLHOUSE_B: 'タップして3DでSpace全体のトップダウンビューを表示して回転します。',
  14167. HELP_MORE_FLOORS_A: 'フロアセレクター',
  14168. HELP_DESKTOP_MORE_FLOORS_B: 'Space内のフロアを切り替えます。',
  14169. HELP_MORE_TAG_A: 'tag™ Posts',
  14170. HELP_DESKTOP_MORE_TAG_B: 'クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。',
  14171. HELP_MOBILE_MORE_TAG_B: 'タップするとSpace内の機能についての説明が表示されます。',
  14172. HELP_MORE_ZOOM_A: 'ズームコントロール',
  14173. HELP_DESKTOP_MORE_ZOOM_B: 'これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。',
  14174. HELP_MORE_TOUR_A: 'ツアーコントロール',
  14175. HELP_DESKTOP_MORE_TOUR_B: 'ガイド付きツアー中に再生、一時停止、前方・後方に移動します。',
  14176. HELP_MORE_INSIDE_A: '内側ビュー',
  14177. HELP_DESKTOP_MORE_INSIDE_B: 'クリックしてSpace内を探索します。',
  14178. HELP_MOBILE_MORE_INSIDE_B: 'タップしてSpace内を探索します。',
  14179. HELP_MORE_VR_A: 'VRモード',
  14180. HELP_DESKTOP_MORE_VR_B: 'クリックしてバーチャルリアリティでSpaceを起動します。',
  14181. HELP_MOBILE_MORE_VR_B: 'タップしてバーチャルリアリティでSpaceを起動します。',
  14182. HELP_MORE_360_A: '360° Views',
  14183. HELP_DESKTOP_MORE_360_B: 'Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。',
  14184. HELP_MOBILE_MORE_360_B: 'Highlight Reelの360° Viewsをタップして屋外シーンを表示します。',
  14185. HELP_MORE_FULLSCREEN_A: 'フルスクリーン',
  14186. HELP_DESKTOP_MORE_FULLSCREEN_B: '3D Showcaseをフルスクリーン表示にします。',
  14187. CLOSE: '閉じる'
  14188. }
  14189. },
  14190. {}
  14191. ],
  14192. 115: [
  14193. function (e, t, i) {
  14194. 'use strict'
  14195. t.exports = {
  14196. PAGE_TITLE: '',
  14197. LOADING: 'Загрузка',
  14198. PRESENTED_BY_CAPS: 'ПРЕДСТАВЛЕНО',
  14199. POWERED_BY: 'разработано на платформе ',
  14200. POWERED_BY_CAPS: 'РАЗРАБОТАНО НА ПЛАТФОРМЕ',
  14201. DESKTOP_SHORT_CTA: 'Нажмите для просмотра.',
  14202. MOBILE_SHORT_CTA: 'Нажмите для просмотра.',
  14203. PRESENTED_BY: 'Представлено ',
  14204. MORE: 'Больше ',
  14205. LESS: 'Меньше ',
  14206. TAG_CONTENT: 'tag™ Контент',
  14207. SHOW: 'Показать',
  14208. HIDE: 'Скрыть',
  14209. DOLLHOUSE: 'Dollhouse',
  14210. FLOOR_PLAN: 'Планировка',
  14211. OPEN_HIGHLIGHTS: 'Открыть Фотоколлаж',
  14212. CLOSE_HIGHLIGHTS: 'Закрыть',
  14213. PREVIOUS: 'Предыдущий',
  14214. PLAY: 'Воспроизвести',
  14215. PAUSE: 'Пауза',
  14216. NEXT: 'Следующий',
  14217. EXPLORE_3D_SPACE: 'Просмотреть 3D модель',
  14218. VIEW_DOLLHOUSE: 'Посмотреть Dollhouse',
  14219. SOCIAL_SHARING: 'Поделиться этой моделью',
  14220. VIEW_IN_VR: 'Посмотреть в VR',
  14221. VIEW_FULLSCREEN: 'Полный экран',
  14222. EXIT_FULLSCREEN: 'Выйти из полноэкранного режима',
  14223. ZOOM_IN: 'Увеличить',
  14224. ZOOM_OUT: 'Уменьшить',
  14225. FLOOR_NAME: 'Этаж ',
  14226. FLOOR_ALL: 'Все',
  14227. TERMS: 'Условия',
  14228. PORT_TERMS: 'Правила пользования',
  14229. TERMS_OF_USE: 'Условия использования',
  14230. TERMS_TEXT_FILE: 'terms-ru-RU.html',
  14231. CLOSE_TERMS: 'Закрыть',
  14232. TERMS_FAIL: 'Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.',
  14233. HELP: 'Помощь',
  14234. HELP_NAVIGATION_TAB: 'Навигация',
  14235. HELP_MORE_HELP_TAB: 'Доп. Помощь',
  14236. CLOSE: 'Закрыть',
  14237. HELP_DESKTOP_PANORAMA_1A: 'Нажмите и перетащите, чтобы осмотреть пространство вокруг.',
  14238. HELP_DESKTOP_PANORAMA_2A: 'Для передвижения по модели нажимайте на круги .',
  14239. HELP_DESKTOP_PANORAMA_3A: 'Используйте колесо прокрутки для увеличения и уменьшения.',
  14240. HELP_DESKTOP_PANORAMA_1B: 'Или используйте клавиши со стрелками для поворота влево и вправо.',
  14241. HELP_DESKTOP_PANORAMA_2B: 'Или используйте стрелки для перемещения вперед и назад.',
  14242. HELP_DESKTOP_PANORAMA_3B: 'Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.',
  14243. HELP_DESKTOP_360_2A: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  14244. HELP_DESKTOP_360_2B: 'или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.',
  14245. HELP_DESKTOP_DOLLHOUSE_1A: 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.',
  14246. HELP_DESKTOP_DOLLHOUSE_2A: 'Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.',
  14247. HELP_DESKTOP_DOLLHOUSE_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  14248. HELP_DESKTOP_DOLLHOUSE_1B: 'Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.',
  14249. HELP_DESKTOP_FLOORPLAN_1A: 'Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.',
  14250. HELP_DESKTOP_FLOORPLAN_2A: 'Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.',
  14251. HELP_DESKTOP_FLOORPLAN_3A: 'Используйте колесо прокрутки чтобы увеличить и уменьшить.',
  14252. HELP_DESKTOP_FLOORPLAN_2B: 'Или используйте клавиши со стрелками для поворота влево или вправо.',
  14253. HELP_DESKTOP_FLOORPLAN_3B: 'Или используйте стрелки для увеличения и уменьшения.',
  14254. HELP_MOBILE_PANORAMA_1: 'Нажмите и перетащите, чтобы осмотреть модель.',
  14255. HELP_MOBILE_PANORAMA_2: 'Для передвижения по модели нажимайте на круги.',
  14256. HELP_MOBILE_3: 'Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.',
  14257. HELP_MOBILE_360_2: 'Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.',
  14258. HELP_MOBILE_DOLLHOUSE_1: 'Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.',
  14259. HELP_MOBILE_DOLLHOUSE_2: 'Нажмите и перетащите, чтобы расположить Dollhouse.',
  14260. HELP_MOBILE_FLOORPLAN_1: 'Нажмите и перетащите, чтобы расположить план здания.',
  14261. HELP_MOBILE_FLOORPLAN_2: 'Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.',
  14262. HELP_MORE_HLR_A: 'Фотоколлаж',
  14263. HELP_DESKTOP_MORE_HLR_B: 'Откройте для перемещения по модели, используя иконки изображений.',
  14264. HELP_MORE_DOLLHOUSE_A: 'Dollhouse',
  14265. HELP_DESKTOP_MORE_DOLLHOUSE_B: 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  14266. HELP_MOBILE_MORE_DOLLHOUSE_B: 'Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.',
  14267. HELP_MORE_FLOORS_A: 'Выбор Этажа',
  14268. HELP_DESKTOP_MORE_FLOORS_B: 'Переключение между этажами.',
  14269. HELP_MORE_TAG_A: 'tag™ Posts',
  14270. HELP_DESKTOP_MORE_TAG_B: 'Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.',
  14271. HELP_MOBILE_MORE_TAG_B: 'Нажмите для получения информации о функциях.',
  14272. HELP_MORE_ZOOM_A: 'Масштаб',
  14273. HELP_DESKTOP_MORE_ZOOM_B: 'Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.',
  14274. HELP_MORE_TOUR_A: 'Управление Туром',
  14275. HELP_DESKTOP_MORE_TOUR_B: 'Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.',
  14276. HELP_MORE_INSIDE_A: 'Вид Изнутри',
  14277. HELP_DESKTOP_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  14278. HELP_MOBILE_MORE_INSIDE_B: 'Нажмите, чтобы просмотреть модель изнутри.',
  14279. HELP_MORE_VR_A: 'Режим VR',
  14280. HELP_DESKTOP_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  14281. HELP_MOBILE_MORE_VR_B: 'Нажмите, чтобы запустить модель в виртуальной реальности.',
  14282. HELP_MORE_360_A: '360° Views',
  14283. HELP_DESKTOP_MORE_360_B: 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  14284. HELP_MOBILE_MORE_360_B: 'Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.',
  14285. HELP_MORE_FULLSCREEN_A: 'Полный экран',
  14286. HELP_DESKTOP_MORE_FULLSCREEN_B: 'Развернуть 3D Showcase во весь экран.',
  14287. WEBVR_FOR_CARDBOARD: 'Для Google Cardboard',
  14288. WEBVR_FOR_DAYDREAM: 'Для просмотра в Daydream',
  14289. WEBVR_ENTER_WEBVR: 'ВОЙТИ В VR ',
  14290. WEBVR_DIFFERENT_HEADSET: 'Есть другой VR-шлем?',
  14291. WEBVR_LEARN_MORE: 'Узнать больше',
  14292. WEBVR_VIEW_SPACE: 'Запустить модель в VR',
  14293. WEBVR_DAYDREAM_VIEW: 'Посмотреть в Daydream',
  14294. WEBVR_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  14295. WEBVR_VIEW_CARDBOARD: 'Или просмотреть в Google Cardboard',
  14296. VR_WHAT_YOU_NEED: 'Что Вам потребуется...',
  14297. VR_NEED_DAYDREAM_PHONE: 'Daydream-готовый телефон',
  14298. VR_GOOGLE_DAYDREAM: 'Google Daydream',
  14299. VR_APP: 'port VR App',
  14300. VR_APP_OPEN: 'Или открыть через приложение port VR',
  14301. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  14302. VR_SAMSUNG_DETAIL: 'Galaxy S6 и выше',
  14303. VR_APP_FOR_ANDROID: 'Приложение port VR для Android',
  14304. VR_NEED_DAYDREAM: 'Необходимо для соединением с Daydream',
  14305. VR_VIEW_SPACE: 'Запустить модель в VR',
  14306. VR_LEARN_MORE_CAPS: 'УЗНАТЬ БОЛЬШЕ',
  14307. VR_PREVIOUS_CAPS: 'ПРЕДЫДУЩИЙ',
  14308. VR_NEXT_CAPS: 'СЛЕДУЮЩИЙ',
  14309. VR_GOT_IT_CAPS: 'ЯСНО',
  14310. VR_SHOW_SUPPORTED: 'Нажмите, чтобы просмотреть модель в VR с помощью',
  14311. VR_SHOW_UNSUPPORTED: 'Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.',
  14312. VR_SHOW_IOS_1: 'Нажмите, чтобы просмотреть модель в VR',
  14313. VR_SHOW_IOS_2: 'Для просмотра требуется приложение port VR и совместимый iPhone',
  14314. VR_NEED_CARDBOARD: 'Что Вам потребуется для Google Cardboard',
  14315. VR_NEED_SAMSUNG: 'Что Вам потребуется для Samsung Gear VR',
  14316. VR_GOOGLE_CARDBOARD: 'Google Cardboard',
  14317. VR_SAMSUNG_GEAR_VR: 'Samsung Gear VR',
  14318. VR_COMPATIBLE_IPHONES_1: 'iPhones',
  14319. VR_COMPATIBLE_IPHONES_2: 'iPhone 5s или новее с iOS 9.1 и выше',
  14320. VR_COMPATIBLE_IPHONES_3: 'Совместимые модели iPhone',
  14321. VR_COMPATIBLE_ANDROID: 'Совместимые Android устройства',
  14322. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  14323. VR_ANDROID_DVICES: 'Android устройства',
  14324. VR_COMPATIBLE_SAMSUNG: 'Совместимые Samsung устройства',
  14325. VR_APP_FOR_CARDBOARD: 'Приложение port VR для Google Cardboard',
  14326. VR_APP_FOR_SAMSUNG: 'Приложение port VR для Gear VR',
  14327. VR_DOWNLOAD_HERE: 'Скачать здесь',
  14328. VR_REQUIRE_HEADSET: 'Требуется VR-шлем и установленное приложение port VR для Android',
  14329. VR_REDIRECT_TO_STORE: 'Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.',
  14330. VR_IMPROPER_EMBED: 'port модель не встроена должным образом для поддержки VR в вашем веб-браузере.',
  14331. VR_OPEN_ANDROID_LINK: 'Откройте ссылку на Вашем мобильном телефоне',
  14332. VR_ANDROID_OPTIONS: 'Доступные опции VR-шлемов',
  14333. SHARE_TO: 'Поделиться',
  14334. SHARE_LINK: 'Прямая ссылка',
  14335. SHARE_EXPLORE: 'просмотреть',
  14336. SHARE_AT: 'на',
  14337. SHARE_WITH: 'с',
  14338. SHARE_3D: 'в 3D',
  14339. SHARE_COPIED: 'Скопировано!',
  14340. ERROR_BROWSER_SOLUTION: 'установите новый браузер, чтобы просмотреть 3D пространство.',
  14341. ERROR_BROWSER_EXPLANATION: 'WebGL требует современный браузер.',
  14342. ERROR_GENERIC_PROBLEM: 'Ой, что-то пошло не так.',
  14343. ERROR_GENERIC_SOLUTION: 'Перезапустите браузер.',
  14344. ERROR_GENERIC_ACTIONS_1: 'Если проблема не устранена, ',
  14345. ERROR_GENERIC_ACTIONS_2: 'установите поддерживаемый браузер',
  14346. ERROR_GENERIC_ACTIONS_3: ' или ',
  14347. ERROR_GENERIC_ACTIONS_4: 'смотрите наше руководство по устранению неполадок',
  14348. ERROR_WEBGL_UNSUPPORTED_PROBLEM: 'Браузер не поддерживается.',
  14349. ERROR_WEBGL_IOS_PROBLEM: 'iOS-версия не поддерживается.',
  14350. ERROR_WEBGL_IOS_SOLUTION: 'Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.',
  14351. ERROR_WEBGL_IOS_ACTIONS_1: 'Нажмите ',
  14352. ERROR_WEBGL_IOS_ACTIONS_2: 'Настройки > Общие > Обновление ПО',
  14353. ERROR_WEBGL_SAFARI_PROBLEM: 'Включите WebGL для 3D-просмотра.',
  14354. ERROR_WEBGL_SAFARI_ACTIONS_1: 'Нажмите ',
  14355. ERROR_WEBGL_SAFARI_ACTIONS_2: 'Настойки > Дополнения > Показывать меню “Разработка” в строке меню',
  14356. ERROR_WEBGL_SAFARI_ACTIONS_3: 'Затем нажмите ',
  14357. ERROR_WEBGL_SAFARI_ACTIONS_4: 'Разработка > Разрешить WebGL',
  14358. ERROR_MISSING_URLS_PROBLEM: 'Ой, для этой модели нет панорамы.',
  14359. ERROR_MISSING_URLS_EXPLANATION: 'Эта модель устарела. У владельца веб-сайта может быть новая модель.',
  14360. ERROR_LOADING_FAILED_PROBLEM: 'Ой, модель недоступна.',
  14361. ERROR_LOADING_FAILED_ACTIONS_1: 'Если проблема не устранена, ',
  14362. ERROR_LOADING_FAILED_ACTIONS_2: 'посмотрите наше руководство по устранению неполадок',
  14363. ERROR_MAINTENANCE_PROBLEM: 'Выполняется техническое обслуживание.',
  14364. ERROR_MAINTENANCE_SOLUTION: 'Пожалуйста, попробуйте снова через несколько минут.',
  14365. LINK_TO_LOCATION: 'Ссылка на местоположение',
  14366. MENU_COPY: 'Копировать',
  14367. LINK_ALERT_COPY: 'Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.',
  14368. ROTATE: 'Вращать',
  14369. MOVE: 'Передвигаться',
  14370. INSIDE: 'Вид изнутри',
  14371. ZOOM: 'Масштаб'
  14372. }
  14373. },
  14374. {}
  14375. ],
  14376. 116: [
  14377. function (e, t, i) {
  14378. //main.js
  14379. ;(function (t) {
  14380. 'use strict'
  14381. var modelProgressBase = 0.4
  14382. var progressUpdate = function (e) {
  14383. // 0 <= e <= 1
  14384. console.log('e1:' + e)
  14385. e = Math.round(modelProgressBase * e * 100)
  14386. console.log('e2:' + e)
  14387. var t = $('.progressbar')
  14388. t.find('.bar').css('width', e + '%')
  14389. t.find('.label').css('left', (t.width() * e) / 100 - 15 + 'px') //上面跟着的字的百分比
  14390. t.find('.perc').text(e + '%') //具体数字的百分比
  14391. }
  14392. $('#gui-loading').fadeIn(200)
  14393. progressUpdate(0.1)
  14394. var fileName = g_version ? 'modeldata.js' : 'someData.json'
  14395. $.ajax(g_Prefix + 'data/' + window.number + '/' + fileName + '?' + randomTime().getTime(), { dataType: 'json' })
  14396. .done(function (e) {
  14397. //改
  14398. var data = matcher(e)
  14399. data.files.templates[0] = g_Prefix + e.files.templates[0].replace('{{number}}', window.number)
  14400. data.user = {
  14401. is_authenticated: false,
  14402. flags: [
  14403. 'payment_show_past_due',
  14404. 'sc_imgopt_100',
  14405. 'mattertags',
  14406. 'labels',
  14407. 'fastly_v2_urls',
  14408. 'vr',
  14409. 'uhql',
  14410. 'sc_segment_100',
  14411. 'show_segment_metrics',
  14412. 'content_distribution',
  14413. 'workshop_webgl',
  14414. 'show360views',
  14415. 'showcase_vr',
  14416. 'ws_zooming',
  14417. 'model_settings',
  14418. 'ws_360snapshots',
  14419. 'img_multi_dl',
  14420. 'vrworkshop',
  14421. 'tag_links',
  14422. 'ws_img_multi_dl',
  14423. 'mattertag_links',
  14424. 'billing_tab_hidden',
  14425. 'static_cloud_ui',
  14426. 'metrics',
  14427. 'mattertag_media',
  14428. 'img_size_download',
  14429. 'show_360snapshots',
  14430. 'floorplan',
  14431. 'sc_tilegen_0',
  14432. 'showcase_webvr',
  14433. 'sc_mixpanel_0',
  14434. 'show_clickbait',
  14435. 'zooming',
  14436. 'showcase_tiling',
  14437. 'list_signed_urls_default_3',
  14438. 'fastly_image_opto'
  14439. ]
  14440. }
  14441. try {
  14442. //处理一下导览数据
  14443. data.model.images = data.model.images.filter(e => {
  14444. if (!e.locations && !e.thumbnail_signed_src) return //旧的曾有导览数据是错误的,将它删除
  14445. if (e.locations && e.locations.length == 0) return
  14446. return e
  14447. })
  14448. } catch (e) {
  14449. console.log(e)
  14450. }
  14451. window.DATA = data
  14452. data.model.summary = data.summary
  14453. data.model.name = data.name
  14454. for (let i in data) {
  14455. data[i] == 'false' && (data[i] = false)
  14456. }
  14457. progressUpdate(0.7)
  14458. StartLoad() //xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14459. if (data.weixinDesc) {
  14460. g_weixinObj.desc = data.weixinDesc
  14461. }
  14462. if (data.shareImgUrl) {
  14463. g_weixinObj.imgUrl = data.shareImgUrl
  14464. }
  14465. window.wx && manage.weixinShare()
  14466. //初始画面
  14467. data.camera_start && data.camera_start.thumbImg && E(manage.dealURL(data.camera_start.thumbImg))
  14468. function E(e) {
  14469. $('<img/>')
  14470. .attr('src', e)
  14471. .on('load', function () {
  14472. $('#gui-thumb')
  14473. .css('backgroundImage', 'url(' + e + ')')
  14474. .fadeIn(500),
  14475. $(this).remove()
  14476. })
  14477. }
  14478. //背景
  14479. ;(settings.transparentBg = settings.transparentBg || data.transparentBg || false), (settings.bgImg = settings.bgImg || data.bgImg || null)
  14480. if (settings.bgImg) {
  14481. $('#player').css({
  14482. 'background-image': 'url(' + settings.bgImg + ')',
  14483. 'background-position': 'center center'
  14484. })
  14485. }
  14486. {
  14487. //初始化导览时间
  14488. if (DATA.tourBlackSpeed == void 0) DATA.tourBlackSpeed = 100
  14489. window._settings.warp.teleportTime = (settings.teleportTime / DATA.tourBlackSpeed) * 100
  14490. if (DATA.tourWalkSpeed == void 0) DATA.tourWalkSpeed = 100
  14491. if (DATA.tourRotTime == '' || DATA.tourRotTime == void 0) {
  14492. DATA.tourRotTime = settings.tourRotTime //默认停留2秒
  14493. }
  14494. }
  14495. {
  14496. //其他
  14497. _settings.floorPlanAngle = DATA.floorPlanAngle || 0
  14498. }
  14499. })
  14500. .fail(e => {
  14501. alert('缺少someData文件,请检查场景码是否正确。')
  14502. })
  14503. function StartLoad() {
  14504. //当加载完data后
  14505. function i() {
  14506. var e = window.number //Y.getModelIDFromQueryString();
  14507. if (!e) return b(null, 'loading-failed')
  14508. var t = Y.parseSidUrl(e),
  14509. i = l(),
  14510. a = c(),
  14511. s = o(),
  14512. u = V.quickstart.enabled,
  14513. g = null,
  14514. m = null,
  14515. v = null,
  14516. w = null,
  14517. T = null,
  14518. x = null,
  14519. S = null,
  14520. M = null,
  14521. R = null,
  14522. P = null,
  14523. O = null,
  14524. L = null,
  14525. N = new ue()
  14526. r(s)
  14527. h({
  14528. //MP开头写法
  14529. urlBase: t.urlBase
  14530. })
  14531. .then(function () {
  14532. return re.init(), d(t, e) //getModel and load
  14533. })
  14534. .then(function (e) {
  14535. progressUpdate(0.9)
  14536. return (
  14537. (P = e),
  14538. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14539. startSource: i,
  14540. autoplay: V.autoplay,
  14541. quickstart: u
  14542. }),
  14543. P.urls.init()
  14544. )
  14545. })
  14546. .then(function () {
  14547. return P.loadPanos()
  14548. })
  14549. .then(function () {
  14550. ;(m = X.getStartCameraOptions(P, P.panos)),
  14551. (S = A(P)),
  14552. (O = y(u, m.mode)),
  14553. (v = O.controls),
  14554. (w = O.player),
  14555. (T = O.director),
  14556. (x = O.tagManager),
  14557. (M = O.tileDownloader),
  14558. (R = O.qualityManager),
  14559. (L = O.panoRenderer),
  14560. C(P, S, O, s),
  14561. (w.director = T), //xzw add
  14562. P.supportsTiles && M.start(),
  14563. !u || (m.mode === D.PANORAMA && m.pano) || (de.warn('Tried to quickstart, but failed as we are not starting in inside mode.'), (u = !1))
  14564. var e = null
  14565. if (u) {
  14566. de.warn('Quickstart engaged. Hold on to your knickers.')
  14567. var t = v.controls[D.PANORAMA]
  14568. ;(g = new ie(R, S.scene, S.camera, t, s)),
  14569. _(S, s, P),
  14570. (e = g.load(m).then(function () {
  14571. S.addComponent(g),
  14572. S.once(le.AfterRender, function () {
  14573. de.warn('First render after quickstart load finished.')
  14574. })
  14575. }))
  14576. }
  14577. window.flyToFirst = function () {
  14578. //xzw add
  14579. var pano = w.model.panos.get('8d778e19657f433fb9cf8947d823bb70')
  14580. var q = new _x.Quaternion(0.7099827027821568, -0.07708150183830938, 0.6958985789714591, 0.07555241737970636)
  14581. var lookAtPoint = new _x.Vector3(0, 0, -1).applyQuaternion(q).add(pano.position)
  14582. w.flyToPano({ pano: pano, lookAtPoint: lookAtPoint })
  14583. }
  14584. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14585. })
  14586. .then(function () {
  14587. return f(P, U.onProgress, i, !u, a)
  14588. })
  14589. .then(function () {
  14590. if (
  14591. ((m.quickstart = u),
  14592. I(P, S, O, s),
  14593. S.started || _(S, s, P),
  14594. H.modelLoaded(P, w, v, V.autoplay),
  14595. E(w, P, m, V.autoplay).done(function () {
  14596. T.autoTour()
  14597. }),
  14598. !P.supportsTiles)
  14599. ) {
  14600. var e = new Z(P, w)
  14601. e.start()
  14602. }
  14603. u && (S.removeComponent(g), g.destroy(), m.pano.enter()),
  14604. U.init(P, T, w, v, S, m, H.getSessionId()),
  14605. U.endLoading(P, T, x),
  14606. S.once(le.AfterRender, function () {
  14607. N.setAppReadyTime()
  14608. var e = N.calcFullLoadingTime()
  14609. de.warn('Total load time: ' + e / 1e3), H.loadComplete(e), de.warn('First render after model load finished.')
  14610. try {
  14611. window.evt && window.dispatchEvent(window.evt)
  14612. parent.postMessage(
  14613. {
  14614. cmd: 'loaded'
  14615. },
  14616. '*'
  14617. )
  14618. } catch (err) {}
  14619. }),
  14620. S.on(le.MemoryUsageUpdated, n)
  14621. })
  14622. .fail(b.bind(this, e))
  14623. }
  14624. function n(e) {
  14625. ce.update(e)
  14626. }
  14627. function r(e) {
  14628. de.info('Version', '2.25.6-0-gd87e5b1'), (q.defaultMaxListeners = 1e3), a(e), s()
  14629. }
  14630. function o() {
  14631. return document.getElementById('player')
  14632. }
  14633. function a(e) {
  14634. e.addEventListener('dragenter', T, !1), e.addEventListener('dragover', T, !1)
  14635. }
  14636. function s() {
  14637. F.valueFromHash('title', !0) ||
  14638. $(document).ready(function () {
  14639. var e = $('.model-title')
  14640. e.hide()
  14641. })
  14642. }
  14643. function l() {
  14644. return F.valueFromHash('play', !1) ? 'autoplay' : F.inIframe() ? 'click' : 'fullpage'
  14645. }
  14646. function c() {
  14647. return {
  14648. panoElementsToLoad: 6,
  14649. modelElementsToLoad: 0,
  14650. totalElementsLoaded: 0,
  14651. totalElementsToLoad: 0,
  14652. totalPercentageLoaded: 0,
  14653. progressCallback: null
  14654. }
  14655. }
  14656. function h(e) {
  14657. return K.loadFeatureFlags(e).done(function (e) {
  14658. K.updateDependentSettings(e, V)
  14659. })
  14660. }
  14661. // function u(e) {
  14662. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14663. // responseType: "json",
  14664. // prefetchFrom: "config"
  14665. // }).then(function(e) {
  14666. // return e ? void j.extendObject(V.appConfig, e) : {}
  14667. // }, function(e) {
  14668. // return de.warn("Failed loading runtime config, using defaults."),
  14669. // $.when({})
  14670. // })
  14671. // }
  14672. function d(e, t) {
  14673. var i = B.getModel({
  14674. url: t,
  14675. floors: F.valueFromHash('f', !0),
  14676. autoload: !1
  14677. })
  14678. return $.when(i, n).then(null, function (e) {
  14679. return this
  14680. })
  14681. }
  14682. function p(e, t, i, n, r) {
  14683. de.info('Model data loaded'),
  14684. de.debug('UUID: ' + e.data.job.uuid),
  14685. J.init(K.getFlags()),
  14686. i &&
  14687. H.initKeen({
  14688. token: i,
  14689. appId: n
  14690. }),
  14691. H.initSegment({
  14692. model: e.sid,
  14693. version: '2.25.6-0-gd87e5b1',
  14694. startSource: r.startSource,
  14695. token: t,
  14696. autoplay: r.autoplay,
  14697. quickstart: r.quickstart
  14698. })
  14699. }
  14700. function f(e, t, i, n, r) {
  14701. return (r.progressCallback = t), H.sessionStart(), e.load(n).progress(g.bind(this, r))
  14702. }
  14703. function g(e, t) {
  14704. ;(e.modelElementsToLoad = t[1]), v(e), m(e)
  14705. }
  14706. function m(e) {
  14707. e.totalElementsLoaded++,
  14708. (e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad),
  14709. //----许钟文-----------------模型进度条向后调整
  14710. isNaN(e.totalPercentageLoaded) && (e.totalPercentageLoaded = 0)
  14711. e.totalPercentageLoaded = modelProgressBase + (1 - modelProgressBase) * e.totalPercentageLoaded
  14712. //console.log('pro:'+e.totalPercentageLoaded)
  14713. //---------------------------
  14714. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14715. }
  14716. function v(e) {
  14717. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14718. }
  14719. function A(e) {
  14720. var t = new x.PerspectiveCamera()
  14721. t.layers.enable(he.PANOMARKERS), t.layers.enable(he.RETICULE), t.layers.enable(he.TAG)
  14722. var i = new x.Scene(),
  14723. n = new x.AmbientLight(16777215)
  14724. i.add(n),
  14725. (i.plane = new x.Mesh(
  14726. new x.PlaneBufferGeometry(1e5, 1e5),
  14727. new x.RawShaderMaterial({
  14728. side: x.DoubleSide
  14729. })
  14730. )),
  14731. (i.plane.position.y = 0),
  14732. i.plane.rotateX(-Math.PI / 2),
  14733. (i.plane.material.visible = !1),
  14734. i.add(i.plane),
  14735. i.updateMatrixWorld(),
  14736. V.showScreenshotLocations &&
  14737. e.data.images.forEach(function (e) {
  14738. if (e.metadata && e.metadata.camera_position) {
  14739. var t = e.metadata.camera_position,
  14740. n = new x.Mesh(new x.BoxGeometry(0.3, 0.3, 0.3))
  14741. ;(n.position = t.clone()), i.add(n)
  14742. var r = e.metadata.camera_quaternion,
  14743. o = new x.Vector3(0, 0, -1).applyQuaternion(r)
  14744. i.add(new x.ArrowHelper(o, t.clone(), 1, 16711680))
  14745. }
  14746. }),
  14747. V.showAxis &&
  14748. (i.add(new x.ArrowHelper(new x.Vector3(0, 1, 0), new x.Vector3(0, 0, 0), 1, 255)),
  14749. i.add(new x.ArrowHelper(new x.Vector3(0, 0, 1), new x.Vector3(0, 0, 0), 1, 16711680)),
  14750. i.add(new x.ArrowHelper(new x.Vector3(1, 0, 0), new x.Vector3(0, 0, 0), 1, 65280)))
  14751. //背景
  14752. if (!settings.transparentBg && !settings.bgImg) {
  14753. i.skybox = new W()
  14754. i.add(i.skybox)
  14755. }
  14756. var r = new te(i, t, z)
  14757. return r
  14758. }
  14759. function y(e, t) {
  14760. var i = e ? 1 : 1e3,
  14761. n = J.tilegen || J.imgopt ? 6 : 2
  14762. n = F.valueFromHash('tileconc', n)
  14763. var r = new ne(),
  14764. o = new ae({
  14765. concurrentDownloads: n
  14766. }),
  14767. a = new se(),
  14768. s = new P(),
  14769. l = new M(),
  14770. c = new S(t),
  14771. h = new R(),
  14772. u = new O(i),
  14773. d = new L(),
  14774. p = new oe()
  14775. return {
  14776. qualityManager: r,
  14777. panoRenderer: a,
  14778. tileDownloader: o,
  14779. player: c,
  14780. director: l,
  14781. modelManager: s,
  14782. tagManager: p,
  14783. displayController: u,
  14784. labelDisplayController: d,
  14785. controls: h
  14786. }
  14787. }
  14788. function C(e, t, i, n) {
  14789. var r = i.controls,
  14790. o = i.qualityManager,
  14791. a = i.panoRenderer,
  14792. s = i.tileDownloader,
  14793. l = i.modelManager
  14794. r.init(n, l), ee.init(i.director, r, i.player, l, t), o.init(l), s.init(o), a.init(t, s, o), l.init(s, a, o), l.addModel(e), t.addComponent(G)
  14795. }
  14796. function I(e, t, i, n) {
  14797. var r = i.qualityManager,
  14798. o = i.panoRenderer,
  14799. a = i.tileDownloader,
  14800. s = i.modelManager,
  14801. l = i.player,
  14802. c = i.director,
  14803. h = i.tagManager,
  14804. u = i.displayController,
  14805. d = i.labelDisplayController,
  14806. p = i.controls
  14807. t.scene.add(e), (t.qualityManager = r)
  14808. var f = {
  14809. camera: t.camera,
  14810. director: c,
  14811. modelManager: s,
  14812. tileDownloader: a,
  14813. panoRenderer: o,
  14814. qualityManager: r,
  14815. tagManager: h,
  14816. container: n,
  14817. controls: p
  14818. }
  14819. l.init(f),
  14820. l.setScene(t.scene),
  14821. h.init(s, l),
  14822. c.init(l, s),
  14823. u.init(c, l, s, h, n),
  14824. d.init(l, s, n),
  14825. z.bindEvents(l),
  14826. t.addComponent(h),
  14827. t.addComponent(l),
  14828. t.addComponent(o),
  14829. (l.sceneRenderer = t) //xzw add 方便resize
  14830. }
  14831. function E(e, t, i, n) {
  14832. return de.info('Starting player in ' + i.mode), H.report(t.sid, 'started-playing', n, i.quickstart), e.start(i)
  14833. }
  14834. function b(e, t) {
  14835. de.error(t), k.error(t), H.report(e, 'error-' + t)
  14836. }
  14837. function w(e) {
  14838. var t = F.details()
  14839. t && 'Safari' === t.name && t.version > 500 && t.version < 600
  14840. ? (k.error('webgl-safari'), H.report(e, 'error-webgl-safari'))
  14841. : (k.error('webgl-generic'), H.report(e, 'error-webgl-generic'))
  14842. }
  14843. function _(e, t, i) {
  14844. try {
  14845. e.start(t)
  14846. } catch (e) {
  14847. throw (de.warn(e.message), w(i.sid), e)
  14848. }
  14849. }
  14850. function T(e) {
  14851. e.stopPropagation(), e.preventDefault()
  14852. }
  14853. //czj 判断someData 有没有hoticon字段 修改热点的样式
  14854. if (window.DATA.hoticon) {
  14855. g_HotImage = {
  14856. point: window.DATA.hoticon.default || 'https://super.4dage.com/images/4dagePoint2.png',
  14857. point2: window.DATA.hoticon.higt || 'https://super.4dage.com/images/4dagePoint.png'
  14858. }
  14859. }
  14860. //czj 判断someData 有没有backgroundMusic 添加音乐
  14861. if (window.DATA.backgroundMusic) {
  14862. if (window.isLocal) {
  14863. SoundManager.setSrc('bgm', manage.dealURL(window.DATA.backgroundMusic))
  14864. } else {
  14865. SoundManager.setSrc('bgm', window.DATA.backgroundMusic)
  14866. }
  14867. $('#volume').show()
  14868. } else if (g_version === 'one') {
  14869. SoundManager.setSrc('bgm', manage.dealURL(g_Prefix + '/audio/' + 'audio' + window.number + '/background.mp3'))
  14870. $('#volume').show()
  14871. }
  14872. //隐藏公司logo
  14873. if (window.DATA.loadlogo) {
  14874. showLogo()
  14875. }
  14876. e('./lib/three75-shim'),
  14877. e('./lib/array-polyfill'),
  14878. e('./lib/performance-polyfill'),
  14879. e('./lib/shaders/CopyShader.js'),
  14880. e('./lib/shaders/HorizontalBlurShader.js'),
  14881. e('./lib/shaders/VerticalBlurShader.js'),
  14882. e('./lib/postprocessing/EffectComposer.js'),
  14883. e('./lib/postprocessing/RenderPass.js'),
  14884. e('./lib/postprocessing/MaskPass.js'),
  14885. e('./lib/postprocessing/ShaderPass.js'),
  14886. window.Promise || (window.Promise = e('promise-polyfill'))
  14887. var x = e('three'),
  14888. _x = e('three'),
  14889. S = (e('./util/sentry'), e('./player')),
  14890. M = e('./director'),
  14891. R = e('./controls/CameraControls'),
  14892. P = e('./model/ModelManager'),
  14893. O = e('./DisplayController'),
  14894. L = e('./label/LabelDisplayController'),
  14895. D = e('./enum/Viewmode'),
  14896. N = e('./util/logger'),
  14897. B = e('./showcase'),
  14898. F = e('./util/browser'),
  14899. V = e('./settings'),
  14900. U = e('./gui/gui'),
  14901. k = e('./gui/error'),
  14902. H = e('./analytics'),
  14903. G = e('./util/transitions'),
  14904. z = e('./effects'),
  14905. W = e('./objects/Skybox'),
  14906. j = e('./util/common'),
  14907. Y = (e('./util/PanoramaCollection'), e('./util/math'), e('./util/showcase')),
  14908. X = e('./util/camera'),
  14909. Z = (e('./objects/Panorama'), e('./cameras/PanoramaCamera'), e('./preloaders')),
  14910. q = e('events').EventEmitter,
  14911. K = e('./featureflags'),
  14912. Q = (e('./util/lerp'), e('./util/ajax')),
  14913. J = e('./ab'),
  14914. ee = e('./sdk/automation.js'),
  14915. te = e('./scene/SceneRenderer'),
  14916. ie = e('./scene/QuickstartManager'),
  14917. ne = e('./tile/QualityManager.js'),
  14918. re = e('./localization/localize'),
  14919. oe = e('./tag/tagManager'),
  14920. ae = e('./tile/TileDownloader'),
  14921. se = e('./tile/PanoRenderer'),
  14922. le = (e('./enum/PanoSizeClass'), e('./enum/PanoramaEvents'), e('./enum/SceneRendererEvents')),
  14923. ce = e('./gui/memoryUsage'),
  14924. he = e('./enum/RenderLayers'),
  14925. ue = e('./TimingData'),
  14926. de = new N(t)
  14927. ;(N.level = V.logLevel), (N.consoleEnabled = V.console), i()
  14928. }
  14929. }).call(this, '/js/main.js')
  14930. },
  14931. {
  14932. './DisplayController': 1,
  14933. './TimingData': 2,
  14934. './ab': 3,
  14935. './analytics': 4,
  14936. './cameras/PanoramaCamera': 7,
  14937. './controls/CameraControls': 9,
  14938. './director': 15,
  14939. './effects': 16,
  14940. './enum/PanoSizeClass': 36,
  14941. './enum/PanoramaEvents': 37,
  14942. './enum/RenderLayers': 41,
  14943. './enum/SceneRendererEvents': 43,
  14944. './enum/Viewmode': 51,
  14945. './featureflags': 59,
  14946. './gui/error': 64,
  14947. './gui/gui': 65,
  14948. './gui/memoryUsage': 73,
  14949. './label/LabelDisplayController': 91,
  14950. './lib/array-polyfill': 92,
  14951. './lib/performance-polyfill': 95,
  14952. './lib/postprocessing/EffectComposer.js': 96,
  14953. './lib/postprocessing/MaskPass.js': 97,
  14954. './lib/postprocessing/RenderPass.js': 98,
  14955. './lib/postprocessing/ShaderPass.js': 99,
  14956. './lib/shaders/CopyShader.js': 100,
  14957. './lib/shaders/HorizontalBlurShader.js': 101,
  14958. './lib/shaders/VerticalBlurShader.js': 102,
  14959. './lib/three75-shim': 103,
  14960. './localization/localize': 108,
  14961. './tag/tagManager': 124,
  14962. './model/ModelManager': 140,
  14963. './objects/Panorama': 148,
  14964. './objects/Skybox': 152,
  14965. './player': 155,
  14966. './preloaders': 156,
  14967. './scene/QuickstartManager': 157,
  14968. './scene/SceneRenderer': 158,
  14969. './sdk/automation.js': 164,
  14970. './settings': 166,
  14971. './showcase': 168,
  14972. './tile/PanoRenderer': 169,
  14973. './tile/QualityManager.js': 170,
  14974. './tile/TileDownloader': 171,
  14975. './util/PanoramaCollection': 178,
  14976. './util/ajax': 181,
  14977. './util/browser': 182,
  14978. './util/camera': 183,
  14979. './util/common': 185,
  14980. './util/lerp': 188,
  14981. './util/logger': 189,
  14982. './util/math': 190,
  14983. './util/sentry': 192,
  14984. './util/showcase': 193,
  14985. './util/transitions': 195,
  14986. events: 202,
  14987. 'promise-polyfill': 213,
  14988. three: 217
  14989. }
  14990. ],
  14991. 117: [
  14992. function (e, t, i) {
  14993. 'use strict'
  14994. function n(e) {
  14995. e = e || {}
  14996. r.RawShaderMaterial.call(
  14997. this,
  14998. a.extendObject(
  14999. {
  15000. fragmentShader: o.cube.fragmentShader,
  15001. vertexShader: o.cube.vertexShader,
  15002. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  15003. name: 'CubemapMaterial'
  15004. },
  15005. e
  15006. )
  15007. )
  15008. }
  15009. var r = e('three'),
  15010. o = e('../shaders'),
  15011. a = e('../util/common')
  15012. ;(n.prototype = Object.create(r.RawShaderMaterial.prototype)), (n.prototype.constructor = n), (t.exports = n)
  15013. },
  15014. {
  15015. '../shaders': 167,
  15016. '../util/common': 185,
  15017. three: 217
  15018. }
  15019. ],
  15020. 118: [
  15021. function (e, t, i) {
  15022. 'use strict'
  15023. function n(e) {
  15024. e = e || {}
  15025. r.RawShaderMaterial.call(
  15026. this,
  15027. a.extendObject(
  15028. {
  15029. fragmentShader: o.model.fragmentShader,
  15030. vertexShader: o.model.vertexShader,
  15031. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  15032. name: 'ModelTextureMaterial'
  15033. },
  15034. e
  15035. )
  15036. )
  15037. }
  15038. var r = e('three'),
  15039. o = e('../shaders'),
  15040. a = e('../util/common')
  15041. ;(n.prototype = Object.create(r.RawShaderMaterial.prototype)),
  15042. (n.prototype.constructor = n),
  15043. (n.prototype.setProjectedPanos = function (e, t, i) {
  15044. i && (this.uniforms.progress.value = 0),
  15045. e.ensureSkyboxReadyForRender(),
  15046. (this.uniforms.pano0Map.value = e.getSkyboxTexture()),
  15047. this.uniforms.pano0Position.value.copy(e.position),
  15048. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  15049. t.ensureSkyboxReadyForRender(),
  15050. (this.uniforms.pano1Map.value = t.getSkyboxTexture()),
  15051. this.uniforms.pano1Position.value.copy(t.position),
  15052. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  15053. }),
  15054. /* n.prototype.setEyeDir = function(dir, pos) {//加
  15055. this.uniforms.eyeDir.value.copy(dir)
  15056. this.uniforms.eyePos.value.copy(pos)
  15057. }
  15058. n.prototype.setBendCameraQua = function(matrix) {//加
  15059. this.uniforms.cameraDeltaMatrix.value.copy(matrix)
  15060. } */
  15061. (t.exports = n)
  15062. },
  15063. {
  15064. '../shaders': 167,
  15065. '../util/common': 185,
  15066. three: 217
  15067. }
  15068. ],
  15069. 119: [
  15070. function (e, t, i) {
  15071. ;(function (i) {
  15072. 'use strict'
  15073. function n(e, t, i, n) {
  15074. ;(this.div = null),
  15075. (this.body = null),
  15076. (this.label = e),
  15077. (this.description = t),
  15078. (this.parsedDescription = []),
  15079. (this.media = i || {
  15080. type: null
  15081. }),
  15082. (this.loadingSpinner = null),
  15083. (this.parser = new r({
  15084. supportLinks: !u.valueFromHash('mls'),
  15085. keepLinkLabels: !0
  15086. })),
  15087. (this.state = I.CLOSED),
  15088. (this.orientation = ''),
  15089. (this.initialTransform = ''),
  15090. (this.hovering = !1),
  15091. (this.openTransition = null),
  15092. (this.closeTransition = null),
  15093. (this.openPromise = null),
  15094. (this.closePromise = null),
  15095. (this.animationTransition = null),
  15096. (this.animationScale = 0)
  15097. }
  15098. var r = e('../Parser/DescriptionParser'),
  15099. o = e('../Media/Link'),
  15100. a = e('../Media/Image'),
  15101. s = e('../Media/EmbedlyPlayer'),
  15102. l = e('../Media/EmbedlyEmbed'),
  15103. c = e('../../util/transitions'),
  15104. h = e('../../util/lerp'),
  15105. u = e('../../util/browser'),
  15106. d = e('./BillboardEvent'),
  15107. p = e('../Media/MediaEvent'),
  15108. f = e('../Parser/DescriptionChunkType'),
  15109. g = e('events').EventEmitter,
  15110. m = e('./billboardSettings'),
  15111. v = e('./overlaySettings'),
  15112. A = e('../../util/logger'),
  15113. y = new A(i),
  15114. C = document.getElementById('tag-billboards')
  15115. C.addEventListener('touchend', function (e) {
  15116. C.style.pointerEvents = 'none'
  15117. }),
  15118. C.addEventListener('touchcancel', function (e) {
  15119. C.style.pointerEvents = 'none'
  15120. })
  15121. var I = {
  15122. CLOSED: 'closed',
  15123. OPENING: 'opening',
  15124. OPEN: 'open',
  15125. CLOSING: 'closing',
  15126. ACTIVE: 'active'
  15127. }
  15128. ;(n.prototype = Object.create(g.prototype)),
  15129. (n.prototype.build = function (e) {
  15130. this.parsedDescription = this.parser.parse(this.description)
  15131. var t = document.createElement('div')
  15132. ;(t.className = 'tag-container has-hotzone'), (this.div = t), (this.body = document.createElement('div')), (this.body.className = 'tag-body')
  15133. var i = document.createElement('div')
  15134. i.classList.add('tag-content')
  15135. var n = document.createElement('div')
  15136. n.classList.add('tag-text-content')
  15137. var r = document.createElement('div')
  15138. ;(r.className = 'tag-label'), (r.textContent = this.label), n.appendChild(r)
  15139. var o = document.createElement('div')
  15140. ;(o.className = 'tag-desc'),
  15141. n.appendChild(o),
  15142. i.appendChild(n),
  15143. this.body.appendChild(i),
  15144. this.appendDescriptionElements(this.parsedDescription, o),
  15145. this.appendMedia(),
  15146. t.appendChild(this.body),
  15147. C.appendChild(t),
  15148. this.bindEvents(t, this.body)
  15149. }),
  15150. (n.prototype.bindEvents = function (e, t) {
  15151. var i = function (e) {
  15152. return function (t) {
  15153. if (!this.div.classList.contains('overlay')) {
  15154. var i,
  15155. n = document.getElementById('player')
  15156. try {
  15157. i = new MouseEvent(e, t)
  15158. } catch (n) {
  15159. ;(i = document.createEvent('MouseEvents')),
  15160. i.initMouseEvent(
  15161. e,
  15162. t.bubbles,
  15163. t.cancelable,
  15164. t.view,
  15165. t.detail,
  15166. t.screenX,
  15167. t.screenY,
  15168. t.clientX,
  15169. t.clientY,
  15170. t.ctrlKey,
  15171. t.altKey,
  15172. t.shiftKey,
  15173. t.metaKey,
  15174. t.button,
  15175. t.relatedTarget
  15176. )
  15177. }
  15178. n.dispatchEvent(i)
  15179. }
  15180. }
  15181. }
  15182. t.addEventListener('mousedown', function (e) {
  15183. e.stopPropagation()
  15184. }),
  15185. t.addEventListener('mouseup', function (e) {
  15186. e.stopPropagation()
  15187. }),
  15188. e.addEventListener('touchstart', function (e) {
  15189. C.style.pointerEvents = 'auto'
  15190. }),
  15191. e.addEventListener('mousedown', i('mousedown').bind(this)),
  15192. e.addEventListener('mouseup', i('mouseup').bind(this)),
  15193. t.addEventListener(
  15194. 'mouseover',
  15195. function (t) {
  15196. this.state === I.OPEN && e.classList.remove('has-hotzone')
  15197. }.bind(this)
  15198. ),
  15199. e.addEventListener(
  15200. 'mouseenter',
  15201. function (e) {
  15202. this.state !== I.CLOSING && ((this.hovering = !0), this.emit(d.ENTER))
  15203. }.bind(this)
  15204. ),
  15205. e.addEventListener(
  15206. 'mouseleave',
  15207. function (e) {
  15208. ;(this.hovering = !1), this.emit(d.LEAVE)
  15209. }.bind(this)
  15210. ),
  15211. e.addEventListener('gesturestart', function (e) {
  15212. e.preventDefault()
  15213. })
  15214. var n = e.querySelector('.tag-text-content'),
  15215. r = 0
  15216. n.addEventListener('touchstart', function (e) {
  15217. r = e.changedTouches[0].clientY
  15218. }),
  15219. n.addEventListener('touchmove', function (t) {
  15220. function i(e) {
  15221. e && ((0 === e.scrollTop && t.changedTouches[0].clientY > r) || (e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r)) && t.preventDefault()
  15222. }
  15223. return e.classList.contains('overlay') ? i(this.querySelector('.tag-desc')) : void i(this)
  15224. }),
  15225. e.addEventListener('touchmove', function (e) {
  15226. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  15227. })
  15228. }),
  15229. (n.prototype.appendDescriptionElements = function (e, t) {
  15230. e.length > 0 && this.div.classList.add('has-text'),
  15231. e.forEach(
  15232. function (e, i) {
  15233. switch (e.type) {
  15234. case f.TEXT:
  15235. t.appendChild(this.createTextElement(e.text))
  15236. break
  15237. case f.LINK:
  15238. t.appendChild(this.createLinkElement(e.link))
  15239. }
  15240. }.bind(this)
  15241. )
  15242. }),
  15243. (n.prototype.appendLoadingSpinner = function () {
  15244. ;(this.loadingSpinner = document.createElement('div')), this.loadingSpinner.classList.add('loading-spinner')
  15245. var e = document.createElement('div')
  15246. e.classList.add('gui-spinner-icon'), this.loadingSpinner.appendChild(e), this.body.appendChild(this.loadingSpinner)
  15247. }),
  15248. (n.prototype.onMediaLoadFinished = function () {
  15249. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner), this.applyOrientation(this.orientation), (this.loadingSpinner = null))
  15250. }),
  15251. (n.prototype.appendMedia = function () {
  15252. if (this.media && this.media.type && 'error' !== this.media.type && (!u.valueFromHash('mls', 0) || this.media.type === f.IMAGE)) {
  15253. this.appendLoadingSpinner()
  15254. var e = document.createElement('div')
  15255. e.classList.add('tag-media-content')
  15256. var t = document.createElement('i')
  15257. switch (
  15258. (['icon', 'icon-close-thin', 'close'].forEach(function (e) {
  15259. t.classList.add(e)
  15260. }),
  15261. this.body.appendChild(t),
  15262. this.body.appendChild(e),
  15263. this.media.type)
  15264. ) {
  15265. case f.IMAGE:
  15266. e.appendChild(this.createImageElement(this.media, this.body))
  15267. break
  15268. case f.VIDEO:
  15269. e.appendChild(this.createVideoElement(this.media, this.body))
  15270. break
  15271. case f.RICH:
  15272. e.appendChild(this.createEmbedElement(this.media, this.body))
  15273. }
  15274. }
  15275. }),
  15276. (n.prototype.createTextElement = function (e) {
  15277. var t = document.createElement('span')
  15278. return (t.textContent = e), t
  15279. })
  15280. ;(n.prototype.createLinkElement = function (e) {
  15281. var t = new o(e)
  15282. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)), t.createDomElement()
  15283. }),
  15284. (n.prototype.createImageElement = function (e, t) {
  15285. function i() {
  15286. function e() {
  15287. m ||
  15288. (r.classList.remove('view-image'),
  15289. c.classList.add('overlay'),
  15290. i(),
  15291. window.addEventListener('resize', b),
  15292. c.addEventListener('click', a),
  15293. g.addEventListener('click', l),
  15294. f.addEventListener('click', s),
  15295. (m = !0),
  15296. o.emit(p.IMAGE_OPENED))
  15297. }
  15298. function i() {
  15299. t.classList.add('show-info'), h.classList.remove('collapsible'), (h.style.height = '')
  15300. var e = parseFloat(getComputedStyle(I).lineHeight),
  15301. i = y + e,
  15302. r = c.clientWidth - 2 * v.boundaryWidth - C,
  15303. a = c.clientHeight - 2 * v.boundaryHeight - C - i,
  15304. s = a,
  15305. l = s * n.aspect
  15306. l > r && ((l = r), (s = l / n.aspect)),
  15307. s > a && ((s = a), (l = s * n.aspect)),
  15308. (l += C),
  15309. (s += C + i),
  15310. (t.style.width = l + 'px'),
  15311. (t.style.height = s + 'px'),
  15312. (u.style.paddingTop = e + C + 'px'),
  15313. o.description.length > 0 && (h.classList.add('collapsible'), (h.style.height = h.clientHeight + 12 + 'px'), (E.style.height = 'calc(100% - ' + I.clientHeight + 'px)'))
  15314. }
  15315. function a(e) {
  15316. e.target === c && s()
  15317. }
  15318. function s() {
  15319. m &&
  15320. ((m = !1),
  15321. r.classList.add('view-image'),
  15322. c.classList.remove('overlay'),
  15323. (h.style.height = ''),
  15324. (u.style.paddingTop = ''),
  15325. (t.style.width = ''),
  15326. (t.style.height = ''),
  15327. window.removeEventListener('resize', b),
  15328. c.removeEventListener('click', a),
  15329. g.removeEventListener('click', l),
  15330. f.removeEventListener('click', s),
  15331. o.emit(p.IMAGE_CLOSED),
  15332. o.close(!0))
  15333. }
  15334. function l(e) {
  15335. t.classList.toggle('show-info')
  15336. }
  15337. var c = o.div,
  15338. h = c.getElementsByClassName('tag-content')[0],
  15339. u = c.getElementsByClassName('tag-media-content')[0],
  15340. f = t.getElementsByClassName('close')[0],
  15341. g = h.getElementsByClassName('tag-label')[0]
  15342. c.classList.add('has-image'), r.classList.add('view-image'), c.classList.add(n.aspect >= 1 ? 'image-landscape' : 'image-portrait'), o.applyOrientation(o.orientation)
  15343. var m = !1,
  15344. A = getComputedStyle(h),
  15345. y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom),
  15346. C = 2 * parseFloat(getComputedStyle(u).paddingLeft),
  15347. I = h.querySelector('.tag-label'),
  15348. E = h.querySelector('.tag-desc'),
  15349. b = (function () {
  15350. var e,
  15351. t,
  15352. n = 0
  15353. return function () {
  15354. clearInterval(e),
  15355. clearTimeout(t),
  15356. (e = setInterval(function () {
  15357. var e = c.clientHeight
  15358. n !== e && (i(), (n = e))
  15359. }, 100)),
  15360. (t = setTimeout(clearInterval.bind(this, e), 1e3))
  15361. }
  15362. })()
  15363. n.on(p.IMAGE_OPENING, e), o.on(d.ACTIVATE, e), o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)), o.on(d.CLOSING, s)
  15364. }
  15365. var n = new a(),
  15366. r = n.createDomElement()
  15367. this.once(d.OPENED, function () {
  15368. n.load(e.src)
  15369. .then(i)
  15370. .catch(function (t) {
  15371. y.warn('Failed to load image:', e.src), y.warn('with error:', t)
  15372. })
  15373. .then(this.onMediaLoadFinished.bind(this))
  15374. })
  15375. var o = this
  15376. return r
  15377. }),
  15378. (n.prototype.createVideoElement = function (e, t) {
  15379. var i = new s({
  15380. autoPlay: !0,
  15381. autoResume: !0,
  15382. startMuted: !1,
  15383. loop: !1
  15384. }),
  15385. n = i.createDomElement()
  15386. return (
  15387. this.once(
  15388. d.OPENED,
  15389. function () {
  15390. i.load(e.src)
  15391. .then(
  15392. function () {
  15393. this.div.classList.add('has-video'),
  15394. (this.state !== I.OPEN && this.state !== I.ACTIVE) || (i.show(), i.play()),
  15395. this.on(d.OPENING, i.show.bind(i)),
  15396. this.on(d.OPENED, i.play.bind(i)),
  15397. this.on(d.CLOSING, i.pause.bind(i)),
  15398. this.on(d.CLOSED, i.hide.bind(i))
  15399. }.bind(this)
  15400. )
  15401. .catch(function (t) {
  15402. y.warn('Failed to embed video:', e.src), y.warn('with error:', t)
  15403. })
  15404. .then(this.onMediaLoadFinished.bind(this))
  15405. }.bind(this)
  15406. ),
  15407. n
  15408. )
  15409. }),
  15410. (n.prototype.createEmbedElement = function (e, t) {
  15411. var i = new l(),
  15412. n = i.createDomElement()
  15413. return (
  15414. this.once(
  15415. d.OPENED,
  15416. function () {
  15417. i.load(e.src)
  15418. .then(
  15419. function () {
  15420. this.div.classList.add('has-embed'),
  15421. (this.state !== I.OPEN && this.state !== I.ACTIVE) || i.show(),
  15422. this.applyOrientation(this.orientation),
  15423. this.on(d.OPENING, i.show.bind(i)),
  15424. this.on(d.CLOSED, i.hide.bind(i))
  15425. }.bind(this)
  15426. )
  15427. .catch(function (t) {
  15428. y.warn('Failed to embed:', e.src), y.warn('with error:', t)
  15429. })
  15430. .then(this.onMediaLoadFinished.bind(this))
  15431. }.bind(this)
  15432. ),
  15433. n
  15434. )
  15435. }),
  15436. (n.prototype.open = function (e) {
  15437. return (
  15438. (this.openPromise = $.Deferred()),
  15439. this.state === I.ACTIVE
  15440. ? this.openPromise.resolve().promise()
  15441. : (this.hovering || this.div.classList.add('has-hotzone'),
  15442. this.openTransition
  15443. ? e && this.setActiveState()
  15444. : (this.openTransition = c.setTimeout(
  15445. function () {
  15446. this.state !== I.OPEN &&
  15447. (this.emit(d.OPENING),
  15448. e && this.emit(d.ACTIVATING),
  15449. (this.state = I.OPENING),
  15450. this.animateOpen(
  15451. function () {
  15452. e && this.setActiveState(), this.openPromise.resolve()
  15453. }.bind(this)
  15454. ))
  15455. }.bind(this),
  15456. m.animation.openDelay
  15457. )),
  15458. c.cancel(this.closeTransition),
  15459. this.closePromise && this.closePromise.reject(),
  15460. (this.closeTransition = void 0),
  15461. this.openPromise.promise())
  15462. )
  15463. }),
  15464. (n.prototype.close = function (e) {
  15465. return (
  15466. (this.closePromise = $.Deferred()),
  15467. !e && this.hovering
  15468. ? this.closePromise.reject().promise()
  15469. : (this.closeTransition ||
  15470. (this.closeTransition = c.setTimeout(
  15471. function () {
  15472. this.state !== I.CLOSED && (this.emit(d.CLOSING), (this.state = I.CLOSING), this.animateClose())
  15473. }.bind(this),
  15474. m.animation.closeDelay
  15475. )),
  15476. c.cancel(this.openTransition),
  15477. this.openPromise && this.openPromise.reject(),
  15478. (this.openTransition = void 0),
  15479. this.closePromise.resolve(),
  15480. this.closePromise.promise())
  15481. )
  15482. }),
  15483. (n.prototype.setActiveState = function () {
  15484. this.state !== I.CLOSED && ((this.state = I.ACTIVE), this.emit(d.ACTIVATE), this.div.classList.remove('has-hotzone'))
  15485. }),
  15486. (n.prototype.animateOpen = function (e) {
  15487. if (this.state === I.OPENING) {
  15488. if ((c.cancel(this.animationTransition), u.detectSamsungNative()))
  15489. return (this.boardOrientation = null), (this.div.style.visibility = 'visible'), this.emit(d.OPENED), (this.state = I.OPEN), void (e && e())
  15490. ;(this.div.style.webkitTransform = 'scale(0)'),
  15491. (this.div.style.transform = 'scale(0)'),
  15492. (this.div.style.visibility = 'visible'),
  15493. (this.animationTransition = c.start(
  15494. h.property(this, 'animationScale', 1),
  15495. m.animation.openDuration,
  15496. function () {
  15497. this.emit(d.OPENED), (this.state = I.OPEN), e && e()
  15498. }.bind(this)
  15499. ))
  15500. }
  15501. }),
  15502. (n.prototype.animateClose = function (e) {
  15503. this.state === I.CLOSING &&
  15504. (c.cancel(this.animationTransition),
  15505. (this.animationTransition = c.start(
  15506. h.property(this, 'animationScale', 0),
  15507. m.animation.closeDuration,
  15508. function () {
  15509. this.emit(d.CLOSED), (this.state = I.CLOSED), (this.div.style.visibility = 'hidden'), this.div.classList.contains('has-hotzone') || this.div.classList.add('has-hotzone'), e && e()
  15510. }.bind(this)
  15511. )))
  15512. }),
  15513. (n.prototype.needsUpdate = function () {
  15514. return this.state !== I.CLOSED
  15515. }),
  15516. (n.prototype.update = function (e, t) {
  15517. if (this.needsUpdate()) {
  15518. var i = (this.updateOrientation(e), this.calcScale(t)),
  15519. n = {
  15520. x: ((e.x + 1) * $('#player').width()) / 2,
  15521. y: ((e.y + 1) * $('#player').height()) / 2
  15522. }
  15523. ;(this.div.screenTransform = this.initialTransform + ' translate(' + n.x + 'px, ' + n.y + 'px) scale(' + i * this.animationScale + ')'),
  15524. (this.div.style.webkitTransform = this.div.screenTransform),
  15525. (this.div.style.transform = this.div.screenTransform)
  15526. }
  15527. }),
  15528. (n.prototype.getDimensions = function () {
  15529. return this.div.getBoundingClientRect()
  15530. }),
  15531. (n.prototype.calcScale = function (e) {
  15532. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15533. }),
  15534. (n.prototype.updateOrientation = function (e) {
  15535. if (this.state !== I.ACTIVE) {
  15536. var t = 1 / 3,
  15537. i = e.y < -t ? 0 : e.y < t ? 1 : 2,
  15538. n = e.x < -t ? 0 : e.x < t ? 1 : 2,
  15539. r = ''
  15540. ;(r += 0 === n ? 'right' : 2 === n ? 'left' : ''),
  15541. (r += 0 === i ? '-down' : 2 === i ? '-up' : ''),
  15542. 1 === n &&
  15543. ((r = 0 === i ? 'bottom' : 2 === i ? 'top' : ''), 1 === i && (r = $('#player').width() > $('#player').height() ? (e.x < 0 ? 'right' : 'left') : e.y < 0 ? 'bottom' : 'top')),
  15544. (1 === n && 1 === i && r === this.orientation) || this.applyOrientation(r)
  15545. }
  15546. }),
  15547. (n.prototype.applyOrientation = function (e) {
  15548. ;(this.div.style.transform = this.div.style.webkitTransform = ''), this.div.classList.remove('tag-container-' + this.orientation), this.div.classList.add('tag-container-' + e)
  15549. var t = window.getComputedStyle(this.div)
  15550. ;(this.initialTransform = t.transform || t.webkitTransform), 'none' === this.initialTransform && (this.initialTransform = '')
  15551. var i = t.transform.slice(7, -1).split(','),
  15552. n = -i[4],
  15553. r = -i[5]
  15554. ;(this.div.style.webkitTransformOrigin = n + 'px ' + r + 'px'), (this.div.style.transformOrigin = n + 'px ' + r + 'px'), (this.orientation = e)
  15555. }),
  15556. (t.exports = n)
  15557. }).call(this, '/js/tag/Billboard/Billboard.js')
  15558. },
  15559. {
  15560. '../../util/browser': 182,
  15561. '../../util/lerp': 188,
  15562. '../../util/logger': 189,
  15563. '../../util/transitions': 195,
  15564. '../Media/EmbedlyEmbed': 125,
  15565. '../Media/EmbedlyPlayer': 126,
  15566. '../Media/Image': 128,
  15567. '../Media/Link': 129,
  15568. '../Media/MediaEvent': 131,
  15569. '../Parser/DescriptionChunkType': 133,
  15570. '../Parser/DescriptionParser': 134,
  15571. './BillboardEvent': 120,
  15572. './billboardSettings': 121,
  15573. './overlaySettings': 122,
  15574. events: 202
  15575. }
  15576. ],
  15577. 120: [
  15578. function (e, t, i) {
  15579. 'use strict'
  15580. t.exports = Object.freeze({
  15581. ENTER: 'billboard.enter',
  15582. LEAVE: 'billboard.leave',
  15583. OPENING: 'billboard.opening',
  15584. OPENED: 'billboard.open',
  15585. CLOSING: 'billboard.closing',
  15586. CLOSED: 'billboard.closed',
  15587. ACTIVATING: 'billboard.activating',
  15588. ACTIVATE: 'billboard.activate'
  15589. })
  15590. },
  15591. {}
  15592. ],
  15593. 121: [
  15594. function (e, t, i) {
  15595. 'use strict'
  15596. t.exports = Object.freeze({
  15597. animation: Object.freeze({
  15598. hoverOnClosing: !1,
  15599. openDelay: 100,
  15600. closeDelay: 50,
  15601. openDuration: 200,
  15602. closeDuration: 100
  15603. }),
  15604. boardToDiscRatio: 1.2
  15605. })
  15606. },
  15607. {}
  15608. ],
  15609. 122: [
  15610. function (e, t, i) {
  15611. 'use strict'
  15612. t.exports = Object.freeze({
  15613. boundaryWidth: 30,
  15614. boundaryHeight: 0
  15615. })
  15616. },
  15617. {}
  15618. ],
  15619. 123: [
  15620. function (e, t, i) {
  15621. //tag
  15622. ;(function (i) {
  15623. 'use strict'
  15624. function n(e, t, i) {
  15625. var n = i.version || '0'
  15626. '0' !== n && I.info('tag defined using version ' + n),
  15627. (this.model = e),
  15628. (this.sid = t),
  15629. (this.color = new r.Color().set(i.color || l.tagDefault)),
  15630. (this.hoverColor = l._darken(this.color, 0.2)),
  15631. (this.floor = null),
  15632. (this.floorIndex = i.floor),
  15633. (this.mode = s.PANORAMA),
  15634. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15635. (this.obj3d = null),
  15636. (this.disc = null),
  15637. (this.materials = {
  15638. disc: null,
  15639. pole: null
  15640. }),
  15641. (this.position = new r.Vector3().copy(i.position)),
  15642. (this.discPosition = new r.Vector3().copy(i.stem.direction)),
  15643. (this.discWorldPosition = null),
  15644. (this.discScale = 0.05),
  15645. (this.poleEnabled = i.stem.enabled),
  15646. (this.billboard = new o(i.label, i.description, i.media, this)),
  15647. (this.visibleTransition = null),
  15648. (this.hoveringDisc = !1)
  15649. }
  15650. var r = e('three'),
  15651. o = e('./Billboard/Billboard'),
  15652. a = e('../settings'),
  15653. s = e('../enum/Viewmode'),
  15654. l = e('../enum/Colors'),
  15655. c = e('../enum/RenderLayers'),
  15656. h = e('../enum/RenderOrder'),
  15657. u = (e('../util/common'), e('../util/math')),
  15658. d = e('../util/texture'),
  15659. p = e('../objects/Panorama'),
  15660. f = e('../shaders'),
  15661. g = e('../util/transitions'),
  15662. m = e('../util/lerp'),
  15663. v = e('../util/easing'),
  15664. A = e('./Billboard/BillboardEvent'),
  15665. y = e('events').EventEmitter,
  15666. C = e('../util/logger'),
  15667. I = new C(i),
  15668. E = d.loadBase64(
  15669. '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=='
  15670. ),
  15671. b = d.loadBase64(
  15672. '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'
  15673. ),
  15674. w = new r.PlaneBufferGeometry(1, 1)
  15675. ;(n.prototype = Object.create(y.prototype)),
  15676. (n.raycaster = new r.Raycaster()),
  15677. (n.prototype.bindEvents = function () {
  15678. this.billboard.on(A.ENTER, this.setHoverState.bind(this)), this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15679. }),
  15680. (n.prototype.build = function () {
  15681. return (
  15682. (this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first()),
  15683. this.floor && (this.billboard.build(this.model.sid), (this.obj3d = this.buildObject3D()), this.floor.add(this.obj3d)),
  15684. this
  15685. )
  15686. }),
  15687. (n.prototype.buildObject3D = function () {
  15688. var e = new r.Object3D()
  15689. e.position.copy(this.position)
  15690. var t = r.UniformsUtils.clone(f.tagDisc.uniforms)
  15691. ;(t.bg.value = b),
  15692. (t.mask.value = E),
  15693. t.color.value.copy(this.color),
  15694. (this.materials.disc = new r.RawShaderMaterial({
  15695. transparent: !0,
  15696. vertexShader: f.tagDisc.vertexShader,
  15697. fragmentShader: f.tagDisc.fragmentShader,
  15698. uniforms: t
  15699. })),
  15700. (this.disc = new r.Mesh(w, this.materials.disc)),
  15701. this.disc.layers.set(c.TAG),
  15702. this.disc.position.copy(this.discPosition),
  15703. (this.disc.renderOrder = h.tagDisc),
  15704. (this.disc.tag = this)
  15705. var i = this.buildPole()
  15706. return i.layers.set(c.TAG), (i.renderOrder = h.tagStem), e.add(i), e.layers.set(c.TAG), e.add(this.disc)
  15707. }),
  15708. (n.prototype.buildPole = function () {
  15709. var e = new r.BufferGeometry(),
  15710. t = new Float32Array(6)
  15711. return (
  15712. (t[0] = t[1] = t[2] = 0),
  15713. (t[3] = this.discPosition.x),
  15714. (t[4] = this.discPosition.y),
  15715. (t[5] = this.discPosition.z),
  15716. e.addAttribute('position', new r.BufferAttribute(t, 3)),
  15717. (this.materials.pole = new r.LineBasicMaterial({
  15718. linewidth: a.tags.pole.width,
  15719. color: a.tags.pole.color,
  15720. opacity: 0,
  15721. visible: this.poleEnabled,
  15722. transparent: !0,
  15723. depthWrite: !1
  15724. })),
  15725. new r.Line(e, this.materials.pole)
  15726. )
  15727. }),
  15728. (n.prototype.setFreeState = function (e) {
  15729. ;(!e && this.hoveringDisc) ||
  15730. this.billboard.close(e).then(
  15731. function () {
  15732. this.materials.disc.uniforms.color.value = this.color
  15733. }.bind(this)
  15734. )
  15735. }),
  15736. (n.prototype.setHoverState = function (e) {
  15737. this.billboard.open(e), (this.materials.disc.uniforms.color.value = this.hoverColor)
  15738. }),
  15739. (n.prototype.hide = function (e, t) {
  15740. var i = $.Deferred()
  15741. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition)) return i.resolve().promise()
  15742. ;(e = e || 0), (t = t || 0), g.cancel(this.visibleTransition)
  15743. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity,
  15744. r = t + e,
  15745. o = t / r
  15746. return (
  15747. (this.visibleTransition = g.start(
  15748. (function (e) {
  15749. var t = m.property(e.materials.disc.uniforms.opacity, 'value', 0),
  15750. i = m.property(e.materials.pole, 'opacity', 0)
  15751. return function (n) {
  15752. t(n), e.materials.pole && i(n)
  15753. }
  15754. })(this),
  15755. r * n,
  15756. function () {
  15757. i.resolve()
  15758. },
  15759. o,
  15760. v[a.warp.blendEasing]
  15761. )),
  15762. i.promise()
  15763. )
  15764. }),
  15765. (n.prototype.show = function (e, t) {
  15766. var i = $.Deferred()
  15767. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition)) return i.resolve().promise()
  15768. ;(e = e || 0), (t = t || 0), g.cancel(this.visibleTransition)
  15769. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity,
  15770. r = t + e,
  15771. o = t / r
  15772. return (
  15773. (this.visibleTransition = g.start(
  15774. (function (e) {
  15775. var t = m.property(e.materials.disc.uniforms.opacity, 'value', a.tags.disc.opacity),
  15776. i = m.property(e.materials.pole, 'opacity', a.tags.pole.opacity)
  15777. return function (n) {
  15778. t(n), e.materials.pole && i(n)
  15779. }
  15780. })(this),
  15781. r * n,
  15782. function () {
  15783. i.resolve()
  15784. },
  15785. o,
  15786. v[a.warp.blendEasing]
  15787. )),
  15788. i.promise()
  15789. )
  15790. }),
  15791. (n.prototype.closestPanoTowardTag = function (e, t) {
  15792. var i = [],
  15793. o = [],
  15794. l = this.disc.getWorldPosition()
  15795. if (e === s.PANORAMA) {
  15796. var c = 0.5,
  15797. h = t.position.clone().sub(l).normalize()
  15798. i.push(p.filters.isPanoAligned()), i.push(p.filters.isNeighbourPanoTo(t)), i.push(p.filters.inPanoDirection(l, h, c)), o.push(p.scoreFunctions.direction(l, h))
  15799. }
  15800. var u = new r.Vector3(),
  15801. d = function (e) {
  15802. u.copy(l).sub(e.position)
  15803. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z))),
  15804. i = a.tags.navigate.tiltTolerance
  15805. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15806. },
  15807. f = function (e) {
  15808. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15809. }
  15810. i.push(f, d), o.push(p.scoreFunctions.distanceSquared(this, -2))
  15811. var g = this.model.panos.sortByScore(i, o)
  15812. if (a.tags.navigate.lineOfSight) {
  15813. for (var m = 0; m < g.length; m++) {
  15814. var v = g[m].item,
  15815. A = v.position.distanceTo(l)
  15816. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance) return null
  15817. n.raycaster.set(v.position, l.clone().sub(v.position).normalize())
  15818. var y = n.raycaster.intersectObjects(this.model.colliders)
  15819. if (0 === y.length || y[0].distance > A) return v
  15820. }
  15821. return null
  15822. }
  15823. return g.length > 0 && g[0].item
  15824. }),
  15825. (n.prototype.examine = function (e) {
  15826. var t = e.mode,
  15827. i = (a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano)) || e.currentPano,
  15828. n = this.disc.getWorldPosition()
  15829. this.billboard.setActiveState()
  15830. var o = function () {
  15831. var t = this.billboard.getDimensions(),
  15832. n = new r.Vector3()
  15833. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15834. n.unproject(e.camera),
  15835. e.flyToPano({
  15836. pano: i,
  15837. lookAtPoint: n
  15838. })
  15839. }.bind(this)
  15840. if (t === s.PANORAMA)
  15841. if (i !== e.currentPano) {
  15842. var l = {
  15843. pano: i,
  15844. lookAtPoint: n,
  15845. duration: null,
  15846. maxDistanceOverride: null,
  15847. skipWarpingCheck: !1
  15848. }
  15849. e.flyToPano(l, o)
  15850. } else
  15851. setTimeout(
  15852. function () {
  15853. this.billboard.open().then(function () {
  15854. o()
  15855. })
  15856. }.bind(this),
  15857. 0
  15858. )
  15859. else {
  15860. var c = {
  15861. pano: i
  15862. }
  15863. if (n) {
  15864. var h = new r.Matrix4().lookAt(i.position, n, new r.Vector3(0, 1, 0))
  15865. c.quaternion = new r.Quaternion().setFromRotationMatrix(h)
  15866. }
  15867. ;(c.callback = o), (c.duration = 1500), (c.mode = s.PANORAMA), e.flyToNewMode(c)
  15868. }
  15869. }),
  15870. (n.prototype.update = (function (e, t) {
  15871. var i = new r.Vector3()
  15872. return function (e, t) {
  15873. ;(this.discWorldPosition = this.disc.getWorldPosition()),
  15874. this.updateDisc(e, t),
  15875. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t), i.z < 1 && ((i.y *= -1), this.billboard.update(i, this.getDiscRadius(i, t))))
  15876. }
  15877. })()),
  15878. (n.prototype.updateDisc = (function (e, t) {
  15879. var i = new r.Vector3(),
  15880. o = new r.Vector3(),
  15881. l = new r.Vector3(),
  15882. c = new r.Vector3(),
  15883. h = new r.Vector3()
  15884. return function (e, t) {
  15885. var u = a.tags.visibility,
  15886. d = a.tags.disc.scale,
  15887. p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition)
  15888. if (
  15889. ((this.obj3d.visible =
  15890. 0 !== this.disc.material.opacity &&
  15891. (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) &&
  15892. (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) &&
  15893. (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) &&
  15894. (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t))),
  15895. this.obj3d.visible)
  15896. ) {
  15897. this.disc.quaternion.copy(t.quaternion)
  15898. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound)
  15899. i.copy(this.discWorldPosition).project(t),
  15900. o.set($('#player').width() / 2, $('#player').height() / 2, 1).multiply(i),
  15901. l.set(f / 2, 0, 0).add(o),
  15902. c.set(2 / $('#player').width(), 2 / $('#player').height(), 1).multiply(l),
  15903. h.copy(c).unproject(t)
  15904. var g = h.distanceTo(this.discWorldPosition),
  15905. m = 1 + (a.tags.disc.scale.responsiveness / 100) * (n.viewportScale() - 1)
  15906. ;(this.discScale = g * m), this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15907. }
  15908. }
  15909. })()),
  15910. (n.prototype.getDiscRadius = (function (e, t) {
  15911. var i = new r.Vector3()
  15912. return function (e, t) {
  15913. return (
  15914. i
  15915. .set(-this.discScale / 2, 0, 0)
  15916. .applyQuaternion(t.quaternion)
  15917. .add(this.discWorldPosition)
  15918. .project(t),
  15919. Math.abs(e.x - i.x) * $('#player').width()
  15920. )
  15921. }
  15922. })()),
  15923. (n.prototype.tagVisibleOnCurrentFloor = function (e) {
  15924. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15925. }),
  15926. (n.prototype.offScreen = function (e, t) {
  15927. var i = e.getWorldPosition().project(t)
  15928. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15929. }),
  15930. (n.viewportScale = function () {
  15931. return (
  15932. (n.viewportWidth === $('#player').width() && n.viewportHeight === $('#player').height()) ||
  15933. ((n.viewportWidth = $('#player').width()),
  15934. (n.viewportHeight = $('#player').height()),
  15935. (n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize))),
  15936. n.currentViewportScale
  15937. )
  15938. }),
  15939. (t.exports = n)
  15940. }).call(this, '/js/tag/tag.js')
  15941. },
  15942. {
  15943. '../enum/Colors': 19,
  15944. '../enum/RenderLayers': 41,
  15945. '../enum/RenderOrder': 42,
  15946. '../enum/Viewmode': 51,
  15947. '../objects/Panorama': 148,
  15948. '../settings': 166,
  15949. '../shaders': 167,
  15950. '../util/common': 185,
  15951. '../util/easing': 186,
  15952. '../util/lerp': 188,
  15953. '../util/logger': 189,
  15954. '../util/math': 190,
  15955. '../util/texture': 194,
  15956. '../util/transitions': 195,
  15957. './Billboard/Billboard': 119,
  15958. './Billboard/BillboardEvent': 120,
  15959. events: 202,
  15960. three: 217
  15961. }
  15962. ],
  15963. 124: [
  15964. function (e, t, i) {
  15965. ;(function (i) {
  15966. 'use strict'
  15967. function n() {
  15968. ;(this.tagState = y.IDLE),
  15969. (this.intersectTag = null),
  15970. (this.hoveredTag = null),
  15971. (this.activeTag = null),
  15972. (this.tagDiscs = []),
  15973. (this.raycaster = new r.Raycaster()),
  15974. (this.modelManager = null),
  15975. (this.player = null),
  15976. (this.totaltags = 0),
  15977. (this.navigatingViaTag = !1),
  15978. (this.enabled = !1)
  15979. }
  15980. var r = e('three'),
  15981. o = e('../util/logger'),
  15982. a = e('../util/common'),
  15983. s = e('../controls/serializer'),
  15984. l = e('../objects/Snapshot'),
  15985. c = e('../settings'),
  15986. h = e('./Billboard/BillboardEvent'),
  15987. u = e('./Media/MediaEvent'),
  15988. d = e('./Media/LinkType'),
  15989. p = e('../enum/Viewmode'),
  15990. f = e('../enum/WarpStyle'),
  15991. g = e('../enum/BlackoutStyle'),
  15992. m = e('../enum/ModelManagerEvents'),
  15993. v = e('../enum/tagEvents'),
  15994. A = e('../enum/PlayerEvents'),
  15995. y = (e('../util/lerp'), e('../enum/TagStates')),
  15996. C = e('events').EventEmitter,
  15997. I = new o(i)
  15998. a.extend(n, C),
  15999. (n.prototype.init = function (e, t) {
  16000. ;(this.modelManager = e), (this.player = t), this.updateModel(), this.bindEvents()
  16001. }),
  16002. (n.prototype.update = function (e) {
  16003. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  16004. }),
  16005. (n.prototype.updateTags = function (e, t, i, n) {
  16006. for (var r in this.model.tags) this.model.tags[r].update(e, t, i, n)
  16007. }),
  16008. (n.prototype.updateModel = function () {
  16009. ;(this.model = this.modelManager.getActiveModel()), this.gettagsFromModel(), (this.totaltags = Object.keys(this.model.tags).length)
  16010. }),
  16011. (n.prototype.gettagsFromModel = function () {
  16012. this.tagDiscs = []
  16013. for (var e in this.model.tags) {
  16014. var t = this.model.tags[e].disc
  16015. t && this.tagDiscs.push(t)
  16016. }
  16017. }),
  16018. (n.prototype.bindEvents = function () {
  16019. function e() {
  16020. Object.keys(this.model.tags).forEach(
  16021. function (e) {
  16022. var t = this.model.tags[e]
  16023. t.bindEvents(),
  16024. t.billboard.on(
  16025. u.LINK_CLICK,
  16026. function (e) {
  16027. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  16028. }.bind(this)
  16029. ),
  16030. t.billboard.on(
  16031. u.IMAGE_OPENED,
  16032. function () {
  16033. ;(this.tagState = y.EXAMINE), this.emit(u.IMAGE_OPENED)
  16034. }.bind(this)
  16035. ),
  16036. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  16037. }.bind(this)
  16038. )
  16039. }
  16040. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  16041. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  16042. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  16043. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  16044. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  16045. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  16046. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  16047. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  16048. e.call(this)
  16049. }),
  16050. (n.prototype.navigateViaLink = function (e) {
  16051. var t = s.deserialize(e)
  16052. if (t)
  16053. if (t.mode === p.PANORAMA) {
  16054. try {
  16055. this.player.model.panos.get(t.panoId)
  16056. } catch (e) {
  16057. return void I.warn('Unable to find panorama location', t.panoId)
  16058. }
  16059. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  16060. } else {
  16061. var i = {
  16062. cameraMode: t.mode,
  16063. position: t.position,
  16064. quaternion: t.quaternion,
  16065. scanId: t.panoId,
  16066. orthoZoom: t.zoom,
  16067. floorVisibility: t.floorVisibility,
  16068. thumbUrl: null,
  16069. name: null
  16070. }
  16071. this.player.flyToNewMode({
  16072. mode: t.mode,
  16073. duration: c.warp.outsideTime,
  16074. warpDest: new l(i),
  16075. force: !0
  16076. })
  16077. }
  16078. }),
  16079. (n.prototype.handleWarpStart = function (e, t, i, n) {
  16080. this.dismissExaminedTag(), t === f.BLACK && ((null !== n && void 0 !== n) || (n = c.warp.teleportTime), e && (i = g.END), this.hideShowTagsForBlackoutStyle(i, n))
  16081. }),
  16082. (n.prototype.handleWarpInterruption = function (e, t, i) {
  16083. ;(null !== i && void 0 !== i) || (i = c.warp.teleportTime), this.hideShowTagsForBlackoutStyle(t, i)
  16084. }),
  16085. (n.prototype.hideShowTagsForBlackoutStyle = function (e, t) {
  16086. var i = 0,
  16087. n = 0,
  16088. r = t / 2
  16089. switch (((null !== e && void 0 !== e) || (e = g.MIDDLE), e)) {
  16090. case g.END:
  16091. this.hideAlltags(r)
  16092. break
  16093. case g.BEGINNING:
  16094. this.hideAlltags().done(this.showAlltags.bind(this, r))
  16095. break
  16096. case g.NONE:
  16097. break
  16098. case g.MIDDLE:
  16099. ;(i = r),
  16100. (n = r),
  16101. this.hideAlltags(n),
  16102. setTimeout(
  16103. function () {
  16104. this.showAlltags(i)
  16105. }.bind(this),
  16106. n
  16107. )
  16108. break
  16109. case g.FADEIN:
  16110. setTimeout(
  16111. function () {
  16112. this.showAlltags(r)
  16113. }.bind(this),
  16114. r
  16115. )
  16116. }
  16117. }),
  16118. (n.prototype.onPlayerModeChanging = function (e, t) {
  16119. t !== p.PANORAMA && this.dismissExaminedTag(), t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR)
  16120. var i = t !== p.OUTDOOR
  16121. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16122. }),
  16123. (n.prototype.onPanoChange = function (e, t) {
  16124. var i = this.navigatingViaTag
  16125. if (((this.navigatingViaTag = !1), !i)) {
  16126. this.dismissExaminedTag()
  16127. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA,
  16128. r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA
  16129. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  16130. }
  16131. }),
  16132. (n.prototype.onPlayerReady = function (e, t, i) {
  16133. this.startAlltags(e, t ? i : null)
  16134. }),
  16135. (n.prototype.onPlayerFlyingEnded = function (e, t) {
  16136. this.updateClosestTags(e)
  16137. }),
  16138. (n.prototype.dismissExaminedTag = function () {
  16139. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(), this.hoveredTag && (this.hoveredTag.setFreeState(!0), (this.hoveredTag = null))
  16140. }),
  16141. (n.prototype.startAlltags = function (e, t) {
  16142. ;(this.model.shouldShowtags = c.tags.enabled),
  16143. (this.enabled = !0),
  16144. e ||
  16145. (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  16146. t &&
  16147. setTimeout(
  16148. function () {
  16149. this.activateTag(this.model.getTagBySid(t))
  16150. }.bind(this),
  16151. c.tags.startup.fadeInDuration / 2
  16152. ))
  16153. }),
  16154. (n.prototype.showAlltags = function (e, t, i) {
  16155. function n() {
  16156. o++, o === this.totaltags && ((this.model.tagsShown = !0), r.resolve())
  16157. }
  16158. var r = $.Deferred()
  16159. if ((!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned()) || !this.model.shouldShowtags) return r.resolve().promise()
  16160. var o = 0
  16161. for (var a in this.model.tags) {
  16162. var s = this.model.tags[a]
  16163. s.show(e, t).done(n.bind(this))
  16164. }
  16165. return r.promise()
  16166. }),
  16167. (n.prototype.hideAlltags = function (e, t) {
  16168. function i() {
  16169. r++, r === this.totaltags && ((this.model.tagsShown = !1), n.resolve())
  16170. }
  16171. var n = $.Deferred(),
  16172. r = 0
  16173. for (var o in this.model.tags) {
  16174. var a = this.model.tags[o]
  16175. a.hide(e, t).done(i.bind(this)), a === this.activeTag && this.dismissActiveTag()
  16176. }
  16177. return n.promise()
  16178. }),
  16179. (n.prototype.enableHovering = function () {
  16180. this.enabled = !0
  16181. }),
  16182. (n.prototype.disableHovering = function () {
  16183. this.enabled = !1
  16184. }),
  16185. (n.prototype.activateTag = function (e, t) {
  16186. ;(t = t || y.EXAMINE), (this.activeTag = e), (this.activeTag.hoveringDisc = !0), this.activeTag.setHoverState(t === y.EXAMINE), (this.tagState = t), this.emit(v.TagActivated, e)
  16187. }),
  16188. (n.prototype.dismissActiveTag = function () {
  16189. ;(this.activeTag.hoveringDisc = !1), this.activeTag.setFreeState(!0)
  16190. var e = this.activeTag
  16191. ;(this.activeTag = null), (this.tagState = y.IDLE), this.emit(v.TagDismissed, e)
  16192. }),
  16193. (n.prototype.clickedOnTag = function (e) {
  16194. var t = function () {
  16195. ;(this.navigatingViaTag = !0), this.activeTag.examine(this.player), this.emit(v.TagNavigation, this.activeTag)
  16196. }.bind(this)
  16197. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE), (this.activeTag = this.intersectTag), t(), !0) : (this.dismissActiveTag(), !1)
  16198. }),
  16199. (n.prototype.intersecttag = (function () {
  16200. var e = new r.Vector3(),
  16201. t = new r.Vector3(),
  16202. i = new r.Vector3()
  16203. return function (n, r, o) {
  16204. if (!this.enabled) return null
  16205. var a = null,
  16206. s = this.tagDiscs.filter(function (e) {
  16207. return e.parent.visible
  16208. })
  16209. if (s.length > 0) {
  16210. var l = this.model.floors.reduce(function (e, t) {
  16211. return t.hidden ? e : e.concat(t.collider.children)
  16212. }, s)
  16213. e.set(n.x, n.y, -1).unproject(o), t.set(n.x, n.y, 1).unproject(o), i.copy(t).sub(e).normalize(), this.raycaster.set(e, i)
  16214. var c = this.raycaster.intersectObjects(l)
  16215. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  16216. }
  16217. return (
  16218. (this.intersectTag = a),
  16219. r &&
  16220. (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || (this.tagState === y.EXAMINE && a)) && this.dismissActiveTag(),
  16221. a &&
  16222. a !== this.activeTag &&
  16223. (a.listeners(h.ENTER).length < 1 &&
  16224. (a.billboard.on(
  16225. h.ENTER,
  16226. function () {
  16227. this.hoveredTag = a
  16228. }.bind(this)
  16229. ),
  16230. a.billboard.on(
  16231. h.LEAVE,
  16232. function () {
  16233. this.hoveredTag = null
  16234. }.bind(this)
  16235. )),
  16236. this.activateTag(a, y.BROWSE))),
  16237. a
  16238. )
  16239. }
  16240. })()),
  16241. (n.prototype.rankedtagInDirection = (function () {
  16242. var e = [],
  16243. t = [],
  16244. i = new r.Vector3(),
  16245. n = new r.Vector3(),
  16246. o = new r.Vector3()
  16247. return function (r, a, s, l) {
  16248. var c = 0
  16249. t.length = 0
  16250. for (var h = 0; h < this.closesttags.length; h++) {
  16251. var u = this.closesttags[h]
  16252. n.copy(u.position), n.add(u.discPosition), i.copy(a), i.sub(n).negate(), i.normalize()
  16253. var d = i.dot(l)
  16254. if (d >= 0) {
  16255. o.copy(n), o.project(s)
  16256. var p = this.intersecttag(o, !1, s)
  16257. if (p) {
  16258. if (c >= e.length)
  16259. for (var f = 0; f < 64; f++)
  16260. e.push({
  16261. tag: u,
  16262. dot: d
  16263. })
  16264. var g = e[c]
  16265. ;(g.tag = u), (g.dot = d), (g.position = math.projectPositionToCanvas(n, s)), t.push(g), c++
  16266. }
  16267. }
  16268. }
  16269. return (
  16270. t.sort(function (e, t) {
  16271. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  16272. }),
  16273. r < t.length ? t[r].tag : null
  16274. )
  16275. }
  16276. })()),
  16277. (n.prototype.updateClosestTags = (function () {
  16278. var e = new r.Vector3(),
  16279. t = 30
  16280. return function (i) {
  16281. this.closesttags || (this.closesttags = []), (this.closesttags.length = 0)
  16282. var n = this.model.tags
  16283. if (n)
  16284. for (var r in n)
  16285. if (n.hasOwnProperty(r)) {
  16286. var o = n[r],
  16287. a = o.position
  16288. e.copy(i), e.sub(a).negate()
  16289. var s = e.lengthSq()
  16290. s < t && this.closesttags.push(o)
  16291. }
  16292. }
  16293. })()),
  16294. (t.exports = n)
  16295. }).call(this, '/js/tag/tagManager.js')
  16296. },
  16297. {
  16298. '../controls/serializer': 14,
  16299. '../enum/BlackoutStyle': 18,
  16300. '../enum/tagEvents': 32,
  16301. '../enum/ModelManagerEvents': 33,
  16302. '../enum/PlayerEvents': 40,
  16303. '../enum/TagStates': 44,
  16304. '../enum/Viewmode': 51,
  16305. '../enum/WarpStyle': 52,
  16306. '../objects/Snapshot': 153,
  16307. '../settings': 166,
  16308. '../util/common': 185,
  16309. '../util/lerp': 188,
  16310. '../util/logger': 189,
  16311. './Billboard/BillboardEvent': 120,
  16312. './Media/LinkType': 130,
  16313. './Media/MediaEvent': 131,
  16314. events: 202,
  16315. three: 217
  16316. }
  16317. ],
  16318. 125: [
  16319. function (e, t, i) {
  16320. ;(function (i) {
  16321. 'use strict'
  16322. function n() {
  16323. ;(this.embedWrapper = null), (this.embedElement = null)
  16324. }
  16325. var r = e('../../util/ajax'),
  16326. o = e('./mediaSettings'),
  16327. a = e('../../settings'),
  16328. s = e('../../util/logger'),
  16329. l = new s(i)
  16330. ;(n.prototype.createDomElement = function () {
  16331. return (this.embedWrapper = document.createElement('div')), this.embedWrapper.classList.add('tag-embed'), this.embedWrapper.classList.add('hidden'), this.embedWrapper
  16332. }),
  16333. (n.prototype.load = function (e) {
  16334. var t = 'https://api.embedly.com/1/oembed?key=' + a.appConfig.embedly_key + '&url=' + encodeURIComponent(e) + '&maxwidth=' + o.maxEmbedWidth
  16335. return new Promise(
  16336. function (e, i) {
  16337. r.get(t).then(
  16338. function (t) {
  16339. if (((t = JSON.parse(t)), t.html && t.html.indexOf('<script') === -1)) {
  16340. this.embedWrapper.innerHTML = t.html
  16341. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth
  16342. if (((this.embedWrapper.style.width = n + 'px'), t.height)) {
  16343. var r = t.height / t.width
  16344. this.embedWrapper.style.height = n * r + 'px'
  16345. }
  16346. this.embedElement = this.embedWrapper.firstChild
  16347. var a = []
  16348. try {
  16349. a = [].slice.call(this.embedElement.querySelectorAll('a'))
  16350. } catch (e) {
  16351. l.debug('Error getting `a` elements for embed; was it an iframe?')
  16352. }
  16353. a.forEach(function (e) {
  16354. e.setAttribute('target', '_blank')
  16355. }),
  16356. this.embedElement.classList.add('hidden'),
  16357. this.embedWrapper.classList.remove('hidden'),
  16358. e()
  16359. } else i('Not a valid embed')
  16360. }.bind(this),
  16361. function (e) {
  16362. i(e.response)
  16363. }
  16364. )
  16365. }.bind(this)
  16366. )
  16367. }),
  16368. (n.prototype.show = function () {
  16369. this.embedElement && this.embedElement.classList.remove('hidden')
  16370. }),
  16371. (n.prototype.hide = function () {
  16372. this.embedElement && this.embedElement.classList.add('hidden')
  16373. }),
  16374. (t.exports = n)
  16375. }).call(this, '/js/tag/Media/EmbedlyEmbed.js')
  16376. },
  16377. {
  16378. '../../settings': 166,
  16379. '../../util/ajax': 181,
  16380. '../../util/logger': 189,
  16381. './mediaSettings': 132
  16382. }
  16383. ],
  16384. 126: [
  16385. function (e, t, i) {
  16386. ;(function (i) {
  16387. 'use strict'
  16388. function n(e) {
  16389. o.call(this), (this.options = e), (this.playerControls = null), (this.state = s.NOT_READY)
  16390. }
  16391. var r = e('../../util/browser'),
  16392. o = e('./EmbedlyEmbed'),
  16393. a = e('../../util/logger'),
  16394. s =
  16395. (new a(i),
  16396. Object.freeze({
  16397. NOT_READY: 'player.not.ready',
  16398. CUED: 'player.cued',
  16399. PLAYING: 'player.playing',
  16400. PAUSED: 'player.paused'
  16401. }))
  16402. ;(n.prototype = Object.create(o.prototype)),
  16403. (n.prototype.createDomElement = function () {
  16404. return (this.embedWrapper = document.createElement('div')), this.embedWrapper.classList.add('tag-video'), this.embedWrapper.classList.add('hidden'), this.embedWrapper
  16405. }),
  16406. (n.prototype.load = function (e) {
  16407. var t = function () {
  16408. function e(e) {
  16409. ;(this.playerState = s.CUED), this.options.startMuted && this.playerControls.mute()
  16410. }
  16411. function t(e) {
  16412. this.playerState = e
  16413. }
  16414. function i(e) {
  16415. this.playerControls.setCurrentTime(0), this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16416. }
  16417. ;(this.playerControls = new playerjs.Player(this.embedElement)),
  16418. this.playerControls.on('ready', e.bind(this)),
  16419. this.playerControls.on('play', t.bind(this, s.PLAYING)),
  16420. this.playerControls.on('pause', t.bind(this, s.PAUSED)),
  16421. this.playerControls.on('ended', i.bind(this))
  16422. }.bind(this)
  16423. return o.prototype.load.call(this, e).then(t.bind(this))
  16424. }),
  16425. (n.prototype.play = (function () {
  16426. var e = r.isMobile()
  16427. return function () {
  16428. this.playerState !== s.NOT_READY && this.playerControls && !e && ((this.state === s.CUED && this.options.autoPlay) || this.options.autoResume) && this.playerControls.play()
  16429. }
  16430. })()),
  16431. (n.prototype.pause = function () {
  16432. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16433. }),
  16434. (t.exports = n)
  16435. }).call(this, '/js/tag/Media/EmbedlyPlayer.js')
  16436. },
  16437. {
  16438. '../../util/browser': 182,
  16439. '../../util/logger': 189,
  16440. './EmbedlyEmbed': 125
  16441. }
  16442. ],
  16443. 127: [
  16444. function (e, t, i) {
  16445. ;(function (i) {
  16446. 'use strict'
  16447. function n(e) {
  16448. function t() {
  16449. return (
  16450. a.debug('requesting file from embedly:', e.href),
  16451. r
  16452. .get(e.href, {
  16453. responseType: e.responseType
  16454. })
  16455. .then(function (t) {
  16456. return a.debug('requesting file finished:', e.href), t
  16457. })
  16458. )
  16459. }
  16460. function i() {}
  16461. return (s = new Promise(function (e, n) {
  16462. s.catch(i).then(function () {
  16463. t().then(e, n)
  16464. })
  16465. }))
  16466. }
  16467. var r = e('../../util/ajax'),
  16468. o = (e('./mediaSettings'), e('../../util/logger')),
  16469. a = new o(i),
  16470. s = Promise.resolve()
  16471. t.exports.enqueue = n
  16472. }).call(this, '/js/tag/Media/EmbedlyQueue.js')
  16473. },
  16474. {
  16475. '../../util/ajax': 181,
  16476. '../../util/logger': 189,
  16477. './mediaSettings': 132
  16478. }
  16479. ],
  16480. 128: [
  16481. function (e, t, i) {
  16482. ;(function (i) {
  16483. 'use strict'
  16484. function n() {
  16485. ;(this.imageWrapper = null), (this.width = 0), (this.height = 0), (this.aspect = 1)
  16486. }
  16487. var r = e('./MediaEvent'),
  16488. o = e('./EmbedlyQueue'),
  16489. a = e('events').EventEmitter,
  16490. s = e('../../util/logger'),
  16491. l = e('../../settings')
  16492. new s(i)
  16493. ;(n.prototype = Object.create(a.prototype)),
  16494. (n.prototype.createDomElement = function () {
  16495. return (
  16496. (this.imageWrapper = document.createElement('div')),
  16497. this.imageWrapper.classList.add('tag-image'),
  16498. this.imageWrapper.classList.add('hidden'),
  16499. this.imageWrapper.addEventListener(
  16500. 'click',
  16501. function (e) {
  16502. e.stopPropagation(), this.emit(r.IMAGE_OPENING), (this.imageWrapper.style.pointerEvents = 'none')
  16503. }.bind(this)
  16504. ),
  16505. this.imageWrapper
  16506. )
  16507. }),
  16508. (n.prototype.onClosed = function () {
  16509. this.imageWrapper.style.pointerEvents = 'auto'
  16510. }),
  16511. (n.prototype.load = function (e) {
  16512. var t = Math.max(window.screen.height, window.screen.width),
  16513. i = 'https://i.embed.ly/1/display/resize?key=' + l.appConfig.embedly_key + '&url=' + encodeURIComponent(e) + '&width=' + t + '&height=' + t
  16514. return new Promise(
  16515. function (e, t) {
  16516. function n(t) {
  16517. var i = t.target
  16518. ;(this.width = i.naturalWidth), (this.height = i.naturalHeight), (this.aspect = this.width / this.height)
  16519. var n = t.target.src
  16520. ;(this.imageWrapper.style.backgroundImage = 'url("' + n + '")'),
  16521. (this.imageWrapper.style.width = this.width + 'px'),
  16522. (this.imageWrapper.style.height = this.height + 'px'),
  16523. this.imageWrapper.classList.remove('hidden'),
  16524. e()
  16525. }
  16526. o.enqueue({
  16527. href: i,
  16528. responseType: 'arraybuffer'
  16529. }).then(
  16530. function (e) {
  16531. var t = new Uint8Array(e),
  16532. i = new Blob([t]),
  16533. r = new window.Image()
  16534. r.addEventListener('load', n.bind(this))
  16535. var o = URL.createObjectURL(i)
  16536. r.src = o
  16537. }.bind(this),
  16538. t
  16539. )
  16540. }.bind(this)
  16541. )
  16542. }),
  16543. (t.exports = n)
  16544. }).call(this, '/js/tag/Media/Image.js')
  16545. },
  16546. {
  16547. '../../settings': 166,
  16548. '../../util/logger': 189,
  16549. './EmbedlyQueue': 127,
  16550. './MediaEvent': 131,
  16551. events: 202
  16552. }
  16553. ],
  16554. 129: [
  16555. function (e, t, i) {
  16556. 'use strict'
  16557. function n(e) {
  16558. ;(this.label = e.label), (this.href = e.url), (this.type = this.updateLinkForType()), (this.domElement = null), (this.id = c++)
  16559. }
  16560. var r = e('./LinkType'),
  16561. o = e('./MediaEvent'),
  16562. a = e('../../util/browser'),
  16563. s = e('../../analytics'),
  16564. l = e('events').EventEmitter,
  16565. c = 0
  16566. ;(n.prototype = Object.create(l.prototype)),
  16567. (n.prototype.updateLinkForType = function () {
  16568. function e(e) {
  16569. var t = new RegExp('[#&?]start=([^#&?]*)'),
  16570. i = t.exec(e)
  16571. return i[1]
  16572. }
  16573. function t(e) {
  16574. return e + '&play=1'
  16575. }
  16576. var i = a.valueFromHash('m') || a.valueFromHash('model')
  16577. return this.href.indexOf('port.com/show') !== -1 || this.href.indexOf(window.location.host + '/show') !== -1
  16578. ? this.href.indexOf(i) !== -1 && this.href.indexOf('start=') !== -1
  16579. ? ((this.href = e(this.href)), r.NAVIGATION)
  16580. : ((this.href = t(this.href)), r.MODEL)
  16581. : r.EXT_LINK
  16582. })
  16583. var h = {}
  16584. ;(n.prototype.createDomElement = function () {
  16585. function e(e) {
  16586. switch (
  16587. (e.stopPropagation(),
  16588. (h[this.id] = !0),
  16589. s.trackAlways('click_tag_link', {
  16590. link_type: this.type,
  16591. link_count: c,
  16592. links_clicked: Object.keys(h).length
  16593. }),
  16594. this.type)
  16595. ) {
  16596. case r.MODEL:
  16597. window.location.replace(this.href)
  16598. break
  16599. case r.EXT_LINK:
  16600. window.open(this.href, '_blank')
  16601. }
  16602. this.emit(o.LINK_CLICK, {
  16603. type: this.type,
  16604. url: this.href
  16605. })
  16606. }
  16607. if (((this.domElement = document.createElement('a')), this.domElement.classList.add('tag-link'), (this.domElement.textContent = this.label), this.type === r.EXT_LINK)) {
  16608. this.domElement.textContent += ' '
  16609. var t = document.createElement('i')
  16610. t.classList.add('icon-ext-link'), (t.title = 'Link to external web site'), this.domElement.appendChild(t)
  16611. }
  16612. return this.domElement.addEventListener('click', e.bind(this)), this.domElement
  16613. }),
  16614. (t.exports = n)
  16615. },
  16616. {
  16617. '../../analytics': 4,
  16618. '../../util/browser': 182,
  16619. './LinkType': 130,
  16620. './MediaEvent': 131,
  16621. events: 202
  16622. }
  16623. ],
  16624. 130: [
  16625. function (e, t, i) {
  16626. 'use strict'
  16627. t.exports = {
  16628. NAVIGATION: 'navigation',
  16629. MODEL: 'model',
  16630. EXT_LINK: 'ext-link'
  16631. }
  16632. },
  16633. {}
  16634. ],
  16635. 131: [
  16636. function (e, t, i) {
  16637. 'use strict'
  16638. t.exports = Object.freeze({
  16639. LINK_CLICK: 'mtmedia.link',
  16640. IMAGE_LOADED: 'mtmedia.image.loaded',
  16641. IMAGE_OPENING: 'mtmedia.image.opening',
  16642. IMAGE_OPENED: 'mtmedia.image.opened',
  16643. IMAGE_CLOSING: 'mtmedia.image.closing',
  16644. IMAGE_CLOSED: 'mtmedia.image.closed',
  16645. VIDEO_START: 'mtmedia.video.start',
  16646. VIDEO_PAUSE: 'mtmedia.video.pause',
  16647. VIDEO_ENDED: 'mtmedia.video.end'
  16648. })
  16649. },
  16650. {}
  16651. ],
  16652. 132: [
  16653. function (e, t, i) {
  16654. 'use strict'
  16655. t.exports = Object.freeze({
  16656. maxEmbedWidth: 350,
  16657. defaultAspectRatio: 0.75
  16658. })
  16659. },
  16660. {}
  16661. ],
  16662. 133: [
  16663. function (e, t, i) {
  16664. 'use strict'
  16665. t.exports = Object.freeze({
  16666. TEXT: 'text',
  16667. LINK: 'link',
  16668. IMAGE: 'photo',
  16669. VIDEO: 'video',
  16670. RICH: 'rich'
  16671. })
  16672. },
  16673. {}
  16674. ],
  16675. 134: [
  16676. function (e, t, i) {
  16677. 'use strict'
  16678. function n(e) {
  16679. this.capabilities = {
  16680. links: {
  16681. enable: e.supportLinks,
  16682. keepLabels: e.keepLinkLabels
  16683. }
  16684. }
  16685. }
  16686. var r = e('./DescriptionChunkType')
  16687. ;(n.prototype.parse = function (e, t) {
  16688. var i = [],
  16689. n = e.split('[').map(function (e, t) {
  16690. return 0 === t ? e : '[' + e
  16691. })
  16692. return (
  16693. n.forEach(
  16694. function (e) {
  16695. var n = this.findMarkdown(e)
  16696. if (n) {
  16697. if (n.url.indexOf('javascript:') !== -1) return
  16698. this.addLinkChunk(i, n, t), this.addTextChunk(i, e.slice(n.markdown.length))
  16699. } else this.addTextChunk(i, e)
  16700. }.bind(this)
  16701. ),
  16702. i
  16703. )
  16704. }),
  16705. (n.prototype.findMarkdown = function (e) {
  16706. var t = /\[([^\]]*)\]\((.*)\)/,
  16707. i = e.match(t)
  16708. if (i) {
  16709. for (var n = i[2], r = 1, o = 0; o < n.length && ('(' === n[o] ? r++ : ')' === n[o] && r--, 0 !== r); ) o++
  16710. var a = n.length - o
  16711. return {
  16712. markdown: i[0].substring(0, i[0].length - a),
  16713. label: i[1],
  16714. url: i[2].substring(0, o)
  16715. }
  16716. }
  16717. }),
  16718. (n.prototype.addTextChunk = function (e, t) {
  16719. 0 !== t.length &&
  16720. e.push({
  16721. type: r.TEXT,
  16722. text: t
  16723. })
  16724. }),
  16725. (n.prototype.addLinkChunk = function (e, t) {
  16726. if (!this.capabilities.links.enable) return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label))
  16727. var i = {
  16728. label: t.label,
  16729. url: t.url
  16730. }
  16731. i.url.indexOf('://') === -1 && (i.url = 'http://' + i.url),
  16732. e.push({
  16733. type: r.LINK,
  16734. link: i
  16735. })
  16736. }),
  16737. (t.exports = n)
  16738. },
  16739. {
  16740. './DescriptionChunkType': 133
  16741. }
  16742. ],
  16743. 135: [
  16744. function (e, t, i) {
  16745. ;(function (i) {
  16746. 'use strict'
  16747. var n = e('../util/logger'),
  16748. r = new n(i),
  16749. o = {
  16750. parseIdsFromChunkName: function (e, t) {
  16751. ;(t.floorId = o.parseFloor(e)), (t.roomId = o.parseRoom(e))
  16752. },
  16753. parseFloor: function (e) {
  16754. var t = e.match(/_group([0-9]+)/)
  16755. if (!t) return 0
  16756. try {
  16757. return parseInt(t[1], 10)
  16758. } catch (e) {
  16759. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'), 0
  16760. }
  16761. },
  16762. parseRoom: function (e) {
  16763. var t = e.match(/_sub([0-9]+)/)
  16764. if (!t) return -1
  16765. try {
  16766. return parseInt(t[1], 10)
  16767. } catch (e) {
  16768. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'), 0
  16769. }
  16770. }
  16771. }
  16772. t.exports = o
  16773. }).call(this, '/js/model/Chunks.js')
  16774. },
  16775. {
  16776. '../util/logger': 189
  16777. }
  16778. ],
  16779. 136: [
  16780. function (e, t, i) {
  16781. ;(function (i) {
  16782. 'use strict'
  16783. function n(e) {
  16784. s.call(this), (this.model = e), (this.exploded = !1)
  16785. }
  16786. var r = e('../objects/Floor'),
  16787. o = (e('../settings'), e('../util/logger')),
  16788. a = e('../util/transitions'),
  16789. s = e('../util/IndexedCollection'),
  16790. l = e('../util/common'),
  16791. c = e('../util/easing')
  16792. new o(i)
  16793. l.inherit(n, s),
  16794. (n.prototype.add = function (e) {
  16795. s.prototype.add.call(this, e), this.model.add(e)
  16796. }),
  16797. (n.prototype.getIndex = function (e) {
  16798. return e.floorIndex
  16799. }),
  16800. (n.prototype.build = function () {
  16801. this.list.forEach(function (e) {
  16802. e.build()
  16803. })
  16804. }),
  16805. (n.prototype.size = function () {
  16806. return this.length
  16807. }),
  16808. (n.prototype.sort = function () {
  16809. s.prototype.sort.call(this, function (e, t) {
  16810. return e.floorIndex - t.floorIndex
  16811. })
  16812. }),
  16813. (n.prototype.nextFloor = function (e, t) {
  16814. return this.index[e.floorIndex + t] || null
  16815. }),
  16816. (n.prototype.getFloorAtPoint = function (e) {
  16817. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16818. var r = this.list[n],
  16819. o = r.distanceToPoint(e)
  16820. ;(!t || i > o) && ((i = o), (t = r))
  16821. }
  16822. return t
  16823. }),
  16824. (n.prototype.getOrMakeFloor = function (e) {
  16825. var t = this.index[e]
  16826. return t || ((t = new r(this.model, e)), this.add(t)), t
  16827. }),
  16828. (n.prototype.hide = function () {
  16829. this.list.forEach(function (e) {
  16830. e.hide()
  16831. })
  16832. }),
  16833. (n.prototype.show = function () {
  16834. this.list.forEach(function (e) {
  16835. e.show()
  16836. })
  16837. }),
  16838. (n.prototype.names = function () {
  16839. return this.list.reduce(function (e, t) {
  16840. return e.concat(t.name)
  16841. }, [])
  16842. }),
  16843. (n.prototype.toggleExplodeHorizontal = function () {
  16844. function e(e, t) {
  16845. r.copy(e.position),
  16846. (e.position.x = i[e.floorIndex] * t),
  16847. (e.position.y = 1 * e.floorIndex * t),
  16848. r.sub(e.position).multiplyScalar(-1),
  16849. e.panos.forEach(function (e) {
  16850. e.translate(r)
  16851. })
  16852. }
  16853. var t,
  16854. i = [],
  16855. n = 0
  16856. this.list.forEach(function (e, r, o) {
  16857. ;(t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0), (n += t), (i[r] = n)
  16858. }),
  16859. (i = i.map(function (e) {
  16860. return e - n / 2
  16861. }))
  16862. var r = this.list[0].position.clone()
  16863. this.exploded
  16864. ? this.list.forEach(function (t) {
  16865. a.start(
  16866. function (i) {
  16867. e(t, 1 - i)
  16868. },
  16869. 1500,
  16870. null,
  16871. 0,
  16872. c.easeOutExpo
  16873. )
  16874. })
  16875. : this.list.forEach(function (t) {
  16876. a.start(
  16877. function (i) {
  16878. e(t, i)
  16879. },
  16880. 1500,
  16881. null,
  16882. 0,
  16883. c.easeOutExpo
  16884. )
  16885. }),
  16886. (this.exploded = !this.exploded)
  16887. }),
  16888. (n.prototype.toggleExplodeVertical = function () {
  16889. function e(e, i) {
  16890. var n = n.copy(e.position)
  16891. ;(e.position.y = (5 * e.floorIndex - t.y / 2) * i),
  16892. n.sub(e.position).multiplyScalar(-1),
  16893. e.panos.forEach(function (e) {
  16894. e.translate(n)
  16895. })
  16896. }
  16897. var t = this.model.size
  16898. this.list[0].position.clone()
  16899. this.exploded
  16900. ? this.list.forEach(function (t) {
  16901. a.start(
  16902. function (i) {
  16903. e(t, 1 - i)
  16904. },
  16905. 1500,
  16906. null,
  16907. 0,
  16908. c.easeOutExpo
  16909. )
  16910. })
  16911. : this.list.forEach(function (t) {
  16912. a.start(
  16913. function (i) {
  16914. e(t, i)
  16915. },
  16916. 1500,
  16917. null,
  16918. 0,
  16919. c.easeOutExpo
  16920. )
  16921. }),
  16922. (this.exploded = !this.exploded)
  16923. }),
  16924. (t.exports = n)
  16925. }).call(this, '/js/model/FloorCollection.js')
  16926. },
  16927. {
  16928. '../objects/Floor': 146,
  16929. '../settings': 166,
  16930. '../util/IndexedCollection': 175,
  16931. '../util/common': 185,
  16932. '../util/easing': 186,
  16933. '../util/logger': 189,
  16934. '../util/transitions': 195
  16935. }
  16936. ],
  16937. 137: [
  16938. function (e, t, i) {
  16939. ;(function (i) {
  16940. 'use strict'
  16941. function n() {
  16942. c.call(this)
  16943. }
  16944. var r = e('../settings'),
  16945. o = e('../util/logger'),
  16946. a = e('../enum/Viewmode'),
  16947. s = e('../objects/Snapshot'),
  16948. l = (e('../util/math'), e('../util/common')),
  16949. c = e('../util/IndexedCollection'),
  16950. h = new o(i)
  16951. l.inherit(n, c),
  16952. (n.prototype.getImage = function (e) {
  16953. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16954. }),
  16955. (n.prototype.filterByModesAndReel = function (e, t) {
  16956. for (var i = [], n = 0; n < t.length; n += 1) {
  16957. var r = t[n],
  16958. o = this.index[r.sid]
  16959. o && i.push(o)
  16960. }
  16961. var s = e[a.DOLLHOUSE],
  16962. l = e[a.FLOORPLAN]
  16963. ;(i = i.filter(function (e) {
  16964. if (!e.metadata || void 0 === e.metadata.camera_mode) return !0
  16965. var t
  16966. try {
  16967. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16968. } catch (e) {
  16969. return h.debug(e.message), !1
  16970. }
  16971. return t === a.PANORAMA || (t === a.FLOORPLAN && l) || (t === a.DOLLHOUSE && s)
  16972. })),
  16973. i.length !== this.list.length && h.info('Disallowed ' + (this.list.length - i.length) + ' highlight images'),
  16974. (this.list = i),
  16975. this.reIndex()
  16976. }),
  16977. (n.prototype.getHeroLocations = function (panos) {
  16978. //改 增加二级location
  16979. if (0 === this.list.length) return []
  16980. var locations = []
  16981. var deal = (info, container) => {
  16982. var src = info.thumbnail_signed_src,
  16983. o = info.name || ''
  16984. if (info.metadata && void 0 !== info.metadata.camera_quaternion) {
  16985. if (!r.show360Views.enabled && info.metadata.scan_id) {
  16986. let a = panos.get(info.metadata.scan_id)
  16987. if (a && !a.isAligned()) return
  16988. }
  16989. var cameraMode = a.convertWorkshopModeInt(info.metadata.camera_mode)
  16990. if (cameraMode === a.MESH) return
  16991. if (window.isLocal) src = manage.dealURL(src)
  16992. else src = 'one' === g_version ? g_Prefix + src + '?' + randomTime().getTime() : src + '?' + randomTime().getTime()
  16993. var l = {
  16994. cameraMode: cameraMode,
  16995. position: info.metadata.camera_position,
  16996. quaternion: info.metadata.camera_quaternion,
  16997. zoom: info.metadata.zoom,
  16998. panoId: info.metadata.scan_id,
  16999. orthoZoom: info.metadata.ortho_zoom,
  17000. floorVisibility: void 0 !== info.metadata.floor_visibility ? info.metadata.floor_visibility.slice(0) : [],
  17001. thumbUrl: src,
  17002. name: n.filterImageName(o),
  17003. sid: info.sid
  17004. }
  17005. var item = new s(l)
  17006. item.momentTour = info.momentTour
  17007. item.dontRot = info.dontRot
  17008. item.rotTime = info.rotTime
  17009. item.musicInfo = info.musicInfo || g_data2.tourAudio[info.sid] || {} //新的music数据统一写在每个info下,如果有musicInfo则覆盖g_data2.tourAudio
  17010. container.push(item)
  17011. return item
  17012. }
  17013. }
  17014. this.list.forEach(image => {
  17015. if (image.images) {
  17016. var folder = $.extend({}, image)
  17017. folder.heroLocations = []
  17018. image.images.list.forEach(child => {
  17019. deal(child, folder.heroLocations)
  17020. })
  17021. folder.musicInfo = folder.musicInfo || {}
  17022. locations.push(folder)
  17023. delete folder.images
  17024. delete folder.locations
  17025. } else {
  17026. var item = deal(image, locations)
  17027. }
  17028. })
  17029. return locations
  17030. }),
  17031. (n.prototype.getIndex = function (e) {
  17032. return e.sid
  17033. }),
  17034. (n.filterImageName = function (e) {
  17035. return '' === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  17036. }),
  17037. (t.exports = n)
  17038. }).call(this, '/js/model/ImageCollection.js')
  17039. },
  17040. {
  17041. '../enum/Viewmode': 51,
  17042. '../objects/Snapshot': 153,
  17043. '../settings': 166,
  17044. '../util/IndexedCollection': 175,
  17045. '../util/common': 185,
  17046. '../util/logger': 189,
  17047. '../util/math': 190
  17048. }
  17049. ],
  17050. 138: [
  17051. function (e, t, i) {
  17052. ;(function (i) {
  17053. 'use strict'
  17054. function n() {
  17055. u.call(this)
  17056. }
  17057. var r = e('../label/Label'),
  17058. o = e('../settings'),
  17059. a = e('../util/logger'),
  17060. s = e('../util/math'),
  17061. l = e('../util/ajax'),
  17062. c = e('./RoomCollection'),
  17063. h = e('../util/common'),
  17064. u = e('../util/IndexedCollection')
  17065. new a(i)
  17066. h.inherit(n, u),
  17067. (n.prototype.getIndex = function (e) {
  17068. return e.labelId
  17069. }),
  17070. (n.prototype.associateWithRooms = function (e) {
  17071. this.forEach(function (t) {
  17072. e.forEach(function (e) {
  17073. e.roomId === t.roomId && (t.room = e)
  17074. })
  17075. })
  17076. }),
  17077. (n.prototype.createFromLabelData = function (e) {
  17078. e.forEach(
  17079. function (e) {
  17080. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId)
  17081. t = c.generateRoomId(e.floorId, t)
  17082. var i = new r(e.sid, e.position || e.positions[0], e.text, e.floorId, t)
  17083. ;(i.position = s.convertWorkshopVector(i.position)), this.add(i), i.build()
  17084. }.bind(this)
  17085. )
  17086. }),
  17087. (n.prototype.load = function (e, t) {
  17088. return l
  17089. .get(e, {
  17090. responseType: 'json',
  17091. auth: t ? o.authorizationHeader : null
  17092. })
  17093. .done(
  17094. function (e) {
  17095. var t = []
  17096. for (var i in e) {
  17097. var n = e[i]
  17098. t.push(n)
  17099. }
  17100. this.createFromLabelData(t)
  17101. }.bind(this)
  17102. )
  17103. }),
  17104. (n.parseRoomIndexFromWorkshopRoomId = function (e) {
  17105. var t = -1
  17106. if (e) {
  17107. if (typeof e == 'number') {
  17108. //add
  17109. t = parseInt(e)
  17110. } else {
  17111. var i = e.split('_')
  17112. t = parseInt(i[0])
  17113. }
  17114. }
  17115. return t
  17116. }),
  17117. (t.exports = n)
  17118. }).call(this, '/js/model/LabelCollection.js')
  17119. },
  17120. {
  17121. '../label/Label': 90,
  17122. '../settings': 166,
  17123. '../util/IndexedCollection': 175,
  17124. '../util/ajax': 181,
  17125. '../util/common': 185,
  17126. '../util/logger': 189,
  17127. '../util/math': 190,
  17128. './RoomCollection': 141
  17129. }
  17130. ],
  17131. 139: [
  17132. function (e, t, i) {
  17133. ;(function (i) {
  17134. 'use strict'
  17135. function n(e, t) {
  17136. o.Object3D.call(this)
  17137. this.sid = window.number //t.sid,
  17138. ;(this.data = t),
  17139. (this.options = e),
  17140. (this.urls = new s(e.urlFiles)),
  17141. (this.isPublic = void 0 !== t.is_public && t.is_public),
  17142. //创建heroLocations
  17143. (this.images = new _(this)),
  17144. this.images.extend(t.images),
  17145. this.images.forEach(info => {
  17146. if (info.locations) {
  17147. info.images = new _(this)
  17148. info.images.extend(info.locations)
  17149. }
  17150. })
  17151. this.heroLocations = []
  17152. //this.heroImage = this.images.getImage(t.icon), //初始画面沒有用到icon
  17153. ;(this.outdoorPanoLocations = []),
  17154. (this.floors = new d(this)),
  17155. (this.floorsEnabled = void 0 === e.floors || e.floors),
  17156. (this.changingFloor = !1),
  17157. (this.chunks = []),
  17158. (this.panos = new A()),
  17159. (this.colliders = []),
  17160. (this.loadPanosPromise = null),
  17161. (this.loadMeshTexturesPromise = null),
  17162. (this.auxDataPromise = null),
  17163. (this.meshTexturesLoaded = !1),
  17164. (this.meshTextures = []),
  17165. (this.tags = {}),
  17166. (this.tagsShown = !1),
  17167. (this.shouldShowtags = !1),
  17168. (this.has360Views = !1),
  17169. (this.showingLabels = f.labels.enabled && t.player_options.labels),
  17170. (this.supportedModes = {}),
  17171. (this.supportedModes[c.PANORAMA] = !0),
  17172. (this.supportedModes[c.DOLLHOUSE] = !t.player_options || (t.player_options.dollhouse && w.valueFromHash('dh', 1))),
  17173. (this.supportedModes[c.FLOORPLAN] = !t.player_options || (t.player_options.floor_plan && w.valueFromHash('dh', 1))),
  17174. (this.supportedModes[c.TRANSITIONING] = !0),
  17175. (this.supportsTiles = this.configureTiling()),
  17176. // this.supportsVR = t.is_vr,
  17177. (this.supportsVR = window.DATA.supportsVR || false) //true; // 方奕卓 VR功能可配置
  17178. ;(this.mode = c.DOLLHOUSE),
  17179. (this.size = null),
  17180. (this.center = null),
  17181. (this.boundingBox = new o.Box3()),
  17182. (this.currentFloor = null),
  17183. (this.allFloorsVisible = !0),
  17184. (this.projectedPano0 = null),
  17185. (this.projectedPano1 = null),
  17186. this.floorsEnabled &&
  17187. t.floors &&
  17188. t.floors.indexOf(',') !== -1 &&
  17189. t.floors.split(',').forEach(
  17190. function (e, t) {
  17191. this.addFloor(new u(this, t, e.trim()))
  17192. }.bind(this)
  17193. ),
  17194. (this.waitQueue = []),
  17195. this.on(
  17196. 'load',
  17197. function (e) {
  17198. 0 !== this.waitQueue.length &&
  17199. ((this.waitQueue = this.waitQueue.filter(function (e) {
  17200. return !e.isLoadedCallback()
  17201. })),
  17202. 0 === this.waitQueue.length && this.emit('waiting-done'))
  17203. }.bind(this)
  17204. ),
  17205. this.setupCustomProperties()
  17206. this.hots = {}
  17207. }
  17208. function r() {
  17209. try {
  17210. var e = document.createElement('canvas'),
  17211. t = e.getContext('webgl')
  17212. t || (t = e.getContext('experimental-webgl'))
  17213. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE)
  17214. return i
  17215. } catch (e) {
  17216. return 0
  17217. }
  17218. }
  17219. var o = e('three'),
  17220. a = e('../util/ajax'),
  17221. s = e('../util/ModelUrls'),
  17222. l = e('../objects/BoundingTextureSkybox'),
  17223. c = e('../enum/Viewmode'),
  17224. h = e('../enum/RenderOrder'),
  17225. u = (e('../enum/AlignmentType'), e('../objects/Floor')),
  17226. d = e('./FloorCollection'),
  17227. p = e('../objects/Chunk'),
  17228. f = (e('../objects/Room'), e('../objects/Snapshot'), e('../label/Label'), e('../util/math'), e('../settings')),
  17229. ss = e('../shaders'),
  17230. g = e('../util/logger'),
  17231. m = e('../tag/tag'),
  17232. v = (e('../tag/tagManager'), e('../objects/Panorama')),
  17233. A = e('../util/PanoramaCollection'),
  17234. y = e('../loaders/ModelLoader'),
  17235. C = e('../loaders/ModelTextureLoader'),
  17236. I = e('../loaders/SweepDataLoader'),
  17237. E = e('../util/transitions'),
  17238. b = e('../util/common'),
  17239. es = e('../util/easing'),
  17240. lerp = e('../util/lerp'),
  17241. tex = e('../util/texture'),
  17242. w = e('./../util/browser'),
  17243. _ = e('./ImageCollection'),
  17244. T = e('./RoomCollection'),
  17245. x = e('./LabelCollection'),
  17246. S = e('./Chunks'),
  17247. cameraLight = e('./util/cameraLight'),
  17248. M = e('./../util/showcase'),
  17249. R = e('../exception/BasicException'),
  17250. P = (e('../constants'), e('events').EventEmitter),
  17251. GLCubeFaces = e('../enum/GLCubeFaces'),
  17252. //,Hot = e("hot")
  17253. O = new g(i)
  17254. ;(n.prototype = Object.create(o.Object3D.prototype)),
  17255. b.extend(n, P),
  17256. (n.prototype.setupCustomProperties = function () {
  17257. var e = f.modelAlpha
  17258. Object.defineProperty(this, 'alpha', {
  17259. get: function () {
  17260. return e
  17261. },
  17262. set: function (t) {
  17263. e = t
  17264. //console.log(t)
  17265. this.chunks.forEach(function (chunk) {
  17266. if (chunk.material && chunk.material.uniforms.modelAlpha) {
  17267. chunk.material.uniforms.modelAlpha.value = e
  17268. //修改一下defines,为了在不需要map时不加载map。 by xzw
  17269. /* if (e>0) {
  17270. if (!('useModelMap' in chunk.material.defines)) {
  17271. chunk.material.defines.useModelMap = ''
  17272. chunk.material.needsUpdate = true
  17273. console.log('add useModelMap')
  17274. }
  17275. } else {
  17276. if ('useModelMap' in chunk.material.defines) {
  17277. delete chunk.material.defines.useModelMap
  17278. chunk.material.needsUpdate = true
  17279. chunk.material.uniforms.map.value.dispose() //防止崩溃(但是因为这样飞出要等待时间所以被去掉了)
  17280. console.log('delete useModelMap')
  17281. }
  17282. } */
  17283. }
  17284. })
  17285. }
  17286. })
  17287. }),
  17288. (n.prototype.configureTiling = function () {
  17289. var e = r()
  17290. if (e < 2048) return !1
  17291. O.warn('Max cube texture size: ' + e)
  17292. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  17293. var i = f.tiling.tilingFlagNames[t]
  17294. if ('1' === w.valueFromHash(i, null)) return !0
  17295. if ('0' === w.valueFromHash(i, null)) return !1
  17296. }
  17297. //--------------------------------------------许钟文-------------------------------------------
  17298. //return true;
  17299. return !!M.modelDataPromisesTiles(this.data) //免去访问mdoeldata.json的vision_version,不明白这是什么
  17300. //--------------------------------------------e n d -------------------------------------------
  17301. }),
  17302. (n.prototype.toggleAlpha = function () {
  17303. this.alpha < 1 ? (this.alpha = 1) : (this.alpha = 0)
  17304. }),
  17305. (n.prototype.load = function (e) {
  17306. var t = function () {
  17307. return $.when(this.loadPanos(), this.loadMesh())
  17308. },
  17309. i = this.urls.init().then(t.bind(this))
  17310. return (
  17311. e ? (i = i.then(this.loadMeshTextures.bind(this))) : i.then(this.loadMeshTextures.bind(this)),
  17312. (this.auxDataPromise = $.when(/*this.loadHighlightReel(), this.loadtags() */ this.loadhots(), this.loadLabels())),
  17313. $.when(i, this.auxDataPromise).done(this.build.bind(this))
  17314. ) //不要另外使用active_reel文件
  17315. }),
  17316. (n.prototype.loadMesh = function () {
  17317. function e(e) {
  17318. O.error(e), n.reject('loading-failed')
  17319. }
  17320. function t(e, t) {
  17321. n.notify(e, t)
  17322. }
  17323. function i(e, t) {
  17324. if (0 === e.length) {
  17325. O.warn('No geometry found for model, loading faux geometry, disabling outside mode'), (r.supportedModes[c.DOLLHOUSE] = !1), (r.supportedModes[c.FLOORPLAN] = !1)
  17326. var i = new p({
  17327. geometry: new o.PlaneBufferGeometry(5, 5, 1, 1)
  17328. })
  17329. ;(i.material.visible = !1), i.rotateX(-Math.PI / 2), i.geometry.computeBoundingBox(), (e = [i])
  17330. }
  17331. e.forEach(function (e) {
  17332. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0
  17333. r.addChunk(t, e)
  17334. }),
  17335. r.floors.sort(),
  17336. n.resolve(r)
  17337. }
  17338. var n = $.Deferred(),
  17339. r = this
  17340. return y.load(r.data.job.uuid, r.urls, i, t, e), n.promise()
  17341. }),
  17342. (n.prototype.loadMeshTextures = function () {
  17343. return this.loadTexturesPromise
  17344. ? this.loadTexturesPromise
  17345. : ((this.loadTexturesPromise = C.load(this, this.meshTextures).then(
  17346. function () {
  17347. this.meshTexturesLoaded = !0
  17348. }.bind(this)
  17349. )),
  17350. this.loadTexturesPromise)
  17351. }),
  17352. /* n.prototype.loadtags = function() {//xzw改
  17353. var e = $.Deferred();
  17354. if (!f.tags.enabled)
  17355. return e.resolve();
  17356. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17357. t = "data/" + this.sid + "/tags.json"
  17358. return a.get(t, {
  17359. responseType: "json",
  17360. auth: this.isPublic ? null : f.authorizationHeader
  17361. }).done(function(t) {
  17362. var i = 0
  17363. , n = 0;
  17364. for (var r in t) {
  17365. var o = t[r];
  17366. o.enabled && (n++,
  17367. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17368. i++))
  17369. }
  17370. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17371. e.resolve()
  17372. }
  17373. .bind(this)).fail(function() {
  17374. O.warn("Getting tags failed, not displaying tags."),
  17375. e.resolve()
  17376. }),
  17377. e
  17378. } */
  17379. (n.prototype.shineHots = function () {
  17380. //xzw
  17381. E.trigger({
  17382. func: function (e) {
  17383. var opa = e <= 0.5 ? 2 * e : -2 * e + 2
  17384. for (var i in this.hots) {
  17385. this.hots[i].mesh.material.uniforms.opac.value = opa
  17386. }
  17387. }.bind(this),
  17388. cycling: true,
  17389. duration: 3000,
  17390. //easing: "easeInOutQuad",
  17391. name: 'hotShine'
  17392. })
  17393. }),
  17394. /* n.prototype.loadOverlays = function(overlays){
  17395. var overlays = window.data2 && window.data2.overlays
  17396. overlays && overlays.forEach((info)=>{
  17397. new Overlay(info)
  17398. })
  17399. Overlay.load()
  17400. }
  17401. */
  17402. (n.prototype.loadhots = function () {
  17403. //xzw
  17404. initHot(this)
  17405. var r = $.Deferred()
  17406. var t = g_Prefix + 'data/' + this.sid + '/data2.js' + '?' + randomTime().getTime()
  17407. return (
  17408. a
  17409. .get(t, {
  17410. responseType: 'json',
  17411. auth: this.isPublic ? null : f.authorizationHeader
  17412. })
  17413. .done(
  17414. function (e) {
  17415. window.data2 = e
  17416. this.roomLabels = []
  17417. if (!e) {
  17418. console.error('data2 is null')
  17419. } else {
  17420. g_data2 = hotMatcher(e)
  17421. this.hotsCount = 0
  17422. let create = () => {
  17423. //因为热点保存后在hots里的顺序会被修改,所以使用order来记录顺序,这里要重排序:
  17424. if (e.hots) {
  17425. var sids = Object.keys(e.hots).sort((a, b) => {
  17426. return e.hots[a].order - e.hots[b].order
  17427. })
  17428. sids.forEach(sid => {
  17429. e.hots[sid].sid = sid
  17430. //if(e.hots[sid].texType == "shine" || e.hots[sid].texType == "photo" ){
  17431. //e.hots[sid].styleImg = []
  17432. new Hot(e.hots[sid], e.hots[sid].version != 'multi' && 'byHot')
  17433. //}
  17434. })
  17435. }
  17436. if (e.overlays) {
  17437. e.overlays.forEach(info => {
  17438. //if(info.file.includes('m/data/762/edit/20210312_112357584.mp4') )return;
  17439. new Hot(info, 'byOverlay')
  17440. })
  17441. }
  17442. Hot.createHotList()
  17443. Hot.startLoad()
  17444. if (DATA.roomLabels) {
  17445. DATA.roomLabels.forEach(data => {
  17446. this.roomLabels.push(new RoomLabel(data))
  17447. })
  17448. }
  17449. }
  17450. if (player.currentPano) {
  17451. create()
  17452. } else {
  17453. let f = () => {
  17454. window.bus.removeEventListener('playerAndModelReady', f)
  17455. create()
  17456. }
  17457. window.bus.addEventListener('playerAndModelReady', f)
  17458. }
  17459. g_index = w.valueFromHash('m')
  17460. }
  17461. /***************************方奕卓 请求data.js数据, 用于初始化热点列表 ****************************/
  17462. /* var dataJsPromise = $.Deferred();
  17463. var dataJsUrl = g_Prefix+"data/" + this.sid + "/hot/js/data.js" +'?'+ randomTime().getTime();
  17464. a.get(dataJsUrl,{
  17465. responseType: "json",
  17466. auth: this.isPublic ? null : f.authorizationHeader
  17467. }).done(function(data) {
  17468. window.hotData = data;
  17469. this.createHotItem(data, this.hots);
  17470. for(let i in this.hots){//add
  17471. data[i] && this.hots[i].initStyleImg(data[i]);
  17472. }
  17473. dataJsPromise.resolve();
  17474. }.bind(this)).fail(function(){
  17475. console.log('Data.js is empty');
  17476. dataJsPromise.resolve();
  17477. }) */
  17478. r.resolve()
  17479. }.bind(this)
  17480. )
  17481. .fail(function () {
  17482. console.log('没有热点')
  17483. r.resolve()
  17484. }),
  17485. r
  17486. )
  17487. }),
  17488. (n.prototype.loadPanos = function () {
  17489. if (this.loadPanosPromise) return this.loadPanosPromise
  17490. var e = new I(this)
  17491. return (
  17492. (this.loadPanosPromise = e.load().then(
  17493. function (e) {
  17494. return (
  17495. this.data.sweeps &&
  17496. Object.keys(this.data.sweeps).length > 0 &&
  17497. (e = e.filter(
  17498. function (e) {
  17499. if (this.data.sweeps[e.uuid]) return this.data.sweeps[e.uuid].enabled
  17500. else console.log(e.uuid)
  17501. }.bind(this)
  17502. )),
  17503. this.panos.extend(
  17504. e.map(
  17505. function (e) {
  17506. return new v(this, e.uuid, e, this.supportsTiles)
  17507. }.bind(this)
  17508. )
  17509. ),
  17510. this.panos.forEach(
  17511. function (e) {
  17512. e.neighbourUUIDs &&
  17513. (e.neighbourUUIDs.forEach(
  17514. function (t) {
  17515. var i = this.panos.get(t)
  17516. i && this.panos.setNeighbour(e, i, !0)
  17517. }.bind(this)
  17518. ),
  17519. (e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0)))
  17520. }.bind(this)
  17521. ),
  17522. 0 === this.panos.length && (O.warn('Model has no panos, turning off inside mode'), (this.supportedModes[c.PANORAMA] = !1)),
  17523. $.when(this)
  17524. )
  17525. }.bind(this)
  17526. )),
  17527. this.loadPanosPromise
  17528. )
  17529. }),
  17530. (n.prototype.loadHighlightReel = function () {
  17531. //xzw
  17532. var e = $.Deferred(),
  17533. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17534. t = this.options.urlBase + 'data/' + this.sid + '/active_reel.json'
  17535. return (
  17536. a
  17537. .get(t, {
  17538. responseType: 'json',
  17539. auth: this.isPublic ? null : f.authorizationHeader
  17540. })
  17541. .done(
  17542. function (t) {
  17543. t.reel ? (O.info('Got highlight reel with ' + t.reel.length + ' items'), this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info('No highlight reel found'),
  17544. e.resolve()
  17545. }.bind(this)
  17546. )
  17547. .fail(function () {
  17548. O.warn('Getting highlight reel failed, no highlights available'), e.resolve()
  17549. }),
  17550. e
  17551. )
  17552. }),
  17553. (n.prototype.waitForLoad = function (e, t) {
  17554. t() ||
  17555. (this.waitQueue.push({
  17556. object: e,
  17557. isLoadedCallback: t
  17558. }),
  17559. 1 === this.waitQueue.length && this.emit('waiting'))
  17560. }),
  17561. (n.prototype.hide = function () {
  17562. this.floors.hide()
  17563. }),
  17564. (n.prototype.show = function () {
  17565. this.floors.show()
  17566. }),
  17567. (n.prototype.floorNames = function () {
  17568. return this.floors.names()
  17569. }),
  17570. (n.prototype.warpDestFloors = function (e, t) {
  17571. if (!e || this.floors.length !== e.length) return void this.toggleAllFloors(!0)
  17572. var i = e.findIndex(
  17573. function (e) {
  17574. return e
  17575. }.bind(this)
  17576. )
  17577. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17578. }),
  17579. (n.prototype.setFloor = function (e, t, i) {
  17580. this.allFloorsVisible && this.emit('allfloors.toggled', !1, this.currentFloor), (this.allFloorsVisible = !1), this._setFloor(e, t, i)
  17581. }),
  17582. (n.prototype.toggleAllFloors = function (e) {
  17583. ;(this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible), this.emit('allfloors.toggled', this.allFloorsVisible, this.currentFloor), this._setFloor(this.currentFloor)
  17584. }),
  17585. (n.prototype._setFloor = function (e, t, i) {
  17586. ;(t = t || this.mode), this.emit('floor.changed', e, t, this.currentFloor), (this.currentFloor = e)
  17587. var n
  17588. if (t === c.PANORAMA) {
  17589. if ((this.show(), this.shouldShowtags && this.tagsShown)) for (n in this.tags) this.tags[n].show(f.showFloorDuration)
  17590. } else if (
  17591. (t === c.FLOORPLAN || t === c.DOLLHOUSE) &&
  17592. (this.floors.list.forEach(
  17593. function (e, t) {
  17594. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17595. }.bind(this)
  17596. ),
  17597. this.shouldShowtags && this.tagsShown)
  17598. )
  17599. for (n in this.tags) {
  17600. var r = this.tags[n]
  17601. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17602. }
  17603. var o = this,
  17604. a = e
  17605. E.start(
  17606. function () {},
  17607. f.showFloorDelay,
  17608. function () {
  17609. o.floors.forEach(function (e) {
  17610. e.chunks.forEach(function (t) {
  17611. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17612. })
  17613. })
  17614. }.bind(this)
  17615. )
  17616. }),
  17617. (n.prototype.toggleExplode = function () {
  17618. this.floors.toggleExplodeHorizontal()
  17619. }),
  17620. (n.prototype.toggleExplodeUp = function () {
  17621. this.floors.toggleExplodeVertical()
  17622. }),
  17623. (n.prototype.nextFloor = function (e) {
  17624. return this.floors.nextFloor(this.currentFloor, e)
  17625. }),
  17626. (n.prototype.addFloor = function (e) {
  17627. this.floors.add(e)
  17628. }),
  17629. (n.prototype.getFloorAtPoint = function (e) {
  17630. return this.floors.getFloorAtPoint(e)
  17631. }),
  17632. (n.prototype.getTagBySid = function (e) {
  17633. return this.tags[e]
  17634. }),
  17635. (n.prototype.addChunk = function (e, t) {
  17636. this.floors.getOrMakeFloor(e).addChunk(t), this.chunks.push(t)
  17637. }),
  17638. (n.prototype.setMode = function (e) {
  17639. if (!this.supportedModes[e]) throw new R('Mode not supported for this model: ' + e)
  17640. this.mode = e
  17641. this.skybox.material.transparent = e == 'panorama' ? false : true //xzw add // 如果skybox透明,会让其中其他mesh 如热点的透明出问题
  17642. this.chunks.forEach(function (t) {
  17643. t.setMode(e)
  17644. })
  17645. }),
  17646. (n.prototype.build = function () {
  17647. this.heroLocations = this.images.getHeroLocations(this.panos)
  17648. var e = function () {
  17649. return (
  17650. !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) &&
  17651. !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  17652. )
  17653. }.bind(this)()
  17654. ;(this.has360Views =
  17655. (f.show360Views.enabled &&
  17656. this.heroLocations.some(
  17657. function (e) {
  17658. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17659. }.bind(this)
  17660. )) ||
  17661. e),
  17662. null === this.heroImage && O.warn('No hero image defined.'),
  17663. (this.currentFloor = this.floors.last()),
  17664. this.floors.build(),
  17665. (this.colliders = this.floors.reduce(function (e, t) {
  17666. return e.concat(t.collider.children)
  17667. }, [])),
  17668. this.panos.forEach(
  17669. function (e) {
  17670. e.build1(),
  17671. e.on(
  17672. 'enter',
  17673. function () {
  17674. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17675. }.bind(this)
  17676. )
  17677. }.bind(this)
  17678. )
  17679. //有很多场景的floorPosition在地面之下,导致marker看不到,所以探测一下
  17680. let time1 = performance.now()
  17681. let downVec = new THREE.Vector3(0, -1, 0)
  17682. this.panos.forEach(pano => {
  17683. player.raycaster.set(pano.position, downVec)
  17684. let collider = pano.floor.collider.children
  17685. let n = player.raycaster.intersectObjects(collider, true) //add true
  17686. if (n && n[0]) {
  17687. if (n[0].point.y - pano.floorPosition.y > 0.03) {
  17688. //console.error(`${pano.id}, 探测高度${n[0].point.y.toPrecision(5)} 原高度 ${pano.floorPosition.y.toPrecision(5)}, 相差 ${(n[0].point.y - pano.floorPosition.y).toPrecision(5)}`)
  17689. pano.originFloorY = pano.floorPosition.y
  17690. pano.floorPosition.y = n[0].point.y
  17691. }
  17692. }
  17693. //是否需要排除一下相差过高的?因为可能探测到的是长椅这样的
  17694. })
  17695. let time2 = performance.now()
  17696. console.log('探测时间', time2 - time1)
  17697. this.panos.forEach(function (e) {
  17698. e.build2()
  17699. }),
  17700. this.floors.forEach(
  17701. function (e) {
  17702. this.boundingBox.union(e.boundingBox)
  17703. }.bind(this)
  17704. ),
  17705. (this.size = this.boundingBox.size()),
  17706. (this.center = this.boundingBox.center()),
  17707. this.floors.forEach(
  17708. function (e) {
  17709. O.info('Floor ' + e + ': ' + e.children.length + ' chunks, ' + e.panos.length + ' panos.')
  17710. }.bind(this)
  17711. ),
  17712. this.panos.populate_path_graph(),
  17713. (this.skybox = new l(this.boundingBox)),
  17714. (this.skybox.matrixWorldNeedsUpdate = !0),
  17715. this.add(this.skybox)
  17716. /* setTimeout(function() {
  17717. //this.hotsCount && this.shineHots()
  17718. Hot.beginShineHot()
  17719. }
  17720. .bind(this), 1300) */
  17721. //add-----
  17722. {
  17723. let maxCount = browser.isMobile() ? 200000 : 400000
  17724. let noVisiHots = this.hotGroup.children.filter(e => !e.info.visiblePanos && e.info.texType != 'shine') //只看非热点的,否则数据太多
  17725. let visiHots = this.hotGroup.children.filter(e => e.info.visiblePanos)
  17726. let c = this.panos.list.length * this.colliders.length * noVisiHots.length
  17727. if (c > maxCount) {
  17728. //防止加载时间过长,分批计算
  17729. console.log('hot分批setVisiblePanos')
  17730. Hot.visiPanosCountSlice = Math.ceil(maxCount / this.colliders.length / noVisiHots.length)
  17731. Hot.visiEveryDurSlice = browser.isMobile() ? 25 : 16
  17732. let dur = Math.ceil(this.panos.list.length / Hot.visiPanosCountSlice) * Hot.visiEveryDurSlice
  17733. console.log(Hot.visiPanosCountSlice, Hot.visiEveryDurSlice, dur, Math.round(dur * noVisiHots.length))
  17734. if (noVisiHots.length) {
  17735. let i = 0
  17736. let hotVisiInterval = setInterval(() => {
  17737. noVisiHots[i].setVisiblePanos(noVisiHots[i].info.visiblePanos)
  17738. i++
  17739. if (i >= noVisiHots.length) {
  17740. clearInterval(hotVisiInterval)
  17741. }
  17742. }, dur)
  17743. }
  17744. }
  17745. }
  17746. //---------
  17747. this.createFloorLogo()
  17748. return (
  17749. O.debug('Done building model'),
  17750. v.raycastsDone > 0 && (O.warn('raycasts: ' + v.raycastsDone), O.warn('raycasts skipped: ' + v.raycastsSkipped)),
  17751. this.buildRooms(),
  17752. this.labels.associateWithRooms(this.rooms),
  17753. $.when(this)
  17754. )
  17755. }),
  17756. (n.prototype.createFloorLogo = function () {
  17757. console.log('createFloorLogo')
  17758. if (this.floorLogos || !settings.floorlogoURL) return
  17759. var url = settings.floorlogoURL
  17760. var map = tex.load(url) //可以追加done
  17761. this.floorLogos = []
  17762. for (var i = 0; i < 2; i++) {
  17763. //不可共用uniforms等 [0]在上一个位置,[1]是下一个位置、 是飞入及飞出后的位置
  17764. var material = new o.MeshBasicMaterial({
  17765. opacity: 0,
  17766. map: map,
  17767. side: o.DoubleSide,
  17768. transparent: !0,
  17769. depthWrite: !1,
  17770. depthTest: false //改 在chunk\skybox外也可看到
  17771. })
  17772. var logo = new o.Mesh(new o.PlaneGeometry(2, 2, 1, 1), material)
  17773. //var s = (Store.metadata.floorLogoSize || 100)/100;
  17774. //logo.scale.set(s,s,s);
  17775. logo.position.set(0, -1.5, 0)
  17776. logo.lookAt(logo.position.clone().add(new o.Vector3(0, 1, 0)))
  17777. logo.renderOrder = 100 //cover the videoSkybox
  17778. //logo.layers.set(0)
  17779. this.add(logo)
  17780. this.floorLogos.push(logo)
  17781. }
  17782. this.floorLogos[1].visible = false
  17783. })
  17784. ;(n.prototype.adjustfloorLogoHeight = function (o) {
  17785. var h = player.currentPano.floorPosition.y + 0.01
  17786. this.floorLogos[1].position.setY(h)
  17787. this.floorLogos[0].position.setY(h)
  17788. //publicObjectSet.player.path.currentPanoMarker.mesh.position.y = h
  17789. }),
  17790. (n.prototype.changefloorLogoOpa = function (o) {
  17791. //改 i, opacity, time, delay
  17792. if (!this.floorLogos) return
  17793. E.cancelById('flOpa_' + o.index) //先停止之前该logo的透明度变化
  17794. if (o.from != void 0) this.floorLogos[o.index].material.opacity = o.from //初始透明度
  17795. if (!o.dur) {
  17796. //立刻
  17797. //this.floorLogos[o.index].material.uniforms.opacity.value = o.opa;
  17798. this.floorLogos[o.index].material.opacity = o.opa
  17799. } else {
  17800. //E.start(lerp.uniform(this.floorLogos[o.index], "opacity", o.opa), o.dur || 0, null,
  17801. E.start(lerp.property(this.floorLogos[o.index].material, 'opacity', o.opa), o.dur || 0, null, o.delay || 0, es['easeInQuad'], 'changefloorLogoOpa', 'flOpa_' + o.index)
  17802. }
  17803. }),
  17804. (n.prototype.updateFloorlogo = (function () {
  17805. //xzw add 更新地标的旋转
  17806. var lastQ, lastP
  17807. var equals = function (v1, v2, min) {
  17808. return Math.abs(v1 - v2) < min
  17809. }
  17810. var isSame = function (now, last, k) {
  17811. //如果和上次相同就不改变
  17812. if (!last) return false
  17813. var R = k.sceneRenderer
  17814. //var min = R.AFPS < 38 ? 0.005 : R.AFPS < 45 ? 0.0008 : R.AFPS < 50 ? 0.0006 : 0.0003;
  17815. //暂时:
  17816. var min = 0.0008
  17817. var same = equals(now.x, last.x, min) && equals(now.y, last.y, min) && equals(now.z, last.z, min) && (now.w != void 0 ? equals(now.w, last.w, min) : true)
  17818. return same
  17819. }
  17820. return function (Q, k) {
  17821. if (!Q) return
  17822. /* if(Config.ifFish && window.lowFPS){
  17823. this.fLCompute++;
  17824. if(R.AFPS < 38){
  17825. if(k.flyingToTag && k.flying && k.fLCompute %4 !=1) return; //点击tag过渡
  17826. else if(k.flying && k.fLCompute%2 !=1) return;
  17827. k.fLCompute %= 4;
  17828. }else if(R.AFPS < 45){
  17829. if(k.flyingToTag && k.flying && k.fLCompute %3 !=1) return; //点击tag过渡
  17830. else if(k.flying && k.fLCompute%2 !=1) return;
  17831. k.fLCompute %= 6;
  17832. }else{
  17833. if(k.flyingToTag && k.flying && k.fLCompute %2 !=1) return;
  17834. //else if(k.flying && k.fLCompute%2 !=1) return;
  17835. k.fLCompute %= 2;
  17836. }
  17837. } */
  17838. var sameQ, sameP, quaternion, visible
  17839. for (var i = 0; i < 2; i++) {
  17840. var logo = this.floorLogos[i]
  17841. if (!logo.visible || logo.material.uniforms.opacity.value == 0) continue
  17842. visible = true
  17843. }
  17844. if (!visible) return //如果两个都不可见,就不更改,如果有一个可见,就都改
  17845. var c = k.cameraControls.activeControl
  17846. var sameQ = c ? (c.lat < 10 ? equals(c.lon, lastQ, 0.1) : equals(c.lon, lastQ, 1)) : false
  17847. sameQ || (lastQ = c ? c.lon : null) //相机旋转是否改变了
  17848. for (var i = 0; i < 2; i++) {
  17849. var logo = this.floorLogos[i]
  17850. if (!sameQ) {
  17851. if (!quaternion) {
  17852. var a = new THREE.Vector3(0, 0, -1)
  17853. a.applyQuaternion(Q)
  17854. a.setY(0)
  17855. var _ = new THREE.Matrix4().lookAt(a, new THREE.Vector3(), new THREE.Vector3(0, 1, 0))
  17856. quaternion = new THREE.Quaternion().setFromRotationMatrix(_)
  17857. var a = new THREE.Quaternion(0, 0.7071067811865476, 0.7071067811865476, 0) //计算得
  17858. quaternion.multiply(a)
  17859. }
  17860. logo.quaternion.copy(quaternion)
  17861. }
  17862. }
  17863. }
  17864. })())
  17865. ;(n.prototype.loadLabels = function () {
  17866. //xzw
  17867. this.labels = new x(this)
  17868. var e = $.Deferred()
  17869. //加载俯视图的标签 注释这个备注就会加载
  17870. //原先是labels, 改为showLabels,因为之前的somedata写的labels都是true
  17871. window.DATA.showingLabels ? (this.showingLabels = true) : ''
  17872. if (!this.showingLabels) return e.resolve()
  17873. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17874. var t = g_Prefix + 'data/' + this.sid + '/labels.json'
  17875. return (
  17876. this.labels
  17877. .load(t, !this.isPublic)
  17878. .done(e.resolve.bind(e))
  17879. .fail(function () {
  17880. O.warn('Getting labels failed, not displaying labels.'), e.resolve()
  17881. }),
  17882. e
  17883. )
  17884. }),
  17885. (n.prototype.buildRooms = function () {
  17886. ;(this.rooms = new T(this)), this.rooms.createFromChunks(this.chunks), this.rooms.calcRoomBoundaries()
  17887. }),
  17888. (n.prototype.updateProjectedPanos = function () {
  17889. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17890. }),
  17891. (n.prototype.setProjectedPanos = function (e, t, i) {
  17892. ;(void 0 !== i && null !== i) || (i = !0),
  17893. (i = !!i),
  17894. (this.projectedPano0 = e),
  17895. (this.projectedPano1 = t),
  17896. this.skybox.material.setProjectedPanos(e, t, i),
  17897. this.chunks.forEach(function (n) {
  17898. n.materialInside.setProjectedPanos(e, t, i)
  17899. })
  17900. }),
  17901. (n.prototype.setSide = function (e) {
  17902. this.floors.forEach(function (t) {
  17903. t.collider.material.side = e
  17904. })
  17905. }),
  17906. (n.prototype.heroCount = function () {
  17907. return this.heroLocations ? this.heroLocations.length : 0
  17908. }),
  17909. (n.prototype.getHeroDescriptorByIndex = function (e = []) {
  17910. //改 因增加了二级目录
  17911. if (e[0] < 0) return O.warn('Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0.'), null
  17912. if (this.heroCount() < 1) return O.warn('Model.getHeroDescriptorByIndex() -> No hero locations in this model'), null
  17913. var t = this.heroLocations[e[0]]
  17914. if (t.heroLocations && e[1] != void 0) {
  17915. t = t.heroLocations[e[1]]
  17916. }
  17917. return void 0 === t ? (O.warn('Model.getHeroDescriptorByIndex() -> Index ' + e + ' is not a validindex'), null) : t
  17918. }),
  17919. (n.prototype.findPanoramicHero = function () {
  17920. for (var e in this.heroLocations) if (this.heroLocations[e].cameraMode === c.PANORAMA) return this.heroLocations[e]
  17921. return null
  17922. }),
  17923. (n.prototype.listImagePanos = function () {
  17924. var e = [],
  17925. t = this
  17926. return (
  17927. this.images.forEach(function (i) {
  17928. if (i.metadata && i.metadata.scan_id) {
  17929. var n = t.panos.get(i.metadata.scan_id)
  17930. n && (t.supportsTiles || n.isLoaded('high') || e.push(n))
  17931. }
  17932. }),
  17933. e
  17934. )
  17935. }),
  17936. (n.prototype.fadePanoMarkers = function (/* e, t */ opacity, dur, o = {}) {
  17937. //改
  17938. //this.panos.fadeMarkerOpacity(e, t)
  17939. if (window.DATA.hideFloorMarker) return
  17940. var currentPano = player.currentPano
  17941. opacity = void 0 == opacity ? _settings.panorama.markerOpacity : opacity //不传opacity代表显示
  17942. var hideWhenFlyOut = () => {
  17943. var shows = [],
  17944. hides = []
  17945. player.model.panos.forEach(pano => {
  17946. hides.push(pano)
  17947. })
  17948. this.panos.fadeMarkerOpacity(0, dur, [{ toOp: 0, member: hides }])
  17949. }
  17950. if (opacity == 0) {
  17951. hideWhenFlyOut()
  17952. } else {
  17953. if (player.mode == 'panorama' && currentPano) {
  17954. var shows = [],
  17955. hides = []
  17956. player.model.panos.forEach(pano => {
  17957. //是邻近点就显示否则隐藏
  17958. if (currentPano.neighbourPanos[pano.id]) {
  17959. shows.push(pano)
  17960. } else {
  17961. hides.push(pano)
  17962. }
  17963. })
  17964. this.panos.fadeMarkerOpacity(opacity, dur, [
  17965. { toOp: opacity, member: shows },
  17966. { toOp: 0, member: hides }
  17967. ])
  17968. } else if (player.modeTran.split('-')[1] != 'panorama') {
  17969. //飞出后marker隐藏
  17970. hideWhenFlyOut()
  17971. }
  17972. }
  17973. }),
  17974. (n.prototype.setSweepVisibility = function (e) {
  17975. this.panos.forEach(function (t) {
  17976. t.marker && (t.marker.visible = e)
  17977. })
  17978. }),
  17979. (n.prototype.outsideAllowed = function () {
  17980. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17981. }),
  17982. (n.prototype.addHighMapCube = function () {
  17983. //创建8*8的tile cube
  17984. if (player.qualityManager.getMaxZoomClass() == '4k' && player.qualityManager.maxRenderTargetSize == 2048) {
  17985. var geo = new THREE.PlaneGeometry(1, 1, 1, 1)
  17986. var cube = new THREE.Object3D()
  17987. cube.tiles = []
  17988. for (var cubeIndex = 0; cubeIndex < 6; cubeIndex++) {
  17989. var face = new THREE.Object3D()
  17990. for (var i = 0; i < 8; i++) {
  17991. for (var j = 0; j < 8; j++) {
  17992. var tile = new THREE.Mesh(geo, new THREE.MeshBasicMaterial({ side: 2 }))
  17993. tile.position.set(i - 3.5, j - 3.5, -4)
  17994. if (highMapAddColor) {
  17995. tile.material.opacity = 0.4
  17996. var colorHue = Math.random()
  17997. tile.material.color = new THREE.Color().setHSL(colorHue, 0.6, 0.9)
  17998. }
  17999. tile.material.transparent = true
  18000. tile.material.depthTest /* = tile.material.depthWrite */ = false //防止chunk比cube近从而被遮 且能不遮住box视频和热点等
  18001. tile.visible = false
  18002. tile.tileX = i
  18003. tile.tileY = j
  18004. tile.cubeFace = cubeIndex
  18005. tile.renderOrder = 2 //RenderOrder.highTileCube
  18006. cube.tiles.push(tile)
  18007. face.add(tile)
  18008. }
  18009. }
  18010. switch (cubeIndex) {
  18011. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  18012. face.rotation.set(0, Math.PI / 2, 0)
  18013. break
  18014. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  18015. face.rotation.set(0, -Math.PI / 2, 0)
  18016. break
  18017. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  18018. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18019. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), Math.PI / 2)
  18020. face.quaternion.copy(rot1).multiply(rot2)
  18021. //face.rotation.set(Math.PI/2,0,0);
  18022. break
  18023. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  18024. //face.rotation.set(-Math.PI/2,0,0);
  18025. var rot1 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(0, 1, 0), Math.PI)
  18026. var rot2 = new THREE.Quaternion().setFromAxisAngle(new THREE.Vector3(1, 0, 0), -Math.PI / 2)
  18027. face.quaternion.copy(rot1).multiply(rot2)
  18028. break
  18029. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  18030. face.rotation.set(0, Math.PI, 0)
  18031. break
  18032. case GLCubeFaces.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  18033. face.rotation.set(0, 0, 0)
  18034. }
  18035. face.scale.set(1, -1, 1)
  18036. cube.add(face)
  18037. }
  18038. cube.name = 'highMapCube'
  18039. this.highMapCube = cube
  18040. this.add(cube)
  18041. cube.scale.set(0.21, 0.21, 0.21) //camera.near is 0.1
  18042. this.highMapCube.visible = false
  18043. this.highMapCube.texLoadedCount = 0
  18044. player.once('pano.chosen', () => {
  18045. //wait sceneRenderer
  18046. player.sceneRenderer.on('after-render', e => {
  18047. if (this.highMapCube.visibleTiles) {
  18048. this.updateTiles()
  18049. }
  18050. if (player && player.lastFrameChanged) {
  18051. common.intervalTool.isWaiting(
  18052. 'update4kTiles',
  18053. () => {
  18054. let vectorForward = player.getDirection()
  18055. this.updateTiles(vectorForward)
  18056. },
  18057. 500
  18058. )
  18059. }
  18060. })
  18061. })
  18062. }
  18063. })
  18064. /*
  18065. highMapCube会遮住场景中所有物体, 如果一定要显示的话,只能类似potree中的那样渲染一个深度贴图出来(model无需贴图),然后其他所有物体的shader中都加入一段代码。(貌似本身已经支持了?)
  18066. */
  18067. n.prototype.isHighMapLoaded = function (cubeFace, tileX, tileY) {
  18068. var tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18069. return !!tile.material.map
  18070. }
  18071. n.prototype.updateTiles = function (direction) {
  18072. if (!this.highMapCube || !this.highMapCube.visible) return
  18073. if (this.highMapCube.tiles.filter(e => e.image).length <= 10) return //加载的太少了
  18074. //performance.mark('updateTiles-start')
  18075. if (direction) {
  18076. let camera = player.cameraControls.cameras.panorama
  18077. let hfov = THREE.Math.degToRad(cameraLight.getHFOVForCamera(camera, $('#player').width(), $('#player').height())) / 2
  18078. let vfov = THREE.Math.degToRad(camera.fov) / 2
  18079. /* let hcos = Math.cos(hfov / 2)
  18080. let vcos = Math.cos(vfov / 2) */
  18081. let list = this.highMapCube.tiles
  18082. list.forEach(e => {
  18083. //屏幕外的不显示
  18084. let pos = e.getWorldPosition(new THREE.Vector3())
  18085. let dir = new THREE.Vector3().subVectors(pos, this.highMapCube.position).normalize()
  18086. let hcos_ = dir.clone().setY(direction.y).normalize().dot(direction) //在direction的斜面上水平角度差
  18087. let hRad = Math.acos(hcos_)
  18088. let vRad = -200
  18089. if (hRad > hfov + 0.08) {
  18090. e.score = -100
  18091. } else {
  18092. vRad = Math.abs(Math.acos(dir.y) - Math.acos(direction.y))
  18093. if (vRad > vfov + 0.08) {
  18094. e.score = -100
  18095. } else {
  18096. e.score = -(hRad / hfov + vRad / vfov)
  18097. }
  18098. }
  18099. e.scores = hRad.toFixed(3) + ', ' + vRad.toFixed(3)
  18100. if (e.score == -100) {
  18101. this.resetTile(e)
  18102. }
  18103. })
  18104. this.highMapCube.visibleTiles = list.filter(e => e.score > -100)
  18105. /* this.highMapCube.visibleTiles.sort((e,b)=>{return e.score-b.score})
  18106. this.highMapCube.visibleTiles = this.highMapCube.visibleTiles.slice(0,10)
  18107. */
  18108. //list.forEach(e=>e.scoreLabel.setText(e.scores))
  18109. }
  18110. let needRecover = this.highMapCube.visibleTiles.filter(e => !e.material.map)
  18111. if (needRecover.length) {
  18112. let maxCount = 1 //common.getBestCount({ name: '4kmaxTileRecover', minCount: 0, maxCount: 2, durBound1: 1.5, durBound2: 6, ifLog: false, maxHistory: 2 })
  18113. let count = 0
  18114. needRecover.forEach((e, i) => {
  18115. //只更新若干个,因为太耗时了, 其余的等下帧更新
  18116. if (count >= maxCount) return
  18117. let r = this.recoverTile(e)
  18118. if (r) count++
  18119. })
  18120. }
  18121. }
  18122. n.prototype.getHighImage = function (image, cubeFace, tileX, tileY) {
  18123. this.gotSomeHighImg = true //标记,需要马上updateTiles
  18124. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18125. tile.image = image //先记录下来
  18126. }
  18127. n.prototype.updateHighMap = function (image, cubeFace, tileX, tileY) {
  18128. let tile = this.highMapCube.children[cubeFace].children[tileX * 8 + tileY]
  18129. if (image) tile.image = image //先记录下来
  18130. if (tile.material.map) return
  18131. if (this.highMapCube.visibleTiles && !this.highMapCube.visibleTiles.includes(tile)) {
  18132. return
  18133. }
  18134. //简易创建贴图
  18135. /* var tex = this.$app.core.get('SceneRenderer').initSizedTexture2D(512, THREE.ClampToEdgeWrapping)
  18136. //var loaded = this.$app.core.get('Player').model.isHighMapLoaded(tile.cubeFace, tile.tileX, tile.tileY)
  18137. this.$app.core.get('SceneRenderer').uploadTexture2D(image, tex, 0, 0, 512, 512) //只替换tex对应的img,不新建
  18138. */
  18139. var tex = new THREE.Texture()
  18140. tex.image = image
  18141. tex.flipY = false
  18142. tex.wrapS = tex.wrapT = THREE.ClampToEdgeWrapping
  18143. tex.generateMipmaps = false
  18144. tex.minFilter = THREE.LinearFilter
  18145. tex.needsUpdate = true
  18146. tile.material.map = tex
  18147. if (highMapAddColor) {
  18148. tile.material.opacity = 1
  18149. }
  18150. tile.visible = true
  18151. tile.material.needsUpdate = true //发现每次开始放大但还未放大到4k时也会把之前加载过的4k加载
  18152. //console.log( {level:1} , 'updateHighMap', cubeFace, tileX, tileY)
  18153. }
  18154. n.prototype.recoverTile = function (tile) {
  18155. if (tile.material.map) return
  18156. if (tile.image) {
  18157. this.updateHighMap(tile.image, tile.cubeFace, tile.tileX, tile.tileY)
  18158. return true
  18159. } else {
  18160. //console.log('no image')
  18161. }
  18162. }
  18163. n.prototype.resetTile = function (tile, kill) {
  18164. if (kill) {
  18165. //完全消灭
  18166. tile.image = null
  18167. }
  18168. let map = tile.material.map
  18169. if (map) {
  18170. map.dispose() //这句其实无效。本来可以使用three自带的deallocateTexture(texture),但因为创建的方式不是普通的new Texture,所以并没有onTextureDispose的侦听,故要自己写
  18171. map.loaded = !1
  18172. map.version = 0
  18173. //这两句才是真正释放贴图资源的 ,类似app.sceneRenderer.deallocateCubeTexture(tile.material.map)
  18174. var h = player.sceneRenderer.renderer.properties.get(map)
  18175. player.sceneRenderer.renderer.getContext().deleteTexture(h.__webglTexture)
  18176. tile.material.map = null
  18177. if (highMapAddColor) {
  18178. tile.material.opacity = 0.4
  18179. }
  18180. tile.material.needsUpdate = true
  18181. tile.visible = false
  18182. //this.highMapCube.texLoadedCount --
  18183. //console.log({level:1},'resetTile'/* , tile.cubeFace, tile.tileX, tile.tileY */)
  18184. }
  18185. }
  18186. n.prototype.resetHighMap = function () {
  18187. if (!this.highMapCube) return
  18188. this.highMapCube.children.forEach(e =>
  18189. e.children.forEach(tile => {
  18190. this.resetTile(tile, true)
  18191. })
  18192. )
  18193. //this.highMapCube.texLoadedCount = 0
  18194. this.highMapCube.visibleTiles = null
  18195. this.hideHighMap()
  18196. }
  18197. n.prototype.setHighMap = function (pano) {
  18198. if (!this.highMapCube) return
  18199. this.highMapCube.position.copy(pano.position)
  18200. this.highMapCube.quaternion.copy(pano.quaternion)
  18201. }
  18202. n.prototype.showHighMap = function () {
  18203. if (!this.highMapCube) return
  18204. this.highMapCube.visible = true
  18205. }
  18206. n.prototype.hideHighMap = function () {
  18207. if (!this.highMapCube) return
  18208. this.highMapCube.visible = false
  18209. }
  18210. //缩小后继续显示cube呢还是不显示? 不显示的话,就要把cube上的复制到renderTarget上……会不会又崩溃,or没加载的显示???
  18211. t.exports = n
  18212. }).call(this, '/js/model/Model.js')
  18213. },
  18214. {
  18215. '../constants': 8,
  18216. '../enum/AlignmentType': 17,
  18217. '../enum/RenderOrder': 42,
  18218. '../enum/Viewmode': 51,
  18219. '../exception/BasicException': 55,
  18220. '../label/Label': 90,
  18221. '../loaders/ModelLoader': 105,
  18222. '../loaders/ModelTextureLoader': 106,
  18223. '../loaders/SweepDataLoader': 107,
  18224. '../tag/tag': 123,
  18225. './util/cameraLight': 184,
  18226. '../tag/tagManager': 124,
  18227. '../objects/BoundingTextureSkybox': 143,
  18228. '../objects/Chunk': 144,
  18229. '../objects/Floor': 146,
  18230. '../objects/Panorama': 148,
  18231. '../objects/Room': 150,
  18232. '../objects/Snapshot': 153,
  18233. '../settings': 166,
  18234. '../shaders': 167,
  18235. '../util/ModelUrls': 177,
  18236. '../util/PanoramaCollection': 178,
  18237. '../util/ajax': 181,
  18238. '../util/common': 185,
  18239. '../util/easing': 186,
  18240. '../util/lerp': 188,
  18241. '../util/logger': 189,
  18242. '../util/math': 190,
  18243. '../util/texture': 194,
  18244. '../util/transitions': 195,
  18245. './../util/browser': 182,
  18246. './../util/showcase': 193,
  18247. './Chunks': 135,
  18248. './FloorCollection': 136,
  18249. './ImageCollection': 137,
  18250. './LabelCollection': 138,
  18251. './RoomCollection': 141,
  18252. events: 202,
  18253. three: 217,
  18254. hot: 'hot',
  18255. '../enum/GLCubeFaces': 25
  18256. }
  18257. ],
  18258. 140: [
  18259. function (e, t, i) {
  18260. 'use strict'
  18261. function n() {
  18262. ;(this.modelMap = {}), (this.activeModel = null), (this.modelCount = 0), (this.tileDownloader = null), (this.panoRenderer = null)
  18263. }
  18264. var r = (e('three'), e('../util/common')),
  18265. o = e('../exception/BasicException'),
  18266. a = e('../enum/ModelManagerEvents'),
  18267. s = e('../enum/PanoRendererEvents'),
  18268. l = e('events').EventEmitter
  18269. ;(n.prototype.init = function (e, t, i) {
  18270. ;(this.tileDownloader = e), (this.panoRenderer = t), (this.qualityManager = i), this.bindEvents()
  18271. }),
  18272. (n.prototype.bindEvents = function () {
  18273. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  18274. }),
  18275. (n.prototype.onTileRendered = function (e, t, i, n) {}),
  18276. (n.prototype.addModel = function (e) {
  18277. ;(this.modelMap[e.sid] = e), 0 === this.modelCount && this.activateModel(e.sid), this.modelCount++, this.emit(a.ModelAdded)
  18278. }),
  18279. (n.prototype.getModel = function (e) {
  18280. return this.modelMap[e]
  18281. }),
  18282. (n.prototype.activateModel = function (e) {
  18283. var t = this.modelMap[e]
  18284. if (!t) throw new o('Tried to activate invalid model!')
  18285. var i = this.activeModel
  18286. ;(this.activeModel = t),
  18287. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  18288. this.tileDownloader.setUrls(t.urls),
  18289. t.panos.forEach(
  18290. function (e) {
  18291. e.attachToPanoRenderer(this.panoRenderer), (e.tileDownloader = this.tileDownloader), (e.qualityManager = this.qualityManager)
  18292. }.bind(this)
  18293. ),
  18294. this.emit(a.ActiveModelChanged, {
  18295. oldModel: i,
  18296. model: t
  18297. })
  18298. }),
  18299. (n.prototype.getActiveModel = function () {
  18300. return this.activeModel
  18301. }),
  18302. r.extend(n, l),
  18303. (t.exports = n)
  18304. },
  18305. {
  18306. '../enum/ModelManagerEvents': 33,
  18307. '../enum/PanoRendererEvents': 35,
  18308. '../exception/BasicException': 55,
  18309. '../util/common': 185,
  18310. events: 202,
  18311. three: 217
  18312. }
  18313. ],
  18314. 141: [
  18315. function (e, t, i) {
  18316. ;(function (i) {
  18317. 'use strict'
  18318. function n() {
  18319. s.call(this)
  18320. }
  18321. var r = e('../objects/Room'),
  18322. o = (e('../settings'), e('../util/logger')),
  18323. a = (e('../util/transitions'), e('../util/easing'), e('../util/common')),
  18324. s = e('../util/IndexedCollection'),
  18325. l = e('./Chunks')
  18326. new o(i)
  18327. a.inherit(n, s),
  18328. (n.prototype.getIndex = function (e) {
  18329. return e.roomId
  18330. }),
  18331. (n.prototype.calcRoomBoundaries = function () {
  18332. this.forEach(function (e) {
  18333. e.calcBoundaries()
  18334. })
  18335. }),
  18336. (n.prototype.createFromChunks = function (e) {
  18337. var t = {
  18338. floorId: -1,
  18339. roomId: -1
  18340. },
  18341. i = {}
  18342. e.forEach(
  18343. function (e) {
  18344. l.parseIdsFromChunkName(e.name, t)
  18345. var o = i[t.roomId]
  18346. if (!o) {
  18347. var a = n.generateRoomId(t.floorId, t.roomId)
  18348. ;(o = new r(t.floorId, a)), this.add(o), (i[t.roomId] = o)
  18349. }
  18350. o.addChunk(e)
  18351. }.bind(this)
  18352. ),
  18353. this.calcRoomBoundaries()
  18354. }),
  18355. (n.generateRoomId = function (e, t) {
  18356. return e + '_' + t
  18357. }),
  18358. (t.exports = n)
  18359. }).call(this, '/js/model/RoomCollection.js')
  18360. },
  18361. {
  18362. '../objects/Room': 150,
  18363. '../settings': 166,
  18364. '../util/IndexedCollection': 175,
  18365. '../util/common': 185,
  18366. '../util/easing': 186,
  18367. '../util/logger': 189,
  18368. '../util/transitions': 195,
  18369. './Chunks': 135
  18370. }
  18371. ],
  18372. 142: [
  18373. function (e, t, i) {
  18374. 'use strict'
  18375. function n(e, t, i) {
  18376. e = e.clone().expandByScalar(0.01) //改
  18377. var n = e.size(),
  18378. o = new r.BoxGeometry(n.x, n.y, n.z)
  18379. ;(o.boundingBox = e), r.Mesh.call(this, o, t), this.position.copy(e.center()), (this.frustumCulled = !1), i && this.add(new r.WireframeHelper(this))
  18380. }
  18381. var r = e('three')
  18382. ;(n.prototype = Object.create(r.Mesh.prototype)), (n.prototype.constructor = n), (t.exports = n)
  18383. },
  18384. {
  18385. three: 217
  18386. }
  18387. ],
  18388. 143: [
  18389. function (e, t, i) {
  18390. ;(function (i) {
  18391. 'use strict'
  18392. function n(e) {
  18393. h.time('Computing a nice bounding cubemap')
  18394. var t = new a({
  18395. side: r.BackSide,
  18396. transparent: !0
  18397. })
  18398. ;(t.uniforms.modelAlpha.value = 0), (t.uniforms.opacity.value = 1 - s.modelAlpha), (this.renderOrder = l.boundingSkybox), o.call(this, e, t), h.timeEnd('Computing a nice bounding cubemap')
  18399. }
  18400. var r = e('three'),
  18401. o = (e('../enum/Viewmode'), e('../shaders'), e('./BoundingMesh')),
  18402. a = e('../materials/ModelTextureMaterial'),
  18403. s = e('../settings'),
  18404. l = e('../enum/RenderOrder'),
  18405. c = e('../util/logger'),
  18406. h = new c(i)
  18407. ;(n.prototype = Object.create(o.prototype)), (n.prototype.constructor = n), (t.exports = n)
  18408. }).call(this, '/js/objects/BoundingTextureSkybox.js')
  18409. },
  18410. {
  18411. '../enum/RenderOrder': 42,
  18412. '../enum/Viewmode': 51,
  18413. '../materials/ModelTextureMaterial': 118,
  18414. '../settings': 166,
  18415. '../shaders': 167,
  18416. '../util/logger': 189,
  18417. './BoundingMesh': 142,
  18418. three: 217
  18419. }
  18420. ],
  18421. 144: [
  18422. function (e, t, i) {
  18423. 'use strict'
  18424. function n(e) {
  18425. this.materialInside = new s({
  18426. side: r.DoubleSide
  18427. })
  18428. var t = r.UniformsUtils.clone(o.modelOutside.uniforms)
  18429. ;(this.materialOutside = new r.RawShaderMaterial({
  18430. fragmentShader: o.modelOutside.fragmentShader,
  18431. vertexShader: o.modelOutside.vertexShader,
  18432. uniforms: t,
  18433. side: r.FrontSide,
  18434. name: 'chunkOut'
  18435. })),
  18436. r.Mesh.call(this, e.geometry, this.materialInside),
  18437. (this.name = e.name || ''),
  18438. (this.textureName = e.textureName),
  18439. (this.meshUrl = e.meshUrl)
  18440. }
  18441. var r = e('three'),
  18442. o = e('../shaders'),
  18443. a = e('../enum/Viewmode'),
  18444. s = e('../materials/ModelTextureMaterial')
  18445. ;(n.prototype = Object.create(r.Mesh.prototype)),
  18446. (n.prototype.setTextureMap = function (e) {
  18447. ;(this.materialInside.uniforms.map.value = e), (this.materialOutside.uniforms.map.value = e)
  18448. }),
  18449. (n.prototype.setMode = function (e) {
  18450. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside
  18451. ;(t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide),
  18452. (t.transparent = this.material.transparent),
  18453. (t.uniforms.opacity.value = this.material.uniforms.opacity.value),
  18454. (this.material = t)
  18455. }),
  18456. (t.exports = n)
  18457. },
  18458. {
  18459. '../enum/Viewmode': 51,
  18460. '../materials/ModelTextureMaterial': 118,
  18461. '../shaders': 167,
  18462. three: 217
  18463. }
  18464. ],
  18465. 145: [
  18466. function (e, t, i) {
  18467. 'use strict'
  18468. function n(e) {
  18469. ;(this.chunksize = e || 10),
  18470. (this.chunks = {}),
  18471. (this.boundingBoxes = {}),
  18472. (this.children = []),
  18473. (this.offset = new r.Vector3(0, 0.5, 0)),
  18474. (this.material = new r.MeshBasicMaterial({
  18475. color: 16777215 * Math.random(),
  18476. side: r.DoubleSide
  18477. }))
  18478. }
  18479. var r = e('three')
  18480. e('../enum/Viewmode')
  18481. ;(n.prototype.add = function (e) {
  18482. var t,
  18483. i,
  18484. n,
  18485. o,
  18486. a,
  18487. s,
  18488. l,
  18489. c,
  18490. h,
  18491. u,
  18492. d,
  18493. p,
  18494. f,
  18495. g,
  18496. m = e.attributes
  18497. m ? ((t = m.position.array), (i = void 0 !== e.index ? e.index.array : void 0)) : ((t = e.vertices), (n = e.faces))
  18498. var v = new r.Vector3()
  18499. if (i)
  18500. for (o = 0, a = i.length; o < a; o += 3) {
  18501. var A = 3 * i[o],
  18502. y = 3 * i[o + 1],
  18503. C = 3 * i[o + 2]
  18504. ;(s = (t[A] + t[y] + t[C]) / 3),
  18505. (l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3),
  18506. (c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3),
  18507. (h = Math.floor(s / this.chunksize)),
  18508. (u = Math.floor(l / this.chunksize)),
  18509. (d = Math.floor(c / this.chunksize)),
  18510. (p = h + '.' + u + '.' + d),
  18511. p in this.chunks ? ((g = this.chunks[p]), (f = this.boundingBoxes[p])) : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  18512. 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]),
  18513. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  18514. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  18515. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  18516. }
  18517. else
  18518. for (o = 0, a = t.length; o < a; o += 9)
  18519. (s = (t[o] + t[o + 3] + t[o + 6]) / 3),
  18520. (l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3),
  18521. (c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3),
  18522. (h = Math.floor(s / this.chunksize)),
  18523. (u = Math.floor(l / this.chunksize)),
  18524. (d = Math.floor(c / this.chunksize)),
  18525. (p = h + '.' + u + '.' + d),
  18526. p in this.chunks ? ((g = this.chunks[p]), (f = this.boundingBoxes[p])) : ((g = this.chunks[p] = []), (f = this.boundingBoxes[p] = new r.Box3())),
  18527. 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]),
  18528. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  18529. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  18530. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  18531. }),
  18532. (n.prototype.build = function () {
  18533. var e = new r.Object3D()
  18534. e.material = this.material
  18535. for (var t in this.chunks) {
  18536. var i = this.chunks[t],
  18537. n = new r.BufferGeometry()
  18538. n.addAttribute('position', new r.BufferAttribute(new Float32Array(i), 3)), (n.boundingBox = this.boundingBoxes[t])
  18539. var o = new r.Mesh(n, this.material)
  18540. ;(o.material.visible = !1), e.add(o), (this.chunks[t] = [])
  18541. }
  18542. return e
  18543. }),
  18544. (t.exports = n)
  18545. },
  18546. {
  18547. '../enum/Viewmode': 51,
  18548. three: 217
  18549. }
  18550. ],
  18551. 146: [
  18552. function (e, t, i) {
  18553. 'use strict'
  18554. var r = e('three'),
  18555. o = e('../settings'),
  18556. a = e('../util/common'),
  18557. s = e('../util/lerp'),
  18558. l = e('./ChunkedCollider'),
  18559. c = e('../util/transitions'),
  18560. h = e('../util/easing'),
  18561. u = (e('../objects/Panorama'), e('../enum/RenderOrder')),
  18562. d = e('../localization/localize')
  18563. function n(e, t, i) {
  18564. r.Object3D.call(this),
  18565. (this.model = e),
  18566. (this.floorIndex = t),
  18567. (this.lang = o.languageTag),
  18568. (this.name = i || o.languageTag === 'cn' ? 'Floor ' + (t + 1) + '' : '第' + (t + 1) + '层'),
  18569. (this.panos = []),
  18570. (this.chunks = []),
  18571. (this.colliderBuilder = new l(3)),
  18572. (this.collider = null),
  18573. (this.center = null),
  18574. (this.boundingBox = new r.Box3()),
  18575. (this.size = null),
  18576. (this.hidden = !1),
  18577. (this.conservativeBoundingBox = new r.Box3()),
  18578. (this.debugColor = 16777215 * Math.random()),
  18579. (this.transition = null)
  18580. }
  18581. ;(n.prototype = Object.create(r.Object3D.prototype)),
  18582. (n.prototype.enter = function (e) {
  18583. this.model.setFloor(this, e)
  18584. }),
  18585. (n.prototype.hide = function (e) {
  18586. if (!this.hidden || this.transition) {
  18587. this.chunks.forEach(function (e) {
  18588. e.material.transparent = !0
  18589. }),
  18590. c.cancel(this.transition)
  18591. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay,
  18592. i = e ? 0 : o.hideFloorDelay / t
  18593. this.transition = c.start(
  18594. s.allUniforms(this.chunks, 'opacity', 0.08),
  18595. t,
  18596. function () {
  18597. this.hidden = !0
  18598. }.bind(this),
  18599. i,
  18600. h.easeInOutQuad
  18601. )
  18602. }
  18603. }),
  18604. (n.prototype.show = function (e) {
  18605. if (this.hidden || this.transition) {
  18606. ;(this.hidden = !1), c.cancel(this.transition)
  18607. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay,
  18608. i = e ? 0 : o.showFloorDelay / t
  18609. this.transition = c.start(
  18610. s.allUniforms(this.chunks, 'opacity', 1),
  18611. t,
  18612. function () {
  18613. this.hidden ||
  18614. this.chunks.forEach(function (e) {
  18615. e.material.transparent = !1
  18616. })
  18617. }.bind(this),
  18618. i,
  18619. h.easeInOutQuad
  18620. )
  18621. }
  18622. }),
  18623. (n.prototype.toggle = function (e, t) {
  18624. ;(e = void 0 === e ? this.hidden : e), e ? this.show(t) : this.hide(t)
  18625. }),
  18626. (n.prototype.containsPoint = function (e) {
  18627. return this.collider.children.some(function (t) {
  18628. return t.geometry.boundingBox || t.geometry.computeBoundingBox(), t.geometry.boundingBox.containsPoint(e)
  18629. })
  18630. }),
  18631. (n.prototype.distanceToPoint = function (e) {
  18632. var t = null,
  18633. i = 1 / 0
  18634. return (
  18635. this.collider.children.forEach(function (n) {
  18636. n.geometry.boundingBox || n.geometry.computeBoundingBox()
  18637. var r = n.geometry.boundingBox.distanceToPoint(e)
  18638. ;(!t || i > r) && ((i = r), (t = n))
  18639. }),
  18640. i
  18641. )
  18642. }),
  18643. (n.prototype.addChunk = function (e) {
  18644. ;(e.renderOrder = u.ghostFloor),
  18645. this.add(e),
  18646. this.chunks.push(e),
  18647. this.boundingBox.union(e.geometry.boundingBox),
  18648. (this.size = this.boundingBox.size()),
  18649. this.colliderBuilder.add(e.geometry)
  18650. }),
  18651. (n.prototype.addPano = function (e) {
  18652. this.panos.push(e), this.add(e.skyboxMesh), e.marker && this.add(e.marker)
  18653. if (e.neighbourUUIDs && e.neighbourUUIDs.length) {
  18654. //add 有相邻点才算入bound 因为拍摄有bug,会出现floorPosition为000,且position位置很偏的点,它们一般都是不可见点。
  18655. var t = new r.Vector3(1, 1, 1),
  18656. i = new r.Box3().setFromCenterAndSize(e.position, t)
  18657. this.boundingBox.union(i)
  18658. }
  18659. }),
  18660. (n.prototype.build = function () {
  18661. ;(this.collider = this.colliderBuilder.build(!0)),
  18662. this.add(this.collider),
  18663. (this.center = this.boundingBox.center()),
  18664. this.conservativeBoundingBox.copy(this.boundingBox),
  18665. (this.conservativeBoundingBox.min.y = a.lowerMedian(
  18666. this.collider.children.map(function (e) {
  18667. return e.geometry.boundingBox.min.y
  18668. }),
  18669. 5
  18670. )),
  18671. (this.conservativeBoundingBox.max.y = a.lowerMedian(
  18672. this.collider.children.map(function (e) {
  18673. return e.geometry.boundingBox.max.y
  18674. }),
  18675. 5
  18676. ))
  18677. this.colliderBuilder = null
  18678. }),
  18679. (n.prototype.toShortString = function () {
  18680. return a.nth(this.floorIndex + 1)
  18681. }),
  18682. (n.prototype.toString = function () {
  18683. return this.name
  18684. }),
  18685. (n.prototype.constructor = n), //add
  18686. (t.exports = n)
  18687. },
  18688. {
  18689. '../enum/RenderOrder': 42,
  18690. '../localization/localize': 108,
  18691. './strings-cn-CN': 109,
  18692. '../objects/Panorama': 148,
  18693. '../settings': 166,
  18694. '../util/common': 185,
  18695. '../util/easing': 186,
  18696. '../util/lerp': 188,
  18697. '../util/transitions': 195,
  18698. './ChunkedCollider': 145,
  18699. three: 217
  18700. }
  18701. ],
  18702. 147: [
  18703. function (e, t, i) {
  18704. 'use strict'
  18705. function n(e) {
  18706. ;(this.player = e), (this.obj3d = null), (this.UP = new r.Vector3(0, 1, 0))
  18707. }
  18708. var r = e('three'),
  18709. o = e('../settings')
  18710. ;(n.prototype.prefs = {
  18711. linewidth: 3,
  18712. height: 0.07,
  18713. opacity: 0.45,
  18714. endScale: 0.05
  18715. }),
  18716. (n.prototype.discard = function () {
  18717. if (this.obj3d) {
  18718. var e = this.obj3d.parent
  18719. e && e.remove(this.obj3d)
  18720. }
  18721. this.obj3d = null
  18722. }),
  18723. (n.prototype.draw = function () {
  18724. if ((this.discard(), o.showNeighbors)) {
  18725. var e = this.player.currentPano.floor
  18726. this.obj3d = new r.Object3D()
  18727. var t = this.player.model.panos.getNeighbours(this.player.currentPano),
  18728. i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position)
  18729. i.y += this.prefs.height
  18730. var n = 0.1525,
  18731. a = 0.127,
  18732. s = 0.0127,
  18733. l = 0.1,
  18734. c = 0.19,
  18735. h = 0.2032,
  18736. u = 0.2286,
  18737. d = 0.255,
  18738. p = new r.Matrix4()
  18739. for (var f in t)
  18740. if (t[f]) {
  18741. var g = this.player.model.panos.get(f),
  18742. m = (g.position.clone().sub(this.player.model.position), g.position.clone().sub(g.floorPosition)),
  18743. v = g.floorPosition.clone().sub(this.player.model.position)
  18744. v.y += this.prefs.height
  18745. var A = new r.Geometry()
  18746. 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)),
  18747. A.vertices.push(
  18748. new r.Vector3(0, -d, 0),
  18749. new r.Vector3(d, -d, 0),
  18750. new r.Vector3(d, n, 0),
  18751. new r.Vector3(-n, n, 0),
  18752. new r.Vector3(-n, a, 0),
  18753. new r.Vector3(-c, l, 0),
  18754. new r.Vector3(-c, -h, 0),
  18755. new r.Vector3(-n, -u, 0),
  18756. new r.Vector3(-n, -d, 0),
  18757. new r.Vector3(0, -d, 0)
  18758. ),
  18759. p.identity().setPosition(m),
  18760. A.applyMatrix(p),
  18761. A.vertices.push(new r.Vector3(0, -this.prefs.endScale, 0)),
  18762. A.vertices.push(
  18763. new r.Vector3(-this.prefs.endScale, -this.prefs.endScale, 0),
  18764. new r.Vector3(-this.prefs.endScale, this.prefs.endScale, 0),
  18765. new r.Vector3(this.prefs.endScale, this.prefs.endScale, 0),
  18766. new r.Vector3(this.prefs.endScale, -this.prefs.endScale, 0)
  18767. ),
  18768. p.lookAt(v, i, this.UP).setPosition(v),
  18769. A.applyMatrix(p),
  18770. A.vertices.push(v, i)
  18771. var y = new r.Line(
  18772. A,
  18773. new r.LineBasicMaterial({
  18774. color: g.debugColor.getHex(),
  18775. transparent: !0,
  18776. opacity: this.prefs.opacity,
  18777. depthWrite: !1,
  18778. name: 'sLine' + f,
  18779. linewidth: this.prefs.linewidth
  18780. })
  18781. )
  18782. this.obj3d.add(y)
  18783. }
  18784. e.add(this.obj3d)
  18785. }
  18786. }),
  18787. (n.prototype.update = function () {
  18788. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18789. }),
  18790. (t.exports = n)
  18791. },
  18792. {
  18793. '../settings': 166,
  18794. three: 217
  18795. }
  18796. ],
  18797. 148: [
  18798. function (e, t, i) {
  18799. ;(function (i) {
  18800. 'use strict'
  18801. function n(e, t, i, n) {
  18802. ;(this.model = e),
  18803. (this.id = t),
  18804. (this.alignmentType = i.alignmentType || l.ALIGNED),
  18805. (this.neighbourUUIDs = i.neighbours || null),
  18806. (this.neighbourPanos = null),
  18807. (this.floor = null),
  18808. (this.floorIndex = i.floor),
  18809. (this.failedLoadingAt = 0),
  18810. (this.maxLoadRetries = 4),
  18811. (this.origin = i.position.clone()),
  18812. (this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0, -5, 0) : i.position.clone()),
  18813. (this.quaternion = i.quaternion.clone()),
  18814. (this.skyboxMesh = new r.Mesh(E)),
  18815. this.skyboxMesh.position.copy(this.position),
  18816. this.skyboxMesh.quaternion.copy(this.quaternion),
  18817. (this.skyboxMesh.name = 'skybox'),
  18818. (this.skyboxMesh.visible = !1),
  18819. this.skyboxMesh.updateMatrix(),
  18820. this.skyboxMesh.updateMatrixWorld(),
  18821. (this.marker = null),
  18822. (this.showFloorMarker = !window.DATA.hideFloorMarker)
  18823. if (this.isAligned()) {
  18824. ;(this.marker = new r.Mesh(
  18825. b,
  18826. new r.MeshBasicMaterial({
  18827. map: w,
  18828. side: r.DoubleSide,
  18829. opacity: 0,
  18830. transparent: !0,
  18831. depthWrite: !1
  18832. })
  18833. )),
  18834. (this.marker.visible = false) //改:先不显示,之后根据opacity显示
  18835. ;(this.marker.renderOrder = s.panoMarker), (this.marker.name = 'marker'), (this.marker.pano = this), this.marker.layers.set(v.PANOMARKERS), this.marker.updateMatrixWorld()
  18836. if (!window.DATA.hideFloorMarker) {
  18837. //xzw
  18838. let opa = this.marker.material.opacity
  18839. Object.defineProperty(this.marker.material, 'opacity', {
  18840. get: function () {
  18841. return opa
  18842. },
  18843. set: o => {
  18844. opa = o
  18845. convertTool.updateVisible(this.marker, 'hideWhenZeroOpa', o > 0)
  18846. //if(o==0)console.log('o==0',this.id,this.marker.visible)
  18847. //console.log(o,this.id,this.marker.visible)
  18848. }
  18849. })
  18850. }
  18851. a.colorMarkerOnLoad &&
  18852. this.on('load', function () {
  18853. this.marker.material.color.set(65280)
  18854. })
  18855. }
  18856. ;(this.debugColor = new r.Color().setHSL(0.06 + 0.53 * Math.random(), 0.8 + 0.2 * Math.random(), 0.5 + 0.2 * Math.random())),
  18857. (this.floorPosition = i.puck ? i.puck.clone() : null),
  18858. (this.tiled = n),
  18859. this.tiled
  18860. ? (this.solidSkybox = null)
  18861. : ((this.solidSkybox = new r.Texture([null, null, null, null, null, null])),
  18862. (this.solidSkybox.flipY = !1),
  18863. a.minimalMemoryMode && ((this.solidSkybox.minFilter = r.LinearFilter), (this.solidSkybox.magFilter = r.LinearFilter), (this.solidSkybox.generateMipmaps = !1))),
  18864. (this.zoomed = !1),
  18865. (this.panoRenderer = null),
  18866. (this.qualityManager = null),
  18867. (this.tileDownloader = null),
  18868. (this.tiledPanoRenderTarget = null),
  18869. (this.minimumTiledPanoLoaded = !1),
  18870. (this.highestPartialTileRenderOpCompleted = 0),
  18871. (this.highestFullTileRenderOpCompleted = 0),
  18872. (this.shouldRedrawOnBaseLoaded = !1),
  18873. (this.lockUntilRenderingComplete = !1),
  18874. a.colorMarkerOnLoad &&
  18875. this.on('load', function () {
  18876. this.marker.material.color.set(65280)
  18877. })
  18878. /********************************************************************fyz改vr from徐世廷*************************************************************/
  18879. var e = new r.TextureLoader()
  18880. e.setCrossOrigin(!0)
  18881. var g = e.load('images/texture.jpg')
  18882. if (
  18883. ((this.vrMarker = new r.Mesh(
  18884. new r.OctahedronGeometry(0.1, 0),
  18885. new r.MeshLambertMaterial({
  18886. color: 16777215,
  18887. transparent: !0,
  18888. opacity: 0.75,
  18889. map: g
  18890. })
  18891. )),
  18892. (this.vrMarker.boluoType = 'vr'),
  18893. (this.vrMarker.position.z = 1),
  18894. (this.vrMarker.enabled = !0),
  18895. (this.vrMarker.visible = !1),
  18896. (window.vrMarkers = window.vrMarkers || []),
  18897. window.vrMarkers.push(this.vrMarker),
  18898. this.marker && this.marker.add(this.vrMarker),
  18899. a.showAxis &&
  18900. (this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0, 1, 0), new r.Vector3(0, 0, 0), 1, 255)),
  18901. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(0, 0, 1), new r.Vector3(0, 0, 0), 1, 16711680)),
  18902. this.skyboxMesh.add(new r.ArrowHelper(new r.Vector3(1, 0, 0), new r.Vector3(0, 0, 0), 1, 65280))),
  18903. this.adjustAngleEnable)
  18904. ) {
  18905. var i = new r.Quaternion()
  18906. i.setFromAxisAngle(new r.Vector3(1, 0, 0), this.adjustAngleX), this.skyboxMesh.quaternion.multiply(i)
  18907. var m = new r.Quaternion()
  18908. m.setFromAxisAngle(new r.Vector3(0, 1, 0), this.adjustAngleY), this.skyboxMesh.quaternion.multiply(m)
  18909. var n = new r.Quaternion()
  18910. n.setFromAxisAngle(new r.Vector3(0, 0, 1), this.adjustAngleZ),
  18911. this.skyboxMesh.quaternion.multiply(n),
  18912. this.skyboxMesh.updateMatrix(),
  18913. this.skyboxMesh.updateMatrixWorld(),
  18914. this.model.updateProjectedPanos()
  18915. }
  18916. /**************************************************************************************************************************************/
  18917. }
  18918. var r = e('three'),
  18919. o = e('../util/logger'),
  18920. a = e('../settings'),
  18921. s = (e('../enum/Viewmode'), e('../enum/RenderOrder')),
  18922. l = e('../enum/AlignmentType'),
  18923. c = (e('../util/common'), e('../util/transitions')),
  18924. h = e('../util/lerp'),
  18925. u = e('../util/ajax'),
  18926. d = e('../util/texture'),
  18927. p = e('../util/panorama'),
  18928. f = (e('../enum/TileDownloaderEvents'), e('../enum/PanoramaEvents')),
  18929. g = e('../enum/PanoRendererEvents'),
  18930. m = e('../enum/PanoSizeClass'),
  18931. v = e('../enum/RenderLayers'),
  18932. A = (e('../scene/SceneRenderer'), e('../enum/GLCubeFaces'), e('../exception/BasicException')),
  18933. y = e('../tile/TileUtils'),
  18934. C = e('events').EventEmitter,
  18935. I = new o(i),
  18936. E = new r.SphereBufferGeometry(0.1),
  18937. b = new r.PlaneBufferGeometry(0.35, 0.35, 1, 1),
  18938. w = d.load('images/marker.png')
  18939. w.anisotropy = browser.isMobile() ? 1 : 3 //add
  18940. ;(n.prototype = Object.create(C.prototype)),
  18941. (n.prototype.enter = (function () {
  18942. var e = null
  18943. return function () {
  18944. this.setZoomed(!1),
  18945. this.emit('enter', {
  18946. oldPano: e,
  18947. newPano: this
  18948. }),
  18949. (e = this)
  18950. this.model.setHighMap(this) //add
  18951. }
  18952. })()),
  18953. (n.prototype.exit = function () {
  18954. this.tiled
  18955. ? (this.clearWaitDeferreds(),
  18956. (this.minimumTiledPanoLoaded = !1),
  18957. (this.tiledPanoRenderTarget = null),
  18958. this.setZoomed(!1),
  18959. this.panoRenderer.deactivateTiledPano(this),
  18960. (this.highestPartialTileRenderOpCompleted = 0),
  18961. (this.highestFullTileRenderOpCompleted = 0))
  18962. : (this.solidSkybox.dispose(), (this.solidSkybox.loaded = !1), (this.solidSkybox.version = 0)),
  18963. this.emit('exit')
  18964. }),
  18965. (n.prototype.hoverOn = function (e) {
  18966. this.marker &&
  18967. (c.start(h.property(this.marker.material, 'opacity', a[e].markerOpacityOnHover), 250), a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite('HIT', 12525854))
  18968. }),
  18969. (n.prototype.hoverOff = function (e) {
  18970. this.marker && c.start(h.property(this.marker.material, 'opacity', a[e].markerOpacity), 250)
  18971. }),
  18972. (n.prototype.build1 = function () {
  18973. ;(this.floor =
  18974. this.floor ||
  18975. this.model.floors.get(this.floorIndex) ||
  18976. (this.model.floors.list.length == 1 ? this.model.floors.list[0] : this.raycastToFindFloor()) ||
  18977. this.model.getFloorAtPoint(this.position)),
  18978. this.floor.addPano(this),
  18979. (this.floorPosition = this.floorPosition || this.raycastFloorPosition()),
  18980. (this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos()),
  18981. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18982. }),
  18983. (n.prototype.build2 = function () {
  18984. ;(this.floorPosition = this.floorPosition || this.interpolateFloorPosition()), (this.height = this.position.distanceTo(this.floorPosition)), this.placeMarker()
  18985. }),
  18986. (n.prototype.interpolateFloorPosition = function () {
  18987. var e = this.model.panos
  18988. .filter(n.filters.isNeighbourPanoTo(this))
  18989. .filter(function (e) {
  18990. return !!e.floorPosition
  18991. })
  18992. .sort(
  18993. function (e, t) {
  18994. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18995. }.bind(this)
  18996. ),
  18997. t = this.position.clone()
  18998. return e.length >= 2 ? (t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2) : t.add(a.noMeshFloorPositionOffset), t
  18999. }),
  19000. (n.prototype.raycastFloorPosition = function () {
  19001. I.warn('Performance warning: Raycasting to find floor position')
  19002. var e = new r.Raycaster(this.position, new r.Vector3(0, -1, 0)),
  19003. t = e.intersectObjects(this.model.colliders)
  19004. return t.length ? t[0].point : null
  19005. }),
  19006. (n.prototype.raycastToFindFloor = (function () {
  19007. var e = [
  19008. new r.Vector3(0, -1, 0),
  19009. new r.Vector3(1, -1, 0),
  19010. new r.Vector3(0, -1, 1),
  19011. new r.Vector3(-1, -1, 0),
  19012. new r.Vector3(0, -1, -1),
  19013. new r.Vector3(1, 0, 0),
  19014. new r.Vector3(0, 0, 1),
  19015. new r.Vector3(-1, 0, 0),
  19016. new r.Vector3(0, 0, -1)
  19017. ]
  19018. return function () {
  19019. I.warn('Performance warning: Raycasting to find floor index')
  19020. for (var t = 0; t < e.length; t++) {
  19021. var i = new r.Raycaster(this.position.clone(), e[t].clone()),
  19022. n = i.intersectObjects(this.model.colliders)
  19023. if (n.length) return n[0].object.parent.parent
  19024. }
  19025. return null
  19026. }
  19027. })()),
  19028. (n.prototype.placeMarker = function () {
  19029. this.marker &&
  19030. (this.marker.position.copy(this.floorPosition),
  19031. //this.fixedFloorY != void 0 && this.marker.position.setY(this.fixedFloorY),//add
  19032. (this.marker.position.y += settings.markerHeight),
  19033. this.marker.lookAt(new r.Vector3(0, 1, 0).add(this.marker.position)))
  19034. }),
  19035. (n.prototype.translate = function (e) {
  19036. this.position.add(e), this.floorPosition.add(e)
  19037. }),
  19038. (n.prototype.findClosestMidtpointPanoTo = function (e) {
  19039. new r.Vector3().addVectors(this.position, e.position).divideScalar(2)
  19040. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  19041. }),
  19042. (n.prototype.attachToPanoRenderer = function (e) {
  19043. ;(this.panoRenderer = e),
  19044. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  19045. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  19046. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  19047. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  19048. })
  19049. var _ = {}
  19050. ;(n.prototype.getWaitDeferred = function (e) {
  19051. var t = _[this.id]
  19052. t || ((t = {}), (_[this.id] = t))
  19053. var i = t[e]
  19054. return (
  19055. i ||
  19056. ((i = {
  19057. deferred: $.Deferred(),
  19058. active: !1
  19059. }),
  19060. (t[e] = i)),
  19061. i
  19062. )
  19063. }),
  19064. (n.prototype.resetWaitDeferred = function (e) {
  19065. var t = this.getWaitDeferred(e)
  19066. ;(t.active = !1), (t.deferred = $.Deferred())
  19067. }),
  19068. (n.prototype.clearWaitDeferreds = function () {
  19069. var e = _[this.id]
  19070. e || ((e = {}), (_[this.id] = e))
  19071. for (var t in e)
  19072. if (e.hasOwnProperty(t)) {
  19073. var i = e[t]
  19074. ;(i.active = !1), (i.deferred = $.Deferred())
  19075. }
  19076. }),
  19077. (n.prototype.loadTiledPano = (function () {
  19078. var e = (new r.Vector3(), []),
  19079. t = []
  19080. return function (i, n, r, o, a, s) {
  19081. ;(null !== o && void 0 !== o) || (o = !0), (null !== a && void 0 !== a) || (a = !0)
  19082. var l = this.getWaitDeferred(i),
  19083. c = l.deferred,
  19084. h = null,
  19085. u = null
  19086. if ((r && ('number' == typeof r ? (h = r) : ((h = r.hFov), (u = r.vFov))), !this.isLoaded(i))) {
  19087. if (!l.active) {
  19088. if (((l.active = !0), r)) {
  19089. var d = y.matchingTilesInDirection(this, i, n, h, u)
  19090. ;(e[this.id + ':' + i] = {
  19091. tileCount: 0,
  19092. targetTileCount: d
  19093. }),
  19094. I.info('Loading partial pano: ' + this.id + ' with ' + d + ' tiles')
  19095. }
  19096. t[this.id] ||
  19097. ((t[this.id] = !0),
  19098. this.on(
  19099. f.LoadComplete,
  19100. function (e, t) {
  19101. //console.warn('点位下载完成 ', 'id:'+this.id, 'count:'+t )
  19102. var i = this.getWaitDeferred(e).deferred
  19103. i && 'pending' === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t), this.resetWaitDeferred(e))
  19104. }.bind(this)
  19105. ),
  19106. this.on(
  19107. f.LoadFailed,
  19108. function (e) {
  19109. var t = this.getWaitDeferred(e).deferred
  19110. t && 'pending' === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e), this.resetWaitDeferred(e))
  19111. }.bind(this)
  19112. ),
  19113. this.on(
  19114. f.TileLoaded,
  19115. function (t, i, n) {
  19116. //console.log('tileLoaded', 'id:'+this.id, 'size:'+t, 'index:'+i )
  19117. var r = this.getWaitDeferred(t).deferred
  19118. if (r && 'pending' === r.state()) {
  19119. r.notify(t, i, n)
  19120. var o = e[this.id + ':' + t]
  19121. o && (o.tileCount++, o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0), r.resolve(t, n), this.resetWaitDeferred(t)))
  19122. }
  19123. }.bind(this)
  19124. ))
  19125. }
  19126. this.tileDownloader.clearForceQueue(),
  19127. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  19128. (this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, Math.min(2048, this.qualityManager.getMaxNavPanoSize()), o)), //不要超过2048否则漫游到下一个点时卡顿
  19129. this.panoRenderer.renderPanoTiles(this.id, n, a)
  19130. }
  19131. return c.promise()
  19132. }
  19133. })()),
  19134. (n.prototype.onUploadAttemptedForAllTiles = function (e, t, i) {
  19135. if (e === this.id) {
  19136. var n = this.qualityManager.getPanoSize(m.BASE)
  19137. t === n &&
  19138. this.shouldRedrawOnBaseLoaded &&
  19139. ((this.shouldRedrawOnBaseLoaded = !1), this.panoRenderer.resetRenderStatus(this.id, !0, !1), this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  19140. }
  19141. }),
  19142. (n.prototype.onTileRendered = function (e, t, i, n) {
  19143. e === this.id && this.emit(f.TileLoaded, t, i, n)
  19144. }),
  19145. (n.prototype.onPanoRendered = function (e, t, i, n) {
  19146. e === this.id &&
  19147. ((this.minimumTiledPanoLoaded = !0),
  19148. this.updateSkyboxForZoomLevel(),
  19149. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  19150. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  19151. this.emit('load', t),
  19152. this.model.emit('load', this),
  19153. this.emit(f.LoadComplete, t, i))
  19154. }),
  19155. (n.prototype.setZoomed = function (e) {
  19156. ;(this.zoomed = e), this.updateSkyboxForZoomLevel()
  19157. if (e) {
  19158. //add
  19159. if (player.qualityManager.getNavZoomClass() != '1k') {
  19160. this.model.showHighMap()
  19161. }
  19162. } else {
  19163. this.model.hideHighMap()
  19164. }
  19165. }),
  19166. (n.prototype.ensureSkyboxReadyForRender = function () {
  19167. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0), (this.solidSkybox.loaded = !0))
  19168. }),
  19169. (n.prototype.updateSkyboxForZoomLevel = function () {
  19170. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  19171. }),
  19172. (n.prototype.getSkyboxTexture = function () {
  19173. //return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  19174. if (!this.tiled) {
  19175. return this.solidSkybox
  19176. }
  19177. if (this.minimumTiledPanoLoaded) {
  19178. if (this.zoomed && (this.qualityManager.maxRenderTargetSize > this.qualityManager.maxNavPanoSize || player.qualityManager.getNavZoomClass() == '4k')) {
  19179. //change 如果放大后和不放大都是2k就不用这个
  19180. return this.panoRenderer.zoomRenderTarget.texture
  19181. } else {
  19182. this.tiledPanoRenderTarget.texture.mapping = THREE.UVMapping //add
  19183. return this.tiledPanoRenderTarget.texture
  19184. }
  19185. } else {
  19186. return null
  19187. }
  19188. }),
  19189. (n.prototype.onTileRenderFail = function (e, t, i) {
  19190. e === this.id && this.emit(f.LoadFailed, t)
  19191. }),
  19192. (n.prototype.isLoaded = function (e) {
  19193. if (this.tiled) {
  19194. if (e && 'string' == typeof e) throw new A('Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass')
  19195. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  19196. }
  19197. if (e && 'number' == typeof e) throw new A('Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.')
  19198. return !!this.solidSkybox.high || e in this.solidSkybox
  19199. }),
  19200. (n.prototype.loadCube = function (e) {
  19201. if (this.isLoaded(e)) return I.info('Skipping load of pano, already loaded'), $.when()
  19202. this.emit('loading', e), this.model.emit('loading', this)
  19203. var t = p.getCubemapUrls(this.model.urls, this.id, e),
  19204. i = t.filter(function (e) {
  19205. return !e
  19206. })
  19207. 'low' === e && i.length > 0 && (I.info('Pano', this.id, 'not available in low res, loading high res right away'), (e = 'high'), (t = p.getCubemapUrls(this.model.urls, this.id, e)))
  19208. var n = 0,
  19209. r = [0, 1, 2, 3, 4, 5].map(
  19210. function (e, i, n) {
  19211. return u.getImage(t[i])
  19212. }.bind(this)
  19213. )
  19214. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(
  19215. function (t, i, n, r, o, a) {
  19216. return (
  19217. (this.solidSkybox[e] = [t, i, n, r, o, a]),
  19218. ('high' !== e && this.solidSkybox.high) || ((this.solidSkybox.image = this.solidSkybox[e]), (this.solidSkybox.low = null)),
  19219. (this.solidSkybox.needsUpdate = !0),
  19220. this.emit('load', e),
  19221. this.model.emit('load', this),
  19222. this
  19223. )
  19224. }.bind(this),
  19225. function () {
  19226. I.error('Downloading cubemap for pano', this.id, 'failed'), (this.failedLoadingAt = Date.now())
  19227. }.bind(this),
  19228. function () {
  19229. return $.when(++n, 6)
  19230. }
  19231. )
  19232. }),
  19233. (n.raycastsSkipped = 0),
  19234. (n.raycastsDone = 0),
  19235. (n.prototype.findNeighourPanos = function () {
  19236. return (
  19237. this.model.panos.setNeighbour(this.id, this.id, !1),
  19238. this.model.panos.forEach(
  19239. function (e) {
  19240. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  19241. var t = this.position.distanceTo(e.position)
  19242. if (t > a.panoramaNeighbourMaxDistance) return this.model.panos.setNeighbour(this, e, !1), void n.raycastsSkipped++
  19243. var i = e.position.clone().sub(this.position).normalize(),
  19244. o = new r.Raycaster(this.position, i.clone(), 0, t),
  19245. s = o.intersectObjects(this.model.colliders)
  19246. n.raycastsDone++,
  19247. this.model.panos.setNeighbour(this, e, 0 === s.length),
  19248. a.showNeighbourRaycasts &&
  19249. (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)))
  19250. }
  19251. }.bind(this)
  19252. ),
  19253. this.model.panos.neighbourMap[this.id]
  19254. )
  19255. }),
  19256. (n.prototype.worldPosition = function () {
  19257. return this.position
  19258. }),
  19259. (n.prototype.addLabel = function () {
  19260. this.removeLabel()
  19261. this.label = new TextSprite({
  19262. sizeInfo: {
  19263. minSize: 100,
  19264. maxSize: 200,
  19265. nearBound: 0.7,
  19266. farBound: 10, //Math.max(20, player.model.size.length() / 3),
  19267. farBoundPlan: 100
  19268. },
  19269. backgroundColor: { r: 255, g: 255, b: 255, a: 0.4 },
  19270. textColor: { r: 0, g: 0, b: 0, a: 1 },
  19271. borderRadius: 15,
  19272. renderOrder: 5,
  19273. text: this.id //`${this.id}-f${this.floorIndex}`
  19274. })
  19275. let position = this.floorPosition.clone()
  19276. position.y += 0.2
  19277. this.label.position.copy(position)
  19278. this.floor.add(this.label)
  19279. }),
  19280. (n.prototype.removeLabel = function () {
  19281. this.label && (this.floor.remove(this.label), this.label.material.dispose(), (this.label = null))
  19282. }),
  19283. /* n.prototype.addTextSprite = function(e, t) {
  19284. this.removeTextSprite();
  19285. var i = document.createElement("canvas")
  19286. , n = i.getContext("2d");
  19287. i.width = 256,
  19288. i.height = 256;
  19289. var o = "Arial"
  19290. , a = 60;
  19291. n.font = "bold " + a + "px " + o,
  19292. n.fillStyle = "white";
  19293. var s = n.measureText(e).width;
  19294. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  19295. var l = new r.Texture(i);
  19296. l.needsUpdate = !0;
  19297. var c = new r.SpriteMaterial({
  19298. map: l,
  19299. color: t || 16428055
  19300. });
  19301. this.text3d = new r.Sprite(c),
  19302. this.text3d.position.copy(this.skyboxMesh.position),
  19303. this.floor.add(this.text3d)
  19304. }
  19305. ,
  19306. n.prototype.removeTextSprite = function() {
  19307. this.text3d && (this.floor.remove(this.text3d),
  19308. this.text3d = null)
  19309. }*/
  19310. (n.prototype.isAligned = function () {
  19311. return this.alignmentType === l.ALIGNED
  19312. }),
  19313. (n.filters = {
  19314. inDirection: function (e, t, i) {
  19315. return function (n) {
  19316. var r = n.position.clone().sub(e).normalize()
  19317. return r.dot(t) > i
  19318. }
  19319. },
  19320. inFloorDirection: function (e, t, i) {
  19321. return function (n) {
  19322. var r = n.floorPosition.clone().sub(e).normalize()
  19323. return r.dot(t) > i
  19324. }
  19325. },
  19326. inPanoDirection: function (e, t, i) {
  19327. return (
  19328. (i = a.navigation.panoScores ? a.navigation.filterStrictness : i),
  19329. function (n) {
  19330. var r = n.floorPosition.clone().sub(e).normalize(),
  19331. o = n.position.clone().sub(e).normalize()
  19332. return r.dot(t) > i || o.dot(t) > i
  19333. }
  19334. )
  19335. },
  19336. atFloor: function (e) {
  19337. return function (t) {
  19338. return !e || t.floor === e
  19339. }
  19340. },
  19341. not: function (e) {
  19342. return function (t) {
  19343. return t !== e
  19344. }
  19345. },
  19346. notIn: function (e) {
  19347. return function (t) {
  19348. return e.indexOf(t) === -1
  19349. }
  19350. },
  19351. isLoaded: function () {
  19352. return function (e) {
  19353. return e.isLoaded()
  19354. }
  19355. },
  19356. isNotLoaded: function () {
  19357. return function (e) {
  19358. return !e.isLoaded()
  19359. }
  19360. },
  19361. isCloseEnoughTo: function (e, t) {
  19362. return function (i) {
  19363. return e.distanceTo(i.floorPosition) < t
  19364. }
  19365. },
  19366. hasMinimumHeightDifferenceTo: function (e, t) {
  19367. return function (i) {
  19368. return Math.abs(i.position.y - e.y) > t
  19369. }
  19370. },
  19371. isNotBehindNormal: function (e, t) {
  19372. var i = new r.Vector3()
  19373. return (
  19374. (t = t.clone()),
  19375. function (n) {
  19376. var r = i.copy(n.position).sub(e).normalize()
  19377. return r.dot(t) > 0
  19378. }
  19379. )
  19380. },
  19381. isNeighbourPanoTo: function (e) {
  19382. return function (t) {
  19383. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  19384. }
  19385. },
  19386. isNeighbourOfNeighbourTo: function (e) {
  19387. return function (t) {
  19388. return (
  19389. !!e.neighbourPanos[t.id] ||
  19390. e.neighbourUUIDs.some(function (i) {
  19391. var n = e.model.panos.get(i)
  19392. return !!n && n.neighbourPanos[t.id]
  19393. })
  19394. )
  19395. }
  19396. },
  19397. isNotRecentlyFailed: function (e) {
  19398. return function (t) {
  19399. return Date.now() - t.failedLoadingAt > e
  19400. }
  19401. },
  19402. isOnVisibleFloor: function () {
  19403. return function (e) {
  19404. return !e.floor.hidden
  19405. }
  19406. },
  19407. isPanoAligned: function () {
  19408. return function (e) {
  19409. return e.isAligned()
  19410. }
  19411. }
  19412. }),
  19413. (n.sortFunctions = {
  19414. distanceToPoint: function (e) {
  19415. return function (t, i) {
  19416. return t.position.distanceTo(e) - i.position.distanceTo(e)
  19417. }
  19418. },
  19419. floorDistanceToPoint: function (e) {
  19420. return function (t, i) {
  19421. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  19422. }
  19423. },
  19424. choose: function (e) {
  19425. return function (t, i) {
  19426. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  19427. }
  19428. }
  19429. }),
  19430. (n.scoreFunctions = {
  19431. distance: function (e, t) {
  19432. return (
  19433. (t = t || a.navigation.distanceFactor),
  19434. function (i) {
  19435. return e ? e.position.distanceTo(i.position) * t : 0
  19436. }
  19437. )
  19438. },
  19439. distanceSquared: function (e, t) {
  19440. return (
  19441. (t = t || a.navigation.distanceFactor),
  19442. function (i) {
  19443. return e ? e.position.distanceToSquared(i.position) * t : 0
  19444. }
  19445. )
  19446. },
  19447. direction: function (e, t) {
  19448. return function (i) {
  19449. var n = i.position.clone().sub(e).normalize()
  19450. return n.dot(t) * a.navigation.directionFactor
  19451. }
  19452. },
  19453. angle: function (e, t) {
  19454. return function (i) {
  19455. var n = i.position.clone().sub(e).normalize()
  19456. return n.angleTo(t) * a.navigation.angleFactor
  19457. }
  19458. },
  19459. inFieldOfView: function (e, t) {
  19460. return function (i) {
  19461. var n = i.position.clone().sub(e).normalize()
  19462. return n.dot(t) > 0.75 ? 10 : -1
  19463. }
  19464. },
  19465. optionality: function (e) {
  19466. return function (t) {
  19467. var i = t.neighbourUUIDs.filter(function (t) {
  19468. return !(t in e.neighbourUUIDs) && t !== e.id
  19469. })
  19470. return i.length * a.navigation.optionalityFactor
  19471. }
  19472. },
  19473. penalizeHeightDifferenceUnder: function (e, t) {
  19474. return function (i) {
  19475. return e.y - i.position.y < t ? -20 : 0
  19476. }
  19477. }
  19478. }),
  19479. (t.exports = n)
  19480. }).call(this, '/js/objects/Panorama.js')
  19481. },
  19482. {
  19483. '../enum/AlignmentType': 17,
  19484. '../enum/GLCubeFaces': 25,
  19485. '../enum/PanoRendererEvents': 35,
  19486. '../enum/PanoSizeClass': 36,
  19487. '../enum/PanoramaEvents': 37,
  19488. '../enum/RenderLayers': 41,
  19489. '../enum/RenderOrder': 42,
  19490. '../enum/TileDownloaderEvents': 45,
  19491. '../enum/Viewmode': 51,
  19492. '../exception/BasicException': 55,
  19493. '../scene/SceneRenderer': 158,
  19494. '../settings': 166,
  19495. '../tile/TileUtils': 174,
  19496. '../util/ajax': 181,
  19497. '../util/common': 185,
  19498. '../util/lerp': 188,
  19499. '../util/logger': 189,
  19500. '../util/panorama': 191,
  19501. '../util/texture': 194,
  19502. '../util/transitions': 195,
  19503. events: 202,
  19504. three: 217
  19505. }
  19506. ],
  19507. 149: [
  19508. function (e, t, i) {
  19509. 'use strict'
  19510. function n(e) {
  19511. var t = r.UniformsUtils.clone(c.waypoint.uniforms)
  19512. ;(t.map.value = d), (t.opacity.value = 0), t.color.value.set(o.reticuleColor), (t.showMouseMarker = !window.DATA.hideMouseMarker)
  19513. r.Mesh.call(
  19514. this,
  19515. new r.PlaneBufferGeometry(0.4, 0.4, 1, 1),
  19516. new r.RawShaderMaterial({
  19517. side: r.DoubleSide,
  19518. depthWrite: !1,
  19519. depthTest: !1,
  19520. transparent: !0,
  19521. vertexShader: c.waypoint.vertexShader,
  19522. fragmentShader: c.waypoint.fragmentShader,
  19523. uniforms: t,
  19524. name: 'waypoint',
  19525. opacity: 0,
  19526. visible: t.showMouseMarker // 显示/隐藏鼠标标志
  19527. })
  19528. ),
  19529. this.layers.set(h.RETICULE),
  19530. (this.renderOrder = u.reticule),
  19531. (this.player = e),
  19532. (this.direction = new r.Vector3()),
  19533. (this.hidden = !0),
  19534. (this.mouseLastMoveTime = Date.now())
  19535. }
  19536. var r = e('three'),
  19537. o = e('../settings'),
  19538. a = e('../util/transitions'),
  19539. s = e('../util/texture'),
  19540. l = e('../util/lerp'),
  19541. c = e('../shaders'),
  19542. h = e('../enum/RenderLayers'),
  19543. u = e('../enum/RenderOrder'),
  19544. d = s.load('images/reticule.png')
  19545. d.anisotropy = browser.isMobile() ? 1 : 4 //各向异性
  19546. ;(n.prototype = Object.create(r.Mesh.prototype)),
  19547. (n.prototype.move = function (e, t, i) {
  19548. ;(this.hidden = i), (this.mouseLastMoveTime = Date.now())
  19549. }),
  19550. (n.prototype.hide = function () {
  19551. this.hidden || ((this.hidden = !0), a.start(l.property(this.material.uniforms.opacity, 'value', 0), o.reticuleOpacityTransitionTime))
  19552. }),
  19553. (n.prototype.show = function () {
  19554. ;(this.hidden = !1), this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, 'value', o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  19555. }),
  19556. (n.prototype.update = function () {
  19557. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  19558. }),
  19559. (n.prototype.updatePosition = function (e, t) {
  19560. if (!this.hidden) {
  19561. if (!t) return this.hide()
  19562. var i = t.point,
  19563. n = e.distanceTo(i),
  19564. r = 1 + 0.01 * n
  19565. n < 1 && (r -= 1 - n),
  19566. this.show(),
  19567. this.scale.set(r, r, r),
  19568. (this.direction = this.direction.multiplyScalar(0.8)),
  19569. this.direction.add(t.face.normal.clone().multiplyScalar(0.2)),
  19570. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(0.01)),
  19571. this.lookAt(this.position.clone().add(this.direction))
  19572. }
  19573. }),
  19574. (n.prototype.writeAstag = function () {
  19575. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16),
  19576. t = new Date()
  19577. this.tagCount = 'undefined' == typeof this.tagCount ? 1 : this.tagCount + 1
  19578. var i = {
  19579. enabled: !0,
  19580. version: '0',
  19581. created: t.toISOString(),
  19582. created_by: 'APITest',
  19583. position: this.position.clone(),
  19584. stem: {
  19585. enabled: o.tags.pole.enabled,
  19586. direction: this.direction.multiplyScalar(o.tags.pole.height)
  19587. },
  19588. label: 'tag ' + this.tagCount,
  19589. description: 'Description ' + e,
  19590. floor: (function (e) {
  19591. if (e.currentFloor) {
  19592. var t = e.floors.indexOf(e.currentFloor)
  19593. return t > -1 ? t : void 0
  19594. }
  19595. })(this.player.model),
  19596. type: 'info',
  19597. metadata: {
  19598. preferred_camera: {
  19599. mode: this.player.mode
  19600. }
  19601. }
  19602. }
  19603. console.log('--------------------------'), console.log(JSON.stringify(i))
  19604. var n = this.player.model.addtag(e, i).build()
  19605. n && (n.disc && this.player.tagDiscs.push(n.disc), n.visible || n.show(o.tags.startup.fadeInDuration))
  19606. }),
  19607. (t.exports = n)
  19608. },
  19609. {
  19610. '../enum/RenderLayers': 41,
  19611. '../enum/RenderOrder': 42,
  19612. '../settings': 166,
  19613. '../shaders': 167,
  19614. '../util/lerp': 188,
  19615. '../util/texture': 194,
  19616. '../util/transitions': 195,
  19617. three: 217
  19618. }
  19619. ],
  19620. 150: [
  19621. function (e, t, i) {
  19622. 'use strict'
  19623. function n(e, t) {
  19624. ;(this.chunks = []), (this.floorId = e), (this.roomId = t), (this.position = new r.Vector3())
  19625. }
  19626. var r = e('three')
  19627. ;(n.prototype.addChunk = function (e) {
  19628. this.chunks.push(e)
  19629. }),
  19630. (n.prototype.calcBoundaries = function () {
  19631. 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++) {
  19632. var s = this.chunks[a],
  19633. l = s.geometry.attributes.position
  19634. if (l) for (var c = 0; c < l.array.length; c += 3) e.set(l.array[c], l.array[c + 1], l.array[c + 2]), t.add(e), 0 === c ? (i.copy(e), n.copy(e)) : (i.max(e), n.min(e)), o++
  19635. }
  19636. o > 0 ? (t.multiplyScalar(1 / o), (this.average = t)) : (this.average = null),
  19637. (this.boundsMax = i),
  19638. (this.boundsMin = n),
  19639. (this.center = new r.Vector3()),
  19640. this.center.copy(i).sub(n).multiplyScalar(0.5).add(n)
  19641. }),
  19642. (t.exports = n)
  19643. },
  19644. {
  19645. three: 217
  19646. }
  19647. ],
  19648. 151: [
  19649. function (e, t, i) {
  19650. ;(function (i) {
  19651. 'use strict'
  19652. function n(e, t, i) {
  19653. ;(this.obj3d = null),
  19654. (this.nodes = []),
  19655. (this.colorHull = []),
  19656. (this.shortPaths = {}),
  19657. (this.floorHull = null),
  19658. (this.cameraHull = null),
  19659. (this.floorPathDistance = 0),
  19660. (this.floorCurvePoints = null),
  19661. (this.floorCurveColors = null),
  19662. (this.camCurvePoints = null),
  19663. (this.warpDestHeroLoc = null),
  19664. (this.warpDestPano = null),
  19665. (this.warpPathPoints = null),
  19666. (this.warpPathLengths = [0]),
  19667. (this.warpLength = 0),
  19668. (this.closeWarpDistance = 4),
  19669. (this.UP = A.UP.clone()),
  19670. (this.longestStep = 0),
  19671. (this.upcomingTransType = null),
  19672. (this.burnsDir = 1), //导览在DOLLHOUSE停留时的旋转方向 1 或 -1
  19673. (this.prevNextDist = 0),
  19674. (this.nextI = 0),
  19675. (this.activeTransType = null),
  19676. (this.lastTransType = null),
  19677. (this.bunnyObj = null),
  19678. (this.director = e),
  19679. (this.player = t),
  19680. (this.playerControls = i),
  19681. (this.modelManager = t.modelManager),
  19682. this.updateModel(),
  19683. this.updateDefaultsFromModelData(),
  19684. this.bindEvents(),
  19685. (this.warping = !1),
  19686. (this.waitingToWarp = !1),
  19687. (this.warpInterrupted = !1),
  19688. (this.warpInterruptionBlackoutStyle = null),
  19689. (this.warpInterruptionTravelTime = null)
  19690. }
  19691. var r = e('three'),
  19692. o = e('../util/logger'),
  19693. a = e('../enum/Viewmode'),
  19694. s = e('../enum/RenderOrder'),
  19695. l = e('../enum/WarpStyle'),
  19696. c = e('../settings'),
  19697. h = e('../util/math'),
  19698. u = e('../util/lerp'),
  19699. d = e('../util/easing'),
  19700. p = e('../util/transitions'),
  19701. f = e('../objects/Snapshot'),
  19702. g = e('../effects'),
  19703. m = e('../shaders'),
  19704. v = (e('../gui/gui'), e('../util/texture')),
  19705. A = e('../enum/Vectors'),
  19706. y = (e('../model/ModelManager'), new o(i)),
  19707. C = e('../enum/PlayerEvents'),
  19708. I = e('../enum/BlackoutStyle'),
  19709. E = e('../enum/ModelManagerEvents'),
  19710. b = e('../constants'),
  19711. w = {
  19712. path: v.loadBase64(
  19713. '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'
  19714. ),
  19715. pathEnd: v.load('images/End.png'),
  19716. pathStart: v.loadBase64(
  19717. '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=='
  19718. )
  19719. }
  19720. ;(n.prototype.setScene = function (e) {
  19721. this.createCpm(e), this.createBunnyObj(e)
  19722. }),
  19723. (n.prototype.updateModel = function () {
  19724. this.model = this.modelManager.getActiveModel()
  19725. }),
  19726. (n.prototype.bindEvents = function () {
  19727. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  19728. }),
  19729. (n.prototype.updateDefaultsFromModelData = function () {
  19730. this.model.data
  19731. }),
  19732. (n.prototype.pointPathDistance = function (e) {
  19733. for (var t = 0, i = 1; i < e.length; i += 1) t += e[i - 1].distanceTo(e[i])
  19734. return t
  19735. }),
  19736. (n.prototype.pointPathLengths = function (e) {
  19737. for (var t = [0], i = 1; i < e.length; i += 1) t.push(t[i - 1] + e[i - 1].distanceTo(e[i]))
  19738. return t
  19739. }),
  19740. (n.prototype.interpAlongPath = function (e, t, i) {
  19741. var n,
  19742. o = new r.Vector3(),
  19743. a = t[t.length - 1]
  19744. if (i < 1) {
  19745. n = i * a
  19746. for (var s = 1; s < t.length; s += 1)
  19747. if (t[s] > n) {
  19748. var l = (n - t[s - 1]) / (t[s] - t[s - 1])
  19749. return o.copy(e[s]), o.sub(e[s - 1]), o.multiplyScalar(l), o.add(e[s - 1]), o
  19750. }
  19751. } else o.copy(e[e.length - 1])
  19752. return o
  19753. }),
  19754. (n.prototype.pathHeight = function () {
  19755. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  19756. }),
  19757. (n.prototype.createBunnyObj = function (e) {
  19758. this.bunnyObj || ((this.bunnyObj = new r.AxisHelper(0.1)), (this.bunnyObj.visible = c.warp.showBunny)),
  19759. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  19760. e.add(this.bunnyObj)
  19761. }),
  19762. (n.prototype.createCpm = function (e) {
  19763. if (!this.currentPanoMarker) {
  19764. var t = this.makeWaypointObj(w.pathEnd, 'Current')
  19765. ;(t.material.uniforms.opacity.value = 0),
  19766. (this.currentPanoMarker = {
  19767. mesh: t,
  19768. placed: !1
  19769. })
  19770. }
  19771. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  19772. this.placeCpm(),
  19773. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  19774. }),
  19775. (n.prototype.placeCpm = function () {
  19776. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  19777. var e = this.player.currentPano.floor
  19778. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor &&
  19779. (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh), e.add(this.currentPanoMarker.mesh)),
  19780. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  19781. (this.currentPanoMarker.mesh.position.y += this.pathHeight()),
  19782. (this.currentPanoMarker.placed = !0)
  19783. } else this.popOutCpm()
  19784. }),
  19785. (n.prototype.fadeInCpm = function (e) {
  19786. ;(this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned()) ||
  19787. (c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 1), e))
  19788. }),
  19789. (n.prototype.fadeOutCpm = function (e) {
  19790. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, 'value', 0), e)
  19791. }),
  19792. (n.prototype.popInCpm = function () {
  19793. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  19794. }),
  19795. (n.prototype.popOutCpm = function () {
  19796. this.fadeOutCpm(2)
  19797. }),
  19798. (n.prototype.brushPrefs = {
  19799. linewidth: 7,
  19800. strokeWidth: 15,
  19801. cvSegments: 48,
  19802. paveStep: 0.1,
  19803. paveWidth: 0.2,
  19804. lookBlendDist: 3,
  19805. maxTurn: r.Math.degToRad(2)
  19806. }),
  19807. (n.prototype.panoPathDistance = function (e) {
  19808. var t = this.model.panos
  19809. if (!e || e.length < 2) return 0
  19810. for (var i = [], n = 0; n < e.length; n += 1) i.push(t.get(e[n]).floorPosition)
  19811. return this.pointPathDistance(i)
  19812. }),
  19813. (n.prototype.loadTileTexture = function (e) {
  19814. var t = v.load(
  19815. e,
  19816. function (t) {
  19817. ;(t.wrapS = r.RepeatWrapping), (t.wrapT = r.RepeatWrapping), (t.needsUpdate = !0), y.debug('path texture "' + e + '" is ready')
  19818. },
  19819. function () {
  19820. y.error('path texture "' + e + '" failed')
  19821. }
  19822. )
  19823. return (t.mapping = r.UVMapping), t
  19824. }),
  19825. (n.prototype.buildWarpDestinationDescriptor = function (e, t, i, n, r, o) {
  19826. var a = {
  19827. cameraMode: n,
  19828. position: e,
  19829. quaternion: t,
  19830. panoId: i,
  19831. orthoZoom: o,
  19832. floorVisibility: r,
  19833. thumbUrl: null,
  19834. name: null
  19835. }
  19836. return new f(a)
  19837. }),
  19838. (n.prototype.buildWarpDestinationDescriptorFromHero = function (e) {
  19839. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19840. }),
  19841. (n.prototype.setWarpDestination = function (e) {
  19842. this.warpDestHeroLoc = e
  19843. }),
  19844. (n.prototype.setWarpDestinationByHeroIndex = function (e) {
  19845. var t = this.getHeroDescriptorByHeroIndex(e)
  19846. return null !== t && (this.setWarpDestination(t), !0)
  19847. }),
  19848. (n.prototype.setWarpDestinationByPano = function (e, t) {
  19849. var i = this.model.panos.get(e.id)
  19850. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19851. }),
  19852. (n.prototype.setWarpDestinationByPanoId = function (e, t) {
  19853. var i = this.model.panos.get(e)
  19854. if (i) {
  19855. t = t || new r.Quaternion()
  19856. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, 'panorama', [], -1)
  19857. return this.setWarpDestination(n), !0
  19858. }
  19859. return !1
  19860. }),
  19861. (n.prototype.getHeroDescriptorByHeroIndex = function (e) {
  19862. var t = this.model.heroCount()
  19863. /* if (null !== this.warpDestHeroLoc && t < 2)
  19864. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19865. this.model.getHeroDescriptorByIndex(0); */
  19866. var i = this.model.getHeroDescriptorByIndex(e)
  19867. if (i) {
  19868. var n = i.isPano() ? i.panoId : i.cameraMode
  19869. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + ' choices.')
  19870. }
  19871. return i
  19872. }),
  19873. (n.prototype.getHeroDescriptorByPano = function (e) {
  19874. var t = this.model.panos.get(e.id)
  19875. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19876. }),
  19877. (n.prototype.getHeroDescriptorByPanoId = function (e) {
  19878. var t = this.getHeroIndexFromPanoId(e)
  19879. return this.getHeroDescriptorByHeroIndex(t)
  19880. }),
  19881. (n.prototype.getHeroIndexFromPanoId = function (e) {
  19882. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19883. var i = this.model.heroLocations[t],
  19884. n = this.getHeroId(i)
  19885. if (n && n === e) return t
  19886. }
  19887. return -1
  19888. }),
  19889. (n.prototype.getHeroPano = function (e) {
  19890. if (null === e) return y.warn('getHeroPano(): no destination'), null
  19891. var t = this.getHeroId(e),
  19892. i = this.model.panos.get(t)
  19893. return void 0 === i && ((i = null), '' !== t && y.debug('unable to find pano "' + t + '"')), i
  19894. }),
  19895. (n.prototype.getHeroId = function (e) {
  19896. return e.panoId
  19897. }),
  19898. (n.prototype.setWarpDestPano = function () {
  19899. return (this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc)), this.warpDestPano
  19900. }),
  19901. (n.prototype.brushToWarpPano = function (e, t) {
  19902. if ((this.discardPathObject(), !this.setWarpDestPano())) return !1
  19903. if ((this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn('Can only brush from pano to pano'), !this.warpDestPano)) return y.info('No brush'), !1
  19904. if (!this.player.currentPano) return y.debug('No current pano, visibility undefined'), !1
  19905. if (!this.warpDestPano) return y.info('No wPano, visibility undefined'), !1
  19906. if (!this.warpDestPano.isAligned()) return y.debug('Cannot brush to unaligned pano'), !1
  19907. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides,
  19908. n = !0
  19909. if (this.player.currentPano.id === this.warpDestPano.id) y.debug('Already at destination pano')
  19910. else {
  19911. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  19912. (n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1),
  19913. (this.obj3d = new r.Object3D()),
  19914. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ')'),
  19915. n
  19916. ? (y.info('No "walkable" route, using fall-back warp style transition'), (e = t))
  19917. : (this.setPathHulls(this.nodes),
  19918. this.setFloorCurves(),
  19919. i &&
  19920. ('chevron' === c.path.style
  19921. ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints))
  19922. : 'ribbon' === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19923. this.player.currentPano.floor.add(this.obj3d)
  19924. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN,
  19925. s = e === l.STD
  19926. if (!n && (i || s)) {
  19927. if (o) {
  19928. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints)
  19929. this.obj3d.add(h)
  19930. }
  19931. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1])
  19932. this.obj3d.add(u)
  19933. }
  19934. this.appearSlow()
  19935. }
  19936. return (this.upcomingTransType = e), !n
  19937. }),
  19938. (n.prototype.findShortestPath = function (e, t) {
  19939. if (!e || !t) return null
  19940. var i = c.warp.walkExtraPanosDistance,
  19941. n = e.id + ':' + t.id + ':' + i
  19942. if (this.shortPaths.hasOwnProperty(n)) return this.shortPaths[n] ? this.shortPaths[n].slice() : null
  19943. var r = t.id + ':' + e.id + ':' + i
  19944. if (this.shortPaths.hasOwnProperty(r)) return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null
  19945. var o = this.model.panos.aStarSearch(e, t)
  19946. return this.model.panos.includeNodesNearPath(o, i), (this.shortPaths[n] = o ? o.slice() : null), o
  19947. }),
  19948. (n.prototype.makePathHulls = function (e) {
  19949. var t,
  19950. i,
  19951. n,
  19952. r,
  19953. o,
  19954. a = 0,
  19955. s = [],
  19956. l = [],
  19957. h = [],
  19958. u = this.model.panos
  19959. ;(t = u.get(e[0])), (r = t.floor.floorIndex)
  19960. for (var d = 0; d < e.length; d += 1)
  19961. (t = u.get(e[d])),
  19962. (i = t.floorPosition.clone().sub(this.model.position)),
  19963. (i.y += this.pathHeight()),
  19964. s.push(i),
  19965. l.push(t.position.clone()),
  19966. (n = t.floor.floorIndex),
  19967. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19968. d > 0 && ((o = l[d].distanceTo(l[d - 1])), o > a && (a = o))
  19969. return (
  19970. a > this.longestStep && ((this.longestStep = a), y.debug('path contains ' + a + ' meter segment')),
  19971. {
  19972. floor: s,
  19973. camera: l,
  19974. color: h
  19975. }
  19976. )
  19977. }),
  19978. (n.prototype.makeFloorCurves = function (e, t, i) {
  19979. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius,
  19980. o = this.pointPathDistance(e) - 2 * n,
  19981. s = e.slice(0),
  19982. l = s[1].clone().sub(s[0])
  19983. ;(l.y = 0),
  19984. l.normalize().multiplyScalar(n),
  19985. (s[0] = new r.Vector3().copy(s[0]).add(l)),
  19986. (l = s[s.length - 2].clone().sub(s[s.length - 1])),
  19987. (l.y = 0),
  19988. l.normalize().multiplyScalar(n),
  19989. (s[s.length - 1] = new r.Vector3().copy(s[s.length - 1]).add(l))
  19990. var h = new r.CatmullRomCurve3(s),
  19991. u = Math.floor(o / i)
  19992. ;(u = 4 * Math.floor(u / 4)), (u = Math.max(4, u))
  19993. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3(), A = 0; A < g.length; A += 1) {
  19994. ;(f = 0), (d = g[A].distanceTo(e[0]))
  19995. for (var y = 1; y < e.length; y += 1) v.copy(g[A]).sub(e[y]), (v.y *= 4), (p = v.length()), p < d && (f = y)
  19996. m.push(t[f])
  19997. }
  19998. return {
  19999. distance: o,
  20000. points: g,
  20001. colors: m
  20002. }
  20003. }),
  20004. (n.prototype.makeCameraCurvePoints = function (e, t) {
  20005. var i = this.pointPathDistance(e),
  20006. n = new r.CatmullRomCurve3(e)
  20007. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  20008. }),
  20009. (n.prototype.makeCameraCurveTangents = function (e, t) {
  20010. var i = this.pointPathDistance(e),
  20011. n = new r.CatmullRomCurve3(e),
  20012. o = Math.max(2, Math.floor(i / t))
  20013. o || (o = 5)
  20014. for (var a = [], s = 0; s <= o; s++) a.push(n.getTangentAt(s / o))
  20015. return a
  20016. }),
  20017. (n.prototype.setPathHulls = function (e) {
  20018. var t = this.makePathHulls(e)
  20019. ;(this.floorHull = t.floor), (this.cameraHull = t.camera), (this.colorHull = t.color)
  20020. }),
  20021. (n.prototype.setFloorCurves = function () {
  20022. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep)
  20023. ;(this.floorPathDistance = e.distance), (this.floorCurvePoints = e.points), (this.floorCurveColors = e.colors)
  20024. }),
  20025. (n.prototype.setCameraCurvePoints = function () {
  20026. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  20027. }),
  20028. (n.prototype.chooseWarpPath = function (e) {
  20029. var t,
  20030. i,
  20031. n,
  20032. o = this.playerControls.cameras[a.PANORAMA]
  20033. if (this.player.currentPano === this.warpDestPano || !e) return (this.warpPathPoints = null), (this.warpLength = 0), !1
  20034. ;(this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano)),
  20035. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1
  20036. ? (y.debug('warp path to unreachable node'),
  20037. (t = this.warpDestPano.position.clone().sub(o.position)),
  20038. (i = t.clone().negate()),
  20039. t.multiplyScalar(0.15).add(o.position),
  20040. i.multiplyScalar(0.15).add(this.warpDestPano.position),
  20041. (t.y = o.position.y),
  20042. (i.y = this.warpDestPano.position.y),
  20043. (n = new r.CubicBezierCurve3(o.position.clone(), t, i, this.warpDestPano.position.clone())),
  20044. (this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)))
  20045. : (y.debug('follow warp path (path distance was ' + this.nodes.length + ' nodes, ' + this.floorPathDistance + ')'),
  20046. this.setCameraCurvePoints(),
  20047. (this.warpPathPoints = this.camCurvePoints.slice(0))),
  20048. (this.warpLength = 0),
  20049. (this.warpPathLengths = [0])
  20050. for (
  20051. 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;
  20052. d < this.warpPathPoints.length;
  20053. d += 1
  20054. ) {
  20055. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d])
  20056. var p = s.length()
  20057. s.y *= c.warp.climbEffort
  20058. var f = s.length() / p
  20059. if (d > 1) {
  20060. s.setY(0).normalize(),
  20061. l
  20062. .copy(this.warpPathPoints[d - 2])
  20063. .sub(this.warpPathPoints[d - 1])
  20064. .setY(0)
  20065. .normalize()
  20066. var g = Math.min(1, s.dot(l)),
  20067. m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h))
  20068. f = Math.max(m, f)
  20069. }
  20070. ;(this.warpLength += p * f), (this.warpPathLengths[d] = this.warpLength)
  20071. }
  20072. return !0
  20073. }),
  20074. (n.prototype.drawPathRibbon = function (e, t) {
  20075. this.bunnyObj.visible = c.warp.showBunny
  20076. for (var i = 0.6 * c.path.ribbonWidth * 0.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) {
  20077. h.copy(e[u]), 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(), h.normalize(), n.crossVectors(h, A.UP), n.multiplyScalar(i)
  20078. var d = new r.Vector3().copy(e[u]).add(o)
  20079. d.sub(n), l.vertices.push(d), (d = new r.Vector3().copy(e[u]).add(o)), d.add(n), l.vertices.push(d)
  20080. }
  20081. var p,
  20082. f = 0
  20083. for (u = 0; u < e.length - 1; u += 1) {
  20084. var g = 2 * u,
  20085. v = f
  20086. f += e[u + 1].distanceTo(e[u])
  20087. var y = f,
  20088. C = t[u],
  20089. I = t[u + 1]
  20090. ;(p = new r.Face3(g, g + 1, g + 2)),
  20091. (p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)]),
  20092. l.faces.push(p),
  20093. l.faceVertexUvs[0].push([new r.Vector2(0, v), new r.Vector2(1, v), new r.Vector2(0, y)]),
  20094. (p = new r.Face3(g + 2, g + 1, g + 3)),
  20095. (p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)]),
  20096. l.faces.push(p),
  20097. l.faceVertexUvs[0].push([new r.Vector2(0, y), new r.Vector2(1, v), new r.Vector2(1, y)])
  20098. }
  20099. l.computeFaceNormals(), l.computeVertexNormals()
  20100. var E, b
  20101. this.player.mode === a.PANORAMA
  20102. ? ((b = r.UniformsUtils.clone(m.ribbon.uniforms)),
  20103. (b.map.value = w.path),
  20104. (b.opacity.value = 0),
  20105. b.color.value.set(c.path.color),
  20106. (E = new r.RawShaderMaterial({
  20107. side: r.DoubleSide,
  20108. depthWrite: !1,
  20109. transparent: !0,
  20110. vertexShader: m.ribbon.vertexShader,
  20111. fragmentShader: m.ribbon.fragmentShader,
  20112. uniforms: b,
  20113. name: 'ribbonT',
  20114. opacity: 0
  20115. })))
  20116. : (E = new r.MeshBasicMaterial({
  20117. color: 16777215,
  20118. side: r.DoubleSide,
  20119. name: 'ribbonOut',
  20120. vertexColors: r.VertexColors
  20121. }))
  20122. var _ = new r.Mesh(l, E)
  20123. return (_.name = 'ribbon'), this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon), _
  20124. }),
  20125. (n.prototype.drawPathPavement = function (e) {
  20126. for (var t, i = 0.25, n = new r.Vector3(), o = new r.Geometry(), s = new r.Vector3(), l = 0; l < e.length; l += 1)
  20127. s.copy(e[l]),
  20128. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  20129. s.normalize(),
  20130. n.crossVectors(s, A.UP),
  20131. n.multiplyScalar(this.brushPrefs.paveWidth),
  20132. (t = new r.Vector3().copy(e[l])),
  20133. t.sub(n),
  20134. o.vertices.push(t),
  20135. o.vertices.push(new r.Vector3().copy(e[l])),
  20136. (t = new r.Vector3().copy(e[l])),
  20137. t.add(n),
  20138. o.vertices.push(t)
  20139. var h, u, d
  20140. for (l = 0; l < e.length - 1; l += 1)
  20141. (h = 3 * l + 1),
  20142. (u = l * i),
  20143. (d = u + i),
  20144. o.faces.push(new r.Face3(h - 1, h, h + 3)),
  20145. o.faceVertexUvs[0].push([new r.Vector2(0, u), new r.Vector2(0.5, u), new r.Vector2(0.5, d)]),
  20146. o.faces.push(new r.Face3(h + 3, h + 2, h - 1)),
  20147. o.faceVertexUvs[0].push([new r.Vector2(0.5, d), new r.Vector2(0, d), new r.Vector2(0, u)]),
  20148. o.faces.push(new r.Face3(h + 3, h, h + 1)),
  20149. o.faceVertexUvs[0].push([new r.Vector2(0.5, d), new r.Vector2(0.5, u), new r.Vector2(1, u)]),
  20150. o.faces.push(new r.Face3(h + 3, h + 1, h + 4)),
  20151. o.faceVertexUvs[0].push([new r.Vector2(0.5, d), new r.Vector2(1, u), new r.Vector2(1, d)])
  20152. var p =
  20153. this.player.mode === a.PANORAMA
  20154. ? new r.MeshBasicMaterial({
  20155. color: c.path.color,
  20156. side: r.DoubleSide,
  20157. transparent: !0,
  20158. depthWrite: !1,
  20159. opacity: 0,
  20160. name: 'paveT',
  20161. map: w.path
  20162. })
  20163. : new r.MeshBasicMaterial({
  20164. color: c.path.color,
  20165. side: r.DoubleSide,
  20166. transparent: !0,
  20167. depthWrite: !1,
  20168. opacity: 1,
  20169. name: 'paveO',
  20170. map: w.path
  20171. })
  20172. return new r.Mesh(o, p)
  20173. }),
  20174. (n.prototype.hintPrefs = {
  20175. rad: 0.18,
  20176. width: 0.0125,
  20177. depth: 0.0625,
  20178. setBack: -0.04,
  20179. markRad: 0.25,
  20180. markInnerRad: 0.16
  20181. }),
  20182. (n.prototype.makeWaypointObj = function (e, t) {
  20183. var i = new r.Geometry(),
  20184. n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius,
  20185. o = this.pathHeight()
  20186. 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)),
  20187. i.faces.push(new r.Face3(0, 1, 2), new r.Face3(2, 3, 0)),
  20188. i.faceVertexUvs[0].push([new r.Vector2(0, 0), new r.Vector2(1, 0), new r.Vector2(1, 1)]),
  20189. i.faceVertexUvs[0].push([new r.Vector2(1, 1), new r.Vector2(0, 1), new r.Vector2(0, 0)])
  20190. var s = r.UniformsUtils.clone(m.waypoint.uniforms)
  20191. ;(s.map.value = e), (s.opacity.value = 0), s.color.value.set(c.path.color)
  20192. var l = {
  20193. side: r.DoubleSide,
  20194. depthWrite: !1,
  20195. transparent: !0,
  20196. vertexShader: m.waypoint.vertexShader,
  20197. fragmentShader: m.waypoint.fragmentShader,
  20198. uniforms: s,
  20199. name: 'waypoint',
  20200. opacity: 0
  20201. }
  20202. this.player.mode !== a.PANORAMA && ((l.depthTest = !1), (l.name = 'wayPtOut'))
  20203. var h = new r.RawShaderMaterial(l),
  20204. u = new r.Mesh(i, h)
  20205. return (u.name = t), u
  20206. }),
  20207. (n.prototype.makeStartMarker = function (e, t) {
  20208. var i = new r.Vector3().copy(t[1]).sub(t[0])
  20209. ;(i.y = 0), i.normalize()
  20210. var n = Math.acos(i.x),
  20211. o = this.makeWaypointObj(w.pathStart, 'Start')
  20212. return o.rotateOnAxis(new r.Vector3(0, 1, 0), n), o.position.copy(e), o
  20213. }),
  20214. (n.prototype.makeEndMarker = function (e) {
  20215. var t = this.makeWaypointObj(w.pathEnd, 'End'),
  20216. i = this.model.panos.get(this.nodes[0]).floor.floorIndex,
  20217. n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex
  20218. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown), t.position.copy(e), t
  20219. }),
  20220. (n.prototype.pathClean = function (e) {
  20221. if (e) {
  20222. for (var t in e.children) this.pathClean(e.children[t])
  20223. e.geometry && e.geometry.dispose(), e.material && e.material.dispose()
  20224. }
  20225. }),
  20226. (n.prototype.discardPathObject = function () {
  20227. if (this.obj3d) {
  20228. var e = this.obj3d.parent
  20229. e && e.remove(this.obj3d), this.pathClean(this.obj3d)
  20230. }
  20231. ;(this.obj3d = null), this.popInCpm()
  20232. }),
  20233. (n.prototype.discardSlow = function () {
  20234. if (this.obj3d) {
  20235. if (this.player.mode !== a.PANORAMA) return void this.discardPathObject()
  20236. for (
  20237. var e,
  20238. t = this,
  20239. i = 0,
  20240. n = function () {
  20241. this.discardPathObject()
  20242. }.bind(this),
  20243. r = 0;
  20244. r < t.obj3d.children.length;
  20245. r += 1
  20246. )
  20247. (e = t.obj3d.children[r]),
  20248. void 0 !== e.material &&
  20249. e.material.transparent === !0 &&
  20250. (void 0 !== e.material.uniforms
  20251. ? p.start(u.property(e.material.uniforms.opacity, 'value', 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing])
  20252. : p.start(u.property(e.material, 'opacity', 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  20253. (i += 1),
  20254. (n = null))
  20255. 0 === i && this.discardPathObject(), this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  20256. }
  20257. }),
  20258. (n.prototype.appearSlow = function () {
  20259. var e,
  20260. t = this
  20261. this.fadeOutCpm(c.path.fadeInTime)
  20262. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  20263. (e = t.obj3d.children[n]),
  20264. void 0 !== e.material &&
  20265. e.material.transparent === !0 &&
  20266. (void 0 !== e.material.uniforms
  20267. ? p.start(u.property(e.material.uniforms.opacity, 'value', i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing])
  20268. : p.start(u.property(e.material, 'opacity', i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  20269. }),
  20270. (n.prototype.update = function () {
  20271. this.obj3d && this.obj3d.updateMatrixWorld()
  20272. }),
  20273. (n.prototype.calcBurnsAmount = function (e) {
  20274. //计算导览点旋转角
  20275. var t = r.Math.degToRad(c.warp.burnsAngle)
  20276. if (this.player.mode === a.PANORAMA) {
  20277. var i = this.burnsDir * t
  20278. if (this.upcomingTransType === l.BLACK) return i
  20279. var n = e
  20280. if (null === n) return y.warn('Transition request for non-highlight'), i
  20281. var o = this.getHeroDescriptorByHeroIndex(n)
  20282. if (null === o) return i
  20283. if (!o.isPano()) return i
  20284. var s = this.getHeroPano(o),
  20285. h = this.playerControls.cameras[a.PANORAMA],
  20286. u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize(),
  20287. d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t),
  20288. p = function (e) {
  20289. var i = Math.acos(Math.min(1, e.dot(u))),
  20290. n = new r.Vector3().crossVectors(u, e)
  20291. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  20292. }
  20293. if (s === this.player.currentPano) return (i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize()))
  20294. var f = this.findShortestPath(this.player.currentPano, s)
  20295. if (void 0 === f || null === f || f.length < 1) return y.debug('Empty path ahead...'), i
  20296. var g = this.makePathHulls(f),
  20297. m = new r.CatmullRomCurve3(g.camera),
  20298. v = Math.min(0.1, c.warp.lookAheadDist / m.getLength())
  20299. return (i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize()))
  20300. }
  20301. return this.player.mode === a.DOLLHOUSE ? 0.02 * this.burnsDir : this.burnsDir
  20302. }),
  20303. (n.prototype.waitNextStep = function (e, t, time) {
  20304. //xzw 改时间
  20305. var i = time == void 0 ? c.warp.tourStepDelay : time
  20306. i == void 0 && (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault)
  20307. var n = new r.Euler(),
  20308. o = new r.Vector3()
  20309. y.debug('Starting wait: ' + (void 0 !== t))
  20310. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem) //this.model.heroLocations[this.director.currentItem[0]]
  20311. var s = currentLocation.dontRot || this.calcBurnsAmount(e),
  20312. h = function () {
  20313. this.endWarpState(), this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0), t && t()
  20314. }.bind(this),
  20315. u = function (e, t) {
  20316. if (this.warpInterrupted) return h(), !0
  20317. var r = t || 1e3 / 60
  20318. if (c.warp.doBurns && !currentLocation.dontRot)
  20319. if (this.player.mode === a.PANORAMA) {
  20320. var l = this.playerControls.cameras[a.PANORAMA]
  20321. n.setFromQuaternion(l.quaternion, c.warp.eOrder)
  20322. var u = i == 0 ? s : (r * s) / i
  20323. u = Math.sign(u) * Math.max(u, 0.0001) //add 如果音频长的话,使旋转可见,否则以为停住了
  20324. ;(n.y += u), o.set(0, 0, -1), o.applyEuler(n), o.add(l.position), l.controls.lookAt(o), l.controls.lookVector.copy(o), l.lookAt(o)
  20325. } else
  20326. this.player.mode === a.DOLLHOUSE ? (this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s) : (this.playerControls.controls[a.FLOORPLAN].absoluteScale *= 0.9996)
  20327. }.bind(this)
  20328. this.startWarpState(), p.start(u, i, h, 0, d.easeInOutQuad, 'wait')
  20329. }),
  20330. (n.prototype.warpToNonPano = function (e) {
  20331. if ((this.discardPathObject(), this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN)) {
  20332. var t = function () {
  20333. e && e()
  20334. }.bind(this)
  20335. this.player.flyToNewMode({
  20336. mode: this.warpDestHeroLoc.cameraMode,
  20337. duration: c.warp.outsideTime,
  20338. warpDest: this.warpDestHeroLoc,
  20339. callback: t,
  20340. force: !0
  20341. })
  20342. } else y.warn('no warp destination!!!'), e && e()
  20343. }),
  20344. (n.prototype._resetWarpShaderParams = function (e) {
  20345. //
  20346. this.player.mode === a.PANORAMA &&
  20347. (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0), void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  20348. /* if(momentTourBlackNewType && "newBlack" in e.material.defines){
  20349. delete e.material.defines.newBlack;
  20350. e.material.needsUpdate = true
  20351. } */
  20352. }),
  20353. (n.prototype._clearWarpShading = function () {
  20354. for (var e = this.model.chunks, t = 0; t < e.length; t += 1) this._resetWarpShaderParams(e[t]), (e[t].visible = !0)
  20355. this._resetWarpShaderParams(this.model.skybox)
  20356. }),
  20357. (n.prototype._warpStopFlying = function () {
  20358. ;(this.activeTransType = null), this.placeCpm()
  20359. }),
  20360. (n.prototype._wrapupTravelOnlyBits = function () {
  20361. this._warpStopFlying(),
  20362. this.warpPathPoints && (this.player.currentPano.exit(), this.warpDestPano.enter(), (this.player.currentPano = this.warpDestPano)),
  20363. this.player.spider.draw(),
  20364. this.placeCpm()
  20365. }),
  20366. (n.prototype._wrapupTravel = function (e) {
  20367. this._wrapupTravelOnlyBits(), this.warpCameraAim(e)
  20368. }),
  20369. (n.prototype._wrapupWarpShading = function (e) {
  20370. this._clearWarpShading(), this._wrapupTravel(e)
  20371. }),
  20372. (n.prototype.wrapupWarpShadingOnly = function (e, t) {
  20373. t !== I.END && this._clearWarpShading(), this._wrapupTravelOnlyBits(), (this.upcomingTransType = null), e && e()
  20374. }),
  20375. (n.prototype._warpCameraAim = function (e, t) {
  20376. //到每个片段终点时转向终点朝向。
  20377. var i = this.warpDestHeroLoc.quaternion,
  20378. n = this.playerControls.cameras[a.PANORAMA],
  20379. o = new r.Vector3(0, 0, 1).applyQuaternion(i).normalize(),
  20380. s = new r.Vector3(0, 0, 1).applyQuaternion(n.quaternion).normalize(),
  20381. l = s.dot(o),
  20382. u = r.Math.radToDeg(Math.acos(l)),
  20383. f = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder),
  20384. g = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  20385. m = new r.Euler(f.x - g.x, f.y - g.y, f.z - g.z, c.warp.eOrder)
  20386. ;(m.y = h.constrainedTurn(m.y)), (this.burnsDir = Math.sign(m.y))
  20387. var v = new r.Euler(0, 0, 0, c.warp.eOrder),
  20388. A = new r.Vector3(),
  20389. C = function (e, t) {
  20390. return (
  20391. !!this.warpInterrupted ||
  20392. ((v.x = g.x + e * m.x),
  20393. (v.y = g.y + e * m.y),
  20394. (v.z = g.z + e * m.z),
  20395. A.set(0, 0, -1),
  20396. A.applyEuler(v),
  20397. A.add(n.position),
  20398. n.controls.lookAt(A),
  20399. n.controls.lookVector.copy(A),
  20400. void n.lookAt(A))
  20401. )
  20402. }.bind(this)
  20403. /* return u > c.warp.minRotation ? (p.start(C, e, t, 0, d[c.warp.movementEasing])
  20404. ,(this.warpDestHeroLoc.zoom != this.player.zoomLevel) && //add 原地转向最终方位时
  20405. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom , e)
  20406. ):
  20407. (y.info("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim")
  20408. ,void (t && t())
  20409. ) */
  20410. this.warpDestHeroLoc.zoom != this.player.zoomLevel && //add 原地转向最终方位时
  20411. this.player.smoothZoomFovTo(null, this.warpDestHeroLoc.zoom, e)
  20412. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.info('Aim angle only is ' + u.toPrecision(3) + ' degrees, skipping explicit re-aim'), void (t && t()))
  20413. }),
  20414. (n.prototype._warpBendAim = function (e, t, i, n) {
  20415. var o = n || 0,
  20416. s = this.playerControls.cameras[a.PANORAMA],
  20417. l = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder),
  20418. u = new r.Euler().setFromQuaternion(s.quaternion, c.warp.eOrder),
  20419. f = new r.Euler(l.x - u.x, l.y - u.y, l.z - u.z, c.warp.eOrder)
  20420. f.y = h.constrainedTurn(f.y)
  20421. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x))
  20422. ;(f.x = g * Math.sign(f.x)), (g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g)), (this.burnsDir = Math.sign(f.y)), (g *= Math.sign(f.y)), (f.y = g)
  20423. var m = new r.Euler(0, 0, 0, c.warp.eOrder),
  20424. v = new r.Vector3(),
  20425. A = function (e, t) {
  20426. if (e < 0.5) (m.x = u.x + e * f.x), (m.y = u.y + e * f.y), (m.z = u.z + e * f.z)
  20427. else {
  20428. var i = (1 - e) * c.warp.softBendEnd
  20429. ;(m.x = l.x - i * f.x), (m.y = l.y - i * f.y), (m.z = l.z - i * f.z)
  20430. }
  20431. v.set(0, 0, -1), v.applyEuler(m), v.add(s.position)
  20432. s.controls.lookAt(v), s.controls.lookVector.copy(v), s.lookAt(v)
  20433. }.bind(this)
  20434. if (window.DATA.momentTourBlackNewType) {
  20435. A(1)
  20436. } else return p.start(A, t, i, o, d[c.warp.movementEasing])
  20437. }),
  20438. (n.prototype._warpStepCameraAim = function (e, t, i) {
  20439. var n = this.playerControls.cameras[a.PANORAMA],
  20440. o = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder),
  20441. s = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  20442. l = new r.Euler(o.x - s.x, o.y - s.y, o.z - s.z, c.warp.eOrder)
  20443. ;(l.y = h.constrainedTurn(l.y)), (this.burnsDir = Math.sign(l.y))
  20444. var u = new r.Euler(0, 0, 0, c.warp.eOrder),
  20445. f = new r.Vector3(),
  20446. g = function (e, t) {
  20447. e < 0.5 ? u.copy(s) : u.copy(o), f.set(0, 0, -1), f.applyEuler(u), f.add(n.position), n.controls.lookAt(f), n.controls.lookVector.copy(f), n.lookAt(f)
  20448. }.bind(this)
  20449. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  20450. }),
  20451. (n.prototype.setBurnsDir = function () {
  20452. var e = this.playerControls.cameras[a.PANORAMA],
  20453. t = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder),
  20454. i = new r.Euler().setFromQuaternion(e.quaternion, c.warp.eOrder),
  20455. n = new r.Euler(t.x - i.x, t.y - i.y, t.z - i.z, c.warp.eOrder)
  20456. ;(n.y = h.constrainedTurn(n.y)), (this.burnsDir = Math.sign(n.y))
  20457. }),
  20458. (n.prototype.stepWarpPath = function (firstPos, e) {
  20459. var i = this.playerControls.cameras[a.PANORAMA]
  20460. var n = this.warpPathPoints ? this.warpPathPoints[0] : firstPos
  20461. if (!n) {
  20462. return i.position.copy(this.warpDestPano.position), !0
  20463. }
  20464. /* if (!this.warpPathPoints)
  20465. return i.position.copy(this.warpDestPano.position),
  20466. !0;
  20467. var n = this.warpPathPoints[0] */
  20468. var o = this.warpDestPano.position
  20469. /* console.log(firstPos)
  20470. console.log(o) */
  20471. if (null !== this.nodes && this.cameraHull && this.cameraHull.length > 1) {
  20472. var s = new r.Vector3()
  20473. e < 0.5
  20474. ? s
  20475. .copy(this.cameraHull[1])
  20476. .sub(n)
  20477. .normalize()
  20478. .multiplyScalar(c.warp.softPushDist * e)
  20479. .add(n)
  20480. : s
  20481. .copy(this.cameraHull[this.cameraHull.length - 2])
  20482. .sub(o)
  20483. .normalize()
  20484. .multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e))
  20485. .add(o),
  20486. i.position.copy(s)
  20487. } else e < 0.5 ? i.position.copy(n) : i.position.copy(o)
  20488. }),
  20489. (n.prototype.interruptAndFastForward = function (e, t) {
  20490. this.warping &&
  20491. ((this.warpInterrupted = !0),
  20492. (this.warpInterruptionBlackoutStyle = e),
  20493. (this.warpInterruptionTravelTime = t),
  20494. (null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle) || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  20495. (null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime) || (this.warpInterruptionTravelTime = c.minWarpTime))
  20496. }),
  20497. (n.prototype.warpCameraAim = function (e) {
  20498. var t = c.warp.minWarpTime
  20499. if (this.upcomingTransType === l.BLACK) t = c.warp.teleportTime
  20500. else {
  20501. var i = this.playerControls.cameras[a.PANORAMA],
  20502. n = new r.Euler(0, 0, 0, c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder),
  20503. o = new r.Euler().setFromQuaternion(i.quaternion, c.warp.eOrder),
  20504. s = new r.Euler(n.x - o.x, n.y - o.y, n.z - o.z, c.warp.eOrder)
  20505. s.y = h.constrainedTurn(s.y)
  20506. var u = (1e3 * Math.abs(s.y)) / r.Math.degToRad(c.warp.maxAimPerSec)
  20507. t = Math.max(t, u)
  20508. }
  20509. var d = function () {
  20510. this._warpStopFlying(), this.discardSlow(), e && e()
  20511. }.bind(this)
  20512. this._warpCameraAim(t, d)
  20513. }),
  20514. (n.prototype.warpCommonParameters = function (e, t, i, n) {
  20515. this.model.skybox.material.uniforms.blackout.value = n
  20516. var r = u.uniform(this.model.skybox, 'progress', 1),
  20517. o = u.allUniforms(this.model.chunks, 'progress', 1),
  20518. a = !1,
  20519. s = function () {
  20520. if (this.warpInterrupted) return (a = !0), !0
  20521. }.bind(this),
  20522. l = function (e, t) {
  20523. return i && a ? ((this.model.skybox.material.uniforms.progress.value = 0), !0) : void r(e, t)
  20524. }.bind(this),
  20525. h = function (e, t) {
  20526. return i && a ? (o(0), !0) : void o(e, t)
  20527. }.bind(this)
  20528. p.start(s, e, null, t, null, 'safeHaltWatch'), p.start(l, e, null, t, d[c.warp.blendEasing], 'skyboxProgress'), p.start(h, e, null, t, d[c.warp.blendEasing], 'chunkProgress')
  20529. }),
  20530. (n.prototype.warpTravel_STD = function (e) {
  20531. var t,
  20532. i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength),
  20533. n = this.playerControls.cameras[a.PANORAMA],
  20534. o = (Math.min(0.25, 3 / this.warpLength), Math.min(0.35, 7 / this.warpLength)),
  20535. s = new r.Euler(0, 0, 0, c.warp.eOrder),
  20536. f = new r.Vector3(),
  20537. m = new r.Euler().setFromQuaternion(n.quaternion, c.warp.eOrder),
  20538. v = new r.Euler().copy(m),
  20539. C = n.position.clone(),
  20540. E = new r.Matrix4(),
  20541. b = new r.Euler(),
  20542. w = c.warp.minWarpTime
  20543. ;(w += this.warpLength * c.warp.timePerMeter), c.warp.flySpeed > 0.01 && (w = (1e3 * this.warpLength) / c.warp.flySpeed)
  20544. var _ = !1,
  20545. T = this.warpDestHeroLoc.quaternion,
  20546. x = new r.Vector3(0, 0, -1).applyQuaternion(T).normalize(),
  20547. S = this.warpPathPoints[this.warpPathPoints.length - 1]
  20548. .clone()
  20549. .sub(this.warpPathPoints[this.warpPathPoints.length - 2])
  20550. .normalize(),
  20551. M = S.dot(x),
  20552. R = r.Math.radToDeg(Math.acos(M)),
  20553. P = function (e) {
  20554. var t = o,
  20555. i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1))
  20556. return i
  20557. },
  20558. O = function () {
  20559. return (
  20560. E.lookAt(C, t, A.UP),
  20561. s.setFromRotationMatrix(E, c.warp.eOrder),
  20562. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20563. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20564. h.constrainedTurn(b.y)
  20565. )
  20566. }.bind(this),
  20567. L = function (e, t) {
  20568. if (this.warpInterrupted) return (_ = !0), !0
  20569. }.bind(this),
  20570. D = function (e, t) {
  20571. return _ || !this.warpPathPoints ? (g.blur(0), !0) : void g.blur(e)
  20572. }.bind(this),
  20573. N = u.allUniforms(this.model.chunks, 'modelAlpha', 1),
  20574. B = function (e, t) {
  20575. return _ || !this.warpPathPoints ? (N(0), !0) : void N(e, t)
  20576. }.bind(this),
  20577. F = function (e, t) {
  20578. if (!this.warpPathPoints) return n.position.copy(this.warpDestPano.position), !0
  20579. if (_) return !0
  20580. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e)
  20581. n.position.copy(i), (C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, 0.99 * e))
  20582. }.bind(this),
  20583. V = function (e, n) {
  20584. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug('Lost bunny.'), !0)
  20585. }.bind(this),
  20586. U = function (e, o) {
  20587. if (_) return y.debug('>>>> Walkthrough interupted at t=' + e), !0
  20588. if (!this.warpPathPoints) return !0
  20589. var a = this.warpLength * e,
  20590. l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist),
  20591. u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength)
  20592. c.warp.matchCam && (l *= 1 - u),
  20593. E.lookAt(C, t, A.UP),
  20594. s.setFromRotationMatrix(E, c.warp.eOrder),
  20595. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  20596. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  20597. (b.y = h.constrainedTurn(b.y)),
  20598. (s.x = m.x + l * b.x),
  20599. (s.y = m.y + l * b.y),
  20600. (s.z = m.z + l * b.z),
  20601. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  20602. (b.y = h.constrainedTurn(b.y))
  20603. var d = (r.Math.degToRad(c.warp.maxTurnPerSec) * o) / 1e3
  20604. ;(b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y))),
  20605. (v.x = v.x + b.x * c.warp.turnFriction),
  20606. (v.y = v.y + b.y * c.warp.turnFriction),
  20607. (v.z = v.z + b.z * c.warp.turnFriction),
  20608. (v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x))
  20609. var p = t.clone().sub(C).normalize()
  20610. if (R < c.warp.maxAimRotation && u > 0) {
  20611. var g = 1 - u
  20612. ;(p.x = p.x * g + u * S.x), (p.y = p.y * g + u * S.y), (p.z = p.z * g + u * S.z), p.normalize()
  20613. }
  20614. this.bunnyObj.position.copy(n.position).add(p),
  20615. f.set(0, 0, -1).applyEuler(v).normalize(),
  20616. f.multiplyScalar(8),
  20617. f.add(n.position),
  20618. (e > 1 - i && c.warp.matchCam) || (n.controls.lookAt(f), n.controls.lookVector.copy(f), n.lookAt(f))
  20619. }.bind(this),
  20620. k = function () {
  20621. _ ? (this.discardSlow(), (this.upcomingTransType = l.BLACK), this.warpTravel_BLACK(-0.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  20622. }.bind(this)
  20623. V(0)
  20624. var H = c.warp.motionLeadTime + (1e3 * Math.abs(O())) / r.Math.degToRad(c.warp.maxTurnPerSec)
  20625. w += H
  20626. var G = H / w
  20627. this.warpCommonParameters(w, G, !0, I.NONE),
  20628. p.start(L, w, null, 0, null, '_haltWatcher'),
  20629. c.warp.blur > 0 && ((g.blurStrength = c.warp.blur), p.start(D, w, null, G, P, 'blurring')),
  20630. p.start(B, w, null, G, P, 'modelAlpha'),
  20631. p.start(F, w, null, G, d[c.warp.blendEasing], 'followPath'),
  20632. p.start(V, w, null, G, d[c.warp.blendEasing], 'goBunny'),
  20633. p.start(U, w, k, 0, d[c.warp.blendEasing], 'lookAtBunny')
  20634. }),
  20635. (n.prototype.warpTravel_BLACK = function (e, t, i, n) {
  20636. var r = e || 0
  20637. ;(void 0 !== t && null !== t) || (t = c.warp.teleportTime)
  20638. //add
  20639. var done = () => {
  20640. Hot.updateVisibles([this.player.currentPano]) //更新热点显示
  20641. this.player.transitionPos({
  20642. type: 'beforeFlytopano',
  20643. pano: this.player.currentPano,
  20644. dur: 100
  20645. }) //add
  20646. }
  20647. if (window.DATA.momentTourBlackNewType) {
  20648. player.sceneRenderer.effects.fastTranMaskPass.start(player.sceneRenderer)
  20649. var camera = this.playerControls.cameras[a.PANORAMA]
  20650. var end = this.warpDestHeroLoc.position
  20651. camera.position.copy(end)
  20652. setTimeout(() => {
  20653. player.sceneRenderer.effects.fastTranMaskPass.stop()
  20654. this.wrapupWarpShadingOnly(n, i)
  20655. done()
  20656. }, t)
  20657. } else {
  20658. var o = function () {
  20659. this.wrapupWarpShadingOnly(n, i)
  20660. done()
  20661. }.bind(this)
  20662. var firstPos = this.player.position.clone() //add
  20663. p.start(this.stepWarpPath.bind(this, firstPos), t, o, r, d[c.warp.blendEasing], 'stepMotion')
  20664. }
  20665. this.warpCommonParameters(t, r, !1, i)
  20666. this.model.chunks.concat(this.model.skybox).forEach(function (e) {
  20667. // 改
  20668. if (window.DATA.momentTourBlackNewType) {
  20669. e.material.uniforms.blackout.value = 5 //i 改
  20670. //e.material.defines.newBlack = ''
  20671. //e.material.needsUpdate = true
  20672. } else {
  20673. e.material.uniforms.blackout.value = i
  20674. }
  20675. }),
  20676. this._warpBendAim(null, t, null, r)
  20677. }),
  20678. (n.prototype.flightStepWalk = (function (e, t, i) {
  20679. var n = 0.001,
  20680. o = 1,
  20681. a = 1.2,
  20682. s = new r.Vector3(),
  20683. h = new r.Vector3(),
  20684. u = function (e, t) {
  20685. //导览速度
  20686. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold),
  20687. // , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  20688. r = i * c.warp.flytimeDistanceMultiplier + c.warp.flyTime
  20689. h.copy(A.FORWARD), this.player.getDirection(h), s.copy(t).sub(e.position).normalize()
  20690. var l = s.dot(h),
  20691. u = Math.acos(l),
  20692. d = u / r
  20693. d > n && ((r *= d / n), u < o && (r *= a))
  20694. return (r / DATA.tourWalkSpeed) * 100 // 改
  20695. }
  20696. return function (e, t, i) {
  20697. if (this.warpInterrupted) i && i()
  20698. else if (this.activeTransType !== l.WALK) this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), i && i()
  20699. else if (this.player.currentPano !== e) {
  20700. var n = {
  20701. pano: e,
  20702. lookAtPoint: t,
  20703. duration: null,
  20704. maxDistanceOverride: c.warp.walkMaxDist,
  20705. skipWarpingCheck: !1,
  20706. constantMoveSpeed: !0
  20707. }
  20708. if (e == this.warpDestPano) {
  20709. //到达终点前,放大到终点的zoom
  20710. n.zoomLevel = this.warpDestHeroLoc.zoom
  20711. }
  20712. ;(n.duration = u.call(this, e, t)), this.player.nonInterruptingFlyToPano(n, i)
  20713. } else i && i()
  20714. }
  20715. })()),
  20716. (n.prototype.makeWalkFlightFunc = function (e, t, i) {
  20717. return this.flightStepWalk.bind(this, e, t, i)
  20718. }),
  20719. (n.prototype.warpTravel_WALK = (function () {
  20720. var e = []
  20721. return function (t) {
  20722. var i = this.player.model.panos
  20723. e.length = 0
  20724. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20725. var s = this.nodes[a],
  20726. l = i.get(s)
  20727. a === this.nodes.length - 1
  20728. ;(o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist), (n && o) || (e.push(s), (n = l))
  20729. }
  20730. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1])
  20731. var h = e.length,
  20732. u = i.get(e[h - 1]),
  20733. d = new Array(h + 1)
  20734. d[d.length - 1] = function () {
  20735. t && t()
  20736. }.bind(this)
  20737. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20738. var g = e[p]
  20739. u = i.get(g)
  20740. var m = new r.Vector3()
  20741. this.getLookAtForWalkingTourNode(e, p, m), (d[f - 1] = this.makeWalkFlightFunc(u, m, d[f])), p--
  20742. }
  20743. d[0]()
  20744. }
  20745. })()),
  20746. (n.prototype.getLookAtForWalkingTourNode = (function () {
  20747. var e = new r.Vector3(),
  20748. t = new r.Vector3(),
  20749. i = new r.Vector3(),
  20750. n = new r.Vector3(),
  20751. o = new r.Vector3(),
  20752. a = 0.65,
  20753. s = 0.75,
  20754. l = 0.2,
  20755. c = 0.4,
  20756. h = 0.2,
  20757. u = 3
  20758. return function (r, d, p) {
  20759. var f = r.length
  20760. if (d >= f) return !1
  20761. var g = 1,
  20762. m = 1
  20763. t.set(0, 0, 0), o.set(0, 0, 0)
  20764. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20765. if (((v = this.player.model.panos.get(r[A])), this.getOrientationForWalkingTourNode(r, A, i), A === d && e.copy(i), n.copy(i), A > d)) {
  20766. var y = n.dot(e) < a
  20767. ;(g *= y ? l : s), (m *= y ? h : c)
  20768. }
  20769. i.multiplyScalar(g), t.add(i), o.lerp(v.position, m)
  20770. }
  20771. return t.normalize(), p.copy(o), p.add(t), !0
  20772. }
  20773. })()),
  20774. (n.prototype.getOrientationForWalkingTourNode = function (e, t, i) {
  20775. var n = e.length
  20776. if (t >= n) return !1
  20777. if (t === n - 1) i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion)
  20778. else {
  20779. var r = this.player.model.panos.get(e[t]),
  20780. o = this.player.model.panos.get(e[t + 1])
  20781. i.copy(o.position).sub(r.position)
  20782. }
  20783. return i.normalize(), !0
  20784. }),
  20785. (n.prototype.warpCameraTravel = function (e, t, i, n) {
  20786. if (((this.activeTransType = this.upcomingTransType), (this.lastTransType = this.activeTransType), (this.upcomingTransType = null), !e)) {
  20787. var r = function () {
  20788. this._wrapupTravel(n)
  20789. }.bind(this),
  20790. o = {
  20791. pano: this.warpDestPano,
  20792. lookAtPoint: null,
  20793. duration: null,
  20794. maxDistanceOverride: null,
  20795. skipWarpingCheck: !1
  20796. }
  20797. return void this.player.flyToPano(o, r)
  20798. }
  20799. this.activeTransType === l.BLACK
  20800. ? this.warpTravel_BLACK(null, i, t, n)
  20801. : this.activeTransType === l.WALK
  20802. ? this.warpTravel_WALK(
  20803. function () {
  20804. this._clearWarpShading(), this._warpStopFlying(), this.player.spider.draw(), this.placeCpm(), n && n()
  20805. }.bind(this)
  20806. )
  20807. : this.warpTravel_STD(n)
  20808. }),
  20809. (n.prototype.startWarpState = function () {
  20810. ;(this.warping = !0), (this.warpInterrupted = !1), (this.warpInterruptionBlackoutStyle = null), (this.warpInterruptionTravelTime = null)
  20811. }),
  20812. (n.prototype.endWarpState = function () {
  20813. this.warping = !1
  20814. }),
  20815. (n.prototype.warpToPano = function (e, t, i, n) {
  20816. if (this.warping) return void y.warn('Cannot warp when already warping')
  20817. if (((this.upcomingTransType = e), (this.activeTransType = null), !this.setWarpDestPano())) return (this.upcomingTransType = null), void this.warpToNonPano(n)
  20818. if (this.player.mode !== a.PANORAMA)
  20819. return (
  20820. (this.upcomingTransType = null),
  20821. this.discardSlow(),
  20822. void this.player.flyToNewMode({
  20823. mode: a.PANORAMA,
  20824. pano: this.warpDestPano,
  20825. duration: c.warp.outsideTime,
  20826. warpDest: this.warpDestHeroLoc,
  20827. callback: n,
  20828. force: !0
  20829. })
  20830. )
  20831. if (!this.warpDestPano) return y.warn('no warp destination, callback dropped'), void (this.upcomingTransType = null)
  20832. var r = !(
  20833. this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) &&
  20834. this.warpDestPano !== this.player.currentPano &&
  20835. this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist
  20836. ),
  20837. o = this.chooseWarpPath(r)
  20838. if (o && this.upcomingTransType !== l.WALK) {
  20839. var s = function () {
  20840. ;(this.waitingToWarp = !1), this.warpToPano(e, t, i, n)
  20841. }.bind(this)
  20842. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, 'high', 'low', this.player.basePanoSize, s)) return void (this.waitingToWarp = !0)
  20843. }
  20844. this.player.currentPano ||
  20845. (y.warn('Arrived at a very strange spot!'), (this.player.currentPano = this.warpDestPano), this.placeCpm(), this.fadeOutCpm(c.path.fadeOutTime), this.player.spider.draw()),
  20846. y.debug('Warping to pano ', this.warpDestPano.position),
  20847. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20848. this.startWarpState()
  20849. var h = function () {
  20850. this.endWarpState(), n && n()
  20851. }.bind(this)
  20852. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h)
  20853. //this.player.smoothZoomToDefault(c.zoom.restoreTime);
  20854. }),
  20855. (t.exports = n)
  20856. }).call(this, '/js/objects/ShowPath.js')
  20857. },
  20858. {
  20859. '../constants': 8,
  20860. '../effects': 16,
  20861. '../enum/BlackoutStyle': 18,
  20862. '../enum/ModelManagerEvents': 33,
  20863. '../enum/PlayerEvents': 40,
  20864. '../enum/RenderOrder': 42,
  20865. '../enum/Vectors': 50,
  20866. '../enum/Viewmode': 51,
  20867. '../enum/WarpStyle': 52,
  20868. '../gui/gui': 65,
  20869. '../model/ModelManager': 140,
  20870. '../objects/Snapshot': 153,
  20871. '../settings': 166,
  20872. '../shaders': 167,
  20873. '../util/easing': 186,
  20874. '../util/lerp': 188,
  20875. '../util/logger': 189,
  20876. '../util/math': 190,
  20877. '../util/texture': 194,
  20878. '../util/transitions': 195,
  20879. three: 217
  20880. }
  20881. ],
  20882. 152: [
  20883. function (e, t, i) {
  20884. 'use strict'
  20885. function n() {
  20886. var e = new r.SphereBufferGeometry(a.skyboxRadius, 20, 5),
  20887. t = new r.RawShaderMaterial({
  20888. fragmentShader: o.skysphere.fragmentShader,
  20889. vertexShader: o.skysphere.vertexShader,
  20890. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20891. side: r.BackSide,
  20892. name: 'skysphere'
  20893. })
  20894. ;(t.uniforms.radius.value = e.parameters.radius), r.Mesh.call(this, e, t)
  20895. }
  20896. var r = e('three'),
  20897. o = e('../shaders'),
  20898. a = e('../settings')
  20899. ;(n.prototype = Object.create(r.Mesh.prototype)), (n.prototype.constructor = n), (t.exports = n)
  20900. },
  20901. {
  20902. '../settings': 166,
  20903. '../shaders': 167,
  20904. three: 217
  20905. }
  20906. ],
  20907. 153: [
  20908. function (e, t, i) {
  20909. ;(function (i) {
  20910. 'use strict'
  20911. function n(e) {
  20912. o.call(this, e),
  20913. (this.sid = e.sid), //xzw add
  20914. (this.panoId = e.panoId),
  20915. (this.orthoZoom = e.orthoZoom),
  20916. (this.floorVisibility = e.floorVisibility),
  20917. (this.thumbUrl = e.thumbUrl),
  20918. (this.name = e.name),
  20919. (this.zoom = e.zoom)
  20920. }
  20921. var r = (e('three'), e('../util/logger')),
  20922. o = (e('../settings'), e('../enum/Viewmode'), e('../util/common'), e('../util/transitions'), e('../util/lerp'), e('../util/ajax'), e('../util/texture'), e('./View'))
  20923. e('events').EventEmitter, new r(i)
  20924. ;(n.prototype = Object.create(o.prototype)),
  20925. (n.prototype.isPano = function () {
  20926. return this.panoId && '' !== this.panoId && this.panoId != 'outside'
  20927. }),
  20928. (t.exports = n)
  20929. }).call(this, '/js/objects/Snapshot.js')
  20930. },
  20931. {
  20932. '../enum/Viewmode': 51,
  20933. '../settings': 166,
  20934. '../util/ajax': 181,
  20935. '../util/common': 185,
  20936. '../util/lerp': 188,
  20937. '../util/logger': 189,
  20938. '../util/texture': 194,
  20939. '../util/transitions': 195,
  20940. './View': 154,
  20941. events: 202,
  20942. three: 217
  20943. }
  20944. ],
  20945. 154: [
  20946. function (e, t, i) {
  20947. ;(function (i) {
  20948. 'use strict'
  20949. function n(e) {
  20950. ;(e = e || {}), (this.position = new r.Vector3()), (this.quaternion = new r.Quaternion()), this.update(e)
  20951. }
  20952. var r = e('three'),
  20953. o = e('../util/logger'),
  20954. a = (e('../settings'), e('../enum/Viewmode'), e('../util/common'), e('../util/transitions'), e('../util/lerp'), e('../util/ajax'), e('../util/texture'), e('events').EventEmitter)
  20955. new o(i)
  20956. ;(n.prototype = Object.create(a.prototype)),
  20957. (n.prototype.isValid = function () {
  20958. return !!this.cameraMode
  20959. }),
  20960. (n.prototype.update = function (e) {
  20961. return (
  20962. (this.cameraMode = e.cameraMode || this.cameraMode),
  20963. (this.pano = e.pano || this.pano),
  20964. e.position && this.position.copy(e.position),
  20965. e.quaternion && this.quaternion.copy(e.quaternion),
  20966. this
  20967. )
  20968. }),
  20969. (t.exports = n)
  20970. }).call(this, '/js/objects/View.js')
  20971. },
  20972. {
  20973. '../enum/Viewmode': 51,
  20974. '../settings': 166,
  20975. '../util/ajax': 181,
  20976. '../util/common': 185,
  20977. '../util/lerp': 188,
  20978. '../util/logger': 189,
  20979. '../util/texture': 194,
  20980. '../util/transitions': 195,
  20981. events: 202,
  20982. three: 217
  20983. }
  20984. ],
  20985. 155: [
  20986. function (e, t, i) {
  20987. //player.js
  20988. ;(function (i) {
  20989. 'use strict'
  20990. function n(e) {
  20991. ;(this.currentPano = null),
  20992. (this.nextPano = null),
  20993. (this.camera = null),
  20994. (this.paused = !1),
  20995. (this.flying = !1),
  20996. (this.sceneIntersectionPlane = null),
  20997. (this.target = new r.Vector3()),
  20998. (this.mouse = new r.Vector3(1.1, 1.1, 0.5)),
  20999. (this.mouseAtMouseDown = new r.Vector2()),
  21000. (this.mouseCouldBeClickToMove = !1),
  21001. (this.mouseLastMoveTime = Date.now()),
  21002. (this.mouseDown = !1),
  21003. (this.mouseDownTimer = null),
  21004. (this.couldBeLongTap = !1),
  21005. (this.containsMouse = !1), //
  21006. (this.isTouchEvent = !1),
  21007. (this.isPanoHover = !1),
  21008. (this.reticule = new a(this)),
  21009. (this.panoMarkers = []),
  21010. (this.spider = new h(this)),
  21011. (this.quaternion = new r.Quaternion()),
  21012. (this.position = new r.Vector3(15, 10, 15)),
  21013. (this.previousState = null),
  21014. (this.lastInsideView = new c()),
  21015. (this.last360View = new c()),
  21016. (this.raycaster = new r.Raycaster()),
  21017. (this.intersect = null),
  21018. (this.lastChangeTime = Date.now()),
  21019. (this.history = new I()),
  21020. (this.cameraControls = null),
  21021. (this.path = null),
  21022. (this.model = null),
  21023. (this.domElement = null),
  21024. (this.cachedPanoCandidates = null),
  21025. (this.basePanoSize = 0),
  21026. (this.standardPanoSize = 0),
  21027. (this.highPanoSize = 0),
  21028. (this.ultraHighPanoSize = 0),
  21029. (this.zoomLevel = 1),
  21030. (this.zooming = 0),
  21031. (this.zoomSpeed = 0.5),
  21032. (this.scrollZoomSpeed = 0.06),
  21033. (this.zoomSpeedAdjust = 0.05),
  21034. (this.defaultZoomIncrement = 0.2),
  21035. (this.baseFov = f.insideFOV),
  21036. (this.zoomFov = this.baseFov),
  21037. (this.zoomEnabled = !0),
  21038. (this.preRenderingEnabled = !1),
  21039. this.setupCustomProperties(e),
  21040. (this.zoomStats = new L())
  21041. window.player = this
  21042. this.modeTran = ''
  21043. }
  21044. var r = e('three'),
  21045. o = e('./util/logger'),
  21046. a = e('./objects/Reticule'),
  21047. s = e('./objects/Panorama'),
  21048. l = e('./objects/ShowPath'),
  21049. c = e('./objects/View'),
  21050. h = (e('./objects/Snapshot'), e('./objects/NSpider')),
  21051. u = e('./enum/Viewmode'),
  21052. d = (e('./enum/TagStates'), e('./enum/Vectors')),
  21053. p = e('./enum/Keys'),
  21054. f = (e('./enum/AlignmentType'), e('./settings')),
  21055. g = e('./util/common'),
  21056. m = (e('./util/browser'), e('./util/math')),
  21057. v = e('./util/lerp'),
  21058. A = e('./util/easing'),
  21059. y = e('./util/transitions'),
  21060. C = e('events').EventEmitter,
  21061. I = (e('./shaders'), e('./util/history')),
  21062. E = (e('./util/camera'), e('./model/ModelManager'), e('./enum/PathDiscardMode')),
  21063. b = e('./enum/PathDisplayMode'),
  21064. w = e('./enum/PlayerEvents'),
  21065. _ = e('./enum/ControlEvents'),
  21066. T = e('./enum/ModelManagerEvents'),
  21067. x = e('./enum/WarpStyle'),
  21068. S = e('./enum/BlackoutStyle'),
  21069. M = e('./exception/BasicException'),
  21070. R = e('./enum/PanoSizeClass'),
  21071. P = (e('./tile/TileDownloader'), e('./tile/TilePrioritizer')),
  21072. O = (e('./enum/PanoramaEvents'), e('./enum/ZoomEvents')),
  21073. L = e('./util/ZoomStats'),
  21074. D = e('./constants'),
  21075. N = e('./util/common'),
  21076. B = e('./util/cameraLight'),
  21077. //, Hot = e('hot')
  21078. F = new o(i),
  21079. V = Object.freeze({
  21080. FlyToPano: y.getUniqueId(),
  21081. FlyToNewMode: y.getUniqueId(),
  21082. FlyToSameMode: y.getUniqueId(),
  21083. FlyToViewFloor: y.getUniqueId(),
  21084. LookTransition: y.getUniqueId(),
  21085. ZoomTransition: y.getUniqueId()
  21086. })
  21087. ;(n.prototype = Object.create(C.prototype)),
  21088. (n.prototype.init = function (e) {
  21089. ;(this.modelManager = e.modelManager),
  21090. (this.tileDownloader = e.tileDownloader),
  21091. (this.panoRenderer = e.panoRenderer),
  21092. (this.qualityManager = e.qualityManager),
  21093. (this.domElement = e.container),
  21094. (this.camera = e.camera),
  21095. (this.tagManager = e.tagManager),
  21096. (this.cameraControls = e.controls),
  21097. (this.path = new l(e.director, this, e.controls)),
  21098. (this.basePanoSize = this.qualityManager.getPanoSize(R.BASE)),
  21099. (this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD)),
  21100. (this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH)),
  21101. (this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH)),
  21102. (this.tileDownloader.processPriorityQueue = !1),
  21103. (this.tileDownloader.tilePrioritizer = new P(this.qualityManager, this.basePanoSize, this.standardPanoSize, this.highPanoSize, this.ultraHighPanoSize)),
  21104. this.bindEvents(e.container),
  21105. this.updateModel()
  21106. })
  21107. //xzw add: 截图
  21108. function dataURLtoBlob(dataurl) {
  21109. var arr = dataurl.split(','),
  21110. mime = arr[0].match(/:(.*?);/)[1],
  21111. bstr = atob(arr[1]),
  21112. n = bstr.length,
  21113. u8arr = new Uint8Array(n)
  21114. while (n--) {
  21115. u8arr[n] = bstr.charCodeAt(n)
  21116. }
  21117. return new Blob([u8arr], { type: mime })
  21118. }
  21119. n.prototype.screenShot = function (o) {
  21120. if (this.flying || this.flyingToTag) return
  21121. var R = this.sceneRenderer
  21122. R.updateScreenSize(o)
  21123. for (var i in this.model.panos.index) {
  21124. if (!this.model.panos.index[i].marker) continue
  21125. this.model.panos.index[i].marker.forceHide = this.model.panos.index[i].marker.visible
  21126. this.model.panos.index[i].marker.visible = false
  21127. }
  21128. for (var i in this.model.hots) {
  21129. this.model.hots[i].mesh.visible = false
  21130. }
  21131. this.reticule.visible = false
  21132. this.reticule.forceUnvisible = true
  21133. this.path.currentPanoMarker.mesh.visible = false
  21134. setTimeout(
  21135. function () {
  21136. //因resize效用没办法立即生效(原因未知),故而延后
  21137. R.renderer.clear(true, true, true)
  21138. R.renderer.render(R.scene, R.camera)
  21139. var imgData = R.renderer.domElement.toDataURL(o.type, 0.9)
  21140. o.f && o.f(imgData)
  21141. R.updateScreenSize({ resize: true })
  21142. this.reticule.visible = true
  21143. for (var i in this.model.hots) {
  21144. this.model.hots[i].mesh.visible = true
  21145. }
  21146. for (var i in this.model.panos.index) {
  21147. this.model.panos.index[i].marker.visible = this.model.panos.index[i].marker.forceHide
  21148. }
  21149. this.path.currentPanoMarker.mesh.visible = true
  21150. R.renderer.render(R.scene, R.camera)
  21151. }.bind(this),
  21152. 30
  21153. ) //这个数字不能太小
  21154. }
  21155. var scaleImg = e('scaleImg')
  21156. var ResizeImg = function (img, option) {
  21157. var img2 //不能直接改img 否则可能触发第二次img.onload
  21158. var compress = function (ratio, type) {
  21159. var image = img2 || img
  21160. var c = document.createElement('canvas')
  21161. c.width = image.width
  21162. c.height = image.height
  21163. var ctx = c.getContext('2d')
  21164. ctx.drawImage(image, 0, 0, image.width, image.height)
  21165. img2 = scaleImg(ratio /* option.maxSize/oldSize */, c, type /* option.type||"png" */) //最大不能超过0.8M
  21166. }
  21167. var reCom = function () {
  21168. //如果有了img2 就只需要img2 否则创造新的img2
  21169. var image = img2 || img
  21170. var blob = dataURLtoBlob(image.src)
  21171. if (option.maxWeight && blob.size > option.maxWeight) {
  21172. compress(option.maxWeight / blob.size, 'jpeg')
  21173. blob = dataURLtoBlob(image.src)
  21174. }
  21175. if (!img2) {
  21176. img2 = new Image()
  21177. }
  21178. img2.base64Src = image.src
  21179. img2.src = window.URL.createObjectURL(blob)
  21180. }
  21181. var oldSize = Math.max(img.width, img.height)
  21182. if (option.toType != 'png') {
  21183. //不是非要png的话
  21184. if (option.oldType == 'jpeg') {
  21185. //jpeg先判断尺寸,然后是尺寸
  21186. if (oldSize > option.maxSize) {
  21187. compress(option.maxSize / oldSize, 'jpeg')
  21188. }
  21189. reCom()
  21190. } else if (option.oldType == 'png') {
  21191. //png先判断数据量 如果数据量达标,就无视大小(有可能超出大小)
  21192. if (option.maxWeight && option.weight > option.maxWeight) {
  21193. //如果一开始大小不大就不压缩 还是png
  21194. compress(oldSize > option.maxSize ? option.maxSize / oldSize : 1, 'jpeg')
  21195. reCom()
  21196. }
  21197. }
  21198. } else {
  21199. //?貌似png会越压缩越大?
  21200. }
  21201. return img2 || img
  21202. }
  21203. var _fixType = function (type) {
  21204. type = type.toLowerCase().replace(/jpg/i, 'jpeg')
  21205. var r = type.match(/png|jpeg|bmp|gif/)[0]
  21206. return 'image/' + r
  21207. }
  21208. var saveFile = function (data, filename) {
  21209. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
  21210. save_link.href = data
  21211. save_link.download = filename
  21212. var event = document.createEvent('MouseEvents')
  21213. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null)
  21214. save_link.dispatchEvent(event)
  21215. }
  21216. ;(n.prototype.getWrapShot = function () {
  21217. //获取导览点截图/初始画面和信息
  21218. var info = this.getSnapAngleInfo()
  21219. var str = ',{\r\t' + info
  21220. var arg = arguments[0]
  21221. this.screenShot({
  21222. width: g_snapShotWidth * 4,
  21223. height: g_snapShotHeight * 4,
  21224. type: 'image/jpeg',
  21225. f: function (imgData) {
  21226. if (arg && arg.__callback) {
  21227. return arg.__callback(imgData, info)
  21228. }
  21229. var img = new Image()
  21230. img.src = imgData
  21231. img.onload = function () {
  21232. var img2 = ResizeImg(this, { maxSize: g_snapShotWidth, oldType: 'jpeg' }) //暂定缩略图大小
  21233. img2.src.replace(_fixType('image/jpeg'), 'image/octet-stream')
  21234. var filename = 'snap' + new Date().getTime()
  21235. saveFile(img2.src, filename + '.jpg')
  21236. str += ',\r\t"thumbnail_signed_src":"' + filename + '.jpg",'
  21237. str += '\r\t"sid":"' + filename + '",'
  21238. str += '\r\t"name":"' + filename + '"\r}'
  21239. logData(str)
  21240. }
  21241. }
  21242. })
  21243. }),
  21244. (n.prototype.getSnapAngleInfo = function () {
  21245. var info = {}
  21246. var str = '"metadata":{'
  21247. var q = this.camera.quaternion.clone()
  21248. switch (this.mode) {
  21249. case 'panorama':
  21250. info.scan_id = this.currentPano.id
  21251. str += '"scan_id":"' + this.currentPano.id + '",'
  21252. break
  21253. case 'floorplan':
  21254. info.camera_mode = 1
  21255. q = new r.Quaternion().setFromAxisAngle(new r.Vector3(0, 1, 0), r.Math.degToRad(90))
  21256. q.multiply(this.camera.quaternion)
  21257. str += '"camera_mode":1,'
  21258. //str += ('"ortho_zoom":'+m.toPrecision(this.cameraControls.activeControl.currentScale * $("#player").height() / $("#player").width() * D.workshopApsect * 16, 4)+",");
  21259. str += '"ortho_zoom":' + m.toPrecision(this.cameraControls.activeControl.currentScale, 4) + ','
  21260. break
  21261. case 'dollhouse':
  21262. info.camera_mode = 2
  21263. str += '"camera_mode":2,'
  21264. break
  21265. }
  21266. info.camera_position = m.toPrecision(this.camera.position.toArray(), 4)
  21267. console.log(info.camera_position)
  21268. if (window.screenSta === 'tour') {
  21269. // fyz 导览截屏需要做额外的
  21270. /**fyz 对相机截屏的角度进行校对 */
  21271. var out = new r.Quaternion(q.x, q.y, q.z, q.w)
  21272. out.multiply(new r.Quaternion(Math.sqrt(2) / 2, Math.sqrt(2) / 2, 0, 0).conjugate())
  21273. out.x *= -1
  21274. out.w *= -1
  21275. info.camera_quaternion = m.toPrecision(out.toArray(), 4)
  21276. } else {
  21277. info.camera_quaternion = m.toPrecision(q.toArray(), 4)
  21278. }
  21279. info.zoom = this.zoomLevel
  21280. console.log(info.camera_quaternion)
  21281. // str += ( '"camera_position":['+ info.camera_position + '],"camera_quaternion":['+info.camera_quaternion+"]}");
  21282. // fyz 扩展编辑页面, 加上导览点缩放值
  21283. str += '"camera_position":[' + info.camera_position + '],"camera_quaternion":[' + info.camera_quaternion + '], "zoom":' + info.zoom + '}'
  21284. return str
  21285. })
  21286. //------end
  21287. ;(n.prototype.setupCustomProperties = function (e) {
  21288. var t = e || u.PANORAMA
  21289. Object.defineProperty(this, 'mode', {
  21290. get: function () {
  21291. return t
  21292. },
  21293. set: function (e) {
  21294. var i = t
  21295. ;(t = e), this.onModeUpdated(i, t)
  21296. }
  21297. })
  21298. }),
  21299. (n.prototype.isInMode = function () {
  21300. for (var e = 0; e < arguments.length; e++) if (this.mode === arguments[e]) return !0
  21301. return !1
  21302. }),
  21303. (n.prototype.isOutsideMode = function (e) {
  21304. return (e = e || this.mode), e === u.DOLLHOUSE || e === u.FLOORPLAN
  21305. }),
  21306. (n.prototype.is360View = function (e, t) {
  21307. return e === u.PANORAMA && t && !t.isAligned()
  21308. }),
  21309. (n.prototype.setScene = function (e) {
  21310. ;(this.sceneIntersectionPlane = e.plane), this.path.setScene(e), this.moveReticuleToScene(e)
  21311. }),
  21312. (n.prototype.moveReticuleToScene = function (e) {
  21313. this.reticule.parent && this.reticule.parent.remove(this.reticule), e.add(this.reticule)
  21314. }),
  21315. (n.prototype.updateModel = function () {
  21316. function e(e, t, n) {
  21317. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  21318. }
  21319. function t(e, t) {
  21320. if (this.mode === u.DOLLHOUSE) {
  21321. var n = e ? this.model.center.y : (n = t.center.y)
  21322. i.call(this, n)
  21323. }
  21324. }
  21325. function i(e) {
  21326. var t = this.cameraControls.cameras[u.DOLLHOUSE],
  21327. i = this.cameraControls.controls[u.DOLLHOUSE],
  21328. n = t.position.y + (e - i.target.y),
  21329. r = f.showFloorDuration + f.showFloorDelay
  21330. y.start(v.property(i.target, 'y', e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  21331. y.start(v.property(t.position, 'y', n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  21332. }
  21333. ;(this.model = this.modelManager.getActiveModel()),
  21334. this.model.on('floor.changed', e.bind(this)),
  21335. this.model.on('allfloors.toggled', t.bind(this)),
  21336. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  21337. /*******************************************************************VR fyz改 from徐世廷*******************************************************************/
  21338. var e2 = this
  21339. this.model.panos.list.forEach(function (a) {
  21340. a.vrMarker.addEventListener('click', function () {
  21341. e2.flyToPano({
  21342. pano: a
  21343. })
  21344. })
  21345. })
  21346. /********************************************************************************************************************************************/
  21347. this.model.addHighMapCube() //add
  21348. this.on(w.FlyingStarted, this.model.resetHighMap.bind(this.model))
  21349. }),
  21350. (n.prototype.updateModelDependentData = function () {
  21351. this.cameraControls.setModelForControls(this.model), this.getPanoMarkersFromModel(this.model)
  21352. }),
  21353. (n.prototype.onModelChanged = function () {
  21354. this.updateModel(), this.updateModelDependentData()
  21355. }),
  21356. (n.prototype.getPanoMarkersFromModel = function (e) {
  21357. this.panoMarkers = e.panos.list.reduce(function (e, t) {
  21358. return t.marker ? e.concat(t.marker) : e
  21359. }, [])
  21360. }),
  21361. (n.prototype.handleControlMove = function (e) {
  21362. this.emit(w.Move, e)
  21363. }),
  21364. (n.prototype.handleControlInputStart = function (e) {
  21365. this.emit(w.InputStart, e)
  21366. }),
  21367. (n.prototype.onModeUpdated = function (e, t) {
  21368. this.cameraControls.activateControls(t), this.emit(w.ModeChanged, e, t)
  21369. }),
  21370. (n.prototype.isWarping = function () {
  21371. //是否导览缓慢走向某个点
  21372. return this.path.warping
  21373. }),
  21374. (n.prototype.isWaitingToWarp = function () {
  21375. return this.path.waitingToWarp
  21376. }),
  21377. (n.prototype.getLabelScaleFactor = function () {
  21378. if (this.isOutsideMode()) {
  21379. var e = 10,
  21380. t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e)
  21381. return t
  21382. }
  21383. return 0.5
  21384. }),
  21385. /* n.prototype.changeMusic = function() {//xzw add
  21386. if(!this.director.tourIsPlaying) this.director.bgmReplay()
  21387. } */
  21388. (n.prototype.bindEvents = function (e) {
  21389. e !== document && e.setAttribute('tabindex', -1),
  21390. e.addEventListener('mousedown', this.onMouseDown.bind(this)),
  21391. e.addEventListener('mousemove', this.onMouseMove.bind(this)),
  21392. e.addEventListener('mouseover', this.onMouseOver.bind(this)),
  21393. e.addEventListener('mouseout', this.onMouseOut.bind(this)),
  21394. e.addEventListener('mouseup', this.onMouseUp.bind(this)),
  21395. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  21396. e.addEventListener('touchstart', this.onTouchStart.bind(this)),
  21397. e.addEventListener('touchmove', this.onTouchMove.bind(this)),
  21398. e.addEventListener('touchend', this.onTouchEnd.bind(this)),
  21399. e.addEventListener('pointerdown', this.onPointerDown.bind(this)),
  21400. e.addEventListener('pointermove', this.onPointerMove.bind(this)),
  21401. e.addEventListener('pointerup', this.onPointerUp.bind(this)),
  21402. e.addEventListener('pointerout', this.onPointerOut.bind(this)),
  21403. e.addEventListener('pointercancel', this.onPointerCancel.bind(this)),
  21404. document.addEventListener('keydown', this.onKeyDown.bind(this)),
  21405. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  21406. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  21407. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  21408. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  21409. window.addEventListener('snapshotBegin', this.getWrapShot.bind(this)), //xzw add
  21410. //window.addEventListener("tourAudioEnded", this.changeMusic.bind(this));//xzw add
  21411. // lzb
  21412. window.getSeft && getSeft(this)
  21413. }),
  21414. (n.prototype.onMouseDown = function (e) {
  21415. e.currentTarget !== document && e.currentTarget.focus(), 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1), this.updateIntersect())
  21416. }),
  21417. (n.prototype.onMouseMove = function (e) {
  21418. ;(this.isTouchEvent = !1), this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  21419. }),
  21420. (n.prototype.onMouseOver = function (e) {
  21421. ;(this.containsMouse = !0), !this.mouseDown || (0 !== e.which && 0 !== e.buttons) || (this.mouseDown = !1)
  21422. }),
  21423. (n.prototype.onMouseOut = function (e) {
  21424. this.containsMouse = !1
  21425. }),
  21426. (n.prototype.onMouseUp = function (e) {
  21427. this.handleInputEnd.call(this, e.clientX, e.clientY, !1)
  21428. }),
  21429. (n.prototype.onTouchStart = function (e) {
  21430. if ((e.currentTarget !== document && e.currentTarget.focus(), !this.mouseDown)) {
  21431. this.couldBeLongTap = !0
  21432. var t = g.average(e.changedTouches, 'clientX'),
  21433. i = g.average(e.changedTouches, 'clientY')
  21434. this.handleInputStart.call(this, t, i, !0),
  21435. (this.mouseDownTimer = setTimeout(
  21436. function () {
  21437. this.updateIntersect(), this.handleInputEnd.call(this, t, i, !0)
  21438. }.bind(this),
  21439. f.input.longTapThreshold
  21440. ))
  21441. }
  21442. }),
  21443. (n.prototype.onTouchMove = function (e) {
  21444. var t = g.average(e.changedTouches, 'clientX'),
  21445. i = g.average(e.changedTouches, 'clientY')
  21446. this.handleInputMove.call(this, t, i, !0)
  21447. }),
  21448. (n.prototype.onTouchEnd = function (e) {
  21449. if ((clearTimeout(this.mouseDownTimer), this.mouseDown)) {
  21450. ;(this.couldBeLongTap = !1), this.updateIntersect()
  21451. var t = g.average(e.changedTouches, 'clientX'),
  21452. i = g.average(e.changedTouches, 'clientY')
  21453. this.handleInputEnd.call(this, t, i, !0)
  21454. }
  21455. //add
  21456. if (this.intersectHot) this.intersectHot.setHoverState(false)
  21457. this.intersectHot = null
  21458. Hot.mobileAutoPlay(this)
  21459. }),
  21460. (n.prototype.onPointerDown = function (e) {
  21461. return (
  21462. e.currentTarget !== document && e.currentTarget.focus(),
  21463. this.mouseDown || 'mouse' === e.pointerType
  21464. ? this.onMouseDown(e)
  21465. : ((this.couldBeLongTap = !0),
  21466. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  21467. void (this.mouseDownTimer = setTimeout(
  21468. function () {
  21469. this.updateIntersect(), this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  21470. }.bind(this),
  21471. f.input.longTapThreshold
  21472. )))
  21473. )
  21474. }),
  21475. (n.prototype.onPointerMove = function (e) {
  21476. 'mouse' !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  21477. }),
  21478. (n.prototype.onPointerUp = function (e) {
  21479. return this.mouseDown && 'mouse' !== e.pointerType
  21480. ? (clearTimeout(this.mouseDownTimer), (this.couldBeLongTap = !1), this.updateIntersect(), void this.handleInputEnd.call(this, e.clientX, e.clientY, !0))
  21481. : this.onMouseUp(e)
  21482. }),
  21483. (n.prototype.onPointerOut = function (e) {
  21484. this.mouseDown = !1
  21485. }),
  21486. (n.prototype.onPointerCancel = function (e) {
  21487. this.mouseDown = !1
  21488. }),
  21489. (n.prototype.onKeyDown = function (e) {
  21490. var t = function () {
  21491. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, 'key')
  21492. }.bind(this),
  21493. i = e.which
  21494. switch (i) {
  21495. case p.F:
  21496. t(), this.changeFloor(-1)
  21497. break
  21498. case p.R:
  21499. t(), this.changeFloor(1)
  21500. }
  21501. if (this.mode === u.PANORAMA)
  21502. switch (i) {
  21503. case p.UPARROW:
  21504. case p.W:
  21505. this.flyLocalDirection(d.FORWARD.clone())
  21506. break
  21507. case p.DOWNARROW:
  21508. case p.S:
  21509. this.flyLocalDirection(d.BACK.clone())
  21510. break
  21511. case p.A:
  21512. this.flyLocalDirection(d.LEFT.clone())
  21513. break
  21514. case p.D:
  21515. this.flyLocalDirection(d.RIGHT.clone())
  21516. }
  21517. }),
  21518. (n.prototype.handleScrollPinchZoom = (function () {
  21519. return function (e) {
  21520. var t = e,
  21521. i = this.zoomLevel
  21522. this.zoomBy(t), this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  21523. }
  21524. })()),
  21525. (n.prototype.handleControlPinch = function (e) {
  21526. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0, 0, e).normalize())
  21527. }),
  21528. (n.prototype.handleControlScroll = function (e) {
  21529. f.zoom.enabled
  21530. ? (e > 0 ? (e = 1 + this.scrollZoomSpeed) : e < 0 && (e = 1 - this.scrollZoomSpeed), 0 !== e && this.handleScrollPinchZoom(e))
  21531. : this.flyLocalDirection(new r.Vector3(0, 0, -e).normalize())
  21532. }),
  21533. (n.prototype.handleInputStart = function (e, t, i) {
  21534. //许钟文加
  21535. var pad = this.handelPadding(e, t)
  21536. e = pad.x
  21537. t = pad.y
  21538. ;(this.isTouchEvent = i),
  21539. m.convertScreenPositionToNDC(e, t, this.mouse),
  21540. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  21541. (this.mouseCouldBeClickToMove = !0),
  21542. (this.mouseDown = !0)
  21543. Hot.mobileAutoPlay(this)
  21544. }),
  21545. (n.prototype.handelPadding = function (x, y) {
  21546. //去除player左边和上面的宽高,因为pc的player左上有其他element 许钟文
  21547. if (!this.pad)
  21548. this.pad = {
  21549. //可以直接用$("#player")[0].getBoundingClientRect() , 因为body没有offset
  21550. x: dom.getOffset('left', $('#player')[0]),
  21551. y: dom.getOffset('top', $('#player')[0])
  21552. }
  21553. return {
  21554. x: x - this.pad.x,
  21555. y: y - this.pad.y
  21556. }
  21557. })
  21558. ;(n.prototype.handleInputMove = function (e, t, i) {
  21559. //许钟文加
  21560. var pad = this.handelPadding(e, t)
  21561. e = pad.x
  21562. t = pad.y
  21563. ;(this.isTouchEvent = i),
  21564. m.convertScreenPositionToNDC(e, t, this.mouse),
  21565. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && ((this.mouseCouldBeClickToMove = !1), (this.couldBeLongTap = !1), clearTimeout(this.mouseDownTimer)),
  21566. (this.mouseLastMoveTime = Date.now()),
  21567. this.reticule.move(e, t, i)
  21568. }),
  21569. (n.prototype.handleInputEnd = function (e, t, i) {
  21570. //xzw
  21571. if (((this.isTouchEvent = i), (this.mouseDown = !1), this.cameraControls.controls[u.PANORAMA].emit('interaction.direct'), !i && this.couldBeLongTap)) return !0
  21572. if (this.handleLongTap()) return !0
  21573. /* if(this.director.tourIsPlaying){
  21574. return !0;
  21575. } */
  21576. if (this.mouseCouldBeClickToMove) {
  21577. if (this.flying)
  21578. return (
  21579. this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType), //停止导览
  21580. !0
  21581. )
  21582. //add----
  21583. if (this.checkHotClick())
  21584. //add
  21585. return !0
  21586. if (this.hoveringPlane) {
  21587. this.clickOverlay(this.hoveringPlane)
  21588. return
  21589. }
  21590. if ((this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? 'touch' : 'mouse'), this.history.invalidate(), this.intersect))
  21591. return this.flyToPanoClosestToMouse()
  21592. if (this.mode === u.PANORAMA) {
  21593. var n = this.closestPanoInDirection(this.getMouseDirection())
  21594. return n
  21595. ? this.flyToPano({
  21596. pano: n
  21597. })
  21598. : this.bump(this.getMouseDirection())
  21599. }
  21600. }
  21601. //this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode) //xzw 删,否则拖拽后就不高亮了
  21602. }),
  21603. (n.prototype.handleLongTap = function () {
  21604. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA)) return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, 'touch'), !0
  21605. }),
  21606. (n.prototype.checktagClick = function () {
  21607. if (this.tagManager.intersectTag) {
  21608. var e = this.isTouchEvent,
  21609. t = this.tagManager.clickedOnTag(e, this)
  21610. return e || t || y.cancelById(V.LookTransition), !0
  21611. }
  21612. if (this.tagManager.activeTag) return this.tagManager.dismissActiveTag(), !1
  21613. }),
  21614. (n.prototype.rankedtagInDirection = function (e, t) {
  21615. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  21616. }),
  21617. (n.prototype.start = function (e) {
  21618. //-------------------
  21619. //-------------------
  21620. var t = e.mode,
  21621. i = e.pano,
  21622. n = e.position,
  21623. rr = e.quaternion,
  21624. o = e.tag,
  21625. a = e.quickstart,
  21626. s = $.Deferred()
  21627. this.updateModelDependentData(), this.updateFromControls(), this.findDefaultViews()
  21628. var l = this.is360View(t, i)
  21629. return (
  21630. !this.model.outsideAllowed() || l || a ? this.startInside(i, n, rr, o, s) : this.startOutside(e, s),
  21631. s.done(
  21632. function (e) {
  21633. this.emit(w.Ready, l, e, o)
  21634. }.bind(this)
  21635. ),
  21636. s.promise()
  21637. )
  21638. }),
  21639. (n.prototype.startOutside = function (e, t) {
  21640. var i = e.mode,
  21641. n = e.pano,
  21642. r = e.position,
  21643. o = e.quaternion,
  21644. a = e.zoom,
  21645. s = e.floorVisibility,
  21646. l = e.tag
  21647. this.emit(w.StartOutside, f[i].transitionTime),
  21648. this.isOutsideMode(i)
  21649. ? (this.model.warpDestFloors(s, !0), y.cancelById(V.FlyToViewFloor), i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o), t.resolve(!1))
  21650. : this.startInsideWithFlyin(n, r, o, l, t)
  21651. }),
  21652. (n.prototype.startInside = function (e, t, i, n, r) {
  21653. ;(r = r || $.Deferred()), (this.currentPano = e)
  21654. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  21655. this.ready = true
  21656. var o = e && !e.isAligned()
  21657. if (((t = o ? e.position : t || e.position), (i = i || e.quaternion), e)) {
  21658. var a = this.startInside.bind(this, e, t, i, n, r)
  21659. if (this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, a)) return
  21660. }
  21661. //add
  21662. this.transitionPos({ type: 'beforeFlytopano', pano: this.currentPano, dur: 0 })
  21663. //this.updateHotVisible()
  21664. Hot.updateVisibles([this.currentPano])
  21665. this.modeTran = 'panorama-panorama'
  21666. return (
  21667. (this.mode = u.PANORAMA),
  21668. e.floor.enter(this.mode),
  21669. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  21670. this.switchCameraMode(this.mode, i),
  21671. this.emit(w.StartInside, o),
  21672. r.resolve(!0),
  21673. r
  21674. )
  21675. }),
  21676. (n.prototype.startInsideWithFlyin = function (e, t, i, n, r) {
  21677. if (((r = r || $.Deferred()), this.dollhouseMode(), !e)) return F.warn('Player.startInsideWithFlyin() -> targetPano is invalid.'), r.resolve(!1), r
  21678. t = t || e.position
  21679. var o = i || this.cameraControls.activeControl.camera.quaternion,
  21680. a = e.position
  21681. return (
  21682. this.fitDollhouse(a, t, o),
  21683. setTimeout(
  21684. function (t) {
  21685. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t)
  21686. var n = {
  21687. mode: u.PANORAMA,
  21688. pano: e,
  21689. quaternion: i,
  21690. callback: function () {
  21691. this.emit(w.FlyinFinished), r.resolve(!0)
  21692. }.bind(this)
  21693. }
  21694. this.flyToNewMode(n)
  21695. }.bind(this, this.cameraControls.activeControl.maxDistance),
  21696. f.startupFlyinDelay
  21697. ),
  21698. r
  21699. )
  21700. }),
  21701. (n.prototype.checkAndWaitForPanoLoad = (function () {
  21702. var e = {},
  21703. t = {},
  21704. i = 5e3,
  21705. n = function () {
  21706. for (var n in e)
  21707. if (e.hasOwnProperty(n) && e[n]) {
  21708. var r = performance.now() - t[n]
  21709. if (r < i) return !0
  21710. }
  21711. return !1
  21712. }
  21713. return function (r, o, a, s, l, c, h, u, d, p) {
  21714. if (n()) return !0
  21715. var f = function (t, i, n) {
  21716. N.delayOneFrame(
  21717. function () {
  21718. ;(e[t] = !1), l && l(i, n)
  21719. }.bind(this)
  21720. )
  21721. }.bind(this, r.id),
  21722. g = function (t, i) {
  21723. N.delayOneFrame(
  21724. function () {
  21725. ;(e[t] = !1), c && c(i)
  21726. }.bind(this)
  21727. )
  21728. }.bind(this, r.id)
  21729. try {
  21730. return (
  21731. (null !== u && void 0 !== u) || (u = !0),
  21732. 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)),
  21733. e[r.id] && (t[r.id] = performance.now()),
  21734. e[r.id]
  21735. )
  21736. } catch (n) {
  21737. throw ((e[r.id] = !1), (t[r.id] = performance.now() - i), n)
  21738. }
  21739. }
  21740. })()),
  21741. (n.prototype.checkAndWaitForWholePanoLoad = function (e, t, i, n, r) {
  21742. if (!e) throw new M('Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.')
  21743. return (
  21744. r &&
  21745. this.model.waitForLoad(e, function () {
  21746. return e.isLoaded(i)
  21747. }),
  21748. !e.isLoaded(t) && (e.loadCube(t).done(n), !0)
  21749. )
  21750. }),
  21751. (n.prototype.checkAndWaitForTiledPanoLoad = (function () {
  21752. var e = new r.Vector3()
  21753. return function (t, i, n, r, o, a, s, l) {
  21754. if (!t) throw new M('Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.')
  21755. return (
  21756. e.copy(d.FORWARD),
  21757. this.getDirection(e),
  21758. !t.isLoaded(i) &&
  21759. (a &&
  21760. this.model.waitForLoad(t, function () {
  21761. return t.isLoaded(i)
  21762. }),
  21763. t
  21764. .loadTiledPano(i, e, null, s, l)
  21765. .done(
  21766. function (e, t) {
  21767. n && n(e, t)
  21768. }.bind(this)
  21769. )
  21770. .fail(
  21771. function (e) {
  21772. r && r(e)
  21773. }.bind(this)
  21774. )
  21775. .progress(
  21776. function (e, t, i) {
  21777. o && o(e, t, i)
  21778. }.bind(this)
  21779. ),
  21780. !0)
  21781. )
  21782. }
  21783. })()),
  21784. (n.prototype.switchCameraMode = function (e, t) {
  21785. var i = this.cameraControls.controls[e],
  21786. n = i.camera
  21787. switch (e) {
  21788. case u.PANORAMA:
  21789. n.position.copy(this.currentPano.position)
  21790. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize()
  21791. i.lookAt(o.add(n.position))
  21792. break
  21793. case u.DOLLHOUSE:
  21794. /* var a = this.position.clone();
  21795. 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),
  21796. n.position.copy(a),
  21797. i.target.copy(this.target.clone().setY(this.model.center.y));
  21798. break; */
  21799. //for多楼层 且 让模型刚好适应屏幕
  21800. var box = this.model.boundingBox.clone()
  21801. box.applyMatrix4(this.camera.matrixWorld) //将 boundingbox、也就是模型, 转换到当前相机朝向
  21802. var boxSize = box.size() //其中boxSize.x是模型在当前相机视角下的横向宽度,当飞出后,该宽度要刚好占满窗口宽度
  21803. var fov = B.getHFOVFromVFOV(f.insideFOV, n.aspect, 1) //获得在当前窗口的横向的fov
  21804. var distance = Math.abs(boxSize.x) / 2 / Math.tan(THREE.Math.degToRad(fov / 2)) //根据上面获得的参数得到target到相机的距离
  21805. //console.log(boxSize.x,distance, boxSize.length() / 2)
  21806. distance += boxSize.length() / 2 //由于此时模型从中心向相机的部分由于近大远小仍超出屏幕,所以将target放在靠近模型靠近相机的这一端,故而再加上box的对角线长度的一半, 虽然本该加上Math.sqrt(boxSize.z*boxSize.z +boxSize.y+boxSize.y)/2,但是这样模型显得比较满
  21807. if (this.mode === u.PANORAMA) {
  21808. i.target.copy(this.model.center)
  21809. var vec = this.getDirection().negate().setY(1).normalize() //获得朝向
  21810. } else {
  21811. i.target.copy(this.target.clone().setY(this.model.center.y))
  21812. var vec = d.DOWN.clone().applyQuaternion(this.quaternion).setY(1).normalize()
  21813. }
  21814. vec.multiplyScalar(distance)
  21815. n.position.copy(i.target.clone().add(vec))
  21816. break
  21817. case u.FLOORPLAN:
  21818. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21819. i.target.copy(this.model.center).setY(0),
  21820. i.zoomToContain(this.model.size),
  21821. i.rotateToView(this.model.size, this.getDirection())
  21822. }
  21823. i.update(0)
  21824. }),
  21825. (n.prototype.update = (function () {
  21826. var e = (new r.Vector3(), {}),
  21827. t = []
  21828. return function (i) {
  21829. this.updatePersistentZooming(i), this.updateFromControls(i), this.getCurrentNodePanos(t)
  21830. this.lastFrameChanged = false
  21831. if (this.hasChanged(e)) {
  21832. this.lastFrameChanged = e.cameraChanged3 ? 'level3' : e.cameraChanged2 ? 'level2' : e.cameraChanged ? 'level1' : false
  21833. ;(this.lastChangeTime = Date.now()),
  21834. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21835. this.emit(w.ViewChanged, e),
  21836. // 注意: player.cameraControls.activeControl.camera 的 matrix是错的
  21837. this.intersect && this.magnifier && this.magnifier.update(this.intersect.point)
  21838. }
  21839. if (e.cameraChanged2) {
  21840. //变化要更大些
  21841. }
  21842. if (e.cameraChanged) {
  21843. this.mode == 'panorama' && window.cad && cad.setSign({ x: this.position.x, y: this.position.z }, this.cameraControls.controls.panorama.lon)
  21844. /* for(var i in this.model.hots){
  21845. this.model.hots[i].updateTitle(this)
  21846. } */
  21847. Hot.updateHots()
  21848. }
  21849. this.model.supportsTiles && (this.updateTileDownloader(t), this.updatePanoRenderer(t)),
  21850. this.updatePreRendering(t),
  21851. this.reticule.update(),
  21852. this.path.update(),
  21853. this.spider.update(),
  21854. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21855. this.updateControlLocks(),
  21856. this.model.supportsTiles && this.updateZoomPano()
  21857. }
  21858. })()),
  21859. /* n.prototype.controlVideosPlay = function() {//判断box视频是否可见 不可见就暂停
  21860. var lastMode, lastPano;
  21861. return function(){
  21862. var mode = this.mode;
  21863. var pano = mode == "panorama" ? this.currentPano : "";
  21864. if(mode != "panorama" || pano != lastPano){
  21865. overlay.noBlock = null
  21866. }
  21867. this.overlayGroup.children.forEach((overlay)=>{
  21868. if(overlay.overlayType == "video" ){
  21869. var matrix = overlay.plane.matrixWorld;
  21870. var inSight = false;
  21871. var cameraDir = this.getDirection();
  21872. var planeDir = (new r.Vector3).copy(d.FORWARD).applyQuaternion(overlay.plane.quaternion)
  21873. var vertexes = []
  21874. if(cameraDir.angleTo(planeDir)>Math.PI/2){//朝向相机视线
  21875. for(let i=0; i<4; i++){
  21876. var vertex = overlay.plane.geometry.vertices[i].clone().applyMatrix4(matrix)
  21877. vertexes.push(vertex)
  21878. if(overlay.noBlock == null){
  21879. if(!m.ifShelter(vertex)){
  21880. overlay.noBlock = true
  21881. }
  21882. inSight = true; break;
  21883. }else{
  21884. overlay.noBlock = true
  21885. }
  21886. if(m.getPos2d(vertex, this.camera, $("#player")[0]).inSight){
  21887. inSight = true; break;
  21888. }
  21889. }
  21890. }
  21891. overlay.inSight = inSight
  21892. if(!inSight)overlay.plane.material.map.image.pause()
  21893. else overlay.plane.material.map.image.play()//maybe fail
  21894. }
  21895. })
  21896. lastMode = mode, lastPano = pano
  21897. }
  21898. }() */
  21899. (n.prototype.updatePersistentZooming = function (e) {
  21900. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21901. }),
  21902. (n.prototype.updateControlLocks = function () {
  21903. this.currentPano &&
  21904. this.model.supportsTiles &&
  21905. (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21906. }),
  21907. (n.prototype.updatePanoRenderer = (function () {
  21908. var e = new r.Vector3()
  21909. return function (t) {
  21910. var i = this.nextPano || this.currentPano
  21911. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD), this.getDirection(e), this.panoRenderer.updateDirection(e))
  21912. }
  21913. })()),
  21914. (n.prototype.cleanupInactivePanos = (function () {
  21915. var e = [],
  21916. t = []
  21917. return function () {
  21918. ;(e.length = 0), e.push(this.currentPano), this.nextPano && e.push(this.nextPano), (t.length = 0)
  21919. for (var i = 0; i < this.panoRenderer.activePanos.length; i++) t.push(this.panoRenderer.activePanos[i])
  21920. for (var n = 0; n < t.length; n++) {
  21921. for (var r = t[n], o = !0, a = 0; a < e.length; a++) r.id === e[a].id && (o = !1)
  21922. o && r.exit()
  21923. }
  21924. }
  21925. })()),
  21926. (n.prototype.updatePreRendering = (function () {
  21927. var e = {}
  21928. return function (t) {
  21929. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21930. var i = this.nextPano || this.currentPano
  21931. if (i && t && t.length > 1) {
  21932. var n = t.findIndex(function (e) {
  21933. if (e.id === i.id) return !0
  21934. })
  21935. if (n >= 0 && n + 1 < t.length) {
  21936. var r = t[n + 1]
  21937. r.isLoaded(this.basePanoSize) ||
  21938. e[r.id] ||
  21939. (window.setTimeout(
  21940. function (t) {
  21941. this.checkAndWaitForPanoLoad(t, 'high', 'low', this.basePanoSize, null, null, null, !1, !1, !1),
  21942. window.setTimeout(
  21943. function (t) {
  21944. e[t.id] = !1
  21945. }.bind(this, t),
  21946. f.tiling.panoPreRenderRepeatDelay
  21947. )
  21948. }.bind(this, r),
  21949. f.tiling.panoPreRenderDelay
  21950. ),
  21951. (e[r.id] = !0))
  21952. }
  21953. }
  21954. }
  21955. }
  21956. })()),
  21957. (n.prototype.enablePreRendering = function () {
  21958. this.preRenderingEnabled = !0
  21959. }),
  21960. (n.prototype.disablePreRendering = function () {
  21961. ;(this.preRenderingEnabled = !1), this.cleanupInactivePanos()
  21962. }),
  21963. (n.prototype.updateTileDownloader = (function () {
  21964. var e = new r.Vector3()
  21965. return function (t) {
  21966. var i = this.nextPano || this.currentPano
  21967. i &&
  21968. (e.copy(d.FORWARD),
  21969. this.getDirection(e),
  21970. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21971. (this.tileDownloader.processPriorityQueue = !0))
  21972. }
  21973. })()),
  21974. (n.prototype.updateFromControls = function (e) {
  21975. ;(null !== e && void 0 !== e) || (e = 0),
  21976. this.cameraControls.activeControl &&
  21977. (this.cameraControls.activeControl.update(e),
  21978. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21979. this.position.copy(this.cameraControls.activeControl.camera.position),
  21980. this.target.copy(this.cameraControls.activeControl.target),
  21981. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21982. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21983. this.camera.position.copy(this.position),
  21984. this.camera.quaternion.copy(this.quaternion),
  21985. this.camera.updateMatrix(),
  21986. this.camera.updateMatrixWorld()
  21987. }),
  21988. (n.prototype.hasChanged = function (e) {
  21989. if (!this.previousState) {
  21990. this.previousState = {
  21991. allFloorsVisible: this.model.allFloorsVisible,
  21992. position: this.position.clone(),
  21993. quaternion: this.quaternion.clone(),
  21994. mouse: this.mouse.clone(),
  21995. //labelScaleFactor: this.getLabelScaleFactor(),
  21996. currentFloor: this.model.currentFloor,
  21997. projectionMatrix: this.camera.projectionMatrix.clone(),
  21998. worldMatrix: this.camera.matrixWorld.clone(),
  21999. mode: this.mode,
  22000. modelPosition: this.model.position.clone(),
  22001. modelCenter: this.model.center.clone(),
  22002. zoomLevel: this.zoomLevel
  22003. }
  22004. e.cameraChanged = e.cameraChanged2 = true
  22005. return !0
  22006. }
  22007. //许钟文改 分成相机是否改变cameraChanged 和其他
  22008. var a =
  22009. this.position.equals(this.previousState.position) &&
  22010. this.quaternion.equals(this.previousState.quaternion) &&
  22011. this.camera.matrixWorld.equals(this.previousState.worldMatrix) &&
  22012. this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) &&
  22013. this.mode === this.previousState.mode &&
  22014. this.zoomLevel === this.previousState.zoomLevel &&
  22015. this.model.center.equals(this.previousState.modelCenter) &&
  22016. this.model.position.equals(this.previousState.modelPosition)
  22017. var t =
  22018. a &&
  22019. this.mouse.equals(this.previousState.mouse) &&
  22020. this.model.allFloorsVisible === this.previousState.allFloorsVisible /* && this.getLabelScaleFactor() === this.previousState.labelScaleFactor */ &&
  22021. this.model.currentFloor === this.previousState.currentFloor &&
  22022. null === this.nextPano
  22023. e.cameraChanged = !a
  22024. ;(e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible),
  22025. (e.moved = !this.position.equals(this.previousState.position)),
  22026. (e.rotated = !this.quaternion.equals(this.previousState.quaternion)),
  22027. (e.mouseMoved = !this.mouse.equals(this.previousState.mouse)),
  22028. // e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  22029. (e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor),
  22030. (e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix)),
  22031. (e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix)),
  22032. (e.modeChanged = this.mode !== this.previousState.mode),
  22033. (e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition)),
  22034. (e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter)),
  22035. (e.nextPanoActive = null !== this.nextPano),
  22036. (e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel)
  22037. /* if(e.cameraChanged){//
  22038. 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)
  22039. }else e.cameraChanged2 = false */
  22040. if (e.cameraChanged) {
  22041. e.cameraChanged2 =
  22042. e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 5) || !MathLight.closeTo(this.position, this.previousState.position, 4)
  22043. e.cameraChanged3 =
  22044. e.cameraProjectionChanged || !MathLight.closeTo(this.quaternion, this.previousState.quaternion, 3) || !MathLight.closeTo(this.position, this.previousState.position, 3)
  22045. } else {
  22046. e.cameraChanged2 = false
  22047. e.cameraChanged3 = false
  22048. }
  22049. ;(this.previousState.allFloorsVisible = this.model.allFloorsVisible),
  22050. this.previousState.position.copy(this.position),
  22051. this.previousState.quaternion.copy(this.quaternion),
  22052. this.previousState.mouse.copy(this.mouse),
  22053. //this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  22054. (this.previousState.currentFloor = this.model.currentFloor),
  22055. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  22056. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  22057. (this.previousState.mode = this.mode),
  22058. this.previousState.modelPosition.copy(this.model.position),
  22059. this.previousState.modelCenter.copy(this.model.center),
  22060. (this.previousState.zoomLevel = this.zoomLevel)
  22061. //console.log("cameraChanged2 "+ e.cameraChanged2 + ", mouseMoved "+e.mouseMoved)
  22062. return !t
  22063. }),
  22064. (n.prototype.updateIntersect = function () {
  22065. var e = this.flying || this.isWarping(),
  22066. t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged(),
  22067. i = y.getById(V.LookTransition),
  22068. n = !(e || t || this.isTouchEvent || (i.length && i[0].running))
  22069. {
  22070. //clear:
  22071. if (this.intersectHot) this.intersectHot.setHoverState(false)
  22072. this.intersectHot = null
  22073. CursorDeal.remove('hoverHot')
  22074. }
  22075. var deal = () => {
  22076. if (this.intersect && this.intersect.object.visible) {
  22077. if ('hotSprite' == this.intersect.object.type) {
  22078. this.intersectHot = this.intersect.object
  22079. while (!(this.intersectHot instanceof Hot)) {
  22080. this.intersectHot = this.intersectHot.parent
  22081. }
  22082. $(`.toolRight .spotList ul li[data-spid=${this.intersectHot.sid}]`).addClass('active')
  22083. this.intersectHot.setHoverState(true)
  22084. }
  22085. }
  22086. }
  22087. if (this.model.hotGroup) {
  22088. var hots = this.model.hotGroup.children.filter(e => e.info.actionType.examine || e.info.actionType.fastTran || e.info.actionType.openHot || e.info.actionType.playAndPause)
  22089. let colliders = this.model.floors.reduce(
  22090. function (e, t) {
  22091. return t.hidden ? e : e.concat(t.collider.children)
  22092. },
  22093. this.mode === 'panorama' ? this.panoMarkers : []
  22094. )
  22095. this.intersect = this.getMouseIntersect(null, hots.concat(colliders /* this.model.colliders */))
  22096. if (this.intersect) {
  22097. deal()
  22098. let intersect = this.intersect
  22099. if (this.intersectHot) {
  22100. this.intersect = null
  22101. CursorDeal.add('hoverHot')
  22102. } else {
  22103. if (intersect.object.parent.parent.hidden) {
  22104. //楼层已隐藏
  22105. this.intersect = null
  22106. }
  22107. }
  22108. }
  22109. } else {
  22110. this.intersect = this.getMouseIntersect()
  22111. }
  22112. this.intersect && this.updateClosestPano(this.intersect),
  22113. this.closestPano || this.closestPanoInDirection(this.getMouseDirection())
  22114. ? (this.reticule.updatePosition(this.position, this.intersect), f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection()))
  22115. : this.reticule.hide()
  22116. }),
  22117. (n.prototype.checkHotClick = function () {
  22118. if (this.intersectHot) {
  22119. if (this.intersectHot.texType == 'video' && this.intersectHot.info.actionType.playAndPause) {
  22120. this.intersectHot.switchPlay(!!this.intersectHot.pausedByUser)
  22121. }
  22122. this.intersectHot.examine(this)
  22123. return true
  22124. }
  22125. }),
  22126. (n.prototype.getMouseDirection = function (e) {
  22127. e = e || this.mouse
  22128. var t = new r.Vector3(e.x, e.y, -1).unproject(this.camera),
  22129. i = new r.Vector3(e.x, e.y, 1).unproject(this.camera)
  22130. return i.sub(t).normalize()
  22131. }),
  22132. (n.prototype.hoverOverlay = function (mesh) {
  22133. if (!mesh) {
  22134. this.hoveringPlane = null
  22135. $('#player').css('cursor', this.currentCursor || '')
  22136. } else {
  22137. var overlay = mesh.parent
  22138. $('#player').css('cursor', 'pointer')
  22139. this.hoveringPlane = overlay
  22140. return true
  22141. }
  22142. }),
  22143. (n.prototype.clickOverlay = function (overlay) {
  22144. if (this.openOverlay && !overlay) return
  22145. var plane = overlay.plane
  22146. /* if(overlay.overlayType == "video"){
  22147. if(plane.material.map.image.paused) plane.material.map.image.play()
  22148. else plane.material.map.image.pause()
  22149. } */
  22150. if (overlay.overlayType == 'video') {
  22151. overlay.switchPlay(!!overlay.pausedByUser)
  22152. }
  22153. /* if(window.EditOverlay &&EditOverlay.editing){
  22154. if(EditOverlay.editPlane && overlay != EditOverlay.editPlane) EditOverlay.closeOverlayPanel('cancel')
  22155. $('#overlayProp').removeClass('atRight').removeClass('hide')
  22156. EditOverlay.endAddPlane();
  22157. EditOverlay.updateOverlayPanel(overlay)
  22158. EditOverlay.controlSelectOverlay(overlay)
  22159. return;
  22160. } */
  22161. }),
  22162. (n.prototype.getMouseIntersect = function (e, t) {
  22163. //xzw change
  22164. ;(e = e || this.mouse.clone()),
  22165. (t =
  22166. t ||
  22167. this.model.floors.reduce(
  22168. function (e, t) {
  22169. return t.hidden ? e : e.concat(t.collider.children)
  22170. },
  22171. this.mode === u.PANORAMA ? this.panoMarkers : []
  22172. ))
  22173. var i = new r.Vector3(e.x, e.y, -1).unproject(this.camera)
  22174. this.raycaster.set(i, this.getMouseDirection(e))
  22175. var n = this.raycaster.intersectObjects(t, true) //add true
  22176. var o = n[0]
  22177. if (o) {
  22178. o.face &&
  22179. ((o.normal = o.face.normal.applyQuaternion(o.object.quaternion)),
  22180. this.position.clone().sub(o.point).dot(o.normal) < 0 && o.normal.negate(),
  22181. this.currentPano ? (o.onFloor = o.point.y < this.position.y - 0.5 * this.currentPano.height) : (o.onFloor = o.point.y < this.position.y - 0.5),
  22182. (o.horizontal = 0.8 < o.normal.y))
  22183. return o
  22184. }
  22185. }),
  22186. (n.prototype.updateClosestPano = function (e) {
  22187. var t = [s.filters.isPanoAligned()]
  22188. if (this.mode === u.PANORAMA) {
  22189. if (!this.currentPano) return
  22190. t.push(s.filters.not(this.currentPano)),
  22191. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  22192. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), 0.25)),
  22193. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  22194. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  22195. } else {
  22196. t.push(s.filters.isOnVisibleFloor()), t.push(this.checkHasNeighbor) //add
  22197. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), 0.25))
  22198. }
  22199. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)])
  22200. i !== this.closestPano
  22201. ? (i && (this.isPanoHover = !0),
  22202. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  22203. (this.closestPano = i),
  22204. this.closestPano && this.mode == 'panorama' ? CursorDeal.add('hoverPano') : CursorDeal.remove('hoverPano')) //add
  22205. : (this.isPanoHover = !1)
  22206. }),
  22207. (n.prototype.dollhouseMode = function (e, t) {
  22208. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE), (this.mode = u.DOLLHOUSE), this.cameraControls.controls[u.DOLLHOUSE].reset()
  22209. var i = new r.Vector3(this.model.center.x, 0, this.model.center.z),
  22210. n = new r.Vector3(15, 10, 15)
  22211. if (e && t) {
  22212. var o = d.FORWARD.clone().applyQuaternion(t),
  22213. a = this.model.center.clone().sub(e),
  22214. s = a.dot(o)
  22215. s > 0 ? ((i = o.clone().multiplyScalar(s).add(e)), n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  22216. }
  22217. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  22218. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  22219. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  22220. this.updateFromControls(),
  22221. (this.model.alpha = 1),
  22222. (this.model.skybox.material.uniforms.opacity.value = 0)
  22223. }),
  22224. (n.prototype.insideMode = function (e, t) {
  22225. var i = $.Deferred(),
  22226. n = t || null
  22227. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  22228. var r = [s.filters.isPanoAligned()]
  22229. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  22230. (e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)])),
  22231. this.flyToNewMode({
  22232. mode: u.PANORAMA,
  22233. pano: e,
  22234. callback: n
  22235. })
  22236. .done(i.resolve.bind(i))
  22237. .fail(i.reject.bind(i))
  22238. } else {
  22239. var o = this.mode === u.PANORAMA ? 'Already in panorama mode' : 'Cannot change mode during mode transition'
  22240. i.reject(o)
  22241. }
  22242. return i.promise()
  22243. }),
  22244. (n.prototype.fitDollhouse = function (e, t, i) {
  22245. //许钟文改 飞入前寻找和初始视角最合适的位置
  22246. //if(urlHasValue('oldEntry')){
  22247. //搬自一代。
  22248. var maxY = this.model.boundingBox.max.y
  22249. var n = d.FORWARD.clone().applyQuaternion(i),
  22250. i = n.clone().add(e)
  22251. this.cameraControls.activeControl.target.copy(i),
  22252. this.cameraControls.activeControl.camera.position
  22253. .set(0, maxY * 2.4, 0)
  22254. .add(e)
  22255. .add(n.multiplyScalar(-10))
  22256. //return;
  22257. /* //this.camera.position.copy(this.model.center);
  22258. //this.camera.updateMatrixWorld()
  22259. this.switchCameraMode("dollhouse", i) */
  22260. //}//下面是二代代码,看不太懂。因为有的场景在靠近一端的某个方向截取的初始视角会甩镜头,也就是不是下去之后的方向
  22261. //直接用一代的这个 效果和二代几乎一样,且不会甩
  22262. /* var n = d.FORWARD.clone().applyQuaternion(i);
  22263. this.cameraControls.activeControl.target.copy(n).add(e);
  22264. var o = d.RIGHT.clone().applyQuaternion(i)
  22265. , a = d.UP.clone()
  22266. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  22267. , l = this.model.boundingBox.max.clone()
  22268. , c = this.model.boundingBox.min.clone()
  22269. , 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)]
  22270. , u = 0
  22271. , p = 0
  22272. , g = 0;
  22273. h.forEach(function(e, t, i) {
  22274. var n = Math.abs(e.dot(o))
  22275. , r = e.dot(s);
  22276. n > u && (u = n,
  22277. p = r),
  22278. r > g && (g = r)
  22279. });
  22280. 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)))
  22281. , v = s.clone().multiplyScalar(p).add(t)
  22282. , A = s.clone().multiplyScalar(g).add(t);
  22283. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180));
  22284. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180));
  22285. p = Math.max(p, 10),
  22286. g = Math.max(g, 10);
  22287. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  22288. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  22289. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1;
  22290. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p))
  22291. : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  22292. */
  22293. }),
  22294. (n.prototype.floorplanMode = function (e, t, i) {
  22295. this.mode = u.FLOORPLAN
  22296. var n = this.cameraControls.controls[u.FLOORPLAN]
  22297. n.reset()
  22298. var r = e ? e : this.model.center
  22299. if (
  22300. (n.target.copy(r).setY(0),
  22301. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  22302. i ? ((n.currentScale = i / ($('#player').width() / $('#player').height())), (n.absoluteScale = n.currentScale)) : n.zoomToContain(this.model.size),
  22303. t)
  22304. ) {
  22305. var o = d.LEFT.clone().applyQuaternion(t)
  22306. n.rotateLeft(-Math.atan2(o.x, o.z))
  22307. } else n.rotateToView(this.model.size, this.getDirection())
  22308. n.update(0)
  22309. }),
  22310. (n.prototype.nonInterruptingFlyToPano = function (e, t) {
  22311. return (e.skipWarpingCheck = !0), this.flyToPano(e, t)
  22312. }),
  22313. (n.prototype.updateMarkerVisi = function () {
  22314. //加
  22315. if (this.mode != 'panorama') return
  22316. this.model.panos.list.forEach(pano => {
  22317. if (!pano.marker) return
  22318. pano.marker.material.visible = !!pano.neighbourPanos[this.currentPano.id]
  22319. })
  22320. }),
  22321. /* n.prototype.updateHotVisible = function(pano){
  22322. var hots = this.model.hots;
  22323. pano = pano || this.currentPano;
  22324. for (var index in hots){
  22325. var visible;
  22326. if(this.mode != "panorama"){
  22327. visible = true;
  22328. }else{
  22329. //hots[index].mesh.material.depthTest = false;
  22330. visible = !hots[index].visiblePanos || hots[index].visiblePanos.indexOf(pano.id) > -1
  22331. }
  22332. hots[index].mesh.visible = visible;
  22333. }
  22334. } */
  22335. (n.prototype.flyToPano = function (e, t) {
  22336. var i = e.pano,
  22337. aim = e.lookAtPoint,
  22338. aimQua = e.quaternion, //ADD
  22339. o = e.duration,
  22340. a = e.aimDuration,
  22341. s = e.maxDistanceOverride,
  22342. l = e.skipWarpingCheck,
  22343. c = e.constantMoveSpeed,
  22344. h = null,
  22345. p = null
  22346. if (aim) {
  22347. var _ = new r.Matrix4().lookAt(i.position, aim, d.UP)
  22348. aimQua = new r.Quaternion().setFromRotationMatrix(_)
  22349. } else aimQua = aimQua
  22350. var zoomLevel = e.zoomLevel || 1 //add
  22351. if (this.flying) return t && t(e)
  22352. window.specialScene && specialScene.special().specifySpot && specialScene.special().specifySpot(i)
  22353. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD)) return F.warn('Player.flyToPano() -> Cannot fly when warping'), t && t(), !1
  22354. if ((this.updateLastView(), this.mode !== u.PANORAMA)) {
  22355. var m
  22356. void this.flyToNewMode({
  22357. mode: u.PANORAMA,
  22358. pano: i,
  22359. duration: o,
  22360. quaternion: aimQua,
  22361. callback: t
  22362. })
  22363. }
  22364. if (
  22365. !i ||
  22366. ((h = g.deepExtend(e)),
  22367. (p = function () {
  22368. N.delayOneFrame(
  22369. function () {
  22370. this.flyToPano(h, t)
  22371. }.bind(this)
  22372. )
  22373. }.bind(this)),
  22374. !this.checkAndWaitForPanoLoad(i, 'high', 'low', this.basePanoSize, p))
  22375. ) {
  22376. var C = function (e) {
  22377. t && t(e)
  22378. }.bind(this)
  22379. this.currentPano || ((this.currentPano = i), this.path.placeCpm(), this.path.fadeOutCpm(f.path.fadeOutTime), this.spider.draw())
  22380. var I = o
  22381. if ('number' != typeof o) {
  22382. var E = s || f.transition.flytimeMaxDistanceThreshold
  22383. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  22384. }
  22385. if ((f.transition.flySpeed > 0.01 && (I = (1e3 * this.currentPano.position.distanceTo(i.position)) / f.transition.flySpeed), zoomLevel !== this.zoomLevel))
  22386. switch (f.zoom.transitionStyle) {
  22387. case 1:
  22388. this.smoothZoomFovTo(null, zoomLevel, zoomLevel == 1 ? I / 2 : I) //改
  22389. break
  22390. case 2:
  22391. return (h = g.deepExtend(e)), (p = this.flyToPano.bind(this, h, t)), void this.smoothZoomFovTo(null, zoomLevel, f.zoom.restoreTime * (this.zoomLevel - 1), p)
  22392. }
  22393. if (aimQua) {
  22394. y.cancelById(V.LookTransition), (I *= f.transition.aimSlowFactor)
  22395. var b = this.cameraControls.activeControl.camera.quaternion.clone(),
  22396. S = b.clone(),
  22397. M = new r.Vector3()
  22398. if (i === this.currentPano) {
  22399. var R = d.FORWARD.clone().applyQuaternion(b),
  22400. P = d.FORWARD.clone().applyQuaternion(aimQua),
  22401. O = R.angleTo(P)
  22402. return (
  22403. (void 0 !== a && null !== a) || (a = ((1 * Math.sqrt(O)) / f.tags.navigate.rotateSpeedFactor) * 1e3),
  22404. void y.start(
  22405. function (e) {
  22406. S.copy(b),
  22407. v.quaternion(S, aimQua)(e),
  22408. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  22409. this.cameraControls.activeControl.lookAt(M)
  22410. }.bind(this),
  22411. a,
  22412. C,
  22413. 0,
  22414. A[f.transition.movementEasing],
  22415. null,
  22416. V.LookTransition
  22417. )
  22418. )
  22419. }
  22420. }
  22421. if (i === this.currentPano) return void C()
  22422. this.flying = !0
  22423. var L = this.position.clone(),
  22424. D = this.currentPano
  22425. F.debug('Flying to pano ', i.position), this.emit(w.PanoChosen, this.currentPano, i), this.emit(w.FlyingStarted, i.position, L, i, D)
  22426. //---------before fly--------------- add
  22427. this.transitionPos({ type: 'beforeFlytopano', pano: i, dur: I }) //add
  22428. Hot.updateVisibles([this.currentPano, i], 'every')
  22429. //地标变化
  22430. if (this.model.floorLogos) {
  22431. this.model.changefloorLogoOpa({ index: 0, opa: 0, dur: p, delay: 0.7 }) //this.model.floorLogoFade(0, _duration*0.5, 0.7);
  22432. this.model.floorLogos[1].position.copy(i.floorPosition.clone().sub(this.model.position))
  22433. //this.model.adjustfloorLogoHeight();
  22434. this.model.floorLogos[1].material.opacity = 0 //uniforms.opacity.value = 0;
  22435. this.model.floorLogos[1].visible = true
  22436. this.model.changefloorLogoOpa({ index: 1, opa: 1, dur: 250 }) //this.model.floorLogoShow(1,250);
  22437. }
  22438. //=======================================
  22439. this.nextPano = i
  22440. let beginTran = () => {
  22441. aimQua &&
  22442. y.start(
  22443. function (e) {
  22444. S.copy(b), v.quaternion(S, aimQua)(e), M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position), this.cameraControls.activeControl.lookAt(M)
  22445. }.bind(this),
  22446. I,
  22447. null,
  22448. 0,
  22449. A[f.transition.movementEasing],
  22450. null,
  22451. V.LookTransition
  22452. )
  22453. var B = c ? null : A[f.transition.movementEasing]
  22454. y.start(v.uniform(this.model.skybox, 'progress', 1), I, null, 0, A[f.transition.blendEasing], 'skyFly', V.FlyToPano),
  22455. y.start(v.allUniforms(this.model.chunks, 'progress', 1), I, null, 0, A[f.transition.blendEasing], 'chunkFly', V.FlyToPano),
  22456. y.start(
  22457. v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position),
  22458. I,
  22459. function (e) {
  22460. ;(this.flying = !1),
  22461. this.currentPano !== i && this.currentPano.exit(),
  22462. i.enter(),
  22463. (this.currentPano = i),
  22464. (this.nextPano = null),
  22465. this.path.placeCpm(),
  22466. this.path.fadeOutCpm(f.path.fadeOutTime),
  22467. this.spider.draw(),
  22468. this.emit(w.FlyingEnded, i.position, L, i, D),
  22469. this.updateMarkerVisi(), //add
  22470. C(e)
  22471. //add:
  22472. if (this.mode == 'panorama') {
  22473. if (this.model.floorLogos) {
  22474. this.model.floorLogos[0].position.copy(this.model.floorLogos[1].position)
  22475. //this.model.adjustfloorLogoHeight()
  22476. this.model.changefloorLogoOpa({ index: 0, opa: 1, dur: 0 }) //this.model.floorLogos[0].material.uniforms.opacity.value = 1;
  22477. this.model.floorLogos[1].visible = false
  22478. }
  22479. this.model.fadePanoMarkers() //add
  22480. Hot.updateVisibles([this.currentPano]) //add
  22481. }
  22482. }.bind(this),
  22483. 0,
  22484. B,
  22485. 'camFly',
  22486. V.FlyToPano
  22487. )
  22488. }
  22489. if (!this.model.supportsTiles && i.getSkyboxTexture().image[0].width > 1024 /* || this.qualityManager.getMaxZoomClass() == '4k' */) {
  22490. setTimeout(() => {
  22491. beginTran()
  22492. }, 50) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  22493. } else {
  22494. beginTran()
  22495. }
  22496. }
  22497. }),
  22498. (n.prototype.warpToPano = function (o = {}) {})
  22499. n.prototype.blackToPano = function (o = {}) {
  22500. //add 瞬间过渡
  22501. //o.panoId = "8bc9156b288d48459e4e0f74d7051ef1"
  22502. if (this.flying || this.isWarping()) return
  22503. let pano = o.pano || this.model.panos.index[o.panoId]
  22504. if (this.mode !== u.PANORAMA) {
  22505. var m
  22506. void this.flyToNewMode({
  22507. mode: u.PANORAMA,
  22508. pano,
  22509. duration: o.duration,
  22510. quaternion: o.quaternion
  22511. //callback: t
  22512. })
  22513. }
  22514. let oldPos = this.position.clone()
  22515. let oldPano = this.currentPano
  22516. this.path.warpDestPano = pano
  22517. var retry = () => {
  22518. ;(this.waitingToWarp = !1), this.blackToPano(o)
  22519. }
  22520. if (this.checkAndWaitForPanoLoad(pano, 'high', 'low', this.basePanoSize, retry)) return void (this.waitingToWarp = !0)
  22521. this.emit('pano.chosen', oldPano, pano)
  22522. this.flying = true
  22523. this.nextPano = pano //提前加载高清图片
  22524. this.path.warpDestHeroLoc = {
  22525. panoId: o.panoId,
  22526. position: pano.position,
  22527. quaternion: o.quaternion || this.quaternion.clone()
  22528. }
  22529. this.path.warpTravel_BLACK(null, 1500, 1, () => {
  22530. pano != this.currentPano && this.currentPano.exit()
  22531. pano.enter()
  22532. this.currentPano = pano
  22533. this.emit('flying.ended', pano.position, oldPos, pano, oldPano)
  22534. this.flying = false
  22535. this.nextPano = null
  22536. this.updateMarkerVisi() //add
  22537. })
  22538. }
  22539. window._transitionPosId = 9999
  22540. n.prototype.transitionPos = function (o = {}) {
  22541. //渐变overlay和热点的位置
  22542. y.cancelById(_transitionPosId)
  22543. var begin = function (object, pos, qua, scale) {
  22544. if (pos) {
  22545. if (!same(object.position, pos, 0.01)) {
  22546. y.start(v.vector(object.position, pos), o.dur, e => {}, 0, A[f.transition.movementEasing], 'transitionPos', _transitionPosId)
  22547. }
  22548. if (qua && !same(object.quaternion, qua, 1e-6)) {
  22549. y.start(v.quaternion(object.quaternion, qua), o.dur, e => {}, 0, A[f.transition.movementEasing], 'transitionPos', _transitionPosId)
  22550. }
  22551. if (scale && !same(object.scale, scale, 0.001)) {
  22552. y.start(v.vector(object.scale, scale), o.dur, e => {}, 0, A[f.transition.movementEasing], 'transitionPos', _transitionPosId)
  22553. }
  22554. }
  22555. }
  22556. var same = function (vec1, vec2, diff) {
  22557. var s = Math.abs(vec1.x - vec2.x) < diff && Math.abs(vec1.y - vec2.y) < diff && Math.abs(vec1.z - vec2.z) < diff
  22558. if (s && vec1.w) s = Math.abs(vec1.w - vec2.w) < diff
  22559. return s
  22560. }
  22561. var sid = o.pano != void 0 ? o.pano.id : 'outside'
  22562. for (let i in this.model.hots) {
  22563. //是否判断visible?
  22564. var hot = this.model.hots[i]
  22565. var panoData = hot.info.transformAtPanos[sid]
  22566. var useCustom = !panoData
  22567. //if(hot.usingTransformData || !useCustom){
  22568. var pos = useCustom ? hot.info.position : panoData.pos
  22569. var qua = hot.isSprite ? null : useCustom ? hot.info.quaternion : panoData.qua
  22570. var scale = useCustom ? hot.info.scale : panoData.scale
  22571. begin(hot, pos, qua, scale)
  22572. //}
  22573. //hot.usingTransformData = !useCustom;
  22574. }
  22575. }
  22576. window._tranOutsideFocus = 4399
  22577. n.prototype.focusPoint = function (o = {}) {
  22578. //当在外时,聚焦相机到这一点
  22579. console.log('focusPoint')
  22580. if (this.mode == 'floorplan') {
  22581. var modelSize = o.modelSize || new THREE.Vector3(8, 8, 8) //可视范围
  22582. var control = this.cameraControls.controls.floorplan
  22583. var absoluteScale = control.getDefaultAbsoluteScale(modelSize)
  22584. var currentScale = control.absoluteScale
  22585. var currentTarget = control.target.clone()
  22586. y.cancelById(window._tranOutsideFocus, true)
  22587. y.start(
  22588. function (progress) {
  22589. control.absoluteScale = absoluteScale * progress + currentScale * (1 - progress)
  22590. control.target = o.aim
  22591. .clone()
  22592. .multiplyScalar(progress)
  22593. .add(currentTarget.clone().multiplyScalar(1 - progress))
  22594. control.camera.position.copy(control.target.clone().add(control.offset)) //维持角度
  22595. }.bind(this),
  22596. o.dur || 600,
  22597. null /* cancelFuc */,
  22598. 0,
  22599. A[f.transition.movementEasing],
  22600. 'outsideFocus',
  22601. window._tranOutsideFocus,
  22602. null /* cancelFuc */
  22603. )
  22604. } else if (player.mode == 'dollhouse') {
  22605. var control = player.cameraControls.controls.dollhouse
  22606. var radius = o.radius || 8
  22607. var currentTarget = control.target.clone()
  22608. var dir = control.offset.clone().normalize()
  22609. var currentRadius = control.offset.length()
  22610. y.cancelById(window._tranOutsideFocus, true)
  22611. y.start(
  22612. function (progress) {
  22613. control.target = o.aim
  22614. .clone()
  22615. .multiplyScalar(progress)
  22616. .add(currentTarget.clone().multiplyScalar(1 - progress))
  22617. let radius_ = radius * progress + currentRadius * (1 - progress)
  22618. control.camera.position.copy(control.target.clone().add(dir.clone().multiplyScalar(radius_)))
  22619. }.bind(this),
  22620. o.dur || 600,
  22621. null /* cancelFuc */,
  22622. 0,
  22623. A[f.transition.movementEasing],
  22624. 'outsideFocus',
  22625. window._tranOutsideFocus,
  22626. null /* cancelFuc */
  22627. )
  22628. } else if (this.mode == 'panorama') {
  22629. this.flyToPano({
  22630. lookAtPoint: o.aim.clone(),
  22631. pano: this.currentPano,
  22632. aimDuration: o.dur || 600
  22633. })
  22634. }
  22635. }
  22636. /*
  22637. 切换到某个模式后再执行函数
  22638. */
  22639. n.prototype.FlyToMode = function (mode, f1, duration) {
  22640. var f2
  22641. if (this.mode == mode) {
  22642. f1 && f1()
  22643. } else {
  22644. f2 = f1
  22645. if (this.mode == 'transitioning' && this.modeTran.split('-')[1] != mode) {
  22646. //正飞向其他模式,就要先飞完再飞进来然后执行
  22647. this.afterCModeFuc = function () {
  22648. /* objects.gui.modeChange[mode](null, {
  22649. fuc: f2 这个写法会使得先添加的回调fuc取代之后添加的afterCModeFuc,所以统一改为afterCModeFuc
  22650. }); */
  22651. this.afterCModeFuc = f2
  22652. this.flyToNewMode({
  22653. mode: mode,
  22654. pano: mode == 'panorama' && this.currentPano
  22655. //callback : f2
  22656. })
  22657. //这个fuc在trainsitioning状态下传入是无效的,所以后面得用afterCModeFuc。但是执行完afterCModeFuc,afterCModeFuc会变为null,所以里面得用fuc。。orz
  22658. }.bind(this)
  22659. } else {
  22660. if (this.afterCModeFuc) console.log('已经有afterCModeFuc了!!!!!!!!!!!!!!!')
  22661. this.afterCModeFuc = f2 //飞入后执行
  22662. try {
  22663. //在场景刚开始加载 control还没建好时这句可能会报错所以用try。 不用callback而用 afterCModeFuc也是这个原因,因为会有别的函数可以飞入然后执行它
  22664. this.flyToNewMode({
  22665. mode: mode,
  22666. pano: mode == 'panorama' && this.currentPano,
  22667. duration: duration
  22668. })
  22669. } catch (e) {
  22670. console.log('FlyToMode遇到问题?')
  22671. }
  22672. }
  22673. }
  22674. }
  22675. ;(n.prototype.fastForwardActivePanoFlight = function (e) {
  22676. e = e || (f.transition.fastForwardFactor / 10) * 4 + 1
  22677. y.adjustSpeed(V.FlyToPano, e)
  22678. y.adjustSpeed(V.LookTransition, e)
  22679. }),
  22680. (n.prototype.flyToPanoClosestToMouse = function () {
  22681. if ((Date.now() - this.mouseLastMoveTime > 50 && ((this.intersect = this.getMouseIntersect()), this.intersect && this.updateClosestPano(this.intersect)), this.closestPano))
  22682. return this.flyToPano({
  22683. pano: this.closestPano
  22684. })
  22685. var e = this.getMouseDirection()
  22686. this.flyDirection(e) ||
  22687. this.flyToPano({
  22688. pano: this.currentPano
  22689. })
  22690. }),
  22691. (n.prototype.flyLocalDirection = function (e) {
  22692. var t = this.getDirection(e),
  22693. i = 1 === e.z ? 0.4 : 0.75,
  22694. n = 1 === Math.abs(e.x)
  22695. return this.flyDirection(t, i, n)
  22696. }),
  22697. (n.prototype.flyDirection = function (e, t, i) {
  22698. Hot.closePopup() //xzw add
  22699. var n = $.Deferred()
  22700. this.history.invalidate()
  22701. var r = this.closestPanoInDirection(e, t, i)
  22702. return (
  22703. r
  22704. ? this.flyToPano(
  22705. {
  22706. pano: r
  22707. },
  22708. n.resolve.bind(n, !0)
  22709. )
  22710. : (this.bump(e), n.resolve(!1)),
  22711. n.promise()
  22712. )
  22713. }),
  22714. (n.prototype.closestPanoInDirection = function (e, t, i) {
  22715. return this.rankedPanoInDirection(0, e, t, i)
  22716. }),
  22717. (n.prototype.rankedPanoInDirection = (function () {
  22718. var e = {
  22719. pano: null,
  22720. candidates: []
  22721. }
  22722. return function (t, i, n, r) {
  22723. t || (t = 0), (n = void 0 !== n ? n : 0.75)
  22724. var o = r ? 'angle' : 'direction'
  22725. return (
  22726. this.model.panos.findRankedByScore(
  22727. t,
  22728. [s.filters.isPanoAligned(), s.filters.not(this.currentPano), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.inPanoDirection(this.position, i, n)],
  22729. [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)],
  22730. e
  22731. ),
  22732. (this.cachedPanoCandidates = e.candidates),
  22733. e.pano
  22734. )
  22735. }
  22736. })()),
  22737. (n.prototype.bump = function (e) {
  22738. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  22739. var t,
  22740. i,
  22741. n,
  22742. r = f.transition,
  22743. o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8,
  22744. a = this.camera.getWorldDirection().dot(e),
  22745. s = Math.abs(a) > 0.5
  22746. if (s)
  22747. (t = function () {
  22748. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], 'zoom', a > 0 ? 1.04 : 0.96), o, i, 0, A.easeInOutSine, 'bumpZStart')
  22749. }.bind(this)),
  22750. (i = function () {
  22751. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], 'zoom', 1), 5 * o, n, 0, A.easeInOutSine, 'bumpZRelax')
  22752. }.bind(this))
  22753. else {
  22754. var l = this.camera.position.clone(),
  22755. c = e.clone()
  22756. this.raycaster.set(l, c)
  22757. var h = this.model.floors.reduce(function (e, t) {
  22758. return e.concat(t.collider.children)
  22759. }, []),
  22760. d = this.raycaster.intersectObjects(h),
  22761. p = d.length > 0 ? d[0].distance / 25 : 0.04,
  22762. g = l.clone().add(c.multiplyScalar(p))
  22763. ;(t = function () {
  22764. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, 'bumpTStart')
  22765. }.bind(this)),
  22766. (i = function () {
  22767. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, 'bumpTRelax')
  22768. }.bind(this))
  22769. }
  22770. ;(n = function () {
  22771. this.flying = !1
  22772. }.bind(this)),
  22773. (this.flying = !0),
  22774. t()
  22775. }
  22776. }),
  22777. (n.prototype.changeFloor = function (e) {
  22778. if (!this.is360View(this.mode, this.currentPano))
  22779. if (this.mode === u.PANORAMA) {
  22780. var t = this.history.reversePano(e)
  22781. t && t.isAligned()
  22782. ? this.flyToPano({
  22783. pano: t
  22784. })
  22785. : this.changeFloorByScore(e)
  22786. } else this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  22787. }),
  22788. (n.prototype.changeFloorByScore = (function () {
  22789. var e = {
  22790. pano: null,
  22791. candidates: []
  22792. }
  22793. return function (t) {
  22794. var i = this.model.nextFloor(t)
  22795. return i
  22796. ? (this.model.panos.lowestByScore(
  22797. [s.filters.atFloor(i), s.filters.isPanoAligned()],
  22798. [
  22799. s.scoreFunctions.distance(this.currentPano),
  22800. s.scoreFunctions.direction(this.position, new r.Vector3(0, t, 0)),
  22801. s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, 0.5)
  22802. ],
  22803. e
  22804. ),
  22805. void (e.pano
  22806. ? ((this.cachedPanoCandidates = e.candidates),
  22807. this.history.push(t, this.currentPano),
  22808. this.flyToPano({
  22809. pano: e.pano
  22810. }))
  22811. : F.warn('No pano found on selected floor, not moving there.')))
  22812. : void F.debug('player.changeFloor(' + t + '): no such floor')
  22813. }
  22814. })()),
  22815. (n.prototype.gotoFloor = function (e) {
  22816. var t = e - this.model.currentFloor.floorIndex
  22817. this.changeFloor(t)
  22818. }),
  22819. (n.prototype.getDirection = function (e) {
  22820. return (e = e ? e : new r.Vector3().copy(d.FORWARD)), e.applyQuaternion(this.camera.quaternion)
  22821. }),
  22822. (n.prototype.flyToSameMode = function (e, t, i, n, o) {
  22823. if (((o = o || $.Deferred()), this.mode === u.TRANSITIONING)) return F.warn('should not be transitioning here'), n && n(!1), o.reject().promise()
  22824. var a = i || !1,
  22825. s = i ? i.position : this.position,
  22826. l = this.position.clone(),
  22827. c = this.currentPano
  22828. if (
  22829. (F.debug('New pose in mode ' + this.mode),
  22830. !e ||
  22831. ((retryCallback = function () {
  22832. N.delayOneFrame(
  22833. function () {
  22834. this.flyToSameMode(e, t, i, n, o)
  22835. }.bind(this)
  22836. )
  22837. }.bind(this)),
  22838. !this.checkAndWaitForPanoLoad(e, 'high', 'low', this.basePanoSize, retryCallback)))
  22839. ) {
  22840. var h = function () {
  22841. this.emit(w.FlyingEnded, s, l, e, c), n && n(!0)
  22842. }.bind(this),
  22843. d = f[this.mode],
  22844. p = void 0 !== t ? t : d.transitionTime,
  22845. g = new r.Vector3(),
  22846. C = new r.Vector3()
  22847. if ((this.emit(w.FlyingStarted, s, l, e, c), this.mode === u.PANORAMA)) F.warn('we should not be here for panorama views')
  22848. else if (this.mode === u.DOLLHOUSE)
  22849. if (a) {
  22850. var I = new r.Vector3(0, 1, 0)
  22851. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(i.floorVisibility), C.copy(i.position)
  22852. var E = new r.Vector3(0, 0, -1).applyQuaternion(i.quaternion),
  22853. b = new r.Raycaster(C.clone(), E.clone(), 0, 1 / 0),
  22854. _ = b.intersectObjects(this.model.colliders),
  22855. T = 3
  22856. _.length
  22857. ? (g.copy(_[0].point), (T = 0.75 * C.distanceTo(g)))
  22858. : (g.copy(E).multiplyScalar(3).add(C), F.debug('Tried to restore dollhouse mode that did not intersect...', i.position, i.quaternion))
  22859. var x = new r.Matrix4().lookAt(C, g, I),
  22860. S = new r.Euler().setFromRotationMatrix(x, f.warp.eOrder),
  22861. M = g.distanceTo(C),
  22862. R = new r.Matrix4().lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I),
  22863. P = new r.Euler().setFromRotationMatrix(R, f.warp.eOrder),
  22864. O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target)
  22865. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0)
  22866. var L = new r.Euler(S.x - P.x, S.y - P.y, S.z - P.z, f.warp.eOrder)
  22867. ;(L.y = L.y > Math.PI ? (L.y -= 2 * Math.PI) : L.y < -Math.PI ? (L.y += 2 * Math.PI) : L.y), (this.path.burnsDir = Math.sign(L.y))
  22868. var D = new r.Euler(0, 0, 0, f.warp.eOrder),
  22869. B = new r.Vector3()
  22870. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  22871. y.start(
  22872. function (e, t) {
  22873. ;(D.x = P.x + e * L.x), (D.y = P.y + e * L.y), (D.z = P.z + e * L.z)
  22874. var i = O + e * (M - O)
  22875. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target), this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  22876. }.bind(this),
  22877. p,
  22878. null,
  22879. f.flydown.movementDelay,
  22880. A[f.flydown.movementEasing],
  22881. null,
  22882. V.FlyToSameMode
  22883. ),
  22884. y.start(
  22885. function (e, t) {
  22886. this.cameraControls.controls[u.DOLLHOUSE].update(),
  22887. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  22888. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  22889. }.bind(this),
  22890. p,
  22891. null,
  22892. f.flydown.movementDelay,
  22893. A[f.flydown.movementEasing],
  22894. null,
  22895. V.FlyToSameMode
  22896. )
  22897. } else F.warn('invalid warp destination in flyToSameMode()? ignore it then')
  22898. else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), i)) {
  22899. this.model.warpDestFloors(i.floorVisibility)
  22900. var U = this.cameraControls.cameras[u.FLOORPLAN],
  22901. k = this.cameraControls.controls[u.FLOORPLAN],
  22902. H = k.target.clone(),
  22903. G = i.position.clone().sub(H),
  22904. z = U.position.clone().sub(k.target),
  22905. W = z.length(),
  22906. j = new r.Vector3(-1, 0, 0).applyQuaternion(i.quaternion).normalize(),
  22907. Y = Math.atan2(k.offset.x, k.offset.z),
  22908. X = Math.atan2(j.x, j.z),
  22909. Z = k.absoluteScale,
  22910. q = m.convertWorkshopOrthoZoom(i.orthoZoom)
  22911. y.start(
  22912. function (e, t) {
  22913. k.target.copy(G).multiplyScalar(e).add(H)
  22914. var i = Y + (X - Y) * e
  22915. ;(k.offset.x = W * Math.sin(i)),
  22916. (k.offset.z = W * Math.cos(i)),
  22917. U.position.copy(k.target).add(k.offset),
  22918. (k.absoluteScale = Z + e * (q - Z)),
  22919. k.update(),
  22920. this.quaternion.copy(U.quaternion),
  22921. this.position.copy(U.position),
  22922. this.target.copy(k.target),
  22923. this.camera.projectionMatrix.copy(U.projectionMatrix)
  22924. }.bind(this),
  22925. p,
  22926. null,
  22927. 0,
  22928. A[f.flydown.movementEasing],
  22929. null,
  22930. V.FlyToSameMode
  22931. )
  22932. } else F.info('flyToSameMode() funny floorplan view? skipping')
  22933. return (
  22934. y.setTimeout(
  22935. function (e) {
  22936. ;(this.mode = e), h(), o.resolve(!0)
  22937. }.bind(this, this.mode),
  22938. p,
  22939. V.FlyToSameMode
  22940. ),
  22941. (this.mode = u.TRANSITIONING),
  22942. o.promise()
  22943. )
  22944. }
  22945. }),
  22946. (n.prototype.flyToNewMode = function (e, t) {
  22947. Hot.closePopup() //xzw add
  22948. e = e || {}
  22949. var i = e.mode,
  22950. n = e.pano,
  22951. o = e.duration,
  22952. a = e.warpDest,
  22953. s = e.callback,
  22954. l = e.force,
  22955. c = e.quaternion
  22956. if (((t = t || $.Deferred()), this.isWarping()))
  22957. return F.warn('Player.flyToNewMode() -> Cannot fly when warping'), s && s(!1), t.reject('Cannot change mode during tour transition').promise()
  22958. if (this.mode === u.TRANSITIONING) return s && s(!1), t.reject('Cannot change mode during mode transition').promise()
  22959. if (i === this.mode)
  22960. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)), t.promise()) : (s && s(!1), t.reject('Already in ' + i + ' mode').promise())
  22961. var h = a || !1
  22962. F.debug('Switching mode to ' + i)
  22963. if (window.vrEnabled && i != 'panorama') {
  22964. return s && s(!1), t.reject('vr不允许飞出').promise()
  22965. }
  22966. var d = function () {
  22967. N.delayOneFrame(
  22968. function () {
  22969. this.flyToNewMode(e, t)
  22970. }.bind(this)
  22971. )
  22972. }.bind(this)
  22973. if (n && this.checkAndWaitForPanoLoad(n, 'low', 'low', this.basePanoSize, d)) return t.promise()
  22974. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  22975. return (
  22976. F.info('Waiting for model textures to be loaded before going out to dollhouse'),
  22977. this.model.waitForLoad(
  22978. this.model,
  22979. function () {
  22980. return this.model.meshTexturesLoaded
  22981. }.bind(this)
  22982. ),
  22983. this.model.loadMeshTextures().done(d),
  22984. t.promise()
  22985. )
  22986. this.history.invalidate(), this.updateLastView()
  22987. var p = this.mode,
  22988. C = this.cameraControls.cameras[i]
  22989. e = g.deepExtend({}, f[i], f[p + '-' + i])
  22990. var I = void 0 !== o ? o : e.transitionTime
  22991. this.emit(w.ModeChanging, p, i, n, I), n && (this.currentPano = n), this.switchCameraMode(i, c), y.cancelById(V.LookTransition)
  22992. //before fly---------------------
  22993. this.modeTran = p + '-' + i //add
  22994. if (this.mode == 'panorama') {
  22995. if (this.model.floorLogos) {
  22996. this.model.floorLogos[0].visible = false
  22997. this.model.floorLogos[1].visible = false
  22998. }
  22999. }
  23000. if (i == 'panorama') {
  23001. this.transitionPos({ type: 'beforeFlyIn', pano: n, dur: I }) //add
  23002. } else {
  23003. this.transitionPos({ type: 'beforeFlyOut', dur: I / 2 }) //add
  23004. }
  23005. window.bus.dispatchEvent({ type: 'playerAndModelReady' })
  23006. this.ready = true
  23007. //------------------------------------
  23008. var beginTran = () => {
  23009. var _ = new r.Vector3().copy(this.position)
  23010. if (i === u.PANORAMA) {
  23011. this.emit(w.PanoChosen, n, n),
  23012. setTimeout(
  23013. function () {
  23014. n.floor.enter(i)
  23015. }.bind(this),
  23016. I / 2
  23017. ),
  23018. this.path.fadeOutCpm(f.path.fadeOutTime)
  23019. if (this.model.floorLogos) {
  23020. this.model.floorLogos[0].position.copy(n.floorPosition.clone().sub(this.model.position)) //改
  23021. this.model.floorLogos[1].position.copy(this.model.floorLogos[0].position) //for floorIcon position
  23022. }
  23023. } else if (i === u.DOLLHOUSE) {
  23024. if (
  23025. (h && (this.model.stayPut = !0),
  23026. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0), this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  23027. this.path.placeCpm(),
  23028. this.path.fadeInCpm(f.path.fadeInTime),
  23029. h)
  23030. ) {
  23031. var T = new r.Vector3(this.model.center.x, 0, this.model.center.z)
  23032. _.set(15, 10, 15)
  23033. var M = new r.Vector3(0, 0, -1).applyQuaternion(a.quaternion),
  23034. R = new r.Raycaster(a.position.clone(), M.clone(), 0, 1 / 0),
  23035. P = R.intersectObjects([this.sceneIntersectionPlane])
  23036. P.length
  23037. ? (T.copy(P[0].point), _.copy(a.position), this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0.75 * _.distanceTo(T), !0))
  23038. : (F.warn('Tried to restore dollhouse mode that did not intersect...', a.position, a.quaternion), this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  23039. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  23040. _.add(this.model.position),
  23041. C.position.copy(_),
  23042. this.cameraControls.controls[u.DOLLHOUSE].update()
  23043. }
  23044. } else if ((this.path.placeCpm(), this.path.fadeInCpm(f.path.fadeInTime), a)) {
  23045. this.model.warpDestFloors(a.floorVisibility)
  23046. var O = this.cameraControls.cameras[u.FLOORPLAN],
  23047. L = this.cameraControls.controls[u.FLOORPLAN],
  23048. D = O.position.clone().sub(L.target),
  23049. B = new r.Vector3(-1, 0, 0).applyQuaternion(a.quaternion).normalize(),
  23050. U = Math.atan2(B.x, B.z)
  23051. L.target.copy(a.position)
  23052. var k = D.length()
  23053. ;(L.offset.x = k * Math.sin(U)), (L.offset.y = 0), (L.offset.z = k * Math.cos(U)), O.position.copy(L.target).add(L.offset)
  23054. L.target.clone().sub(C.position)
  23055. C.quaternion.copy(a.quaternion), (L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom)), (L.absoluteScale = L.currentScale), L.update()
  23056. } else this.model.currentFloor.enter(i)
  23057. var H = this.currentPano,
  23058. G = this.position.clone()
  23059. this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  23060. (this.flying = !0),
  23061. this.isOutsideMode(i) && this.is360View(p, H)
  23062. ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15), C.controls.target.set(this.model.center.x, 0, this.model.center.z), C.controls.update()),
  23063. (e.blackoutStyle = S.FADEIN),
  23064. (I = f.show360Views.transitionTime),
  23065. this.fade360View(I, C, e))
  23066. : this.isOutsideMode(p) && this.is360View(i, n)
  23067. ? (h && this.switchCameraMode(i, h.quaternion),
  23068. (this.mode = i),
  23069. this.path && this.path.popOutCpm(),
  23070. (e.blackoutStyle = S.END),
  23071. (I = f.show360Views.transitionTime),
  23072. this.fade360View(I, C, e))
  23073. : (y.start(v.property(this.model, 'alpha', e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  23074. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  23075. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  23076. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  23077. y.start(v.uniform(this.model.skybox, 'opacity', e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  23078. y.start(v.property(this.reticule.material.uniforms.opacity, 'value', 0), I, null, V.FlyToNewMode)),
  23079. y.setTimeout(
  23080. function () {
  23081. ;(this.flying = !1),
  23082. p === u.PANORAMA && i !== u.PANORAMA
  23083. ? this.currentPano.exit()
  23084. : p !== u.PANORAMA &&
  23085. i === u.PANORAMA &&
  23086. (this.currentPano !== H && H.exit(), this.currentPano.enter(), this.path.placeCpm(), this.path.fadeOutCpm(f.path.fadeOutTime), this.spider.draw()),
  23087. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  23088. (this.mode = i),
  23089. this.emit(w.FlyingEnded, _, G, this.currentPano, H)
  23090. //add:
  23091. this.updateMarkerVisi()
  23092. //(this.mode == u.PANORAMA) && this.updateHotVisible(),
  23093. this.mode == u.PANORAMA &&
  23094. this.model.floorLogos &&
  23095. (this.model.changefloorLogoOpa({ index: 0, from: 0, opa: 1, dur: 150 }), //this.model.floorLogoShow(0,150);
  23096. (this.model.floorLogos[0].visible = true))
  23097. if (this.afterCModeFuc) {
  23098. //手动加的函数
  23099. var cf = this.afterCModeFuc
  23100. this.afterCModeFuc = null //因为可能在执行afterCModeFuc时需要再添加afterCModeFuc所以要置空的话提前
  23101. cf()
  23102. }
  23103. if (this.mode == u.PANORAMA) {
  23104. Hot.updateVisibles([this.currentPano])
  23105. this.model.fadePanoMarkers()
  23106. } else {
  23107. Hot.updateVisibles(true)
  23108. this.model.hotGroup.children.forEach(overlay => {
  23109. if (overlay.animateInfo) {
  23110. GifTexDeal.start(overlay.animation)
  23111. }
  23112. })
  23113. }
  23114. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(), t.resolve())
  23115. }.bind(this),
  23116. I,
  23117. V.FlyToNewMode
  23118. )
  23119. }
  23120. if (i == 'panorama' && !this.model.supportsTiles && n.getSkyboxTexture().image[0].width > 1024) {
  23121. setTimeout(() => {
  23122. beginTran()
  23123. }, 16) //2048的非tile需要延迟到下一帧,因为需要时间载入贴图,否则掉帧
  23124. } else {
  23125. beginTran()
  23126. }
  23127. this.mode = u.TRANSITIONING
  23128. //p == "panorama" && this.updateHotVisible(),
  23129. return t.promise()
  23130. }),
  23131. (n.prototype.fade360View = function (e, t, i) {
  23132. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  23133. $(this.domElement).fadeOut(
  23134. 0.5 * e,
  23135. function () {
  23136. ;(this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity),
  23137. (this.model.alpha = i.modelAlpha),
  23138. this.position.copy(t.position),
  23139. this.quaternion.copy(t.quaternion),
  23140. this.camera.projectionMatrix.copy(t.projectionMatrix),
  23141. $(this.domElement).fadeIn(0.5 * e)
  23142. }.bind(this)
  23143. )
  23144. }),
  23145. (n.prototype.findDefaultViews = function () {
  23146. this.findDefaultView(this.lastInsideView, !0), this.findDefaultView(this.last360View, !1)
  23147. }),
  23148. (n.prototype.findDefaultView = function (e, t) {
  23149. var i,
  23150. n = this.model.heroLocations,
  23151. r = this.model.panos,
  23152. o = n.findIndex(function (e) {
  23153. if (e.cameraMode !== u.PANORAMA) return !1
  23154. var i = r.get(e.panoId)
  23155. return i && i.isAligned() === t
  23156. })
  23157. o >= 0
  23158. ? ((i = r.get(n[o].panoId)),
  23159. e.update({
  23160. cameraMode: u.PANORAMA,
  23161. pano: i,
  23162. position: n[o].position,
  23163. quaternion: n[o].quaternion
  23164. }))
  23165. : ((o = r.list.findIndex(function (e) {
  23166. return e.isAligned() === t
  23167. })),
  23168. o >= 0
  23169. ? ((i = r.list[o]),
  23170. e.update({
  23171. cameraMode: u.PANORAMA,
  23172. pano: i,
  23173. position: i.position
  23174. }))
  23175. : F.warn('There are no', t ? 'inside' : '360º', 'views in this model'))
  23176. }),
  23177. (n.prototype.updateLastView = function () {
  23178. if (this.mode === u.PANORAMA) {
  23179. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View
  23180. e.update({
  23181. pano: this.currentPano,
  23182. position: this.position,
  23183. quaternion: this.quaternion
  23184. })
  23185. }
  23186. }),
  23187. (n.prototype.goToLastView = function (e, t) {
  23188. var i = $.Deferred(),
  23189. n = i.resolve.bind(i),
  23190. r = i.reject.bind(i),
  23191. o = e ? this.lastInsideView : this.last360View
  23192. return (
  23193. this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  23194. this.isInMode(u.PANORAMA)
  23195. ? (this.path && this.path.popOutCpm(), this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r))
  23196. : this.isOutsideMode() &&
  23197. this.flyToNewMode({
  23198. mode: o.cameraMode,
  23199. pano: o.pano,
  23200. quaternion: o.quaternion,
  23201. callback: t
  23202. })
  23203. .done(n)
  23204. .fail(r),
  23205. i.promise()
  23206. )
  23207. }),
  23208. (n.prototype.fadeToView = function (e, t, i, n) {
  23209. var r = $.Deferred(),
  23210. o = r.resolve.bind(r),
  23211. a = r.reject.bind(r)
  23212. if (!t.isValid() || (t.cameraMode === u.PANORAMA && !t.pano)) return F.warn('Tried to fade to an illegal view', t.cameraMode), a('Cannot go to illegal view'), r.promise()
  23213. var s =
  23214. (f[t.cameraMode],
  23215. function () {
  23216. $(this.domElement).fadeIn(0.5 * i), n && n(), o()
  23217. }.bind(this)),
  23218. l = e ? S.FADEIN : S.END
  23219. return (
  23220. this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  23221. $(this.domElement).fadeOut(
  23222. 0.5 * i,
  23223. function () {
  23224. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  23225. t.cameraMode === u.PANORAMA
  23226. ? this.flyToPano(
  23227. {
  23228. pano: t.pano,
  23229. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  23230. duration: 0
  23231. },
  23232. s
  23233. )
  23234. : this.flyToNewMode({
  23235. mode: t.cameraMode,
  23236. quaternion: t.quaternion,
  23237. duration: 0,
  23238. callback: s
  23239. })
  23240. }.bind(this)
  23241. ),
  23242. r.promise()
  23243. )
  23244. }),
  23245. (n.prototype.startWarp = function (e, t, i, n, r, o) {
  23246. if ((this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1), this.flying)) return F.warn('Player.startWarp() -> Cannot warp when flying'), o && o(), !1
  23247. ;(null !== e && void 0 !== e) || (e = b.Show), this.history.invalidate()
  23248. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : (i = this.path.upcomingTransType)
  23249. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned()
  23250. return (
  23251. this.emit(w.WarpStarted, a, i, n, r),
  23252. (n = n || S.MIDDLE),
  23253. this.path.warpToPano(
  23254. i,
  23255. n,
  23256. r,
  23257. function () {
  23258. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  23259. this.emit(w.WarpEnded, i),
  23260. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  23261. o && o()
  23262. }.bind(this)
  23263. ),
  23264. e === b.Hide && this.path.discardPathObject(),
  23265. !0
  23266. )
  23267. }),
  23268. (n.prototype.warpToPanoById = function (e, t, i, n, r, o, a, s) {
  23269. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn('Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()'), s && s(), !1)
  23270. }),
  23271. (n.prototype.warpToPanoByHeroIndex = function (e, t, i, n, r, o, a) {
  23272. return this.path.setWarpDestinationByHeroIndex(e)
  23273. ? this.startWarp(t, i, n, r, o, a)
  23274. : (F.warn('Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'), a && a(), !1)
  23275. }),
  23276. (n.prototype.warpToPano = function (e, t, i, n, r, o, a, s) {
  23277. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  23278. }),
  23279. (n.prototype.warpToNonPanoByHeroIndex = function (e, t) {
  23280. return this.path.setWarpDestinationByHeroIndex(e)
  23281. ? (this.path.warpToNonPano(t), !0)
  23282. : (F.warn('Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()'), t && t(), !1)
  23283. }),
  23284. (n.prototype.aimTourCamera = function (e, t, i, n) {
  23285. return F.debug('player.aimTourCamera(' + e + ') calling warpToPanoByHeroIndex(' + e + ')'), this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  23286. }),
  23287. (n.prototype.showPathToHeroLocation = function (e) {
  23288. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  23289. }),
  23290. (n.prototype.tourInterlude = function (e, t) {
  23291. this.history.invalidate()
  23292. this.path.discardSlow()
  23293. //xzw:
  23294. var defaultRotTime = DATA.tourRotTime * 1000
  23295. var timeEachItem = (2e3 / (DATA.tourWalkSpeed + DATA.tourBlackSpeed)) * 200 //预估时间假设每个item飞的时间(如果距离远就少了)
  23296. var currentLocation = this.model.getHeroDescriptorByIndex(this.director.currentItem)
  23297. var currentLocation0 = this.model.heroLocations[this.director.currentItem[0]]
  23298. //zeg 标注一下
  23299. //var currentLocation = this.model.heroLocations[this.director.currentItem[0]]
  23300. var rotTime
  23301. if (currentLocation.rotTime == void 0 || currentLocation.rotTime == '') {
  23302. var restChildCount = currentLocation0.heroLocations ? currentLocation0.heroLocations.length - this.director.currentItem[1] - 1 : 0
  23303. var hasMusic = currentLocation0 && currentLocation0.musicInfo.music
  23304. if (hasMusic) {
  23305. var audioObj = SoundManager.list.find(e => e.name == 'tour')
  23306. var current = audioObj.audio.currentTime * 1e3 // || 0 //g_tourAudio ? 1e3 * g_tourAudio.currentTime : 0
  23307. rotTime = currentLocation0.musicInfo.time - current
  23308. if (restChildCount) {
  23309. //如果当前folder中还有剩下的item,平分一下时间
  23310. rotTime = (rotTime - timeEachItem * restChildCount) / (restChildCount + 1)
  23311. }
  23312. } else {
  23313. rotTime = defaultRotTime
  23314. }
  23315. rotTime = Math.max(0, rotTime)
  23316. Log('rotTime ' + rotTime + ' at item ' + this.director.currentItem + (hasMusic ? ',musicCurrentTime:' + current + '音乐总长:' + currentLocation0.musicInfo.time : ''), '#E8E')
  23317. } else {
  23318. rotTime = currentLocation.rotTime * 1000
  23319. Log('rotTime ' + rotTime + ' at item ' + this.director.currentItem, '#E8E')
  23320. }
  23321. this.path.waitNextStep(
  23322. e,
  23323. function () {
  23324. t && t()
  23325. }.bind(this),
  23326. rotTime
  23327. )
  23328. }),
  23329. (n.prototype.stopInterlude = function () {
  23330. this.interruptAndFastForward(null, 0)
  23331. }),
  23332. (n.prototype.interruptAndFastForward = function (e, t) {
  23333. //Log('interruptAndFastForward' , '#f00')
  23334. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t), this.flying && this.emit(w.FlyingInterrupted), this.path.interruptAndFastForward(e, t)
  23335. }),
  23336. (n.prototype.setSize = function (e, t) {
  23337. var i = e / t
  23338. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t)
  23339. var n = B.getHFOVFromVFOV(f.insideFOV, e, t)
  23340. n > f.insideFOVMax ? (this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t)) : (this.baseFov = f.insideFOV)
  23341. for (var r in this.cameraControls.cameras) {
  23342. var o = this.cameraControls.cameras[r]
  23343. ;(o.fov = this.baseFov * (1 / this.zoomLevel)), o.updateAspect(i)
  23344. }
  23345. }),
  23346. (n.prototype.toJSON = function () {
  23347. var e = {}
  23348. return this.cameraControls.activeControl
  23349. ? ((e = this.cameraControls.activeControl.toJSON()),
  23350. (e.camera_mode = u.toInt(this.mode)),
  23351. this.isOutsideMode()
  23352. ? this.model.allFloorsVisible
  23353. ? (e.floor_visibility = [])
  23354. : (e.floor_visibility = this.model.floors.list.map(function (e) {
  23355. return e.hidden ? 0 : 1
  23356. }))
  23357. : u.PANORAMA && (e.scan_id = this.currentPano.id),
  23358. e)
  23359. : e
  23360. }),
  23361. (n.prototype.getCurrentNodePanos = function (e) {
  23362. this.model.panos.map
  23363. if (((e.length = 0), this.path.nodes)) {
  23364. var momentTour = this.director.getMomentTour(this.director.destinationItem)
  23365. if (momentTour == 'black') {
  23366. //改 upcomingPanos如果是black的只需要起点和终点
  23367. if (this.path.nodes.length) {
  23368. e.push(this.model.panos.get(this.path.nodes[0]))
  23369. }
  23370. if (this.path.nodes.length > 1) {
  23371. e.push(this.model.panos.get(this.path.nodes[this.path.nodes.length - 1]))
  23372. }
  23373. } else {
  23374. for (var t = 0; t < this.path.nodes.length; t++) {
  23375. var i = this.path.nodes[t]
  23376. e.push(this.model.panos.get(i))
  23377. }
  23378. }
  23379. }
  23380. }),
  23381. (n.prototype.zoomIncrementally = function (e) {
  23382. var t = this.zoomLevel
  23383. this.zoomTo(this.zoomLevel + e), t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  23384. }),
  23385. (n.prototype.zoomInIncrementally = function (e) {
  23386. ;(e = e || this.defaultZoomIncrement), this.zoomIncrementally(e)
  23387. }),
  23388. (n.prototype.zoomOutIncrementally = function (e) {
  23389. ;(e = e || -this.defaultZoomIncrement), this.zoomIncrementally(e)
  23390. }),
  23391. (n.prototype.zoomBy = function (e) {
  23392. this.zoomTo(this.zoomLevel * e)
  23393. }),
  23394. (n.prototype.zoomIn = function () {
  23395. this.zoomBy(1 + this.zoomSpeed)
  23396. }),
  23397. (n.prototype.zoomOut = function () {
  23398. this.zoomBy(1 - this.zoomSpeed)
  23399. }),
  23400. (n.prototype.zoomTo = function (e, t) {
  23401. if (t || (f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled)) {
  23402. if (
  23403. (e < f.zoom.min && (e = f.zoom.min),
  23404. e > f.zoom.max && (e = f.zoom.max),
  23405. e > this.zoomLevel ? (this.emit(O.ZoomIn), e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut), e === f.zoom.min && this.emit(O.ZoomMin)),
  23406. this.cameraControls.activeControl)
  23407. ) {
  23408. var i = this.cameraControls.activeControl.camera
  23409. ;(this.zoomLevel = e), (i.fov = this.baseFov * (1 / this.zoomLevel)), i.updateProjectionMatrix(), (this.zoomFov = i.fov)
  23410. }
  23411. }
  23412. }),
  23413. (n.prototype.increaseZoomSpeed = function () {
  23414. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  23415. }),
  23416. (n.prototype.decreaseZoomSpeed = function () {
  23417. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  23418. }),
  23419. (n.prototype.clampZoomSpeed = function (e) {
  23420. return e < 0 ? 0 : e
  23421. }),
  23422. (n.prototype.activatePersistentZooming = function (e) {
  23423. this.zooming = e ? 1 : -1
  23424. }),
  23425. (n.prototype.deactivatePersistentZooming = function () {
  23426. this.zooming = 0
  23427. }),
  23428. (n.prototype.zoomDefault = function () {
  23429. this.zoomTo(1, !0)
  23430. }),
  23431. (window.fovTranId = 333) //add
  23432. n.prototype.smoothZoomToDefault = function (e, t) {
  23433. y.cancelById(window.fovTranId)
  23434. var i,
  23435. n = this.zoomLevel,
  23436. r = function (e) {
  23437. e > 1 && (e = 1), (i = n * (1 - e) + e), this.zoomTo(i, !0)
  23438. }.bind(this),
  23439. o = function () {
  23440. this.zoomDefault(), t && window.setTimeout(t, 50)
  23441. }.bind(this)
  23442. y.start(r, e, o, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23443. }
  23444. n.prototype.smoothZoomFovTo = function (fov, zoomLevel, dur, callback) {
  23445. //add
  23446. y.cancelById(window.fovTranId)
  23447. console.log('smoothZoomFovTo ' + zoomLevel)
  23448. var i,
  23449. n = this.zoomLevel,
  23450. aimLevel = zoomLevel || this.baseFov / fov
  23451. if (n == aimLevel) return
  23452. var fun = function (e) {
  23453. e > 1 && (e = 1), (i = n * (1 - e) + e * aimLevel), this.zoomTo(i, !0)
  23454. }.bind(this)
  23455. y.start(fun, dur, callback, null, 0, A[f.transition.blendEasing], null, window.fovTranId)
  23456. }
  23457. n.prototype.updateZoomPano = function () {
  23458. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA && this.currentPano) {
  23459. let navTileClass = this.qualityManager.getNavZoomClass()
  23460. let tileClass = this.qualityManager.getMaxZoomClass()
  23461. if (navTileClass == '4k') {
  23462. var r = true
  23463. } else {
  23464. var levelThreshold1 = navTileClass == '1k' ? 1.1 : 1.5,
  23465. levelThreshold2 = 1.8 //levelThreshold2不能比zoom.max大也就是不能超过2,否则zoom.max将无法提升到3
  23466. var t = this.zoomLevel > levelThreshold1,
  23467. i = this.flying && this.nextPano && this.nextPano !== this.currentPano,
  23468. n = !i && !this.isWarping(),
  23469. r = t //&& n ; // 允许flying状态下加载4K图
  23470. }
  23471. this.tileDownloader.tilePrioritizer.setZoomingActive(r), this.panoRenderer.setZoomingActive(r, this.currentPano, !0)
  23472. var o = function (pano, ifZoom) {
  23473. this.panoRenderer.resetRenderStatus(pano.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  23474. this.panoRenderer.clearAllQueuedUploadsForPano(pano.id),
  23475. this.panoRenderer.renderPanoTiles(pano.id, null, !1, !1),
  23476. pano.setZoomed(ifZoom)
  23477. }.bind(this)
  23478. if (navTileClass == '4k') {
  23479. if (!this.currentPano.zoomed) {
  23480. o(this.currentPano, !0)
  23481. this.panoRenderer.enableUltraHighQualityMode(
  23482. function () {
  23483. //开启4k getMaxZoomPanoSize
  23484. this.qualityManager.useUltraHighResolutionPanos && (f.zoom.max = D.ultraHighQualityMaxZoom)
  23485. o(this.currentPano, !0)
  23486. }.bind(this)
  23487. )
  23488. }
  23489. } else {
  23490. let zoomLevelRes = this.qualityManager.zoomLevelResolution
  23491. if (r && (!this.currentPano.zoomed || (zoomLevelRes && zoomLevelRes != '4k'))) {
  23492. //needZoom
  23493. this.currentPano.zoomed || o(this.currentPano, !0)
  23494. if (navTileClass == '1k' && tileClass != '1k' && this.zoomLevel < levelThreshold2) {
  23495. this.panoRenderer.enableHighQuality(
  23496. function () {
  23497. //开启2k
  23498. if (tileClass != '4k') {
  23499. o(this.currentPano, !0)
  23500. }
  23501. }.bind(this)
  23502. )
  23503. } else {
  23504. this.panoRenderer.enableUltraHighQualityMode(
  23505. function () {
  23506. //开启4k getMaxZoomPanoSize
  23507. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom)
  23508. o(this.currentPano, !0)
  23509. }.bind(this)
  23510. )
  23511. }
  23512. } else {
  23513. !t && this.currentPano.zoomed && o(this.currentPano, !1)
  23514. }
  23515. //有三个级别的话,需要标记zoomLevelResolution,以便更新maxZoomPanoSize判断能下载的最高级别
  23516. if (r && navTileClass == '1k' && tileClass == '4k') {
  23517. //目前只有手机端navTileClass == '1k'
  23518. var change = zoomedFlag => {
  23519. this.qualityManager.updateMaximums() //更新maxZoomPanoSize
  23520. this.panoRenderer.setupZoomRenderTarget() //更新renderTarget
  23521. //this.currentPano.setZoomed(t);//更新uniforms贴图
  23522. if (this.qualityManager.zoomLevelResolution == '4k') {
  23523. this.model.showHighMap()
  23524. } else {
  23525. this.model.hideHighMap()
  23526. }
  23527. }
  23528. this.qualityManager.zoomLevelResolution = this.zoomLevel >= levelThreshold2 ? '4k' : this.zoomLevel > levelThreshold1 ? '2k' : '1k'
  23529. if (this.oldZoomLevel < levelThreshold2 && this.zoomLevel >= levelThreshold2) {
  23530. //1k/2k-4k
  23531. change()
  23532. o(this.currentPano, t)
  23533. } else if (this.oldZoomLevel <= levelThreshold1 && this.zoomLevel > levelThreshold1) {
  23534. //1k-2k
  23535. change()
  23536. } else if (this.oldZoomLevel > levelThreshold2 && this.zoomLevel <= levelThreshold2) {
  23537. //4k-2k/1k
  23538. change()
  23539. o(this.currentPano, t)
  23540. } else if (this.oldZoomLevel > levelThreshold1 && this.zoomLevel <= levelThreshold1) {
  23541. //2k-1k
  23542. change()
  23543. }
  23544. this.oldZoomLevel = this.zoomLevel
  23545. }
  23546. }
  23547. }
  23548. }
  23549. ;(n.prototype.checkHasNeighbor = function (pano) {
  23550. //add
  23551. for (var i in pano.neighbourPanos) {
  23552. if (i == pano.id) continue
  23553. if (pano.neighbourPanos[i]) {
  23554. return true
  23555. }
  23556. }
  23557. }),
  23558. (t.exports = n)
  23559. }).call(this, '/js/player.js')
  23560. },
  23561. {
  23562. './constants': 8,
  23563. './enum/AlignmentType': 17,
  23564. './enum/BlackoutStyle': 18,
  23565. './enum/ControlEvents': 21,
  23566. './enum/Keys': 30,
  23567. './enum/ModelManagerEvents': 33,
  23568. './enum/PanoSizeClass': 36,
  23569. './enum/PanoramaEvents': 37,
  23570. './enum/PathDiscardMode': 38,
  23571. './enum/PathDisplayMode': 39,
  23572. './enum/PlayerEvents': 40,
  23573. './enum/TagStates': 44,
  23574. './enum/Vectors': 50,
  23575. './enum/Viewmode': 51,
  23576. './enum/WarpStyle': 52,
  23577. './enum/ZoomEvents': 53,
  23578. './exception/BasicException': 55,
  23579. './model/ModelManager': 140,
  23580. './objects/NSpider': 147,
  23581. './objects/Panorama': 148,
  23582. './objects/Reticule': 149,
  23583. './objects/ShowPath': 151,
  23584. './objects/Snapshot': 153,
  23585. './objects/View': 154,
  23586. './settings': 166,
  23587. './shaders': 167,
  23588. './tile/TileDownloader': 171,
  23589. './tile/TilePrioritizer': 172,
  23590. './util/ZoomStats': 179,
  23591. './util/browser': 182,
  23592. './util/camera': 183,
  23593. './util/cameraLight': 184,
  23594. './util/common': 185,
  23595. './util/easing': 186,
  23596. './util/history': 187,
  23597. './util/lerp': 188,
  23598. './util/logger': 189,
  23599. './util/math': 190,
  23600. './util/transitions': 195,
  23601. hot: 'hot',
  23602. scaleImg: 'scaleImg',
  23603. events: 202,
  23604. three: 217
  23605. }
  23606. ],
  23607. scaleImg: [
  23608. function (t, e) {
  23609. // xzw
  23610. var OUTPUT = e
  23611. ;(function () {
  23612. function t(t, a, i, r) {
  23613. function h() {
  23614. ;(B = 'object' == typeof i ? i : a.src || r ? u : document.createElement('canvas')), (B.width = s), (B.height = f), (G = B.getContext('2d'))
  23615. }
  23616. function n(t) {
  23617. if (t) {
  23618. var e,
  23619. a = G.getImageData(0, 0, s, f),
  23620. i = a.data
  23621. for (e = 0; at > e; e += 4) (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)
  23622. return delete t, a
  23623. }
  23624. return G.getImageData(0, 0, s, f)
  23625. }
  23626. function o(t, e, a, i, r) {
  23627. return 0.5 * (i - e + (2 * e - 5 * a + 4 * i - r + (3 * (a - i) + r - e) * t) * t) * t + a
  23628. }
  23629. a || ((a = t.input), (i = t.output), (r = t.inputRemovable), t.scale && (t = t.scale))
  23630. var u, d
  23631. if (a.src)
  23632. if (((u = document.createElement('canvas')), null != a.naturalWidth)) (u.width = a.naturalWidth), (u.height = a.naturalHeight)
  23633. else if (null != a.runtimeStyle) {
  23634. var l = a.runtimeStyle,
  23635. c = l.width,
  23636. g = l.height
  23637. ;(l.width = 'auto'), (l.height = 'auto'), (u.width = a.width), (u.height = a.height), (l.width = c), (l.height = g)
  23638. } else {
  23639. var c = a.width,
  23640. g = a.height
  23641. a.removeAttribute && (a.removeAttribute('width'), a.removeAttribute('height')), (u.width = a.width), (u.height = a.height), (a.width = c), (a.height = g)
  23642. }
  23643. else u = a
  23644. ;(d = u.getContext('2d')), a.src && d.drawImage(a, 0, 0)
  23645. var s,
  23646. f,
  23647. m = u.width,
  23648. w = u.height,
  23649. p = d.getImageData(0, 0, m, w).data
  23650. if (!m || !w) return !1
  23651. ;(a.src || r) && u.clearRect(0, 0, m, w),
  23652. 'object' == typeof t
  23653. ? t.width
  23654. ? ((s = (t.width + 0.5) | 0), (f = (t.height + 0.5) | 0))
  23655. : ((s = (m * t.scaleX + 0.5) | 0), (f = (w * t.scaleY + 0.5) | 0))
  23656. : ((s = (t * m + 0.5) | 0), (f = (t * w + 0.5) | 0))
  23657. var v,
  23658. b,
  23659. y,
  23660. x,
  23661. D,
  23662. I,
  23663. A,
  23664. j,
  23665. R,
  23666. k,
  23667. C,
  23668. E,
  23669. F,
  23670. L,
  23671. S,
  23672. U,
  23673. W,
  23674. H,
  23675. alpha,
  23676. X,
  23677. Y,
  23678. q,
  23679. z,
  23680. B,
  23681. G,
  23682. J,
  23683. K,
  23684. M,
  23685. N,
  23686. O,
  23687. P,
  23688. Q,
  23689. T,
  23690. V,
  23691. Z,
  23692. $ = s << 2,
  23693. _ = m << 2,
  23694. tt = 0,
  23695. et = 0,
  23696. at = $ * f,
  23697. it = 255.99 / 255,
  23698. rt = s / m,
  23699. ht = f / w,
  23700. nt = rt * ht
  23701. if (rt > 1 || ht > 1)
  23702. for (h(), J = n(), K = J.data, x = 0; f > x; x++)
  23703. 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)
  23704. (v = y / rt),
  23705. (j = 0 | v),
  23706. (z = v - j),
  23707. (T = j << 2),
  23708. (Q = 1 > j ? T : T - 4),
  23709. m - 2 > j ? ((V = T + 4), (Z = T + 8)) : (V = Z = j > m - 2 ? T : T + 4),
  23710. (H =
  23711. (o(
  23712. q,
  23713. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  23714. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  23715. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  23716. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  23717. ) *
  23718. it) |
  23719. 0),
  23720. ++Q,
  23721. ++T,
  23722. ++V,
  23723. ++Z,
  23724. (X =
  23725. (o(
  23726. q,
  23727. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  23728. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  23729. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  23730. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  23731. ) *
  23732. it) |
  23733. 0),
  23734. ++Q,
  23735. ++T,
  23736. ++V,
  23737. ++Z,
  23738. (Y =
  23739. (o(
  23740. q,
  23741. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  23742. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  23743. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  23744. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  23745. ) *
  23746. it) |
  23747. 0),
  23748. ++Q,
  23749. ++T,
  23750. ++V,
  23751. ++Z,
  23752. (alpha =
  23753. (o(
  23754. q,
  23755. o(z, p[M + Q], p[M + T], p[M + V], p[M + Z]),
  23756. o(z, p[N + Q], p[N + T], p[N + V], p[N + Z]),
  23757. o(z, p[O + Q], p[O + T], p[O + V], p[O + Z]),
  23758. o(z, p[P + Q], p[P + T], p[P + V], p[P + Z])
  23759. ) *
  23760. it) |
  23761. 0),
  23762. (K[et] = H >= 0 ? (256 > H ? H : 255) : 0),
  23763. (K[et + 1] = X >= 0 ? (256 > X ? X : 255) : 0),
  23764. (K[et + 2] = Y >= 0 ? (256 > Y ? Y : 255) : 0),
  23765. (K[et + 3] = alpha >= 0 ? (256 > alpha ? alpha : 255) : 0)
  23766. else {
  23767. if (e.Float32Array) W = new Float32Array(at)
  23768. else for (W = [], et = 0; at > et; ++et) W[et] = 0
  23769. for (b = 0; w > b; b++)
  23770. 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)
  23771. switch (
  23772. ((y = v * rt),
  23773. (I = 0 | y),
  23774. (et = D + (I << 2)),
  23775. (S = !!((I - ((y + rt) | 0)) * (m - 1 - v))),
  23776. S && ((C = I + 1 - y), (E = y + rt - I - 1)),
  23777. (H = p[tt]),
  23778. (X = p[tt + 1]),
  23779. (Y = p[tt + 2]),
  23780. (alpha = p[tt + 3]),
  23781. S + U)
  23782. ) {
  23783. case 0:
  23784. ;(W[et] += H * nt), (W[et + 1] += X * nt), (W[et + 2] += Y * nt), (W[et + 3] += alpha * nt)
  23785. break
  23786. case 1:
  23787. ;(k = C * ht),
  23788. (W[et] += H * k),
  23789. (W[et + 1] += X * k),
  23790. (W[et + 2] += Y * k),
  23791. (W[et + 3] += alpha * k),
  23792. (k = E * ht),
  23793. (W[et + 4] += H * k),
  23794. (W[et + 5] += X * k),
  23795. (W[et + 6] += Y * k),
  23796. (W[et + 7] += alpha * k)
  23797. break
  23798. case 2:
  23799. ;(k = rt * F),
  23800. (W[et] += H * k),
  23801. (W[et + 1] += X * k),
  23802. (W[et + 2] += Y * k),
  23803. (W[et + 3] += alpha * k),
  23804. (k = rt * L),
  23805. (et += $),
  23806. (W[et] += H * k),
  23807. (W[et + 1] += X * k),
  23808. (W[et + 2] += Y * k),
  23809. (W[et + 3] += alpha * k)
  23810. break
  23811. default:
  23812. ;(k = C * F),
  23813. (W[et] += H * k),
  23814. (W[et + 1] += X * k),
  23815. (W[et + 2] += Y * k),
  23816. (W[et + 3] += alpha * k),
  23817. (k = E * F),
  23818. (W[et + 4] += H * k),
  23819. (W[et + 5] += X * k),
  23820. (W[et + 6] += Y * k),
  23821. (W[et + 7] += alpha * k),
  23822. (k = C * L),
  23823. (et += $),
  23824. (W[et] += H * k),
  23825. (W[et + 1] += X * k),
  23826. (W[et + 2] += Y * k),
  23827. (W[et + 3] += alpha * k),
  23828. (k = E * L),
  23829. (W[et + 4] += H * k),
  23830. (W[et + 5] += X * k),
  23831. (W[et + 6] += Y * k),
  23832. (W[et + 7] += alpha * k)
  23833. }
  23834. delete p, h(), (J = n(W))
  23835. }
  23836. if ((G.putImageData(J, 0, 0), 'string' == typeof i)) {
  23837. if ('png' === i || 'jpeg' === i) {
  23838. var ot
  23839. return (ot = r && a.src ? a : new Image()), (ot.width = s), (ot.height = f), (ot.src = B.toDataURL('image/' + i, 0.85)), ot
  23840. }
  23841. if ('png-src' === i || 'jpeg-src' === i) return B.toDataURL('image/' + i.split('-')[0], 0.85)
  23842. }
  23843. return B
  23844. }
  23845. var e = this
  23846. 'undefined' != typeof exports ? ('undefined' != typeof module && module.exports && (exports = module.exports = t), (exports.scale = t)) : (c = t)
  23847. }).call(this)
  23848. OUTPUT.exports = c
  23849. },
  23850. {}
  23851. ],
  23852. 156: [
  23853. function (e, t, i) {
  23854. ;(function (i) {
  23855. 'use strict'
  23856. function n(e, t) {
  23857. ;(this.model = e), (this.panos = e.panos), (this.player = t), (this.imagePanos = this.listImagePanos()), (this.retryMinimumTime = 1e4)
  23858. }
  23859. var r = (e('three'), e('./enum/Viewmode')),
  23860. o = (e('./settings'), e('./objects/Panorama')),
  23861. a = e('./util/logger'),
  23862. s = new a(i)
  23863. ;(n.prototype.start = function () {
  23864. this.loadNextPano(
  23865. function (e) {
  23866. e
  23867. ? this.start()
  23868. : (s.debug('No suitable pano loaded, waiting a little while before looking again'),
  23869. setTimeout(
  23870. function () {
  23871. this.start()
  23872. }.bind(this),
  23873. 1e3
  23874. ))
  23875. }.bind(this)
  23876. )
  23877. }),
  23878. (n.prototype.validLoadTarget = function (e) {
  23879. return e && !e.isLoaded('high') && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  23880. }),
  23881. (n.prototype.listImagePanos = function () {
  23882. var e = [],
  23883. t = this
  23884. return (
  23885. this.model.images.forEach(function (i) {
  23886. if (i.metadata && i.metadata.scan_id) {
  23887. var n = t.model.panos.get(i.metadata.scan_id)
  23888. n && !n.isLoaded('high') && e.push(n)
  23889. }
  23890. }),
  23891. e
  23892. )
  23893. }),
  23894. (n.prototype.nextNotLoadedImage = function () {
  23895. for (; this.imagePanos.length > 0; ) {
  23896. var e = this.imagePanos[0]
  23897. if (!e.isLoaded('high')) return e
  23898. this.imagePanos.shift()
  23899. }
  23900. return null
  23901. }),
  23902. (n.prototype.loadNextPano = function (e) {
  23903. var t,
  23904. i,
  23905. n = this.model.waitQueue.filter(function (e) {
  23906. return e.object instanceof o
  23907. })
  23908. n.length > 0
  23909. ? ((t = n[0].object), s.debug('Overrode pano selection: Flying to an unloaded pano ' + t.id))
  23910. : this.validLoadTarget(this.player.currentPano)
  23911. ? ((t = this.player.currentPano), s.debug('Overrode pano selection: Currently at an unloaded pano ' + t.id))
  23912. : this.validLoadTarget(this.player.closestPano)
  23913. ? ((t = this.player.closestPano), s.debug('Overrode pano selection: Hovering over an unloaded pano ' + t.id))
  23914. : this.validLoadTarget(this.nextNotLoadedImage())
  23915. ? ((i = 'high'), (t = this.imagePanos[0]), s.debug('Overrode pano selection: Highlight image ' + t.id))
  23916. : this.player.mode === r.PANORAMA &&
  23917. ((t = this.panos.lowestByScore(
  23918. [this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)],
  23919. [
  23920. o.scoreFunctions.distance(this.player.currentPano),
  23921. o.scoreFunctions.direction(this.player.position, this.player.getDirection()),
  23922. o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())
  23923. ]
  23924. )),
  23925. t && s.debug('Normal pano selection: neighbor ' + t.id)),
  23926. t
  23927. ? ((i = i || t.isLoaded('low') ? 'high' : 'low'),
  23928. s.debug('Preloading ' + i + '-res pano ' + t.id),
  23929. t
  23930. .loadCube(i)
  23931. .done(e)
  23932. .fail(function () {
  23933. s.warn('Failed preloading pano', t.id, ', marking it as failed and forgetting it for a while'), e()
  23934. }))
  23935. : e && e(null)
  23936. }),
  23937. (t.exports = n)
  23938. }).call(this, '/js/preloaders.js')
  23939. },
  23940. {
  23941. './enum/Viewmode': 51,
  23942. './objects/Panorama': 148,
  23943. './settings': 166,
  23944. './util/logger': 189,
  23945. three: 217
  23946. }
  23947. ],
  23948. 157: [
  23949. function (e, t, i) {
  23950. ;(function (i) {
  23951. 'use strict'
  23952. function n(e, t, i, n, r) {
  23953. ;(this.qualityManager = e),
  23954. (this.scene = t),
  23955. (this.camera = i),
  23956. (this.container = r),
  23957. (this.controls = n),
  23958. (this.controls.enabled = !0),
  23959. (this.controls.locked = !0),
  23960. (this.quickstartCamera = n.camera),
  23961. (this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $('#player').width(), $('#player').height())),
  23962. (this.skybox = null)
  23963. }
  23964. var r = e('three'),
  23965. o = e('../util/logger'),
  23966. a = e('../constants'),
  23967. s = (e('../util/transitions'), e('../util/lerp'), e('../util/easing'), e('../enum/Vectors')),
  23968. l = e('../enum/PanoSizeClass'),
  23969. c = (e('../materials/ModelTextureMaterial'), e('../materials/CubemapMaterial')),
  23970. h = (e('../cameras/PanoramaCamera'), e('../controls/PanoramaControls'), e('../tile/TileUtils'), e('../util/camera'), e('../util/cameraLight')),
  23971. u = (e('../util/browser'), e('../settings'), e('../gui/helpManager'), new o(i))
  23972. ;(n.prototype.load = function (e) {
  23973. e.pano.shouldRedrawOnBaseLoaded = !0
  23974. var t,
  23975. i,
  23976. n = this,
  23977. r = s.FORWARD.clone().applyQuaternion(e.quaternion),
  23978. o = r.clone().negate()
  23979. this.controls.lookAt(r.add(this.quickstartCamera.position))
  23980. var a = this.qualityManager.getPanoSize(l.BASE),
  23981. c = this.qualityManager.getPanoSize(l.STANDARD)
  23982. if (e.pano.tiled) {
  23983. u.warn('Loading startPano, TILED', e.pano.id)
  23984. var d = h.getHFOVForCamera(this.quickstartCamera, $('#player').width(), $('#player').height()),
  23985. p = this.quickstartCamera.fov
  23986. u.warn('Quickstart loading tiles in frustum: [horizontal FOV: ' + d + ', vertical FOV: ' + p + ']'),
  23987. (t = e.pano.loadTiledPano(
  23988. c,
  23989. r,
  23990. {
  23991. hFov: d,
  23992. vFov: p
  23993. },
  23994. !1,
  23995. !1,
  23996. !0
  23997. )),
  23998. (i = e.pano.loadTiledPano(a, o, null, !1, !1, !0))
  23999. } else u.warn('Loading startPano', e.pano.id), (t = e.pano.loadCube('high'))
  24000. return $.when(t).then(
  24001. function () {
  24002. n.init(e.pano, e.quaternion),
  24003. e.pano.tiled
  24004. ? i.done(
  24005. function () {
  24006. ;(e.pano.lockUntilRenderingComplete = !1), (this.controls.locked = !1)
  24007. }.bind(this)
  24008. )
  24009. : (this.controls.locked = !1)
  24010. }.bind(this)
  24011. )
  24012. }),
  24013. (n.prototype.init = function (e, t) {
  24014. u.info('Quickstart done loading, adding scene objects'),
  24015. (e.lockUntilRenderingComplete = !0),
  24016. (this.skybox = new r.Mesh(
  24017. new r.CubeGeometry(1, 1, 1),
  24018. new c({
  24019. side: r.BackSide
  24020. })
  24021. )),
  24022. (this.skybox.material.uniforms.map.value = e.getSkyboxTexture()),
  24023. this.skybox.quaternion.copy(e.quaternion),
  24024. this.scene.add(this.skybox),
  24025. $(this.container).show()
  24026. }),
  24027. (n.prototype.update = function (e) {
  24028. this.controls.update(e), this.camera.copy(this.quickstartCamera)
  24029. }),
  24030. (n.prototype.setSize = function (e, t) {
  24031. this.quickstartCamera.updateAspect(e / t)
  24032. }),
  24033. (n.prototype.destroy = function () {
  24034. this.scene.remove(this.skybox)
  24035. }),
  24036. (t.exports = n)
  24037. }).call(this, '/js/scene/QuickstartManager.js')
  24038. },
  24039. {
  24040. '../cameras/PanoramaCamera': 7,
  24041. '../constants': 8,
  24042. '../controls/PanoramaControls': 13,
  24043. '../enum/PanoSizeClass': 36,
  24044. '../enum/Vectors': 50,
  24045. '../gui/helpManager': 68,
  24046. '../materials/CubemapMaterial': 117,
  24047. '../materials/ModelTextureMaterial': 118,
  24048. '../settings': 166,
  24049. '../tile/TileUtils': 174,
  24050. '../util/browser': 182,
  24051. '../util/camera': 183,
  24052. '../util/cameraLight': 184,
  24053. '../util/easing': 186,
  24054. '../util/lerp': 188,
  24055. '../util/logger': 189,
  24056. '../util/transitions': 195,
  24057. three: 217
  24058. }
  24059. ],
  24060. 158: [
  24061. function (e, t, i) {
  24062. 'use strict'
  24063. function n(e, t, i) {
  24064. ;(this.scene = e),
  24065. (this.camera = t),
  24066. (this.renderer = null),
  24067. (this.effects = i),
  24068. (this.animateCallback = null),
  24069. (this.composer = null),
  24070. (this.qualityManager = null),
  24071. (e.renderWidth = 0),
  24072. (e.renderHeight = 0),
  24073. (this.updateClock = new r.Clock()),
  24074. (this.components = []),
  24075. (this.updateListeners = []),
  24076. (this.resizeListeners = []),
  24077. (this.forceUpdateSize = !1),
  24078. (this.started = !1),
  24079. (this.textures = {}),
  24080. (this.suspendedObjects = [])
  24081. }
  24082. var r = e('three'),
  24083. o = e('../shaders'),
  24084. a = e('../enum/SceneRendererEvents'),
  24085. s = e('../enum/GLTextureType'),
  24086. l = e('../enum/GLCubeFaces'),
  24087. c = e('../exception/BasicException'),
  24088. h = e('../exception/RendererCreationException'),
  24089. /**********************************************************************fyz改 from徐世廷**********************************************************************/
  24090. m = e('../util/browser'),
  24091. /**************************************************************************************************************************************************/
  24092. u = e('../settings'),
  24093. d = e('events').EventEmitter
  24094. ;(window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame),
  24095. (n.prototype = Object.create(d.prototype)),
  24096. (n.prototype.addComponent = function (e) {
  24097. this.components.push(e), e.update && this.updateListeners.push(e), e.setSize && (this.resizeListeners.push(e), (this.forceUpdateSize = !0))
  24098. }),
  24099. (n.prototype.removeComponent = function (e) {
  24100. var t = function (t) {
  24101. return t !== e
  24102. }
  24103. ;(this.components = this.components.filter(t)), (this.updateListeners = this.updateListeners.filter(t)), (this.resizeListeners = this.resizeListeners.filter(t))
  24104. }),
  24105. (n.prototype.start = function (e) {
  24106. if (this.started) throw new c("Can't start SceneRenderer, already started")
  24107. this.createContext(e),
  24108. /***************************************************VR fyz改 from徐世廷**********************************************************************/
  24109. m.isMobile() && this.boluoVrInit(),
  24110. /*******************************************************************************************************************************/
  24111. this.initComposer(),
  24112. (this.started = !0),
  24113. (p = p.bind(this))()
  24114. }),
  24115. (n.prototype.createContext = function (e) {
  24116. var transparent = !!(settings.transparentBg || settings.bgImg)
  24117. try {
  24118. ;(this.renderer = new r.WebGLRenderer({
  24119. antialias: !m.isMobile(),
  24120. alpha: transparent
  24121. })),
  24122. (this.renderer.autoClear = !0),
  24123. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  24124. this.renderer.setSize($('#player').width(), $('#player').height(), false), //改
  24125. transparent && this.renderer.setClearColor(0x000000, 0) //透明
  24126. this.emit(a.ContextCreated)
  24127. } catch (e) {
  24128. throw new h('Unable to create a WebGL rendering context')
  24129. }
  24130. u.profiling.enabled && this.overrideTextures(), e.appendChild(this.renderer.domElement)
  24131. /* window.stats = new Stats();
  24132. e.appendChild( stats.dom ); */
  24133. }),
  24134. (n.prototype.overrideTextures = function () {
  24135. var e = this.renderer.context,
  24136. t = 0,
  24137. i = e.createTexture
  24138. e.createTexture = function () {
  24139. var n = i.call(e)
  24140. return (n.id = t++), (this.textures[n.id] = n), n
  24141. }.bind(this)
  24142. var n = e.texImage2D
  24143. e.texImage2D = function (t, i, r, o, a, l, c, h, u) {
  24144. var d,
  24145. p = this.getTextureTypeFromTarget(e, t)
  24146. ;(d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D)),
  24147. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : ((c = o), (h = a), (u = l), (o = u.naturalWidth), (a = u.naturalHeight), n.call(e, t, i, r, c, h, u))
  24148. var f = this.textures[d.id]
  24149. ;(f.width = p === s.TextureCube ? 6 * o : o), (f.height = a)
  24150. }.bind(this)
  24151. var r = e.deleteTexture
  24152. e.deleteTexture = function (t) {
  24153. delete this.textures[t.id], r.call(e, t)
  24154. }.bind(this)
  24155. }),
  24156. (n.prototype.updateTextureMemory = (function () {
  24157. var e = null
  24158. return function () {
  24159. var t = 0
  24160. for (var i in this.textures) {
  24161. var n = this.textures[i]
  24162. n.width && n.height && (t += n.width * n.height * 4)
  24163. }
  24164. t !== e && this.emit(a.MemoryUsageUpdated, t), (e = t)
  24165. }
  24166. })()),
  24167. (n.prototype.getTextureTypeFromTarget = function (e, t) {
  24168. switch (t) {
  24169. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  24170. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  24171. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  24172. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  24173. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  24174. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  24175. return s.TextureCube
  24176. case e.TEXTURE_2D:
  24177. return s.Texture2D
  24178. default:
  24179. return null
  24180. }
  24181. }),
  24182. (n.prototype.initComposer = function () {
  24183. ;(this.composer = new r.EffectComposer(this.renderer)),
  24184. this.composer.addPass(new r.RenderPass(this.scene, this.camera)),
  24185. //this.composer.addPass(this.effects.hblurPass),
  24186. //this.composer.addPass(this.effects.vblurPass)
  24187. this.composer.addPass(this.effects.fastTranMaskPass) //add
  24188. }),
  24189. (n.prototype.setSize = function (e, t, devicePixelRatio) {
  24190. ;(this.renderWidth = e),
  24191. (this.renderHeight = t),
  24192. (this.effects.aspect = e / t),
  24193. /* this.renderer.setSize(e, t), -----MP */
  24194. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  24195. this.composer.setSize(e, t)
  24196. for (var i = 0; i < this.resizeListeners.length; i++) this.resizeListeners[i].setSize(e, t)
  24197. }),
  24198. (n.prototype.render = function () {
  24199. //this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24200. this.effects.fastTranMaskPass.enabled ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  24201. })
  24202. /******************************************************************************************************徐世廷**********************************************************************/
  24203. var vrPermission = {}
  24204. var vrPermissionCallBack = function (info1, info2) {
  24205. if (info1 == 'reset') {
  24206. vrPermission = {}
  24207. } else {
  24208. vrPermission[info1] = info2
  24209. if (Object.keys(vrPermission).length == 2 && (vrPermission.deviceMotion != 'granted' || vrPermission.deviceOrientation != 'granted')) {
  24210. alert('运动和方向访问失败。这会导致画面视角一直固定。您需要完全关闭此应用,然后再次打开,并允许访问运动与方向。')
  24211. }
  24212. }
  24213. }
  24214. ;(n.prototype.boluoVrInit = function () {
  24215. console.log('boluoVrInit')
  24216. //webxr.init(this.renderer)
  24217. ;(this.isHuawei5X = m.detectHUAWEI5X()), (this.oldRenderer = this.renderer), (this.newRenderer = new this.vrRenderer(this.renderer, this, this.camera))
  24218. window.panoCamera = this.camera
  24219. var a = this
  24220. ;(window._vrEnabled = !1),
  24221. Object.defineProperty(window, 'vrEnabled', {
  24222. get: function () {
  24223. return window._vrEnabled
  24224. },
  24225. set: function (b) {
  24226. //if(webxr.xrType)return webxr.enterVR()
  24227. b = !!b
  24228. b
  24229. ? ((a.renderer = a.newRenderer),
  24230. window.vrMarkers.forEach(function (a) {
  24231. a.visible = !0
  24232. }))
  24233. : ((a.renderer = a.oldRenderer),
  24234. window.vrMarkers.forEach(function (a) {
  24235. a.visible = !1
  24236. })),
  24237. (a.cursor.visible = b),
  24238. a.setSize(window.innerWidth, window.innerHeight),
  24239. (window._vrEnabled = b)
  24240. $('.cad').css('visibility', b ? 'hidden' : '')
  24241. if (b) {
  24242. setTimeout(function () {
  24243. console.log('orientEnable' + window.orientEnable)
  24244. if (window.vrEnabled && !window.orientEnable) {
  24245. //很可能没能触发陀螺仪事件
  24246. if (m.detectIOS() /* && m.detectSafari() */) {
  24247. var b = m.iosVersion() //{major: 10, minor: 3, patch: 1}
  24248. console.log('开始获取权限 major' + b.major)
  24249. if (b.major == 12 && b.minor >= 2) {
  24250. if (browser.detectSafari()) alert('浏览器未能检测到转动。为完整体验VR效果,请打开 “设置” > “Safari” > “隐私和安全” 下的 “运动和方向访问” 开关,然后刷新此页面。')
  24251. else {
  24252. //app??
  24253. alert('浏览器未能检测到转动。请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。')
  24254. }
  24255. } else if (b.major >= 13) {
  24256. if (!window.location.href.includes('https://')) {
  24257. console.log('需要https')
  24258. alert('当前网页下,高于ios12的浏览器版本可能不支持陀螺仪开启。')
  24259. return
  24260. }
  24261. var hasFailed = window.vrPermission && (window.vrPermission.deviceMotion != 'granted' || window.vrPermission.deviceOrientation != 'granted')
  24262. setTimeout(
  24263. () => {
  24264. //如果使用了alert会阻断这个事件,报以下错requusting device orientation or motion access requires a user gesture
  24265. if (!window.vrEnabled || window.orientEnable) return
  24266. vrPermissionCallBack('reset')
  24267. console.log(window.DeviceMotionEvent)
  24268. if (window.DeviceMotionEvent && window.DeviceMotionEvent.requestPermission && typeof window.DeviceMotionEvent.requestPermission === 'function') {
  24269. console.log('开始获取权限1')
  24270. ///注意:需要https 本地服务器permissionState会得到denied
  24271. window.DeviceMotionEvent.requestPermission()
  24272. .then(permissionState => {
  24273. console.log('permissionState1: ' + permissionState)
  24274. vrPermissionCallBack('deviceMotion', permissionState)
  24275. })
  24276. .catch(function (e) {
  24277. vrPermissionCallBack('deviceMotion', false)
  24278. console.log(e)
  24279. })
  24280. } else {
  24281. console.log('window.DeviceMotionEvent undefined')
  24282. vrPermissionCallBack('deviceMotion', false)
  24283. }
  24284. if (window.DeviceOrientationEvent && window.DeviceOrientationEvent.requestPermission && typeof window.DeviceOrientationEvent.requestPermission === 'function') {
  24285. console.log('开始获取权限2')
  24286. window.DeviceOrientationEvent.requestPermission()
  24287. .then(permissionState => {
  24288. console.log('permissionState2: ' + permissionState)
  24289. vrPermissionCallBack('deviceOrientation', permissionState)
  24290. })
  24291. .catch(function (e) {
  24292. vrPermissionCallBack('deviceOrientation', false)
  24293. console.log(e)
  24294. })
  24295. } else {
  24296. console.log('window.DeviceOrientationEvent undefined')
  24297. vrPermissionCallBack('deviceOrientation', false)
  24298. }
  24299. },
  24300. hasFailed ? 0 : 150
  24301. )
  24302. /* /* setTimeout(function(){
  24303. if(settings.vrEnabled && !window.orientEnable){
  24304. $alert("若画面视角一直固定,您需要完全关闭Safari浏览器,然后再次打开以开启运动和方向访问。")
  24305. }
  24306. },4000) */
  24307. } else console.log('陀螺仪未能启用 ios ' + b.major + '.' + b.minor)
  24308. } else {
  24309. //$alert("浏览器未能检测到转动", "请在手机或浏览器设置中开启了运动和方向访问等设置,然后刷新此页面。")
  24310. }
  24311. } else {
  24312. //已经触发了
  24313. }
  24314. }, 200)
  24315. }
  24316. }
  24317. }),
  24318. this.createCursor(0.5, !1, 1, 16777215, 0)
  24319. var b = {
  24320. setSize: function (b, c) {
  24321. a.camera.aspect = b / c
  24322. }
  24323. }
  24324. this.resizeListeners.push(b), this.vrLoadingInit()
  24325. }),
  24326. (n.prototype.vrLoadingInit = function () {
  24327. var a = function (camera) {
  24328. var a = this,
  24329. b = new r.RingGeometry(1.3, 1.5, 32, 32, 0, 1.2 * Math.PI),
  24330. c = new r.MeshBasicMaterial({
  24331. color: 4967932,
  24332. side: r.DoubleSide
  24333. }),
  24334. d = new r.Mesh(b, c)
  24335. ;(this.mesh = d),
  24336. (d.position.z = -2),
  24337. d.scale.set(0.08, 0.08, 0.08),
  24338. (d.visible = !1),
  24339. camera.add(d),
  24340. //window.player.camera.add(d),
  24341. (a.enabled = !1),
  24342. (this.update = function (b) {
  24343. 1 == a.enabled && (d.rotation.z += 15 * b)
  24344. })
  24345. },
  24346. a = new a(this.camera)
  24347. ;(window.Loading = a), this.updateListeners.push(a)
  24348. }),
  24349. (n.prototype.createCursor = function (a, b, c, d, e) {
  24350. var g,
  24351. h = new r.SpriteMaterial({
  24352. opacity: c,
  24353. color: d,
  24354. transparent: b,
  24355. map: this.boluoGetTexture('images/cursor.png'),
  24356. needsUpdate: !0,
  24357. side: r.DoubleSide
  24358. })
  24359. ;(h.map.offset = new r.Vector2((1 / 17) * e, 0)),
  24360. (h.map.repeat = new r.Vector2(1 / 17, 1)),
  24361. (h.depthTest = !1),
  24362. (h.blending = r.AdditiveBlending),
  24363. (g = new r.Sprite(h)),
  24364. // g.scale.set(a, a, a),
  24365. g.scale.set(0.3, 0.3, 0.3)
  24366. ;(g.position.z = -2), (g.visible = !1), (g.name = 'cursor'), this.camera.add(g), this.scene.add(this.camera), (this.cursor = g)
  24367. var i = new this.CursorAnimation(this.scene, g, this.camera)
  24368. ;(this.cursor.triggerTargetEvent = i.triggerTargetEvent), this.updateListeners.push(i)
  24369. }),
  24370. (window.orientEnable = 0) //是否能触发deviceorientation
  24371. ;(n.prototype.CursorAnimation = function (a, b, c) {
  24372. function d() {
  24373. g.orient = r.Math.degToRad(window.orientation || 0)
  24374. }
  24375. function e(a) {
  24376. if (!window.vrEnabled && window.orientEnable) return
  24377. window.orientEnable || (window.orientEnable = 1)
  24378. var b = r.Math.degToRad(a.alpha),
  24379. c = r.Math.degToRad(a.beta),
  24380. d = r.Math.degToRad(a.gamma)
  24381. if (
  24382. (this.isHuawei5X
  24383. ? (-1e3 === g.alpha && (g.alpha = b),
  24384. -1e3 === g.beta && (g.beta = c),
  24385. -1e3 === g.gamma && (g.gamma = d),
  24386. Math.abs(b - g.alpha) > 0.06 && (g.alpha = b),
  24387. Math.abs(c - g.beta) > 0.006 && (g.beta = c),
  24388. Math.abs(d - g.gamma) > 0.006 && (g.gamma = d))
  24389. : ((g.alpha = b), (g.beta = c), (g.gamma = d)),
  24390. n.vrDebug)
  24391. ) {
  24392. $('#info-device-orientation').css('display', 'block')
  24393. var e = ''
  24394. ;(e += 'alpha=(' + g.alpha + ')<BR/>'), (e += 'beta=(' + g.beta + ')<BR/>'), (e += 'gamma=' + g.gamma + '<BR/>'), (document.getElementById('info-device-orientation').innerHTML = e)
  24395. }
  24396. }
  24397. ;(this.cursor = b), (this.raycaster = new r.Raycaster()), (this.targetEventObj = {}), (this.type = 1), (this.tweenFlag = !0)
  24398. var g = this
  24399. ;(this.target = c),
  24400. console.log(c.uuid),
  24401. (this.euler = new r.Euler()),
  24402. (this.q0 = new r.Quaternion()),
  24403. (this.q1 = new r.Quaternion(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5))),
  24404. (this.zee = new r.Vector3(0, 0, 1)),
  24405. (this.alpha = -1e3),
  24406. (this.beta = -1e3),
  24407. (this.gamma = -1e3),
  24408. (this.orient = r.Math.degToRad(window.orientation || 0)),
  24409. window.addEventListener('orientationchange', d),
  24410. window.addEventListener('deviceorientation', e),
  24411. (this.setObjectQuaternion = function (a, b, d, e, f) {
  24412. g.euler.set(d, b, -e, 'YXZ'), a.setFromEuler(g.euler), a.multiply(g.q1), a.multiply(g.q0.setFromAxisAngle(g.zee, -f)), c.updateMatrixWorld()
  24413. }),
  24414. parent !== window &&
  24415. window.addEventListener('message', function (a) {
  24416. var b = JSON.parse(a.data),
  24417. c = -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  24418. b &&
  24419. b.alpha &&
  24420. b.beta &&
  24421. b.gamma &&
  24422. (function (a) {
  24423. var c = r.Math.degToRad(b.alpha),
  24424. d = r.Math.degToRad(b.beta),
  24425. e = r.Math.degToRad(b.gamma)
  24426. a
  24427. ? (-1e3 === g.alpha && (g.alpha = c),
  24428. -1e3 === g.beta && (g.beta = d),
  24429. -1e3 === g.gamma && (g.gamma = e),
  24430. Math.abs(c - g.alpha) > 0.06 && (g.alpha = c),
  24431. Math.abs(d - g.beta) > 0.006 && (g.beta = d),
  24432. Math.abs(e - g.gamma) > 0.006 && (g.gamma = e))
  24433. : ((g.alpha = c), (g.beta = d), (g.gamma = e))
  24434. })(c)
  24435. }),
  24436. (this.update = function (a) {
  24437. TWEEN.update()
  24438. if (window.vrEnabled) this.triggerTargetEvent() //测试时不根据陀螺仪来转向
  24439. else window.vrEnabled && (this.setObjectQuaternion(this.target.quaternion, this.alpha, this.beta, this.gamma, this.orient), this.triggerTargetEvent())
  24440. }),
  24441. (this.triggerTargetEvent = function () {
  24442. var a = this.choseObj(),
  24443. b = a ? a.object : void 0
  24444. ;(this.targetEventObj.currentObj = b),
  24445. b !== this.targetEventObj.lastObj &&
  24446. (b && this.autoCursorPosition(a),
  24447. 1 === this.type
  24448. ? (this.cursorAnimate && this.cursorAnimate.stop(),
  24449. b &&
  24450. b.enabled &&
  24451. this.startAnimate(
  24452. function () {
  24453. this.clickCallback(b)
  24454. }.bind(this)
  24455. ))
  24456. : this.type,
  24457. (this.targetEventObj.lastObj = b))
  24458. }),
  24459. (this.choseObj = function () {
  24460. this.raycaster.setFromCamera(
  24461. {
  24462. x: 0,
  24463. y: 0
  24464. },
  24465. c
  24466. )
  24467. var a = (this.raycaster.ray, window.vrMarkers),
  24468. b = this.raycaster.intersectObjects(a)
  24469. if (b.length > 0) return b[0]
  24470. }),
  24471. (this.clickCallback = function (a) {
  24472. this.runTHREEAction(a, 'onclick')
  24473. }),
  24474. (this.runTHREEAction = function (a, b) {
  24475. switch (b) {
  24476. case 'onclick':
  24477. a._listeners &&
  24478. a._listeners.click &&
  24479. a._listeners.click.forEach(function (a) {
  24480. a()
  24481. })
  24482. break
  24483. case 'onhover':
  24484. a._listeners &&
  24485. a._listeners.hover &&
  24486. a._listeners.hover.forEach(function (a) {
  24487. a()
  24488. })
  24489. break
  24490. case 'onout':
  24491. a._listeners &&
  24492. a._listeners.out &&
  24493. a._listeners.out.forEach(function (a) {
  24494. a()
  24495. })
  24496. }
  24497. }),
  24498. (this.startAnimate = function (a) {
  24499. this.tweenFlag && this.initAnimation(a)
  24500. }),
  24501. (this.initAnimation = function (a) {
  24502. var b = this,
  24503. c = this.cursor.material.map.offset,
  24504. d = function (a) {
  24505. return Math.floor(17 * a) / 17
  24506. }
  24507. ;(b.tweenFlag = !1),
  24508. (this.cursorAnimate = new TWEEN.Tween(c)
  24509. .to(
  24510. {
  24511. x: 1
  24512. },
  24513. 1e3
  24514. )
  24515. .onStart(function () {
  24516. b.tweenFlag = !1
  24517. })
  24518. .onStop(function () {
  24519. ;(b.tweenFlag = !0), (this.x = 0), (c.x = 0)
  24520. })
  24521. .onUpdate(function () {})
  24522. .onComplete(function () {
  24523. a(),
  24524. (c.x = 0),
  24525. setTimeout(function () {
  24526. b.tweenFlag = !0
  24527. }, 1500)
  24528. })),
  24529. this.cursorAnimate.easing(d),
  24530. this.cursorAnimate.start()
  24531. }),
  24532. (this.autoCursorPosition = function (a) {
  24533. // var b = Math.abs(a.distance - 10);
  24534. // this.cursor.position.z = -b,
  24535. // b /= 10;
  24536. // alert(b);
  24537. // this.cursor.scale.set(b, b, b)
  24538. this.cursor.scale.set(0.3, 0.3, 0.3)
  24539. })
  24540. }),
  24541. (n.prototype.vrRenderer = function (a, b, c) {
  24542. var d = new b.vrCamera(c)
  24543. ;(d.bananaAspect = 0.8), this.width, this.height
  24544. var b = this
  24545. ;(this.setSize = function (c, d) {
  24546. a.setSize.call(this, c, d), (b.width = c), (b.height = d)
  24547. }),
  24548. (this.render = function (b, c, e, f) {
  24549. window.cameraQua = c.quaternion.clone()
  24550. var g, h
  24551. if (c.__RESS__SKIP__STEREO__) return a.render(b, c, e, f)
  24552. if ('PerspectiveCamera' === c.type) (g = d.cameraL), (h = d.cameraR), b.updateMatrixWorld(), null === c.parent && c.updateMatrixWorld(), d.vrCameraUpdate(c)
  24553. else {
  24554. if ('OrthographicCamera' !== c.type) return DEBUG && console.error('Unsupported renderer: ', c.type)
  24555. g = h = c
  24556. }
  24557. a.setScissorTest(!0),
  24558. a.setScissor(0, 0, this.width / 2, this.height),
  24559. a.setViewport(0, 0, this.width / 2, this.height),
  24560. a.render.call(this, b, g, e, f),
  24561. a.setScissor(this.width / 2, 0, this.width / 2, this.height),
  24562. a.setViewport(this.width / 2, 0, this.width / 2, this.height),
  24563. a.render.call(this, b, h, e, f),
  24564. a.setScissorTest(!1)
  24565. }),
  24566. (this.__proto__ = {
  24567. __proto__: a
  24568. })
  24569. }),
  24570. (n.prototype.vrCamera = function (a) {
  24571. ;(this.type = 'StereoCamera'),
  24572. (this._aspect = 1),
  24573. (this._overlap = 0.064),
  24574. (this.cameraL = new r.PerspectiveCamera()),
  24575. this.cameraL.layers.enable(1),
  24576. (this.cameraL.near = 0.01), //xzw add
  24577. (this.cameraL.matrixAutoUpdate = !1),
  24578. (this.cameraR = new r.PerspectiveCamera()),
  24579. this.cameraR.layers.enable(2),
  24580. (this.cameraR.near = 0.01), //xzw add
  24581. (this.cameraR.matrixAutoUpdate = !1),
  24582. (this.eyeRight = new r.Matrix4()),
  24583. (this.eyeLeft = new r.Matrix4()),
  24584. (this.vrCameraNeedsUpdate = !0),
  24585. (window.vrCameraL = this.cameraL) // fyz 记录vr相机
  24586. Object.defineProperty(this, 'bananaAspect', {
  24587. get: function () {
  24588. return this._aspect
  24589. },
  24590. set: function (a) {
  24591. this._aspect !== a && (this.vrCameraNeedsUpdate = !0), (this._aspect = a)
  24592. }
  24593. }),
  24594. Object.defineProperty(this, 'overlap', {
  24595. get: function () {
  24596. return this._overlap
  24597. },
  24598. set: function (a) {
  24599. this._overlap !== a && (this.vrCameraNeedsUpdate = !0), (this._overlap = a)
  24600. }
  24601. }),
  24602. (this.vrCameraUpdate = function (a) {
  24603. this.vrCameraNeedsUpdate = true
  24604. if (
  24605. ((this.vrCameraNeedsUpdate =
  24606. this.vrCameraNeedsUpdate || this.bananaFov !== a.fov || this.bananaReal_aspect !== a.aspect * this.bananaAspect || this.bananaNear !== a.near || this.bananaFar !== a.far),
  24607. this.vrCameraNeedsUpdate)
  24608. ) {
  24609. ;(this.vrCameraNeedsUpdate = !1),
  24610. //console.debug("vrCameraUpdate"),
  24611. (this.bananaFocus = a.focus),
  24612. (this.bananaFov = a.fov),
  24613. (this.bananaReal_aspect = a.aspect * this.bananaAspect),
  24614. (this.bananaNear = a.near),
  24615. (this.bananaFar = a.far),
  24616. //console.debug(a.aspect),
  24617. (this.bananaFocus = 10)
  24618. var b,
  24619. c,
  24620. d = a.projectionMatrix.clone(),
  24621. e = this.overlap / 2,
  24622. f = (e * this.bananaNear) / this.bananaFocus,
  24623. g = this.bananaNear * Math.tan((Math.PI / 180) * this.bananaFov * 0.5)
  24624. ;(this.eyeLeft.elements[12] = -e),
  24625. (this.eyeRight.elements[12] = e),
  24626. (b = -g * this.bananaReal_aspect + f),
  24627. (c = g * this.bananaReal_aspect + f),
  24628. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  24629. (d.elements[8] = (c + b) / (c - b)),
  24630. this.cameraL.projectionMatrix.copy(d),
  24631. (b = -g * this.bananaReal_aspect - f),
  24632. (c = g * this.bananaReal_aspect - f),
  24633. (d.elements[0] = (2 * this.bananaNear) / (c - b)),
  24634. (d.elements[8] = (c + b) / (c - b)),
  24635. this.cameraR.projectionMatrix.copy(d)
  24636. }
  24637. this.cameraL.matrixWorld.copy(a.matrixWorld).multiply(this.eyeLeft), this.cameraR.matrixWorld.copy(a.matrixWorld).multiply(this.eyeRight)
  24638. })
  24639. }),
  24640. (n.prototype.boluoGetTexture = function (a) {
  24641. var b = new r.TextureLoader()
  24642. return (b.crossOrigin = 'anonymous'), b.load(a)
  24643. })
  24644. /* let webxr = {
  24645. init(renderer) {
  24646. this.renderer = renderer
  24647. renderer.xr = new THREE.WebXRManager(renderer, renderer.getContext());
  24648. renderer.xr.enabled = true
  24649. if ('xr' in navigator && 'isSessionSupported' in navigator.xr) {
  24650. //pico firefox
  24651. var mode = 'immersive-vr'
  24652. navigator.xr
  24653. .isSessionSupported(mode)
  24654. .then(supported => {
  24655. if (!supported) {
  24656. this.xrNotFound('isSessionSupported not supported')
  24657. } else {
  24658. this.xrType = 'xr' //showEnterXR();
  24659. }
  24660. })
  24661. .catch(this.xrNotFound.bind(this, 'isSessionSupported error'))
  24662. } else if ('getVRDisplays' in navigator) {
  24663. //pico 的vr browser是这个
  24664. console.log('getVRDisplays')
  24665. let setDevice = device => {
  24666. this.xrType = 'vr'
  24667. this.device = device
  24668. this.renderer.xr.setDevice(device) //新版是renderer.vr
  24669. }
  24670. window.addEventListener(
  24671. 'vrdisplayconnect',
  24672. function (event) {
  24673. setDevice(event.display)
  24674. },
  24675. false
  24676. )
  24677. window.addEventListener(
  24678. 'vrdisplaydisconnect',
  24679. function ( ) {
  24680. console.log('vrdisplaydisconnect')
  24681. window.bus.dispatchEvent({type:'exitWebXR'})
  24682. },
  24683. false
  24684. )
  24685. window.addEventListener(
  24686. 'vrdisplaypresentchange',
  24687. function (event) {
  24688. console.log('vrdisplaypresentchange', event.display.isPresenting ? 'EXIT VR' : 'ENTER VR')
  24689. event.display.isPresenting || window.bus.dispatchEvent({type:'exitWebXR'})
  24690. },
  24691. false
  24692. )
  24693. window.addEventListener(
  24694. 'vrdisplayactivate',
  24695. function (event) {
  24696. event.display.requestPresent([{ source: this.renderer.domElement }])
  24697. },
  24698. false
  24699. )
  24700. navigator
  24701. .getVRDisplays()
  24702. .then(function (displays) {
  24703. if (displays.length > 0) {
  24704. setDevice(displays[0])
  24705. } else {
  24706. this.xrNotFound('no displays')
  24707. }
  24708. })
  24709. .catch(this.xrNotFound.bind(this, 'getVRDisplays error'))
  24710. } else {
  24711. this.xrNotFound('xr not supported')
  24712. }
  24713. },
  24714. enterVR() {
  24715. if (!this.xrType) return //不支持
  24716. console.log('enterVR', this.xrType)
  24717. if (this.xrType == 'vr') {
  24718. this.device.isPresenting ? this.device.exitPresent() : this.device.requestPresent([{ source: renderer.domElement }])
  24719. } else if (this.xrType == 'xr') {
  24720. if (this.currentSession == void 0) {
  24721. console.log('this.currentSession == void 0 ')
  24722. function getXRSessionInit(mode, options) {
  24723. var space = (options || {}).referenceSpaceType || 'local-floor'
  24724. var sessionInit = (options && options.sessionInit) || {}
  24725. // Nothing to do for default features.
  24726. if (space == 'viewer') return sessionInit
  24727. if (space == 'local' && mode.startsWith('immersive')) return sessionInit
  24728. // If the user already specified the space as an optional or required feature, don't do anything.
  24729. if (sessionInit.optionalFeatures && sessionInit.optionalFeatures.includes(space)) return sessionInit
  24730. if (sessionInit.requiredFeatures && sessionInit.requiredFeatures.includes(space)) return sessionInit
  24731. // The user didn't request the reference space type as a feature. Add it to a shallow copy
  24732. // of the user-supplied sessionInit requiredFeatures (if any) to ensure it's valid to
  24733. // request it later.
  24734. var newInit = Object.assign({}, sessionInit)
  24735. newInit.requiredFeatures = [space]
  24736. if (sessionInit.requiredFeatures) {
  24737. newInit.requiredFeatures = newInit.requiredFeatures.concat(sessionInit.requiredFeatures)
  24738. }
  24739. return newInit
  24740. }
  24741. let onSessionEnded = ( ) => {
  24742. console.log('onSessionEnded')
  24743. this.currentSession.removeEventListener('end', onSessionEnded)
  24744. setTimeout(()=>{
  24745. this.renderer.xr.setSession(null)
  24746. this.currentSession = null
  24747. window.bus.dispatchEvent({type:'exitWebXR'})
  24748. },1)//延迟原因:先使THREE里的onSessionEnded执行
  24749. }
  24750. let onSessionStarted = session => {
  24751. console.log('onSessionStarted')
  24752. session.addEventListener('end', onSessionEnded)
  24753. this.renderer.xr.setSession(session)
  24754. this.currentSession = session
  24755. }
  24756. var mode = 'immersive-vr'
  24757. var sessionInit = getXRSessionInit(mode)
  24758. navigator.xr.requestSession(mode, sessionInit).then(onSessionStarted)
  24759. } else {
  24760. console.log('this.currentSession.end()', this.currentSession)
  24761. this.currentSession.end()
  24762. }
  24763. }
  24764. },
  24765. xrNotFound(text) {
  24766. console.log('xrNotFound:', text)
  24767. },
  24768. } */
  24769. /***********************************************************************************************************************************************************************************/
  24770. ;(n.prototype.updateScreenSize = (function () {
  24771. //xzw 改 为了截屏 要改canvas大小 以及缩放时不模糊
  24772. var W, H //当截屏时有setTimeout 期间不能恢复大小,所以要用W,H记录正常大小
  24773. return function (o) {
  24774. var render = false
  24775. var ratio
  24776. var w, h //记录应当render的大小
  24777. if (o && !o.resize && o.width != void 0 && o.height != void 0) {
  24778. ;(w = o.width), (h = o.height), (render = true), (ratio = 1)
  24779. } else {
  24780. w = $('#player').width()
  24781. h = $('#player').height()
  24782. o && o.resize && ((W = this.renderWidth), (H = this.renderHeight))
  24783. ;(w !== W || h !== H || this.forceUpdateSize) && ((W = w), (H = h), (render = true), (ratio = window.devicePixelRatio))
  24784. }
  24785. if (render) {
  24786. this.setSize(w, h, ratio)
  24787. this.forceUpdateSize = !1
  24788. }
  24789. }
  24790. })()),
  24791. (n.prototype.updateComponents = function () {
  24792. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++) this.updateListeners[t].update(e)
  24793. }),
  24794. (n.prototype.suspend = function () {
  24795. ;(this.started = !1),
  24796. (this.suspendedObjects = this.scene.children.map(
  24797. function (e) {
  24798. return this.scene.remove(e), e
  24799. }.bind(this)
  24800. )),
  24801. this.render()
  24802. }),
  24803. (n.prototype.resume = function () {
  24804. this.suspendedObjects.forEach(
  24805. function (e) {
  24806. this.scene.add(e)
  24807. }.bind(this)
  24808. ),
  24809. (this.suspendedObjects = []),
  24810. (this.started = !0),
  24811. p()
  24812. })
  24813. var p = function () {
  24814. this.started &&
  24815. (window.requestAnimationFrame(p),
  24816. this.updateScreenSize(), // fyz resize
  24817. this.updateComponents(),
  24818. this.updateTextureMemory(),
  24819. this.render(),
  24820. window.stats && (window.fps = stats.update()),
  24821. this.emit(a.AfterRender))
  24822. }
  24823. ;(n.prototype.getImageData = (function () {
  24824. var e = document.createElement('canvas'),
  24825. t = e.getContext('2d')
  24826. return function (i, n, r) {
  24827. return (e.width === n && e.height === r) || ((e.width = n), (e.height = r)), t.drawImage(i, 0, 0, n, r), t.getImageData(0, 0, n, r)
  24828. }
  24829. })()),
  24830. (n.prototype.initSizedTexture2D = function (e, t, i) {
  24831. var n = this.renderer,
  24832. o = n.context,
  24833. a = n.state,
  24834. s = new r.Texture(null)
  24835. ;(s.flipY = !1), i !== !0 && (i = !1), (s.generateMipmaps = i)
  24836. var l = n.paramThreeToGL(s.format),
  24837. c = n.paramThreeToGL(s.type),
  24838. h = n.properties.get(s),
  24839. u = o.createTexture()
  24840. a.bindTexture(o.TEXTURE_2D, u), o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY), o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null), (s.wrapS = t), (s.wrapT = t)
  24841. var d = n.paramThreeToGL(t)
  24842. return (
  24843. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  24844. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  24845. i
  24846. ? ((s.magFilter = r.LinearFilter),
  24847. (s.minFilter = r.LinearMipMapLinearFilter),
  24848. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24849. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  24850. o.generateMipmap(o.TEXTURE_2D))
  24851. : ((s.magFilter = r.LinearFilter),
  24852. (s.minFilter = r.LinearFilter),
  24853. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  24854. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  24855. a.bindTexture(o.TEXTURE_2D, null),
  24856. (h.__webglTexture = u),
  24857. s
  24858. )
  24859. }),
  24860. (n.prototype.initSizedCubeMap = function (e, t) {
  24861. var i = this.renderer,
  24862. n = i.context,
  24863. o = i.state,
  24864. a = new r.CubeTexture([null, null, null, null, null, null])
  24865. ;(a.flipY = !1), (a.generateMipmaps = t)
  24866. var s = i.paramThreeToGL(a.format),
  24867. l = i.paramThreeToGL(a.type),
  24868. c = i.properties.get(a),
  24869. h = n.createTexture()
  24870. o.bindTexture(n.TEXTURE_CUBE_MAP, h), n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY)
  24871. for (var u = 0; u < 6; u++) n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null)
  24872. return (
  24873. t
  24874. ? ((a.magFilter = r.LinearFilter),
  24875. (a.minFilter = r.LinearMipMapLinearFilter),
  24876. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24877. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  24878. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  24879. n.generateMipmap(n.TEXTURE_CUBE_MAP))
  24880. : ((a.magFilter = r.LinearFilter),
  24881. (a.minFilter = r.LinearFilter),
  24882. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  24883. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  24884. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  24885. (c.__image__webglTextureCube = h),
  24886. a
  24887. )
  24888. }),
  24889. (n.prototype.deallocateCubeTexture = function (e) {
  24890. var t = this.renderer,
  24891. i = t.context,
  24892. n = t.properties.get(e)
  24893. i.deleteTexture(n.__image__webglTextureCube)
  24894. }),
  24895. (n.prototype.uploadTexture2D = function (e, t, i, n, r, o) {
  24896. var a = this.renderer,
  24897. s = a.context,
  24898. l = a.state,
  24899. c = a.properties.get(t)
  24900. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  24901. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24902. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  24903. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  24904. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  24905. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  24906. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  24907. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  24908. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  24909. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  24910. l.bindTexture(s.TEXTURE_2D, null)
  24911. }),
  24912. (n.prototype.uploadTexture3D = function (e, t, i, n, r, o, a) {
  24913. var s = this.renderer,
  24914. l = s.context,
  24915. c = s.state,
  24916. h = s.properties.get(t)
  24917. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  24918. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  24919. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  24920. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  24921. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  24922. }),
  24923. (n.prototype.rebuildMipMaps2D = function (e) {
  24924. var t = this.renderer,
  24925. i = t.context,
  24926. n = t.state
  24927. t.properties.get(e)
  24928. i.generateMipmap(i.TEXTURE_2D), n.bindTexture(i.TEXTURE_2D, null)
  24929. }),
  24930. (n.prototype.rebuildMipMaps3D = function (e) {
  24931. var t = this.renderer,
  24932. i = t.context,
  24933. n = t.state,
  24934. r = t.properties.get(e)
  24935. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube), i.generateMipmap(i.TEXTURE_CUBE_MAP), n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  24936. }),
  24937. (n.prototype.renderToCubeMap = (function () {
  24938. var e = !1,
  24939. t = null,
  24940. i = null,
  24941. n = null,
  24942. a = null,
  24943. s = null,
  24944. l = 1
  24945. return function (c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  24946. var _ = this.renderer
  24947. _.context
  24948. e ||
  24949. ((i = new r.OrthographicCamera(l / -2, l / 2, l / 2, l / -2, -200, 200)),
  24950. (i.position.z = 150),
  24951. (t = new r.Scene()),
  24952. t.add(i),
  24953. (n = new r.ShaderMaterial({
  24954. uniforms: {
  24955. tDiffuse: {
  24956. type: 't',
  24957. value: null
  24958. },
  24959. alpha: {
  24960. type: 'f',
  24961. value: 1
  24962. }
  24963. },
  24964. vertexShader: o.basicTextured.vertexShader,
  24965. fragmentShader: o.basicTextured.fragmentShader,
  24966. depthWrite: !1,
  24967. depthTest: !1,
  24968. side: r.DoubleSide
  24969. })),
  24970. (a = new r.PlaneBufferGeometry(l, l)),
  24971. (s = new r.Mesh(a, n)),
  24972. (s.position.z = 0),
  24973. t.add(s),
  24974. (e = !0))
  24975. var T = a.getAttribute('uv')
  24976. T.setDynamic(!0), (T.needsUpdate = !0)
  24977. var x = T.array,
  24978. S = p / u,
  24979. M = f / d,
  24980. R = g / u,
  24981. P = m / d
  24982. ;(x[0] = S), (x[1] = M + P), (x[2] = S + R), (x[3] = M + P), (x[4] = S), (x[5] = M), (x[6] = S + R), (x[7] = M)
  24983. var O = a.getAttribute('position')
  24984. O.setDynamic(!0), (O.needsUpdate = !0)
  24985. var L = O.array,
  24986. D = v / h.width - l / 2,
  24987. N = A / h.height - l / 2,
  24988. B = y / h.width,
  24989. F = C / h.height
  24990. ;(L[0] = D), (L[1] = N + F), (L[3] = D + B), (L[4] = N + F), (L[6] = D), (L[7] = N), (L[9] = D + B), (L[10] = N)
  24991. this.renderer.properties.get(c)
  24992. ;(n.uniforms.tDiffuse.value = c),
  24993. (n.blending = E || r.NoBlending),
  24994. (n.transparent = !!b),
  24995. (void 0 !== w && null !== w) || (w = 1),
  24996. (n.uniforms.alpha.value = w),
  24997. (n.needUpdate = !0),
  24998. (h.activeCubeFace = I),
  24999. h.viewport.set(0, 0, h.width, h.height)
  25000. var V = this.renderer.autoClear
  25001. ;(this.renderer.autoClear = !1), this.renderer.render(t, i, h, !1), (this.renderer.autoClear = V)
  25002. }
  25003. })()),
  25004. (n.prototype.copyCubeMap = (function () {
  25005. var e = !1,
  25006. t = null,
  25007. i = null,
  25008. a = null,
  25009. s = null,
  25010. l = null,
  25011. c = new r.Euler()
  25012. new r.Vector3()
  25013. return function (h, u, d, p, f, g, m, v, A) {
  25014. if (f > this.qualityManager.maxRenderTargetSize) return //add
  25015. this.renderer
  25016. if (!e) {
  25017. var y = 2
  25018. ;(i = new r.OrthographicCamera(y / -2, y / 2, y / 2, y / -2, 0, 200)),
  25019. i.position.set(0, 0, 0),
  25020. (t = new r.Scene()),
  25021. t.add(i),
  25022. (a = new r.ShaderMaterial({
  25023. uniforms: {
  25024. tDiffuse: {
  25025. type: 't',
  25026. value: null
  25027. },
  25028. alpha: {
  25029. type: 'f',
  25030. value: 1
  25031. }
  25032. },
  25033. vertexShader: o.copyCubeMap.vertexShader,
  25034. fragmentShader: o.copyCubeMap.fragmentShader,
  25035. depthWrite: !1,
  25036. depthTest: !1,
  25037. side: r.DoubleSide
  25038. })),
  25039. (s = new r.BoxGeometry(y, y, y)),
  25040. (l = new r.Mesh(s, a)),
  25041. t.add(l),
  25042. (e = !0)
  25043. }
  25044. for (var C = 0; C < 6; C++)
  25045. n.getCubeOrientationForCubeFace(C, c),
  25046. l.rotation.copy(c),
  25047. (l.matrixWorldNeedsUpdate = !0),
  25048. l.updateMatrixWorld(),
  25049. (a.uniforms.tDiffuse.value = h),
  25050. (a.blending = m || r.NoBlending),
  25051. (a.transparent = !!v),
  25052. (void 0 !== A && null !== A) || (A = 1),
  25053. (a.uniforms.alpha.value = A),
  25054. (a.needUpdate = !0),
  25055. (u.activeCubeFace = C),
  25056. u.viewport.set(0, 0, f, g),
  25057. this.renderer.render(t, i, u, !1)
  25058. }
  25059. })()),
  25060. (n.getLookAtForCubeFace = function (e, t) {
  25061. switch (e) {
  25062. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25063. t.set(1, 0, 0)
  25064. break
  25065. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25066. t.set(-1, 0, 0)
  25067. break
  25068. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25069. t.set(0, 1, 0)
  25070. break
  25071. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25072. t.set(0, -1, 0)
  25073. break
  25074. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25075. t.set(0, 0, 1)
  25076. break
  25077. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25078. t.set(0, 0, -1)
  25079. }
  25080. }),
  25081. (n.getCubeOrientationForCubeFace = function (e, t) {
  25082. switch (e) {
  25083. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  25084. t.set(0, -Math.PI / 2, 0)
  25085. break
  25086. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  25087. t.set(0, Math.PI / 2, 0)
  25088. break
  25089. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  25090. t.set(Math.PI / 2, Math.PI, 0)
  25091. break
  25092. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  25093. t.set(-Math.PI / 2, Math.PI, 0)
  25094. break
  25095. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  25096. t.set(0, -Math.PI, 0)
  25097. break
  25098. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  25099. t.set(0, 0, 0)
  25100. }
  25101. }),
  25102. (t.exports = n)
  25103. },
  25104. {
  25105. '../enum/GLCubeFaces': 25,
  25106. '../enum/GLTextureType': 26,
  25107. '../enum/SceneRendererEvents': 43,
  25108. '../exception/BasicException': 55,
  25109. '../exception/RendererCreationException': 57,
  25110. '../settings': 166,
  25111. '../shaders': 167,
  25112. /********************************************************************fyz改 from徐世廷**********************************************************************/
  25113. '../util/browser': 182,
  25114. /************************************************************************************************************************************************/
  25115. events: 202,
  25116. three: 217
  25117. }
  25118. ],
  25119. 159: [
  25120. function (e, t, i) {
  25121. 'use strict'
  25122. function n(e) {
  25123. ;(this.messenger = new a(e)), (this.clientKey = null)
  25124. }
  25125. var r = e('../util/ajax'),
  25126. o = e('./PostMessageType'),
  25127. a = e('./postmessage'),
  25128. s = e('./VersionInfo'),
  25129. l = e('events').EventEmitter,
  25130. c = window.location.origin + '/api/v1/user/'
  25131. ;(n.prototype = Object.create(l.prototype)),
  25132. (n.prototype.bindEvents = function () {
  25133. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  25134. }),
  25135. (n.prototype.waitForConnection = function () {
  25136. var e = new Promise(
  25137. function (e, t) {
  25138. this.messenger.on(
  25139. o.CONNECT,
  25140. function (i) {
  25141. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  25142. }.bind(this)
  25143. )
  25144. }.bind(this)
  25145. )
  25146. return e
  25147. }),
  25148. (n.prototype.onConnectionReceived = function (e) {
  25149. return (
  25150. this.messenger.setTarget(e.source, e.origin),
  25151. this.verifyConnection(e).then(
  25152. function (t, i) {
  25153. this.messenger.send({
  25154. type: o.ACCEPT,
  25155. toId: e.fromId,
  25156. warning: i
  25157. }),
  25158. (this.clientKey = t),
  25159. this.messenger.removeAllListeners(o.CONNECT),
  25160. this.bindEvents()
  25161. }.bind(this),
  25162. function (t) {
  25163. this.messenger.send({
  25164. type: o.REJECT,
  25165. toId: e.fromId,
  25166. reason: t
  25167. }),
  25168. this.messenger.setTarget()
  25169. }.bind(this)
  25170. )
  25171. )
  25172. }),
  25173. (n.prototype.verifyConnection = function (e) {
  25174. return new Promise(function (t, i) {
  25175. var n
  25176. if (s.isDeprecated(e.sdkVersion)) n = '这个版本正在被弃用'
  25177. else if (!s.isSupported(e.sdkVersion)) return i('不支持此版本的SDK')
  25178. var o = {
  25179. cache: !1,
  25180. headers: {
  25181. 'X-port-Application-Key': e.applicationKey,
  25182. 'X-port-Referrer': e.origin
  25183. }
  25184. }
  25185. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, 'key/referrer mismatch'))
  25186. })
  25187. }),
  25188. (n.prototype.onMessageReceived = function (e) {
  25189. if (this.validateClientApplicationKey(e.applicationKey)) {
  25190. var t = this
  25191. ;(e.onDone = function (i) {
  25192. ;(i.toId = e.fromId), (i.uid = e.uid), (i.type = o.RESPONSE), t.messenger.send(i)
  25193. }),
  25194. this.emit(o.ACTION, e)
  25195. }
  25196. }),
  25197. (n.prototype.validateClientApplicationKey = function (e) {
  25198. return this.clientKey === e
  25199. }),
  25200. (n.prototype.sendEvent = function (e, t) {
  25201. this.messenger.send({
  25202. type: o.EVENT,
  25203. eventType: e,
  25204. eventData: t
  25205. })
  25206. }),
  25207. (t.exports = n)
  25208. },
  25209. {
  25210. '../util/ajax': 181,
  25211. './PostMessageType': 160,
  25212. './VersionInfo': 163,
  25213. './postmessage': 165,
  25214. events: 202
  25215. }
  25216. ],
  25217. 160: [
  25218. function (e, t, i) {
  25219. 'use strict'
  25220. t.exports = Object.freeze({
  25221. CONNECT: 'postmessage.connect',
  25222. ACCEPT: 'postmessage.accept',
  25223. REJECT: 'postmessage.reject',
  25224. ACTION: 'postmessage.action',
  25225. RESPONSE: 'postmessage.response',
  25226. EVENT: 'postmessage.event'
  25227. })
  25228. },
  25229. {}
  25230. ],
  25231. 161: [
  25232. function (e, t, i) {
  25233. 'use strict'
  25234. t.exports = Object.freeze({
  25235. MOVE: 'sdk.move',
  25236. ENTER_PANO: 'sdk.enterpano',
  25237. MODEL_LOADED: 'sdk.modelloaded'
  25238. })
  25239. },
  25240. {}
  25241. ],
  25242. 162: [
  25243. function (e, t, i) {
  25244. 'use strict'
  25245. t.exports = Object.freeze({
  25246. FLY: 'transition.fly',
  25247. FADEOUT: 'transition.fade',
  25248. INSTANT: 'transition.instant'
  25249. })
  25250. },
  25251. {}
  25252. ],
  25253. 163: [
  25254. function (e, t, i) {
  25255. 'use strict'
  25256. t.exports = {
  25257. current: '1.0',
  25258. supported: ['1.0'],
  25259. deprecated: [],
  25260. isSupported: function (e) {
  25261. return this.supported.indexOf(e) !== -1
  25262. },
  25263. isDeprecated: function (e) {
  25264. return this.deprecated.indexOf(e) !== -1
  25265. },
  25266. isValid: function (e) {
  25267. return this.isSupported(e) || this.isDeprecated(e)
  25268. }
  25269. }
  25270. },
  25271. {}
  25272. ],
  25273. 164: [
  25274. function (e, t, i) {
  25275. ;(function (i) {
  25276. 'use strict'
  25277. function n(e, t, i) {
  25278. e && (e = e.toLowerCase().trim())
  25279. var n = new I.UP.clone(),
  25280. r = Math.PI / 3,
  25281. o = Math.PI / 2
  25282. switch (e) {
  25283. case 'left':
  25284. i.copy(t), i.applyAxisAngle(n, o)
  25285. break
  25286. case 'right':
  25287. i.copy(t), i.applyAxisAngle(n, -o)
  25288. break
  25289. case 'forwardleft':
  25290. i.copy(t), i.applyAxisAngle(n, r)
  25291. break
  25292. case 'forwardright':
  25293. i.copy(t), i.applyAxisAngle(n, -r)
  25294. break
  25295. case 'forward':
  25296. default:
  25297. i.copy(t)
  25298. }
  25299. return i
  25300. }
  25301. function r(e, t) {
  25302. if (e) {
  25303. var i = {
  25304. pano: e,
  25305. lookAtPoint: null,
  25306. duration: null,
  25307. maxDistanceOverride: null,
  25308. skipWarpingCheck: !1
  25309. }
  25310. this.player.flyToPano(i, function () {
  25311. t &&
  25312. t({
  25313. success: !0,
  25314. message: 'Transition complete.'
  25315. })
  25316. })
  25317. } else
  25318. R.warn('Showcase -> clickPanoObject: Unable to find pano.'),
  25319. t &&
  25320. t({
  25321. success: !1,
  25322. error: 'Unable to find pano.'
  25323. })
  25324. }
  25325. function o(e, t) {
  25326. var i = this.findRankedPano(e, t)
  25327. return i >= 0 ? this.handleToObject[i] : (R.warn('Showcase -> findRankedPanoObject: Unable to find nearby pano.'), null)
  25328. }
  25329. function a(e, t) {
  25330. var i = this.findRankedtag(e, t)
  25331. return i >= 0 ? this.handleToObject[i] : (R.warn('Showcase -> findRankedtagObject: Unable to find nearby tag.'), null)
  25332. }
  25333. function s(e, t) {
  25334. t.copy(I.FORWARD), e.getDirection(t)
  25335. }
  25336. function l(e) {
  25337. function t(e) {
  25338. var t = new c.Euler().setFromQuaternion(e.quaternion, 'YXZ')
  25339. return {
  25340. x: c.Math.radToDeg(t._x),
  25341. y: c.Math.radToDeg(t._y),
  25342. z: c.Math.radToDeg(t._z)
  25343. }
  25344. }
  25345. var i = function (e) {
  25346. return e.alignmentType !== m.ALIGNED
  25347. ? null
  25348. : {
  25349. x: e.position.x,
  25350. y: e.position.y,
  25351. z: e.position.z
  25352. }
  25353. }
  25354. return {
  25355. panos: e.panos.list.map(function (n) {
  25356. var r = y.getCubemapUrls(e.urls, n.id, 'high')[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z]
  25357. return {
  25358. uuid: n.id,
  25359. aligned: n.alignmentType === m.ALIGNED,
  25360. neighbourUUIDs: n.neighbourUUIDs.slice(),
  25361. position: i(n),
  25362. rotation: t(n),
  25363. thumbnail: r
  25364. }
  25365. })
  25366. }
  25367. }
  25368. var c = e('three'),
  25369. h = e('./ApiHost'),
  25370. u = e('../util/logger'),
  25371. d = e('../util/common'),
  25372. p = e('../util/math'),
  25373. f = e('../enum/ModelManagerEvents'),
  25374. g = e('./PostMessageType'),
  25375. m = e('../enum/AlignmentType'),
  25376. v = e('../enum/Direction'),
  25377. A = e('./TransitionStyles'),
  25378. y = e('../util/panorama'),
  25379. C = e('../enum/GLCubeFaces'),
  25380. I = e('../enum/Vectors'),
  25381. E = e('../enum/Viewmode'),
  25382. b = e('../enum/WarpStyle'),
  25383. w = (e('../enum/Keys'), e('../enum/PlayerEvents')),
  25384. _ = e('../sdk/SdkEvents'),
  25385. I = e('../enum/Vectors'),
  25386. T = e('../enum/ControlEvents'),
  25387. x = e('../enum/RenderLayers'),
  25388. S = (e('../constants'), e('../settings')),
  25389. M = e('../lib/jpeg_encoder'),
  25390. R = new u(i),
  25391. P = (function () {
  25392. var e = function e() {
  25393. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD), e.player.getDirection(e.playerDirection), e.projectVectors()
  25394. var t = e.playerDirection.angleTo(e.lastFacingDirection)
  25395. if (((e.angleTravelled += Math.abs(t)), e.angleTravelled >= Math.abs(e.angle))) {
  25396. if (((e.active = !1), e.onDone)) {
  25397. var i = e.onDone
  25398. i()
  25399. }
  25400. } else e.lastFacingDirection.copy(e.playerDirection), window.setTimeout(e, 4)
  25401. }
  25402. return (
  25403. (e.active = !1),
  25404. (e.angle = 0),
  25405. (e.angleTravelled = 0),
  25406. (e.playerDirection = new c.Vector3()),
  25407. (e.lastFacingDirection = new c.Vector3()),
  25408. (e.onDone = null),
  25409. (e.player = null),
  25410. (e.start = function (t, i, n, r) {
  25411. ;(e.active = !0),
  25412. t && i && (i = 0),
  25413. (e.angle = t || i),
  25414. (e.xAngle = t),
  25415. (e.yAngle = i),
  25416. (e.angleTravelled = 0),
  25417. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25418. n.getDirection(e.playerDirection),
  25419. e.lastFacingDirection.copy(e.playerDirection),
  25420. e.projectVectors(),
  25421. (e.onDone = r),
  25422. (e.player = n),
  25423. e()
  25424. }),
  25425. (e.projectVectors = function () {
  25426. e.xAngle && (e.playerDirection.projectOnPlane(I.UP), e.lastFacingDirection.projectOnPlane(I.UP))
  25427. }),
  25428. e
  25429. )
  25430. })(),
  25431. O = (function () {
  25432. var e = new c.Vector3()
  25433. return function (t) {
  25434. t ? (e.copy(t.position), e.add(t.discPosition), p.projectPositionToCanvas(e, this.player.camera, e), this.click(e.x, e.y)) : R.warn('Showcase -> clicktagObject: Unable to find tag.')
  25435. }
  25436. })(),
  25437. L = function () {
  25438. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  25439. },
  25440. D = function () {
  25441. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  25442. },
  25443. N = (function (e) {
  25444. var t = new c.Vector3()
  25445. return function (e) {
  25446. var i = this.player.getDirection()
  25447. t.copy(i)
  25448. var n = t.y
  25449. ;(t.y = 0), t.normalize()
  25450. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1)
  25451. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA) return 0 !== e && R.warn('Cannot rotate in y direction when in ' + this.player.mode + ' mode'), 0
  25452. this.player.mode === E.DOLLHOUSE && (r = -r)
  25453. var o = L.call(this) - 0.1,
  25454. a = D.call(this) + 0.1,
  25455. s = r + e
  25456. s > o ? (s = o) : s < a && (s = a)
  25457. var l = s - r
  25458. return e > 0 && l < 0.01 && (l = 0), e < 0 && l > -0.01 && (l = 0), l
  25459. }
  25460. })(),
  25461. B = (function () {
  25462. var e = new c.Euler()
  25463. return function (t) {
  25464. return (
  25465. e.setFromQuaternion(t.quaternion, 'YXZ'),
  25466. {
  25467. position: {
  25468. x: t.position.x,
  25469. y: t.position.y,
  25470. z: t.position.z
  25471. },
  25472. rotation: {
  25473. x: c.Math.radToDeg(e.x),
  25474. y: c.Math.radToDeg(e.y),
  25475. z: 0
  25476. },
  25477. pano: t.currentPano ? t.currentPano.id : null,
  25478. mode: t.mode
  25479. }
  25480. )
  25481. }
  25482. })(),
  25483. F = null
  25484. t.exports = {
  25485. init: function (e, t, i, n, r) {
  25486. V.init(e, t, i, r),
  25487. (F = new Promise(
  25488. function (e, t) {
  25489. i.on(w.Ready, function () {
  25490. e()
  25491. })
  25492. }.bind(this)
  25493. ))
  25494. var o = new h(window),
  25495. a = o.waitForConnection()
  25496. a.then(function (e) {
  25497. o.on(g.ACTION, V.onMessageReceive.bind(V))
  25498. })
  25499. var s = (function () {
  25500. var e = Date.now()
  25501. return function () {
  25502. if (!(Date.now() - e < 100)) {
  25503. var t = B(i)
  25504. o.sendEvent(_.MOVE, {
  25505. state: t
  25506. }),
  25507. (e = Date.now())
  25508. }
  25509. }
  25510. })()
  25511. i.on(w.Move, s),
  25512. i.on(w.ViewChanged, s),
  25513. n.on(f.ActiveModelChanged, function (e) {
  25514. function t(e) {
  25515. var t,
  25516. i = e.newPano.id
  25517. e.oldPano && (t = e.oldPano.id),
  25518. i !== t &&
  25519. o.sendEvent(_.ENTER_PANO, {
  25520. oldPano: t,
  25521. newPano: i
  25522. })
  25523. }
  25524. var i = e.model,
  25525. n = e.oldModel
  25526. ;(V.model = i),
  25527. a.then(function () {
  25528. o.sendEvent(_.MODEL_LOADED, {
  25529. metadata: l(i)
  25530. })
  25531. }),
  25532. n &&
  25533. n.panos.forEach(function (e) {
  25534. e.removeEventListener('enter', t)
  25535. }),
  25536. i.panos.forEach(function (e) {
  25537. e.on('enter', t)
  25538. })
  25539. })
  25540. }
  25541. }
  25542. var V = {
  25543. director: null,
  25544. player: null,
  25545. controls: null,
  25546. sceneRenderer: null,
  25547. model: null,
  25548. init: function (e, t, i, n) {
  25549. ;(this.director = e), (this.player = i), (this.controls = t), (this.sceneRenderer = n)
  25550. },
  25551. handleToObject: {},
  25552. objectToHandle: {},
  25553. handleCount: 0,
  25554. onMessageReceive: function (e) {
  25555. if (e) {
  25556. var t = e.targetFunction,
  25557. i = e.params,
  25558. n = e.onDone
  25559. t && this[t] && this[t](i, n)
  25560. }
  25561. },
  25562. waitForInit: function (e, t) {
  25563. F.then(
  25564. t.bind({
  25565. success: !0,
  25566. message: 'Init complete.'
  25567. })
  25568. )
  25569. },
  25570. moveToPano: (function (e, t) {
  25571. var i = new c.Euler(0, 0, 0, 'YXZ'),
  25572. n = new c.Quaternion()
  25573. return function (e, t) {
  25574. var r = e.pano,
  25575. o = e.rotation,
  25576. a = e.transition
  25577. if (!this.model)
  25578. return t({
  25579. success: !1,
  25580. error: 'The model has not been loaded yet'
  25581. })
  25582. var s = this.model.panos.get(r)
  25583. if (!s)
  25584. return t({
  25585. success: !1,
  25586. error: r + ' does not exist in this model'
  25587. })
  25588. if (!o)
  25589. return t({
  25590. sucess: !1,
  25591. erorr: o + ' is not a valid rotation'
  25592. })
  25593. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), 'YXZ'), console.log(o.z)
  25594. var l = {
  25595. success: !0,
  25596. message: r
  25597. }
  25598. if (a === A.FADEOUT) n.setFromEuler(i), this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l))
  25599. else {
  25600. var h, u
  25601. a === A.INSTANT && ((h = 0), (u = 0))
  25602. var d = I.FORWARD.clone().applyEuler(i).add(s.position)
  25603. this.player.flyToPano(
  25604. {
  25605. pano: s,
  25606. lookAtPoint: d,
  25607. duration: h,
  25608. aimDuration: u
  25609. },
  25610. t.bind(this, l)
  25611. )
  25612. }
  25613. }
  25614. })(),
  25615. moveInDirection: function (e, t) {
  25616. var i = e.direction
  25617. return 'undefined' == typeof v[i]
  25618. ? (R.warn('Showcase -> moveInDirection: Cannot move in invalid direction.'),
  25619. void (
  25620. t &&
  25621. t({
  25622. success: !1,
  25623. error: 'Invalid direction.'
  25624. })
  25625. ))
  25626. : void this.player.flyLocalDirection(I[i].clone()).then(function (e) {
  25627. t(
  25628. e
  25629. ? {
  25630. success: !0,
  25631. message: 'moved ' + i
  25632. }
  25633. : {
  25634. success: !1,
  25635. error: 'Cannot move in direction: ' + i
  25636. }
  25637. )
  25638. })
  25639. },
  25640. getPose: function (e, t) {
  25641. this.player.camera.position, new c.Euler().setFromQuaternion(this.player.camera.quaternion, 'YXZ')
  25642. return t({
  25643. success: !0,
  25644. message: B(this.player)
  25645. })
  25646. },
  25647. takeScreenShot: (function () {
  25648. var e = new c.PerspectiveCamera(),
  25649. t = new c.WebGLRenderTarget()
  25650. return function (i, n) {
  25651. if (!i.resolution)
  25652. return n({
  25653. success: !1,
  25654. error: 'An invalid resolution was specified'
  25655. })
  25656. if (i.resolution.width === -1 || i.resolution.height === -1) {
  25657. var r = this.sceneRenderer.renderer.getSize()
  25658. ;(i.resolution.width = r.width), (i.resolution.height = r.height)
  25659. }
  25660. e.layers.set(x.DEFAULT),
  25661. i.visibleObjects &&
  25662. (i.visibleObjects.showtags && e.layers.enable(x.TAG), i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS), i.visibleObjects.showReticule && e.layers.enable(x.RETICULE))
  25663. var o = i.resolution.width,
  25664. a = i.resolution.height,
  25665. s = o / a
  25666. e.position.copy(this.sceneRenderer.camera.position),
  25667. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  25668. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  25669. (e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s),
  25670. t.setSize(o, a),
  25671. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t)
  25672. var l = new Uint8Array(o * a * 4)
  25673. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l)
  25674. var c = M.encode(
  25675. {
  25676. data: l,
  25677. width: o,
  25678. height: a,
  25679. heading: 180,
  25680. pitch: 0
  25681. },
  25682. {
  25683. quality: 75,
  25684. flipY: !0
  25685. }
  25686. ),
  25687. h = 'data:image/jpg;base64,' + d.uint8ToBase64(c.data)
  25688. n({
  25689. success: !0,
  25690. message: h
  25691. })
  25692. }
  25693. })(),
  25694. findRankedPano: (function (e, t) {
  25695. var i = new c.Vector3(),
  25696. r = new c.Vector3()
  25697. return function (e, t) {
  25698. s(this.player, r), n(t, r, i)
  25699. var o = this.player.rankedPanoInDirection(e, i)
  25700. if (o) {
  25701. var a = this.objectToHandle[o.id]
  25702. return a || ((this.objectToHandle[o.id] = a = this.handleCount++), (this.handleToObject[a] = o)), a
  25703. }
  25704. return R.warn('Showcase -> findRankedPano: Unable to find nearby pano.'), -1
  25705. }
  25706. })(),
  25707. findRankedtag: (function (e, t) {
  25708. var i = new c.Vector3(),
  25709. r = new c.Vector3()
  25710. return function (e, t) {
  25711. s(this.player, r), n(t, r, i)
  25712. var o = this.player.rankedtagInDirection(e, i)
  25713. if (o) {
  25714. var a = this.objectToHandle[o.sid]
  25715. return a || ((this.objectToHandle[o.sid] = a = this.handleCount++), (this.handleToObject[a] = o)), a
  25716. }
  25717. return R.warn('Showcase -> findRankedtag: Unable to find nearby tag.'), -1
  25718. }
  25719. })(),
  25720. clickNearesttag: function (e) {
  25721. this.clickRankedtag(0, e)
  25722. },
  25723. clickRankedtag: function (e, t) {
  25724. var i = a.call(this, e, t)
  25725. i && O.call(this, i)
  25726. },
  25727. clickNearestPano: function (e, t) {
  25728. this.clickRankedPano(0, e, t)
  25729. },
  25730. clickRankedPano: function (e, t, i) {
  25731. var n = o.call(this, e, t)
  25732. n ? r.call(this, n, i) : i(null)
  25733. },
  25734. clickPano: function (e, t) {
  25735. var i = this.handleTable[e]
  25736. i ? r.call(this, i, t) : t(null)
  25737. },
  25738. rotateDirection: (function () {
  25739. return function (e, t) {
  25740. var i = e.direction,
  25741. n = e.angle
  25742. if (!P.active) {
  25743. var r = 0,
  25744. o = 0,
  25745. a = 0,
  25746. s = 0
  25747. if (!n || isNaN(n))
  25748. return (
  25749. R.warn('Showcase -> rotateDirection: Invalid rotation angle.'),
  25750. void (
  25751. t &&
  25752. t({
  25753. success: !1,
  25754. error: 'Invalid rotation angle.'
  25755. })
  25756. )
  25757. )
  25758. if (this.player.mode === E.TRANSITIONING)
  25759. return (
  25760. R.warn('Automation -> rotateDirection: Cannot rotate while transitioning'),
  25761. void (
  25762. t &&
  25763. t({
  25764. success: !1,
  25765. error: 'Cannot rotate while transitioning'
  25766. })
  25767. )
  25768. )
  25769. if (i === v.RIGHT || i === v.LEFT) i === v.RIGHT && (n = -n), (r = n > 0 ? -1 : 1), (a = n)
  25770. else {
  25771. if (i !== v.UP && i !== v.DOWN)
  25772. return (
  25773. R.warn('Showcase -> rotateDirection: Invalid direction for rotation: ' + i),
  25774. void (
  25775. t &&
  25776. t({
  25777. success: !1,
  25778. error: 'Invalid direction for rotation.'
  25779. })
  25780. )
  25781. )
  25782. if (this.player.mode === E.FLOORPLAN)
  25783. return (
  25784. R.warn('Showcase -> rotateDirection: Cannot rotate ' + i + ' in floorplan mode'),
  25785. void (
  25786. t &&
  25787. t({
  25788. success: !1,
  25789. error: 'Cannot rotate ' + i + ' in floorplan mode'
  25790. })
  25791. )
  25792. )
  25793. if ((i === v.DOWN && (n = -n), (n = N.call(this, n)), 0 === n))
  25794. return (
  25795. R.warn('Showcase -> rotateDirection: Already at maximum rotation in direction: ' + i),
  25796. void (
  25797. t &&
  25798. t({
  25799. success: !1,
  25800. error: 'Already at maximum rotation in direction: ' + i
  25801. })
  25802. )
  25803. )
  25804. ;(o = n > 0 ? 1 : -1), (s = n)
  25805. }
  25806. var l = n
  25807. ;(n = c.Math.degToRad(n)), (a = c.Math.degToRad(a)), (s = c.Math.degToRad(s))
  25808. var h = this.controls.activeControl,
  25809. u = function () {
  25810. h.stopRotating(!0),
  25811. t &&
  25812. t({
  25813. success: !0,
  25814. message: 'Rotated ' + l.toFixed(2) + '° in direction: ' + e.direction
  25815. })
  25816. }
  25817. h.startRotating(r, o), P.start(a, s, this.player, u)
  25818. }
  25819. }
  25820. })(),
  25821. rotate: (function () {
  25822. var e = new c.Vector3(),
  25823. t = new c.Vector3()
  25824. return function (i, n) {
  25825. var r = i.xAngle,
  25826. o = i.yAngle
  25827. if (!P.active) {
  25828. if (((r = r || 0), (o = o || 0), isNaN(r) || isNaN(o)))
  25829. return (
  25830. R.warn('Showcase -> rotate: Invalid rotation angle.'),
  25831. void (
  25832. n &&
  25833. n({
  25834. success: !1,
  25835. error: 'Invalid rotation angle.'
  25836. })
  25837. )
  25838. )
  25839. if (this.player.mode === E.TRANSITIONING)
  25840. return (
  25841. R.warn('Automation -> rotate: Cannot rotate while transitioning'),
  25842. void (
  25843. n &&
  25844. n({
  25845. success: !1,
  25846. error: 'Cannot rotate while transitioning'
  25847. })
  25848. )
  25849. )
  25850. Math.abs(r) < 0.01 && (r = 0), Math.abs(o) < 0.01 && (o = 0)
  25851. var a = o
  25852. ;(o = N.call(this, o)), (r = -r)
  25853. var s = a > 0 ? 'UP' : 'DOWN'
  25854. if (!r && a && !o)
  25855. return (
  25856. R.warn('Showcase -> rotate: Already at maximum rotation in direction: ' + s),
  25857. void (
  25858. n &&
  25859. n({
  25860. success: !1,
  25861. error: 'Already at maximum rotation in direction: ' + s
  25862. })
  25863. )
  25864. )
  25865. a > o && R.warn('Showcase -> rotate: Reached maximum rotation in direction: ' + s)
  25866. var l = o
  25867. ;(o = c.Math.degToRad(o)),
  25868. (r = c.Math.degToRad(r)),
  25869. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  25870. this.player.getDirection(e),
  25871. t.copy(e).applyAxisAngle(I.UP, r),
  25872. t.applyAxisAngle(I.RIGHT, o)
  25873. var h = (e.angleTo(t), r > 0 ? -1 : r < 0 ? 1 : 0),
  25874. u = o > 0 ? 1 : o < 0 ? -1 : 0
  25875. Math.abs(r) > Math.abs(o) ? (u *= Math.abs(o / r)) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o))
  25876. var d = this.controls.activeControl,
  25877. p = function () {
  25878. d.stopRotating(!0),
  25879. n &&
  25880. n({
  25881. success: !0,
  25882. message: 'Rotated ' + i.xAngle.toFixed(2) + '° horizontally, ' + l.toFixed(2) + '° vertically'
  25883. })
  25884. }
  25885. d.startRotating(h, u), P.start(r, o, this.player, p)
  25886. }
  25887. }
  25888. })(),
  25889. panCamera: function (e, t) {
  25890. function i(e) {
  25891. switch ((r.removeAllListeners(T.AutoPanComplete), r.removeAllListeners(T.AutoPanInterrupt), r.removeAllListeners(T.AutoPanClamped), e)) {
  25892. case T.AutoPanInterrupt:
  25893. t({
  25894. success: !0,
  25895. message: 'Camera panning interrupted.'
  25896. })
  25897. break
  25898. case T.AutoPanClamped:
  25899. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  25900. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < 0.01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < 0.01)
  25901. return void t({
  25902. success: !1,
  25903. error: 'Already at edge of current model bounds.'
  25904. })
  25905. var i = 'The view point is outside the bounds for the current model. '
  25906. ;(i += 'The view point was clamped to ' + o(r.target.x, r.target.z)), console.warn(i)
  25907. }
  25908. case T.AutoPanComplete:
  25909. t({
  25910. success: !0,
  25911. message: 'Panned camera to position ' + o(r.autoPanPosition.x, r.autoPanPosition.z)
  25912. })
  25913. }
  25914. }
  25915. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  25916. return t({
  25917. success: !1,
  25918. error: 'Camera panning is not available in the current mode: ' + this.player.mode
  25919. })
  25920. var n = e.position,
  25921. r = this.player.control
  25922. r.setAutoPanPosition(n.x, n.z), (r.autoPan = !0)
  25923. var o = function (e, t) {
  25924. return '(' + e.toFixed(2) + ', ' + t.toFixed(2) + ')'
  25925. }
  25926. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)), r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)), r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  25927. },
  25928. click: function (e, t) {
  25929. var i = e.x,
  25930. n = e.y,
  25931. r = e.percentage
  25932. r === !0 && ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())),
  25933. this.player.handleInputStart(i, n),
  25934. this.player.updateIntersect(),
  25935. this.player.handleInputEnd(i, n)
  25936. },
  25937. mouseOver: function (e, t) {
  25938. var i = e.x,
  25939. n = e.y,
  25940. r = e.percentage
  25941. r === !0 && ((i = (i / 100) * $('#player').width()), (n = (n / 100) * $('#player').height())), this.player.handleInputMove(i, n), this.player.updateIntersect()
  25942. },
  25943. moveToMode: function (e, t) {
  25944. function i(e) {
  25945. t(
  25946. e
  25947. ? {
  25948. success: !1,
  25949. error: 'Failed to load new mode: ' + e
  25950. }
  25951. : {
  25952. success: !0,
  25953. message: 'Moved to new mode: ' + n
  25954. }
  25955. )
  25956. }
  25957. var n = e.mode
  25958. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN
  25959. ? this.director.changeMode(n).then(
  25960. function () {
  25961. i()
  25962. },
  25963. function (e) {
  25964. i(e)
  25965. }
  25966. )
  25967. : t({
  25968. success: !1,
  25969. error: 'Invalid mode selection'
  25970. })
  25971. }
  25972. }
  25973. }).call(this, '/js/sdk/automation.js')
  25974. },
  25975. {
  25976. '../constants': 8,
  25977. '../enum/AlignmentType': 17,
  25978. '../enum/ControlEvents': 21,
  25979. '../enum/Direction': 22,
  25980. '../enum/GLCubeFaces': 25,
  25981. '../enum/Keys': 30,
  25982. '../enum/ModelManagerEvents': 33,
  25983. '../enum/PlayerEvents': 40,
  25984. '../enum/RenderLayers': 41,
  25985. '../enum/Vectors': 50,
  25986. '../enum/Viewmode': 51,
  25987. '../enum/WarpStyle': 52,
  25988. '../lib/jpeg_encoder': 94,
  25989. '../sdk/SdkEvents': 161,
  25990. '../settings': 166,
  25991. '../util/common': 185,
  25992. '../util/logger': 189,
  25993. '../util/math': 190,
  25994. '../util/panorama': 191,
  25995. './ApiHost': 159,
  25996. './PostMessageType': 160,
  25997. './TransitionStyles': 162,
  25998. three: 217
  25999. }
  26000. ],
  26001. 165: [
  26002. function (e, t, i) {
  26003. 'use strict'
  26004. function n(e) {
  26005. ;(this.sourceWindow = e), (this.targetWindow = null), (this.targetOrigin = null), (this.id = Math.floor(1e5 * Math.random())), this.bindEvents()
  26006. }
  26007. var r = e('./PostMessageType'),
  26008. o = e('events').EventEmitter
  26009. ;(n.prototype = Object.create(o.prototype)),
  26010. (n.prototype.bindEvents = function () {
  26011. this.sourceWindow.addEventListener('message', this.onPostmessageReceived.bind(this))
  26012. }),
  26013. (n.prototype.setTarget = function (e, t) {
  26014. ;(this.targetWindow = e), (this.targetOrigin = t)
  26015. }),
  26016. (n.prototype.onPostmessageReceived = function (e) {
  26017. var t = e.origin || e.originalEvent.origin,
  26018. i = e.source
  26019. switch (e.data.type) {
  26020. case r.CONNECT:
  26021. break
  26022. case r.RESPONSE:
  26023. if (this.id !== e.data.toId) return
  26024. default:
  26025. if (!this.validateMessageOrigin(t)) return
  26026. }
  26027. var n = e.data
  26028. ;(n.source = i), (n.origin = t), (n.timestamp = Date.now()), this.emit(e.data.type, n)
  26029. }),
  26030. (n.prototype.validateMessageOrigin = function (e) {
  26031. return '*' === this.targetOrigin || e === this.targetOrigin
  26032. }),
  26033. (n.prototype.send = function (e) {
  26034. this.targetWindow && this.targetOrigin && ((e.fromId = this.id), this.targetWindow.postMessage(e, this.targetOrigin))
  26035. }),
  26036. (t.exports = n)
  26037. },
  26038. {
  26039. './PostMessageType': 160,
  26040. events: 202
  26041. }
  26042. ],
  26043. 166: [
  26044. function (e, t, i) {
  26045. 'use strict'
  26046. var n = e('three'),
  26047. r = e('./util/browser'),
  26048. o = e('./enum/Viewmode'),
  26049. a = e('./enum/VROption'),
  26050. s = e('./enum/Colors'),
  26051. l = e('./enum/WarpStyle'),
  26052. c = e('./util/easing'),
  26053. h = e('./util/common'),
  26054. u = e('./util/showcase'),
  26055. d = e('./constants'),
  26056. p = {
  26057. debug: !1,
  26058. version: '2.25.6-0-gd87e5b1',
  26059. languageTag: r.valueFromHash('lang', null),
  26060. pageTitle: '四维虚拟漫游',
  26061. authorizationHeader: u.getAuthorizationHeader(),
  26062. autoplay: r.valueFromHash('play', !1) || !r.inIframe(),
  26063. logLevel: r.valueFromHash('log', 2),
  26064. skyboxRadius: 2500,
  26065. modelBoundsPadding: 5,
  26066. showNeighbors: !1,
  26067. brand: r.valueFromHash('brand', !0),
  26068. showHighlights: r.valueFromHash('hhl', !0) && r.valueFromHash('hr', 1),
  26069. startHighlights: r.valueFromHash('hl', -1),
  26070. specialEdition: r.valueFromHash('bn', 0),
  26071. useWheel: r.valueFromHash('wh', !0),
  26072. crossOrigin: 'anonymous',
  26073. fancierTransition: !1,
  26074. wireframe: !1,
  26075. skyboxWireframe: !1,
  26076. modelAlpha: 1,
  26077. highlightPanoSelection: !1,
  26078. showSweeps: !0,
  26079. showSkyboxes: !1,
  26080. showMesh: !0,
  26081. showFloors: !1,
  26082. showFloorDuration: 300,
  26083. showFloorDelay: 300,
  26084. hideFloorDuration: 300,
  26085. hideFloorDelay: 0,
  26086. reticuleOpacityTransitionTime: 250,
  26087. reticuleColor: window.DATA.mouseMarkerColor || s.newBlue, // 方奕卓 配置鼠标标志颜色
  26088. markerOpacityTransitionTime: 500,
  26089. guiAnimationSpeed: 250,
  26090. highlightAnimationDuration: 500,
  26091. modelComponentLoadSpinnerDelay: 150,
  26092. captureErrors: !1,
  26093. maxMobileTextures: 6,
  26094. minimalMemoryMode: r.valueFromHash('m3', r.isMobile()),
  26095. startupFlyinDelay: 3e3,
  26096. dollhouseDefault: {
  26097. minDistance: 15,
  26098. maxDistance: 50,
  26099. minPolarAngle: n.Math.degToRad(10),
  26100. maxPolarAngle: n.Math.degToRad(90)
  26101. },
  26102. hideReticuleTimeout: 1e3,
  26103. analytics: {
  26104. inactivityThreshold: 30,
  26105. sessionTrackingRate: 0.15,
  26106. maxTrackedErrors: 20,
  26107. sessionDurationPingFrequency: 10,
  26108. sessionDurationTimeout: 15
  26109. },
  26110. flydown: {
  26111. movementEasing: 'easeInOutQuad',
  26112. movementDelay: 0.001,
  26113. rotationEasing: 'easeInOutQuad',
  26114. rotationDelay: 0.5,
  26115. modelTextureDelay: 0.75,
  26116. skyboxDelay: 0.75
  26117. },
  26118. transition: {
  26119. flySpeed: 0.001,
  26120. flyTime: 750,
  26121. flytimeMaxDistanceThreshold: 5,
  26122. flytimeDistanceMultiplier: 150,
  26123. aimTime: 1500,
  26124. aimSlowFactor: 1.5,
  26125. blur: 0.8,
  26126. movementEasing: 'easeInOutQuad',
  26127. blendEasing: 'easeInOutQuad',
  26128. fastForwardFactor: 4 //r.valueFromHash("mfis", 3) //快速停止导览的速度,原先是3
  26129. },
  26130. show360Views: {
  26131. enabled: !0,
  26132. transitionTime: 1e3
  26133. },
  26134. quickstart: {
  26135. enabled: 1 === r.valueFromHash('qust', 0) || 1 === r.valueFromHash('qs', 0),
  26136. animation: 1400,
  26137. showTextDelay: 500,
  26138. fadeOutDelay: 3e3,
  26139. fovChange: 10
  26140. },
  26141. appConfig: {
  26142. webvr_version: null,
  26143. segment_key: null,
  26144. embedly_key: null,
  26145. branch_key: null,
  26146. keen_write_key: null,
  26147. keen_project_id: null
  26148. },
  26149. vr: {
  26150. enabled: !0,
  26151. allowWebVR: !1,
  26152. option: r.valueFromHash('vr', a.CONTEXTUAL)
  26153. },
  26154. share: {
  26155. enabled: !r.valueFromHash('mls', 0) && r.valueFromHash('brand', !0)
  26156. },
  26157. input: {
  26158. longTapThreshold: 200,
  26159. moveToleranceNDC: 0.01, //.08,
  26160. touchMoveThreshold: 25
  26161. },
  26162. help: {
  26163. modalStayDuration: 600
  26164. },
  26165. immersive: {
  26166. timeToShowAgain: 1250,
  26167. uiStayDuration: 600
  26168. },
  26169. tourInteraction: {
  26170. disabled: '0' === r.valueFromHash('tourcta', null),
  26171. showPauseButton: 1e3,
  26172. showModal: 1500,
  26173. allowNextClick: 200,
  26174. largeModal: '1' === r.valueFromHash('tourcta', null),
  26175. smallModal: '2' === r.valueFromHash('tourcta', null)
  26176. },
  26177. labels: {
  26178. enabled: !1,
  26179. hideUntilStart: !0,
  26180. fadeInDuration: 250,
  26181. fadeInDelay: 250,
  26182. fadeOutDuration: 250,
  26183. fadeOutDelay: 0,
  26184. zoomHideThreshhold: {
  26185. mobile: r.isSmallScreen() ? 0.45 : 0.6,
  26186. desktop: 2
  26187. },
  26188. zoomTruncateThreshhold: {
  26189. mobile: r.isSmallScreen() ? 0.35 : 0.45,
  26190. desktop: 0.85
  26191. },
  26192. minLengthForTruncate: 16,
  26193. truncateLength: 12,
  26194. truncateSuffix: '...'
  26195. },
  26196. tags: {
  26197. enabled: r.valueFromHash('mt', 1),
  26198. startup: {
  26199. hideUntilStart: !0,
  26200. fadeInDuration: 500,
  26201. fadeInDelay: 100
  26202. },
  26203. visibility: {
  26204. anyDistance: !0,
  26205. visibleDistance: 8,
  26206. cameraClearance: 0.1,
  26207. alphaTestLevel: 0.05,
  26208. hideViaFloor: !0,
  26209. hideOffScreenDisc: !1,
  26210. hideOffScreenObject: !1
  26211. },
  26212. disc: {
  26213. opacity: 1,
  26214. disabledOpacity: 0.5,
  26215. scale: {
  26216. nearBound: 1.5,
  26217. farBound: 4.8,
  26218. linkFarBound: !1,
  26219. linkPercent: 40,
  26220. maxSize: 80,
  26221. minSize: 40,
  26222. baseViewportSize: 800,
  26223. responsiveness: 100
  26224. }
  26225. },
  26226. pole: {
  26227. enabled: !0,
  26228. height: 0.5,
  26229. width: 2,
  26230. opacity: 0.5,
  26231. color: 'white'
  26232. },
  26233. navigate: {
  26234. nearestPano: !0,
  26235. lineOfSight: !0,
  26236. reactivate: !0,
  26237. aimAt: 'disc',
  26238. tiltTolerance: 25,
  26239. rotateSpeedFactor: 0.6
  26240. }
  26241. },
  26242. path: {
  26243. color: window.DATA.floorMarkerColor || s.newBlue, // 方奕卓 配置导览标志颜色
  26244. colorUp: s._desat(s.newBlue, 0.5),
  26245. colorDown: s._darken(s.newBlue, 0.35),
  26246. opacity: 0.5,
  26247. style: 'ribbon',
  26248. height: 0.025,
  26249. ribbonWidth: 0.24,
  26250. outsideHeight: 0.5,
  26251. waypointRadius: 0.5,
  26252. waypointIndoorRadius: 0.24,
  26253. waypointPulse: 1e3,
  26254. typ: l.BLACK,
  26255. meshFree: r.valueFromHash('mf', 1),
  26256. mapGuides: r.valueFromHash('guides', !0),
  26257. fadeInTime: 400,
  26258. fadeOutTime: 300
  26259. },
  26260. warp: {
  26261. nearPanoDist: 0.1,
  26262. matchCam: !1,
  26263. blur: 0.33,
  26264. fastTime: 1500,
  26265. teleportTime: 1500, //瞬间过渡的时间
  26266. flytimeDistanceMultiplier: 150, //add
  26267. flyTime: 750, //add
  26268. outsideTime: 2e3,
  26269. lookAheadMax: 0.3,
  26270. lookAheadDist: 2.5,
  26271. softPushDist: 0.37,
  26272. softPushEnd: 0.3,
  26273. softBendAngle: 8,
  26274. softBendTilt: 4,
  26275. softBendEnd: 0.3,
  26276. doBurns: true, //r.valueFromHash("kb", !0),
  26277. burnsAngle: 8, //导览在每个点停留时的旋转角度
  26278. minBurnsAngle: 35,
  26279. minDownAngle: -35,
  26280. maxTurnPerSec: 280,
  26281. maxAimPerSec: 35,
  26282. minRotation: 12,
  26283. maxAimRotation: 33.2,
  26284. turnFriction: 0.2,
  26285. flySpeed: 0.01,
  26286. minWarpTime: 1200,
  26287. warpInterruptionRedirectTime: 500,
  26288. tourStepDelay: r.valueFromHash('st', 0),
  26289. walkDelay: 0,
  26290. walkMaxDist: 50,
  26291. walkMinDist: 0.8,
  26292. walkSlideShowThreshhold: 3000,
  26293. walkExtraPanosDistance: 0.4,
  26294. timePerMeter: 1200,
  26295. motionLeadTime: 5000,
  26296. movementEasing: 'easeInOutQuad',
  26297. blendEasing: 'easeInOutQuad',
  26298. showBunny: !1,
  26299. loop: r.valueFromHash('lp', !1),
  26300. auto: r.valueFromHash('ts', -1),
  26301. eOrder: 'YXZ', //"YXZ",
  26302. stepFactor: 0.25,
  26303. brakeStrength: 2,
  26304. minBrakeAngle: 0.1,
  26305. maxBrakeAngle: 1.8,
  26306. climbEffort: 4
  26307. },
  26308. rotationFriction: 0.05,
  26309. rotationAccelerationInside: 4.5,
  26310. rotationAccelerationOutside: 0.15,
  26311. rotationAfterMoveMultiplier: 40,
  26312. rotationAfterMoveHistoryCount: 5,
  26313. panFriction: 0.09,
  26314. panAccelerationOutside: 60,
  26315. onload: r.valueFromHash('onload', o.PANORAMA),
  26316. zoomNearLimit: 0.1,
  26317. zoomFarLimit: 50,
  26318. navigation: {
  26319. panoScores: !1,
  26320. mouseDirection: !0,
  26321. filterStrictness: 0.75,
  26322. angleFactor: -30,
  26323. directionFactor: 10,
  26324. distanceFactor: -1,
  26325. optionalityFactor: 3
  26326. },
  26327. sdkInit: !1,
  26328. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  26329. console: r.valueFromHash('console', !1),
  26330. noMeshFloorPositionOffset: new n.Vector3(0, -1.2, 0),
  26331. panoramaNeighbourMaxDistance: 5,
  26332. panoFloorClickRadius: 0.35,
  26333. showScreenshotLocations: !1,
  26334. showAxis: !1,
  26335. showNeighbourRaycasts: !1,
  26336. colorMarkerOnLoad: !1,
  26337. colorMarkerByFloor: !1,
  26338. tiling: {
  26339. panoPreRenderRepeatDelay: 2500,
  26340. panoPreRenderDelay: 500,
  26341. preRenderTourPanos: r.valueFromHash('tileprerender', 0),
  26342. tilingFlagNames: ['usetiles', 'tiles'],
  26343. maxNavPanoQuality: r.valueFromHash('maxtileq', null),
  26344. maxZoomPanoQuality: r.valueFromHash('maxztileq', null),
  26345. overlayStyle: r.valueFromHash('tileoverlay', 0),
  26346. uploadIntervalDelay: r.valueFromHash('tileupdelay', 10),
  26347. initialIntervalDelay: r.valueFromHash('itiledelay', 0),
  26348. maxNonBaseUploadsPerFrame: r.valueFromHash('maxnbtpf', 1 /* 2 */),
  26349. maxBaseUploadsPerFrame: r.valueFromHash('maxbtpf', 6),
  26350. customCompression: r.valueFromHash('tilecustcomp', 0),
  26351. // mobileHighQualityOverride: !1,
  26352. mobileHighQualityOverride: 1,
  26353. allowUltraHighResolution: true
  26354. },
  26355. zoom: {
  26356. enabled: true,
  26357. forceOff: r.valueFromHash('nozoom', 0),
  26358. overridemax: r.valueFromHash('maxzoom', null),
  26359. overridemin: r.valueFromHash('minzoom', null),
  26360. max: d.highQualityMaxZoom,
  26361. min: 1,
  26362. transitionStyle: r.valueFromHash('zoomtrans', 1),
  26363. activationThreshold: 1.1,
  26364. restoreTime: 500
  26365. },
  26366. profiling: {
  26367. enabled: r.valueFromHash('mem', !1)
  26368. }
  26369. }
  26370. ;(p = h.deepExtend(p, d, {
  26371. insideFOV: r.valueFromHash('fov', d.insideFOV),
  26372. insideFOVMax: r.valueFromHash('fovmax', d.insideFOVMax),
  26373. panorama: {
  26374. transitionTime: 1e3,
  26375. modelAlpha: 0,
  26376. modelAlphaDelay: p.flydown.modelTextureDelay,
  26377. modelAlphaLength: 1,
  26378. skyboxOpacity: 1,
  26379. skyboxOpacityDelay: p.flydown.skyboxDelay,
  26380. skyboxOpacityLength: 0.9,
  26381. fovLength: 1,
  26382. fovDelay: 0,
  26383. cameraMatrixDuration: 0.8,
  26384. cameraMatrixDelay: 0,
  26385. cameraMatrixEase: c.easeInCubic,
  26386. reticuleOpacity: 1,
  26387. markerOpacity: 0.3,
  26388. markerOpacityOnHover: 1
  26389. },
  26390. dollhouse: {
  26391. transitionTime: 1e3,
  26392. modelAlpha: 1,
  26393. modelAlphaDelay: 0,
  26394. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26395. skyboxOpacity: 0,
  26396. skyboxOpacityDelay: 0,
  26397. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26398. fovLength: 1,
  26399. fovDelay: 0,
  26400. cameraMatrixDuration: 0.8,
  26401. cameraMatrixDelay: 0.3,
  26402. cameraMatrixEase: c.easeInCubic,
  26403. reticuleOpacity: 1,
  26404. markerOpacity: 0,
  26405. markerOpacityOnHover: 0
  26406. },
  26407. floorplan: {
  26408. transitionTime: 1e3,
  26409. modelAlpha: 1,
  26410. modelAlphaDelay: 0,
  26411. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  26412. skyboxOpacity: 0,
  26413. skyboxOpacityDelay: 0,
  26414. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  26415. fovLength: 1,
  26416. fovDelay: 0,
  26417. cameraMatrixDuration: 0.5,
  26418. cameraMatrixDelay: 0,
  26419. cameraMatrixEase: c.easeOutCubic,
  26420. reticuleOpacity: 1,
  26421. markerOpacity: 0,
  26422. markerOpacityOnHover: 0,
  26423. cameraHeight: 50
  26424. },
  26425. transitioning: {
  26426. reticuleOpacity: 0,
  26427. markerOpacity: 0.3,
  26428. markerOpacityOnHover: 1
  26429. },
  26430. 'floorplan-dollhouse': {
  26431. rotationDelay: 0,
  26432. rotationDuration: 1
  26433. },
  26434. 'floorplan-panorama': {
  26435. rotationDelay: 0.5,
  26436. rotationDuration: 1
  26437. },
  26438. 'dollhouse-panorama': {
  26439. rotationDelay: 0.5,
  26440. rotationDuration: 1
  26441. },
  26442. 'dollhouse-floorplan': {
  26443. rotationDelay: 0,
  26444. rotationDuration: 1,
  26445. cameraMatrixDuration: 1.05,
  26446. cameraMatrixDelay: 0.5
  26447. },
  26448. 'panorama-dollhouse': {
  26449. rotationDelay: 0,
  26450. rotationDuration: 0.5
  26451. },
  26452. 'panorama-floorplan': {
  26453. transitionTime: 1500,
  26454. rotationDelay: 0,
  26455. rotationDuration: 0.5
  26456. }
  26457. })),
  26458. p.path.meshFree && (p.path.typ = l.WALK),
  26459. (p.zoom.max = p.zoom.overridemax || p.zoom.max),
  26460. (p.zoom.min = p.zoom.overridemin || p.zoom.min),
  26461. (window._settings = t.exports = p)
  26462. },
  26463. {
  26464. './constants': 8,
  26465. './enum/Colors': 19,
  26466. './enum/VROption': 47,
  26467. './enum/Viewmode': 51,
  26468. './enum/WarpStyle': 52,
  26469. './util/browser': 182,
  26470. './util/common': 185,
  26471. './util/easing': 186,
  26472. './util/showcase': 193,
  26473. three: 217
  26474. }
  26475. ],
  26476. 167: [
  26477. function (e, t, i) {
  26478. 'use strict'
  26479. var n = e('three'),
  26480. r = e('./settings'),
  26481. o =
  26482. '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',
  26483. a = 'precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n'
  26484. t.exports = {
  26485. basicTextured: {
  26486. uniforms: {
  26487. tDiffuse: {
  26488. type: 't',
  26489. value: null
  26490. },
  26491. alpha: {
  26492. type: 'f',
  26493. value: 1
  26494. }
  26495. },
  26496. vertexShader: 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  26497. fragmentShader:
  26498. '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}'
  26499. },
  26500. copyCubeMap: {
  26501. uniforms: {
  26502. tDiffuse: {
  26503. type: 't',
  26504. value: null
  26505. },
  26506. alpha: {
  26507. type: 'f',
  26508. value: 1
  26509. }
  26510. },
  26511. vertexShader:
  26512. 'varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  26513. fragmentShader:
  26514. '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}'
  26515. },
  26516. cube: {
  26517. uniforms: {
  26518. map: {
  26519. type: 't',
  26520. value: null
  26521. },
  26522. opacity: {
  26523. type: 'f',
  26524. value: 1
  26525. }
  26526. },
  26527. vertexShader: o + 'varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n',
  26528. fragmentShader:
  26529. a +
  26530. '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'
  26531. },
  26532. model: {
  26533. uniforms: {
  26534. map: {
  26535. type: 't',
  26536. value: null
  26537. },
  26538. modelAlpha: {
  26539. type: 'f',
  26540. value: r.modelAlpha
  26541. },
  26542. opacity: {
  26543. type: 'f',
  26544. value: 1
  26545. },
  26546. progress: {
  26547. type: 'f',
  26548. value: 0
  26549. },
  26550. blackout: {
  26551. type: 'i',
  26552. value: 0
  26553. },
  26554. pano0Map: {
  26555. type: 't',
  26556. value: null
  26557. },
  26558. pano0Position: {
  26559. type: 'v3',
  26560. value: new n.Vector3()
  26561. },
  26562. pano0Matrix: {
  26563. type: 'm4',
  26564. value: new n.Matrix4()
  26565. },
  26566. pano1Map: {
  26567. type: 't',
  26568. value: null
  26569. },
  26570. pano1Position: {
  26571. type: 'v3',
  26572. value: new n.Vector3()
  26573. },
  26574. pano1Matrix: {
  26575. type: 'm4',
  26576. value: new n.Matrix4()
  26577. }
  26578. },
  26579. vertexShader:
  26580. o +
  26581. `uniform vec3 pano0Position;
  26582. uniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\n
  26583. uniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\n
  26584. varying vec3 vWorldPosition0;
  26585. varying vec3 vWorldPosition1;
  26586. uniform int blackout;
  26587. void main() {
  26588. vUv = uv;
  26589. vec4 worldPosition = modelMatrix * vec4(position, 1.0);
  26590. vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;
  26591. vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;
  26592. vWorldPosition0.x *= -1.0;
  26593. vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;
  26594. vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;
  26595. vWorldPosition1.x *= -1.0;
  26596. gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
  26597. }`,
  26598. fragmentShader:
  26599. a +
  26600. `uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\n
  26601. 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
  26602. void main() {
  26603. const vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);
  26604. const vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);
  26605. vec4 colorFromPanos;
  26606. if (blackout == 5){//add for TransitionPass
  26607. colorFromPanos = textureCube( pano1Map, vWorldPosition1.xyz) ;
  26608. }else{
  26609. vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);
  26610. vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);
  26611. if (blackout == 0) {colorFromPanos = mix(colorFromPano0, colorFromPano1, progress);}
  26612. else if (blackout == 1) {
  26613. colorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));
  26614. colorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));
  26615. }
  26616. else if (blackout == 2) {colorFromPanos = mix(colorFromPano0, BLACK, progress);}
  26617. else if (blackout == 3) {colorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));}
  26618. }
  26619. //#ifdef useModelMap //起不了作用为啥
  26620. if(modelAlpha>0.0){
  26621. vec4 colorFromTexture = texture2D( map, vUv );
  26622. colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);
  26623. }
  26624. //#endif
  26625. float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);
  26626. colorFromPanos = mix(colorFromPanos, GREY, whiteness);
  26627. gl_FragColor = vec4(colorFromPanos.rgb, opacity);
  26628. }`
  26629. },
  26630. hot: {
  26631. uniforms: {
  26632. color: {
  26633. type: 'c',
  26634. value: new n.Color(0xff2200)
  26635. },
  26636. opac: {
  26637. type: 'f',
  26638. value: 0
  26639. },
  26640. texture1: {
  26641. type: 't',
  26642. value: null
  26643. },
  26644. texture2: {
  26645. type: 't',
  26646. value: null
  26647. }
  26648. },
  26649. vertexShader: 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  26650. fragmentShader:
  26651. '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'
  26652. },
  26653. modelOutside: {
  26654. uniforms: {
  26655. map: {
  26656. type: 't',
  26657. value: null
  26658. },
  26659. opacity: {
  26660. type: 'f',
  26661. value: 1
  26662. }
  26663. },
  26664. vertexShader: o + 'varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n',
  26665. fragmentShader:
  26666. a +
  26667. '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'
  26668. },
  26669. ribbon: {
  26670. uniforms: {
  26671. map: {
  26672. type: 't',
  26673. value: null
  26674. },
  26675. opacity: {
  26676. type: 'f',
  26677. value: 1
  26678. },
  26679. color: {
  26680. type: 'c',
  26681. value: new n.Color(r.path.color)
  26682. }
  26683. },
  26684. vertexShader:
  26685. o +
  26686. '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',
  26687. fragmentShader:
  26688. a +
  26689. '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'
  26690. },
  26691. waypoint: {
  26692. uniforms: {
  26693. map: {
  26694. type: 't',
  26695. value: null
  26696. },
  26697. opacity: {
  26698. type: 'f',
  26699. value: 1
  26700. },
  26701. pulse: {
  26702. type: 'f',
  26703. value: 1
  26704. },
  26705. nearFade: {
  26706. type: 'v2',
  26707. value: new n.Vector2(2 * r.insideNear, 2 * r.path.waypointIndoorRadius)
  26708. },
  26709. color: {
  26710. type: 'c',
  26711. value: new n.Color(r.reticuleColor)
  26712. }
  26713. },
  26714. vertexShader:
  26715. o +
  26716. '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',
  26717. fragmentShader:
  26718. a +
  26719. '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'
  26720. },
  26721. modelDebug: {
  26722. uniforms: {
  26723. map: {
  26724. type: 't',
  26725. value: null
  26726. },
  26727. modelAlpha: {
  26728. type: 'f',
  26729. value: r.modelAlpha
  26730. },
  26731. depthmapRatio: {
  26732. type: 'f',
  26733. value: 0
  26734. },
  26735. opacity: {
  26736. type: 'f',
  26737. value: 1
  26738. },
  26739. progress: {
  26740. type: 'f',
  26741. value: 0
  26742. },
  26743. considerOcclusion: {
  26744. type: 'i',
  26745. value: r.fancierTransition
  26746. },
  26747. highlightPanoSelection: {
  26748. type: 'i',
  26749. value: 0
  26750. },
  26751. useThirdPano: {
  26752. type: 'i',
  26753. value: r.useThirdPano
  26754. },
  26755. pano0Map: {
  26756. type: 't',
  26757. value: null
  26758. },
  26759. pano0Depth: {
  26760. type: 't',
  26761. value: null
  26762. },
  26763. pano0Position: {
  26764. type: 'v3',
  26765. value: new n.Vector3()
  26766. },
  26767. pano0Matrix: {
  26768. type: 'm4',
  26769. value: new n.Matrix4()
  26770. },
  26771. pano0Weight: {
  26772. type: 'f',
  26773. value: r.transition.pano0Weight
  26774. },
  26775. pano1Map: {
  26776. type: 't',
  26777. value: null
  26778. },
  26779. pano1Depth: {
  26780. type: 't',
  26781. value: null
  26782. },
  26783. pano1Position: {
  26784. type: 'v3',
  26785. value: new n.Vector3()
  26786. },
  26787. pano1Matrix: {
  26788. type: 'm4',
  26789. value: new n.Matrix4()
  26790. },
  26791. pano1Weight: {
  26792. type: 'f',
  26793. value: r.transition.pano1Weight
  26794. },
  26795. pano2Map: {
  26796. type: 't',
  26797. value: null
  26798. },
  26799. pano2Depth: {
  26800. type: 't',
  26801. value: null
  26802. },
  26803. pano2Position: {
  26804. type: 'v3',
  26805. value: new n.Vector3()
  26806. },
  26807. pano2Matrix: {
  26808. type: 'm4',
  26809. value: new n.Matrix4()
  26810. },
  26811. pano2Weight: {
  26812. type: 'f',
  26813. value: r.transition.pano2Weight
  26814. }
  26815. },
  26816. vertexShader:
  26817. o +
  26818. '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',
  26819. fragmentShader:
  26820. a +
  26821. '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'
  26822. },
  26823. customDepth: {
  26824. uniforms: {
  26825. panoPosition: {
  26826. type: 'v3',
  26827. value: new n.Vector3()
  26828. }
  26829. },
  26830. vertexShader:
  26831. o +
  26832. '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',
  26833. fragmentShader:
  26834. a +
  26835. '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'
  26836. },
  26837. skysphere: {
  26838. uniforms: {
  26839. radius: {
  26840. type: 'f',
  26841. value: 0
  26842. }
  26843. },
  26844. vertexShader:
  26845. o +
  26846. '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',
  26847. fragmentShader:
  26848. a +
  26849. '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'
  26850. },
  26851. tagDisc: {
  26852. uniforms: {
  26853. opacity: {
  26854. type: 'f',
  26855. value: 0
  26856. },
  26857. color: {
  26858. type: 'c',
  26859. value: new n.Color()
  26860. },
  26861. bg: {
  26862. type: 't',
  26863. value: null
  26864. },
  26865. mask: {
  26866. type: 't',
  26867. value: null
  26868. }
  26869. },
  26870. vertexShader: o + 'varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}',
  26871. fragmentShader:
  26872. a +
  26873. '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'
  26874. }
  26875. }
  26876. },
  26877. {
  26878. './settings': 166,
  26879. three: 217
  26880. }
  26881. ],
  26882. 168: [
  26883. function (e, t, i) {
  26884. ;(function (i) {
  26885. 'use strict'
  26886. var n = e('three'),
  26887. r = (e('url'), e('./util/ajax')),
  26888. o = e('./settings'),
  26889. a = e('./util/logger'),
  26890. s = e('./util/math'),
  26891. l = e('./util/showcase'),
  26892. c = e('./objects/Panorama'),
  26893. h = new a(i),
  26894. u = e('./model/Model'),
  26895. d = e('./shaders'),
  26896. p = e('./util/transitions'),
  26897. f = e('./objects/Chunk'),
  26898. g = e('./objects/Reticule'),
  26899. m = e('./objects/Skybox'),
  26900. v = e('./objects/Floor'),
  26901. A = e('./cameras/DollhouseCamera'),
  26902. y = e('./cameras/FloorplanCamera'),
  26903. C = e('./cameras/PanoramaCamera'),
  26904. I = e('./controls/DollhouseControls'),
  26905. E = e('./controls/FloorplanControls'),
  26906. b = e('./controls/PanoramaControls')
  26907. ;(n.ImageUtils.crossOrigin = o.crossOrigin),
  26908. (t.exports = {
  26909. shaders: d,
  26910. transitions: p,
  26911. Model: u,
  26912. Chunk: f,
  26913. Floor: v,
  26914. Skybox: m,
  26915. Reticule: g,
  26916. Panorama: c,
  26917. DollhouseCamera: A,
  26918. FloorplanCamera: y,
  26919. PanoramaCamera: C,
  26920. DollhouseControls: I,
  26921. FloorplanControls: E,
  26922. PanoramaControls: b,
  26923. getModel: function (e) {
  26924. if (!e.url) throw 'getModel(): missing parameter "url"'
  26925. e.autoload = void 0 === e.autoload || e.autoload
  26926. var t = l.parseSidUrl(e.url)
  26927. ;(e.urlBase = t.urlBase), (e.urlModel = t.urlModel), (e.urlFiles = t.urlFiles)
  26928. var i = this._getPlatformError()
  26929. return i ? $.Deferred().reject(i).promise() : ((this.options = e), this._loadModel().then(this._buildModel.bind(this)))
  26930. },
  26931. _getPlatformError: function () {
  26932. return 'IE' === $.ua.browser.name && parseInt($.ua.browser.major) < 11
  26933. ? 'webgl-unsupported'
  26934. : 'iOS' === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version)
  26935. ? 'webgl-ios'
  26936. : Modernizr.webgl
  26937. ? null
  26938. : 'webgl-unsupported'
  26939. },
  26940. _loadModel: function () {
  26941. return r
  26942. .get(this.options.urlModel, {
  26943. responseType: 'json',
  26944. prefetchFrom: 'model',
  26945. auth: l.getAuthorizationHeader()
  26946. })
  26947. .then(null, function () {
  26948. return h.warn('Model loading failed at initial metadata load'), 'loading-failed'
  26949. })
  26950. },
  26951. _buildModel: function (e) {
  26952. e = l.normalizeModeldata(e, s)
  26953. var t = new u(this.options, e)
  26954. return this.options.autoload ? t.load(!0) : $.when(t)
  26955. }
  26956. })
  26957. }).call(this, '/js/showcase.js')
  26958. },
  26959. {
  26960. './cameras/DollhouseCamera': 5,
  26961. './cameras/FloorplanCamera': 6,
  26962. './cameras/PanoramaCamera': 7,
  26963. './controls/DollhouseControls': 10,
  26964. './controls/FloorplanControls': 11,
  26965. './controls/PanoramaControls': 13,
  26966. './model/Model': 139,
  26967. './objects/Chunk': 144,
  26968. './objects/Floor': 146,
  26969. './objects/Panorama': 148,
  26970. './objects/Reticule': 149,
  26971. './objects/Skybox': 152,
  26972. './settings': 166,
  26973. './shaders': 167,
  26974. './util/ajax': 181,
  26975. './util/logger': 189,
  26976. './util/math': 190,
  26977. './util/showcase': 193,
  26978. './util/transitions': 195,
  26979. three: 217,
  26980. url: 208
  26981. }
  26982. ],
  26983. 169: [
  26984. function (e, t, i) {
  26985. 'use strict'
  26986. function n() {
  26987. var e = {
  26988. renderTarget: null,
  26989. inUse: !1,
  26990. size: -1,
  26991. pano: null
  26992. }
  26993. return e
  26994. }
  26995. function r(e) {
  26996. M.push(e)
  26997. }
  26998. function o(e) {
  26999. var t = n()
  27000. return (t.inUse = !0), (t.size = e), r(t), t
  27001. }
  27002. function a(e) {
  27003. for (var t = 0; t < M.length; t++) {
  27004. var i = M[t]
  27005. if (!i.inUse && i.size === e) return (i.inUse = !0), i
  27006. }
  27007. return null
  27008. }
  27009. function s(e) {
  27010. for (var t = 0; t < M.length; t++) {
  27011. var i = M[t]
  27012. if (i.renderTarget === e) return (i.inUse = !1), !0
  27013. }
  27014. return !1
  27015. }
  27016. function l() {
  27017. ;(this.tileDirectory = {}),
  27018. (this.activeRenderTargetDescriptors = {}),
  27019. (this.activePanos = []),
  27020. (this.panoLODDescriptors = {}),
  27021. (this.panoDescriptors = {}),
  27022. (this.tileTrees = {}),
  27023. (this.sceneRenderer = null),
  27024. (this.tileDownloader = null),
  27025. (this.forceQueue = []),
  27026. (this.uploadQueues = {}),
  27027. (this.uploadInterval = null),
  27028. (this.uploadIntervalCancelled = !1),
  27029. (this.usingTileOverlay = !1),
  27030. (this.overlayTilesLoaded = !1),
  27031. (this.overlayTileBase = null),
  27032. (this.overlayTilesBasic = {}),
  27033. (this.overlayTilesEnhanced = {}),
  27034. (this.zoomRenderTarget = null),
  27035. (this.zoomPano = null),
  27036. (this.zoomingActive = !1),
  27037. (this.zoomPanoId = null),
  27038. (this.zoomPanoRenderingDisabled = !1),
  27039. (this.direction = new h.Vector3()),
  27040. (this.initTime = -1),
  27041. (this.maxBaseUploadsPerFrame = x),
  27042. (this.maxNonBaseUploadsPerFrame = T)
  27043. }
  27044. function c() {
  27045. this.uploadIntervalCancelled ||
  27046. (this.overlayTilesLoaded || !this.usingTileOverlay
  27047. ? ((b = !0),
  27048. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  27049. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : (this.uploadInterval = null))
  27050. : this.refreshUploadInterval(this.uploadIntervalDelay))
  27051. }
  27052. /* function c() {
  27053. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  27054. this.updateUploadQueue(1, 2),
  27055. w = 18,
  27056. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  27057. } */
  27058. var h = e('three'),
  27059. u = e('../exception/BasicException'),
  27060. d = e('../settings'),
  27061. p = e('../enum/PanoSizeClass'),
  27062. f = (e('../objects/Panorama'), e('../enum/PanoRendererEvents')),
  27063. g = e('../enum/SceneRendererEvents'),
  27064. m = e('../enum/TileDownloaderEvents'),
  27065. v = e('../enum/Vectors'),
  27066. A = (e('../enum/GLCubeFaces'), e('../objects/Panorama'), e('./TileTree')),
  27067. y = (e('./TileDownloader'), e('./TilePrioritizer')),
  27068. C = e('./TileUtils'),
  27069. p = e('../enum/PanoSizeClass'),
  27070. I = (e('../util/browser'), e('../util/panorama')),
  27071. E = e('events').EventEmitter,
  27072. b = !1,
  27073. w = d.tiling.uploadIntervalDelay,
  27074. _ = d.tiling.initialIntervalDelay,
  27075. T = d.tiling.maxNonBaseUploadsPerFrame,
  27076. x = d.tiling.maxBaseUploadsPerFrame,
  27077. S = {
  27078. Base: 0,
  27079. Remaining: 1
  27080. },
  27081. M = []
  27082. window.targetList = M
  27083. ;(l.prototype = Object.create(E.prototype)),
  27084. (l.prototype.init = function (e, t, i) {
  27085. ;(this.sceneRenderer = e),
  27086. (this.tileDownloader = t),
  27087. (this.qualityManager = i),
  27088. this.bindEvents(),
  27089. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  27090. (this.initTime = performance.now())
  27091. }),
  27092. (l.prototype.getActivePanoTextures = function (e) {
  27093. e = e || []
  27094. for (var t = 0; t < M.length; t++) {
  27095. var i = M[t]
  27096. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  27097. }
  27098. }),
  27099. (l.prototype.hasQueuedTiles = function () {
  27100. var e = this.peekNextFromUploadQueue()
  27101. return null !== e && void 0 !== e
  27102. }),
  27103. (l.prototype.getActiveRenderTargetDescriptor = function (e) {
  27104. return this.activeRenderTargetDescriptors[e]
  27105. }),
  27106. (l.prototype.setActiveRenderTargetDescriptor = function (e, t) {
  27107. this.activeRenderTargetDescriptors[e] = t
  27108. }),
  27109. (l.prototype.loadOverlayTiles = function () {
  27110. if (0 !== d.tiling.overlayStyle) {
  27111. var e = 0,
  27112. t = function (t, n, r) {
  27113. ;(t = n
  27114. ? (t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping))
  27115. : (this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping))),
  27116. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  27117. e++,
  27118. e === i.length && (this.overlayTilesLoaded = !0)
  27119. }.bind(this),
  27120. i = [
  27121. ['images/outlineBase.png', t.bind(this, this.overlayTileBase, null)],
  27122. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 256)],
  27123. ['images/outlineBasic512.png', t.bind(this, this.overlayTilesBasic, 512)],
  27124. ['images/outlineBasic1024.png', t.bind(this, this.overlayTilesBasic, 1024)],
  27125. ['images/outlineBasic2048.png', t.bind(this, this.overlayTilesBasic, 2048)],
  27126. ['images/outlineBasic4096.png', t.bind(this, this.overlayTilesBasic, 4096)],
  27127. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 256)],
  27128. ['images/outlineEnhanced512.png', t.bind(this, this.overlayTilesEnhanced, 512)],
  27129. ['images/outlineEnhanced1024.png', t.bind(this, this.overlayTilesEnhanced, 1024)],
  27130. ['images/outlineEnhanced2048.png', t.bind(this, this.overlayTilesEnhanced, 2048)],
  27131. ['images/outlineEnhanced4096.png', t.bind(this, this.overlayTilesEnhanced, 4096)]
  27132. ]
  27133. i.forEach(
  27134. function (e) {
  27135. this.tileDownloader.loadImage(e[0], 0, e[1])
  27136. }.bind(this)
  27137. ),
  27138. (this.usingTileOverlay = !0)
  27139. } else this.usingTileOverlay = !1
  27140. }),
  27141. (l.prototype.bindEvents = function () {
  27142. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  27143. }),
  27144. (l.prototype.setupZoomRenderTarget = (function () {
  27145. var targets = {}
  27146. return function () {
  27147. if (this.qualityManager.maxRenderTargetSize == '2k' && this.qualityManager.getMaxNavPanoSize() == '2k') return //不使用zoomTarget 直接用pano的tiledPanoRenderTarget,防崩溃
  27148. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  27149. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) return
  27150. var e = this.zoomRenderTarget
  27151. var size = this.qualityManager.getMaxZoomPanoSize()
  27152. if (size > this.qualityManager.maxRenderTargetSize) {
  27153. return
  27154. }
  27155. if (targets[size]) {
  27156. this.zoomRenderTarget = targets[size]
  27157. } else {
  27158. this.zoomRenderTarget = this.initTiledPano(size, true) //放大后不使用抗锯齿,否则消耗更多内存
  27159. targets[size] = this.zoomRenderTarget
  27160. }
  27161. if (e) {
  27162. //将旧的zoomRenderTarget渲染到新zoomRenderTarget上
  27163. var t = e.width,
  27164. i = this.zoomRenderTarget.width
  27165. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  27166. e.texture.dispose(),
  27167. (e.texture.loaded = !1),
  27168. (e.texture.version = 0),
  27169. this.sceneRenderer.deallocateCubeTexture(e.texture),
  27170. (e.texture = null)
  27171. }
  27172. this.zoomPanoRenderingDisabled = !1
  27173. } else this.zoomPanoRenderingDisabled = !0
  27174. }
  27175. })()),
  27176. (l.prototype.enableHighQuality = function (e) {
  27177. //xzw add 如果最多只要2k图的话enableUltraHighQualityMode替换成这个
  27178. if (!this.qualityManager.highQualityModeStarted) {
  27179. this.setupZoomRenderTarget()
  27180. e()
  27181. this.qualityManager.highQualityModeStarted = true
  27182. }
  27183. }),
  27184. (l.prototype.enableUltraHighQualityMode = function (e) {
  27185. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  27186. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH)
  27187. this.tileDownloader.testDownload(
  27188. t,
  27189. C.TILE_SIZE,
  27190. function (t) {
  27191. t && (this.qualityManager.enableUltraHighQualityMode(), this.setupZoomRenderTarget(), e())
  27192. }.bind(this)
  27193. )
  27194. }
  27195. }),
  27196. (l.prototype.activateTiledPano = function (e, t, i) {
  27197. i && this.clearAllQueuedUploads()
  27198. for (var n = 0; n < C.FACES_PER_PANO; n++) this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize())
  27199. this.linkAllTilesAndNodes(e)
  27200. var r = this.getActiveRenderTargetDescriptor(e.id),
  27201. l = t
  27202. if ((l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()), !r || l !== r.size)) {
  27203. if ((r && s(r.renderTarget), (r = a(l)), !r)) {
  27204. var c = this.initTiledPano(l, !browser.isMobile() /* !1 */)
  27205. ;(r = o(c.width)), (r.renderTarget = c)
  27206. }
  27207. ;(r.pano = e), this.resetPanoDescriptor(e.id), this.resetPanoLODDescriptors(e.id), this.resetRenderStatus(e.id, !0, !0)
  27208. }
  27209. this.setActiveRenderTargetDescriptor(e.id, r)
  27210. var h = i ? 0 : 1
  27211. return this.updateActivePanos(e, h), r.renderTarget
  27212. }),
  27213. (l.prototype.deactivateTiledPano = function (e) {
  27214. var t = this.getActiveRenderTargetDescriptor(e.id)
  27215. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget), this.setActiveRenderTargetDescriptor(e.id, null)
  27216. var i = this.getUploadQueueForPano(e.id)
  27217. this.clearUploadQueue(i), this.updateActivePanos()
  27218. }),
  27219. (l.prototype.updateActivePanos = (function () {
  27220. var e = []
  27221. return function (t, i) {
  27222. e.length = 0
  27223. for (var n = 0; n < this.activePanos.length; n++) {
  27224. t && e.length === i && e.push(t)
  27225. var r = this.activePanos[n],
  27226. o = this.getActiveRenderTargetDescriptor(r.id)
  27227. ;(t && r.id === t.id) || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  27228. }
  27229. t && i >= e.length && e.push(t), (this.activePanos.length = 0), this.activePanos.push.apply(this.activePanos, e)
  27230. }
  27231. })()),
  27232. (l.prototype.getActivePanoCount = function () {
  27233. return this.activePanos.length
  27234. }),
  27235. (l.prototype.resetRenderStatus = function (e, t, i, n) {
  27236. var r = null
  27237. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1)
  27238. for (
  27239. var o = function (e, n, r, o) {
  27240. i && (n.tile.zoomUploaded = !1), t && (n.tile.uploaded = !1)
  27241. },
  27242. a = 0;
  27243. a < C.FACES_PER_PANO;
  27244. a++
  27245. ) {
  27246. var s = this.getTileTree(e, a)
  27247. s.breadthFirst({
  27248. callback: o.bind(this, a),
  27249. minLevel: r
  27250. })
  27251. }
  27252. }),
  27253. (l.prototype.copyBaseRenderStatusToZoomed = function (e) {
  27254. for (
  27255. var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()),
  27256. i = function (e, t, i, n) {
  27257. ;(t.tile.zoomUploaded = t.tile.uploaded), (t.zoomCovered = t.covered)
  27258. },
  27259. n = 0;
  27260. n < C.FACES_PER_PANO;
  27261. n++
  27262. ) {
  27263. var r = this.getTileTree(e, n)
  27264. r.breadthFirst({
  27265. callback: i.bind(this, n),
  27266. maxLevel: t
  27267. })
  27268. }
  27269. }),
  27270. (l.prototype.renderPanoTiles = (function () {
  27271. var e = []
  27272. return function (t, i, n, r) {
  27273. ;(this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize()) || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  27274. (i = i || this.direction || v.FORWARD)
  27275. var o = this.getActiveRenderTargetDescriptor(t)
  27276. if (!this.isRenderTargetDescriptorValid(o)) throw new u('PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.')
  27277. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  27278. var s = this.getTileTree(t, a)
  27279. ;(e.length = 0),
  27280. s.breadthFirst({
  27281. saveVisited: e
  27282. })
  27283. for (var l = 0; l < e.length; l++) {
  27284. var c = e[l]
  27285. this.queueTileUpload(c.tile, !1, r || (0 === l && n))
  27286. }
  27287. }
  27288. this.updateDirection(i)
  27289. }
  27290. })()),
  27291. (l.prototype.isRenderTargetDescriptorValid = function (e) {
  27292. return e && e.renderTarget
  27293. }),
  27294. (l.prototype.isPanoActive = function (e) {
  27295. var t = this.getActiveRenderTargetDescriptor(e)
  27296. return this.isRenderTargetDescriptorValid(t)
  27297. }),
  27298. (l.prototype.isPanoZoomed = function (e) {
  27299. return this.zoomingActive && this.zoomPanoId === e
  27300. }),
  27301. (l.prototype.initTileTree = function (e, t, i) {
  27302. var n = this.tileTrees[e]
  27303. n || ((n = []), (this.tileTrees[e] = n))
  27304. var r = n[t]
  27305. if (!r) {
  27306. var o = A.getLevelCountForSize(C.TILE_SIZE, i)
  27307. ;(r = new A(C.TILE_SIZE, o)), (n[t] = r)
  27308. }
  27309. }),
  27310. (l.prototype.getTileTree = function (e, t) {
  27311. var i = this.tileTrees[e]
  27312. if (!i) throw new u('PanoRenderer.getTileTree() -> Tree array not yet initialized!')
  27313. var n = i[t]
  27314. if (!n) throw new u('PanoRenderer.getTileTree() -> Tree not yet initialized!')
  27315. return n
  27316. }),
  27317. (l.prototype.initTiledPano = function (e, antialias) {
  27318. var i = this.sceneRenderer.renderer,
  27319. n =
  27320. (i.context,
  27321. new h.WebGLRenderTargetCube(e, e, {
  27322. stencilBuffer: !1
  27323. })),
  27324. r = new h.CubeTexture([])
  27325. ;(n.texture = r),
  27326. (r.image = [null, null, null, null, null, null]),
  27327. (r.flipY = !0),
  27328. //antialias: 如果抗锯齿的话,采用mipmap,会增加一倍的存储消耗。原版本都是不抗锯齿的。但是抗锯齿效果更柔和
  27329. antialias
  27330. ? ((r.generateMipmaps = !0), (r.magFilter = h.LinearFilter), (r.minFilter = h.LinearMipMapLinearFilter))
  27331. : ((r.generateMipmaps = !1), (r.magFilter = h.LinearFilter), (r.minFilter = h.LinearFilter)),
  27332. (r.format = h.RGBAFormat),
  27333. i.setRenderTarget(n),
  27334. i.setRenderTarget(null)
  27335. var o = i.properties.get(r)
  27336. return (o.__image__webglTextureCube = o.__webglTexture), n
  27337. }),
  27338. (l.prototype.getUploadQueueForPano = function (e) {
  27339. var t = this.uploadQueues[e]
  27340. return t || ((t = []), (this.uploadQueues[e] = t)), t
  27341. }),
  27342. (l.prototype.isTileUploaded = function (e) {
  27343. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  27344. }),
  27345. (l.prototype.setUploaded = function (e, t) {
  27346. this.isPanoZoomed(e.panoId) ? (e.zoomUploaded = t) : (e.uploaded = t)
  27347. }),
  27348. (l.prototype.queueTileUpload = function (e, t, i) {
  27349. var n = this.getActiveRenderTargetDescriptor(e.panoId)
  27350. if (
  27351. this.isRenderTargetDescriptorValid(n) &&
  27352. e.downloaded &&
  27353. !this.isTileUploaded(e) &&
  27354. (!e.uploadQueued || i) &&
  27355. (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)
  27356. ) {
  27357. var r = this.getUploadQueueForPano(e.panoId)
  27358. i
  27359. ? this.uploadTile(e, !1)
  27360. : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  27361. (e.uploadQueued = !0),
  27362. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  27363. }
  27364. }),
  27365. (l.prototype.shoulPushToFrontOfQueue = function (e) {
  27366. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  27367. }),
  27368. (l.prototype.getTopUploadQueue = function () {
  27369. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  27370. for (var n = 0; n < this.activePanos.length; n++)
  27371. if (((e = this.activePanos[n]), (t = this.getUploadQueueForPano(e.id)), t.length > 0))
  27372. switch (i) {
  27373. case S.Base:
  27374. if (0 === t[0].level) return t
  27375. break
  27376. case S.Remaining:
  27377. return t
  27378. }
  27379. return null
  27380. }),
  27381. (l.prototype.getNextFromUploadQueue = (function () {
  27382. var e = function (e) {
  27383. var t = e.shift()
  27384. return (t.uploadQueued = !1), t
  27385. }
  27386. return function () {
  27387. if (this.forceQueue.length > 0) return e(this.forceQueue)
  27388. var t = this.getTopUploadQueue()
  27389. return t && t.length > 0 ? e(t) : null
  27390. }
  27391. })()),
  27392. (l.prototype.peekNextFromUploadQueue = function () {
  27393. if (this.forceQueue.length > 0) return this.forceQueue[0]
  27394. var e = this.getTopUploadQueue()
  27395. return e && e.length > 0 ? e[0] : null
  27396. }),
  27397. (l.prototype.clearAllQueuedUploads = function () {
  27398. this.clearAllUploadQueues(null, 0)
  27399. }),
  27400. (l.prototype.clearAllQueuedUploadsForPano = function (e) {
  27401. this.clearAllUploadQueues(e, 0)
  27402. }),
  27403. (l.prototype.clearAllUploadQueues = function (e, t) {
  27404. if (e) this.clearUploadQueue(this.getUploadQueueForPano(e), t), this.clearUploadQueue(this.forceQueue, t, e)
  27405. else {
  27406. for (var i = 0; i < this.activePanos.length; i++) {
  27407. var n = this.activePanos[i]
  27408. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  27409. }
  27410. this.clearUploadQueue(this.forceQueue, t)
  27411. }
  27412. }),
  27413. (l.prototype.clearUploadQueue = function (e, t, i) {
  27414. ;(void 0 !== t && null !== t) || (t = 0)
  27415. for (var n = 0; n < e.length; ) {
  27416. var r = e[n]
  27417. ;(!i || (i && i === r.tile.panoId)) && r.level >= t ? ((r.uploadQueued = !1), e.splice(n, 1)) : n++
  27418. }
  27419. }),
  27420. (l.prototype.refreshUploadInterval = (function () {
  27421. var e = null
  27422. return function (t) {
  27423. this.uploadIntervalCancelled ||
  27424. (e || (e = c.bind(this)), (null !== t && void 0 !== t) || (t = w), b || (t = _), (this.uploadInterval = window.setTimeout(e, t)), (this.uploadIntervalDelay = t))
  27425. }
  27426. })()),
  27427. (l.prototype.update = (function () {
  27428. var e = performance.now(),
  27429. t = 0
  27430. return function () {
  27431. ;(this.uploadIntervalCancelled = !0), window.clearTimeout(this.uploadInterval), (this.uploadInterval = null)
  27432. var i = performance.now() - e
  27433. !(i > w || 0 === t) ||
  27434. (!this.overlayTilesLoaded && this.usingTileOverlay) ||
  27435. (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame), (e = performance.now())),
  27436. t++
  27437. }
  27438. })()),
  27439. (l.prototype.updateUploadQueue = function (e, t) {
  27440. e || (e = 1)
  27441. for (var i = 0, n = 0; ; ) {
  27442. if (n >= t || i >= e) break
  27443. var r = this.getNextFromUploadQueue()
  27444. if (!r) break
  27445. if ((0 !== r.level ? i++ : n++, !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  27446. var o = this.getActiveRenderTargetDescriptor(r.panoId)
  27447. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  27448. }
  27449. }
  27450. }),
  27451. (l.prototype.updateDirection = function (e) {
  27452. if ((e = e || this.direction)) {
  27453. this.direction = e
  27454. for (var t = 0; t < this.activePanos.length; t++) {
  27455. var i = this.activePanos[t],
  27456. n = this.getUploadQueueForPano(i.id)
  27457. y.sortPanoTiles(n, i, this.direction)
  27458. }
  27459. }
  27460. }),
  27461. (l.prototype.uploadTile = (function () {
  27462. var e = {},
  27463. t = (new h.Vector4(), d.tiling.overlayStyle)
  27464. //var failHistory = {};
  27465. return function (i, n) {
  27466. var r = i.panoId,
  27467. o = i.image,
  27468. a = i.tileSize,
  27469. s = i.panoSize,
  27470. l = i.tileIndex,
  27471. c = (i.faceTileIndex, i.totalTiles),
  27472. u = (i.face, i.tileX),
  27473. d = i.tileY,
  27474. p = !0,
  27475. g = !1,
  27476. m = (this.getPanoDescriptor(r), this.getPanoLODDescriptor(r, s)),
  27477. v = this.getActiveRenderTargetDescriptor(r),
  27478. A = v.renderTarget,
  27479. y = v.size
  27480. if (
  27481. (this.isPanoZoomed(r) && ((A = this.zoomRenderTarget), (y = A.width)), //this.qualityManager.getMaxZoomPanoSize()),
  27482. this.isRenderTargetDescriptorValid(v) || ((p = !1), (g = !1)),
  27483. n || (this.anyUploaded(i.node) && ((p = !1), (g = !0)), this.isTileUploaded(i) && ((p = !1), (g = !1))),
  27484. p)
  27485. ) {
  27486. /* if(failHistory[''+r+s+l]){
  27487. console.log('uploadTile retry', r, s, l)
  27488. }
  27489. console.log('uploadTile 成功', r, s, l)
  27490. */
  27491. var C = u * a,
  27492. I = d * a,
  27493. E = (a / s) * y,
  27494. b = (C / s) * y,
  27495. w = (I / s) * y
  27496. if (s > this.qualityManager.maxRenderTargetSize) {
  27497. player.model.getHighImage(o, i.cubeFace, u, d)
  27498. } else {
  27499. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping))
  27500. var _ = e[a]
  27501. this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a)
  27502. if (1 === t || 2 === t) {
  27503. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced
  27504. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  27505. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, 0.5)
  27506. } else this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace)
  27507. }
  27508. m.uploadCount++, this.emit(f.TileRenderSuccess, r, s, l, c), m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c), this.setUploaded(i, !0), this.addCoverageForNode(i.node)
  27509. } else {
  27510. this.setUploaded(i, !1)
  27511. //console.log('uploadTile 失败', r, s, l)
  27512. //failHistory[''+r+s+l] = true;
  27513. }
  27514. return (
  27515. i.uploadAttempted || (m.uploadAttempts++, this.emit(f.TileUploadAttempted, r, s, l, c)),
  27516. (i.uploadAttempted = !0),
  27517. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  27518. g
  27519. )
  27520. }
  27521. })()),
  27522. (l.prototype.linkTileAndNode = function (e, t) {
  27523. ;(t.tile = e), (e.node = t)
  27524. }),
  27525. (l.prototype.linkAllTilesAndNodes = function (e) {
  27526. for (
  27527. var t = function (t, i, n, r, o) {
  27528. var a = this.getTileDirectoryEntry(e.id, i, r, o)
  27529. this.linkTileAndNode(a, n)
  27530. },
  27531. i = 0;
  27532. i < C.FACES_PER_PANO;
  27533. i++
  27534. ) {
  27535. var n = this.getTileTree(e.id, i)
  27536. n.breadthFirst({
  27537. callback: t.bind(this, n, i)
  27538. })
  27539. }
  27540. }),
  27541. (l.prototype.anyUploaded = function (e) {
  27542. if (!e) return !1
  27543. if (e.tile && this.isTileUploaded(e.tile)) return !0
  27544. if (e.children)
  27545. for (var t = 0; t < e.children.length; t++) {
  27546. var i = e.children[t]
  27547. if (this.anyUploaded(i)) return !0
  27548. }
  27549. return !1
  27550. }),
  27551. (l.prototype.setNodeCovered = function (e, t) {
  27552. this.isPanoZoomed(e.tile.panoId) ? (e.zoomCovered = t) : (e.covered = t)
  27553. }),
  27554. (l.prototype.isNodeCovered = function (e) {
  27555. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  27556. }),
  27557. (l.prototype.addCoverageForNode = function (e) {
  27558. if ((this.setNodeCovered(e, !0), e.parent && e.covered)) {
  27559. var t = e.parent
  27560. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  27561. }
  27562. }),
  27563. (l.prototype.calcFullCoverage = function (e) {
  27564. var t = !1
  27565. if (e.children)
  27566. for (var i = 0; i < e.children.length; i++) {
  27567. var n = e.children[i]
  27568. t = t || this.calcFullCoverage(n)
  27569. }
  27570. e.covered = e.tile.uploaded || t
  27571. }),
  27572. (l.prototype.nodeSubcovered = function (e) {
  27573. if (!e.children) return !1
  27574. for (var t = 0; t < e.children.length; t++) if (!e.children[t] || !this.isNodeCovered(e.children[t])) return !1
  27575. return !0
  27576. }),
  27577. (l.prototype.resetPanoDescriptor = function (e) {
  27578. this.getPanoDescriptor(e)
  27579. }),
  27580. (l.prototype.getPanoDescriptor = function (e) {
  27581. var t = this.panoDescriptors[e]
  27582. return t || ((t = {}), (this.panoDescriptors[e] = t)), t
  27583. }),
  27584. (l.prototype.resetPanoLODDescriptors = function (e) {
  27585. var t = this.getPanoLODDescriptors(e)
  27586. for (var i in t)
  27587. if (t.hasOwnProperty(i)) {
  27588. var n = t[i]
  27589. ;(n.uploadCount = 0), (n.uploadAttempts = 0)
  27590. }
  27591. }),
  27592. (l.prototype.getPanoLODDescriptor = function (e, t) {
  27593. var i = this.getPanoLODDescriptors(e),
  27594. n = i[t]
  27595. return (
  27596. n ||
  27597. ((n = {
  27598. uploadCount: 0,
  27599. uploadAttempts: 0
  27600. }),
  27601. (i[t] = n)),
  27602. n
  27603. )
  27604. }),
  27605. (l.prototype.getPanoLODDescriptors = function (e) {
  27606. var t = this.panoLODDescriptors[e]
  27607. return t || ((t = {}), (this.panoLODDescriptors[e] = t)), t
  27608. }),
  27609. (l.prototype.onTileDownloaded = function (e) {
  27610. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize),
  27611. i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex)
  27612. if (
  27613. ((i.downloaded = !0),
  27614. (i.image = e.image),
  27615. (i.panoSize = e.panoSize),
  27616. (i.tileX = e.tileX),
  27617. (i.tileY = e.tileY),
  27618. (i.totalTiles = e.totalTiles),
  27619. (i.tileIndex = e.tileIndex),
  27620. (i.faceTileIndex = e.faceTileIndex),
  27621. (i.face = e.face),
  27622. (i.cubeFace = I.mapFaceToCubemapFace(e.face)),
  27623. (i.panoId = e.panoId),
  27624. (i.tileSize = e.tileSize),
  27625. (i.direction = new h.Vector3().copy(e.direction)),
  27626. (i.node = null),
  27627. (i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize)),
  27628. this.isPanoActive(i.panoId))
  27629. ) {
  27630. var n = this.getTileTree(i.panoId, i.face),
  27631. r = n.getSubNode(i.panoSize, i.tileX, i.tileY)
  27632. this.linkTileAndNode(i, r), this.queueTileUpload(i, !0)
  27633. }
  27634. }),
  27635. (l.prototype.getTileDirectoryEntry = function (e, t, i, n) {
  27636. var r = this.tileDirectory[e]
  27637. r || ((r = {}), (this.tileDirectory[e] = r))
  27638. var o = 16384 * t + 1024 * i + n,
  27639. a = r[o]
  27640. return (
  27641. a ||
  27642. ((a = {
  27643. downloaded: !1,
  27644. uploaded: !1,
  27645. zoomUploaded: !1
  27646. }),
  27647. (r[o] = a)),
  27648. (a._key = e + ':' + t + ':' + i + ':' + n),
  27649. (a._tileKey = o),
  27650. a
  27651. )
  27652. }),
  27653. (l.prototype.setZoomingActive = function (e, t, i) {
  27654. this.zoomPanoRenderingDisabled ||
  27655. (e === this.zoomingActive && this.zoomPanoId === t.id) ||
  27656. ((this.zoomingActive = e), (this.zoomPanoId = t.id), this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  27657. }),
  27658. (l.prototype.updateZoomedPanoFromBase = function (e) {
  27659. if (!this.zoomPanoRenderingDisabled) {
  27660. var t = this.getActiveRenderTargetDescriptor(e.id)
  27661. if (t && t.renderTarget) {
  27662. var i = Math.min(this.qualityManager.maxRenderTargetSize, this.qualityManager.getMaxZoomPanoSize()), //this.qualityManager.getMaxZoomPanoSize()
  27663. n = t.renderTarget,
  27664. r = t.size
  27665. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i), this.copyBaseRenderStatusToZoomed(e.id)
  27666. }
  27667. }
  27668. }),
  27669. (t.exports = l)
  27670. },
  27671. {
  27672. '../enum/GLCubeFaces': 25,
  27673. '../enum/PanoRendererEvents': 35,
  27674. '../enum/PanoSizeClass': 36,
  27675. '../enum/SceneRendererEvents': 43,
  27676. '../enum/TileDownloaderEvents': 45,
  27677. '../enum/Vectors': 50,
  27678. '../exception/BasicException': 55,
  27679. '../objects/Panorama': 148,
  27680. '../settings': 166,
  27681. '../util/browser': 182,
  27682. '../util/panorama': 191,
  27683. './TileDownloader': 171,
  27684. './TilePrioritizer': 172,
  27685. './TileTree': 173,
  27686. './TileUtils': 174,
  27687. events: 202,
  27688. three: 217
  27689. }
  27690. ],
  27691. 170: [
  27692. function (e, t, i) {
  27693. 'use strict'
  27694. function n(e, t, i) {
  27695. ;(this.maxNavPanoSize = -1),
  27696. (this.maxZoomPanoSize = -1),
  27697. (this.devicePixelDensity = e),
  27698. (this.deviceScreenSize = t),
  27699. (this.clientBandwidth = i),
  27700. (this.panoSizeClassMap = {}),
  27701. (this.useHighResolutionPanos = !0),
  27702. (this.useUltraHighResolutionPanos = !1),
  27703. (this.modelHasUltraHighPanos = !1)
  27704. this.maxRenderTargetSize = a.isMobile() ? 2048 : 4096 //add
  27705. }
  27706. var r = e('../enum/PanoSizeClass'),
  27707. o = e('../settings'),
  27708. a = e('../util/browser'),
  27709. s = e('../constants'),
  27710. l = e('../util/showcase'),
  27711. c = e('../enum/ModelManagerEvents')
  27712. ;(n.prototype.init = function (e) {
  27713. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  27714. (this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH)),
  27715. (this.highSize = this.getPanoSize(r.HIGH)),
  27716. (this.standardSize = this.getPanoSize(r.STANDARD)),
  27717. (this.baseSize = this.getPanoSize(r.BASE)),
  27718. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  27719. (this.highQualityThreshold = a.valueFromHash('threshold2k', s.windowHeightHighQualityThreshold)),
  27720. this.updateMaximums(),
  27721. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  27722. }),
  27723. (n.prototype.updateFromModel = function (e) {
  27724. this.updateHighResolutionSettings(e), this.updateUltraHighResolutionSettings(e)
  27725. }),
  27726. (n.prototype.updateHighResolutionSettings = function (e) {
  27727. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  27728. l.modelDataPromisesTiles(e.data) ? (this.useHighResolutionPanos = !0) : (this.useHighResolutionPanos = !1),
  27729. //this.useHighResolutionPanos = !0;
  27730. //----------------------e n d -----------------------------------------------------------------
  27731. this.updateMaximums()
  27732. }),
  27733. (n.prototype.updateUltraHighResolutionSettings = function (e) {
  27734. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? (this.useUltraHighResolutionPanos = !0) : (this.useUltraHighResolutionPanos = !1), this.updateMaximums()
  27735. }),
  27736. (n.prototype.enableUltraHighQualityMode = function () {
  27737. ;(this.modelHasUltraHighPanos = !0), this.updateUltraHighResolutionSettings(null)
  27738. }),
  27739. (n.prototype.ultraHighQualityModeEnabled = function () {
  27740. return this.modelHasUltraHighPanos
  27741. }),
  27742. (n.prototype.onModelChanged = function (e) {
  27743. this.updateFromModel(e.model), this.updateMaximums()
  27744. }),
  27745. (n.prototype.updateMaximums = function () {
  27746. ;(this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize()),
  27747. (this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize()),
  27748. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  27749. }),
  27750. (n.prototype.buildPanoSizeClassMap = function () {
  27751. ;(this.panoSizeClassMap[r.BASE] = 512), (this.panoSizeClassMap[r.STANDARD] = 1024), (this.panoSizeClassMap[r.HIGH] = 2048), (this.panoSizeClassMap[r.ULTRAHIGH] = 4096)
  27752. }),
  27753. (n.prototype.getPanoSize = function (e) {
  27754. return this.panoSizeClassMap[e]
  27755. }),
  27756. (n.prototype.getMaxPossiblePanoSize = function () {
  27757. return this.getPanoSize(r.ULTRAHIGH)
  27758. }),
  27759. (n.prototype.getMaxPanoSize = function () {
  27760. return this.maxZoomPanoSize
  27761. }),
  27762. (n.prototype.getMaxNavPanoSize = function () {
  27763. return this.maxNavPanoSize
  27764. }),
  27765. (n.prototype.getMaxZoomPanoSize = function () {
  27766. return this.maxZoomPanoSize
  27767. }),
  27768. /* n.prototype.detectMaxNavPanoSizeClass = function() {
  27769. if(settings.mobileNavHigh)return r.HIGH //改
  27770. else return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  27771. } */
  27772. (n.prototype.detectDevice = function () {
  27773. //add
  27774. if (a.isMobile()) {
  27775. let area = $('#player').width() * $('#player').height()
  27776. if (area < 768 * 1024) {
  27777. //ipad mini full screen 大场景拍的质量很好默认不需要很高清
  27778. return 'mobile'
  27779. } else {
  27780. return 'bigMobile'
  27781. }
  27782. } else {
  27783. return 'pc'
  27784. }
  27785. })
  27786. ;(n.prototype.detectMaxNavPanoSizeClass = function () {
  27787. //xzw 改
  27788. switch (this.getNavZoomClass()) {
  27789. case '1k':
  27790. return r.STANDARD
  27791. break
  27792. case '2k':
  27793. default:
  27794. return r.HIGH
  27795. case '4k':
  27796. return r.ULTRAHIGH
  27797. }
  27798. }),
  27799. (n.prototype.detectMaxNavPanoSize = function () {
  27800. var e = this.detectMaxNavPanoSizeClass()
  27801. return this.getPanoSize(e)
  27802. }),
  27803. (n.prototype.getMaxZoomClass = function () {
  27804. //add
  27805. let type = this.detectDevice()
  27806. let setting = settings.tileClass[type] //见manage.js的settings
  27807. return setting.max
  27808. })
  27809. ;(n.prototype.getNavZoomClass = function () {
  27810. //add
  27811. let type = this.detectDevice()
  27812. let setting = settings.tileClass[type]
  27813. return setting.nav
  27814. }),
  27815. (n.prototype.detectMaxZoomPanoSize = function () {
  27816. //获取当前zoomRenderTarget应下载的最高级别
  27817. //若是有三个级别,每次只需要加载到当前的zoomLevel;而两级时因为有zoomed来判断是使用基本贴图还是zoomRenderTarget,所以只需要返回最大的即可
  27818. if (this.zoomLevelResolution) {
  27819. //有三个级别
  27820. if (this.zoomLevelResolution == '4k' && this.useUltraHighResolutionPanos) {
  27821. return this.getPanoSize(r.ULTRAHIGH)
  27822. } else if (this.zoomLevelResolution == '1k' || !this.useHighResolutionPanos) {
  27823. return this.getPanoSize(r.STANDARD)
  27824. } else {
  27825. return this.getPanoSize(r.HIGH)
  27826. }
  27827. } else {
  27828. let tileClass = this.getMaxZoomClass()
  27829. if (tileClass == '1k') return this.getPanoSize(r.STANDARD)
  27830. if (tileClass == '4k' && this.useUltraHighResolutionPanos) {
  27831. return this.getPanoSize(r.ULTRAHIGH)
  27832. } else {
  27833. //'2k'
  27834. return this.getPanoSize(r.HIGH)
  27835. }
  27836. }
  27837. }),
  27838. /* n.prototype.detectMaxZoomPanoSize = function() {
  27839. 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)
  27840. } */
  27841. (t.exports = n)
  27842. },
  27843. {
  27844. '../constants': 8,
  27845. '../enum/ModelManagerEvents': 33,
  27846. '../enum/PanoSizeClass': 36,
  27847. '../settings': 166,
  27848. '../util/browser': 182,
  27849. '../util/showcase': 193
  27850. }
  27851. ],
  27852. 171: [
  27853. function (e, t, i) {
  27854. ;(function (i) {
  27855. 'use strict'
  27856. function n(e) {
  27857. ;(this.panos = null),
  27858. (this.retryMinimumTime = 1e4),
  27859. (this.urls = null),
  27860. (this.panoLoadCallbacks = {}),
  27861. (this.downloadDescriptors = {}),
  27862. (this.priorityQueue = []),
  27863. (this.forceQueue = []),
  27864. (this.activeDownloads = []),
  27865. (this.qualityManager = null),
  27866. (this.tilePrioritizer = null),
  27867. (this.refreshInterval = null),
  27868. (this.processPriorityQueue = !1),
  27869. (this.concurrentDownloads = e.concurrentDownloads || 1),
  27870. (this.downloadTestResults = {})
  27871. }
  27872. var r = e('three'),
  27873. o = (e('../enum/Viewmode'), e('../settings')),
  27874. a = (e('../objects/Panorama'), e('../util/logger')),
  27875. s = (e('../enum/Vectors'), e('../enum/PanoSizeClass'), e('../enum/TileDownloaderEvents')),
  27876. l = e('./TilePrioritizer'),
  27877. c = e('./TileUtils'),
  27878. h = (e('../enum/GLCubeFaces'), e('../enum/DownloadStatus')),
  27879. u = e('../util/panorama'),
  27880. d = e('../util/ajax'),
  27881. p = e('../ab'),
  27882. f = e('events').EventEmitter,
  27883. g =
  27884. (new a(i),
  27885. Object.freeze({
  27886. Testing: 1,
  27887. Success: 2,
  27888. Fail: 3
  27889. }))
  27890. ;(n.prototype = Object.create(f.prototype)),
  27891. (n.IDLE_REFRESH_DELAY = 500),
  27892. (n.ACTIVE_REFRESH_DELAY = 16),
  27893. (n.DOWNLOAD_RETRIES = 4),
  27894. (n.prototype.init = function (e) {
  27895. this.qualityManager = e
  27896. }),
  27897. (n.prototype.setUrls = function (e) {
  27898. this.urls = e
  27899. }),
  27900. (n.prototype.setPanoData = function (e, t, i) {
  27901. ;(this.panos = e), (this.imagePanos = t), (this.panoGroupId = i)
  27902. }),
  27903. (n.prototype.start = function () {
  27904. this.refreshUpdateInterval(0)
  27905. }),
  27906. (n.prototype.stop = function () {
  27907. window.cancel(this.refreshInterval)
  27908. }),
  27909. (n.prototype.refreshUpdateInterval = function (e) {
  27910. e || (e = 0),
  27911. (this.refreshInterval = window.setTimeout(
  27912. function () {
  27913. var e = this.update()
  27914. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  27915. }.bind(this),
  27916. e
  27917. ))
  27918. }),
  27919. (n.prototype.update = function () {
  27920. var e = this.forceQueue.length > 0
  27921. return (
  27922. this.processQueueForDownloading(this.forceQueue),
  27923. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos), this.priorityQueue.length > 0 && (e = !0), this.processQueueForDownloading(this.priorityQueue)),
  27924. e
  27925. )
  27926. }),
  27927. (n.prototype.forceQueueTilesForPano = (function () {
  27928. var e = [],
  27929. t = []
  27930. return function (i, n, r, o, a, s) {
  27931. e.length = 0
  27932. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  27933. var p = u[d]
  27934. ;(p.status !== h.None && p.status !== h.Queued) || e.push(p)
  27935. }
  27936. if (r && e.length > 0) {
  27937. l.sortPanoTiles(e, i, r), (t.length = 0), c.matchingTilesInDirection(i, n, r, o, a, t)
  27938. for (
  27939. var f = 0,
  27940. g = function (e) {
  27941. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  27942. };
  27943. f < e.length;
  27944. ) {
  27945. var m = e[f],
  27946. v = t.findIndex(g)
  27947. v < 0 ? e.splice(f, 1) : f++
  27948. }
  27949. }
  27950. for (var A = 0; A < e.length; A++) this.forceQueue.push(e[A])
  27951. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued), this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1), s && this.processQueueForDownloading(this.forceQueue, !0)
  27952. }
  27953. })()),
  27954. (n.prototype.clearForceQueue = function () {
  27955. this.clearQueue(this.forceQueue)
  27956. }),
  27957. (n.prototype.queuePrioritizedTilesForPanos = function (e) {
  27958. this.tilePrioritizer &&
  27959. (this.clearQueue(this.priorityQueue),
  27960. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  27961. this.clearFromQueue(this.priorityQueue, h.None, !0),
  27962. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  27963. }),
  27964. (n.prototype.clearQueue = function (e) {
  27965. this.setStatusForAllDescriptors(e, h.None), (e.length = 0)
  27966. }),
  27967. (n.prototype.clearFromQueue = function (e, t, i) {
  27968. for (var n = 0; n < e.length; n++) {
  27969. var r = e[n]
  27970. r && ((t === r.status && !i) || (t !== r.status && i)) && (e[n] = null)
  27971. }
  27972. }),
  27973. (n.prototype.setStatusForAllDescriptors = function (e, t) {
  27974. for (var i = 0; i < e.length; i++) {
  27975. var n = e[i]
  27976. n && (n.status = t)
  27977. }
  27978. }),
  27979. (n.prototype.setStatusOrRemoveForAllDescriptors = function (e, t) {
  27980. for (var i = 0; i < e.length; i++) {
  27981. var n = e[i]
  27982. n && (n.status !== t ? (n.status = t) : (e[i] = null))
  27983. }
  27984. }),
  27985. (n.prototype.getTileDownloadDescriptors = function (e, t) {
  27986. var i = this.getAllTileDownloadDescriptorsForPano(e),
  27987. n = i[t]
  27988. return n || ((n = this.buildDownloadDescriptorArray(t)), (i[t] = n), this.initTileDownloadDescriptors(n, e, t)), n
  27989. }),
  27990. (n.prototype.getAllTileDownloadDescriptorsForPano = function (e) {
  27991. var t = this.downloadDescriptors[e.id]
  27992. return t || ((t = {}), (this.downloadDescriptors[e.id] = t)), t
  27993. }),
  27994. (n.prototype.processQueueForDownloading = function (e, t) {
  27995. if ((this.cleanupActiveDownloads(), this.activeDownloads.length < this.concurrentDownloads || t))
  27996. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  27997. var o = e.shift()
  27998. o && (this.startDownload(o), n++)
  27999. }
  28000. }),
  28001. (n.prototype.testDownload = function (e, t, i) {
  28002. var n = this.downloadTestResults[e]
  28003. if (n) return void (n === g.Success ? i(!0) : n === g.Fail && i(!1))
  28004. this.downloadTestResults[e] = g.Testing
  28005. var r = this.panos.list[0],
  28006. o = this.getTileUrl(r.id, e, t, 0),
  28007. a = function (t) {
  28008. ;(this.downloadTestResults[e] = g.Success), i(!0)
  28009. }.bind(this),
  28010. s = function () {
  28011. ;(this.downloadTestResults[e] = g.Fail), i(!1)
  28012. }.bind(this)
  28013. this.loadImage(o, 0, a, s)
  28014. }),
  28015. (n.prototype.startDownload = function (e) {
  28016. e.status = h.Downloading
  28017. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex)
  28018. this.activeDownloads.push(e), this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  28019. }),
  28020. (n.prototype.downloadFailed = function (e, t) {}),
  28021. (n.prototype.downloadComplete = function (e, t) {
  28022. if (e.panoGroupId === this.panoGroupId) {
  28023. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize)
  28024. ;(e.status = h.Downloaded), i && i.onProgress && i.onProgress(e.pano, e.panoSize)
  28025. var n = {
  28026. panoId: e.pano.id,
  28027. image: t,
  28028. tileSize: e.tileSize,
  28029. panoSize: e.panoSize,
  28030. tileIndex: e.tileIndex,
  28031. faceTileIndex: e.faceTileIndex,
  28032. totalTiles: e.totalTiles,
  28033. face: e.face,
  28034. tileX: e.tileX,
  28035. tileY: e.tileY,
  28036. direction: e.direction
  28037. }
  28038. ;(e.image = t),
  28039. this.emit(s.TileDownloadSuccess, n),
  28040. this.isPanoDownloaded(e.pano, e.panoSize) &&
  28041. ((n = {
  28042. panoId: e.pano.id,
  28043. tileSize: e.tileSize,
  28044. panoSize: e.panoSize
  28045. }),
  28046. this.emit(s.PanoDownloadComplete, n),
  28047. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  28048. }
  28049. }),
  28050. (n.prototype.cleanupActiveDownloads = (function () {
  28051. var e = []
  28052. return function () {
  28053. e.length = 0
  28054. for (var t = 0; t < this.activeDownloads.length; t++) {
  28055. var i = this.activeDownloads[t]
  28056. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  28057. }
  28058. ;(this.activeDownloads.length = 0), this.activeDownloads.push.apply(this.activeDownloads, e)
  28059. }
  28060. })()),
  28061. (n.prototype.isPanoDownloaded = function (e, t) {
  28062. var i = this.getTileDownloadDescriptors(e, t)
  28063. if (i.length <= 0) return !1
  28064. for (var n = 0; n < i.length; n++) {
  28065. var r = i[n]
  28066. if (r.status !== h.Downloaded) return !1
  28067. }
  28068. return !0
  28069. }),
  28070. (n.prototype.setPanoLoadCallbacks = function (e, t, i, n, r) {
  28071. var o = e.id + ':' + this.qualityManager.getPanoSize(t)
  28072. this.panoLoadCallbacks[o] = {
  28073. onLoad: i,
  28074. onFail: n,
  28075. onProgress: r
  28076. }
  28077. }),
  28078. (n.prototype.getPanoLoadCallbacks = function (e, t) {
  28079. var i = e.id + ':' + t
  28080. return this.panoLoadCallbacks[i]
  28081. }),
  28082. (n.prototype.buildDownloadDescriptorArray = function (e) {
  28083. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  28084. var r = this.buildDownloadDescriptor()
  28085. i.push(r)
  28086. }
  28087. return i
  28088. }),
  28089. (n.prototype.buildDownloadDescriptor = function () {
  28090. var e = {
  28091. panoGroupId: null,
  28092. pano: null,
  28093. panoSize: -1,
  28094. tileSize: -1,
  28095. tileIndex: -1,
  28096. totalTiles: -1,
  28097. faceTileIndex: -1,
  28098. status: h.None,
  28099. url: null,
  28100. image: null,
  28101. direction: new r.Vector3(),
  28102. face: -1,
  28103. cubeFace: -1,
  28104. tileX: -1,
  28105. tileY: -1
  28106. }
  28107. return e
  28108. }),
  28109. (n.prototype.initTileDownloadDescriptors = function (e, t, i) {
  28110. for (var n = 0; n < e.length; n++) {
  28111. var r = e[n]
  28112. this.initTileDownloadDescriptor(r, t, i, n)
  28113. }
  28114. }),
  28115. (n.prototype.initTileDownloadDescriptor = function (e, t, i, n) {
  28116. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i
  28117. ;(e.face = c.getFaceForTile(i, n)),
  28118. (e.cubeFace = u.mapFaceToCubemapFace(e.face)),
  28119. (e.panoGroupId = this.panoGroupId),
  28120. (e.pano = t),
  28121. (e.panoSize = i),
  28122. (e.tileSize = r),
  28123. (e.tileIndex = n),
  28124. (e.totalTiles = c.getTileCountForSize(i)),
  28125. (e.status = h.None),
  28126. (e.image = null),
  28127. c.getTileLocation(e.panoSize, e.tileIndex, e),
  28128. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  28129. }),
  28130. (n.prototype.getTileUrl = (function () {
  28131. var e = {
  28132. 256: '256',
  28133. 512: '512',
  28134. 1024: '1k',
  28135. 2048: '2k',
  28136. 4096: '4k'
  28137. },
  28138. t = {
  28139. face: -1,
  28140. faceTileIndex: -1,
  28141. tileX: -1,
  28142. tileY: -1
  28143. }
  28144. return function (i, n, r, a) {
  28145. c.getTileLocation(n, a, t)
  28146. var s = Math.floor(n / r),
  28147. l = s * s,
  28148. h = Math.floor(a / l),
  28149. u = ''
  28150. 1 === o.tiling.customCompression && (u = '_' + o.tiling['q' + e[n]])
  28151. var d = this.urls.get('tiles/' + i + '/' + e[n] + u + '_face' + h + '_' + t.tileX + '_' + t.tileY + '.jpg')
  28152. return (d = p.changeIfTileGenerating(d))
  28153. }
  28154. })()),
  28155. (n.prototype.loadImage = function (e, t, i, n) {
  28156. d.getImage(e, t)
  28157. .then(function (e) {
  28158. i(e)
  28159. })
  28160. .fail(n)
  28161. }),
  28162. (t.exports = n)
  28163. }).call(this, '/js/tile/TileDownloader.js')
  28164. },
  28165. {
  28166. '../ab': 3,
  28167. '../enum/DownloadStatus': 24,
  28168. '../enum/GLCubeFaces': 25,
  28169. '../enum/PanoSizeClass': 36,
  28170. '../enum/TileDownloaderEvents': 45,
  28171. '../enum/Vectors': 50,
  28172. '../enum/Viewmode': 51,
  28173. '../objects/Panorama': 148,
  28174. '../settings': 166,
  28175. '../util/ajax': 181,
  28176. '../util/logger': 189,
  28177. '../util/panorama': 191,
  28178. './TilePrioritizer': 172,
  28179. './TileUtils': 174,
  28180. events: 202,
  28181. three: 217
  28182. }
  28183. ],
  28184. 172: [
  28185. function (e, t, i) {
  28186. ;(function (i) {
  28187. 'use strict'
  28188. function n(e, t, i, o, a) {
  28189. ;(this.qualityManager = e),
  28190. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize()),
  28191. (this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()),
  28192. (this.baseSize = t),
  28193. (this.standardSize = i),
  28194. (this.highSize = o),
  28195. (this.ultraHighSize = a),
  28196. (this.priorityCriteria = new n.PriorityCriteria(null, new r.Vector3(0, 0, 0), new r.Vector3(0, 0, -1), new r.Vector3(0, 0, -1)))
  28197. }
  28198. var r = e('three'),
  28199. o = (e('../enum/Viewmode'), e('../settings'), e('../settings'), e('../objects/Panorama')),
  28200. a = e('../util/logger'),
  28201. s = (e('../enum/Vectors'), e('../enum/PanoSizeClass'), e('../enum/ModelManagerEvents'), e('../enum/GLCubeFaces'), e('../enum/DownloadStatus')),
  28202. l = (e('../util/browser'), e('./TileUtils')),
  28203. c = e('../util/math'),
  28204. h =
  28205. (e('events').EventEmitter,
  28206. new a(i),
  28207. Object.freeze({
  28208. None: 0,
  28209. DirectionalFOV: 1
  28210. }))
  28211. ;(n.PriorityCriteria = function (e, t, i, n, o) {
  28212. ;(this.pano = e),
  28213. (this.cameraPosition = new r.Vector3().copy(t)),
  28214. (this.cameraDir = new r.Vector3().copy(i)),
  28215. (this.panoSpaceDir = new r.Vector3().copy(n)),
  28216. (this.upcomingPanos = o),
  28217. (this.copy = function (e) {
  28218. ;(this.pano = e.pano), this.cameraPosition.copy(e.cameraPosition), this.cameraDir.copy(e.cameraDir), this.panoSpaceDir.copy(e.panoSpaceDir), (this.upcomingPanos = o)
  28219. }),
  28220. (this.zoomingActive = !1)
  28221. }),
  28222. (n.DIRECTIONAL_FOV = 180),
  28223. (n.DIRECTIONAL_FOV_NARROW = 120),
  28224. (n.MAX_SCORED_PANOS_TOCONSIDER = 6),
  28225. (n.MAX_SCORED_PANOS_TOADD = 2),
  28226. (n.MAX_UPCOMING_PANOS_TOADD = 3),
  28227. (n.DIRECTION_SCORE_STRICTNESS = 0.75),
  28228. (n.appendQueue = function (e, t) {
  28229. if (e && t) for (var i = 0; i < t.length; i++) e.push(t[i])
  28230. }),
  28231. (n.prototype.updateCriteria = function (e, t, i, n) {
  28232. ;(this.priorityCriteria.pano = e),
  28233. this.priorityCriteria.cameraPosition.copy(t),
  28234. this.priorityCriteria.cameraDir.copy(i),
  28235. (this.priorityCriteria.upcomingPanos = n),
  28236. (this.maxNavQuality = this.qualityManager.getMaxNavPanoSize())
  28237. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  28238. if (!player.panoRenderer.isPanoZoomed(e.id)) {
  28239. //xzw add,直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  28240. this.maxNavQuality = Math.min(2048, this.maxNavQuality)
  28241. this.maxZoomQuality = Math.min(2048, this.maxZoomQuality)
  28242. }
  28243. }),
  28244. (n.prototype.filterAndPrioritize = (function () {
  28245. var e = [],
  28246. t = [],
  28247. i = []
  28248. return function (r, o, a) {
  28249. this.populateNeighborPanos(this.priorityCriteria.pano, o, e), this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER)
  28250. var s = this.baseSize,
  28251. l = this.standardSize,
  28252. c = this.highSize,
  28253. h = this.ultraHighSize
  28254. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  28255. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  28256. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, 1024, n.MAX_UPCOMING_PANOS_TOADD), //更清晰些
  28257. (i.length = 0),
  28258. this.canDownloadSize(l) &&
  28259. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28260. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28261. n.appendQueue(r, i),
  28262. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  28263. (i.length = 0),
  28264. this.canDownloadSize(c) &&
  28265. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28266. this.canDownloadSize(h) &&
  28267. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  28268. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28269. n.appendQueue(r, i),
  28270. (i.length = 0),
  28271. this.canDownloadSize(l) &&
  28272. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28273. this.canDownloadSize(c) &&
  28274. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28275. this.canDownloadSize(h) &&
  28276. this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  28277. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  28278. n.appendQueue(r, i),
  28279. this.queueTilesForPanos(r, e, a, s)
  28280. }
  28281. })()),
  28282. (n.prototype.canDownloadSize = function (e) {
  28283. return this.maxNavQuality >= e || (this.maxZoomQuality >= e && this.zoomingActive)
  28284. }),
  28285. (n.prototype.populateNeighborPanos = function (e, t, i) {
  28286. ;(i = i || []), (i.length = 0)
  28287. var n = t.getNeighbours(e)
  28288. for (var r in n)
  28289. if (n.hasOwnProperty(r)) {
  28290. var o = t.get(r)
  28291. i.push(o)
  28292. }
  28293. return i
  28294. }),
  28295. (n.prototype.populateScoredPanos = function (e, t, i, r, a) {
  28296. ;(i = i || []), (i.length = 0)
  28297. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)],
  28298. l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)],
  28299. c = t.sortByScore(s, l)
  28300. if (c)
  28301. for (var h = 0; h < c.length && h < a; h++) {
  28302. var u = c[h].item
  28303. i.push(u)
  28304. }
  28305. return i
  28306. }),
  28307. (n.prototype.queueTilesForPanos = function (e, t, i, n, r) {
  28308. for (var o = 0, a = 0; a < t.length; a++) {
  28309. var s = t[a],
  28310. l = this.queueTilesForPano(e, i, s, n)
  28311. if (((o += l > 0 ? 1 : 0), r && o >= r)) break
  28312. }
  28313. return o
  28314. }),
  28315. (n.prototype.queueTilesForPano = (function () {
  28316. var e = {
  28317. filter: h.None
  28318. }
  28319. return function (t, i, n, r) {
  28320. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  28321. }
  28322. })()),
  28323. (n.prototype.queueTilesForPanosInDirection = (function () {
  28324. var e = new r.Vector3()
  28325. return function (t, i, n, r, o, a, s, l) {
  28326. for (var h = 0, u = 0; u < n.length; u++) {
  28327. var d = n[u]
  28328. e.copy(d.position), e.sub(o), e.normalize()
  28329. var p = Math.max(Math.min(a.dot(e), 1), -1),
  28330. f = c.getFOVDotThreshold(s)
  28331. if (p >= f) {
  28332. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s)
  28333. if (((h += g > 0 ? 1 : 0), l && h >= l)) break
  28334. }
  28335. }
  28336. return h
  28337. }
  28338. })()),
  28339. (n.prototype.queueTilesInDirectionForPanos = function (e, t, i, n, r, o, a, s) {
  28340. for (var l = 0, c = 0; c < i.length; c++) {
  28341. var h = i[c],
  28342. u = this.queueTilesInDirectionForPano(e, t, h, n, o, a)
  28343. if (((l += u > 0 ? 1 : 0), s && l >= s)) break
  28344. }
  28345. return l
  28346. }),
  28347. (n.prototype.queueTilesInDirectionForPano = (function () {
  28348. var e = {
  28349. filter: h.DirectionalFOV,
  28350. direction: new r.Vector3(),
  28351. fov: 60
  28352. },
  28353. t = new r.Vector3()
  28354. return function (i, n, r, o, a, s, c) {
  28355. return t.copy(s), l.getRelativeDirection(r.quaternion, t), e.direction.copy(t), (e.fov = c), this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  28356. }
  28357. })()),
  28358. (n.prototype.filterAndQueueTileDownloadDescriptors = (function () {
  28359. var e = []
  28360. return function (t, i, n, r, o) {
  28361. var a = i.getTileDownloadDescriptors(n, r)
  28362. ;(e.length = 0), this.filterTileDownloadDescriptors(n, a, e, o)
  28363. for (var s = 0, l = 0; l < e.length; l++) {
  28364. var c = e[l]
  28365. c && (t.push(c), s++)
  28366. }
  28367. return s
  28368. }
  28369. })()),
  28370. (n.prototype.filterTileDownloadDescriptors = (function () {
  28371. new r.Vector3()
  28372. return function (e, t, i, n) {
  28373. var r, o
  28374. switch (n.filter) {
  28375. case h.DirectionalFOV:
  28376. for (r = 0; r < t.length; r++) (o = t[r]), l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o)
  28377. break
  28378. default:
  28379. for (r = 0; r < t.length; r++) (o = t[r]), i.push(o)
  28380. }
  28381. for (r = 0; r < i.length; r++) (o = i[r]), this.canIncludeDescriptor(o) || (i[r] = null)
  28382. }
  28383. })()),
  28384. (n.prototype.canIncludeDescriptor = function (e) {
  28385. return e.status !== s.Downloading && e.status !== s.Downloaded
  28386. }),
  28387. (n.prototype.canIncludePano = function (e, t) {
  28388. return !e.isLoaded(t)
  28389. }),
  28390. (n.getFOVDotThreshold = function (e) {
  28391. return Math.cos(r.Math.degToRad(e / 2))
  28392. })
  28393. var u = (function () {
  28394. var e = function e(t, i) {
  28395. var n = e._panoSpaceDir,
  28396. r = e._fovThreshold,
  28397. o = e._fovThresholdNarrow,
  28398. a = Math.max(Math.min(n.dot(t.direction), 1), -1),
  28399. s = Math.max(Math.min(n.dot(i.direction), 1), -1)
  28400. return (
  28401. (t._dot = a),
  28402. (i._dot = s),
  28403. 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)
  28404. )
  28405. }
  28406. return (e._panoSpaceDir = new r.Vector3()), (e._fovThreshold = -1), (e._fovThresholdNarrow = -1), e
  28407. })()
  28408. ;(n.sortPanoTiles = function (e, t, i) {
  28409. u._panoSpaceDir.copy(i),
  28410. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  28411. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  28412. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV)),
  28413. e.sort(u)
  28414. }),
  28415. (n.insertSortedPanoTile = function (e, t, i, r) {
  28416. u._panoSpaceDir.copy(r),
  28417. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  28418. (u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW)),
  28419. (u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV))
  28420. for (var o = -1, a = 0; a < e.length; a++) {
  28421. var s = u(t, e[a])
  28422. if (s <= 0) {
  28423. o = a
  28424. break
  28425. }
  28426. }
  28427. if (o === -1) e[e.length] = t
  28428. else {
  28429. for (var h = e.length; h > o; h--) e[h] = e[h - 1]
  28430. e[o] = t
  28431. }
  28432. }),
  28433. (n.prototype.setZoomingActive = function (e) {
  28434. e !== this.zoomingActive && (this.zoomingActive = e)
  28435. }),
  28436. (t.exports = n)
  28437. }).call(this, '/js/tile/TilePrioritizer.js')
  28438. },
  28439. {
  28440. '../enum/DownloadStatus': 24,
  28441. '../enum/GLCubeFaces': 25,
  28442. '../enum/ModelManagerEvents': 33,
  28443. '../enum/PanoSizeClass': 36,
  28444. '../enum/Vectors': 50,
  28445. '../enum/Viewmode': 51,
  28446. '../objects/Panorama': 148,
  28447. '../settings': 166,
  28448. '../util/browser': 182,
  28449. '../util/logger': 189,
  28450. '../util/math': 190,
  28451. './TileUtils': 174,
  28452. events: 202,
  28453. three: 217
  28454. }
  28455. ],
  28456. 173: [
  28457. function (e, t, i) {
  28458. 'use strict'
  28459. function n(e, t) {
  28460. ;(this.levels = t), (this.tileSize = e), (this.root = null), (this.allNodes = []), a(this)
  28461. }
  28462. function r(e, t) {
  28463. ;(this.tree = e), (this.parent = t), (this.children = []), (this.id = ++u)
  28464. }
  28465. function o(e, t, i, r, a, s, l, h) {
  28466. if (e) {
  28467. l = l || n.TraversalType.PreOrder
  28468. var u = r * c + i
  28469. if ((l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r), s && s.push(e)), e.children && 0 !== e.children.length)) {
  28470. for (var d = r * c, p = i * c, f = 0; f < c; f++) for (var g = 0; g < c; g++) o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h)
  28471. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r), s && s.push(e))
  28472. }
  28473. }
  28474. }
  28475. function a(e) {
  28476. e.root = s(e, null, 0)
  28477. }
  28478. function s(e, t, i) {
  28479. if (i > e.levels) return null
  28480. var n = new r(e, t)
  28481. e.allNodes.push(n)
  28482. for (var o = 0; o < h; o++) n.children[o] = s(e, n, i + 1)
  28483. return n
  28484. }
  28485. function l(e, t, i, n, r) {
  28486. if (!e) return null
  28487. if (0 === i) return e
  28488. if (!e.children || 0 === e.children.length) return null
  28489. var o = Math.pow(c, i),
  28490. a = o / c,
  28491. s = n % a,
  28492. h = r % a,
  28493. u = Math.floor(r / a),
  28494. d = Math.floor(n / a),
  28495. p = u * c + d,
  28496. f = e.children[p]
  28497. return l(f, t + 1, i - 1, s, h)
  28498. }
  28499. var c = (e('three'), e('./TileUtils'), e('../objects/Panorama'), e('../util/panorama'), e('events').EventEmitter, 2),
  28500. h = c * c
  28501. n.TraversalType = Object.freeze({
  28502. PreOrder: 0,
  28503. PostOrder: 1
  28504. })
  28505. var u = 0
  28506. ;(n.getLevelCountForSize = function (e, t) {
  28507. var i = 0
  28508. for (t < e && (t = e); ; ) {
  28509. if (((t /= c), t < e)) break
  28510. i++
  28511. }
  28512. return i
  28513. }),
  28514. (n.getSizeForLevel = function (e, t) {
  28515. return Math.pow(c, t) * e
  28516. }),
  28517. (n.prototype.getSubNode = function (e, t, i) {
  28518. ;(!t || e < this.tileSize) && (t = 0), (!i || e < this.tileSize) && (i = 0), e < this.tileSize && (e = this.tileSize)
  28519. var r = n.getLevelCountForSize(this.tileSize, e),
  28520. o = l(this.root, 0, r, t, i)
  28521. return o
  28522. }),
  28523. (n.prototype.breadthFirst = function (e) {
  28524. e = e || {}
  28525. var t = !!e.nullLevelEnd,
  28526. i = e.maxLevel,
  28527. n = e.minLevel,
  28528. r = e.callback,
  28529. o = e.saveVisited,
  28530. a = [],
  28531. s = {},
  28532. l = 0,
  28533. c = 0
  28534. for (a.push(this.root), a.push(s); a.length > 0 && !(i && l > i); ) {
  28535. var h = a.shift()
  28536. if (h === s) (!n || l >= n) && (r && t && r(null), o && t && o.push(null)), a.length > 0 && a.push(s), l++, (c = 0)
  28537. else {
  28538. if (h.children)
  28539. for (var u = 0; u < h.children.length; u++) {
  28540. var d = h.children[u]
  28541. d && a.push(h.children[u])
  28542. }
  28543. var p = this.getFaceIndexFromNode(h)
  28544. ;(!n || l >= n) && (r && r(h, l, p), o && o.push(h)), c++
  28545. }
  28546. }
  28547. }),
  28548. (n.prototype.getFaceIndexFromNode = function (e) {
  28549. if (!e) return -1
  28550. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  28551. var o = i.parent
  28552. if (!o) break
  28553. for (var a = -1, s = 0; s < o.children.length; s++) o.children[s] === i && (a = s)
  28554. var l = a % c,
  28555. h = Math.floor(a / c)
  28556. ;(n = l * t + n), (r = h * t + r), (t *= c), (i = o)
  28557. }
  28558. return r * t + n
  28559. }),
  28560. (n.prototype.depthFirst = function (e, t, i) {
  28561. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  28562. }),
  28563. (t.exports = n)
  28564. },
  28565. {
  28566. '../objects/Panorama': 148,
  28567. '../util/panorama': 191,
  28568. './TileUtils': 174,
  28569. events: 202,
  28570. three: 217
  28571. }
  28572. ],
  28573. 174: [
  28574. function (e, t, i) {
  28575. 'use strict'
  28576. var n = e('../enum/GLCubeFaces'),
  28577. r = e('../util/MathLight'),
  28578. o = {}
  28579. ;(o.TILE_SIZE = 512),
  28580. (o.FACES_PER_PANO = 6),
  28581. (o.LocationOnTile = {
  28582. Center: 0,
  28583. UpperLeft: 1,
  28584. UpperRight: 2,
  28585. LowerRight: 3,
  28586. LowerLeft: 4
  28587. }),
  28588. (o.getTileVector = (function () {
  28589. return function (e, t, i, a, s, l, c, h) {
  28590. l = l || o.LocationOnTile.Center
  28591. var u = e / t,
  28592. d = a / u
  28593. s = -s + (u - 1)
  28594. var p = s / u,
  28595. f = t / e,
  28596. g = 2 * f,
  28597. m = g / 2,
  28598. v = 2 * d - 1 + m,
  28599. A = 2 * p - 1 + m
  28600. switch (l) {
  28601. case o.LocationOnTile.UpperLeft:
  28602. ;(v -= m), (A += m), (v += c * g)
  28603. break
  28604. case o.LocationOnTile.UpperRight:
  28605. ;(v += m), (A += m), (A -= c * g)
  28606. break
  28607. case o.LocationOnTile.LowerRight:
  28608. ;(v += m), (A -= m), (v -= c * g)
  28609. break
  28610. case o.LocationOnTile.LowerLeft:
  28611. ;(v -= m), (A -= m), (A += c * g)
  28612. break
  28613. case o.LocationOnTile.Center:
  28614. }
  28615. switch (i) {
  28616. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28617. r.setVector(h, -1, A, -v)
  28618. break
  28619. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28620. r.setVector(h, 1, A, v)
  28621. break
  28622. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28623. r.setVector(h, -v, 1, -A)
  28624. break
  28625. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28626. r.setVector(h, -v, -1, A)
  28627. break
  28628. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28629. r.setVector(h, -v, A, 1)
  28630. break
  28631. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28632. r.setVector(h, v, A, -1)
  28633. }
  28634. r.normalize(h)
  28635. }
  28636. })()),
  28637. (o.getFaceForTile = function (e, t) {
  28638. var i = o.TILE_SIZE
  28639. e < o.TILE_SIZE && (i = e)
  28640. var n = Math.floor(e / i),
  28641. r = n * n
  28642. return Math.floor(t / r)
  28643. }),
  28644. (o.getTileLocation = function (e, t, i) {
  28645. var n = o.TILE_SIZE
  28646. e < o.TILE_SIZE && (n = e)
  28647. var r = o.getFaceForTile(e, t),
  28648. a = Math.floor(e / n),
  28649. s = a * a,
  28650. l = t - r * s
  28651. ;(i.tileX = l % a), (i.tileY = Math.floor(l / a)), (i.face = r), (i.faceTileIndex = l)
  28652. }),
  28653. (o.getTileCountForSize = function (e) {
  28654. if (e <= o.TILE_SIZE) return o.FACES_PER_PANO
  28655. var t = Math.floor(e / o.TILE_SIZE),
  28656. i = t * t,
  28657. n = i * o.FACES_PER_PANO
  28658. return n
  28659. }),
  28660. (o.getRelativeDirection = (function () {
  28661. var e = new r.Matrix4(),
  28662. t = new r.Quaternion()
  28663. return function (i, n) {
  28664. t.copy(i), t.inverse(), e.makeRotationFromQuaternion(t), e.applyToVector3(n), r.normalize(n)
  28665. }
  28666. })()),
  28667. (o.matchingTilesInDirection = (function () {
  28668. var e = new r.Vector3(),
  28669. t = new r.Vector3(0, 0, -1),
  28670. i = new r.Quaternion(),
  28671. n = function (e, t) {
  28672. e.push({
  28673. face: t.face,
  28674. faceTileIndex: t.faceTileIndex,
  28675. tileX: t.tileX,
  28676. tileY: t.tileY
  28677. })
  28678. },
  28679. a = (function () {
  28680. var e = {
  28681. face: -1,
  28682. faceTileIndex: -1,
  28683. tileX: -1,
  28684. tileY: -1
  28685. }
  28686. return function (t, i, r) {
  28687. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++) o.getTileLocation(t, l, e), (i && !i(e)) || (s++, r && n(r, e))
  28688. return s
  28689. }
  28690. })()
  28691. return function (n, s, l, c, h, u) {
  28692. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE
  28693. o.getTileCountForSize(s)
  28694. if (!c && !h) return a(s, null, u)
  28695. var p = !!h
  28696. if (((h = h || c), (h = Math.max(0, Math.min(h, 360))), (c = Math.max(0, Math.min(c, 360))), r.copyVector(l, e), o.getRelativeDirection(n.quaternion, e), p)) {
  28697. i.setFromUnitVectors(e, t)
  28698. var f = function (e) {
  28699. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  28700. }
  28701. return a(s, f, u)
  28702. }
  28703. var g = function (t) {
  28704. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  28705. }
  28706. return a(s, g, u)
  28707. }
  28708. })()),
  28709. (o.isTileWithinFrustum = (function () {
  28710. var e = new r.Vector3(),
  28711. t = 1e-5
  28712. return function (i, n, a, s, l, c, h, u) {
  28713. for (
  28714. var d = Math.tan(0.5 * u * r.RADIANS_PER_DEGREE),
  28715. p = -d,
  28716. f = Math.tan(0.5 * h * r.RADIANS_PER_DEGREE),
  28717. g = -f,
  28718. m = o.mapFaceToCubemapFace(a),
  28719. v = 0,
  28720. A = 0,
  28721. y = 0,
  28722. C = 0,
  28723. I = 0,
  28724. E = 0,
  28725. b = o.LocationOnTile.Center;
  28726. b <= o.LocationOnTile.LowerLeft;
  28727. b++
  28728. )
  28729. if ((o.getTileVector(i, n, m, s, l, b, 0, e), r.applyQuaternionToVector(c, e), e.z >= -t)) I++
  28730. else {
  28731. var w = -1 / e.z,
  28732. _ = e.x * w,
  28733. T = e.y * w
  28734. T > d ? v++ : T < p && A++, _ > f ? y++ : _ < g && C++, E++
  28735. }
  28736. return A !== E && v !== E && y !== E && C !== E
  28737. }
  28738. })()),
  28739. (o.isTileWithinFOV = (function () {
  28740. var e = new r.Vector3(),
  28741. t = new r.Vector3(0, 1, 0),
  28742. i = new r.Vector3(1, 0, 0)
  28743. return function (n, a, s, l, c, h, u) {
  28744. var d = o.mapFaceToCubemapFace(s)
  28745. if ((r.cross(h, t, i), o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e), o.isWithinFOV(e, h, u, null))) return !0
  28746. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  28747. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++) if ((o.getTileVector(n, a, d, l, c, v, g, e), o.isWithinFOV(e, h, u, null))) return !0
  28748. g += p
  28749. }
  28750. return !1
  28751. }
  28752. })()),
  28753. (o.isWithinFOV = (function () {
  28754. var e = new r.Vector3(),
  28755. t = new r.Vector3()
  28756. return function (i, n, o, a) {
  28757. if ((r.copyVector(i, t), a)) {
  28758. r.copyVector(a, e), r.normalize(e)
  28759. var s = r.dot(e, i)
  28760. ;(e.x *= s), (e.y *= s), (e.z *= s), r.subVector(t, e)
  28761. }
  28762. var l = (o / 2) * r.RADIANS_PER_DEGREE,
  28763. c = Math.cos(l),
  28764. h = r.dot(t, n)
  28765. return h >= c
  28766. }
  28767. })()),
  28768. (o.mapFaceToCubemapFace = (function () {
  28769. var e = {
  28770. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28771. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28772. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28773. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28774. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28775. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28776. }
  28777. return function (t) {
  28778. return e[t]
  28779. }
  28780. })()),
  28781. (t.exports = o)
  28782. },
  28783. {
  28784. '../enum/GLCubeFaces': 25,
  28785. '../util/MathLight': 176
  28786. }
  28787. ],
  28788. 175: [
  28789. function (e, t, i) {
  28790. ;(function (i) {
  28791. 'use strict'
  28792. function n() {
  28793. ;(this.list = []),
  28794. (this.index = {}),
  28795. Object.defineProperty(this, 'length', {
  28796. get: function () {
  28797. return this.list.length
  28798. }
  28799. })
  28800. }
  28801. var r = (e('./common'), e('./logger'))
  28802. new r(i)
  28803. ;(n.prototype.forEach = function (e) {
  28804. this.list.forEach(e)
  28805. }),
  28806. (n.prototype.add = function (e) {
  28807. this.list.push(e), (this.index[this.getIndex(e)] = e)
  28808. }),
  28809. (n.prototype.getIndex = function (e) {
  28810. throw new Error('IndexedCollection.getIndex not implemented in subclass.')
  28811. }),
  28812. (n.prototype.extend = function (e) {
  28813. for (var t = 0; t < e.length; t++) this.add(e[t])
  28814. }),
  28815. (n.prototype.get = function (e) {
  28816. return this.index[e]
  28817. }),
  28818. (n.prototype.first = function () {
  28819. return this.list[0]
  28820. }),
  28821. (n.prototype.last = function () {
  28822. return this.list[this.list.length - 1]
  28823. }),
  28824. (n.prototype.reIndex = function () {
  28825. this.index = {}
  28826. var e = this
  28827. this.forEach(function (t) {
  28828. e.index[e.getIndex(t)] = t
  28829. })
  28830. }),
  28831. (n.prototype.filter = function (e) {
  28832. var t = this.list.filter(e)
  28833. return this.reIndex(), t
  28834. }),
  28835. (n.prototype.reduce = function (e, t) {
  28836. return this.list.reduce(e, t)
  28837. }),
  28838. (n.prototype.sort = function (e) {
  28839. return this.list.sort(e)
  28840. }),
  28841. (n.prototype.indexOf = function (e) {
  28842. for (var t = 0; t < this.list.length; ++t) if (this.list[t] === e) return t
  28843. return -1
  28844. }),
  28845. (t.exports = n)
  28846. }).call(this, '/js/util/IndexedCollection.js')
  28847. },
  28848. {
  28849. './common': 185,
  28850. './logger': 189
  28851. }
  28852. ],
  28853. 176: [
  28854. function (e, t, i) {
  28855. 'use strict'
  28856. var n = e('../constants'),
  28857. r = {}
  28858. ;(r.RADIANS_PER_DEGREE = Math.PI / 180),
  28859. (r.DEGREES_PER_RADIAN = 180 / Math.PI),
  28860. (r.Vector3 = function (e, t, i) {
  28861. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  28862. }),
  28863. (r.Matrix4 = function () {
  28864. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  28865. arguments.length > 0 && console.error('MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.')
  28866. }),
  28867. (r.Matrix4.prototype = {
  28868. identity: function () {
  28869. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  28870. },
  28871. copy: function (e) {
  28872. return this.elements.set(e.elements), this
  28873. },
  28874. applyToVector3: function (e) {
  28875. var t = e.x,
  28876. i = e.y,
  28877. n = e.z,
  28878. r = this.elements
  28879. return (e.x = r[0] * t + r[4] * i + r[8] * n + r[12]), (e.y = r[1] * t + r[5] * i + r[9] * n + r[13]), (e.z = r[2] * t + r[6] * i + r[10] * n + r[14]), this
  28880. },
  28881. getInverse: function (e, t) {
  28882. var i = this.elements,
  28883. n = e.elements,
  28884. r = n[0],
  28885. o = n[1],
  28886. a = n[2],
  28887. s = n[3],
  28888. l = n[4],
  28889. c = n[5],
  28890. h = n[6],
  28891. u = n[7],
  28892. d = n[8],
  28893. p = n[9],
  28894. f = n[10],
  28895. g = n[11],
  28896. m = n[12],
  28897. v = n[13],
  28898. A = n[14],
  28899. y = n[15],
  28900. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  28901. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  28902. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  28903. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  28904. w = r * C + o * I + a * E + s * b
  28905. if (0 === w) {
  28906. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  28907. if (t) throw new Error(_)
  28908. return console.warn(_), this.identity()
  28909. }
  28910. var T = 1 / w
  28911. return (
  28912. (i[0] = C * T),
  28913. (i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T),
  28914. (i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T),
  28915. (i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T),
  28916. (i[4] = I * T),
  28917. (i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T),
  28918. (i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T),
  28919. (i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T),
  28920. (i[8] = E * T),
  28921. (i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T),
  28922. (i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T),
  28923. (i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T),
  28924. (i[12] = b * T),
  28925. (i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T),
  28926. (i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T),
  28927. (i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T),
  28928. this
  28929. )
  28930. },
  28931. makeRotationFromQuaternion: function (e) {
  28932. var t = this.elements,
  28933. i = e.x,
  28934. n = e.y,
  28935. r = e.z,
  28936. o = e.w,
  28937. a = i + i,
  28938. s = n + n,
  28939. l = r + r,
  28940. c = i * a,
  28941. h = i * s,
  28942. u = i * l,
  28943. d = n * s,
  28944. p = n * l,
  28945. f = r * l,
  28946. g = o * a,
  28947. m = o * s,
  28948. v = o * l
  28949. return (
  28950. (t[0] = 1 - (d + f)),
  28951. (t[4] = h - v),
  28952. (t[8] = u + m),
  28953. (t[1] = h + v),
  28954. (t[5] = 1 - (c + f)),
  28955. (t[9] = p - g),
  28956. (t[2] = u - m),
  28957. (t[6] = p + g),
  28958. (t[10] = 1 - (c + d)),
  28959. (t[3] = 0),
  28960. (t[7] = 0),
  28961. (t[11] = 0),
  28962. (t[12] = 0),
  28963. (t[13] = 0),
  28964. (t[14] = 0),
  28965. (t[15] = 1),
  28966. this
  28967. )
  28968. }
  28969. }),
  28970. (r.Quaternion = function (e, t, i, n) {
  28971. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._w = void 0 !== n ? n : 1)
  28972. }),
  28973. (r.Quaternion.prototype = {
  28974. get x() {
  28975. return this._x
  28976. },
  28977. set x(e) {
  28978. this._x = e
  28979. },
  28980. get y() {
  28981. return this._y
  28982. },
  28983. set y(e) {
  28984. this._y = e
  28985. },
  28986. get z() {
  28987. return this._z
  28988. },
  28989. set z(e) {
  28990. this._z = e
  28991. },
  28992. get w() {
  28993. return this._w
  28994. },
  28995. set w(e) {
  28996. this._w = e
  28997. },
  28998. copy: function (e) {
  28999. ;(this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w)
  29000. },
  29001. inverse: function () {
  29002. return this.conjugate().normalize()
  29003. },
  29004. conjugate: function () {
  29005. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this
  29006. },
  29007. length: function () {
  29008. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  29009. },
  29010. normalize: function () {
  29011. var e = this.length()
  29012. return (
  29013. 0 === e
  29014. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  29015. : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)),
  29016. this
  29017. )
  29018. },
  29019. setFromAxisAngle: function (e, t) {
  29020. var i = t / 2,
  29021. n = Math.sin(i)
  29022. return (this._x = e.x * n), (this._y = e.y * n), (this._z = e.z * n), (this._w = Math.cos(i)), this
  29023. },
  29024. setFromUnitVectors: (function () {
  29025. var e,
  29026. t,
  29027. i = 1e-6
  29028. return function (n, o) {
  29029. return (
  29030. void 0 === e && (e = new r.Vector3()),
  29031. (t = r.dot(n, o) + 1),
  29032. t < i ? ((t = 0), 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),
  29033. (this._x = e.x),
  29034. (this._y = e.y),
  29035. (this._z = e.z),
  29036. (this._w = t),
  29037. this.normalize()
  29038. )
  29039. }
  29040. })(),
  29041. multiply: function (e) {
  29042. return this.multiplyQuaternions(this, e)
  29043. },
  29044. premultiply: function (e) {
  29045. return this.multiplyQuaternions(e, this)
  29046. },
  29047. multiplyQuaternions: function (e, t) {
  29048. var i = e._x,
  29049. n = e._y,
  29050. r = e._z,
  29051. o = e._w,
  29052. a = t._x,
  29053. s = t._y,
  29054. l = t._z,
  29055. c = t._w
  29056. return (this._x = i * c + o * a + n * l - r * s), (this._y = n * c + o * s + r * a - i * l), (this._z = r * c + o * l + i * s - n * a), (this._w = o * c - i * a - n * s - r * l), this
  29057. }
  29058. }),
  29059. (r.convertWorkshopVector = function (e) {
  29060. return new r.Vector3(-e.x, e.y, e.z)
  29061. }),
  29062. (r.convertWorkshopQuaternion = function (e) {
  29063. 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))
  29064. })
  29065. ;(r.convertWorkshopOrthoZoom = function (e) {
  29066. //xzw
  29067. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  29068. return e === -1 ? -1 : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) * g_snapShotHeight
  29069. }),
  29070. (r.convertWorkshopPanoramaQuaternion = function (e) {
  29071. 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))
  29072. }),
  29073. (r.normalize = function (e) {
  29074. var t = e.x * e.x + e.y * e.y + e.z * e.z,
  29075. i = Math.sqrt(t)
  29076. ;(e.x /= i), (e.y /= i), (e.z /= i)
  29077. }),
  29078. (r.dot = function (e, t) {
  29079. return e.x * t.x + e.y * t.y + e.z * t.z
  29080. }),
  29081. (r.cross = function (e, t, i) {
  29082. var n = e.x,
  29083. r = e.y,
  29084. o = e.z
  29085. ;(i.x = r * t.z - o * t.y), (i.y = o * t.x - n * t.z), (i.z = n * t.y - r * t.x)
  29086. }),
  29087. (r.setVector = function (e, t, i, n) {
  29088. ;(e.x = t), (e.y = i), (e.z = n)
  29089. }),
  29090. (r.copyVector = function (e, t) {
  29091. ;(t.x = e.x), (t.y = e.y), (t.z = e.z)
  29092. }),
  29093. (r.addVector = function (e, t) {
  29094. ;(e.x += t.x), (e.y += t.y), (e.z += t.z)
  29095. }),
  29096. (r.subVector = function (e, t) {
  29097. ;(e.x -= t.x), (e.y -= t.y), (e.z -= t.z)
  29098. }),
  29099. (r.applyQuaternionToVector = function (e, t) {
  29100. var i = t.x,
  29101. n = t.y,
  29102. r = t.z,
  29103. o = e.x,
  29104. a = e.y,
  29105. s = e.z,
  29106. l = e.w,
  29107. c = l * i + a * r - s * n,
  29108. h = l * n + s * i - o * r,
  29109. u = l * r + o * n - a * i,
  29110. d = -o * i - a * n - s * r
  29111. ;(t.x = c * l + d * -o + h * -s - u * -a), (t.y = h * l + d * -a + u * -o - c * -s), (t.z = u * l + d * -s + c * -a - h * -o)
  29112. }),
  29113. (r.angleBetweenVectors = function (e, t) {
  29114. return Math.acos(r.dot(e, t))
  29115. }),
  29116. (t.exports = r)
  29117. },
  29118. {
  29119. '../constants': 8
  29120. }
  29121. ],
  29122. 177: [
  29123. function (e, t, i) {
  29124. ;(function (i) {
  29125. 'use strict'
  29126. function n(e) {
  29127. ;(this.cache = null), (this.expires = 0)
  29128. }
  29129. function r() {
  29130. ;(this.baseUrl = null), (this.cache = null), (this.expires = 0)
  29131. }
  29132. function o() {
  29133. ;(this.baseUrl = null), (this.expires = 0)
  29134. }
  29135. function a(e) {
  29136. ;(this.initialLoadingPromise = null),
  29137. (this.endpoint = e + '?type=3'),
  29138. (this.urlContainer = null),
  29139. (this.authorizationHeader = h.getAuthorizationHeader()),
  29140. (this.containerClasses = [o, r, n])
  29141. }
  29142. var s = e('./ajax'),
  29143. l = e('./logger'),
  29144. c = e('../constants'),
  29145. h = e('./showcase'),
  29146. u = (e('../ab'), new l(i))
  29147. ;(n.prototype = {
  29148. version: 1,
  29149. validate: function (e) {
  29150. return 'catalog.json' in e && Object.keys(e).length > 0
  29151. },
  29152. update: function (e) {
  29153. return (this.cache = e), (this.expires = Date.now() + c.signedUrlDefaultExpireTime), $.when()
  29154. },
  29155. get: function (e) {
  29156. return this.cache[e]
  29157. }
  29158. }),
  29159. (r.prototype = {
  29160. version: 2,
  29161. validate: function (e) {
  29162. return 'catalog.json' in e && 'base.url' in e && Object.keys(e).length > 1
  29163. },
  29164. update: function (e) {
  29165. return (this.baseUrl = e['base.url']), (this.cache = e), (this.expires = Date.now() + c.signedUrlDefaultExpireTime), $.when()
  29166. },
  29167. get: function (e) {
  29168. var t = this.cache[e]
  29169. return t ? this.baseUrl.replace('{{filename}}', e) + t : null
  29170. }
  29171. }),
  29172. (o.prototype = {
  29173. version: 3,
  29174. validate: function (e) {
  29175. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  29176. },
  29177. update: function (e) {
  29178. return (this.baseUrl = e.templates[0]), e.expires ? (this.expires = 1e3 * e.expires) : (this.expires = Date.now() + c.signedUrlDefaultExpireTime), $.when()
  29179. },
  29180. get: function (e) {
  29181. return this.baseUrl.replace('{{filename}}', e)
  29182. }
  29183. }),
  29184. (a.prototype = {
  29185. init: function () {
  29186. return this.initialLoadingPromise
  29187. ? this.initialLoadingPromise
  29188. : (setInterval(
  29189. function () {
  29190. var e = this.urlContainer ? this.urlContainer.expires : Date.now()
  29191. Date.now() + c.signedUrlRefreshBuffer > e &&
  29192. (u.debug('Refreshing urls...'),
  29193. this.refresh()
  29194. .done(function () {
  29195. u.debug('Refreshed')
  29196. })
  29197. .fail(function () {
  29198. u.error('Failed url refresh, urls might go stale soon')
  29199. }))
  29200. }.bind(this),
  29201. c.signedUrlCheckInterval
  29202. ),
  29203. (this.initialLoadingPromise = this.refresh()),
  29204. this.initialLoadingPromise)
  29205. },
  29206. refresh: function (e) {
  29207. //已经在someData.js里加载过了 不用再加载file了吧
  29208. e = e || {}
  29209. /*var t = void 0 === e.cache || e.cache;
  29210. return s.get( this.endpoint , { //file
  29211. responseType: "json",
  29212. prefetchFrom: t ? "files" : null,
  29213. cache: t,
  29214. auth: this.authorizationHeader
  29215. }).then(function(e) {
  29216. if (this.urlContainer && this.urlContainer.validate(e))
  29217. return this.urlContainer.update(e);
  29218. for (var i = 0; i < this.containerClasses.length; i++) {
  29219. var n = this.containerClasses[i]
  29220. , r = new n;
  29221. if (r.validate(e))
  29222. return u.info("Using urls version " + r.version),
  29223. this.urlContainer = r,
  29224. this.urlContainer.update(e)
  29225. }
  29226. return t ? this.refresh({
  29227. cache: !1
  29228. }) : $.Deferred().reject("missing-urls")
  29229. }
  29230. .bind(this), function(e) {
  29231. return "loading-failed"
  29232. }) */
  29233. return $.Deferred().resolve()
  29234. },
  29235. get: function (e) {
  29236. //return this.urlContainer.get(e)
  29237. return window.DATA.files.templates[0].replace('{{filename}}', e)
  29238. }
  29239. }),
  29240. (t.exports = a)
  29241. }).call(this, '/js/util/ModelUrls.js')
  29242. },
  29243. {
  29244. '../ab': 3,
  29245. '../constants': 8,
  29246. './ajax': 181,
  29247. './logger': 189,
  29248. './showcase': 193
  29249. }
  29250. ],
  29251. 178: [
  29252. function (e, t, i) {
  29253. ;(function (i) {
  29254. 'use strict'
  29255. function n() {
  29256. u.call(this), (this.neighbourMap = {}), (this.map = null)
  29257. }
  29258. var r = e('three'),
  29259. o = e('./common'),
  29260. a = e('../settings'),
  29261. s = e('../objects/Panorama'),
  29262. a = e('../settings'),
  29263. l = e('./aStar'),
  29264. c = e('./logger'),
  29265. h = new c(i),
  29266. u = e('./IndexedCollection'),
  29267. d = e('./transitions')
  29268. o.inherit(n, u),
  29269. (n.prototype.getIndex = function (e) {
  29270. return e.id
  29271. }),
  29272. (n.prototype.find = function (e, t) {
  29273. var i = o.filterAll(this.list, e)
  29274. return 0 === i.length
  29275. ? null
  29276. : (t &&
  29277. t.forEach(function (e) {
  29278. i = o.stableSort(i, e)
  29279. }),
  29280. i[0])
  29281. }),
  29282. /* n.prototype.sortByScore = function(e, t) {
  29283. var i = o.filterAll(this.list, e);
  29284. return 0 === i.length ? null : i = i.map(function(e) {
  29285. return {
  29286. pano: e,
  29287. score: t.reduce(function(t, i) {
  29288. return t + i(e)
  29289. }, 0)
  29290. }
  29291. }).sort(function(e, t) {
  29292. return t.score - e.score;
  29293. })
  29294. } */
  29295. (n.prototype.sortByScore = function (request, rank) {
  29296. return common.sortByScore(this.list, request, rank)
  29297. }),
  29298. (n.prototype.lowestByScore = function (e, t, i) {
  29299. return this.findRankedByScore(0, e, t, i)
  29300. }),
  29301. (n.prototype.findRankedByScore = function (e, t, i, n) {
  29302. n && ((n.candidates = null), (n.pano = null)), e || (e = 0)
  29303. var r = this.sortByScore(t, i)
  29304. return !r || 0 === r.length || e >= r.length ? null : (n && ((n.candidates = r), (n.pano = r[e].item)), r[e].item)
  29305. }),
  29306. (n.prototype.showPanoScores = function (e) {
  29307. this.list.forEach(function (e) {
  29308. e.removeTextSprite()
  29309. })
  29310. var t = 6344768
  29311. e.forEach(function (e) {
  29312. e.pano.addTextSprite(e.score.toFixed(2), t), (t = 16428055)
  29313. })
  29314. }),
  29315. (n.prototype.isNeighbour = function (e, t) {
  29316. return this.neighbourMap[e.id][t.id]
  29317. }),
  29318. (n.prototype.getNeighbours = function (e) {
  29319. return this.neighbourMap[e.id]
  29320. }),
  29321. (n.prototype.setNeighbour = function (e, t, i) {
  29322. return (
  29323. this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  29324. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  29325. (this.neighbourMap[e.id][e.id] = !0),
  29326. (this.neighbourMap[t.id][t.id] = !0),
  29327. (this.neighbourMap[e.id][t.id] = i),
  29328. (this.neighbourMap[t.id][e.id] = i),
  29329. this.neighbourMap[e.id]
  29330. )
  29331. }),
  29332. (n.prototype.findClosest = function (e, t) {
  29333. var i = [s.filters.isPanoAligned()]
  29334. return t && i.push(s.filters.inDirection(e, t, 0.75)), this.find(i, [s.sortFunctions.distanceToPoint(e)])
  29335. }),
  29336. (n.prototype.dualNeighbors = function (e, t) {
  29337. var i,
  29338. n = []
  29339. for (i in this.neighbourMap[e.id]) this.neighbourMap[t.id][i] && n.push(i)
  29340. return n
  29341. }),
  29342. (n.prototype.populate_path_graph = function () {
  29343. var e,
  29344. t,
  29345. i,
  29346. n,
  29347. o,
  29348. a,
  29349. s,
  29350. l,
  29351. c = Date.now(),
  29352. u = {},
  29353. d = 0,
  29354. p = new r.Vector3(0, 0, 0),
  29355. f = 0,
  29356. g = 0
  29357. for (e = 0; e < this.list.length; e += 1) {
  29358. ;(o = this.list[e]), (s = {}), (l = !1), (i = o.neighbourPanos || o.findNeighourPanos())
  29359. for (t in i)
  29360. if (i[t]) {
  29361. ;(a = this.index[t]), p.copy(o.floorPosition), p.sub(a.floorPosition)
  29362. var m = Math.sqrt(p.x * p.x + p.z * p.z),
  29363. v = (Math.abs(p.y) / Math.max(m, 0.01), Math.max(0, Math.abs(p.y) - 0.2))
  29364. v > 0 ? ((f += 1), (v = Math.pow(4 * v, 2)), (m = Math.pow(m, 2)), (n = Math.sqrt(v * v + m * m))) : ((g += 1), (n = p.length())), (s[a.id] = n), (l = !0)
  29365. }
  29366. l ? (u[o.id] = s) : (d += 1)
  29367. }
  29368. ;(this.map = u), h.info('graph ready in ' + (Date.now() - c) + 'ms, ' + d + ' had no neighbors')
  29369. }),
  29370. (n.prototype.aStarSearch = function (e, t) {
  29371. var i = Date.now(),
  29372. n = new l({
  29373. start: e,
  29374. isEnd: function (e) {
  29375. return e === t
  29376. },
  29377. neighbor: function (e) {
  29378. var t = e.neighbourPanos || e.findNeighourPanos(),
  29379. i = []
  29380. for (var n in t) t[n] && i.push(this.index[n]) //add: t[n] &&
  29381. return i
  29382. }.bind(this),
  29383. distance: function (e, t) {
  29384. var i = this.map[e.id],
  29385. n = i[t.id]
  29386. return n
  29387. }.bind(this),
  29388. heuristic: function (e, t) {
  29389. return 1
  29390. }.bind(this),
  29391. hash: function (e) {
  29392. return e.id
  29393. },
  29394. timeout: 5e3
  29395. })
  29396. if ((h.debug('A* search in ' + (Date.now() - i) + 'ms'), 'success' !== n.status)) return h.debug('Did not find A* path from ' + e + ' to ' + t), null
  29397. h.debug('Total cost ' + n.cost.toPrecision(3) + ', ' + n.path.length + ' steps')
  29398. var r = []
  29399. return (
  29400. n.path.forEach(function (e) {
  29401. r.push(e.id)
  29402. }),
  29403. r
  29404. )
  29405. }),
  29406. (n.prototype.includeNodesNearPath = (function () {
  29407. var e = new r.Vector3(),
  29408. t = new r.Vector3(),
  29409. i = new r.Vector3(),
  29410. n = new r.Vector3(),
  29411. o = new r.Vector3(),
  29412. a = new r.Vector3(),
  29413. s = new r.Vector3(),
  29414. l = new r.Vector3(),
  29415. c = [],
  29416. h = new r.Vector3(),
  29417. u = new r.Vector3()
  29418. return function (r, d) {
  29419. if (r)
  29420. for (
  29421. var p = function (e, t, i) {
  29422. return o.copy(t).sub(e), o.dot(i)
  29423. },
  29424. f = function (e, t) {
  29425. return p(h, e.position, i) - p(h, t.position, i)
  29426. },
  29427. g = 0;
  29428. g < r.length - 1;
  29429. ) {
  29430. var m = r[g],
  29431. v = r[g + 1],
  29432. A = this.index[m],
  29433. y = this.index[v]
  29434. h.copy(A.position), u.copy(y.position), (c.length = 0), e.copy(u).sub(h), i.copy(e).normalize()
  29435. for (var C = 0; C < this.list.length; C++) {
  29436. var I = this.list[C]
  29437. o.copy(I.position).sub(h)
  29438. var E = o.dot(i)
  29439. if (E > 0) {
  29440. s.copy(i), s.multiplyScalar(E), a.copy(o), a.sub(s)
  29441. var b = a.length()
  29442. if (b < d) {
  29443. t.copy(e).negate(), n.copy(t).normalize(), l.copy(I.position).sub(u)
  29444. var w = l.dot(n)
  29445. w > 0 && c.push(I)
  29446. }
  29447. }
  29448. }
  29449. if (c.length > 0) {
  29450. c.sort(f)
  29451. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--) r[_] = r[_ - c.length]
  29452. for (var T = 0; T < c.length; T++) r[T + g + 1] = c[T].id
  29453. }
  29454. g += c.length + 1
  29455. }
  29456. }
  29457. })()),
  29458. /* n.prototype. = function(e, t) {
  29459. var i = void 0 === e ? a.panorama.markerOpacity : e
  29460. , n = this.list.findIndex(function(e) {
  29461. return e.marker
  29462. });
  29463. if (!(n < 0)) {
  29464. var r = this.list[n].marker.material.opacity;
  29465. if (r !== e) {
  29466. var o = i - r;
  29467. d.trigger({
  29468. func: function(e, t) {
  29469. var i = r + e * o;
  29470. this.forEach(function(e) {
  29471. e.marker && (e.marker.material.opacity = i)
  29472. })
  29473. }
  29474. .bind(this),
  29475. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  29476. name: "_fpm"
  29477. })
  29478. }
  29479. }
  29480. } */
  29481. (n.prototype.fadeMarkerOpacity = function (e, t, gr) {
  29482. d.cancelById('fadeMarkerOpacity')
  29483. var n = this.list.findIndex(function (e) {
  29484. //why? 难道没有marker的pano吗 findeIndex:获取数组中函数返回值不为fasle的第一个元素索引位置
  29485. return e.marker
  29486. })
  29487. if (n < 0) {
  29488. //logger.info('marker findIndex<0')
  29489. return
  29490. }
  29491. var group
  29492. var tran = function (list, index) {
  29493. list.member = list.member.filter(function (m) {
  29494. return m.marker && m.marker.material.opacity != list.toOp
  29495. })
  29496. transitions.trigger({
  29497. func: function (e, t) {
  29498. //e:0-1
  29499. list.member.forEach(function (m) {
  29500. var o = m.marker.oldOpacity
  29501. var i = o + e * (list.toOp - o)
  29502. m.marker && (m.marker.material.opacity = i)
  29503. })
  29504. }.bind(this),
  29505. duration: void 0 == t ? a.markerOpacityTransitionTime : t,
  29506. name: '_fpm_' + index,
  29507. id: 'fadeMarkerOpacity'
  29508. })
  29509. }
  29510. this.forEach(function (e) {
  29511. //先记录旧的opacity
  29512. e.marker && (e.marker.oldOpacity = e.marker.material.opacity)
  29513. })
  29514. group = gr
  29515. /* if (e > 0 && gr) {
  29516. group = gr
  29517. } else {
  29518. group = [
  29519. {
  29520. member: this.list,
  29521. toOp: 0,
  29522. },
  29523. ]
  29524. } */
  29525. for (var i = 0; i < group.length; i++) {
  29526. tran(group[i], i)
  29527. }
  29528. }),
  29529. (t.exports = n)
  29530. }).call(this, '/js/util/PanoramaCollection.js')
  29531. },
  29532. {
  29533. '../objects/Panorama': 148,
  29534. '../settings': 166,
  29535. './IndexedCollection': 175,
  29536. './aStar': 180,
  29537. './common': 185,
  29538. './logger': 189,
  29539. './transitions': 195,
  29540. three: 217
  29541. }
  29542. ],
  29543. 179: [
  29544. function (e, t, i) {
  29545. 'use strict'
  29546. function n() {
  29547. ;(this.actionSequence = []), (this.actionSequenceInProgress = !1)
  29548. }
  29549. function r(e, t, i, n) {
  29550. s.trackAlways('zoom_' + e, {
  29551. from: t,
  29552. to: i,
  29553. pano: n
  29554. })
  29555. }
  29556. function o(e, t) {
  29557. r('initial', 1, e, t)
  29558. }
  29559. function a(e, t, i) {
  29560. r('followup', e, t, i)
  29561. }
  29562. var s = e('../analytics')
  29563. ;(n.prototype.reset = function (e) {
  29564. ;(this.actionSequenceInProgress = !1), (this.actionSequence.length = 0)
  29565. }),
  29566. (n.prototype.addZoomAction = (function () {
  29567. var e = null,
  29568. t = null,
  29569. i = !1,
  29570. n = function () {
  29571. if (((e = null), this.actionSequence.length > 0)) {
  29572. var i = this.actionSequence[0].start,
  29573. n = this.actionSequence[this.actionSequence.length - 1].end
  29574. 1 === i ? o(n, t) : a(i, n, t)
  29575. }
  29576. this.reset()
  29577. }
  29578. return function (r, o, a) {
  29579. if (r !== o) {
  29580. i || ((n = n.bind(this)), (i = !0)),
  29581. e && (window.clearTimeout(e), (e = null)),
  29582. (a === t && this.actionSequenceInProgress) || (this.reset(), (t = a)),
  29583. (this.actionSequenceInProgress = !0)
  29584. var s = {
  29585. start: r,
  29586. end: o
  29587. }
  29588. this.actionSequence.push(s), (e = window.setTimeout(n, 150))
  29589. }
  29590. }
  29591. })()),
  29592. (t.exports = n)
  29593. },
  29594. {
  29595. '../analytics': 4
  29596. }
  29597. ],
  29598. 180: [
  29599. function (e, t, i) {
  29600. 'use strict'
  29601. function n(e) {
  29602. void 0 === e.timeout && (e.timeout = 1 / 0)
  29603. var t = e.hash || o,
  29604. i = {
  29605. data: e.start,
  29606. g: 0,
  29607. h: e.heuristic(e.start)
  29608. },
  29609. n = i
  29610. i.f = i.h
  29611. var h = new s(),
  29612. u = new l(a),
  29613. d = c()
  29614. u.push(i), d.set(t(i.data), i)
  29615. for (var p = new Date(); u.size(); ) {
  29616. if (new Date() - p > e.timeout)
  29617. return {
  29618. status: 'timeout',
  29619. cost: n.g,
  29620. path: r(n)
  29621. }
  29622. var f = u.pop()
  29623. if ((d.delete(t(f.data)), e.isEnd(f.data)))
  29624. return {
  29625. status: 'success',
  29626. cost: f.g,
  29627. path: r(f)
  29628. }
  29629. h.add(t(f.data))
  29630. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  29631. var v = g[m]
  29632. if (!h.contains(t(v))) {
  29633. var A = f.g + e.distance(f.data, v),
  29634. y = d.get(t(v)),
  29635. C = !1
  29636. if (void 0 === y)
  29637. (y = {
  29638. data: v
  29639. }),
  29640. d.set(t(v), y)
  29641. else {
  29642. if (y.g < A) continue
  29643. C = !0
  29644. }
  29645. ;(y.parent = f), (y.g = A), (y.h = e.heuristic(v)), (y.f = A + y.h), y.h < n.h && (n = y), C ? u.heapify() : u.push(y)
  29646. }
  29647. }
  29648. }
  29649. return {
  29650. status: 'noPath',
  29651. cost: n.g,
  29652. path: r(n)
  29653. }
  29654. }
  29655. function r(e) {
  29656. if (void 0 !== e.parent) {
  29657. var t = r(e.parent)
  29658. return t.push(e.data), t
  29659. }
  29660. return [e.data]
  29661. }
  29662. function o(e) {
  29663. return e.toString()
  29664. }
  29665. function a(e, t) {
  29666. return e.f - t.f
  29667. }
  29668. var s = e('Set'),
  29669. l = e('heap'),
  29670. c = e('dict')
  29671. t.exports = n
  29672. },
  29673. {
  29674. Set: 196,
  29675. dict: 210,
  29676. heap: 211
  29677. }
  29678. ],
  29679. 181: [
  29680. function (e, t, i) {
  29681. ;(function (i) {
  29682. 'use strict'
  29683. function n(e, t, i) {
  29684. var n = new XMLHttpRequest()
  29685. if (i && 'withCredentials' in n) n.open(e, t, i)
  29686. else if ('undefined' != typeof XDomainRequest) (n = new XDomainRequest()), n.open(e, t)
  29687. else {
  29688. if (i) throw 'Browser does not support CORS!'
  29689. n.open(e, t)
  29690. }
  29691. return n
  29692. }
  29693. function r(e, t, i) {
  29694. function o() {
  29695. u.warn('Retrying ', t), r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  29696. }
  29697. function a(e, t) {
  29698. var i = e.response
  29699. if ('json' === t && 'object' != typeof i)
  29700. try {
  29701. i = JSON.parse(e.responseText)
  29702. } catch (e) {
  29703. return void c.reject({
  29704. error: 'Failed parsing JSON'
  29705. })
  29706. }
  29707. else if ('image/jpeg' === t) {
  29708. var n = new Uint8Array(e.response),
  29709. r = new Blob([n], {
  29710. type: 'image/jpeg'
  29711. }),
  29712. o = URL.createObjectURL(r)
  29713. ;(i = new Image()),
  29714. (i.src = o),
  29715. (i.crossOrigin = 'Anonymous'),
  29716. (i.onload = function () {
  29717. URL.revokeObjectURL(o)
  29718. })
  29719. }
  29720. return i
  29721. }
  29722. var s = n(e, t, !1)
  29723. if (((i = i || {}), (i.retries = void 0 !== i.retries ? i.retries : 0), (i.retry = void 0 !== i.retry ? i.retry : 'get' === e.toLowerCase()), i.responseType))
  29724. if (['arraybuffer', 'text', 'json'].indexOf(i.responseType) > -1) s.responseType = i.responseType
  29725. else {
  29726. if ('image/jpeg' !== i.responseType) throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"')
  29727. s.responseType = 'arraybuffer'
  29728. }
  29729. if (
  29730. ('json' === i.responseType && s.setRequestHeader('Accept', 'application/json'),
  29731. i.auth && s.setRequestHeader('Authorization', i.auth),
  29732. 'object' == typeof i.data && ((i.data = JSON.stringify(i.data)), s.setRequestHeader('Content-Type', 'application/json')),
  29733. 'object' == typeof i.headers)
  29734. )
  29735. for (var l in i.headers) s.setRequestHeader(l, i.headers[l])
  29736. var c = $.Deferred()
  29737. return (
  29738. (s.onreadystatechange = function (e) {
  29739. if (4 === this.readyState)
  29740. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3) i.retries++, setTimeout(o, 1e3)
  29741. else if (200 === this.status) {
  29742. var t = a(this, i.responseType)
  29743. c.resolve(t)
  29744. } else c.reject(this)
  29745. }),
  29746. (s.onprogress = function (e) {
  29747. c.notify(e)
  29748. }),
  29749. s.send(i.data),
  29750. c.promise()
  29751. )
  29752. }
  29753. function o(e) {
  29754. return Object.keys(e)
  29755. .sort()
  29756. .map(function (t) {
  29757. return {
  29758. key: t,
  29759. value: e[t]
  29760. }
  29761. })
  29762. }
  29763. function a(e, t) {
  29764. var i = t.responseType || null,
  29765. n = t.auth || null,
  29766. r = t.prefetchFrom || null,
  29767. a = e + '__' + i + '__' + n + '__' + r
  29768. return (
  29769. t.headers &&
  29770. o(t.headers).forEach(function (e) {
  29771. a += '__' + e.key + ':' + e.value
  29772. }),
  29773. a
  29774. )
  29775. }
  29776. function s(e, t) {
  29777. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  29778. }
  29779. function l(e, t, i) {
  29780. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  29781. }
  29782. var c = e('./logger'),
  29783. h = e('../ab'),
  29784. u = new c(i)
  29785. ;(window.URL = window.URL || window.webkitURL),
  29786. (window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {}),
  29787. (window.DATA = window.DATA || {}),
  29788. /* setTimeout(function() {//MP-- xzw delete
  29789. window.MP_REQUEST_CACHE = null,
  29790. window.DATA = {}
  29791. }, 6e4),
  29792. window.onpageshow = function(e) {
  29793. e.persisted && (window.MP_REQUEST_CACHE = null,
  29794. window.DATA = {})
  29795. } */
  29796. (t.exports = {
  29797. get: function (e, t) {
  29798. t = t || {}
  29799. var i = void 0 === t.cache || t.cache
  29800. if (i) {
  29801. var n = s(e, t)
  29802. if (n) return n
  29803. }
  29804. var o
  29805. return (o = t.prefetchFrom && window.DATA[t.prefetchFrom] ? $.when(window.DATA[t.prefetchFrom]) : r('GET', e, t)), i && l(e, t, o), o
  29806. },
  29807. post: function (e, t) {
  29808. return r('POST', e, t)
  29809. },
  29810. patch: function (e, t) {
  29811. return r('PATCH', e, t)
  29812. },
  29813. getImage: function (e, t) {
  29814. function i() {
  29815. u.warn('Retrying ', e),
  29816. o
  29817. .getImage(e, t - 1)
  29818. .done(n.resolve.bind(n))
  29819. .progress(n.notify.bind(n))
  29820. .fail(n.reject.bind(n))
  29821. }
  29822. var n = $.Deferred(),
  29823. r = new Image(),
  29824. o = this
  29825. return (
  29826. (e = h.changeIfImageOptimzing(e)),
  29827. (null !== t && void 0 !== t) || (t = 3),
  29828. (r.onerror = function () {
  29829. t > 0 ? setTimeout(i, 1e3) : n.reject()
  29830. }),
  29831. (r.onload = function () {
  29832. n.resolve(r)
  29833. }),
  29834. (r.crossOrigin = 'anonymous'),
  29835. (r.src = e),
  29836. n
  29837. )
  29838. }
  29839. })
  29840. }).call(this, '/js/util/ajax.js')
  29841. },
  29842. {
  29843. '../ab': 3,
  29844. './logger': 189
  29845. }
  29846. ],
  29847. 182: [
  29848. function (e, t, i) {
  29849. 'use strict'
  29850. function n(e, t) {
  29851. var i = window.navigator.userAgent,
  29852. n = i.match(e)
  29853. return (
  29854. (n = n ? n[1].split(t) : []),
  29855. {
  29856. major: parseInt(n[0]) || 0,
  29857. minor: parseInt(n[1]) || 0,
  29858. patch: parseInt(n[2]) || 0
  29859. }
  29860. )
  29861. }
  29862. var r = e('../exception/DeviceMismatchException')
  29863. t.exports = {
  29864. supportsFullscreen: function () {
  29865. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  29866. },
  29867. isPointerLocked: function () {
  29868. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  29869. },
  29870. requestFullscreen: function (e, t) {
  29871. e.requestFullscreen
  29872. ? e.requestFullscreen()
  29873. : e.mozRequestFullScreen
  29874. ? e.mozRequestFullScreen()
  29875. : e.webkitRequestFullscreen
  29876. ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT)
  29877. : e.msRequestFullscreen && e.msRequestFullscreen(),
  29878. t && $(document).on('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', browser.requestPointerLock)
  29879. },
  29880. requestPointerLock: function () {
  29881. var e
  29882. if (document.fullscreenElement) e = document.fullscreenElement()
  29883. else if (document.mozFullscreenElement) e = document.mozFullscreenElement()
  29884. else if (document.mozFullScreenElement) e = document.mozFullScreenElement()
  29885. else {
  29886. if (!document.webkitFullscreenElement) return
  29887. e = document.webkitFullscreenElement()
  29888. }
  29889. ;(e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock),
  29890. e.requestPointerLock(),
  29891. $(document).off('fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange', this)
  29892. },
  29893. exitPointerLock: function () {
  29894. ;(document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock), document.exitPointerLock()
  29895. },
  29896. exitFullscreen: function () {
  29897. document.exitFullscreen
  29898. ? document.exitFullscreen()
  29899. : document.msExitFullscreen
  29900. ? document.msExitFullscreen()
  29901. : document.mozCancelFullScreen
  29902. ? document.mozCancelFullScreen()
  29903. : document.webkitExitFullscreen && document.webkitExitFullscreen()
  29904. },
  29905. details: function () {
  29906. var e = navigator.userAgent.match('(Firefox|Chrome|Safari)/([\\d]+)')
  29907. return e
  29908. ? {
  29909. name: e[1],
  29910. version: parseInt(e[2]),
  29911. platform: navigator.platform
  29912. }
  29913. : {}
  29914. },
  29915. is: function (e) {
  29916. return this.details() && this.details().name === e
  29917. },
  29918. inIframe: function () {
  29919. return window.parent !== window
  29920. },
  29921. aspectRatio: function () {
  29922. var e = $('#player').width() / $('#player').height()
  29923. return isFinite(e) ? e : 0
  29924. },
  29925. userAgent: function () {
  29926. return window.navigator.userAgent
  29927. },
  29928. isLandscape: function () {
  29929. return this.isMobile && this.aspectRatio() > 1
  29930. },
  29931. isSmallScreen: function () {
  29932. var e = screen.width / window.devicePixelRatio
  29933. return e < 240
  29934. },
  29935. detectIE: function () {
  29936. var e = window.navigator.userAgent,
  29937. t = e.indexOf('MSIE ')
  29938. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  29939. },
  29940. detectSafari: function () {
  29941. var e = window.navigator.userAgent,
  29942. t = e.indexOf('Safari')
  29943. return t !== -1 && !this.detectChrome()
  29944. },
  29945. detectFirefox: function () {
  29946. var e = window.navigator.userAgent
  29947. return e.indexOf('Firefox') !== -1
  29948. },
  29949. detectChrome: function () {
  29950. var e = window.navigator.userAgent
  29951. return e.indexOf('Chrome') !== -1 && !this.detectOpera()
  29952. },
  29953. detectOpera: function () {
  29954. var e = window.navigator.userAgent
  29955. return e.indexOf('OPR') !== -1
  29956. },
  29957. detectIOS: function () {
  29958. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  29959. },
  29960. detectIPad: function () {
  29961. var e = window.navigator.userAgent,
  29962. t = /iPad/
  29963. return t.test(e)
  29964. },
  29965. detectIPod: function () {
  29966. var e = window.navigator.userAgent,
  29967. t = /iPod/
  29968. return t.test(e)
  29969. },
  29970. detectIPhone: function () {
  29971. var e = window.navigator.userAgent,
  29972. t = /iPhone/
  29973. return t.test(e)
  29974. },
  29975. detectAndroid: function () {
  29976. var e = window.navigator.userAgent
  29977. return e.indexOf('Android') !== -1
  29978. },
  29979. detectAndroidMobile: function () {
  29980. var e = window.navigator.userAgent
  29981. return this.detectAndroid() && e.indexOf('Mobile') !== -1
  29982. },
  29983. detectSamsungNative: function () {
  29984. var e = window.navigator.userAgent
  29985. return e.indexOf('SM-G900H') !== -1 || e.indexOf('GT-I9500') !== -1 || e.indexOf('SM-N900') !== -1
  29986. },
  29987. detectSamsungS6: function () {
  29988. var e = window.navigator.userAgent
  29989. return e.indexOf('SM-G92') !== -1
  29990. },
  29991. /************************************************************fyz改from徐世廷*************************************************************/
  29992. detectHUAWEI5X: function () {
  29993. return -1 !== window.navigator.userAgent.indexOf('KIW-TL00H')
  29994. },
  29995. /*******************************************************************************************************************************/
  29996. detectWebVR: function () {
  29997. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  29998. },
  29999. getVRDisplay: function () {
  30000. var e = $.Deferred()
  30001. return this.detectWebVR()
  30002. ? (navigator.getVRDisplays().then(function (t) {
  30003. t.length >= 1 && e.resolve(t[0]), e.reject(null)
  30004. }),
  30005. e)
  30006. : e.reject(null)
  30007. },
  30008. iosVersion: function () {
  30009. if (!this.detectIOS()) throw new r('Did not detect an iDevice')
  30010. var e = /((?:\d+\_?){1,3}) like Mac OS/,
  30011. t = '_'
  30012. return n(e, t)
  30013. },
  30014. androidVersion: function () {
  30015. if (!this.detectAndroid()) throw new r('Did not detect an Android based device')
  30016. var e = /Android ((?:\d+\.?){1,3})/,
  30017. t = '.'
  30018. return n(e, t)
  30019. },
  30020. valueFromCookie: function (e, t) {
  30021. var i = new RegExp(e + '=([0-9a-f]+)(; ?|$)').exec(document.cookie)
  30022. if (!i) return t
  30023. var n = i[1]
  30024. return 'boolean' == typeof t ? 'true' === n || '1' === n : 'number' == typeof t ? parseFloat(n) : n
  30025. }
  30026. }
  30027. Object.assign(window.browser, t.exports)
  30028. t.exports = window.browser
  30029. changeLog()
  30030. },
  30031. {
  30032. '../exception/DeviceMismatchException': 56
  30033. }
  30034. ],
  30035. 183: [
  30036. function (e, t, i) {
  30037. ;(function (i) {
  30038. 'use strict'
  30039. function n(e, t) {
  30040. var i = r(t)
  30041. var replaceAll = function (str, f, e) {
  30042. //f全部替换成e
  30043. var reg = new RegExp(f, 'g') //创建正则RegExp对象
  30044. return str.replace(reg, e)
  30045. }
  30046. var urlFirstView = c.valueFromHash('firstView')
  30047. if (urlFirstView) {
  30048. //&firstView=pano:e98808cfdb894f33851c3b3d7d0a2679,qua:-0.015155019941222028,0.3253822291629593,0.005215708110435864,0.945446737862511&qs=1
  30049. try {
  30050. urlFirstView = replaceAll(urlFirstView, 'pano:', '"pano":"')
  30051. if (urlFirstView.includes('qua')) {
  30052. urlFirstView = replaceAll(urlFirstView, ',qua:', '","qua":[')
  30053. urlFirstView += ']'
  30054. } else {
  30055. urlFirstView += '"'
  30056. }
  30057. urlFirstView = '{' + urlFirstView + '}'
  30058. let info = JSON.parse(urlFirstView)
  30059. i.pano = t.index[info.pano] //panos.get(info.pano)
  30060. if (!i.pano) {
  30061. urlFirstView = false
  30062. console.error('检测到firstView但是 找不到该pano')
  30063. } else {
  30064. if (info.qua) {
  30065. i.quaternion = new THREE.Quaternion().fromArray(info.qua)
  30066. } else {
  30067. i.quaternion = new THREE.Quaternion()
  30068. }
  30069. i.zoom = -1
  30070. i.mode = 'panorama'
  30071. i.setByUrl = true
  30072. }
  30073. } catch (e) {
  30074. urlFirstView = false
  30075. console.error('检测到firstView但是解析出错' + e)
  30076. }
  30077. }
  30078. if (Object.keys(i).length > 0) return i
  30079. if (e.heroImage) i = o(e, t)
  30080. else if (window.DATA.camera_start) {
  30081. var n = window.DATA.camera_start
  30082. try {
  30083. Object.keys(n).length > 0 &&
  30084. !l.isEmptyQuaternion(n.camera.quaternion) &&
  30085. ((i.mode = h.convertWorkshopModeInt(n.mode)),
  30086. (i.position = n.camera.position),
  30087. //i.quaternion = n.camera.quaternion,
  30088. (i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion)), //xzw
  30089. (i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom)),
  30090. n.pano &&
  30091. ((i.pano = t.get(n.pano.uuid) || t.findClosest(i.position)),
  30092. d.debug('Using camera_start'),
  30093. d.debug('Modeldata pano: ', i.pano.quaternion),
  30094. d.debug('Camera start pano: ', n.pano.quaternion)),
  30095. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  30096. } catch (e) {
  30097. d.warn(e.message)
  30098. if (i.mode == 'panorama' && !i.pano) i.pano = t.list[0]
  30099. }
  30100. }
  30101. if (
  30102. (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  30103. i.mode === h.MESH && i.position && ((i.mode = h.PANORAMA), (i.pano = t.findClosest(i.position)), (i.quaternion = i.pano.quaternion)),
  30104. 0 === Object.keys(i).length)
  30105. ) {
  30106. var a = t.list[0]
  30107. a && ((i.mode = h.PANORAMA), (i.pano = a), (i.position = a.position), (i.quaternion = a.quaternion), d.info('Starting at 1st pano ' + a.id))
  30108. }
  30109. return (i.mode = i.mode || h.DOLLHOUSE), i
  30110. }
  30111. function r(e) {
  30112. var t = c.valueFromHash('start', ''),
  30113. i = {}
  30114. if ('' !== t) {
  30115. d.debug('Start override found in parameters, trying to parse...'), (i = a(t) || {})
  30116. var n = c.valueFromHash('tag', null)
  30117. n && (i.tag = n), i.panoId && (i.pano = e.get(i.panoId))
  30118. }
  30119. return i
  30120. }
  30121. function o(e, t) {
  30122. if (!e.heroImage || !e.heroImage.metadata.camera_position) return {}
  30123. var i = {},
  30124. n = e.heroImage.metadata
  30125. d.debug('Using start position from thumbnail image'), (i.position = n.camera_position), (i.quaternion = n.camera_quaternion)
  30126. try {
  30127. ;(i.mode = h.convertWorkshopModeInt(n.camera_mode)), i.mode === h.PANORAMA ? (i.pano = t.get(n.scan_id)) : (i.floorVisibility = n.floor_visibility)
  30128. } catch (e) {
  30129. d.debug(e.message)
  30130. }
  30131. return i
  30132. }
  30133. function a(e) {
  30134. return s.deserialize(e)
  30135. }
  30136. var s = e('../controls/serializer'),
  30137. l = e('../util/math'),
  30138. c = e('./browser'),
  30139. h = e('../enum/Viewmode'),
  30140. u = e('../util/logger'),
  30141. th = e('three'), //xzw
  30142. d = new u(i)
  30143. t.exports = {
  30144. getStartCameraOptions: n
  30145. }
  30146. }).call(this, '/js/util/camera.js')
  30147. },
  30148. {
  30149. '../controls/serializer': 14,
  30150. '../enum/Viewmode': 51,
  30151. '../util/logger': 189,
  30152. '../util/math': 190,
  30153. './browser': 182,
  30154. three: 217
  30155. }
  30156. ],
  30157. 184: [
  30158. function (e, t, i) {
  30159. 'use strict'
  30160. function n(e, t, i) {
  30161. return o(e.fov, t, i)
  30162. }
  30163. var r = e('./MathLight'),
  30164. o = function (e, t, i) {
  30165. var n = t,
  30166. o = i,
  30167. a = 2 * Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (n / o)) * r.DEGREES_PER_RADIAN
  30168. return a
  30169. },
  30170. a = function (e, t, i) {
  30171. var n = t,
  30172. o = i,
  30173. a = 2 * Math.atan(Math.tan((e * r.RADIANS_PER_DEGREE) / 2) * (o / n)) * r.DEGREES_PER_RADIAN
  30174. return a
  30175. },
  30176. s = function (e, t, i, n) {
  30177. var r = o(e, i, n)
  30178. return r > t ? a(t, i, n) : e
  30179. }
  30180. t.exports = {
  30181. clampVFOV: s,
  30182. getHFOVForCamera: n,
  30183. getHFOVFromVFOV: o,
  30184. getVFOVFromHFOV: a
  30185. }
  30186. window.MathLight = t.exports
  30187. MathLight.closeTo = function (e1, e2, precision) {
  30188. //xzw add 判断e1,e2是否接近
  30189. var prec = Math.pow(10, -(precision || 4))
  30190. var s1 = Math.abs(e1.x - e2.x) < prec && Math.abs(e1.y - e2.y) < prec && Math.abs(e1.z - e2.z) < prec
  30191. if (e1.w) {
  30192. return s1 && Math.abs(e1.w - e2.w) < prec
  30193. } else return s1
  30194. }
  30195. },
  30196. {
  30197. './MathLight': 176
  30198. }
  30199. ],
  30200. 185: [
  30201. function (e, t, i) {
  30202. 'use strict'
  30203. var n = e('three')
  30204. ;(t.exports = {
  30205. delayOneFrame: function (e) {
  30206. window.setTimeout(e, 1)
  30207. },
  30208. normalizeUrl: function (e) {
  30209. return e.replace('https://', 'http://')
  30210. },
  30211. domainFromUrl: function (e) {
  30212. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e)
  30213. return t ? t[3] : e
  30214. },
  30215. average: function (e, t) {
  30216. if (0 === e.length) return null
  30217. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  30218. var o = t ? e[r][t] : e[r]
  30219. ;(i += o), n++
  30220. }
  30221. return i / n
  30222. },
  30223. countUnique: function (e) {
  30224. for (var t = {}, i = 0; i < e.length; i++) t[e[i]] = 1 + (t[e[i]] || 0)
  30225. return Object.keys(t).length
  30226. },
  30227. averageVectors: function (e, t) {
  30228. var i = new n.Vector3()
  30229. if (0 === e.length) return i
  30230. for (var r = 0, o = 0; o < e.length; o++) {
  30231. var a = t ? e[o][t] : e[o]
  30232. i.add(a), r++
  30233. }
  30234. return i.divideScalar(r)
  30235. },
  30236. equalLists: function (e, t) {
  30237. if (e.length !== t.length) return !1
  30238. for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !1
  30239. return !0
  30240. },
  30241. lowerMedian: function (e, t) {
  30242. if (0 === e.length) return null
  30243. ;(t = t || 2),
  30244. e.sort(function (e, t) {
  30245. return e - t
  30246. })
  30247. var i = Math.floor(e.length / t)
  30248. return e[i]
  30249. },
  30250. stableSort: function (e, t) {
  30251. return e
  30252. .map(function (e, t) {
  30253. return {
  30254. value: e,
  30255. index: t
  30256. }
  30257. })
  30258. .sort(function (e, i) {
  30259. var n = t(e.value, i.value)
  30260. return 0 !== n ? n : e.index - i.index
  30261. })
  30262. .map(function (e) {
  30263. return e.value
  30264. })
  30265. },
  30266. filterAll: function (e, t) {
  30267. return e.filter(function (e) {
  30268. return t.every(function (t) {
  30269. return t(e)
  30270. })
  30271. })
  30272. },
  30273. formatDate: function (e) {
  30274. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join('-')
  30275. },
  30276. formatDatetime: function (e) {
  30277. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join('-')
  30278. },
  30279. randomString: function (e) {
  30280. for (var t = '', i = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', n = 0; n < e; n++) t += i.charAt(Math.floor(Math.random() * i.length))
  30281. return t
  30282. },
  30283. uint8ToBase64: function (e, t) {
  30284. ;(t && 'number' == typeof t) || (t = 8192)
  30285. for (var i = [], n = 0; n < e.length; n += t) i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)))
  30286. return btoa(i.join(''))
  30287. },
  30288. uuid4: function e(t) {
  30289. return t ? (t ^ ((16 * Math.random()) >> (t / 4))).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  30290. },
  30291. nth: function (e) {
  30292. return (e %= 10), 1 === e ? e + 'st' : 2 === e ? e + 'nd' : 3 === e ? e + 'rd' : e + 'th'
  30293. },
  30294. extendObject: function (e, t) {
  30295. return (
  30296. Object.keys(t).forEach(function (i) {
  30297. e[i] = t[i]
  30298. }),
  30299. e
  30300. )
  30301. },
  30302. deepExtend: function e(t) {
  30303. t = t || {}
  30304. for (var i = 1; i < arguments.length; i++) {
  30305. var n = arguments[i]
  30306. if (n) for (var r in n) n.hasOwnProperty(r) && ('object' == typeof n[r] ? (t[r] = e(t[r], n[r])) : (t[r] = n[r]))
  30307. }
  30308. return t
  30309. },
  30310. inherit: function (e, t) {
  30311. ;(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e)
  30312. },
  30313. extend: function (e, t) {
  30314. for (var i in t.prototype) e.prototype[i] = t.prototype[i]
  30315. },
  30316. getFileNameFromUrl: function (url) {
  30317. return url.split('/').pop()
  30318. }
  30319. }),
  30320. (Math.sign = function (e) {
  30321. return e < 0 ? -1 : 1
  30322. })
  30323. window.common = t.exports
  30324. expandCommon(common)
  30325. },
  30326. {
  30327. three: 217
  30328. }
  30329. ],
  30330. 186: [
  30331. function (e, t, i) {
  30332. 'use strict'
  30333. var n = {}
  30334. ;(n.linearTween = function (e, t, i, n) {
  30335. return (i * e) / n + t
  30336. }),
  30337. (n.easeInQuad = function (e, t, i, n) {
  30338. return (e /= n), i * e * e + t
  30339. }),
  30340. (n.easeOutQuad = function (e, t, i, n) {
  30341. return (e /= n), -i * e * (e - 2) + t
  30342. }),
  30343. (n.easeInOutQuad = function (e, t, i, n) {
  30344. return (e /= n / 2), e < 1 ? (i / 2) * e * e + t : (e--, (-i / 2) * (e * (e - 2) - 1) + t)
  30345. }),
  30346. (n.easeInCubic = function (e, t, i, n) {
  30347. return (e /= n), i * e * e * e + t
  30348. }),
  30349. (n.easeOutCubic = function (e, t, i, n) {
  30350. return (e /= n), e--, i * (e * e * e + 1) + t
  30351. }),
  30352. (n.easeInOutCubic = function (e, t, i, n) {
  30353. return (e /= n / 2), e < 1 ? (i / 2) * e * e * e + t : ((e -= 2), (i / 2) * (e * e * e + 2) + t)
  30354. }),
  30355. (n.easeInQuart = function (e, t, i, n) {
  30356. return (e /= n), i * e * e * e * e + t
  30357. }),
  30358. (n.easeOutQuart = function (e, t, i, n) {
  30359. return (e /= n), e--, -i * (e * e * e * e - 1) + t
  30360. }),
  30361. (n.easeInOutQuart = function (e, t, i, n) {
  30362. return (e /= n / 2), e < 1 ? (i / 2) * e * e * e * e + t : ((e -= 2), (-i / 2) * (e * e * e * e - 2) + t)
  30363. }),
  30364. (n.easeInQuint = function (e, t, i, n) {
  30365. return (e /= n), i * e * e * e * e * e + t
  30366. }),
  30367. (n.easeOutQuint = function (e, t, i, n) {
  30368. return (e /= n), e--, i * (e * e * e * e * e + 1) + t
  30369. }),
  30370. (n.easeInOutQuint = function (e, t, i, n) {
  30371. return (e /= n / 2), e < 1 ? (i / 2) * e * e * e * e * e + t : ((e -= 2), (i / 2) * (e * e * e * e * e + 2) + t)
  30372. }),
  30373. (n.easeInSine = function (e, t, i, n) {
  30374. return -i * Math.cos((e / n) * (Math.PI / 2)) + i + t
  30375. }),
  30376. (n.easeOutSine = function (e, t, i, n) {
  30377. return i * Math.sin((e / n) * (Math.PI / 2)) + t
  30378. }),
  30379. (n.easeInOutSine = function (e, t, i, n) {
  30380. return (-i / 2) * (Math.cos((Math.PI * e) / n) - 1) + t
  30381. }),
  30382. (n.easeInExpo = function (e, t, i, n) {
  30383. return i * Math.pow(2, 10 * (e / n - 1)) + t
  30384. }),
  30385. (n.easeOutExpo = function (e, t, i, n) {
  30386. return i * (-Math.pow(2, (-10 * e) / n) + 1) + t
  30387. }),
  30388. (n.easeInOutExpo = function (e, t, i, n) {
  30389. return (e /= n / 2), e < 1 ? (i / 2) * Math.pow(2, 10 * (e - 1)) + t : (e--, (i / 2) * (-Math.pow(2, -10 * e) + 2) + t)
  30390. }),
  30391. (n.easeInCirc = function (e, t, i, n) {
  30392. return (e /= n), -i * (Math.sqrt(1 - e * e) - 1) + t
  30393. }),
  30394. (n.easeOutCirc = function (e, t, i, n) {
  30395. return (e /= n), e--, i * Math.sqrt(1 - e * e) + t
  30396. }),
  30397. (n.easeInOutCirc = function (e, t, i, n) {
  30398. return (e /= n / 2), e < 1 ? (-i / 2) * (Math.sqrt(1 - e * e) - 1) + t : ((e -= 2), (i / 2) * (Math.sqrt(1 - e * e) + 1) + t)
  30399. }),
  30400. (n.easeInElastic = function (e, t, i, n) {
  30401. var r = 1.70158,
  30402. o = 0,
  30403. a = i
  30404. return 0 === e
  30405. ? t
  30406. : 1 === (e /= n)
  30407. ? t + i
  30408. : (o || (o = 0.3 * n),
  30409. a < Math.abs(i) ? ((a = i), (r = o / 4)) : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  30410. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o)) + t)
  30411. }),
  30412. (n.easeOutElastic = function (e, t, i, n) {
  30413. var r = 1.70158,
  30414. o = 0,
  30415. a = i
  30416. return 0 === e
  30417. ? t
  30418. : 1 === (e /= n)
  30419. ? t + i
  30420. : (o || (o = 0.3 * n),
  30421. a < Math.abs(i) ? ((a = i), (r = o / 4)) : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  30422. a * Math.pow(2, -10 * e) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) + i + t)
  30423. }),
  30424. (n.easeInOutElastic = function (e, t, i, n) {
  30425. var r = 1.70158,
  30426. o = 0,
  30427. a = i
  30428. return 0 === e
  30429. ? t
  30430. : 2 === (e /= n / 2)
  30431. ? t + i
  30432. : (o || (o = n * (0.3 * 1.5)),
  30433. a < Math.abs(i) ? ((a = i), (r = o / 4)) : (r = (o / (2 * Math.PI)) * Math.asin(i / a)),
  30434. e < 1
  30435. ? -0.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o)) + t
  30436. : a * Math.pow(2, -10 * (e -= 1)) * Math.sin(((e * n - r) * (2 * Math.PI)) / o) * 0.5 + i + t)
  30437. }),
  30438. (n.easeInBack = function (e, t, i, n, r) {
  30439. return void 0 === r && (r = 1.70158), i * (e /= n) * e * ((r + 1) * e - r) + t
  30440. }),
  30441. (n.easeOutBack = function (e, t, i, n, r) {
  30442. return void 0 === r && (r = 1.70158), i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  30443. }),
  30444. (n.easeInOutBack = function (e, t, i, n, r) {
  30445. return void 0 === r && (r = 1.70158), (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
  30446. }),
  30447. (n.easeOutBounce = function (e, t, i, n) {
  30448. return (e /= n) < 1 / 2.75
  30449. ? i * (7.5625 * e * e) + t
  30450. : e < 2 / 2.75
  30451. ? i * (7.5625 * (e -= 1.5 / 2.75) * e + 0.75) + t
  30452. : e < 2.5 / 2.75
  30453. ? i * (7.5625 * (e -= 2.25 / 2.75) * e + 0.9375) + t
  30454. : i * (7.5625 * (e -= 2.625 / 2.75) * e + 0.984375) + t
  30455. }),
  30456. (n.easeInBounce = function (e, t, i, r) {
  30457. return i - n.easeOutBounce(r - e, 0, i, r) + t
  30458. }),
  30459. (n.easeInOutBounce = function (e, t, i, r) {
  30460. return e < r / 2 ? 0.5 * n.easeInBounce(2 * e, 0, i, r) + t : 0.5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + 0.5 * i + t
  30461. }),
  30462. (t.exports = n)
  30463. window.easing = n
  30464. },
  30465. {}
  30466. ],
  30467. 187: [
  30468. function (e, t, i) {
  30469. 'use strict'
  30470. function n() {
  30471. ;(this.events = []), (this.valid = !1)
  30472. }
  30473. var r = e('../enum/Joystick')
  30474. ;(n.prototype.push = function (e, t) {
  30475. this.events.push({
  30476. direction: e,
  30477. pano: t
  30478. }),
  30479. (this.valid = !0)
  30480. }),
  30481. (n.prototype.pop = function (e) {
  30482. var t = this.events.pop()
  30483. return this.events.length < 1 && (this.valid = !1), t
  30484. }),
  30485. (n.prototype.peek = function () {
  30486. return this.events.length
  30487. ? this.events[this.events.length - 1]
  30488. : {
  30489. direction: null,
  30490. pano: null
  30491. }
  30492. }),
  30493. (n.prototype.invalidate = function () {
  30494. ;(this.events = []), (this.valid = !1)
  30495. }),
  30496. (n.prototype.reversePano = function (e) {
  30497. if (!this.valid) return null
  30498. var t = this.peek()
  30499. return r.opposite(e) === t.direction ? (this.pop(), t.pano) : null
  30500. }),
  30501. (t.exports = n)
  30502. },
  30503. {
  30504. '../enum/Joystick': 29
  30505. }
  30506. ],
  30507. 188: [
  30508. function (e, t, i) {
  30509. 'use strict'
  30510. window.lerp = t.exports = {
  30511. vector: function (e, t) {
  30512. var i = e.clone()
  30513. return (
  30514. (t = t.clone()),
  30515. function (n) {
  30516. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  30517. }
  30518. )
  30519. },
  30520. quaternion: function (e, t) {
  30521. var i = e.clone()
  30522. return function (n) {
  30523. e.copy(i).slerp(t, n)
  30524. }
  30525. },
  30526. property: function (e, t, i, n) {
  30527. var r = e[t]
  30528. return function (o) {
  30529. ;(e[t] = r * (1 - o) + i * o), n && n(e[t])
  30530. }
  30531. },
  30532. uniform: function (e, t, i) {
  30533. var n = e.material.uniforms[t].value
  30534. return function (r) {
  30535. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  30536. }
  30537. },
  30538. matrix4: function (e, t) {
  30539. var i = e.clone()
  30540. return function (n) {
  30541. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++) r[s] = o[s] * (1 - n) + a[s] * n
  30542. }
  30543. },
  30544. allUniforms: function (e, t, i) {
  30545. var n = e.map(
  30546. function (e) {
  30547. return this.uniform(e, t, i)
  30548. }.bind(this)
  30549. )
  30550. return function (e) {
  30551. n.forEach(function (t) {
  30552. t(e)
  30553. })
  30554. }
  30555. }
  30556. }
  30557. },
  30558. {}
  30559. ],
  30560. 189: [
  30561. function (e, t, i) {
  30562. 'use strict'
  30563. function n(e) {
  30564. var t,
  30565. i,
  30566. o,
  30567. a,
  30568. s = e.split('/'),
  30569. l = '[' + s[s.length - 1].replace('.js', '') + ']',
  30570. c = {}
  30571. if (n.consoleEnabled) {
  30572. var h = function (e) {
  30573. $('#debug-console').append('<p>' + e + '</p>'), ($('#debug-console')[0].scrollTop = $('#debug-console')[0].scrollHeight)
  30574. }
  30575. ;(t = function (e) {
  30576. h(Array.prototype.slice.call(arguments).join(' '))
  30577. }),
  30578. (i = function (e) {
  30579. h(Array.prototype.slice.call(arguments).join(' '))
  30580. }),
  30581. (o = function (e) {
  30582. h('WARN: ' + Array.prototype.slice.call(arguments).join(' '))
  30583. }),
  30584. (a = function (e) {
  30585. h('ERROR: ' + Array.prototype.slice.call(arguments).join(' '))
  30586. })
  30587. } else
  30588. console.log
  30589. ? ((t = console.log), (i = console.info ? console.info : console.log), (o = console.warn ? console.warn : console.log), (a = console.error ? console.error : console.log))
  30590. : (t = i = o = a = function () {})
  30591. var u = function (e) {
  30592. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  30593. },
  30594. d = function (t, i) {
  30595. if (r) {
  30596. var o = Array.prototype.slice.call(t).join(' ')
  30597. r.captureMessage(o, {
  30598. level: i,
  30599. path: e,
  30600. timestamp: n.timestamp()
  30601. })
  30602. }
  30603. },
  30604. p = function (t, i) {
  30605. if (r) {
  30606. var o = Array.prototype.slice.call(t).join(' ')
  30607. r.captureException(new Error(o), {
  30608. level: i,
  30609. path: e,
  30610. timestamp: n.timestamp()
  30611. })
  30612. }
  30613. }
  30614. return {
  30615. debug: function () {
  30616. n.level >= n.levels.debug && t.apply(console, u(arguments))
  30617. },
  30618. info: function () {
  30619. n.level >= n.levels.info && i.apply(console, u(arguments))
  30620. },
  30621. warn: function () {
  30622. d(arguments, 'warn'), n.level >= n.levels.warn && o.apply(console, u(arguments))
  30623. },
  30624. error: function () {
  30625. p(arguments, 'error'), n.level >= n.levels.error && a.apply(console, u(arguments))
  30626. },
  30627. v3str: function (e, t) {
  30628. var i = void 0 === t ? 2 : t
  30629. return '(' + e.x.toPrecision(i) + ', ' + e.y.toPrecision(i) + ', ' + e.z.toPrecision(i) + ')'
  30630. },
  30631. eulstr: function (e, t) {
  30632. var i = void 0 === t ? 2 : t
  30633. return '(' + THREE.Math.radToDeg(e.x).toPrecision(i) + ', ' + THREE.Math.radToDeg(e.y).toPrecision(i) + ', ' + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  30634. },
  30635. time: function (e) {
  30636. n.level >= n.levels.debug && (c[e] = Date.now())
  30637. },
  30638. timeEnd: function (e) {
  30639. if (n.level >= n.levels.debug) {
  30640. var t = c[e]
  30641. if (!t) return
  30642. var i = (Date.now() - t) / 1e3
  30643. this.debug(e, i + 's')
  30644. }
  30645. }
  30646. }
  30647. }
  30648. var r = window.Raven
  30649. ;(n.timestamp = function () {
  30650. return (Date.now() - window.navigationStart) / 1e3 + 's'
  30651. }),
  30652. (n.levels = {
  30653. debug: 3,
  30654. info: 2,
  30655. warn: 1,
  30656. error: 0
  30657. }),
  30658. (n.level = n.levels.info),
  30659. (t.exports = n)
  30660. },
  30661. {}
  30662. ],
  30663. 190: [
  30664. function (e, t, i) {
  30665. 'use strict'
  30666. var n = e('three'),
  30667. r = e('../enum/GLCubeFaces'),
  30668. o = e('../constants')
  30669. t.exports = {
  30670. convertVisionVector: function (e) {
  30671. return new n.Vector3(e.x, e.z, -e.y)
  30672. },
  30673. convertVisionQuaternion: function (e) {
  30674. 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)))
  30675. },
  30676. convertWorkshopVector: function (e) {
  30677. return new n.Vector3(-e.x, e.y, e.z)
  30678. },
  30679. convertWorkshopQuaternion: function (e) {
  30680. 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))
  30681. },
  30682. convertWorkshopPanoramaQuaternion: function (e) {
  30683. 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)))
  30684. },
  30685. convertWorkshopOrthoZoom: function (e) {
  30686. // xzw
  30687. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  30688. //return e;
  30689. return e === -1 ? -1 : ((e * ($('#player').width() / $('#player').height())) / g_snapShotWidth) * g_snapShotHeight
  30690. },
  30691. toPrecision: function (e, t) {
  30692. //xzw change
  30693. var f = function (e, t) {
  30694. var i = Math.pow(10, t)
  30695. return Math.round(e * i) / i
  30696. }
  30697. if (e instanceof Array) {
  30698. for (var s = 0; s < e.length; s++) {
  30699. e[s] = f(e[s], t)
  30700. }
  30701. return e
  30702. } else return f(e, t)
  30703. },
  30704. isEmptyQuaternion: function (e) {
  30705. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  30706. },
  30707. projectPositionToCanvas: function (e, t, i) {
  30708. ;(i = i || new n.Vector3()), i.copy(e)
  30709. var r = 0.5 * $('#player').width(),
  30710. o = 0.5 * $('#player').height()
  30711. return i.project(t), (i.x = i.x * r + r), (i.y = -(i.y * o) + o), i
  30712. },
  30713. convertScreenPositionToNDC: function (e, t, i) {
  30714. return (i = i || new n.Vector2()), (i.x = (e / $('#player').width()) * 2 - 1), (i.y = 2 * -(t / $('#player').height()) + 1), i
  30715. },
  30716. constrainedTurn: function (e) {
  30717. var t = e % (2 * Math.PI)
  30718. return (t = t > Math.PI ? (t -= 2 * Math.PI) : t < -Math.PI ? (t += 2 * Math.PI) : t)
  30719. },
  30720. getFOVDotThreshold: function (e) {
  30721. return Math.cos(n.Math.degToRad(e / 2))
  30722. },
  30723. transform2DForwardVectorByCubeFace: function (e, t, i, n) {
  30724. switch (e) {
  30725. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  30726. i.set(1, t.y, t.x)
  30727. break
  30728. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  30729. i.set(-1, t.y, -t.x)
  30730. break
  30731. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  30732. i.set(-t.x, 1, -t.y)
  30733. break
  30734. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  30735. i.set(-t.x, -1, t.y)
  30736. break
  30737. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  30738. i.set(-t.x, t.y, 1)
  30739. break
  30740. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  30741. i.set(t.x, t.y, -1)
  30742. }
  30743. n && i.normalize()
  30744. },
  30745. //add:
  30746. getPos2d: function (point, camera, dom) {
  30747. var camera = camera
  30748. var dom = dom
  30749. 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);
  30750. var x, y
  30751. x = ((pos.x + 1) / 2) * dom.clientWidth
  30752. y = (1 - (pos.y + 1) / 2) * dom.clientHeight
  30753. var inSight = x <= dom.clientWidth && x >= 0 && y <= dom.clientHeight && y >= 0
  30754. return {
  30755. pos: new THREE.Vector2(x, y),
  30756. vector: pos,
  30757. trueSide: pos.z < 1, //trueSide为false时,即使在屏幕范围内可见,也是反方向的另一个不可以被渲染的点 参见Tag.update
  30758. inSight: inSight //在屏幕范围内可见
  30759. }
  30760. },
  30761. getDirByLonLat: function (lon, lat) {
  30762. var dir = new THREE.Vector3()
  30763. var phi = THREE.Math.degToRad(90 - lat)
  30764. var theta = THREE.Math.degToRad(lon)
  30765. dir.x = Math.sin(phi) * Math.cos(theta)
  30766. dir.y = Math.cos(phi)
  30767. dir.z = Math.sin(phi) * Math.sin(theta)
  30768. return dir.negate()
  30769. }
  30770. }
  30771. window.math = t.exports
  30772. expandMath(math)
  30773. },
  30774. {
  30775. '../constants': 8,
  30776. '../enum/GLCubeFaces': 25,
  30777. three: 217
  30778. }
  30779. ],
  30780. 191: [
  30781. function (e, t, i) {
  30782. 'use strict'
  30783. function n(e, t, i) {
  30784. return a.map(
  30785. function (n, o) {
  30786. return e.get('pan/' + i + '/' + t + '_skybox' + r(n) + '.jpg')
  30787. }.bind(this)
  30788. )
  30789. }
  30790. function r(e) {
  30791. return s[e]
  30792. }
  30793. var o = e('../enum/GLCubeFaces'),
  30794. a = [0, 1, 2, 3, 4, 5],
  30795. s = {
  30796. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  30797. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  30798. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  30799. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  30800. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  30801. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  30802. }
  30803. t.exports = {
  30804. mapFaceToCubemapFace: r,
  30805. getCubemapUrls: n
  30806. }
  30807. },
  30808. {
  30809. '../enum/GLCubeFaces': 25
  30810. }
  30811. ],
  30812. 192: [
  30813. function (e, t, i) {
  30814. 'use strict'
  30815. t.exports = {
  30816. captureErrors: function (e, t, i) {
  30817. if ('Raven' in window) {
  30818. Raven.config(e, t).install(), i && Raven.setTagsContext(i)
  30819. var n = console.warn,
  30820. r = console.error
  30821. ;(console.warn = function () {
  30822. var e = Array.prototype.slice.call(arguments)
  30823. Raven.captureMessage(e.join(' '), {
  30824. level: 'warning'
  30825. }),
  30826. n.apply(console, e)
  30827. }),
  30828. (console.error = function () {
  30829. var e = Array.prototype.slice.call(arguments)
  30830. Raven.captureException(new Error(e.join(' ')), {
  30831. level: 'error'
  30832. }),
  30833. r.apply(console, e)
  30834. })
  30835. } else console.error('Raven not found, not capturing errors.')
  30836. }
  30837. }
  30838. },
  30839. {}
  30840. ],
  30841. 193: [
  30842. function (e, t, i) {
  30843. ;(function (i) {
  30844. 'use strict'
  30845. var n = e('./browser'),
  30846. r = e('../constants'),
  30847. o = e('url'),
  30848. a = e('./logger'),
  30849. ss = e('three'),
  30850. s = new a(i),
  30851. l = {
  30852. getAuthorizationHeader: function () {
  30853. var e = n.valueFromHash('auth')
  30854. if (e) return e.replace(',', ' ')
  30855. var t = n.valueFromCookie('token')
  30856. return t ? 'Token ' + t : null
  30857. },
  30858. parseSidUrl: function (e) {
  30859. var t, i
  30860. t = g_Prefix
  30861. if (((e = e || ''), e.match(/^https?/))) {
  30862. var n = o.parse(e)
  30863. ;(t = g_Prefix), (i = e)
  30864. } else {
  30865. //xzw 原先的不能用
  30866. //t = window.location.protocol + "//" + window.location.host, //MP
  30867. t = g_Prefix
  30868. //i = t + "/api/player/models/" + e; //MP
  30869. i = t + 'data/' + e
  30870. }
  30871. return {
  30872. urlBase: t,
  30873. urlModel: i,
  30874. urlFiles: i + (i.match(/\/$/) ? 'files' : '/files'),
  30875. urlThumb: i + (i.match(/\/$/) ? 'thumb' : '/thumb')
  30876. }
  30877. },
  30878. getModelIDFromQueryString: function () {
  30879. return n.valueFromHash('model') || n.valueFromHash('m')
  30880. },
  30881. /* normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  30882. e = JSON.parse(JSON.stringify(e));
  30883. var i = null;
  30884. if (e.images.forEach(function(n) {
  30885. if(!n.metadata) return;
  30886. if ("string" == typeof n.metadata)
  30887. try {
  30888. n.metadata = JSON.parse(n.metadata)
  30889. } catch (e) {
  30890. s.warn("Unable to parse image metadata"),
  30891. n.metadata = null
  30892. }
  30893. else{
  30894. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  30895. }
  30896. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  30897. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  30898. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  30899. }else{
  30900. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30901. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  30902. n.metadata.zoom = n.metadata.zoom || 1;
  30903. }
  30904. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30905. }),
  30906. //icon初始视角的:
  30907. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30908. var n = {};
  30909. n.pano = {
  30910. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30911. position: t.convertWorkshopVector(i.scan_position),
  30912. uuid: i.scan_id
  30913. },
  30914. n.camera = {
  30915. quaternion: i.camera_quaternion,
  30916. position: i.camera_position
  30917. },
  30918. e.startPano = n
  30919. }
  30920. return e
  30921. },
  30922. */
  30923. normalizeModeldata: function (e, t) {
  30924. //xzw 修改导览images数据
  30925. e = JSON.parse(JSON.stringify(e))
  30926. var i = null
  30927. var deal = function (n) {
  30928. if (!n.metadata) return
  30929. if ('string' == typeof n.metadata)
  30930. try {
  30931. n.metadata = JSON.parse(n.metadata)
  30932. } catch (e) {
  30933. s.warn('Unable to parse image metadata'), (n.metadata = null)
  30934. }
  30935. else {
  30936. 'object' == typeof n.metadata && s.debug('image.metadata already a JSON object')
  30937. }
  30938. if (n.metadata.camera_position instanceof Array) {
  30939. //xzw 改的格式
  30940. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position)
  30941. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion)
  30942. } else {
  30943. n.metadata.camera_position = new ss.Vector3().copy(n.metadata.camera_position)
  30944. n.metadata.camera_quaternion = new ss.Quaternion().copy(n.metadata.camera_quaternion)
  30945. /* n.metadata.camera_quaternion && (n.metadata.camera_quaternion = i.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  30946. n.metadata.camera_position && (n.metadata.camera_position = i.convertWorkshopVector(n.metadata.camera_position)) */
  30947. }
  30948. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  30949. }
  30950. //改
  30951. e.images.forEach(info => {
  30952. if (info.locations) {
  30953. info.locations.forEach(a => deal(a))
  30954. } else {
  30955. deal(info)
  30956. }
  30957. })
  30958. //icon初始视角的:
  30959. if (i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  30960. var n = {}
  30961. ;(n.pano = {
  30962. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  30963. position: t.convertWorkshopVector(i.scan_position),
  30964. uuid: i.scan_id
  30965. }),
  30966. (n.camera = {
  30967. quaternion: i.camera_quaternion,
  30968. position: i.camera_position
  30969. }),
  30970. (e.startPano = n)
  30971. }
  30972. return e
  30973. },
  30974. visionVersionToInt: (function () {
  30975. var e = new RegExp(['(?:[0-9.]+\\.){1,4}', '([0-9]+)', '[^\\.]*$'].join(''))
  30976. return function (t) {
  30977. if (!t) throw new Error('Vision version is required')
  30978. var i = e.exec(t)
  30979. if (null === i) throw new Error('String is not a vision version: ' + t)
  30980. return parseInt(i[1])
  30981. }
  30982. })(),
  30983. modelDataPromisesTiles: function (e) {
  30984. var vision_version = e.vision_version || window.DATA.vision_version
  30985. if (vision_version)
  30986. try {
  30987. return l.visionVersionToInt(vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  30988. } catch (t) {
  30989. s.warn('Invalid vision version: ' + vision_version)
  30990. }
  30991. // var t = e.created ? new Date(e.created) : null;
  30992. // return t && t >= r.visionTilingStartDate
  30993. return false
  30994. }
  30995. }
  30996. t.exports = l
  30997. }).call(this, '/js/util/showcase.js')
  30998. },
  30999. {
  31000. '../constants': 8,
  31001. './browser': 182,
  31002. './logger': 189,
  31003. three: 217,
  31004. url: 208
  31005. }
  31006. ],
  31007. 194: [
  31008. function (e, t, i) {
  31009. 'use strict'
  31010. var n = e('../util/ajax'),
  31011. r = e('three'),
  31012. o = e('../settings'),
  31013. a = {}
  31014. t.exports = {
  31015. load: function (e, t, i) {
  31016. var s = a[e]
  31017. return s
  31018. ? (t &&
  31019. setTimeout(function () {
  31020. t(s)
  31021. }, 1),
  31022. s)
  31023. : ((s = new r.Texture()),
  31024. o.minimalMemoryMode && ((s.minFilter = r.LinearFilter), (s.magFilter = r.LinearFilter), (s.generateMipmaps = !1)),
  31025. (s.sourceFile = e),
  31026. (a[e] = s),
  31027. n
  31028. .getImage(e)
  31029. .then(function (e) {
  31030. ;(s.image = e), (s.needsUpdate = !0), t && t(s)
  31031. })
  31032. .fail(i),
  31033. s)
  31034. },
  31035. loadBase64: function (e, t) {
  31036. t = t || 'png'
  31037. var i = new r.Texture()
  31038. return (
  31039. (i.image = document.createElement('img')),
  31040. i.image.setAttribute('src', 'data:image/' + t + ';base64,' + e),
  31041. o.minimalMemoryMode && ((i.minFilter = r.LinearFilter), (i.magFilter = r.LinearFilter), (i.generateMipmaps = !1)),
  31042. (i.needsUpdate = !0),
  31043. i
  31044. )
  31045. },
  31046. isLoaded: function (e) {
  31047. return !!a[e]
  31048. }
  31049. }
  31050. window.Texture = t.exports
  31051. },
  31052. {
  31053. '../settings': 166,
  31054. '../util/ajax': 181,
  31055. three: 217
  31056. }
  31057. ],
  31058. 195: [
  31059. function (e, t, i) {
  31060. 'use strict'
  31061. var n = e('./easing')
  31062. window.transitions = t.exports = {
  31063. globalDone: null,
  31064. funcs: [],
  31065. counter: 0,
  31066. uniqueID: 0,
  31067. start: function (e, t, i, r, o, a, s) {
  31068. return (
  31069. (r = r || 0),
  31070. this.funcs.push({
  31071. func: e,
  31072. current: -r * Math.abs(t),
  31073. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  31074. done: i,
  31075. easing: o || n.linearTween,
  31076. cycling: t < 0,
  31077. running: !0,
  31078. debug: r < 0,
  31079. name: a || 'T' + this.counter,
  31080. id: void 0 === s ? this.counter : s,
  31081. paused: !1
  31082. }),
  31083. e(0, 16),
  31084. (this.counter += 1),
  31085. e
  31086. )
  31087. },
  31088. trigger: function (e) {
  31089. var t = void 0 === e.delayRatio ? 0 : e.delayRatio,
  31090. i = e.func || function () {},
  31091. r = void 0 === e.duration ? 0 : e.duration
  31092. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r))
  31093. var o = e.done || null,
  31094. a = e.easing || n.linearTween,
  31095. s = e.name || 'R' + this.counter,
  31096. l = void 0 === e.id ? this.counter : e.id
  31097. return this.start(i, r, o, t, a, s, l)
  31098. },
  31099. setTimeout: function (e, t, i) {
  31100. var n = void 0 === i ? this.counter : i
  31101. return this.trigger({
  31102. done: e,
  31103. duration: void 0 === t ? 0 : t,
  31104. name: 'O' + this.counter,
  31105. id: n
  31106. })
  31107. },
  31108. pause: function () {
  31109. this.paused = !0
  31110. },
  31111. resume: function () {
  31112. this.paused = !1
  31113. },
  31114. update: function (e) {
  31115. this.funcs.forEach(function (t) {
  31116. if (!(t.paused || ((t.current += 1e3 * e), t.current < 0)))
  31117. if (t.current >= t.duration && !t.cycling) {
  31118. var i = t.easing(1, 0, 1, 1)
  31119. t.func(i, 1e3 * e), t.done && t.done(), (t.running = !1)
  31120. } else {
  31121. var n = t.easing((t.current % t.duration) / t.duration, 0, 1, 1),
  31122. r = t.func(n, 1e3 * e) || !1
  31123. r && (t.done && t.done(), (t.running = !1))
  31124. }
  31125. })
  31126. var t = this.funcs.length
  31127. this.funcs = this.funcs.filter(function (e) {
  31128. return e.running
  31129. })
  31130. var i = this.funcs.length
  31131. if (t > 0 && 0 === i && this.globalDone) {
  31132. var n = this.globalDone
  31133. ;(this.globalDone = null), n()
  31134. }
  31135. },
  31136. adjustSpeed: function (e, t) {
  31137. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  31138. var r = i[n]
  31139. ;(r.duration /= t), (r.current /= t)
  31140. }
  31141. },
  31142. getById: function (e) {
  31143. return this.funcs.filter(function (t) {
  31144. return e === t.id
  31145. })
  31146. },
  31147. get: function (e) {
  31148. for (var t = 0; t < this.funcs.length; t += 1) if (this.funcs[t].func === e) return this.funcs[t]
  31149. return null
  31150. },
  31151. isRunning: function (e) {
  31152. var t = this.get(e)
  31153. return null !== t && t.running
  31154. },
  31155. countActive: function () {
  31156. for (var e = 0, t = 0; t < this.funcs.length; t += 1) e += this.funcs[t].running
  31157. return e
  31158. },
  31159. listActive: function () {
  31160. for (var e = [], t = 0; t < this.funcs.length; t += 1) this.funcs[t].running && e.push(this.funcs[t].name)
  31161. return e
  31162. },
  31163. done: function (e) {
  31164. this.globalDone = e
  31165. },
  31166. cancelById: function (e) {
  31167. var t = void 0 === e ? 0 : e
  31168. this.funcs = this.funcs.filter(function (e) {
  31169. return e.id !== t
  31170. })
  31171. },
  31172. cancel: function (e) {
  31173. this.funcs = this.funcs.filter(function (t) {
  31174. return t.func !== e
  31175. })
  31176. },
  31177. getUniqueId: function () {
  31178. return (this.uniqueID -= 1), this.uniqueID
  31179. }
  31180. }
  31181. },
  31182. {
  31183. './easing': 186
  31184. }
  31185. ],
  31186. 196: [
  31187. function (e, t, i) {
  31188. function n(e) {
  31189. if (
  31190. ((this.set = {}),
  31191. (this.infContains = function () {
  31192. return !0
  31193. }),
  31194. 'object' == typeof e)
  31195. )
  31196. if (e instanceof Array) for (var t = 0; t < e.length; t++) this.set[e[t]] = !0
  31197. else this.set = e
  31198. else if ('function' == typeof e) this.infContains = e
  31199. else if ('undefined' != typeof e) throw new Error('set must be either an array or an object.')
  31200. }
  31201. ;(t.exports = n),
  31202. (n.prototype.contains = function (e) {
  31203. return !!this.set[e]
  31204. }),
  31205. (n.prototype.has = n.prototype.contains),
  31206. (n.prototype.add = function (e) {
  31207. if (1 == arguments.length) this.set[e] = !0
  31208. else for (var t = 0; t < arguments.length; t++) this.set[arguments[t]] = !0
  31209. }),
  31210. (n.prototype.addAll = function (e) {
  31211. if ('object' != typeof e && !(e instanceof Array)) throw new Error('arr must be an array.')
  31212. for (var t = 0; t < e.length; t++) this.add(e[t])
  31213. }),
  31214. (n.prototype.remove = function (e) {
  31215. if (1 == arguments.length) delete this.set[e]
  31216. else for (var t = 0; t < arguments.length; t++) delete this.set[arguments[t]]
  31217. }),
  31218. (n.prototype.delete = n.prototype.remove),
  31219. (n.prototype.clear = function () {
  31220. this.set = {}
  31221. }),
  31222. (n.prototype.size = function () {
  31223. return Object.keys(this.set).length
  31224. }),
  31225. (n.prototype.toString = function () {
  31226. return '{' + Object.keys(this.set).toString() + '}'
  31227. }),
  31228. (n.prototype.toArray = function () {
  31229. return 'undefined' == typeof this.set ? [] : Object.keys(this.set)
  31230. }),
  31231. (n.prototype['*values'] = n.prototype.toArray)
  31232. },
  31233. {}
  31234. ],
  31235. 197: [function (e, t, i) {}, {}],
  31236. 198: [
  31237. function (e, t, i) {
  31238. ;(function (t) {
  31239. 'use strict'
  31240. function n() {
  31241. try {
  31242. var e = new Uint8Array(1)
  31243. return (
  31244. (e.__proto__ = {
  31245. __proto__: Uint8Array.prototype,
  31246. foo: function () {
  31247. return 42
  31248. }
  31249. }),
  31250. 42 === e.foo() && 'function' == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  31251. )
  31252. } catch (e) {
  31253. return !1
  31254. }
  31255. }
  31256. function r() {
  31257. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  31258. }
  31259. function o(e, t) {
  31260. if (r() < t) throw new RangeError('Invalid typed array length')
  31261. return a.TYPED_ARRAY_SUPPORT ? ((e = new Uint8Array(t)), (e.__proto__ = a.prototype)) : (null === e && (e = new a(t)), (e.length = t)), e
  31262. }
  31263. function a(e, t, i) {
  31264. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a)) return new a(e, t, i)
  31265. if ('number' == typeof e) {
  31266. if ('string' == typeof t) throw new Error('If encoding is specified then the first argument must be a string')
  31267. return h(this, e)
  31268. }
  31269. return s(this, e, t, i)
  31270. }
  31271. function s(e, t, i, n) {
  31272. if ('number' == typeof t) throw new TypeError('"value" argument must not be a number')
  31273. return 'undefined' != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : 'string' == typeof t ? u(e, t, i) : f(e, t)
  31274. }
  31275. function l(e) {
  31276. if ('number' != typeof e) throw new TypeError('"size" argument must be a number')
  31277. if (e < 0) throw new RangeError('"size" argument must not be negative')
  31278. }
  31279. function c(e, t, i, n) {
  31280. return l(t), 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)
  31281. }
  31282. function h(e, t) {
  31283. if ((l(t), (e = o(e, t < 0 ? 0 : 0 | g(t))), !a.TYPED_ARRAY_SUPPORT)) for (var i = 0; i < t; ++i) e[i] = 0
  31284. return e
  31285. }
  31286. function u(e, t, i) {
  31287. if ((('string' == typeof i && '' !== i) || (i = 'utf8'), !a.isEncoding(i))) throw new TypeError('"encoding" must be a valid string encoding')
  31288. var n = 0 | v(t, i)
  31289. e = o(e, n)
  31290. var r = e.write(t, i)
  31291. return r !== n && (e = e.slice(0, r)), e
  31292. }
  31293. function d(e, t) {
  31294. var i = t.length < 0 ? 0 : 0 | g(t.length)
  31295. e = o(e, i)
  31296. for (var n = 0; n < i; n += 1) e[n] = 255 & t[n]
  31297. return e
  31298. }
  31299. function p(e, t, i, n) {
  31300. if ((t.byteLength, i < 0 || t.byteLength < i)) throw new RangeError("'offset' is out of bounds")
  31301. if (t.byteLength < i + (n || 0)) throw new RangeError("'length' is out of bounds")
  31302. return (
  31303. (t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t, i) : new Uint8Array(t, i, n)),
  31304. a.TYPED_ARRAY_SUPPORT ? ((e = t), (e.__proto__ = a.prototype)) : (e = d(e, t)),
  31305. e
  31306. )
  31307. }
  31308. function f(e, t) {
  31309. if (a.isBuffer(t)) {
  31310. var i = 0 | g(t.length)
  31311. return (e = o(e, i)), 0 === e.length ? e : (t.copy(e, 0, 0, i), e)
  31312. }
  31313. if (t) {
  31314. if (('undefined' != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer) || 'length' in t) return 'number' != typeof t.length || K(t.length) ? o(e, 0) : d(e, t)
  31315. if ('Buffer' === t.type && $(t.data)) return d(e, t.data)
  31316. }
  31317. throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')
  31318. }
  31319. function g(e) {
  31320. if (e >= r()) throw new RangeError('Attempt to allocate Buffer larger than maximum size: 0x' + r().toString(16) + ' bytes')
  31321. return 0 | e
  31322. }
  31323. function m(e) {
  31324. return +e != e && (e = 0), a.alloc(+e)
  31325. }
  31326. function v(e, t) {
  31327. if (a.isBuffer(e)) return e.length
  31328. if ('undefined' != typeof ArrayBuffer && 'function' == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer)) return e.byteLength
  31329. 'string' != typeof e && (e = '' + e)
  31330. var i = e.length
  31331. if (0 === i) return 0
  31332. for (var n = !1; ; )
  31333. switch (t) {
  31334. case 'ascii':
  31335. case 'latin1':
  31336. case 'binary':
  31337. return i
  31338. case 'utf8':
  31339. case 'utf-8':
  31340. case void 0:
  31341. return j(e).length
  31342. case 'ucs2':
  31343. case 'ucs-2':
  31344. case 'utf16le':
  31345. case 'utf-16le':
  31346. return 2 * i
  31347. case 'hex':
  31348. return i >>> 1
  31349. case 'base64':
  31350. return Z(e).length
  31351. default:
  31352. if (n) return j(e).length
  31353. ;(t = ('' + t).toLowerCase()), (n = !0)
  31354. }
  31355. }
  31356. function A(e, t, i) {
  31357. var n = !1
  31358. if (((void 0 === t || t < 0) && (t = 0), t > this.length)) return ''
  31359. if (((void 0 === i || i > this.length) && (i = this.length), i <= 0)) return ''
  31360. if (((i >>>= 0), (t >>>= 0), i <= t)) return ''
  31361. for (e || (e = 'utf8'); ; )
  31362. switch (e) {
  31363. case 'hex':
  31364. return L(this, t, i)
  31365. case 'utf8':
  31366. case 'utf-8':
  31367. return M(this, t, i)
  31368. case 'ascii':
  31369. return P(this, t, i)
  31370. case 'latin1':
  31371. case 'binary':
  31372. return O(this, t, i)
  31373. case 'base64':
  31374. return S(this, t, i)
  31375. case 'ucs2':
  31376. case 'ucs-2':
  31377. case 'utf16le':
  31378. case 'utf-16le':
  31379. return D(this, t, i)
  31380. default:
  31381. if (n) throw new TypeError('Unknown encoding: ' + e)
  31382. ;(e = (e + '').toLowerCase()), (n = !0)
  31383. }
  31384. }
  31385. function y(e, t, i) {
  31386. var n = e[t]
  31387. ;(e[t] = e[i]), (e[i] = n)
  31388. }
  31389. function C(e, t, i, n, r) {
  31390. if (0 === e.length) return -1
  31391. if (
  31392. ('string' == typeof i ? ((n = i), (i = 0)) : i > 2147483647 ? (i = 2147483647) : i < -2147483648 && (i = -2147483648),
  31393. (i = +i),
  31394. isNaN(i) && (i = r ? 0 : e.length - 1),
  31395. i < 0 && (i = e.length + i),
  31396. i >= e.length)
  31397. ) {
  31398. if (r) return -1
  31399. i = e.length - 1
  31400. } else if (i < 0) {
  31401. if (!r) return -1
  31402. i = 0
  31403. }
  31404. if (('string' == typeof t && (t = a.from(t, n)), a.isBuffer(t))) return 0 === t.length ? -1 : I(e, t, i, n, r)
  31405. if ('number' == typeof t)
  31406. return (
  31407. (t &= 255),
  31408. a.TYPED_ARRAY_SUPPORT && 'function' == typeof Uint8Array.prototype.indexOf
  31409. ? r
  31410. ? Uint8Array.prototype.indexOf.call(e, t, i)
  31411. : Uint8Array.prototype.lastIndexOf.call(e, t, i)
  31412. : I(e, [t], i, n, r)
  31413. )
  31414. throw new TypeError('val must be string, number or Buffer')
  31415. }
  31416. function I(e, t, i, n, r) {
  31417. function o(e, t) {
  31418. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  31419. }
  31420. var a = 1,
  31421. s = e.length,
  31422. l = t.length
  31423. if (void 0 !== n && ((n = String(n).toLowerCase()), 'ucs2' === n || 'ucs-2' === n || 'utf16le' === n || 'utf-16le' === n)) {
  31424. if (e.length < 2 || t.length < 2) return -1
  31425. ;(a = 2), (s /= 2), (l /= 2), (i /= 2)
  31426. }
  31427. var c
  31428. if (r) {
  31429. var h = -1
  31430. for (c = i; c < s; c++)
  31431. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  31432. if ((h === -1 && (h = c), c - h + 1 === l)) return h * a
  31433. } else h !== -1 && (c -= c - h), (h = -1)
  31434. } else
  31435. for (i + l > s && (i = s - l), c = i; c >= 0; c--) {
  31436. for (var u = !0, d = 0; d < l; d++)
  31437. if (o(e, c + d) !== o(t, d)) {
  31438. u = !1
  31439. break
  31440. }
  31441. if (u) return c
  31442. }
  31443. return -1
  31444. }
  31445. function E(e, t, i, n) {
  31446. i = Number(i) || 0
  31447. var r = e.length - i
  31448. n ? ((n = Number(n)), n > r && (n = r)) : (n = r)
  31449. var o = t.length
  31450. if (o % 2 !== 0) throw new TypeError('Invalid hex string')
  31451. n > o / 2 && (n = o / 2)
  31452. for (var a = 0; a < n; ++a) {
  31453. var s = parseInt(t.substr(2 * a, 2), 16)
  31454. if (isNaN(s)) return a
  31455. e[i + a] = s
  31456. }
  31457. return a
  31458. }
  31459. function b(e, t, i, n) {
  31460. return q(j(t, e.length - i), e, i, n)
  31461. }
  31462. function w(e, t, i, n) {
  31463. return q(Y(t), e, i, n)
  31464. }
  31465. function _(e, t, i, n) {
  31466. return w(e, t, i, n)
  31467. }
  31468. function T(e, t, i, n) {
  31469. return q(Z(t), e, i, n)
  31470. }
  31471. function x(e, t, i, n) {
  31472. return q(X(t, e.length - i), e, i, n)
  31473. }
  31474. function S(e, t, i) {
  31475. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  31476. }
  31477. function M(e, t, i) {
  31478. i = Math.min(e.length, i)
  31479. for (var n = [], r = t; r < i; ) {
  31480. var o = e[r],
  31481. a = null,
  31482. s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1
  31483. if (r + s <= i) {
  31484. var l, c, h, u
  31485. switch (s) {
  31486. case 1:
  31487. o < 128 && (a = o)
  31488. break
  31489. case 2:
  31490. ;(l = e[r + 1]), 128 === (192 & l) && ((u = ((31 & o) << 6) | (63 & l)), u > 127 && (a = u))
  31491. break
  31492. case 3:
  31493. ;(l = e[r + 1]), (c = e[r + 2]), 128 === (192 & l) && 128 === (192 & c) && ((u = ((15 & o) << 12) | ((63 & l) << 6) | (63 & c)), u > 2047 && (u < 55296 || u > 57343) && (a = u))
  31494. break
  31495. case 4:
  31496. ;(l = e[r + 1]),
  31497. (c = e[r + 2]),
  31498. (h = e[r + 3]),
  31499. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && ((u = ((15 & o) << 18) | ((63 & l) << 12) | ((63 & c) << 6) | (63 & h)), u > 65535 && u < 1114112 && (a = u))
  31500. }
  31501. }
  31502. null === a ? ((a = 65533), (s = 1)) : a > 65535 && ((a -= 65536), n.push(((a >>> 10) & 1023) | 55296), (a = 56320 | (1023 & a))), n.push(a), (r += s)
  31503. }
  31504. return R(n)
  31505. }
  31506. function R(e) {
  31507. var t = e.length
  31508. if (t <= ee) return String.fromCharCode.apply(String, e)
  31509. for (var i = '', n = 0; n < t; ) i += String.fromCharCode.apply(String, e.slice(n, (n += ee)))
  31510. return i
  31511. }
  31512. function P(e, t, i) {
  31513. var n = ''
  31514. i = Math.min(e.length, i)
  31515. for (var r = t; r < i; ++r) n += String.fromCharCode(127 & e[r])
  31516. return n
  31517. }
  31518. function O(e, t, i) {
  31519. var n = ''
  31520. i = Math.min(e.length, i)
  31521. for (var r = t; r < i; ++r) n += String.fromCharCode(e[r])
  31522. return n
  31523. }
  31524. function L(e, t, i) {
  31525. var n = e.length
  31526. ;(!t || t < 0) && (t = 0), (!i || i < 0 || i > n) && (i = n)
  31527. for (var r = '', o = t; o < i; ++o) r += W(e[o])
  31528. return r
  31529. }
  31530. function D(e, t, i) {
  31531. for (var n = e.slice(t, i), r = '', o = 0; o < n.length; o += 2) r += String.fromCharCode(n[o] + 256 * n[o + 1])
  31532. return r
  31533. }
  31534. function N(e, t, i) {
  31535. if (e % 1 !== 0 || e < 0) throw new RangeError('offset is not uint')
  31536. if (e + t > i) throw new RangeError('Trying to access beyond buffer length')
  31537. }
  31538. function B(e, t, i, n, r, o) {
  31539. if (!a.isBuffer(e)) throw new TypeError('"buffer" argument must be a Buffer instance')
  31540. if (t > r || t < o) throw new RangeError('"value" argument is out of bounds')
  31541. if (i + n > e.length) throw new RangeError('Index out of range')
  31542. }
  31543. function F(e, t, i, n) {
  31544. t < 0 && (t = 65535 + t + 1)
  31545. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r) e[i + r] = (t & (255 << (8 * (n ? r : 1 - r)))) >>> (8 * (n ? r : 1 - r))
  31546. }
  31547. function V(e, t, i, n) {
  31548. t < 0 && (t = 4294967295 + t + 1)
  31549. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r) e[i + r] = (t >>> (8 * (n ? r : 3 - r))) & 255
  31550. }
  31551. function U(e, t, i, n, r, o) {
  31552. if (i + n > e.length) throw new RangeError('Index out of range')
  31553. if (i < 0) throw new RangeError('Index out of range')
  31554. }
  31555. function k(e, t, i, n, r) {
  31556. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38), J.write(e, t, i, n, 23, 4), i + 4
  31557. }
  31558. function H(e, t, i, n, r) {
  31559. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308), J.write(e, t, i, n, 52, 8), i + 8
  31560. }
  31561. function G(e) {
  31562. if (((e = z(e).replace(te, '')), e.length < 2)) return ''
  31563. for (; e.length % 4 !== 0; ) e += '='
  31564. return e
  31565. }
  31566. function z(e) {
  31567. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, '')
  31568. }
  31569. function W(e) {
  31570. return e < 16 ? '0' + e.toString(16) : e.toString(16)
  31571. }
  31572. function j(e, t) {
  31573. t = t || 1 / 0
  31574. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  31575. if (((i = e.charCodeAt(a)), i > 55295 && i < 57344)) {
  31576. if (!r) {
  31577. if (i > 56319) {
  31578. ;(t -= 3) > -1 && o.push(239, 191, 189)
  31579. continue
  31580. }
  31581. if (a + 1 === n) {
  31582. ;(t -= 3) > -1 && o.push(239, 191, 189)
  31583. continue
  31584. }
  31585. r = i
  31586. continue
  31587. }
  31588. if (i < 56320) {
  31589. ;(t -= 3) > -1 && o.push(239, 191, 189), (r = i)
  31590. continue
  31591. }
  31592. i = (((r - 55296) << 10) | (i - 56320)) + 65536
  31593. } else r && (t -= 3) > -1 && o.push(239, 191, 189)
  31594. if (((r = null), i < 128)) {
  31595. if ((t -= 1) < 0) break
  31596. o.push(i)
  31597. } else if (i < 2048) {
  31598. if ((t -= 2) < 0) break
  31599. o.push((i >> 6) | 192, (63 & i) | 128)
  31600. } else if (i < 65536) {
  31601. if ((t -= 3) < 0) break
  31602. o.push((i >> 12) | 224, ((i >> 6) & 63) | 128, (63 & i) | 128)
  31603. } else {
  31604. if (!(i < 1114112)) throw new Error('Invalid code point')
  31605. if ((t -= 4) < 0) break
  31606. o.push((i >> 18) | 240, ((i >> 12) & 63) | 128, ((i >> 6) & 63) | 128, (63 & i) | 128)
  31607. }
  31608. }
  31609. return o
  31610. }
  31611. function Y(e) {
  31612. for (var t = [], i = 0; i < e.length; ++i) t.push(255 & e.charCodeAt(i))
  31613. return t
  31614. }
  31615. function X(e, t) {
  31616. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a) (i = e.charCodeAt(a)), (n = i >> 8), (r = i % 256), o.push(r), o.push(n)
  31617. return o
  31618. }
  31619. function Z(e) {
  31620. return Q.toByteArray(G(e))
  31621. }
  31622. function q(e, t, i, n) {
  31623. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r) t[r + i] = e[r]
  31624. return r
  31625. }
  31626. function K(e) {
  31627. return e !== e
  31628. }
  31629. var Q = e('base64-js'),
  31630. J = e('ieee754'),
  31631. $ = e('isarray')
  31632. ;(i.Buffer = a),
  31633. (i.SlowBuffer = m),
  31634. (i.INSPECT_MAX_BYTES = 50),
  31635. (a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n()),
  31636. (i.kMaxLength = r()),
  31637. (a.poolSize = 8192),
  31638. (a._augment = function (e) {
  31639. return (e.__proto__ = a.prototype), e
  31640. }),
  31641. (a.from = function (e, t, i) {
  31642. return s(null, e, t, i)
  31643. }),
  31644. a.TYPED_ARRAY_SUPPORT &&
  31645. ((a.prototype.__proto__ = Uint8Array.prototype),
  31646. (a.__proto__ = Uint8Array),
  31647. 'undefined' != typeof Symbol &&
  31648. Symbol.species &&
  31649. a[Symbol.species] === a &&
  31650. Object.defineProperty(a, Symbol.species, {
  31651. value: null,
  31652. configurable: !0
  31653. })),
  31654. (a.alloc = function (e, t, i) {
  31655. return c(null, e, t, i)
  31656. }),
  31657. (a.allocUnsafe = function (e) {
  31658. return h(null, e)
  31659. }),
  31660. (a.allocUnsafeSlow = function (e) {
  31661. return h(null, e)
  31662. }),
  31663. (a.isBuffer = function (e) {
  31664. return !(null == e || !e._isBuffer)
  31665. }),
  31666. (a.compare = function (e, t) {
  31667. if (!a.isBuffer(e) || !a.isBuffer(t)) throw new TypeError('Arguments must be Buffers')
  31668. if (e === t) return 0
  31669. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  31670. if (e[r] !== t[r]) {
  31671. ;(i = e[r]), (n = t[r])
  31672. break
  31673. }
  31674. return i < n ? -1 : n < i ? 1 : 0
  31675. }),
  31676. (a.isEncoding = function (e) {
  31677. switch (String(e).toLowerCase()) {
  31678. case 'hex':
  31679. case 'utf8':
  31680. case 'utf-8':
  31681. case 'ascii':
  31682. case 'latin1':
  31683. case 'binary':
  31684. case 'base64':
  31685. case 'ucs2':
  31686. case 'ucs-2':
  31687. case 'utf16le':
  31688. case 'utf-16le':
  31689. return !0
  31690. default:
  31691. return !1
  31692. }
  31693. }),
  31694. (a.concat = function (e, t) {
  31695. if (!$(e)) throw new TypeError('"list" argument must be an Array of Buffers')
  31696. if (0 === e.length) return a.alloc(0)
  31697. var i
  31698. if (void 0 === t) for (t = 0, i = 0; i < e.length; ++i) t += e[i].length
  31699. var n = a.allocUnsafe(t),
  31700. r = 0
  31701. for (i = 0; i < e.length; ++i) {
  31702. var o = e[i]
  31703. if (!a.isBuffer(o)) throw new TypeError('"list" argument must be an Array of Buffers')
  31704. o.copy(n, r), (r += o.length)
  31705. }
  31706. return n
  31707. }),
  31708. (a.byteLength = v),
  31709. (a.prototype._isBuffer = !0),
  31710. (a.prototype.swap16 = function () {
  31711. var e = this.length
  31712. if (e % 2 !== 0) throw new RangeError('Buffer size must be a multiple of 16-bits')
  31713. for (var t = 0; t < e; t += 2) y(this, t, t + 1)
  31714. return this
  31715. }),
  31716. (a.prototype.swap32 = function () {
  31717. var e = this.length
  31718. if (e % 4 !== 0) throw new RangeError('Buffer size must be a multiple of 32-bits')
  31719. for (var t = 0; t < e; t += 4) y(this, t, t + 3), y(this, t + 1, t + 2)
  31720. return this
  31721. }),
  31722. (a.prototype.swap64 = function () {
  31723. var e = this.length
  31724. if (e % 8 !== 0) throw new RangeError('Buffer size must be a multiple of 64-bits')
  31725. for (var t = 0; t < e; t += 8) y(this, t, t + 7), y(this, t + 1, t + 6), y(this, t + 2, t + 5), y(this, t + 3, t + 4)
  31726. return this
  31727. }),
  31728. (a.prototype.toString = function () {
  31729. var e = 0 | this.length
  31730. return 0 === e ? '' : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  31731. }),
  31732. (a.prototype.equals = function (e) {
  31733. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  31734. return this === e || 0 === a.compare(this, e)
  31735. }),
  31736. (a.prototype.inspect = function () {
  31737. var e = '',
  31738. t = i.INSPECT_MAX_BYTES
  31739. return this.length > 0 && ((e = this.toString('hex', 0, t).match(/.{2}/g).join(' ')), this.length > t && (e += ' ... ')), '<Buffer ' + e + '>'
  31740. }),
  31741. (a.prototype.compare = function (e, t, i, n, r) {
  31742. if (!a.isBuffer(e)) throw new TypeError('Argument must be a Buffer')
  31743. if ((void 0 === t && (t = 0), void 0 === i && (i = e ? e.length : 0), void 0 === n && (n = 0), void 0 === r && (r = this.length), t < 0 || i > e.length || n < 0 || r > this.length))
  31744. throw new RangeError('out of range index')
  31745. if (n >= r && t >= i) return 0
  31746. if (n >= r) return -1
  31747. if (t >= i) return 1
  31748. if (((t >>>= 0), (i >>>= 0), (n >>>= 0), (r >>>= 0), this === e)) return 0
  31749. 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)
  31750. if (c[u] !== h[u]) {
  31751. ;(o = c[u]), (s = h[u])
  31752. break
  31753. }
  31754. return o < s ? -1 : s < o ? 1 : 0
  31755. }),
  31756. (a.prototype.includes = function (e, t, i) {
  31757. return this.indexOf(e, t, i) !== -1
  31758. }),
  31759. (a.prototype.indexOf = function (e, t, i) {
  31760. return C(this, e, t, i, !0)
  31761. }),
  31762. (a.prototype.lastIndexOf = function (e, t, i) {
  31763. return C(this, e, t, i, !1)
  31764. }),
  31765. (a.prototype.write = function (e, t, i, n) {
  31766. if (void 0 === t) (n = 'utf8'), (i = this.length), (t = 0)
  31767. else if (void 0 === i && 'string' == typeof t) (n = t), (i = this.length), (t = 0)
  31768. else {
  31769. if (!isFinite(t)) throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported')
  31770. ;(t |= 0), isFinite(i) ? ((i |= 0), void 0 === n && (n = 'utf8')) : ((n = i), (i = void 0))
  31771. }
  31772. var r = this.length - t
  31773. if (((void 0 === i || i > r) && (i = r), (e.length > 0 && (i < 0 || t < 0)) || t > this.length)) throw new RangeError('Attempt to write outside buffer bounds')
  31774. n || (n = 'utf8')
  31775. for (var o = !1; ; )
  31776. switch (n) {
  31777. case 'hex':
  31778. return E(this, e, t, i)
  31779. case 'utf8':
  31780. case 'utf-8':
  31781. return b(this, e, t, i)
  31782. case 'ascii':
  31783. return w(this, e, t, i)
  31784. case 'latin1':
  31785. case 'binary':
  31786. return _(this, e, t, i)
  31787. case 'base64':
  31788. return T(this, e, t, i)
  31789. case 'ucs2':
  31790. case 'ucs-2':
  31791. case 'utf16le':
  31792. case 'utf-16le':
  31793. return x(this, e, t, i)
  31794. default:
  31795. if (o) throw new TypeError('Unknown encoding: ' + n)
  31796. ;(n = ('' + n).toLowerCase()), (o = !0)
  31797. }
  31798. }),
  31799. (a.prototype.toJSON = function () {
  31800. return {
  31801. type: 'Buffer',
  31802. data: Array.prototype.slice.call(this._arr || this, 0)
  31803. }
  31804. })
  31805. var ee = 4096
  31806. ;(a.prototype.slice = function (e, t) {
  31807. var i = this.length
  31808. ;(e = ~~e), (t = void 0 === t ? i : ~~t), e < 0 ? ((e += i), e < 0 && (e = 0)) : e > i && (e = i), t < 0 ? ((t += i), t < 0 && (t = 0)) : t > i && (t = i), t < e && (t = e)
  31809. var n
  31810. if (a.TYPED_ARRAY_SUPPORT) (n = this.subarray(e, t)), (n.__proto__ = a.prototype)
  31811. else {
  31812. var r = t - e
  31813. n = new a(r, void 0)
  31814. for (var o = 0; o < r; ++o) n[o] = this[o + e]
  31815. }
  31816. return n
  31817. }),
  31818. (a.prototype.readUIntLE = function (e, t, i) {
  31819. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  31820. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  31821. return n
  31822. }),
  31823. (a.prototype.readUIntBE = function (e, t, i) {
  31824. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  31825. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); ) n += this[e + --t] * r
  31826. return n
  31827. }),
  31828. (a.prototype.readUInt8 = function (e, t) {
  31829. return t || N(e, 1, this.length), this[e]
  31830. }),
  31831. (a.prototype.readUInt16LE = function (e, t) {
  31832. return t || N(e, 2, this.length), this[e] | (this[e + 1] << 8)
  31833. }),
  31834. (a.prototype.readUInt16BE = function (e, t) {
  31835. return t || N(e, 2, this.length), (this[e] << 8) | this[e + 1]
  31836. }),
  31837. (a.prototype.readUInt32LE = function (e, t) {
  31838. return t || N(e, 4, this.length), (this[e] | (this[e + 1] << 8) | (this[e + 2] << 16)) + 16777216 * this[e + 3]
  31839. }),
  31840. (a.prototype.readUInt32BE = function (e, t) {
  31841. return t || N(e, 4, this.length), 16777216 * this[e] + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3])
  31842. }),
  31843. (a.prototype.readIntLE = function (e, t, i) {
  31844. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  31845. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); ) n += this[e + o] * r
  31846. return (r *= 128), n >= r && (n -= Math.pow(2, 8 * t)), n
  31847. }),
  31848. (a.prototype.readIntBE = function (e, t, i) {
  31849. ;(e |= 0), (t |= 0), i || N(e, t, this.length)
  31850. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); ) o += this[e + --n] * r
  31851. return (r *= 128), o >= r && (o -= Math.pow(2, 8 * t)), o
  31852. }),
  31853. (a.prototype.readInt8 = function (e, t) {
  31854. return t || N(e, 1, this.length), 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  31855. }),
  31856. (a.prototype.readInt16LE = function (e, t) {
  31857. t || N(e, 2, this.length)
  31858. var i = this[e] | (this[e + 1] << 8)
  31859. return 32768 & i ? 4294901760 | i : i
  31860. }),
  31861. (a.prototype.readInt16BE = function (e, t) {
  31862. t || N(e, 2, this.length)
  31863. var i = this[e + 1] | (this[e] << 8)
  31864. return 32768 & i ? 4294901760 | i : i
  31865. }),
  31866. (a.prototype.readInt32LE = function (e, t) {
  31867. return t || N(e, 4, this.length), this[e] | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24)
  31868. }),
  31869. (a.prototype.readInt32BE = function (e, t) {
  31870. return t || N(e, 4, this.length), (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]
  31871. }),
  31872. (a.prototype.readFloatLE = function (e, t) {
  31873. return t || N(e, 4, this.length), J.read(this, e, !0, 23, 4)
  31874. }),
  31875. (a.prototype.readFloatBE = function (e, t) {
  31876. return t || N(e, 4, this.length), J.read(this, e, !1, 23, 4)
  31877. }),
  31878. (a.prototype.readDoubleLE = function (e, t) {
  31879. return t || N(e, 8, this.length), J.read(this, e, !0, 52, 8)
  31880. }),
  31881. (a.prototype.readDoubleBE = function (e, t) {
  31882. return t || N(e, 8, this.length), J.read(this, e, !1, 52, 8)
  31883. }),
  31884. (a.prototype.writeUIntLE = function (e, t, i, n) {
  31885. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  31886. var r = Math.pow(2, 8 * i) - 1
  31887. B(this, e, t, i, r, 0)
  31888. }
  31889. var o = 1,
  31890. a = 0
  31891. for (this[t] = 255 & e; ++a < i && (o *= 256); ) this[t + a] = (e / o) & 255
  31892. return t + i
  31893. }),
  31894. (a.prototype.writeUIntBE = function (e, t, i, n) {
  31895. if (((e = +e), (t |= 0), (i |= 0), !n)) {
  31896. var r = Math.pow(2, 8 * i) - 1
  31897. B(this, e, t, i, r, 0)
  31898. }
  31899. var o = i - 1,
  31900. a = 1
  31901. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) this[t + o] = (e / a) & 255
  31902. return t + i
  31903. }),
  31904. (a.prototype.writeUInt8 = function (e, t, i) {
  31905. return (e = +e), (t |= 0), i || B(this, e, t, 1, 255, 0), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), (this[t] = 255 & e), t + 1
  31906. }),
  31907. (a.prototype.writeUInt16LE = function (e, t, i) {
  31908. return (e = +e), (t |= 0), i || B(this, e, t, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : F(this, e, t, !0), t + 2
  31909. }),
  31910. (a.prototype.writeUInt16BE = function (e, t, i) {
  31911. return (e = +e), (t |= 0), i || B(this, e, t, 2, 65535, 0), a.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : F(this, e, t, !1), t + 2
  31912. }),
  31913. (a.prototype.writeUInt32LE = function (e, t, i) {
  31914. return (
  31915. (e = +e),
  31916. (t |= 0),
  31917. i || B(this, e, t, 4, 4294967295, 0),
  31918. a.TYPED_ARRAY_SUPPORT ? ((this[t + 3] = e >>> 24), (this[t + 2] = e >>> 16), (this[t + 1] = e >>> 8), (this[t] = 255 & e)) : V(this, e, t, !0),
  31919. t + 4
  31920. )
  31921. }),
  31922. (a.prototype.writeUInt32BE = function (e, t, i) {
  31923. return (
  31924. (e = +e),
  31925. (t |= 0),
  31926. i || B(this, e, t, 4, 4294967295, 0),
  31927. a.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : V(this, e, t, !1),
  31928. t + 4
  31929. )
  31930. }),
  31931. (a.prototype.writeIntLE = function (e, t, i, n) {
  31932. if (((e = +e), (t |= 0), !n)) {
  31933. var r = Math.pow(2, 8 * i - 1)
  31934. B(this, e, t, i, r - 1, -r)
  31935. }
  31936. var o = 0,
  31937. a = 1,
  31938. s = 0
  31939. for (this[t] = 255 & e; ++o < i && (a *= 256); ) e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1), (this[t + o] = (((e / a) >> 0) - s) & 255)
  31940. return t + i
  31941. }),
  31942. (a.prototype.writeIntBE = function (e, t, i, n) {
  31943. if (((e = +e), (t |= 0), !n)) {
  31944. var r = Math.pow(2, 8 * i - 1)
  31945. B(this, e, t, i, r - 1, -r)
  31946. }
  31947. var o = i - 1,
  31948. a = 1,
  31949. s = 0
  31950. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); ) e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1), (this[t + o] = (((e / a) >> 0) - s) & 255)
  31951. return t + i
  31952. }),
  31953. (a.prototype.writeInt8 = function (e, t, i) {
  31954. return (e = +e), (t |= 0), i || B(this, e, t, 1, 127, -128), a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)), e < 0 && (e = 255 + e + 1), (this[t] = 255 & e), t + 1
  31955. }),
  31956. (a.prototype.writeInt16LE = function (e, t, i) {
  31957. return (e = +e), (t |= 0), i || B(this, e, t, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8)) : F(this, e, t, !0), t + 2
  31958. }),
  31959. (a.prototype.writeInt16BE = function (e, t, i) {
  31960. return (e = +e), (t |= 0), i || B(this, e, t, 2, 32767, -32768), a.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 8), (this[t + 1] = 255 & e)) : F(this, e, t, !1), t + 2
  31961. }),
  31962. (a.prototype.writeInt32LE = function (e, t, i) {
  31963. return (
  31964. (e = +e),
  31965. (t |= 0),
  31966. i || B(this, e, t, 4, 2147483647, -2147483648),
  31967. a.TYPED_ARRAY_SUPPORT ? ((this[t] = 255 & e), (this[t + 1] = e >>> 8), (this[t + 2] = e >>> 16), (this[t + 3] = e >>> 24)) : V(this, e, t, !0),
  31968. t + 4
  31969. )
  31970. }),
  31971. (a.prototype.writeInt32BE = function (e, t, i) {
  31972. return (
  31973. (e = +e),
  31974. (t |= 0),
  31975. i || B(this, e, t, 4, 2147483647, -2147483648),
  31976. e < 0 && (e = 4294967295 + e + 1),
  31977. a.TYPED_ARRAY_SUPPORT ? ((this[t] = e >>> 24), (this[t + 1] = e >>> 16), (this[t + 2] = e >>> 8), (this[t + 3] = 255 & e)) : V(this, e, t, !1),
  31978. t + 4
  31979. )
  31980. }),
  31981. (a.prototype.writeFloatLE = function (e, t, i) {
  31982. return k(this, e, t, !0, i)
  31983. }),
  31984. (a.prototype.writeFloatBE = function (e, t, i) {
  31985. return k(this, e, t, !1, i)
  31986. }),
  31987. (a.prototype.writeDoubleLE = function (e, t, i) {
  31988. return H(this, e, t, !0, i)
  31989. }),
  31990. (a.prototype.writeDoubleBE = function (e, t, i) {
  31991. return H(this, e, t, !1, i)
  31992. }),
  31993. (a.prototype.copy = function (e, t, i, n) {
  31994. if ((i || (i = 0), n || 0 === n || (n = this.length), t >= e.length && (t = e.length), t || (t = 0), n > 0 && n < i && (n = i), n === i)) return 0
  31995. if (0 === e.length || 0 === this.length) return 0
  31996. if (t < 0) throw new RangeError('targetStart out of bounds')
  31997. if (i < 0 || i >= this.length) throw new RangeError('sourceStart out of bounds')
  31998. if (n < 0) throw new RangeError('sourceEnd out of bounds')
  31999. n > this.length && (n = this.length), e.length - t < n - i && (n = e.length - t + i)
  32000. var r,
  32001. o = n - i
  32002. if (this === e && i < t && t < n) for (r = o - 1; r >= 0; --r) e[r + t] = this[r + i]
  32003. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT) for (r = 0; r < o; ++r) e[r + t] = this[r + i]
  32004. else Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t)
  32005. return o
  32006. }),
  32007. (a.prototype.fill = function (e, t, i, n) {
  32008. if ('string' == typeof e) {
  32009. if (('string' == typeof t ? ((n = t), (t = 0), (i = this.length)) : 'string' == typeof i && ((n = i), (i = this.length)), 1 === e.length)) {
  32010. var r = e.charCodeAt(0)
  32011. r < 256 && (e = r)
  32012. }
  32013. if (void 0 !== n && 'string' != typeof n) throw new TypeError('encoding must be a string')
  32014. if ('string' == typeof n && !a.isEncoding(n)) throw new TypeError('Unknown encoding: ' + n)
  32015. } else 'number' == typeof e && (e &= 255)
  32016. if (t < 0 || this.length < t || this.length < i) throw new RangeError('Out of range index')
  32017. if (i <= t) return this
  32018. ;(t >>>= 0), (i = void 0 === i ? this.length : i >>> 0), e || (e = 0)
  32019. var o
  32020. if ('number' == typeof e) for (o = t; o < i; ++o) this[o] = e
  32021. else {
  32022. var s = a.isBuffer(e) ? e : j(new a(e, n).toString()),
  32023. l = s.length
  32024. for (o = 0; o < i - t; ++o) this[o + t] = s[o % l]
  32025. }
  32026. return this
  32027. })
  32028. var te = /[^+\/0-9A-Za-z-_]/g
  32029. }).call(this, 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {})
  32030. },
  32031. {
  32032. 'base64-js': 199,
  32033. ieee754: 200,
  32034. isarray: 201
  32035. }
  32036. ],
  32037. 199: [
  32038. function (e, t, i) {
  32039. 'use strict'
  32040. function n(e) {
  32041. var t = e.length
  32042. if (t % 4 > 0) throw new Error('Invalid string. Length must be a multiple of 4')
  32043. return '=' === e[t - 2] ? 2 : '=' === e[t - 1] ? 1 : 0
  32044. }
  32045. function r(e) {
  32046. return (3 * e.length) / 4 - n(e)
  32047. }
  32048. function o(e) {
  32049. var t,
  32050. i,
  32051. r,
  32052. o,
  32053. a,
  32054. s,
  32055. l = e.length
  32056. ;(a = n(e)), (s = new u((3 * l) / 4 - a)), (r = a > 0 ? l - 4 : l)
  32057. var c = 0
  32058. for (t = 0, i = 0; t < r; t += 4, i += 3)
  32059. (o = (h[e.charCodeAt(t)] << 18) | (h[e.charCodeAt(t + 1)] << 12) | (h[e.charCodeAt(t + 2)] << 6) | h[e.charCodeAt(t + 3)]),
  32060. (s[c++] = (o >> 16) & 255),
  32061. (s[c++] = (o >> 8) & 255),
  32062. (s[c++] = 255 & o)
  32063. return (
  32064. 2 === a
  32065. ? ((o = (h[e.charCodeAt(t)] << 2) | (h[e.charCodeAt(t + 1)] >> 4)), (s[c++] = 255 & o))
  32066. : 1 === a && ((o = (h[e.charCodeAt(t)] << 10) | (h[e.charCodeAt(t + 1)] << 4) | (h[e.charCodeAt(t + 2)] >> 2)), (s[c++] = (o >> 8) & 255), (s[c++] = 255 & o)),
  32067. s
  32068. )
  32069. }
  32070. function a(e) {
  32071. return c[(e >> 18) & 63] + c[(e >> 12) & 63] + c[(e >> 6) & 63] + c[63 & e]
  32072. }
  32073. function s(e, t, i) {
  32074. for (var n, r = [], o = t; o < i; o += 3) (n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2]), r.push(a(n))
  32075. return r.join('')
  32076. }
  32077. function l(e) {
  32078. for (var t, i = e.length, n = i % 3, r = '', o = [], a = 16383, l = 0, h = i - n; l < h; l += a) o.push(s(e, l, l + a > h ? h : l + a))
  32079. return (
  32080. 1 === n
  32081. ? ((t = e[i - 1]), (r += c[t >> 2]), (r += c[(t << 4) & 63]), (r += '=='))
  32082. : 2 === n && ((t = (e[i - 2] << 8) + e[i - 1]), (r += c[t >> 10]), (r += c[(t >> 4) & 63]), (r += c[(t << 2) & 63]), (r += '=')),
  32083. o.push(r),
  32084. o.join('')
  32085. )
  32086. }
  32087. ;(i.byteLength = r), (i.toByteArray = o), (i.fromByteArray = l)
  32088. for (var c = [], h = [], u = 'undefined' != typeof Uint8Array ? Uint8Array : Array, d = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/', p = 0, f = d.length; p < f; ++p)
  32089. (c[p] = d[p]), (h[d.charCodeAt(p)] = p)
  32090. ;(h['-'.charCodeAt(0)] = 62), (h['_'.charCodeAt(0)] = 63)
  32091. },
  32092. {}
  32093. ],
  32094. 200: [
  32095. function (e, t, i) {
  32096. ;(i.read = function (e, t, i, n, r) {
  32097. var o,
  32098. a,
  32099. s = 8 * r - n - 1,
  32100. l = (1 << s) - 1,
  32101. c = l >> 1,
  32102. h = -7,
  32103. u = i ? r - 1 : 0,
  32104. d = i ? -1 : 1,
  32105. p = e[t + u]
  32106. for (u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s; h > 0; o = 256 * o + e[t + u], u += d, h -= 8);
  32107. for (a = o & ((1 << -h) - 1), o >>= -h, h += n; h > 0; a = 256 * a + e[t + u], u += d, h -= 8);
  32108. if (0 === o) o = 1 - c
  32109. else {
  32110. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0)
  32111. ;(a += Math.pow(2, n)), (o -= c)
  32112. }
  32113. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  32114. }),
  32115. (i.write = function (e, t, i, n, r, o) {
  32116. var a,
  32117. s,
  32118. l,
  32119. c = 8 * o - r - 1,
  32120. h = (1 << c) - 1,
  32121. u = h >> 1,
  32122. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  32123. p = n ? 0 : o - 1,
  32124. f = n ? 1 : -1,
  32125. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  32126. for (
  32127. t = Math.abs(t),
  32128. isNaN(t) || t === 1 / 0
  32129. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  32130. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  32131. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  32132. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  32133. t * l >= 2 && (a++, (l /= 2)),
  32134. a + u >= h ? ((s = 0), (a = h)) : a + u >= 1 ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u)) : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  32135. r >= 8;
  32136. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  32137. );
  32138. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  32139. e[i + p - f] |= 128 * g
  32140. })
  32141. },
  32142. {}
  32143. ],
  32144. 201: [
  32145. function (e, t, i) {
  32146. var n = {}.toString
  32147. t.exports =
  32148. Array.isArray ||
  32149. function (e) {
  32150. return '[object Array]' == n.call(e)
  32151. }
  32152. },
  32153. {}
  32154. ],
  32155. 202: [
  32156. function (e, t, i) {
  32157. function n() {
  32158. ;(this._events = this._events || {}), (this._maxListeners = this._maxListeners || void 0)
  32159. }
  32160. function r(e) {
  32161. return 'function' == typeof e
  32162. }
  32163. function o(e) {
  32164. return 'number' == typeof e
  32165. }
  32166. function a(e) {
  32167. return 'object' == typeof e && null !== e
  32168. }
  32169. function s(e) {
  32170. return void 0 === e
  32171. }
  32172. ;(t.exports = n),
  32173. (n.EventEmitter = n),
  32174. (n.prototype._events = void 0),
  32175. (n.prototype._maxListeners = void 0),
  32176. (n.defaultMaxListeners = 10),
  32177. (n.prototype.setMaxListeners = function (e) {
  32178. if (!o(e) || e < 0 || isNaN(e)) throw TypeError('n must be a positive number')
  32179. return (this._maxListeners = e), this
  32180. }),
  32181. (n.prototype.emit = function (e) {
  32182. var t, i, n, o, l, c
  32183. if ((this._events || (this._events = {}), 'error' === e && (!this._events.error || (a(this._events.error) && !this._events.error.length)))) {
  32184. if (((t = arguments[1]), t instanceof Error)) throw t
  32185. var h = new Error('Uncaught, unspecified "error" event. (' + t + ')')
  32186. throw ((h.context = t), h)
  32187. }
  32188. if (((i = this._events[e]), s(i))) return !1
  32189. if (r(i))
  32190. switch (arguments.length) {
  32191. case 1:
  32192. i.call(this)
  32193. break
  32194. case 2:
  32195. i.call(this, arguments[1])
  32196. break
  32197. case 3:
  32198. i.call(this, arguments[1], arguments[2])
  32199. break
  32200. default:
  32201. ;(o = Array.prototype.slice.call(arguments, 1)), i.apply(this, o)
  32202. }
  32203. else if (a(i)) for (o = Array.prototype.slice.call(arguments, 1), c = i.slice(), n = c.length, l = 0; l < n; l++) c[l].apply(this, o)
  32204. return !0
  32205. }),
  32206. (n.prototype.addListener = function (e, t) {
  32207. var i
  32208. if (!r(t)) throw TypeError('listener must be a function')
  32209. return (
  32210. this._events || (this._events = {}),
  32211. this._events.newListener && this.emit('newListener', e, r(t.listener) ? t.listener : t),
  32212. this._events[e] ? (a(this._events[e]) ? this._events[e].push(t) : (this._events[e] = [this._events[e], t])) : (this._events[e] = t),
  32213. a(this._events[e]) &&
  32214. !this._events[e].warned &&
  32215. ((i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners),
  32216. i &&
  32217. i > 0 &&
  32218. this._events[e].length > i &&
  32219. ((this._events[e].warned = !0),
  32220. console.error('(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.', this._events[e].length),
  32221. 'function' == typeof console.trace && console.trace())),
  32222. this
  32223. )
  32224. }),
  32225. (n.prototype.on = n.prototype.addListener),
  32226. (n.prototype.once = function (e, t) {
  32227. function i() {
  32228. this.removeListener(e, i), n || ((n = !0), t.apply(this, arguments))
  32229. }
  32230. if (!r(t)) throw TypeError('listener must be a function')
  32231. var n = !1
  32232. return (i.listener = t), this.on(e, i), this
  32233. }),
  32234. (n.prototype.removeListener = function (e, t) {
  32235. var i, n, o, s
  32236. if (!r(t)) throw TypeError('listener must be a function')
  32237. if (!this._events || !this._events[e]) return this
  32238. if (((i = this._events[e]), (o = i.length), (n = -1), i === t || (r(i.listener) && i.listener === t)))
  32239. delete this._events[e], this._events.removeListener && this.emit('removeListener', e, t)
  32240. else if (a(i)) {
  32241. for (s = o; s-- > 0; )
  32242. if (i[s] === t || (i[s].listener && i[s].listener === t)) {
  32243. n = s
  32244. break
  32245. }
  32246. if (n < 0) return this
  32247. 1 === i.length ? ((i.length = 0), delete this._events[e]) : i.splice(n, 1), this._events.removeListener && this.emit('removeListener', e, t)
  32248. }
  32249. return this
  32250. }),
  32251. (n.prototype.removeAllListeners = function (e) {
  32252. var t, i
  32253. if (!this._events) return this
  32254. if (!this._events.removeListener) return 0 === arguments.length ? (this._events = {}) : this._events[e] && delete this._events[e], this
  32255. if (0 === arguments.length) {
  32256. for (t in this._events) 'removeListener' !== t && this.removeAllListeners(t)
  32257. return this.removeAllListeners('removeListener'), (this._events = {}), this
  32258. }
  32259. if (((i = this._events[e]), r(i))) this.removeListener(e, i)
  32260. else if (i) for (; i.length; ) this.removeListener(e, i[i.length - 1])
  32261. return delete this._events[e], this
  32262. }),
  32263. (n.prototype.listeners = function (e) {
  32264. var t
  32265. return (t = this._events && this._events[e] ? (r(this._events[e]) ? [this._events[e]] : this._events[e].slice()) : [])
  32266. }),
  32267. (n.prototype.listenerCount = function (e) {
  32268. if (this._events) {
  32269. var t = this._events[e]
  32270. if (r(t)) return 1
  32271. if (t) return t.length
  32272. }
  32273. return 0
  32274. }),
  32275. (n.listenerCount = function (e, t) {
  32276. return e.listenerCount(t)
  32277. })
  32278. },
  32279. {}
  32280. ],
  32281. 203: [
  32282. function (e, t, i) {
  32283. function n() {
  32284. throw new Error('setTimeout has not been defined')
  32285. }
  32286. function r() {
  32287. throw new Error('clearTimeout has not been defined')
  32288. }
  32289. function o(e) {
  32290. if (u === setTimeout) return setTimeout(e, 0)
  32291. if ((u === n || !u) && setTimeout) return (u = setTimeout), setTimeout(e, 0)
  32292. try {
  32293. return u(e, 0)
  32294. } catch (t) {
  32295. try {
  32296. return u.call(null, e, 0)
  32297. } catch (t) {
  32298. return u.call(this, e, 0)
  32299. }
  32300. }
  32301. }
  32302. function a(e) {
  32303. if (d === clearTimeout) return clearTimeout(e)
  32304. if ((d === r || !d) && clearTimeout) return (d = clearTimeout), clearTimeout(e)
  32305. try {
  32306. return d(e)
  32307. } catch (t) {
  32308. try {
  32309. return d.call(null, e)
  32310. } catch (t) {
  32311. return d.call(this, e)
  32312. }
  32313. }
  32314. }
  32315. function s() {
  32316. m && f && ((m = !1), f.length ? (g = f.concat(g)) : (v = -1), g.length && l())
  32317. }
  32318. function l() {
  32319. if (!m) {
  32320. var e = o(s)
  32321. m = !0
  32322. for (var t = g.length; t; ) {
  32323. for (f = g, g = []; ++v < t; ) f && f[v].run()
  32324. ;(v = -1), (t = g.length)
  32325. }
  32326. ;(f = null), (m = !1), a(e)
  32327. }
  32328. }
  32329. function c(e, t) {
  32330. ;(this.fun = e), (this.array = t)
  32331. }
  32332. function h() {}
  32333. var u,
  32334. d,
  32335. p = (t.exports = {})
  32336. !(function () {
  32337. try {
  32338. u = 'function' == typeof setTimeout ? setTimeout : n
  32339. } catch (e) {
  32340. u = n
  32341. }
  32342. try {
  32343. d = 'function' == typeof clearTimeout ? clearTimeout : r
  32344. } catch (e) {
  32345. d = r
  32346. }
  32347. })()
  32348. var f,
  32349. g = [],
  32350. m = !1,
  32351. v = -1
  32352. ;(p.nextTick = function (e) {
  32353. var t = new Array(arguments.length - 1)
  32354. if (arguments.length > 1) for (var i = 1; i < arguments.length; i++) t[i - 1] = arguments[i]
  32355. g.push(new c(e, t)), 1 !== g.length || m || o(l)
  32356. }),
  32357. (c.prototype.run = function () {
  32358. this.fun.apply(null, this.array)
  32359. }),
  32360. (p.title = 'browser'),
  32361. (p.browser = !0),
  32362. (p.env = {}),
  32363. (p.argv = []),
  32364. (p.version = ''),
  32365. (p.versions = {}),
  32366. (p.on = h),
  32367. (p.addListener = h),
  32368. (p.once = h),
  32369. (p.off = h),
  32370. (p.removeListener = h),
  32371. (p.removeAllListeners = h),
  32372. (p.emit = h),
  32373. (p.binding = function (e) {
  32374. throw new Error('process.binding is not supported')
  32375. }),
  32376. (p.cwd = function () {
  32377. return '/'
  32378. }),
  32379. (p.chdir = function (e) {
  32380. throw new Error('process.chdir is not supported')
  32381. }),
  32382. (p.umask = function () {
  32383. return 0
  32384. })
  32385. },
  32386. {}
  32387. ],
  32388. 204: [
  32389. function (e, t, i) {
  32390. ;(function (e) {
  32391. !(function (n) {
  32392. function r(e) {
  32393. throw new RangeError(L[e])
  32394. }
  32395. function o(e, t) {
  32396. for (var i = e.length, n = []; i--; ) n[i] = t(e[i])
  32397. return n
  32398. }
  32399. function a(e, t) {
  32400. var i = e.split('@'),
  32401. n = ''
  32402. i.length > 1 && ((n = i[0] + '@'), (e = i[1])), (e = e.replace(O, '.'))
  32403. var r = e.split('.'),
  32404. a = o(r, t).join('.')
  32405. return n + a
  32406. }
  32407. function s(e) {
  32408. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  32409. (t = e.charCodeAt(r++)),
  32410. t >= 55296 && t <= 56319 && r < o ? ((i = e.charCodeAt(r++)), 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t), r--)) : n.push(t)
  32411. return n
  32412. }
  32413. function l(e) {
  32414. return o(e, function (e) {
  32415. var t = ''
  32416. return e > 65535 && ((e -= 65536), (t += B(((e >>> 10) & 1023) | 55296)), (e = 56320 | (1023 & e))), (t += B(e))
  32417. }).join('')
  32418. }
  32419. function c(e) {
  32420. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  32421. }
  32422. function h(e, t) {
  32423. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  32424. }
  32425. function u(e, t, i) {
  32426. var n = 0
  32427. for (e = i ? N(e / T) : e >> 1, e += N(e / t); e > (D * w) >> 1; n += E) e = N(e / D)
  32428. return N(n + ((D + 1) * e) / (e + _))
  32429. }
  32430. function d(e) {
  32431. var t,
  32432. i,
  32433. n,
  32434. o,
  32435. a,
  32436. s,
  32437. h,
  32438. d,
  32439. p,
  32440. f,
  32441. g = [],
  32442. m = e.length,
  32443. v = 0,
  32444. A = S,
  32445. y = x
  32446. for (i = e.lastIndexOf(M), i < 0 && (i = 0), n = 0; n < i; ++n) e.charCodeAt(n) >= 128 && r('not-basic'), g.push(e.charCodeAt(n))
  32447. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  32448. for (
  32449. a = v, s = 1, h = E;
  32450. o >= m && r('invalid-input'), (d = c(e.charCodeAt(o++))), (d >= E || d > N((I - v) / s)) && r('overflow'), (v += d * s), (p = h <= y ? b : h >= y + w ? w : h - y), !(d < p);
  32451. h += E
  32452. )
  32453. (f = E - p), s > N(I / f) && r('overflow'), (s *= f)
  32454. ;(t = g.length + 1), (y = u(v - a, t, 0 == a)), N(v / t) > I - A && r('overflow'), (A += N(v / t)), (v %= t), g.splice(v++, 0, A)
  32455. }
  32456. return l(g)
  32457. }
  32458. function p(e) {
  32459. var t,
  32460. i,
  32461. n,
  32462. o,
  32463. a,
  32464. l,
  32465. c,
  32466. d,
  32467. p,
  32468. f,
  32469. g,
  32470. m,
  32471. v,
  32472. A,
  32473. y,
  32474. C = []
  32475. for (e = s(e), m = e.length, t = S, i = 0, a = x, l = 0; l < m; ++l) (g = e[l]), g < 128 && C.push(B(g))
  32476. for (n = o = C.length, o && C.push(M); n < m; ) {
  32477. for (c = I, l = 0; l < m; ++l) (g = e[l]), g >= t && g < c && (c = g)
  32478. for (v = n + 1, c - t > N((I - i) / v) && r('overflow'), i += (c - t) * v, t = c, l = 0; l < m; ++l)
  32479. if (((g = e[l]), g < t && ++i > I && r('overflow'), g == t)) {
  32480. for (d = i, p = E; (f = p <= a ? b : p >= a + w ? w : p - a), !(d < f); p += E) (y = d - f), (A = E - f), C.push(B(h(f + (y % A), 0))), (d = N(y / A))
  32481. C.push(B(h(d, 0))), (a = u(i, v, n == o)), (i = 0), ++n
  32482. }
  32483. ++i, ++t
  32484. }
  32485. return C.join('')
  32486. }
  32487. function f(e) {
  32488. return a(e, function (e) {
  32489. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  32490. })
  32491. }
  32492. function g(e) {
  32493. return a(e, function (e) {
  32494. return P.test(e) ? 'xn--' + p(e) : e
  32495. })
  32496. }
  32497. var m = 'object' == typeof i && i && !i.nodeType && i,
  32498. v = 'object' == typeof t && t && !t.nodeType && t,
  32499. A = 'object' == typeof e && e
  32500. ;(A.global !== A && A.window !== A && A.self !== A) || (n = A)
  32501. var y,
  32502. C,
  32503. I = 2147483647,
  32504. E = 36,
  32505. b = 1,
  32506. w = 26,
  32507. _ = 38,
  32508. T = 700,
  32509. x = 72,
  32510. S = 128,
  32511. M = '-',
  32512. R = /^xn--/,
  32513. P = /[^\x20-\x7E]/,
  32514. O = /[\x2E\u3002\uFF0E\uFF61]/g,
  32515. L = {
  32516. overflow: 'Overflow: input needs wider integers to process',
  32517. 'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
  32518. 'invalid-input': 'Invalid input'
  32519. },
  32520. D = E - b,
  32521. N = Math.floor,
  32522. B = String.fromCharCode
  32523. if (
  32524. ((y = {
  32525. version: '1.4.1',
  32526. ucs2: {
  32527. decode: s,
  32528. encode: l
  32529. },
  32530. decode: d,
  32531. encode: p,
  32532. toASCII: g,
  32533. toUnicode: f
  32534. }),
  32535. 'function' == typeof define && 'object' == typeof define.amd && define.amd)
  32536. )
  32537. define('punycode', function () {
  32538. return y
  32539. })
  32540. else if (m && v)
  32541. if (t.exports == m) v.exports = y
  32542. else for (C in y) y.hasOwnProperty(C) && (m[C] = y[C])
  32543. else n.punycode = y
  32544. })(this)
  32545. }).call(this, 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : 'undefined' != typeof window ? window : {})
  32546. },
  32547. {}
  32548. ],
  32549. 205: [
  32550. function (e, t, i) {
  32551. 'use strict'
  32552. function n(e, t) {
  32553. return Object.prototype.hasOwnProperty.call(e, t)
  32554. }
  32555. t.exports = function (e, t, i, o) {
  32556. ;(t = t || '&'), (i = i || '=')
  32557. var a = {}
  32558. if ('string' != typeof e || 0 === e.length) return a
  32559. var s = /\+/g
  32560. e = e.split(t)
  32561. var l = 1e3
  32562. o && 'number' == typeof o.maxKeys && (l = o.maxKeys)
  32563. var c = e.length
  32564. l > 0 && c > l && (c = l)
  32565. for (var h = 0; h < c; ++h) {
  32566. var u,
  32567. d,
  32568. p,
  32569. f,
  32570. g = e[h].replace(s, '%20'),
  32571. m = g.indexOf(i)
  32572. m >= 0 ? ((u = g.substr(0, m)), (d = g.substr(m + 1))) : ((u = g), (d = '')),
  32573. (p = decodeURIComponent(u)),
  32574. (f = decodeURIComponent(d)),
  32575. n(a, p) ? (r(a[p]) ? a[p].push(f) : (a[p] = [a[p], f])) : (a[p] = f)
  32576. }
  32577. return a
  32578. }
  32579. var r =
  32580. Array.isArray ||
  32581. function (e) {
  32582. return '[object Array]' === Object.prototype.toString.call(e)
  32583. }
  32584. },
  32585. {}
  32586. ],
  32587. 206: [
  32588. function (e, t, i) {
  32589. 'use strict'
  32590. function n(e, t) {
  32591. if (e.map) return e.map(t)
  32592. for (var i = [], n = 0; n < e.length; n++) i.push(t(e[n], n))
  32593. return i
  32594. }
  32595. var r = function (e) {
  32596. switch (typeof e) {
  32597. case 'string':
  32598. return e
  32599. case 'boolean':
  32600. return e ? 'true' : 'false'
  32601. case 'number':
  32602. return isFinite(e) ? e : ''
  32603. default:
  32604. return ''
  32605. }
  32606. }
  32607. t.exports = function (e, t, i, s) {
  32608. return (
  32609. (t = t || '&'),
  32610. (i = i || '='),
  32611. null === e && (e = void 0),
  32612. 'object' == typeof e
  32613. ? n(a(e), function (a) {
  32614. var s = encodeURIComponent(r(a)) + i
  32615. return o(e[a])
  32616. ? n(e[a], function (e) {
  32617. return s + encodeURIComponent(r(e))
  32618. }).join(t)
  32619. : s + encodeURIComponent(r(e[a]))
  32620. }).join(t)
  32621. : s
  32622. ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e))
  32623. : ''
  32624. )
  32625. }
  32626. var o =
  32627. Array.isArray ||
  32628. function (e) {
  32629. return '[object Array]' === Object.prototype.toString.call(e)
  32630. },
  32631. a =
  32632. Object.keys ||
  32633. function (e) {
  32634. var t = []
  32635. for (var i in e) Object.prototype.hasOwnProperty.call(e, i) && t.push(i)
  32636. return t
  32637. }
  32638. },
  32639. {}
  32640. ],
  32641. 207: [
  32642. function (e, t, i) {
  32643. 'use strict'
  32644. ;(i.decode = i.parse = e('./decode')), (i.encode = i.stringify = e('./encode'))
  32645. },
  32646. {
  32647. './decode': 205,
  32648. './encode': 206
  32649. }
  32650. ],
  32651. 208: [
  32652. function (e, t, i) {
  32653. 'use strict'
  32654. function n() {
  32655. ;(this.protocol = null),
  32656. (this.slashes = null),
  32657. (this.auth = null),
  32658. (this.host = null),
  32659. (this.port = null),
  32660. (this.hostname = null),
  32661. (this.hash = null),
  32662. (this.search = null),
  32663. (this.query = null),
  32664. (this.pathname = null),
  32665. (this.path = null),
  32666. (this.href = null)
  32667. }
  32668. function r(e, t, i) {
  32669. if (e && c.isObject(e) && e instanceof n) return e
  32670. var r = new n()
  32671. return r.parse(e, t, i), r
  32672. }
  32673. function o(e) {
  32674. return c.isString(e) && (e = r(e)), e instanceof n ? e.format() : n.prototype.format.call(e)
  32675. }
  32676. function a(e, t) {
  32677. return r(e, !1, !0).resolve(t)
  32678. }
  32679. function s(e, t) {
  32680. return e ? r(e, !1, !0).resolveObject(t) : t
  32681. }
  32682. var l = e('punycode'),
  32683. c = e('./util')
  32684. ;(i.parse = r), (i.resolve = a), (i.resolveObject = s), (i.format = o), (i.Url = n)
  32685. var h = /^([a-z0-9.+-]+:)/i,
  32686. u = /:[0-9]*$/,
  32687. d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  32688. p = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'],
  32689. f = ['{', '}', '|', '\\', '^', '`'].concat(p),
  32690. g = ["'"].concat(f),
  32691. m = ['%', '/', '?', ';', '#'].concat(g),
  32692. v = ['/', '?', '#'],
  32693. A = 255,
  32694. y = /^[+a-z0-9A-Z_-]{0,63}$/,
  32695. C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  32696. I = {
  32697. javascript: !0,
  32698. 'javascript:': !0
  32699. },
  32700. E = {
  32701. javascript: !0,
  32702. 'javascript:': !0
  32703. },
  32704. b = {
  32705. http: !0,
  32706. https: !0,
  32707. ftp: !0,
  32708. gopher: !0,
  32709. file: !0,
  32710. 'http:': !0,
  32711. 'https:': !0,
  32712. 'ftp:': !0,
  32713. 'gopher:': !0,
  32714. 'file:': !0
  32715. },
  32716. w = e('querystring')
  32717. ;(n.prototype.parse = function (e, t, i) {
  32718. if (!c.isString(e)) throw new TypeError("Parameter 'url' must be a string, not " + typeof e)
  32719. var n = e.indexOf('?'),
  32720. r = n !== -1 && n < e.indexOf('#') ? '?' : '#',
  32721. o = e.split(r),
  32722. a = /\\/g
  32723. ;(o[0] = o[0].replace(a, '/')), (e = o.join(r))
  32724. var s = e
  32725. if (((s = s.trim()), !i && 1 === e.split('#').length)) {
  32726. var u = d.exec(s)
  32727. if (u)
  32728. return (
  32729. (this.path = s),
  32730. (this.href = s),
  32731. (this.pathname = u[1]),
  32732. u[2] ? ((this.search = u[2]), t ? (this.query = w.parse(this.search.substr(1))) : (this.query = this.search.substr(1))) : t && ((this.search = ''), (this.query = {})),
  32733. this
  32734. )
  32735. }
  32736. var p = h.exec(s)
  32737. if (p) {
  32738. p = p[0]
  32739. var f = p.toLowerCase()
  32740. ;(this.protocol = f), (s = s.substr(p.length))
  32741. }
  32742. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  32743. var _ = '//' === s.substr(0, 2)
  32744. !_ || (p && E[p]) || ((s = s.substr(2)), (this.slashes = !0))
  32745. }
  32746. if (!E[p] && (_ || (p && !b[p]))) {
  32747. for (var T = -1, x = 0; x < v.length; x++) {
  32748. var S = s.indexOf(v[x])
  32749. S !== -1 && (T === -1 || S < T) && (T = S)
  32750. }
  32751. var M, R
  32752. ;(R = T === -1 ? s.lastIndexOf('@') : s.lastIndexOf('@', T)), R !== -1 && ((M = s.slice(0, R)), (s = s.slice(R + 1)), (this.auth = decodeURIComponent(M))), (T = -1)
  32753. for (var x = 0; x < m.length; x++) {
  32754. var S = s.indexOf(m[x])
  32755. S !== -1 && (T === -1 || S < T) && (T = S)
  32756. }
  32757. T === -1 && (T = s.length), (this.host = s.slice(0, T)), (s = s.slice(T)), this.parseHost(), (this.hostname = this.hostname || '')
  32758. var P = '[' === this.hostname[0] && ']' === this.hostname[this.hostname.length - 1]
  32759. if (!P)
  32760. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  32761. var D = O[x]
  32762. if (D && !D.match(y)) {
  32763. for (var N = '', B = 0, F = D.length; B < F; B++) N += D.charCodeAt(B) > 127 ? 'x' : D[B]
  32764. if (!N.match(y)) {
  32765. var V = O.slice(0, x),
  32766. U = O.slice(x + 1),
  32767. k = D.match(C)
  32768. k && (V.push(k[1]), U.unshift(k[2])), U.length && (s = '/' + U.join('.') + s), (this.hostname = V.join('.'))
  32769. break
  32770. }
  32771. }
  32772. }
  32773. this.hostname.length > A ? (this.hostname = '') : (this.hostname = this.hostname.toLowerCase()), P || (this.hostname = l.toASCII(this.hostname))
  32774. var H = this.port ? ':' + this.port : '',
  32775. G = this.hostname || ''
  32776. ;(this.host = G + H), (this.href += this.host), P && ((this.hostname = this.hostname.substr(1, this.hostname.length - 2)), '/' !== s[0] && (s = '/' + s))
  32777. }
  32778. if (!I[f])
  32779. for (var x = 0, L = g.length; x < L; x++) {
  32780. var z = g[x]
  32781. if (s.indexOf(z) !== -1) {
  32782. var W = encodeURIComponent(z)
  32783. W === z && (W = escape(z)), (s = s.split(z).join(W))
  32784. }
  32785. }
  32786. var j = s.indexOf('#')
  32787. j !== -1 && ((this.hash = s.substr(j)), (s = s.slice(0, j)))
  32788. var Y = s.indexOf('?')
  32789. if (
  32790. (Y !== -1 ? ((this.search = s.substr(Y)), (this.query = s.substr(Y + 1)), t && (this.query = w.parse(this.query)), (s = s.slice(0, Y))) : t && ((this.search = ''), (this.query = {})),
  32791. s && (this.pathname = s),
  32792. b[f] && this.hostname && !this.pathname && (this.pathname = '/'),
  32793. this.pathname || this.search)
  32794. ) {
  32795. var H = this.pathname || '',
  32796. X = this.search || ''
  32797. this.path = H + X
  32798. }
  32799. return (this.href = this.format()), this
  32800. }),
  32801. (n.prototype.format = function () {
  32802. var e = this.auth || ''
  32803. e && ((e = encodeURIComponent(e)), (e = e.replace(/%3A/i, ':')), (e += '@'))
  32804. var t = this.protocol || '',
  32805. i = this.pathname || '',
  32806. n = this.hash || '',
  32807. r = !1,
  32808. o = ''
  32809. this.host ? (r = e + this.host) : this.hostname && ((r = e + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']')), this.port && (r += ':' + this.port)),
  32810. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query))
  32811. var a = this.search || (o && '?' + o) || ''
  32812. return (
  32813. t && ':' !== t.substr(-1) && (t += ':'),
  32814. this.slashes || ((!t || b[t]) && r !== !1) ? ((r = '//' + (r || '')), i && '/' !== i.charAt(0) && (i = '/' + i)) : r || (r = ''),
  32815. n && '#' !== n.charAt(0) && (n = '#' + n),
  32816. a && '?' !== a.charAt(0) && (a = '?' + a),
  32817. (i = i.replace(/[?#]/g, function (e) {
  32818. return encodeURIComponent(e)
  32819. })),
  32820. (a = a.replace('#', '%23')),
  32821. t + r + i + a + n
  32822. )
  32823. }),
  32824. (n.prototype.resolve = function (e) {
  32825. return this.resolveObject(r(e, !1, !0)).format()
  32826. }),
  32827. (n.prototype.resolveObject = function (e) {
  32828. if (c.isString(e)) {
  32829. var t = new n()
  32830. t.parse(e, !1, !0), (e = t)
  32831. }
  32832. for (var i = new n(), r = Object.keys(this), o = 0; o < r.length; o++) {
  32833. var a = r[o]
  32834. i[a] = this[a]
  32835. }
  32836. if (((i.hash = e.hash), '' === e.href)) return (i.href = i.format()), i
  32837. if (e.slashes && !e.protocol) {
  32838. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  32839. var h = s[l]
  32840. 'protocol' !== h && (i[h] = e[h])
  32841. }
  32842. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = '/'), (i.href = i.format()), i
  32843. }
  32844. if (e.protocol && e.protocol !== i.protocol) {
  32845. if (!b[e.protocol]) {
  32846. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  32847. var p = u[d]
  32848. i[p] = e[p]
  32849. }
  32850. return (i.href = i.format()), i
  32851. }
  32852. if (((i.protocol = e.protocol), e.host || E[e.protocol])) i.pathname = e.pathname
  32853. else {
  32854. for (var f = (e.pathname || '').split('/'); f.length && !(e.host = f.shift()); );
  32855. e.host || (e.host = ''), e.hostname || (e.hostname = ''), '' !== f[0] && f.unshift(''), f.length < 2 && f.unshift(''), (i.pathname = f.join('/'))
  32856. }
  32857. if (((i.search = e.search), (i.query = e.query), (i.host = e.host || ''), (i.auth = e.auth), (i.hostname = e.hostname || e.host), (i.port = e.port), i.pathname || i.search)) {
  32858. var g = i.pathname || '',
  32859. m = i.search || ''
  32860. i.path = g + m
  32861. }
  32862. return (i.slashes = i.slashes || e.slashes), (i.href = i.format()), i
  32863. }
  32864. var v = i.pathname && '/' === i.pathname.charAt(0),
  32865. A = e.host || (e.pathname && '/' === e.pathname.charAt(0)),
  32866. y = A || v || (i.host && e.pathname),
  32867. C = y,
  32868. I = (i.pathname && i.pathname.split('/')) || [],
  32869. f = (e.pathname && e.pathname.split('/')) || [],
  32870. w = i.protocol && !b[i.protocol]
  32871. if (
  32872. (w &&
  32873. ((i.hostname = ''),
  32874. (i.port = null),
  32875. i.host && ('' === I[0] ? (I[0] = i.host) : I.unshift(i.host)),
  32876. (i.host = ''),
  32877. e.protocol && ((e.hostname = null), (e.port = null), e.host && ('' === f[0] ? (f[0] = e.host) : f.unshift(e.host)), (e.host = null)),
  32878. (y = y && ('' === f[0] || '' === I[0]))),
  32879. A)
  32880. )
  32881. (i.host = e.host || '' === e.host ? e.host : i.host), (i.hostname = e.hostname || '' === e.hostname ? e.hostname : i.hostname), (i.search = e.search), (i.query = e.query), (I = f)
  32882. else if (f.length) I || (I = []), I.pop(), (I = I.concat(f)), (i.search = e.search), (i.query = e.query)
  32883. else if (!c.isNullOrUndefined(e.search)) {
  32884. if (w) {
  32885. i.hostname = i.host = I.shift()
  32886. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@')
  32887. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()))
  32888. }
  32889. return (
  32890. (i.search = e.search),
  32891. (i.query = e.query),
  32892. (c.isNull(i.pathname) && c.isNull(i.search)) || (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  32893. (i.href = i.format()),
  32894. i
  32895. )
  32896. }
  32897. if (!I.length) return (i.pathname = null), i.search ? (i.path = '/' + i.search) : (i.path = null), (i.href = i.format()), i
  32898. 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--)
  32899. (T = I[M]), '.' === T ? I.splice(M, 1) : '..' === T ? (I.splice(M, 1), S++) : S && (I.splice(M, 1), S--)
  32900. if (!y && !C) for (; S--; S) I.unshift('..')
  32901. !y || '' === I[0] || (I[0] && '/' === I[0].charAt(0)) || I.unshift(''), x && '/' !== I.join('/').substr(-1) && I.push('')
  32902. var R = '' === I[0] || (I[0] && '/' === I[0].charAt(0))
  32903. if (w) {
  32904. i.hostname = i.host = R ? '' : I.length ? I.shift() : ''
  32905. var _ = !!(i.host && i.host.indexOf('@') > 0) && i.host.split('@')
  32906. _ && ((i.auth = _.shift()), (i.host = i.hostname = _.shift()))
  32907. }
  32908. return (
  32909. (y = y || (i.host && I.length)),
  32910. y && !R && I.unshift(''),
  32911. I.length ? (i.pathname = I.join('/')) : ((i.pathname = null), (i.path = null)),
  32912. (c.isNull(i.pathname) && c.isNull(i.search)) || (i.path = (i.pathname ? i.pathname : '') + (i.search ? i.search : '')),
  32913. (i.auth = e.auth || i.auth),
  32914. (i.slashes = i.slashes || e.slashes),
  32915. (i.href = i.format()),
  32916. i
  32917. )
  32918. }),
  32919. (n.prototype.parseHost = function () {
  32920. var e = this.host,
  32921. t = u.exec(e)
  32922. t && ((t = t[0]), ':' !== t && (this.port = t.substr(1)), (e = e.substr(0, e.length - t.length))), e && (this.hostname = e)
  32923. })
  32924. },
  32925. {
  32926. './util': 209,
  32927. punycode: 204,
  32928. querystring: 207
  32929. }
  32930. ],
  32931. 209: [
  32932. function (e, t, i) {
  32933. 'use strict'
  32934. t.exports = {
  32935. isString: function (e) {
  32936. return 'string' == typeof e
  32937. },
  32938. isObject: function (e) {
  32939. return 'object' == typeof e && null !== e
  32940. },
  32941. isNull: function (e) {
  32942. return null === e
  32943. },
  32944. isNullOrUndefined: function (e) {
  32945. return null == e
  32946. }
  32947. }
  32948. },
  32949. {}
  32950. ],
  32951. 210: [
  32952. function (e, t, i) {
  32953. 'use strict'
  32954. function n(e) {
  32955. return l + e
  32956. }
  32957. function r(e) {
  32958. return e.substring(l.length)
  32959. }
  32960. function o(e, t) {
  32961. for (var i in t)
  32962. Object.defineProperty(e, i, {
  32963. value: t[i],
  32964. configurable: !0,
  32965. writable: !0
  32966. })
  32967. }
  32968. function a(e) {
  32969. if ('string' != typeof e) throw new TypeError('key must be a string.')
  32970. }
  32971. var s = Object.prototype.hasOwnProperty,
  32972. l = '~'
  32973. t.exports = function (e) {
  32974. var t = Object.create(null),
  32975. i = 0,
  32976. l = {}
  32977. return (
  32978. o(l, {
  32979. get: function (e, i) {
  32980. a(e)
  32981. var r = n(e)
  32982. return r in t ? t[r] : i
  32983. },
  32984. set: function (e, r) {
  32985. a(e)
  32986. var o = n(e)
  32987. return o in t || ++i, (t[o] = r)
  32988. },
  32989. has: function (e) {
  32990. return a(e), n(e) in t
  32991. },
  32992. delete: function (e) {
  32993. a(e)
  32994. var r = n(e)
  32995. return r in t && (--i, delete t[r], !0)
  32996. },
  32997. clear: function () {
  32998. ;(t = Object.create(null)), (i = 0)
  32999. },
  33000. forEach: function (e, i) {
  33001. if ('function' != typeof e) throw new TypeError('`callback` must be a function')
  33002. for (var n in t)
  33003. if (s.call(t, n)) {
  33004. var o = r(n),
  33005. a = t[n]
  33006. e.call(i, a, o, l)
  33007. }
  33008. }
  33009. }),
  33010. Object.defineProperty(l, 'size', {
  33011. get: function () {
  33012. return i
  33013. },
  33014. configurable: !0
  33015. }),
  33016. 'object' == typeof e &&
  33017. null !== e &&
  33018. Object.keys(e).forEach(function (t) {
  33019. l.set(t, e[t])
  33020. }),
  33021. l
  33022. )
  33023. }
  33024. },
  33025. {}
  33026. ],
  33027. 211: [
  33028. function (e, t, i) {
  33029. t.exports = e('./lib/heap')
  33030. },
  33031. {
  33032. './lib/heap': 212
  33033. }
  33034. ],
  33035. 212: [
  33036. function (e, t, i) {
  33037. ;(function () {
  33038. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m
  33039. ;(r = Math.floor),
  33040. (u = Math.min),
  33041. (n = function (e, t) {
  33042. return e < t ? -1 : e > t ? 1 : 0
  33043. }),
  33044. (h = function (e, t, i, o, a) {
  33045. var s
  33046. if ((null == i && (i = 0), null == a && (a = n), i < 0)) throw new Error('lo must be non-negative')
  33047. for (null == o && (o = e.length); i < o; ) (s = r((i + o) / 2)), a(t, e[s]) < 0 ? (o = s) : (i = s + 1)
  33048. return [].splice.apply(e, [i, i - i].concat(t)), t
  33049. }),
  33050. (s = function (e, t, i) {
  33051. return null == i && (i = n), e.push(t), g(e, 0, e.length - 1, i)
  33052. }),
  33053. (a = function (e, t) {
  33054. var i, r
  33055. return null == t && (t = n), (i = e.pop()), e.length ? ((r = e[0]), (e[0] = i), m(e, 0, t)) : (r = i), r
  33056. }),
  33057. (c = function (e, t, i) {
  33058. var r
  33059. return null == i && (i = n), (r = e[0]), (e[0] = t), m(e, 0, i), r
  33060. }),
  33061. (l = function (e, t, i) {
  33062. var r
  33063. return null == i && (i = n), e.length && i(e[0], t) < 0 && ((r = [e[0], t]), (t = r[0]), (e[0] = r[1]), m(e, 0, i)), t
  33064. }),
  33065. (o = function (e, t) {
  33066. var i, o, a, s, l, c
  33067. for (
  33068. null == t && (t = n),
  33069. s = function () {
  33070. c = []
  33071. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--) c.push(t)
  33072. return c
  33073. }
  33074. .apply(this)
  33075. .reverse(),
  33076. l = [],
  33077. o = 0,
  33078. a = s.length;
  33079. o < a;
  33080. o++
  33081. )
  33082. (i = s[o]), l.push(m(e, i, t))
  33083. return l
  33084. }),
  33085. (f = function (e, t, i) {
  33086. var r
  33087. if ((null == i && (i = n), (r = e.indexOf(t)), r !== -1)) return g(e, 0, r, i), m(e, r, i)
  33088. }),
  33089. (d = function (e, t, i) {
  33090. var r, a, s, c, h
  33091. if ((null == i && (i = n), (a = e.slice(0, t)), !a.length)) return a
  33092. for (o(a, i), h = e.slice(t), s = 0, c = h.length; s < c; s++) (r = h[s]), l(a, r, i)
  33093. return a.sort(i).reverse()
  33094. }),
  33095. (p = function (e, t, i) {
  33096. var r, s, l, c, d, p, f, g, m, v
  33097. if ((null == i && (i = n), 10 * t <= e.length)) {
  33098. if (((c = e.slice(0, t).sort(i)), !c.length)) return c
  33099. for (l = c[c.length - 1], g = e.slice(t), d = 0, f = g.length; d < f; d++) (r = g[d]), i(r, l) < 0 && (h(c, r, 0, null, i), c.pop(), (l = c[c.length - 1]))
  33100. return c
  33101. }
  33102. for (o(e, i), v = [], s = p = 0, m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p) v.push(a(e, i))
  33103. return v
  33104. }),
  33105. (g = function (e, t, i, r) {
  33106. var o, a, s
  33107. for (null == r && (r = n), o = e[i]; i > t && ((s = (i - 1) >> 1), (a = e[s]), r(o, a) < 0); ) (e[i] = a), (i = s)
  33108. return (e[i] = o)
  33109. }),
  33110. (m = function (e, t, i) {
  33111. var r, o, a, s, l
  33112. for (null == i && (i = n), o = e.length, l = t, a = e[t], r = 2 * t + 1; r < o; ) (s = r + 1), s < o && !(i(e[r], e[s]) < 0) && (r = s), (e[t] = e[r]), (t = r), (r = 2 * t + 1)
  33113. return (e[t] = a), g(e, l, t, i)
  33114. }),
  33115. (e = (function () {
  33116. function e(e) {
  33117. ;(this.cmp = null != e ? e : n), (this.nodes = [])
  33118. }
  33119. return (
  33120. (e.push = s),
  33121. (e.pop = a),
  33122. (e.replace = c),
  33123. (e.pushpop = l),
  33124. (e.heapify = o),
  33125. (e.updateItem = f),
  33126. (e.nlargest = d),
  33127. (e.nsmallest = p),
  33128. (e.prototype.push = function (e) {
  33129. return s(this.nodes, e, this.cmp)
  33130. }),
  33131. (e.prototype.pop = function () {
  33132. return a(this.nodes, this.cmp)
  33133. }),
  33134. (e.prototype.peek = function () {
  33135. return this.nodes[0]
  33136. }),
  33137. (e.prototype.contains = function (e) {
  33138. return this.nodes.indexOf(e) !== -1
  33139. }),
  33140. (e.prototype.replace = function (e) {
  33141. return c(this.nodes, e, this.cmp)
  33142. }),
  33143. (e.prototype.pushpop = function (e) {
  33144. return l(this.nodes, e, this.cmp)
  33145. }),
  33146. (e.prototype.heapify = function () {
  33147. return o(this.nodes, this.cmp)
  33148. }),
  33149. (e.prototype.updateItem = function (e) {
  33150. return f(this.nodes, e, this.cmp)
  33151. }),
  33152. (e.prototype.clear = function () {
  33153. return (this.nodes = [])
  33154. }),
  33155. (e.prototype.empty = function () {
  33156. return 0 === this.nodes.length
  33157. }),
  33158. (e.prototype.size = function () {
  33159. return this.nodes.length
  33160. }),
  33161. (e.prototype.clone = function () {
  33162. var t
  33163. return (t = new e()), (t.nodes = this.nodes.slice(0)), t
  33164. }),
  33165. (e.prototype.toArray = function () {
  33166. return this.nodes.slice(0)
  33167. }),
  33168. (e.prototype.insert = e.prototype.push),
  33169. (e.prototype.top = e.prototype.peek),
  33170. (e.prototype.front = e.prototype.peek),
  33171. (e.prototype.has = e.prototype.contains),
  33172. (e.prototype.copy = e.prototype.clone),
  33173. e
  33174. )
  33175. })()),
  33176. (function (e, n) {
  33177. return 'function' == typeof define && define.amd ? define([], n) : 'object' == typeof i ? (t.exports = n()) : (e.Heap = n())
  33178. })(this, function () {
  33179. return e
  33180. })
  33181. }).call(this)
  33182. },
  33183. {}
  33184. ],
  33185. 213: [
  33186. function (e, t, i) {
  33187. !(function (e) {
  33188. function i() {}
  33189. function n(e, t) {
  33190. return function () {
  33191. e.apply(t, arguments)
  33192. }
  33193. }
  33194. function r(e) {
  33195. if ('object' != typeof this) throw new TypeError('Promises must be constructed via new')
  33196. if ('function' != typeof e) throw new TypeError('not a function')
  33197. ;(this._state = 0), (this._handled = !1), (this._value = void 0), (this._deferreds = []), h(e, this)
  33198. }
  33199. function o(e, t) {
  33200. for (; 3 === e._state; ) e = e._value
  33201. return 0 === e._state
  33202. ? void e._deferreds.push(t)
  33203. : ((e._handled = !0),
  33204. void r._immediateFn(function () {
  33205. var i = 1 === e._state ? t.onFulfilled : t.onRejected
  33206. if (null === i) return void (1 === e._state ? a : s)(t.promise, e._value)
  33207. var n
  33208. try {
  33209. n = i(e._value)
  33210. } catch (e) {
  33211. return void s(t.promise, e)
  33212. }
  33213. a(t.promise, n)
  33214. }))
  33215. }
  33216. function a(e, t) {
  33217. try {
  33218. if (t === e) throw new TypeError('A promise cannot be resolved with itself.')
  33219. if (t && ('object' == typeof t || 'function' == typeof t)) {
  33220. var i = t.then
  33221. if (t instanceof r) return (e._state = 3), (e._value = t), void l(e)
  33222. if ('function' == typeof i) return void h(n(i, t), e)
  33223. }
  33224. ;(e._state = 1), (e._value = t), l(e)
  33225. } catch (t) {
  33226. s(e, t)
  33227. }
  33228. }
  33229. function s(e, t) {
  33230. ;(e._state = 2), (e._value = t), l(e)
  33231. }
  33232. function l(e) {
  33233. 2 === e._state &&
  33234. 0 === e._deferreds.length &&
  33235. r._immediateFn(function () {
  33236. e._handled || r._unhandledRejectionFn(e._value)
  33237. })
  33238. for (var t = 0, i = e._deferreds.length; t < i; t++) o(e, e._deferreds[t])
  33239. e._deferreds = null
  33240. }
  33241. function c(e, t, i) {
  33242. ;(this.onFulfilled = 'function' == typeof e ? e : null), (this.onRejected = 'function' == typeof t ? t : null), (this.promise = i)
  33243. }
  33244. function h(e, t) {
  33245. var i = !1
  33246. try {
  33247. e(
  33248. function (e) {
  33249. i || ((i = !0), a(t, e))
  33250. },
  33251. function (e) {
  33252. i || ((i = !0), s(t, e))
  33253. }
  33254. )
  33255. } catch (e) {
  33256. if (i) return
  33257. ;(i = !0), s(t, e)
  33258. }
  33259. }
  33260. var u = setTimeout
  33261. ;(r.prototype.catch = function (e) {
  33262. return this.then(null, e)
  33263. }),
  33264. (r.prototype.then = function (e, t) {
  33265. var n = new this.constructor(i)
  33266. return o(this, new c(e, t, n)), n
  33267. }),
  33268. (r.all = function (e) {
  33269. var t = Array.prototype.slice.call(e)
  33270. return new r(function (e, i) {
  33271. function n(o, a) {
  33272. try {
  33273. if (a && ('object' == typeof a || 'function' == typeof a)) {
  33274. var s = a.then
  33275. if ('function' == typeof s)
  33276. return void s.call(
  33277. a,
  33278. function (e) {
  33279. n(o, e)
  33280. },
  33281. i
  33282. )
  33283. }
  33284. ;(t[o] = a), 0 === --r && e(t)
  33285. } catch (e) {
  33286. i(e)
  33287. }
  33288. }
  33289. if (0 === t.length) return e([])
  33290. for (var r = t.length, o = 0; o < t.length; o++) n(o, t[o])
  33291. })
  33292. }),
  33293. (r.resolve = function (e) {
  33294. return e && 'object' == typeof e && e.constructor === r
  33295. ? e
  33296. : new r(function (t) {
  33297. t(e)
  33298. })
  33299. }),
  33300. (r.reject = function (e) {
  33301. return new r(function (t, i) {
  33302. i(e)
  33303. })
  33304. }),
  33305. (r.race = function (e) {
  33306. return new r(function (t, i) {
  33307. for (var n = 0, r = e.length; n < r; n++) e[n].then(t, i)
  33308. })
  33309. }),
  33310. (r._immediateFn =
  33311. ('function' == typeof setImmediate &&
  33312. function (e) {
  33313. setImmediate(e)
  33314. }) ||
  33315. function (e) {
  33316. u(e, 0)
  33317. }),
  33318. (r._unhandledRejectionFn = function (e) {
  33319. 'undefined' != typeof console && console && console.warn('Possible Unhandled Promise Rejection:', e)
  33320. }),
  33321. (r._setImmediateFn = function (e) {
  33322. r._immediateFn = e
  33323. }),
  33324. (r._setUnhandledRejectionFn = function (e) {
  33325. r._unhandledRejectionFn = e
  33326. }),
  33327. 'undefined' != typeof t && t.exports ? (t.exports = r) : e.Promise || (e.Promise = r)
  33328. })(this)
  33329. },
  33330. {}
  33331. ],
  33332. 214: [
  33333. function (e, t, i) {
  33334. ;(function (i) {
  33335. !(function (i, n) {
  33336. 'function' == typeof define && define.amd
  33337. ? define(['bytebuffer'], n)
  33338. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  33339. ? (t.exports = n(e('bytebuffer'), !0))
  33340. : ((i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer))
  33341. })(this, function (t, n) {
  33342. 'use strict'
  33343. var r = {}
  33344. return (
  33345. (r.ByteBuffer = t),
  33346. (r.Long = t.Long || null),
  33347. (r.VERSION = '5.0.1'),
  33348. (r.WIRE_TYPES = {}),
  33349. (r.WIRE_TYPES.VARINT = 0),
  33350. (r.WIRE_TYPES.BITS64 = 1),
  33351. (r.WIRE_TYPES.LDELIM = 2),
  33352. (r.WIRE_TYPES.STARTGROUP = 3),
  33353. (r.WIRE_TYPES.ENDGROUP = 4),
  33354. (r.WIRE_TYPES.BITS32 = 5),
  33355. (r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32]),
  33356. (r.TYPES = {
  33357. int32: {
  33358. name: 'int32',
  33359. wireType: r.WIRE_TYPES.VARINT,
  33360. defaultValue: 0
  33361. },
  33362. uint32: {
  33363. name: 'uint32',
  33364. wireType: r.WIRE_TYPES.VARINT,
  33365. defaultValue: 0
  33366. },
  33367. sint32: {
  33368. name: 'sint32',
  33369. wireType: r.WIRE_TYPES.VARINT,
  33370. defaultValue: 0
  33371. },
  33372. int64: {
  33373. name: 'int64',
  33374. wireType: r.WIRE_TYPES.VARINT,
  33375. defaultValue: r.Long ? r.Long.ZERO : void 0
  33376. },
  33377. uint64: {
  33378. name: 'uint64',
  33379. wireType: r.WIRE_TYPES.VARINT,
  33380. defaultValue: r.Long ? r.Long.UZERO : void 0
  33381. },
  33382. sint64: {
  33383. name: 'sint64',
  33384. wireType: r.WIRE_TYPES.VARINT,
  33385. defaultValue: r.Long ? r.Long.ZERO : void 0
  33386. },
  33387. bool: {
  33388. name: 'bool',
  33389. wireType: r.WIRE_TYPES.VARINT,
  33390. defaultValue: !1
  33391. },
  33392. double: {
  33393. name: 'double',
  33394. wireType: r.WIRE_TYPES.BITS64,
  33395. defaultValue: 0
  33396. },
  33397. string: {
  33398. name: 'string',
  33399. wireType: r.WIRE_TYPES.LDELIM,
  33400. defaultValue: ''
  33401. },
  33402. bytes: {
  33403. name: 'bytes',
  33404. wireType: r.WIRE_TYPES.LDELIM,
  33405. defaultValue: null
  33406. },
  33407. fixed32: {
  33408. name: 'fixed32',
  33409. wireType: r.WIRE_TYPES.BITS32,
  33410. defaultValue: 0
  33411. },
  33412. sfixed32: {
  33413. name: 'sfixed32',
  33414. wireType: r.WIRE_TYPES.BITS32,
  33415. defaultValue: 0
  33416. },
  33417. fixed64: {
  33418. name: 'fixed64',
  33419. wireType: r.WIRE_TYPES.BITS64,
  33420. defaultValue: r.Long ? r.Long.UZERO : void 0
  33421. },
  33422. sfixed64: {
  33423. name: 'sfixed64',
  33424. wireType: r.WIRE_TYPES.BITS64,
  33425. defaultValue: r.Long ? r.Long.ZERO : void 0
  33426. },
  33427. float: {
  33428. name: 'float',
  33429. wireType: r.WIRE_TYPES.BITS32,
  33430. defaultValue: 0
  33431. },
  33432. enum: {
  33433. name: 'enum',
  33434. wireType: r.WIRE_TYPES.VARINT,
  33435. defaultValue: 0
  33436. },
  33437. message: {
  33438. name: 'message',
  33439. wireType: r.WIRE_TYPES.LDELIM,
  33440. defaultValue: null
  33441. },
  33442. group: {
  33443. name: 'group',
  33444. wireType: r.WIRE_TYPES.STARTGROUP,
  33445. defaultValue: null
  33446. }
  33447. }),
  33448. (r.MAP_KEY_TYPES = [
  33449. r.TYPES.int32,
  33450. r.TYPES.sint32,
  33451. r.TYPES.sfixed32,
  33452. r.TYPES.uint32,
  33453. r.TYPES.fixed32,
  33454. r.TYPES.int64,
  33455. r.TYPES.sint64,
  33456. r.TYPES.sfixed64,
  33457. r.TYPES.uint64,
  33458. r.TYPES.fixed64,
  33459. r.TYPES.bool,
  33460. r.TYPES.string,
  33461. r.TYPES.bytes
  33462. ]),
  33463. (r.ID_MIN = 1),
  33464. (r.ID_MAX = 536870911),
  33465. (r.convertFieldsToCamelCase = !1),
  33466. (r.populateAccessors = !0),
  33467. (r.populateDefaults = !0),
  33468. (r.Util = (function () {
  33469. var t = {}
  33470. return (
  33471. (t.IS_NODE = !('object' != typeof i || i + '' != '[object process]' || i.browser)),
  33472. (t.XHR = function () {
  33473. for (
  33474. var e = [
  33475. function () {
  33476. return new XMLHttpRequest()
  33477. },
  33478. function () {
  33479. return new ActiveXObject('Msxml2.XMLHTTP')
  33480. },
  33481. function () {
  33482. return new ActiveXObject('Msxml3.XMLHTTP')
  33483. },
  33484. function () {
  33485. return new ActiveXObject('Microsoft.XMLHTTP')
  33486. }
  33487. ],
  33488. t = null,
  33489. i = 0;
  33490. i < e.length;
  33491. i++
  33492. ) {
  33493. try {
  33494. t = e[i]()
  33495. } catch (e) {
  33496. continue
  33497. }
  33498. break
  33499. }
  33500. if (!t) throw Error('XMLHttpRequest is not supported')
  33501. return t
  33502. }),
  33503. (t.fetch = function (i, n) {
  33504. if ((n && 'function' != typeof n && (n = null), t.IS_NODE)) {
  33505. var r = e('fs')
  33506. if (n)
  33507. r.readFile(i, function (e, t) {
  33508. n(e ? null : '' + t)
  33509. })
  33510. else
  33511. try {
  33512. return r.readFileSync(i)
  33513. } catch (e) {
  33514. return null
  33515. }
  33516. } else {
  33517. var o = t.XHR()
  33518. if ((o.open('GET', i, !!n), o.setRequestHeader('Accept', 'text/plain'), 'function' == typeof o.overrideMimeType && o.overrideMimeType('text/plain'), !n))
  33519. return o.send(null), 200 == o.status || (0 == o.status && 'string' == typeof o.responseText) ? o.responseText : null
  33520. if (
  33521. ((o.onreadystatechange = function () {
  33522. 4 == o.readyState && n(200 == o.status || (0 == o.status && 'string' == typeof o.responseText) ? o.responseText : null)
  33523. }),
  33524. 4 == o.readyState)
  33525. )
  33526. return
  33527. o.send(null)
  33528. }
  33529. }),
  33530. (t.toCamelCase = function (e) {
  33531. return e.replace(/_([a-zA-Z])/g, function (e, t) {
  33532. return t.toUpperCase()
  33533. })
  33534. }),
  33535. t
  33536. )
  33537. })()),
  33538. (r.Lang = {
  33539. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  33540. RULE: /^(?:required|optional|repeated|map)$/,
  33541. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  33542. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  33543. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  33544. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  33545. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  33546. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  33547. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  33548. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  33549. NUMBER_OCT: /^0[0-7]+$/,
  33550. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  33551. BOOL: /^(?:true|false)$/i,
  33552. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33553. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  33554. WHITESPACE: /\s/,
  33555. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  33556. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  33557. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  33558. }),
  33559. (r.DotProto = (function (e, t) {
  33560. function i(e, i) {
  33561. var n = -1,
  33562. r = 1
  33563. if (('-' == e.charAt(0) && ((r = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))) n = parseInt(e)
  33564. else if (t.NUMBER_HEX.test(e)) n = parseInt(e.substring(2), 16)
  33565. else {
  33566. if (!t.NUMBER_OCT.test(e)) throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e)
  33567. n = parseInt(e.substring(1), 8)
  33568. }
  33569. if (((n = (r * n) | 0), !i && n < 0)) throw Error('illegal id value: ' + (r < 0 ? '-' : '') + e)
  33570. return n
  33571. }
  33572. function n(e) {
  33573. var i = 1
  33574. if (('-' == e.charAt(0) && ((i = -1), (e = e.substring(1))), t.NUMBER_DEC.test(e))) return i * parseInt(e, 10)
  33575. if (t.NUMBER_HEX.test(e)) return i * parseInt(e.substring(2), 16)
  33576. if (t.NUMBER_OCT.test(e)) return i * parseInt(e.substring(1), 8)
  33577. if ('inf' === e) return i * (1 / 0)
  33578. if ('nan' === e) return NaN
  33579. if (t.NUMBER_FLT.test(e)) return i * parseFloat(e)
  33580. throw Error('illegal number value: ' + (i < 0 ? '-' : '') + e)
  33581. }
  33582. function r(e, t, i) {
  33583. 'undefined' == typeof e[t] ? (e[t] = i) : (Array.isArray(e[t]) || (e[t] = [e[t]]), e[t].push(i))
  33584. }
  33585. var o = {},
  33586. a = function (e) {
  33587. ;(this.source = e + ''), (this.index = 0), (this.line = 1), (this.stack = []), (this._stringOpen = null)
  33588. },
  33589. s = a.prototype
  33590. ;(s._readString = function () {
  33591. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ
  33592. e.lastIndex = this.index - 1
  33593. var i = e.exec(this.source)
  33594. if (!i) throw Error('unterminated string')
  33595. return (this.index = e.lastIndex), this.stack.push(this._stringOpen), (this._stringOpen = null), i[1]
  33596. }),
  33597. (s.next = function () {
  33598. if (this.stack.length > 0) return this.stack.shift()
  33599. if (this.index >= this.source.length) return null
  33600. if (null !== this._stringOpen) return this._readString()
  33601. var e, i, n
  33602. do {
  33603. for (e = !1; t.WHITESPACE.test((n = this.source.charAt(this.index))); ) if (('\n' === n && ++this.line, ++this.index === this.source.length)) return null
  33604. if ('/' === this.source.charAt(this.index))
  33605. if ((++this.index, '/' === this.source.charAt(this.index))) {
  33606. for (; '\n' !== this.source.charAt(++this.index); ) if (this.index == this.source.length) return null
  33607. ++this.index, ++this.line, (e = !0)
  33608. } else {
  33609. if ('*' !== (n = this.source.charAt(this.index))) return '/'
  33610. do {
  33611. if (('\n' === n && ++this.line, ++this.index === this.source.length)) return null
  33612. ;(i = n), (n = this.source.charAt(this.index))
  33613. } while ('*' !== i || '/' !== n)
  33614. ++this.index, (e = !0)
  33615. }
  33616. } while (e)
  33617. if (this.index === this.source.length) return null
  33618. var r = this.index
  33619. t.DELIM.lastIndex = 0
  33620. var o = t.DELIM.test(this.source.charAt(r++))
  33621. if (!o) for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); ) ++r
  33622. var a = this.source.substring(this.index, (this.index = r))
  33623. return ('"' !== a && "'" !== a) || (this._stringOpen = a), a
  33624. }),
  33625. (s.peek = function () {
  33626. if (0 === this.stack.length) {
  33627. var e = this.next()
  33628. if (null === e) return null
  33629. this.stack.push(e)
  33630. }
  33631. return this.stack[0]
  33632. }),
  33633. (s.skip = function (e) {
  33634. var t = this.next()
  33635. if (t !== e) throw Error("illegal '" + t + "', '" + e + "' expected")
  33636. }),
  33637. (s.omit = function (e) {
  33638. return this.peek() === e && (this.next(), !0)
  33639. }),
  33640. (s.toString = function () {
  33641. return 'Tokenizer (' + this.index + '/' + this.source.length + ' at line ' + this.line + ')'
  33642. }),
  33643. (o.Tokenizer = a)
  33644. var l = function (e) {
  33645. ;(this.tn = new a(e)), (this.proto3 = !1)
  33646. },
  33647. c = l.prototype
  33648. return (
  33649. (c.parse = function () {
  33650. var e,
  33651. i,
  33652. n = {
  33653. name: '[ROOT]',
  33654. package: null,
  33655. messages: [],
  33656. enums: [],
  33657. imports: [],
  33658. options: {},
  33659. services: []
  33660. },
  33661. r = !0
  33662. try {
  33663. for (; (e = this.tn.next()); )
  33664. switch (e) {
  33665. case 'package':
  33666. if (!r || null !== n.package) throw Error("unexpected 'package'")
  33667. if (((e = this.tn.next()), !t.TYPEREF.test(e))) throw Error('illegal package name: ' + e)
  33668. this.tn.skip(';'), (n.package = e)
  33669. break
  33670. case 'import':
  33671. if (!r) throw Error("unexpected 'import'")
  33672. ;(e = this.tn.peek()), ('public' === e || (i = 'weak' === e)) && this.tn.next(), (e = this._readString()), this.tn.skip(';'), i || n.imports.push(e)
  33673. break
  33674. case 'syntax':
  33675. if (!r) throw Error("unexpected 'syntax'")
  33676. this.tn.skip('='), 'proto3' === (n.syntax = this._readString()) && (this.proto3 = !0), this.tn.skip(';')
  33677. break
  33678. case 'message':
  33679. this._parseMessage(n, null), (r = !1)
  33680. break
  33681. case 'enum':
  33682. this._parseEnum(n), (r = !1)
  33683. break
  33684. case 'option':
  33685. this._parseOption(n)
  33686. break
  33687. case 'service':
  33688. this._parseService(n)
  33689. break
  33690. case 'extend':
  33691. this._parseExtend(n)
  33692. break
  33693. default:
  33694. throw Error("unexpected '" + e + "'")
  33695. }
  33696. } catch (e) {
  33697. throw ((e.message = 'Parse error at line ' + this.tn.line + ': ' + e.message), e)
  33698. }
  33699. return delete n.name, n
  33700. }),
  33701. (l.parse = function (e) {
  33702. return new l(e).parse()
  33703. }),
  33704. (c._readString = function () {
  33705. var e,
  33706. t,
  33707. i = ''
  33708. do {
  33709. if (((t = this.tn.next()), "'" !== t && '"' !== t)) throw Error('illegal string delimiter: ' + t)
  33710. ;(i += this.tn.next()), this.tn.skip(t), (e = this.tn.peek())
  33711. } while ('"' === e || '"' === e)
  33712. return i
  33713. }),
  33714. (c._readValue = function (e) {
  33715. var i = this.tn.peek()
  33716. if ('"' === i || "'" === i) return this._readString()
  33717. if ((this.tn.next(), t.NUMBER.test(i))) return n(i)
  33718. if (t.BOOL.test(i)) return 'true' === i.toLowerCase()
  33719. if (e && t.TYPEREF.test(i)) return i
  33720. throw Error('illegal value: ' + i)
  33721. }),
  33722. (c._parseOption = function (e, i) {
  33723. var n = this.tn.next(),
  33724. r = !1
  33725. if (('(' === n && ((r = !0), (n = this.tn.next())), !t.TYPEREF.test(n))) throw Error('illegal option name: ' + n)
  33726. var o = n
  33727. r && (this.tn.skip(')'), (o = '(' + o + ')'), (n = this.tn.peek()), t.FQTYPEREF.test(n) && ((o += n), this.tn.next())),
  33728. this.tn.skip('='),
  33729. this._parseOptionValue(e, o),
  33730. i || this.tn.skip(';')
  33731. }),
  33732. (c._parseOptionValue = function (e, i) {
  33733. var n = this.tn.peek()
  33734. if ('{' !== n) r(e.options, i, this._readValue(!0))
  33735. else
  33736. for (this.tn.skip('{'); '}' !== (n = this.tn.next()); ) {
  33737. if (!t.NAME.test(n)) throw Error('illegal option name: ' + i + '.' + n)
  33738. this.tn.omit(':') ? r(e.options, i + '.' + n, this._readValue(!0)) : this._parseOptionValue(e, i + '.' + n)
  33739. }
  33740. }),
  33741. (c._parseService = function (e) {
  33742. var i = this.tn.next()
  33743. if (!t.NAME.test(i)) throw Error('illegal service name at line ' + this.tn.line + ': ' + i)
  33744. var n = i,
  33745. r = {
  33746. name: n,
  33747. rpc: {},
  33748. options: {}
  33749. }
  33750. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  33751. if ('option' === i) this._parseOption(r)
  33752. else {
  33753. if ('rpc' !== i) throw Error('illegal service token: ' + i)
  33754. this._parseServiceRPC(r)
  33755. }
  33756. this.tn.omit(';'), e.services.push(r)
  33757. }),
  33758. (c._parseServiceRPC = function (e) {
  33759. var i = 'rpc',
  33760. n = this.tn.next()
  33761. if (!t.NAME.test(n)) throw Error('illegal rpc service method name: ' + n)
  33762. var r = n,
  33763. o = {
  33764. request: null,
  33765. response: null,
  33766. request_stream: !1,
  33767. response_stream: !1,
  33768. options: {}
  33769. }
  33770. if ((this.tn.skip('('), (n = this.tn.next()), 'stream' === n.toLowerCase() && ((o.request_stream = !0), (n = this.tn.next())), !t.TYPEREF.test(n)))
  33771. throw Error('illegal rpc service request type: ' + n)
  33772. if (((o.request = n), this.tn.skip(')'), (n = this.tn.next()), 'returns' !== n.toLowerCase())) throw Error('illegal rpc service request type delimiter: ' + n)
  33773. if (
  33774. (this.tn.skip('('),
  33775. (n = this.tn.next()),
  33776. 'stream' === n.toLowerCase() && ((o.response_stream = !0), (n = this.tn.next())),
  33777. (o.response = n),
  33778. this.tn.skip(')'),
  33779. (n = this.tn.peek()),
  33780. '{' === n)
  33781. ) {
  33782. for (this.tn.next(); '}' !== (n = this.tn.next()); ) {
  33783. if ('option' !== n) throw Error('illegal rpc service token: ' + n)
  33784. this._parseOption(o)
  33785. }
  33786. this.tn.omit(';')
  33787. } else this.tn.skip(';')
  33788. 'undefined' == typeof e[i] && (e[i] = {}), (e[i][r] = o)
  33789. }),
  33790. (c._parseMessage = function (e, n) {
  33791. var r = !!n,
  33792. o = this.tn.next(),
  33793. a = {
  33794. name: '',
  33795. fields: [],
  33796. enums: [],
  33797. messages: [],
  33798. options: {},
  33799. services: [],
  33800. oneofs: {}
  33801. }
  33802. if (!t.NAME.test(o)) throw Error('illegal ' + (r ? 'group' : 'message') + ' name: ' + o)
  33803. for (
  33804. a.name = o, r && (this.tn.skip('='), (n.id = i(this.tn.next())), (a.isGroup = !0)), o = this.tn.peek(), '[' === o && n && this._parseFieldOptions(n), this.tn.skip('{');
  33805. '}' !== (o = this.tn.next());
  33806. )
  33807. if (t.RULE.test(o)) this._parseMessageField(a, o)
  33808. else if ('oneof' === o) this._parseMessageOneOf(a)
  33809. else if ('enum' === o) this._parseEnum(a)
  33810. else if ('message' === o) this._parseMessage(a)
  33811. else if ('option' === o) this._parseOption(a)
  33812. else if ('service' === o) this._parseService(a)
  33813. else if ('extensions' === o) a.extensions = this._parseExtensionRanges()
  33814. else if ('reserved' === o) this._parseIgnored()
  33815. else if ('extend' === o) this._parseExtend(a)
  33816. else {
  33817. if (!t.TYPEREF.test(o)) throw Error('illegal message token: ' + o)
  33818. if (!this.proto3) throw Error('illegal field rule: ' + o)
  33819. this._parseMessageField(a, 'optional', o)
  33820. }
  33821. return this.tn.omit(';'), e.messages.push(a), a
  33822. }),
  33823. (c._parseIgnored = function () {
  33824. for (; ';' !== this.tn.peek(); ) this.tn.next()
  33825. this.tn.skip(';')
  33826. }),
  33827. (c._parseMessageField = function (e, n, r) {
  33828. if (!t.RULE.test(n)) throw Error('illegal message field rule: ' + n)
  33829. var o,
  33830. a = {
  33831. rule: n,
  33832. type: '',
  33833. name: '',
  33834. options: {},
  33835. id: 0
  33836. }
  33837. if ('map' === n) {
  33838. if (r) throw Error('illegal type: ' + r)
  33839. if ((this.tn.skip('<'), (o = this.tn.next()), !t.TYPE.test(o) && !t.TYPEREF.test(o))) throw Error('illegal message field type: ' + o)
  33840. if (((a.keytype = o), this.tn.skip(','), (o = this.tn.next()), !t.TYPE.test(o) && !t.TYPEREF.test(o))) throw Error('illegal message field: ' + o)
  33841. if (((a.type = o), this.tn.skip('>'), (o = this.tn.next()), !t.NAME.test(o))) throw Error('illegal message field name: ' + o)
  33842. ;(a.name = o), this.tn.skip('='), (a.id = i(this.tn.next())), (o = this.tn.peek()), '[' === o && this._parseFieldOptions(a), this.tn.skip(';')
  33843. } else if (((r = 'undefined' != typeof r ? r : this.tn.next()), 'group' === r)) {
  33844. var s = this._parseMessage(e, a)
  33845. if (!/^[A-Z]/.test(s.name)) throw Error('illegal group name: ' + s.name)
  33846. ;(a.type = s.name), (a.name = s.name.toLowerCase()), this.tn.omit(';')
  33847. } else {
  33848. if (!t.TYPE.test(r) && !t.TYPEREF.test(r)) throw Error('illegal message field type: ' + r)
  33849. if (((a.type = r), (o = this.tn.next()), !t.NAME.test(o))) throw Error('illegal message field name: ' + o)
  33850. ;(a.name = o), this.tn.skip('='), (a.id = i(this.tn.next())), (o = this.tn.peek()), '[' === o && this._parseFieldOptions(a), this.tn.skip(';')
  33851. }
  33852. return e.fields.push(a), a
  33853. }),
  33854. (c._parseMessageOneOf = function (e) {
  33855. var i = this.tn.next()
  33856. if (!t.NAME.test(i)) throw Error('illegal oneof name: ' + i)
  33857. var n,
  33858. r = i,
  33859. o = []
  33860. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); ) (n = this._parseMessageField(e, 'optional', i)), (n.oneof = r), o.push(n.id)
  33861. this.tn.omit(';'), (e.oneofs[r] = o)
  33862. }),
  33863. (c._parseFieldOptions = function (e) {
  33864. this.tn.skip('[')
  33865. for (var t, i = !0; ']' !== (t = this.tn.peek()); ) i || this.tn.skip(','), this._parseOption(e, !0), (i = !1)
  33866. this.tn.next()
  33867. }),
  33868. (c._parseEnum = function (e) {
  33869. var n = {
  33870. name: '',
  33871. values: [],
  33872. options: {}
  33873. },
  33874. r = this.tn.next()
  33875. if (!t.NAME.test(r)) throw Error('illegal name: ' + r)
  33876. for (n.name = r, this.tn.skip('{'); '}' !== (r = this.tn.next()); )
  33877. if ('option' === r) this._parseOption(n)
  33878. else {
  33879. if (!t.NAME.test(r)) throw Error('illegal name: ' + r)
  33880. this.tn.skip('=')
  33881. var o = {
  33882. name: r,
  33883. id: i(this.tn.next(), !0)
  33884. }
  33885. ;(r = this.tn.peek()),
  33886. '[' === r &&
  33887. this._parseFieldOptions({
  33888. options: {}
  33889. }),
  33890. this.tn.skip(';'),
  33891. n.values.push(o)
  33892. }
  33893. this.tn.omit(';'), e.enums.push(n)
  33894. }),
  33895. (c._parseExtensionRanges = function () {
  33896. var t,
  33897. i,
  33898. r,
  33899. o = []
  33900. do {
  33901. for (i = []; ; ) {
  33902. switch ((t = this.tn.next())) {
  33903. case 'min':
  33904. r = e.ID_MIN
  33905. break
  33906. case 'max':
  33907. r = e.ID_MAX
  33908. break
  33909. default:
  33910. r = n(t)
  33911. }
  33912. if ((i.push(r), 2 === i.length)) break
  33913. if ('to' !== this.tn.peek()) {
  33914. i.push(r)
  33915. break
  33916. }
  33917. this.tn.next()
  33918. }
  33919. o.push(i)
  33920. } while (this.tn.omit(','))
  33921. return this.tn.skip(';'), o
  33922. }),
  33923. (c._parseExtend = function (e) {
  33924. var i = this.tn.next()
  33925. if (!t.TYPEREF.test(i)) throw Error('illegal extend reference: ' + i)
  33926. var n = {
  33927. ref: i,
  33928. fields: []
  33929. }
  33930. for (this.tn.skip('{'); '}' !== (i = this.tn.next()); )
  33931. if (t.RULE.test(i)) this._parseMessageField(n, i)
  33932. else {
  33933. if (!t.TYPEREF.test(i)) throw Error('illegal extend token: ' + i)
  33934. if (!this.proto3) throw Error('illegal field rule: ' + i)
  33935. this._parseMessageField(n, 'optional', i)
  33936. }
  33937. return this.tn.omit(';'), e.messages.push(n), n
  33938. }),
  33939. (c.toString = function () {
  33940. return 'Parser at line ' + this.tn.line
  33941. }),
  33942. (o.Parser = l),
  33943. o
  33944. )
  33945. })(r, r.Lang)),
  33946. (r.Reflect = (function (e) {
  33947. function i(i) {
  33948. if (('string' == typeof i && (i = e.TYPES[i]), 'undefined' == typeof i.defaultValue)) throw Error('default value for type ' + i.name + ' is not supported')
  33949. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  33950. }
  33951. function n(t, i) {
  33952. if (t && 'number' == typeof t.low && 'number' == typeof t.high && 'boolean' == typeof t.unsigned && t.low === t.low && t.high === t.high)
  33953. return new e.Long(t.low, t.high, 'undefined' == typeof i ? t.unsigned : i)
  33954. if ('string' == typeof t) return e.Long.fromString(t, i || !1, 10)
  33955. if ('number' == typeof t) return e.Long.fromNumber(t, i || !1)
  33956. throw Error('not convertible to Long')
  33957. }
  33958. function r(t, i) {
  33959. var n = i.readVarint32(),
  33960. o = 7 & n,
  33961. a = n >>> 3
  33962. switch (o) {
  33963. case e.WIRE_TYPES.VARINT:
  33964. do n = i.readUint8()
  33965. while (128 === (128 & n))
  33966. break
  33967. case e.WIRE_TYPES.BITS64:
  33968. i.offset += 8
  33969. break
  33970. case e.WIRE_TYPES.LDELIM:
  33971. ;(n = i.readVarint32()), (i.offset += n)
  33972. break
  33973. case e.WIRE_TYPES.STARTGROUP:
  33974. r(a, i)
  33975. break
  33976. case e.WIRE_TYPES.ENDGROUP:
  33977. if (a === t) return !1
  33978. throw Error('Illegal GROUPEND after unknown group: ' + a + ' (' + t + ' expected)')
  33979. case e.WIRE_TYPES.BITS32:
  33980. i.offset += 4
  33981. break
  33982. default:
  33983. throw Error('Illegal wire type in unknown group ' + t + ': ' + o)
  33984. }
  33985. return !0
  33986. }
  33987. var o = {},
  33988. a = function (e, t, i) {
  33989. ;(this.builder = e), (this.parent = t), (this.name = i), this.className
  33990. },
  33991. s = a.prototype
  33992. ;(s.fqn = function () {
  33993. for (var e = this.name, t = this; ; ) {
  33994. if (((t = t.parent), null == t)) break
  33995. e = t.name + '.' + e
  33996. }
  33997. return e
  33998. }),
  33999. (s.toString = function (e) {
  34000. return (e ? this.className + ' ' : '') + this.fqn()
  34001. }),
  34002. (s.build = function () {
  34003. throw Error(this.toString(!0) + ' cannot be built directly')
  34004. }),
  34005. (o.T = a)
  34006. var l = function (e, t, i, n, r) {
  34007. a.call(this, e, t, i), (this.className = 'Namespace'), (this.children = []), (this.options = n || {}), (this.syntax = r || 'proto2')
  34008. },
  34009. c = (l.prototype = Object.create(a.prototype))
  34010. ;(c.getChildren = function (e) {
  34011. if (((e = e || null), null == e)) return this.children.slice()
  34012. for (var t = [], i = 0, n = this.children.length; i < n; ++i) this.children[i] instanceof e && t.push(this.children[i])
  34013. return t
  34014. }),
  34015. (c.addChild = function (e) {
  34016. var t
  34017. if ((t = this.getChild(e.name)))
  34018. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName)) t.name = t.originalName
  34019. else {
  34020. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  34021. throw Error('Duplicate name in namespace ' + this.toString(!0) + ': ' + e.name)
  34022. e.name = e.originalName
  34023. }
  34024. this.children.push(e)
  34025. }),
  34026. (c.getChild = function (e) {
  34027. for (var t = 'number' == typeof e ? 'id' : 'name', i = 0, n = this.children.length; i < n; ++i) if (this.children[i][t] === e) return this.children[i]
  34028. return null
  34029. }),
  34030. (c.resolve = function (e, t) {
  34031. var i = 'string' == typeof e ? e.split('.') : e,
  34032. n = this,
  34033. r = 0
  34034. if ('' === i[r]) {
  34035. for (; null !== n.parent; ) n = n.parent
  34036. r++
  34037. }
  34038. var a
  34039. do {
  34040. do {
  34041. if (!(n instanceof o.Namespace)) {
  34042. n = null
  34043. break
  34044. }
  34045. if (((a = n.getChild(i[r])), !a || !(a instanceof o.T) || (t && !(a instanceof o.Namespace)))) {
  34046. n = null
  34047. break
  34048. }
  34049. ;(n = a), r++
  34050. } while (r < i.length)
  34051. if (null != n) break
  34052. if (null !== this.parent) return this.parent.resolve(e, t)
  34053. } while (null != n)
  34054. return n
  34055. }),
  34056. (c.qn = function (e) {
  34057. var t = [],
  34058. i = e
  34059. do t.unshift(i.name), (i = i.parent)
  34060. while (null !== i)
  34061. for (var n = 1; n <= t.length; n++) {
  34062. var r = t.slice(t.length - n)
  34063. if (e === this.resolve(r, e instanceof o.Namespace)) return r.join('.')
  34064. }
  34065. return e.fqn()
  34066. }),
  34067. (c.build = function () {
  34068. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n) (e = i[n]), e instanceof l && (t[e.name] = e.build())
  34069. return (
  34070. Object.defineProperty &&
  34071. Object.defineProperty(t, '$options', {
  34072. value: this.buildOpt()
  34073. }),
  34074. t
  34075. )
  34076. }),
  34077. (c.buildOpt = function () {
  34078. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  34079. var r = t[i],
  34080. o = this.options[t[i]]
  34081. e[r] = o
  34082. }
  34083. return e
  34084. }),
  34085. (c.getOption = function (e) {
  34086. return 'undefined' == typeof e ? this.options : 'undefined' != typeof this.options[e] ? this.options[e] : null
  34087. }),
  34088. (o.Namespace = l)
  34089. var h = function (t, i, n, r) {
  34090. if (((this.type = t), (this.resolvedType = i), (this.isMapKey = n), (this.syntax = r), n && e.MAP_KEY_TYPES.indexOf(t) < 0)) throw Error('Invalid map key type: ' + t.name)
  34091. },
  34092. u = h.prototype
  34093. ;(h.defaultFieldValue = i),
  34094. (u.verifyValue = function (i) {
  34095. function r(e, t) {
  34096. throw Error('Illegal value for ' + o.toString(!0) + ' of type ' + o.type.name + ': ' + e + ' (' + t + ')')
  34097. }
  34098. var o = this
  34099. switch (this.type) {
  34100. case e.TYPES.int32:
  34101. case e.TYPES.sint32:
  34102. case e.TYPES.sfixed32:
  34103. return ('number' != typeof i || (i === i && i % 1 !== 0)) && r(typeof i, 'not an integer'), i > 4294967295 ? 0 | i : i
  34104. case e.TYPES.uint32:
  34105. case e.TYPES.fixed32:
  34106. return ('number' != typeof i || (i === i && i % 1 !== 0)) && r(typeof i, 'not an integer'), i < 0 ? i >>> 0 : i
  34107. case e.TYPES.int64:
  34108. case e.TYPES.sint64:
  34109. case e.TYPES.sfixed64:
  34110. if (e.Long)
  34111. try {
  34112. return n(i, !1)
  34113. } catch (e) {
  34114. r(typeof i, e.message)
  34115. }
  34116. else r(typeof i, 'requires Long.js')
  34117. case e.TYPES.uint64:
  34118. case e.TYPES.fixed64:
  34119. if (e.Long)
  34120. try {
  34121. return n(i, !0)
  34122. } catch (e) {
  34123. r(typeof i, e.message)
  34124. }
  34125. else r(typeof i, 'requires Long.js')
  34126. case e.TYPES.bool:
  34127. return 'boolean' != typeof i && r(typeof i, 'not a boolean'), i
  34128. case e.TYPES.float:
  34129. case e.TYPES.double:
  34130. return 'number' != typeof i && r(typeof i, 'not a number'), i
  34131. case e.TYPES.string:
  34132. return 'string' == typeof i || (i && i instanceof String) || r(typeof i, 'not a string'), '' + i
  34133. case e.TYPES.bytes:
  34134. return t.isByteBuffer(i) ? i : t.wrap(i, 'base64')
  34135. case e.TYPES.enum:
  34136. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value)
  34137. for (l = 0; l < a.length; l++) {
  34138. if (a[l].name == i) return a[l].id
  34139. if (a[l].id == i) return a[l].id
  34140. }
  34141. if ('proto3' === this.syntax)
  34142. return ('number' != typeof i || (i === i && i % 1 !== 0)) && r(typeof i, 'not an integer'), (i > 4294967295 || i < 0) && r(typeof i, 'not in range for uint32'), i
  34143. r(i, 'not a valid enum value')
  34144. case e.TYPES.group:
  34145. case e.TYPES.message:
  34146. if (((i && 'object' == typeof i) || r(typeof i, 'object expected'), i instanceof this.resolvedType.clazz)) return i
  34147. if (i instanceof e.Builder.Message) {
  34148. var s = {}
  34149. for (var l in i) i.hasOwnProperty(l) && (s[l] = i[l])
  34150. i = s
  34151. }
  34152. return new this.resolvedType.clazz(i)
  34153. }
  34154. throw Error('[INTERNAL] Illegal value for ' + this.toString(!0) + ': ' + i + ' (undefined type ' + this.type + ')')
  34155. }),
  34156. (u.calculateLength = function (i, n) {
  34157. if (null === n) return 0
  34158. var r
  34159. switch (this.type) {
  34160. case e.TYPES.int32:
  34161. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n)
  34162. case e.TYPES.uint32:
  34163. return t.calculateVarint32(n)
  34164. case e.TYPES.sint32:
  34165. return t.calculateVarint32(t.zigZagEncode32(n))
  34166. case e.TYPES.fixed32:
  34167. case e.TYPES.sfixed32:
  34168. case e.TYPES.float:
  34169. return 4
  34170. case e.TYPES.int64:
  34171. case e.TYPES.uint64:
  34172. return t.calculateVarint64(n)
  34173. case e.TYPES.sint64:
  34174. return t.calculateVarint64(t.zigZagEncode64(n))
  34175. case e.TYPES.fixed64:
  34176. case e.TYPES.sfixed64:
  34177. return 8
  34178. case e.TYPES.bool:
  34179. return 1
  34180. case e.TYPES.enum:
  34181. return t.calculateVarint32(n)
  34182. case e.TYPES.double:
  34183. return 8
  34184. case e.TYPES.string:
  34185. return (r = t.calculateUTF8Bytes(n)), t.calculateVarint32(r) + r
  34186. case e.TYPES.bytes:
  34187. if (n.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + n.remaining() + ' bytes remaining')
  34188. return t.calculateVarint32(n.remaining()) + n.remaining()
  34189. case e.TYPES.message:
  34190. return (r = this.resolvedType.calculate(n)), t.calculateVarint32(r) + r
  34191. case e.TYPES.group:
  34192. return (r = this.resolvedType.calculate(n)), r + t.calculateVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  34193. }
  34194. throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + n + ' (unknown type)')
  34195. }),
  34196. (u.encodeValue = function (i, n, r) {
  34197. if (null === n) return r
  34198. switch (this.type) {
  34199. case e.TYPES.int32:
  34200. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n)
  34201. break
  34202. case e.TYPES.uint32:
  34203. r.writeVarint32(n)
  34204. break
  34205. case e.TYPES.sint32:
  34206. r.writeVarint32ZigZag(n)
  34207. break
  34208. case e.TYPES.fixed32:
  34209. r.writeUint32(n)
  34210. break
  34211. case e.TYPES.sfixed32:
  34212. r.writeInt32(n)
  34213. break
  34214. case e.TYPES.int64:
  34215. case e.TYPES.uint64:
  34216. r.writeVarint64(n)
  34217. break
  34218. case e.TYPES.sint64:
  34219. r.writeVarint64ZigZag(n)
  34220. break
  34221. case e.TYPES.fixed64:
  34222. r.writeUint64(n)
  34223. break
  34224. case e.TYPES.sfixed64:
  34225. r.writeInt64(n)
  34226. break
  34227. case e.TYPES.bool:
  34228. 'string' == typeof n ? r.writeVarint32('false' === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0)
  34229. break
  34230. case e.TYPES.enum:
  34231. r.writeVarint32(n)
  34232. break
  34233. case e.TYPES.float:
  34234. r.writeFloat32(n)
  34235. break
  34236. case e.TYPES.double:
  34237. r.writeFloat64(n)
  34238. break
  34239. case e.TYPES.string:
  34240. r.writeVString(n)
  34241. break
  34242. case e.TYPES.bytes:
  34243. if (n.remaining() < 0) throw Error('Illegal value for ' + this.toString(!0) + ': ' + n.remaining() + ' bytes remaining')
  34244. var o = n.offset
  34245. r.writeVarint32(n.remaining()), r.append(n), (n.offset = o)
  34246. break
  34247. case e.TYPES.message:
  34248. var a = new t().LE()
  34249. this.resolvedType.encode(n, a), r.writeVarint32(a.offset), r.append(a.flip())
  34250. break
  34251. case e.TYPES.group:
  34252. this.resolvedType.encode(n, r), r.writeVarint32((i << 3) | e.WIRE_TYPES.ENDGROUP)
  34253. break
  34254. default:
  34255. throw Error('[INTERNAL] Illegal value to encode in ' + this.toString(!0) + ': ' + n + ' (unknown type)')
  34256. }
  34257. return r
  34258. }),
  34259. (u.decode = function (t, i, n) {
  34260. if (i != this.type.wireType) throw Error('Unexpected wire type for element')
  34261. var r, o
  34262. switch (this.type) {
  34263. case e.TYPES.int32:
  34264. return 0 | t.readVarint32()
  34265. case e.TYPES.uint32:
  34266. return t.readVarint32() >>> 0
  34267. case e.TYPES.sint32:
  34268. return 0 | t.readVarint32ZigZag()
  34269. case e.TYPES.fixed32:
  34270. return t.readUint32() >>> 0
  34271. case e.TYPES.sfixed32:
  34272. return 0 | t.readInt32()
  34273. case e.TYPES.int64:
  34274. return t.readVarint64()
  34275. case e.TYPES.uint64:
  34276. return t.readVarint64().toUnsigned()
  34277. case e.TYPES.sint64:
  34278. return t.readVarint64ZigZag()
  34279. case e.TYPES.fixed64:
  34280. return t.readUint64()
  34281. case e.TYPES.sfixed64:
  34282. return t.readInt64()
  34283. case e.TYPES.bool:
  34284. return !!t.readVarint32()
  34285. case e.TYPES.enum:
  34286. return t.readVarint32()
  34287. case e.TYPES.float:
  34288. return t.readFloat()
  34289. case e.TYPES.double:
  34290. return t.readDouble()
  34291. case e.TYPES.string:
  34292. return t.readVString()
  34293. case e.TYPES.bytes:
  34294. if (((o = t.readVarint32()), t.remaining() < o)) throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + o + ' required but got only ' + t.remaining())
  34295. return (r = t.clone()), (r.limit = r.offset + o), (t.offset += o), r
  34296. case e.TYPES.message:
  34297. return (o = t.readVarint32()), this.resolvedType.decode(t, o)
  34298. case e.TYPES.group:
  34299. return this.resolvedType.decode(t, -1, n)
  34300. }
  34301. throw Error('[INTERNAL] Illegal decode type')
  34302. }),
  34303. (u.valueFromString = function (i) {
  34304. if (!this.isMapKey) throw Error('valueFromString() called on non-map-key element')
  34305. switch (this.type) {
  34306. case e.TYPES.int32:
  34307. case e.TYPES.sint32:
  34308. case e.TYPES.sfixed32:
  34309. case e.TYPES.uint32:
  34310. case e.TYPES.fixed32:
  34311. return this.verifyValue(parseInt(i))
  34312. case e.TYPES.int64:
  34313. case e.TYPES.sint64:
  34314. case e.TYPES.sfixed64:
  34315. case e.TYPES.uint64:
  34316. case e.TYPES.fixed64:
  34317. return this.verifyValue(i)
  34318. case e.TYPES.bool:
  34319. return 'true' === i
  34320. case e.TYPES.string:
  34321. return this.verifyValue(i)
  34322. case e.TYPES.bytes:
  34323. return t.fromBinary(i)
  34324. }
  34325. }),
  34326. (u.valueToString = function (t) {
  34327. if (!this.isMapKey) throw Error('valueToString() called on non-map-key element')
  34328. return this.type === e.TYPES.bytes ? t.toString('binary') : t.toString()
  34329. }),
  34330. (o.Element = h)
  34331. var d = function (e, t, i, n, r, o) {
  34332. l.call(this, e, t, i, n, o),
  34333. (this.className = 'Message'),
  34334. (this.extensions = void 0),
  34335. (this.clazz = null),
  34336. (this.isGroup = !!r),
  34337. (this._fields = null),
  34338. (this._fieldsById = null),
  34339. (this._fieldsByName = null)
  34340. },
  34341. p = (d.prototype = Object.create(l.prototype))
  34342. ;(p.build = function (i) {
  34343. if (this.clazz && !i) return this.clazz
  34344. var n = (function (e, i) {
  34345. function n(i, r, o, a) {
  34346. if (null === i || 'object' != typeof i) {
  34347. if (a && a instanceof e.Reflect.Enum) {
  34348. var s = e.Reflect.Enum.getName(a.object, i)
  34349. if (null !== s) return s
  34350. }
  34351. return i
  34352. }
  34353. if (t.isByteBuffer(i)) return r ? i.toBase64() : i.toBuffer()
  34354. if (e.Long.isLong(i)) return o ? i.toString() : e.Long.fromValue(i)
  34355. var l
  34356. if (Array.isArray(i))
  34357. return (
  34358. (l = []),
  34359. i.forEach(function (e, t) {
  34360. l[t] = n(e, r, o, a)
  34361. }),
  34362. l
  34363. )
  34364. if (((l = {}), i instanceof e.Map)) {
  34365. for (var c = i.entries(), h = c.next(); !h.done; h = c.next()) l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType)
  34366. return l
  34367. }
  34368. var u = i.$type,
  34369. d = void 0
  34370. for (var p in i) i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? (l[p] = n(i[p], r, o, d.resolvedType)) : (l[p] = n(i[p], r, o)))
  34371. return l
  34372. }
  34373. var r = i.getChildren(e.Reflect.Message.Field),
  34374. o = i.getChildren(e.Reflect.Message.OneOf),
  34375. a = function (n, s) {
  34376. e.Builder.Message.call(this)
  34377. for (var l = 0, c = o.length; l < c; ++l) this[o[l].name] = null
  34378. for (l = 0, c = r.length; l < c; ++l) {
  34379. var h = r[l]
  34380. ;(this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null), (!h.required && 'proto3' !== i.syntax) || null === h.defaultValue || (this[h.name] = h.defaultValue)
  34381. }
  34382. if (arguments.length > 0) {
  34383. var u
  34384. if (
  34385. 1 !== arguments.length ||
  34386. null === n ||
  34387. 'object' != typeof n ||
  34388. !('function' != typeof n.encode || n instanceof a) ||
  34389. Array.isArray(n) ||
  34390. n instanceof e.Map ||
  34391. t.isByteBuffer(n) ||
  34392. n instanceof ArrayBuffer ||
  34393. (e.Long && n instanceof e.Long)
  34394. )
  34395. for (l = 0, c = arguments.length; l < c; ++l) 'undefined' != typeof (u = arguments[l]) && this.$set(r[l].name, u)
  34396. else this.$set(n)
  34397. }
  34398. },
  34399. s = (a.prototype = Object.create(e.Builder.Message.prototype))
  34400. ;(s.add = function (t, n, r) {
  34401. var o = i._fieldsByName[t]
  34402. if (!r) {
  34403. if (!o) throw Error(this + '#' + t + ' is undefined')
  34404. if (!(o instanceof e.Reflect.Message.Field)) throw Error(this + '#' + t + ' is not a field: ' + o.toString(!0))
  34405. if (!o.repeated) throw Error(this + '#' + t + ' is not a repeated field')
  34406. n = o.verifyValue(n, !0)
  34407. }
  34408. return null === this[t] && (this[t] = []), this[t].push(n), this
  34409. }),
  34410. (s.$add = s.add),
  34411. (s.set = function (t, n, r) {
  34412. if (t && 'object' == typeof t) {
  34413. r = n
  34414. for (var o in t) t.hasOwnProperty(o) && 'undefined' != typeof (n = t[o]) && this.$set(o, n, r)
  34415. return this
  34416. }
  34417. var a = i._fieldsByName[t]
  34418. if (r) this[t] = n
  34419. else {
  34420. if (!a) throw Error(this + '#' + t + ' is not a field: undefined')
  34421. if (!(a instanceof e.Reflect.Message.Field)) throw Error(this + '#' + t + ' is not a field: ' + a.toString(!0))
  34422. this[a.name] = n = a.verifyValue(n)
  34423. }
  34424. if (a && a.oneof) {
  34425. var s = this[a.oneof.name]
  34426. null !== n ? (null !== s && s !== a.name && (this[s] = null), (this[a.oneof.name] = a.name)) : s === t && (this[a.oneof.name] = null)
  34427. }
  34428. return this
  34429. }),
  34430. (s.$set = s.set),
  34431. (s.get = function (t, n) {
  34432. if (n) return this[t]
  34433. var r = i._fieldsByName[t]
  34434. if (!(r && r instanceof e.Reflect.Message.Field)) throw Error(this + '#' + t + ' is not a field: undefined')
  34435. if (!(r instanceof e.Reflect.Message.Field)) throw Error(this + '#' + t + ' is not a field: ' + r.toString(!0))
  34436. return this[r.name]
  34437. }),
  34438. (s.$get = s.get)
  34439. for (var l = 0; l < r.length; l++) {
  34440. var c = r[l]
  34441. c instanceof e.Reflect.Message.ExtensionField ||
  34442. (i.builder.options.populateAccessors &&
  34443. (function (e) {
  34444. var t = e.originalName.replace(/(_[a-zA-Z])/g, function (e) {
  34445. return e.toUpperCase().replace('_', '')
  34446. })
  34447. t = t.substring(0, 1).toUpperCase() + t.substring(1)
  34448. var n = e.originalName.replace(/([A-Z])/g, function (e) {
  34449. return '_' + e
  34450. }),
  34451. r = function (t, i) {
  34452. return (this[e.name] = i ? t : e.verifyValue(t)), this
  34453. },
  34454. o = function () {
  34455. return this[e.name]
  34456. }
  34457. null === i.getChild('set' + t) && (s['set' + t] = r),
  34458. null === i.getChild('set_' + n) && (s['set_' + n] = r),
  34459. null === i.getChild('get' + t) && (s['get' + t] = o),
  34460. null === i.getChild('get_' + n) && (s['get_' + n] = o)
  34461. })(c))
  34462. }
  34463. ;(s.encode = function (e, n) {
  34464. 'boolean' == typeof e && ((n = e), (e = void 0))
  34465. var r = !1
  34466. e || ((e = new t()), (r = !0))
  34467. var o = e.littleEndian
  34468. try {
  34469. return i.encode(this, e.LE(), n), (r ? e.flip() : e).LE(o)
  34470. } catch (t) {
  34471. throw (e.LE(o), t)
  34472. }
  34473. }),
  34474. (a.encode = function (e, t, i) {
  34475. return new a(e).encode(t, i)
  34476. }),
  34477. (s.calculate = function () {
  34478. return i.calculate(this)
  34479. }),
  34480. (s.encodeDelimited = function (e, n) {
  34481. var r = !1
  34482. e || ((e = new t()), (r = !0))
  34483. var o = new t().LE()
  34484. return i.encode(this, o, n).flip(), e.writeVarint32(o.remaining()), e.append(o), r ? e.flip() : e
  34485. }),
  34486. (s.encodeAB = function () {
  34487. try {
  34488. return this.encode().toArrayBuffer()
  34489. } catch (e) {
  34490. throw (e.encoded && (e.encoded = e.encoded.toArrayBuffer()), e)
  34491. }
  34492. }),
  34493. (s.toArrayBuffer = s.encodeAB),
  34494. (s.encodeNB = function () {
  34495. try {
  34496. return this.encode().toBuffer()
  34497. } catch (e) {
  34498. throw (e.encoded && (e.encoded = e.encoded.toBuffer()), e)
  34499. }
  34500. }),
  34501. (s.toBuffer = s.encodeNB),
  34502. (s.encode64 = function () {
  34503. try {
  34504. return this.encode().toBase64()
  34505. } catch (e) {
  34506. throw (e.encoded && (e.encoded = e.encoded.toBase64()), e)
  34507. }
  34508. }),
  34509. (s.toBase64 = s.encode64),
  34510. (s.encodeHex = function () {
  34511. try {
  34512. return this.encode().toHex()
  34513. } catch (e) {
  34514. throw (e.encoded && (e.encoded = e.encoded.toHex()), e)
  34515. }
  34516. }),
  34517. (s.toHex = s.encodeHex),
  34518. (s.toRaw = function (e, t) {
  34519. return n(this, !!e, !!t, this.$type)
  34520. }),
  34521. (s.encodeJSON = function () {
  34522. return JSON.stringify(n(this, !0, !0, this.$type))
  34523. }),
  34524. (a.decode = function (e, n, r) {
  34525. 'string' == typeof n && ((r = n), (n = -1)), 'string' == typeof e && (e = t.wrap(e, r ? r : 'base64')), (e = t.isByteBuffer(e) ? e : t.wrap(e))
  34526. var o = e.littleEndian
  34527. try {
  34528. var a = i.decode(e.LE())
  34529. return e.LE(o), a
  34530. } catch (t) {
  34531. throw (e.LE(o), t)
  34532. }
  34533. }),
  34534. (a.decodeDelimited = function (e, n) {
  34535. if (('string' == typeof e && (e = t.wrap(e, n ? n : 'base64')), (e = t.isByteBuffer(e) ? e : t.wrap(e)), e.remaining() < 1)) return null
  34536. var r = e.offset,
  34537. o = e.readVarint32()
  34538. if (e.remaining() < o) return (e.offset = r), null
  34539. try {
  34540. var a = i.decode(e.slice(e.offset, e.offset + o).LE())
  34541. return (e.offset += o), a
  34542. } catch (t) {
  34543. throw ((e.offset += o), t)
  34544. }
  34545. }),
  34546. (a.decode64 = function (e) {
  34547. return a.decode(e, 'base64')
  34548. }),
  34549. (a.decodeHex = function (e) {
  34550. return a.decode(e, 'hex')
  34551. }),
  34552. (a.decodeJSON = function (e) {
  34553. return new a(JSON.parse(e))
  34554. }),
  34555. (s.toString = function () {
  34556. return i.toString()
  34557. })
  34558. return (
  34559. Object.defineProperty &&
  34560. (Object.defineProperty(a, '$options', {
  34561. value: i.buildOpt()
  34562. }),
  34563. Object.defineProperty(s, '$options', {
  34564. value: a.$options
  34565. }),
  34566. Object.defineProperty(a, '$type', {
  34567. value: i
  34568. }),
  34569. Object.defineProperty(s, '$type', {
  34570. value: i
  34571. })),
  34572. a
  34573. )
  34574. })(e, this)
  34575. ;(this._fields = []), (this._fieldsById = {}), (this._fieldsByName = {})
  34576. for (var r, o = 0, a = this.children.length; o < a; o++)
  34577. if (((r = this.children[o]), r instanceof A || r instanceof d || r instanceof E)) {
  34578. if (n.hasOwnProperty(r.name)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + r.toString(!0) + " cannot override static property '" + r.name + "'")
  34579. n[r.name] = r.build()
  34580. } else if (r instanceof d.Field) r.build(), this._fields.push(r), (this._fieldsById[r.id] = r), (this._fieldsByName[r.name] = r)
  34581. else if (!(r instanceof d.OneOf || r instanceof I)) throw Error('Illegal reflect child of ' + this.toString(!0) + ': ' + this.children[o].toString(!0))
  34582. return (this.clazz = n)
  34583. }),
  34584. (p.encode = function (e, t, i) {
  34585. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  34586. (n = this._fields[a]), (r = e[n.name]), n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e)
  34587. if (null !== o) {
  34588. var l = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + o)
  34589. throw ((l.encoded = t), l)
  34590. }
  34591. return t
  34592. }),
  34593. (p.calculate = function (e) {
  34594. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  34595. if (((t = this._fields[r]), (i = e[t.name]), t.required && null === i)) throw Error('Missing at least one required field for ' + this.toString(!0) + ': ' + t)
  34596. n += t.calculate(i, e)
  34597. }
  34598. return n
  34599. }),
  34600. (p.decode = function (t, i, n) {
  34601. i = 'number' == typeof i ? i : -1
  34602. for (var o, a, s, l, c = t.offset, h = new this.clazz(); t.offset < c + i || (i === -1 && t.remaining() > 0); ) {
  34603. if (((o = t.readVarint32()), (a = 7 & o), (s = o >>> 3), a === e.WIRE_TYPES.ENDGROUP)) {
  34604. if (s !== n) throw Error('Illegal group end indicator for ' + this.toString(!0) + ': ' + s + ' (' + (n ? n + ' expected' : 'not a group') + ')')
  34605. break
  34606. }
  34607. if ((l = this._fieldsById[s])) {
  34608. if (l.repeated && !l.options.packed) h[l.name].push(l.decode(a, t))
  34609. else if (l.map) {
  34610. var u = l.decode(a, t)
  34611. h[l.name].set(u[0], u[1])
  34612. } else if (((h[l.name] = l.decode(a, t)), l.oneof)) {
  34613. var d = h[l.oneof.name]
  34614. null !== d && d !== l.name && (h[d] = null), (h[l.oneof.name] = l.name)
  34615. }
  34616. } else
  34617. switch (a) {
  34618. case e.WIRE_TYPES.VARINT:
  34619. t.readVarint32()
  34620. break
  34621. case e.WIRE_TYPES.BITS32:
  34622. t.offset += 4
  34623. break
  34624. case e.WIRE_TYPES.BITS64:
  34625. t.offset += 8
  34626. break
  34627. case e.WIRE_TYPES.LDELIM:
  34628. var p = t.readVarint32()
  34629. t.offset += p
  34630. break
  34631. case e.WIRE_TYPES.STARTGROUP:
  34632. for (; r(s, t); );
  34633. break
  34634. default:
  34635. throw Error('Illegal wire type for unknown field ' + s + ' in ' + this.toString(!0) + '#decode: ' + a)
  34636. }
  34637. }
  34638. for (var f = 0, g = this._fields.length; f < g; ++f)
  34639. if (((l = this._fields[f]), null === h[l.name]))
  34640. if ('proto3' === this.syntax) h[l.name] = l.defaultValue
  34641. else {
  34642. if (l.required) {
  34643. var m = Error('Missing at least one required field for ' + this.toString(!0) + ': ' + l.name)
  34644. throw ((m.decoded = h), m)
  34645. }
  34646. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  34647. }
  34648. return h
  34649. }),
  34650. (o.Message = d)
  34651. var f = function (t, i, n, r, o, s, l, c, h, u) {
  34652. a.call(this, t, i, s),
  34653. (this.className = 'Message.Field'),
  34654. (this.required = 'required' === n),
  34655. (this.repeated = 'repeated' === n),
  34656. (this.map = 'map' === n),
  34657. (this.keyType = r || null),
  34658. (this.type = o),
  34659. (this.resolvedType = null),
  34660. (this.id = l),
  34661. (this.options = c || {}),
  34662. (this.defaultValue = null),
  34663. (this.oneof = h || null),
  34664. (this.syntax = u || 'proto2'),
  34665. (this.originalName = this.name),
  34666. (this.element = null),
  34667. (this.keyElement = null),
  34668. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  34669. },
  34670. g = (f.prototype = Object.create(a.prototype))
  34671. ;(g.build = function () {
  34672. ;(this.element = new h(this.type, this.resolvedType, !1, this.syntax)),
  34673. this.map && (this.keyElement = new h(this.keyType, void 0, !0, this.syntax)),
  34674. 'proto3' !== this.syntax || this.repeated || this.map
  34675. ? 'undefined' != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default))
  34676. : (this.defaultValue = h.defaultFieldValue(this.type))
  34677. }),
  34678. (g.verifyValue = function (t, i) {
  34679. function n(e, t) {
  34680. throw Error('Illegal value for ' + r.toString(!0) + ' of type ' + r.type.name + ': ' + e + ' (' + t + ')')
  34681. }
  34682. i = i || !1
  34683. var r = this
  34684. if (null === t)
  34685. return (
  34686. this.required && n(typeof t, 'required'), 'proto3' === this.syntax && this.type !== e.TYPES.message && n(typeof t, 'proto3 field without field presence cannot be null'), null
  34687. )
  34688. var o
  34689. if (this.repeated && !i) {
  34690. Array.isArray(t) || (t = [t])
  34691. var a = []
  34692. for (o = 0; o < t.length; o++) a.push(this.element.verifyValue(t[o]))
  34693. return a
  34694. }
  34695. return this.map && !i
  34696. ? t instanceof e.Map
  34697. ? t
  34698. : (t instanceof Object || n(typeof t, 'expected ProtoBuf.Map or raw object for map field'), new e.Map(this, t))
  34699. : (!this.repeated && Array.isArray(t) && n(typeof t, 'no array expected'), this.element.verifyValue(t))
  34700. }),
  34701. (g.hasWirePresence = function (t, i) {
  34702. if ('proto3' !== this.syntax) return null !== t
  34703. if (this.oneof && i[this.oneof.name] === this.name) return !0
  34704. switch (this.type) {
  34705. case e.TYPES.int32:
  34706. case e.TYPES.sint32:
  34707. case e.TYPES.sfixed32:
  34708. case e.TYPES.uint32:
  34709. case e.TYPES.fixed32:
  34710. return 0 !== t
  34711. case e.TYPES.int64:
  34712. case e.TYPES.sint64:
  34713. case e.TYPES.sfixed64:
  34714. case e.TYPES.uint64:
  34715. case e.TYPES.fixed64:
  34716. return 0 !== t.low || 0 !== t.high
  34717. case e.TYPES.bool:
  34718. return t
  34719. case e.TYPES.float:
  34720. case e.TYPES.double:
  34721. return 0 !== t
  34722. case e.TYPES.string:
  34723. return t.length > 0
  34724. case e.TYPES.bytes:
  34725. return t.remaining() > 0
  34726. case e.TYPES.enum:
  34727. return 0 !== t
  34728. case e.TYPES.message:
  34729. return null !== t
  34730. default:
  34731. return !0
  34732. }
  34733. }),
  34734. (g.encode = function (i, n, r) {
  34735. if (null === this.type || 'object' != typeof this.type) throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type)
  34736. if (null === i || (this.repeated && 0 == i.length)) return n
  34737. try {
  34738. if (this.repeated) {
  34739. var o
  34740. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  34741. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM), n.ensureCapacity((n.offset += 1))
  34742. var a = n.offset
  34743. for (o = 0; o < i.length; o++) this.element.encodeValue(this.id, i[o], n)
  34744. var s = n.offset - a,
  34745. l = t.calculateVarint32(s)
  34746. if (l > 1) {
  34747. var c = n.slice(a, n.offset)
  34748. ;(a += l - 1), (n.offset = a), n.append(c)
  34749. }
  34750. n.writeVarint32(s, a - l)
  34751. } else for (o = 0; o < i.length; o++) n.writeVarint32((this.id << 3) | this.type.wireType), this.element.encodeValue(this.id, i[o], n)
  34752. } else
  34753. this.map
  34754. ? i.forEach(function (i, r, o) {
  34755. var a =
  34756. t.calculateVarint32(8 | this.keyType.wireType) +
  34757. this.keyElement.calculateLength(1, r) +
  34758. t.calculateVarint32(16 | this.type.wireType) +
  34759. this.element.calculateLength(2, i)
  34760. n.writeVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM),
  34761. n.writeVarint32(a),
  34762. n.writeVarint32(8 | this.keyType.wireType),
  34763. this.keyElement.encodeValue(1, r, n),
  34764. n.writeVarint32(16 | this.type.wireType),
  34765. this.element.encodeValue(2, i, n)
  34766. }, this)
  34767. : this.hasWirePresence(i, r) && (n.writeVarint32((this.id << 3) | this.type.wireType), this.element.encodeValue(this.id, i, n))
  34768. } catch (e) {
  34769. throw Error('Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')')
  34770. }
  34771. return n
  34772. }),
  34773. (g.calculate = function (i, n) {
  34774. if (((i = this.verifyValue(i)), null === this.type || 'object' != typeof this.type)) throw Error('[INTERNAL] Unresolved type in ' + this.toString(!0) + ': ' + this.type)
  34775. if (null === i || (this.repeated && 0 == i.length)) return 0
  34776. var r = 0
  34777. try {
  34778. if (this.repeated) {
  34779. var o, a
  34780. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  34781. for (r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM), a = 0, o = 0; o < i.length; o++) a += this.element.calculateLength(this.id, i[o])
  34782. ;(r += t.calculateVarint32(a)), (r += a)
  34783. } else for (o = 0; o < i.length; o++) (r += t.calculateVarint32((this.id << 3) | this.type.wireType)), (r += this.element.calculateLength(this.id, i[o]))
  34784. } else
  34785. this.map
  34786. ? i.forEach(function (i, n, o) {
  34787. var a =
  34788. t.calculateVarint32(8 | this.keyType.wireType) +
  34789. this.keyElement.calculateLength(1, n) +
  34790. t.calculateVarint32(16 | this.type.wireType) +
  34791. this.element.calculateLength(2, i)
  34792. ;(r += t.calculateVarint32((this.id << 3) | e.WIRE_TYPES.LDELIM)), (r += t.calculateVarint32(a)), (r += a)
  34793. }, this)
  34794. : this.hasWirePresence(i, n) && ((r += t.calculateVarint32((this.id << 3) | this.type.wireType)), (r += this.element.calculateLength(this.id, i)))
  34795. } catch (e) {
  34796. throw Error('Illegal value for ' + this.toString(!0) + ': ' + i + ' (' + e + ')')
  34797. }
  34798. return r
  34799. }),
  34800. (g.decode = function (t, i, n) {
  34801. var r,
  34802. o,
  34803. 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)
  34804. if (!a) throw Error('Illegal wire type for field ' + this.toString(!0) + ': ' + t + ' (' + this.type.wireType + ' expected)')
  34805. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  34806. ;(o = i.readVarint32()), (o = i.offset + o)
  34807. for (var s = []; i.offset < o; ) s.push(this.decode(this.type.wireType, i, !0))
  34808. return s
  34809. }
  34810. if (this.map) {
  34811. var l = h.defaultFieldValue(this.keyType)
  34812. if (((r = h.defaultFieldValue(this.type)), (o = i.readVarint32()), i.remaining() < o))
  34813. throw Error('Illegal number of bytes for ' + this.toString(!0) + ': ' + o + ' required but got only ' + i.remaining())
  34814. var c = i.clone()
  34815. for (c.limit = c.offset + o, i.offset += o; c.remaining() > 0; ) {
  34816. var u = c.readVarint32()
  34817. t = 7 & u
  34818. var d = u >>> 3
  34819. if (1 === d) l = this.keyElement.decode(c, t, d)
  34820. else {
  34821. if (2 !== d) throw Error('Unexpected tag in map field key/value submessage')
  34822. r = this.element.decode(c, t, d)
  34823. }
  34824. }
  34825. return [l, r]
  34826. }
  34827. return this.element.decode(i, t, this.id)
  34828. }),
  34829. (o.Message.Field = f)
  34830. var m = function (e, t, i, n, r, o, a) {
  34831. f.call(this, e, t, i, null, n, r, o, a), this.extension
  34832. }
  34833. ;(m.prototype = Object.create(f.prototype)), (o.Message.ExtensionField = m)
  34834. var v = function (e, t, i) {
  34835. a.call(this, e, t, i), (this.fields = [])
  34836. }
  34837. o.Message.OneOf = v
  34838. var A = function (e, t, i, n, r) {
  34839. l.call(this, e, t, i, n, r), (this.className = 'Enum'), (this.object = null)
  34840. }
  34841. A.getName = function (e, t) {
  34842. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r) if (e[(i = n[r])] === t) return i
  34843. return null
  34844. }
  34845. var y = (A.prototype = Object.create(l.prototype))
  34846. ;(y.build = function (t) {
  34847. if (this.object && !t) return this.object
  34848. for (var i = new e.Builder.Enum(), n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r) i[n[r].name] = n[r].id
  34849. return (
  34850. Object.defineProperty &&
  34851. Object.defineProperty(i, '$options', {
  34852. value: this.buildOpt(),
  34853. enumerable: !1
  34854. }),
  34855. (this.object = i)
  34856. )
  34857. }),
  34858. (o.Enum = A)
  34859. var C = function (e, t, i, n) {
  34860. a.call(this, e, t, i), (this.className = 'Enum.Value'), (this.id = n)
  34861. }
  34862. ;(C.prototype = Object.create(a.prototype)), (o.Enum.Value = C)
  34863. var I = function (e, t, i, n) {
  34864. a.call(this, e, t, i), (this.field = n)
  34865. }
  34866. ;(I.prototype = Object.create(a.prototype)), (o.Extension = I)
  34867. var E = function (e, t, i, n) {
  34868. l.call(this, e, t, i, n), (this.className = 'Service'), (this.clazz = null)
  34869. },
  34870. b = (E.prototype = Object.create(l.prototype))
  34871. ;(b.build = function (i) {
  34872. return this.clazz && !i
  34873. ? this.clazz
  34874. : (this.clazz = (function (e, i) {
  34875. for (
  34876. var n = function (t) {
  34877. e.Builder.Service.call(this),
  34878. (this.rpcImpl =
  34879. t ||
  34880. function (e, t, i) {
  34881. setTimeout(i.bind(this, Error('Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services')), 0)
  34882. })
  34883. },
  34884. r = (n.prototype = Object.create(e.Builder.Service.prototype)),
  34885. o = i.getChildren(e.Reflect.Service.RPCMethod),
  34886. a = 0;
  34887. a < o.length;
  34888. a++
  34889. )
  34890. !(function (e) {
  34891. ;(r[e.name] = function (n, r) {
  34892. try {
  34893. try {
  34894. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  34895. } catch (e) {
  34896. if (!(e instanceof TypeError)) throw e
  34897. }
  34898. if (null === n || 'object' != typeof n) throw Error('Illegal arguments')
  34899. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  34900. this.rpcImpl(e.fqn(), n, function (t, n) {
  34901. if (t) return void r(t)
  34902. null === n && (n = '')
  34903. try {
  34904. n = e.resolvedResponseType.clazz.decode(n)
  34905. } catch (e) {}
  34906. 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))
  34907. })
  34908. } catch (e) {
  34909. setTimeout(r.bind(this, e), 0)
  34910. }
  34911. }),
  34912. (n[e.name] = function (t, i, r) {
  34913. new n(t)[e.name](i, r)
  34914. }),
  34915. Object.defineProperty &&
  34916. (Object.defineProperty(n[e.name], '$options', {
  34917. value: e.buildOpt()
  34918. }),
  34919. Object.defineProperty(r[e.name], '$options', {
  34920. value: n[e.name].$options
  34921. }))
  34922. })(o[a])
  34923. return (
  34924. Object.defineProperty &&
  34925. (Object.defineProperty(n, '$options', {
  34926. value: i.buildOpt()
  34927. }),
  34928. Object.defineProperty(r, '$options', {
  34929. value: n.$options
  34930. }),
  34931. Object.defineProperty(n, '$type', {
  34932. value: i
  34933. }),
  34934. Object.defineProperty(r, '$type', {
  34935. value: i
  34936. })),
  34937. n
  34938. )
  34939. })(e, this))
  34940. }),
  34941. (o.Service = E)
  34942. var w = function (e, t, i, n) {
  34943. a.call(this, e, t, i), (this.className = 'Service.Method'), (this.options = n || {})
  34944. },
  34945. _ = (w.prototype = Object.create(a.prototype))
  34946. ;(_.buildOpt = c.buildOpt), (o.Service.Method = w)
  34947. var T = function (e, t, i, n, r, o, a, s) {
  34948. w.call(this, e, t, i, s),
  34949. (this.className = 'Service.RPCMethod'),
  34950. (this.requestName = n),
  34951. (this.responseName = r),
  34952. (this.requestStream = o),
  34953. (this.responseStream = a),
  34954. (this.resolvedRequestType = null),
  34955. (this.resolvedResponseType = null)
  34956. }
  34957. return (T.prototype = Object.create(w.prototype)), (o.Service.RPCMethod = T), o
  34958. })(r)),
  34959. (r.Builder = (function (t, i, n) {
  34960. function r(e) {
  34961. e.messages &&
  34962. e.messages.forEach(function (t) {
  34963. ;(t.syntax = e.syntax), r(t)
  34964. }),
  34965. e.enums &&
  34966. e.enums.forEach(function (t) {
  34967. t.syntax = e.syntax
  34968. })
  34969. }
  34970. var o = function (e) {
  34971. ;(this.ns = new n.Namespace(this, null, '')),
  34972. (this.ptr = this.ns),
  34973. (this.resolved = !1),
  34974. (this.result = null),
  34975. (this.files = {}),
  34976. (this.importRoot = null),
  34977. (this.options = e || {})
  34978. },
  34979. a = o.prototype
  34980. return (
  34981. (o.isMessage = function (e) {
  34982. return 'string' == typeof e.name && 'undefined' == typeof e.values && 'undefined' == typeof e.rpc
  34983. }),
  34984. (o.isMessageField = function (e) {
  34985. return 'string' == typeof e.rule && 'string' == typeof e.name && 'string' == typeof e.type && 'undefined' != typeof e.id
  34986. }),
  34987. (o.isEnum = function (e) {
  34988. return 'string' == typeof e.name && !('undefined' == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  34989. }),
  34990. (o.isService = function (e) {
  34991. return !('string' != typeof e.name || 'object' != typeof e.rpc || !e.rpc)
  34992. }),
  34993. (o.isExtend = function (e) {
  34994. return 'string' == typeof e.ref
  34995. }),
  34996. (a.reset = function () {
  34997. return (this.ptr = this.ns), this
  34998. }),
  34999. (a.define = function (e) {
  35000. if ('string' != typeof e || !i.TYPEREF.test(e)) throw Error('illegal namespace: ' + e)
  35001. return (
  35002. e.split('.').forEach(function (e) {
  35003. var t = this.ptr.getChild(e)
  35004. null === t && this.ptr.addChild((t = new n.Namespace(this, this.ptr, e))), (this.ptr = t)
  35005. }, this),
  35006. this
  35007. )
  35008. }),
  35009. (a.create = function (e) {
  35010. if (!e) return this
  35011. if (Array.isArray(e)) {
  35012. if (0 === e.length) return this
  35013. e = e.slice()
  35014. } else e = [e]
  35015. for (var i = [e]; i.length > 0; ) {
  35016. if (((e = i.pop()), !Array.isArray(e))) throw Error('not a valid namespace: ' + JSON.stringify(e))
  35017. for (; e.length > 0; ) {
  35018. var r = e.shift()
  35019. if (o.isMessage(r)) {
  35020. var a = new n.Message(this, this.ptr, r.name, r.options, r.isGroup, r.syntax),
  35021. s = {}
  35022. r.oneofs &&
  35023. Object.keys(r.oneofs).forEach(function (e) {
  35024. a.addChild((s[e] = new n.Message.OneOf(this, a, e)))
  35025. }, this),
  35026. r.fields &&
  35027. r.fields.forEach(function (e) {
  35028. if (null !== a.getChild(0 | e.id)) throw Error('duplicate or invalid field id in ' + a.name + ': ' + e.id)
  35029. if (e.options && 'object' != typeof e.options) throw Error('illegal field options in ' + a.name + '#' + e.name)
  35030. var t = null
  35031. if ('string' == typeof e.oneof && !(t = s[e.oneof])) throw Error('illegal oneof in ' + a.name + '#' + e.name + ': ' + e.oneof)
  35032. ;(e = new n.Message.Field(this, a, e.rule, e.keytype, e.type, e.name, e.id, e.options, t, r.syntax)), t && t.fields.push(e), a.addChild(e)
  35033. }, this)
  35034. var l = []
  35035. if (
  35036. (r.enums &&
  35037. r.enums.forEach(function (e) {
  35038. l.push(e)
  35039. }),
  35040. r.messages &&
  35041. r.messages.forEach(function (e) {
  35042. l.push(e)
  35043. }),
  35044. r.services &&
  35045. r.services.forEach(function (e) {
  35046. l.push(e)
  35047. }),
  35048. r.extensions && ('number' == typeof r.extensions[0] ? (a.extensions = [r.extensions]) : (a.extensions = r.extensions)),
  35049. this.ptr.addChild(a),
  35050. l.length > 0)
  35051. ) {
  35052. i.push(e), (e = l), (l = null), (this.ptr = a), (a = null)
  35053. continue
  35054. }
  35055. l = null
  35056. } else if (o.isEnum(r))
  35057. (a = new n.Enum(this, this.ptr, r.name, r.options, r.syntax)),
  35058. r.values.forEach(function (e) {
  35059. a.addChild(new n.Enum.Value(this, a, e.name, e.id))
  35060. }, this),
  35061. this.ptr.addChild(a)
  35062. else if (o.isService(r))
  35063. (a = new n.Service(this, this.ptr, r.name, r.options)),
  35064. Object.keys(r.rpc).forEach(function (e) {
  35065. var t = r.rpc[e]
  35066. a.addChild(new n.Service.RPCMethod(this, a, e, t.request, t.response, !!t.request_stream, !!t.response_stream, t.options))
  35067. }, this),
  35068. this.ptr.addChild(a)
  35069. else {
  35070. if (!o.isExtend(r)) throw Error('not a valid definition: ' + JSON.stringify(r))
  35071. if ((a = this.ptr.resolve(r.ref, !0)))
  35072. r.fields.forEach(function (e) {
  35073. if (null !== a.getChild(0 | e.id)) throw Error('duplicate extended field id in ' + a.name + ': ' + e.id)
  35074. if (a.extensions) {
  35075. var i = !1
  35076. if (
  35077. (a.extensions.forEach(function (t) {
  35078. e.id >= t[0] && e.id <= t[1] && (i = !0)
  35079. }),
  35080. !i)
  35081. )
  35082. throw Error('illegal extended field id in ' + a.name + ': ' + e.id + ' (not within valid ranges)')
  35083. }
  35084. var r = e.name
  35085. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r))
  35086. var o = new n.Message.ExtensionField(this, a, e.rule, e.type, this.ptr.fqn() + '.' + r, e.id, e.options),
  35087. s = new n.Extension(this, this.ptr, e.name, o)
  35088. ;(o.extension = s), this.ptr.addChild(s), a.addChild(o)
  35089. }, this)
  35090. else if (!/\.?google\.protobuf\./.test(r.ref)) throw Error('extended message ' + r.ref + ' is not defined')
  35091. }
  35092. ;(r = null), (a = null)
  35093. }
  35094. ;(e = null), (this.ptr = this.ptr.parent)
  35095. }
  35096. return (this.resolved = !1), (this.result = null), this
  35097. }),
  35098. (a.import = function (i, n) {
  35099. var o = '/'
  35100. if ('string' == typeof n) {
  35101. if ((t.Util.IS_NODE && (n = e('path').resolve(n)), this.files[n] === !0)) return this.reset()
  35102. this.files[n] = !0
  35103. } else if ('object' == typeof n) {
  35104. var a = n.root
  35105. t.Util.IS_NODE && (a = e('path').resolve(a)), (a.indexOf('\\') >= 0 || n.file.indexOf('\\') >= 0) && (o = '\\')
  35106. var s = a + o + n.file
  35107. if (this.files[s] === !0) return this.reset()
  35108. this.files[s] = !0
  35109. }
  35110. if (i.imports && i.imports.length > 0) {
  35111. var l,
  35112. c = !1
  35113. 'object' == typeof n
  35114. ? ((this.importRoot = n.root), (c = !0), (l = this.importRoot), (n = n.file), (l.indexOf('\\') >= 0 || n.indexOf('\\') >= 0) && (o = '\\'))
  35115. : 'string' == typeof n
  35116. ? this.importRoot
  35117. ? (l = this.importRoot)
  35118. : n.indexOf('/') >= 0
  35119. ? ((l = n.replace(/\/[^\/]*$/, '')), '' === l && (l = '/'))
  35120. : n.indexOf('\\') >= 0
  35121. ? ((l = n.replace(/\\[^\\]*$/, '')), (o = '\\'))
  35122. : (l = '.')
  35123. : (l = null)
  35124. for (var h = 0; h < i.imports.length; h++)
  35125. if ('string' == typeof i.imports[h]) {
  35126. if (!l) throw Error('cannot determine import root')
  35127. var u = i.imports[h]
  35128. if ('google/protobuf/descriptor.proto' === u) continue
  35129. if (((u = l + o + u), this.files[u] === !0)) continue
  35130. ;/\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, '.json'))
  35131. var d = t.Util.fetch(u)
  35132. if (null === d) throw Error("failed to import '" + u + "' in '" + n + "': file not found")
  35133. ;/\.json$/i.test(u) ? this.import(JSON.parse(d + ''), u) : this.import(t.DotProto.Parser.parse(d), u)
  35134. } else
  35135. n
  35136. ? /\.(\w+)$/.test(n)
  35137. ? this.import(
  35138. i.imports[h],
  35139. n.replace(/^(.+)\.(\w+)$/, function (e, t, i) {
  35140. return t + '_import' + h + '.' + i
  35141. })
  35142. )
  35143. : this.import(i.imports[h], n + '_import' + h)
  35144. : this.import(i.imports[h])
  35145. c && (this.importRoot = null)
  35146. }
  35147. i.package && this.define(i.package), i.syntax && r(i)
  35148. var p = this.ptr
  35149. return (
  35150. i.options &&
  35151. Object.keys(i.options).forEach(function (e) {
  35152. p.options[e] = i.options[e]
  35153. }),
  35154. i.messages && (this.create(i.messages), (this.ptr = p)),
  35155. i.enums && (this.create(i.enums), (this.ptr = p)),
  35156. i.services && (this.create(i.services), (this.ptr = p)),
  35157. i.extends && this.create(i.extends),
  35158. this.reset()
  35159. )
  35160. }),
  35161. (a.resolveAll = function () {
  35162. var e
  35163. if (null == this.ptr || 'object' == typeof this.ptr.type) return this
  35164. if (this.ptr instanceof n.Namespace)
  35165. this.ptr.children.forEach(function (e) {
  35166. ;(this.ptr = e), this.resolveAll()
  35167. }, this)
  35168. else if (this.ptr instanceof n.Message.Field) {
  35169. if (i.TYPE.test(this.ptr.type)) this.ptr.type = t.TYPES[this.ptr.type]
  35170. else {
  35171. if (!i.TYPEREF.test(this.ptr.type)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  35172. if (((e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0)), !e))
  35173. throw Error('unresolvable type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  35174. if (((this.ptr.resolvedType = e), e instanceof n.Enum)) {
  35175. if (((this.ptr.type = t.TYPES.enum), 'proto3' === this.ptr.syntax && 'proto3' !== e.syntax)) throw Error('proto3 message cannot reference proto2 enum')
  35176. } else {
  35177. if (!(e instanceof n.Message)) throw Error('illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.type)
  35178. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  35179. }
  35180. }
  35181. if (this.ptr.map) {
  35182. if (!i.TYPE.test(this.ptr.keyType)) throw Error('illegal key type for map field in ' + this.ptr.toString(!0) + ': ' + this.ptr.keyType)
  35183. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  35184. }
  35185. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  35186. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod)) throw Error('illegal service type in ' + this.ptr.toString(!0))
  35187. if (((e = this.ptr.parent.resolve(this.ptr.requestName, !0)), !(e && e instanceof t.Reflect.Message)))
  35188. throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.requestName)
  35189. if (((this.ptr.resolvedRequestType = e), (e = this.ptr.parent.resolve(this.ptr.responseName, !0)), !(e && e instanceof t.Reflect.Message)))
  35190. throw Error('Illegal type reference in ' + this.ptr.toString(!0) + ': ' + this.ptr.responseName)
  35191. this.ptr.resolvedResponseType = e
  35192. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  35193. throw Error('illegal object in namespace: ' + typeof this.ptr + ': ' + this.ptr)
  35194. return this.reset()
  35195. }),
  35196. (a.build = function (e) {
  35197. if ((this.reset(), this.resolved || (this.resolveAll(), (this.resolved = !0), (this.result = null)), null === this.result && (this.result = this.ns.build()), !e))
  35198. return this.result
  35199. for (var t = 'string' == typeof e ? e.split('.') : e, i = this.result, n = 0; n < t.length; n++) {
  35200. if (!i[t[n]]) {
  35201. i = null
  35202. break
  35203. }
  35204. i = i[t[n]]
  35205. }
  35206. return i
  35207. }),
  35208. (a.lookup = function (e, t) {
  35209. return e ? this.ns.resolve(e, t) : this.ns
  35210. }),
  35211. (a.toString = function () {
  35212. return 'Builder'
  35213. }),
  35214. (o.Message = function () {}),
  35215. (o.Enum = function () {}),
  35216. (o.Service = function () {}),
  35217. o
  35218. )
  35219. })(r, r.Lang, r.Reflect)),
  35220. (r.Map = (function (e, t) {
  35221. function i(e) {
  35222. var t = 0
  35223. return {
  35224. next: function () {
  35225. return t < e.length
  35226. ? {
  35227. done: !1,
  35228. value: e[t++]
  35229. }
  35230. : {
  35231. done: !0
  35232. }
  35233. }
  35234. }
  35235. }
  35236. var n = function (e, i) {
  35237. if (!e.map) throw Error('field is not a map')
  35238. if (
  35239. ((this.field = e),
  35240. (this.keyElem = new t.Element(e.keyType, null, !0, e.syntax)),
  35241. (this.valueElem = new t.Element(e.type, e.resolvedType, !1, e.syntax)),
  35242. (this.map = {}),
  35243. Object.defineProperty(this, 'size', {
  35244. get: function () {
  35245. return Object.keys(this.map).length
  35246. }
  35247. }),
  35248. i)
  35249. )
  35250. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  35251. var o = this.keyElem.valueFromString(n[r]),
  35252. a = this.valueElem.verifyValue(i[n[r]])
  35253. this.map[this.keyElem.valueToString(o)] = {
  35254. key: o,
  35255. value: a
  35256. }
  35257. }
  35258. },
  35259. r = n.prototype
  35260. return (
  35261. (r.clear = function () {
  35262. this.map = {}
  35263. }),
  35264. (r.delete = function (e) {
  35265. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e)),
  35266. i = t in this.map
  35267. return delete this.map[t], i
  35268. }),
  35269. (r.entries = function () {
  35270. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++) t.push([(e = this.map[n[r]]).key, e.value])
  35271. return i(t)
  35272. }),
  35273. (r.keys = function () {
  35274. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++) e.push(this.map[t[n]].key)
  35275. return i(e)
  35276. }),
  35277. (r.values = function () {
  35278. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++) e.push(this.map[t[n]].value)
  35279. return i(e)
  35280. }),
  35281. (r.forEach = function (e, t) {
  35282. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++) e.call(t, (i = this.map[n[r]]).value, i.key, this)
  35283. }),
  35284. (r.set = function (e, t) {
  35285. var i = this.keyElem.verifyValue(e),
  35286. n = this.valueElem.verifyValue(t)
  35287. return (
  35288. (this.map[this.keyElem.valueToString(i)] = {
  35289. key: i,
  35290. value: n
  35291. }),
  35292. this
  35293. )
  35294. }),
  35295. (r.get = function (e) {
  35296. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  35297. if (t in this.map) return this.map[t].value
  35298. }),
  35299. (r.has = function (e) {
  35300. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  35301. return t in this.map
  35302. }),
  35303. n
  35304. )
  35305. })(r, r.Reflect)),
  35306. (r.loadProto = function (e, t, i) {
  35307. return ('string' == typeof t || (t && 'string' == typeof t.file && 'string' == typeof t.root)) && ((i = t), (t = void 0)), r.loadJson(r.DotProto.Parser.parse(e), t, i)
  35308. }),
  35309. (r.protoFromString = r.loadProto),
  35310. (r.loadProtoFile = function (e, t, i) {
  35311. if ((t && 'object' == typeof t ? ((i = t), (t = null)) : (t && 'function' == typeof t) || (t = null), t))
  35312. return r.Util.fetch('string' == typeof e ? e : e.root + '/' + e.file, function (n) {
  35313. if (null === n) return void t(Error('Failed to fetch file'))
  35314. try {
  35315. t(null, r.loadProto(n, i, e))
  35316. } catch (e) {
  35317. t(e)
  35318. }
  35319. })
  35320. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e)
  35321. return null === n ? null : r.loadProto(n, i, e)
  35322. }),
  35323. (r.protoFromFile = r.loadProtoFile),
  35324. (r.newBuilder = function (e) {
  35325. return (
  35326. (e = e || {}),
  35327. 'undefined' == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  35328. 'undefined' == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  35329. new r.Builder(e)
  35330. )
  35331. }),
  35332. (r.loadJson = function (e, t, i) {
  35333. return (
  35334. ('string' == typeof t || (t && 'string' == typeof t.file && 'string' == typeof t.root)) && ((i = t), (t = null)),
  35335. (t && 'object' == typeof t) || (t = r.newBuilder()),
  35336. 'string' == typeof e && (e = JSON.parse(e)),
  35337. t.import(e, i),
  35338. t.resolveAll(),
  35339. t
  35340. )
  35341. }),
  35342. (r.loadJsonFile = function (e, t, i) {
  35343. if ((t && 'object' == typeof t ? ((i = t), (t = null)) : (t && 'function' == typeof t) || (t = null), t))
  35344. return r.Util.fetch('string' == typeof e ? e : e.root + '/' + e.file, function (n) {
  35345. if (null === n) return void t(Error('Failed to fetch file'))
  35346. try {
  35347. t(null, r.loadJson(JSON.parse(n), i, e))
  35348. } catch (e) {
  35349. t(e)
  35350. }
  35351. })
  35352. var n = r.Util.fetch('object' == typeof e ? e.root + '/' + e.file : e)
  35353. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  35354. }),
  35355. r
  35356. )
  35357. })
  35358. }).call(this, e('_process'))
  35359. },
  35360. {
  35361. _process: 203,
  35362. bytebuffer: 215,
  35363. fs: 197,
  35364. path: 197
  35365. }
  35366. ],
  35367. 215: [
  35368. function (e, t, i) {
  35369. !(function (i, n) {
  35370. 'function' == typeof define && define.amd
  35371. ? define(['long'], n)
  35372. : 'function' == typeof e && 'object' == typeof t && t && t.exports
  35373. ? (t.exports = (function () {
  35374. var t
  35375. try {
  35376. t = e('long')
  35377. } catch (e) {}
  35378. return n(t)
  35379. })())
  35380. : ((i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long))
  35381. })(this, function (e) {
  35382. 'use strict'
  35383. function t(e) {
  35384. var t = 0
  35385. return function () {
  35386. return t < e.length ? e.charCodeAt(t++) : null
  35387. }
  35388. }
  35389. function i() {
  35390. var e = [],
  35391. t = []
  35392. return function () {
  35393. return 0 === arguments.length
  35394. ? t.join('') + l.apply(String, e)
  35395. : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)), (e.length = 0)), void Array.prototype.push.apply(e, arguments))
  35396. }
  35397. }
  35398. function n(e, t, i, n, r) {
  35399. var o,
  35400. a,
  35401. s = 8 * r - n - 1,
  35402. l = (1 << s) - 1,
  35403. c = l >> 1,
  35404. h = -7,
  35405. u = i ? r - 1 : 0,
  35406. d = i ? -1 : 1,
  35407. p = e[t + u]
  35408. for (u += d, o = p & ((1 << -h) - 1), p >>= -h, h += s; h > 0; o = 256 * o + e[t + u], u += d, h -= 8);
  35409. for (a = o & ((1 << -h) - 1), o >>= -h, h += n; h > 0; a = 256 * a + e[t + u], u += d, h -= 8);
  35410. if (0 === o) o = 1 - c
  35411. else {
  35412. if (o === l) return a ? NaN : (p ? -1 : 1) * (1 / 0)
  35413. ;(a += Math.pow(2, n)), (o -= c)
  35414. }
  35415. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  35416. }
  35417. function r(e, t, i, n, r, o) {
  35418. var a,
  35419. s,
  35420. l,
  35421. c = 8 * o - r - 1,
  35422. h = (1 << c) - 1,
  35423. u = h >> 1,
  35424. d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0,
  35425. p = n ? 0 : o - 1,
  35426. f = n ? 1 : -1,
  35427. g = t < 0 || (0 === t && 1 / t < 0) ? 1 : 0
  35428. for (
  35429. t = Math.abs(t),
  35430. isNaN(t) || t === 1 / 0
  35431. ? ((s = isNaN(t) ? 1 : 0), (a = h))
  35432. : ((a = Math.floor(Math.log(t) / Math.LN2)),
  35433. t * (l = Math.pow(2, -a)) < 1 && (a--, (l *= 2)),
  35434. (t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u)),
  35435. t * l >= 2 && (a++, (l /= 2)),
  35436. a + u >= h ? ((s = 0), (a = h)) : a + u >= 1 ? ((s = (t * l - 1) * Math.pow(2, r)), (a += u)) : ((s = t * Math.pow(2, u - 1) * Math.pow(2, r)), (a = 0)));
  35437. r >= 8;
  35438. e[i + p] = 255 & s, p += f, s /= 256, r -= 8
  35439. );
  35440. for (a = (a << r) | s, c += r; c > 0; e[i + p] = 255 & a, p += f, a /= 256, c -= 8);
  35441. e[i + p - f] |= 128 * g
  35442. }
  35443. var o = function (e, t, i) {
  35444. if (('undefined' == typeof e && (e = o.DEFAULT_CAPACITY), 'undefined' == typeof t && (t = o.DEFAULT_ENDIAN), 'undefined' == typeof i && (i = o.DEFAULT_NOASSERT), !i)) {
  35445. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity')
  35446. ;(t = !!t), (i = !!i)
  35447. }
  35448. ;(this.buffer = 0 === e ? s : new ArrayBuffer(e)),
  35449. (this.view = 0 === e ? null : new Uint8Array(this.buffer)),
  35450. (this.offset = 0),
  35451. (this.markedOffset = -1),
  35452. (this.limit = e),
  35453. (this.littleEndian = t),
  35454. (this.noAssert = i)
  35455. }
  35456. ;(o.VERSION = '5.0.1'), (o.LITTLE_ENDIAN = !0), (o.BIG_ENDIAN = !1), (o.DEFAULT_CAPACITY = 16), (o.DEFAULT_ENDIAN = o.BIG_ENDIAN), (o.DEFAULT_NOASSERT = !1), (o.Long = e || null)
  35457. var a = o.prototype
  35458. a.__isByteBuffer__,
  35459. Object.defineProperty(a, '__isByteBuffer__', {
  35460. value: !0,
  35461. enumerable: !1,
  35462. configurable: !1
  35463. })
  35464. var s = new ArrayBuffer(0),
  35465. l = String.fromCharCode
  35466. ;(o.accessor = function () {
  35467. return Uint8Array
  35468. }),
  35469. (o.allocate = function (e, t, i) {
  35470. return new o(e, t, i)
  35471. }),
  35472. (o.concat = function (e, t, i, n) {
  35473. ;('boolean' != typeof t && 'string' == typeof t) || ((n = i), (i = t), (t = void 0))
  35474. for (var r, a = 0, s = 0, l = e.length; s < l; ++s) o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)), (r = e[s].limit - e[s].offset), r > 0 && (a += r)
  35475. if (0 === a) return new o(0, i, n)
  35476. var c,
  35477. h = new o(a, i, n)
  35478. for (s = 0; s < l; ) (c = e[s++]), (r = c.limit - c.offset), r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset), (h.offset += r))
  35479. return (h.limit = h.offset), (h.offset = 0), h
  35480. }),
  35481. (o.isByteBuffer = function (e) {
  35482. return (e && e.__isByteBuffer__) === !0
  35483. }),
  35484. (o.type = function () {
  35485. return ArrayBuffer
  35486. }),
  35487. (o.wrap = function (e, t, i, n) {
  35488. if (('string' != typeof t && ((n = i), (i = t), (t = void 0)), 'string' == typeof e))
  35489. switch (('undefined' == typeof t && (t = 'utf8'), t)) {
  35490. case 'base64':
  35491. return o.fromBase64(e, i)
  35492. case 'hex':
  35493. return o.fromHex(e, i)
  35494. case 'binary':
  35495. return o.fromBinary(e, i)
  35496. case 'utf8':
  35497. return o.fromUTF8(e, i)
  35498. case 'debug':
  35499. return o.fromDebug(e, i)
  35500. default:
  35501. throw Error('Unsupported encoding: ' + t)
  35502. }
  35503. if (null === e || 'object' != typeof e) throw TypeError('Illegal buffer')
  35504. var r
  35505. if (o.isByteBuffer(e)) return (r = a.clone.call(e)), (r.markedOffset = -1), r
  35506. if (e instanceof Uint8Array)
  35507. (r = new o(0, i, n)), e.length > 0 && ((r.buffer = e.buffer), (r.offset = e.byteOffset), (r.limit = e.byteOffset + e.byteLength), (r.view = new Uint8Array(e.buffer)))
  35508. else if (e instanceof ArrayBuffer)
  35509. (r = new o(0, i, n)), e.byteLength > 0 && ((r.buffer = e), (r.offset = 0), (r.limit = e.byteLength), (r.view = e.byteLength > 0 ? new Uint8Array(e) : null))
  35510. else {
  35511. if ('[object Array]' !== Object.prototype.toString.call(e)) throw TypeError('Illegal buffer')
  35512. ;(r = new o(e.length, i, n)), (r.limit = e.length)
  35513. for (var s = 0; s < e.length; ++s) r.view[s] = e[s]
  35514. }
  35515. return r
  35516. }),
  35517. (a.writeBitSet = function (e, t) {
  35518. var i = 'undefined' == typeof t
  35519. if ((i && (t = this.offset), !this.noAssert)) {
  35520. if (!(e instanceof Array)) throw TypeError('Illegal BitSet: Not an array')
  35521. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35522. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35523. }
  35524. var n,
  35525. r = t,
  35526. o = e.length,
  35527. a = o >> 3,
  35528. s = 0
  35529. for (t += this.writeVarint32(o, t); a--; )
  35530. (n =
  35531. (1 & !!e[s++]) |
  35532. ((1 & !!e[s++]) << 1) |
  35533. ((1 & !!e[s++]) << 2) |
  35534. ((1 & !!e[s++]) << 3) |
  35535. ((1 & !!e[s++]) << 4) |
  35536. ((1 & !!e[s++]) << 5) |
  35537. ((1 & !!e[s++]) << 6) |
  35538. ((1 & !!e[s++]) << 7)),
  35539. this.writeByte(n, t++)
  35540. if (s < o) {
  35541. var l = 0
  35542. for (n = 0; s < o; ) n |= (1 & !!e[s++]) << l++
  35543. this.writeByte(n, t++)
  35544. }
  35545. return i ? ((this.offset = t), this) : t - r
  35546. }),
  35547. (a.readBitSet = function (e) {
  35548. var t = 'undefined' == typeof e
  35549. t && (e = this.offset)
  35550. var i,
  35551. n = this.readVarint32(e),
  35552. r = n.value,
  35553. o = r >> 3,
  35554. a = 0,
  35555. s = []
  35556. for (e += n.length; o--; )
  35557. (i = this.readByte(e++)),
  35558. (s[a++] = !!(1 & i)),
  35559. (s[a++] = !!(2 & i)),
  35560. (s[a++] = !!(4 & i)),
  35561. (s[a++] = !!(8 & i)),
  35562. (s[a++] = !!(16 & i)),
  35563. (s[a++] = !!(32 & i)),
  35564. (s[a++] = !!(64 & i)),
  35565. (s[a++] = !!(128 & i))
  35566. if (a < r) {
  35567. var l = 0
  35568. for (i = this.readByte(e++); a < r; ) s[a++] = !!((i >> l++) & 1)
  35569. }
  35570. return t && (this.offset = e), s
  35571. }),
  35572. (a.readBytes = function (e, t) {
  35573. var i = 'undefined' == typeof t
  35574. if ((i && (t = this.offset), !this.noAssert)) {
  35575. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35576. if (((t >>>= 0), t < 0 || t + e > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+' + e + ') <= ' + this.buffer.byteLength)
  35577. }
  35578. var n = this.slice(t, t + e)
  35579. return i && (this.offset += e), n
  35580. }),
  35581. (a.writeBytes = a.append),
  35582. (a.writeInt8 = function (e, t) {
  35583. var i = 'undefined' == typeof t
  35584. if ((i && (t = this.offset), !this.noAssert)) {
  35585. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35586. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35587. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35588. }
  35589. t += 1
  35590. var n = this.buffer.byteLength
  35591. return t > n && this.resize((n *= 2) > t ? n : t), (t -= 1), (this.view[t] = e), i && (this.offset += 1), this
  35592. }),
  35593. (a.writeByte = a.writeInt8),
  35594. (a.readInt8 = function (e) {
  35595. var t = 'undefined' == typeof e
  35596. if ((t && (e = this.offset), !this.noAssert)) {
  35597. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35598. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  35599. }
  35600. var i = this.view[e]
  35601. return 128 === (128 & i) && (i = -(255 - i + 1)), t && (this.offset += 1), i
  35602. }),
  35603. (a.readByte = a.readInt8),
  35604. (a.writeUint8 = function (e, t) {
  35605. var i = 'undefined' == typeof t
  35606. if ((i && (t = this.offset), !this.noAssert)) {
  35607. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35608. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35609. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35610. }
  35611. t += 1
  35612. var n = this.buffer.byteLength
  35613. return t > n && this.resize((n *= 2) > t ? n : t), (t -= 1), (this.view[t] = e), i && (this.offset += 1), this
  35614. }),
  35615. (a.writeUInt8 = a.writeUint8),
  35616. (a.readUint8 = function (e) {
  35617. var t = 'undefined' == typeof e
  35618. if ((t && (e = this.offset), !this.noAssert)) {
  35619. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35620. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  35621. }
  35622. var i = this.view[e]
  35623. return t && (this.offset += 1), i
  35624. }),
  35625. (a.readUInt8 = a.readUint8),
  35626. (a.writeInt16 = function (e, t) {
  35627. var i = 'undefined' == typeof t
  35628. if ((i && (t = this.offset), !this.noAssert)) {
  35629. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35630. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35631. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35632. }
  35633. t += 2
  35634. var n = this.buffer.byteLength
  35635. return (
  35636. t > n && this.resize((n *= 2) > t ? n : t),
  35637. (t -= 2),
  35638. this.littleEndian ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e)) : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  35639. i && (this.offset += 2),
  35640. this
  35641. )
  35642. }),
  35643. (a.writeShort = a.writeInt16),
  35644. (a.readInt16 = function (e) {
  35645. var t = 'undefined' == typeof e
  35646. if ((t && (e = this.offset), !this.noAssert)) {
  35647. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35648. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength)
  35649. }
  35650. var i = 0
  35651. return (
  35652. this.littleEndian ? ((i = this.view[e]), (i |= this.view[e + 1] << 8)) : ((i = this.view[e] << 8), (i |= this.view[e + 1])),
  35653. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  35654. t && (this.offset += 2),
  35655. i
  35656. )
  35657. }),
  35658. (a.readShort = a.readInt16),
  35659. (a.writeUint16 = function (e, t) {
  35660. var i = 'undefined' == typeof t
  35661. if ((i && (t = this.offset), !this.noAssert)) {
  35662. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35663. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35664. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35665. }
  35666. t += 2
  35667. var n = this.buffer.byteLength
  35668. return (
  35669. t > n && this.resize((n *= 2) > t ? n : t),
  35670. (t -= 2),
  35671. this.littleEndian ? ((this.view[t + 1] = (65280 & e) >>> 8), (this.view[t] = 255 & e)) : ((this.view[t] = (65280 & e) >>> 8), (this.view[t + 1] = 255 & e)),
  35672. i && (this.offset += 2),
  35673. this
  35674. )
  35675. }),
  35676. (a.writeUInt16 = a.writeUint16),
  35677. (a.readUint16 = function (e) {
  35678. var t = 'undefined' == typeof e
  35679. if ((t && (e = this.offset), !this.noAssert)) {
  35680. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35681. if (((e >>>= 0), e < 0 || e + 2 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+2) <= ' + this.buffer.byteLength)
  35682. }
  35683. var i = 0
  35684. return this.littleEndian ? ((i = this.view[e]), (i |= this.view[e + 1] << 8)) : ((i = this.view[e] << 8), (i |= this.view[e + 1])), t && (this.offset += 2), i
  35685. }),
  35686. (a.readUInt16 = a.readUint16),
  35687. (a.writeInt32 = function (e, t) {
  35688. var i = 'undefined' == typeof t
  35689. if ((i && (t = this.offset), !this.noAssert)) {
  35690. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35691. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35692. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35693. }
  35694. t += 4
  35695. var n = this.buffer.byteLength
  35696. return (
  35697. t > n && this.resize((n *= 2) > t ? n : t),
  35698. (t -= 4),
  35699. this.littleEndian
  35700. ? ((this.view[t + 3] = (e >>> 24) & 255), (this.view[t + 2] = (e >>> 16) & 255), (this.view[t + 1] = (e >>> 8) & 255), (this.view[t] = 255 & e))
  35701. : ((this.view[t] = (e >>> 24) & 255), (this.view[t + 1] = (e >>> 16) & 255), (this.view[t + 2] = (e >>> 8) & 255), (this.view[t + 3] = 255 & e)),
  35702. i && (this.offset += 4),
  35703. this
  35704. )
  35705. }),
  35706. (a.writeInt = a.writeInt32),
  35707. (a.readInt32 = function (e) {
  35708. var t = 'undefined' == typeof e
  35709. if ((t && (e = this.offset), !this.noAssert)) {
  35710. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35711. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  35712. }
  35713. var i = 0
  35714. return (
  35715. this.littleEndian
  35716. ? ((i = this.view[e + 2] << 16), (i |= this.view[e + 1] << 8), (i |= this.view[e]), (i += (this.view[e + 3] << 24) >>> 0))
  35717. : ((i = this.view[e + 1] << 16), (i |= this.view[e + 2] << 8), (i |= this.view[e + 3]), (i += (this.view[e] << 24) >>> 0)),
  35718. (i |= 0),
  35719. t && (this.offset += 4),
  35720. i
  35721. )
  35722. }),
  35723. (a.readInt = a.readInt32),
  35724. (a.writeUint32 = function (e, t) {
  35725. var i = 'undefined' == typeof t
  35726. if ((i && (t = this.offset), !this.noAssert)) {
  35727. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35728. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35729. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35730. }
  35731. t += 4
  35732. var n = this.buffer.byteLength
  35733. return (
  35734. t > n && this.resize((n *= 2) > t ? n : t),
  35735. (t -= 4),
  35736. this.littleEndian
  35737. ? ((this.view[t + 3] = (e >>> 24) & 255), (this.view[t + 2] = (e >>> 16) & 255), (this.view[t + 1] = (e >>> 8) & 255), (this.view[t] = 255 & e))
  35738. : ((this.view[t] = (e >>> 24) & 255), (this.view[t + 1] = (e >>> 16) & 255), (this.view[t + 2] = (e >>> 8) & 255), (this.view[t + 3] = 255 & e)),
  35739. i && (this.offset += 4),
  35740. this
  35741. )
  35742. }),
  35743. (a.writeUInt32 = a.writeUint32),
  35744. (a.readUint32 = function (e) {
  35745. var t = 'undefined' == typeof e
  35746. if ((t && (e = this.offset), !this.noAssert)) {
  35747. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35748. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  35749. }
  35750. var i = 0
  35751. return (
  35752. this.littleEndian
  35753. ? ((i = this.view[e + 2] << 16), (i |= this.view[e + 1] << 8), (i |= this.view[e]), (i += (this.view[e + 3] << 24) >>> 0))
  35754. : ((i = this.view[e + 1] << 16), (i |= this.view[e + 2] << 8), (i |= this.view[e + 3]), (i += (this.view[e] << 24) >>> 0)),
  35755. t && (this.offset += 4),
  35756. i
  35757. )
  35758. }),
  35759. (a.readUInt32 = a.readUint32),
  35760. e &&
  35761. ((a.writeInt64 = function (t, i) {
  35762. var n = 'undefined' == typeof i
  35763. if ((n && (i = this.offset), !this.noAssert)) {
  35764. if ('number' == typeof t) t = e.fromNumber(t)
  35765. else if ('string' == typeof t) t = e.fromString(t)
  35766. else if (!(t && t instanceof e)) throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  35767. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  35768. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  35769. }
  35770. 'number' == typeof t ? (t = e.fromNumber(t)) : 'string' == typeof t && (t = e.fromString(t)), (i += 8)
  35771. var r = this.buffer.byteLength
  35772. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8)
  35773. var o = t.low,
  35774. a = t.high
  35775. return (
  35776. this.littleEndian
  35777. ? ((this.view[i + 3] = (o >>> 24) & 255),
  35778. (this.view[i + 2] = (o >>> 16) & 255),
  35779. (this.view[i + 1] = (o >>> 8) & 255),
  35780. (this.view[i] = 255 & o),
  35781. (i += 4),
  35782. (this.view[i + 3] = (a >>> 24) & 255),
  35783. (this.view[i + 2] = (a >>> 16) & 255),
  35784. (this.view[i + 1] = (a >>> 8) & 255),
  35785. (this.view[i] = 255 & a))
  35786. : ((this.view[i] = (a >>> 24) & 255),
  35787. (this.view[i + 1] = (a >>> 16) & 255),
  35788. (this.view[i + 2] = (a >>> 8) & 255),
  35789. (this.view[i + 3] = 255 & a),
  35790. (i += 4),
  35791. (this.view[i] = (o >>> 24) & 255),
  35792. (this.view[i + 1] = (o >>> 16) & 255),
  35793. (this.view[i + 2] = (o >>> 8) & 255),
  35794. (this.view[i + 3] = 255 & o)),
  35795. n && (this.offset += 8),
  35796. this
  35797. )
  35798. }),
  35799. (a.writeLong = a.writeInt64),
  35800. (a.readInt64 = function (t) {
  35801. var i = 'undefined' == typeof t
  35802. if ((i && (t = this.offset), !this.noAssert)) {
  35803. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35804. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength)
  35805. }
  35806. var n = 0,
  35807. r = 0
  35808. this.littleEndian
  35809. ? ((n = this.view[t + 2] << 16),
  35810. (n |= this.view[t + 1] << 8),
  35811. (n |= this.view[t]),
  35812. (n += (this.view[t + 3] << 24) >>> 0),
  35813. (t += 4),
  35814. (r = this.view[t + 2] << 16),
  35815. (r |= this.view[t + 1] << 8),
  35816. (r |= this.view[t]),
  35817. (r += (this.view[t + 3] << 24) >>> 0))
  35818. : ((r = this.view[t + 1] << 16),
  35819. (r |= this.view[t + 2] << 8),
  35820. (r |= this.view[t + 3]),
  35821. (r += (this.view[t] << 24) >>> 0),
  35822. (t += 4),
  35823. (n = this.view[t + 1] << 16),
  35824. (n |= this.view[t + 2] << 8),
  35825. (n |= this.view[t + 3]),
  35826. (n += (this.view[t] << 24) >>> 0))
  35827. var o = new e(n, r, !1)
  35828. return i && (this.offset += 8), o
  35829. }),
  35830. (a.readLong = a.readInt64),
  35831. (a.writeUint64 = function (t, i) {
  35832. var n = 'undefined' == typeof i
  35833. if ((n && (i = this.offset), !this.noAssert)) {
  35834. if ('number' == typeof t) t = e.fromNumber(t)
  35835. else if ('string' == typeof t) t = e.fromString(t)
  35836. else if (!(t && t instanceof e)) throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  35837. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  35838. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  35839. }
  35840. 'number' == typeof t ? (t = e.fromNumber(t)) : 'string' == typeof t && (t = e.fromString(t)), (i += 8)
  35841. var r = this.buffer.byteLength
  35842. i > r && this.resize((r *= 2) > i ? r : i), (i -= 8)
  35843. var o = t.low,
  35844. a = t.high
  35845. return (
  35846. this.littleEndian
  35847. ? ((this.view[i + 3] = (o >>> 24) & 255),
  35848. (this.view[i + 2] = (o >>> 16) & 255),
  35849. (this.view[i + 1] = (o >>> 8) & 255),
  35850. (this.view[i] = 255 & o),
  35851. (i += 4),
  35852. (this.view[i + 3] = (a >>> 24) & 255),
  35853. (this.view[i + 2] = (a >>> 16) & 255),
  35854. (this.view[i + 1] = (a >>> 8) & 255),
  35855. (this.view[i] = 255 & a))
  35856. : ((this.view[i] = (a >>> 24) & 255),
  35857. (this.view[i + 1] = (a >>> 16) & 255),
  35858. (this.view[i + 2] = (a >>> 8) & 255),
  35859. (this.view[i + 3] = 255 & a),
  35860. (i += 4),
  35861. (this.view[i] = (o >>> 24) & 255),
  35862. (this.view[i + 1] = (o >>> 16) & 255),
  35863. (this.view[i + 2] = (o >>> 8) & 255),
  35864. (this.view[i + 3] = 255 & o)),
  35865. n && (this.offset += 8),
  35866. this
  35867. )
  35868. }),
  35869. (a.writeUInt64 = a.writeUint64),
  35870. (a.readUint64 = function (t) {
  35871. var i = 'undefined' == typeof t
  35872. if ((i && (t = this.offset), !this.noAssert)) {
  35873. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35874. if (((t >>>= 0), t < 0 || t + 8 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+8) <= ' + this.buffer.byteLength)
  35875. }
  35876. var n = 0,
  35877. r = 0
  35878. this.littleEndian
  35879. ? ((n = this.view[t + 2] << 16),
  35880. (n |= this.view[t + 1] << 8),
  35881. (n |= this.view[t]),
  35882. (n += (this.view[t + 3] << 24) >>> 0),
  35883. (t += 4),
  35884. (r = this.view[t + 2] << 16),
  35885. (r |= this.view[t + 1] << 8),
  35886. (r |= this.view[t]),
  35887. (r += (this.view[t + 3] << 24) >>> 0))
  35888. : ((r = this.view[t + 1] << 16),
  35889. (r |= this.view[t + 2] << 8),
  35890. (r |= this.view[t + 3]),
  35891. (r += (this.view[t] << 24) >>> 0),
  35892. (t += 4),
  35893. (n = this.view[t + 1] << 16),
  35894. (n |= this.view[t + 2] << 8),
  35895. (n |= this.view[t + 3]),
  35896. (n += (this.view[t] << 24) >>> 0))
  35897. var o = new e(n, r, !0)
  35898. return i && (this.offset += 8), o
  35899. }),
  35900. (a.readUInt64 = a.readUint64)),
  35901. (a.writeFloat32 = function (e, t) {
  35902. var i = 'undefined' == typeof t
  35903. if ((i && (t = this.offset), !this.noAssert)) {
  35904. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  35905. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35906. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35907. }
  35908. t += 4
  35909. var n = this.buffer.byteLength
  35910. return t > n && this.resize((n *= 2) > t ? n : t), (t -= 4), r(this.view, e, t, this.littleEndian, 23, 4), i && (this.offset += 4), this
  35911. }),
  35912. (a.writeFloat = a.writeFloat32),
  35913. (a.readFloat32 = function (e) {
  35914. var t = 'undefined' == typeof e
  35915. if ((t && (e = this.offset), !this.noAssert)) {
  35916. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35917. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  35918. }
  35919. var i = n(this.view, e, this.littleEndian, 23, 4)
  35920. return t && (this.offset += 4), i
  35921. }),
  35922. (a.readFloat = a.readFloat32),
  35923. (a.writeFloat64 = function (e, t) {
  35924. var i = 'undefined' == typeof t
  35925. if ((i && (t = this.offset), !this.noAssert)) {
  35926. if ('number' != typeof e) throw TypeError('Illegal value: ' + e + ' (not a number)')
  35927. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35928. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35929. }
  35930. t += 8
  35931. var n = this.buffer.byteLength
  35932. return t > n && this.resize((n *= 2) > t ? n : t), (t -= 8), r(this.view, e, t, this.littleEndian, 52, 8), i && (this.offset += 8), this
  35933. }),
  35934. (a.writeDouble = a.writeFloat64),
  35935. (a.readFloat64 = function (e) {
  35936. var t = 'undefined' == typeof e
  35937. if ((t && (e = this.offset), !this.noAssert)) {
  35938. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35939. if (((e >>>= 0), e < 0 || e + 8 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+8) <= ' + this.buffer.byteLength)
  35940. }
  35941. var i = n(this.view, e, this.littleEndian, 52, 8)
  35942. return t && (this.offset += 8), i
  35943. }),
  35944. (a.readDouble = a.readFloat64),
  35945. (o.MAX_VARINT32_BYTES = 5),
  35946. (o.calculateVarint32 = function (e) {
  35947. return (e >>>= 0), e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35948. }),
  35949. (o.zigZagEncode32 = function (e) {
  35950. return (((e |= 0) << 1) ^ (e >> 31)) >>> 0
  35951. }),
  35952. (o.zigZagDecode32 = function (e) {
  35953. return ((e >>> 1) ^ -(1 & e)) | 0
  35954. }),
  35955. (a.writeVarint32 = function (e, t) {
  35956. var i = 'undefined' == typeof t
  35957. if ((i && (t = this.offset), !this.noAssert)) {
  35958. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  35959. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  35960. if (((t >>>= 0), t < 0 || t + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+0) <= ' + this.buffer.byteLength)
  35961. }
  35962. var n,
  35963. r = o.calculateVarint32(e)
  35964. t += r
  35965. var a = this.buffer.byteLength
  35966. for (t > a && this.resize((a *= 2) > t ? a : t), t -= r, e >>>= 0; e >= 128; ) (n = (127 & e) | 128), (this.view[t++] = n), (e >>>= 7)
  35967. return (this.view[t++] = e), i ? ((this.offset = t), this) : r
  35968. }),
  35969. (a.writeVarint32ZigZag = function (e, t) {
  35970. return this.writeVarint32(o.zigZagEncode32(e), t)
  35971. }),
  35972. (a.readVarint32 = function (e) {
  35973. var t = 'undefined' == typeof e
  35974. if ((t && (e = this.offset), !this.noAssert)) {
  35975. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  35976. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  35977. }
  35978. var i,
  35979. n = 0,
  35980. r = 0
  35981. do {
  35982. if (!this.noAssert && e > this.limit) {
  35983. var o = Error('Truncated')
  35984. throw ((o.truncated = !0), o)
  35985. }
  35986. ;(i = this.view[e++]), n < 5 && (r |= (127 & i) << (7 * n)), ++n
  35987. } while (0 !== (128 & i))
  35988. return (
  35989. (r |= 0),
  35990. t
  35991. ? ((this.offset = e), r)
  35992. : {
  35993. value: r,
  35994. length: n
  35995. }
  35996. )
  35997. }),
  35998. (a.readVarint32ZigZag = function (e) {
  35999. var t = this.readVarint32(e)
  36000. return 'object' == typeof t ? (t.value = o.zigZagDecode32(t.value)) : (t = o.zigZagDecode32(t)), t
  36001. }),
  36002. e &&
  36003. ((o.MAX_VARINT64_BYTES = 10),
  36004. (o.calculateVarint64 = function (t) {
  36005. 'number' == typeof t ? (t = e.fromNumber(t)) : 'string' == typeof t && (t = e.fromString(t))
  36006. var i = t.toInt() >>> 0,
  36007. n = t.shiftRightUnsigned(28).toInt() >>> 0,
  36008. r = t.shiftRightUnsigned(56).toInt() >>> 0
  36009. 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
  36010. }),
  36011. (o.zigZagEncode64 = function (t) {
  36012. return (
  36013. 'number' == typeof t ? (t = e.fromNumber(t, !1)) : 'string' == typeof t ? (t = e.fromString(t, !1)) : t.unsigned !== !1 && (t = t.toSigned()),
  36014. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  36015. )
  36016. }),
  36017. (o.zigZagDecode64 = function (t) {
  36018. return (
  36019. 'number' == typeof t ? (t = e.fromNumber(t, !1)) : 'string' == typeof t ? (t = e.fromString(t, !1)) : t.unsigned !== !1 && (t = t.toSigned()),
  36020. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  36021. )
  36022. }),
  36023. (a.writeVarint64 = function (t, i) {
  36024. var n = 'undefined' == typeof i
  36025. if ((n && (i = this.offset), !this.noAssert)) {
  36026. if ('number' == typeof t) t = e.fromNumber(t)
  36027. else if ('string' == typeof t) t = e.fromString(t)
  36028. else if (!(t && t instanceof e)) throw TypeError('Illegal value: ' + t + ' (not an integer or Long)')
  36029. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36030. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36031. }
  36032. 'number' == typeof t ? (t = e.fromNumber(t, !1)) : 'string' == typeof t ? (t = e.fromString(t, !1)) : t.unsigned !== !1 && (t = t.toSigned())
  36033. var r = o.calculateVarint64(t),
  36034. a = t.toInt() >>> 0,
  36035. s = t.shiftRightUnsigned(28).toInt() >>> 0,
  36036. l = t.shiftRightUnsigned(56).toInt() >>> 0
  36037. i += r
  36038. var c = this.buffer.byteLength
  36039. switch ((i > c && this.resize((c *= 2) > i ? c : i), (i -= r), r)) {
  36040. case 10:
  36041. this.view[i + 9] = (l >>> 7) & 1
  36042. case 9:
  36043. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l
  36044. case 8:
  36045. this.view[i + 7] = 8 !== r ? (s >>> 21) | 128 : (s >>> 21) & 127
  36046. case 7:
  36047. this.view[i + 6] = 7 !== r ? (s >>> 14) | 128 : (s >>> 14) & 127
  36048. case 6:
  36049. this.view[i + 5] = 6 !== r ? (s >>> 7) | 128 : (s >>> 7) & 127
  36050. case 5:
  36051. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s
  36052. case 4:
  36053. this.view[i + 3] = 4 !== r ? (a >>> 21) | 128 : (a >>> 21) & 127
  36054. case 3:
  36055. this.view[i + 2] = 3 !== r ? (a >>> 14) | 128 : (a >>> 14) & 127
  36056. case 2:
  36057. this.view[i + 1] = 2 !== r ? (a >>> 7) | 128 : (a >>> 7) & 127
  36058. case 1:
  36059. this.view[i] = 1 !== r ? 128 | a : 127 & a
  36060. }
  36061. return n ? ((this.offset += r), this) : r
  36062. }),
  36063. (a.writeVarint64ZigZag = function (e, t) {
  36064. return this.writeVarint64(o.zigZagEncode64(e), t)
  36065. }),
  36066. (a.readVarint64 = function (t) {
  36067. var i = 'undefined' == typeof t
  36068. if ((i && (t = this.offset), !this.noAssert)) {
  36069. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: ' + t + ' (not an integer)')
  36070. if (((t >>>= 0), t < 0 || t + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + t + ' (+1) <= ' + this.buffer.byteLength)
  36071. }
  36072. var n = t,
  36073. r = 0,
  36074. o = 0,
  36075. a = 0,
  36076. s = 0
  36077. if (
  36078. ((s = this.view[t++]),
  36079. (r = 127 & s),
  36080. 128 & s &&
  36081. ((s = this.view[t++]),
  36082. (r |= (127 & s) << 7),
  36083. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36084. ((s = this.view[t++]),
  36085. (r |= (127 & s) << 14),
  36086. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36087. ((s = this.view[t++]),
  36088. (r |= (127 & s) << 21),
  36089. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36090. ((s = this.view[t++]),
  36091. (o = 127 & s),
  36092. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36093. ((s = this.view[t++]),
  36094. (o |= (127 & s) << 7),
  36095. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36096. ((s = this.view[t++]),
  36097. (o |= (127 & s) << 14),
  36098. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36099. ((s = this.view[t++]),
  36100. (o |= (127 & s) << 21),
  36101. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36102. ((s = this.view[t++]),
  36103. (a = 127 & s),
  36104. (128 & s || (this.noAssert && 'undefined' == typeof s)) &&
  36105. ((s = this.view[t++]), (a |= (127 & s) << 7), 128 & s || (this.noAssert && 'undefined' == typeof s)))))))))))
  36106. )
  36107. throw Error('Buffer overrun')
  36108. var l = e.fromBits(r | (o << 28), (o >>> 4) | (a << 24), !1)
  36109. return i
  36110. ? ((this.offset = t), l)
  36111. : {
  36112. value: l,
  36113. length: t - n
  36114. }
  36115. }),
  36116. (a.readVarint64ZigZag = function (t) {
  36117. var i = this.readVarint64(t)
  36118. return i && i.value instanceof e ? (i.value = o.zigZagDecode64(i.value)) : (i = o.zigZagDecode64(i)), i
  36119. })),
  36120. (a.writeCString = function (e, i) {
  36121. var n = 'undefined' == typeof i
  36122. n && (i = this.offset)
  36123. var r,
  36124. o = e.length
  36125. if (!this.noAssert) {
  36126. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  36127. for (r = 0; r < o; ++r) if (0 === e.charCodeAt(r)) throw RangeError('Illegal str: Contains NULL-characters')
  36128. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36129. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36130. }
  36131. ;(o = h.calculateUTF16asUTF8(t(e))[1]), (i += o + 1)
  36132. var a = this.buffer.byteLength
  36133. return (
  36134. i > a && this.resize((a *= 2) > i ? a : i),
  36135. (i -= o + 1),
  36136. h.encodeUTF16toUTF8(
  36137. t(e),
  36138. function (e) {
  36139. this.view[i++] = e
  36140. }.bind(this)
  36141. ),
  36142. (this.view[i++] = 0),
  36143. n ? ((this.offset = i), this) : o
  36144. )
  36145. }),
  36146. (a.readCString = function (e) {
  36147. var t = 'undefined' == typeof e
  36148. if ((t && (e = this.offset), !this.noAssert)) {
  36149. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36150. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  36151. }
  36152. var n,
  36153. r = e,
  36154. o = -1
  36155. return (
  36156. h.decodeUTF8toUTF16(
  36157. function () {
  36158. if (0 === o) return null
  36159. if (e >= this.limit) throw RangeError('Illegal range: Truncated data, ' + e + ' < ' + this.limit)
  36160. return (o = this.view[e++]), 0 === o ? null : o
  36161. }.bind(this),
  36162. (n = i()),
  36163. !0
  36164. ),
  36165. t
  36166. ? ((this.offset = e), n())
  36167. : {
  36168. string: n(),
  36169. length: e - r
  36170. }
  36171. )
  36172. }),
  36173. (a.writeIString = function (e, i) {
  36174. var n = 'undefined' == typeof i
  36175. if ((n && (i = this.offset), !this.noAssert)) {
  36176. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  36177. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36178. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36179. }
  36180. var r,
  36181. o = i
  36182. ;(r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]), (i += 4 + r)
  36183. var a = this.buffer.byteLength
  36184. if (
  36185. (i > a && this.resize((a *= 2) > i ? a : i),
  36186. (i -= 4 + r),
  36187. this.littleEndian
  36188. ? ((this.view[i + 3] = (r >>> 24) & 255), (this.view[i + 2] = (r >>> 16) & 255), (this.view[i + 1] = (r >>> 8) & 255), (this.view[i] = 255 & r))
  36189. : ((this.view[i] = (r >>> 24) & 255), (this.view[i + 1] = (r >>> 16) & 255), (this.view[i + 2] = (r >>> 8) & 255), (this.view[i + 3] = 255 & r)),
  36190. (i += 4),
  36191. h.encodeUTF16toUTF8(
  36192. t(e),
  36193. function (e) {
  36194. this.view[i++] = e
  36195. }.bind(this)
  36196. ),
  36197. i !== o + 4 + r)
  36198. )
  36199. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + 4 + r))
  36200. return n ? ((this.offset = i), this) : i - o
  36201. }),
  36202. (a.readIString = function (e) {
  36203. var t = 'undefined' == typeof e
  36204. if ((t && (e = this.offset), !this.noAssert)) {
  36205. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36206. if (((e >>>= 0), e < 0 || e + 4 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+4) <= ' + this.buffer.byteLength)
  36207. }
  36208. var i = e,
  36209. n = this.readUint32(e),
  36210. r = this.readUTF8String(n, o.METRICS_BYTES, (e += 4))
  36211. return (
  36212. (e += r.length),
  36213. t
  36214. ? ((this.offset = e), r.string)
  36215. : {
  36216. string: r.string,
  36217. length: e - i
  36218. }
  36219. )
  36220. }),
  36221. (o.METRICS_CHARS = 'c'),
  36222. (o.METRICS_BYTES = 'b'),
  36223. (a.writeUTF8String = function (e, i) {
  36224. var n = 'undefined' == typeof i
  36225. if ((n && (i = this.offset), !this.noAssert)) {
  36226. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36227. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36228. }
  36229. var r,
  36230. o = i
  36231. ;(r = h.calculateUTF16asUTF8(t(e))[1]), (i += r)
  36232. var a = this.buffer.byteLength
  36233. return (
  36234. i > a && this.resize((a *= 2) > i ? a : i),
  36235. (i -= r),
  36236. h.encodeUTF16toUTF8(
  36237. t(e),
  36238. function (e) {
  36239. this.view[i++] = e
  36240. }.bind(this)
  36241. ),
  36242. n ? ((this.offset = i), this) : i - o
  36243. )
  36244. }),
  36245. (a.writeString = a.writeUTF8String),
  36246. (o.calculateUTF8Chars = function (e) {
  36247. return h.calculateUTF16asUTF8(t(e))[0]
  36248. }),
  36249. (o.calculateUTF8Bytes = function (e) {
  36250. return h.calculateUTF16asUTF8(t(e))[1]
  36251. }),
  36252. (o.calculateString = o.calculateUTF8Bytes),
  36253. (a.readUTF8String = function (e, t, n) {
  36254. 'number' == typeof t && ((n = t), (t = void 0))
  36255. var r = 'undefined' == typeof n
  36256. if ((r && (n = this.offset), 'undefined' == typeof t && (t = o.METRICS_CHARS), !this.noAssert)) {
  36257. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal length: ' + e + ' (not an integer)')
  36258. if (((e |= 0), 'number' != typeof n || n % 1 !== 0)) throw TypeError('Illegal offset: ' + n + ' (not an integer)')
  36259. if (((n >>>= 0), n < 0 || n + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + n + ' (+0) <= ' + this.buffer.byteLength)
  36260. }
  36261. var a,
  36262. s = 0,
  36263. l = n
  36264. if (t === o.METRICS_CHARS) {
  36265. if (
  36266. ((a = i()),
  36267. h.decodeUTF8(
  36268. function () {
  36269. return s < e && n < this.limit ? this.view[n++] : null
  36270. }.bind(this),
  36271. function (e) {
  36272. ++s, h.UTF8toUTF16(e, a)
  36273. }
  36274. ),
  36275. s !== e)
  36276. )
  36277. throw RangeError('Illegal range: Truncated data, ' + s + ' == ' + e)
  36278. return r
  36279. ? ((this.offset = n), a())
  36280. : {
  36281. string: a(),
  36282. length: n - l
  36283. }
  36284. }
  36285. if (t === o.METRICS_BYTES) {
  36286. if (!this.noAssert) {
  36287. if ('number' != typeof n || n % 1 !== 0) throw TypeError('Illegal offset: ' + n + ' (not an integer)')
  36288. if (((n >>>= 0), n < 0 || n + e > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + n + ' (+' + e + ') <= ' + this.buffer.byteLength)
  36289. }
  36290. var c = n + e
  36291. if (
  36292. (h.decodeUTF8toUTF16(
  36293. function () {
  36294. return n < c ? this.view[n++] : null
  36295. }.bind(this),
  36296. (a = i()),
  36297. this.noAssert
  36298. ),
  36299. n !== c)
  36300. )
  36301. throw RangeError('Illegal range: Truncated data, ' + n + ' == ' + c)
  36302. return r
  36303. ? ((this.offset = n), a())
  36304. : {
  36305. string: a(),
  36306. length: n - l
  36307. }
  36308. }
  36309. throw TypeError('Unsupported metrics: ' + t)
  36310. }),
  36311. (a.readString = a.readUTF8String),
  36312. (a.writeVString = function (e, i) {
  36313. var n = 'undefined' == typeof i
  36314. if ((n && (i = this.offset), !this.noAssert)) {
  36315. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  36316. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36317. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36318. }
  36319. var r,
  36320. a,
  36321. s = i
  36322. ;(r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1]), (a = o.calculateVarint32(r)), (i += a + r)
  36323. var l = this.buffer.byteLength
  36324. if (
  36325. (i > l && this.resize((l *= 2) > i ? l : i),
  36326. (i -= a + r),
  36327. (i += this.writeVarint32(r, i)),
  36328. h.encodeUTF16toUTF8(
  36329. t(e),
  36330. function (e) {
  36331. this.view[i++] = e
  36332. }.bind(this)
  36333. ),
  36334. i !== s + r + a)
  36335. )
  36336. throw RangeError('Illegal range: Truncated data, ' + i + ' == ' + (i + r + a))
  36337. return n ? ((this.offset = i), this) : i - s
  36338. }),
  36339. (a.readVString = function (e) {
  36340. var t = 'undefined' == typeof e
  36341. if ((t && (e = this.offset), !this.noAssert)) {
  36342. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36343. if (((e >>>= 0), e < 0 || e + 1 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+1) <= ' + this.buffer.byteLength)
  36344. }
  36345. var i = e,
  36346. n = this.readVarint32(e),
  36347. r = this.readUTF8String(n.value, o.METRICS_BYTES, (e += n.length))
  36348. return (
  36349. (e += r.length),
  36350. t
  36351. ? ((this.offset = e), r.string)
  36352. : {
  36353. string: r.string,
  36354. length: e - i
  36355. }
  36356. )
  36357. }),
  36358. (a.append = function (e, t, i) {
  36359. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  36360. var n = 'undefined' == typeof i
  36361. if ((n && (i = this.offset), !this.noAssert)) {
  36362. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36363. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36364. }
  36365. e instanceof o || (e = o.wrap(e, t))
  36366. var r = e.limit - e.offset
  36367. if (r <= 0) return this
  36368. i += r
  36369. var a = this.buffer.byteLength
  36370. return i > a && this.resize((a *= 2) > i ? a : i), (i -= r), this.view.set(e.view.subarray(e.offset, e.limit), i), (e.offset += r), n && (this.offset += r), this
  36371. }),
  36372. (a.appendTo = function (e, t) {
  36373. return e.append(this, t), this
  36374. }),
  36375. (a.assert = function (e) {
  36376. return (this.noAssert = !e), this
  36377. }),
  36378. (a.capacity = function () {
  36379. return this.buffer.byteLength
  36380. }),
  36381. (a.clear = function () {
  36382. return (this.offset = 0), (this.limit = this.buffer.byteLength), (this.markedOffset = -1), this
  36383. }),
  36384. (a.clone = function (e) {
  36385. var t = new o(0, this.littleEndian, this.noAssert)
  36386. return (
  36387. e ? ((t.buffer = new ArrayBuffer(this.buffer.byteLength)), (t.view = new Uint8Array(t.buffer))) : ((t.buffer = this.buffer), (t.view = this.view)),
  36388. (t.offset = this.offset),
  36389. (t.markedOffset = this.markedOffset),
  36390. (t.limit = this.limit),
  36391. t
  36392. )
  36393. }),
  36394. (a.compact = function (e, t) {
  36395. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36396. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36397. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36398. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36399. }
  36400. if (0 === e && t === this.buffer.byteLength) return this
  36401. var i = t - e
  36402. if (0 === i) return (this.buffer = s), (this.view = null), this.markedOffset >= 0 && (this.markedOffset -= e), (this.offset = 0), (this.limit = 0), this
  36403. var n = new ArrayBuffer(i),
  36404. r = new Uint8Array(n)
  36405. return r.set(this.view.subarray(e, t)), (this.buffer = n), (this.view = r), this.markedOffset >= 0 && (this.markedOffset -= e), (this.offset = 0), (this.limit = i), this
  36406. }),
  36407. (a.copy = function (e, t) {
  36408. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36409. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36410. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36411. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36412. }
  36413. if (e === t) return new o(0, this.littleEndian, this.noAssert)
  36414. var i = t - e,
  36415. n = new o(i, this.littleEndian, this.noAssert)
  36416. return (n.offset = 0), (n.limit = i), n.markedOffset >= 0 && (n.markedOffset -= e), this.copyTo(n, 0, e, t), n
  36417. }),
  36418. (a.copyTo = function (e, t, i, n) {
  36419. var r, a
  36420. if (!this.noAssert && !o.isByteBuffer(e)) throw TypeError('Illegal target: Not a ByteBuffer')
  36421. if (
  36422. ((t = (a = 'undefined' == typeof t) ? e.offset : 0 | t),
  36423. (i = (r = 'undefined' == typeof i) ? this.offset : 0 | i),
  36424. (n = 'undefined' == typeof n ? this.limit : 0 | n),
  36425. t < 0 || t > e.buffer.byteLength)
  36426. )
  36427. throw RangeError('Illegal target range: 0 <= ' + t + ' <= ' + e.buffer.byteLength)
  36428. if (i < 0 || n > this.buffer.byteLength) throw RangeError('Illegal source range: 0 <= ' + i + ' <= ' + this.buffer.byteLength)
  36429. var s = n - i
  36430. return 0 === s ? e : (e.ensureCapacity(t + s), e.view.set(this.view.subarray(i, n), t), r && (this.offset += s), a && (e.offset += s), this)
  36431. }),
  36432. (a.ensureCapacity = function (e) {
  36433. var t = this.buffer.byteLength
  36434. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  36435. }),
  36436. (a.fill = function (e, t, i) {
  36437. var n = 'undefined' == typeof t
  36438. if (
  36439. (n && (t = this.offset),
  36440. 'string' == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  36441. 'undefined' == typeof t && (t = this.offset),
  36442. 'undefined' == typeof i && (i = this.limit),
  36443. !this.noAssert)
  36444. ) {
  36445. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal value: ' + e + ' (not an integer)')
  36446. if (((e |= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal begin: Not an integer')
  36447. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36448. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  36449. }
  36450. if (t >= i) return this
  36451. for (; t < i; ) this.view[t++] = e
  36452. return n && (this.offset = t), this
  36453. }),
  36454. (a.flip = function () {
  36455. return (this.limit = this.offset), (this.offset = 0), this
  36456. }),
  36457. (a.mark = function (e) {
  36458. if (((e = 'undefined' == typeof e ? this.offset : e), !this.noAssert)) {
  36459. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal offset: ' + e + ' (not an integer)')
  36460. if (((e >>>= 0), e < 0 || e + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + e + ' (+0) <= ' + this.buffer.byteLength)
  36461. }
  36462. return (this.markedOffset = e), this
  36463. }),
  36464. (a.order = function (e) {
  36465. if (!this.noAssert && 'boolean' != typeof e) throw TypeError('Illegal littleEndian: Not a boolean')
  36466. return (this.littleEndian = !!e), this
  36467. }),
  36468. (a.LE = function (e) {
  36469. return (this.littleEndian = 'undefined' == typeof e || !!e), this
  36470. }),
  36471. (a.BE = function (e) {
  36472. return (this.littleEndian = 'undefined' != typeof e && !e), this
  36473. }),
  36474. (a.prepend = function (e, t, i) {
  36475. ;('number' != typeof t && 'string' == typeof t) || ((i = t), (t = void 0))
  36476. var n = 'undefined' == typeof i
  36477. if ((n && (i = this.offset), !this.noAssert)) {
  36478. if ('number' != typeof i || i % 1 !== 0) throw TypeError('Illegal offset: ' + i + ' (not an integer)')
  36479. if (((i >>>= 0), i < 0 || i + 0 > this.buffer.byteLength)) throw RangeError('Illegal offset: 0 <= ' + i + ' (+0) <= ' + this.buffer.byteLength)
  36480. }
  36481. e instanceof o || (e = o.wrap(e, t))
  36482. var r = e.limit - e.offset
  36483. if (r <= 0) return this
  36484. var a = r - i
  36485. if (a > 0) {
  36486. var s = new ArrayBuffer(this.buffer.byteLength + a),
  36487. l = new Uint8Array(s)
  36488. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  36489. (this.buffer = s),
  36490. (this.view = l),
  36491. (this.offset += a),
  36492. this.markedOffset >= 0 && (this.markedOffset += a),
  36493. (this.limit += a),
  36494. (i += a)
  36495. } else {
  36496. new Uint8Array(this.buffer)
  36497. }
  36498. return this.view.set(e.view.subarray(e.offset, e.limit), i - r), (e.offset = e.limit), n && (this.offset -= r), this
  36499. }),
  36500. (a.prependTo = function (e, t) {
  36501. return e.prepend(this, t), this
  36502. }),
  36503. (a.printDebug = function (e) {
  36504. 'function' != typeof e && (e = console.log.bind(console)), e(this.toString() + '\n-------------------------------------------------------------------\n' + this.toDebug(!0))
  36505. }),
  36506. (a.remaining = function () {
  36507. return this.limit - this.offset
  36508. }),
  36509. (a.reset = function () {
  36510. return this.markedOffset >= 0 ? ((this.offset = this.markedOffset), (this.markedOffset = -1)) : (this.offset = 0), this
  36511. }),
  36512. (a.resize = function (e) {
  36513. if (!this.noAssert) {
  36514. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal capacity: ' + e + ' (not an integer)')
  36515. if (((e |= 0), e < 0)) throw RangeError('Illegal capacity: 0 <= ' + e)
  36516. }
  36517. if (this.buffer.byteLength < e) {
  36518. var t = new ArrayBuffer(e),
  36519. i = new Uint8Array(t)
  36520. i.set(this.view), (this.buffer = t), (this.view = i)
  36521. }
  36522. return this
  36523. }),
  36524. (a.reverse = function (e, t) {
  36525. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36526. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36527. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36528. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36529. }
  36530. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)), this)
  36531. }),
  36532. (a.skip = function (e) {
  36533. if (!this.noAssert) {
  36534. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal length: ' + e + ' (not an integer)')
  36535. e |= 0
  36536. }
  36537. var t = this.offset + e
  36538. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength)) throw RangeError('Illegal length: 0 <= ' + this.offset + ' + ' + e + ' <= ' + this.buffer.byteLength)
  36539. return (this.offset = t), this
  36540. }),
  36541. (a.slice = function (e, t) {
  36542. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36543. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36544. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36545. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36546. }
  36547. var i = this.clone()
  36548. return (i.offset = e), (i.limit = t), i
  36549. }),
  36550. (a.toBuffer = function (e) {
  36551. var t = this.offset,
  36552. i = this.limit
  36553. if (!this.noAssert) {
  36554. if ('number' != typeof t || t % 1 !== 0) throw TypeError('Illegal offset: Not an integer')
  36555. if (((t >>>= 0), 'number' != typeof i || i % 1 !== 0)) throw TypeError('Illegal limit: Not an integer')
  36556. if (((i >>>= 0), t < 0 || t > i || i > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + t + ' <= ' + i + ' <= ' + this.buffer.byteLength)
  36557. }
  36558. if (!e && 0 === t && i === this.buffer.byteLength) return this.buffer
  36559. if (t === i) return s
  36560. var n = new ArrayBuffer(i - t)
  36561. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0), n
  36562. }),
  36563. (a.toArrayBuffer = a.toBuffer),
  36564. (a.toString = function (e, t, i) {
  36565. if ('undefined' == typeof e) return 'ByteBufferAB(offset=' + this.offset + ',markedOffset=' + this.markedOffset + ',limit=' + this.limit + ',capacity=' + this.capacity() + ')'
  36566. switch (('number' == typeof e && ((e = 'utf8'), (t = e), (i = t)), e)) {
  36567. case 'utf8':
  36568. return this.toUTF8(t, i)
  36569. case 'base64':
  36570. return this.toBase64(t, i)
  36571. case 'hex':
  36572. return this.toHex(t, i)
  36573. case 'binary':
  36574. return this.toBinary(t, i)
  36575. case 'debug':
  36576. return this.toDebug()
  36577. case 'columns':
  36578. return this.toColumns()
  36579. default:
  36580. throw Error('Unsupported encoding: ' + e)
  36581. }
  36582. })
  36583. var c = (function () {
  36584. for (
  36585. var e = {},
  36586. t = [
  36587. 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,
  36588. 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47
  36589. ],
  36590. i = [],
  36591. n = 0,
  36592. r = t.length;
  36593. n < r;
  36594. ++n
  36595. )
  36596. i[t[n]] = n
  36597. return (
  36598. (e.encode = function (e, i) {
  36599. for (var n, r; null !== (n = e()); )
  36600. i(t[(n >> 2) & 63]),
  36601. (r = (3 & n) << 4),
  36602. null !== (n = e())
  36603. ? ((r |= (n >> 4) & 15), i(t[63 & (r | ((n >> 4) & 15))]), (r = (15 & n) << 2), null !== (n = e()) ? (i(t[63 & (r | ((n >> 6) & 3))]), i(t[63 & n])) : (i(t[63 & r]), i(61)))
  36604. : (i(t[63 & r]), i(61), i(61))
  36605. }),
  36606. (e.decode = function (e, t) {
  36607. function n(e) {
  36608. throw Error('Illegal character code: ' + e)
  36609. }
  36610. for (var r, o, a; null !== (r = e()); )
  36611. if (((o = i[r]), 'undefined' == typeof o && n(r), null !== (r = e()) && ((a = i[r]), 'undefined' == typeof a && n(r), t(((o << 2) >>> 0) | ((48 & a) >> 4)), null !== (r = e())))) {
  36612. if (((o = i[r]), 'undefined' == typeof o)) {
  36613. if (61 === r) break
  36614. n(r)
  36615. }
  36616. if ((t((((15 & a) << 4) >>> 0) | ((60 & o) >> 2)), null !== (r = e()))) {
  36617. if (((a = i[r]), 'undefined' == typeof a)) {
  36618. if (61 === r) break
  36619. n(r)
  36620. }
  36621. t((((3 & o) << 6) >>> 0) | a)
  36622. }
  36623. }
  36624. }),
  36625. (e.test = function (e) {
  36626. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  36627. }),
  36628. e
  36629. )
  36630. })()
  36631. ;(a.toBase64 = function (e, t) {
  36632. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), (e |= 0), (t |= 0), e < 0 || t > this.capacity || e > t)) throw RangeError('begin, end')
  36633. var n
  36634. return (
  36635. c.encode(
  36636. function () {
  36637. return e < t ? this.view[e++] : null
  36638. }.bind(this),
  36639. (n = i())
  36640. ),
  36641. n()
  36642. )
  36643. }),
  36644. (o.fromBase64 = function (e, i) {
  36645. if ('string' != typeof e) throw TypeError('str')
  36646. var n = new o((e.length / 4) * 3, i),
  36647. r = 0
  36648. return (
  36649. c.decode(t(e), function (e) {
  36650. n.view[r++] = e
  36651. }),
  36652. (n.limit = r),
  36653. n
  36654. )
  36655. }),
  36656. (o.btoa = function (e) {
  36657. return o.fromBinary(e).toBase64()
  36658. }),
  36659. (o.atob = function (e) {
  36660. return o.fromBase64(e).toBinary()
  36661. }),
  36662. (a.toBinary = function (e, t) {
  36663. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), (e |= 0), (t |= 0), e < 0 || t > this.capacity() || e > t)) throw RangeError('begin, end')
  36664. if (e === t) return ''
  36665. for (var i = [], n = []; e < t; ) i.push(this.view[e++]), i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)), (i = []))
  36666. return n.join('') + String.fromCharCode.apply(String, i)
  36667. }),
  36668. (o.fromBinary = function (e, t) {
  36669. if ('string' != typeof e) throw TypeError('str')
  36670. for (var i, n = 0, r = e.length, a = new o(r, t); n < r; ) {
  36671. if (((i = e.charCodeAt(n)), i > 255)) throw RangeError('illegal char code: ' + i)
  36672. a.view[n++] = i
  36673. }
  36674. return (a.limit = r), a
  36675. }),
  36676. (a.toDebug = function (e) {
  36677. for (var t, i = -1, n = this.buffer.byteLength, r = '', o = '', a = ''; i < n; ) {
  36678. if (
  36679. (i !== -1 && ((t = this.view[i]), (r += t < 16 ? '0' + t.toString(16).toUpperCase() : t.toString(16).toUpperCase()), e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : '.')),
  36680. ++i,
  36681. e && i > 0 && i % 16 === 0 && i !== n)
  36682. ) {
  36683. for (; r.length < 51; ) r += ' '
  36684. ;(a += r + o + '\n'), (r = o = '')
  36685. }
  36686. r +=
  36687. i === this.offset && i === this.limit
  36688. ? i === this.markedOffset
  36689. ? '!'
  36690. : '|'
  36691. : i === this.offset
  36692. ? i === this.markedOffset
  36693. ? '['
  36694. : '<'
  36695. : i === this.limit
  36696. ? i === this.markedOffset
  36697. ? ']'
  36698. : '>'
  36699. : i === this.markedOffset
  36700. ? "'"
  36701. : e || (0 !== i && i !== n)
  36702. ? ' '
  36703. : ''
  36704. }
  36705. if (e && ' ' !== r) {
  36706. for (; r.length < 51; ) r += ' '
  36707. a += r + o + '\n'
  36708. }
  36709. return e ? a : r
  36710. }),
  36711. (o.fromDebug = function (e, t, i) {
  36712. 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; ) {
  36713. switch ((n = e.charAt(l++))) {
  36714. case '!':
  36715. if (!i) {
  36716. if (u || d || p) {
  36717. f = !0
  36718. break
  36719. }
  36720. u = d = p = !0
  36721. }
  36722. ;(s.offset = s.markedOffset = s.limit = c), (h = !1)
  36723. break
  36724. case '|':
  36725. if (!i) {
  36726. if (u || p) {
  36727. f = !0
  36728. break
  36729. }
  36730. u = p = !0
  36731. }
  36732. ;(s.offset = s.limit = c), (h = !1)
  36733. break
  36734. case '[':
  36735. if (!i) {
  36736. if (u || d) {
  36737. f = !0
  36738. break
  36739. }
  36740. u = d = !0
  36741. }
  36742. ;(s.offset = s.markedOffset = c), (h = !1)
  36743. break
  36744. case '<':
  36745. if (!i) {
  36746. if (u) {
  36747. f = !0
  36748. break
  36749. }
  36750. u = !0
  36751. }
  36752. ;(s.offset = c), (h = !1)
  36753. break
  36754. case ']':
  36755. if (!i) {
  36756. if (p || d) {
  36757. f = !0
  36758. break
  36759. }
  36760. p = d = !0
  36761. }
  36762. ;(s.limit = s.markedOffset = c), (h = !1)
  36763. break
  36764. case '>':
  36765. if (!i) {
  36766. if (p) {
  36767. f = !0
  36768. break
  36769. }
  36770. p = !0
  36771. }
  36772. ;(s.limit = c), (h = !1)
  36773. break
  36774. case "'":
  36775. if (!i) {
  36776. if (d) {
  36777. f = !0
  36778. break
  36779. }
  36780. d = !0
  36781. }
  36782. ;(s.markedOffset = c), (h = !1)
  36783. break
  36784. case ' ':
  36785. h = !1
  36786. break
  36787. default:
  36788. if (!i && h) {
  36789. f = !0
  36790. break
  36791. }
  36792. if (((r = parseInt(n + e.charAt(l++), 16)), !i && (isNaN(r) || r < 0 || r > 255))) throw TypeError('Illegal str: Not a debug encoded string')
  36793. ;(s.view[c++] = r), (h = !0)
  36794. }
  36795. if (f) throw TypeError('Illegal str: Invalid symbol at ' + l)
  36796. }
  36797. if (!i) {
  36798. if (!u || !p) throw TypeError('Illegal str: Missing offset or limit')
  36799. if (c < s.buffer.byteLength) throw TypeError('Illegal str: Not a debug encoded string (is it hex?) ' + c + ' < ' + a)
  36800. }
  36801. return s
  36802. }),
  36803. (a.toHex = function (e, t) {
  36804. if (((e = 'undefined' == typeof e ? this.offset : e), (t = 'undefined' == typeof t ? this.limit : t), !this.noAssert)) {
  36805. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36806. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36807. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36808. }
  36809. for (var i, n = new Array(t - e); e < t; ) (i = this.view[e++]), i < 16 ? n.push('0', i.toString(16)) : n.push(i.toString(16))
  36810. return n.join('')
  36811. }),
  36812. (o.fromHex = function (e, t, i) {
  36813. if (!i) {
  36814. if ('string' != typeof e) throw TypeError('Illegal str: Not a string')
  36815. if (e.length % 2 !== 0) throw TypeError('Illegal str: Length not a multiple of 2')
  36816. }
  36817. for (var n, r = e.length, a = new o((r / 2) | 0, t), s = 0, l = 0; s < r; s += 2) {
  36818. if (((n = parseInt(e.substring(s, s + 2), 16)), !i && (!isFinite(n) || n < 0 || n > 255))) throw TypeError('Illegal str: Contains non-hex characters')
  36819. a.view[l++] = n
  36820. }
  36821. return (a.limit = l), a
  36822. })
  36823. var h = (function () {
  36824. var e = {}
  36825. return (
  36826. (e.MAX_CODEPOINT = 1114111),
  36827. (e.encodeUTF8 = function (e, t) {
  36828. var i = null
  36829. for (
  36830. 'number' == typeof e &&
  36831. ((i = e),
  36832. (e = function () {
  36833. return null
  36834. }));
  36835. null !== i || null !== (i = e());
  36836. )
  36837. i < 128
  36838. ? t(127 & i)
  36839. : i < 2048
  36840. ? (t(((i >> 6) & 31) | 192), t((63 & i) | 128))
  36841. : i < 65536
  36842. ? (t(((i >> 12) & 15) | 224), t(((i >> 6) & 63) | 128), t((63 & i) | 128))
  36843. : (t(((i >> 18) & 7) | 240), t(((i >> 12) & 63) | 128), t(((i >> 6) & 63) | 128), t((63 & i) | 128)),
  36844. (i = null)
  36845. }),
  36846. (e.decodeUTF8 = function (e, t) {
  36847. for (
  36848. var i,
  36849. n,
  36850. r,
  36851. o,
  36852. a = function (e) {
  36853. e = e.slice(0, e.indexOf(null))
  36854. var t = Error(e.toString())
  36855. throw ((t.name = 'TruncatedError'), (t.bytes = e), t)
  36856. };
  36857. null !== (i = e());
  36858. )
  36859. if (0 === (128 & i)) t(i)
  36860. else if (192 === (224 & i)) null === (n = e()) && a([i, n]), t(((31 & i) << 6) | (63 & n))
  36861. else if (224 === (240 & i)) (null === (n = e()) || null === (r = e())) && a([i, n, r]), t(((15 & i) << 12) | ((63 & n) << 6) | (63 & r))
  36862. else {
  36863. if (240 !== (248 & i)) throw RangeError('Illegal starting byte: ' + i)
  36864. ;(null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]), t(((7 & i) << 18) | ((63 & n) << 12) | ((63 & r) << 6) | (63 & o))
  36865. }
  36866. }),
  36867. (e.UTF16toUTF8 = function (e, t) {
  36868. for (var i, n = null; ; ) {
  36869. if (null === (i = null !== n ? n : e())) break
  36870. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536), (n = null)) : t(i)
  36871. }
  36872. null !== n && t(n)
  36873. }),
  36874. (e.UTF8toUTF16 = function (e, t) {
  36875. var i = null
  36876. for (
  36877. 'number' == typeof e &&
  36878. ((i = e),
  36879. (e = function () {
  36880. return null
  36881. }));
  36882. null !== i || null !== (i = e());
  36883. )
  36884. i <= 65535 ? t(i) : ((i -= 65536), t((i >> 10) + 55296), t((i % 1024) + 56320)), (i = null)
  36885. }),
  36886. (e.encodeUTF16toUTF8 = function (t, i) {
  36887. e.UTF16toUTF8(t, function (t) {
  36888. e.encodeUTF8(t, i)
  36889. })
  36890. }),
  36891. (e.decodeUTF8toUTF16 = function (t, i) {
  36892. e.decodeUTF8(t, function (t) {
  36893. e.UTF8toUTF16(t, i)
  36894. })
  36895. }),
  36896. (e.calculateCodePoint = function (e) {
  36897. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36898. }),
  36899. (e.calculateUTF8 = function (e) {
  36900. for (var t, i = 0; null !== (t = e()); ) i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4
  36901. return i
  36902. }),
  36903. (e.calculateUTF16asUTF8 = function (t) {
  36904. var i = 0,
  36905. n = 0
  36906. return (
  36907. e.UTF16toUTF8(t, function (e) {
  36908. ++i, (n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4)
  36909. }),
  36910. [i, n]
  36911. )
  36912. }),
  36913. e
  36914. )
  36915. })()
  36916. return (
  36917. (a.toUTF8 = function (e, t) {
  36918. if (('undefined' == typeof e && (e = this.offset), 'undefined' == typeof t && (t = this.limit), !this.noAssert)) {
  36919. if ('number' != typeof e || e % 1 !== 0) throw TypeError('Illegal begin: Not an integer')
  36920. if (((e >>>= 0), 'number' != typeof t || t % 1 !== 0)) throw TypeError('Illegal end: Not an integer')
  36921. if (((t >>>= 0), e < 0 || e > t || t > this.buffer.byteLength)) throw RangeError('Illegal range: 0 <= ' + e + ' <= ' + t + ' <= ' + this.buffer.byteLength)
  36922. }
  36923. var n
  36924. try {
  36925. h.decodeUTF8toUTF16(
  36926. function () {
  36927. return e < t ? this.view[e++] : null
  36928. }.bind(this),
  36929. (n = i())
  36930. )
  36931. } catch (i) {
  36932. if (e !== t) throw RangeError('Illegal range: Truncated data, ' + e + ' != ' + t)
  36933. }
  36934. return n()
  36935. }),
  36936. (o.fromUTF8 = function (e, i, n) {
  36937. if (!n && 'string' != typeof e) throw TypeError('Illegal str: Not a string')
  36938. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1], i, n),
  36939. a = 0
  36940. return (
  36941. h.encodeUTF16toUTF8(t(e), function (e) {
  36942. r.view[a++] = e
  36943. }),
  36944. (r.limit = a),
  36945. r
  36946. )
  36947. }),
  36948. o
  36949. )
  36950. })
  36951. },
  36952. {
  36953. long: 216
  36954. }
  36955. ],
  36956. 216: [
  36957. function (e, t, i) {
  36958. !(function (i, n) {
  36959. '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())
  36960. })(this, function () {
  36961. 'use strict'
  36962. function e(e, t, i) {
  36963. ;(this.low = 0 | e), (this.high = 0 | t), (this.unsigned = !!i)
  36964. }
  36965. function t(e) {
  36966. return (e && e.__isLong__) === !0
  36967. }
  36968. function i(e, t) {
  36969. var i, n, o
  36970. return t
  36971. ? ((e >>>= 0), (o = 0 <= e && e < 256) && (n = l[e]) ? n : ((i = r(e, (0 | e) < 0 ? -1 : 0, !0)), o && (l[e] = i), i))
  36972. : ((e |= 0), (o = -128 <= e && e < 128) && (n = s[e]) ? n : ((i = r(e, e < 0 ? -1 : 0, !1)), o && (s[e] = i), i))
  36973. }
  36974. function n(e, t) {
  36975. if (isNaN(e) || !isFinite(e)) return t ? m : g
  36976. if (t) {
  36977. if (e < 0) return m
  36978. if (e >= d) return I
  36979. } else {
  36980. if (e <= -p) return E
  36981. if (e + 1 >= p) return C
  36982. }
  36983. return e < 0 ? n(-e, t).neg() : r(e % u | 0, (e / u) | 0, t)
  36984. }
  36985. function r(t, i, n) {
  36986. return new e(t, i, n)
  36987. }
  36988. function o(e, t, i) {
  36989. if (0 === e.length) throw Error('empty string')
  36990. if ('NaN' === e || 'Infinity' === e || '+Infinity' === e || '-Infinity' === e) return g
  36991. if (('number' == typeof t ? ((i = t), (t = !1)) : (t = !!t), (i = i || 10), i < 2 || 36 < i)) throw RangeError('radix')
  36992. var r
  36993. if ((r = e.indexOf('-')) > 0) throw Error('interior hyphen')
  36994. if (0 === r) return o(e.substring(1), t, i).neg()
  36995. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  36996. var h = Math.min(8, e.length - l),
  36997. u = parseInt(e.substring(l, l + h), i)
  36998. if (h < 8) {
  36999. var d = n(c(i, h))
  37000. s = s.mul(d).add(n(u))
  37001. } else (s = s.mul(a)), (s = s.add(n(u)))
  37002. }
  37003. return (s.unsigned = t), s
  37004. }
  37005. function a(t) {
  37006. return t instanceof e ? t : 'number' == typeof t ? n(t) : 'string' == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  37007. }
  37008. e.prototype.__isLong__,
  37009. Object.defineProperty(e.prototype, '__isLong__', {
  37010. value: !0,
  37011. enumerable: !1,
  37012. configurable: !1
  37013. }),
  37014. (e.isLong = t)
  37015. var s = {},
  37016. l = {}
  37017. ;(e.fromInt = i), (e.fromNumber = n), (e.fromBits = r)
  37018. var c = Math.pow
  37019. ;(e.fromString = o), (e.fromValue = a)
  37020. var h = 1 << 24,
  37021. u = 4294967296,
  37022. d = 0x10000000000000000,
  37023. p = d / 2,
  37024. f = i(h),
  37025. g = i(0)
  37026. e.ZERO = g
  37027. var m = i(0, !0)
  37028. e.UZERO = m
  37029. var v = i(1)
  37030. e.ONE = v
  37031. var A = i(1, !0)
  37032. e.UONE = A
  37033. var y = i(-1)
  37034. e.NEG_ONE = y
  37035. var C = r(-1, 2147483647, !1)
  37036. e.MAX_VALUE = C
  37037. var I = r(-1, -1, !0)
  37038. e.MAX_UNSIGNED_VALUE = I
  37039. var E = r(0, -2147483648, !1)
  37040. e.MIN_VALUE = E
  37041. var b = e.prototype
  37042. return (
  37043. (b.toInt = function () {
  37044. return this.unsigned ? this.low >>> 0 : this.low
  37045. }),
  37046. (b.toNumber = function () {
  37047. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  37048. }),
  37049. (b.toString = function (e) {
  37050. if (((e = e || 10), e < 2 || 36 < e)) throw RangeError('radix')
  37051. if (this.isZero()) return '0'
  37052. if (this.isNegative()) {
  37053. if (this.eq(E)) {
  37054. var t = n(e),
  37055. i = this.div(t),
  37056. r = i.mul(t).sub(this)
  37057. return i.toString(e) + r.toInt().toString(e)
  37058. }
  37059. return '-' + this.neg().toString(e)
  37060. }
  37061. for (var o = n(c(e, 6), this.unsigned), a = this, s = ''; ; ) {
  37062. var l = a.div(o),
  37063. h = a.sub(l.mul(o)).toInt() >>> 0,
  37064. u = h.toString(e)
  37065. if (((a = l), a.isZero())) return u + s
  37066. for (; u.length < 6; ) u = '0' + u
  37067. s = '' + u + s
  37068. }
  37069. }),
  37070. (b.getHighBits = function () {
  37071. return this.high
  37072. }),
  37073. (b.getHighBitsUnsigned = function () {
  37074. return this.high >>> 0
  37075. }),
  37076. (b.getLowBits = function () {
  37077. return this.low
  37078. }),
  37079. (b.getLowBitsUnsigned = function () {
  37080. return this.low >>> 0
  37081. }),
  37082. (b.getNumBitsAbs = function () {
  37083. if (this.isNegative()) return this.eq(E) ? 64 : this.neg().getNumBitsAbs()
  37084. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & (1 << t)); t--);
  37085. return 0 != this.high ? t + 33 : t + 1
  37086. }),
  37087. (b.isZero = function () {
  37088. return 0 === this.high && 0 === this.low
  37089. }),
  37090. (b.isNegative = function () {
  37091. return !this.unsigned && this.high < 0
  37092. }),
  37093. (b.isPositive = function () {
  37094. return this.unsigned || this.high >= 0
  37095. }),
  37096. (b.isOdd = function () {
  37097. return 1 === (1 & this.low)
  37098. }),
  37099. (b.isEven = function () {
  37100. return 0 === (1 & this.low)
  37101. }),
  37102. (b.equals = function (e) {
  37103. return t(e) || (e = a(e)), (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && this.high === e.high && this.low === e.low
  37104. }),
  37105. (b.eq = b.equals),
  37106. (b.notEquals = function (e) {
  37107. return !this.eq(e)
  37108. }),
  37109. (b.neq = b.notEquals),
  37110. (b.lessThan = function (e) {
  37111. return this.comp(e) < 0
  37112. }),
  37113. (b.lt = b.lessThan),
  37114. (b.lessThanOrEqual = function (e) {
  37115. return this.comp(e) <= 0
  37116. }),
  37117. (b.lte = b.lessThanOrEqual),
  37118. (b.greaterThan = function (e) {
  37119. return this.comp(e) > 0
  37120. }),
  37121. (b.gt = b.greaterThan),
  37122. (b.greaterThanOrEqual = function (e) {
  37123. return this.comp(e) >= 0
  37124. }),
  37125. (b.gte = b.greaterThanOrEqual),
  37126. (b.compare = function (e) {
  37127. if ((t(e) || (e = a(e)), this.eq(e))) return 0
  37128. var i = this.isNegative(),
  37129. n = e.isNegative()
  37130. return i && !n
  37131. ? -1
  37132. : !i && n
  37133. ? 1
  37134. : this.unsigned
  37135. ? e.high >>> 0 > this.high >>> 0 || (e.high === this.high && e.low >>> 0 > this.low >>> 0)
  37136. ? -1
  37137. : 1
  37138. : this.sub(e).isNegative()
  37139. ? -1
  37140. : 1
  37141. }),
  37142. (b.comp = b.compare),
  37143. (b.negate = function () {
  37144. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  37145. }),
  37146. (b.neg = b.negate),
  37147. (b.add = function (e) {
  37148. t(e) || (e = a(e))
  37149. var i = this.high >>> 16,
  37150. n = 65535 & this.high,
  37151. o = this.low >>> 16,
  37152. s = 65535 & this.low,
  37153. l = e.high >>> 16,
  37154. c = 65535 & e.high,
  37155. h = e.low >>> 16,
  37156. u = 65535 & e.low,
  37157. d = 0,
  37158. p = 0,
  37159. f = 0,
  37160. g = 0
  37161. return (
  37162. (g += s + u),
  37163. (f += g >>> 16),
  37164. (g &= 65535),
  37165. (f += o + h),
  37166. (p += f >>> 16),
  37167. (f &= 65535),
  37168. (p += n + c),
  37169. (d += p >>> 16),
  37170. (p &= 65535),
  37171. (d += i + l),
  37172. (d &= 65535),
  37173. r((f << 16) | g, (d << 16) | p, this.unsigned)
  37174. )
  37175. }),
  37176. (b.subtract = function (e) {
  37177. return t(e) || (e = a(e)), this.add(e.neg())
  37178. }),
  37179. (b.sub = b.subtract),
  37180. (b.multiply = function (e) {
  37181. if (this.isZero()) return g
  37182. if ((t(e) || (e = a(e)), e.isZero())) return g
  37183. if (this.eq(E)) return e.isOdd() ? E : g
  37184. if (e.eq(E)) return this.isOdd() ? E : g
  37185. if (this.isNegative()) return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg()
  37186. if (e.isNegative()) return this.mul(e.neg()).neg()
  37187. if (this.lt(f) && e.lt(f)) return n(this.toNumber() * e.toNumber(), this.unsigned)
  37188. var i = this.high >>> 16,
  37189. o = 65535 & this.high,
  37190. s = this.low >>> 16,
  37191. l = 65535 & this.low,
  37192. c = e.high >>> 16,
  37193. h = 65535 & e.high,
  37194. u = e.low >>> 16,
  37195. d = 65535 & e.low,
  37196. p = 0,
  37197. m = 0,
  37198. v = 0,
  37199. A = 0
  37200. return (
  37201. (A += l * d),
  37202. (v += A >>> 16),
  37203. (A &= 65535),
  37204. (v += s * d),
  37205. (m += v >>> 16),
  37206. (v &= 65535),
  37207. (v += l * u),
  37208. (m += v >>> 16),
  37209. (v &= 65535),
  37210. (m += o * d),
  37211. (p += m >>> 16),
  37212. (m &= 65535),
  37213. (m += s * u),
  37214. (p += m >>> 16),
  37215. (m &= 65535),
  37216. (m += l * h),
  37217. (p += m >>> 16),
  37218. (m &= 65535),
  37219. (p += i * d + o * u + s * h + l * c),
  37220. (p &= 65535),
  37221. r((v << 16) | A, (p << 16) | m, this.unsigned)
  37222. )
  37223. }),
  37224. (b.mul = b.multiply),
  37225. (b.divide = function (e) {
  37226. if ((t(e) || (e = a(e)), e.isZero())) throw Error('division by zero')
  37227. if (this.isZero()) return this.unsigned ? m : g
  37228. var i, r, o
  37229. if (this.unsigned) {
  37230. if ((e.unsigned || (e = e.toUnsigned()), e.gt(this))) return m
  37231. if (e.gt(this.shru(1))) return A
  37232. o = m
  37233. } else {
  37234. if (this.eq(E)) {
  37235. if (e.eq(v) || e.eq(y)) return E
  37236. if (e.eq(E)) return v
  37237. var s = this.shr(1)
  37238. return (i = s.div(e).shl(1)), i.eq(g) ? (e.isNegative() ? v : y) : ((r = this.sub(e.mul(i))), (o = i.add(r.div(e))))
  37239. }
  37240. if (e.eq(E)) return this.unsigned ? m : g
  37241. if (this.isNegative()) return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg()
  37242. if (e.isNegative()) return this.div(e.neg()).neg()
  37243. o = g
  37244. }
  37245. for (r = this; r.gte(e); ) {
  37246. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()))
  37247. 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); ) (i -= h), (u = n(i, this.unsigned)), (d = u.mul(e))
  37248. u.isZero() && (u = v), (o = o.add(u)), (r = r.sub(d))
  37249. }
  37250. return o
  37251. }),
  37252. (b.div = b.divide),
  37253. (b.modulo = function (e) {
  37254. return t(e) || (e = a(e)), this.sub(this.div(e).mul(e))
  37255. }),
  37256. (b.mod = b.modulo),
  37257. (b.not = function () {
  37258. return r(~this.low, ~this.high, this.unsigned)
  37259. }),
  37260. (b.and = function (e) {
  37261. return t(e) || (e = a(e)), r(this.low & e.low, this.high & e.high, this.unsigned)
  37262. }),
  37263. (b.or = function (e) {
  37264. return t(e) || (e = a(e)), r(this.low | e.low, this.high | e.high, this.unsigned)
  37265. }),
  37266. (b.xor = function (e) {
  37267. return t(e) || (e = a(e)), r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  37268. }),
  37269. (b.shiftLeft = function (e) {
  37270. return t(e) && (e = e.toInt()), 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)
  37271. }),
  37272. (b.shl = b.shiftLeft),
  37273. (b.shiftRight = function (e) {
  37274. return (
  37275. t(e) && (e = e.toInt()),
  37276. 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)
  37277. )
  37278. }),
  37279. (b.shr = b.shiftRight),
  37280. (b.shiftRightUnsigned = function (e) {
  37281. if ((t(e) && (e = e.toInt()), (e &= 63), 0 === e)) return this
  37282. var i = this.high
  37283. if (e < 32) {
  37284. var n = this.low
  37285. return r((n >>> e) | (i << (32 - e)), i >>> e, this.unsigned)
  37286. }
  37287. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> (e - 32), 0, this.unsigned)
  37288. }),
  37289. (b.shru = b.shiftRightUnsigned),
  37290. (b.toSigned = function () {
  37291. return this.unsigned ? r(this.low, this.high, !1) : this
  37292. }),
  37293. (b.toUnsigned = function () {
  37294. return this.unsigned ? this : r(this.low, this.high, !0)
  37295. }),
  37296. (b.toBytes = function (e) {
  37297. return e ? this.toBytesLE() : this.toBytesBE()
  37298. }),
  37299. (b.toBytesLE = function () {
  37300. var e = this.high,
  37301. t = this.low
  37302. return [255 & t, (t >>> 8) & 255, (t >>> 16) & 255, (t >>> 24) & 255, 255 & e, (e >>> 8) & 255, (e >>> 16) & 255, (e >>> 24) & 255]
  37303. }),
  37304. (b.toBytesBE = function () {
  37305. var e = this.high,
  37306. t = this.low
  37307. return [(e >>> 24) & 255, (e >>> 16) & 255, (e >>> 8) & 255, 255 & e, (t >>> 24) & 255, (t >>> 16) & 255, (t >>> 8) & 255, 255 & t]
  37308. }),
  37309. e
  37310. )
  37311. })
  37312. },
  37313. {}
  37314. ],
  37315. 217: [
  37316. function (e, t, i) {
  37317. var n = {
  37318. REVISION: '75'
  37319. }
  37320. 'function' == typeof define && define.amd ? define('three', n) : 'undefined' != typeof i && 'undefined' != typeof t && (t.exports = n),
  37321. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  37322. void 0 === Math.sign &&
  37323. (Math.sign = function (e) {
  37324. return e < 0 ? -1 : e > 0 ? 1 : +e
  37325. }),
  37326. void 0 === Function.prototype.name &&
  37327. void 0 !== Object.defineProperty &&
  37328. Object.defineProperty(Function.prototype, 'name', {
  37329. get: function () {
  37330. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  37331. }
  37332. }),
  37333. void 0 === Object.assign &&
  37334. Object.defineProperty(Object, 'assign', {
  37335. writable: !0,
  37336. configurable: !0,
  37337. value: function (e) {
  37338. 'use strict'
  37339. if (void 0 === e || null === e) throw new TypeError('Cannot convert first argument to object')
  37340. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  37341. var r = arguments[i]
  37342. if (void 0 !== r && null !== r) {
  37343. r = Object(r)
  37344. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  37345. var l = o[a],
  37346. c = Object.getOwnPropertyDescriptor(r, l)
  37347. void 0 !== c && c.enumerable && (t[l] = r[l])
  37348. }
  37349. }
  37350. }
  37351. return t
  37352. }
  37353. }),
  37354. (n.MOUSE = {
  37355. LEFT: 0,
  37356. MIDDLE: 1,
  37357. RIGHT: 2
  37358. }),
  37359. (n.CullFaceNone = 0),
  37360. (n.CullFaceBack = 1),
  37361. (n.CullFaceFront = 2),
  37362. (n.CullFaceFrontBack = 3),
  37363. (n.FrontFaceDirectionCW = 0),
  37364. (n.FrontFaceDirectionCCW = 1),
  37365. (n.BasicShadowMap = 0),
  37366. (n.PCFShadowMap = 1),
  37367. (n.PCFSoftShadowMap = 2),
  37368. (n.FrontSide = 0),
  37369. (n.BackSide = 1),
  37370. (n.DoubleSide = 2),
  37371. (n.FlatShading = 1),
  37372. (n.SmoothShading = 2),
  37373. (n.NoColors = 0),
  37374. (n.FaceColors = 1),
  37375. (n.VertexColors = 2),
  37376. (n.NoBlending = 0),
  37377. (n.NormalBlending = 1),
  37378. (n.AdditiveBlending = 2),
  37379. (n.SubtractiveBlending = 3),
  37380. (n.MultiplyBlending = 4),
  37381. (n.CustomBlending = 5),
  37382. (n.AddEquation = 100),
  37383. (n.SubtractEquation = 101),
  37384. (n.ReverseSubtractEquation = 102),
  37385. (n.MinEquation = 103),
  37386. (n.MaxEquation = 104),
  37387. (n.ZeroFactor = 200),
  37388. (n.OneFactor = 201),
  37389. (n.SrcColorFactor = 202),
  37390. (n.OneMinusSrcColorFactor = 203),
  37391. (n.SrcAlphaFactor = 204),
  37392. (n.OneMinusSrcAlphaFactor = 205),
  37393. (n.DstAlphaFactor = 206),
  37394. (n.OneMinusDstAlphaFactor = 207),
  37395. (n.DstColorFactor = 208),
  37396. (n.OneMinusDstColorFactor = 209),
  37397. (n.SrcAlphaSaturateFactor = 210),
  37398. (n.NeverDepth = 0),
  37399. (n.AlwaysDepth = 1),
  37400. (n.LessDepth = 2),
  37401. (n.LessEqualDepth = 3),
  37402. (n.EqualDepth = 4),
  37403. (n.GreaterEqualDepth = 5),
  37404. (n.GreaterDepth = 6),
  37405. (n.NotEqualDepth = 7),
  37406. (n.MultiplyOperation = 0),
  37407. (n.MixOperation = 1),
  37408. (n.AddOperation = 2),
  37409. (n.NoToneMapping = 0),
  37410. (n.LinearToneMapping = 1),
  37411. (n.ReinhardToneMapping = 2),
  37412. (n.Uncharted2ToneMapping = 3),
  37413. (n.CineonToneMapping = 4),
  37414. (n.UVMapping = 300),
  37415. (n.CubeReflectionMapping = 301),
  37416. (n.CubeRefractionMapping = 302),
  37417. (n.EquirectangularReflectionMapping = 303),
  37418. (n.EquirectangularRefractionMapping = 304),
  37419. (n.SphericalReflectionMapping = 305),
  37420. (n.CubeUVReflectionMapping = 306),
  37421. (n.CubeUVRefractionMapping = 307),
  37422. (n.RepeatWrapping = 1e3),
  37423. (n.ClampToEdgeWrapping = 1001),
  37424. (n.MirroredRepeatWrapping = 1002),
  37425. (n.NearestFilter = 1003),
  37426. (n.NearestMipMapNearestFilter = 1004),
  37427. (n.NearestMipMapLinearFilter = 1005),
  37428. (n.LinearFilter = 1006),
  37429. (n.LinearMipMapNearestFilter = 1007),
  37430. (n.LinearMipMapLinearFilter = 1008),
  37431. (n.UnsignedByteType = 1009),
  37432. (n.ByteType = 1010),
  37433. (n.ShortType = 1011),
  37434. (n.UnsignedShortType = 1012),
  37435. (n.IntType = 1013),
  37436. (n.UnsignedIntType = 1014),
  37437. (n.FloatType = 1015),
  37438. (n.HalfFloatType = 1025),
  37439. (n.UnsignedShort4444Type = 1016),
  37440. (n.UnsignedShort5551Type = 1017),
  37441. (n.UnsignedShort565Type = 1018),
  37442. (n.AlphaFormat = 1019),
  37443. (n.RGBFormat = 1020),
  37444. (n.RGBAFormat = 1021),
  37445. (n.LuminanceFormat = 1022),
  37446. (n.LuminanceAlphaFormat = 1023),
  37447. (n.RGBEFormat = n.RGBAFormat),
  37448. (n.RGB_S3TC_DXT1_Format = 2001),
  37449. (n.RGBA_S3TC_DXT1_Format = 2002),
  37450. (n.RGBA_S3TC_DXT3_Format = 2003),
  37451. (n.RGBA_S3TC_DXT5_Format = 2004),
  37452. (n.RGB_PVRTC_4BPPV1_Format = 2100),
  37453. (n.RGB_PVRTC_2BPPV1_Format = 2101),
  37454. (n.RGBA_PVRTC_4BPPV1_Format = 2102),
  37455. (n.RGBA_PVRTC_2BPPV1_Format = 2103),
  37456. (n.RGB_ETC1_Format = 2151),
  37457. (n.LoopOnce = 2200),
  37458. (n.LoopRepeat = 2201),
  37459. (n.LoopPingPong = 2202),
  37460. (n.InterpolateDiscrete = 2300),
  37461. (n.InterpolateLinear = 2301),
  37462. (n.InterpolateSmooth = 2302),
  37463. (n.ZeroCurvatureEnding = 2400),
  37464. (n.ZeroSlopeEnding = 2401),
  37465. (n.WrapAroundEnding = 2402),
  37466. (n.TrianglesDrawMode = 0),
  37467. (n.TriangleStripDrawMode = 1),
  37468. (n.TriangleFanDrawMode = 2),
  37469. (n.LinearEncoding = 3e3),
  37470. (n.sRGBEncoding = 3001),
  37471. (n.GammaEncoding = 3007),
  37472. (n.RGBEEncoding = 3002),
  37473. (n.LogLuvEncoding = 3003),
  37474. (n.RGBM7Encoding = 3004),
  37475. (n.RGBM16Encoding = 3005),
  37476. (n.RGBDEncoding = 3006),
  37477. (n.Color = function (e) {
  37478. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  37479. }),
  37480. (n.Color.prototype = {
  37481. constructor: n.Color,
  37482. r: 1,
  37483. g: 1,
  37484. b: 1,
  37485. set: function (e) {
  37486. return e instanceof n.Color ? this.copy(e) : 'number' == typeof e ? this.setHex(e) : 'string' == typeof e && this.setStyle(e), this
  37487. },
  37488. setScalar: function (e) {
  37489. ;(this.r = e), (this.g = e), (this.b = e)
  37490. },
  37491. setHex: function (e) {
  37492. return (e = Math.floor(e)), (this.r = ((e >> 16) & 255) / 255), (this.g = ((e >> 8) & 255) / 255), (this.b = (255 & e) / 255), this
  37493. },
  37494. setRGB: function (e, t, i) {
  37495. return (this.r = e), (this.g = t), (this.b = i), this
  37496. },
  37497. setHSL: (function () {
  37498. function e(e, t, i) {
  37499. return i < 0 && (i += 1), i > 1 && (i -= 1), i < 1 / 6 ? e + 6 * (t - e) * i : i < 0.5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  37500. }
  37501. return function (t, i, r) {
  37502. if (((t = n.Math.euclideanModulo(t, 1)), (i = n.Math.clamp(i, 0, 1)), (r = n.Math.clamp(r, 0, 1)), 0 === i)) this.r = this.g = this.b = r
  37503. else {
  37504. var o = r <= 0.5 ? r * (1 + i) : r + i - r * i,
  37505. a = 2 * r - o
  37506. ;(this.r = e(a, o, t + 1 / 3)), (this.g = e(a, o, t)), (this.b = e(a, o, t - 1 / 3))
  37507. }
  37508. return this
  37509. }
  37510. })(),
  37511. setStyle: function (e) {
  37512. function t(t) {
  37513. void 0 !== t && parseFloat(t) < 1 && console.warn('THREE.Color: Alpha component of ' + e + ' will be ignored.')
  37514. }
  37515. var i
  37516. if ((i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e))) {
  37517. var r,
  37518. o = i[1],
  37519. a = i[2]
  37520. switch (o) {
  37521. case 'rgb':
  37522. case 'rgba':
  37523. if ((r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)))
  37524. return (this.r = Math.min(255, parseInt(r[1], 10)) / 255), (this.g = Math.min(255, parseInt(r[2], 10)) / 255), (this.b = Math.min(255, parseInt(r[3], 10)) / 255), t(r[5]), this
  37525. if ((r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)))
  37526. return (this.r = Math.min(100, parseInt(r[1], 10)) / 100), (this.g = Math.min(100, parseInt(r[2], 10)) / 100), (this.b = Math.min(100, parseInt(r[3], 10)) / 100), t(r[5]), this
  37527. break
  37528. case 'hsl':
  37529. case 'hsla':
  37530. if ((r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))) {
  37531. var s = parseFloat(r[1]) / 360,
  37532. l = parseInt(r[2], 10) / 100,
  37533. c = parseInt(r[3], 10) / 100
  37534. return t(r[5]), this.setHSL(s, l, c)
  37535. }
  37536. }
  37537. } else if ((i = /^\#([A-Fa-f0-9]+)$/.exec(e))) {
  37538. var h = i[1],
  37539. u = h.length
  37540. if (3 === u)
  37541. return (
  37542. (this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255), (this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255), (this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255), this
  37543. )
  37544. if (6 === u)
  37545. return (
  37546. (this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255), (this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255), (this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255), this
  37547. )
  37548. }
  37549. if (e && e.length > 0) {
  37550. var h = n.ColorKeywords[e]
  37551. void 0 !== h ? this.setHex(h) : console.warn('THREE.Color: Unknown color ' + e)
  37552. }
  37553. return this
  37554. },
  37555. clone: function () {
  37556. return new this.constructor(this.r, this.g, this.b)
  37557. },
  37558. copy: function (e) {
  37559. return (this.r = e.r), (this.g = e.g), (this.b = e.b), this
  37560. },
  37561. copyGammaToLinear: function (e, t) {
  37562. return void 0 === t && (t = 2), (this.r = Math.pow(e.r, t)), (this.g = Math.pow(e.g, t)), (this.b = Math.pow(e.b, t)), this
  37563. },
  37564. copyLinearToGamma: function (e, t) {
  37565. void 0 === t && (t = 2)
  37566. var i = t > 0 ? 1 / t : 1
  37567. return (this.r = Math.pow(e.r, i)), (this.g = Math.pow(e.g, i)), (this.b = Math.pow(e.b, i)), this
  37568. },
  37569. convertGammaToLinear: function () {
  37570. var e = this.r,
  37571. t = this.g,
  37572. i = this.b
  37573. return (this.r = e * e), (this.g = t * t), (this.b = i * i), this
  37574. },
  37575. convertLinearToGamma: function () {
  37576. return (this.r = Math.sqrt(this.r)), (this.g = Math.sqrt(this.g)), (this.b = Math.sqrt(this.b)), this
  37577. },
  37578. getHex: function () {
  37579. return ((255 * this.r) << 16) ^ ((255 * this.g) << 8) ^ ((255 * this.b) << 0)
  37580. },
  37581. getHexString: function () {
  37582. return ('000000' + this.getHex().toString(16)).slice(-6)
  37583. },
  37584. getHSL: function (e) {
  37585. var t,
  37586. i,
  37587. n = e || {
  37588. h: 0,
  37589. s: 0,
  37590. l: 0
  37591. },
  37592. r = this.r,
  37593. o = this.g,
  37594. a = this.b,
  37595. s = Math.max(r, o, a),
  37596. l = Math.min(r, o, a),
  37597. c = (l + s) / 2
  37598. if (l === s) (t = 0), (i = 0)
  37599. else {
  37600. var h = s - l
  37601. switch (((i = c <= 0.5 ? h / (s + l) : h / (2 - s - l)), s)) {
  37602. case r:
  37603. t = (o - a) / h + (o < a ? 6 : 0)
  37604. break
  37605. case o:
  37606. t = (a - r) / h + 2
  37607. break
  37608. case a:
  37609. t = (r - o) / h + 4
  37610. }
  37611. t /= 6
  37612. }
  37613. return (n.h = t), (n.s = i), (n.l = c), n
  37614. },
  37615. getStyle: function () {
  37616. return 'rgb(' + ((255 * this.r) | 0) + ',' + ((255 * this.g) | 0) + ',' + ((255 * this.b) | 0) + ')'
  37617. },
  37618. offsetHSL: function (e, t, i) {
  37619. var n = this.getHSL()
  37620. return (n.h += e), (n.s += t), (n.l += i), this.setHSL(n.h, n.s, n.l), this
  37621. },
  37622. add: function (e) {
  37623. return (this.r += e.r), (this.g += e.g), (this.b += e.b), this
  37624. },
  37625. addColors: function (e, t) {
  37626. return (this.r = e.r + t.r), (this.g = e.g + t.g), (this.b = e.b + t.b), this
  37627. },
  37628. addScalar: function (e) {
  37629. return (this.r += e), (this.g += e), (this.b += e), this
  37630. },
  37631. multiply: function (e) {
  37632. return (this.r *= e.r), (this.g *= e.g), (this.b *= e.b), this
  37633. },
  37634. multiplyScalar: function (e) {
  37635. return (this.r *= e), (this.g *= e), (this.b *= e), this
  37636. },
  37637. lerp: function (e, t) {
  37638. return (this.r += (e.r - this.r) * t), (this.g += (e.g - this.g) * t), (this.b += (e.b - this.b) * t), this
  37639. },
  37640. equals: function (e) {
  37641. return e.r === this.r && e.g === this.g && e.b === this.b
  37642. },
  37643. fromArray: function (e, t) {
  37644. return void 0 === t && (t = 0), (this.r = e[t]), (this.g = e[t + 1]), (this.b = e[t + 2]), this
  37645. },
  37646. toArray: function (e, t) {
  37647. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.r), (e[t + 1] = this.g), (e[t + 2] = this.b), e
  37648. }
  37649. }),
  37650. (n.ColorKeywords = {
  37651. aliceblue: 15792383,
  37652. antiquewhite: 16444375,
  37653. aqua: 65535,
  37654. aquamarine: 8388564,
  37655. azure: 15794175,
  37656. beige: 16119260,
  37657. bisque: 16770244,
  37658. black: 0,
  37659. blanchedalmond: 16772045,
  37660. blue: 255,
  37661. blueviolet: 9055202,
  37662. brown: 10824234,
  37663. burlywood: 14596231,
  37664. cadetblue: 6266528,
  37665. chartreuse: 8388352,
  37666. chocolate: 13789470,
  37667. coral: 16744272,
  37668. cornflowerblue: 6591981,
  37669. cornsilk: 16775388,
  37670. crimson: 14423100,
  37671. cyan: 65535,
  37672. darkblue: 139,
  37673. darkcyan: 35723,
  37674. darkgoldenrod: 12092939,
  37675. darkgray: 11119017,
  37676. darkgreen: 25600,
  37677. darkgrey: 11119017,
  37678. darkkhaki: 12433259,
  37679. darkmagenta: 9109643,
  37680. darkolivegreen: 5597999,
  37681. darkorange: 16747520,
  37682. darkorchid: 10040012,
  37683. darkred: 9109504,
  37684. darksalmon: 15308410,
  37685. darkseagreen: 9419919,
  37686. darkslateblue: 4734347,
  37687. darkslategray: 3100495,
  37688. darkslategrey: 3100495,
  37689. darkturquoise: 52945,
  37690. darkviolet: 9699539,
  37691. deeppink: 16716947,
  37692. deepskyblue: 49151,
  37693. dimgray: 6908265,
  37694. dimgrey: 6908265,
  37695. dodgerblue: 2003199,
  37696. firebrick: 11674146,
  37697. floralwhite: 16775920,
  37698. forestgreen: 2263842,
  37699. fuchsia: 16711935,
  37700. gainsboro: 14474460,
  37701. ghostwhite: 16316671,
  37702. gold: 16766720,
  37703. goldenrod: 14329120,
  37704. gray: 8421504,
  37705. green: 32768,
  37706. greenyellow: 11403055,
  37707. grey: 8421504,
  37708. honeydew: 15794160,
  37709. hotpink: 16738740,
  37710. indianred: 13458524,
  37711. indigo: 4915330,
  37712. ivory: 16777200,
  37713. khaki: 15787660,
  37714. lavender: 15132410,
  37715. lavenderblush: 16773365,
  37716. lawngreen: 8190976,
  37717. lemonchiffon: 16775885,
  37718. lightblue: 11393254,
  37719. lightcoral: 15761536,
  37720. lightcyan: 14745599,
  37721. lightgoldenrodyellow: 16448210,
  37722. lightgray: 13882323,
  37723. lightgreen: 9498256,
  37724. lightgrey: 13882323,
  37725. lightpink: 16758465,
  37726. lightsalmon: 16752762,
  37727. lightseagreen: 2142890,
  37728. lightskyblue: 8900346,
  37729. lightslategray: 7833753,
  37730. lightslategrey: 7833753,
  37731. lightsteelblue: 11584734,
  37732. lightyellow: 16777184,
  37733. lime: 65280,
  37734. limegreen: 3329330,
  37735. linen: 16445670,
  37736. magenta: 16711935,
  37737. maroon: 8388608,
  37738. mediumaquamarine: 6737322,
  37739. mediumblue: 205,
  37740. mediumorchid: 12211667,
  37741. mediumpurple: 9662683,
  37742. mediumseagreen: 3978097,
  37743. mediumslateblue: 8087790,
  37744. mediumspringgreen: 64154,
  37745. mediumturquoise: 4772300,
  37746. mediumvioletred: 13047173,
  37747. midnightblue: 1644912,
  37748. mintcream: 16121850,
  37749. mistyrose: 16770273,
  37750. moccasin: 16770229,
  37751. navajowhite: 16768685,
  37752. navy: 128,
  37753. oldlace: 16643558,
  37754. olive: 8421376,
  37755. olivedrab: 7048739,
  37756. orange: 16753920,
  37757. orangered: 16729344,
  37758. orchid: 14315734,
  37759. palegoldenrod: 15657130,
  37760. palegreen: 10025880,
  37761. paleturquoise: 11529966,
  37762. palevioletred: 14381203,
  37763. papayawhip: 16773077,
  37764. peachpuff: 16767673,
  37765. peru: 13468991,
  37766. pink: 16761035,
  37767. plum: 14524637,
  37768. powderblue: 11591910,
  37769. purple: 8388736,
  37770. red: 16711680,
  37771. rosybrown: 12357519,
  37772. royalblue: 4286945,
  37773. saddlebrown: 9127187,
  37774. salmon: 16416882,
  37775. sandybrown: 16032864,
  37776. seagreen: 3050327,
  37777. seashell: 16774638,
  37778. sienna: 10506797,
  37779. silver: 12632256,
  37780. skyblue: 8900331,
  37781. slateblue: 6970061,
  37782. slategray: 7372944,
  37783. slategrey: 7372944,
  37784. snow: 16775930,
  37785. springgreen: 65407,
  37786. steelblue: 4620980,
  37787. tan: 13808780,
  37788. teal: 32896,
  37789. thistle: 14204888,
  37790. tomato: 16737095,
  37791. turquoise: 4251856,
  37792. violet: 15631086,
  37793. wheat: 16113331,
  37794. white: 16777215,
  37795. whitesmoke: 16119285,
  37796. yellow: 16776960,
  37797. yellowgreen: 10145074
  37798. }),
  37799. (n.Quaternion = function (e, t, i, n) {
  37800. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._w = void 0 !== n ? n : 1)
  37801. }),
  37802. (n.Quaternion.prototype = {
  37803. constructor: n.Quaternion,
  37804. get x() {
  37805. return this._x
  37806. },
  37807. set x(e) {
  37808. ;(this._x = e), this.onChangeCallback()
  37809. },
  37810. get y() {
  37811. return this._y
  37812. },
  37813. set y(e) {
  37814. ;(this._y = e), this.onChangeCallback()
  37815. },
  37816. get z() {
  37817. return this._z
  37818. },
  37819. set z(e) {
  37820. ;(this._z = e), this.onChangeCallback()
  37821. },
  37822. get w() {
  37823. return this._w
  37824. },
  37825. set w(e) {
  37826. ;(this._w = e), this.onChangeCallback()
  37827. },
  37828. set: function (e, t, i, n) {
  37829. return (this._x = e), (this._y = t), (this._z = i), (this._w = n), this.onChangeCallback(), this
  37830. },
  37831. clone: function () {
  37832. return new this.constructor(this._x, this._y, this._z, this._w)
  37833. },
  37834. copy: function (e) {
  37835. return (this._x = e.x), (this._y = e.y), (this._z = e.z), (this._w = e.w), this.onChangeCallback(), this
  37836. },
  37837. setFromEuler: function (e, t) {
  37838. if (e instanceof n.Euler == !1) throw new Error('THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.')
  37839. var i = Math.cos(e._x / 2),
  37840. r = Math.cos(e._y / 2),
  37841. o = Math.cos(e._z / 2),
  37842. a = Math.sin(e._x / 2),
  37843. s = Math.sin(e._y / 2),
  37844. l = Math.sin(e._z / 2),
  37845. c = e.order
  37846. return (
  37847. 'XYZ' === c
  37848. ? ((this._x = a * r * o + i * s * l), (this._y = i * s * o - a * r * l), (this._z = i * r * l + a * s * o), (this._w = i * r * o - a * s * l))
  37849. : 'YXZ' === c
  37850. ? ((this._x = a * r * o + i * s * l), (this._y = i * s * o - a * r * l), (this._z = i * r * l - a * s * o), (this._w = i * r * o + a * s * l))
  37851. : 'ZXY' === c
  37852. ? ((this._x = a * r * o - i * s * l), (this._y = i * s * o + a * r * l), (this._z = i * r * l + a * s * o), (this._w = i * r * o - a * s * l))
  37853. : 'ZYX' === c
  37854. ? ((this._x = a * r * o - i * s * l), (this._y = i * s * o + a * r * l), (this._z = i * r * l - a * s * o), (this._w = i * r * o + a * s * l))
  37855. : 'YZX' === c
  37856. ? ((this._x = a * r * o + i * s * l), (this._y = i * s * o + a * r * l), (this._z = i * r * l - a * s * o), (this._w = i * r * o - a * s * l))
  37857. : 'XZY' === c && ((this._x = a * r * o - i * s * l), (this._y = i * s * o - a * r * l), (this._z = i * r * l + a * s * o), (this._w = i * r * o + a * s * l)),
  37858. t !== !1 && this.onChangeCallback(),
  37859. this
  37860. )
  37861. },
  37862. setFromAxisAngle: function (e, t) {
  37863. var i = t / 2,
  37864. n = Math.sin(i)
  37865. return (this._x = e.x * n), (this._y = e.y * n), (this._z = e.z * n), (this._w = Math.cos(i)), this.onChangeCallback(), this
  37866. },
  37867. setFromRotationMatrix: function (e) {
  37868. var t,
  37869. i = e.elements,
  37870. n = i[0],
  37871. r = i[4],
  37872. o = i[8],
  37873. a = i[1],
  37874. s = i[5],
  37875. l = i[9],
  37876. c = i[2],
  37877. h = i[6],
  37878. u = i[10],
  37879. d = n + s + u
  37880. return (
  37881. d > 0
  37882. ? ((t = 0.5 / Math.sqrt(d + 1)), (this._w = 0.25 / t), (this._x = (h - l) * t), (this._y = (o - c) * t), (this._z = (a - r) * t))
  37883. : n > s && n > u
  37884. ? ((t = 2 * Math.sqrt(1 + n - s - u)), (this._w = (h - l) / t), (this._x = 0.25 * t), (this._y = (r + a) / t), (this._z = (o + c) / t))
  37885. : s > u
  37886. ? ((t = 2 * Math.sqrt(1 + s - n - u)), (this._w = (o - c) / t), (this._x = (r + a) / t), (this._y = 0.25 * t), (this._z = (l + h) / t))
  37887. : ((t = 2 * Math.sqrt(1 + u - n - s)), (this._w = (a - r) / t), (this._x = (o + c) / t), (this._y = (l + h) / t), (this._z = 0.25 * t)),
  37888. this.onChangeCallback(),
  37889. this
  37890. )
  37891. },
  37892. setFromUnitVectors: (function () {
  37893. var e,
  37894. t,
  37895. i = 1e-6
  37896. return function (r, o) {
  37897. return (
  37898. void 0 === e && (e = new n.Vector3()),
  37899. (t = r.dot(o) + 1),
  37900. t < i ? ((t = 0), 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),
  37901. (this._x = e.x),
  37902. (this._y = e.y),
  37903. (this._z = e.z),
  37904. (this._w = t),
  37905. this.normalize(),
  37906. this
  37907. )
  37908. }
  37909. })(),
  37910. inverse: function () {
  37911. return this.conjugate().normalize(), this
  37912. },
  37913. conjugate: function () {
  37914. return (this._x *= -1), (this._y *= -1), (this._z *= -1), this.onChangeCallback(), this
  37915. },
  37916. dot: function (e) {
  37917. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37918. },
  37919. lengthSq: function () {
  37920. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37921. },
  37922. length: function () {
  37923. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37924. },
  37925. normalize: function () {
  37926. var e = this.length()
  37927. return (
  37928. 0 === e
  37929. ? ((this._x = 0), (this._y = 0), (this._z = 0), (this._w = 1))
  37930. : ((e = 1 / e), (this._x = this._x * e), (this._y = this._y * e), (this._z = this._z * e), (this._w = this._w * e)),
  37931. this.onChangeCallback(),
  37932. this
  37933. )
  37934. },
  37935. multiply: function (e, t) {
  37936. return void 0 !== t
  37937. ? (console.warn('THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.'), this.multiplyQuaternions(e, t))
  37938. : this.multiplyQuaternions(this, e)
  37939. },
  37940. multiplyQuaternions: function (e, t) {
  37941. var i = e._x,
  37942. n = e._y,
  37943. r = e._z,
  37944. o = e._w,
  37945. a = t._x,
  37946. s = t._y,
  37947. l = t._z,
  37948. c = t._w
  37949. return (
  37950. (this._x = i * c + o * a + n * l - r * s),
  37951. (this._y = n * c + o * s + r * a - i * l),
  37952. (this._z = r * c + o * l + i * s - n * a),
  37953. (this._w = o * c - i * a - n * s - r * l),
  37954. this.onChangeCallback(),
  37955. this
  37956. )
  37957. },
  37958. slerp: function (e, t) {
  37959. if (0 === t) return this
  37960. if (1 === t) return this.copy(e)
  37961. var i = this._x,
  37962. n = this._y,
  37963. r = this._z,
  37964. o = this._w,
  37965. a = o * e._w + i * e._x + n * e._y + r * e._z
  37966. if ((a < 0 ? ((this._w = -e._w), (this._x = -e._x), (this._y = -e._y), (this._z = -e._z), (a = -a)) : this.copy(e), a >= 1))
  37967. return (this._w = o), (this._x = i), (this._y = n), (this._z = r), this
  37968. var s = Math.sqrt(1 - a * a)
  37969. if (Math.abs(s) < 0.001) return (this._w = 0.5 * (o + this._w)), (this._x = 0.5 * (i + this._x)), (this._y = 0.5 * (n + this._y)), (this._z = 0.5 * (r + this._z)), this
  37970. var l = Math.atan2(s, a),
  37971. c = Math.sin((1 - t) * l) / s,
  37972. h = Math.sin(t * l) / s
  37973. return (this._w = o * c + this._w * h), (this._x = i * c + this._x * h), (this._y = n * c + this._y * h), (this._z = r * c + this._z * h), this.onChangeCallback(), this
  37974. },
  37975. equals: function (e) {
  37976. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37977. },
  37978. fromArray: function (e, t) {
  37979. return void 0 === t && (t = 0), (this._x = e[t]), (this._y = e[t + 1]), (this._z = e[t + 2]), (this._w = e[t + 3]), this.onChangeCallback(), this
  37980. },
  37981. toArray: function (e, t) {
  37982. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._w), e
  37983. },
  37984. onChange: function (e) {
  37985. return (this.onChangeCallback = e), this
  37986. },
  37987. onChangeCallback: function () {}
  37988. }),
  37989. Object.assign(n.Quaternion, {
  37990. slerp: function (e, t, i, n) {
  37991. return i.copy(e).slerp(t, n)
  37992. },
  37993. slerpFlat: function (e, t, i, n, r, o, a) {
  37994. var s = i[n + 0],
  37995. l = i[n + 1],
  37996. c = i[n + 2],
  37997. h = i[n + 3],
  37998. u = r[o + 0],
  37999. d = r[o + 1],
  38000. p = r[o + 2],
  38001. f = r[o + 3]
  38002. if (h !== f || s !== u || l !== d || c !== p) {
  38003. var g = 1 - a,
  38004. m = s * u + l * d + c * p + h * f,
  38005. v = m >= 0 ? 1 : -1,
  38006. A = 1 - m * m
  38007. if (A > Number.EPSILON) {
  38008. var y = Math.sqrt(A),
  38009. C = Math.atan2(y, m * v)
  38010. ;(g = Math.sin(g * C) / y), (a = Math.sin(a * C) / y)
  38011. }
  38012. var I = a * v
  38013. if (((s = s * g + u * I), (l = l * g + d * I), (c = c * g + p * I), (h = h * g + f * I), g === 1 - a)) {
  38014. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h)
  38015. ;(s *= E), (l *= E), (c *= E), (h *= E)
  38016. }
  38017. }
  38018. ;(e[t] = s), (e[t + 1] = l), (e[t + 2] = c), (e[t + 3] = h)
  38019. }
  38020. }),
  38021. (n.Vector2 = function (e, t) {
  38022. ;(this.x = e || 0), (this.y = t || 0)
  38023. }),
  38024. (n.Vector2.prototype = {
  38025. constructor: n.Vector2,
  38026. get width() {
  38027. return this.x
  38028. },
  38029. set width(e) {
  38030. this.x = e
  38031. },
  38032. get height() {
  38033. return this.y
  38034. },
  38035. set height(e) {
  38036. this.y = e
  38037. },
  38038. set: function (e, t) {
  38039. return (this.x = e), (this.y = t), this
  38040. },
  38041. setScalar: function (e) {
  38042. return (this.x = e), (this.y = e), this
  38043. },
  38044. setX: function (e) {
  38045. return (this.x = e), this
  38046. },
  38047. setY: function (e) {
  38048. return (this.y = e), this
  38049. },
  38050. setComponent: function (e, t) {
  38051. switch (e) {
  38052. case 0:
  38053. this.x = t
  38054. break
  38055. case 1:
  38056. this.y = t
  38057. break
  38058. default:
  38059. throw new Error('index is out of range: ' + e)
  38060. }
  38061. },
  38062. getComponent: function (e) {
  38063. switch (e) {
  38064. case 0:
  38065. return this.x
  38066. case 1:
  38067. return this.y
  38068. default:
  38069. throw new Error('index is out of range: ' + e)
  38070. }
  38071. },
  38072. clone: function () {
  38073. return new this.constructor(this.x, this.y)
  38074. },
  38075. copy: function (e) {
  38076. return (this.x = e.x), (this.y = e.y), this
  38077. },
  38078. add: function (e, t) {
  38079. return void 0 !== t
  38080. ? (console.warn('THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  38081. : ((this.x += e.x), (this.y += e.y), this)
  38082. },
  38083. addScalar: function (e) {
  38084. return (this.x += e), (this.y += e), this
  38085. },
  38086. addVectors: function (e, t) {
  38087. return (this.x = e.x + t.x), (this.y = e.y + t.y), this
  38088. },
  38089. addScaledVector: function (e, t) {
  38090. return (this.x += e.x * t), (this.y += e.y * t), this
  38091. },
  38092. sub: function (e, t) {
  38093. return void 0 !== t
  38094. ? (console.warn('THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  38095. : ((this.x -= e.x), (this.y -= e.y), this)
  38096. },
  38097. subScalar: function (e) {
  38098. return (this.x -= e), (this.y -= e), this
  38099. },
  38100. subVectors: function (e, t) {
  38101. return (this.x = e.x - t.x), (this.y = e.y - t.y), this
  38102. },
  38103. multiply: function (e) {
  38104. return (this.x *= e.x), (this.y *= e.y), this
  38105. },
  38106. multiplyScalar: function (e) {
  38107. return isFinite(e) ? ((this.x *= e), (this.y *= e)) : ((this.x = 0), (this.y = 0)), this
  38108. },
  38109. divide: function (e) {
  38110. return (this.x /= e.x), (this.y /= e.y), this
  38111. },
  38112. divideScalar: function (e) {
  38113. return this.multiplyScalar(1 / e)
  38114. },
  38115. min: function (e) {
  38116. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), this
  38117. },
  38118. max: function (e) {
  38119. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), this
  38120. },
  38121. clamp: function (e, t) {
  38122. return (this.x = Math.max(e.x, Math.min(t.x, this.x))), (this.y = Math.max(e.y, Math.min(t.y, this.y))), this
  38123. },
  38124. clampScalar: (function () {
  38125. var e, t
  38126. return function (i, r) {
  38127. return void 0 === e && ((e = new n.Vector2()), (t = new n.Vector2())), e.set(i, i), t.set(r, r), this.clamp(e, t)
  38128. }
  38129. })(),
  38130. clampLength: function (e, t) {
  38131. var i = this.length()
  38132. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  38133. },
  38134. floor: function () {
  38135. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), this
  38136. },
  38137. ceil: function () {
  38138. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), this
  38139. },
  38140. round: function () {
  38141. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), this
  38142. },
  38143. roundToZero: function () {
  38144. return (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)), (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)), this
  38145. },
  38146. negate: function () {
  38147. return (this.x = -this.x), (this.y = -this.y), this
  38148. },
  38149. dot: function (e) {
  38150. return this.x * e.x + this.y * e.y
  38151. },
  38152. lengthSq: function () {
  38153. return this.x * this.x + this.y * this.y
  38154. },
  38155. length: function () {
  38156. return Math.sqrt(this.x * this.x + this.y * this.y)
  38157. },
  38158. lengthManhattan: function () {
  38159. return Math.abs(this.x) + Math.abs(this.y)
  38160. },
  38161. normalize: function () {
  38162. return this.divideScalar(this.length())
  38163. },
  38164. angle: function () {
  38165. var e = Math.atan2(this.y, this.x)
  38166. return e < 0 && (e += 2 * Math.PI), e
  38167. },
  38168. distanceTo: function (e) {
  38169. return Math.sqrt(this.distanceToSquared(e))
  38170. },
  38171. distanceToSquared: function (e) {
  38172. var t = this.x - e.x,
  38173. i = this.y - e.y
  38174. return t * t + i * i
  38175. },
  38176. setLength: function (e) {
  38177. return this.multiplyScalar(e / this.length())
  38178. },
  38179. lerp: function (e, t) {
  38180. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), this
  38181. },
  38182. lerpVectors: function (e, t, i) {
  38183. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  38184. },
  38185. equals: function (e) {
  38186. return e.x === this.x && e.y === this.y
  38187. },
  38188. fromArray: function (e, t) {
  38189. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), this
  38190. },
  38191. toArray: function (e, t) {
  38192. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), e
  38193. },
  38194. fromAttribute: function (e, t, i) {
  38195. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), this
  38196. },
  38197. rotateAround: function (e, t) {
  38198. var i = Math.cos(t),
  38199. n = Math.sin(t),
  38200. r = this.x - e.x,
  38201. o = this.y - e.y
  38202. return (this.x = r * i - o * n + e.x), (this.y = r * n + o * i + e.y), this
  38203. }
  38204. }),
  38205. (n.Vector3 = function (e, t, i) {
  38206. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0)
  38207. }),
  38208. (n.Vector3.prototype = {
  38209. constructor: n.Vector3,
  38210. set: function (e, t, i) {
  38211. return (this.x = e), (this.y = t), (this.z = i), this
  38212. },
  38213. setScalar: function (e) {
  38214. return (this.x = e), (this.y = e), (this.z = e), this
  38215. },
  38216. setX: function (e) {
  38217. return (this.x = e), this
  38218. },
  38219. setY: function (e) {
  38220. return (this.y = e), this
  38221. },
  38222. setZ: function (e) {
  38223. return (this.z = e), this
  38224. },
  38225. setComponent: function (e, t) {
  38226. switch (e) {
  38227. case 0:
  38228. this.x = t
  38229. break
  38230. case 1:
  38231. this.y = t
  38232. break
  38233. case 2:
  38234. this.z = t
  38235. break
  38236. default:
  38237. throw new Error('index is out of range: ' + e)
  38238. }
  38239. },
  38240. getComponent: function (e) {
  38241. switch (e) {
  38242. case 0:
  38243. return this.x
  38244. case 1:
  38245. return this.y
  38246. case 2:
  38247. return this.z
  38248. default:
  38249. throw new Error('index is out of range: ' + e)
  38250. }
  38251. },
  38252. clone: function () {
  38253. return new this.constructor(this.x, this.y, this.z)
  38254. },
  38255. copy: function (e) {
  38256. return (this.x = e.x), (this.y = e.y), (this.z = e.z), this
  38257. },
  38258. add: function (e, t) {
  38259. return void 0 !== t
  38260. ? (console.warn('THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  38261. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), this)
  38262. },
  38263. addScalar: function (e) {
  38264. return (this.x += e), (this.y += e), (this.z += e), this
  38265. },
  38266. addVectors: function (e, t) {
  38267. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), this
  38268. },
  38269. addScaledVector: function (e, t) {
  38270. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), this
  38271. },
  38272. sub: function (e, t) {
  38273. return void 0 !== t
  38274. ? (console.warn('THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  38275. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), this)
  38276. },
  38277. subScalar: function (e) {
  38278. return (this.x -= e), (this.y -= e), (this.z -= e), this
  38279. },
  38280. subVectors: function (e, t) {
  38281. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), this
  38282. },
  38283. multiply: function (e, t) {
  38284. return void 0 !== t
  38285. ? (console.warn('THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.'), this.multiplyVectors(e, t))
  38286. : ((this.x *= e.x), (this.y *= e.y), (this.z *= e.z), this)
  38287. },
  38288. multiplyScalar: function (e) {
  38289. return isFinite(e) ? ((this.x *= e), (this.y *= e), (this.z *= e)) : ((this.x = 0), (this.y = 0), (this.z = 0)), this
  38290. },
  38291. multiplyVectors: function (e, t) {
  38292. return (this.x = e.x * t.x), (this.y = e.y * t.y), (this.z = e.z * t.z), this
  38293. },
  38294. applyEuler: (function () {
  38295. var e
  38296. return function (t) {
  38297. return (
  38298. t instanceof n.Euler == !1 && console.error('THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.'),
  38299. void 0 === e && (e = new n.Quaternion()),
  38300. this.applyQuaternion(e.setFromEuler(t)),
  38301. this
  38302. )
  38303. }
  38304. })(),
  38305. applyAxisAngle: (function () {
  38306. var e
  38307. return function (t, i) {
  38308. return void 0 === e && (e = new n.Quaternion()), this.applyQuaternion(e.setFromAxisAngle(t, i)), this
  38309. }
  38310. })(),
  38311. applyMatrix3: function (e) {
  38312. var t = this.x,
  38313. i = this.y,
  38314. n = this.z,
  38315. r = e.elements
  38316. return (this.x = r[0] * t + r[3] * i + r[6] * n), (this.y = r[1] * t + r[4] * i + r[7] * n), (this.z = r[2] * t + r[5] * i + r[8] * n), this
  38317. },
  38318. applyMatrix4: function (e) {
  38319. var t = this.x,
  38320. i = this.y,
  38321. n = this.z,
  38322. r = e.elements
  38323. return (this.x = r[0] * t + r[4] * i + r[8] * n + r[12]), (this.y = r[1] * t + r[5] * i + r[9] * n + r[13]), (this.z = r[2] * t + r[6] * i + r[10] * n + r[14]), this
  38324. },
  38325. applyProjection: function (e) {
  38326. var t = this.x,
  38327. i = this.y,
  38328. n = this.z,
  38329. r = e.elements,
  38330. o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15])
  38331. return (this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o), (this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o), (this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o), this
  38332. },
  38333. applyQuaternion: function (e) {
  38334. var t = this.x,
  38335. i = this.y,
  38336. n = this.z,
  38337. r = e.x,
  38338. o = e.y,
  38339. a = e.z,
  38340. s = e.w,
  38341. l = s * t + o * n - a * i,
  38342. c = s * i + a * t - r * n,
  38343. h = s * n + r * i - o * t,
  38344. u = -r * t - o * i - a * n
  38345. return (this.x = l * s + u * -r + c * -a - h * -o), (this.y = c * s + u * -o + h * -r - l * -a), (this.z = h * s + u * -a + l * -o - c * -r), this
  38346. },
  38347. project: (function () {
  38348. var e
  38349. return function (t) {
  38350. return void 0 === e && (e = new n.Matrix4()), e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)), this.applyProjection(e)
  38351. }
  38352. })(),
  38353. unproject: (function () {
  38354. var e
  38355. return function (t) {
  38356. return void 0 === e && (e = new n.Matrix4()), e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)), this.applyProjection(e)
  38357. }
  38358. })(),
  38359. transformDirection: function (e) {
  38360. var t = this.x,
  38361. i = this.y,
  38362. n = this.z,
  38363. r = e.elements
  38364. return (this.x = r[0] * t + r[4] * i + r[8] * n), (this.y = r[1] * t + r[5] * i + r[9] * n), (this.z = r[2] * t + r[6] * i + r[10] * n), this.normalize(), this
  38365. },
  38366. divide: function (e) {
  38367. return (this.x /= e.x), (this.y /= e.y), (this.z /= e.z), this
  38368. },
  38369. divideScalar: function (e) {
  38370. return this.multiplyScalar(1 / e)
  38371. },
  38372. min: function (e) {
  38373. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), (this.z = Math.min(this.z, e.z)), this
  38374. },
  38375. max: function (e) {
  38376. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), (this.z = Math.max(this.z, e.z)), this
  38377. },
  38378. clamp: function (e, t) {
  38379. return (this.x = Math.max(e.x, Math.min(t.x, this.x))), (this.y = Math.max(e.y, Math.min(t.y, this.y))), (this.z = Math.max(e.z, Math.min(t.z, this.z))), this
  38380. },
  38381. clampScalar: (function () {
  38382. var e, t
  38383. return function (i, r) {
  38384. return void 0 === e && ((e = new n.Vector3()), (t = new n.Vector3())), e.set(i, i, i), t.set(r, r, r), this.clamp(e, t)
  38385. }
  38386. })(),
  38387. clampLength: function (e, t) {
  38388. var i = this.length()
  38389. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i), this
  38390. },
  38391. floor: function () {
  38392. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), this
  38393. },
  38394. ceil: function () {
  38395. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), this
  38396. },
  38397. round: function () {
  38398. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), this
  38399. },
  38400. roundToZero: function () {
  38401. return (
  38402. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  38403. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  38404. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  38405. this
  38406. )
  38407. },
  38408. negate: function () {
  38409. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), this
  38410. },
  38411. dot: function (e) {
  38412. return this.x * e.x + this.y * e.y + this.z * e.z
  38413. },
  38414. lengthSq: function () {
  38415. return this.x * this.x + this.y * this.y + this.z * this.z
  38416. },
  38417. length: function () {
  38418. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38419. },
  38420. lengthManhattan: function () {
  38421. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38422. },
  38423. normalize: function () {
  38424. return this.divideScalar(this.length())
  38425. },
  38426. setLength: function (e) {
  38427. return this.multiplyScalar(e / this.length())
  38428. },
  38429. lerp: function (e, t) {
  38430. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), this
  38431. },
  38432. lerpVectors: function (e, t, i) {
  38433. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  38434. },
  38435. cross: function (e, t) {
  38436. if (void 0 !== t) return console.warn('THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.'), this.crossVectors(e, t)
  38437. var i = this.x,
  38438. n = this.y,
  38439. r = this.z
  38440. return (this.x = n * e.z - r * e.y), (this.y = r * e.x - i * e.z), (this.z = i * e.y - n * e.x), this
  38441. },
  38442. crossVectors: function (e, t) {
  38443. var i = e.x,
  38444. n = e.y,
  38445. r = e.z,
  38446. o = t.x,
  38447. a = t.y,
  38448. s = t.z
  38449. return (this.x = n * s - r * a), (this.y = r * o - i * s), (this.z = i * a - n * o), this
  38450. },
  38451. projectOnVector: (function () {
  38452. var e, t
  38453. return function (i) {
  38454. return void 0 === e && (e = new n.Vector3()), e.copy(i).normalize(), (t = this.dot(e)), this.copy(e).multiplyScalar(t)
  38455. }
  38456. })(),
  38457. projectOnPlane: (function () {
  38458. var e
  38459. return function (t) {
  38460. return void 0 === e && (e = new n.Vector3()), e.copy(this).projectOnVector(t), this.sub(e)
  38461. }
  38462. })(),
  38463. reflect: (function () {
  38464. var e
  38465. return function (t) {
  38466. return void 0 === e && (e = new n.Vector3()), this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  38467. }
  38468. })(),
  38469. angleTo: function (e) {
  38470. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq())
  38471. return Math.acos(n.Math.clamp(t, -1, 1))
  38472. },
  38473. distanceTo: function (e) {
  38474. return Math.sqrt(this.distanceToSquared(e))
  38475. },
  38476. distanceToSquared: function (e) {
  38477. var t = this.x - e.x,
  38478. i = this.y - e.y,
  38479. n = this.z - e.z
  38480. return t * t + i * i + n * n
  38481. },
  38482. setFromSpherical: function (e) {
  38483. var t = Math.sin(e.phi) * e.radius
  38484. return (this.x = t * Math.sin(e.theta)), (this.y = Math.cos(e.phi) * e.radius), (this.z = t * Math.cos(e.theta)), this
  38485. },
  38486. setFromMatrixPosition: function (e) {
  38487. return this.setFromMatrixColumn(e, 3)
  38488. },
  38489. setFromMatrixScale: function (e) {
  38490. var t = this.setFromMatrixColumn(e, 0).length(),
  38491. i = this.setFromMatrixColumn(e, 1).length(),
  38492. n = this.setFromMatrixColumn(e, 2).length()
  38493. return (this.x = t), (this.y = i), (this.z = n), this
  38494. },
  38495. setFromMatrixColumn: function (e, t) {
  38496. return (
  38497. 'number' == typeof e && (console.warn('THREE.Vector3: setFromMatrixColumn now expects ( matrix, index ).'), (e = arguments[1]), (t = arguments[0])), this.fromArray(e.elements, 4 * t)
  38498. )
  38499. },
  38500. equals: function (e) {
  38501. return e.x === this.x && e.y === this.y && e.z === this.z
  38502. },
  38503. fromArray: function (e, t) {
  38504. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), this
  38505. },
  38506. toArray: function (e, t) {
  38507. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), e
  38508. },
  38509. fromAttribute: function (e, t, i) {
  38510. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), (this.z = e.array[t + 2]), this
  38511. }
  38512. }),
  38513. (n.Vector4 = function (e, t, i, n) {
  38514. ;(this.x = e || 0), (this.y = t || 0), (this.z = i || 0), (this.w = void 0 !== n ? n : 1)
  38515. }),
  38516. (n.Vector4.prototype = {
  38517. constructor: n.Vector4,
  38518. set: function (e, t, i, n) {
  38519. return (this.x = e), (this.y = t), (this.z = i), (this.w = n), this
  38520. },
  38521. setScalar: function (e) {
  38522. return (this.x = e), (this.y = e), (this.z = e), (this.w = e), this
  38523. },
  38524. setX: function (e) {
  38525. return (this.x = e), this
  38526. },
  38527. setY: function (e) {
  38528. return (this.y = e), this
  38529. },
  38530. setZ: function (e) {
  38531. return (this.z = e), this
  38532. },
  38533. setW: function (e) {
  38534. return (this.w = e), this
  38535. },
  38536. setComponent: function (e, t) {
  38537. switch (e) {
  38538. case 0:
  38539. this.x = t
  38540. break
  38541. case 1:
  38542. this.y = t
  38543. break
  38544. case 2:
  38545. this.z = t
  38546. break
  38547. case 3:
  38548. this.w = t
  38549. break
  38550. default:
  38551. throw new Error('index is out of range: ' + e)
  38552. }
  38553. },
  38554. getComponent: function (e) {
  38555. switch (e) {
  38556. case 0:
  38557. return this.x
  38558. case 1:
  38559. return this.y
  38560. case 2:
  38561. return this.z
  38562. case 3:
  38563. return this.w
  38564. default:
  38565. throw new Error('index is out of range: ' + e)
  38566. }
  38567. },
  38568. clone: function () {
  38569. return new this.constructor(this.x, this.y, this.z, this.w)
  38570. },
  38571. copy: function (e) {
  38572. return (this.x = e.x), (this.y = e.y), (this.z = e.z), (this.w = void 0 !== e.w ? e.w : 1), this
  38573. },
  38574. add: function (e, t) {
  38575. return void 0 !== t
  38576. ? (console.warn('THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.'), this.addVectors(e, t))
  38577. : ((this.x += e.x), (this.y += e.y), (this.z += e.z), (this.w += e.w), this)
  38578. },
  38579. addScalar: function (e) {
  38580. return (this.x += e), (this.y += e), (this.z += e), (this.w += e), this
  38581. },
  38582. addVectors: function (e, t) {
  38583. return (this.x = e.x + t.x), (this.y = e.y + t.y), (this.z = e.z + t.z), (this.w = e.w + t.w), this
  38584. },
  38585. addScaledVector: function (e, t) {
  38586. return (this.x += e.x * t), (this.y += e.y * t), (this.z += e.z * t), (this.w += e.w * t), this
  38587. },
  38588. sub: function (e, t) {
  38589. return void 0 !== t
  38590. ? (console.warn('THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.'), this.subVectors(e, t))
  38591. : ((this.x -= e.x), (this.y -= e.y), (this.z -= e.z), (this.w -= e.w), this)
  38592. },
  38593. subScalar: function (e) {
  38594. return (this.x -= e), (this.y -= e), (this.z -= e), (this.w -= e), this
  38595. },
  38596. subVectors: function (e, t) {
  38597. return (this.x = e.x - t.x), (this.y = e.y - t.y), (this.z = e.z - t.z), (this.w = e.w - t.w), this
  38598. },
  38599. multiplyScalar: function (e) {
  38600. return isFinite(e) ? ((this.x *= e), (this.y *= e), (this.z *= e), (this.w *= e)) : ((this.x = 0), (this.y = 0), (this.z = 0), (this.w = 0)), this
  38601. },
  38602. applyMatrix4: function (e) {
  38603. var t = this.x,
  38604. i = this.y,
  38605. n = this.z,
  38606. r = this.w,
  38607. o = e.elements
  38608. return (
  38609. (this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r),
  38610. (this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r),
  38611. (this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r),
  38612. (this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r),
  38613. this
  38614. )
  38615. },
  38616. divideScalar: function (e) {
  38617. return this.multiplyScalar(1 / e)
  38618. },
  38619. setAxisAngleFromQuaternion: function (e) {
  38620. this.w = 2 * Math.acos(e.w)
  38621. var t = Math.sqrt(1 - e.w * e.w)
  38622. return t < 1e-4 ? ((this.x = 1), (this.y = 0), (this.z = 0)) : ((this.x = e.x / t), (this.y = e.y / t), (this.z = e.z / t)), this
  38623. },
  38624. setAxisAngleFromRotationMatrix: function (e) {
  38625. var t,
  38626. i,
  38627. n,
  38628. r,
  38629. o = 0.01,
  38630. a = 0.1,
  38631. s = e.elements,
  38632. l = s[0],
  38633. c = s[4],
  38634. h = s[8],
  38635. u = s[1],
  38636. d = s[5],
  38637. p = s[9],
  38638. f = s[2],
  38639. g = s[6],
  38640. m = s[10]
  38641. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  38642. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a) return this.set(1, 0, 0, 0), this
  38643. t = Math.PI
  38644. var v = (l + 1) / 2,
  38645. A = (d + 1) / 2,
  38646. y = (m + 1) / 2,
  38647. C = (c + u) / 4,
  38648. I = (h + f) / 4,
  38649. E = (p + g) / 4
  38650. return (
  38651. v > A && v > y
  38652. ? v < o
  38653. ? ((i = 0), (n = 0.707106781), (r = 0.707106781))
  38654. : ((i = Math.sqrt(v)), (n = C / i), (r = I / i))
  38655. : A > y
  38656. ? A < o
  38657. ? ((i = 0.707106781), (n = 0), (r = 0.707106781))
  38658. : ((n = Math.sqrt(A)), (i = C / n), (r = E / n))
  38659. : y < o
  38660. ? ((i = 0.707106781), (n = 0.707106781), (r = 0))
  38661. : ((r = Math.sqrt(y)), (i = I / r), (n = E / r)),
  38662. this.set(i, n, r, t),
  38663. this
  38664. )
  38665. }
  38666. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c))
  38667. return Math.abs(b) < 0.001 && (b = 1), (this.x = (g - p) / b), (this.y = (h - f) / b), (this.z = (u - c) / b), (this.w = Math.acos((l + d + m - 1) / 2)), this
  38668. },
  38669. min: function (e) {
  38670. return (this.x = Math.min(this.x, e.x)), (this.y = Math.min(this.y, e.y)), (this.z = Math.min(this.z, e.z)), (this.w = Math.min(this.w, e.w)), this
  38671. },
  38672. max: function (e) {
  38673. return (this.x = Math.max(this.x, e.x)), (this.y = Math.max(this.y, e.y)), (this.z = Math.max(this.z, e.z)), (this.w = Math.max(this.w, e.w)), this
  38674. },
  38675. clamp: function (e, t) {
  38676. return (
  38677. (this.x = Math.max(e.x, Math.min(t.x, this.x))),
  38678. (this.y = Math.max(e.y, Math.min(t.y, this.y))),
  38679. (this.z = Math.max(e.z, Math.min(t.z, this.z))),
  38680. (this.w = Math.max(e.w, Math.min(t.w, this.w))),
  38681. this
  38682. )
  38683. },
  38684. clampScalar: (function () {
  38685. var e, t
  38686. return function (i, r) {
  38687. return void 0 === e && ((e = new n.Vector4()), (t = new n.Vector4())), e.set(i, i, i, i), t.set(r, r, r, r), this.clamp(e, t)
  38688. }
  38689. })(),
  38690. floor: function () {
  38691. return (this.x = Math.floor(this.x)), (this.y = Math.floor(this.y)), (this.z = Math.floor(this.z)), (this.w = Math.floor(this.w)), this
  38692. },
  38693. ceil: function () {
  38694. return (this.x = Math.ceil(this.x)), (this.y = Math.ceil(this.y)), (this.z = Math.ceil(this.z)), (this.w = Math.ceil(this.w)), this
  38695. },
  38696. round: function () {
  38697. return (this.x = Math.round(this.x)), (this.y = Math.round(this.y)), (this.z = Math.round(this.z)), (this.w = Math.round(this.w)), this
  38698. },
  38699. roundToZero: function () {
  38700. return (
  38701. (this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x)),
  38702. (this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y)),
  38703. (this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z)),
  38704. (this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w)),
  38705. this
  38706. )
  38707. },
  38708. negate: function () {
  38709. return (this.x = -this.x), (this.y = -this.y), (this.z = -this.z), (this.w = -this.w), this
  38710. },
  38711. dot: function (e) {
  38712. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38713. },
  38714. lengthSq: function () {
  38715. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38716. },
  38717. length: function () {
  38718. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38719. },
  38720. lengthManhattan: function () {
  38721. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38722. },
  38723. normalize: function () {
  38724. return this.divideScalar(this.length())
  38725. },
  38726. setLength: function (e) {
  38727. return this.multiplyScalar(e / this.length())
  38728. },
  38729. lerp: function (e, t) {
  38730. return (this.x += (e.x - this.x) * t), (this.y += (e.y - this.y) * t), (this.z += (e.z - this.z) * t), (this.w += (e.w - this.w) * t), this
  38731. },
  38732. lerpVectors: function (e, t, i) {
  38733. return this.subVectors(t, e).multiplyScalar(i).add(e), this
  38734. },
  38735. equals: function (e) {
  38736. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38737. },
  38738. fromArray: function (e, t) {
  38739. return void 0 === t && (t = 0), (this.x = e[t]), (this.y = e[t + 1]), (this.z = e[t + 2]), (this.w = e[t + 3]), this
  38740. },
  38741. toArray: function (e, t) {
  38742. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this.x), (e[t + 1] = this.y), (e[t + 2] = this.z), (e[t + 3] = this.w), e
  38743. },
  38744. fromAttribute: function (e, t, i) {
  38745. return void 0 === i && (i = 0), (t = t * e.itemSize + i), (this.x = e.array[t]), (this.y = e.array[t + 1]), (this.z = e.array[t + 2]), (this.w = e.array[t + 3]), this
  38746. }
  38747. }),
  38748. (n.Euler = function (e, t, i, r) {
  38749. ;(this._x = e || 0), (this._y = t || 0), (this._z = i || 0), (this._order = r || n.Euler.DefaultOrder)
  38750. }),
  38751. (n.Euler.RotationOrders = ['XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX']),
  38752. (n.Euler.DefaultOrder = 'XYZ'),
  38753. (n.Euler.prototype = {
  38754. constructor: n.Euler,
  38755. get x() {
  38756. return this._x
  38757. },
  38758. set x(e) {
  38759. ;(this._x = e), this.onChangeCallback()
  38760. },
  38761. get y() {
  38762. return this._y
  38763. },
  38764. set y(e) {
  38765. ;(this._y = e), this.onChangeCallback()
  38766. },
  38767. get z() {
  38768. return this._z
  38769. },
  38770. set z(e) {
  38771. ;(this._z = e), this.onChangeCallback()
  38772. },
  38773. get order() {
  38774. return this._order
  38775. },
  38776. set order(e) {
  38777. ;(this._order = e), this.onChangeCallback()
  38778. },
  38779. set: function (e, t, i, n) {
  38780. return (this._x = e), (this._y = t), (this._z = i), (this._order = n || this._order), this.onChangeCallback(), this
  38781. },
  38782. clone: function () {
  38783. return new this.constructor(this._x, this._y, this._z, this._order)
  38784. },
  38785. copy: function (e) {
  38786. return (this._x = e._x), (this._y = e._y), (this._z = e._z), (this._order = e._order), this.onChangeCallback(), this
  38787. },
  38788. setFromRotationMatrix: function (e, t, i) {
  38789. var r = n.Math.clamp,
  38790. o = e.elements,
  38791. a = o[0],
  38792. s = o[4],
  38793. l = o[8],
  38794. c = o[1],
  38795. h = o[5],
  38796. u = o[9],
  38797. d = o[2],
  38798. p = o[6],
  38799. f = o[10]
  38800. return (
  38801. (t = t || this._order),
  38802. 'XYZ' === t
  38803. ? ((this._y = Math.asin(r(l, -1, 1))), Math.abs(l) < 0.99999 ? ((this._x = Math.atan2(-u, f)), (this._z = Math.atan2(-s, a))) : ((this._x = Math.atan2(p, h)), (this._z = 0)))
  38804. : 'YXZ' === t
  38805. ? ((this._x = Math.asin(-r(u, -1, 1))), Math.abs(u) < 0.99999 ? ((this._y = Math.atan2(l, f)), (this._z = Math.atan2(c, h))) : ((this._y = Math.atan2(-d, a)), (this._z = 0)))
  38806. : 'ZXY' === t
  38807. ? ((this._x = Math.asin(r(p, -1, 1))), Math.abs(p) < 0.99999 ? ((this._y = Math.atan2(-d, f)), (this._z = Math.atan2(-s, h))) : ((this._y = 0), (this._z = Math.atan2(c, a))))
  38808. : 'ZYX' === t
  38809. ? ((this._y = Math.asin(-r(d, -1, 1))), Math.abs(d) < 0.99999 ? ((this._x = Math.atan2(p, f)), (this._z = Math.atan2(c, a))) : ((this._x = 0), (this._z = Math.atan2(-s, h))))
  38810. : 'YZX' === t
  38811. ? ((this._z = Math.asin(r(c, -1, 1))), Math.abs(c) < 0.99999 ? ((this._x = Math.atan2(-u, h)), (this._y = Math.atan2(-d, a))) : ((this._x = 0), (this._y = Math.atan2(l, f))))
  38812. : 'XZY' === t
  38813. ? ((this._z = Math.asin(-r(s, -1, 1))), Math.abs(s) < 0.99999 ? ((this._x = Math.atan2(p, h)), (this._y = Math.atan2(l, a))) : ((this._x = Math.atan2(-u, f)), (this._y = 0)))
  38814. : console.warn('THREE.Euler: .setFromRotationMatrix() given unsupported order: ' + t),
  38815. (this._order = t),
  38816. i !== !1 && this.onChangeCallback(),
  38817. this
  38818. )
  38819. },
  38820. setFromQuaternion: (function () {
  38821. var e
  38822. return function (t, i, r) {
  38823. return void 0 === e && (e = new n.Matrix4()), e.makeRotationFromQuaternion(t), this.setFromRotationMatrix(e, i, r), this
  38824. }
  38825. })(),
  38826. setFromVector3: function (e, t) {
  38827. return this.set(e.x, e.y, e.z, t || this._order)
  38828. },
  38829. reorder: (function () {
  38830. var e = new n.Quaternion()
  38831. return function (t) {
  38832. e.setFromEuler(this), this.setFromQuaternion(e, t)
  38833. }
  38834. })(),
  38835. equals: function (e) {
  38836. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38837. },
  38838. fromArray: function (e) {
  38839. return (this._x = e[0]), (this._y = e[1]), (this._z = e[2]), void 0 !== e[3] && (this._order = e[3]), this.onChangeCallback(), this
  38840. },
  38841. toArray: function (e, t) {
  38842. return void 0 === e && (e = []), void 0 === t && (t = 0), (e[t] = this._x), (e[t + 1] = this._y), (e[t + 2] = this._z), (e[t + 3] = this._order), e
  38843. },
  38844. toVector3: function (e) {
  38845. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x, this._y, this._z)
  38846. },
  38847. onChange: function (e) {
  38848. return (this.onChangeCallback = e), this
  38849. },
  38850. onChangeCallback: function () {}
  38851. }),
  38852. (n.Line3 = function (e, t) {
  38853. ;(this.start = void 0 !== e ? e : new n.Vector3()), (this.end = void 0 !== t ? t : new n.Vector3())
  38854. }),
  38855. (n.Line3.prototype = {
  38856. constructor: n.Line3,
  38857. set: function (e, t) {
  38858. return this.start.copy(e), this.end.copy(t), this
  38859. },
  38860. clone: function () {
  38861. return new this.constructor().copy(this)
  38862. },
  38863. copy: function (e) {
  38864. return this.start.copy(e.start), this.end.copy(e.end), this
  38865. },
  38866. center: function (e) {
  38867. var t = e || new n.Vector3()
  38868. return t.addVectors(this.start, this.end).multiplyScalar(0.5)
  38869. },
  38870. delta: function (e) {
  38871. var t = e || new n.Vector3()
  38872. return t.subVectors(this.end, this.start)
  38873. },
  38874. distanceSq: function () {
  38875. return this.start.distanceToSquared(this.end)
  38876. },
  38877. distance: function () {
  38878. return this.start.distanceTo(this.end)
  38879. },
  38880. at: function (e, t) {
  38881. var i = t || new n.Vector3()
  38882. return this.delta(i).multiplyScalar(e).add(this.start)
  38883. },
  38884. closestPointToPointParameter: (function () {
  38885. var e = new n.Vector3(),
  38886. t = new n.Vector3()
  38887. return function (i, r) {
  38888. e.subVectors(i, this.start), t.subVectors(this.end, this.start)
  38889. var o = t.dot(t),
  38890. a = t.dot(e),
  38891. s = a / o
  38892. return r && (s = n.Math.clamp(s, 0, 1)), s
  38893. }
  38894. })(),
  38895. closestPointToPoint: function (e, t, i) {
  38896. var r = this.closestPointToPointParameter(e, t),
  38897. o = i || new n.Vector3()
  38898. return this.delta(o).multiplyScalar(r).add(this.start)
  38899. },
  38900. applyMatrix4: function (e) {
  38901. return this.start.applyMatrix4(e), this.end.applyMatrix4(e), this
  38902. },
  38903. equals: function (e) {
  38904. return e.start.equals(this.start) && e.end.equals(this.end)
  38905. }
  38906. }),
  38907. (n.Box2 = function (e, t) {
  38908. ;(this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0), +(1 / 0))), (this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0), -(1 / 0)))
  38909. }),
  38910. (n.Box2.prototype = {
  38911. constructor: n.Box2,
  38912. set: function (e, t) {
  38913. return this.min.copy(e), this.max.copy(t), this
  38914. },
  38915. setFromPoints: function (e) {
  38916. this.makeEmpty()
  38917. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  38918. return this
  38919. },
  38920. setFromCenterAndSize: (function () {
  38921. var e = new n.Vector2()
  38922. return function (t, i) {
  38923. var n = e.copy(i).multiplyScalar(0.5)
  38924. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this
  38925. }
  38926. })(),
  38927. clone: function () {
  38928. return new this.constructor().copy(this)
  38929. },
  38930. copy: function (e) {
  38931. return this.min.copy(e.min), this.max.copy(e.max), this
  38932. },
  38933. makeEmpty: function () {
  38934. return (this.min.x = this.min.y = +(1 / 0)), (this.max.x = this.max.y = -(1 / 0)), this
  38935. },
  38936. isEmpty: function () {
  38937. return this.max.x < this.min.x || this.max.y < this.min.y
  38938. },
  38939. center: function (e) {
  38940. var t = e || new n.Vector2()
  38941. return t.addVectors(this.min, this.max).multiplyScalar(0.5)
  38942. },
  38943. size: function (e) {
  38944. var t = e || new n.Vector2()
  38945. return t.subVectors(this.max, this.min)
  38946. },
  38947. expandByPoint: function (e) {
  38948. return this.min.min(e), this.max.max(e), this
  38949. },
  38950. expandByVector: function (e) {
  38951. return this.min.sub(e), this.max.add(e), this
  38952. },
  38953. expandByScalar: function (e) {
  38954. return this.min.addScalar(-e), this.max.addScalar(e), this
  38955. },
  38956. containsPoint: function (e) {
  38957. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38958. },
  38959. containsBox: function (e) {
  38960. 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
  38961. },
  38962. getParameter: function (e, t) {
  38963. var i = t || new n.Vector2()
  38964. 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))
  38965. },
  38966. intersectsBox: function (e) {
  38967. 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)
  38968. },
  38969. clampPoint: function (e, t) {
  38970. var i = t || new n.Vector2()
  38971. return i.copy(e).clamp(this.min, this.max)
  38972. },
  38973. distanceToPoint: (function () {
  38974. var e = new n.Vector2()
  38975. return function (t) {
  38976. var i = e.copy(t).clamp(this.min, this.max)
  38977. return i.sub(t).length()
  38978. }
  38979. })(),
  38980. intersect: function (e) {
  38981. return this.min.max(e.min), this.max.min(e.max), this
  38982. },
  38983. union: function (e) {
  38984. return this.min.min(e.min), this.max.max(e.max), this
  38985. },
  38986. translate: function (e) {
  38987. return this.min.add(e), this.max.add(e), this
  38988. },
  38989. equals: function (e) {
  38990. return e.min.equals(this.min) && e.max.equals(this.max)
  38991. }
  38992. }),
  38993. (n.Box3 = function (e, t) {
  38994. ;(this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0), +(1 / 0), +(1 / 0))), (this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0), -(1 / 0), -(1 / 0)))
  38995. }),
  38996. (n.Box3.prototype = {
  38997. constructor: n.Box3,
  38998. set: function (e, t) {
  38999. return this.min.copy(e), this.max.copy(t), this
  39000. },
  39001. setFromArray: function (e) {
  39002. this.makeEmpty()
  39003. 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) {
  39004. var c = e[s],
  39005. h = e[s + 1],
  39006. u = e[s + 2]
  39007. c < t && (t = c), h < i && (i = h), u < n && (n = u), c > r && (r = c), h > o && (o = h), u > a && (a = u)
  39008. }
  39009. this.min.set(t, i, n), this.max.set(r, o, a)
  39010. },
  39011. setFromPoints: function (e) {
  39012. this.makeEmpty()
  39013. for (var t = 0, i = e.length; t < i; t++) this.expandByPoint(e[t])
  39014. return this
  39015. },
  39016. setFromCenterAndSize: (function () {
  39017. var e = new n.Vector3()
  39018. return function (t, i) {
  39019. var n = e.copy(i).multiplyScalar(0.5)
  39020. return this.min.copy(t).sub(n), this.max.copy(t).add(n), this
  39021. }
  39022. })(),
  39023. setFromObject: (function () {
  39024. var e
  39025. return function (t) {
  39026. void 0 === e && (e = new n.Box3())
  39027. var i = this
  39028. return (
  39029. this.makeEmpty(),
  39030. t.updateMatrixWorld(!0),
  39031. t.traverse(function (t) {
  39032. var n = t.geometry
  39033. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(), n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox), e.applyMatrix4(t.matrixWorld), i.union(e)))
  39034. }),
  39035. this
  39036. )
  39037. }
  39038. })(),
  39039. clone: function () {
  39040. return new this.constructor().copy(this)
  39041. },
  39042. copy: function (e) {
  39043. return this.min.copy(e.min), this.max.copy(e.max), this
  39044. },
  39045. makeEmpty: function () {
  39046. return (this.min.x = this.min.y = this.min.z = +(1 / 0)), (this.max.x = this.max.y = this.max.z = -(1 / 0)), this
  39047. },
  39048. isEmpty: function () {
  39049. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39050. },
  39051. center: function (e) {
  39052. var t = e || new n.Vector3()
  39053. return t.addVectors(this.min, this.max).multiplyScalar(0.5)
  39054. },
  39055. size: function (e) {
  39056. var t = e || new n.Vector3()
  39057. return t.subVectors(this.max, this.min)
  39058. },
  39059. expandByPoint: function (e) {
  39060. return this.min.min(e), this.max.max(e), this
  39061. },
  39062. expandByVector: function (e) {
  39063. return this.min.sub(e), this.max.add(e), this
  39064. },
  39065. expandByScalar: function (e) {
  39066. return this.min.addScalar(-e), this.max.addScalar(e), this
  39067. },
  39068. containsPoint: function (e) {
  39069. 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)
  39070. },
  39071. containsBox: function (e) {
  39072. 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
  39073. },
  39074. getParameter: function (e, t) {
  39075. var i = t || new n.Vector3()
  39076. 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))
  39077. },
  39078. intersectsBox: function (e) {
  39079. 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)
  39080. },
  39081. intersectsSphere: (function () {
  39082. var e
  39083. return function (t) {
  39084. return void 0 === e && (e = new n.Vector3()), this.clampPoint(t.center, e), e.distanceToSquared(t.center) <= t.radius * t.radius
  39085. }
  39086. })(),
  39087. intersectsPlane: function (e) {
  39088. var t, i
  39089. return (
  39090. e.normal.x > 0 ? ((t = e.normal.x * this.min.x), (i = e.normal.x * this.max.x)) : ((t = e.normal.x * this.max.x), (i = e.normal.x * this.min.x)),
  39091. e.normal.y > 0 ? ((t += e.normal.y * this.min.y), (i += e.normal.y * this.max.y)) : ((t += e.normal.y * this.max.y), (i += e.normal.y * this.min.y)),
  39092. e.normal.z > 0 ? ((t += e.normal.z * this.min.z), (i += e.normal.z * this.max.z)) : ((t += e.normal.z * this.max.z), (i += e.normal.z * this.min.z)),
  39093. t <= e.constant && i >= e.constant
  39094. )
  39095. },
  39096. clampPoint: function (e, t) {
  39097. var i = t || new n.Vector3()
  39098. return i.copy(e).clamp(this.min, this.max)
  39099. },
  39100. distanceToPoint: (function () {
  39101. var e = new n.Vector3()
  39102. return function (t) {
  39103. var i = e.copy(t).clamp(this.min, this.max)
  39104. return i.sub(t).length()
  39105. }
  39106. })(),
  39107. getBoundingSphere: (function () {
  39108. var e = new n.Vector3()
  39109. return function (t) {
  39110. var i = t || new n.Sphere()
  39111. return (i.center = this.center()), (i.radius = 0.5 * this.size(e).length()), i
  39112. }
  39113. })(),
  39114. intersect: function (e) {
  39115. return this.min.max(e.min), this.max.min(e.max), this
  39116. },
  39117. union: function (e) {
  39118. return this.min.min(e.min), this.max.max(e.max), this
  39119. },
  39120. applyMatrix4: (function () {
  39121. 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()]
  39122. return function (t) {
  39123. return (
  39124. e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  39125. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  39126. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  39127. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  39128. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  39129. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  39130. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  39131. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  39132. this.makeEmpty(),
  39133. this.setFromPoints(e),
  39134. this
  39135. )
  39136. }
  39137. })(),
  39138. translate: function (e) {
  39139. return this.min.add(e), this.max.add(e), this
  39140. },
  39141. equals: function (e) {
  39142. return e.min.equals(this.min) && e.max.equals(this.max)
  39143. }
  39144. }),
  39145. (n.Matrix3 = function () {
  39146. ;(this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1])), arguments.length > 0 && console.error('THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.')
  39147. }),
  39148. (n.Matrix3.prototype = {
  39149. constructor: n.Matrix3,
  39150. set: function (e, t, i, n, r, o, a, s, l) {
  39151. var c = this.elements
  39152. return (c[0] = e), (c[1] = n), (c[2] = a), (c[3] = t), (c[4] = r), (c[5] = s), (c[6] = i), (c[7] = o), (c[8] = l), this
  39153. },
  39154. identity: function () {
  39155. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1), this
  39156. },
  39157. clone: function () {
  39158. return new this.constructor().fromArray(this.elements)
  39159. },
  39160. copy: function (e) {
  39161. var t = e.elements
  39162. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]), this
  39163. },
  39164. setFromMatrix4: function (e) {
  39165. var t = e.elements
  39166. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]), this
  39167. },
  39168. applyToVector3Array: (function () {
  39169. var e
  39170. return function (t, i, r) {
  39171. void 0 === e && (e = new n.Vector3()), void 0 === i && (i = 0), void 0 === r && (r = t.length)
  39172. for (var o = 0, a = i; o < r; o += 3, a += 3) e.fromArray(t, a), e.applyMatrix3(this), e.toArray(t, a)
  39173. return t
  39174. }
  39175. })(),
  39176. applyToBuffer: (function () {
  39177. var e
  39178. return function (t, i, r) {
  39179. void 0 === e && (e = new n.Vector3()), void 0 === i && (i = 0), void 0 === r && (r = t.length / t.itemSize)
  39180. for (var o = 0, a = i; o < r; o++, a++) (e.x = t.getX(a)), (e.y = t.getY(a)), (e.z = t.getZ(a)), e.applyMatrix3(this), t.setXYZ(e.x, e.y, e.z)
  39181. return t
  39182. }
  39183. })(),
  39184. multiplyScalar: function (e) {
  39185. var t = this.elements
  39186. return (t[0] *= e), (t[3] *= e), (t[6] *= e), (t[1] *= e), (t[4] *= e), (t[7] *= e), (t[2] *= e), (t[5] *= e), (t[8] *= e), this
  39187. },
  39188. determinant: function () {
  39189. var e = this.elements,
  39190. t = e[0],
  39191. i = e[1],
  39192. n = e[2],
  39193. r = e[3],
  39194. o = e[4],
  39195. a = e[5],
  39196. s = e[6],
  39197. l = e[7],
  39198. c = e[8]
  39199. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39200. },
  39201. getInverse: function (e, t) {
  39202. e instanceof n.Matrix4 && console.warn('THREE.Matrix3.getInverse no longer takes a Matrix4 argument.')
  39203. var i = e.elements,
  39204. r = this.elements,
  39205. o = i[0],
  39206. a = i[1],
  39207. s = i[2],
  39208. l = i[3],
  39209. c = i[4],
  39210. h = i[5],
  39211. u = i[6],
  39212. d = i[7],
  39213. p = i[8],
  39214. f = p * c - h * d,
  39215. g = h * u - p * l,
  39216. m = d * l - c * u,
  39217. v = o * f + a * g + s * m
  39218. if (0 === v) {
  39219. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0"
  39220. if (t) throw new Error(A)
  39221. return console.warn(A), this.identity()
  39222. }
  39223. return (
  39224. (r[0] = f),
  39225. (r[1] = s * d - p * a),
  39226. (r[2] = h * a - s * c),
  39227. (r[3] = g),
  39228. (r[4] = p * o - s * u),
  39229. (r[5] = s * l - h * o),
  39230. (r[6] = m),
  39231. (r[7] = a * u - d * o),
  39232. (r[8] = c * o - a * l),
  39233. this.multiplyScalar(1 / v)
  39234. )
  39235. },
  39236. transpose: function () {
  39237. var e,
  39238. t = this.elements
  39239. return (e = t[1]), (t[1] = t[3]), (t[3] = e), (e = t[2]), (t[2] = t[6]), (t[6] = e), (e = t[5]), (t[5] = t[7]), (t[7] = e), this
  39240. },
  39241. flattenToArrayOffset: function (e, t) {
  39242. var i = this.elements
  39243. return (e[t] = i[0]), (e[t + 1] = i[1]), (e[t + 2] = i[2]), (e[t + 3] = i[3]), (e[t + 4] = i[4]), (e[t + 5] = i[5]), (e[t + 6] = i[6]), (e[t + 7] = i[7]), (e[t + 8] = i[8]), e
  39244. },
  39245. getNormalMatrix: function (e) {
  39246. return this.setFromMatrix4(e).getInverse(this).transpose()
  39247. },
  39248. transposeIntoArray: function (e) {
  39249. var t = this.elements
  39250. return (e[0] = t[0]), (e[1] = t[3]), (e[2] = t[6]), (e[3] = t[1]), (e[4] = t[4]), (e[5] = t[7]), (e[6] = t[2]), (e[7] = t[5]), (e[8] = t[8]), this
  39251. },
  39252. fromArray: function (e) {
  39253. return this.elements.set(e), this
  39254. },
  39255. toArray: function () {
  39256. var e = this.elements
  39257. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39258. }
  39259. }),
  39260. (n.Matrix4 = function () {
  39261. ;(this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1])),
  39262. arguments.length > 0 && console.error('THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.')
  39263. }),
  39264. (n.Matrix4.prototype = {
  39265. constructor: n.Matrix4,
  39266. set: function (e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39267. var m = this.elements
  39268. return (
  39269. (m[0] = e),
  39270. (m[4] = t),
  39271. (m[8] = i),
  39272. (m[12] = n),
  39273. (m[1] = r),
  39274. (m[5] = o),
  39275. (m[9] = a),
  39276. (m[13] = s),
  39277. (m[2] = l),
  39278. (m[6] = c),
  39279. (m[10] = h),
  39280. (m[14] = u),
  39281. (m[3] = d),
  39282. (m[7] = p),
  39283. (m[11] = f),
  39284. (m[15] = g),
  39285. this
  39286. )
  39287. },
  39288. identity: function () {
  39289. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  39290. },
  39291. clone: function () {
  39292. return new n.Matrix4().fromArray(this.elements)
  39293. },
  39294. copy: function (e) {
  39295. return this.elements.set(e.elements), this
  39296. },
  39297. copyPosition: function (e) {
  39298. var t = this.elements,
  39299. i = e.elements
  39300. return (t[12] = i[12]), (t[13] = i[13]), (t[14] = i[14]), this
  39301. },
  39302. extractBasis: function (e, t, i) {
  39303. return e.setFromMatrixColumn(this, 0), t.setFromMatrixColumn(this, 1), i.setFromMatrixColumn(this, 2), this
  39304. },
  39305. makeBasis: function (e, t, i) {
  39306. 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), this
  39307. },
  39308. extractRotation: (function () {
  39309. var e
  39310. return function (t) {
  39311. void 0 === e && (e = new n.Vector3())
  39312. var i = this.elements,
  39313. r = t.elements,
  39314. o = 1 / e.setFromMatrixColumn(t, 0).length(),
  39315. a = 1 / e.setFromMatrixColumn(t, 1).length(),
  39316. s = 1 / e.setFromMatrixColumn(t, 2).length()
  39317. return (i[0] = r[0] * o), (i[1] = r[1] * o), (i[2] = r[2] * o), (i[4] = r[4] * a), (i[5] = r[5] * a), (i[6] = r[6] * a), (i[8] = r[8] * s), (i[9] = r[9] * s), (i[10] = r[10] * s), this
  39318. }
  39319. })(),
  39320. makeRotationFromEuler: function (e) {
  39321. e instanceof n.Euler == !1 && console.error('THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.')
  39322. var t = this.elements,
  39323. i = e.x,
  39324. r = e.y,
  39325. o = e.z,
  39326. a = Math.cos(i),
  39327. s = Math.sin(i),
  39328. l = Math.cos(r),
  39329. c = Math.sin(r),
  39330. h = Math.cos(o),
  39331. u = Math.sin(o)
  39332. if ('XYZ' === e.order) {
  39333. var d = a * h,
  39334. p = a * u,
  39335. f = s * h,
  39336. g = s * u
  39337. ;(t[0] = l * h), (t[4] = -l * u), (t[8] = c), (t[1] = p + f * c), (t[5] = d - g * c), (t[9] = -s * l), (t[2] = g - d * c), (t[6] = f + p * c), (t[10] = a * l)
  39338. } else if ('YXZ' === e.order) {
  39339. var m = l * h,
  39340. v = l * u,
  39341. A = c * h,
  39342. y = c * u
  39343. ;(t[0] = m + y * s), (t[4] = A * s - v), (t[8] = a * c), (t[1] = a * u), (t[5] = a * h), (t[9] = -s), (t[2] = v * s - A), (t[6] = y + m * s), (t[10] = a * l)
  39344. } else if ('ZXY' === e.order) {
  39345. var m = l * h,
  39346. v = l * u,
  39347. A = c * h,
  39348. y = c * u
  39349. ;(t[0] = m - y * s), (t[4] = -a * u), (t[8] = A + v * s), (t[1] = v + A * s), (t[5] = a * h), (t[9] = y - m * s), (t[2] = -a * c), (t[6] = s), (t[10] = a * l)
  39350. } else if ('ZYX' === e.order) {
  39351. var d = a * h,
  39352. p = a * u,
  39353. f = s * h,
  39354. g = s * u
  39355. ;(t[0] = l * h), (t[4] = f * c - p), (t[8] = d * c + g), (t[1] = l * u), (t[5] = g * c + d), (t[9] = p * c - f), (t[2] = -c), (t[6] = s * l), (t[10] = a * l)
  39356. } else if ('YZX' === e.order) {
  39357. var C = a * l,
  39358. I = a * c,
  39359. E = s * l,
  39360. b = s * c
  39361. ;(t[0] = l * h), (t[4] = b - C * u), (t[8] = E * u + I), (t[1] = u), (t[5] = a * h), (t[9] = -s * h), (t[2] = -c * h), (t[6] = I * u + E), (t[10] = C - b * u)
  39362. } else if ('XZY' === e.order) {
  39363. var C = a * l,
  39364. I = a * c,
  39365. E = s * l,
  39366. b = s * c
  39367. ;(t[0] = l * h), (t[4] = -u), (t[8] = c * h), (t[1] = C * u + b), (t[5] = a * h), (t[9] = I * u - E), (t[2] = E * u - I), (t[6] = s * h), (t[10] = b * u + C)
  39368. }
  39369. return (t[3] = 0), (t[7] = 0), (t[11] = 0), (t[12] = 0), (t[13] = 0), (t[14] = 0), (t[15] = 1), this
  39370. },
  39371. makeRotationFromQuaternion: function (e) {
  39372. var t = this.elements,
  39373. i = e.x,
  39374. n = e.y,
  39375. r = e.z,
  39376. o = e.w,
  39377. a = i + i,
  39378. s = n + n,
  39379. l = r + r,
  39380. c = i * a,
  39381. h = i * s,
  39382. u = i * l,
  39383. d = n * s,
  39384. p = n * l,
  39385. f = r * l,
  39386. g = o * a,
  39387. m = o * s,
  39388. v = o * l
  39389. return (
  39390. (t[0] = 1 - (d + f)),
  39391. (t[4] = h - v),
  39392. (t[8] = u + m),
  39393. (t[1] = h + v),
  39394. (t[5] = 1 - (c + f)),
  39395. (t[9] = p - g),
  39396. (t[2] = u - m),
  39397. (t[6] = p + g),
  39398. (t[10] = 1 - (c + d)),
  39399. (t[3] = 0),
  39400. (t[7] = 0),
  39401. (t[11] = 0),
  39402. (t[12] = 0),
  39403. (t[13] = 0),
  39404. (t[14] = 0),
  39405. (t[15] = 1),
  39406. this
  39407. )
  39408. },
  39409. lookAt: (function () {
  39410. var e, t, i
  39411. return function (r, o, a) {
  39412. void 0 === e && (e = new n.Vector3()), void 0 === t && (t = new n.Vector3()), void 0 === i && (i = new n.Vector3())
  39413. var s = this.elements
  39414. return (
  39415. i.subVectors(r, o).normalize(),
  39416. 0 === i.lengthSq() && (i.z = 1),
  39417. e.crossVectors(a, i).normalize(),
  39418. 0 === e.lengthSq() && ((i.x += 1e-4), e.crossVectors(a, i).normalize()),
  39419. t.crossVectors(i, e),
  39420. (s[0] = e.x),
  39421. (s[4] = t.x),
  39422. (s[8] = i.x),
  39423. (s[1] = e.y),
  39424. (s[5] = t.y),
  39425. (s[9] = i.y),
  39426. (s[2] = e.z),
  39427. (s[6] = t.z),
  39428. (s[10] = i.z),
  39429. this
  39430. )
  39431. }
  39432. })(),
  39433. multiply: function (e, t) {
  39434. return void 0 !== t
  39435. ? (console.warn('THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.'), this.multiplyMatrices(e, t))
  39436. : this.multiplyMatrices(this, e)
  39437. },
  39438. multiplyMatrices: function (e, t) {
  39439. var i = e.elements,
  39440. n = t.elements,
  39441. r = this.elements,
  39442. o = i[0],
  39443. a = i[4],
  39444. s = i[8],
  39445. l = i[12],
  39446. c = i[1],
  39447. h = i[5],
  39448. u = i[9],
  39449. d = i[13],
  39450. p = i[2],
  39451. f = i[6],
  39452. g = i[10],
  39453. m = i[14],
  39454. v = i[3],
  39455. A = i[7],
  39456. y = i[11],
  39457. C = i[15],
  39458. I = n[0],
  39459. E = n[4],
  39460. b = n[8],
  39461. w = n[12],
  39462. _ = n[1],
  39463. T = n[5],
  39464. x = n[9],
  39465. S = n[13],
  39466. M = n[2],
  39467. R = n[6],
  39468. P = n[10],
  39469. O = n[14],
  39470. L = n[3],
  39471. D = n[7],
  39472. N = n[11],
  39473. B = n[15]
  39474. return (
  39475. (r[0] = o * I + a * _ + s * M + l * L),
  39476. (r[4] = o * E + a * T + s * R + l * D),
  39477. (r[8] = o * b + a * x + s * P + l * N),
  39478. (r[12] = o * w + a * S + s * O + l * B),
  39479. (r[1] = c * I + h * _ + u * M + d * L),
  39480. (r[5] = c * E + h * T + u * R + d * D),
  39481. (r[9] = c * b + h * x + u * P + d * N),
  39482. (r[13] = c * w + h * S + u * O + d * B),
  39483. (r[2] = p * I + f * _ + g * M + m * L),
  39484. (r[6] = p * E + f * T + g * R + m * D),
  39485. (r[10] = p * b + f * x + g * P + m * N),
  39486. (r[14] = p * w + f * S + g * O + m * B),
  39487. (r[3] = v * I + A * _ + y * M + C * L),
  39488. (r[7] = v * E + A * T + y * R + C * D),
  39489. (r[11] = v * b + A * x + y * P + C * N),
  39490. (r[15] = v * w + A * S + y * O + C * B),
  39491. this
  39492. )
  39493. },
  39494. multiplyToArray: function (e, t, i) {
  39495. var n = this.elements
  39496. return (
  39497. this.multiplyMatrices(e, t),
  39498. (i[0] = n[0]),
  39499. (i[1] = n[1]),
  39500. (i[2] = n[2]),
  39501. (i[3] = n[3]),
  39502. (i[4] = n[4]),
  39503. (i[5] = n[5]),
  39504. (i[6] = n[6]),
  39505. (i[7] = n[7]),
  39506. (i[8] = n[8]),
  39507. (i[9] = n[9]),
  39508. (i[10] = n[10]),
  39509. (i[11] = n[11]),
  39510. (i[12] = n[12]),
  39511. (i[13] = n[13]),
  39512. (i[14] = n[14]),
  39513. (i[15] = n[15]),
  39514. this
  39515. )
  39516. },
  39517. multiplyScalar: function (e) {
  39518. var t = this.elements
  39519. return (
  39520. (t[0] *= e),
  39521. (t[4] *= e),
  39522. (t[8] *= e),
  39523. (t[12] *= e),
  39524. (t[1] *= e),
  39525. (t[5] *= e),
  39526. (t[9] *= e),
  39527. (t[13] *= e),
  39528. (t[2] *= e),
  39529. (t[6] *= e),
  39530. (t[10] *= e),
  39531. (t[14] *= e),
  39532. (t[3] *= e),
  39533. (t[7] *= e),
  39534. (t[11] *= e),
  39535. (t[15] *= e),
  39536. this
  39537. )
  39538. },
  39539. applyToVector3Array: (function () {
  39540. var e
  39541. return function (t, i, r) {
  39542. void 0 === e && (e = new n.Vector3()), void 0 === i && (i = 0), void 0 === r && (r = t.length)
  39543. for (var o = 0, a = i; o < r; o += 3, a += 3) e.fromArray(t, a), e.applyMatrix4(this), e.toArray(t, a)
  39544. return t
  39545. }
  39546. })(),
  39547. applyToBuffer: (function () {
  39548. var e
  39549. return function (t, i, r) {
  39550. void 0 === e && (e = new n.Vector3()), void 0 === i && (i = 0), void 0 === r && (r = t.length / t.itemSize)
  39551. for (var o = 0, a = i; o < r; o++, a++) (e.x = t.getX(a)), (e.y = t.getY(a)), (e.z = t.getZ(a)), e.applyMatrix4(this), t.setXYZ(e.x, e.y, e.z)
  39552. return t
  39553. }
  39554. })(),
  39555. determinant: function () {
  39556. var e = this.elements,
  39557. t = e[0],
  39558. i = e[4],
  39559. n = e[8],
  39560. r = e[12],
  39561. o = e[1],
  39562. a = e[5],
  39563. s = e[9],
  39564. l = e[13],
  39565. c = e[2],
  39566. h = e[6],
  39567. u = e[10],
  39568. d = e[14],
  39569. p = e[3],
  39570. f = e[7],
  39571. g = e[11],
  39572. m = e[15]
  39573. return (
  39574. p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) +
  39575. f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) +
  39576. g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) +
  39577. m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39578. )
  39579. },
  39580. transpose: function () {
  39581. var e,
  39582. t = this.elements
  39583. return (
  39584. (e = t[1]),
  39585. (t[1] = t[4]),
  39586. (t[4] = e),
  39587. (e = t[2]),
  39588. (t[2] = t[8]),
  39589. (t[8] = e),
  39590. (e = t[6]),
  39591. (t[6] = t[9]),
  39592. (t[9] = e),
  39593. (e = t[3]),
  39594. (t[3] = t[12]),
  39595. (t[12] = e),
  39596. (e = t[7]),
  39597. (t[7] = t[13]),
  39598. (t[13] = e),
  39599. (e = t[11]),
  39600. (t[11] = t[14]),
  39601. (t[14] = e),
  39602. this
  39603. )
  39604. },
  39605. flattenToArrayOffset: function (e, t) {
  39606. var i = this.elements
  39607. return (
  39608. (e[t] = i[0]),
  39609. (e[t + 1] = i[1]),
  39610. (e[t + 2] = i[2]),
  39611. (e[t + 3] = i[3]),
  39612. (e[t + 4] = i[4]),
  39613. (e[t + 5] = i[5]),
  39614. (e[t + 6] = i[6]),
  39615. (e[t + 7] = i[7]),
  39616. (e[t + 8] = i[8]),
  39617. (e[t + 9] = i[9]),
  39618. (e[t + 10] = i[10]),
  39619. (e[t + 11] = i[11]),
  39620. (e[t + 12] = i[12]),
  39621. (e[t + 13] = i[13]),
  39622. (e[t + 14] = i[14]),
  39623. (e[t + 15] = i[15]),
  39624. e
  39625. )
  39626. },
  39627. getPosition: (function () {
  39628. var e
  39629. return function () {
  39630. return (
  39631. void 0 === e && (e = new n.Vector3()),
  39632. console.warn('THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.'),
  39633. e.setFromMatrixColumn(this, 3)
  39634. )
  39635. }
  39636. })(),
  39637. setPosition: function (e) {
  39638. var t = this.elements
  39639. return (t[12] = e.x), (t[13] = e.y), (t[14] = e.z), this
  39640. },
  39641. getInverse: function (e, t) {
  39642. var i = this.elements,
  39643. n = e.elements,
  39644. r = n[0],
  39645. o = n[1],
  39646. a = n[2],
  39647. s = n[3],
  39648. l = n[4],
  39649. c = n[5],
  39650. h = n[6],
  39651. u = n[7],
  39652. d = n[8],
  39653. p = n[9],
  39654. f = n[10],
  39655. g = n[11],
  39656. m = n[12],
  39657. v = n[13],
  39658. A = n[14],
  39659. y = n[15],
  39660. C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y,
  39661. I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y,
  39662. E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y,
  39663. b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A,
  39664. w = r * C + o * I + a * E + s * b
  39665. if (0 === w) {
  39666. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"
  39667. if (t) throw new Error(_)
  39668. return console.warn(_), this.identity()
  39669. }
  39670. return (
  39671. (i[0] = C),
  39672. (i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y),
  39673. (i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y),
  39674. (i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g),
  39675. (i[4] = I),
  39676. (i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y),
  39677. (i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y),
  39678. (i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g),
  39679. (i[8] = E),
  39680. (i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y),
  39681. (i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y),
  39682. (i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g),
  39683. (i[12] = b),
  39684. (i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A),
  39685. (i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A),
  39686. (i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f),
  39687. this.multiplyScalar(1 / w)
  39688. )
  39689. },
  39690. scale: function (e) {
  39691. var t = this.elements,
  39692. i = e.x,
  39693. n = e.y,
  39694. r = e.z
  39695. return (t[0] *= i), (t[4] *= n), (t[8] *= r), (t[1] *= i), (t[5] *= n), (t[9] *= r), (t[2] *= i), (t[6] *= n), (t[10] *= r), (t[3] *= i), (t[7] *= n), (t[11] *= r), this
  39696. },
  39697. getMaxScaleOnAxis: function () {
  39698. var e = this.elements,
  39699. t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2],
  39700. i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6],
  39701. n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10]
  39702. return Math.sqrt(Math.max(t, i, n))
  39703. },
  39704. makeTranslation: function (e, t, i) {
  39705. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1), this
  39706. },
  39707. makeRotationX: function (e) {
  39708. var t = Math.cos(e),
  39709. i = Math.sin(e)
  39710. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1), this
  39711. },
  39712. makeRotationY: function (e) {
  39713. var t = Math.cos(e),
  39714. i = Math.sin(e)
  39715. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1), this
  39716. },
  39717. makeRotationZ: function (e) {
  39718. var t = Math.cos(e),
  39719. i = Math.sin(e)
  39720. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), this
  39721. },
  39722. makeRotationAxis: function (e, t) {
  39723. var i = Math.cos(t),
  39724. n = Math.sin(t),
  39725. r = 1 - i,
  39726. o = e.x,
  39727. a = e.y,
  39728. s = e.z,
  39729. l = r * o,
  39730. c = r * a
  39731. 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), this
  39732. },
  39733. makeScale: function (e, t, i) {
  39734. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1), this
  39735. },
  39736. compose: function (e, t, i) {
  39737. return this.makeRotationFromQuaternion(t), this.scale(i), this.setPosition(e), this
  39738. },
  39739. decompose: (function () {
  39740. var e, t
  39741. return function (i, r, o) {
  39742. void 0 === e && (e = new n.Vector3()), void 0 === t && (t = new n.Matrix4())
  39743. var a = this.elements,
  39744. s = e.set(a[0], a[1], a[2]).length(),
  39745. l = e.set(a[4], a[5], a[6]).length(),
  39746. c = e.set(a[8], a[9], a[10]).length(),
  39747. h = this.determinant()
  39748. h < 0 && (s = -s), (i.x = a[12]), (i.y = a[13]), (i.z = a[14]), t.elements.set(this.elements)
  39749. var u = 1 / s,
  39750. d = 1 / l,
  39751. p = 1 / c
  39752. return (
  39753. (t.elements[0] *= u),
  39754. (t.elements[1] *= u),
  39755. (t.elements[2] *= u),
  39756. (t.elements[4] *= d),
  39757. (t.elements[5] *= d),
  39758. (t.elements[6] *= d),
  39759. (t.elements[8] *= p),
  39760. (t.elements[9] *= p),
  39761. (t.elements[10] *= p),
  39762. r.setFromRotationMatrix(t),
  39763. (o.x = s),
  39764. (o.y = l),
  39765. (o.z = c),
  39766. this
  39767. )
  39768. }
  39769. })(),
  39770. makeFrustum: function (e, t, i, n, r, o) {
  39771. var a = this.elements,
  39772. s = (2 * r) / (t - e),
  39773. l = (2 * r) / (n - i),
  39774. c = (t + e) / (t - e),
  39775. h = (n + i) / (n - i),
  39776. u = -(o + r) / (o - r),
  39777. d = (-2 * o * r) / (o - r)
  39778. return (
  39779. (a[0] = s),
  39780. (a[4] = 0),
  39781. (a[8] = c),
  39782. (a[12] = 0),
  39783. (a[1] = 0),
  39784. (a[5] = l),
  39785. (a[9] = h),
  39786. (a[13] = 0),
  39787. (a[2] = 0),
  39788. (a[6] = 0),
  39789. (a[10] = u),
  39790. (a[14] = d),
  39791. (a[3] = 0),
  39792. (a[7] = 0),
  39793. (a[11] = -1),
  39794. (a[15] = 0),
  39795. this
  39796. )
  39797. },
  39798. makePerspective: function (e, t, i, r) {
  39799. var o = i * Math.tan(n.Math.degToRad(0.5 * e)),
  39800. a = -o,
  39801. s = a * t,
  39802. l = o * t
  39803. return this.makeFrustum(s, l, a, o, i, r)
  39804. },
  39805. makeOrthographic: function (e, t, i, n, r, o) {
  39806. var a = this.elements,
  39807. s = 1 / (t - e),
  39808. l = 1 / (i - n),
  39809. c = 1 / (o - r),
  39810. h = (t + e) * s,
  39811. u = (i + n) * l,
  39812. d = (o + r) * c
  39813. return (
  39814. (a[0] = 2 * s),
  39815. (a[4] = 0),
  39816. (a[8] = 0),
  39817. (a[12] = -h),
  39818. (a[1] = 0),
  39819. (a[5] = 2 * l),
  39820. (a[9] = 0),
  39821. (a[13] = -u),
  39822. (a[2] = 0),
  39823. (a[6] = 0),
  39824. (a[10] = -2 * c),
  39825. (a[14] = -d),
  39826. (a[3] = 0),
  39827. (a[7] = 0),
  39828. (a[11] = 0),
  39829. (a[15] = 1),
  39830. this
  39831. )
  39832. },
  39833. equals: function (e) {
  39834. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++) if (t[n] !== i[n]) return !1
  39835. return !0
  39836. },
  39837. fromArray: function (e) {
  39838. return this.elements.set(e), this
  39839. },
  39840. toArray: function () {
  39841. var e = this.elements
  39842. 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]]
  39843. }
  39844. }),
  39845. (n.Ray = function (e, t) {
  39846. ;(this.origin = void 0 !== e ? e : new n.Vector3()), (this.direction = void 0 !== t ? t : new n.Vector3())
  39847. }),
  39848. (n.Ray.prototype = {
  39849. constructor: n.Ray,
  39850. set: function (e, t) {
  39851. return this.origin.copy(e), this.direction.copy(t), this
  39852. },
  39853. clone: function () {
  39854. return new this.constructor().copy(this)
  39855. },
  39856. copy: function (e) {
  39857. return this.origin.copy(e.origin), this.direction.copy(e.direction), this
  39858. },
  39859. at: function (e, t) {
  39860. var i = t || new n.Vector3()
  39861. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  39862. },
  39863. lookAt: function (e) {
  39864. this.direction.copy(e).sub(this.origin).normalize()
  39865. },
  39866. recast: (function () {
  39867. var e = new n.Vector3()
  39868. return function (t) {
  39869. return this.origin.copy(this.at(t, e)), this
  39870. }
  39871. })(),
  39872. closestPointToPoint: function (e, t) {
  39873. var i = t || new n.Vector3()
  39874. i.subVectors(e, this.origin)
  39875. var r = i.dot(this.direction)
  39876. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  39877. },
  39878. distanceToPoint: function (e) {
  39879. return Math.sqrt(this.distanceSqToPoint(e))
  39880. },
  39881. distanceSqToPoint: (function () {
  39882. var e = new n.Vector3()
  39883. return function (t) {
  39884. var i = e.subVectors(t, this.origin).dot(this.direction)
  39885. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin), e.distanceToSquared(t))
  39886. }
  39887. })(),
  39888. distanceSqToSegment: (function () {
  39889. var e = new n.Vector3(),
  39890. t = new n.Vector3(),
  39891. i = new n.Vector3()
  39892. return function (n, r, o, a) {
  39893. e.copy(n).add(r).multiplyScalar(0.5), t.copy(r).sub(n).normalize(), i.copy(this.origin).sub(e)
  39894. var s,
  39895. l,
  39896. c,
  39897. h,
  39898. u = 0.5 * n.distanceTo(r),
  39899. d = -this.direction.dot(t),
  39900. p = i.dot(this.direction),
  39901. f = -i.dot(t),
  39902. g = i.lengthSq(),
  39903. m = Math.abs(1 - d * d)
  39904. if (m > 0)
  39905. if (((s = d * f - p), (l = d * p - f), (h = u * m), s >= 0))
  39906. if (l >= -h)
  39907. if (l <= h) {
  39908. var v = 1 / m
  39909. ;(s *= v), (l *= v), (c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g)
  39910. } else (l = u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  39911. else (l = -u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  39912. else
  39913. l <= -h
  39914. ? ((s = Math.max(0, -(-d * u + p))), (l = s > 0 ? -u : Math.min(Math.max(-u, -f), u)), (c = -s * s + l * (l + 2 * f) + g))
  39915. : l <= h
  39916. ? ((s = 0), (l = Math.min(Math.max(-u, -f), u)), (c = l * (l + 2 * f) + g))
  39917. : ((s = Math.max(0, -(d * u + p))), (l = s > 0 ? u : Math.min(Math.max(-u, -f), u)), (c = -s * s + l * (l + 2 * f) + g))
  39918. else (l = d > 0 ? -u : u), (s = Math.max(0, -(d * l + p))), (c = -s * s + l * (l + 2 * f) + g)
  39919. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin), a && a.copy(t).multiplyScalar(l).add(e), c
  39920. }
  39921. })(),
  39922. intersectSphere: (function () {
  39923. var e = new n.Vector3()
  39924. return function (t, i) {
  39925. e.subVectors(t.center, this.origin)
  39926. var n = e.dot(this.direction),
  39927. r = e.dot(e) - n * n,
  39928. o = t.radius * t.radius
  39929. if (r > o) return null
  39930. var a = Math.sqrt(o - r),
  39931. s = n - a,
  39932. l = n + a
  39933. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  39934. }
  39935. })(),
  39936. intersectsSphere: function (e) {
  39937. return this.distanceToPoint(e.center) <= e.radius
  39938. },
  39939. distanceToPlane: function (e) {
  39940. var t = e.normal.dot(this.direction)
  39941. if (0 === t) return 0 === e.distanceToPoint(this.origin) ? 0 : null
  39942. var i = -(this.origin.dot(e.normal) + e.constant) / t
  39943. return i >= 0 ? i : null
  39944. },
  39945. intersectPlane: function (e, t) {
  39946. var i = this.distanceToPlane(e)
  39947. return null === i ? null : this.at(i, t)
  39948. },
  39949. intersectsPlane: function (e) {
  39950. var t = e.distanceToPoint(this.origin)
  39951. if (0 === t) return !0
  39952. var i = e.normal.dot(this.direction)
  39953. return i * t < 0
  39954. },
  39955. intersectBox: function (e, t) {
  39956. var i,
  39957. n,
  39958. r,
  39959. o,
  39960. a,
  39961. s,
  39962. l = 1 / this.direction.x,
  39963. c = 1 / this.direction.y,
  39964. h = 1 / this.direction.z,
  39965. u = this.origin
  39966. return (
  39967. l >= 0 ? ((i = (e.min.x - u.x) * l), (n = (e.max.x - u.x) * l)) : ((i = (e.max.x - u.x) * l), (n = (e.min.x - u.x) * l)),
  39968. c >= 0 ? ((r = (e.min.y - u.y) * c), (o = (e.max.y - u.y) * c)) : ((r = (e.max.y - u.y) * c), (o = (e.min.y - u.y) * c)),
  39969. i > o || r > n
  39970. ? null
  39971. : ((r > i || i !== i) && (i = r),
  39972. (o < n || n !== n) && (n = o),
  39973. h >= 0 ? ((a = (e.min.z - u.z) * h), (s = (e.max.z - u.z) * h)) : ((a = (e.max.z - u.z) * h), (s = (e.min.z - u.z) * h)),
  39974. i > s || a > n ? null : ((a > i || i !== i) && (i = a), (s < n || n !== n) && (n = s), n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  39975. )
  39976. },
  39977. intersectsBox: (function () {
  39978. var e = new n.Vector3()
  39979. return function (t) {
  39980. return null !== this.intersectBox(t, e)
  39981. }
  39982. })(),
  39983. intersectTriangle: (function () {
  39984. var e = new n.Vector3(),
  39985. t = new n.Vector3(),
  39986. i = new n.Vector3(),
  39987. r = new n.Vector3()
  39988. return function (n, o, a, s, l) {
  39989. t.subVectors(o, n), i.subVectors(a, n), r.crossVectors(t, i)
  39990. var c,
  39991. h = this.direction.dot(r)
  39992. if (h > 0) {
  39993. if (s) return null
  39994. c = 1
  39995. } else {
  39996. if (!(h < 0)) return null
  39997. ;(c = -1), (h = -h)
  39998. }
  39999. e.subVectors(this.origin, n)
  40000. var u = c * this.direction.dot(i.crossVectors(e, i))
  40001. if (u < 0) return null
  40002. var d = c * this.direction.dot(t.cross(e))
  40003. if (d < 0) return null
  40004. if (u + d > h) return null
  40005. var p = -c * e.dot(r)
  40006. return p < 0 ? null : this.at(p / h, l)
  40007. }
  40008. })(),
  40009. applyMatrix4: function (e) {
  40010. return this.direction.add(this.origin).applyMatrix4(e), this.origin.applyMatrix4(e), this.direction.sub(this.origin), this.direction.normalize(), this
  40011. },
  40012. equals: function (e) {
  40013. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40014. }
  40015. }),
  40016. (n.Sphere = function (e, t) {
  40017. ;(this.center = void 0 !== e ? e : new n.Vector3()), (this.radius = void 0 !== t ? t : 0)
  40018. }),
  40019. (n.Sphere.prototype = {
  40020. constructor: n.Sphere,
  40021. set: function (e, t) {
  40022. return this.center.copy(e), (this.radius = t), this
  40023. },
  40024. setFromPoints: (function () {
  40025. var e = new n.Box3()
  40026. return function (t, i) {
  40027. var n = this.center
  40028. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n)
  40029. for (var r = 0, o = 0, a = t.length; o < a; o++) r = Math.max(r, n.distanceToSquared(t[o]))
  40030. return (this.radius = Math.sqrt(r)), this
  40031. }
  40032. })(),
  40033. clone: function () {
  40034. return new this.constructor().copy(this)
  40035. },
  40036. copy: function (e) {
  40037. return this.center.copy(e.center), (this.radius = e.radius), this
  40038. },
  40039. empty: function () {
  40040. return this.radius <= 0
  40041. },
  40042. containsPoint: function (e) {
  40043. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40044. },
  40045. distanceToPoint: function (e) {
  40046. return e.distanceTo(this.center) - this.radius
  40047. },
  40048. intersectsSphere: function (e) {
  40049. var t = this.radius + e.radius
  40050. return e.center.distanceToSquared(this.center) <= t * t
  40051. },
  40052. intersectsBox: function (e) {
  40053. return e.intersectsSphere(this)
  40054. },
  40055. intersectsPlane: function (e) {
  40056. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40057. },
  40058. clampPoint: function (e, t) {
  40059. var i = this.center.distanceToSquared(e),
  40060. r = t || new n.Vector3()
  40061. return r.copy(e), i > this.radius * this.radius && (r.sub(this.center).normalize(), r.multiplyScalar(this.radius).add(this.center)), r
  40062. },
  40063. getBoundingBox: function (e) {
  40064. var t = e || new n.Box3()
  40065. return t.set(this.center, this.center), t.expandByScalar(this.radius), t
  40066. },
  40067. applyMatrix4: function (e) {
  40068. return this.center.applyMatrix4(e), (this.radius = this.radius * e.getMaxScaleOnAxis()), this
  40069. },
  40070. translate: function (e) {
  40071. return this.center.add(e), this
  40072. },
  40073. equals: function (e) {
  40074. return e.center.equals(this.center) && e.radius === this.radius
  40075. }
  40076. }),
  40077. (n.Frustum = function (e, t, i, r, o, a) {
  40078. this.planes = [
  40079. void 0 !== e ? e : new n.Plane(),
  40080. void 0 !== t ? t : new n.Plane(),
  40081. void 0 !== i ? i : new n.Plane(),
  40082. void 0 !== r ? r : new n.Plane(),
  40083. void 0 !== o ? o : new n.Plane(),
  40084. void 0 !== a ? a : new n.Plane()
  40085. ]
  40086. }),
  40087. (n.Frustum.prototype = {
  40088. constructor: n.Frustum,
  40089. set: function (e, t, i, n, r, o) {
  40090. var a = this.planes
  40091. return a[0].copy(e), a[1].copy(t), a[2].copy(i), a[3].copy(n), a[4].copy(r), a[5].copy(o), this
  40092. },
  40093. clone: function () {
  40094. return new this.constructor().copy(this)
  40095. },
  40096. copy: function (e) {
  40097. for (var t = this.planes, i = 0; i < 6; i++) t[i].copy(e.planes[i])
  40098. return this
  40099. },
  40100. setFromMatrix: function (e) {
  40101. var t = this.planes,
  40102. i = e.elements,
  40103. n = i[0],
  40104. r = i[1],
  40105. o = i[2],
  40106. a = i[3],
  40107. s = i[4],
  40108. l = i[5],
  40109. c = i[6],
  40110. h = i[7],
  40111. u = i[8],
  40112. d = i[9],
  40113. p = i[10],
  40114. f = i[11],
  40115. g = i[12],
  40116. m = i[13],
  40117. v = i[14],
  40118. A = i[15]
  40119. return (
  40120. t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  40121. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  40122. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  40123. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  40124. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  40125. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  40126. this
  40127. )
  40128. },
  40129. intersectsObject: (function () {
  40130. var e = new n.Sphere()
  40131. return function (t) {
  40132. var i = t.geometry
  40133. return null === i.boundingSphere && i.computeBoundingSphere(), e.copy(i.boundingSphere), e.applyMatrix4(t.matrixWorld), this.intersectsSphere(e)
  40134. }
  40135. })(),
  40136. intersectsSphere: function (e) {
  40137. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40138. var o = t[r].distanceToPoint(i)
  40139. if (o < n) return !1
  40140. }
  40141. return !0
  40142. },
  40143. intersectsBox: (function () {
  40144. var e = new n.Vector3(),
  40145. t = new n.Vector3()
  40146. return function (i) {
  40147. for (var n = this.planes, r = 0; r < 6; r++) {
  40148. var o = n[r]
  40149. ;(e.x = o.normal.x > 0 ? i.min.x : i.max.x),
  40150. (t.x = o.normal.x > 0 ? i.max.x : i.min.x),
  40151. (e.y = o.normal.y > 0 ? i.min.y : i.max.y),
  40152. (t.y = o.normal.y > 0 ? i.max.y : i.min.y),
  40153. (e.z = o.normal.z > 0 ? i.min.z : i.max.z),
  40154. (t.z = o.normal.z > 0 ? i.max.z : i.min.z)
  40155. var a = o.distanceToPoint(e),
  40156. s = o.distanceToPoint(t)
  40157. if (a < 0 && s < 0) return !1
  40158. }
  40159. return !0
  40160. }
  40161. })(),
  40162. containsPoint: function (e) {
  40163. for (var t = this.planes, i = 0; i < 6; i++) if (t[i].distanceToPoint(e) < 0) return !1
  40164. return !0
  40165. }
  40166. }),
  40167. (n.Plane = function (e, t) {
  40168. ;(this.normal = void 0 !== e ? e : new n.Vector3(1, 0, 0)), (this.constant = void 0 !== t ? t : 0)
  40169. }),
  40170. (n.Plane.prototype = {
  40171. constructor: n.Plane,
  40172. set: function (e, t) {
  40173. return this.normal.copy(e), (this.constant = t), this
  40174. },
  40175. setComponents: function (e, t, i, n) {
  40176. return this.normal.set(e, t, i), (this.constant = n), this
  40177. },
  40178. setFromNormalAndCoplanarPoint: function (e, t) {
  40179. return this.normal.copy(e), (this.constant = -t.dot(this.normal)), this
  40180. },
  40181. setFromCoplanarPoints: (function () {
  40182. var e = new n.Vector3(),
  40183. t = new n.Vector3()
  40184. return function (i, n, r) {
  40185. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize()
  40186. return this.setFromNormalAndCoplanarPoint(o, i), this
  40187. }
  40188. })(),
  40189. clone: function () {
  40190. return new this.constructor().copy(this)
  40191. },
  40192. copy: function (e) {
  40193. return this.normal.copy(e.normal), (this.constant = e.constant), this
  40194. },
  40195. normalize: function () {
  40196. var e = 1 / this.normal.length()
  40197. return this.normal.multiplyScalar(e), (this.constant *= e), this
  40198. },
  40199. negate: function () {
  40200. return (this.constant *= -1), this.normal.negate(), this
  40201. },
  40202. distanceToPoint: function (e) {
  40203. return this.normal.dot(e) + this.constant
  40204. },
  40205. distanceToSphere: function (e) {
  40206. return this.distanceToPoint(e.center) - e.radius
  40207. },
  40208. projectPoint: function (e, t) {
  40209. return this.orthoPoint(e, t).sub(e).negate()
  40210. },
  40211. orthoPoint: function (e, t) {
  40212. var i = this.distanceToPoint(e),
  40213. r = t || new n.Vector3()
  40214. return r.copy(this.normal).multiplyScalar(i)
  40215. },
  40216. intersectLine: (function () {
  40217. var e = new n.Vector3()
  40218. return function (t, i) {
  40219. var r = i || new n.Vector3(),
  40220. o = t.delta(e),
  40221. a = this.normal.dot(o)
  40222. if (0 !== a) {
  40223. var s = -(t.start.dot(this.normal) + this.constant) / a
  40224. if (!(s < 0 || s > 1)) return r.copy(o).multiplyScalar(s).add(t.start)
  40225. } else if (0 === this.distanceToPoint(t.start)) return r.copy(t.start)
  40226. }
  40227. })(),
  40228. intersectsLine: function (e) {
  40229. var t = this.distanceToPoint(e.start),
  40230. i = this.distanceToPoint(e.end)
  40231. return (t < 0 && i > 0) || (i < 0 && t > 0)
  40232. },
  40233. intersectsBox: function (e) {
  40234. return e.intersectsPlane(this)
  40235. },
  40236. intersectsSphere: function (e) {
  40237. return e.intersectsPlane(this)
  40238. },
  40239. coplanarPoint: function (e) {
  40240. var t = e || new n.Vector3()
  40241. return t.copy(this.normal).multiplyScalar(-this.constant)
  40242. },
  40243. applyMatrix4: (function () {
  40244. var e = new n.Vector3(),
  40245. t = new n.Vector3(),
  40246. i = new n.Matrix3()
  40247. return function (n, r) {
  40248. var o = r || i.getNormalMatrix(n),
  40249. a = e.copy(this.normal).applyMatrix3(o),
  40250. s = this.coplanarPoint(t)
  40251. return s.applyMatrix4(n), this.setFromNormalAndCoplanarPoint(a, s), this
  40252. }
  40253. })(),
  40254. translate: function (e) {
  40255. return (this.constant = this.constant - e.dot(this.normal)), this
  40256. },
  40257. equals: function (e) {
  40258. return e.normal.equals(this.normal) && e.constant === this.constant
  40259. }
  40260. }),
  40261. (n.Spherical = function (e, t, i) {
  40262. return (this.radius = void 0 !== e ? e : 1), (this.phi = void 0 !== t ? t : 0), (this.theta = void 0 !== i ? i : 0), this
  40263. }),
  40264. (n.Spherical.prototype = {
  40265. constructor: n.Spherical,
  40266. set: function (e, t, i) {
  40267. ;(this.radius = e), (this.phi = t), (this.theta = i)
  40268. },
  40269. clone: function () {
  40270. return new this.constructor().copy(this)
  40271. },
  40272. copy: function (e) {
  40273. return this.radius.copy(e.radius), this.phi.copy(e.phi), this.theta.copy(e.theta), this
  40274. },
  40275. makeSafe: function () {
  40276. var e = 1e-6
  40277. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  40278. },
  40279. setFromVector3: function (e) {
  40280. return (
  40281. (this.radius = e.length()),
  40282. 0 === this.radius ? ((this.theta = 0), (this.phi = 0)) : ((this.theta = Math.atan2(e.x, e.z)), (this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1)))),
  40283. this
  40284. )
  40285. }
  40286. }),
  40287. (n.Math = {
  40288. generateUUID: (function () {
  40289. var e,
  40290. t = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split(''),
  40291. i = new Array(36),
  40292. n = 0
  40293. return function () {
  40294. for (var r = 0; r < 36; r++)
  40295. 8 === r || 13 === r || 18 === r || 23 === r
  40296. ? (i[r] = '-')
  40297. : 14 === r
  40298. ? (i[r] = '4')
  40299. : (n <= 2 && (n = (33554432 + 16777216 * Math.random()) | 0), (e = 15 & n), (n >>= 4), (i[r] = t[19 === r ? (3 & e) | 8 : e]))
  40300. return i.join('')
  40301. }
  40302. })(),
  40303. clamp: function (e, t, i) {
  40304. return Math.max(t, Math.min(i, e))
  40305. },
  40306. euclideanModulo: function (e, t) {
  40307. return ((e % t) + t) % t
  40308. },
  40309. mapLinear: function (e, t, i, n, r) {
  40310. return n + ((e - t) * (r - n)) / (i - t)
  40311. },
  40312. smoothstep: function (e, t, i) {
  40313. return e <= t ? 0 : e >= i ? 1 : ((e = (e - t) / (i - t)), e * e * (3 - 2 * e))
  40314. },
  40315. smootherstep: function (e, t, i) {
  40316. return e <= t ? 0 : e >= i ? 1 : ((e = (e - t) / (i - t)), e * e * e * (e * (6 * e - 15) + 10))
  40317. },
  40318. random16: function () {
  40319. return console.warn('THREE.Math.random16() has been deprecated. Use Math.random() instead.'), Math.random()
  40320. },
  40321. randInt: function (e, t) {
  40322. return e + Math.floor(Math.random() * (t - e + 1))
  40323. },
  40324. randFloat: function (e, t) {
  40325. return e + Math.random() * (t - e)
  40326. },
  40327. randFloatSpread: function (e) {
  40328. return e * (0.5 - Math.random())
  40329. },
  40330. degToRad: (function () {
  40331. var e = Math.PI / 180
  40332. return function (t) {
  40333. return t * e
  40334. }
  40335. })(),
  40336. radToDeg: (function () {
  40337. var e = 180 / Math.PI
  40338. return function (t) {
  40339. return t * e
  40340. }
  40341. })(),
  40342. isPowerOfTwo: function (e) {
  40343. return 0 === (e & (e - 1)) && 0 !== e
  40344. },
  40345. nearestPowerOfTwo: function (e) {
  40346. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40347. },
  40348. nextPowerOfTwo: function (e) {
  40349. return e--, (e |= e >> 1), (e |= e >> 2), (e |= e >> 4), (e |= e >> 8), (e |= e >> 16), e++, e
  40350. }
  40351. }),
  40352. (n.Spline = function (e) {
  40353. function t(e, t, i, n, r, o, a) {
  40354. var s = 0.5 * (i - e),
  40355. l = 0.5 * (n - t)
  40356. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40357. }
  40358. this.points = e
  40359. var i,
  40360. r,
  40361. o,
  40362. a,
  40363. s,
  40364. l,
  40365. c,
  40366. h,
  40367. u,
  40368. d = [],
  40369. p = {
  40370. x: 0,
  40371. y: 0,
  40372. z: 0
  40373. }
  40374. ;(this.initFromArray = function (e) {
  40375. this.points = []
  40376. for (var t = 0; t < e.length; t++)
  40377. this.points[t] = {
  40378. x: e[t][0],
  40379. y: e[t][1],
  40380. z: e[t][2]
  40381. }
  40382. }),
  40383. (this.getPoint = function (e) {
  40384. return (
  40385. (i = (this.points.length - 1) * e),
  40386. (r = Math.floor(i)),
  40387. (o = i - r),
  40388. (d[0] = 0 === r ? r : r - 1),
  40389. (d[1] = r),
  40390. (d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1),
  40391. (d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2),
  40392. (l = this.points[d[0]]),
  40393. (c = this.points[d[1]]),
  40394. (h = this.points[d[2]]),
  40395. (u = this.points[d[3]]),
  40396. (a = o * o),
  40397. (s = o * a),
  40398. (p.x = t(l.x, c.x, h.x, u.x, o, a, s)),
  40399. (p.y = t(l.y, c.y, h.y, u.y, o, a, s)),
  40400. (p.z = t(l.z, c.z, h.z, u.z, o, a, s)),
  40401. p
  40402. )
  40403. }),
  40404. (this.getControlPointsArray = function () {
  40405. var e,
  40406. t,
  40407. i = this.points.length,
  40408. n = []
  40409. for (e = 0; e < i; e++) (t = this.points[e]), (n[e] = [t.x, t.y, t.z])
  40410. return n
  40411. }),
  40412. (this.getLength = function (e) {
  40413. var t,
  40414. i,
  40415. r,
  40416. o,
  40417. a = 0,
  40418. s = 0,
  40419. l = 0,
  40420. c = new n.Vector3(),
  40421. h = new n.Vector3(),
  40422. u = [],
  40423. d = 0
  40424. for (u[0] = 0, e || (e = 100), r = this.points.length * e, c.copy(this.points[0]), t = 1; t < r; t++)
  40425. (i = t / r), (o = this.getPoint(i)), h.copy(o), (d += h.distanceTo(c)), c.copy(o), (a = (this.points.length - 1) * i), (s = Math.floor(a)), s !== l && ((u[s] = d), (l = s))
  40426. return (
  40427. (u[u.length] = d),
  40428. {
  40429. chunks: u,
  40430. total: d
  40431. }
  40432. )
  40433. }),
  40434. (this.reparametrizeByArcLength = function (e) {
  40435. var t,
  40436. i,
  40437. r,
  40438. o,
  40439. a,
  40440. s,
  40441. l,
  40442. c,
  40443. h = [],
  40444. u = new n.Vector3(),
  40445. d = this.getLength()
  40446. for (h.push(u.copy(this.points[0]).clone()), t = 1; t < this.points.length; t++) {
  40447. for (s = d.chunks[t] - d.chunks[t - 1], l = Math.ceil((e * s) / d.total), o = (t - 1) / (this.points.length - 1), a = t / (this.points.length - 1), i = 1; i < l - 1; i++)
  40448. (r = o + i * (1 / l) * (a - o)), (c = this.getPoint(r)), h.push(u.copy(c).clone())
  40449. h.push(u.copy(this.points[t]).clone())
  40450. }
  40451. this.points = h
  40452. })
  40453. }),
  40454. (n.Triangle = function (e, t, i) {
  40455. ;(this.a = void 0 !== e ? e : new n.Vector3()), (this.b = void 0 !== t ? t : new n.Vector3()), (this.c = void 0 !== i ? i : new n.Vector3())
  40456. }),
  40457. (n.Triangle.normal = (function () {
  40458. var e = new n.Vector3()
  40459. return function (t, i, r, o) {
  40460. var a = o || new n.Vector3()
  40461. a.subVectors(r, i), e.subVectors(t, i), a.cross(e)
  40462. var s = a.lengthSq()
  40463. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  40464. }
  40465. })()),
  40466. (n.Triangle.barycoordFromPoint = (function () {
  40467. var e = new n.Vector3(),
  40468. t = new n.Vector3(),
  40469. i = new n.Vector3()
  40470. return function (r, o, a, s, l) {
  40471. e.subVectors(s, o), t.subVectors(a, o), i.subVectors(r, o)
  40472. var c = e.dot(e),
  40473. h = e.dot(t),
  40474. u = e.dot(i),
  40475. d = t.dot(t),
  40476. p = t.dot(i),
  40477. f = c * d - h * h,
  40478. g = l || new n.Vector3()
  40479. if (0 === f) return g.set(-2, -1, -1)
  40480. var m = 1 / f,
  40481. v = (d * u - h * p) * m,
  40482. A = (c * p - h * u) * m
  40483. return g.set(1 - v - A, A, v)
  40484. }
  40485. })()),
  40486. (n.Triangle.containsPoint = (function () {
  40487. var e = new n.Vector3()
  40488. return function (t, i, r, o) {
  40489. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e)
  40490. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  40491. }
  40492. })()),
  40493. (n.Triangle.prototype = {
  40494. constructor: n.Triangle,
  40495. set: function (e, t, i) {
  40496. return this.a.copy(e), this.b.copy(t), this.c.copy(i), this
  40497. },
  40498. setFromPointsAndIndices: function (e, t, i, n) {
  40499. return this.a.copy(e[t]), this.b.copy(e[i]), this.c.copy(e[n]), this
  40500. },
  40501. clone: function () {
  40502. return new this.constructor().copy(this)
  40503. },
  40504. copy: function (e) {
  40505. return this.a.copy(e.a), this.b.copy(e.b), this.c.copy(e.c), this
  40506. },
  40507. area: (function () {
  40508. var e = new n.Vector3(),
  40509. t = new n.Vector3()
  40510. return function () {
  40511. return e.subVectors(this.c, this.b), t.subVectors(this.a, this.b), 0.5 * e.cross(t).length()
  40512. }
  40513. })(),
  40514. midpoint: function (e) {
  40515. var t = e || new n.Vector3()
  40516. return t
  40517. .addVectors(this.a, this.b)
  40518. .add(this.c)
  40519. .multiplyScalar(1 / 3)
  40520. },
  40521. normal: function (e) {
  40522. return n.Triangle.normal(this.a, this.b, this.c, e)
  40523. },
  40524. plane: function (e) {
  40525. var t = e || new n.Plane()
  40526. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  40527. },
  40528. barycoordFromPoint: function (e, t) {
  40529. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40530. },
  40531. containsPoint: function (e) {
  40532. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  40533. },
  40534. equals: function (e) {
  40535. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40536. }
  40537. }),
  40538. (n.Interpolant = function (e, t, i, n) {
  40539. ;(this.parameterPositions = e), (this._cachedIndex = 0), (this.resultBuffer = void 0 !== n ? n : new t.constructor(i)), (this.sampleValues = t), (this.valueSize = i)
  40540. }),
  40541. (n.Interpolant.prototype = {
  40542. constructor: n.Interpolant,
  40543. evaluate: function (e) {
  40544. var t = this.parameterPositions,
  40545. i = this._cachedIndex,
  40546. n = t[i],
  40547. r = t[i - 1]
  40548. e: {
  40549. t: {
  40550. var o
  40551. i: {
  40552. n: if (!(e < n)) {
  40553. for (var a = i + 2; ; ) {
  40554. if (void 0 === n) {
  40555. if (e < r) break n
  40556. return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, e, r)
  40557. }
  40558. if (i === a) break
  40559. if (((r = n), (n = t[++i]), e < n)) break t
  40560. }
  40561. o = t.length
  40562. break i
  40563. }
  40564. {
  40565. if (e >= r) break e
  40566. var s = t[1]
  40567. e < s && ((i = 2), (r = s))
  40568. for (var a = i - 2; ; ) {
  40569. if (void 0 === r) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  40570. if (i === a) break
  40571. if (((n = r), (r = t[--i - 1]), e >= r)) break t
  40572. }
  40573. ;(o = i), (i = 0)
  40574. }
  40575. }
  40576. for (; i < o; ) {
  40577. var l = (i + o) >>> 1
  40578. e < t[l] ? (o = l) : (i = l + 1)
  40579. }
  40580. if (((n = t[i]), (r = t[i - 1]), void 0 === r)) return (this._cachedIndex = 0), this.beforeStart_(0, e, n)
  40581. if (void 0 === n) return (i = t.length), (this._cachedIndex = i), this.afterEnd_(i - 1, r, e)
  40582. }
  40583. ;(this._cachedIndex = i), this.intervalChanged_(i, r, n)
  40584. }
  40585. return this.interpolate_(i, r, e, n)
  40586. },
  40587. settings: null,
  40588. DefaultSettings_: {},
  40589. getSettings_: function () {
  40590. return this.settings || this.DefaultSettings_
  40591. },
  40592. copySampleValue_: function (e) {
  40593. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o) t[o] = i[r + o]
  40594. return t
  40595. },
  40596. interpolate_: function (e, t, i, n) {
  40597. throw new Error('call to abstract method')
  40598. },
  40599. intervalChanged_: function (e, t, i) {}
  40600. }),
  40601. Object.assign(n.Interpolant.prototype, {
  40602. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  40603. afterEnd_: n.Interpolant.prototype.copySampleValue_
  40604. }),
  40605. (n.CubicInterpolant = function (e, t, i, r) {
  40606. n.Interpolant.call(this, e, t, i, r), (this._weightPrev = -0), (this._offsetPrev = -0), (this._weightNext = -0), (this._offsetNext = -0)
  40607. }),
  40608. (n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40609. constructor: n.CubicInterpolant,
  40610. DefaultSettings_: {
  40611. endingStart: n.ZeroCurvatureEnding,
  40612. endingEnd: n.ZeroCurvatureEnding
  40613. },
  40614. intervalChanged_: function (e, t, i) {
  40615. var r = this.parameterPositions,
  40616. o = e - 2,
  40617. a = e + 1,
  40618. s = r[o],
  40619. l = r[a]
  40620. if (void 0 === s)
  40621. switch (this.getSettings_().endingStart) {
  40622. case n.ZeroSlopeEnding:
  40623. ;(o = e), (s = 2 * t - i)
  40624. break
  40625. case n.WrapAroundEnding:
  40626. ;(o = r.length - 2), (s = t + r[o] - r[o + 1])
  40627. break
  40628. default:
  40629. ;(o = e), (s = i)
  40630. }
  40631. if (void 0 === l)
  40632. switch (this.getSettings_().endingEnd) {
  40633. case n.ZeroSlopeEnding:
  40634. ;(a = e), (l = 2 * i - t)
  40635. break
  40636. case n.WrapAroundEnding:
  40637. ;(a = 1), (l = i + r[1] - r[0])
  40638. break
  40639. default:
  40640. ;(a = e - 1), (l = t)
  40641. }
  40642. var c = 0.5 * (i - t),
  40643. h = this.valueSize
  40644. ;(this._weightPrev = c / (t - s)), (this._weightNext = c / (l - i)), (this._offsetPrev = o * h), (this._offsetNext = a * h)
  40645. },
  40646. interpolate_: function (e, t, i, n) {
  40647. for (
  40648. var r = this.resultBuffer,
  40649. o = this.sampleValues,
  40650. a = this.valueSize,
  40651. s = e * a,
  40652. l = s - a,
  40653. c = this._offsetPrev,
  40654. h = this._offsetNext,
  40655. u = this._weightPrev,
  40656. d = this._weightNext,
  40657. p = (i - t) / (n - t),
  40658. f = p * p,
  40659. g = f * p,
  40660. m = -u * g + 2 * u * f - u * p,
  40661. v = (1 + u) * g + (-1.5 - 2 * u) * f + (-0.5 + u) * p + 1,
  40662. A = (-1 - d) * g + (1.5 + d) * f + 0.5 * p,
  40663. y = d * g - d * f,
  40664. C = 0;
  40665. C !== a;
  40666. ++C
  40667. )
  40668. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C]
  40669. return r
  40670. }
  40671. })),
  40672. (n.DiscreteInterpolant = function (e, t, i, r) {
  40673. n.Interpolant.call(this, e, t, i, r)
  40674. }),
  40675. (n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40676. constructor: n.DiscreteInterpolant,
  40677. interpolate_: function (e, t, i, n) {
  40678. return this.copySampleValue_(e - 1)
  40679. }
  40680. })),
  40681. (n.LinearInterpolant = function (e, t, i, r) {
  40682. n.Interpolant.call(this, e, t, i, r)
  40683. }),
  40684. (n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40685. constructor: n.LinearInterpolant,
  40686. interpolate_: function (e, t, i, n) {
  40687. 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) r[u] = o[l + u] * h + o[s + u] * c
  40688. return r
  40689. }
  40690. })),
  40691. (n.QuaternionLinearInterpolant = function (e, t, i, r) {
  40692. n.Interpolant.call(this, e, t, i, r)
  40693. }),
  40694. (n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40695. constructor: n.QuaternionLinearInterpolant,
  40696. interpolate_: function (e, t, i, r) {
  40697. 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) n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c)
  40698. return o
  40699. }
  40700. })),
  40701. (n.Clock = function (e) {
  40702. ;(this.autoStart = void 0 === e || e), (this.startTime = 0), (this.oldTime = 0), (this.elapsedTime = 0), (this.running = !1)
  40703. }),
  40704. (n.Clock.prototype = {
  40705. constructor: n.Clock,
  40706. start: function () {
  40707. ;(this.startTime = performance.now()), (this.oldTime = this.startTime), (this.running = !0)
  40708. },
  40709. stop: function () {
  40710. this.getElapsedTime(), (this.running = !1)
  40711. },
  40712. getElapsedTime: function () {
  40713. return this.getDelta(), this.elapsedTime
  40714. },
  40715. getDelta: function () {
  40716. var e = 0
  40717. if ((this.autoStart && !this.running && this.start(), this.running)) {
  40718. var t = performance.now()
  40719. ;(e = 0.001 * (t - this.oldTime)), (this.oldTime = t), (this.elapsedTime += e)
  40720. }
  40721. return e
  40722. }
  40723. }),
  40724. (n.EventDispatcher = function () {}),
  40725. (n.EventDispatcher.prototype = {
  40726. constructor: n.EventDispatcher,
  40727. apply: function (e) {
  40728. ;(e.addEventListener = n.EventDispatcher.prototype.addEventListener),
  40729. (e.hasEventListener = n.EventDispatcher.prototype.hasEventListener),
  40730. (e.removeEventListener = n.EventDispatcher.prototype.removeEventListener),
  40731. (e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent)
  40732. },
  40733. addEventListener: function (e, t) {
  40734. void 0 === this._listeners && (this._listeners = {})
  40735. var i = this._listeners
  40736. void 0 === i[e] && (i[e] = []), i[e].indexOf(t) === -1 && i[e].push(t)
  40737. },
  40738. hasEventListener: function (e, t) {
  40739. if (void 0 === this._listeners) return !1
  40740. var i = this._listeners
  40741. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  40742. },
  40743. removeEventListener: function (e, t) {
  40744. if (void 0 !== this._listeners) {
  40745. var i = this._listeners,
  40746. n = i[e]
  40747. if (void 0 !== n) {
  40748. var r = n.indexOf(t)
  40749. r !== -1 && n.splice(r, 1)
  40750. }
  40751. }
  40752. },
  40753. dispatchEvent: function (e) {
  40754. if (void 0 !== this._listeners) {
  40755. var t = this._listeners,
  40756. i = t[e.type]
  40757. if (void 0 !== i) {
  40758. e.target = this
  40759. for (var n = [], r = i.length, o = 0; o < r; o++) n[o] = i[o]
  40760. for (var o = 0; o < r; o++) n[o].call(this, e)
  40761. }
  40762. }
  40763. }
  40764. }),
  40765. (n.Layers = function () {
  40766. this.mask = 1
  40767. }),
  40768. (n.Layers.prototype = {
  40769. constructor: n.Layers,
  40770. set: function (e) {
  40771. this.mask = 1 << e
  40772. },
  40773. enable: function (e) {
  40774. this.mask |= 1 << e
  40775. },
  40776. toggle: function (e) {
  40777. this.mask ^= 1 << e
  40778. },
  40779. disable: function (e) {
  40780. this.mask &= ~(1 << e)
  40781. },
  40782. test: function (e) {
  40783. return 0 !== (this.mask & e.mask)
  40784. }
  40785. }),
  40786. (function (e) {
  40787. function t(e, t) {
  40788. return e.distance - t.distance
  40789. }
  40790. function i(e, t, n, r) {
  40791. if (e.visible !== !1 && (e.raycast(t, n), r === !0)) for (var o = e.children, a = 0, s = o.length; a < s; a++) i(o[a], t, n, !0)
  40792. }
  40793. ;(e.Raycaster = function (t, i, n, r) {
  40794. ;(this.ray = new e.Ray(t, i)),
  40795. (this.near = n || 0),
  40796. (this.far = r || 1 / 0),
  40797. (this.params = {
  40798. Mesh: {},
  40799. Line: {},
  40800. LOD: {},
  40801. Points: {
  40802. threshold: 1
  40803. },
  40804. Sprite: {}
  40805. }),
  40806. Object.defineProperties(this.params, {
  40807. PointCloud: {
  40808. get: function () {
  40809. return console.warn('THREE.Raycaster: params.PointCloud has been renamed to params.Points.'), this.Points
  40810. }
  40811. }
  40812. })
  40813. }),
  40814. (e.Raycaster.prototype = {
  40815. constructor: e.Raycaster,
  40816. linePrecision: 1,
  40817. set: function (e, t) {
  40818. this.ray.set(e, t)
  40819. },
  40820. setFromCamera: function (t, i) {
  40821. i instanceof e.PerspectiveCamera
  40822. ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld), this.ray.direction.set(t.x, t.y, 0.5).unproject(i).sub(this.ray.origin).normalize())
  40823. : i instanceof e.OrthographicCamera
  40824. ? (this.ray.origin.set(t.x, t.y, -1).unproject(i), this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld))
  40825. : console.error('THREE.Raycaster: Unsupported camera type.')
  40826. },
  40827. intersectObject: function (e, n) {
  40828. var r = []
  40829. return i(e, this, r, n), r.sort(t), r
  40830. },
  40831. intersectObjects: function (e, n) {
  40832. var r = []
  40833. if (Array.isArray(e) === !1) return console.warn('THREE.Raycaster.intersectObjects: objects is not an Array.'), r
  40834. for (var o = 0, a = e.length; o < a; o++) i(e[o], this, r, n)
  40835. return r.sort(t), r
  40836. }
  40837. })
  40838. })(n),
  40839. (n.Object3D = function () {
  40840. function e() {
  40841. o.setFromEuler(r, !1)
  40842. }
  40843. function t() {
  40844. r.setFromQuaternion(o, void 0, !1)
  40845. }
  40846. Object.defineProperty(this, 'id', {
  40847. value: n.Object3DIdCount++
  40848. }),
  40849. (this.uuid = n.Math.generateUUID()),
  40850. (this.name = ''),
  40851. (this.type = 'Object3D'),
  40852. (this.parent = null),
  40853. (this.children = []),
  40854. (this.up = n.Object3D.DefaultUp.clone())
  40855. var i = new n.Vector3(),
  40856. r = new n.Euler(),
  40857. o = new n.Quaternion(),
  40858. a = new n.Vector3(1, 1, 1)
  40859. r.onChange(e),
  40860. o.onChange(t),
  40861. Object.defineProperties(this, {
  40862. position: {
  40863. enumerable: !0,
  40864. value: i
  40865. },
  40866. rotation: {
  40867. enumerable: !0,
  40868. value: r
  40869. },
  40870. quaternion: {
  40871. enumerable: !0,
  40872. value: o
  40873. },
  40874. scale: {
  40875. enumerable: !0,
  40876. value: a
  40877. },
  40878. modelViewMatrix: {
  40879. value: new n.Matrix4()
  40880. },
  40881. normalMatrix: {
  40882. value: new n.Matrix3()
  40883. }
  40884. }),
  40885. (this.rotationAutoUpdate = !0),
  40886. (this.matrix = new n.Matrix4()),
  40887. (this.matrixWorld = new n.Matrix4()),
  40888. (this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate),
  40889. (this.matrixWorldNeedsUpdate = !1),
  40890. (this.layers = new n.Layers()),
  40891. (this.visible = !0),
  40892. (this.castShadow = !1),
  40893. (this.receiveShadow = !1),
  40894. (this.frustumCulled = !0),
  40895. (this.renderOrder = 0),
  40896. (this.userData = {})
  40897. }),
  40898. (n.Object3D.DefaultUp = new n.Vector3(0, 1, 0)),
  40899. (n.Object3D.DefaultMatrixAutoUpdate = !0),
  40900. (n.Object3D.prototype = {
  40901. constructor: n.Object3D,
  40902. applyMatrix: function (e) {
  40903. this.matrix.multiplyMatrices(e, this.matrix), this.matrix.decompose(this.position, this.quaternion, this.scale)
  40904. },
  40905. setRotationFromAxisAngle: function (e, t) {
  40906. this.quaternion.setFromAxisAngle(e, t)
  40907. },
  40908. setRotationFromEuler: function (e) {
  40909. this.quaternion.setFromEuler(e, !0)
  40910. },
  40911. setRotationFromMatrix: function (e) {
  40912. this.quaternion.setFromRotationMatrix(e)
  40913. },
  40914. setRotationFromQuaternion: function (e) {
  40915. this.quaternion.copy(e)
  40916. },
  40917. rotateOnAxis: (function () {
  40918. var e = new n.Quaternion()
  40919. return function (t, i) {
  40920. return e.setFromAxisAngle(t, i), this.quaternion.multiply(e), this
  40921. }
  40922. })(),
  40923. rotateX: (function () {
  40924. var e = new n.Vector3(1, 0, 0)
  40925. return function (t) {
  40926. return this.rotateOnAxis(e, t)
  40927. }
  40928. })(),
  40929. rotateY: (function () {
  40930. var e = new n.Vector3(0, 1, 0)
  40931. return function (t) {
  40932. return this.rotateOnAxis(e, t)
  40933. }
  40934. })(),
  40935. rotateZ: (function () {
  40936. var e = new n.Vector3(0, 0, 1)
  40937. return function (t) {
  40938. return this.rotateOnAxis(e, t)
  40939. }
  40940. })(),
  40941. translateOnAxis: (function () {
  40942. var e = new n.Vector3()
  40943. return function (t, i) {
  40944. return e.copy(t).applyQuaternion(this.quaternion), this.position.add(e.multiplyScalar(i)), this
  40945. }
  40946. })(),
  40947. translateX: (function () {
  40948. var e = new n.Vector3(1, 0, 0)
  40949. return function (t) {
  40950. return this.translateOnAxis(e, t)
  40951. }
  40952. })(),
  40953. translateY: (function () {
  40954. var e = new n.Vector3(0, 1, 0)
  40955. return function (t) {
  40956. return this.translateOnAxis(e, t)
  40957. }
  40958. })(),
  40959. translateZ: (function () {
  40960. var e = new n.Vector3(0, 0, 1)
  40961. return function (t) {
  40962. return this.translateOnAxis(e, t)
  40963. }
  40964. })(),
  40965. localToWorld: function (e) {
  40966. return e.applyMatrix4(this.matrixWorld)
  40967. },
  40968. worldToLocal: (function () {
  40969. var e = new n.Matrix4()
  40970. return function (t) {
  40971. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  40972. }
  40973. })(),
  40974. lookAt: (function () {
  40975. var e = new n.Matrix4()
  40976. return function (t) {
  40977. e.lookAt(t, this.position, this.up), this.quaternion.setFromRotationMatrix(e)
  40978. }
  40979. })(),
  40980. add: function (e) {
  40981. if (arguments.length > 1) {
  40982. for (var t = 0; t < arguments.length; t++) this.add(arguments[t])
  40983. return this
  40984. }
  40985. return e === this
  40986. ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e), this)
  40987. : (e instanceof n.Object3D
  40988. ? (null !== e.parent && e.parent.remove(e),
  40989. (e.parent = this),
  40990. e.dispatchEvent({
  40991. type: 'added'
  40992. }),
  40993. this.children.push(e))
  40994. : console.error('THREE.Object3D.add: object not an instance of THREE.Object3D.', e),
  40995. this)
  40996. },
  40997. remove: function (e) {
  40998. if (arguments.length > 1) for (var t = 0; t < arguments.length; t++) this.remove(arguments[t])
  40999. var i = this.children.indexOf(e)
  41000. i !== -1 &&
  41001. ((e.parent = null),
  41002. e.dispatchEvent({
  41003. type: 'removed'
  41004. }),
  41005. this.children.splice(i, 1))
  41006. },
  41007. getObjectById: function (e) {
  41008. return this.getObjectByProperty('id', e)
  41009. },
  41010. getObjectByName: function (e) {
  41011. return this.getObjectByProperty('name', e)
  41012. },
  41013. getObjectByProperty: function (e, t) {
  41014. if (this[e] === t) return this
  41015. for (var i = 0, n = this.children.length; i < n; i++) {
  41016. var r = this.children[i],
  41017. o = r.getObjectByProperty(e, t)
  41018. if (void 0 !== o) return o
  41019. }
  41020. },
  41021. getWorldPosition: function (e) {
  41022. var t = e || new n.Vector3()
  41023. return this.updateMatrixWorld(!0), t.setFromMatrixPosition(this.matrixWorld)
  41024. },
  41025. getWorldQuaternion: (function () {
  41026. var e = new n.Vector3(),
  41027. t = new n.Vector3()
  41028. return function (i) {
  41029. var r = i || new n.Quaternion()
  41030. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, r, t), r
  41031. }
  41032. })(),
  41033. getWorldRotation: (function () {
  41034. var e = new n.Quaternion()
  41035. return function (t) {
  41036. var i = t || new n.Euler()
  41037. return this.getWorldQuaternion(e), i.setFromQuaternion(e, this.rotation.order, !1)
  41038. }
  41039. })(),
  41040. getWorldScale: (function () {
  41041. var e = new n.Vector3(),
  41042. t = new n.Quaternion()
  41043. return function (i) {
  41044. var r = i || new n.Vector3()
  41045. return this.updateMatrixWorld(!0), this.matrixWorld.decompose(e, t, r), r
  41046. }
  41047. })(),
  41048. getWorldDirection: (function () {
  41049. var e = new n.Quaternion()
  41050. return function (t) {
  41051. var i = t || new n.Vector3()
  41052. return this.getWorldQuaternion(e), i.set(0, 0, 1).applyQuaternion(e)
  41053. }
  41054. })(),
  41055. raycast: function () {},
  41056. traverse: function (e) {
  41057. e(this)
  41058. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverse(e)
  41059. },
  41060. traverseVisible: function (e) {
  41061. if (this.visible !== !1) {
  41062. e(this)
  41063. for (var t = this.children, i = 0, n = t.length; i < n; i++) t[i].traverseVisible(e)
  41064. }
  41065. },
  41066. traverseAncestors: function (e) {
  41067. var t = this.parent
  41068. null !== t && (e(t), t.traverseAncestors(e))
  41069. },
  41070. updateMatrix: function () {
  41071. this.matrix.compose(this.position, this.quaternion, this.scale), (this.matrixWorldNeedsUpdate = !0)
  41072. },
  41073. updateMatrixWorld: function (e) {
  41074. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  41075. (this.matrixWorldNeedsUpdate !== !0 && e !== !0) ||
  41076. (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix), (this.matrixWorldNeedsUpdate = !1), (e = !0))
  41077. for (var t = 0, i = this.children.length; t < i; t++) this.children[t].updateMatrixWorld(e)
  41078. },
  41079. toJSON: function (e) {
  41080. function t(e) {
  41081. var t = []
  41082. for (var i in e) {
  41083. var n = e[i]
  41084. delete n.metadata, t.push(n)
  41085. }
  41086. return t
  41087. }
  41088. var i = void 0 === e,
  41089. n = {}
  41090. i &&
  41091. ((e = {
  41092. geometries: {},
  41093. materials: {},
  41094. textures: {},
  41095. images: {}
  41096. }),
  41097. (n.metadata = {
  41098. version: 4.4,
  41099. type: 'Object',
  41100. generator: 'Object3D.toJSON'
  41101. }))
  41102. var r = {}
  41103. if (
  41104. ((r.uuid = this.uuid),
  41105. (r.type = this.type),
  41106. '' !== this.name && (r.name = this.name),
  41107. '{}' !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41108. this.castShadow === !0 && (r.castShadow = !0),
  41109. this.receiveShadow === !0 && (r.receiveShadow = !0),
  41110. this.visible === !1 && (r.visible = !1),
  41111. (r.matrix = this.matrix.toArray()),
  41112. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)), (r.geometry = this.geometry.uuid)),
  41113. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)), (r.material = this.material.uuid)),
  41114. this.children.length > 0)
  41115. ) {
  41116. r.children = []
  41117. for (var o = 0; o < this.children.length; o++) r.children.push(this.children[o].toJSON(e).object)
  41118. }
  41119. if (i) {
  41120. var a = t(e.geometries),
  41121. s = t(e.materials),
  41122. l = t(e.textures),
  41123. c = t(e.images)
  41124. a.length > 0 && (n.geometries = a), s.length > 0 && (n.materials = s), l.length > 0 && (n.textures = l), c.length > 0 && (n.images = c)
  41125. }
  41126. return (n.object = r), n
  41127. },
  41128. clone: function (e) {
  41129. return new this.constructor().copy(this, e)
  41130. },
  41131. copy: function (e, t) {
  41132. if (
  41133. (void 0 === t && (t = !0),
  41134. (this.name = e.name),
  41135. this.up.copy(e.up),
  41136. this.position.copy(e.position),
  41137. this.quaternion.copy(e.quaternion),
  41138. this.scale.copy(e.scale),
  41139. (this.rotationAutoUpdate = e.rotationAutoUpdate),
  41140. this.matrix.copy(e.matrix),
  41141. this.matrixWorld.copy(e.matrixWorld),
  41142. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  41143. (this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate),
  41144. (this.visible = e.visible),
  41145. (this.castShadow = e.castShadow),
  41146. (this.receiveShadow = e.receiveShadow),
  41147. (this.frustumCulled = e.frustumCulled),
  41148. (this.renderOrder = e.renderOrder),
  41149. (this.userData = JSON.parse(JSON.stringify(e.userData))),
  41150. t === !0)
  41151. )
  41152. for (var i = 0; i < e.children.length; i++) {
  41153. var n = e.children[i]
  41154. this.add(n.clone())
  41155. }
  41156. return this
  41157. }
  41158. }),
  41159. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  41160. (n.Object3DIdCount = 0),
  41161. (n.Face3 = function (e, t, i, r, o, a) {
  41162. ;(this.a = e),
  41163. (this.b = t),
  41164. (this.c = i),
  41165. (this.normal = r instanceof n.Vector3 ? r : new n.Vector3()),
  41166. (this.vertexNormals = Array.isArray(r) ? r : []),
  41167. (this.color = o instanceof n.Color ? o : new n.Color()),
  41168. (this.vertexColors = Array.isArray(o) ? o : []),
  41169. (this.materialIndex = void 0 !== a ? a : 0)
  41170. }),
  41171. (n.Face3.prototype = {
  41172. constructor: n.Face3,
  41173. clone: function () {
  41174. return new this.constructor().copy(this)
  41175. },
  41176. copy: function (e) {
  41177. ;(this.a = e.a), (this.b = e.b), (this.c = e.c), this.normal.copy(e.normal), this.color.copy(e.color), (this.materialIndex = e.materialIndex)
  41178. for (var t = 0, i = e.vertexNormals.length; t < i; t++) this.vertexNormals[t] = e.vertexNormals[t].clone()
  41179. for (var t = 0, i = e.vertexColors.length; t < i; t++) this.vertexColors[t] = e.vertexColors[t].clone()
  41180. return this
  41181. }
  41182. }),
  41183. (n.BufferAttribute = function (e, t) {
  41184. ;(this.uuid = n.Math.generateUUID()),
  41185. (this.array = e),
  41186. (this.itemSize = t),
  41187. (this.dynamic = !1),
  41188. (this.updateRange = {
  41189. offset: 0,
  41190. count: -1
  41191. }),
  41192. (this.version = 0)
  41193. }),
  41194. (n.BufferAttribute.prototype = {
  41195. constructor: n.BufferAttribute,
  41196. get count() {
  41197. return this.array.length / this.itemSize
  41198. },
  41199. set needsUpdate(e) {
  41200. e === !0 && this.version++
  41201. },
  41202. setDynamic: function (e) {
  41203. return (this.dynamic = e), this
  41204. },
  41205. copy: function (e) {
  41206. return (this.array = new e.array.constructor(e.array)), (this.itemSize = e.itemSize), (this.dynamic = e.dynamic), this
  41207. },
  41208. copyAt: function (e, t, i) {
  41209. ;(e *= this.itemSize), (i *= t.itemSize)
  41210. for (var n = 0, r = this.itemSize; n < r; n++) this.array[e + n] = t.array[i + n]
  41211. return this
  41212. },
  41213. copyArray: function (e) {
  41214. return this.array.set(e), this
  41215. },
  41216. copyColorsArray: function (e) {
  41217. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41218. var a = e[r]
  41219. void 0 === a && (console.warn('THREE.BufferAttribute.copyColorsArray(): color is undefined', r), (a = new n.Color())), (t[i++] = a.r), (t[i++] = a.g), (t[i++] = a.b)
  41220. }
  41221. return this
  41222. },
  41223. copyIndicesArray: function (e) {
  41224. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41225. var o = e[n]
  41226. ;(t[i++] = o.a), (t[i++] = o.b), (t[i++] = o.c)
  41227. }
  41228. return this
  41229. },
  41230. copyVector2sArray: function (e) {
  41231. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41232. var a = e[r]
  41233. void 0 === a && (console.warn('THREE.BufferAttribute.copyVector2sArray(): vector is undefined', r), (a = new n.Vector2())), (t[i++] = a.x), (t[i++] = a.y)
  41234. }
  41235. return this
  41236. },
  41237. copyVector3sArray: function (e) {
  41238. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41239. var a = e[r]
  41240. void 0 === a && (console.warn('THREE.BufferAttribute.copyVector3sArray(): vector is undefined', r), (a = new n.Vector3())), (t[i++] = a.x), (t[i++] = a.y), (t[i++] = a.z)
  41241. }
  41242. return this
  41243. },
  41244. copyVector4sArray: function (e) {
  41245. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41246. var a = e[r]
  41247. void 0 === a && (console.warn('THREE.BufferAttribute.copyVector4sArray(): vector is undefined', r), (a = new n.Vector4())),
  41248. (t[i++] = a.x),
  41249. (t[i++] = a.y),
  41250. (t[i++] = a.z),
  41251. (t[i++] = a.w)
  41252. }
  41253. return this
  41254. },
  41255. set: function (e, t) {
  41256. return void 0 === t && (t = 0), this.array.set(e, t), this
  41257. },
  41258. getX: function (e) {
  41259. return this.array[e * this.itemSize]
  41260. },
  41261. setX: function (e, t) {
  41262. return (this.array[e * this.itemSize] = t), this
  41263. },
  41264. getY: function (e) {
  41265. return this.array[e * this.itemSize + 1]
  41266. },
  41267. setY: function (e, t) {
  41268. return (this.array[e * this.itemSize + 1] = t), this
  41269. },
  41270. getZ: function (e) {
  41271. return this.array[e * this.itemSize + 2]
  41272. },
  41273. setZ: function (e, t) {
  41274. return (this.array[e * this.itemSize + 2] = t), this
  41275. },
  41276. getW: function (e) {
  41277. return this.array[e * this.itemSize + 3]
  41278. },
  41279. setW: function (e, t) {
  41280. return (this.array[e * this.itemSize + 3] = t), this
  41281. },
  41282. setXY: function (e, t, i) {
  41283. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), this
  41284. },
  41285. setXYZ: function (e, t, i, n) {
  41286. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), (this.array[e + 2] = n), this
  41287. },
  41288. setXYZW: function (e, t, i, n, r) {
  41289. return (e *= this.itemSize), (this.array[e + 0] = t), (this.array[e + 1] = i), (this.array[e + 2] = n), (this.array[e + 3] = r), this
  41290. },
  41291. clone: function () {
  41292. return new this.constructor().copy(this)
  41293. }
  41294. }),
  41295. (n.Int8Attribute = function (e, t) {
  41296. return new n.BufferAttribute(new Int8Array(e), t)
  41297. }),
  41298. (n.Uint8Attribute = function (e, t) {
  41299. return new n.BufferAttribute(new Uint8Array(e), t)
  41300. }),
  41301. (n.Uint8ClampedAttribute = function (e, t) {
  41302. return new n.BufferAttribute(new Uint8ClampedArray(e), t)
  41303. }),
  41304. (n.Int16Attribute = function (e, t) {
  41305. return new n.BufferAttribute(new Int16Array(e), t)
  41306. }),
  41307. (n.Uint16Attribute = function (e, t) {
  41308. return new n.BufferAttribute(new Uint16Array(e), t)
  41309. })
  41310. n.Int32Attribute = function (e, t) {
  41311. return new n.BufferAttribute(new Int32Array(e), t)
  41312. }
  41313. ;(n.Uint32Attribute = function (e, t) {
  41314. return new n.BufferAttribute(new Uint32Array(e), t)
  41315. }),
  41316. (n.Float32Attribute = function (e, t) {
  41317. return new n.BufferAttribute(new Float32Array(e), t)
  41318. }),
  41319. (n.Float64Attribute = function (e, t) {
  41320. return new n.BufferAttribute(new Float64Array(e), t)
  41321. }),
  41322. (n.DynamicBufferAttribute = function (e, t) {
  41323. return console.warn('THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead.'), new n.BufferAttribute(e, t).setDynamic(!0)
  41324. }),
  41325. (n.InstancedBufferAttribute = function (e, t, i) {
  41326. n.BufferAttribute.call(this, e, t), (this.meshPerAttribute = i || 1)
  41327. }),
  41328. (n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype)),
  41329. (n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute),
  41330. (n.InstancedBufferAttribute.prototype.copy = function (e) {
  41331. return n.BufferAttribute.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this
  41332. }),
  41333. (n.InterleavedBuffer = function (e, t) {
  41334. ;(this.uuid = n.Math.generateUUID()),
  41335. (this.array = e),
  41336. (this.stride = t),
  41337. (this.dynamic = !1),
  41338. (this.updateRange = {
  41339. offset: 0,
  41340. count: -1
  41341. }),
  41342. (this.version = 0)
  41343. }),
  41344. (n.InterleavedBuffer.prototype = {
  41345. constructor: n.InterleavedBuffer,
  41346. get length() {
  41347. return this.array.length
  41348. },
  41349. get count() {
  41350. return this.array.length / this.stride
  41351. },
  41352. set needsUpdate(e) {
  41353. e === !0 && this.version++
  41354. },
  41355. setDynamic: function (e) {
  41356. return (this.dynamic = e), this
  41357. },
  41358. copy: function (e) {
  41359. return (this.array = new e.array.constructor(e.array)), (this.stride = e.stride), (this.dynamic = e.dynamic), this
  41360. },
  41361. copyAt: function (e, t, i) {
  41362. ;(e *= this.stride), (i *= t.stride)
  41363. for (var n = 0, r = this.stride; n < r; n++) this.array[e + n] = t.array[i + n]
  41364. return this
  41365. },
  41366. set: function (e, t) {
  41367. return void 0 === t && (t = 0), this.array.set(e, t), this
  41368. },
  41369. clone: function () {
  41370. return new this.constructor().copy(this)
  41371. }
  41372. }),
  41373. (n.InstancedInterleavedBuffer = function (e, t, i) {
  41374. n.InterleavedBuffer.call(this, e, t), (this.meshPerAttribute = i || 1)
  41375. }),
  41376. (n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype)),
  41377. (n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer),
  41378. (n.InstancedInterleavedBuffer.prototype.copy = function (e) {
  41379. return n.InterleavedBuffer.prototype.copy.call(this, e), (this.meshPerAttribute = e.meshPerAttribute), this
  41380. }),
  41381. (n.InterleavedBufferAttribute = function (e, t, i) {
  41382. ;(this.uuid = n.Math.generateUUID()), (this.data = e), (this.itemSize = t), (this.offset = i)
  41383. }),
  41384. (n.InterleavedBufferAttribute.prototype = {
  41385. constructor: n.InterleavedBufferAttribute,
  41386. get length() {
  41387. return console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.'), this.array.length
  41388. },
  41389. get count() {
  41390. return this.data.count
  41391. },
  41392. setX: function (e, t) {
  41393. return (this.data.array[e * this.data.stride + this.offset] = t), this
  41394. },
  41395. setY: function (e, t) {
  41396. return (this.data.array[e * this.data.stride + this.offset + 1] = t), this
  41397. },
  41398. setZ: function (e, t) {
  41399. return (this.data.array[e * this.data.stride + this.offset + 2] = t), this
  41400. },
  41401. setW: function (e, t) {
  41402. return (this.data.array[e * this.data.stride + this.offset + 3] = t), this
  41403. },
  41404. getX: function (e) {
  41405. return this.data.array[e * this.data.stride + this.offset]
  41406. },
  41407. getY: function (e) {
  41408. return this.data.array[e * this.data.stride + this.offset + 1]
  41409. },
  41410. getZ: function (e) {
  41411. return this.data.array[e * this.data.stride + this.offset + 2]
  41412. },
  41413. getW: function (e) {
  41414. return this.data.array[e * this.data.stride + this.offset + 3]
  41415. },
  41416. setXY: function (e, t, i) {
  41417. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), this
  41418. },
  41419. setXYZ: function (e, t, i, n) {
  41420. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), (this.data.array[e + 2] = n), this
  41421. },
  41422. setXYZW: function (e, t, i, n, r) {
  41423. return (e = e * this.data.stride + this.offset), (this.data.array[e + 0] = t), (this.data.array[e + 1] = i), (this.data.array[e + 2] = n), (this.data.array[e + 3] = r), this
  41424. }
  41425. }),
  41426. (n.Geometry = function () {
  41427. Object.defineProperty(this, 'id', {
  41428. value: n.GeometryIdCount++
  41429. }),
  41430. (this.uuid = n.Math.generateUUID()),
  41431. (this.name = ''),
  41432. (this.type = 'Geometry'),
  41433. (this.vertices = []),
  41434. (this.colors = []),
  41435. (this.faces = []),
  41436. (this.faceVertexUvs = [[]]),
  41437. (this.morphTargets = []),
  41438. (this.morphNormals = []),
  41439. (this.skinWeights = []),
  41440. (this.skinIndices = []),
  41441. (this.lineDistances = []),
  41442. (this.boundingBox = null),
  41443. (this.boundingSphere = null),
  41444. (this.verticesNeedUpdate = !1),
  41445. (this.elementsNeedUpdate = !1),
  41446. (this.uvsNeedUpdate = !1),
  41447. (this.normalsNeedUpdate = !1),
  41448. (this.colorsNeedUpdate = !1),
  41449. (this.lineDistancesNeedUpdate = !1),
  41450. (this.groupsNeedUpdate = !1)
  41451. }),
  41452. (n.Geometry.prototype = {
  41453. constructor: n.Geometry,
  41454. applyMatrix: function (e) {
  41455. for (var t = new n.Matrix3().getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  41456. var o = this.vertices[i]
  41457. o.applyMatrix4(e)
  41458. }
  41459. for (var i = 0, r = this.faces.length; i < r; i++) {
  41460. var a = this.faces[i]
  41461. a.normal.applyMatrix3(t).normalize()
  41462. for (var s = 0, l = a.vertexNormals.length; s < l; s++) a.vertexNormals[s].applyMatrix3(t).normalize()
  41463. }
  41464. return (
  41465. null !== this.boundingBox && this.computeBoundingBox(),
  41466. null !== this.boundingSphere && this.computeBoundingSphere(),
  41467. (this.verticesNeedUpdate = !0),
  41468. (this.normalsNeedUpdate = !0),
  41469. this
  41470. )
  41471. },
  41472. rotateX: (function () {
  41473. var e
  41474. return function (t) {
  41475. return void 0 === e && (e = new n.Matrix4()), e.makeRotationX(t), this.applyMatrix(e), this
  41476. }
  41477. })(),
  41478. rotateY: (function () {
  41479. var e
  41480. return function (t) {
  41481. return void 0 === e && (e = new n.Matrix4()), e.makeRotationY(t), this.applyMatrix(e), this
  41482. }
  41483. })(),
  41484. rotateZ: (function () {
  41485. var e
  41486. return function (t) {
  41487. return void 0 === e && (e = new n.Matrix4()), e.makeRotationZ(t), this.applyMatrix(e), this
  41488. }
  41489. })(),
  41490. translate: (function () {
  41491. var e
  41492. return function (t, i, r) {
  41493. return void 0 === e && (e = new n.Matrix4()), e.makeTranslation(t, i, r), this.applyMatrix(e), this
  41494. }
  41495. })(),
  41496. scale: (function () {
  41497. var e
  41498. return function (t, i, r) {
  41499. return void 0 === e && (e = new n.Matrix4()), e.makeScale(t, i, r), this.applyMatrix(e), this
  41500. }
  41501. })(),
  41502. lookAt: (function () {
  41503. var e
  41504. return function (t) {
  41505. void 0 === e && (e = new n.Object3D()), e.lookAt(t), e.updateMatrix(), this.applyMatrix(e.matrix)
  41506. }
  41507. })(),
  41508. fromBufferGeometry: function (e) {
  41509. function t(e, t, r, o) {
  41510. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : [],
  41511. f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : [],
  41512. g = new n.Face3(e, t, r, a, f, o)
  41513. i.faces.push(g),
  41514. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  41515. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  41516. }
  41517. var i = this,
  41518. r = null !== e.index ? e.index.array : void 0,
  41519. o = e.attributes,
  41520. a = o.position.array,
  41521. s = void 0 !== o.normal ? o.normal.array : void 0,
  41522. l = void 0 !== o.color ? o.color.array : void 0,
  41523. c = void 0 !== o.uv ? o.uv.array : void 0,
  41524. h = void 0 !== o.uv2 ? o.uv2.array : void 0
  41525. void 0 !== h && (this.faceVertexUvs[1] = [])
  41526. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3, g += 2)
  41527. i.vertices.push(new n.Vector3(a[f], a[f + 1], a[f + 2])),
  41528. void 0 !== s && u.push(new n.Vector3(s[f], s[f + 1], s[f + 2])),
  41529. void 0 !== l && i.colors.push(new n.Color(l[f], l[f + 1], l[f + 2])),
  41530. void 0 !== c && d.push(new n.Vector2(c[g], c[g + 1])),
  41531. void 0 !== h && p.push(new n.Vector2(h[g], h[g + 1]))
  41532. if (void 0 !== r) {
  41533. var m = e.groups
  41534. if (m.length > 0) for (var f = 0; f < m.length; f++) for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3) t(r[g], r[g + 1], r[g + 2], v.materialIndex)
  41535. else for (var f = 0; f < r.length; f += 3) t(r[f], r[f + 1], r[f + 2])
  41536. } else for (var f = 0; f < a.length / 3; f += 3) t(f, f + 1, f + 2)
  41537. return (
  41538. this.computeFaceNormals(), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), this
  41539. )
  41540. },
  41541. center: function () {
  41542. this.computeBoundingBox()
  41543. var e = this.boundingBox.center().negate()
  41544. return this.translate(e.x, e.y, e.z), e
  41545. },
  41546. normalize: function () {
  41547. this.computeBoundingSphere()
  41548. var e = this.boundingSphere.center,
  41549. t = this.boundingSphere.radius,
  41550. i = 0 === t ? 1 : 1 / t,
  41551. r = new n.Matrix4()
  41552. 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), this.applyMatrix(r), this
  41553. },
  41554. computeFaceNormals: function () {
  41555. for (var e = new n.Vector3(), t = new n.Vector3(), i = 0, r = this.faces.length; i < r; i++) {
  41556. var o = this.faces[i],
  41557. a = this.vertices[o.a],
  41558. s = this.vertices[o.b],
  41559. l = this.vertices[o.c]
  41560. e.subVectors(l, s), t.subVectors(a, s), e.cross(t), e.normalize(), o.normal.copy(e)
  41561. }
  41562. },
  41563. computeVertexNormals: function (e) {
  41564. void 0 === e && (e = !0)
  41565. var t, i, r, o, a, s
  41566. for (s = new Array(this.vertices.length), t = 0, i = this.vertices.length; t < i; t++) s[t] = new n.Vector3()
  41567. if (e) {
  41568. var l,
  41569. c,
  41570. h,
  41571. u = new n.Vector3(),
  41572. d = new n.Vector3()
  41573. for (r = 0, o = this.faces.length; r < o; r++)
  41574. (a = this.faces[r]),
  41575. (l = this.vertices[a.a]),
  41576. (c = this.vertices[a.b]),
  41577. (h = this.vertices[a.c]),
  41578. u.subVectors(h, c),
  41579. d.subVectors(l, c),
  41580. u.cross(d),
  41581. s[a.a].add(u),
  41582. s[a.b].add(u),
  41583. s[a.c].add(u)
  41584. } else for (r = 0, o = this.faces.length; r < o; r++) (a = this.faces[r]), s[a.a].add(a.normal), s[a.b].add(a.normal), s[a.c].add(a.normal)
  41585. for (t = 0, i = this.vertices.length; t < i; t++) s[t].normalize()
  41586. for (r = 0, o = this.faces.length; r < o; r++) {
  41587. a = this.faces[r]
  41588. var p = a.vertexNormals
  41589. 3 === p.length ? (p[0].copy(s[a.a]), p[1].copy(s[a.b]), p[2].copy(s[a.c])) : ((p[0] = s[a.a].clone()), (p[1] = s[a.b].clone()), (p[2] = s[a.c].clone()))
  41590. }
  41591. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  41592. },
  41593. computeMorphNormals: function () {
  41594. var e, t, i, r, o
  41595. for (i = 0, r = this.faces.length; i < r; i++)
  41596. for (
  41597. o = this.faces[i],
  41598. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : (o.__originalFaceNormal = o.normal.clone()),
  41599. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  41600. e = 0,
  41601. t = o.vertexNormals.length;
  41602. e < t;
  41603. e++
  41604. )
  41605. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : (o.__originalVertexNormals[e] = o.vertexNormals[e].clone())
  41606. var a = new n.Geometry()
  41607. for (a.faces = this.faces, e = 0, t = this.morphTargets.length; e < t; e++) {
  41608. if (!this.morphNormals[e]) {
  41609. ;(this.morphNormals[e] = {}), (this.morphNormals[e].faceNormals = []), (this.morphNormals[e].vertexNormals = [])
  41610. var s,
  41611. l,
  41612. c = this.morphNormals[e].faceNormals,
  41613. h = this.morphNormals[e].vertexNormals
  41614. for (i = 0, r = this.faces.length; i < r; i++)
  41615. (s = new n.Vector3()),
  41616. (l = {
  41617. a: new n.Vector3(),
  41618. b: new n.Vector3(),
  41619. c: new n.Vector3()
  41620. }),
  41621. c.push(s),
  41622. h.push(l)
  41623. }
  41624. var u = this.morphNormals[e]
  41625. ;(a.vertices = this.morphTargets[e].vertices), a.computeFaceNormals(), a.computeVertexNormals()
  41626. var s, l
  41627. for (i = 0, r = this.faces.length; i < r; i++)
  41628. (o = this.faces[i]), (s = u.faceNormals[i]), (l = u.vertexNormals[i]), s.copy(o.normal), l.a.copy(o.vertexNormals[0]), l.b.copy(o.vertexNormals[1]), l.c.copy(o.vertexNormals[2])
  41629. }
  41630. for (i = 0, r = this.faces.length; i < r; i++) (o = this.faces[i]), (o.normal = o.__originalFaceNormal), (o.vertexNormals = o.__originalVertexNormals)
  41631. },
  41632. computeTangents: function () {
  41633. console.warn('THREE.Geometry: .computeTangents() has been removed.')
  41634. },
  41635. computeLineDistances: function () {
  41636. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++) i > 0 && (e += t[i].distanceTo(t[i - 1])), (this.lineDistances[i] = e)
  41637. },
  41638. computeBoundingBox: function () {
  41639. null === this.boundingBox && (this.boundingBox = new n.Box3()), this.boundingBox.setFromPoints(this.vertices)
  41640. },
  41641. computeBoundingSphere: function () {
  41642. null === this.boundingSphere && (this.boundingSphere = new n.Sphere()), this.boundingSphere.setFromPoints(this.vertices)
  41643. },
  41644. merge: function (e, t, i) {
  41645. if (e instanceof n.Geometry == !1) return void console.error('THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.', e)
  41646. var r,
  41647. o = this.vertices.length,
  41648. a = this.vertices,
  41649. s = e.vertices,
  41650. l = this.faces,
  41651. c = e.faces,
  41652. h = this.faceVertexUvs[0],
  41653. u = e.faceVertexUvs[0]
  41654. void 0 === i && (i = 0), void 0 !== t && (r = new n.Matrix3().getNormalMatrix(t))
  41655. for (var d = 0, p = s.length; d < p; d++) {
  41656. var f = s[d],
  41657. g = f.clone()
  41658. void 0 !== t && g.applyMatrix4(t), a.push(g)
  41659. }
  41660. for (d = 0, p = c.length; d < p; d++) {
  41661. var m,
  41662. v,
  41663. A,
  41664. y = c[d],
  41665. C = y.vertexNormals,
  41666. I = y.vertexColors
  41667. ;(m = new n.Face3(y.a + o, y.b + o, y.c + o)), m.normal.copy(y.normal), void 0 !== r && m.normal.applyMatrix3(r).normalize()
  41668. for (var E = 0, b = C.length; E < b; E++) (v = C[E].clone()), void 0 !== r && v.applyMatrix3(r).normalize(), m.vertexNormals.push(v)
  41669. m.color.copy(y.color)
  41670. for (var E = 0, b = I.length; E < b; E++) (A = I[E]), m.vertexColors.push(A.clone())
  41671. ;(m.materialIndex = y.materialIndex + i), l.push(m)
  41672. }
  41673. for (d = 0, p = u.length; d < p; d++) {
  41674. var w = u[d],
  41675. _ = []
  41676. if (void 0 !== w) {
  41677. for (var E = 0, b = w.length; E < b; E++) _.push(w[E].clone())
  41678. h.push(_)
  41679. }
  41680. }
  41681. },
  41682. mergeMesh: function (e) {
  41683. return e instanceof n.Mesh == !1
  41684. ? void console.error('THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.', e)
  41685. : (e.matrixAutoUpdate && e.updateMatrix(), void this.merge(e.geometry, e.matrix))
  41686. },
  41687. mergeVertices: function () {
  41688. var e,
  41689. t,
  41690. i,
  41691. n,
  41692. r,
  41693. o,
  41694. a,
  41695. s,
  41696. l = {},
  41697. c = [],
  41698. h = [],
  41699. u = 4,
  41700. d = Math.pow(10, u)
  41701. for (i = 0, n = this.vertices.length; i < n; i++)
  41702. (e = this.vertices[i]),
  41703. (t = Math.round(e.x * d) + '_' + Math.round(e.y * d) + '_' + Math.round(e.z * d)),
  41704. void 0 === l[t] ? ((l[t] = i), c.push(this.vertices[i]), (h[i] = c.length - 1)) : (h[i] = h[l[t]])
  41705. var p = []
  41706. for (i = 0, n = this.faces.length; i < n; i++) {
  41707. ;(r = this.faces[i]), (r.a = h[r.a]), (r.b = h[r.b]), (r.c = h[r.c]), (o = [r.a, r.b, r.c])
  41708. for (var f = -1, g = 0; g < 3; g++)
  41709. if (o[g] === o[(g + 1) % 3]) {
  41710. ;(f = g), p.push(i)
  41711. break
  41712. }
  41713. }
  41714. for (i = p.length - 1; i >= 0; i--) {
  41715. var m = p[i]
  41716. for (this.faces.splice(m, 1), a = 0, s = this.faceVertexUvs.length; a < s; a++) this.faceVertexUvs[a].splice(m, 1)
  41717. }
  41718. var v = this.vertices.length - c.length
  41719. return (this.vertices = c), v
  41720. },
  41721. sortFacesByMaterialIndex: function () {
  41722. function e(e, t) {
  41723. return e.materialIndex - t.materialIndex
  41724. }
  41725. for (var t = this.faces, i = t.length, n = 0; n < i; n++) t[n]._id = n
  41726. t.sort(e)
  41727. var r,
  41728. o,
  41729. a = this.faceVertexUvs[0],
  41730. s = this.faceVertexUvs[1]
  41731. a && a.length === i && (r = []), s && s.length === i && (o = [])
  41732. for (var n = 0; n < i; n++) {
  41733. var l = t[n]._id
  41734. r && r.push(a[l]), o && o.push(s[l])
  41735. }
  41736. r && (this.faceVertexUvs[0] = r), o && (this.faceVertexUvs[1] = o)
  41737. },
  41738. toJSON: function () {
  41739. function e(e, t, i) {
  41740. return i ? e | (1 << t) : e & ~(1 << t)
  41741. }
  41742. function t(e) {
  41743. var t = e.x.toString() + e.y.toString() + e.z.toString()
  41744. return void 0 !== d[t] ? d[t] : ((d[t] = u.length / 3), u.push(e.x, e.y, e.z), d[t])
  41745. }
  41746. function i(e) {
  41747. var t = e.r.toString() + e.g.toString() + e.b.toString()
  41748. return void 0 !== f[t] ? f[t] : ((f[t] = p.length), p.push(e.getHex()), f[t])
  41749. }
  41750. function n(e) {
  41751. var t = e.x.toString() + e.y.toString()
  41752. return void 0 !== m[t] ? m[t] : ((m[t] = g.length / 2), g.push(e.x, e.y), m[t])
  41753. }
  41754. var r = {
  41755. metadata: {
  41756. version: 4.4,
  41757. type: 'Geometry',
  41758. generator: 'Geometry.toJSON'
  41759. }
  41760. }
  41761. if (((r.uuid = this.uuid), (r.type = this.type), '' !== this.name && (r.name = this.name), void 0 !== this.parameters)) {
  41762. var o = this.parameters
  41763. for (var a in o) void 0 !== o[a] && (r[a] = o[a])
  41764. return r
  41765. }
  41766. for (var s = [], l = 0; l < this.vertices.length; l++) {
  41767. var c = this.vertices[l]
  41768. s.push(c.x, c.y, c.z)
  41769. }
  41770. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  41771. var v = this.faces[l],
  41772. A = !0,
  41773. y = !1,
  41774. C = void 0 !== this.faceVertexUvs[0][l],
  41775. I = v.normal.length() > 0,
  41776. E = v.vertexNormals.length > 0,
  41777. b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b,
  41778. w = v.vertexColors.length > 0,
  41779. _ = 0
  41780. if (
  41781. ((_ = e(_, 0, 0)),
  41782. (_ = e(_, 1, A)),
  41783. (_ = e(_, 2, y)),
  41784. (_ = e(_, 3, C)),
  41785. (_ = e(_, 4, I)),
  41786. (_ = e(_, 5, E)),
  41787. (_ = e(_, 6, b)),
  41788. (_ = e(_, 7, w)),
  41789. h.push(_),
  41790. h.push(v.a, v.b, v.c),
  41791. h.push(v.materialIndex),
  41792. C)
  41793. ) {
  41794. var T = this.faceVertexUvs[0][l]
  41795. h.push(n(T[0]), n(T[1]), n(T[2]))
  41796. }
  41797. if ((I && h.push(t(v.normal)), E)) {
  41798. var x = v.vertexNormals
  41799. h.push(t(x[0]), t(x[1]), t(x[2]))
  41800. }
  41801. if ((b && h.push(i(v.color)), w)) {
  41802. var S = v.vertexColors
  41803. h.push(i(S[0]), i(S[1]), i(S[2]))
  41804. }
  41805. }
  41806. return (r.data = {}), (r.data.vertices = s), (r.data.normals = u), p.length > 0 && (r.data.colors = p), g.length > 0 && (r.data.uvs = [g]), (r.data.faces = h), r
  41807. },
  41808. clone: function () {
  41809. return new n.Geometry().copy(this)
  41810. },
  41811. copy: function (e) {
  41812. ;(this.vertices = []), (this.faces = []), (this.faceVertexUvs = [[]])
  41813. for (var t = e.vertices, i = 0, n = t.length; i < n; i++) this.vertices.push(t[i].clone())
  41814. for (var r = e.faces, i = 0, n = r.length; i < n; i++) this.faces.push(r[i].clone())
  41815. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  41816. var o = e.faceVertexUvs[i]
  41817. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = [])
  41818. for (var a = 0, s = o.length; a < s; a++) {
  41819. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  41820. var d = l[h]
  41821. c.push(d.clone())
  41822. }
  41823. this.faceVertexUvs[i].push(c)
  41824. }
  41825. }
  41826. return this
  41827. },
  41828. dispose: function () {
  41829. this.dispatchEvent({
  41830. type: 'dispose'
  41831. })
  41832. }
  41833. }),
  41834. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  41835. (n.GeometryIdCount = 0),
  41836. (n.DirectGeometry = function () {
  41837. Object.defineProperty(this, 'id', {
  41838. value: n.GeometryIdCount++
  41839. }),
  41840. (this.uuid = n.Math.generateUUID()),
  41841. (this.name = ''),
  41842. (this.type = 'DirectGeometry'),
  41843. (this.indices = []),
  41844. (this.vertices = []),
  41845. (this.normals = []),
  41846. (this.colors = []),
  41847. (this.uvs = []),
  41848. (this.uvs2 = []),
  41849. (this.groups = []),
  41850. (this.morphTargets = {}),
  41851. (this.skinWeights = []),
  41852. (this.skinIndices = []),
  41853. (this.boundingBox = null),
  41854. (this.boundingSphere = null),
  41855. (this.verticesNeedUpdate = !1),
  41856. (this.normalsNeedUpdate = !1),
  41857. (this.colorsNeedUpdate = !1),
  41858. (this.uvsNeedUpdate = !1),
  41859. (this.groupsNeedUpdate = !1)
  41860. }),
  41861. (n.DirectGeometry.prototype = {
  41862. constructor: n.DirectGeometry,
  41863. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  41864. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  41865. computeFaceNormals: function () {
  41866. console.warn('THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.')
  41867. },
  41868. computeVertexNormals: function () {
  41869. console.warn('THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.')
  41870. },
  41871. computeGroups: function (e) {
  41872. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  41873. var a = r[o]
  41874. a.materialIndex !== i &&
  41875. ((i = a.materialIndex),
  41876. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)),
  41877. (t = {
  41878. start: 3 * o,
  41879. materialIndex: i
  41880. }))
  41881. }
  41882. void 0 !== t && ((t.count = 3 * o - t.start), n.push(t)), (this.groups = n)
  41883. },
  41884. fromGeometry: function (e) {
  41885. var t,
  41886. i = e.faces,
  41887. r = e.vertices,
  41888. o = e.faceVertexUvs,
  41889. a = o[0] && o[0].length > 0,
  41890. s = o[1] && o[1].length > 0,
  41891. l = e.morphTargets,
  41892. c = l.length
  41893. if (c > 0) {
  41894. t = []
  41895. for (var h = 0; h < c; h++) t[h] = []
  41896. this.morphTargets.position = t
  41897. }
  41898. var u,
  41899. d = e.morphNormals,
  41900. p = d.length
  41901. if (p > 0) {
  41902. u = []
  41903. for (var h = 0; h < p; h++) u[h] = []
  41904. this.morphTargets.normal = u
  41905. }
  41906. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  41907. var A = i[h]
  41908. this.vertices.push(r[A.a], r[A.b], r[A.c])
  41909. var y = A.vertexNormals
  41910. if (3 === y.length) this.normals.push(y[0], y[1], y[2])
  41911. else {
  41912. var C = A.normal
  41913. this.normals.push(C, C, C)
  41914. }
  41915. var I = A.vertexColors
  41916. if (3 === I.length) this.colors.push(I[0], I[1], I[2])
  41917. else {
  41918. var E = A.color
  41919. this.colors.push(E, E, E)
  41920. }
  41921. if (a === !0) {
  41922. var b = o[0][h]
  41923. void 0 !== b
  41924. ? this.uvs.push(b[0], b[1], b[2])
  41925. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ', h), this.uvs.push(new n.Vector2(), new n.Vector2(), new n.Vector2()))
  41926. }
  41927. if (s === !0) {
  41928. var b = o[1][h]
  41929. void 0 !== b
  41930. ? this.uvs2.push(b[0], b[1], b[2])
  41931. : (console.warn('THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ', h), this.uvs2.push(new n.Vector2(), new n.Vector2(), new n.Vector2()))
  41932. }
  41933. for (var w = 0; w < c; w++) {
  41934. var _ = l[w].vertices
  41935. t[w].push(_[A.a], _[A.b], _[A.c])
  41936. }
  41937. for (var w = 0; w < p; w++) {
  41938. var T = d[w].vertexNormals[h]
  41939. u[w].push(T.a, T.b, T.c)
  41940. }
  41941. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]), v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  41942. }
  41943. return (
  41944. this.computeGroups(e),
  41945. (this.verticesNeedUpdate = e.verticesNeedUpdate),
  41946. (this.normalsNeedUpdate = e.normalsNeedUpdate),
  41947. (this.colorsNeedUpdate = e.colorsNeedUpdate),
  41948. (this.uvsNeedUpdate = e.uvsNeedUpdate),
  41949. (this.groupsNeedUpdate = e.groupsNeedUpdate),
  41950. this
  41951. )
  41952. },
  41953. dispose: function () {
  41954. this.dispatchEvent({
  41955. type: 'dispose'
  41956. })
  41957. }
  41958. }),
  41959. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  41960. (n.BufferGeometry = function () {
  41961. Object.defineProperty(this, 'id', {
  41962. value: n.GeometryIdCount++
  41963. }),
  41964. (this.uuid = n.Math.generateUUID()),
  41965. (this.name = ''),
  41966. (this.type = 'BufferGeometry'),
  41967. (this.index = null),
  41968. (this.attributes = {}),
  41969. (this.morphAttributes = {}),
  41970. (this.groups = []),
  41971. (this.boundingBox = null),
  41972. (this.boundingSphere = null),
  41973. (this.drawRange = {
  41974. start: 0,
  41975. count: 1 / 0
  41976. })
  41977. }),
  41978. (n.BufferGeometry.prototype = {
  41979. constructor: n.BufferGeometry,
  41980. getIndex: function () {
  41981. return this.index
  41982. },
  41983. setIndex: function (e) {
  41984. this.index = e
  41985. },
  41986. addAttribute: function (e, t) {
  41987. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1
  41988. ? (console.warn('THREE.BufferGeometry: .addAttribute() now expects ( name, attribute ).'), void this.addAttribute(e, new n.BufferAttribute(arguments[1], arguments[2])))
  41989. : 'index' === e
  41990. ? (console.warn('THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute.'), void this.setIndex(t))
  41991. : ((this.attributes[e] = t), this)
  41992. },
  41993. getAttribute: function (e) {
  41994. return this.attributes[e]
  41995. },
  41996. removeAttribute: function (e) {
  41997. return delete this.attributes[e], this
  41998. },
  41999. addGroup: function (e, t, i) {
  42000. this.groups.push({
  42001. start: e,
  42002. count: t,
  42003. materialIndex: void 0 !== i ? i : 0
  42004. })
  42005. },
  42006. clearGroups: function () {
  42007. this.groups = []
  42008. },
  42009. setDrawRange: function (e, t) {
  42010. ;(this.drawRange.start = e), (this.drawRange.count = t)
  42011. },
  42012. applyMatrix: function (e) {
  42013. var t = this.attributes.position
  42014. void 0 !== t && (e.applyToVector3Array(t.array), (t.needsUpdate = !0))
  42015. var i = this.attributes.normal
  42016. if (void 0 !== i) {
  42017. var r = new n.Matrix3().getNormalMatrix(e)
  42018. r.applyToVector3Array(i.array), (i.needsUpdate = !0)
  42019. }
  42020. return null !== this.boundingBox && this.computeBoundingBox(), null !== this.boundingSphere && this.computeBoundingSphere(), this
  42021. },
  42022. rotateX: (function () {
  42023. var e
  42024. return function (t) {
  42025. return void 0 === e && (e = new n.Matrix4()), e.makeRotationX(t), this.applyMatrix(e), this
  42026. }
  42027. })(),
  42028. rotateY: (function () {
  42029. var e
  42030. return function (t) {
  42031. return void 0 === e && (e = new n.Matrix4()), e.makeRotationY(t), this.applyMatrix(e), this
  42032. }
  42033. })(),
  42034. rotateZ: (function () {
  42035. var e
  42036. return function (t) {
  42037. return void 0 === e && (e = new n.Matrix4()), e.makeRotationZ(t), this.applyMatrix(e), this
  42038. }
  42039. })(),
  42040. translate: (function () {
  42041. var e
  42042. return function (t, i, r) {
  42043. return void 0 === e && (e = new n.Matrix4()), e.makeTranslation(t, i, r), this.applyMatrix(e), this
  42044. }
  42045. })(),
  42046. scale: (function () {
  42047. var e
  42048. return function (t, i, r) {
  42049. return void 0 === e && (e = new n.Matrix4()), e.makeScale(t, i, r), this.applyMatrix(e), this
  42050. }
  42051. })(),
  42052. lookAt: (function () {
  42053. var e
  42054. return function (t) {
  42055. void 0 === e && (e = new n.Object3D()), e.lookAt(t), e.updateMatrix(), this.applyMatrix(e.matrix)
  42056. }
  42057. })(),
  42058. center: function () {
  42059. this.computeBoundingBox()
  42060. var e = this.boundingBox.center().negate()
  42061. return this.translate(e.x, e.y, e.z), e
  42062. },
  42063. setFromObject: function (e) {
  42064. var t = e.geometry
  42065. if (e instanceof n.Points || e instanceof n.Line) {
  42066. var i = new n.Float32Attribute(3 * t.vertices.length, 3),
  42067. r = new n.Float32Attribute(3 * t.colors.length, 3)
  42068. if (
  42069. (this.addAttribute('position', i.copyVector3sArray(t.vertices)),
  42070. this.addAttribute('color', r.copyColorsArray(t.colors)),
  42071. t.lineDistances && t.lineDistances.length === t.vertices.length)
  42072. ) {
  42073. var o = new n.Float32Attribute(t.lineDistances.length, 1)
  42074. this.addAttribute('lineDistance', o.copyArray(t.lineDistances))
  42075. }
  42076. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()), null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42077. } else e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t)
  42078. return this
  42079. },
  42080. updateFromObject: function (e) {
  42081. var t = e.geometry
  42082. if (e instanceof n.Mesh) {
  42083. var i = t.__directGeometry
  42084. if (void 0 === i) return this.fromGeometry(t)
  42085. ;(i.verticesNeedUpdate = t.verticesNeedUpdate),
  42086. (i.normalsNeedUpdate = t.normalsNeedUpdate),
  42087. (i.colorsNeedUpdate = t.colorsNeedUpdate),
  42088. (i.uvsNeedUpdate = t.uvsNeedUpdate),
  42089. (i.groupsNeedUpdate = t.groupsNeedUpdate),
  42090. (t.verticesNeedUpdate = !1),
  42091. (t.normalsNeedUpdate = !1),
  42092. (t.colorsNeedUpdate = !1),
  42093. (t.uvsNeedUpdate = !1),
  42094. (t.groupsNeedUpdate = !1),
  42095. (t = i)
  42096. }
  42097. if (t.verticesNeedUpdate === !0) {
  42098. var r = this.attributes.position
  42099. void 0 !== r && (r.copyVector3sArray(t.vertices), (r.needsUpdate = !0)), (t.verticesNeedUpdate = !1)
  42100. }
  42101. if (t.normalsNeedUpdate === !0) {
  42102. var r = this.attributes.normal
  42103. void 0 !== r && (r.copyVector3sArray(t.normals), (r.needsUpdate = !0)), (t.normalsNeedUpdate = !1)
  42104. }
  42105. if (t.colorsNeedUpdate === !0) {
  42106. var r = this.attributes.color
  42107. void 0 !== r && (r.copyColorsArray(t.colors), (r.needsUpdate = !0)), (t.colorsNeedUpdate = !1)
  42108. }
  42109. if (t.uvsNeedUpdate) {
  42110. var r = this.attributes.uv
  42111. void 0 !== r && (r.copyVector2sArray(t.uvs), (r.needsUpdate = !0)), (t.uvsNeedUpdate = !1)
  42112. }
  42113. if (t.lineDistancesNeedUpdate) {
  42114. var r = this.attributes.lineDistance
  42115. void 0 !== r && (r.copyArray(t.lineDistances), (r.needsUpdate = !0)), (t.lineDistancesNeedUpdate = !1)
  42116. }
  42117. return t.groupsNeedUpdate && (t.computeGroups(e.geometry), (this.groups = t.groups), (t.groupsNeedUpdate = !1)), this
  42118. },
  42119. fromGeometry: function (e) {
  42120. return (e.__directGeometry = new n.DirectGeometry().fromGeometry(e)), this.fromDirectGeometry(e.__directGeometry)
  42121. },
  42122. fromDirectGeometry: function (e) {
  42123. var t = new Float32Array(3 * e.vertices.length)
  42124. if ((this.addAttribute('position', new n.BufferAttribute(t, 3).copyVector3sArray(e.vertices)), e.normals.length > 0)) {
  42125. var i = new Float32Array(3 * e.normals.length)
  42126. this.addAttribute('normal', new n.BufferAttribute(i, 3).copyVector3sArray(e.normals))
  42127. }
  42128. if (e.colors.length > 0) {
  42129. var r = new Float32Array(3 * e.colors.length)
  42130. this.addAttribute('color', new n.BufferAttribute(r, 3).copyColorsArray(e.colors))
  42131. }
  42132. if (e.uvs.length > 0) {
  42133. var o = new Float32Array(2 * e.uvs.length)
  42134. this.addAttribute('uv', new n.BufferAttribute(o, 2).copyVector2sArray(e.uvs))
  42135. }
  42136. if (e.uvs2.length > 0) {
  42137. var a = new Float32Array(2 * e.uvs2.length)
  42138. this.addAttribute('uv2', new n.BufferAttribute(a, 2).copyVector2sArray(e.uvs2))
  42139. }
  42140. if (e.indices.length > 0) {
  42141. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array,
  42142. l = new s(3 * e.indices.length)
  42143. this.setIndex(new n.BufferAttribute(l, 1).copyIndicesArray(e.indices))
  42144. }
  42145. this.groups = e.groups
  42146. for (var c in e.morphTargets) {
  42147. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  42148. var f = u[d],
  42149. g = new n.Float32Attribute(3 * f.length, 3)
  42150. h.push(g.copyVector3sArray(f))
  42151. }
  42152. this.morphAttributes[c] = h
  42153. }
  42154. if (e.skinIndices.length > 0) {
  42155. var m = new n.Float32Attribute(4 * e.skinIndices.length, 4)
  42156. this.addAttribute('skinIndex', m.copyVector4sArray(e.skinIndices))
  42157. }
  42158. if (e.skinWeights.length > 0) {
  42159. var v = new n.Float32Attribute(4 * e.skinWeights.length, 4)
  42160. this.addAttribute('skinWeight', v.copyVector4sArray(e.skinWeights))
  42161. }
  42162. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()), null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()), this
  42163. },
  42164. computeBoundingBox: (function () {
  42165. new n.Vector3()
  42166. return function () {
  42167. null === this.boundingBox && (this.boundingBox = new n.Box3())
  42168. var e = this.attributes.position.array
  42169. e && this.boundingBox.setFromArray(e),
  42170. (void 0 !== e && 0 !== e.length) || (this.boundingBox.min.set(0, 0, 0), this.boundingBox.max.set(0, 0, 0)),
  42171. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) &&
  42172. console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  42173. }
  42174. })(),
  42175. computeBoundingSphere: (function () {
  42176. var e = new n.Box3(),
  42177. t = new n.Vector3()
  42178. return function () {
  42179. null === this.boundingSphere && (this.boundingSphere = new n.Sphere())
  42180. var i = this.attributes.position.array
  42181. if (i) {
  42182. var r = this.boundingSphere.center
  42183. e.setFromArray(i), e.center(r)
  42184. for (var o = 0, a = 0, s = i.length; a < s; a += 3) t.fromArray(i, a), (o = Math.max(o, r.distanceToSquared(t)))
  42185. ;(this.boundingSphere.radius = Math.sqrt(o)),
  42186. isNaN(this.boundingSphere.radius) &&
  42187. console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42188. }
  42189. }
  42190. })(),
  42191. computeFaceNormals: function () {},
  42192. computeVertexNormals: function () {
  42193. var e = this.index,
  42194. t = this.attributes,
  42195. i = this.groups
  42196. if (t.position) {
  42197. var r = t.position.array
  42198. if (void 0 === t.normal) this.addAttribute('normal', new n.BufferAttribute(new Float32Array(r.length), 3))
  42199. else for (var o = t.normal.array, a = 0, s = o.length; a < s; a++) o[a] = 0
  42200. var l,
  42201. c,
  42202. h,
  42203. u = t.normal.array,
  42204. d = new n.Vector3(),
  42205. p = new n.Vector3(),
  42206. f = new n.Vector3(),
  42207. g = new n.Vector3(),
  42208. m = new n.Vector3()
  42209. if (e) {
  42210. var v = e.array
  42211. 0 === i.length && this.addGroup(0, v.length)
  42212. for (var A = 0, y = i.length; A < y; ++A)
  42213. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  42214. (l = 3 * v[a + 0]),
  42215. (c = 3 * v[a + 1]),
  42216. (h = 3 * v[a + 2]),
  42217. d.fromArray(r, l),
  42218. p.fromArray(r, c),
  42219. f.fromArray(r, h),
  42220. g.subVectors(f, p),
  42221. m.subVectors(d, p),
  42222. g.cross(m),
  42223. (u[l] += g.x),
  42224. (u[l + 1] += g.y),
  42225. (u[l + 2] += g.z),
  42226. (u[c] += g.x),
  42227. (u[c + 1] += g.y),
  42228. (u[c + 2] += g.z),
  42229. (u[h] += g.x),
  42230. (u[h + 1] += g.y),
  42231. (u[h + 2] += g.z)
  42232. } else
  42233. for (var a = 0, s = r.length; a < s; a += 9)
  42234. d.fromArray(r, a),
  42235. p.fromArray(r, a + 3),
  42236. f.fromArray(r, a + 6),
  42237. g.subVectors(f, p),
  42238. m.subVectors(d, p),
  42239. g.cross(m),
  42240. (u[a] = g.x),
  42241. (u[a + 1] = g.y),
  42242. (u[a + 2] = g.z),
  42243. (u[a + 3] = g.x),
  42244. (u[a + 4] = g.y),
  42245. (u[a + 5] = g.z),
  42246. (u[a + 6] = g.x),
  42247. (u[a + 7] = g.y),
  42248. (u[a + 8] = g.z)
  42249. this.normalizeNormals(), (t.normal.needsUpdate = !0)
  42250. }
  42251. },
  42252. merge: function (e, t) {
  42253. if (e instanceof n.BufferGeometry == !1) return void console.error('THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.', e)
  42254. void 0 === t && (t = 0)
  42255. var i = this.attributes
  42256. for (var r in i) if (void 0 !== e.attributes[r]) 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++, u++) a[u] = l[h]
  42257. return this
  42258. },
  42259. normalizeNormals: function () {
  42260. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42261. (e = r[o]), (t = r[o + 1]), (i = r[o + 2]), (n = 1 / Math.sqrt(e * e + t * t + i * i)), (r[o] *= n), (r[o + 1] *= n), (r[o + 2] *= n)
  42262. },
  42263. toNonIndexed: function () {
  42264. if (null === this.index) return console.warn('THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed.'), this
  42265. var e = new n.BufferGeometry(),
  42266. t = this.index.array,
  42267. i = this.attributes
  42268. for (var r in i) {
  42269. 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++) {
  42270. c = t[u] * s
  42271. for (var p = 0; p < s; p++) l[h++] = a[c++]
  42272. }
  42273. e.addAttribute(r, new n.BufferAttribute(l, s))
  42274. }
  42275. return e
  42276. },
  42277. toJSON: function () {
  42278. var e = {
  42279. metadata: {
  42280. version: 4.4,
  42281. type: 'BufferGeometry',
  42282. generator: 'BufferGeometry.toJSON'
  42283. }
  42284. }
  42285. if (((e.uuid = this.uuid), (e.type = this.type), '' !== this.name && (e.name = this.name), void 0 !== this.parameters)) {
  42286. var t = this.parameters
  42287. for (var i in t) void 0 !== t[i] && (e[i] = t[i])
  42288. return e
  42289. }
  42290. e.data = {
  42291. attributes: {}
  42292. }
  42293. var n = this.index
  42294. if (null !== n) {
  42295. var r = Array.prototype.slice.call(n.array)
  42296. e.data.index = {
  42297. type: n.array.constructor.name,
  42298. array: r
  42299. }
  42300. }
  42301. var o = this.attributes
  42302. for (var i in o) {
  42303. var a = o[i],
  42304. r = Array.prototype.slice.call(a.array)
  42305. e.data.attributes[i] = {
  42306. itemSize: a.itemSize,
  42307. type: a.array.constructor.name,
  42308. array: r
  42309. }
  42310. }
  42311. var s = this.groups
  42312. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)))
  42313. var l = this.boundingSphere
  42314. return (
  42315. null !== l &&
  42316. (e.data.boundingSphere = {
  42317. center: l.center.toArray(),
  42318. radius: l.radius
  42319. }),
  42320. e
  42321. )
  42322. },
  42323. clone: function () {
  42324. return new n.BufferGeometry().copy(this)
  42325. },
  42326. copy: function (e) {
  42327. var t = e.index
  42328. null !== t && this.setIndex(t.clone())
  42329. var i = e.attributes
  42330. for (var n in i) {
  42331. var r = i[n]
  42332. this.addAttribute(n, r.clone())
  42333. }
  42334. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42335. var l = o[a]
  42336. this.addGroup(l.start, l.count)
  42337. }
  42338. return this
  42339. },
  42340. dispose: function () {
  42341. this.dispatchEvent({
  42342. type: 'dispose'
  42343. })
  42344. }
  42345. }),
  42346. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  42347. (n.BufferGeometry.MaxIndex = 65535),
  42348. (n.InstancedBufferGeometry = function () {
  42349. n.BufferGeometry.call(this), (this.type = 'InstancedBufferGeometry'), (this.maxInstancedCount = void 0)
  42350. }),
  42351. (n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  42352. (n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry),
  42353. (n.InstancedBufferGeometry.prototype.addGroup = function (e, t, i) {
  42354. this.groups.push({
  42355. start: e,
  42356. count: t,
  42357. instances: i
  42358. })
  42359. }),
  42360. (n.InstancedBufferGeometry.prototype.copy = function (e) {
  42361. var t = e.index
  42362. null !== t && this.setIndex(t.clone())
  42363. var i = e.attributes
  42364. for (var n in i) {
  42365. var r = i[n]
  42366. this.addAttribute(n, r.clone())
  42367. }
  42368. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42369. var l = o[a]
  42370. this.addGroup(l.start, l.count, l.instances)
  42371. }
  42372. return this
  42373. }),
  42374. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  42375. (n.Uniform = function (e, t) {
  42376. ;(this.type = e), (this.value = t), (this.dynamic = !1)
  42377. }),
  42378. (n.Uniform.prototype = {
  42379. constructor: n.Uniform,
  42380. onUpdate: function (e) {
  42381. return (this.dynamic = !0), (this.onUpdateCallback = e), this
  42382. }
  42383. }),
  42384. (n.AnimationClip = function (e, t, i) {
  42385. ;(this.name = e || n.Math.generateUUID()), (this.tracks = i), (this.duration = void 0 !== t ? t : -1), this.duration < 0 && this.resetDuration(), this.trim(), this.optimize()
  42386. }),
  42387. (n.AnimationClip.prototype = {
  42388. constructor: n.AnimationClip,
  42389. resetDuration: function () {
  42390. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  42391. var r = this.tracks[i]
  42392. t = Math.max(t, r.times[r.times.length - 1])
  42393. }
  42394. this.duration = t
  42395. },
  42396. trim: function () {
  42397. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].trim(0, this.duration)
  42398. return this
  42399. },
  42400. optimize: function () {
  42401. for (var e = 0; e < this.tracks.length; e++) this.tracks[e].optimize()
  42402. return this
  42403. }
  42404. }),
  42405. Object.assign(n.AnimationClip, {
  42406. parse: function (e) {
  42407. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o) t.push(n.KeyframeTrack.parse(i[o]).scale(r))
  42408. return new n.AnimationClip(e.name, e.duration, t)
  42409. },
  42410. toJSON: function (e) {
  42411. for (
  42412. var t = [],
  42413. i = e.tracks,
  42414. r = {
  42415. name: e.name,
  42416. duration: e.duration,
  42417. tracks: t
  42418. },
  42419. o = 0,
  42420. a = i.length;
  42421. o !== a;
  42422. ++o
  42423. )
  42424. t.push(n.KeyframeTrack.toJSON(i[o]))
  42425. return r
  42426. },
  42427. CreateFromMorphTargetSequence: function (e, t, i) {
  42428. for (var r = t.length, o = [], a = 0; a < r; a++) {
  42429. var s = [],
  42430. l = []
  42431. s.push((a + r - 1) % r, a, (a + 1) % r), l.push(0, 1, 0)
  42432. var c = n.AnimationUtils.getKeyframeOrder(s)
  42433. ;(s = n.AnimationUtils.sortedArray(s, 1, c)),
  42434. (l = n.AnimationUtils.sortedArray(l, 1, c)),
  42435. 0 === s[0] && (s.push(r), l.push(l[0])),
  42436. o.push(new n.NumberKeyframeTrack('.morphTargetInfluences[' + t[a].name + ']', s, l).scale(1 / i))
  42437. }
  42438. return new n.AnimationClip(e, -1, o)
  42439. },
  42440. findByName: function (e, t) {
  42441. for (var i = 0; i < e.length; i++) if (e[i].name === t) return e[i]
  42442. return null
  42443. },
  42444. CreateClipsFromMorphTargetSequences: function (e, t) {
  42445. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  42446. var s = e[o],
  42447. l = s.name.match(r)
  42448. if (l && l.length > 1) {
  42449. var c = l[1],
  42450. h = i[c]
  42451. h || (i[c] = h = []), h.push(s)
  42452. }
  42453. }
  42454. var u = []
  42455. for (var c in i) u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t))
  42456. return u
  42457. },
  42458. parseAnimation: function (e, t, i) {
  42459. if (!e) return console.error(' no animation in JSONLoader data'), null
  42460. for (
  42461. var r = function (e, t, i, r, o) {
  42462. if (0 !== i.length) {
  42463. var a = [],
  42464. s = []
  42465. n.AnimationUtils.flattenJSON(i, a, s, r), 0 !== a.length && o.push(new e(t, a, s))
  42466. }
  42467. },
  42468. o = [],
  42469. a = e.name || 'default',
  42470. s = e.length || -1,
  42471. l = e.fps || 30,
  42472. c = e.hierarchy || [],
  42473. h = 0;
  42474. h < c.length;
  42475. h++
  42476. ) {
  42477. var u = c[h].keys
  42478. if (u && 0 != u.length)
  42479. if (u[0].morphTargets) {
  42480. for (var d = {}, p = 0; p < u.length; p++) if (u[p].morphTargets) for (var f = 0; f < u[p].morphTargets.length; f++) d[u[p].morphTargets[f]] = -1
  42481. for (var g in d) {
  42482. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  42483. var A = u[p]
  42484. m.push(A.time), v.push(A.morphTarget === g ? 1 : 0)
  42485. }
  42486. o.push(new n.NumberKeyframeTrack('.morphTargetInfluence[' + g + ']', m, v))
  42487. }
  42488. s = d.length * (l || 1)
  42489. } else {
  42490. var y = '.bones[' + t[h].name + ']'
  42491. r(n.VectorKeyframeTrack, y + '.position', u, 'pos', o), r(n.QuaternionKeyframeTrack, y + '.quaternion', u, 'rot', o), r(n.VectorKeyframeTrack, y + '.scale', u, 'scl', o)
  42492. }
  42493. }
  42494. if (0 === o.length) return null
  42495. var C = new n.AnimationClip(a, s, o)
  42496. return C
  42497. }
  42498. }),
  42499. (n.AnimationMixer = function (e) {
  42500. ;(this._root = e), this._initMemoryManager(), (this._accuIndex = 0), (this.time = 0), (this.timeScale = 1)
  42501. }),
  42502. (n.AnimationMixer.prototype = {
  42503. constructor: n.AnimationMixer,
  42504. clipAction: function (e, t) {
  42505. var i,
  42506. r = t || this._root,
  42507. o = r.uuid,
  42508. a = 'string' == typeof e ? e : e.name,
  42509. s = e !== a ? e : null,
  42510. l = this._actionsByClip[a]
  42511. if (void 0 !== l) {
  42512. var c = l.actionByRoot[o]
  42513. if (void 0 !== c) return c
  42514. if (((i = l.knownActions[0]), (s = i._clip), e !== a && e !== s)) throw new Error('Different clips with the same name detected!')
  42515. }
  42516. if (null === s) return null
  42517. var h = new n.AnimationMixer._Action(this, s, t)
  42518. return this._bindAction(h, i), this._addInactiveAction(h, a, o), h
  42519. },
  42520. existingAction: function (e, t) {
  42521. var i = t || this._root,
  42522. n = i.uuid,
  42523. r = 'string' == typeof e ? e : e.name,
  42524. o = this._actionsByClip[r]
  42525. return void 0 !== o ? o.actionByRoot[n] || null : null
  42526. },
  42527. stopAllAction: function () {
  42528. var e = this._actions,
  42529. t = this._nActiveActions,
  42530. i = this._bindings,
  42531. n = this._nActiveBindings
  42532. ;(this._nActiveActions = 0), (this._nActiveBindings = 0)
  42533. for (var r = 0; r !== t; ++r) e[r].reset()
  42534. for (var r = 0; r !== n; ++r) i[r].useCount = 0
  42535. return this
  42536. },
  42537. update: function (e) {
  42538. e *= this.timeScale
  42539. 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) {
  42540. var s = t[a]
  42541. s.enabled && s._update(n, e, r, o)
  42542. }
  42543. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a) l[a].apply(o)
  42544. return this
  42545. },
  42546. getRoot: function () {
  42547. return this._root
  42548. },
  42549. uncacheClip: function (e) {
  42550. var t = this._actions,
  42551. i = e.name,
  42552. n = this._actionsByClip,
  42553. r = n[i]
  42554. if (void 0 !== r) {
  42555. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  42556. var l = o[a]
  42557. this._deactivateAction(l)
  42558. var c = l._cacheIndex,
  42559. h = t[t.length - 1]
  42560. ;(l._cacheIndex = null), (l._byClipCacheIndex = null), (h._cacheIndex = c), (t[c] = h), t.pop(), this._removeInactiveBindingsForAction(l)
  42561. }
  42562. delete n[i]
  42563. }
  42564. },
  42565. uncacheRoot: function (e) {
  42566. var t = e.uuid,
  42567. i = this._actionsByClip
  42568. for (var n in i) {
  42569. var r = i[n].actionByRoot,
  42570. o = r[t]
  42571. void 0 !== o && (this._deactivateAction(o), this._removeInactiveAction(o))
  42572. }
  42573. var a = this._bindingsByRootAndName,
  42574. s = a[t]
  42575. if (void 0 !== s)
  42576. for (var l in s) {
  42577. var c = s[l]
  42578. c.restoreOriginalState(), this._removeInactiveBinding(c)
  42579. }
  42580. },
  42581. uncacheAction: function (e, t) {
  42582. var i = this.existingAction(e, t)
  42583. null !== i && (this._deactivateAction(i), this._removeInactiveAction(i))
  42584. }
  42585. }),
  42586. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  42587. (n.AnimationMixer._Action = function (e, t, i) {
  42588. ;(this._mixer = e), (this._clip = t), (this._localRoot = i || null)
  42589. for (
  42590. var r = t.tracks,
  42591. o = r.length,
  42592. a = new Array(o),
  42593. s = {
  42594. endingStart: n.ZeroCurvatureEnding,
  42595. endingEnd: n.ZeroCurvatureEnding
  42596. },
  42597. l = 0;
  42598. l !== o;
  42599. ++l
  42600. ) {
  42601. var c = r[l].createInterpolant(null)
  42602. ;(a[l] = c), (c.settings = s)
  42603. }
  42604. ;(this._interpolantSettings = s),
  42605. (this._interpolants = a),
  42606. (this._propertyBindings = new Array(o)),
  42607. (this._cacheIndex = null),
  42608. (this._byClipCacheIndex = null),
  42609. (this._timeScaleInterpolant = null),
  42610. (this._weightInterpolant = null),
  42611. (this.loop = n.LoopRepeat),
  42612. (this._loopCount = -1),
  42613. (this._startTime = null),
  42614. (this.time = 0),
  42615. (this.timeScale = 1),
  42616. (this._effectiveTimeScale = 1),
  42617. (this.weight = 1),
  42618. (this._effectiveWeight = 1),
  42619. (this.repetitions = 1 / 0),
  42620. (this.paused = !1),
  42621. (this.enabled = !0),
  42622. (this.clampWhenFinished = !1),
  42623. (this.zeroSlopeAtStart = !0),
  42624. (this.zeroSlopeAtEnd = !0)
  42625. }),
  42626. (n.AnimationMixer._Action.prototype = {
  42627. constructor: n.AnimationMixer._Action,
  42628. play: function () {
  42629. return this._mixer._activateAction(this), this
  42630. },
  42631. stop: function () {
  42632. return this._mixer._deactivateAction(this), this.reset()
  42633. },
  42634. reset: function () {
  42635. return (this.paused = !1), (this.enabled = !0), (this.time = 0), (this._loopCount = -1), (this._startTime = null), this.stopFading().stopWarping()
  42636. },
  42637. isRunning: function () {
  42638. this._startTime
  42639. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  42640. },
  42641. isScheduled: function () {
  42642. return this._mixer._isActiveAction(this)
  42643. },
  42644. startAt: function (e) {
  42645. return (this._startTime = e), this
  42646. },
  42647. setLoop: function (e, t) {
  42648. return (this.loop = e), (this.repetitions = t), this
  42649. },
  42650. setEffectiveWeight: function (e) {
  42651. return (this.weight = e), (this._effectiveWeight = this.enabled ? e : 0), this.stopFading()
  42652. },
  42653. getEffectiveWeight: function () {
  42654. return this._effectiveWeight
  42655. },
  42656. fadeIn: function (e) {
  42657. return this._scheduleFading(e, 0, 1)
  42658. },
  42659. fadeOut: function (e) {
  42660. return this._scheduleFading(e, 1, 0)
  42661. },
  42662. crossFadeFrom: function (e, t, i) {
  42663. this._mixer
  42664. if ((e.fadeOut(t), this.fadeIn(t), i)) {
  42665. var n = this._clip.duration,
  42666. r = e._clip.duration,
  42667. o = r / n,
  42668. a = n / r
  42669. e.warp(1, o, t), this.warp(a, 1, t)
  42670. }
  42671. return this
  42672. },
  42673. crossFadeTo: function (e, t, i) {
  42674. return e.crossFadeFrom(this, t, i)
  42675. },
  42676. stopFading: function () {
  42677. var e = this._weightInterpolant
  42678. return null !== e && ((this._weightInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this
  42679. },
  42680. setEffectiveTimeScale: function (e) {
  42681. return (this.timeScale = e), (this._effectiveTimeScale = this.paused ? 0 : e), this.stopWarping()
  42682. },
  42683. getEffectiveTimeScale: function () {
  42684. return this._effectiveTimeScale
  42685. },
  42686. setDuration: function (e) {
  42687. return (this.timeScale = this._clip.duration / e), this.stopWarping()
  42688. },
  42689. syncWith: function (e) {
  42690. return (this.time = e.time), (this.timeScale = e.timeScale), this.stopWarping()
  42691. },
  42692. halt: function (e) {
  42693. return this.warp(this._currentTimeScale, 0, e)
  42694. },
  42695. warp: function (e, t, i) {
  42696. var n = this._mixer,
  42697. r = n.time,
  42698. o = this._timeScaleInterpolant,
  42699. a = this.timeScale
  42700. null === o && ((o = n._lendControlInterpolant()), (this._timeScaleInterpolant = o))
  42701. var s = o.parameterPositions,
  42702. l = o.sampleValues
  42703. return (s[0] = r), (s[1] = r + i), (l[0] = e / a), (l[1] = t / a), this
  42704. },
  42705. stopWarping: function () {
  42706. var e = this._timeScaleInterpolant
  42707. return null !== e && ((this._timeScaleInterpolant = null), this._mixer._takeBackControlInterpolant(e)), this
  42708. },
  42709. getMixer: function () {
  42710. return this._mixer
  42711. },
  42712. getClip: function () {
  42713. return this._clip
  42714. },
  42715. getRoot: function () {
  42716. return this._localRoot || this._mixer._root
  42717. },
  42718. _update: function (e, t, i, n) {
  42719. var r = this._startTime
  42720. if (null !== r) {
  42721. var o = (e - r) * i
  42722. if (o < 0 || 0 === i) return
  42723. ;(this._startTime = null), (t = i * o)
  42724. }
  42725. t *= this._updateTimeScale(e)
  42726. var a = this._updateTime(t),
  42727. s = this._updateWeight(e)
  42728. if (s > 0) for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h) l[h].evaluate(a), c[h].accumulate(n, s)
  42729. },
  42730. _updateWeight: function (e) {
  42731. var t = 0
  42732. if (this.enabled) {
  42733. t = this.weight
  42734. var i = this._weightInterpolant
  42735. if (null !== i) {
  42736. var n = i.evaluate(e)[0]
  42737. ;(t *= n), e > i.parameterPositions[1] && (this.stopFading(), 0 === n && (this.enabled = !1))
  42738. }
  42739. }
  42740. return (this._effectiveWeight = t), t
  42741. },
  42742. _updateTimeScale: function (e) {
  42743. var t = 0
  42744. if (!this.paused) {
  42745. t = this.timeScale
  42746. var i = this._timeScaleInterpolant
  42747. if (null !== i) {
  42748. var n = i.evaluate(e)[0]
  42749. ;(t *= n), e > i.parameterPositions[1] && (this.stopWarping(), 0 === t ? (this.pause = !0) : (this.timeScale = t))
  42750. }
  42751. }
  42752. return (this._effectiveTimeScale = t), t
  42753. },
  42754. _updateTime: function (e) {
  42755. var t = this.time + e
  42756. if (0 === e) return t
  42757. var i = this._clip.duration,
  42758. r = this.loop,
  42759. o = this._loopCount,
  42760. a = !1
  42761. switch (r) {
  42762. case n.LoopOnce:
  42763. if ((o === -1 && ((this.loopCount = 0), this._setEndings(!0, !0, !1)), t >= i)) t = i
  42764. else {
  42765. if (!(t < 0)) break
  42766. t = 0
  42767. }
  42768. this.clampWhenFinished ? (this.pause = !0) : (this.enabled = !1),
  42769. this._mixer.dispatchEvent({
  42770. type: 'finished',
  42771. action: this,
  42772. direction: e < 0 ? -1 : 1
  42773. })
  42774. break
  42775. case n.LoopPingPong:
  42776. a = !0
  42777. case n.LoopRepeat:
  42778. if ((o === -1 && (e > 0 ? ((o = 0), this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)), t >= i || t < 0)) {
  42779. var s = Math.floor(t / i)
  42780. ;(t -= i * s), (o += Math.abs(s))
  42781. var l = this.repetitions - o
  42782. if (l < 0) {
  42783. this.clampWhenFinished ? (this.paused = !0) : (this.enabled = !1),
  42784. (t = e > 0 ? i : 0),
  42785. this._mixer.dispatchEvent({
  42786. type: 'finished',
  42787. action: this,
  42788. direction: e > 0 ? 1 : -1
  42789. })
  42790. break
  42791. }
  42792. if (0 === l) {
  42793. var c = e < 0
  42794. this._setEndings(c, !c, a)
  42795. } else this._setEndings(!1, !1, a)
  42796. ;(this._loopCount = o),
  42797. this._mixer.dispatchEvent({
  42798. type: 'loop',
  42799. action: this,
  42800. loopDelta: s
  42801. })
  42802. }
  42803. if (r === n.LoopPingPong && 1 === (1 & o)) return (this.time = t), i - t
  42804. }
  42805. return (this.time = t), t
  42806. },
  42807. _setEndings: function (e, t, i) {
  42808. var r = this._interpolantSettings
  42809. i
  42810. ? ((r.endingStart = n.ZeroSlopeEnding), (r.endingEnd = n.ZeroSlopeEnding))
  42811. : (e ? (r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding) : (r.endingStart = n.WrapAroundEnding),
  42812. t ? (r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding) : (r.endingEnd = n.WrapAroundEnding))
  42813. },
  42814. _scheduleFading: function (e, t, i) {
  42815. var n = this._mixer,
  42816. r = n.time,
  42817. o = this._weightInterpolant
  42818. null === o && ((o = n._lendControlInterpolant()), (this._weightInterpolant = o))
  42819. var a = o.parameterPositions,
  42820. s = o.sampleValues
  42821. return (a[0] = r), (s[0] = t), (a[1] = r + e), (s[1] = i), this
  42822. }
  42823. }),
  42824. Object.assign(n.AnimationMixer.prototype, {
  42825. _bindAction: function (e, t) {
  42826. var i = e._localRoot || this._root,
  42827. r = e._clip.tracks,
  42828. o = r.length,
  42829. a = e._propertyBindings,
  42830. s = e._interpolants,
  42831. l = i.uuid,
  42832. c = this._bindingsByRootAndName,
  42833. h = c[l]
  42834. void 0 === h && ((h = {}), (c[l] = h))
  42835. for (var u = 0; u !== o; ++u) {
  42836. var d = r[u],
  42837. p = d.name,
  42838. f = h[p]
  42839. if (void 0 !== f) a[u] = f
  42840. else {
  42841. if (((f = a[u]), void 0 !== f)) {
  42842. null === f._cacheIndex && (++f.referenceCount, this._addInactiveBinding(f, l, p))
  42843. continue
  42844. }
  42845. var g = t && t._propertyBindings[u].binding.parsedPath
  42846. ;(f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g), d.ValueTypeName, d.getValueSize())), ++f.referenceCount, this._addInactiveBinding(f, l, p), (a[u] = f)
  42847. }
  42848. s[u].resultBuffer = f.buffer
  42849. }
  42850. },
  42851. _activateAction: function (e) {
  42852. if (!this._isActiveAction(e)) {
  42853. if (null === e._cacheIndex) {
  42854. var t = (e._localRoot || this._root).uuid,
  42855. i = e._clip.name,
  42856. n = this._actionsByClip[i]
  42857. this._bindAction(e, n && n.knownActions[0]), this._addInactiveAction(e, i, t)
  42858. }
  42859. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  42860. var s = r[o]
  42861. 0 === s.useCount++ && (this._lendBinding(s), s.saveOriginalState())
  42862. }
  42863. this._lendAction(e)
  42864. }
  42865. },
  42866. _deactivateAction: function (e) {
  42867. if (this._isActiveAction(e)) {
  42868. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  42869. var r = t[i]
  42870. 0 === --r.useCount && (r.restoreOriginalState(), this._takeBackBinding(r))
  42871. }
  42872. this._takeBackAction(e)
  42873. }
  42874. },
  42875. _initMemoryManager: function () {
  42876. ;(this._actions = []),
  42877. (this._nActiveActions = 0),
  42878. (this._actionsByClip = {}),
  42879. (this._bindings = []),
  42880. (this._nActiveBindings = 0),
  42881. (this._bindingsByRootAndName = {}),
  42882. (this._controlInterpolants = []),
  42883. (this._nActiveControlInterpolants = 0)
  42884. var e = this
  42885. this.stats = {
  42886. actions: {
  42887. get total() {
  42888. return e._actions.length
  42889. },
  42890. get inUse() {
  42891. return e._nActiveActions
  42892. }
  42893. },
  42894. bindings: {
  42895. get total() {
  42896. return e._bindings.length
  42897. },
  42898. get inUse() {
  42899. return e._nActiveBindings
  42900. }
  42901. },
  42902. controlInterpolants: {
  42903. get total() {
  42904. return e._controlInterpolants.length
  42905. },
  42906. get inUse() {
  42907. return e._nActiveControlInterpolants
  42908. }
  42909. }
  42910. }
  42911. },
  42912. _isActiveAction: function (e) {
  42913. var t = e._cacheIndex
  42914. return null !== t && t < this._nActiveActions
  42915. },
  42916. _addInactiveAction: function (e, t, i) {
  42917. var n = this._actions,
  42918. r = this._actionsByClip,
  42919. o = r[t]
  42920. if (void 0 === o)
  42921. (o = {
  42922. knownActions: [e],
  42923. actionByRoot: {}
  42924. }),
  42925. (e._byClipCacheIndex = 0),
  42926. (r[t] = o)
  42927. else {
  42928. var a = o.knownActions
  42929. ;(e._byClipCacheIndex = a.length), a.push(e)
  42930. }
  42931. ;(e._cacheIndex = n.length), n.push(e), (o.actionByRoot[i] = e)
  42932. },
  42933. _removeInactiveAction: function (e) {
  42934. var t = this._actions,
  42935. i = t[t.length - 1],
  42936. n = e._cacheIndex
  42937. ;(i._cacheIndex = n), (t[n] = i), t.pop(), (e._cacheIndex = null)
  42938. var r = e._clip.name,
  42939. o = this._actionsByClip,
  42940. a = o[r],
  42941. s = a.knownActions,
  42942. l = s[s.length - 1],
  42943. c = e._byClipCacheIndex
  42944. ;(l._byClipCacheIndex = c), (s[c] = l), s.pop(), (e._byClipCacheIndex = null)
  42945. var h = a.actionByRoot,
  42946. u = (t._localRoot || this._root).uuid
  42947. delete h[u], 0 === s.length && delete o[r], this._removeInactiveBindingsForAction(e)
  42948. },
  42949. _removeInactiveBindingsForAction: function (e) {
  42950. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  42951. var r = t[i]
  42952. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  42953. }
  42954. },
  42955. _lendAction: function (e) {
  42956. var t = this._actions,
  42957. i = e._cacheIndex,
  42958. n = this._nActiveActions++,
  42959. r = t[n]
  42960. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  42961. },
  42962. _takeBackAction: function (e) {
  42963. var t = this._actions,
  42964. i = e._cacheIndex,
  42965. n = --this._nActiveActions,
  42966. r = t[n]
  42967. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  42968. },
  42969. _addInactiveBinding: function (e, t, i) {
  42970. var n = this._bindingsByRootAndName,
  42971. r = n[t],
  42972. o = this._bindings
  42973. void 0 === r && ((r = {}), (n[t] = r)), (r[i] = e), (e._cacheIndex = o.length), o.push(e)
  42974. },
  42975. _removeInactiveBinding: function (e) {
  42976. var t = this._bindings,
  42977. i = e.binding,
  42978. n = i.rootNode.uuid,
  42979. r = i.path,
  42980. o = this._bindingsByRootAndName,
  42981. a = o[n],
  42982. s = t[t.length - 1],
  42983. l = e._cacheIndex
  42984. ;(s._cacheIndex = l), (t[l] = s), t.pop(), delete a[r]
  42985. e: {
  42986. for (var c in a) break e
  42987. delete o[n]
  42988. }
  42989. },
  42990. _lendBinding: function (e) {
  42991. var t = this._bindings,
  42992. i = e._cacheIndex,
  42993. n = this._nActiveBindings++,
  42994. r = t[n]
  42995. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  42996. },
  42997. _takeBackBinding: function (e) {
  42998. var t = this._bindings,
  42999. i = e._cacheIndex,
  43000. n = --this._nActiveBindings,
  43001. r = t[n]
  43002. ;(e._cacheIndex = n), (t[n] = e), (r._cacheIndex = i), (t[i] = r)
  43003. },
  43004. _lendControlInterpolant: function () {
  43005. var e = this._controlInterpolants,
  43006. t = this._nActiveControlInterpolants++,
  43007. i = e[t]
  43008. return void 0 === i && ((i = new n.LinearInterpolant(new Float32Array(2), new Float32Array(2), 1, this._controlInterpolantsResultBuffer)), (i.__cacheIndex = t), (e[t] = i)), i
  43009. },
  43010. _takeBackControlInterpolant: function (e) {
  43011. var t = this._controlInterpolants,
  43012. i = e.__cacheIndex,
  43013. n = --this._nActiveControlInterpolants,
  43014. r = t[n]
  43015. ;(e.__cacheIndex = n), (t[n] = e), (r.__cacheIndex = i), (t[i] = r)
  43016. },
  43017. _controlInterpolantsResultBuffer: new Float32Array(1)
  43018. }),
  43019. (n.AnimationObjectGroup = function (e) {
  43020. ;(this.uuid = n.Math.generateUUID()), (this._objects = Array.prototype.slice.call(arguments)), (this.nCachedObjects_ = 0)
  43021. var t = {}
  43022. this._indicesByUUID = t
  43023. for (var i = 0, r = arguments.length; i !== r; ++i) t[arguments[i].uuid] = i
  43024. ;(this._paths = []), (this._parsedPaths = []), (this._bindings = []), (this._bindingsIndicesByPath = {})
  43025. var o = this
  43026. this.stats = {
  43027. objects: {
  43028. get total() {
  43029. return o._objects.length
  43030. },
  43031. get inUse() {
  43032. return this.total - o.nCachedObjects_
  43033. }
  43034. },
  43035. get bindingsPerObject() {
  43036. return o._bindings.length
  43037. }
  43038. }
  43039. }),
  43040. (n.AnimationObjectGroup.prototype = {
  43041. constructor: n.AnimationObjectGroup,
  43042. add: function (e) {
  43043. for (
  43044. var t = this._objects,
  43045. i = t.length,
  43046. r = this.nCachedObjects_,
  43047. o = this._indicesByUUID,
  43048. a = this._paths,
  43049. s = this._parsedPaths,
  43050. l = this._bindings,
  43051. c = l.length,
  43052. h = 0,
  43053. u = arguments.length;
  43054. h !== u;
  43055. ++h
  43056. ) {
  43057. var d = arguments[h],
  43058. p = d.uuid,
  43059. f = o[p]
  43060. if (void 0 === f) {
  43061. ;(f = i++), (o[p] = f), t.push(d)
  43062. for (var g = 0, m = c; g !== m; ++g) l[g].push(new n.PropertyBinding(d, a[g], s[g]))
  43063. } else if (f < r) {
  43064. var v = t[f],
  43065. A = --r,
  43066. y = t[A]
  43067. ;(o[y.uuid] = f), (t[f] = y), (o[p] = A), (t[A] = d)
  43068. for (var g = 0, m = c; g !== m; ++g) {
  43069. var C = l[g],
  43070. I = C[A],
  43071. E = C[f]
  43072. ;(C[f] = I), void 0 === E && (E = new n.PropertyBinding(d, a[g], s[g])), (C[A] = E)
  43073. }
  43074. } else t[f] !== v && console.error('Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...')
  43075. }
  43076. this.nCachedObjects_ = r
  43077. },
  43078. remove: function (e) {
  43079. for (var t = this._objects, i = (t.length, this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43080. var l = arguments[a],
  43081. c = l.uuid,
  43082. h = n[c]
  43083. if (void 0 !== h && h >= i) {
  43084. var u = i++,
  43085. d = t[u]
  43086. ;(n[d.uuid] = h), (t[h] = d), (n[c] = u), (t[u] = l)
  43087. for (var p = 0, f = o; p !== f; ++p) {
  43088. var g = r[p],
  43089. m = g[u],
  43090. v = g[h]
  43091. ;(g[h] = m), (g[u] = v)
  43092. }
  43093. }
  43094. }
  43095. this.nCachedObjects_ = i
  43096. },
  43097. uncache: function (e) {
  43098. 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) {
  43099. var c = arguments[s],
  43100. h = c.uuid,
  43101. u = r[h]
  43102. if (void 0 !== u)
  43103. if ((delete r[h], u < n)) {
  43104. var d = --n,
  43105. p = t[d],
  43106. f = --i,
  43107. g = t[f]
  43108. ;(r[p.uuid] = u), (t[u] = p), (r[g.uuid] = d), (t[d] = g), t.pop()
  43109. for (var m = 0, v = a; m !== v; ++m) {
  43110. var A = o[m],
  43111. y = A[d],
  43112. C = A[f]
  43113. ;(A[u] = y), (A[d] = C), A.pop()
  43114. }
  43115. } else {
  43116. var f = --i,
  43117. g = t[f]
  43118. ;(r[g.uuid] = u), (t[u] = g), t.pop()
  43119. for (var m = 0, v = a; m !== v; ++m) {
  43120. var A = o[m]
  43121. ;(A[u] = A[f]), A.pop()
  43122. }
  43123. }
  43124. }
  43125. this.nCachedObjects_ = n
  43126. },
  43127. subscribe_: function (e, t) {
  43128. var i = this._bindingsIndicesByPath,
  43129. r = i[e],
  43130. o = this._bindings
  43131. if (void 0 !== r) return o[r]
  43132. var a = this._paths,
  43133. s = this._parsedPaths,
  43134. l = this._objects,
  43135. c = l.length,
  43136. h = this.nCachedObjects_,
  43137. u = new Array(c)
  43138. ;(r = o.length), (i[e] = r), a.push(e), s.push(t), o.push(u)
  43139. for (var d = h, p = l.length; d !== p; ++d) {
  43140. var f = l[d]
  43141. u[d] = new n.PropertyBinding(f, e, t)
  43142. }
  43143. return u
  43144. },
  43145. unsubscribe_: function (e) {
  43146. var t = this._bindingsIndicesByPath,
  43147. i = t[e]
  43148. if (void 0 !== i) {
  43149. var n = this._paths,
  43150. r = this._parsedPaths,
  43151. o = this._bindings,
  43152. a = o.length - 1,
  43153. s = o[a],
  43154. l = e[a]
  43155. ;(t[l] = i), (o[i] = s), o.pop(), (r[i] = r[a]), r.pop(), (n[i] = n[a]), n.pop()
  43156. }
  43157. }
  43158. }),
  43159. (n.AnimationUtils = {
  43160. arraySlice: function (e, t, i) {
  43161. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43162. },
  43163. convertArray: function (e, t, i) {
  43164. return !e || (!i && e.constructor === t) ? e : 'number' == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43165. },
  43166. isTypedArray: function (e) {
  43167. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43168. },
  43169. getKeyframeOrder: function (e) {
  43170. function t(t, i) {
  43171. return e[t] - e[i]
  43172. }
  43173. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r) n[r] = r
  43174. return n.sort(t), n
  43175. },
  43176. sortedArray: function (e, t, i) {
  43177. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o) for (var s = i[o] * t, l = 0; l !== t; ++l) r[a++] = e[s + l]
  43178. return r
  43179. },
  43180. flattenJSON: function (e, t, i, n) {
  43181. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; ) o = e[r++]
  43182. if (void 0 !== o) {
  43183. var a = o[n]
  43184. if (void 0 !== a)
  43185. if (Array.isArray(a)) {
  43186. do (a = o[n]), void 0 !== a && (t.push(o.time), i.push.apply(i, a)), (o = e[r++])
  43187. while (void 0 !== o)
  43188. } else if (void 0 !== a.toArray) {
  43189. do (a = o[n]), void 0 !== a && (t.push(o.time), a.toArray(i, i.length)), (o = e[r++])
  43190. while (void 0 !== o)
  43191. } else
  43192. do (a = o[n]), void 0 !== a && (t.push(o.time), i.push(a)), (o = e[r++])
  43193. while (void 0 !== o)
  43194. }
  43195. }
  43196. }),
  43197. (n.KeyframeTrack = function (e, t, i, r) {
  43198. if (void 0 === e) throw new Error('track name is undefined')
  43199. if (void 0 === t || 0 === t.length) throw new Error('no keyframes in track named ' + e)
  43200. ;(this.name = e),
  43201. (this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType)),
  43202. (this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType)),
  43203. this.setInterpolation(r || this.DefaultInterpolation),
  43204. this.validate(),
  43205. this.optimize()
  43206. }),
  43207. (n.KeyframeTrack.prototype = {
  43208. constructor: n.KeyframeTrack,
  43209. TimeBufferType: Float32Array,
  43210. ValueBufferType: Float32Array,
  43211. DefaultInterpolation: n.InterpolateLinear,
  43212. InterpolantFactoryMethodDiscrete: function (e) {
  43213. return new n.DiscreteInterpolant(this.times, this.values, this.getValueSize(), e)
  43214. },
  43215. InterpolantFactoryMethodLinear: function (e) {
  43216. return new n.LinearInterpolant(this.times, this.values, this.getValueSize(), e)
  43217. },
  43218. InterpolantFactoryMethodSmooth: function (e) {
  43219. return new n.CubicInterpolant(this.times, this.values, this.getValueSize(), e)
  43220. },
  43221. setInterpolation: function (e) {
  43222. var t = void 0
  43223. switch (e) {
  43224. case n.InterpolateDiscrete:
  43225. t = this.InterpolantFactoryMethodDiscrete
  43226. break
  43227. case n.InterpolateLinear:
  43228. t = this.InterpolantFactoryMethodLinear
  43229. break
  43230. case n.InterpolateSmooth:
  43231. t = this.InterpolantFactoryMethodSmooth
  43232. }
  43233. if (void 0 === t) {
  43234. var i = 'unsupported interpolation for ' + this.ValueTypeName + ' keyframe track named ' + this.name
  43235. if (void 0 === this.createInterpolant) {
  43236. if (e === this.DefaultInterpolation) throw new Error(i)
  43237. this.setInterpolation(this.DefaultInterpolation)
  43238. }
  43239. return void console.warn(i)
  43240. }
  43241. this.createInterpolant = t
  43242. },
  43243. getInterpolation: function () {
  43244. switch (this.createInterpolant) {
  43245. case this.InterpolantFactoryMethodDiscrete:
  43246. return n.InterpolateDiscrete
  43247. case this.InterpolantFactoryMethodLinear:
  43248. return n.InterpolateLinear
  43249. case this.InterpolantFactoryMethodSmooth:
  43250. return n.InterpolateSmooth
  43251. }
  43252. },
  43253. getValueSize: function () {
  43254. return this.values.length / this.times.length
  43255. },
  43256. shift: function (e) {
  43257. if (0 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] += e
  43258. return this
  43259. },
  43260. scale: function (e) {
  43261. if (1 !== e) for (var t = this.times, i = 0, n = t.length; i !== n; ++i) t[i] *= e
  43262. return this
  43263. },
  43264. trim: function (e, t) {
  43265. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; ) ++o
  43266. for (; a !== -1 && i[a] > t; ) --a
  43267. if ((++a, 0 !== o || a !== r)) {
  43268. o >= a && ((a = Math.max(a, 1)), (o = a - 1))
  43269. var s = this.getValueSize()
  43270. ;(this.times = n.AnimationUtils.arraySlice(i, o, a)), (this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s))
  43271. }
  43272. return this
  43273. },
  43274. validate: function () {
  43275. var e = !0,
  43276. t = this.getValueSize()
  43277. t - Math.floor(t) !== 0 && (console.error('invalid value size in track', this), (e = !1))
  43278. var i = this.times,
  43279. r = this.values,
  43280. o = i.length
  43281. 0 === o && (console.error('track is empty', this), (e = !1))
  43282. for (var a = null, s = 0; s !== o; s++) {
  43283. var l = i[s]
  43284. if ('number' == typeof l && isNaN(l)) {
  43285. console.error('time is not a valid number', this, s, l), (e = !1)
  43286. break
  43287. }
  43288. if (null !== a && a > l) {
  43289. console.error('out of order keys', this, s, l, a), (e = !1)
  43290. break
  43291. }
  43292. a = l
  43293. }
  43294. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  43295. for (var s = 0, c = r.length; s !== c; ++s) {
  43296. var h = r[s]
  43297. if (isNaN(h)) {
  43298. console.error('value is not a valid number', this, s, h), (e = !1)
  43299. break
  43300. }
  43301. }
  43302. return e
  43303. },
  43304. optimize: function () {
  43305. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  43306. var s = !1,
  43307. l = e[o],
  43308. c = e[o + 1]
  43309. if (l !== c && (1 !== o || l !== l[0]))
  43310. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  43311. var f = t[h + p]
  43312. if (f !== t[u + p] || f !== t[d + p]) {
  43313. s = !0
  43314. break
  43315. }
  43316. }
  43317. if (s) {
  43318. if (o !== r) {
  43319. e[r] = e[o]
  43320. for (var g = o * i, m = r * i, p = 0; p !== i; ++p) t[m + p] = t[g + p]
  43321. }
  43322. ++r
  43323. }
  43324. }
  43325. return r !== e.length && ((this.times = n.AnimationUtils.arraySlice(e, 0, r)), (this.values = n.AnimationUtils.arraySlice(t, 0, r * i))), this
  43326. }
  43327. }),
  43328. Object.assign(n.KeyframeTrack, {
  43329. parse: function (e) {
  43330. if (void 0 === e.type) throw new Error('track type undefined, can not parse')
  43331. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type)
  43332. if (void 0 === e.times) {
  43333. console.warn('legacy JSON format detected, converting')
  43334. var i = [],
  43335. r = []
  43336. n.AnimationUtils.flattenJSON(e.keys, i, r, 'value'), (e.times = i), (e.values = r)
  43337. }
  43338. return void 0 !== t.parse ? t.parse(e) : new t(e.name, e.times, e.values, e.interpolation)
  43339. },
  43340. toJSON: function (e) {
  43341. var t,
  43342. i = e.constructor
  43343. if (void 0 !== i.toJSON) t = i.toJSON(e)
  43344. else {
  43345. t = {
  43346. name: e.name,
  43347. times: n.AnimationUtils.convertArray(e.times, Array),
  43348. values: n.AnimationUtils.convertArray(e.values, Array)
  43349. }
  43350. var r = e.getInterpolation()
  43351. r !== e.DefaultInterpolation && (t.interpolation = r)
  43352. }
  43353. return (t.type = e.ValueTypeName), t
  43354. },
  43355. _getTrackTypeForValueTypeName: function (e) {
  43356. switch (e.toLowerCase()) {
  43357. case 'scalar':
  43358. case 'double':
  43359. case 'float':
  43360. case 'number':
  43361. case 'integer':
  43362. return n.NumberKeyframeTrack
  43363. case 'vector':
  43364. case 'vector2':
  43365. case 'vector3':
  43366. case 'vector4':
  43367. return n.VectorKeyframeTrack
  43368. case 'color':
  43369. return n.ColorKeyframeTrack
  43370. case 'quaternion':
  43371. return n.QuaternionKeyframeTrack
  43372. case 'bool':
  43373. case 'boolean':
  43374. return n.BooleanKeyframeTrack
  43375. case 'string':
  43376. return n.StringKeyframeTrack
  43377. }
  43378. throw new Error('Unsupported typeName: ' + e)
  43379. }
  43380. }),
  43381. (n.PropertyBinding = function (e, t, i) {
  43382. ;(this.path = t), (this.parsedPath = i || n.PropertyBinding.parseTrackName(t)), (this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e), (this.rootNode = e)
  43383. }),
  43384. (n.PropertyBinding.prototype = {
  43385. constructor: n.PropertyBinding,
  43386. getValue: function (e, t) {
  43387. this.bind(), this.getValue(e, t)
  43388. },
  43389. setValue: function (e, t) {
  43390. this.bind(), this.setValue(e, t)
  43391. },
  43392. bind: function () {
  43393. var e = this.node,
  43394. t = this.parsedPath,
  43395. i = t.objectName,
  43396. r = t.propertyName,
  43397. o = t.propertyIndex
  43398. if (
  43399. (e || ((e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode), (this.node = e)),
  43400. (this.getValue = this._getValue_unavailable),
  43401. (this.setValue = this._setValue_unavailable),
  43402. !e)
  43403. )
  43404. return void console.error(' trying to update node for track: ' + this.path + " but it wasn't found.")
  43405. if (i) {
  43406. var a = t.objectIndex
  43407. switch (i) {
  43408. case 'materials':
  43409. if (!e.material) return void console.error(' can not bind to material as node does not have a material', this)
  43410. if (!e.material.materials) return void console.error(' can not bind to material.materials as node.material does not have a materials array', this)
  43411. e = e.material.materials
  43412. break
  43413. case 'bones':
  43414. if (!e.skeleton) return void console.error(' can not bind to bones as node does not have a skeleton', this)
  43415. e = e.skeleton.bones
  43416. for (var s = 0; s < e.length; s++)
  43417. if (e[s].name === a) {
  43418. a = s
  43419. break
  43420. }
  43421. break
  43422. default:
  43423. if (void 0 === e[i]) return void console.error(' can not bind to objectName of node, undefined', this)
  43424. e = e[i]
  43425. }
  43426. if (void 0 !== a) {
  43427. if (void 0 === e[a]) return void console.error(' trying to bind to objectIndex of objectName, but is undefined:', this, e)
  43428. e = e[a]
  43429. }
  43430. }
  43431. var l = e[r]
  43432. if (!l) {
  43433. var c = t.nodeName
  43434. return void console.error(' trying to update property for track: ' + c + '.' + r + " but it wasn't found.", e)
  43435. }
  43436. var h = this.Versioning.None
  43437. void 0 !== e.needsUpdate
  43438. ? ((h = this.Versioning.NeedsUpdate), (this.targetObject = e))
  43439. : void 0 !== e.matrixWorldNeedsUpdate && ((h = this.Versioning.MatrixWorldNeedsUpdate), (this.targetObject = e))
  43440. var u = this.BindingType.Direct
  43441. if (void 0 !== o) {
  43442. if ('morphTargetInfluences' === r) {
  43443. if (!e.geometry) return void console.error(' can not bind to morphTargetInfluences becasuse node does not have a geometry', this)
  43444. if (!e.geometry.morphTargets) return void console.error(' can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets', this)
  43445. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  43446. if (e.geometry.morphTargets[s].name === o) {
  43447. o = s
  43448. break
  43449. }
  43450. }
  43451. ;(u = this.BindingType.ArrayElement), (this.resolvedProperty = l), (this.propertyIndex = o)
  43452. } else
  43453. void 0 !== l.fromArray && void 0 !== l.toArray
  43454. ? ((u = this.BindingType.HasFromToArray), (this.resolvedProperty = l))
  43455. : void 0 !== l.length
  43456. ? ((u = this.BindingType.EntireArray), (this.resolvedProperty = l))
  43457. : (this.propertyName = r)
  43458. ;(this.getValue = this.GetterByBindingType[u]), (this.setValue = this.SetterByBindingTypeAndVersioning[u][h])
  43459. },
  43460. unbind: function () {
  43461. ;(this.node = null), (this.getValue = this._getValue_unbound), (this.setValue = this._setValue_unbound)
  43462. }
  43463. }),
  43464. Object.assign(n.PropertyBinding.prototype, {
  43465. _getValue_unavailable: function () {},
  43466. _setValue_unavailable: function () {},
  43467. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  43468. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  43469. BindingType: {
  43470. Direct: 0,
  43471. EntireArray: 1,
  43472. ArrayElement: 2,
  43473. HasFromToArray: 3
  43474. },
  43475. Versioning: {
  43476. None: 0,
  43477. NeedsUpdate: 1,
  43478. MatrixWorldNeedsUpdate: 2
  43479. },
  43480. GetterByBindingType: [
  43481. function (e, t) {
  43482. e[t] = this.node[this.propertyName]
  43483. },
  43484. function (e, t) {
  43485. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) e[t++] = i[n]
  43486. },
  43487. function (e, t) {
  43488. e[t] = this.resolvedProperty[this.propertyIndex]
  43489. },
  43490. function (e, t) {
  43491. this.resolvedProperty.toArray(e, t)
  43492. }
  43493. ],
  43494. SetterByBindingTypeAndVersioning: [
  43495. [
  43496. function (e, t) {
  43497. this.node[this.propertyName] = e[t]
  43498. },
  43499. function (e, t) {
  43500. ;(this.node[this.propertyName] = e[t]), (this.targetObject.needsUpdate = !0)
  43501. },
  43502. function (e, t) {
  43503. ;(this.node[this.propertyName] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)
  43504. }
  43505. ],
  43506. [
  43507. function (e, t) {
  43508. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  43509. },
  43510. function (e, t) {
  43511. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  43512. this.targetObject.needsUpdate = !0
  43513. },
  43514. function (e, t) {
  43515. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n) i[n] = e[t++]
  43516. this.targetObject.matrixWorldNeedsUpdate = !0
  43517. }
  43518. ],
  43519. [
  43520. function (e, t) {
  43521. this.resolvedProperty[this.propertyIndex] = e[t]
  43522. },
  43523. function (e, t) {
  43524. ;(this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.needsUpdate = !0)
  43525. },
  43526. function (e, t) {
  43527. ;(this.resolvedProperty[this.propertyIndex] = e[t]), (this.targetObject.matrixWorldNeedsUpdate = !0)
  43528. }
  43529. ],
  43530. [
  43531. function (e, t) {
  43532. this.resolvedProperty.fromArray(e, t)
  43533. },
  43534. function (e, t) {
  43535. this.resolvedProperty.fromArray(e, t), (this.targetObject.needsUpdate = !0)
  43536. },
  43537. function (e, t) {
  43538. this.resolvedProperty.fromArray(e, t), (this.targetObject.matrixWorldNeedsUpdate = !0)
  43539. }
  43540. ]
  43541. ]
  43542. }),
  43543. (n.PropertyBinding.Composite = function (e, t, i) {
  43544. var r = i || n.PropertyBinding.parseTrackName(t)
  43545. ;(this._targetGroup = e), (this._bindings = e.subscribe_(t, r))
  43546. }),
  43547. (n.PropertyBinding.Composite.prototype = {
  43548. constructor: n.PropertyBinding.Composite,
  43549. getValue: function (e, t) {
  43550. this.bind()
  43551. var i = this._targetGroup.nCachedObjects_,
  43552. n = this._bindings[i]
  43553. void 0 !== n && n.getValue(e, t)
  43554. },
  43555. setValue: function (e, t) {
  43556. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n) i[n].setValue(e, t)
  43557. },
  43558. bind: function () {
  43559. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].bind()
  43560. },
  43561. unbind: function () {
  43562. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t) e[t].unbind()
  43563. }
  43564. }),
  43565. (n.PropertyBinding.create = function (e, t, i) {
  43566. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e, t, i) : new n.PropertyBinding(e, t, i)
  43567. }),
  43568. (n.PropertyBinding.parseTrackName = function (e) {
  43569. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/,
  43570. i = t.exec(e)
  43571. if (!i) throw new Error('cannot parse trackName at all: ' + e)
  43572. i.index === t.lastIndex && t.lastIndex++
  43573. var n = {
  43574. nodeName: i[3],
  43575. objectName: i[5],
  43576. objectIndex: i[7],
  43577. propertyName: i[9],
  43578. propertyIndex: i[11]
  43579. }
  43580. if (null === n.propertyName || 0 === n.propertyName.length) throw new Error('can not parse propertyName from trackName: ' + e)
  43581. return n
  43582. }),
  43583. (n.PropertyBinding.findNode = function (e, t) {
  43584. if (!t || '' === t || 'root' === t || '.' === t || t === -1 || t === e.name || t === e.uuid) return e
  43585. if (e.skeleton) {
  43586. var i = function (e) {
  43587. for (var i = 0; i < e.bones.length; i++) {
  43588. var n = e.bones[i]
  43589. if (n.name === t) return n
  43590. }
  43591. return null
  43592. },
  43593. n = i(e.skeleton)
  43594. if (n) return n
  43595. }
  43596. if (e.children) {
  43597. var r = function (e) {
  43598. for (var i = 0; i < e.length; i++) {
  43599. var n = e[i]
  43600. if (n.name === t || n.uuid === t) return n
  43601. var o = r(n.children)
  43602. if (o) return o
  43603. }
  43604. return null
  43605. },
  43606. o = r(e.children)
  43607. if (o) return o
  43608. }
  43609. return null
  43610. }),
  43611. (n.PropertyMixer = function (e, t, i) {
  43612. ;(this.binding = e), (this.valueSize = i)
  43613. var n,
  43614. r = Float64Array
  43615. switch (t) {
  43616. case 'quaternion':
  43617. n = this._slerp
  43618. break
  43619. case 'string':
  43620. case 'bool':
  43621. ;(r = Array), (n = this._select)
  43622. break
  43623. default:
  43624. n = this._lerp
  43625. }
  43626. ;(this.buffer = new r(4 * i)), (this._mixBufferRegion = n), (this.cumulativeWeight = 0), (this.useCount = 0), (this.referenceCount = 0)
  43627. }),
  43628. (n.PropertyMixer.prototype = {
  43629. constructor: n.PropertyMixer,
  43630. accumulate: function (e, t) {
  43631. var i = this.buffer,
  43632. n = this.valueSize,
  43633. r = e * n + n,
  43634. o = this.cumulativeWeight
  43635. if (0 === o) {
  43636. for (var a = 0; a !== n; ++a) i[r + a] = i[a]
  43637. o = t
  43638. } else {
  43639. o += t
  43640. var s = t / o
  43641. this._mixBufferRegion(i, r, 0, s, n)
  43642. }
  43643. this.cumulativeWeight = o
  43644. },
  43645. apply: function (e) {
  43646. var t = this.valueSize,
  43647. i = this.buffer,
  43648. n = e * t + t,
  43649. r = this.cumulativeWeight,
  43650. o = this.binding
  43651. if (((this.cumulativeWeight = 0), r < 1)) {
  43652. var a = 3 * t
  43653. this._mixBufferRegion(i, n, a, 1 - r, t)
  43654. }
  43655. for (var s = t, l = t + t; s !== l; ++s)
  43656. if (i[s] !== i[s + t]) {
  43657. o.setValue(i, n)
  43658. break
  43659. }
  43660. },
  43661. saveOriginalState: function () {
  43662. var e = this.binding,
  43663. t = this.buffer,
  43664. i = this.valueSize,
  43665. n = 3 * i
  43666. e.getValue(t, n)
  43667. for (var r = i, o = n; r !== o; ++r) t[r] = t[n + (r % i)]
  43668. this.cumulativeWeight = 0
  43669. },
  43670. restoreOriginalState: function () {
  43671. var e = 3 * this.valueSize
  43672. this.binding.setValue(this.buffer, e)
  43673. },
  43674. _select: function (e, t, i, n, r) {
  43675. if (n >= 0.5) for (var o = 0; o !== r; ++o) e[t + o] = e[i + o]
  43676. },
  43677. _slerp: function (e, t, i, r, o) {
  43678. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  43679. },
  43680. _lerp: function (e, t, i, n, r) {
  43681. for (var o = 1 - n, a = 0; a !== r; ++a) {
  43682. var s = t + a
  43683. e[s] = e[s] * o + e[i + a] * n
  43684. }
  43685. }
  43686. }),
  43687. (n.BooleanKeyframeTrack = function (e, t, i) {
  43688. n.KeyframeTrack.call(this, e, t, i)
  43689. }),
  43690. (n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43691. constructor: n.BooleanKeyframeTrack,
  43692. ValueTypeName: 'bool',
  43693. ValueBufferType: Array,
  43694. DefaultInterpolation: n.IntepolateDiscrete,
  43695. InterpolantFactoryMethodLinear: void 0,
  43696. InterpolantFactoryMethodSmooth: void 0
  43697. })),
  43698. (n.NumberKeyframeTrack = function (e, t, i, r) {
  43699. n.KeyframeTrack.call(this, e, t, i, r)
  43700. }),
  43701. (n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43702. constructor: n.NumberKeyframeTrack,
  43703. ValueTypeName: 'number'
  43704. })),
  43705. (n.QuaternionKeyframeTrack = function (e, t, i, r) {
  43706. n.KeyframeTrack.call(this, e, t, i, r)
  43707. }),
  43708. (n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43709. constructor: n.QuaternionKeyframeTrack,
  43710. ValueTypeName: 'quaternion',
  43711. DefaultInterpolation: n.InterpolateLinear,
  43712. InterpolantFactoryMethodLinear: function (e) {
  43713. return new n.QuaternionLinearInterpolant(this.times, this.values, this.getValueSize(), e)
  43714. },
  43715. InterpolantFactoryMethodSmooth: void 0
  43716. })),
  43717. (n.StringKeyframeTrack = function (e, t, i, r) {
  43718. n.KeyframeTrack.call(this, e, t, i, r)
  43719. }),
  43720. (n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43721. constructor: n.StringKeyframeTrack,
  43722. ValueTypeName: 'string',
  43723. ValueBufferType: Array,
  43724. DefaultInterpolation: n.IntepolateDiscrete,
  43725. InterpolantFactoryMethodLinear: void 0,
  43726. InterpolantFactoryMethodSmooth: void 0
  43727. })),
  43728. (n.VectorKeyframeTrack = function (e, t, i, r) {
  43729. n.KeyframeTrack.call(this, e, t, i, r)
  43730. }),
  43731. (n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  43732. constructor: n.VectorKeyframeTrack,
  43733. ValueTypeName: 'vector'
  43734. })),
  43735. (n.Audio = function (e) {
  43736. n.Object3D.call(this),
  43737. (this.type = 'Audio'),
  43738. (this.context = e.context),
  43739. (this.source = this.context.createBufferSource()),
  43740. (this.source.onended = this.onEnded.bind(this)),
  43741. (this.gain = this.context.createGain()),
  43742. this.gain.connect(e.getInput()),
  43743. (this.autoplay = !1),
  43744. (this.startTime = 0),
  43745. (this.playbackRate = 1),
  43746. (this.isPlaying = !1),
  43747. (this.hasPlaybackControl = !0),
  43748. (this.sourceType = 'empty'),
  43749. (this.filter = null)
  43750. }),
  43751. (n.Audio.prototype = Object.create(n.Object3D.prototype)),
  43752. (n.Audio.prototype.constructor = n.Audio),
  43753. (n.Audio.prototype.getOutput = function () {
  43754. return this.gain
  43755. }),
  43756. (n.Audio.prototype.load = function (e) {
  43757. var t = new n.AudioBuffer(this.context)
  43758. return t.load(e), this.setBuffer(t), this
  43759. }),
  43760. (n.Audio.prototype.setNodeSource = function (e) {
  43761. return (this.hasPlaybackControl = !1), (this.sourceType = 'audioNode'), (this.source = e), this.connect(), this
  43762. }),
  43763. (n.Audio.prototype.setBuffer = function (e) {
  43764. var t = this
  43765. return (
  43766. e.onReady(function (e) {
  43767. ;(t.source.buffer = e), (t.sourceType = 'buffer'), t.autoplay && t.play()
  43768. }),
  43769. this
  43770. )
  43771. }),
  43772. (n.Audio.prototype.play = function () {
  43773. if (this.isPlaying === !0) return void console.warn('THREE.Audio: Audio is already playing.')
  43774. if (this.hasPlaybackControl === !1) return void console.warn('THREE.Audio: this Audio has no playback control.')
  43775. var e = this.context.createBufferSource()
  43776. ;(e.buffer = this.source.buffer),
  43777. (e.loop = this.source.loop),
  43778. (e.onended = this.source.onended),
  43779. e.start(0, this.startTime),
  43780. (e.playbackRate.value = this.playbackRate),
  43781. (this.isPlaying = !0),
  43782. (this.source = e),
  43783. this.connect()
  43784. }),
  43785. (n.Audio.prototype.pause = function () {
  43786. return this.hasPlaybackControl === !1 ? void console.warn('THREE.Audio: this Audio has no playback control.') : (this.source.stop(), void (this.startTime = this.context.currentTime))
  43787. }),
  43788. (n.Audio.prototype.stop = function () {
  43789. return this.hasPlaybackControl === !1 ? void console.warn('THREE.Audio: this Audio has no playback control.') : (this.source.stop(), void (this.startTime = 0))
  43790. }),
  43791. (n.Audio.prototype.connect = function () {
  43792. null !== this.filter ? (this.source.connect(this.filter), this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  43793. }),
  43794. (n.Audio.prototype.disconnect = function () {
  43795. null !== this.filter ? (this.source.disconnect(this.filter), this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  43796. }),
  43797. (n.Audio.prototype.getFilter = function () {
  43798. return this.filter
  43799. }),
  43800. (n.Audio.prototype.setFilter = function (e) {
  43801. void 0 === e && (e = null), this.isPlaying === !0 ? (this.disconnect(), (this.filter = e), this.connect()) : (this.filter = e)
  43802. }),
  43803. (n.Audio.prototype.setPlaybackRate = function (e) {
  43804. return this.hasPlaybackControl === !1
  43805. ? void console.warn('THREE.Audio: this Audio has no playback control.')
  43806. : ((this.playbackRate = e), void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  43807. }),
  43808. (n.Audio.prototype.getPlaybackRate = function () {
  43809. return this.playbackRate
  43810. }),
  43811. (n.Audio.prototype.onEnded = function () {
  43812. this.isPlaying = !1
  43813. }),
  43814. (n.Audio.prototype.setLoop = function (e) {
  43815. return this.hasPlaybackControl === !1 ? void console.warn('THREE.Audio: this Audio has no playback control.') : void (this.source.loop = e)
  43816. }),
  43817. (n.Audio.prototype.getLoop = function () {
  43818. return this.hasPlaybackControl === !1 ? (console.warn('THREE.Audio: this Audio has no playback control.'), !1) : this.source.loop
  43819. }),
  43820. (n.Audio.prototype.setVolume = function (e) {
  43821. this.gain.gain.value = e
  43822. }),
  43823. (n.Audio.prototype.getVolume = function () {
  43824. return this.gain.gain.value
  43825. }),
  43826. (n.AudioAnalyser = function (e, t) {
  43827. ;(this.analyser = e.context.createAnalyser()),
  43828. (this.analyser.fftSize = void 0 !== t ? t : 2048),
  43829. (this.data = new Uint8Array(this.analyser.frequencyBinCount)),
  43830. e.getOutput().connect(this.analyser)
  43831. }),
  43832. (n.AudioAnalyser.prototype = {
  43833. constructor: n.AudioAnalyser,
  43834. getData: function () {
  43835. return this.analyser.getByteFrequencyData(this.data), this.data
  43836. }
  43837. }),
  43838. (n.AudioBuffer = function (e) {
  43839. ;(this.context = e), (this.ready = !1), (this.readyCallbacks = [])
  43840. }),
  43841. (n.AudioBuffer.prototype.load = function (e) {
  43842. var t = this,
  43843. i = new XMLHttpRequest()
  43844. return (
  43845. i.open('GET', e, !0),
  43846. (i.responseType = 'arraybuffer'),
  43847. (i.onload = function (e) {
  43848. t.context.decodeAudioData(this.response, function (e) {
  43849. ;(t.buffer = e), (t.ready = !0)
  43850. for (var i = 0; i < t.readyCallbacks.length; i++) t.readyCallbacks[i](t.buffer)
  43851. t.readyCallbacks = []
  43852. })
  43853. }),
  43854. i.send(),
  43855. this
  43856. )
  43857. }),
  43858. (n.AudioBuffer.prototype.onReady = function (e) {
  43859. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  43860. }),
  43861. (n.PositionalAudio = function (e) {
  43862. n.Audio.call(this, e), (this.panner = this.context.createPanner()), this.panner.connect(this.gain)
  43863. }),
  43864. (n.PositionalAudio.prototype = Object.create(n.Audio.prototype)),
  43865. (n.PositionalAudio.prototype.constructor = n.PositionalAudio),
  43866. (n.PositionalAudio.prototype.getOutput = function () {
  43867. return this.panner
  43868. }),
  43869. (n.PositionalAudio.prototype.setRefDistance = function (e) {
  43870. this.panner.refDistance = e
  43871. }),
  43872. (n.PositionalAudio.prototype.getRefDistance = function () {
  43873. return this.panner.refDistance
  43874. }),
  43875. (n.PositionalAudio.prototype.setRolloffFactor = function (e) {
  43876. this.panner.rolloffFactor = e
  43877. }),
  43878. (n.PositionalAudio.prototype.getRolloffFactor = function () {
  43879. return this.panner.rolloffFactor
  43880. }),
  43881. (n.PositionalAudio.prototype.setDistanceModel = function (e) {
  43882. this.panner.distanceModel = e
  43883. }),
  43884. (n.PositionalAudio.prototype.getDistanceModel = function () {
  43885. return this.panner.distanceModel
  43886. }),
  43887. (n.PositionalAudio.prototype.setMaxDistance = function (e) {
  43888. this.panner.maxDistance = e
  43889. }),
  43890. (n.PositionalAudio.prototype.getMaxDistance = function () {
  43891. return this.panner.maxDistance
  43892. }),
  43893. (n.PositionalAudio.prototype.updateMatrixWorld = (function () {
  43894. var e = new n.Vector3()
  43895. return function (t) {
  43896. n.Object3D.prototype.updateMatrixWorld.call(this, t), e.setFromMatrixPosition(this.matrixWorld), this.panner.setPosition(e.x, e.y, e.z)
  43897. }
  43898. })()),
  43899. (n.AudioListener = function () {
  43900. n.Object3D.call(this),
  43901. (this.type = 'AudioListener'),
  43902. (this.context = new (window.AudioContext || window.webkitAudioContext)()),
  43903. (this.gain = this.context.createGain()),
  43904. this.gain.connect(this.context.destination),
  43905. (this.filter = null)
  43906. }),
  43907. (n.AudioListener.prototype = Object.create(n.Object3D.prototype)),
  43908. (n.AudioListener.prototype.constructor = n.AudioListener),
  43909. (n.AudioListener.prototype.getInput = function () {
  43910. return this.gain
  43911. }),
  43912. (n.AudioListener.prototype.removeFilter = function () {
  43913. null !== this.filter && (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination), this.gain.connect(this.context.destination), (this.filter = null))
  43914. }),
  43915. (n.AudioListener.prototype.setFilter = function (e) {
  43916. null !== this.filter ? (this.gain.disconnect(this.filter), this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  43917. (this.filter = e),
  43918. this.gain.connect(this.filter),
  43919. this.filter.connect(this.context.destination)
  43920. }),
  43921. (n.AudioListener.prototype.getFilter = function () {
  43922. return this.filter
  43923. }),
  43924. (n.AudioListener.prototype.setMasterVolume = function (e) {
  43925. this.gain.gain.value = e
  43926. }),
  43927. (n.AudioListener.prototype.getMasterVolume = function () {
  43928. return this.gain.gain.value
  43929. }),
  43930. (n.AudioListener.prototype.updateMatrixWorld = (function () {
  43931. var e = new n.Vector3(),
  43932. t = new n.Quaternion(),
  43933. i = new n.Vector3(),
  43934. r = new n.Vector3()
  43935. return function (o) {
  43936. n.Object3D.prototype.updateMatrixWorld.call(this, o)
  43937. var a = this.context.listener,
  43938. s = this.up
  43939. this.matrixWorld.decompose(e, t, i), r.set(0, 0, -1).applyQuaternion(t), a.setPosition(e.x, e.y, e.z), a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  43940. }
  43941. })()),
  43942. (n.Camera = function () {
  43943. n.Object3D.call(this), (this.type = 'Camera'), (this.matrixWorldInverse = new n.Matrix4()), (this.projectionMatrix = new n.Matrix4())
  43944. }),
  43945. (n.Camera.prototype = Object.create(n.Object3D.prototype)),
  43946. (n.Camera.prototype.constructor = n.Camera),
  43947. (n.Camera.prototype.getWorldDirection = (function () {
  43948. var e = new n.Quaternion()
  43949. return function (t) {
  43950. var i = t || new n.Vector3()
  43951. return this.getWorldQuaternion(e), i.set(0, 0, -1).applyQuaternion(e)
  43952. }
  43953. })()),
  43954. (n.Camera.prototype.lookAt = (function () {
  43955. var e = new n.Matrix4()
  43956. return function (t) {
  43957. e.lookAt(this.position, t, this.up), this.quaternion.setFromRotationMatrix(e)
  43958. }
  43959. })()),
  43960. (n.Camera.prototype.clone = function () {
  43961. return new this.constructor().copy(this)
  43962. }),
  43963. (n.Camera.prototype.copy = function (e) {
  43964. return n.Object3D.prototype.copy.call(this, e), this.matrixWorldInverse.copy(e.matrixWorldInverse), this.projectionMatrix.copy(e.projectionMatrix), this
  43965. }),
  43966. (n.CubeCamera = function (e, t, i) {
  43967. n.Object3D.call(this), (this.type = 'CubeCamera')
  43968. var r = 90,
  43969. o = 1,
  43970. a = new n.PerspectiveCamera(r, o, e, t)
  43971. a.up.set(0, -1, 0), a.lookAt(new n.Vector3(1, 0, 0)), this.add(a)
  43972. var s = new n.PerspectiveCamera(r, o, e, t)
  43973. s.up.set(0, -1, 0), s.lookAt(new n.Vector3(-1, 0, 0)), this.add(s)
  43974. var l = new n.PerspectiveCamera(r, o, e, t)
  43975. l.up.set(0, 0, 1), l.lookAt(new n.Vector3(0, 1, 0)), this.add(l)
  43976. var c = new n.PerspectiveCamera(r, o, e, t)
  43977. c.up.set(0, 0, -1), c.lookAt(new n.Vector3(0, -1, 0)), this.add(c)
  43978. var h = new n.PerspectiveCamera(r, o, e, t)
  43979. h.up.set(0, -1, 0), h.lookAt(new n.Vector3(0, 0, 1)), this.add(h)
  43980. var u = new n.PerspectiveCamera(r, o, e, t)
  43981. u.up.set(0, -1, 0), u.lookAt(new n.Vector3(0, 0, -1)), this.add(u)
  43982. var d = {
  43983. format: n.RGBFormat,
  43984. magFilter: n.LinearFilter,
  43985. minFilter: n.LinearFilter
  43986. }
  43987. ;(this.renderTarget = new n.WebGLRenderTargetCube(i, i, d)),
  43988. (this.updateCubeMap = function (e, t) {
  43989. null === this.parent && this.updateMatrixWorld()
  43990. var i = this.renderTarget,
  43991. n = i.texture.generateMipmaps
  43992. ;(i.texture.generateMipmaps = !1),
  43993. (i.activeCubeFace = 0),
  43994. e.render(t, a, i),
  43995. (i.activeCubeFace = 1),
  43996. e.render(t, s, i),
  43997. (i.activeCubeFace = 2),
  43998. e.render(t, l, i),
  43999. (i.activeCubeFace = 3),
  44000. e.render(t, c, i),
  44001. (i.activeCubeFace = 4),
  44002. e.render(t, h, i),
  44003. (i.texture.generateMipmaps = n),
  44004. (i.activeCubeFace = 5),
  44005. e.render(t, u, i),
  44006. e.setRenderTarget(null)
  44007. })
  44008. }),
  44009. (n.CubeCamera.prototype = Object.create(n.Object3D.prototype)),
  44010. (n.CubeCamera.prototype.constructor = n.CubeCamera),
  44011. (n.OrthographicCamera = function (e, t, i, r, o, a) {
  44012. n.Camera.call(this),
  44013. (this.type = 'OrthographicCamera'),
  44014. (this.zoom = 1),
  44015. (this.left = e),
  44016. (this.right = t),
  44017. (this.top = i),
  44018. (this.bottom = r),
  44019. (this.near = void 0 !== o ? o : 0.1),
  44020. (this.far = void 0 !== a ? a : 2e3),
  44021. this.updateProjectionMatrix()
  44022. }),
  44023. (n.OrthographicCamera.prototype = Object.create(n.Camera.prototype)),
  44024. (n.OrthographicCamera.prototype.constructor = n.OrthographicCamera),
  44025. (n.OrthographicCamera.prototype.updateProjectionMatrix = function () {
  44026. var e = (this.right - this.left) / (2 * this.zoom),
  44027. t = (this.top - this.bottom) / (2 * this.zoom),
  44028. i = (this.right + this.left) / 2,
  44029. n = (this.top + this.bottom) / 2
  44030. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44031. }),
  44032. (n.OrthographicCamera.prototype.copy = function (e) {
  44033. return (
  44034. n.Camera.prototype.copy.call(this, e),
  44035. (this.left = e.left),
  44036. (this.right = e.right),
  44037. (this.top = e.top),
  44038. (this.bottom = e.bottom),
  44039. (this.near = e.near),
  44040. (this.far = e.far),
  44041. (this.zoom = e.zoom),
  44042. this
  44043. )
  44044. }),
  44045. (n.OrthographicCamera.prototype.toJSON = function (e) {
  44046. var t = n.Object3D.prototype.toJSON.call(this, e)
  44047. return (
  44048. (t.object.zoom = this.zoom),
  44049. (t.object.left = this.left),
  44050. (t.object.right = this.right),
  44051. (t.object.top = this.top),
  44052. (t.object.bottom = this.bottom),
  44053. (t.object.near = this.near),
  44054. (t.object.far = this.far),
  44055. t
  44056. )
  44057. }),
  44058. (n.PerspectiveCamera = function (e, t, i, r) {
  44059. n.Camera.call(this),
  44060. (this.type = 'PerspectiveCamera'),
  44061. (this.focalLength = 10),
  44062. (this.zoom = 1),
  44063. (this.fov = void 0 !== e ? e : 50),
  44064. (this.aspect = void 0 !== t ? t : 1),
  44065. (this.near = void 0 !== i ? i : 0.1),
  44066. (this.far = void 0 !== r ? r : 2e3),
  44067. this.updateProjectionMatrix()
  44068. }),
  44069. (n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype)),
  44070. (n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera),
  44071. (n.PerspectiveCamera.prototype.setLens = function (e, t) {
  44072. void 0 === t && (t = 24), (this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e)))), this.updateProjectionMatrix()
  44073. }),
  44074. (n.PerspectiveCamera.prototype.setViewOffset = function (e, t, i, n, r, o) {
  44075. ;(this.fullWidth = e), (this.fullHeight = t), (this.x = i), (this.y = n), (this.width = r), (this.height = o), this.updateProjectionMatrix()
  44076. }),
  44077. (n.PerspectiveCamera.prototype.updateProjectionMatrix = function () {
  44078. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(0.5 * n.Math.degToRad(this.fov)) / this.zoom))
  44079. if (this.fullWidth) {
  44080. var t = this.fullWidth / this.fullHeight,
  44081. i = Math.tan(n.Math.degToRad(0.5 * e)) * this.near,
  44082. r = -i,
  44083. o = t * r,
  44084. a = t * i,
  44085. s = Math.abs(a - o),
  44086. l = Math.abs(i - r)
  44087. this.projectionMatrix.makeFrustum(
  44088. o + (this.x * s) / this.fullWidth,
  44089. o + ((this.x + this.width) * s) / this.fullWidth,
  44090. i - ((this.y + this.height) * l) / this.fullHeight,
  44091. i - (this.y * l) / this.fullHeight,
  44092. this.near,
  44093. this.far
  44094. )
  44095. } else this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  44096. }),
  44097. (n.PerspectiveCamera.prototype.copy = function (e) {
  44098. return (
  44099. n.Camera.prototype.copy.call(this, e),
  44100. (this.focalLength = e.focalLength),
  44101. (this.zoom = e.zoom),
  44102. (this.fov = e.fov),
  44103. (this.aspect = e.aspect),
  44104. (this.near = e.near),
  44105. (this.far = e.far),
  44106. this
  44107. )
  44108. }),
  44109. (n.PerspectiveCamera.prototype.toJSON = function (e) {
  44110. var t = n.Object3D.prototype.toJSON.call(this, e)
  44111. return (
  44112. (t.object.focalLength = this.focalLength),
  44113. (t.object.zoom = this.zoom),
  44114. (t.object.fov = this.fov),
  44115. (t.object.aspect = this.aspect),
  44116. (t.object.near = this.near),
  44117. (t.object.far = this.far),
  44118. t
  44119. )
  44120. }),
  44121. (n.StereoCamera = function () {
  44122. ;(this.type = 'StereoCamera'),
  44123. (this.aspect = 1),
  44124. (this.cameraL = new n.PerspectiveCamera()),
  44125. this.cameraL.layers.enable(1),
  44126. (this.cameraL.matrixAutoUpdate = !1),
  44127. (this.cameraR = new n.PerspectiveCamera()),
  44128. this.cameraR.layers.enable(2),
  44129. (this.cameraR.matrixAutoUpdate = !1)
  44130. }),
  44131. (n.StereoCamera.prototype = {
  44132. constructor: n.StereoCamera,
  44133. update: (function () {
  44134. var e,
  44135. t,
  44136. i,
  44137. r,
  44138. o,
  44139. a = new n.Matrix4(),
  44140. s = new n.Matrix4()
  44141. return function (l) {
  44142. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far
  44143. if (c) {
  44144. ;(e = l.focalLength), (t = l.fov), (i = l.aspect * this.aspect), (r = l.near), (o = l.far)
  44145. var h,
  44146. u,
  44147. d = l.projectionMatrix.clone(),
  44148. p = 0.032,
  44149. f = (p * r) / e,
  44150. g = r * Math.tan(n.Math.degToRad(0.5 * t))
  44151. ;(s.elements[12] = -p),
  44152. (a.elements[12] = p),
  44153. (h = -g * i + f),
  44154. (u = g * i + f),
  44155. (d.elements[0] = (2 * r) / (u - h)),
  44156. (d.elements[8] = (u + h) / (u - h)),
  44157. this.cameraL.projectionMatrix.copy(d),
  44158. (h = -g * i - f),
  44159. (u = g * i - f),
  44160. (d.elements[0] = (2 * r) / (u - h)),
  44161. (d.elements[8] = (u + h) / (u - h)),
  44162. this.cameraR.projectionMatrix.copy(d)
  44163. }
  44164. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s), this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  44165. }
  44166. })()
  44167. }),
  44168. (n.Light = function (e, t) {
  44169. n.Object3D.call(this), (this.type = 'Light'), (this.color = new n.Color(e)), (this.intensity = void 0 !== t ? t : 1), (this.receiveShadow = void 0)
  44170. }),
  44171. (n.Light.prototype = Object.create(n.Object3D.prototype)),
  44172. (n.Light.prototype.constructor = n.Light),
  44173. (n.Light.prototype.copy = function (e) {
  44174. return n.Object3D.prototype.copy.call(this, e), this.color.copy(e.color), (this.intensity = e.intensity), this
  44175. }),
  44176. (n.Light.prototype.toJSON = function (e) {
  44177. var t = n.Object3D.prototype.toJSON.call(this, e)
  44178. return (
  44179. (t.object.color = this.color.getHex()),
  44180. (t.object.intensity = this.intensity),
  44181. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  44182. void 0 !== this.distance && (t.object.distance = this.distance),
  44183. void 0 !== this.angle && (t.object.angle = this.angle),
  44184. void 0 !== this.decay && (t.object.decay = this.decay),
  44185. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  44186. t
  44187. )
  44188. }),
  44189. (n.LightShadow = function (e) {
  44190. ;(this.camera = e), (this.bias = 0), (this.radius = 1), (this.mapSize = new n.Vector2(512, 512)), (this.map = null), (this.matrix = new n.Matrix4())
  44191. }),
  44192. (n.LightShadow.prototype = {
  44193. constructor: n.LightShadow,
  44194. copy: function (e) {
  44195. return (this.camera = e.camera.clone()), (this.bias = e.bias), (this.radius = e.radius), this.mapSize.copy(e.mapSize), this
  44196. },
  44197. clone: function () {
  44198. return new this.constructor().copy(this)
  44199. }
  44200. }),
  44201. (n.AmbientLight = function (e, t) {
  44202. n.Light.call(this, e, t), (this.type = 'AmbientLight'), (this.castShadow = void 0)
  44203. }),
  44204. (n.AmbientLight.prototype = Object.create(n.Light.prototype)),
  44205. (n.AmbientLight.prototype.constructor = n.AmbientLight),
  44206. (n.DirectionalLight = function (e, t) {
  44207. n.Light.call(this, e, t),
  44208. (this.type = 'DirectionalLight'),
  44209. this.position.set(0, 1, 0),
  44210. this.updateMatrix(),
  44211. (this.target = new n.Object3D()),
  44212. (this.shadow = new n.LightShadow(new n.OrthographicCamera(-5, 5, 5, -5, 0.5, 500)))
  44213. }),
  44214. (n.DirectionalLight.prototype = Object.create(n.Light.prototype)),
  44215. (n.DirectionalLight.prototype.constructor = n.DirectionalLight),
  44216. (n.DirectionalLight.prototype.copy = function (e) {
  44217. return n.Light.prototype.copy.call(this, e), (this.target = e.target.clone()), (this.shadow = e.shadow.clone()), this
  44218. }),
  44219. (n.HemisphereLight = function (e, t, i) {
  44220. n.Light.call(this, e, i), (this.type = 'HemisphereLight'), (this.castShadow = void 0), this.position.set(0, 1, 0), this.updateMatrix(), (this.groundColor = new n.Color(t))
  44221. }),
  44222. (n.HemisphereLight.prototype = Object.create(n.Light.prototype)),
  44223. (n.HemisphereLight.prototype.constructor = n.HemisphereLight),
  44224. (n.HemisphereLight.prototype.copy = function (e) {
  44225. return n.Light.prototype.copy.call(this, e), this.groundColor.copy(e.groundColor), this
  44226. }),
  44227. (n.PointLight = function (e, t, i, r) {
  44228. n.Light.call(this, e, t),
  44229. (this.type = 'PointLight'),
  44230. (this.distance = void 0 !== i ? i : 0),
  44231. (this.decay = void 0 !== r ? r : 1),
  44232. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(90, 1, 0.5, 500)))
  44233. }),
  44234. (n.PointLight.prototype = Object.create(n.Light.prototype)),
  44235. (n.PointLight.prototype.constructor = n.PointLight),
  44236. Object.defineProperty(n.PointLight.prototype, 'power', {
  44237. get: function () {
  44238. return 4 * this.intensity * Math.PI
  44239. },
  44240. set: function (e) {
  44241. this.intensity = e / (4 * Math.PI)
  44242. }
  44243. }),
  44244. (n.PointLight.prototype.copy = function (e) {
  44245. return n.Light.prototype.copy.call(this, e), (this.distance = e.distance), (this.decay = e.decay), (this.shadow = e.shadow.clone()), this
  44246. }),
  44247. (n.SpotLight = function (e, t, i, r, o, a) {
  44248. n.Light.call(this, e, t),
  44249. (this.type = 'SpotLight'),
  44250. this.position.set(0, 1, 0),
  44251. this.updateMatrix(),
  44252. (this.target = new n.Object3D()),
  44253. (this.distance = void 0 !== i ? i : 0),
  44254. (this.angle = void 0 !== r ? r : Math.PI / 3),
  44255. (this.penumbra = void 0 !== o ? o : 0),
  44256. (this.decay = void 0 !== a ? a : 1),
  44257. (this.shadow = new n.LightShadow(new n.PerspectiveCamera(50, 1, 0.5, 500)))
  44258. }),
  44259. (n.SpotLight.prototype = Object.create(n.Light.prototype)),
  44260. (n.SpotLight.prototype.constructor = n.SpotLight),
  44261. Object.defineProperty(n.SpotLight.prototype, 'power', {
  44262. get: function () {
  44263. return this.intensity * Math.PI
  44264. },
  44265. set: function (e) {
  44266. this.intensity = e / Math.PI
  44267. }
  44268. }),
  44269. (n.SpotLight.prototype.copy = function (e) {
  44270. return (
  44271. n.Light.prototype.copy.call(this, e),
  44272. (this.distance = e.distance),
  44273. (this.angle = e.angle),
  44274. (this.penumbra = e.penumbra),
  44275. (this.decay = e.decay),
  44276. (this.target = e.target.clone()),
  44277. (this.shadow = e.shadow.clone()),
  44278. this
  44279. )
  44280. }),
  44281. (n.Cache = {
  44282. enabled: !1,
  44283. files: {},
  44284. add: function (e, t) {
  44285. this.enabled !== !1 && (this.files[e] = t)
  44286. },
  44287. get: function (e) {
  44288. if (this.enabled !== !1) return this.files[e]
  44289. },
  44290. remove: function (e) {
  44291. delete this.files[e]
  44292. },
  44293. clear: function () {
  44294. this.files = {}
  44295. }
  44296. }),
  44297. (n.Loader = function () {
  44298. ;(this.onLoadStart = function () {}), (this.onLoadProgress = function () {}), (this.onLoadComplete = function () {})
  44299. }),
  44300. (n.Loader.prototype = {
  44301. constructor: n.Loader,
  44302. crossOrigin: void 0,
  44303. extractUrlBase: function (e) {
  44304. var t = e.split('/')
  44305. return 1 === t.length ? './' : (t.pop(), t.join('/') + '/')
  44306. },
  44307. initMaterials: function (e, t, i) {
  44308. for (var n = [], r = 0; r < e.length; ++r) n[r] = this.createMaterial(e[r], t, i)
  44309. return n
  44310. },
  44311. createMaterial: (function () {
  44312. var e, t, i
  44313. return function (r, o, a) {
  44314. function s(e, i, r, s, c) {
  44315. var h,
  44316. u = o + e,
  44317. d = n.Loader.Handlers.get(u)
  44318. null !== d ? (h = d.load(u)) : (t.setCrossOrigin(a), (h = t.load(u))),
  44319. void 0 !== i && (h.repeat.fromArray(i), 1 !== i[0] && (h.wrapS = n.RepeatWrapping), 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  44320. void 0 !== r && h.offset.fromArray(r),
  44321. void 0 !== s &&
  44322. ('repeat' === s[0] && (h.wrapS = n.RepeatWrapping),
  44323. 'mirror' === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  44324. 'repeat' === s[1] && (h.wrapT = n.RepeatWrapping),
  44325. 'mirror' === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  44326. void 0 !== c && (h.anisotropy = c)
  44327. var p = n.Math.generateUUID()
  44328. return (l[p] = h), p
  44329. }
  44330. void 0 === e && (e = new n.Color()), void 0 === t && (t = new n.TextureLoader()), void 0 === i && (i = new n.MaterialLoader())
  44331. var l = {},
  44332. c = {
  44333. uuid: n.Math.generateUUID(),
  44334. type: 'MeshLambertMaterial'
  44335. }
  44336. for (var h in r) {
  44337. var u = r[h]
  44338. switch (h) {
  44339. case 'DbgColor':
  44340. case 'DbgIndex':
  44341. case 'opticalDensity':
  44342. case 'illumination':
  44343. break
  44344. case 'DbgName':
  44345. c.name = u
  44346. break
  44347. case 'blending':
  44348. c.blending = n[u]
  44349. break
  44350. case 'colorAmbient':
  44351. case 'mapAmbient':
  44352. console.warn('THREE.Loader.createMaterial:', h, 'is no longer supported.')
  44353. break
  44354. case 'colorDiffuse':
  44355. c.color = e.fromArray(u).getHex()
  44356. break
  44357. case 'colorSpecular':
  44358. c.specular = e.fromArray(u).getHex()
  44359. break
  44360. case 'colorEmissive':
  44361. c.emissive = e.fromArray(u).getHex()
  44362. break
  44363. case 'specularCoef':
  44364. c.shininess = u
  44365. break
  44366. case 'shading':
  44367. 'basic' === u.toLowerCase() && (c.type = 'MeshBasicMaterial'), 'phong' === u.toLowerCase() && (c.type = 'MeshPhongMaterial')
  44368. break
  44369. case 'mapDiffuse':
  44370. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy)
  44371. break
  44372. case 'mapDiffuseRepeat':
  44373. case 'mapDiffuseOffset':
  44374. case 'mapDiffuseWrap':
  44375. case 'mapDiffuseAnisotropy':
  44376. break
  44377. case 'mapLight':
  44378. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy)
  44379. break
  44380. case 'mapLightRepeat':
  44381. case 'mapLightOffset':
  44382. case 'mapLightWrap':
  44383. case 'mapLightAnisotropy':
  44384. break
  44385. case 'mapAO':
  44386. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy)
  44387. break
  44388. case 'mapAORepeat':
  44389. case 'mapAOOffset':
  44390. case 'mapAOWrap':
  44391. case 'mapAOAnisotropy':
  44392. break
  44393. case 'mapBump':
  44394. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy)
  44395. break
  44396. case 'mapBumpScale':
  44397. c.bumpScale = u
  44398. break
  44399. case 'mapBumpRepeat':
  44400. case 'mapBumpOffset':
  44401. case 'mapBumpWrap':
  44402. case 'mapBumpAnisotropy':
  44403. break
  44404. case 'mapNormal':
  44405. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy)
  44406. break
  44407. case 'mapNormalFactor':
  44408. c.normalScale = [u, u]
  44409. break
  44410. case 'mapNormalRepeat':
  44411. case 'mapNormalOffset':
  44412. case 'mapNormalWrap':
  44413. case 'mapNormalAnisotropy':
  44414. break
  44415. case 'mapSpecular':
  44416. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy)
  44417. break
  44418. case 'mapSpecularRepeat':
  44419. case 'mapSpecularOffset':
  44420. case 'mapSpecularWrap':
  44421. case 'mapSpecularAnisotropy':
  44422. break
  44423. case 'mapAlpha':
  44424. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy)
  44425. break
  44426. case 'mapAlphaRepeat':
  44427. case 'mapAlphaOffset':
  44428. case 'mapAlphaWrap':
  44429. case 'mapAlphaAnisotropy':
  44430. break
  44431. case 'flipSided':
  44432. c.side = n.BackSide
  44433. break
  44434. case 'doubleSided':
  44435. c.side = n.DoubleSide
  44436. break
  44437. case 'transparency':
  44438. console.warn('THREE.Loader.createMaterial: transparency has been renamed to opacity'), (c.opacity = u)
  44439. break
  44440. case 'depthTest':
  44441. case 'depthWrite':
  44442. case 'colorWrite':
  44443. case 'opacity':
  44444. case 'reflectivity':
  44445. case 'transparent':
  44446. case 'visible':
  44447. case 'wireframe':
  44448. c[h] = u
  44449. break
  44450. case 'vertexColors':
  44451. u === !0 && (c.vertexColors = n.VertexColors), 'face' === u && (c.vertexColors = n.FaceColors)
  44452. break
  44453. default:
  44454. console.error('THREE.Loader.createMaterial: Unsupported', h, u)
  44455. }
  44456. }
  44457. return 'MeshBasicMaterial' === c.type && delete c.emissive, 'MeshPhongMaterial' !== c.type && delete c.specular, c.opacity < 1 && (c.transparent = !0), i.setTextures(l), i.parse(c)
  44458. }
  44459. })()
  44460. }),
  44461. (n.Loader.Handlers = {
  44462. handlers: [],
  44463. add: function (e, t) {
  44464. this.handlers.push(e, t)
  44465. },
  44466. get: function (e) {
  44467. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  44468. var r = t[i],
  44469. o = t[i + 1]
  44470. if (r.test(e)) return o
  44471. }
  44472. return null
  44473. }
  44474. }),
  44475. (n.XHRLoader = function (e) {
  44476. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  44477. }),
  44478. (n.XHRLoader.prototype = {
  44479. constructor: n.XHRLoader,
  44480. load: function (e, t, i, r) {
  44481. void 0 !== this.path && (e = this.path + e)
  44482. var o = this,
  44483. a = n.Cache.get(e)
  44484. if (void 0 !== a)
  44485. return (
  44486. t &&
  44487. setTimeout(function () {
  44488. t(a)
  44489. }, 0),
  44490. a
  44491. )
  44492. var s = new XMLHttpRequest()
  44493. return (
  44494. s.overrideMimeType('text/plain'),
  44495. s.open('GET', e, !0),
  44496. s.addEventListener(
  44497. 'load',
  44498. function (i) {
  44499. var a = i.target.response
  44500. n.Cache.add(e, a),
  44501. 200 === this.status
  44502. ? (t && t(a), o.manager.itemEnd(e))
  44503. : 0 === this.status
  44504. ? (console.warn('THREE.XHRLoader: HTTP Status 0 received.'), t && t(a), o.manager.itemEnd(e))
  44505. : (r && r(i), o.manager.itemError(e))
  44506. },
  44507. !1
  44508. ),
  44509. void 0 !== i &&
  44510. s.addEventListener(
  44511. 'progress',
  44512. function (e) {
  44513. i(e)
  44514. },
  44515. !1
  44516. ),
  44517. s.addEventListener(
  44518. 'error',
  44519. function (t) {
  44520. r && r(t), o.manager.itemError(e)
  44521. },
  44522. !1
  44523. ),
  44524. void 0 !== this.responseType && (s.responseType = this.responseType),
  44525. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  44526. s.send(null),
  44527. o.manager.itemStart(e),
  44528. s
  44529. )
  44530. },
  44531. setPath: function (e) {
  44532. this.path = e
  44533. },
  44534. setResponseType: function (e) {
  44535. this.responseType = e
  44536. },
  44537. setWithCredentials: function (e) {
  44538. this.withCredentials = e
  44539. }
  44540. }),
  44541. (n.FontLoader = function (e) {
  44542. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  44543. }),
  44544. (n.FontLoader.prototype = {
  44545. constructor: n.FontLoader,
  44546. load: function (e, t, i, r) {
  44547. var o = new n.XHRLoader(this.manager)
  44548. o.load(
  44549. e,
  44550. function (e) {
  44551. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  44552. },
  44553. i,
  44554. r
  44555. )
  44556. }
  44557. }),
  44558. (n.ImageLoader = function (e) {
  44559. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  44560. }),
  44561. (n.ImageLoader.prototype = {
  44562. constructor: n.ImageLoader,
  44563. load: function (e, t, i, r) {
  44564. void 0 !== this.path && (e = this.path + e)
  44565. var o = this,
  44566. a = n.Cache.get(e)
  44567. if (void 0 !== a)
  44568. return (
  44569. o.manager.itemStart(e),
  44570. t
  44571. ? setTimeout(function () {
  44572. t(a), o.manager.itemEnd(e)
  44573. }, 0)
  44574. : o.manager.itemEnd(e),
  44575. a
  44576. )
  44577. var s = document.createElement('img')
  44578. return (
  44579. s.addEventListener(
  44580. 'load',
  44581. function (i) {
  44582. n.Cache.add(e, this), t && t(this), o.manager.itemEnd(e)
  44583. },
  44584. !1
  44585. ),
  44586. void 0 !== i &&
  44587. s.addEventListener(
  44588. 'progress',
  44589. function (e) {
  44590. i(e)
  44591. },
  44592. !1
  44593. ),
  44594. s.addEventListener(
  44595. 'error',
  44596. function (t) {
  44597. r && r(t), o.manager.itemError(e)
  44598. },
  44599. !1
  44600. ),
  44601. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  44602. o.manager.itemStart(e),
  44603. (s.src = e),
  44604. s
  44605. )
  44606. },
  44607. setCrossOrigin: function (e) {
  44608. this.crossOrigin = e
  44609. },
  44610. setPath: function (e) {
  44611. this.path = e
  44612. }
  44613. }),
  44614. (n.JSONLoader = function (e) {
  44615. 'boolean' == typeof e && (console.warn('THREE.JSONLoader: showStatus parameter has been removed from constructor.'), (e = void 0)),
  44616. (this.manager = void 0 !== e ? e : n.DefaultLoadingManager),
  44617. (this.withCredentials = !1)
  44618. }),
  44619. (n.JSONLoader.prototype = {
  44620. constructor: n.JSONLoader,
  44621. get statusDomElement() {
  44622. return (
  44623. void 0 === this._statusDomElement && (this._statusDomElement = document.createElement('div')),
  44624. console.warn('THREE.JSONLoader: .statusDomElement has been removed.'),
  44625. this._statusDomElement
  44626. )
  44627. },
  44628. load: function (e, t, i, r) {
  44629. var o = this,
  44630. a = this.texturePath && 'string' == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e),
  44631. s = new n.XHRLoader(this.manager)
  44632. s.setWithCredentials(this.withCredentials),
  44633. s.load(
  44634. e,
  44635. function (i) {
  44636. var n = JSON.parse(i),
  44637. r = n.metadata
  44638. if (void 0 !== r) {
  44639. var s = r.type
  44640. if (void 0 !== s) {
  44641. if ('object' === s.toLowerCase()) return void console.error('THREE.JSONLoader: ' + e + ' should be loaded with THREE.ObjectLoader instead.')
  44642. if ('scene' === s.toLowerCase()) return void console.error('THREE.JSONLoader: ' + e + ' should be loaded with THREE.SceneLoader instead.')
  44643. }
  44644. }
  44645. var l = o.parse(n, a)
  44646. t(l.geometry, l.materials)
  44647. },
  44648. i,
  44649. r
  44650. )
  44651. },
  44652. setTexturePath: function (e) {
  44653. this.texturePath = e
  44654. },
  44655. parse: function (e, t) {
  44656. function i(t) {
  44657. function i(e, t) {
  44658. return e & (1 << t)
  44659. }
  44660. var r,
  44661. o,
  44662. a,
  44663. l,
  44664. c,
  44665. h,
  44666. u,
  44667. d,
  44668. p,
  44669. f,
  44670. g,
  44671. m,
  44672. v,
  44673. A,
  44674. y,
  44675. C,
  44676. I,
  44677. E,
  44678. b,
  44679. w,
  44680. _,
  44681. T,
  44682. x,
  44683. S,
  44684. M,
  44685. R,
  44686. P,
  44687. O = e.faces,
  44688. L = e.vertices,
  44689. D = e.normals,
  44690. N = e.colors,
  44691. B = 0
  44692. if (void 0 !== e.uvs) {
  44693. for (r = 0; r < e.uvs.length; r++) e.uvs[r].length && B++
  44694. for (r = 0; r < B; r++) s.faceVertexUvs[r] = []
  44695. }
  44696. for (l = 0, c = L.length; l < c; ) (E = new n.Vector3()), (E.x = L[l++] * t), (E.y = L[l++] * t), (E.z = L[l++] * t), s.vertices.push(E)
  44697. for (l = 0, c = O.length; l < c; )
  44698. if (((f = O[l++]), (g = i(f, 0)), (m = i(f, 1)), (v = i(f, 3)), (A = i(f, 4)), (y = i(f, 5)), (C = i(f, 6)), (I = i(f, 7)), g)) {
  44699. if (
  44700. ((w = new n.Face3()),
  44701. (w.a = O[l]),
  44702. (w.b = O[l + 1]),
  44703. (w.c = O[l + 3]),
  44704. (_ = new n.Face3()),
  44705. (_.a = O[l + 1]),
  44706. (_.b = O[l + 2]),
  44707. (_.c = O[l + 3]),
  44708. (l += 4),
  44709. m && ((p = O[l++]), (w.materialIndex = p), (_.materialIndex = p)),
  44710. (a = s.faces.length),
  44711. v)
  44712. )
  44713. for (r = 0; r < B; r++)
  44714. for (S = e.uvs[r], s.faceVertexUvs[r][a] = [], s.faceVertexUvs[r][a + 1] = [], o = 0; o < 4; o++)
  44715. (d = O[l++]), (R = S[2 * d]), (P = S[2 * d + 1]), (M = new n.Vector2(R, P)), 2 !== o && s.faceVertexUvs[r][a].push(M), 0 !== o && s.faceVertexUvs[r][a + 1].push(M)
  44716. if ((A && ((u = 3 * O[l++]), w.normal.set(D[u++], D[u++], D[u]), _.normal.copy(w.normal)), y))
  44717. for (r = 0; r < 4; r++) (u = 3 * O[l++]), (x = new n.Vector3(D[u++], D[u++], D[u])), 2 !== r && w.vertexNormals.push(x), 0 !== r && _.vertexNormals.push(x)
  44718. if ((C && ((h = O[l++]), (T = N[h]), w.color.setHex(T), _.color.setHex(T)), I))
  44719. for (r = 0; r < 4; r++) (h = O[l++]), (T = N[h]), 2 !== r && w.vertexColors.push(new n.Color(T)), 0 !== r && _.vertexColors.push(new n.Color(T))
  44720. s.faces.push(w), s.faces.push(_)
  44721. } else {
  44722. if (((b = new n.Face3()), (b.a = O[l++]), (b.b = O[l++]), (b.c = O[l++]), m && ((p = O[l++]), (b.materialIndex = p)), (a = s.faces.length), v))
  44723. for (r = 0; r < B; r++)
  44724. for (S = e.uvs[r], s.faceVertexUvs[r][a] = [], o = 0; o < 3; o++) (d = O[l++]), (R = S[2 * d]), (P = S[2 * d + 1]), (M = new n.Vector2(R, P)), s.faceVertexUvs[r][a].push(M)
  44725. if ((A && ((u = 3 * O[l++]), b.normal.set(D[u++], D[u++], D[u])), y)) for (r = 0; r < 3; r++) (u = 3 * O[l++]), (x = new n.Vector3(D[u++], D[u++], D[u])), b.vertexNormals.push(x)
  44726. if ((C && ((h = O[l++]), b.color.setHex(N[h])), I)) for (r = 0; r < 3; r++) (h = O[l++]), b.vertexColors.push(new n.Color(N[h]))
  44727. s.faces.push(b)
  44728. }
  44729. }
  44730. function r() {
  44731. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2
  44732. if (e.skinWeights)
  44733. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  44734. var o = e.skinWeights[i],
  44735. a = t > 1 ? e.skinWeights[i + 1] : 0,
  44736. l = t > 2 ? e.skinWeights[i + 2] : 0,
  44737. c = t > 3 ? e.skinWeights[i + 3] : 0
  44738. s.skinWeights.push(new n.Vector4(o, a, l, c))
  44739. }
  44740. if (e.skinIndices)
  44741. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  44742. var h = e.skinIndices[i],
  44743. u = t > 1 ? e.skinIndices[i + 1] : 0,
  44744. d = t > 2 ? e.skinIndices[i + 2] : 0,
  44745. p = t > 3 ? e.skinIndices[i + 3] : 0
  44746. s.skinIndices.push(new n.Vector4(h, u, d, p))
  44747. }
  44748. ;(s.bones = e.bones),
  44749. s.bones &&
  44750. s.bones.length > 0 &&
  44751. (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) &&
  44752. console.warn(
  44753. 'When skinning, number of vertices (' + s.vertices.length + '), skinIndices (' + s.skinIndices.length + '), and skinWeights (' + s.skinWeights.length + ') should match.'
  44754. )
  44755. }
  44756. function o(t) {
  44757. if (void 0 !== e.morphTargets)
  44758. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  44759. ;(s.morphTargets[i] = {}), (s.morphTargets[i].name = e.morphTargets[i].name), (s.morphTargets[i].vertices = [])
  44760. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  44761. var h = new n.Vector3()
  44762. ;(h.x = a[l] * t), (h.y = a[l + 1] * t), (h.z = a[l + 2] * t), o.push(h)
  44763. }
  44764. }
  44765. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  44766. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.')
  44767. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++) u[i].color.fromArray(d, 3 * i)
  44768. }
  44769. }
  44770. function a() {
  44771. var t = [],
  44772. i = []
  44773. void 0 !== e.animation && i.push(e.animation), void 0 !== e.animations && (e.animations.length ? (i = i.concat(e.animations)) : i.push(e.animations))
  44774. for (var r = 0; r < i.length; r++) {
  44775. var o = n.AnimationClip.parseAnimation(i[r], s.bones)
  44776. o && t.push(o)
  44777. }
  44778. if (s.morphTargets) {
  44779. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10)
  44780. t = t.concat(a)
  44781. }
  44782. t.length > 0 && (s.animations = t)
  44783. }
  44784. var s = new n.Geometry(),
  44785. l = void 0 !== e.scale ? 1 / e.scale : 1
  44786. if ((i(l), r(), o(l), a(), s.computeFaceNormals(), s.computeBoundingSphere(), void 0 === e.materials || 0 === e.materials.length))
  44787. return {
  44788. geometry: s
  44789. }
  44790. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin)
  44791. return {
  44792. geometry: s,
  44793. materials: c
  44794. }
  44795. }
  44796. }),
  44797. (n.LoadingManager = function (e, t, i) {
  44798. var n = this,
  44799. r = !1,
  44800. o = 0,
  44801. a = 0
  44802. ;(this.onStart = void 0),
  44803. (this.onLoad = e),
  44804. (this.onProgress = t),
  44805. (this.onError = i),
  44806. (this.itemStart = function (e) {
  44807. a++, r === !1 && void 0 !== n.onStart && n.onStart(e, o, a), (r = !0)
  44808. }),
  44809. (this.itemEnd = function (e) {
  44810. o++, void 0 !== n.onProgress && n.onProgress(e, o, a), o === a && ((r = !1), void 0 !== n.onLoad && n.onLoad())
  44811. }),
  44812. (this.itemError = function (e) {
  44813. void 0 !== n.onError && n.onError(e)
  44814. })
  44815. }),
  44816. (n.DefaultLoadingManager = new n.LoadingManager()),
  44817. (n.BufferGeometryLoader = function (e) {
  44818. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  44819. }),
  44820. (n.BufferGeometryLoader.prototype = {
  44821. constructor: n.BufferGeometryLoader,
  44822. load: function (e, t, i, r) {
  44823. var o = this,
  44824. a = new n.XHRLoader(o.manager)
  44825. a.load(
  44826. e,
  44827. function (e) {
  44828. t(o.parse(JSON.parse(e)))
  44829. },
  44830. i,
  44831. r
  44832. )
  44833. },
  44834. parse: function (e) {
  44835. var t = new n.BufferGeometry(),
  44836. i = e.data.index,
  44837. r = {
  44838. Int8Array: Int8Array,
  44839. Uint8Array: Uint8Array,
  44840. Uint8ClampedArray: Uint8ClampedArray,
  44841. Int16Array: Int16Array,
  44842. Uint16Array: Uint16Array,
  44843. Int32Array: Int32Array,
  44844. Uint32Array: Uint32Array,
  44845. Float32Array: Float32Array,
  44846. Float64Array: Float64Array
  44847. }
  44848. if (void 0 !== i) {
  44849. var o = new r[i.type](i.array)
  44850. t.setIndex(new n.BufferAttribute(o, 1))
  44851. }
  44852. var a = e.data.attributes
  44853. for (var s in a) {
  44854. var l = a[s],
  44855. o = new r[l.type](l.array)
  44856. t.addAttribute(s, new n.BufferAttribute(o, l.itemSize))
  44857. }
  44858. var c = e.data.groups || e.data.drawcalls || e.data.offsets
  44859. if (void 0 !== c)
  44860. for (var h = 0, u = c.length; h !== u; ++h) {
  44861. var d = c[h]
  44862. t.addGroup(d.start, d.count, d.materialIndex)
  44863. }
  44864. var p = e.data.boundingSphere
  44865. if (void 0 !== p) {
  44866. var f = new n.Vector3()
  44867. void 0 !== p.center && f.fromArray(p.center), (t.boundingSphere = new n.Sphere(f, p.radius))
  44868. }
  44869. return t
  44870. }
  44871. }),
  44872. (n.MaterialLoader = function (e) {
  44873. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.textures = {})
  44874. }),
  44875. (n.MaterialLoader.prototype = {
  44876. constructor: n.MaterialLoader,
  44877. load: function (e, t, i, r) {
  44878. var o = this,
  44879. a = new n.XHRLoader(o.manager)
  44880. a.load(
  44881. e,
  44882. function (e) {
  44883. t(o.parse(JSON.parse(e)))
  44884. },
  44885. i,
  44886. r
  44887. )
  44888. },
  44889. setTextures: function (e) {
  44890. this.textures = e
  44891. },
  44892. getTexture: function (e) {
  44893. var t = this.textures
  44894. return void 0 === t[e] && console.warn('THREE.MaterialLoader: Undefined texture', e), t[e]
  44895. },
  44896. parse: function (e) {
  44897. var t = new n[e.type]()
  44898. if (
  44899. (void 0 !== e.uuid && (t.uuid = e.uuid),
  44900. void 0 !== e.name && (t.name = e.name),
  44901. void 0 !== e.color && t.color.setHex(e.color),
  44902. void 0 !== e.roughness && (t.roughness = e.roughness),
  44903. void 0 !== e.metalness && (t.metalness = e.metalness),
  44904. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  44905. void 0 !== e.specular && t.specular.setHex(e.specular),
  44906. void 0 !== e.shininess && (t.shininess = e.shininess),
  44907. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  44908. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  44909. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  44910. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  44911. void 0 !== e.shading && (t.shading = e.shading),
  44912. void 0 !== e.blending && (t.blending = e.blending),
  44913. void 0 !== e.side && (t.side = e.side),
  44914. void 0 !== e.opacity && (t.opacity = e.opacity),
  44915. void 0 !== e.transparent && (t.transparent = e.transparent),
  44916. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  44917. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  44918. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  44919. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  44920. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  44921. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  44922. void 0 !== e.size && (t.size = e.size),
  44923. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  44924. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  44925. void 0 !== e.alphaMap && ((t.alphaMap = this.getTexture(e.alphaMap)), (t.transparent = !0)),
  44926. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  44927. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  44928. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  44929. void 0 !== e.normalScale)
  44930. ) {
  44931. var i = e.normalScale
  44932. Array.isArray(i) === !1 && (i = [i, i]), (t.normalScale = new n.Vector2().fromArray(i))
  44933. }
  44934. if (
  44935. (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  44936. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  44937. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  44938. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  44939. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  44940. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  44941. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  44942. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  44943. void 0 !== e.envMap && ((t.envMap = this.getTexture(e.envMap)), (t.combine = n.MultiplyOperation)),
  44944. e.reflectivity && (t.reflectivity = e.reflectivity),
  44945. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  44946. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  44947. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  44948. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  44949. void 0 !== e.materials)
  44950. )
  44951. for (var r = 0, o = e.materials.length; r < o; r++) t.materials.push(this.parse(e.materials[r]))
  44952. return t
  44953. }
  44954. }),
  44955. (n.ObjectLoader = function (e) {
  44956. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this.texturePath = '')
  44957. }),
  44958. (n.ObjectLoader.prototype = {
  44959. constructor: n.ObjectLoader,
  44960. load: function (e, t, i, r) {
  44961. '' === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf('/') + 1))
  44962. var o = this,
  44963. a = new n.XHRLoader(o.manager)
  44964. a.load(
  44965. e,
  44966. function (e) {
  44967. o.parse(JSON.parse(e), t)
  44968. },
  44969. i,
  44970. r
  44971. )
  44972. },
  44973. setTexturePath: function (e) {
  44974. this.texturePath = e
  44975. },
  44976. setCrossOrigin: function (e) {
  44977. this.crossOrigin = e
  44978. },
  44979. parse: function (e, t) {
  44980. var i = this.parseGeometries(e.geometries),
  44981. n = this.parseImages(e.images, function () {
  44982. void 0 !== t && t(a)
  44983. }),
  44984. r = this.parseTextures(e.textures, n),
  44985. o = this.parseMaterials(e.materials, r),
  44986. a = this.parseObject(e.object, i, o)
  44987. return e.animations && (a.animations = this.parseAnimations(e.animations)), (void 0 !== e.images && 0 !== e.images.length) || (void 0 !== t && t(a)), a
  44988. },
  44989. parseGeometries: function (e) {
  44990. var t = {}
  44991. if (void 0 !== e)
  44992. for (var i = new n.JSONLoader(), r = new n.BufferGeometryLoader(), o = 0, a = e.length; o < a; o++) {
  44993. var s,
  44994. l = e[o]
  44995. switch (l.type) {
  44996. case 'PlaneGeometry':
  44997. case 'PlaneBufferGeometry':
  44998. s = new n[l.type](l.width, l.height, l.widthSegments, l.heightSegments)
  44999. break
  45000. case 'BoxGeometry':
  45001. case 'BoxBufferGeometry':
  45002. case 'CubeGeometry':
  45003. s = new n[l.type](l.width, l.height, l.depth, l.widthSegments, l.heightSegments, l.depthSegments)
  45004. break
  45005. case 'CircleGeometry':
  45006. case 'CircleBufferGeometry':
  45007. s = new n[l.type](l.radius, l.segments, l.thetaStart, l.thetaLength)
  45008. break
  45009. case 'CylinderGeometry':
  45010. case 'CylinderBufferGeometry':
  45011. s = new n[l.type](l.radiusTop, l.radiusBottom, l.height, l.radialSegments, l.heightSegments, l.openEnded, l.thetaStart, l.thetaLength)
  45012. break
  45013. case 'SphereGeometry':
  45014. case 'SphereBufferGeometry':
  45015. s = new n[l.type](l.radius, l.widthSegments, l.heightSegments, l.phiStart, l.phiLength, l.thetaStart, l.thetaLength)
  45016. break
  45017. case 'DodecahedronGeometry':
  45018. s = new n.DodecahedronGeometry(l.radius, l.detail)
  45019. break
  45020. case 'IcosahedronGeometry':
  45021. s = new n.IcosahedronGeometry(l.radius, l.detail)
  45022. break
  45023. case 'OctahedronGeometry':
  45024. s = new n.OctahedronGeometry(l.radius, l.detail)
  45025. break
  45026. case 'TetrahedronGeometry':
  45027. s = new n.TetrahedronGeometry(l.radius, l.detail)
  45028. break
  45029. case 'RingGeometry':
  45030. case 'RingBufferGeometry':
  45031. s = new n[l.type](l.innerRadius, l.outerRadius, l.thetaSegments, l.phiSegments, l.thetaStart, l.thetaLength)
  45032. break
  45033. case 'TorusGeometry':
  45034. case 'TorusBufferGeometry':
  45035. s = new n[l.type](l.radius, l.tube, l.radialSegments, l.tubularSegments, l.arc)
  45036. break
  45037. case 'TorusKnotGeometry':
  45038. case 'TorusKnotBufferGeometry':
  45039. s = new n[l.type](l.radius, l.tube, l.tubularSegments, l.radialSegments, l.p, l.q)
  45040. break
  45041. case 'LatheGeometry':
  45042. s = new n.LatheGeometry(l.points, l.segments, l.phiStart, l.phiLength)
  45043. break
  45044. case 'BufferGeometry':
  45045. s = r.parse(l)
  45046. break
  45047. case 'Geometry':
  45048. s = i.parse(l.data, this.texturePath).geometry
  45049. break
  45050. default:
  45051. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"')
  45052. continue
  45053. }
  45054. ;(s.uuid = l.uuid), void 0 !== l.name && (s.name = l.name), (t[l.uuid] = s)
  45055. }
  45056. return t
  45057. },
  45058. parseMaterials: function (e, t) {
  45059. var i = {}
  45060. if (void 0 !== e) {
  45061. var r = new n.MaterialLoader()
  45062. r.setTextures(t)
  45063. for (var o = 0, a = e.length; o < a; o++) {
  45064. var s = r.parse(e[o])
  45065. i[s.uuid] = s
  45066. }
  45067. }
  45068. return i
  45069. },
  45070. parseAnimations: function (e) {
  45071. for (var t = [], i = 0; i < e.length; i++) {
  45072. var r = n.AnimationClip.parse(e[i])
  45073. t.push(r)
  45074. }
  45075. return t
  45076. },
  45077. parseImages: function (e, t) {
  45078. function i(e) {
  45079. return (
  45080. r.manager.itemStart(e),
  45081. s.load(e, function () {
  45082. r.manager.itemEnd(e)
  45083. })
  45084. )
  45085. }
  45086. var r = this,
  45087. o = {}
  45088. if (void 0 !== e && e.length > 0) {
  45089. var a = new n.LoadingManager(t),
  45090. s = new n.ImageLoader(a)
  45091. s.setCrossOrigin(this.crossOrigin)
  45092. for (var l = 0, c = e.length; l < c; l++) {
  45093. var h = e[l],
  45094. u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url
  45095. o[h.uuid] = i(u)
  45096. }
  45097. }
  45098. return o
  45099. },
  45100. parseTextures: function (e, t) {
  45101. function i(e) {
  45102. return 'number' == typeof e ? e : (console.warn('THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', e), n[e])
  45103. }
  45104. var r = {}
  45105. if (void 0 !== e)
  45106. for (var o = 0, a = e.length; o < a; o++) {
  45107. var s = e[o]
  45108. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid), void 0 === t[s.image] && console.warn('THREE.ObjectLoader: Undefined image', s.image)
  45109. var l = new n.Texture(t[s.image])
  45110. ;(l.needsUpdate = !0),
  45111. (l.uuid = s.uuid),
  45112. void 0 !== s.name && (l.name = s.name),
  45113. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  45114. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0], s.offset[1])),
  45115. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0], s.repeat[1])),
  45116. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  45117. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  45118. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  45119. Array.isArray(s.wrap) && ((l.wrapS = i(s.wrap[0])), (l.wrapT = i(s.wrap[1]))),
  45120. (r[s.uuid] = l)
  45121. }
  45122. return r
  45123. },
  45124. parseObject: (function () {
  45125. var e = new n.Matrix4()
  45126. return function (t, i, r) {
  45127. function o(e) {
  45128. return void 0 === i[e] && console.warn('THREE.ObjectLoader: Undefined geometry', e), i[e]
  45129. }
  45130. function a(e) {
  45131. if (void 0 !== e) return void 0 === r[e] && console.warn('THREE.ObjectLoader: Undefined material', e), r[e]
  45132. }
  45133. var s
  45134. switch (t.type) {
  45135. case 'Scene':
  45136. s = new n.Scene()
  45137. break
  45138. case 'PerspectiveCamera':
  45139. s = new n.PerspectiveCamera(t.fov, t.aspect, t.near, t.far)
  45140. break
  45141. case 'OrthographicCamera':
  45142. s = new n.OrthographicCamera(t.left, t.right, t.top, t.bottom, t.near, t.far)
  45143. break
  45144. case 'AmbientLight':
  45145. s = new n.AmbientLight(t.color, t.intensity)
  45146. break
  45147. case 'DirectionalLight':
  45148. s = new n.DirectionalLight(t.color, t.intensity)
  45149. break
  45150. case 'PointLight':
  45151. s = new n.PointLight(t.color, t.intensity, t.distance, t.decay)
  45152. break
  45153. case 'SpotLight':
  45154. s = new n.SpotLight(t.color, t.intensity, t.distance, t.angle, t.penumbra, t.decay)
  45155. break
  45156. case 'HemisphereLight':
  45157. s = new n.HemisphereLight(t.color, t.groundColor, t.intensity)
  45158. break
  45159. case 'Mesh':
  45160. var l = o(t.geometry),
  45161. c = a(t.material)
  45162. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l, c) : new n.Mesh(l, c)
  45163. break
  45164. case 'LOD':
  45165. s = new n.LOD()
  45166. break
  45167. case 'Line':
  45168. s = new n.Line(o(t.geometry), a(t.material), t.mode)
  45169. break
  45170. case 'PointCloud':
  45171. case 'Points':
  45172. s = new n.Points(o(t.geometry), a(t.material))
  45173. break
  45174. case 'Sprite':
  45175. s = new n.Sprite(a(t.material))
  45176. break
  45177. case 'Group':
  45178. s = new n.Group()
  45179. break
  45180. default:
  45181. s = new n.Object3D()
  45182. }
  45183. if (
  45184. ((s.uuid = t.uuid),
  45185. void 0 !== t.name && (s.name = t.name),
  45186. void 0 !== t.matrix
  45187. ? (e.fromArray(t.matrix), e.decompose(s.position, s.quaternion, s.scale))
  45188. : (void 0 !== t.position && s.position.fromArray(t.position), void 0 !== t.rotation && s.rotation.fromArray(t.rotation), void 0 !== t.scale && s.scale.fromArray(t.scale)),
  45189. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  45190. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  45191. void 0 !== t.visible && (s.visible = t.visible),
  45192. void 0 !== t.userData && (s.userData = t.userData),
  45193. void 0 !== t.children)
  45194. )
  45195. for (var h in t.children) s.add(this.parseObject(t.children[h], i, r))
  45196. if ('LOD' === t.type)
  45197. for (var u = t.levels, d = 0; d < u.length; d++) {
  45198. var p = u[d],
  45199. h = s.getObjectByProperty('uuid', p.object)
  45200. void 0 !== h && s.addLevel(h, p.distance)
  45201. }
  45202. return s
  45203. }
  45204. })()
  45205. }),
  45206. (n.TextureLoader = function (e) {
  45207. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45208. }),
  45209. (n.TextureLoader.prototype = {
  45210. constructor: n.TextureLoader,
  45211. load: function (e, t, i, r) {
  45212. var o = new n.Texture(),
  45213. a = new n.ImageLoader(this.manager)
  45214. return (
  45215. a.setCrossOrigin(this.crossOrigin),
  45216. a.setPath(this.path),
  45217. a.load(
  45218. e,
  45219. function (e) {
  45220. ;(o.image = e), (o.needsUpdate = !0), void 0 !== t && t(o)
  45221. },
  45222. i,
  45223. r
  45224. ),
  45225. o
  45226. )
  45227. },
  45228. setCrossOrigin: function (e) {
  45229. this.crossOrigin = e
  45230. },
  45231. setPath: function (e) {
  45232. this.path = e
  45233. }
  45234. }),
  45235. (n.CubeTextureLoader = function (e) {
  45236. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45237. }),
  45238. (n.CubeTextureLoader.prototype = {
  45239. constructor: n.CubeTextureLoader,
  45240. load: function (e, t, i, r) {
  45241. function o(i) {
  45242. s.load(
  45243. e[i],
  45244. function (e) {
  45245. ;(a.images[i] = e), l++, 6 === l && ((a.needsUpdate = !0), t && t(a))
  45246. },
  45247. void 0,
  45248. r
  45249. )
  45250. }
  45251. var a = new n.CubeTexture(),
  45252. s = new n.ImageLoader(this.manager)
  45253. s.setCrossOrigin(this.crossOrigin), s.setPath(this.path)
  45254. for (var l = 0, c = 0; c < e.length; ++c) o(c)
  45255. return a
  45256. },
  45257. setCrossOrigin: function (e) {
  45258. this.crossOrigin = e
  45259. },
  45260. setPath: function (e) {
  45261. this.path = e
  45262. }
  45263. }),
  45264. (n.DataTextureLoader = n.BinaryTextureLoader =
  45265. function (e) {
  45266. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null)
  45267. }),
  45268. (n.BinaryTextureLoader.prototype = {
  45269. constructor: n.BinaryTextureLoader,
  45270. load: function (e, t, i, r) {
  45271. var o = this,
  45272. a = new n.DataTexture(),
  45273. s = new n.XHRLoader(this.manager)
  45274. return (
  45275. s.setResponseType('arraybuffer'),
  45276. s.load(
  45277. e,
  45278. function (e) {
  45279. var i = o._parser(e)
  45280. i &&
  45281. (void 0 !== i.image ? (a.image = i.image) : void 0 !== i.data && ((a.image.width = i.width), (a.image.height = i.height), (a.image.data = i.data)),
  45282. (a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping),
  45283. (a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping),
  45284. (a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter),
  45285. (a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter),
  45286. (a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1),
  45287. void 0 !== i.format && (a.format = i.format),
  45288. void 0 !== i.type && (a.type = i.type),
  45289. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  45290. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  45291. (a.needsUpdate = !0),
  45292. t && t(a, i))
  45293. },
  45294. i,
  45295. r
  45296. ),
  45297. a
  45298. )
  45299. }
  45300. }),
  45301. (n.CompressedTextureLoader = function (e) {
  45302. ;(this.manager = void 0 !== e ? e : n.DefaultLoadingManager), (this._parser = null)
  45303. })
  45304. n.CompressedTextureLoader.prototype = {
  45305. constructor: n.CompressedTextureLoader,
  45306. load: function (e, t, i, r) {
  45307. function o(o) {
  45308. c.load(
  45309. e[o],
  45310. function (e) {
  45311. var i = a._parser(e, !0)
  45312. ;(s[o] = {
  45313. width: i.width,
  45314. height: i.height,
  45315. format: i.format,
  45316. mipmaps: i.mipmaps
  45317. }),
  45318. (h += 1),
  45319. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter), (l.format = i.format), (l.needsUpdate = !0), t && t(l))
  45320. },
  45321. i,
  45322. r
  45323. )
  45324. }
  45325. var a = this,
  45326. s = [],
  45327. l = new n.CompressedTexture()
  45328. l.image = s
  45329. var c = new n.XHRLoader(this.manager)
  45330. if ((c.setPath(this.path), c.setResponseType('arraybuffer'), Array.isArray(e))) for (var h = 0, u = 0, d = e.length; u < d; ++u) o(u)
  45331. else
  45332. c.load(
  45333. e,
  45334. function (e) {
  45335. var i = a._parser(e, !0)
  45336. if (i.isCubemap)
  45337. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  45338. s[o] = {
  45339. mipmaps: []
  45340. }
  45341. for (var c = 0; c < i.mipmapCount; c++) s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]), (s[o].format = i.format), (s[o].width = i.width), (s[o].height = i.height)
  45342. }
  45343. else (l.image.width = i.width), (l.image.height = i.height), (l.mipmaps = i.mipmaps)
  45344. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter), (l.format = i.format), (l.needsUpdate = !0), t && t(l)
  45345. },
  45346. i,
  45347. r
  45348. )
  45349. return l
  45350. },
  45351. setPath: function (e) {
  45352. this.path = e
  45353. }
  45354. }
  45355. ;(n.Material = function () {
  45356. Object.defineProperty(this, 'id', {
  45357. value: n.MaterialIdCount++
  45358. }),
  45359. (this.uuid = n.Math.generateUUID()),
  45360. (this.name = ''),
  45361. (this.type = 'Material'),
  45362. (this.side = n.FrontSide),
  45363. (this.opacity = 1),
  45364. (this.transparent = !1),
  45365. (this.blending = n.NormalBlending),
  45366. (this.blendSrc = n.SrcAlphaFactor),
  45367. (this.blendDst = n.OneMinusSrcAlphaFactor),
  45368. (this.blendEquation = n.AddEquation),
  45369. (this.blendSrcAlpha = null),
  45370. (this.blendDstAlpha = null),
  45371. (this.blendEquationAlpha = null),
  45372. (this.depthFunc = n.LessEqualDepth),
  45373. (this.depthTest = !0),
  45374. (this.depthWrite = !0),
  45375. (this.colorWrite = !0),
  45376. (this.precision = null),
  45377. (this.polygonOffset = !1),
  45378. (this.polygonOffsetFactor = 0),
  45379. (this.polygonOffsetUnits = 0),
  45380. (this.alphaTest = 0),
  45381. (this.premultipliedAlpha = !1),
  45382. (this.overdraw = 0),
  45383. (this.visible = !0),
  45384. (this._needsUpdate = !0)
  45385. }),
  45386. (n.Material.prototype = {
  45387. constructor: n.Material,
  45388. get needsUpdate() {
  45389. return this._needsUpdate
  45390. },
  45391. set needsUpdate(e) {
  45392. e === !0 && this.update(), (this._needsUpdate = e)
  45393. },
  45394. setValues: function (e) {
  45395. if (void 0 !== e)
  45396. for (var t in e) {
  45397. var i = e[t]
  45398. if (void 0 !== i) {
  45399. var r = this[t]
  45400. void 0 !== r
  45401. ? r instanceof n.Color
  45402. ? r.set(i)
  45403. : r instanceof n.Vector3 && i instanceof n.Vector3
  45404. ? r.copy(i)
  45405. : 'overdraw' === t
  45406. ? (this[t] = Number(i))
  45407. : (this[t] = i)
  45408. : console.warn('THREE.' + this.type + ": '" + t + "' is not a property of this material.")
  45409. } else console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  45410. }
  45411. },
  45412. toJSON: function (e) {
  45413. function t(e) {
  45414. var t = []
  45415. for (var i in e) {
  45416. var n = e[i]
  45417. delete n.metadata, t.push(n)
  45418. }
  45419. return t
  45420. }
  45421. var i = void 0 === e
  45422. i &&
  45423. (e = {
  45424. textures: {},
  45425. images: {}
  45426. })
  45427. var r = {
  45428. metadata: {
  45429. version: 4.4,
  45430. type: 'Material',
  45431. generator: 'Material.toJSON'
  45432. }
  45433. }
  45434. if (
  45435. ((r.uuid = this.uuid),
  45436. (r.type = this.type),
  45437. '' !== this.name && (r.name = this.name),
  45438. this.color instanceof n.Color && (r.color = this.color.getHex()),
  45439. 0.5 !== this.roughness && (r.roughness = this.roughness),
  45440. 0.5 !== this.metalness && (r.metalness = this.metalness),
  45441. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  45442. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  45443. void 0 !== this.shininess && (r.shininess = this.shininess),
  45444. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  45445. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  45446. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  45447. this.bumpMap instanceof n.Texture && ((r.bumpMap = this.bumpMap.toJSON(e).uuid), (r.bumpScale = this.bumpScale)),
  45448. this.normalMap instanceof n.Texture && ((r.normalMap = this.normalMap.toJSON(e).uuid), (r.normalScale = this.normalScale.toArray())),
  45449. this.displacementMap instanceof n.Texture &&
  45450. ((r.displacementMap = this.displacementMap.toJSON(e).uuid), (r.displacementScale = this.displacementScale), (r.displacementBias = this.displacementBias)),
  45451. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  45452. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  45453. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  45454. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  45455. this.envMap instanceof n.Texture && ((r.envMap = this.envMap.toJSON(e).uuid), (r.reflectivity = this.reflectivity)),
  45456. void 0 !== this.size && (r.size = this.size),
  45457. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  45458. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  45459. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  45460. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  45461. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  45462. this.opacity < 1 && (r.opacity = this.opacity),
  45463. this.transparent === !0 && (r.transparent = this.transparent),
  45464. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  45465. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  45466. this.wireframe === !0 && (r.wireframe = this.wireframe),
  45467. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  45468. i)
  45469. ) {
  45470. var o = t(e.textures),
  45471. a = t(e.images)
  45472. o.length > 0 && (r.textures = o), a.length > 0 && (r.images = a)
  45473. }
  45474. return r
  45475. },
  45476. clone: function () {
  45477. return new this.constructor().copy(this)
  45478. },
  45479. copy: function (e) {
  45480. return (
  45481. (this.name = e.name),
  45482. (this.side = e.side),
  45483. (this.opacity = e.opacity),
  45484. (this.transparent = e.transparent),
  45485. (this.blending = e.blending),
  45486. (this.blendSrc = e.blendSrc),
  45487. (this.blendDst = e.blendDst),
  45488. (this.blendEquation = e.blendEquation),
  45489. (this.blendSrcAlpha = e.blendSrcAlpha),
  45490. (this.blendDstAlpha = e.blendDstAlpha),
  45491. (this.blendEquationAlpha = e.blendEquationAlpha),
  45492. (this.depthFunc = e.depthFunc),
  45493. (this.depthTest = e.depthTest),
  45494. (this.depthWrite = e.depthWrite),
  45495. (this.colorWrite = e.colorWrite),
  45496. (this.precision = e.precision),
  45497. (this.polygonOffset = e.polygonOffset),
  45498. (this.polygonOffsetFactor = e.polygonOffsetFactor),
  45499. (this.polygonOffsetUnits = e.polygonOffsetUnits),
  45500. (this.alphaTest = e.alphaTest),
  45501. (this.premultipliedAlpha = e.premultipliedAlpha),
  45502. (this.overdraw = e.overdraw),
  45503. (this.visible = e.visible),
  45504. this
  45505. )
  45506. },
  45507. update: function () {
  45508. this.dispatchEvent({
  45509. type: 'update'
  45510. })
  45511. },
  45512. dispose: function () {
  45513. this.dispatchEvent({
  45514. type: 'dispose'
  45515. })
  45516. }
  45517. }),
  45518. n.EventDispatcher.prototype.apply(n.Material.prototype),
  45519. (n.MaterialIdCount = 0),
  45520. (n.LineBasicMaterial = function (e) {
  45521. n.Material.call(this),
  45522. (this.type = 'LineBasicMaterial'),
  45523. (this.color = new n.Color(16777215)),
  45524. (this.linewidth = 1),
  45525. (this.linecap = 'round'),
  45526. (this.linejoin = 'round'),
  45527. (this.blending = n.NormalBlending),
  45528. (this.vertexColors = n.NoColors),
  45529. (this.fog = !0),
  45530. this.setValues(e)
  45531. }),
  45532. (n.LineBasicMaterial.prototype = Object.create(n.Material.prototype)),
  45533. (n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial),
  45534. (n.LineBasicMaterial.prototype.copy = function (e) {
  45535. return (
  45536. n.Material.prototype.copy.call(this, e),
  45537. this.color.copy(e.color),
  45538. (this.linewidth = e.linewidth),
  45539. (this.linecap = e.linecap),
  45540. (this.linejoin = e.linejoin),
  45541. (this.vertexColors = e.vertexColors),
  45542. (this.fog = e.fog),
  45543. this
  45544. )
  45545. }),
  45546. (n.LineDashedMaterial = function (e) {
  45547. n.Material.call(this),
  45548. (this.type = 'LineDashedMaterial'),
  45549. (this.color = new n.Color(16777215)),
  45550. (this.linewidth = 1),
  45551. (this.scale = 1),
  45552. (this.dashSize = 3),
  45553. (this.gapSize = 1),
  45554. (this.blending = n.NormalBlending),
  45555. (this.vertexColors = n.NoColors),
  45556. (this.fog = !0),
  45557. this.setValues(e)
  45558. }),
  45559. (n.LineDashedMaterial.prototype = Object.create(n.Material.prototype)),
  45560. (n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial),
  45561. (n.LineDashedMaterial.prototype.copy = function (e) {
  45562. return (
  45563. n.Material.prototype.copy.call(this, e),
  45564. this.color.copy(e.color),
  45565. (this.linewidth = e.linewidth),
  45566. (this.scale = e.scale),
  45567. (this.dashSize = e.dashSize),
  45568. (this.gapSize = e.gapSize),
  45569. (this.vertexColors = e.vertexColors),
  45570. (this.fog = e.fog),
  45571. this
  45572. )
  45573. }),
  45574. (n.MeshBasicMaterial = function (e) {
  45575. n.Material.call(this),
  45576. (this.type = 'MeshBasicMaterial'),
  45577. (this.color = new n.Color(16777215)),
  45578. (this.map = null),
  45579. (this.aoMap = null),
  45580. (this.aoMapIntensity = 1),
  45581. (this.specularMap = null),
  45582. (this.alphaMap = null),
  45583. (this.envMap = null),
  45584. (this.combine = n.MultiplyOperation),
  45585. (this.reflectivity = 1),
  45586. (this.refractionRatio = 0.98),
  45587. (this.fog = !0),
  45588. (this.shading = n.SmoothShading),
  45589. (this.blending = n.NormalBlending),
  45590. (this.wireframe = !1),
  45591. (this.wireframeLinewidth = 1),
  45592. (this.wireframeLinecap = 'round'),
  45593. (this.wireframeLinejoin = 'round'),
  45594. (this.vertexColors = n.NoColors),
  45595. (this.skinning = !1),
  45596. (this.morphTargets = !1),
  45597. this.setValues(e)
  45598. }),
  45599. (n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype)),
  45600. (n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial),
  45601. (n.MeshBasicMaterial.prototype.copy = function (e) {
  45602. return (
  45603. n.Material.prototype.copy.call(this, e),
  45604. this.color.copy(e.color),
  45605. (this.map = e.map),
  45606. (this.aoMap = e.aoMap),
  45607. (this.aoMapIntensity = e.aoMapIntensity),
  45608. (this.specularMap = e.specularMap),
  45609. (this.alphaMap = e.alphaMap),
  45610. (this.envMap = e.envMap),
  45611. (this.combine = e.combine),
  45612. (this.reflectivity = e.reflectivity),
  45613. (this.refractionRatio = e.refractionRatio),
  45614. (this.fog = e.fog),
  45615. (this.shading = e.shading),
  45616. (this.wireframe = e.wireframe),
  45617. (this.wireframeLinewidth = e.wireframeLinewidth),
  45618. (this.wireframeLinecap = e.wireframeLinecap),
  45619. (this.wireframeLinejoin = e.wireframeLinejoin),
  45620. (this.vertexColors = e.vertexColors),
  45621. (this.skinning = e.skinning),
  45622. (this.morphTargets = e.morphTargets),
  45623. this
  45624. )
  45625. }),
  45626. (n.MeshLambertMaterial = function (e) {
  45627. n.Material.call(this),
  45628. (this.type = 'MeshLambertMaterial'),
  45629. (this.color = new n.Color(16777215)),
  45630. (this.map = null),
  45631. (this.lightMap = null),
  45632. (this.lightMapIntensity = 1),
  45633. (this.aoMap = null),
  45634. (this.aoMapIntensity = 1),
  45635. (this.emissive = new n.Color(0)),
  45636. (this.emissiveIntensity = 1),
  45637. (this.emissiveMap = null),
  45638. (this.specularMap = null),
  45639. (this.alphaMap = null),
  45640. (this.envMap = null),
  45641. (this.combine = n.MultiplyOperation),
  45642. (this.reflectivity = 1),
  45643. (this.refractionRatio = 0.98),
  45644. (this.fog = !0),
  45645. (this.blending = n.NormalBlending),
  45646. (this.wireframe = !1),
  45647. (this.wireframeLinewidth = 1),
  45648. (this.wireframeLinecap = 'round'),
  45649. (this.wireframeLinejoin = 'round'),
  45650. (this.vertexColors = n.NoColors),
  45651. (this.skinning = !1),
  45652. (this.morphTargets = !1),
  45653. (this.morphNormals = !1),
  45654. this.setValues(e)
  45655. }),
  45656. (n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype)),
  45657. (n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial),
  45658. (n.MeshLambertMaterial.prototype.copy = function (e) {
  45659. return (
  45660. n.Material.prototype.copy.call(this, e),
  45661. this.color.copy(e.color),
  45662. (this.map = e.map),
  45663. (this.lightMap = e.lightMap),
  45664. (this.lightMapIntensity = e.lightMapIntensity),
  45665. (this.aoMap = e.aoMap),
  45666. (this.aoMapIntensity = e.aoMapIntensity),
  45667. this.emissive.copy(e.emissive),
  45668. (this.emissiveMap = e.emissiveMap),
  45669. (this.emissiveIntensity = e.emissiveIntensity),
  45670. (this.specularMap = e.specularMap),
  45671. (this.alphaMap = e.alphaMap),
  45672. (this.envMap = e.envMap),
  45673. (this.combine = e.combine),
  45674. (this.reflectivity = e.reflectivity),
  45675. (this.refractionRatio = e.refractionRatio),
  45676. (this.fog = e.fog),
  45677. (this.wireframe = e.wireframe),
  45678. (this.wireframeLinewidth = e.wireframeLinewidth),
  45679. (this.wireframeLinecap = e.wireframeLinecap),
  45680. (this.wireframeLinejoin = e.wireframeLinejoin),
  45681. (this.vertexColors = e.vertexColors),
  45682. (this.skinning = e.skinning),
  45683. (this.morphTargets = e.morphTargets),
  45684. (this.morphNormals = e.morphNormals),
  45685. this
  45686. )
  45687. }),
  45688. (n.MeshPhongMaterial = function (e) {
  45689. n.Material.call(this),
  45690. (this.type = 'MeshPhongMaterial'),
  45691. (this.color = new n.Color(16777215)),
  45692. (this.specular = new n.Color(1118481)),
  45693. (this.shininess = 30),
  45694. (this.map = null),
  45695. (this.lightMap = null),
  45696. (this.lightMapIntensity = 1),
  45697. (this.aoMap = null),
  45698. (this.aoMapIntensity = 1),
  45699. (this.emissive = new n.Color(0)),
  45700. (this.emissiveIntensity = 1),
  45701. (this.emissiveMap = null),
  45702. (this.bumpMap = null),
  45703. (this.bumpScale = 1),
  45704. (this.normalMap = null),
  45705. (this.normalScale = new n.Vector2(1, 1)),
  45706. (this.displacementMap = null),
  45707. (this.displacementScale = 1),
  45708. (this.displacementBias = 0),
  45709. (this.specularMap = null),
  45710. (this.alphaMap = null),
  45711. (this.envMap = null),
  45712. (this.combine = n.MultiplyOperation),
  45713. (this.reflectivity = 1),
  45714. (this.refractionRatio = 0.98),
  45715. (this.fog = !0),
  45716. (this.shading = n.SmoothShading),
  45717. (this.blending = n.NormalBlending),
  45718. (this.wireframe = !1),
  45719. (this.wireframeLinewidth = 1),
  45720. (this.wireframeLinecap = 'round'),
  45721. (this.wireframeLinejoin = 'round'),
  45722. (this.vertexColors = n.NoColors),
  45723. (this.skinning = !1),
  45724. (this.morphTargets = !1),
  45725. (this.morphNormals = !1),
  45726. this.setValues(e)
  45727. }),
  45728. (n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype)),
  45729. (n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial),
  45730. (n.MeshPhongMaterial.prototype.copy = function (e) {
  45731. return (
  45732. n.Material.prototype.copy.call(this, e),
  45733. this.color.copy(e.color),
  45734. this.specular.copy(e.specular),
  45735. (this.shininess = e.shininess),
  45736. (this.map = e.map),
  45737. (this.lightMap = e.lightMap),
  45738. (this.lightMapIntensity = e.lightMapIntensity),
  45739. (this.aoMap = e.aoMap),
  45740. (this.aoMapIntensity = e.aoMapIntensity),
  45741. this.emissive.copy(e.emissive),
  45742. (this.emissiveMap = e.emissiveMap),
  45743. (this.emissiveIntensity = e.emissiveIntensity),
  45744. (this.bumpMap = e.bumpMap),
  45745. (this.bumpScale = e.bumpScale),
  45746. (this.normalMap = e.normalMap),
  45747. this.normalScale.copy(e.normalScale),
  45748. (this.displacementMap = e.displacementMap),
  45749. (this.displacementScale = e.displacementScale),
  45750. (this.displacementBias = e.displacementBias),
  45751. (this.specularMap = e.specularMap),
  45752. (this.alphaMap = e.alphaMap),
  45753. (this.envMap = e.envMap),
  45754. (this.combine = e.combine),
  45755. (this.reflectivity = e.reflectivity),
  45756. (this.refractionRatio = e.refractionRatio),
  45757. (this.fog = e.fog),
  45758. (this.shading = e.shading),
  45759. (this.wireframe = e.wireframe),
  45760. (this.wireframeLinewidth = e.wireframeLinewidth),
  45761. (this.wireframeLinecap = e.wireframeLinecap),
  45762. (this.wireframeLinejoin = e.wireframeLinejoin),
  45763. (this.vertexColors = e.vertexColors),
  45764. (this.skinning = e.skinning),
  45765. (this.morphTargets = e.morphTargets),
  45766. (this.morphNormals = e.morphNormals),
  45767. this
  45768. )
  45769. }),
  45770. (n.MeshStandardMaterial = function (e) {
  45771. n.Material.call(this),
  45772. (this.type = 'MeshStandardMaterial'),
  45773. (this.color = new n.Color(16777215)),
  45774. (this.roughness = 0.5),
  45775. (this.metalness = 0.5),
  45776. (this.map = null),
  45777. (this.lightMap = null),
  45778. (this.lightMapIntensity = 1),
  45779. (this.aoMap = null),
  45780. (this.aoMapIntensity = 1),
  45781. (this.emissive = new n.Color(0)),
  45782. (this.emissiveIntensity = 1),
  45783. (this.emissiveMap = null),
  45784. (this.bumpMap = null),
  45785. (this.bumpScale = 1),
  45786. (this.normalMap = null),
  45787. (this.normalScale = new n.Vector2(1, 1)),
  45788. (this.displacementMap = null),
  45789. (this.displacementScale = 1),
  45790. (this.displacementBias = 0),
  45791. (this.roughnessMap = null),
  45792. (this.metalnessMap = null),
  45793. (this.alphaMap = null),
  45794. (this.envMap = null),
  45795. (this.envMapIntensity = 1),
  45796. (this.refractionRatio = 0.98),
  45797. (this.fog = !0),
  45798. (this.shading = n.SmoothShading),
  45799. (this.blending = n.NormalBlending),
  45800. (this.wireframe = !1),
  45801. (this.wireframeLinewidth = 1),
  45802. (this.wireframeLinecap = 'round'),
  45803. (this.wireframeLinejoin = 'round'),
  45804. (this.vertexColors = n.NoColors),
  45805. (this.skinning = !1),
  45806. (this.morphTargets = !1),
  45807. (this.morphNormals = !1),
  45808. this.setValues(e)
  45809. }),
  45810. (n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype)),
  45811. (n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial),
  45812. (n.MeshStandardMaterial.prototype.copy = function (e) {
  45813. return (
  45814. n.Material.prototype.copy.call(this, e),
  45815. this.color.copy(e.color),
  45816. (this.roughness = e.roughness),
  45817. (this.metalness = e.metalness),
  45818. (this.map = e.map),
  45819. (this.lightMap = e.lightMap),
  45820. (this.lightMapIntensity = e.lightMapIntensity),
  45821. (this.aoMap = e.aoMap),
  45822. (this.aoMapIntensity = e.aoMapIntensity),
  45823. this.emissive.copy(e.emissive),
  45824. (this.emissiveMap = e.emissiveMap),
  45825. (this.emissiveIntensity = e.emissiveIntensity),
  45826. (this.bumpMap = e.bumpMap),
  45827. (this.bumpScale = e.bumpScale),
  45828. (this.normalMap = e.normalMap),
  45829. this.normalScale.copy(e.normalScale),
  45830. (this.displacementMap = e.displacementMap),
  45831. (this.displacementScale = e.displacementScale),
  45832. (this.displacementBias = e.displacementBias),
  45833. (this.roughnessMap = e.roughnessMap),
  45834. (this.metalnessMap = e.metalnessMap),
  45835. (this.alphaMap = e.alphaMap),
  45836. (this.envMap = e.envMap),
  45837. (this.envMapIntensity = e.envMapIntensity),
  45838. (this.refractionRatio = e.refractionRatio),
  45839. (this.fog = e.fog),
  45840. (this.shading = e.shading),
  45841. (this.wireframe = e.wireframe),
  45842. (this.wireframeLinewidth = e.wireframeLinewidth),
  45843. (this.wireframeLinecap = e.wireframeLinecap),
  45844. (this.wireframeLinejoin = e.wireframeLinejoin),
  45845. (this.vertexColors = e.vertexColors),
  45846. (this.skinning = e.skinning),
  45847. (this.morphTargets = e.morphTargets),
  45848. (this.morphNormals = e.morphNormals),
  45849. this
  45850. )
  45851. }),
  45852. (n.MeshDepthMaterial = function (e) {
  45853. n.Material.call(this), (this.type = 'MeshDepthMaterial'), (this.morphTargets = !1), (this.wireframe = !1), (this.wireframeLinewidth = 1), this.setValues(e)
  45854. }),
  45855. (n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype)),
  45856. (n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial),
  45857. (n.MeshDepthMaterial.prototype.copy = function (e) {
  45858. return n.Material.prototype.copy.call(this, e), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this
  45859. }),
  45860. (n.MeshNormalMaterial = function (e) {
  45861. n.Material.call(this, e), (this.type = 'MeshNormalMaterial'), (this.wireframe = !1), (this.wireframeLinewidth = 1), (this.morphTargets = !1), this.setValues(e)
  45862. }),
  45863. (n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype)),
  45864. (n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial),
  45865. (n.MeshNormalMaterial.prototype.copy = function (e) {
  45866. return n.Material.prototype.copy.call(this, e), (this.wireframe = e.wireframe), (this.wireframeLinewidth = e.wireframeLinewidth), this
  45867. }),
  45868. (n.MultiMaterial = function (e) {
  45869. ;(this.uuid = n.Math.generateUUID()), (this.type = 'MultiMaterial'), (this.materials = e instanceof Array ? e : []), (this.visible = !0)
  45870. }),
  45871. (n.MultiMaterial.prototype = {
  45872. constructor: n.MultiMaterial,
  45873. toJSON: function (e) {
  45874. for (
  45875. var t = {
  45876. metadata: {
  45877. version: 4.2,
  45878. type: 'material',
  45879. generator: 'MaterialExporter'
  45880. },
  45881. uuid: this.uuid,
  45882. type: this.type,
  45883. materials: []
  45884. },
  45885. i = this.materials,
  45886. n = 0,
  45887. r = i.length;
  45888. n < r;
  45889. n++
  45890. ) {
  45891. var o = i[n].toJSON(e)
  45892. delete o.metadata, t.materials.push(o)
  45893. }
  45894. return (t.visible = this.visible), t
  45895. },
  45896. clone: function () {
  45897. for (var e = new this.constructor(), t = 0; t < this.materials.length; t++) e.materials.push(this.materials[t].clone())
  45898. return (e.visible = this.visible), e
  45899. }
  45900. }),
  45901. (n.PointsMaterial = function (e) {
  45902. n.Material.call(this),
  45903. (this.type = 'PointsMaterial'),
  45904. (this.color = new n.Color(16777215)),
  45905. (this.map = null),
  45906. (this.size = 1),
  45907. (this.sizeAttenuation = !0),
  45908. (this.blending = n.NormalBlending),
  45909. (this.vertexColors = n.NoColors),
  45910. (this.fog = !0),
  45911. this.setValues(e)
  45912. }),
  45913. (n.PointsMaterial.prototype = Object.create(n.Material.prototype)),
  45914. (n.PointsMaterial.prototype.constructor = n.PointsMaterial),
  45915. (n.PointsMaterial.prototype.copy = function (e) {
  45916. return (
  45917. n.Material.prototype.copy.call(this, e),
  45918. this.color.copy(e.color),
  45919. (this.map = e.map),
  45920. (this.size = e.size),
  45921. (this.sizeAttenuation = e.sizeAttenuation),
  45922. (this.vertexColors = e.vertexColors),
  45923. (this.fog = e.fog),
  45924. this
  45925. )
  45926. }),
  45927. (n.ShaderMaterial = function (e) {
  45928. n.Material.call(this),
  45929. (this.type = 'ShaderMaterial'),
  45930. (this.defines = {}),
  45931. (this.uniforms = {}),
  45932. (this.vertexShader = 'void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}'),
  45933. (this.fragmentShader = 'void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}'),
  45934. (this.shading = n.SmoothShading),
  45935. (this.linewidth = 1),
  45936. (this.wireframe = !1),
  45937. (this.wireframeLinewidth = 1),
  45938. (this.fog = !1),
  45939. (this.lights = !1),
  45940. (this.vertexColors = n.NoColors),
  45941. (this.skinning = !1),
  45942. (this.morphTargets = !1),
  45943. (this.morphNormals = !1),
  45944. (this.extensions = {
  45945. derivatives: !1,
  45946. fragDepth: !1,
  45947. drawBuffers: !1,
  45948. shaderTextureLOD: !1
  45949. }),
  45950. (this.defaultAttributeValues = {
  45951. color: [1, 1, 1],
  45952. uv: [0, 0],
  45953. uv2: [0, 0]
  45954. }),
  45955. (this.index0AttributeName = void 0),
  45956. void 0 !== e && (void 0 !== e.attributes && console.error('THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead.'), this.setValues(e))
  45957. }),
  45958. (n.ShaderMaterial.prototype = Object.create(n.Material.prototype)),
  45959. (n.ShaderMaterial.prototype.constructor = n.ShaderMaterial),
  45960. (n.ShaderMaterial.prototype.copy = function (e) {
  45961. return (
  45962. n.Material.prototype.copy.call(this, e),
  45963. (this.fragmentShader = e.fragmentShader),
  45964. (this.vertexShader = e.vertexShader),
  45965. (this.uniforms = n.UniformsUtils.clone(e.uniforms)),
  45966. (this.defines = e.defines),
  45967. (this.shading = e.shading),
  45968. (this.wireframe = e.wireframe),
  45969. (this.wireframeLinewidth = e.wireframeLinewidth),
  45970. (this.fog = e.fog),
  45971. (this.lights = e.lights),
  45972. (this.vertexColors = e.vertexColors),
  45973. (this.skinning = e.skinning),
  45974. (this.morphTargets = e.morphTargets),
  45975. (this.morphNormals = e.morphNormals),
  45976. (this.extensions = e.extensions),
  45977. this
  45978. )
  45979. }),
  45980. (n.ShaderMaterial.prototype.toJSON = function (e) {
  45981. var t = n.Material.prototype.toJSON.call(this, e)
  45982. return (t.uniforms = this.uniforms), (t.vertexShader = this.vertexShader), (t.fragmentShader = this.fragmentShader), t
  45983. }),
  45984. (n.RawShaderMaterial = function (e) {
  45985. n.ShaderMaterial.call(this, e), (this.type = 'RawShaderMaterial')
  45986. }),
  45987. (n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype)),
  45988. (n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial),
  45989. (n.SpriteMaterial = function (e) {
  45990. n.Material.call(this), (this.type = 'SpriteMaterial'), (this.color = new n.Color(16777215)), (this.map = null), (this.rotation = 0), (this.fog = !1), this.setValues(e)
  45991. }),
  45992. (n.SpriteMaterial.prototype = Object.create(n.Material.prototype)),
  45993. (n.SpriteMaterial.prototype.constructor = n.SpriteMaterial),
  45994. (n.SpriteMaterial.prototype.copy = function (e) {
  45995. return n.Material.prototype.copy.call(this, e), this.color.copy(e.color), (this.map = e.map), (this.rotation = e.rotation), (this.fog = e.fog), this
  45996. }),
  45997. (n.Texture = function (e, t, i, r, o, a, s, l, c) {
  45998. Object.defineProperty(this, 'id', {
  45999. value: n.TextureIdCount++
  46000. }),
  46001. (this.uuid = n.Math.generateUUID()),
  46002. (this.name = ''),
  46003. (this.sourceFile = ''),
  46004. (this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE),
  46005. (this.mipmaps = []),
  46006. (this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING),
  46007. (this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping),
  46008. (this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping),
  46009. (this.magFilter = void 0 !== o ? o : n.LinearFilter),
  46010. (this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter),
  46011. (this.anisotropy = void 0 !== c ? c : 1),
  46012. (this.format = void 0 !== s ? s : n.RGBAFormat),
  46013. (this.type = void 0 !== l ? l : n.UnsignedByteType),
  46014. (this.offset = new n.Vector2(0, 0)),
  46015. (this.repeat = new n.Vector2(1, 1)),
  46016. (this.generateMipmaps = !0),
  46017. (this.premultiplyAlpha = !1),
  46018. (this.flipY = !0),
  46019. (this.unpackAlignment = 4),
  46020. (this.encoding = n.LinearEncoding),
  46021. (this.version = 0),
  46022. (this.onUpdate = null)
  46023. }),
  46024. (n.Texture.DEFAULT_IMAGE = void 0),
  46025. (n.Texture.DEFAULT_MAPPING = n.UVMapping),
  46026. (n.Texture.prototype = {
  46027. constructor: n.Texture,
  46028. set needsUpdate(e) {
  46029. e === !0 && this.version++
  46030. },
  46031. clone: function () {
  46032. return new this.constructor().copy(this)
  46033. },
  46034. copy: function (e) {
  46035. return (
  46036. (this.image = e.image),
  46037. (this.mipmaps = e.mipmaps.slice(0)),
  46038. (this.mapping = e.mapping),
  46039. (this.wrapS = e.wrapS),
  46040. (this.wrapT = e.wrapT),
  46041. (this.magFilter = e.magFilter),
  46042. (this.minFilter = e.minFilter),
  46043. (this.anisotropy = e.anisotropy),
  46044. (this.format = e.format),
  46045. (this.type = e.type),
  46046. this.offset.copy(e.offset),
  46047. this.repeat.copy(e.repeat),
  46048. (this.generateMipmaps = e.generateMipmaps),
  46049. (this.premultiplyAlpha = e.premultiplyAlpha),
  46050. (this.flipY = e.flipY),
  46051. (this.unpackAlignment = e.unpackAlignment),
  46052. (this.encoding = e.encoding),
  46053. this
  46054. )
  46055. },
  46056. toJSON: function (e) {
  46057. function t(e) {
  46058. var t
  46059. return (
  46060. void 0 !== e.toDataURL ? (t = e) : ((t = document.createElement('canvas')), (t.width = e.width), (t.height = e.height), t.getContext('2d').drawImage(e, 0, 0, e.width, e.height)),
  46061. t.width > 2048 || t.height > 2048 ? t.toDataURL('image/jpeg', 0.6) : t.toDataURL('image/png')
  46062. )
  46063. }
  46064. if (void 0 !== e.textures[this.uuid]) return e.textures[this.uuid]
  46065. var i = {
  46066. metadata: {
  46067. version: 4.4,
  46068. type: 'Texture',
  46069. generator: 'Texture.toJSON'
  46070. },
  46071. uuid: this.uuid,
  46072. name: this.name,
  46073. mapping: this.mapping,
  46074. repeat: [this.repeat.x, this.repeat.y],
  46075. offset: [this.offset.x, this.offset.y],
  46076. wrap: [this.wrapS, this.wrapT],
  46077. minFilter: this.minFilter,
  46078. magFilter: this.magFilter,
  46079. anisotropy: this.anisotropy
  46080. }
  46081. if (void 0 !== this.image) {
  46082. var r = this.image
  46083. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  46084. void 0 === e.images[r.uuid] &&
  46085. (e.images[r.uuid] = {
  46086. uuid: r.uuid,
  46087. url: t(r)
  46088. }),
  46089. (i.image = r.uuid)
  46090. }
  46091. return (e.textures[this.uuid] = i), i
  46092. },
  46093. dispose: function () {
  46094. this.dispatchEvent({
  46095. type: 'dispose'
  46096. })
  46097. },
  46098. transformUv: function (e) {
  46099. if (this.mapping === n.UVMapping) {
  46100. if ((e.multiply(this.repeat), e.add(this.offset), e.x < 0 || e.x > 1))
  46101. switch (this.wrapS) {
  46102. case n.RepeatWrapping:
  46103. e.x = e.x - Math.floor(e.x)
  46104. break
  46105. case n.ClampToEdgeWrapping:
  46106. e.x = e.x < 0 ? 0 : 1
  46107. break
  46108. case n.MirroredRepeatWrapping:
  46109. 1 === Math.abs(Math.floor(e.x) % 2) ? (e.x = Math.ceil(e.x) - e.x) : (e.x = e.x - Math.floor(e.x))
  46110. }
  46111. if (e.y < 0 || e.y > 1)
  46112. switch (this.wrapT) {
  46113. case n.RepeatWrapping:
  46114. e.y = e.y - Math.floor(e.y)
  46115. break
  46116. case n.ClampToEdgeWrapping:
  46117. e.y = e.y < 0 ? 0 : 1
  46118. break
  46119. case n.MirroredRepeatWrapping:
  46120. 1 === Math.abs(Math.floor(e.y) % 2) ? (e.y = Math.ceil(e.y) - e.y) : (e.y = e.y - Math.floor(e.y))
  46121. }
  46122. this.flipY && (e.y = 1 - e.y)
  46123. }
  46124. }
  46125. }),
  46126. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  46127. (n.TextureIdCount = 0),
  46128. (n.CanvasTexture = function (e, t, i, r, o, a, s, l, c) {
  46129. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.needsUpdate = !0)
  46130. }),
  46131. (n.CanvasTexture.prototype = Object.create(n.Texture.prototype)),
  46132. (n.CanvasTexture.prototype.constructor = n.CanvasTexture),
  46133. (n.CubeTexture = function (e, t, i, r, o, a, s, l, c) {
  46134. ;(e = void 0 !== e ? e : []), (t = void 0 !== t ? t : n.CubeReflectionMapping), n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.flipY = !1)
  46135. }),
  46136. (n.CubeTexture.prototype = Object.create(n.Texture.prototype)),
  46137. (n.CubeTexture.prototype.constructor = n.CubeTexture),
  46138. Object.defineProperty(n.CubeTexture.prototype, 'images', {
  46139. get: function () {
  46140. return this.image
  46141. },
  46142. set: function (e) {
  46143. this.image = e
  46144. }
  46145. }),
  46146. (n.CompressedTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  46147. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  46148. (this.image = {
  46149. width: t,
  46150. height: i
  46151. }),
  46152. (this.mipmaps = e),
  46153. (this.flipY = !1),
  46154. (this.generateMipmaps = !1)
  46155. }),
  46156. (n.CompressedTexture.prototype = Object.create(n.Texture.prototype)),
  46157. (n.CompressedTexture.prototype.constructor = n.CompressedTexture),
  46158. (n.DataTexture = function (e, t, i, r, o, a, s, l, c, h, u) {
  46159. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  46160. (this.image = {
  46161. data: e,
  46162. width: t,
  46163. height: i
  46164. }),
  46165. (this.magFilter = void 0 !== c ? c : n.NearestFilter),
  46166. (this.minFilter = void 0 !== h ? h : n.NearestFilter),
  46167. (this.flipY = !1),
  46168. (this.generateMipmaps = !1)
  46169. }),
  46170. (n.DataTexture.prototype = Object.create(n.Texture.prototype)),
  46171. (n.DataTexture.prototype.constructor = n.DataTexture),
  46172. (n.VideoTexture = function (e, t, i, r, o, a, s, l, c) {
  46173. function h() {
  46174. requestAnimationFrame(h)
  46175. if (!e.paused && e.readyState === e.HAVE_ENOUGH_DATA) {
  46176. //改 add !e.paused
  46177. u.needsUpdate = !0
  46178. }
  46179. }
  46180. n.Texture.call(this, e, t, i, r, o, a, s, l, c), (this.generateMipmaps = !1)
  46181. var u = this
  46182. h()
  46183. }),
  46184. (n.VideoTexture.prototype = Object.create(n.Texture.prototype)),
  46185. (n.VideoTexture.prototype.constructor = n.VideoTexture),
  46186. (n.Group = function () {
  46187. n.Object3D.call(this), (this.type = 'Group')
  46188. }),
  46189. (n.Group.prototype = Object.create(n.Object3D.prototype)),
  46190. (n.Group.prototype.constructor = n.Group),
  46191. (n.Points = function (e, t) {
  46192. n.Object3D.call(this),
  46193. (this.type = 'Points'),
  46194. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  46195. (this.material =
  46196. void 0 !== t
  46197. ? t
  46198. : new n.PointsMaterial({
  46199. color: 16777215 * Math.random()
  46200. }))
  46201. }),
  46202. (n.Points.prototype = Object.create(n.Object3D.prototype)),
  46203. (n.Points.prototype.constructor = n.Points),
  46204. (n.Points.prototype.raycast = (function () {
  46205. var e = new n.Matrix4(),
  46206. t = new n.Ray(),
  46207. i = new n.Sphere()
  46208. return function (r, o) {
  46209. function a(e, i) {
  46210. var n = t.distanceSqToPoint(e)
  46211. if (n < d) {
  46212. var a = t.closestPointToPoint(e)
  46213. a.applyMatrix4(c)
  46214. var l = r.ray.origin.distanceTo(a)
  46215. if (l < r.near || l > r.far) return
  46216. o.push({
  46217. distance: l,
  46218. distanceToRay: Math.sqrt(n),
  46219. point: a.clone(),
  46220. index: i,
  46221. face: null,
  46222. object: s
  46223. })
  46224. }
  46225. }
  46226. var s = this,
  46227. l = this.geometry,
  46228. c = this.matrixWorld,
  46229. h = r.params.Points.threshold
  46230. if ((null === l.boundingSphere && l.computeBoundingSphere(), i.copy(l.boundingSphere), i.applyMatrix4(c), r.ray.intersectsSphere(i) !== !1)) {
  46231. e.getInverse(c), t.copy(r.ray).applyMatrix4(e)
  46232. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3),
  46233. d = u * u,
  46234. p = new n.Vector3()
  46235. if (l instanceof n.BufferGeometry) {
  46236. var f = l.index,
  46237. g = l.attributes,
  46238. m = g.position.array
  46239. if (null !== f)
  46240. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  46241. var C = v[A]
  46242. p.fromArray(m, 3 * C), a(p, C)
  46243. }
  46244. else for (var A = 0, I = m.length / 3; A < I; A++) p.fromArray(m, 3 * A), a(p, A)
  46245. } else for (var E = l.vertices, A = 0, I = E.length; A < I; A++) a(E[A], A)
  46246. }
  46247. }
  46248. })()),
  46249. (n.Points.prototype.clone = function () {
  46250. return new this.constructor(this.geometry, this.material).copy(this)
  46251. }),
  46252. (n.Line = function (e, t, i) {
  46253. return 1 === i
  46254. ? (console.warn('THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead.'), new n.LineSegments(e, t))
  46255. : (n.Object3D.call(this),
  46256. (this.type = 'Line'),
  46257. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  46258. void (this.material =
  46259. void 0 !== t
  46260. ? t
  46261. : new n.LineBasicMaterial({
  46262. color: 16777215 * Math.random()
  46263. })))
  46264. }),
  46265. (n.Line.prototype = Object.create(n.Object3D.prototype)),
  46266. (n.Line.prototype.constructor = n.Line),
  46267. (n.Line.prototype.raycast = (function () {
  46268. var e = new n.Matrix4(),
  46269. t = new n.Ray(),
  46270. i = new n.Sphere()
  46271. return function (r, o) {
  46272. var a = r.linePrecision,
  46273. s = a * a,
  46274. l = this.geometry,
  46275. c = this.matrixWorld
  46276. if ((null === l.boundingSphere && l.computeBoundingSphere(), i.copy(l.boundingSphere), i.applyMatrix4(c), r.ray.intersectsSphere(i) !== !1)) {
  46277. e.getInverse(c), t.copy(r.ray).applyMatrix4(e)
  46278. var h = new n.Vector3(),
  46279. u = new n.Vector3(),
  46280. d = new n.Vector3(),
  46281. p = new n.Vector3(),
  46282. f = this instanceof n.LineSegments ? 2 : 1
  46283. if (l instanceof n.BufferGeometry) {
  46284. var g = l.index,
  46285. m = l.attributes,
  46286. v = m.position.array
  46287. if (null !== g)
  46288. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  46289. var I = A[y],
  46290. E = A[y + 1]
  46291. h.fromArray(v, 3 * I), u.fromArray(v, 3 * E)
  46292. var b = t.distanceSqToSegment(h, u, p, d)
  46293. if (!(b > s)) {
  46294. p.applyMatrix4(this.matrixWorld)
  46295. var w = r.ray.origin.distanceTo(p)
  46296. w < r.near ||
  46297. w > r.far ||
  46298. o.push({
  46299. distance: w,
  46300. point: d.clone().applyMatrix4(this.matrixWorld),
  46301. index: y,
  46302. face: null,
  46303. faceIndex: null,
  46304. object: this
  46305. })
  46306. }
  46307. }
  46308. else
  46309. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  46310. h.fromArray(v, 3 * y), u.fromArray(v, 3 * y + 3)
  46311. var b = t.distanceSqToSegment(h, u, p, d)
  46312. if (!(b > s)) {
  46313. p.applyMatrix4(this.matrixWorld)
  46314. var w = r.ray.origin.distanceTo(p)
  46315. w < r.near ||
  46316. w > r.far ||
  46317. o.push({
  46318. distance: w,
  46319. point: d.clone().applyMatrix4(this.matrixWorld),
  46320. index: y,
  46321. face: null,
  46322. faceIndex: null,
  46323. object: this
  46324. })
  46325. }
  46326. }
  46327. } else if (l instanceof n.Geometry)
  46328. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  46329. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d)
  46330. if (!(b > s)) {
  46331. p.applyMatrix4(this.matrixWorld)
  46332. var w = r.ray.origin.distanceTo(p)
  46333. w < r.near ||
  46334. w > r.far ||
  46335. o.push({
  46336. distance: w,
  46337. point: d.clone().applyMatrix4(this.matrixWorld),
  46338. index: y,
  46339. face: null,
  46340. faceIndex: null,
  46341. object: this
  46342. })
  46343. }
  46344. }
  46345. }
  46346. }
  46347. })()),
  46348. (n.Line.prototype.clone = function () {
  46349. return new this.constructor(this.geometry, this.material).copy(this)
  46350. }),
  46351. (n.LineStrip = 0),
  46352. (n.LinePieces = 1),
  46353. (n.LineSegments = function (e, t) {
  46354. n.Line.call(this, e, t), (this.type = 'LineSegments')
  46355. }),
  46356. (n.LineSegments.prototype = Object.create(n.Line.prototype)),
  46357. (n.LineSegments.prototype.constructor = n.LineSegments),
  46358. (n.Mesh = function (e, t) {
  46359. n.Object3D.call(this),
  46360. (this.type = 'Mesh'),
  46361. (this.geometry = void 0 !== e ? e : new n.Geometry()),
  46362. (this.material =
  46363. void 0 !== t
  46364. ? t
  46365. : new n.MeshBasicMaterial({
  46366. color: 16777215 * Math.random()
  46367. })),
  46368. (this.drawMode = n.TrianglesDrawMode),
  46369. this.updateMorphTargets()
  46370. }),
  46371. (n.Mesh.prototype = Object.create(n.Object3D.prototype)),
  46372. (n.Mesh.prototype.constructor = n.Mesh),
  46373. (n.Mesh.prototype.setDrawMode = function (e) {
  46374. this.drawMode = e
  46375. }),
  46376. (n.Mesh.prototype.updateMorphTargets = function () {
  46377. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  46378. ;(this.morphTargetBase = -1), (this.morphTargetInfluences = []), (this.morphTargetDictionary = {})
  46379. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++) this.morphTargetInfluences.push(0), (this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e)
  46380. }
  46381. }),
  46382. (n.Mesh.prototype.getMorphTargetIndexByName = function (e) {
  46383. return void 0 !== this.morphTargetDictionary[e]
  46384. ? this.morphTargetDictionary[e]
  46385. : (console.warn('THREE.Mesh.getMorphTargetIndexByName: morph target ' + e + ' does not exist. Returning 0.'), 0)
  46386. }),
  46387. (n.Mesh.prototype.raycast = (function () {
  46388. function e(e, t, i, r, o, a, s) {
  46389. return n.Triangle.barycoordFromPoint(e, t, i, r, m), o.multiplyScalar(m.x), a.multiplyScalar(m.y), s.multiplyScalar(m.z), o.add(a).add(s), o.clone()
  46390. }
  46391. function t(e, t, i, r, o, a, s) {
  46392. var l,
  46393. c = e.material
  46394. if (((l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s)), null === l)) return null
  46395. A.copy(s), A.applyMatrix4(e.matrixWorld)
  46396. var h = t.ray.origin.distanceTo(A)
  46397. return h < t.near || h > t.far
  46398. ? null
  46399. : {
  46400. distance: h,
  46401. point: A.clone(),
  46402. object: e
  46403. }
  46404. }
  46405. function i(i, r, o, a, h, u, d, m) {
  46406. s.fromArray(a, 3 * u), l.fromArray(a, 3 * d), c.fromArray(a, 3 * m)
  46407. var A = t(i, r, o, s, l, c, v)
  46408. return (
  46409. A &&
  46410. (h && (p.fromArray(h, 2 * u), f.fromArray(h, 2 * d), g.fromArray(h, 2 * m), (A.uv = e(v, s, l, c, p, f, g))),
  46411. (A.face = new n.Face3(u, d, m, n.Triangle.normal(s, l, c))),
  46412. (A.faceIndex = u)),
  46413. A
  46414. )
  46415. }
  46416. var r = new n.Matrix4(),
  46417. o = new n.Ray(),
  46418. a = new n.Sphere(),
  46419. s = new n.Vector3(),
  46420. l = new n.Vector3(),
  46421. c = new n.Vector3(),
  46422. h = new n.Vector3(),
  46423. u = new n.Vector3(),
  46424. d = new n.Vector3(),
  46425. p = new n.Vector2(),
  46426. f = new n.Vector2(),
  46427. g = new n.Vector2(),
  46428. m = new n.Vector3(),
  46429. v = new n.Vector3(),
  46430. A = new n.Vector3()
  46431. return function (m, A) {
  46432. var y = this.geometry,
  46433. C = this.material,
  46434. I = this.matrixWorld
  46435. if (
  46436. void 0 !== C &&
  46437. (null === y.boundingSphere && y.computeBoundingSphere(),
  46438. a.copy(y.boundingSphere),
  46439. a.applyMatrix4(I),
  46440. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I), o.copy(m.ray).applyMatrix4(r), null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))
  46441. ) {
  46442. var E, b
  46443. if (y instanceof n.BufferGeometry) {
  46444. var w,
  46445. _,
  46446. T,
  46447. x = y.index,
  46448. S = y.attributes,
  46449. M = S.position.array
  46450. if ((void 0 !== S.uv && (E = S.uv.array), null !== x))
  46451. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  46452. (w = R[P]), (_ = R[P + 1]), (T = R[P + 2]), (b = i(this, m, o, M, E, w, _, T)), b && ((b.faceIndex = Math.floor(P / 3)), A.push(b))
  46453. else for (var P = 0, O = M.length; P < O; P += 9) (w = P / 3), (_ = w + 1), (T = w + 2), (b = i(this, m, o, M, E, w, _, T)), b && ((b.index = w), A.push(b))
  46454. } else if (y instanceof n.Geometry) {
  46455. var L,
  46456. D,
  46457. N,
  46458. B = C instanceof n.MultiMaterial,
  46459. F = B === !0 ? C.materials : null,
  46460. V = y.vertices,
  46461. U = y.faces,
  46462. k = y.faceVertexUvs[0]
  46463. k.length > 0 && (E = k)
  46464. for (var H = 0, G = U.length; H < G; H++) {
  46465. var z = U[H],
  46466. W = B === !0 ? F[z.materialIndex] : C
  46467. if (void 0 !== W) {
  46468. if (((L = V[z.a]), (D = V[z.b]), (N = V[z.c]), W.morphTargets === !0)) {
  46469. var j = y.morphTargets,
  46470. Y = this.morphTargetInfluences
  46471. s.set(0, 0, 0), l.set(0, 0, 0), c.set(0, 0, 0)
  46472. for (var X = 0, Z = j.length; X < Z; X++) {
  46473. var q = Y[X]
  46474. if (0 !== q) {
  46475. var K = j[X].vertices
  46476. s.addScaledVector(h.subVectors(K[z.a], L), q), l.addScaledVector(u.subVectors(K[z.b], D), q), c.addScaledVector(d.subVectors(K[z.c], N), q)
  46477. }
  46478. }
  46479. s.add(L), l.add(D), c.add(N), (L = s), (D = l), (N = c)
  46480. }
  46481. if ((b = t(this, m, o, L, D, N, v))) {
  46482. if (E) {
  46483. var Q = E[H]
  46484. p.copy(Q[0]), f.copy(Q[1]), g.copy(Q[2]), (b.uv = e(v, L, D, N, p, f, g))
  46485. }
  46486. ;(b.face = z), (b.faceIndex = H), A.push(b)
  46487. }
  46488. }
  46489. }
  46490. }
  46491. }
  46492. }
  46493. })()),
  46494. (n.Mesh.prototype.clone = function () {
  46495. return new this.constructor(this.geometry, this.material).copy(this)
  46496. }),
  46497. (n.Bone = function (e) {
  46498. n.Object3D.call(this), (this.type = 'Bone'), (this.skin = e)
  46499. }),
  46500. (n.Bone.prototype = Object.create(n.Object3D.prototype)),
  46501. (n.Bone.prototype.constructor = n.Bone),
  46502. (n.Bone.prototype.copy = function (e) {
  46503. return n.Object3D.prototype.copy.call(this, e), (this.skin = e.skin), this
  46504. }),
  46505. (n.Skeleton = function (e, t, i) {
  46506. if (((this.useVertexTexture = void 0 === i || i), (this.identityMatrix = new n.Matrix4()), (e = e || []), (this.bones = e.slice(0)), this.useVertexTexture)) {
  46507. var r = Math.sqrt(4 * this.bones.length)
  46508. ;(r = n.Math.nextPowerOfTwo(Math.ceil(r))),
  46509. (r = Math.max(r, 4)),
  46510. (this.boneTextureWidth = r),
  46511. (this.boneTextureHeight = r),
  46512. (this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4)),
  46513. (this.boneTexture = new n.DataTexture(this.boneMatrices, this.boneTextureWidth, this.boneTextureHeight, n.RGBAFormat, n.FloatType))
  46514. } else this.boneMatrices = new Float32Array(16 * this.bones.length)
  46515. if (void 0 === t) this.calculateInverses()
  46516. else if (this.bones.length === t.length) this.boneInverses = t.slice(0)
  46517. else {
  46518. console.warn('THREE.Skeleton bonInverses is the wrong length.'), (this.boneInverses = [])
  46519. for (var o = 0, a = this.bones.length; o < a; o++) this.boneInverses.push(new n.Matrix4())
  46520. }
  46521. }),
  46522. (n.Skeleton.prototype.calculateInverses = function () {
  46523. this.boneInverses = []
  46524. for (var e = 0, t = this.bones.length; e < t; e++) {
  46525. var i = new n.Matrix4()
  46526. this.bones[e] && i.getInverse(this.bones[e].matrixWorld), this.boneInverses.push(i)
  46527. }
  46528. }),
  46529. (n.Skeleton.prototype.pose = function () {
  46530. for (var e, t = 0, i = this.bones.length; t < i; t++) (e = this.bones[t]), e && e.matrixWorld.getInverse(this.boneInverses[t])
  46531. for (var t = 0, i = this.bones.length; t < i; t++)
  46532. (e = this.bones[t]),
  46533. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld), e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld), e.matrix.decompose(e.position, e.quaternion, e.scale))
  46534. }),
  46535. (n.Skeleton.prototype.update = (function () {
  46536. var e = new n.Matrix4()
  46537. return function () {
  46538. for (var t = 0, i = this.bones.length; t < i; t++) {
  46539. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix
  46540. e.multiplyMatrices(n, this.boneInverses[t]), e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  46541. }
  46542. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  46543. }
  46544. })()),
  46545. (n.Skeleton.prototype.clone = function () {
  46546. return new n.Skeleton(this.bones, this.boneInverses, this.useVertexTexture)
  46547. }),
  46548. (n.SkinnedMesh = function (e, t, i) {
  46549. n.Mesh.call(this, e, t), (this.type = 'SkinnedMesh'), (this.bindMode = 'attached'), (this.bindMatrix = new n.Matrix4()), (this.bindMatrixInverse = new n.Matrix4())
  46550. var r = []
  46551. if (this.geometry && void 0 !== this.geometry.bones) {
  46552. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  46553. (a = this.geometry.bones[s]),
  46554. (o = new n.Bone(this)),
  46555. r.push(o),
  46556. (o.name = a.name),
  46557. o.position.fromArray(a.pos),
  46558. o.quaternion.fromArray(a.rotq),
  46559. void 0 !== a.scl && o.scale.fromArray(a.scl)
  46560. for (var s = 0, l = this.geometry.bones.length; s < l; ++s) (a = this.geometry.bones[s]), a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  46561. }
  46562. this.normalizeSkinWeights(), this.updateMatrixWorld(!0), this.bind(new n.Skeleton(r, void 0, i), this.matrixWorld)
  46563. }),
  46564. (n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype)),
  46565. (n.SkinnedMesh.prototype.constructor = n.SkinnedMesh),
  46566. (n.SkinnedMesh.prototype.bind = function (e, t) {
  46567. ;(this.skeleton = e), void 0 === t && (this.updateMatrixWorld(!0), this.skeleton.calculateInverses(), (t = this.matrixWorld)), this.bindMatrix.copy(t), this.bindMatrixInverse.getInverse(t)
  46568. }),
  46569. (n.SkinnedMesh.prototype.pose = function () {
  46570. this.skeleton.pose()
  46571. }),
  46572. (n.SkinnedMesh.prototype.normalizeSkinWeights = function () {
  46573. if (this.geometry instanceof n.Geometry)
  46574. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  46575. var t = this.geometry.skinWeights[e],
  46576. i = 1 / t.lengthManhattan()
  46577. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  46578. }
  46579. else if (this.geometry instanceof n.BufferGeometry)
  46580. for (var r = new n.Vector4(), o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  46581. ;(r.x = o.getX(e)), (r.y = o.getY(e)), (r.z = o.getZ(e)), (r.w = o.getW(e))
  46582. var i = 1 / r.lengthManhattan()
  46583. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0), o.setXYZW(e, r.x, r.y, r.z, r.w)
  46584. }
  46585. }),
  46586. (n.SkinnedMesh.prototype.updateMatrixWorld = function (e) {
  46587. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  46588. 'attached' === this.bindMode
  46589. ? this.bindMatrixInverse.getInverse(this.matrixWorld)
  46590. : 'detached' === this.bindMode
  46591. ? this.bindMatrixInverse.getInverse(this.bindMatrix)
  46592. : console.warn('THREE.SkinnedMesh unrecognized bindMode: ' + this.bindMode)
  46593. }),
  46594. (n.SkinnedMesh.prototype.clone = function () {
  46595. return new this.constructor(this.geometry, this.material, this.useVertexTexture).copy(this)
  46596. }),
  46597. (n.LOD = function () {
  46598. n.Object3D.call(this),
  46599. (this.type = 'LOD'),
  46600. Object.defineProperties(this, {
  46601. levels: {
  46602. enumerable: !0,
  46603. value: []
  46604. },
  46605. objects: {
  46606. get: function () {
  46607. return console.warn('THREE.LOD: .objects has been renamed to .levels.'), this.levels
  46608. }
  46609. }
  46610. })
  46611. }),
  46612. (n.LOD.prototype = Object.create(n.Object3D.prototype)),
  46613. (n.LOD.prototype.constructor = n.LOD),
  46614. (n.LOD.prototype.addLevel = function (e, t) {
  46615. void 0 === t && (t = 0), (t = Math.abs(t))
  46616. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++);
  46617. i.splice(n, 0, {
  46618. distance: t,
  46619. object: e
  46620. }),
  46621. this.add(e)
  46622. }),
  46623. (n.LOD.prototype.getObjectForDistance = function (e) {
  46624. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++);
  46625. return t[i - 1].object
  46626. }),
  46627. (n.LOD.prototype.raycast = (function () {
  46628. var e = new n.Vector3()
  46629. return function (t, i) {
  46630. e.setFromMatrixPosition(this.matrixWorld)
  46631. var n = t.ray.origin.distanceTo(e)
  46632. this.getObjectForDistance(n).raycast(t, i)
  46633. }
  46634. })()),
  46635. (n.LOD.prototype.update = (function () {
  46636. var e = new n.Vector3(),
  46637. t = new n.Vector3()
  46638. return function (i) {
  46639. var n = this.levels
  46640. if (n.length > 1) {
  46641. e.setFromMatrixPosition(i.matrixWorld), t.setFromMatrixPosition(this.matrixWorld)
  46642. var r = e.distanceTo(t)
  46643. n[0].object.visible = !0
  46644. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++) (n[o - 1].object.visible = !1), (n[o].object.visible = !0)
  46645. for (; o < a; o++) n[o].object.visible = !1
  46646. }
  46647. }
  46648. })()),
  46649. (n.LOD.prototype.copy = function (e) {
  46650. n.Object3D.prototype.copy.call(this, e, !1)
  46651. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  46652. var o = t[i]
  46653. this.addLevel(o.object.clone(), o.distance)
  46654. }
  46655. return this
  46656. }),
  46657. (n.LOD.prototype.toJSON = function (e) {
  46658. var t = n.Object3D.prototype.toJSON.call(this, e)
  46659. t.object.levels = []
  46660. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  46661. var a = i[r]
  46662. t.object.levels.push({
  46663. object: a.object.uuid,
  46664. distance: a.distance
  46665. })
  46666. }
  46667. return t
  46668. }),
  46669. (n.Sprite = (function () {
  46670. var e = new Uint16Array([0, 1, 2, 0, 2, 3]),
  46671. t = new Float32Array([-0.5, -0.5, 0, 0.5, -0.5, 0, 0.5, 0.5, 0, -0.5, 0.5, 0]),
  46672. i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1]),
  46673. r = new n.BufferGeometry()
  46674. return (
  46675. r.setIndex(new n.BufferAttribute(e, 1)),
  46676. r.addAttribute('position', new n.BufferAttribute(t, 3)),
  46677. r.addAttribute('uv', new n.BufferAttribute(i, 2)),
  46678. function (e) {
  46679. n.Object3D.call(this), (this.type = 'Sprite'), (this.geometry = r), (this.material = void 0 !== e ? e : new n.SpriteMaterial())
  46680. }
  46681. )
  46682. })()),
  46683. (n.Sprite.prototype = Object.create(n.Object3D.prototype)),
  46684. (n.Sprite.prototype.constructor = n.Sprite),
  46685. (n.Sprite.prototype.raycast = (function () {
  46686. var e = new n.Vector3()
  46687. return function (t, i) {
  46688. e.setFromMatrixPosition(this.matrixWorld)
  46689. var n = t.ray.distanceSqToPoint(e),
  46690. r = this.scale.x * this.scale.y
  46691. n > r ||
  46692. i.push({
  46693. distance: Math.sqrt(n),
  46694. point: this.position,
  46695. face: null,
  46696. object: this
  46697. })
  46698. }
  46699. })()),
  46700. (n.Sprite.prototype.clone = function () {
  46701. return new this.constructor(this.material).copy(this)
  46702. }),
  46703. (n.Particle = n.Sprite),
  46704. (n.LensFlare = function (e, t, i, r, o) {
  46705. n.Object3D.call(this), (this.lensFlares = []), (this.positionScreen = new n.Vector3()), (this.customUpdateCallback = void 0), void 0 !== e && this.add(e, t, i, r, o)
  46706. }),
  46707. (n.LensFlare.prototype = Object.create(n.Object3D.prototype)),
  46708. (n.LensFlare.prototype.constructor = n.LensFlare),
  46709. (n.LensFlare.prototype.add = function (e, t, i, r, o, a) {
  46710. void 0 === t && (t = -1),
  46711. void 0 === i && (i = 0),
  46712. void 0 === a && (a = 1),
  46713. void 0 === o && (o = new n.Color(16777215)),
  46714. void 0 === r && (r = n.NormalBlending),
  46715. (i = Math.min(i, Math.max(0, i))),
  46716. this.lensFlares.push({
  46717. texture: e,
  46718. size: t,
  46719. distance: i,
  46720. x: 0,
  46721. y: 0,
  46722. z: 0,
  46723. scale: 1,
  46724. rotation: 0,
  46725. opacity: a,
  46726. color: o,
  46727. blending: r
  46728. })
  46729. }),
  46730. (n.LensFlare.prototype.updateLensFlares = function () {
  46731. var e,
  46732. t,
  46733. i = this.lensFlares.length,
  46734. n = 2 * -this.positionScreen.x,
  46735. r = 2 * -this.positionScreen.y
  46736. for (e = 0; e < i; e++)
  46737. (t = this.lensFlares[e]),
  46738. (t.x = this.positionScreen.x + n * t.distance),
  46739. (t.y = this.positionScreen.y + r * t.distance),
  46740. (t.wantedRotation = t.x * Math.PI * 0.25),
  46741. (t.rotation += 0.25 * (t.wantedRotation - t.rotation))
  46742. }),
  46743. (n.LensFlare.prototype.copy = function (e) {
  46744. n.Object3D.prototype.copy.call(this, e), this.positionScreen.copy(e.positionScreen), (this.customUpdateCallback = e.customUpdateCallback)
  46745. for (var t = 0, i = e.lensFlares.length; t < i; t++) this.lensFlares.push(e.lensFlares[t])
  46746. return this
  46747. }),
  46748. (n.Scene = function () {
  46749. n.Object3D.call(this), (this.type = 'Scene'), (this.fog = null), (this.overrideMaterial = null), (this.autoUpdate = !0)
  46750. }),
  46751. (n.Scene.prototype = Object.create(n.Object3D.prototype)),
  46752. (n.Scene.prototype.constructor = n.Scene),
  46753. (n.Scene.prototype.copy = function (e, t) {
  46754. return (
  46755. n.Object3D.prototype.copy.call(this, e, t),
  46756. null !== e.fog && (this.fog = e.fog.clone()),
  46757. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  46758. (this.autoUpdate = e.autoUpdate),
  46759. (this.matrixAutoUpdate = e.matrixAutoUpdate),
  46760. this
  46761. )
  46762. }),
  46763. (n.Fog = function (e, t, i) {
  46764. ;(this.name = ''), (this.color = new n.Color(e)), (this.near = void 0 !== t ? t : 1), (this.far = void 0 !== i ? i : 1e3)
  46765. }),
  46766. (n.Fog.prototype.clone = function () {
  46767. return new n.Fog(this.color.getHex(), this.near, this.far)
  46768. }),
  46769. (n.FogExp2 = function (e, t) {
  46770. ;(this.name = ''), (this.color = new n.Color(e)), (this.density = void 0 !== t ? t : 25e-5)
  46771. }),
  46772. (n.FogExp2.prototype.clone = function () {
  46773. return new n.FogExp2(this.color.getHex(), this.density)
  46774. }),
  46775. (n.ShaderChunk = {}),
  46776. (n.ShaderChunk.alphamap_fragment = '#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n'),
  46777. (n.ShaderChunk.alphamap_pars_fragment = '#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n'),
  46778. (n.ShaderChunk.alphatest_fragment = '#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n'),
  46779. (n.ShaderChunk.aomap_fragment =
  46780. '#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'),
  46781. (n.ShaderChunk.aomap_pars_fragment = '#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif'),
  46782. (n.ShaderChunk.begin_vertex = '\nvec3 transformed = vec3( position );\n'),
  46783. (n.ShaderChunk.beginnormal_vertex = '\nvec3 objectNormal = vec3( normal );\n'),
  46784. (n.ShaderChunk.bsdfs =
  46785. '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'),
  46786. (n.ShaderChunk.bumpmap_pars_fragment =
  46787. '#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'),
  46788. (n.ShaderChunk.color_fragment = '#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif'),
  46789. (n.ShaderChunk.color_pars_fragment = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n'),
  46790. (n.ShaderChunk.color_pars_vertex = '#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif'),
  46791. (n.ShaderChunk.color_vertex = '#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif'),
  46792. (n.ShaderChunk.common =
  46793. '#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'),
  46794. (n.ShaderChunk.cube_uv_reflection_fragment =
  46795. '#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'),
  46796. (n.ShaderChunk.defaultnormal_vertex = '#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n'),
  46797. (n.ShaderChunk.displacementmap_vertex = '#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n'),
  46798. (n.ShaderChunk.displacementmap_pars_vertex =
  46799. '#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n'),
  46800. (n.ShaderChunk.emissivemap_fragment =
  46801. '#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n'),
  46802. (n.ShaderChunk.emissivemap_pars_fragment = '#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n'),
  46803. (n.ShaderChunk.encodings_pars_fragment =
  46804. '\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'),
  46805. (n.ShaderChunk.encodings_fragment = ' gl_FragColor = linearToOutputTexel( gl_FragColor );\n'),
  46806. (n.ShaderChunk.envmap_fragment =
  46807. '#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'),
  46808. (n.ShaderChunk.envmap_pars_fragment =
  46809. '#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'),
  46810. (n.ShaderChunk.envmap_pars_vertex =
  46811. '#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'),
  46812. (n.ShaderChunk.envmap_vertex =
  46813. '#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'),
  46814. (n.ShaderChunk.fog_fragment =
  46815. '#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'),
  46816. (n.ShaderChunk.fog_pars_fragment =
  46817. '#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'),
  46818. (n.ShaderChunk.lightmap_fragment = '#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n'),
  46819. (n.ShaderChunk.lightmap_pars_fragment = '#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif'),
  46820. (n.ShaderChunk.lights_lambert_vertex =
  46821. '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'),
  46822. (n.ShaderChunk.lights_pars =
  46823. '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'),
  46824. (n.ShaderChunk.lights_phong_fragment =
  46825. 'BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n'),
  46826. (n.ShaderChunk.lights_phong_pars_fragment =
  46827. '#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'),
  46828. (n.ShaderChunk.lights_phong_pars_vertex = '#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n'),
  46829. (n.ShaderChunk.lights_phong_vertex = '#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n'),
  46830. (n.ShaderChunk.lights_standard_fragment =
  46831. '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'),
  46832. (n.ShaderChunk.lights_standard_pars_fragment =
  46833. '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'),
  46834. (n.ShaderChunk.lights_template =
  46835. '\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'),
  46836. (n.ShaderChunk.logdepthbuf_fragment = '#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif'),
  46837. (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'),
  46838. (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'),
  46839. (n.ShaderChunk.logdepthbuf_vertex =
  46840. '#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'),
  46841. (n.ShaderChunk.map_fragment = '#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n'),
  46842. (n.ShaderChunk.map_pars_fragment = '#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n'),
  46843. (n.ShaderChunk.map_particle_fragment =
  46844. '#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'),
  46845. (n.ShaderChunk.map_particle_pars_fragment = '#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n'),
  46846. (n.ShaderChunk.metalnessmap_fragment =
  46847. 'float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n'),
  46848. (n.ShaderChunk.metalnessmap_pars_fragment = '#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif'),
  46849. (n.ShaderChunk.morphnormal_vertex =
  46850. '#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'),
  46851. (n.ShaderChunk.morphtarget_pars_vertex =
  46852. '#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')
  46853. n.ShaderChunk.morphtarget_vertex =
  46854. '#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'
  46855. ;(n.ShaderChunk.normal_fragment =
  46856. '#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'),
  46857. (n.ShaderChunk.normalmap_pars_fragment =
  46858. '#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'),
  46859. (n.ShaderChunk.premultiplied_alpha_fragment = '#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n'),
  46860. (n.ShaderChunk.project_vertex =
  46861. '#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'),
  46862. (n.ShaderChunk.roughnessmap_fragment =
  46863. 'float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n'),
  46864. (n.ShaderChunk.roughnessmap_pars_fragment = '#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif'),
  46865. (n.ShaderChunk.shadowmap_pars_fragment =
  46866. '#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'),
  46867. (n.ShaderChunk.shadowmap_pars_vertex =
  46868. '#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'),
  46869. (n.ShaderChunk.shadowmap_vertex =
  46870. '#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'),
  46871. (n.ShaderChunk.shadowmask_pars_fragment =
  46872. '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'),
  46873. (n.ShaderChunk.skinbase_vertex =
  46874. '#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'),
  46875. (n.ShaderChunk.skinning_pars_vertex =
  46876. '#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'),
  46877. (n.ShaderChunk.skinning_vertex =
  46878. '#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'),
  46879. (n.ShaderChunk.skinnormal_vertex =
  46880. '#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'),
  46881. (n.ShaderChunk.specularmap_fragment =
  46882. 'float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif'),
  46883. (n.ShaderChunk.specularmap_pars_fragment = '#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif'),
  46884. (n.ShaderChunk.tonemapping_fragment = '#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n'),
  46885. (n.ShaderChunk.tonemapping_pars_fragment =
  46886. '#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'),
  46887. (n.ShaderChunk.uv2_pars_fragment = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif'),
  46888. (n.ShaderChunk.uv2_pars_vertex = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif'),
  46889. (n.ShaderChunk.uv2_vertex = '#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif'),
  46890. (n.ShaderChunk.uv_pars_fragment =
  46891. '#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'),
  46892. (n.ShaderChunk.uv_pars_vertex =
  46893. '#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'),
  46894. (n.ShaderChunk.uv_vertex =
  46895. '#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'),
  46896. (n.ShaderChunk.worldpos_vertex =
  46897. '#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'),
  46898. (n.UniformsUtils = {
  46899. merge: function (e) {
  46900. for (var t = {}, i = 0; i < e.length; i++) {
  46901. var n = this.clone(e[i])
  46902. for (var r in n) t[r] = n[r]
  46903. }
  46904. return t
  46905. },
  46906. clone: function (e) {
  46907. var t = {}
  46908. for (var i in e) {
  46909. t[i] = {}
  46910. for (var r in e[i]) {
  46911. var o = e[i][r]
  46912. 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
  46913. ? (t[i][r] = o.clone())
  46914. : Array.isArray(o)
  46915. ? (t[i][r] = o.slice())
  46916. : (t[i][r] = o)
  46917. }
  46918. }
  46919. return t
  46920. }
  46921. }),
  46922. (n.UniformsLib = {
  46923. common: {
  46924. diffuse: {
  46925. type: 'c',
  46926. value: new n.Color(15658734)
  46927. },
  46928. opacity: {
  46929. type: 'f',
  46930. value: 1
  46931. },
  46932. map: {
  46933. type: 't',
  46934. value: null
  46935. },
  46936. offsetRepeat: {
  46937. type: 'v4',
  46938. value: new n.Vector4(0, 0, 1, 1)
  46939. },
  46940. specularMap: {
  46941. type: 't',
  46942. value: null
  46943. },
  46944. alphaMap: {
  46945. type: 't',
  46946. value: null
  46947. },
  46948. envMap: {
  46949. type: 't',
  46950. value: null
  46951. },
  46952. flipEnvMap: {
  46953. type: 'f',
  46954. value: -1
  46955. },
  46956. reflectivity: {
  46957. type: 'f',
  46958. value: 1
  46959. },
  46960. refractionRatio: {
  46961. type: 'f',
  46962. value: 0.98
  46963. }
  46964. },
  46965. aomap: {
  46966. aoMap: {
  46967. type: 't',
  46968. value: null
  46969. },
  46970. aoMapIntensity: {
  46971. type: 'f',
  46972. value: 1
  46973. }
  46974. },
  46975. lightmap: {
  46976. lightMap: {
  46977. type: 't',
  46978. value: null
  46979. },
  46980. lightMapIntensity: {
  46981. type: 'f',
  46982. value: 1
  46983. }
  46984. },
  46985. emissivemap: {
  46986. emissiveMap: {
  46987. type: 't',
  46988. value: null
  46989. }
  46990. },
  46991. bumpmap: {
  46992. bumpMap: {
  46993. type: 't',
  46994. value: null
  46995. },
  46996. bumpScale: {
  46997. type: 'f',
  46998. value: 1
  46999. }
  47000. },
  47001. normalmap: {
  47002. normalMap: {
  47003. type: 't',
  47004. value: null
  47005. },
  47006. normalScale: {
  47007. type: 'v2',
  47008. value: new n.Vector2(1, 1)
  47009. }
  47010. },
  47011. displacementmap: {
  47012. displacementMap: {
  47013. type: 't',
  47014. value: null
  47015. },
  47016. displacementScale: {
  47017. type: 'f',
  47018. value: 1
  47019. },
  47020. displacementBias: {
  47021. type: 'f',
  47022. value: 0
  47023. }
  47024. },
  47025. roughnessmap: {
  47026. roughnessMap: {
  47027. type: 't',
  47028. value: null
  47029. }
  47030. },
  47031. metalnessmap: {
  47032. metalnessMap: {
  47033. type: 't',
  47034. value: null
  47035. }
  47036. },
  47037. fog: {
  47038. fogDensity: {
  47039. type: 'f',
  47040. value: 25e-5
  47041. },
  47042. fogNear: {
  47043. type: 'f',
  47044. value: 1
  47045. },
  47046. fogFar: {
  47047. type: 'f',
  47048. value: 2e3
  47049. },
  47050. fogColor: {
  47051. type: 'c',
  47052. value: new n.Color(16777215)
  47053. }
  47054. },
  47055. lights: {
  47056. ambientLightColor: {
  47057. type: 'fv',
  47058. value: []
  47059. },
  47060. directionalLights: {
  47061. type: 'sa',
  47062. value: [],
  47063. properties: {
  47064. direction: {
  47065. type: 'v3'
  47066. },
  47067. color: {
  47068. type: 'c'
  47069. },
  47070. shadow: {
  47071. type: 'i'
  47072. },
  47073. shadowBias: {
  47074. type: 'f'
  47075. },
  47076. shadowRadius: {
  47077. type: 'f'
  47078. },
  47079. shadowMapSize: {
  47080. type: 'v2'
  47081. }
  47082. }
  47083. },
  47084. directionalShadowMap: {
  47085. type: 'tv',
  47086. value: []
  47087. },
  47088. directionalShadowMatrix: {
  47089. type: 'm4v',
  47090. value: []
  47091. },
  47092. spotLights: {
  47093. type: 'sa',
  47094. value: [],
  47095. properties: {
  47096. color: {
  47097. type: 'c'
  47098. },
  47099. position: {
  47100. type: 'v3'
  47101. },
  47102. direction: {
  47103. type: 'v3'
  47104. },
  47105. distance: {
  47106. type: 'f'
  47107. },
  47108. coneCos: {
  47109. type: 'f'
  47110. },
  47111. penumbraCos: {
  47112. type: 'f'
  47113. },
  47114. decay: {
  47115. type: 'f'
  47116. },
  47117. shadow: {
  47118. type: 'i'
  47119. },
  47120. shadowBias: {
  47121. type: 'f'
  47122. },
  47123. shadowRadius: {
  47124. type: 'f'
  47125. },
  47126. shadowMapSize: {
  47127. type: 'v2'
  47128. }
  47129. }
  47130. },
  47131. spotShadowMap: {
  47132. type: 'tv',
  47133. value: []
  47134. },
  47135. spotShadowMatrix: {
  47136. type: 'm4v',
  47137. value: []
  47138. },
  47139. pointLights: {
  47140. type: 'sa',
  47141. value: [],
  47142. properties: {
  47143. color: {
  47144. type: 'c'
  47145. },
  47146. position: {
  47147. type: 'v3'
  47148. },
  47149. decay: {
  47150. type: 'f'
  47151. },
  47152. distance: {
  47153. type: 'f'
  47154. },
  47155. shadow: {
  47156. type: 'i'
  47157. },
  47158. shadowBias: {
  47159. type: 'f'
  47160. },
  47161. shadowRadius: {
  47162. type: 'f'
  47163. },
  47164. shadowMapSize: {
  47165. type: 'v2'
  47166. }
  47167. }
  47168. },
  47169. pointShadowMap: {
  47170. type: 'tv',
  47171. value: []
  47172. },
  47173. pointShadowMatrix: {
  47174. type: 'm4v',
  47175. value: []
  47176. },
  47177. hemisphereLights: {
  47178. type: 'sa',
  47179. value: [],
  47180. properties: {
  47181. direction: {
  47182. type: 'v3'
  47183. },
  47184. skyColor: {
  47185. type: 'c'
  47186. },
  47187. groundColor: {
  47188. type: 'c'
  47189. }
  47190. }
  47191. }
  47192. },
  47193. points: {
  47194. diffuse: {
  47195. type: 'c',
  47196. value: new n.Color(15658734)
  47197. },
  47198. opacity: {
  47199. type: 'f',
  47200. value: 1
  47201. },
  47202. size: {
  47203. type: 'f',
  47204. value: 1
  47205. },
  47206. scale: {
  47207. type: 'f',
  47208. value: 1
  47209. },
  47210. map: {
  47211. type: 't',
  47212. value: null
  47213. },
  47214. offsetRepeat: {
  47215. type: 'v4',
  47216. value: new n.Vector4(0, 0, 1, 1)
  47217. }
  47218. }
  47219. }),
  47220. (n.ShaderChunk.cube_frag =
  47221. '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'),
  47222. (n.ShaderChunk.cube_vert =
  47223. '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'),
  47224. (n.ShaderChunk.depth_frag =
  47225. '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'),
  47226. (n.ShaderChunk.depth_vert =
  47227. '#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'),
  47228. (n.ShaderChunk.depthRGBA_frag =
  47229. '#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'),
  47230. (n.ShaderChunk.depthRGBA_vert =
  47231. '#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'),
  47232. (n.ShaderChunk.distanceRGBA_frag =
  47233. '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'),
  47234. (n.ShaderChunk.distanceRGBA_vert =
  47235. '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'),
  47236. (n.ShaderChunk.equirect_frag =
  47237. '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'),
  47238. (n.ShaderChunk.equirect_vert =
  47239. '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'),
  47240. (n.ShaderChunk.linedashed_frag =
  47241. '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'),
  47242. (n.ShaderChunk.linedashed_vert =
  47243. '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'),
  47244. (n.ShaderChunk.meshbasic_frag =
  47245. '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'),
  47246. (n.ShaderChunk.meshbasic_vert =
  47247. '#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'),
  47248. (n.ShaderChunk.meshlambert_frag =
  47249. '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'),
  47250. (n.ShaderChunk.meshlambert_vert =
  47251. '#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'),
  47252. (n.ShaderChunk.meshphong_frag =
  47253. '#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'),
  47254. (n.ShaderChunk.meshphong_vert =
  47255. '#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'),
  47256. (n.ShaderChunk.meshstandard_frag =
  47257. '#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'),
  47258. (n.ShaderChunk.meshstandard_vert =
  47259. '#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'),
  47260. (n.ShaderChunk.normal_frag =
  47261. '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'),
  47262. (n.ShaderChunk.normal_vert =
  47263. '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'),
  47264. (n.ShaderChunk.points_frag =
  47265. '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'),
  47266. (n.ShaderChunk.points_vert =
  47267. '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'),
  47268. (n.ShaderLib = {
  47269. basic: {
  47270. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  47271. vertexShader: n.ShaderChunk.meshbasic_vert,
  47272. fragmentShader: n.ShaderChunk.meshbasic_frag
  47273. },
  47274. lambert: {
  47275. uniforms: n.UniformsUtils.merge([
  47276. n.UniformsLib.common,
  47277. n.UniformsLib.aomap,
  47278. n.UniformsLib.lightmap,
  47279. n.UniformsLib.emissivemap,
  47280. n.UniformsLib.fog,
  47281. n.UniformsLib.lights,
  47282. {
  47283. emissive: {
  47284. type: 'c',
  47285. value: new n.Color(0)
  47286. }
  47287. }
  47288. ]),
  47289. vertexShader: n.ShaderChunk.meshlambert_vert,
  47290. fragmentShader: n.ShaderChunk.meshlambert_frag
  47291. },
  47292. phong: {
  47293. uniforms: n.UniformsUtils.merge([
  47294. n.UniformsLib.common,
  47295. n.UniformsLib.aomap,
  47296. n.UniformsLib.lightmap,
  47297. n.UniformsLib.emissivemap,
  47298. n.UniformsLib.bumpmap,
  47299. n.UniformsLib.normalmap,
  47300. n.UniformsLib.displacementmap,
  47301. n.UniformsLib.fog,
  47302. n.UniformsLib.lights,
  47303. {
  47304. emissive: {
  47305. type: 'c',
  47306. value: new n.Color(0)
  47307. },
  47308. specular: {
  47309. type: 'c',
  47310. value: new n.Color(1118481)
  47311. },
  47312. shininess: {
  47313. type: 'f',
  47314. value: 30
  47315. }
  47316. }
  47317. ]),
  47318. vertexShader: n.ShaderChunk.meshphong_vert,
  47319. fragmentShader: n.ShaderChunk.meshphong_frag
  47320. },
  47321. standard: {
  47322. uniforms: n.UniformsUtils.merge([
  47323. n.UniformsLib.common,
  47324. n.UniformsLib.aomap,
  47325. n.UniformsLib.lightmap,
  47326. n.UniformsLib.emissivemap,
  47327. n.UniformsLib.bumpmap,
  47328. n.UniformsLib.normalmap,
  47329. n.UniformsLib.displacementmap,
  47330. n.UniformsLib.roughnessmap,
  47331. n.UniformsLib.metalnessmap,
  47332. n.UniformsLib.fog,
  47333. n.UniformsLib.lights,
  47334. {
  47335. emissive: {
  47336. type: 'c',
  47337. value: new n.Color(0)
  47338. },
  47339. roughness: {
  47340. type: 'f',
  47341. value: 0.5
  47342. },
  47343. metalness: {
  47344. type: 'f',
  47345. value: 0
  47346. },
  47347. envMapIntensity: {
  47348. type: 'f',
  47349. value: 1
  47350. }
  47351. }
  47352. ]),
  47353. vertexShader: n.ShaderChunk.meshstandard_vert,
  47354. fragmentShader: n.ShaderChunk.meshstandard_frag
  47355. },
  47356. points: {
  47357. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  47358. vertexShader: n.ShaderChunk.points_vert,
  47359. fragmentShader: n.ShaderChunk.points_frag
  47360. },
  47361. dashed: {
  47362. uniforms: n.UniformsUtils.merge([
  47363. n.UniformsLib.common,
  47364. n.UniformsLib.fog,
  47365. {
  47366. scale: {
  47367. type: 'f',
  47368. value: 1
  47369. },
  47370. dashSize: {
  47371. type: 'f',
  47372. value: 1
  47373. },
  47374. totalSize: {
  47375. type: 'f',
  47376. value: 2
  47377. }
  47378. }
  47379. ]),
  47380. vertexShader: n.ShaderChunk.linedashed_vert,
  47381. fragmentShader: n.ShaderChunk.linedashed_frag
  47382. },
  47383. depth: {
  47384. uniforms: {
  47385. mNear: {
  47386. type: 'f',
  47387. value: 1
  47388. },
  47389. mFar: {
  47390. type: 'f',
  47391. value: 2e3
  47392. },
  47393. opacity: {
  47394. type: 'f',
  47395. value: 1
  47396. }
  47397. },
  47398. vertexShader: n.ShaderChunk.depth_vert,
  47399. fragmentShader: n.ShaderChunk.depth_frag
  47400. },
  47401. normal: {
  47402. uniforms: {
  47403. opacity: {
  47404. type: 'f',
  47405. value: 1
  47406. }
  47407. },
  47408. vertexShader: n.ShaderChunk.normal_vert,
  47409. fragmentShader: n.ShaderChunk.normal_frag
  47410. },
  47411. cube: {
  47412. uniforms: {
  47413. tCube: {
  47414. type: 't',
  47415. value: null
  47416. },
  47417. tFlip: {
  47418. type: 'f',
  47419. value: -1
  47420. }
  47421. },
  47422. vertexShader: n.ShaderChunk.cube_vert,
  47423. fragmentShader: n.ShaderChunk.cube_frag
  47424. },
  47425. equirect: {
  47426. uniforms: {
  47427. tEquirect: {
  47428. type: 't',
  47429. value: null
  47430. },
  47431. tFlip: {
  47432. type: 'f',
  47433. value: -1
  47434. }
  47435. },
  47436. vertexShader: n.ShaderChunk.equirect_vert,
  47437. fragmentShader: n.ShaderChunk.equirect_frag
  47438. },
  47439. depthRGBA: {
  47440. uniforms: {},
  47441. vertexShader: n.ShaderChunk.depthRGBA_vert,
  47442. fragmentShader: n.ShaderChunk.depthRGBA_frag
  47443. },
  47444. distanceRGBA: {
  47445. uniforms: {
  47446. lightPos: {
  47447. type: 'v3',
  47448. value: new n.Vector3(0, 0, 0)
  47449. }
  47450. },
  47451. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  47452. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  47453. }
  47454. }),
  47455. (n.WebGLRenderer = function (e) {
  47456. function t() {
  47457. return null === ye ? Oe : 1
  47458. }
  47459. function i(e, t, i, n) {
  47460. se === !0 && ((e *= n), (t *= n), (i *= n)), Ye.clearColor(e, t, i, n)
  47461. }
  47462. function r() {
  47463. Ye.init(), Ye.scissor(we.copy(Le).multiplyScalar(Oe)), Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)), i(Se.r, Se.g, Se.b, Me)
  47464. }
  47465. function o() {
  47466. ;(Ae = null), (be = null), (Ee = ''), (Ie = -1), Ye.reset()
  47467. }
  47468. function a(e) {
  47469. e.preventDefault(), o(), r(), Xe.clear()
  47470. }
  47471. function s(e) {
  47472. var t = e.target
  47473. t.removeEventListener('dispose', s), h(t), ke.textures--
  47474. }
  47475. function l(e) {
  47476. var t = e.target
  47477. t.removeEventListener('dispose', l), u(t), ke.textures--
  47478. }
  47479. function c(e) {
  47480. var t = e.target
  47481. t.removeEventListener('dispose', c), d(t)
  47482. }
  47483. function h(e) {
  47484. var t = Xe.get(e)
  47485. if (e.image && t.__image__webglTextureCube) Ge.deleteTexture(t.__image__webglTextureCube)
  47486. else {
  47487. if (void 0 === t.__webglInit) return
  47488. Ge.deleteTexture(t.__webglTexture)
  47489. }
  47490. Xe.delete(e)
  47491. }
  47492. function u(e) {
  47493. var t = Xe.get(e),
  47494. i = Xe.get(e.texture)
  47495. if (e && void 0 !== i.__webglTexture) {
  47496. if ((Ge.deleteTexture(i.__webglTexture), e instanceof n.WebGLRenderTargetCube))
  47497. for (var r = 0; r < 6; r++) Ge.deleteFramebuffer(t.__webglFramebuffer[r]), Ge.deleteRenderbuffer(t.__webglDepthbuffer[r])
  47498. else Ge.deleteFramebuffer(t.__webglFramebuffer), Ge.deleteRenderbuffer(t.__webglDepthbuffer)
  47499. Xe.delete(e.texture), Xe.delete(e)
  47500. }
  47501. }
  47502. function d(e) {
  47503. p(e), Xe.delete(e)
  47504. }
  47505. function p(e) {
  47506. var t = Xe.get(e).program
  47507. ;(e.program = void 0), void 0 !== t && qe.releaseProgram(t)
  47508. }
  47509. function f(e, t, i, r) {
  47510. var o
  47511. if (i instanceof n.InstancedBufferGeometry && ((o = We.get('ANGLE_instanced_arrays')), null === o))
  47512. return void console.error('THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  47513. void 0 === r && (r = 0), Ye.initAttributes()
  47514. var a = i.attributes,
  47515. s = t.getAttributes(),
  47516. l = e.defaultAttributeValues
  47517. for (var c in s) {
  47518. var h = s[c]
  47519. if (h >= 0) {
  47520. var u = a[c]
  47521. if (void 0 !== u) {
  47522. var d = u.itemSize,
  47523. p = Ze.getAttributeBuffer(u)
  47524. if (u instanceof n.InterleavedBufferAttribute) {
  47525. var f = u.data,
  47526. g = f.stride,
  47527. m = u.offset
  47528. f instanceof n.InstancedInterleavedBuffer
  47529. ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o), void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count))
  47530. : Ye.enableAttribute(h),
  47531. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  47532. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  47533. } else
  47534. u instanceof n.InstancedBufferAttribute
  47535. ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o), void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count))
  47536. : Ye.enableAttribute(h),
  47537. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  47538. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  47539. } else if (void 0 !== l) {
  47540. var v = l[c]
  47541. if (void 0 !== v)
  47542. switch (v.length) {
  47543. case 2:
  47544. Ge.vertexAttrib2fv(h, v)
  47545. break
  47546. case 3:
  47547. Ge.vertexAttrib3fv(h, v)
  47548. break
  47549. case 4:
  47550. Ge.vertexAttrib4fv(h, v)
  47551. break
  47552. default:
  47553. Ge.vertexAttrib1fv(h, v)
  47554. }
  47555. }
  47556. }
  47557. }
  47558. Ye.disableUnusedAttributes()
  47559. }
  47560. function g(e, t) {
  47561. return Math.abs(t[0]) - Math.abs(e[0])
  47562. }
  47563. function m(e, t) {
  47564. return e.object.renderOrder !== t.object.renderOrder
  47565. ? e.object.renderOrder - t.object.renderOrder
  47566. : e.material.id !== t.material.id
  47567. ? e.material.id - t.material.id
  47568. : e.z !== t.z
  47569. ? e.z - t.z
  47570. : e.id - t.id
  47571. }
  47572. function v(e, t) {
  47573. 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
  47574. }
  47575. function A(e, t, i, n, r) {
  47576. var o, a
  47577. i.transparent ? ((o = de), (a = ++pe)) : ((o = he), (a = ++ue))
  47578. var s = o[a]
  47579. void 0 !== s
  47580. ? ((s.id = e.id), (s.object = e), (s.geometry = t), (s.material = i), (s.z = Ve.z), (s.group = r))
  47581. : ((s = {
  47582. id: e.id,
  47583. object: e,
  47584. geometry: t,
  47585. material: i,
  47586. z: Ve.z,
  47587. group: r
  47588. }),
  47589. o.push(s))
  47590. }
  47591. function y(e, t) {
  47592. if (e.visible !== !1) {
  47593. if (e.layers.test(t.layers))
  47594. if (e instanceof n.Light) ce.push(e)
  47595. else if (e instanceof n.Sprite) (e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0) || ge.push(e)
  47596. else if (e instanceof n.LensFlare) me.push(e)
  47597. else if (e instanceof n.ImmediateRenderObject) ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe)), A(e, null, e.material, Ve.z, null)
  47598. else if (
  47599. (e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) &&
  47600. (e instanceof n.SkinnedMesh && e.skeleton.update(), e.frustumCulled === !1 || Be.intersectsObject(e) === !0)
  47601. ) {
  47602. var i = e.material
  47603. if (i.visible === !0) {
  47604. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld), Ve.applyProjection(Fe))
  47605. var r = Ze.update(e)
  47606. if (i instanceof n.MultiMaterial)
  47607. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  47608. var c = o[s],
  47609. h = a[c.materialIndex]
  47610. h.visible === !0 && A(e, r, h, Ve.z, c)
  47611. }
  47612. else A(e, r, i, Ve.z, null)
  47613. }
  47614. }
  47615. for (var u = e.children, s = 0, l = u.length; s < l; s++) y(u[s], t)
  47616. }
  47617. }
  47618. function C(e, t, i, r) {
  47619. for (var o = 0, a = e.length; o < a; o++) {
  47620. var s = e[o],
  47621. l = s.object,
  47622. c = s.geometry,
  47623. h = void 0 === r ? s.material : r,
  47624. u = s.group
  47625. if ((l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld), l.normalMatrix.getNormalMatrix(l.modelViewMatrix), l instanceof n.ImmediateRenderObject)) {
  47626. E(h)
  47627. var d = w(t, i, h, l)
  47628. ;(Ee = ''),
  47629. l.render(function (e) {
  47630. ve.renderBufferImmediate(e, d, h)
  47631. })
  47632. } else ve.renderBufferDirect(t, i, c, h, l, u)
  47633. }
  47634. }
  47635. function I(e, t, i) {
  47636. var r = Xe.get(e),
  47637. o = qe.getParameters(e, Ue, t, i),
  47638. a = qe.getProgramCode(e, o),
  47639. s = r.program,
  47640. l = !0
  47641. if (void 0 === s) e.addEventListener('dispose', c)
  47642. else if (s.code !== a) p(e)
  47643. else {
  47644. if (void 0 !== o.shaderID) return
  47645. l = !1
  47646. }
  47647. if (l) {
  47648. if (o.shaderID) {
  47649. var h = n.ShaderLib[o.shaderID]
  47650. r.__webglShader = {
  47651. name: e.type,
  47652. uniforms: n.UniformsUtils.clone(h.uniforms),
  47653. vertexShader: h.vertexShader,
  47654. fragmentShader: h.fragmentShader
  47655. }
  47656. } else
  47657. r.__webglShader = {
  47658. name: e.type,
  47659. uniforms: e.uniforms,
  47660. vertexShader: e.vertexShader,
  47661. fragmentShader: e.fragmentShader
  47662. }
  47663. ;(e.__webglShader = r.__webglShader), (s = qe.acquireProgram(e, o, a)), (r.program = s), (e.program = s)
  47664. }
  47665. var u = s.getAttributes()
  47666. if (e.morphTargets) {
  47667. e.numSupportedMorphTargets = 0
  47668. for (var d = 0; d < ve.maxMorphTargets; d++) u['morphTarget' + d] >= 0 && e.numSupportedMorphTargets++
  47669. }
  47670. if (e.morphNormals) {
  47671. e.numSupportedMorphNormals = 0
  47672. for (var d = 0; d < ve.maxMorphNormals; d++) u['morphNormal' + d] >= 0 && e.numSupportedMorphNormals++
  47673. }
  47674. r.uniformsList = []
  47675. var f = r.__webglShader.uniforms,
  47676. g = r.program.getUniforms()
  47677. for (var m in f) {
  47678. var v = g[m]
  47679. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  47680. }
  47681. ;(e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) &&
  47682. ((r.lightsHash = Ue.hash),
  47683. (f.ambientLightColor.value = Ue.ambient),
  47684. (f.directionalLights.value = Ue.directional),
  47685. (f.spotLights.value = Ue.spot),
  47686. (f.pointLights.value = Ue.point),
  47687. (f.hemisphereLights.value = Ue.hemi),
  47688. (f.directionalShadowMap.value = Ue.directionalShadowMap),
  47689. (f.directionalShadowMatrix.value = Ue.directionalShadowMatrix),
  47690. (f.spotShadowMap.value = Ue.spotShadowMap),
  47691. (f.spotShadowMatrix.value = Ue.spotShadowMatrix),
  47692. (f.pointShadowMap.value = Ue.pointShadowMap),
  47693. (f.pointShadowMatrix.value = Ue.pointShadowMatrix)),
  47694. (r.hasDynamicUniforms = !1)
  47695. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  47696. var C = r.uniformsList[A][0]
  47697. if (C.dynamic === !0) {
  47698. r.hasDynamicUniforms = !0
  47699. break
  47700. }
  47701. }
  47702. }
  47703. function E(e) {
  47704. b(e),
  47705. e.transparent === !0
  47706. ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha)
  47707. : Ye.setBlending(n.NoBlending),
  47708. Ye.setDepthFunc(e.depthFunc),
  47709. Ye.setDepthTest(e.depthTest),
  47710. Ye.setDepthWrite(e.depthWrite),
  47711. Ye.setColorWrite(e.colorWrite),
  47712. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  47713. }
  47714. function b(e) {
  47715. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE), Ye.setFlipSided(e.side === n.BackSide)
  47716. }
  47717. function w(e, t, i, r) {
  47718. xe = 0
  47719. var o = Xe.get(i)
  47720. void 0 === o.program && (i.needsUpdate = !0), void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0), i.needsUpdate && (I(i, t, r), (i.needsUpdate = !1))
  47721. var a = !1,
  47722. s = !1,
  47723. l = !1,
  47724. c = o.program,
  47725. h = c.getUniforms(),
  47726. u = o.__webglShader.uniforms
  47727. if (
  47728. (c.id !== Ae && (Ge.useProgram(c.program), (Ae = c.id), (a = !0), (s = !0), (l = !0)),
  47729. i.id !== Ie && ((Ie = i.id), (s = !0)),
  47730. (a || e !== be) &&
  47731. (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  47732. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  47733. e !== be && ((be = e), (s = !0), (l = !0)),
  47734. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) &&
  47735. void 0 !== h.cameraPosition &&
  47736. (Ve.setFromMatrixPosition(e.matrixWorld), Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  47737. (i instanceof n.MeshPhongMaterial ||
  47738. i instanceof n.MeshLambertMaterial ||
  47739. i instanceof n.MeshBasicMaterial ||
  47740. i instanceof n.MeshStandardMaterial ||
  47741. i instanceof n.ShaderMaterial ||
  47742. i.skinning) &&
  47743. void 0 !== h.viewMatrix &&
  47744. Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  47745. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  47746. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  47747. i.skinning)
  47748. )
  47749. if (
  47750. (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  47751. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  47752. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture)
  47753. ) {
  47754. if (void 0 !== h.boneTexture) {
  47755. var d = B()
  47756. Ge.uniform1i(h.boneTexture, d), ve.setTexture(r.skeleton.boneTexture, d)
  47757. }
  47758. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  47759. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  47760. } else r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices)
  47761. return (
  47762. s &&
  47763. ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  47764. t && i.fog && R(u, t),
  47765. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  47766. i instanceof n.LineBasicMaterial
  47767. ? x(u, i)
  47768. : i instanceof n.LineDashedMaterial
  47769. ? (x(u, i), S(u, i))
  47770. : i instanceof n.PointsMaterial
  47771. ? M(u, i)
  47772. : i instanceof n.MeshLambertMaterial
  47773. ? P(u, i)
  47774. : i instanceof n.MeshPhongMaterial
  47775. ? O(u, i)
  47776. : i instanceof n.MeshStandardMaterial
  47777. ? L(u, i)
  47778. : i instanceof n.MeshDepthMaterial
  47779. ? ((u.mNear.value = e.near), (u.mFar.value = e.far), (u.opacity.value = i.opacity))
  47780. : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  47781. V(o.uniformsList)),
  47782. N(h, r),
  47783. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  47784. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  47785. c
  47786. )
  47787. }
  47788. function _(e, t, i) {
  47789. for (var n = [], r = 0, o = e.length; r < o; r++) {
  47790. var a = e[r][0],
  47791. s = a.onUpdateCallback
  47792. void 0 !== s && (s.bind(a)(t, i), n.push(e[r]))
  47793. }
  47794. V(n)
  47795. }
  47796. function T(e, t) {
  47797. ;(e.opacity.value = t.opacity),
  47798. (e.diffuse.value = t.color),
  47799. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  47800. (e.map.value = t.map),
  47801. (e.specularMap.value = t.specularMap),
  47802. (e.alphaMap.value = t.alphaMap),
  47803. t.aoMap && ((e.aoMap.value = t.aoMap), (e.aoMapIntensity.value = t.aoMapIntensity))
  47804. var i
  47805. if (
  47806. (t.map
  47807. ? (i = t.map)
  47808. : t.specularMap
  47809. ? (i = t.specularMap)
  47810. : t.displacementMap
  47811. ? (i = t.displacementMap)
  47812. : t.normalMap
  47813. ? (i = t.normalMap)
  47814. : t.bumpMap
  47815. ? (i = t.bumpMap)
  47816. : t.roughnessMap
  47817. ? (i = t.roughnessMap)
  47818. : t.metalnessMap
  47819. ? (i = t.metalnessMap)
  47820. : t.alphaMap
  47821. ? (i = t.alphaMap)
  47822. : t.emissiveMap && (i = t.emissiveMap),
  47823. void 0 !== i)
  47824. ) {
  47825. i instanceof n.WebGLRenderTarget && (i = i.texture)
  47826. var r = i.offset,
  47827. o = i.repeat
  47828. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  47829. }
  47830. ;(e.envMap.value = t.envMap),
  47831. (e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1),
  47832. (e.reflectivity.value = t.reflectivity),
  47833. (e.refractionRatio.value = t.refractionRatio)
  47834. }
  47835. function x(e, t) {
  47836. ;(e.diffuse.value = t.color), (e.opacity.value = t.opacity)
  47837. }
  47838. function S(e, t) {
  47839. ;(e.dashSize.value = t.dashSize), (e.totalSize.value = t.dashSize + t.gapSize), (e.scale.value = t.scale)
  47840. }
  47841. function M(e, t) {
  47842. if (((e.diffuse.value = t.color), (e.opacity.value = t.opacity), (e.size.value = t.size * Oe), (e.scale.value = te.clientHeight / 2), (e.map.value = t.map), null !== t.map)) {
  47843. var i = t.map.offset,
  47844. n = t.map.repeat
  47845. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  47846. }
  47847. }
  47848. function R(e, t) {
  47849. ;(e.fogColor.value = t.color), t instanceof n.Fog ? ((e.fogNear.value = t.near), (e.fogFar.value = t.far)) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  47850. }
  47851. function P(e, t) {
  47852. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)), t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  47853. }
  47854. function O(e, t) {
  47855. ;(e.specular.value = t.specular),
  47856. (e.shininess.value = Math.max(t.shininess, 1e-4)),
  47857. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)),
  47858. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  47859. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  47860. t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  47861. t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias))
  47862. }
  47863. function L(e, t) {
  47864. ;(e.roughness.value = t.roughness),
  47865. (e.metalness.value = t.metalness),
  47866. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  47867. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  47868. t.lightMap && ((e.lightMap.value = t.lightMap), (e.lightMapIntensity.value = t.lightMapIntensity)),
  47869. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  47870. t.bumpMap && ((e.bumpMap.value = t.bumpMap), (e.bumpScale.value = t.bumpScale)),
  47871. t.normalMap && ((e.normalMap.value = t.normalMap), e.normalScale.value.copy(t.normalScale)),
  47872. t.displacementMap && ((e.displacementMap.value = t.displacementMap), (e.displacementScale.value = t.displacementScale), (e.displacementBias.value = t.displacementBias)),
  47873. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  47874. }
  47875. function D(e, t) {
  47876. ;(e.ambientLightColor.needsUpdate = t), (e.directionalLights.needsUpdate = t), (e.pointLights.needsUpdate = t), (e.spotLights.needsUpdate = t), (e.hemisphereLights.needsUpdate = t)
  47877. }
  47878. function N(e, t) {
  47879. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements), e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  47880. }
  47881. function B() {
  47882. var e = xe
  47883. return e >= je.maxTextures && console.warn('WebGLRenderer: trying to use ' + e + ' texture units while this GPU supports only ' + je.maxTextures), (xe += 1), e
  47884. }
  47885. function F(e, t, i, r) {
  47886. var o, a
  47887. if ('1i' === t) Ge.uniform1i(i, r)
  47888. else if ('1f' === t) Ge.uniform1f(i, r)
  47889. else if ('2f' === t) Ge.uniform2f(i, r[0], r[1])
  47890. else if ('3f' === t) Ge.uniform3f(i, r[0], r[1], r[2])
  47891. else if ('4f' === t) Ge.uniform4f(i, r[0], r[1], r[2], r[3])
  47892. else if ('1iv' === t) Ge.uniform1iv(i, r)
  47893. else if ('3iv' === t) Ge.uniform3iv(i, r)
  47894. else if ('1fv' === t) Ge.uniform1fv(i, r)
  47895. else if ('2fv' === t) Ge.uniform2fv(i, r)
  47896. else if ('3fv' === t) Ge.uniform3fv(i, r)
  47897. else if ('4fv' === t) Ge.uniform4fv(i, r)
  47898. else if ('Matrix2fv' === t) Ge.uniformMatrix2fv(i, !1, r)
  47899. else if ('Matrix3fv' === t) Ge.uniformMatrix3fv(i, !1, r)
  47900. else if ('Matrix4fv' === t) Ge.uniformMatrix4fv(i, !1, r)
  47901. else if ('i' === t) Ge.uniform1i(i, r)
  47902. else if ('f' === t) Ge.uniform1f(i, r)
  47903. else if ('v2' === t) Ge.uniform2f(i, r.x, r.y)
  47904. else if ('v3' === t) Ge.uniform3f(i, r.x, r.y, r.z)
  47905. else if ('v4' === t) Ge.uniform4f(i, r.x, r.y, r.z, r.w)
  47906. else if ('c' === t) Ge.uniform3f(i, r.r, r.g, r.b)
  47907. else if ('s' === t) {
  47908. var s = e.properties
  47909. for (var l in s) {
  47910. var c = s[l],
  47911. h = i[l],
  47912. u = r[l]
  47913. F(c, c.type, h, u)
  47914. }
  47915. } else if ('sa' === t)
  47916. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  47917. for (var l in s) {
  47918. var c = s[l],
  47919. h = i[d][l],
  47920. u = r[d][l]
  47921. F(c, c.type, h, u)
  47922. }
  47923. else if ('iv1' === t) Ge.uniform1iv(i, r)
  47924. else if ('iv' === t) Ge.uniform3iv(i, r)
  47925. else if ('fv1' === t) Ge.uniform1fv(i, r)
  47926. else if ('fv' === t) Ge.uniform3fv(i, r)
  47927. else if ('v2v' === t) {
  47928. void 0 === e._array && (e._array = new Float32Array(2 * r.length))
  47929. for (var d = 0, f = 0, g = r.length; d < g; d++, f += 2) (e._array[f + 0] = r[d].x), (e._array[f + 1] = r[d].y)
  47930. Ge.uniform2fv(i, e._array)
  47931. } else if ('v3v' === t) {
  47932. void 0 === e._array && (e._array = new Float32Array(3 * r.length))
  47933. for (var d = 0, m = 0, g = r.length; d < g; d++, m += 3) (e._array[m + 0] = r[d].x), (e._array[m + 1] = r[d].y), (e._array[m + 2] = r[d].z)
  47934. Ge.uniform3fv(i, e._array)
  47935. } else if ('v4v' === t) {
  47936. void 0 === e._array && (e._array = new Float32Array(4 * r.length))
  47937. for (var d = 0, v = 0, g = r.length; d < g; d++, v += 4) (e._array[v + 0] = r[d].x), (e._array[v + 1] = r[d].y), (e._array[v + 2] = r[d].z), (e._array[v + 3] = r[d].w)
  47938. Ge.uniform4fv(i, e._array)
  47939. } else if ('m2' === t) Ge.uniformMatrix2fv(i, !1, r.elements)
  47940. else if ('m3' === t) Ge.uniformMatrix3fv(i, !1, r.elements)
  47941. else if ('m3v' === t) {
  47942. void 0 === e._array && (e._array = new Float32Array(9 * r.length))
  47943. for (var d = 0, g = r.length; d < g; d++) r[d].flattenToArrayOffset(e._array, 9 * d)
  47944. Ge.uniformMatrix3fv(i, !1, e._array)
  47945. } else if ('m4' === t) Ge.uniformMatrix4fv(i, !1, r.elements)
  47946. else if ('m4v' === t) {
  47947. void 0 === e._array && (e._array = new Float32Array(16 * r.length))
  47948. for (var d = 0, g = r.length; d < g; d++) r[d].flattenToArrayOffset(e._array, 16 * d)
  47949. Ge.uniformMatrix4fv(i, !1, e._array)
  47950. } else if ('t' === t) {
  47951. if (((o = r), (a = B()), Ge.uniform1i(i, a), !o)) return
  47952. o instanceof n.CubeTexture || (Array.isArray(o.image) && 6 === o.image.length)
  47953. ? Y(o, a)
  47954. : o instanceof n.WebGLRenderTargetCube
  47955. ? X(o.texture, a)
  47956. : o instanceof n.WebGLRenderTarget
  47957. ? ve.setTexture(o.texture, a)
  47958. : ve.setTexture(o, a)
  47959. } else if ('tv' === t) {
  47960. void 0 === e._array && (e._array = [])
  47961. for (var d = 0, g = e.value.length; d < g; d++) e._array[d] = B()
  47962. Ge.uniform1iv(i, e._array)
  47963. for (var d = 0, g = e.value.length; d < g; d++)
  47964. (o = e.value[d]),
  47965. (a = e._array[d]),
  47966. o &&
  47967. (o instanceof n.CubeTexture || (o.image instanceof Array && 6 === o.image.length)
  47968. ? Y(o, a)
  47969. : o instanceof n.WebGLRenderTarget
  47970. ? ve.setTexture(o.texture, a)
  47971. : o instanceof n.WebGLRenderTargetCube
  47972. ? X(o.texture, a)
  47973. : ve.setTexture(o, a))
  47974. } else console.warn('THREE.WebGLRenderer: Unknown uniform type: ' + t)
  47975. }
  47976. function V(e) {
  47977. for (var t = 0, i = e.length; t < i; t++) {
  47978. var n = e[t][0]
  47979. if (n.needsUpdate !== !1) {
  47980. var r = n.type,
  47981. o = e[t][1],
  47982. a = n.value
  47983. F(n, r, o, a)
  47984. }
  47985. }
  47986. }
  47987. function U(e, t) {
  47988. var i,
  47989. r,
  47990. o,
  47991. a,
  47992. s,
  47993. l,
  47994. c = 0,
  47995. h = 0,
  47996. u = 0,
  47997. d = t.matrixWorldInverse,
  47998. p = 0,
  47999. f = 0,
  48000. g = 0,
  48001. m = 0,
  48002. v = 0
  48003. for (Ue.shadowsPointLight = 0, i = 0, r = e.length; i < r; i++)
  48004. if (((o = e[i]), (a = o.color), (s = o.intensity), (l = o.distance), o instanceof n.AmbientLight)) (c += a.r * s), (h += a.g * s), (u += a.b * s)
  48005. else if (o instanceof n.DirectionalLight) {
  48006. var A = Ke.get(o)
  48007. A.color.copy(o.color).multiplyScalar(o.intensity),
  48008. A.direction.setFromMatrixPosition(o.matrixWorld),
  48009. Ve.setFromMatrixPosition(o.target.matrixWorld),
  48010. A.direction.sub(Ve),
  48011. A.direction.transformDirection(d),
  48012. (A.shadow = o.castShadow),
  48013. o.castShadow && ((A.shadowBias = o.shadow.bias), (A.shadowRadius = o.shadow.radius), (A.shadowMapSize = o.shadow.mapSize), (Ue.shadows[v++] = o)),
  48014. (Ue.directionalShadowMap[p] = o.shadow.map),
  48015. (Ue.directionalShadowMatrix[p] = o.shadow.matrix),
  48016. (Ue.directional[p++] = A)
  48017. } else if (o instanceof n.SpotLight) {
  48018. var A = Ke.get(o)
  48019. A.position.setFromMatrixPosition(o.matrixWorld),
  48020. A.position.applyMatrix4(d),
  48021. A.color.copy(a).multiplyScalar(s),
  48022. (A.distance = l),
  48023. A.direction.setFromMatrixPosition(o.matrixWorld),
  48024. Ve.setFromMatrixPosition(o.target.matrixWorld),
  48025. A.direction.sub(Ve),
  48026. A.direction.transformDirection(d),
  48027. (A.coneCos = Math.cos(o.angle)),
  48028. (A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra))),
  48029. (A.decay = 0 === o.distance ? 0 : o.decay),
  48030. (A.shadow = o.castShadow),
  48031. o.castShadow && ((A.shadowBias = o.shadow.bias), (A.shadowRadius = o.shadow.radius), (A.shadowMapSize = o.shadow.mapSize), (Ue.shadows[v++] = o)),
  48032. (Ue.spotShadowMap[g] = o.shadow.map),
  48033. (Ue.spotShadowMatrix[g] = o.shadow.matrix),
  48034. (Ue.spot[g++] = A)
  48035. } else if (o instanceof n.PointLight) {
  48036. var A = Ke.get(o)
  48037. A.position.setFromMatrixPosition(o.matrixWorld),
  48038. A.position.applyMatrix4(d),
  48039. A.color.copy(o.color).multiplyScalar(o.intensity),
  48040. (A.distance = o.distance),
  48041. (A.decay = 0 === o.distance ? 0 : o.decay),
  48042. (A.shadow = o.castShadow),
  48043. o.castShadow && ((A.shadowBias = o.shadow.bias), (A.shadowRadius = o.shadow.radius), (A.shadowMapSize = o.shadow.mapSize), (Ue.shadows[v++] = o)),
  48044. (Ue.pointShadowMap[f] = o.shadow.map),
  48045. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4()),
  48046. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  48047. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  48048. (Ue.point[f++] = A)
  48049. } else if (o instanceof n.HemisphereLight) {
  48050. var A = Ke.get(o)
  48051. A.direction.setFromMatrixPosition(o.matrixWorld),
  48052. A.direction.transformDirection(d),
  48053. A.direction.normalize(),
  48054. A.skyColor.copy(o.color).multiplyScalar(s),
  48055. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  48056. (Ue.hemi[m++] = A)
  48057. }
  48058. ;(Ue.ambient[0] = c),
  48059. (Ue.ambient[1] = h),
  48060. (Ue.ambient[2] = u),
  48061. (Ue.directional.length = p),
  48062. (Ue.spot.length = g),
  48063. (Ue.point.length = f),
  48064. (Ue.hemi.length = m),
  48065. (Ue.shadows.length = v),
  48066. (Ue.hash = p + ',' + f + ',' + g + ',' + m + ',' + v)
  48067. }
  48068. function k(e, t, i) {
  48069. var r
  48070. if (
  48071. (i
  48072. ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  48073. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  48074. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  48075. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter)))
  48076. : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  48077. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  48078. (t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping) ||
  48079. console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.', t),
  48080. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  48081. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  48082. t.minFilter !== n.NearestFilter &&
  48083. t.minFilter !== n.LinearFilter &&
  48084. console.warn('THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.', t)),
  48085. (r = We.get('EXT_texture_filter_anisotropic')))
  48086. ) {
  48087. if (t.type === n.FloatType && null === We.get('OES_texture_float_linear')) return
  48088. if (t.type === n.HalfFloatType && null === We.get('OES_texture_half_float_linear')) return
  48089. ;(t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) &&
  48090. (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())), (Xe.get(t).__currentAnisotropy = t.anisotropy))
  48091. }
  48092. }
  48093. function H(e, t, i) {
  48094. void 0 === e.__webglInit && ((e.__webglInit = !0), t.addEventListener('dispose', s), (e.__webglTexture = Ge.createTexture()), ke.textures++),
  48095. Ye.activeTexture(Ge.TEXTURE0 + i),
  48096. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  48097. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  48098. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  48099. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment)
  48100. var r = G(t.image, je.maxTextureSize)
  48101. W(t) && z(r) === !1 && (r = j(r))
  48102. var o = z(r),
  48103. a = ee(t.format),
  48104. l = ee(t.type)
  48105. k(Ge.TEXTURE_2D, t, o)
  48106. var c,
  48107. h = t.mipmaps
  48108. if (t instanceof n.DataTexture)
  48109. if (h.length > 0 && o) {
  48110. for (var u = 0, d = h.length; u < d; u++) (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data)
  48111. t.generateMipmaps = !1
  48112. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data)
  48113. else if (t instanceof n.CompressedTexture)
  48114. for (var u = 0, d = h.length; u < d; u++)
  48115. (c = h[u]),
  48116. t.format !== n.RGBAFormat && t.format !== n.RGBFormat
  48117. ? Ye.getCompressedTextureFormats().indexOf(a) > -1
  48118. ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data)
  48119. : console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()')
  48120. : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data)
  48121. else if (h.length > 0 && o) {
  48122. for (var u = 0, d = h.length; u < d; u++) (c = h[u]), Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c)
  48123. t.generateMipmaps = !1
  48124. } else Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r)
  48125. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D), (e.__version = t.version), t.onUpdate && t.onUpdate(t)
  48126. }
  48127. function G(e, t) {
  48128. if (e.width > t || e.height > t) {
  48129. var i = t / Math.max(e.width, e.height),
  48130. n = document.createElement('canvas')
  48131. ;(n.width = Math.floor(e.width * i)), (n.height = Math.floor(e.height * i))
  48132. var r = n.getContext('2d')
  48133. return (
  48134. r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  48135. console.warn('THREE.WebGLRenderer: image is too big (' + e.width + 'x' + e.height + '). Resized to ' + n.width + 'x' + n.height, e),
  48136. n
  48137. )
  48138. }
  48139. return e
  48140. }
  48141. function z(e) {
  48142. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  48143. }
  48144. function W(e) {
  48145. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || (e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter)
  48146. }
  48147. function j(e) {
  48148. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  48149. var t = document.createElement('canvas')
  48150. ;(t.width = n.Math.nearestPowerOfTwo(e.width)), (t.height = n.Math.nearestPowerOfTwo(e.height))
  48151. var i = t.getContext('2d')
  48152. return (
  48153. i.drawImage(e, 0, 0, t.width, t.height),
  48154. console.warn('THREE.WebGLRenderer: image is not power of two (' + e.width + 'x' + e.height + '). Resized to ' + t.width + 'x' + t.height, e),
  48155. t
  48156. )
  48157. }
  48158. return e
  48159. }
  48160. function Y(e, t) {
  48161. var i = Xe.get(e)
  48162. if (6 === e.image.length)
  48163. if (e.version > 0 && i.__version !== e.version) {
  48164. i.__image__webglTextureCube || (e.addEventListener('dispose', s), (i.__image__webglTextureCube = Ge.createTexture()), ke.textures++),
  48165. Ye.activeTexture(Ge.TEXTURE0 + t),
  48166. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  48167. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY)
  48168. for (var r = e instanceof n.CompressedTexture, o = e.image[0] instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  48169. !ve.autoScaleCubemaps || r || o ? (a[l] = o ? e.image[l].image : e.image[l]) : (a[l] = G(e.image[l], je.maxCubemapSize))
  48170. var c = a[0],
  48171. h = z(c),
  48172. u = ee(e.format),
  48173. d = ee(e.type)
  48174. k(Ge.TEXTURE_CUBE_MAP, e, h)
  48175. for (var l = 0; l < 6; l++)
  48176. if (r)
  48177. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  48178. (p = f[g]),
  48179. e.format !== n.RGBAFormat && e.format !== n.RGBFormat
  48180. ? Ye.getCompressedTextureFormats().indexOf(u) > -1
  48181. ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data)
  48182. : console.warn('THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()')
  48183. : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data)
  48184. else 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])
  48185. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP), (i.__version = e.version), e.onUpdate && e.onUpdate(e)
  48186. } else Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  48187. }
  48188. function X(e, t) {
  48189. Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  48190. }
  48191. function Z(e, t, i, n) {
  48192. var r = ee(t.texture.format),
  48193. o = ee(t.texture.type)
  48194. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  48195. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  48196. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  48197. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  48198. }
  48199. function q(e, t) {
  48200. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  48201. t.depthBuffer && !t.stencilBuffer
  48202. ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height), Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e))
  48203. : t.depthBuffer && t.stencilBuffer
  48204. ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height), Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e))
  48205. : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  48206. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  48207. }
  48208. function K(e) {
  48209. var t = Xe.get(e),
  48210. i = e instanceof n.WebGLRenderTargetCube
  48211. if (i) {
  48212. t.__webglDepthbuffer = []
  48213. for (var r = 0; r < 6; r++) Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]), (t.__webglDepthbuffer[r] = Ge.createRenderbuffer()), q(t.__webglDepthbuffer[r], e)
  48214. } else Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer), (t.__webglDepthbuffer = Ge.createRenderbuffer()), q(t.__webglDepthbuffer, e)
  48215. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  48216. }
  48217. function Q(e) {
  48218. var t = Xe.get(e),
  48219. i = Xe.get(e.texture)
  48220. e.addEventListener('dispose', l), (i.__webglTexture = Ge.createTexture()), ke.textures++
  48221. var r = e instanceof n.WebGLRenderTargetCube,
  48222. o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  48223. if (r) {
  48224. t.__webglFramebuffer = []
  48225. for (var a = 0; a < 6; a++) t.__webglFramebuffer[a] = Ge.createFramebuffer()
  48226. } else t.__webglFramebuffer = Ge.createFramebuffer()
  48227. if (r) {
  48228. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture), k(Ge.TEXTURE_CUBE_MAP, e.texture, o)
  48229. for (var a = 0; a < 6; a++) Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a)
  48230. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP), Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  48231. } else
  48232. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  48233. k(Ge.TEXTURE_2D, e.texture, o),
  48234. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  48235. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  48236. Ye.bindTexture(Ge.TEXTURE_2D, null)
  48237. e.depthBuffer && K(e)
  48238. }
  48239. function J(e) {
  48240. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D,
  48241. i = Xe.get(e.texture).__webglTexture
  48242. Ye.bindTexture(t, i), Ge.generateMipmap(t), Ye.bindTexture(t, null)
  48243. }
  48244. function $(e) {
  48245. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  48246. }
  48247. function ee(e) {
  48248. var t
  48249. if (e === n.RepeatWrapping) return Ge.REPEAT
  48250. if (e === n.ClampToEdgeWrapping) return Ge.CLAMP_TO_EDGE
  48251. if (e === n.MirroredRepeatWrapping) return Ge.MIRRORED_REPEAT
  48252. if (e === n.NearestFilter) return Ge.NEAREST
  48253. if (e === n.NearestMipMapNearestFilter) return Ge.NEAREST_MIPMAP_NEAREST
  48254. if (e === n.NearestMipMapLinearFilter) return Ge.NEAREST_MIPMAP_LINEAR
  48255. if (e === n.LinearFilter) return Ge.LINEAR
  48256. if (e === n.LinearMipMapNearestFilter) return Ge.LINEAR_MIPMAP_NEAREST
  48257. if (e === n.LinearMipMapLinearFilter) return Ge.LINEAR_MIPMAP_LINEAR
  48258. if (e === n.UnsignedByteType) return Ge.UNSIGNED_BYTE
  48259. if (e === n.UnsignedShort4444Type) return Ge.UNSIGNED_SHORT_4_4_4_4
  48260. if (e === n.UnsignedShort5551Type) return Ge.UNSIGNED_SHORT_5_5_5_1
  48261. if (e === n.UnsignedShort565Type) return Ge.UNSIGNED_SHORT_5_6_5
  48262. if (e === n.ByteType) return Ge.BYTE
  48263. if (e === n.ShortType) return Ge.SHORT
  48264. if (e === n.UnsignedShortType) return Ge.UNSIGNED_SHORT
  48265. if (e === n.IntType) return Ge.INT
  48266. if (e === n.UnsignedIntType) return Ge.UNSIGNED_INT
  48267. if (e === n.FloatType) return Ge.FLOAT
  48268. if (((t = We.get('OES_texture_half_float')), null !== t && e === n.HalfFloatType)) return t.HALF_FLOAT_OES
  48269. if (e === n.AlphaFormat) return Ge.ALPHA
  48270. if (e === n.RGBFormat) return Ge.RGB
  48271. if (e === n.RGBAFormat) return Ge.RGBA
  48272. if (e === n.LuminanceFormat) return Ge.LUMINANCE
  48273. if (e === n.LuminanceAlphaFormat) return Ge.LUMINANCE_ALPHA
  48274. if (e === n.AddEquation) return Ge.FUNC_ADD
  48275. if (e === n.SubtractEquation) return Ge.FUNC_SUBTRACT
  48276. if (e === n.ReverseSubtractEquation) return Ge.FUNC_REVERSE_SUBTRACT
  48277. if (e === n.ZeroFactor) return Ge.ZERO
  48278. if (e === n.OneFactor) return Ge.ONE
  48279. if (e === n.SrcColorFactor) return Ge.SRC_COLOR
  48280. if (e === n.OneMinusSrcColorFactor) return Ge.ONE_MINUS_SRC_COLOR
  48281. if (e === n.SrcAlphaFactor) return Ge.SRC_ALPHA
  48282. if (e === n.OneMinusSrcAlphaFactor) return Ge.ONE_MINUS_SRC_ALPHA
  48283. if (e === n.DstAlphaFactor) return Ge.DST_ALPHA
  48284. if (e === n.OneMinusDstAlphaFactor) return Ge.ONE_MINUS_DST_ALPHA
  48285. if (e === n.DstColorFactor) return Ge.DST_COLOR
  48286. if (e === n.OneMinusDstColorFactor) return Ge.ONE_MINUS_DST_COLOR
  48287. if (e === n.SrcAlphaSaturateFactor) return Ge.SRC_ALPHA_SATURATE
  48288. if (((t = We.get('WEBGL_compressed_texture_s3tc')), null !== t)) {
  48289. if (e === n.RGB_S3TC_DXT1_Format) return t.COMPRESSED_RGB_S3TC_DXT1_EXT
  48290. if (e === n.RGBA_S3TC_DXT1_Format) return t.COMPRESSED_RGBA_S3TC_DXT1_EXT
  48291. if (e === n.RGBA_S3TC_DXT3_Format) return t.COMPRESSED_RGBA_S3TC_DXT3_EXT
  48292. if (e === n.RGBA_S3TC_DXT5_Format) return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  48293. }
  48294. if (((t = We.get('WEBGL_compressed_texture_pvrtc')), null !== t)) {
  48295. if (e === n.RGB_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG
  48296. if (e === n.RGB_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG
  48297. if (e === n.RGBA_PVRTC_4BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG
  48298. if (e === n.RGBA_PVRTC_2BPPV1_Format) return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  48299. }
  48300. if (((t = We.get('WEBGL_compressed_texture_etc1')), null !== t && e === n.RGB_ETC1_Format)) return t.COMPRESSED_RGB_ETC1_WEBGL
  48301. if (((t = We.get('EXT_blend_minmax')), null !== t)) {
  48302. if (e === n.MinEquation) return t.MIN_EXT
  48303. if (e === n.MaxEquation) return t.MAX_EXT
  48304. }
  48305. return 0
  48306. }
  48307. console.log('THREE.WebGLRenderer', n.REVISION), (e = e || {})
  48308. var te = void 0 !== e.canvas ? e.canvas : document.createElement('canvas'),
  48309. ie = void 0 !== e.context ? e.context : null,
  48310. ne = void 0 !== e.alpha && e.alpha,
  48311. re = void 0 === e.depth || e.depth,
  48312. oe = void 0 === e.stencil || e.stencil,
  48313. ae = void 0 !== e.antialias && e.antialias,
  48314. se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha,
  48315. le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer,
  48316. ce = [],
  48317. he = [],
  48318. ue = -1,
  48319. de = [],
  48320. pe = -1,
  48321. fe = new Float32Array(8),
  48322. ge = [],
  48323. me = []
  48324. ;(this.domElement = te),
  48325. (this.context = null),
  48326. (this.autoClear = !0),
  48327. (this.autoClearColor = !0),
  48328. (this.autoClearDepth = !0),
  48329. (this.autoClearStencil = !0),
  48330. (this.sortObjects = !0),
  48331. (this.gammaFactor = 2),
  48332. (this.gammaInput = !1),
  48333. (this.gammaOutput = !1),
  48334. (this.physicallyCorrectLights = !1),
  48335. (this.toneMapping = n.LinearToneMapping),
  48336. (this.toneMappingExposure = 1),
  48337. (this.toneMappingWhitePoint = 1),
  48338. (this.maxMorphTargets = 8),
  48339. (this.maxMorphNormals = 4),
  48340. (this.autoScaleCubemaps = !0)
  48341. var ve = this,
  48342. Ae = null,
  48343. ye = null,
  48344. Ce = null,
  48345. Ie = -1,
  48346. Ee = '',
  48347. be = null,
  48348. we = new n.Vector4(),
  48349. _e = null,
  48350. Te = new n.Vector4(),
  48351. xe = 0,
  48352. Se = new n.Color(0),
  48353. Me = 0,
  48354. Re = te.width,
  48355. Pe = te.height,
  48356. Oe = 1,
  48357. Le = new n.Vector4(0, 0, Re, Pe),
  48358. De = !1,
  48359. Ne = new n.Vector4(0, 0, Re, Pe),
  48360. Be = new n.Frustum(),
  48361. Fe = new n.Matrix4(),
  48362. Ve = new n.Vector3(),
  48363. Ue = {
  48364. hash: '',
  48365. ambient: [0, 0, 0],
  48366. directional: [],
  48367. directionalShadowMap: [],
  48368. directionalShadowMatrix: [],
  48369. spot: [],
  48370. spotShadowMap: [],
  48371. spotShadowMatrix: [],
  48372. point: [],
  48373. pointShadowMap: [],
  48374. pointShadowMatrix: [],
  48375. hemi: [],
  48376. shadows: [],
  48377. shadowsPointLight: 0
  48378. },
  48379. ke = {
  48380. geometries: 0,
  48381. textures: 0
  48382. },
  48383. He = {
  48384. calls: 0,
  48385. vertices: 0,
  48386. faces: 0,
  48387. points: 0
  48388. }
  48389. this.info = {
  48390. render: He,
  48391. memory: ke,
  48392. programs: null
  48393. }
  48394. var Ge
  48395. try {
  48396. var ze = {
  48397. alpha: ne,
  48398. depth: re,
  48399. stencil: oe,
  48400. antialias: ae,
  48401. premultipliedAlpha: se,
  48402. preserveDrawingBuffer: le
  48403. }
  48404. if (((Ge = ie || te.getContext('webgl', ze) || te.getContext('experimental-webgl', ze)), null === Ge))
  48405. throw null !== te.getContext('webgl') ? 'Error creating WebGL context with your selected attributes.' : 'Error creating WebGL context.'
  48406. void 0 === Ge.getShaderPrecisionFormat &&
  48407. (Ge.getShaderPrecisionFormat = function () {
  48408. return {
  48409. rangeMin: 1,
  48410. rangeMax: 1,
  48411. precision: 1
  48412. }
  48413. }),
  48414. te.addEventListener('webglcontextlost', a, !1)
  48415. } catch (e) {
  48416. console.error('THREE.WebGLRenderer: ' + e)
  48417. }
  48418. var We = new n.WebGLExtensions(Ge)
  48419. We.get('OES_texture_float'),
  48420. We.get('OES_texture_float_linear'),
  48421. We.get('OES_texture_half_float'),
  48422. We.get('OES_texture_half_float_linear'),
  48423. We.get('OES_standard_derivatives'),
  48424. We.get('ANGLE_instanced_arrays'),
  48425. We.get('OES_element_index_uint') && (n.BufferGeometry.MaxIndex = 4294967296)
  48426. var je = new n.WebGLCapabilities(Ge, We, e),
  48427. Ye = new n.WebGLState(Ge, We, ee),
  48428. Xe = new n.WebGLProperties(),
  48429. Ze = new n.WebGLObjects(Ge, Xe, this.info),
  48430. qe = new n.WebGLPrograms(this, je),
  48431. Ke = new n.WebGLLights()
  48432. this.info.programs = qe.programs
  48433. var Qe = new n.WebGLBufferRenderer(Ge, We, He),
  48434. Je = new n.WebGLIndexedBufferRenderer(Ge, We, He)
  48435. r(), (this.context = Ge), (this.capabilities = je), (this.extensions = We), (this.properties = Xe), (this.state = Ye)
  48436. var $e = new n.WebGLShadowMap(this, Ue, Ze)
  48437. this.shadowMap = $e
  48438. var et = new n.SpritePlugin(this, ge),
  48439. tt = new n.LensFlarePlugin(this, me)
  48440. ;(this.getContext = function () {
  48441. return Ge
  48442. }),
  48443. (this.getContextAttributes = function () {
  48444. return Ge.getContextAttributes()
  48445. }),
  48446. (this.forceContextLoss = function () {
  48447. We.get('WEBGL_lose_context').loseContext()
  48448. }),
  48449. (this.getMaxAnisotropy = (function () {
  48450. var e
  48451. return function () {
  48452. if (void 0 !== e) return e
  48453. var t = We.get('EXT_texture_filter_anisotropic')
  48454. return (e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0)
  48455. }
  48456. })()),
  48457. (this.getPrecision = function () {
  48458. return je.precision
  48459. }),
  48460. (this.getPixelRatio = function () {
  48461. return Oe
  48462. }),
  48463. (this.setPixelRatio = function (e) {
  48464. void 0 !== e && ((Oe = e), this.setSize(Ne.z, Ne.w, !1))
  48465. }),
  48466. (this.getSize = function () {
  48467. return {
  48468. width: Re,
  48469. height: Pe
  48470. }
  48471. }),
  48472. (this.setSize = function (e, t, i, devicePixelRatio) {
  48473. if (devicePixelRatio != void 0)
  48474. Oe = devicePixelRatio //xzw add 改分辨率 始终保持清晰
  48475. ;(Re = e), (Pe = t), (te.width = e * Oe), (te.height = t * Oe), i !== !1 && ((te.style.width = e + 'px'), (te.style.height = t + 'px')), this.setViewport(0, 0, e, t)
  48476. }),
  48477. (this.setViewport = function (e, t, i, n) {
  48478. Ye.viewport(Ne.set(e, t, i, n))
  48479. }),
  48480. (this.setScissor = function (e, t, i, n) {
  48481. Ye.scissor(Le.set(e, t, i, n))
  48482. }),
  48483. (this.setScissorTest = function (e) {
  48484. Ye.setScissorTest((De = e))
  48485. }),
  48486. (this.getClearColor = function () {
  48487. return Se
  48488. }),
  48489. (this.setClearColor = function (e, t) {
  48490. Se.set(e), (Me = void 0 !== t ? t : 1), i(Se.r, Se.g, Se.b, Me)
  48491. }),
  48492. (this.getClearAlpha = function () {
  48493. return Me
  48494. }),
  48495. (this.setClearAlpha = function (e) {
  48496. ;(Me = e), i(Se.r, Se.g, Se.b, Me)
  48497. }),
  48498. (this.clear = function (e, t, i) {
  48499. var n = 0
  48500. ;(void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT), (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT), (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT), Ge.clear(n)
  48501. }),
  48502. (this.clearColor = function () {
  48503. this.clear(!0, !1, !1)
  48504. }),
  48505. (this.clearDepth = function () {
  48506. this.clear(!1, !0, !1)
  48507. }),
  48508. (this.clearStencil = function () {
  48509. this.clear(!1, !1, !0)
  48510. }),
  48511. (this.clearTarget = function (e, t, i, n) {
  48512. this.setRenderTarget(e), this.clear(t, i, n)
  48513. }),
  48514. (this.resetGLState = o),
  48515. (this.dispose = function () {
  48516. te.removeEventListener('webglcontextlost', a, !1)
  48517. }),
  48518. (this.renderBufferImmediate = function (e, t, i) {
  48519. Ye.initAttributes()
  48520. var r = Xe.get(e)
  48521. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  48522. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  48523. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  48524. e.hasColors && !r.color && (r.color = Ge.createBuffer())
  48525. var o = t.getAttributes()
  48526. if (
  48527. (e.hasPositions &&
  48528. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  48529. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  48530. Ye.enableAttribute(o.position),
  48531. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  48532. e.hasNormals)
  48533. ) {
  48534. if ((Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal), 'MeshPhongMaterial' !== i.type && 'MeshStandardMaterial' !== i.type && i.shading === n.FlatShading))
  48535. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  48536. var l = e.normalArray,
  48537. c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3,
  48538. h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3,
  48539. u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3
  48540. ;(l[a + 0] = c), (l[a + 1] = h), (l[a + 2] = u), (l[a + 3] = c), (l[a + 4] = h), (l[a + 5] = u), (l[a + 6] = c), (l[a + 7] = h), (l[a + 8] = u)
  48541. }
  48542. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW), Ye.enableAttribute(o.normal), Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  48543. }
  48544. e.hasUvs &&
  48545. i.map &&
  48546. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv), Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW), Ye.enableAttribute(o.uv), Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  48547. e.hasColors &&
  48548. i.vertexColors !== n.NoColors &&
  48549. (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  48550. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  48551. Ye.enableAttribute(o.color),
  48552. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  48553. Ye.disableUnusedAttributes(),
  48554. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  48555. (e.count = 0)
  48556. }),
  48557. (this.renderBufferDirect = function (e, i, r, o, a, s) {
  48558. E(o)
  48559. var l = w(e, i, o, a),
  48560. c = !1,
  48561. h = r.id + '_' + l.id + '_' + o.wireframe
  48562. h !== Ee && ((Ee = h), (c = !0))
  48563. var u = a.morphTargetInfluences
  48564. if (void 0 !== u) {
  48565. for (var d = [], p = 0, m = u.length; p < m; p++) {
  48566. var v = u[p]
  48567. d.push([v, p])
  48568. }
  48569. d.sort(g), d.length > 8 && (d.length = 8)
  48570. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  48571. var v = d[p]
  48572. if (((fe[p] = v[0]), 0 !== v[0])) {
  48573. var y = v[1]
  48574. o.morphTargets === !0 && A.position && r.addAttribute('morphTarget' + p, A.position[y]), o.morphNormals === !0 && A.normal && r.addAttribute('morphNormal' + p, A.normal[y])
  48575. } else o.morphTargets === !0 && r.removeAttribute('morphTarget' + p), o.morphNormals === !0 && r.removeAttribute('morphNormal' + p)
  48576. }
  48577. var C = l.getUniforms()
  48578. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe), (c = !0)
  48579. }
  48580. var y = r.index,
  48581. I = r.attributes.position
  48582. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r))
  48583. var b
  48584. null !== y ? ((b = Je), b.setIndex(y)) : (b = Qe), c && (f(o, l, r), null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)))
  48585. var _ = 0,
  48586. T = 1 / 0
  48587. null !== y ? (T = y.count) : void 0 !== I && (T = I.count)
  48588. var x = r.drawRange.start,
  48589. S = r.drawRange.count,
  48590. M = null !== s ? s.start : 0,
  48591. R = null !== s ? s.count : 1 / 0,
  48592. P = Math.max(_, x, M),
  48593. O = Math.min(_ + T, x + S, M + R) - 1,
  48594. L = Math.max(0, O - P + 1)
  48595. if (a instanceof n.Mesh)
  48596. if (o.wireframe === !0) Ye.setLineWidth(o.wireframeLinewidth * t()), b.setMode(Ge.LINES)
  48597. else
  48598. switch (a.drawMode) {
  48599. case n.TrianglesDrawMode:
  48600. b.setMode(Ge.TRIANGLES)
  48601. break
  48602. case n.TriangleStripDrawMode:
  48603. b.setMode(Ge.TRIANGLE_STRIP)
  48604. break
  48605. case n.TriangleFanDrawMode:
  48606. b.setMode(Ge.TRIANGLE_FAN)
  48607. }
  48608. else if (a instanceof n.Line) {
  48609. var D = o.linewidth
  48610. void 0 === D && (D = 1), Ye.setLineWidth(D * t()), a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  48611. } else a instanceof n.Points && b.setMode(Ge.POINTS)
  48612. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  48613. }),
  48614. (this.render = function (e, t, i, r) {
  48615. if (t instanceof n.Camera == !1) return void console.error('THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.')
  48616. var o = e.fog
  48617. if (
  48618. ((Ee = ''),
  48619. (Ie = -1),
  48620. (be = null),
  48621. e.autoUpdate === !0 && e.updateMatrixWorld(),
  48622. null === t.parent && t.updateMatrixWorld(),
  48623. t.matrixWorldInverse.getInverse(t.matrixWorld),
  48624. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  48625. Be.setFromMatrix(Fe),
  48626. (ce.length = 0),
  48627. (ue = -1),
  48628. (pe = -1),
  48629. (ge.length = 0),
  48630. (me.length = 0),
  48631. y(e, t),
  48632. (he.length = ue + 1),
  48633. (de.length = pe + 1),
  48634. ve.sortObjects === !0 && (he.sort(m), de.sort(v)),
  48635. U(ce, t),
  48636. $e.render(e, t),
  48637. (He.calls = 0),
  48638. (He.vertices = 0),
  48639. (He.faces = 0),
  48640. (He.points = 0),
  48641. void 0 === i && (i = null),
  48642. this.setRenderTarget(i),
  48643. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  48644. e.overrideMaterial)
  48645. ) {
  48646. var a = e.overrideMaterial
  48647. C(he, t, o, a), C(de, t, o, a)
  48648. } else Ye.setBlending(n.NoBlending), C(he, t, o), C(de, t, o)
  48649. if ((et.render(e, t), tt.render(e, t, Te), i)) {
  48650. var s = i.texture
  48651. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  48652. }
  48653. Ye.setDepthTest(!0), Ye.setDepthWrite(!0), Ye.setColorWrite(!0)
  48654. }),
  48655. (this.setFaceCulling = function (e, t) {
  48656. e === n.CullFaceNone
  48657. ? Ye.disable(Ge.CULL_FACE)
  48658. : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  48659. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  48660. Ye.enable(Ge.CULL_FACE))
  48661. }),
  48662. (this.setTexture = function (e, t) {
  48663. var i = Xe.get(e)
  48664. if (e.version > 0 && i.__version !== e.version) {
  48665. var n = e.image
  48666. return void 0 === n
  48667. ? void console.warn('THREE.WebGLRenderer: Texture marked for update but image is undefined', e)
  48668. : n.complete === !1
  48669. ? void console.warn('THREE.WebGLRenderer: Texture marked for update but image is incomplete', e)
  48670. : void H(i, e, t)
  48671. }
  48672. Ye.activeTexture(Ge.TEXTURE0 + t), Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  48673. }),
  48674. (this.getCurrentRenderTarget = function () {
  48675. return ye
  48676. }),
  48677. (this.setRenderTargetFramebuffer = function (renderTarget, defaultFramebuffer) {
  48678. //add
  48679. const renderTargetProperties = Xe.get(renderTarget)
  48680. renderTargetProperties.__webglFramebuffer = defaultFramebuffer
  48681. renderTargetProperties.__useDefaultFramebuffer = defaultFramebuffer === undefined
  48682. }),
  48683. (this.setFramebuffer = function (value) {
  48684. //add
  48685. if (Ce !== value && ye === null) Ge.bindFramebuffer(36160, value)
  48686. Ce = value
  48687. }),
  48688. (this.setRenderTarget = function (e) {
  48689. ;(ye = e), e && void 0 === Xe.get(e).__webglFramebuffer && Q(e)
  48690. var t,
  48691. i = e instanceof n.WebGLRenderTargetCube
  48692. if (e) {
  48693. var r = Xe.get(e)
  48694. ;(t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer), we.copy(e.scissor), (_e = e.scissorTest), Te.copy(e.viewport)
  48695. } else (t = null), we.copy(Le).multiplyScalar(Oe), (_e = De), Te.copy(Ne).multiplyScalar(Oe)
  48696. if ((Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t), (Ce = t)), Ye.scissor(we), Ye.setScissorTest(_e), Ye.viewport(Te), i)) {
  48697. var o = Xe.get(e.texture)
  48698. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  48699. }
  48700. }),
  48701. (this.readRenderTargetPixels = function (e, t, i, r, o, a) {
  48702. if (e instanceof n.WebGLRenderTarget == !1) return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.')
  48703. var s = Xe.get(e).__webglFramebuffer
  48704. if (s) {
  48705. var l = !1
  48706. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s), (l = !0))
  48707. try {
  48708. var c = e.texture
  48709. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  48710. return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.')
  48711. if (
  48712. !(
  48713. c.type === n.UnsignedByteType ||
  48714. ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) ||
  48715. (c.type === n.FloatType && We.get('WEBGL_color_buffer_float')) ||
  48716. (c.type === n.HalfFloatType && We.get('EXT_color_buffer_half_float'))
  48717. )
  48718. )
  48719. return void console.error('THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.')
  48720. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE
  48721. ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a)
  48722. : console.error('THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.')
  48723. } finally {
  48724. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  48725. }
  48726. }
  48727. })
  48728. }),
  48729. (n.WebGLRenderTarget = function (e, t, i) {
  48730. ;(this.uuid = n.Math.generateUUID()),
  48731. (this.width = e),
  48732. (this.height = t),
  48733. (this.scissor = new n.Vector4(0, 0, e, t)),
  48734. (this.scissorTest = !1),
  48735. (this.viewport = new n.Vector4(0, 0, e, t)),
  48736. (i = i || {}),
  48737. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  48738. (this.texture = new n.Texture(void 0, void 0, i.wrapS, i.wrapT, i.magFilter, i.minFilter, i.format, i.type, i.anisotropy)),
  48739. (this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer),
  48740. (this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer)
  48741. }),
  48742. (n.WebGLRenderTarget.prototype = {
  48743. constructor: n.WebGLRenderTarget,
  48744. setSize: function (e, t) {
  48745. ;(this.width === e && this.height === t) || ((this.width = e), (this.height = t), this.dispose()), this.viewport.set(0, 0, e, t), this.scissor.set(0, 0, e, t)
  48746. },
  48747. clone: function () {
  48748. return new this.constructor().copy(this)
  48749. },
  48750. copy: function (e) {
  48751. return (
  48752. (this.width = e.width),
  48753. (this.height = e.height),
  48754. this.viewport.copy(e.viewport),
  48755. (this.texture = e.texture.clone()),
  48756. (this.depthBuffer = e.depthBuffer),
  48757. (this.stencilBuffer = e.stencilBuffer),
  48758. this
  48759. )
  48760. },
  48761. dispose: function () {
  48762. this.dispatchEvent({
  48763. type: 'dispose'
  48764. })
  48765. }
  48766. }),
  48767. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  48768. (n.WebGLRenderTargetCube = function (e, t, i) {
  48769. n.WebGLRenderTarget.call(this, e, t, i), (this.activeCubeFace = 0), (this.activeMipMapLevel = 0)
  48770. }),
  48771. (n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype)),
  48772. (n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube),
  48773. (n.WebGLBufferRenderer = function (e, t, i) {
  48774. function r(e) {
  48775. s = e
  48776. }
  48777. function o(t, n) {
  48778. e.drawArrays(s, t, n), i.calls++, (i.vertices += n), s === e.TRIANGLES && (i.faces += n / 3)
  48779. }
  48780. function a(r) {
  48781. var o = t.get('ANGLE_instanced_arrays')
  48782. if (null === o) return void console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  48783. var a = r.attributes.position,
  48784. l = 0
  48785. a instanceof n.InterleavedBufferAttribute
  48786. ? ((l = a.data.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount))
  48787. : ((l = a.count), o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  48788. i.calls++,
  48789. (i.vertices += l * r.maxInstancedCount),
  48790. s === e.TRIANGLES && (i.faces += (r.maxInstancedCount * l) / 3)
  48791. }
  48792. var s
  48793. ;(this.setMode = r), (this.render = o), (this.renderInstances = a)
  48794. }),
  48795. (n.WebGLIndexedBufferRenderer = function (e, t, i) {
  48796. function n(e) {
  48797. s = e
  48798. }
  48799. function r(i) {
  48800. i.array instanceof Uint32Array && t.get('OES_element_index_uint') ? ((l = e.UNSIGNED_INT), (c = 4)) : ((l = e.UNSIGNED_SHORT), (c = 2))
  48801. }
  48802. function o(t, n) {
  48803. e.drawElements(s, n, l, t * c), i.calls++, (i.vertices += n), s === e.TRIANGLES && (i.faces += n / 3)
  48804. }
  48805. function a(n, r, o) {
  48806. var a = t.get('ANGLE_instanced_arrays')
  48807. return null === a
  48808. ? void console.error('THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.')
  48809. : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  48810. i.calls++,
  48811. (i.vertices += o * n.maxInstancedCount),
  48812. void (s === e.TRIANGLES && (i.faces += (n.maxInstancedCount * o) / 3)))
  48813. }
  48814. var s, l, c
  48815. ;(this.setMode = n), (this.setIndex = r), (this.render = o), (this.renderInstances = a)
  48816. }),
  48817. (n.WebGLExtensions = function (e) {
  48818. var t = {}
  48819. this.get = function (i) {
  48820. if (void 0 !== t[i]) return t[i]
  48821. var n
  48822. switch (i) {
  48823. case 'EXT_texture_filter_anisotropic':
  48824. n = e.getExtension('EXT_texture_filter_anisotropic') || e.getExtension('MOZ_EXT_texture_filter_anisotropic') || e.getExtension('WEBKIT_EXT_texture_filter_anisotropic')
  48825. break
  48826. case 'WEBGL_compressed_texture_s3tc':
  48827. n = e.getExtension('WEBGL_compressed_texture_s3tc') || e.getExtension('MOZ_WEBGL_compressed_texture_s3tc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc')
  48828. break
  48829. case 'WEBGL_compressed_texture_pvrtc':
  48830. n = e.getExtension('WEBGL_compressed_texture_pvrtc') || e.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc')
  48831. break
  48832. case 'WEBGL_compressed_texture_etc1':
  48833. n = e.getExtension('WEBGL_compressed_texture_etc1')
  48834. break
  48835. default:
  48836. n = e.getExtension(i)
  48837. }
  48838. return null === n && console.warn('THREE.WebGLRenderer: ' + i + ' extension not supported.'), (t[i] = n), n
  48839. }
  48840. }),
  48841. (n.WebGLCapabilities = function (e, t, i) {
  48842. function n(t) {
  48843. if ('highp' === t) {
  48844. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0) return 'highp'
  48845. t = 'mediump'
  48846. }
  48847. return 'mediump' === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0
  48848. ? 'mediump'
  48849. : 'lowp'
  48850. }
  48851. ;(this.getMaxPrecision = n),
  48852. (this.precision = void 0 !== i.precision ? i.precision : 'highp'),
  48853. (this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer),
  48854. (this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),
  48855. (this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),
  48856. (this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE)),
  48857. (this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),
  48858. (this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS)),
  48859. (this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),
  48860. (this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS)),
  48861. (this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),
  48862. (this.vertexTextures = this.maxVertexTextures > 0),
  48863. (this.floatFragmentTextures = !!t.get('OES_texture_float')),
  48864. (this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures)
  48865. var r = n(this.precision)
  48866. r !== this.precision && (console.warn('THREE.WebGLRenderer:', this.precision, 'not supported, using', r, 'instead.'), (this.precision = r)),
  48867. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get('EXT_frag_depth'))
  48868. }),
  48869. (n.WebGLGeometries = function (e, t, i) {
  48870. function r(e) {
  48871. var t = e.geometry
  48872. if (void 0 !== h[t.id]) return h[t.id]
  48873. t.addEventListener('dispose', o)
  48874. var r
  48875. return (
  48876. t instanceof n.BufferGeometry
  48877. ? (r = t)
  48878. : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = new n.BufferGeometry().setFromObject(e)), (r = t._bufferGeometry)),
  48879. (h[t.id] = r),
  48880. i.memory.geometries++,
  48881. r
  48882. )
  48883. }
  48884. function o(e) {
  48885. var n = e.target,
  48886. r = h[n.id]
  48887. null !== r.index && s(r.index), l(r.attributes), n.removeEventListener('dispose', o), delete h[n.id]
  48888. var a = t.get(n)
  48889. a.wireframe && s(a.wireframe), t.delete(n)
  48890. var c = t.get(r)
  48891. c.wireframe && s(c.wireframe), t.delete(r), i.memory.geometries--
  48892. }
  48893. function a(e) {
  48894. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  48895. }
  48896. function s(t) {
  48897. var i = a(t)
  48898. void 0 !== i && (e.deleteBuffer(i), c(t))
  48899. }
  48900. function l(e) {
  48901. for (var t in e) s(e[t])
  48902. }
  48903. function c(e) {
  48904. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  48905. }
  48906. var h = {}
  48907. this.get = r
  48908. }),
  48909. (n.WebGLLights = function () {
  48910. var e = {}
  48911. this.get = function (t) {
  48912. if (void 0 !== e[t.id]) return e[t.id]
  48913. var i
  48914. switch (t.type) {
  48915. case 'DirectionalLight':
  48916. i = {
  48917. direction: new n.Vector3(),
  48918. color: new n.Color(),
  48919. shadow: !1,
  48920. shadowBias: 0,
  48921. shadowRadius: 1,
  48922. shadowMapSize: new n.Vector2()
  48923. }
  48924. break
  48925. case 'SpotLight':
  48926. i = {
  48927. position: new n.Vector3(),
  48928. direction: new n.Vector3(),
  48929. color: new n.Color(),
  48930. distance: 0,
  48931. coneCos: 0,
  48932. penumbraCos: 0,
  48933. decay: 0,
  48934. shadow: !1,
  48935. shadowBias: 0,
  48936. shadowRadius: 1,
  48937. shadowMapSize: new n.Vector2()
  48938. }
  48939. break
  48940. case 'PointLight':
  48941. i = {
  48942. position: new n.Vector3(),
  48943. color: new n.Color(),
  48944. distance: 0,
  48945. decay: 0,
  48946. shadow: !1,
  48947. shadowBias: 0,
  48948. shadowRadius: 1,
  48949. shadowMapSize: new n.Vector2()
  48950. }
  48951. break
  48952. case 'HemisphereLight':
  48953. i = {
  48954. direction: new n.Vector3(),
  48955. skyColor: new n.Color(),
  48956. groundColor: new n.Color()
  48957. }
  48958. }
  48959. return (e[t.id] = i), i
  48960. }
  48961. }),
  48962. (n.WebGLObjects = function (e, t, i) {
  48963. function r(t) {
  48964. var i = u.get(t)
  48965. t.geometry instanceof n.Geometry && i.updateFromObject(t)
  48966. var r = i.index,
  48967. a = i.attributes
  48968. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER)
  48969. for (var s in a) o(a[s], e.ARRAY_BUFFER)
  48970. var l = i.morphAttributes
  48971. for (var s in l) for (var c = l[s], h = 0, d = c.length; h < d; h++) o(c[h], e.ARRAY_BUFFER)
  48972. return i
  48973. }
  48974. function o(e, i) {
  48975. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e,
  48976. o = t.get(r)
  48977. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  48978. }
  48979. function a(t, i, n) {
  48980. ;(t.__webglBuffer = e.createBuffer()), e.bindBuffer(n, t.__webglBuffer)
  48981. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW
  48982. e.bufferData(n, i.array, r), (t.version = i.version)
  48983. }
  48984. function s(t, i, n) {
  48985. e.bindBuffer(n, t.__webglBuffer),
  48986. i.dynamic === !1 || i.updateRange.count === -1
  48987. ? e.bufferSubData(n, 0, i.array)
  48988. : 0 === i.updateRange.count
  48989. ? console.error(
  48990. 'THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.'
  48991. )
  48992. : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  48993. (i.updateRange.count = 0)),
  48994. (t.version = i.version)
  48995. }
  48996. function l(e) {
  48997. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  48998. }
  48999. function c(i) {
  49000. var r = t.get(i)
  49001. if (void 0 !== r.wireframe) return r.wireframe
  49002. var a = [],
  49003. s = i.index,
  49004. l = i.attributes,
  49005. c = l.position
  49006. if (null !== s)
  49007. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  49008. var g = d[p + 0],
  49009. m = d[p + 1],
  49010. v = d[p + 2]
  49011. h(u, g, m) && a.push(g, m), h(u, m, v) && a.push(m, v), h(u, v, g) && a.push(v, g)
  49012. }
  49013. else
  49014. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  49015. var g = p + 0,
  49016. m = p + 1,
  49017. v = p + 2
  49018. a.push(g, m, m, v, v, g)
  49019. }
  49020. var A = c.count > 65535 ? Uint32Array : Uint16Array,
  49021. y = new n.BufferAttribute(new A(a), 1)
  49022. return o(y, e.ELEMENT_ARRAY_BUFFER), (r.wireframe = y), y
  49023. }
  49024. function h(e, t, i) {
  49025. if (t > i) {
  49026. var n = t
  49027. ;(t = i), (i = n)
  49028. }
  49029. var r = e[t]
  49030. return void 0 === r ? ((e[t] = [i]), !0) : r.indexOf(i) === -1 && (r.push(i), !0)
  49031. }
  49032. var u = new n.WebGLGeometries(e, t, i)
  49033. ;(this.getAttributeBuffer = l), (this.getWireframeAttribute = c), (this.update = r)
  49034. }),
  49035. (n.WebGLProgram = (function () {
  49036. function e(e) {
  49037. switch (e) {
  49038. case n.LinearEncoding:
  49039. return ['Linear', '( value )']
  49040. case n.sRGBEncoding:
  49041. return ['sRGB', '( value )']
  49042. case n.RGBEEncoding:
  49043. return ['RGBE', '( value )']
  49044. case n.RGBM7Encoding:
  49045. return ['RGBM', '( value, 7.0 )']
  49046. case n.RGBM16Encoding:
  49047. return ['RGBM', '( value, 16.0 )']
  49048. case n.RGBDEncoding:
  49049. return ['RGBD', '( value, 256.0 )']
  49050. case n.GammaEncoding:
  49051. return ['Gamma', '( value, float( GAMMA_FACTOR ) )']
  49052. default:
  49053. throw new Error('unsupported encoding: ' + e)
  49054. }
  49055. }
  49056. function t(t, i) {
  49057. var n = e(i)
  49058. return 'vec4 ' + t + '( vec4 value ) { return ' + n[0] + 'ToLinear' + n[1] + '; }'
  49059. }
  49060. function i(t, i) {
  49061. var n = e(i)
  49062. return 'vec4 ' + t + '( vec4 value ) { return LinearTo' + n[0] + n[1] + '; }'
  49063. }
  49064. function r(e, t) {
  49065. var i
  49066. switch (t) {
  49067. case n.LinearToneMapping:
  49068. i = 'Linear'
  49069. break
  49070. case n.ReinhardToneMapping:
  49071. i = 'Reinhard'
  49072. break
  49073. case n.Uncharted2ToneMapping:
  49074. i = 'Uncharted2'
  49075. break
  49076. case n.CineonToneMapping:
  49077. i = 'OptimizedCineon'
  49078. break
  49079. default:
  49080. throw new Error('unsupported toneMapping: ' + t)
  49081. }
  49082. return 'vec3 ' + e + '( vec3 color ) { return ' + i + 'ToneMapping( color ); }'
  49083. }
  49084. function o(e, t, i) {
  49085. e = e || {}
  49086. var n = [
  49087. e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? '#extension GL_OES_standard_derivatives : enable' : '',
  49088. (e.fragDepth || t.logarithmicDepthBuffer) && i.get('EXT_frag_depth') ? '#extension GL_EXT_frag_depth : enable' : '',
  49089. e.drawBuffers && i.get('WEBGL_draw_buffers') ? '#extension GL_EXT_draw_buffers : require' : '',
  49090. (e.shaderTextureLOD || t.envMap) && i.get('EXT_shader_texture_lod') ? '#extension GL_EXT_shader_texture_lod : enable' : ''
  49091. ]
  49092. return n.filter(c).join('\n')
  49093. }
  49094. function a(e) {
  49095. var t = []
  49096. for (var i in e) {
  49097. var n = e[i]
  49098. n !== !1 && t.push('#define ' + i + ' ' + n)
  49099. }
  49100. return t.join('\n')
  49101. }
  49102. function s(e, t, i) {
  49103. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  49104. var a = e.getActiveUniform(t, o),
  49105. s = a.name,
  49106. l = e.getUniformLocation(t, s),
  49107. c = f.exec(s)
  49108. if (c) {
  49109. var h = c[1],
  49110. u = c[2],
  49111. d = n[h]
  49112. d || (d = n[h] = {}), (d[u] = l)
  49113. } else if ((c = g.exec(s))) {
  49114. var p = c[1],
  49115. v = c[2],
  49116. A = c[3],
  49117. y = n[p]
  49118. y || (y = n[p] = [])
  49119. var C = y[v]
  49120. C || (C = y[v] = {}), (C[A] = l)
  49121. } else if ((c = m.exec(s))) {
  49122. var p = c[1]
  49123. n[p] = l
  49124. } else n[s] = l
  49125. }
  49126. return n
  49127. }
  49128. function l(e, t, i) {
  49129. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  49130. var a = e.getActiveAttrib(t, o),
  49131. s = a.name
  49132. n[s] = e.getAttribLocation(t, s)
  49133. }
  49134. return n
  49135. }
  49136. function c(e) {
  49137. return '' !== e
  49138. }
  49139. function h(e, t) {
  49140. return e
  49141. .replace(/NUM_DIR_LIGHTS/g, t.numDirLights)
  49142. .replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights)
  49143. .replace(/NUM_POINT_LIGHTS/g, t.numPointLights)
  49144. .replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  49145. }
  49146. function u(e) {
  49147. function t(e, t) {
  49148. var i = n.ShaderChunk[t]
  49149. if (void 0 === i) throw new Error('Can not resolve #include <' + t + '>')
  49150. return u(i)
  49151. }
  49152. var i = /#include +<([\w\d.]+)>/g
  49153. return e.replace(i, t)
  49154. }
  49155. function d(e) {
  49156. function t(e, t, i, n) {
  49157. for (var r = '', o = parseInt(t); o < parseInt(i); o++) r += n.replace(/\[ i \]/g, '[ ' + o + ' ]')
  49158. return r
  49159. }
  49160. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g
  49161. return e.replace(i, t)
  49162. }
  49163. var p = 0,
  49164. f = /^([\w\d_]+)\.([\w\d_]+)$/,
  49165. g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/,
  49166. m = /^([\w\d_]+)\[0\]$/
  49167. return function (e, f, g, m) {
  49168. var v = e.context,
  49169. A = g.extensions,
  49170. y = g.defines,
  49171. C = g.__webglShader.vertexShader,
  49172. I = g.__webglShader.fragmentShader,
  49173. E = 'SHADOWMAP_TYPE_BASIC'
  49174. m.shadowMapType === n.PCFShadowMap ? (E = 'SHADOWMAP_TYPE_PCF') : m.shadowMapType === n.PCFSoftShadowMap && (E = 'SHADOWMAP_TYPE_PCF_SOFT')
  49175. var b = 'ENVMAP_TYPE_CUBE',
  49176. w = 'ENVMAP_MODE_REFLECTION',
  49177. _ = 'ENVMAP_BLENDING_MULTIPLY'
  49178. if (m.envMap) {
  49179. switch (g.envMap.mapping) {
  49180. case n.CubeReflectionMapping:
  49181. case n.CubeRefractionMapping:
  49182. b = 'ENVMAP_TYPE_CUBE'
  49183. break
  49184. case n.CubeUVReflectionMapping:
  49185. case n.CubeUVRefractionMapping:
  49186. b = 'ENVMAP_TYPE_CUBE_UV'
  49187. break
  49188. case n.EquirectangularReflectionMapping:
  49189. case n.EquirectangularRefractionMapping:
  49190. b = 'ENVMAP_TYPE_EQUIREC'
  49191. break
  49192. case n.SphericalReflectionMapping:
  49193. b = 'ENVMAP_TYPE_SPHERE'
  49194. }
  49195. switch (g.envMap.mapping) {
  49196. case n.CubeRefractionMapping:
  49197. case n.EquirectangularRefractionMapping:
  49198. w = 'ENVMAP_MODE_REFRACTION'
  49199. }
  49200. switch (g.combine) {
  49201. case n.MultiplyOperation:
  49202. _ = 'ENVMAP_BLENDING_MULTIPLY'
  49203. break
  49204. case n.MixOperation:
  49205. _ = 'ENVMAP_BLENDING_MIX'
  49206. break
  49207. case n.AddOperation:
  49208. _ = 'ENVMAP_BLENDING_ADD'
  49209. }
  49210. }
  49211. var T,
  49212. x,
  49213. S = e.gammaFactor > 0 ? e.gammaFactor : 1,
  49214. M = o(A, m, e.extensions),
  49215. R = a(y),
  49216. P = v.createProgram()
  49217. g instanceof n.RawShaderMaterial
  49218. ? ((T = ''), (x = ''))
  49219. : ((T = [
  49220. 'precision ' + m.precision + ' float;',
  49221. 'precision ' + m.precision + ' int;',
  49222. '#define SHADER_NAME ' + g.__webglShader.name,
  49223. R,
  49224. m.supportsVertexTextures ? '#define VERTEX_TEXTURES' : '',
  49225. '#define GAMMA_FACTOR ' + S,
  49226. '#define MAX_BONES ' + m.maxBones,
  49227. m.map ? '#define USE_MAP' : '',
  49228. m.envMap ? '#define USE_ENVMAP' : '',
  49229. m.envMap ? '#define ' + w : '',
  49230. m.lightMap ? '#define USE_LIGHTMAP' : '',
  49231. m.aoMap ? '#define USE_AOMAP' : '',
  49232. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  49233. m.bumpMap ? '#define USE_BUMPMAP' : '',
  49234. m.normalMap ? '#define USE_NORMALMAP' : '',
  49235. m.displacementMap && m.supportsVertexTextures ? '#define USE_DISPLACEMENTMAP' : '',
  49236. m.specularMap ? '#define USE_SPECULARMAP' : '',
  49237. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  49238. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  49239. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  49240. m.vertexColors ? '#define USE_COLOR' : '',
  49241. m.flatShading ? '#define FLAT_SHADED' : '',
  49242. m.skinning ? '#define USE_SKINNING' : '',
  49243. m.useVertexTexture ? '#define BONE_TEXTURE' : '',
  49244. m.morphTargets ? '#define USE_MORPHTARGETS' : '',
  49245. m.morphNormals && m.flatShading === !1 ? '#define USE_MORPHNORMALS' : '',
  49246. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  49247. m.flipSided ? '#define FLIP_SIDED' : '',
  49248. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  49249. m.shadowMapEnabled ? '#define ' + E : '',
  49250. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  49251. m.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
  49252. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  49253. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth') ? '#define USE_LOGDEPTHBUF_EXT' : '',
  49254. 'uniform mat4 modelMatrix;',
  49255. 'uniform mat4 modelViewMatrix;',
  49256. 'uniform mat4 projectionMatrix;',
  49257. 'uniform mat4 viewMatrix;',
  49258. 'uniform mat3 normalMatrix;',
  49259. 'uniform vec3 cameraPosition;',
  49260. 'attribute vec3 position;',
  49261. 'attribute vec3 normal;',
  49262. 'attribute vec2 uv;',
  49263. '#ifdef USE_COLOR',
  49264. '\tattribute vec3 color;',
  49265. '#endif',
  49266. '#ifdef USE_MORPHTARGETS',
  49267. '\tattribute vec3 morphTarget0;',
  49268. '\tattribute vec3 morphTarget1;',
  49269. '\tattribute vec3 morphTarget2;',
  49270. '\tattribute vec3 morphTarget3;',
  49271. '\t#ifdef USE_MORPHNORMALS',
  49272. '\t\tattribute vec3 morphNormal0;',
  49273. '\t\tattribute vec3 morphNormal1;',
  49274. '\t\tattribute vec3 morphNormal2;',
  49275. '\t\tattribute vec3 morphNormal3;',
  49276. '\t#else',
  49277. '\t\tattribute vec3 morphTarget4;',
  49278. '\t\tattribute vec3 morphTarget5;',
  49279. '\t\tattribute vec3 morphTarget6;',
  49280. '\t\tattribute vec3 morphTarget7;',
  49281. '\t#endif',
  49282. '#endif',
  49283. '#ifdef USE_SKINNING',
  49284. '\tattribute vec4 skinIndex;',
  49285. '\tattribute vec4 skinWeight;',
  49286. '#endif',
  49287. '\n'
  49288. ]
  49289. .filter(c)
  49290. .join('\n')),
  49291. (x = [
  49292. M,
  49293. 'precision ' + m.precision + ' float;',
  49294. 'precision ' + m.precision + ' int;',
  49295. '#define SHADER_NAME ' + g.__webglShader.name,
  49296. R,
  49297. m.alphaTest ? '#define ALPHATEST ' + m.alphaTest : '',
  49298. '#define GAMMA_FACTOR ' + S,
  49299. m.useFog && m.fog ? '#define USE_FOG' : '',
  49300. m.useFog && m.fogExp ? '#define FOG_EXP2' : '',
  49301. m.map ? '#define USE_MAP' : '',
  49302. m.envMap ? '#define USE_ENVMAP' : '',
  49303. m.envMap ? '#define ' + b : '',
  49304. m.envMap ? '#define ' + w : '',
  49305. m.envMap ? '#define ' + _ : '',
  49306. m.lightMap ? '#define USE_LIGHTMAP' : '',
  49307. m.aoMap ? '#define USE_AOMAP' : '',
  49308. m.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
  49309. m.bumpMap ? '#define USE_BUMPMAP' : '',
  49310. m.normalMap ? '#define USE_NORMALMAP' : '',
  49311. m.specularMap ? '#define USE_SPECULARMAP' : '',
  49312. m.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
  49313. m.metalnessMap ? '#define USE_METALNESSMAP' : '',
  49314. m.alphaMap ? '#define USE_ALPHAMAP' : '',
  49315. m.vertexColors ? '#define USE_COLOR' : '',
  49316. m.flatShading ? '#define FLAT_SHADED' : '',
  49317. m.doubleSided ? '#define DOUBLE_SIDED' : '',
  49318. m.flipSided ? '#define FLIP_SIDED' : '',
  49319. m.shadowMapEnabled ? '#define USE_SHADOWMAP' : '',
  49320. m.shadowMapEnabled ? '#define ' + E : '',
  49321. m.pointLightShadows > 0 ? '#define POINT_LIGHT_SHADOWS' : '',
  49322. m.premultipliedAlpha ? '#define PREMULTIPLIED_ALPHA' : '',
  49323. m.physicallyCorrectLights ? '#define PHYSICALLY_CORRECT_LIGHTS' : '',
  49324. m.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
  49325. m.logarithmicDepthBuffer && e.extensions.get('EXT_frag_depth') ? '#define USE_LOGDEPTHBUF_EXT' : '',
  49326. m.envMap && e.extensions.get('EXT_shader_texture_lod') ? '#define TEXTURE_LOD_EXT' : '',
  49327. 'uniform mat4 viewMatrix;',
  49328. 'uniform vec3 cameraPosition;',
  49329. m.toneMapping !== n.NoToneMapping ? '#define TONE_MAPPING' : '',
  49330. m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : '',
  49331. m.toneMapping !== n.NoToneMapping ? r('toneMapping', m.toneMapping) : '',
  49332. m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : '',
  49333. m.mapEncoding ? t('mapTexelToLinear', m.mapEncoding) : '',
  49334. m.envMapEncoding ? t('envMapTexelToLinear', m.envMapEncoding) : '',
  49335. m.emissiveMapEncoding ? t('emissiveMapTexelToLinear', m.emissiveMapEncoding) : '',
  49336. m.outputEncoding ? i('linearToOutputTexel', m.outputEncoding) : '',
  49337. '\n'
  49338. ]
  49339. .filter(c)
  49340. .join('\n'))),
  49341. (C = u(C, m)),
  49342. (C = h(C, m)),
  49343. (I = u(I, m)),
  49344. (I = h(I, m)),
  49345. g instanceof n.ShaderMaterial == !1 && ((C = d(C)), (I = d(I)))
  49346. var O = T + C,
  49347. L = x + I,
  49348. D = n.WebGLShader(v, v.VERTEX_SHADER, O),
  49349. N = n.WebGLShader(v, v.FRAGMENT_SHADER, L)
  49350. v.attachShader(P, D),
  49351. v.attachShader(P, N),
  49352. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, 'position'),
  49353. v.linkProgram(P)
  49354. var B = v.getProgramInfoLog(P),
  49355. F = v.getShaderInfoLog(D),
  49356. V = v.getShaderInfoLog(N),
  49357. U = !0,
  49358. k = !0
  49359. v.getProgramParameter(P, v.LINK_STATUS) === !1
  49360. ? ((U = !1), console.error('THREE.WebGLProgram: shader error: ', v.getError(), 'gl.VALIDATE_STATUS', v.getProgramParameter(P, v.VALIDATE_STATUS), 'gl.getProgramInfoLog', B, F, V))
  49361. : '' !== B
  49362. ? console.warn('THREE.WebGLProgram: gl.getProgramInfoLog()', B)
  49363. : ('' !== F && '' !== V) || (k = !1),
  49364. k &&
  49365. (this.diagnostics = {
  49366. runnable: U,
  49367. material: g,
  49368. programLog: B,
  49369. vertexShader: {
  49370. log: F,
  49371. prefix: T
  49372. },
  49373. fragmentShader: {
  49374. log: V,
  49375. prefix: x
  49376. }
  49377. }),
  49378. v.deleteShader(D),
  49379. v.deleteShader(N)
  49380. var H
  49381. this.getUniforms = function () {
  49382. return void 0 === H && (H = s(v, P)), H
  49383. }
  49384. var G
  49385. return (
  49386. (this.getAttributes = function () {
  49387. return void 0 === G && (G = l(v, P)), G
  49388. }),
  49389. (this.destroy = function () {
  49390. v.deleteProgram(P), (this.program = void 0)
  49391. }),
  49392. Object.defineProperties(this, {
  49393. uniforms: {
  49394. get: function () {
  49395. return console.warn('THREE.WebGLProgram: .uniforms is now .getUniforms().'), this.getUniforms()
  49396. }
  49397. },
  49398. attributes: {
  49399. get: function () {
  49400. return console.warn('THREE.WebGLProgram: .attributes is now .getAttributes().'), this.getAttributes()
  49401. }
  49402. }
  49403. }),
  49404. (this.id = p++),
  49405. (this.code = f),
  49406. (this.usedTimes = 1),
  49407. (this.program = P),
  49408. (this.vertexShader = D),
  49409. (this.fragmentShader = N),
  49410. this
  49411. )
  49412. }
  49413. })()),
  49414. (n.WebGLPrograms = function (e, t) {
  49415. function i(e) {
  49416. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture) return 1024
  49417. var i = t.maxVertexUniforms,
  49418. r = Math.floor((i - 20) / 4),
  49419. o = r
  49420. return (
  49421. void 0 !== e &&
  49422. e instanceof n.SkinnedMesh &&
  49423. ((o = Math.min(e.skeleton.bones.length, o)),
  49424. 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)')),
  49425. o
  49426. )
  49427. }
  49428. function r(e, t) {
  49429. var i
  49430. return (
  49431. e ? (e instanceof n.Texture ? (i = e.encoding) : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding)) : (i = n.LinearEncoding),
  49432. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  49433. i
  49434. )
  49435. }
  49436. var o = [],
  49437. a = {
  49438. MeshDepthMaterial: 'depth',
  49439. MeshNormalMaterial: 'normal',
  49440. MeshBasicMaterial: 'basic',
  49441. MeshLambertMaterial: 'lambert',
  49442. MeshPhongMaterial: 'phong',
  49443. MeshStandardMaterial: 'standard',
  49444. LineBasicMaterial: 'basic',
  49445. LineDashedMaterial: 'dashed',
  49446. PointsMaterial: 'points'
  49447. },
  49448. s = [
  49449. 'precision',
  49450. 'supportsVertexTextures',
  49451. 'map',
  49452. 'mapEncoding',
  49453. 'envMap',
  49454. 'envMapMode',
  49455. 'envMapEncoding',
  49456. 'lightMap',
  49457. 'aoMap',
  49458. 'emissiveMap',
  49459. 'emissiveMapEncoding',
  49460. 'bumpMap',
  49461. 'normalMap',
  49462. 'displacementMap',
  49463. 'specularMap',
  49464. 'roughnessMap',
  49465. 'metalnessMap',
  49466. 'alphaMap',
  49467. 'combine',
  49468. 'vertexColors',
  49469. 'fog',
  49470. 'useFog',
  49471. 'fogExp',
  49472. 'flatShading',
  49473. 'sizeAttenuation',
  49474. 'logarithmicDepthBuffer',
  49475. 'skinning',
  49476. 'maxBones',
  49477. 'useVertexTexture',
  49478. 'morphTargets',
  49479. 'morphNormals',
  49480. 'maxMorphTargets',
  49481. 'maxMorphNormals',
  49482. 'premultipliedAlpha',
  49483. 'numDirLights',
  49484. 'numPointLights',
  49485. 'numSpotLights',
  49486. 'numHemiLights',
  49487. 'shadowMapEnabled',
  49488. 'pointLightShadows',
  49489. 'toneMapping',
  49490. 'physicallyCorrectLights',
  49491. 'shadowMapType',
  49492. 'alphaTest',
  49493. 'doubleSided',
  49494. 'flipSided'
  49495. ]
  49496. ;(this.getParameters = function (o, s, l, c) {
  49497. var h = a[o.type],
  49498. u = i(c),
  49499. d = e.getPrecision()
  49500. null !== o.precision && ((d = t.getMaxPrecision(o.precision)), d !== o.precision && console.warn('THREE.WebGLProgram.getParameters:', o.precision, 'not supported, using', d, 'instead.'))
  49501. var p = {
  49502. shaderID: h,
  49503. precision: d,
  49504. supportsVertexTextures: t.vertexTextures,
  49505. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  49506. map: !!o.map,
  49507. mapEncoding: r(o.map, e.gammaInput),
  49508. envMap: !!o.envMap,
  49509. envMapMode: o.envMap && o.envMap.mapping,
  49510. envMapEncoding: r(o.envMap, e.gammaInput),
  49511. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  49512. lightMap: !!o.lightMap,
  49513. aoMap: !!o.aoMap,
  49514. emissiveMap: !!o.emissiveMap,
  49515. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  49516. bumpMap: !!o.bumpMap,
  49517. normalMap: !!o.normalMap,
  49518. displacementMap: !!o.displacementMap,
  49519. roughnessMap: !!o.roughnessMap,
  49520. metalnessMap: !!o.metalnessMap,
  49521. specularMap: !!o.specularMap,
  49522. alphaMap: !!o.alphaMap,
  49523. combine: o.combine,
  49524. vertexColors: o.vertexColors,
  49525. fog: l,
  49526. useFog: o.fog,
  49527. fogExp: l instanceof n.FogExp2,
  49528. flatShading: o.shading === n.FlatShading,
  49529. sizeAttenuation: o.sizeAttenuation,
  49530. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  49531. skinning: o.skinning,
  49532. maxBones: u,
  49533. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  49534. morphTargets: o.morphTargets,
  49535. morphNormals: o.morphNormals,
  49536. maxMorphTargets: e.maxMorphTargets,
  49537. maxMorphNormals: e.maxMorphNormals,
  49538. numDirLights: s.directional.length,
  49539. numPointLights: s.point.length,
  49540. numSpotLights: s.spot.length,
  49541. numHemiLights: s.hemi.length,
  49542. pointLightShadows: s.shadowsPointLight,
  49543. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  49544. shadowMapType: e.shadowMap.type,
  49545. toneMapping: e.toneMapping,
  49546. physicallyCorrectLights: e.physicallyCorrectLights,
  49547. premultipliedAlpha: o.premultipliedAlpha,
  49548. alphaTest: o.alphaTest,
  49549. doubleSided: o.side === n.DoubleSide,
  49550. flipSided: o.side === n.BackSide
  49551. }
  49552. return p
  49553. }),
  49554. (this.getProgramCode = function (e, t) {
  49555. var i = []
  49556. if ((t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader), i.push(e.vertexShader)), void 0 !== e.defines)) for (var n in e.defines) i.push(n), i.push(e.defines[n])
  49557. for (var r = 0; r < s.length; r++) {
  49558. var o = s[r]
  49559. i.push(o), i.push(t[o])
  49560. }
  49561. return i.join()
  49562. }),
  49563. (this.acquireProgram = function (t, i, r) {
  49564. for (var a, s = 0, l = o.length; s < l; s++) {
  49565. var c = o[s]
  49566. if (c.code === r) {
  49567. ;(a = c), ++a.usedTimes
  49568. break
  49569. }
  49570. }
  49571. return void 0 === a && ((a = new n.WebGLProgram(e, r, t, i)), o.push(a)), a
  49572. }),
  49573. (this.releaseProgram = function (e) {
  49574. if (0 === --e.usedTimes) {
  49575. var t = o.indexOf(e)
  49576. ;(o[t] = o[o.length - 1]), o.pop(), e.destroy()
  49577. }
  49578. }),
  49579. (this.programs = o)
  49580. }),
  49581. (n.WebGLProperties = function () {
  49582. var e = {}
  49583. ;(this.get = function (t) {
  49584. var i = t.uuid,
  49585. n = e[i]
  49586. return void 0 === n && ((n = {}), (e[i] = n)), n
  49587. }),
  49588. (this.delete = function (t) {
  49589. delete e[t.uuid]
  49590. }),
  49591. (this.clear = function () {
  49592. e = {}
  49593. })
  49594. }),
  49595. (n.WebGLShader = (function () {
  49596. function e(e) {
  49597. for (var t = e.split('\n'), i = 0; i < t.length; i++) t[i] = i + 1 + ': ' + t[i]
  49598. return t.join('\n')
  49599. }
  49600. return function (t, i, n) {
  49601. var r = t.createShader(i)
  49602. return (
  49603. t.shaderSource(r, n),
  49604. t.compileShader(r),
  49605. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  49606. '' !== t.getShaderInfoLog(r) && console.warn('THREE.WebGLShader: gl.getShaderInfoLog()', i === t.VERTEX_SHADER ? 'vertex' : 'fragment', t.getShaderInfoLog(r), e(n)),
  49607. r
  49608. )
  49609. }
  49610. })()),
  49611. (n.WebGLShadowMap = function (e, t, i) {
  49612. function r(e, t, i, r) {
  49613. var o = e.geometry,
  49614. a = null,
  49615. s = v,
  49616. l = e.customDepthMaterial
  49617. if ((i && ((s = A), (l = e.customDistanceMaterial)), l)) a = l
  49618. else {
  49619. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets,
  49620. h = e instanceof n.SkinnedMesh && t.skinning,
  49621. u = 0
  49622. c && (u |= f), h && (u |= g), (a = s[u])
  49623. }
  49624. return (a.visible = t.visible), (a.wireframe = t.wireframe), (a.wireframeLinewidth = t.wireframeLinewidth), i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r), a
  49625. }
  49626. function o(e, t, i) {
  49627. if (e.visible !== !1) {
  49628. 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)) {
  49629. var r = e.material
  49630. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld), p.push(e))
  49631. }
  49632. for (var a = e.children, s = 0, c = a.length; s < c; s++) o(a[s], t, i)
  49633. }
  49634. }
  49635. for (
  49636. var a = e.context,
  49637. s = e.state,
  49638. l = new n.Frustum(),
  49639. c = new n.Matrix4(),
  49640. h = new n.Vector2(),
  49641. u = new n.Vector3(),
  49642. d = new n.Vector3(),
  49643. p = [],
  49644. f = 1,
  49645. g = 2,
  49646. m = (f | g) + 1,
  49647. v = new Array(m),
  49648. A = new Array(m),
  49649. 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)],
  49650. 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)],
  49651. I = [new n.Vector4(), new n.Vector4(), new n.Vector4(), new n.Vector4(), new n.Vector4(), new n.Vector4()],
  49652. E = n.ShaderLib.depthRGBA,
  49653. b = n.UniformsUtils.clone(E.uniforms),
  49654. w = n.ShaderLib.distanceRGBA,
  49655. _ = n.UniformsUtils.clone(w.uniforms),
  49656. T = 0;
  49657. T !== m;
  49658. ++T
  49659. ) {
  49660. var x = 0 !== (T & f),
  49661. S = 0 !== (T & g),
  49662. M = new n.ShaderMaterial({
  49663. uniforms: b,
  49664. vertexShader: E.vertexShader,
  49665. fragmentShader: E.fragmentShader,
  49666. morphTargets: x,
  49667. skinning: S
  49668. })
  49669. v[T] = M
  49670. var R = new n.ShaderMaterial({
  49671. defines: {
  49672. USE_SHADOWMAP: ''
  49673. },
  49674. uniforms: _,
  49675. vertexShader: w.vertexShader,
  49676. fragmentShader: w.fragmentShader,
  49677. morphTargets: x,
  49678. skinning: S
  49679. })
  49680. A[T] = R
  49681. }
  49682. var P = this
  49683. ;(this.enabled = !1),
  49684. (this.autoUpdate = !0),
  49685. (this.needsUpdate = !1),
  49686. (this.type = n.PCFShadowMap),
  49687. (this.cullFace = n.CullFaceFront),
  49688. (this.render = function (f, g) {
  49689. var m,
  49690. v,
  49691. A = t.shadows
  49692. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  49693. s.clearColor(1, 1, 1, 1),
  49694. s.disable(a.BLEND),
  49695. s.enable(a.CULL_FACE),
  49696. a.frontFace(a.CCW),
  49697. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  49698. s.setDepthTest(!0),
  49699. s.setScissorTest(!1)
  49700. for (var E = 0, b = A.length; E < b; E++) {
  49701. var w = A[E],
  49702. _ = w.shadow,
  49703. T = _.camera
  49704. if ((h.copy(_.mapSize), w instanceof n.PointLight)) {
  49705. ;(m = 6), (v = !0)
  49706. var x = h.x,
  49707. S = h.y
  49708. I[0].set(2 * x, S, x, S), I[1].set(0, S, x, S), I[2].set(3 * x, S, x, S), I[3].set(x, S, x, S), I[4].set(3 * x, 0, x, S), I[5].set(x, 0, x, S), (h.x *= 4), (h.y *= 2)
  49709. } else (m = 1), (v = !1)
  49710. if (null === _.map) {
  49711. var M = {
  49712. minFilter: n.NearestFilter,
  49713. magFilter: n.NearestFilter,
  49714. format: n.RGBAFormat
  49715. }
  49716. ;(_.map = new n.WebGLRenderTarget(h.x, h.y, M)), w instanceof n.SpotLight && (T.aspect = h.x / h.y), T.updateProjectionMatrix()
  49717. }
  49718. var R = _.map,
  49719. O = _.matrix
  49720. d.setFromMatrixPosition(w.matrixWorld), T.position.copy(d), e.setRenderTarget(R), e.clear()
  49721. for (var L = 0; L < m; L++) {
  49722. if (v) {
  49723. u.copy(T.position), u.add(y[L]), T.up.copy(C[L]), T.lookAt(u)
  49724. var D = I[L]
  49725. s.viewport(D)
  49726. } else u.setFromMatrixPosition(w.target.matrixWorld), T.lookAt(u)
  49727. T.updateMatrixWorld(),
  49728. T.matrixWorldInverse.getInverse(T.matrixWorld),
  49729. O.set(0.5, 0, 0, 0.5, 0, 0.5, 0, 0.5, 0, 0, 0.5, 0.5, 0, 0, 0, 1),
  49730. O.multiply(T.projectionMatrix),
  49731. O.multiply(T.matrixWorldInverse),
  49732. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  49733. l.setFromMatrix(c),
  49734. (p.length = 0),
  49735. o(f, g, T)
  49736. for (var N = 0, B = p.length; N < B; N++) {
  49737. var F = p[N],
  49738. V = i.update(F),
  49739. U = F.material
  49740. if (U instanceof n.MultiMaterial)
  49741. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  49742. var W = k[G],
  49743. j = H[W.materialIndex]
  49744. if (j.visible === !0) {
  49745. var Y = r(F, j, v, d)
  49746. e.renderBufferDirect(T, null, V, Y, F, W)
  49747. }
  49748. }
  49749. else {
  49750. var Y = r(F, U, v, d)
  49751. e.renderBufferDirect(T, null, V, Y, F, null)
  49752. }
  49753. }
  49754. }
  49755. }
  49756. var X = e.getClearColor(),
  49757. Z = e.getClearAlpha()
  49758. e.setClearColor(X, Z), s.enable(a.BLEND), P.cullFace === n.CullFaceFront && a.cullFace(a.BACK), (P.needsUpdate = !1)
  49759. }
  49760. })
  49761. }),
  49762. (n.WebGLState = function (e, t, i) {
  49763. var r = this,
  49764. o = new n.Vector4(),
  49765. a = new Uint8Array(16),
  49766. s = new Uint8Array(16),
  49767. l = new Uint8Array(16),
  49768. c = {},
  49769. h = null,
  49770. u = null,
  49771. d = null,
  49772. p = null,
  49773. f = null,
  49774. g = null,
  49775. m = null,
  49776. v = null,
  49777. A = !1,
  49778. y = null,
  49779. C = null,
  49780. I = null,
  49781. E = null,
  49782. b = null,
  49783. w = null,
  49784. _ = null,
  49785. T = null,
  49786. x = null,
  49787. S = null,
  49788. M = null,
  49789. R = null,
  49790. P = null,
  49791. O = null,
  49792. L = null,
  49793. D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  49794. N = void 0,
  49795. B = {},
  49796. F = new n.Vector4(),
  49797. V = null,
  49798. U = null,
  49799. k = new n.Vector4(),
  49800. H = new n.Vector4(),
  49801. G = e.createTexture()
  49802. e.bindTexture(e.TEXTURE_2D, G),
  49803. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  49804. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  49805. (this.init = function () {
  49806. this.clearColor(0, 0, 0, 1),
  49807. this.clearDepth(1),
  49808. this.clearStencil(0),
  49809. this.enable(e.DEPTH_TEST),
  49810. e.depthFunc(e.LEQUAL),
  49811. e.frontFace(e.CCW),
  49812. e.cullFace(e.BACK),
  49813. this.enable(e.CULL_FACE),
  49814. this.enable(e.BLEND),
  49815. e.blendEquation(e.FUNC_ADD),
  49816. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  49817. }),
  49818. (this.initAttributes = function () {
  49819. for (var e = 0, t = a.length; e < t; e++) a[e] = 0
  49820. }),
  49821. (this.enableAttribute = function (i) {
  49822. if (((a[i] = 1), 0 === s[i] && (e.enableVertexAttribArray(i), (s[i] = 1)), 0 !== l[i])) {
  49823. var n = t.get('ANGLE_instanced_arrays')
  49824. n.vertexAttribDivisorANGLE(i, 0), (l[i] = 0)
  49825. }
  49826. }),
  49827. (this.enableAttributeAndDivisor = function (t, i, n) {
  49828. ;(a[t] = 1), 0 === s[t] && (e.enableVertexAttribArray(t), (s[t] = 1)), l[t] !== i && (n.vertexAttribDivisorANGLE(t, i), (l[t] = i))
  49829. }),
  49830. (this.disableUnusedAttributes = function () {
  49831. for (var t = 0, i = s.length; t < i; t++) s[t] !== a[t] && (e.disableVertexAttribArray(t), (s[t] = 0))
  49832. }),
  49833. (this.enable = function (t) {
  49834. c[t] !== !0 && (e.enable(t), (c[t] = !0))
  49835. }),
  49836. (this.disable = function (t) {
  49837. c[t] !== !1 && (e.disable(t), (c[t] = !1))
  49838. }),
  49839. (this.getCompressedTextureFormats = function () {
  49840. if (null === h && ((h = []), t.get('WEBGL_compressed_texture_pvrtc') || t.get('WEBGL_compressed_texture_s3tc') || t.get('WEBGL_compressed_texture_etc1')))
  49841. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++) h.push(i[n])
  49842. return h
  49843. }),
  49844. (this.setBlending = function (t, r, o, a, s, l, c, h) {
  49845. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  49846. (t === u && h === A) ||
  49847. (t === n.AdditiveBlending
  49848. ? h
  49849. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE))
  49850. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.SRC_ALPHA, e.ONE))
  49851. : t === n.SubtractiveBlending
  49852. ? h
  49853. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA))
  49854. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR))
  49855. : t === n.MultiplyBlending
  49856. ? h
  49857. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA))
  49858. : (e.blendEquation(e.FUNC_ADD), e.blendFunc(e.ZERO, e.SRC_COLOR))
  49859. : h
  49860. ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA))
  49861. : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD), e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  49862. (u = t),
  49863. (A = h)),
  49864. t === n.CustomBlending
  49865. ? ((s = s || r),
  49866. (l = l || o),
  49867. (c = c || a),
  49868. (r === d && s === g) || (e.blendEquationSeparate(i(r), i(s)), (d = r), (g = s)),
  49869. (o === p && a === f && l === m && c === v) || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)), (p = o), (f = a), (m = l), (v = c)))
  49870. : ((d = null), (p = null), (f = null), (g = null), (m = null), (v = null))
  49871. }),
  49872. (this.setDepthFunc = function (t) {
  49873. if (y !== t) {
  49874. if (t)
  49875. switch (t) {
  49876. case n.NeverDepth:
  49877. e.depthFunc(e.NEVER)
  49878. break
  49879. case n.AlwaysDepth:
  49880. e.depthFunc(e.ALWAYS)
  49881. break
  49882. case n.LessDepth:
  49883. e.depthFunc(e.LESS)
  49884. break
  49885. case n.LessEqualDepth:
  49886. e.depthFunc(e.LEQUAL)
  49887. break
  49888. case n.EqualDepth:
  49889. e.depthFunc(e.EQUAL)
  49890. break
  49891. case n.GreaterEqualDepth:
  49892. e.depthFunc(e.GEQUAL)
  49893. break
  49894. case n.GreaterDepth:
  49895. e.depthFunc(e.GREATER)
  49896. break
  49897. case n.NotEqualDepth:
  49898. e.depthFunc(e.NOTEQUAL)
  49899. break
  49900. default:
  49901. e.depthFunc(e.LEQUAL)
  49902. }
  49903. else e.depthFunc(e.LEQUAL)
  49904. y = t
  49905. }
  49906. }),
  49907. (this.setDepthTest = function (t) {
  49908. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  49909. }),
  49910. (this.setDepthWrite = function (t) {
  49911. C !== t && (e.depthMask(t), (C = t))
  49912. }),
  49913. (this.setColorWrite = function (t) {
  49914. I !== t && (e.colorMask(t, t, t, t), (I = t))
  49915. }),
  49916. (this.setStencilFunc = function (t, i, n) {
  49917. ;(b === t && w === i && _ === n) || (e.stencilFunc(t, i, n), (b = t), (w = i), (_ = n))
  49918. }),
  49919. (this.setStencilOp = function (t, i, n) {
  49920. ;(T === t && x === i && S === n) || (e.stencilOp(t, i, n), (T = t), (x = i), (S = n))
  49921. }),
  49922. (this.setStencilTest = function (t) {
  49923. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  49924. }),
  49925. (this.setStencilWrite = function (t) {
  49926. E !== t && (e.stencilMask(t), (E = t))
  49927. }),
  49928. (this.setFlipSided = function (t) {
  49929. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW), (M = t))
  49930. }),
  49931. (this.setLineWidth = function (t) {
  49932. t !== R && (e.lineWidth(t), (R = t))
  49933. }),
  49934. (this.setPolygonOffset = function (t, i, n) {
  49935. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL), !t || (P === i && O === n) || (e.polygonOffset(i, n), (P = i), (O = n))
  49936. }),
  49937. (this.getScissorTest = function () {
  49938. return L
  49939. }),
  49940. (this.setScissorTest = function (t) {
  49941. ;(L = t), t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  49942. }),
  49943. (this.activeTexture = function (t) {
  49944. void 0 === t && (t = e.TEXTURE0 + D - 1), N !== t && (e.activeTexture(t), (N = t))
  49945. }),
  49946. (this.bindTexture = function (t, i) {
  49947. void 0 === N && r.activeTexture()
  49948. var n = B[N]
  49949. void 0 === n &&
  49950. ((n = {
  49951. type: void 0,
  49952. texture: void 0
  49953. }),
  49954. (B[N] = n)),
  49955. (n.type === t && n.texture === i) || (e.bindTexture(t, i || G), (n.type = t), (n.texture = i))
  49956. }),
  49957. (this.compressedTexImage2D = function () {
  49958. try {
  49959. e.compressedTexImage2D.apply(e, arguments)
  49960. } catch (e) {
  49961. console.error(e)
  49962. }
  49963. }),
  49964. (this.texImage2D = function () {
  49965. try {
  49966. e.texImage2D.apply(e, arguments)
  49967. } catch (e) {
  49968. console.error(e)
  49969. }
  49970. }),
  49971. (this.clearColor = function (t, i, n, r) {
  49972. o.set(t, i, n, r), F.equals(o) === !1 && (e.clearColor(t, i, n, r), F.copy(o))
  49973. }),
  49974. (this.clearDepth = function (t) {
  49975. V !== t && (e.clearDepth(t), (V = t))
  49976. }),
  49977. (this.clearStencil = function (t) {
  49978. U !== t && (e.clearStencil(t), (U = t))
  49979. }),
  49980. (this.scissor = function (t) {
  49981. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w), k.copy(t))
  49982. }),
  49983. (this.viewport = function (t) {
  49984. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w), H.copy(t))
  49985. }),
  49986. (this.reset = function () {
  49987. for (var t = 0; t < s.length; t++) 1 === s[t] && (e.disableVertexAttribArray(t), (s[t] = 0))
  49988. ;(c = {}), (h = null), (N = void 0), (B = {}), (u = null), (I = null), (C = null), (E = null), (M = null)
  49989. })
  49990. }),
  49991. (n.LensFlarePlugin = function (e, t) {
  49992. function i() {
  49993. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1]),
  49994. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  49995. ;(o = p.createBuffer()),
  49996. (a = p.createBuffer()),
  49997. p.bindBuffer(p.ARRAY_BUFFER, o),
  49998. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  49999. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  50000. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  50001. (u = p.createTexture()),
  50002. (d = p.createTexture()),
  50003. f.bindTexture(p.TEXTURE_2D, u),
  50004. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  50005. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  50006. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  50007. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  50008. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  50009. f.bindTexture(p.TEXTURE_2D, d),
  50010. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  50011. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  50012. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  50013. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  50014. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  50015. (h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0)
  50016. var i
  50017. ;(i = h
  50018. ? {
  50019. vertexShader: [
  50020. 'uniform lowp int renderType;',
  50021. 'uniform vec3 screenPosition;',
  50022. 'uniform vec2 scale;',
  50023. 'uniform float rotation;',
  50024. 'uniform sampler2D occlusionMap;',
  50025. 'attribute vec2 position;',
  50026. 'attribute vec2 uv;',
  50027. 'varying vec2 vUV;',
  50028. 'varying float vVisibility;',
  50029. 'void main() {',
  50030. 'vUV = uv;',
  50031. 'vec2 pos = position;',
  50032. 'if ( renderType == 2 ) {',
  50033. 'vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );',
  50034. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );',
  50035. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );',
  50036. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );',
  50037. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );',
  50038. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );',
  50039. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );',
  50040. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );',
  50041. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );',
  50042. 'vVisibility = visibility.r / 9.0;',
  50043. 'vVisibility *= 1.0 - visibility.g / 9.0;',
  50044. 'vVisibility *= visibility.b / 9.0;',
  50045. 'vVisibility *= 1.0 - visibility.a / 9.0;',
  50046. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  50047. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  50048. '}',
  50049. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  50050. '}'
  50051. ].join('\n'),
  50052. fragmentShader: [
  50053. 'uniform lowp int renderType;',
  50054. 'uniform sampler2D map;',
  50055. 'uniform float opacity;',
  50056. 'uniform vec3 color;',
  50057. 'varying vec2 vUV;',
  50058. 'varying float vVisibility;',
  50059. 'void main() {',
  50060. 'if ( renderType == 0 ) {',
  50061. 'gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );',
  50062. '} else if ( renderType == 1 ) {',
  50063. 'gl_FragColor = texture2D( map, vUV );',
  50064. '} else {',
  50065. 'vec4 texture = texture2D( map, vUV );',
  50066. 'texture.a *= opacity * vVisibility;',
  50067. 'gl_FragColor = texture;',
  50068. 'gl_FragColor.rgb *= color;',
  50069. '}',
  50070. '}'
  50071. ].join('\n')
  50072. }
  50073. : {
  50074. vertexShader: [
  50075. 'uniform lowp int renderType;',
  50076. 'uniform vec3 screenPosition;',
  50077. 'uniform vec2 scale;',
  50078. 'uniform float rotation;',
  50079. 'attribute vec2 position;',
  50080. 'attribute vec2 uv;',
  50081. 'varying vec2 vUV;',
  50082. 'void main() {',
  50083. 'vUV = uv;',
  50084. 'vec2 pos = position;',
  50085. 'if ( renderType == 2 ) {',
  50086. 'pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;',
  50087. 'pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;',
  50088. '}',
  50089. 'gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );',
  50090. '}'
  50091. ].join('\n'),
  50092. fragmentShader: [
  50093. 'precision mediump float;',
  50094. 'uniform lowp int renderType;',
  50095. 'uniform sampler2D map;',
  50096. 'uniform sampler2D occlusionMap;',
  50097. 'uniform float opacity;',
  50098. 'uniform vec3 color;',
  50099. 'varying vec2 vUV;',
  50100. 'void main() {',
  50101. 'if ( renderType == 0 ) {',
  50102. 'gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );',
  50103. '} else if ( renderType == 1 ) {',
  50104. 'gl_FragColor = texture2D( map, vUV );',
  50105. '} else {',
  50106. 'float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;',
  50107. 'visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;',
  50108. 'visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;',
  50109. 'visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;',
  50110. 'visibility = ( 1.0 - visibility / 4.0 );',
  50111. 'vec4 texture = texture2D( map, vUV );',
  50112. 'texture.a *= opacity * visibility;',
  50113. 'gl_FragColor = texture;',
  50114. 'gl_FragColor.rgb *= color;',
  50115. '}',
  50116. '}'
  50117. ].join('\n')
  50118. }),
  50119. (s = r(i)),
  50120. (l = {
  50121. vertex: p.getAttribLocation(s, 'position'),
  50122. uv: p.getAttribLocation(s, 'uv')
  50123. }),
  50124. (c = {
  50125. renderType: p.getUniformLocation(s, 'renderType'),
  50126. map: p.getUniformLocation(s, 'map'),
  50127. occlusionMap: p.getUniformLocation(s, 'occlusionMap'),
  50128. opacity: p.getUniformLocation(s, 'opacity'),
  50129. color: p.getUniformLocation(s, 'color'),
  50130. scale: p.getUniformLocation(s, 'scale'),
  50131. rotation: p.getUniformLocation(s, 'rotation'),
  50132. screenPosition: p.getUniformLocation(s, 'screenPosition')
  50133. })
  50134. }
  50135. function r(t) {
  50136. var i = p.createProgram(),
  50137. n = p.createShader(p.FRAGMENT_SHADER),
  50138. r = p.createShader(p.VERTEX_SHADER),
  50139. o = 'precision ' + e.getPrecision() + ' float;\n'
  50140. return (
  50141. p.shaderSource(n, o + t.fragmentShader), p.shaderSource(r, o + t.vertexShader), p.compileShader(n), p.compileShader(r), p.attachShader(i, n), p.attachShader(i, r), p.linkProgram(i), i
  50142. )
  50143. }
  50144. var o,
  50145. a,
  50146. s,
  50147. l,
  50148. c,
  50149. h,
  50150. u,
  50151. d,
  50152. p = e.context,
  50153. f = e.state
  50154. this.render = function (r, g, m) {
  50155. if (0 !== t.length) {
  50156. var v = new n.Vector3(),
  50157. A = m.w / m.z,
  50158. y = 0.5 * m.z,
  50159. C = 0.5 * m.w,
  50160. I = 16 / m.w,
  50161. E = new n.Vector2(I * A, I),
  50162. b = new n.Vector3(1, 1, 0),
  50163. w = new n.Vector2(1, 1)
  50164. void 0 === s && i(),
  50165. p.useProgram(s),
  50166. f.initAttributes(),
  50167. f.enableAttribute(l.vertex),
  50168. f.enableAttribute(l.uv),
  50169. f.disableUnusedAttributes(),
  50170. p.uniform1i(c.occlusionMap, 0),
  50171. p.uniform1i(c.map, 1),
  50172. p.bindBuffer(p.ARRAY_BUFFER, o),
  50173. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  50174. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  50175. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  50176. f.disable(p.CULL_FACE),
  50177. f.setDepthWrite(!1)
  50178. for (var _ = 0, T = t.length; _ < T; _++) {
  50179. ;(I = 16 / m.w), E.set(I * A, I)
  50180. var x = t[_]
  50181. if (
  50182. (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  50183. v.applyMatrix4(g.matrixWorldInverse),
  50184. v.applyProjection(g.projectionMatrix),
  50185. b.copy(v),
  50186. (w.x = b.x * y + y),
  50187. (w.y = b.y * C + C),
  50188. h || (w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w))
  50189. ) {
  50190. f.activeTexture(p.TEXTURE0),
  50191. f.bindTexture(p.TEXTURE_2D, null),
  50192. f.activeTexture(p.TEXTURE1),
  50193. f.bindTexture(p.TEXTURE_2D, u),
  50194. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  50195. p.uniform1i(c.renderType, 0),
  50196. p.uniform2f(c.scale, E.x, E.y),
  50197. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  50198. f.disable(p.BLEND),
  50199. f.enable(p.DEPTH_TEST),
  50200. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  50201. f.activeTexture(p.TEXTURE0),
  50202. f.bindTexture(p.TEXTURE_2D, d),
  50203. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  50204. p.uniform1i(c.renderType, 1),
  50205. f.disable(p.DEPTH_TEST),
  50206. f.activeTexture(p.TEXTURE1),
  50207. f.bindTexture(p.TEXTURE_2D, u),
  50208. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  50209. x.positionScreen.copy(b),
  50210. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  50211. p.uniform1i(c.renderType, 2),
  50212. f.enable(p.BLEND)
  50213. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  50214. var R = x.lensFlares[S]
  50215. R.opacity > 0.001 &&
  50216. R.scale > 0.001 &&
  50217. ((b.x = R.x),
  50218. (b.y = R.y),
  50219. (b.z = R.z),
  50220. (I = (R.size * R.scale) / m.w),
  50221. (E.x = I * A),
  50222. (E.y = I),
  50223. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  50224. p.uniform2f(c.scale, E.x, E.y),
  50225. p.uniform1f(c.rotation, R.rotation),
  50226. p.uniform1f(c.opacity, R.opacity),
  50227. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  50228. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  50229. e.setTexture(R.texture, 1),
  50230. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  50231. }
  50232. }
  50233. }
  50234. f.enable(p.CULL_FACE), f.enable(p.DEPTH_TEST), f.setDepthWrite(!0), e.resetGLState()
  50235. }
  50236. }
  50237. }),
  50238. (n.SpritePlugin = function (e, t) {
  50239. function i() {
  50240. var e = new Float32Array([-0.5, -0.5, 0, 0, 0.5, -0.5, 1, 0, 0.5, 0.5, 1, 1, -0.5, 0.5, 0, 1]),
  50241. t = new Uint16Array([0, 1, 2, 0, 2, 3])
  50242. ;(a = d.createBuffer()),
  50243. (s = d.createBuffer()),
  50244. d.bindBuffer(d.ARRAY_BUFFER, a),
  50245. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  50246. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  50247. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  50248. (l = r()),
  50249. (c = {
  50250. position: d.getAttribLocation(l, 'position'),
  50251. uv: d.getAttribLocation(l, 'uv')
  50252. }),
  50253. (h = {
  50254. uvOffset: d.getUniformLocation(l, 'uvOffset'),
  50255. uvScale: d.getUniformLocation(l, 'uvScale'),
  50256. rotation: d.getUniformLocation(l, 'rotation'),
  50257. scale: d.getUniformLocation(l, 'scale'),
  50258. color: d.getUniformLocation(l, 'color'),
  50259. map: d.getUniformLocation(l, 'map'),
  50260. opacity: d.getUniformLocation(l, 'opacity'),
  50261. modelViewMatrix: d.getUniformLocation(l, 'modelViewMatrix'),
  50262. projectionMatrix: d.getUniformLocation(l, 'projectionMatrix'),
  50263. fogType: d.getUniformLocation(l, 'fogType'),
  50264. fogDensity: d.getUniformLocation(l, 'fogDensity'),
  50265. fogNear: d.getUniformLocation(l, 'fogNear'),
  50266. fogFar: d.getUniformLocation(l, 'fogFar'),
  50267. fogColor: d.getUniformLocation(l, 'fogColor'),
  50268. alphaTest: d.getUniformLocation(l, 'alphaTest')
  50269. })
  50270. var i = document.createElement('canvas')
  50271. ;(i.width = 8), (i.height = 8)
  50272. var o = i.getContext('2d')
  50273. ;(o.fillStyle = 'white'), o.fillRect(0, 0, 8, 8), (u = new n.Texture(i)), (u.needsUpdate = !0)
  50274. }
  50275. function r() {
  50276. var t = d.createProgram(),
  50277. i = d.createShader(d.VERTEX_SHADER),
  50278. n = d.createShader(d.FRAGMENT_SHADER)
  50279. return (
  50280. d.shaderSource(
  50281. i,
  50282. [
  50283. 'precision ' + e.getPrecision() + ' float;',
  50284. 'uniform mat4 modelViewMatrix;',
  50285. 'uniform mat4 projectionMatrix;',
  50286. 'uniform float rotation;',
  50287. 'uniform vec2 scale;',
  50288. 'uniform vec2 uvOffset;',
  50289. 'uniform vec2 uvScale;',
  50290. 'attribute vec2 position;',
  50291. 'attribute vec2 uv;',
  50292. 'varying vec2 vUV;',
  50293. 'void main() {',
  50294. 'vUV = uvOffset + uv * uvScale;',
  50295. 'vec2 alignedPosition = position * scale;',
  50296. 'vec2 rotatedPosition;',
  50297. 'rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;',
  50298. 'rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;',
  50299. 'vec4 finalPosition;',
  50300. 'finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );',
  50301. 'finalPosition.xy += rotatedPosition;',
  50302. 'finalPosition = projectionMatrix * finalPosition;',
  50303. 'gl_Position = finalPosition;',
  50304. '}'
  50305. ].join('\n')
  50306. ),
  50307. d.shaderSource(
  50308. n,
  50309. [
  50310. 'precision ' + e.getPrecision() + ' float;',
  50311. 'uniform vec3 color;',
  50312. 'uniform sampler2D map;',
  50313. 'uniform float opacity;',
  50314. 'uniform int fogType;',
  50315. 'uniform vec3 fogColor;',
  50316. 'uniform float fogDensity;',
  50317. 'uniform float fogNear;',
  50318. 'uniform float fogFar;',
  50319. 'uniform float alphaTest;',
  50320. 'varying vec2 vUV;',
  50321. 'void main() {',
  50322. 'vec4 texture = texture2D( map, vUV );',
  50323. 'if ( texture.a < alphaTest ) discard;',
  50324. 'gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );',
  50325. 'if ( fogType > 0 ) {',
  50326. 'float depth = gl_FragCoord.z / gl_FragCoord.w;',
  50327. 'float fogFactor = 0.0;',
  50328. 'if ( fogType == 1 ) {',
  50329. 'fogFactor = smoothstep( fogNear, fogFar, depth );',
  50330. '} else {',
  50331. 'const float LOG2 = 1.442695;',
  50332. 'fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );',
  50333. 'fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );',
  50334. '}',
  50335. 'gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );',
  50336. '}',
  50337. '}'
  50338. ].join('\n')
  50339. ),
  50340. d.compileShader(i),
  50341. d.compileShader(n),
  50342. d.attachShader(t, i),
  50343. d.attachShader(t, n),
  50344. d.linkProgram(t),
  50345. t
  50346. )
  50347. }
  50348. function o(e, t) {
  50349. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  50350. }
  50351. var a,
  50352. s,
  50353. l,
  50354. c,
  50355. h,
  50356. u,
  50357. d = e.context,
  50358. p = e.state,
  50359. f = new n.Vector3(),
  50360. g = new n.Quaternion(),
  50361. m = new n.Vector3()
  50362. this.render = function (r, v) {
  50363. if (0 !== t.length) {
  50364. void 0 === l && i(),
  50365. d.useProgram(l),
  50366. p.initAttributes(),
  50367. p.enableAttribute(c.position),
  50368. p.enableAttribute(c.uv),
  50369. p.disableUnusedAttributes(),
  50370. p.disable(d.CULL_FACE),
  50371. p.enable(d.BLEND),
  50372. d.bindBuffer(d.ARRAY_BUFFER, a),
  50373. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  50374. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  50375. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  50376. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  50377. p.activeTexture(d.TEXTURE0),
  50378. d.uniform1i(h.map, 0)
  50379. var A = 0,
  50380. y = 0,
  50381. C = r.fog
  50382. C
  50383. ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  50384. C instanceof n.Fog
  50385. ? (d.uniform1f(h.fogNear, C.near), d.uniform1f(h.fogFar, C.far), d.uniform1i(h.fogType, 1), (A = 1), (y = 1))
  50386. : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density), d.uniform1i(h.fogType, 2), (A = 2), (y = 2)))
  50387. : (d.uniform1i(h.fogType, 0), (A = 0), (y = 0))
  50388. for (var I = 0, E = t.length; I < E; I++) {
  50389. var b = t[I]
  50390. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld), (b.z = -b.modelViewMatrix.elements[14])
  50391. }
  50392. t.sort(o)
  50393. for (var w = [], I = 0, E = t.length; I < E; I++) {
  50394. var b = t[I],
  50395. _ = b.material
  50396. d.uniform1f(h.alphaTest, _.alphaTest), d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements), b.matrixWorld.decompose(f, g, m), (w[0] = m.x), (w[1] = m.y)
  50397. var T = 0
  50398. r.fog && _.fog && (T = y),
  50399. A !== T && (d.uniform1i(h.fogType, T), (A = T)),
  50400. null !== _.map
  50401. ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y), d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y))
  50402. : (d.uniform2f(h.uvOffset, 0, 0), d.uniform2f(h.uvScale, 1, 1)),
  50403. d.uniform1f(h.opacity, _.opacity),
  50404. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  50405. d.uniform1f(h.rotation, _.rotation),
  50406. d.uniform2fv(h.scale, w),
  50407. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  50408. p.setDepthTest(_.depthTest),
  50409. p.setDepthWrite(_.depthWrite),
  50410. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  50411. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  50412. }
  50413. p.enable(d.CULL_FACE), e.resetGLState()
  50414. }
  50415. }
  50416. }),
  50417. Object.defineProperties(n.Box2.prototype, {
  50418. empty: {
  50419. value: function () {
  50420. return console.warn('THREE.Box2: .empty() has been renamed to .isEmpty().'), this.isEmpty()
  50421. }
  50422. },
  50423. isIntersectionBox: {
  50424. value: function (e) {
  50425. return console.warn('THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  50426. }
  50427. }
  50428. }),
  50429. Object.defineProperties(n.Box3.prototype, {
  50430. empty: {
  50431. value: function () {
  50432. return console.warn('THREE.Box3: .empty() has been renamed to .isEmpty().'), this.isEmpty()
  50433. }
  50434. },
  50435. isIntersectionBox: {
  50436. value: function (e) {
  50437. return console.warn('THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  50438. }
  50439. },
  50440. isIntersectionSphere: {
  50441. value: function (e) {
  50442. return console.warn('THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere().'), this.intersectsSphere(e)
  50443. }
  50444. }
  50445. }),
  50446. Object.defineProperties(n.Matrix3.prototype, {
  50447. multiplyVector3: {
  50448. value: function (e) {
  50449. return console.warn('THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead.'), e.applyMatrix3(this)
  50450. }
  50451. },
  50452. multiplyVector3Array: {
  50453. value: function (e) {
  50454. return console.warn('THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'), this.applyToVector3Array(e)
  50455. }
  50456. }
  50457. }),
  50458. Object.defineProperties(n.Matrix4.prototype, {
  50459. extractPosition: {
  50460. value: function (e) {
  50461. return console.warn('THREE.Matrix4: .extractPosition() has been renamed to .copyPosition().'), this.copyPosition(e)
  50462. }
  50463. },
  50464. setRotationFromQuaternion: {
  50465. value: function (e) {
  50466. return console.warn('THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion().'), this.makeRotationFromQuaternion(e)
  50467. }
  50468. },
  50469. multiplyVector3: {
  50470. value: function (e) {
  50471. return console.warn('THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead.'), e.applyProjection(this)
  50472. }
  50473. },
  50474. multiplyVector4: {
  50475. value: function (e) {
  50476. return console.warn('THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead.'), e.applyMatrix4(this)
  50477. }
  50478. },
  50479. multiplyVector3Array: {
  50480. value: function (e) {
  50481. return console.warn('THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead.'), this.applyToVector3Array(e)
  50482. }
  50483. },
  50484. rotateAxis: {
  50485. value: function (e) {
  50486. console.warn('THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead.'), e.transformDirection(this)
  50487. }
  50488. },
  50489. crossVector: {
  50490. value: function (e) {
  50491. return console.warn('THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead.'), e.applyMatrix4(this)
  50492. }
  50493. },
  50494. translate: {
  50495. value: function (e) {
  50496. console.error('THREE.Matrix4: .translate() has been removed.')
  50497. }
  50498. },
  50499. rotateX: {
  50500. value: function (e) {
  50501. console.error('THREE.Matrix4: .rotateX() has been removed.')
  50502. }
  50503. },
  50504. rotateY: {
  50505. value: function (e) {
  50506. console.error('THREE.Matrix4: .rotateY() has been removed.')
  50507. }
  50508. },
  50509. rotateZ: {
  50510. value: function (e) {
  50511. console.error('THREE.Matrix4: .rotateZ() has been removed.')
  50512. }
  50513. },
  50514. rotateByAxis: {
  50515. value: function (e, t) {
  50516. console.error('THREE.Matrix4: .rotateByAxis() has been removed.')
  50517. }
  50518. }
  50519. }),
  50520. Object.defineProperties(n.Plane.prototype, {
  50521. isIntersectionLine: {
  50522. value: function (e) {
  50523. return console.warn('THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine().'), this.intersectsLine(e)
  50524. }
  50525. }
  50526. }),
  50527. Object.defineProperties(n.Quaternion.prototype, {
  50528. multiplyVector3: {
  50529. value: function (e) {
  50530. return console.warn('THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead.'), e.applyQuaternion(this)
  50531. }
  50532. }
  50533. }),
  50534. Object.defineProperties(n.Ray.prototype, {
  50535. isIntersectionBox: {
  50536. value: function (e) {
  50537. return console.warn('THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox().'), this.intersectsBox(e)
  50538. }
  50539. },
  50540. isIntersectionPlane: {
  50541. value: function (e) {
  50542. return console.warn('THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane().'), this.intersectsPlane(e)
  50543. }
  50544. },
  50545. isIntersectionSphere: {
  50546. value: function (e) {
  50547. return console.warn('THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere().'), this.intersectsSphere(e)
  50548. }
  50549. }
  50550. }),
  50551. Object.defineProperties(n.Vector3.prototype, {
  50552. setEulerFromRotationMatrix: {
  50553. value: function () {
  50554. console.error('THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.')
  50555. }
  50556. },
  50557. setEulerFromQuaternion: {
  50558. value: function () {
  50559. console.error('THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.')
  50560. }
  50561. },
  50562. getPositionFromMatrix: {
  50563. value: function (e) {
  50564. return console.warn('THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition().'), this.setFromMatrixPosition(e)
  50565. }
  50566. },
  50567. getScaleFromMatrix: {
  50568. value: function (e) {
  50569. return console.warn('THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale().'), this.setFromMatrixScale(e)
  50570. }
  50571. },
  50572. getColumnFromMatrix: {
  50573. value: function (e, t) {
  50574. return console.warn('THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn().'), this.setFromMatrixColumn(e, t)
  50575. }
  50576. }
  50577. }),
  50578. (n.Face4 = function (e, t, i, r, o, a, s) {
  50579. return console.warn('THREE.Face4 has been removed. A THREE.Face3 will be created instead.'), new n.Face3(e, t, i, o, a, s)
  50580. }),
  50581. (n.Vertex = function (e, t, i) {
  50582. return console.warn('THREE.Vertex has been removed. Use THREE.Vector3 instead.'), new n.Vector3(e, t, i)
  50583. }),
  50584. Object.defineProperties(n.Object3D.prototype, {
  50585. eulerOrder: {
  50586. get: function () {
  50587. return console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'), this.rotation.order
  50588. },
  50589. set: function (e) {
  50590. console.warn('THREE.Object3D: .eulerOrder is now .rotation.order.'), (this.rotation.order = e)
  50591. }
  50592. },
  50593. getChildByName: {
  50594. value: function (e) {
  50595. return console.warn('THREE.Object3D: .getChildByName() has been renamed to .getObjectByName().'), this.getObjectByName(e)
  50596. }
  50597. },
  50598. renderDepth: {
  50599. set: function (e) {
  50600. console.warn('THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.')
  50601. }
  50602. },
  50603. translate: {
  50604. value: function (e, t) {
  50605. return console.warn('THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead.'), this.translateOnAxis(t, e)
  50606. }
  50607. },
  50608. useQuaternion: {
  50609. get: function () {
  50610. console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.')
  50611. },
  50612. set: function (e) {
  50613. console.warn('THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.')
  50614. }
  50615. }
  50616. }),
  50617. Object.defineProperties(n, {
  50618. PointCloud: {
  50619. value: function (e, t) {
  50620. return console.warn('THREE.PointCloud has been renamed to THREE.Points.'), new n.Points(e, t)
  50621. }
  50622. },
  50623. ParticleSystem: {
  50624. value: function (e, t) {
  50625. return console.warn('THREE.ParticleSystem has been renamed to THREE.Points.'), new n.Points(e, t)
  50626. }
  50627. }
  50628. }),
  50629. Object.defineProperties(n.Light.prototype, {
  50630. onlyShadow: {
  50631. set: function (e) {
  50632. console.warn('THREE.Light: .onlyShadow has been removed.')
  50633. }
  50634. },
  50635. shadowCameraFov: {
  50636. set: function (e) {
  50637. console.warn('THREE.Light: .shadowCameraFov is now .shadow.camera.fov.'), (this.shadow.camera.fov = e)
  50638. }
  50639. },
  50640. shadowCameraLeft: {
  50641. set: function (e) {
  50642. console.warn('THREE.Light: .shadowCameraLeft is now .shadow.camera.left.'), (this.shadow.camera.left = e)
  50643. }
  50644. },
  50645. shadowCameraRight: {
  50646. set: function (e) {
  50647. console.warn('THREE.Light: .shadowCameraRight is now .shadow.camera.right.'), (this.shadow.camera.right = e)
  50648. }
  50649. },
  50650. shadowCameraTop: {
  50651. set: function (e) {
  50652. console.warn('THREE.Light: .shadowCameraTop is now .shadow.camera.top.'), (this.shadow.camera.top = e)
  50653. }
  50654. },
  50655. shadowCameraBottom: {
  50656. set: function (e) {
  50657. console.warn('THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom.'), (this.shadow.camera.bottom = e)
  50658. }
  50659. },
  50660. shadowCameraNear: {
  50661. set: function (e) {
  50662. console.warn('THREE.Light: .shadowCameraNear is now .shadow.camera.near.'), (this.shadow.camera.near = e)
  50663. }
  50664. },
  50665. shadowCameraFar: {
  50666. set: function (e) {
  50667. console.warn('THREE.Light: .shadowCameraFar is now .shadow.camera.far.'), (this.shadow.camera.far = e)
  50668. }
  50669. },
  50670. shadowCameraVisible: {
  50671. set: function (e) {
  50672. console.warn('THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.')
  50673. }
  50674. },
  50675. shadowBias: {
  50676. set: function (e) {
  50677. console.warn('THREE.Light: .shadowBias is now .shadow.bias.'), (this.shadow.bias = e)
  50678. }
  50679. },
  50680. shadowDarkness: {
  50681. set: function (e) {
  50682. console.warn('THREE.Light: .shadowDarkness has been removed.')
  50683. }
  50684. },
  50685. shadowMapWidth: {
  50686. set: function (e) {
  50687. console.warn('THREE.Light: .shadowMapWidth is now .shadow.mapSize.width.'), (this.shadow.mapSize.width = e)
  50688. }
  50689. },
  50690. shadowMapHeight: {
  50691. set: function (e) {
  50692. console.warn('THREE.Light: .shadowMapHeight is now .shadow.mapSize.height.'), (this.shadow.mapSize.height = e)
  50693. }
  50694. }
  50695. }),
  50696. Object.defineProperties(n.BufferAttribute.prototype, {
  50697. length: {
  50698. get: function () {
  50699. return console.warn('THREE.BufferAttribute: .length has been deprecated. Please use .count.'), this.array.length
  50700. }
  50701. }
  50702. }),
  50703. Object.defineProperties(n.BufferGeometry.prototype, {
  50704. drawcalls: {
  50705. get: function () {
  50706. return console.error('THREE.BufferGeometry: .drawcalls has been renamed to .groups.'), this.groups
  50707. }
  50708. },
  50709. offsets: {
  50710. get: function () {
  50711. return console.warn('THREE.BufferGeometry: .offsets has been renamed to .groups.'), this.groups
  50712. }
  50713. },
  50714. addIndex: {
  50715. value: function (e) {
  50716. console.warn('THREE.BufferGeometry: .addIndex() has been renamed to .setIndex().'), this.setIndex(e)
  50717. }
  50718. },
  50719. addDrawCall: {
  50720. value: function (e, t, i) {
  50721. void 0 !== i && console.warn('THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset.'),
  50722. console.warn('THREE.BufferGeometry: .addDrawCall() is now .addGroup().'),
  50723. this.addGroup(e, t)
  50724. }
  50725. },
  50726. clearDrawCalls: {
  50727. value: function () {
  50728. console.warn('THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups().'), this.clearGroups()
  50729. }
  50730. },
  50731. computeTangents: {
  50732. value: function () {
  50733. console.warn('THREE.BufferGeometry: .computeTangents() has been removed.')
  50734. }
  50735. },
  50736. computeOffsets: {
  50737. value: function () {
  50738. console.warn('THREE.BufferGeometry: .computeOffsets() has been removed.')
  50739. }
  50740. }
  50741. }),
  50742. Object.defineProperties(n.Material.prototype, {
  50743. wrapAround: {
  50744. get: function () {
  50745. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  50746. },
  50747. set: function (e) {
  50748. console.warn('THREE.' + this.type + ': .wrapAround has been removed.')
  50749. }
  50750. },
  50751. wrapRGB: {
  50752. get: function () {
  50753. return console.warn('THREE.' + this.type + ': .wrapRGB has been removed.'), new n.Color()
  50754. }
  50755. }
  50756. }),
  50757. Object.defineProperties(n, {
  50758. PointCloudMaterial: {
  50759. value: function (e) {
  50760. return console.warn('THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial.'), new n.PointsMaterial(e)
  50761. }
  50762. },
  50763. ParticleBasicMaterial: {
  50764. value: function (e) {
  50765. return console.warn('THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial.'), new n.PointsMaterial(e)
  50766. }
  50767. },
  50768. ParticleSystemMaterial: {
  50769. value: function (e) {
  50770. return console.warn('THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial.'), new n.PointsMaterial(e)
  50771. }
  50772. }
  50773. }),
  50774. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  50775. metal: {
  50776. get: function () {
  50777. return console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead.'), !1
  50778. },
  50779. set: function (e) {
  50780. console.warn('THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead')
  50781. }
  50782. }
  50783. }),
  50784. Object.defineProperties(n.ShaderMaterial.prototype, {
  50785. derivatives: {
  50786. get: function () {
  50787. return console.warn('THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'), this.extensions.derivatives
  50788. },
  50789. set: function (e) {
  50790. console.warn('THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives.'), (this.extensions.derivatives = e)
  50791. }
  50792. }
  50793. }),
  50794. Object.defineProperties(n.WebGLRenderer.prototype, {
  50795. supportsFloatTextures: {
  50796. value: function () {
  50797. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."), this.extensions.get('OES_texture_float')
  50798. }
  50799. },
  50800. supportsHalfFloatTextures: {
  50801. value: function () {
  50802. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."), this.extensions.get('OES_texture_half_float')
  50803. }
  50804. },
  50805. supportsStandardDerivatives: {
  50806. value: function () {
  50807. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."), this.extensions.get('OES_standard_derivatives')
  50808. }
  50809. },
  50810. supportsCompressedTextureS3TC: {
  50811. value: function () {
  50812. return (
  50813. console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."), this.extensions.get('WEBGL_compressed_texture_s3tc')
  50814. )
  50815. }
  50816. },
  50817. supportsCompressedTexturePVRTC: {
  50818. value: function () {
  50819. return (
  50820. console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  50821. this.extensions.get('WEBGL_compressed_texture_pvrtc')
  50822. )
  50823. }
  50824. },
  50825. supportsBlendMinMax: {
  50826. value: function () {
  50827. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."), this.extensions.get('EXT_blend_minmax')
  50828. }
  50829. },
  50830. supportsVertexTextures: {
  50831. value: function () {
  50832. return this.capabilities.vertexTextures
  50833. }
  50834. },
  50835. supportsInstancedArrays: {
  50836. value: function () {
  50837. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."), this.extensions.get('ANGLE_instanced_arrays')
  50838. }
  50839. },
  50840. enableScissorTest: {
  50841. value: function (e) {
  50842. console.warn('THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest().'), this.setScissorTest(e)
  50843. }
  50844. },
  50845. initMaterial: {
  50846. value: function () {
  50847. console.warn('THREE.WebGLRenderer: .initMaterial() has been removed.')
  50848. }
  50849. },
  50850. addPrePlugin: {
  50851. value: function () {
  50852. console.warn('THREE.WebGLRenderer: .addPrePlugin() has been removed.')
  50853. }
  50854. },
  50855. addPostPlugin: {
  50856. value: function () {
  50857. console.warn('THREE.WebGLRenderer: .addPostPlugin() has been removed.')
  50858. }
  50859. },
  50860. updateShadowMap: {
  50861. value: function () {
  50862. console.warn('THREE.WebGLRenderer: .updateShadowMap() has been removed.')
  50863. }
  50864. },
  50865. shadowMapEnabled: {
  50866. get: function () {
  50867. return this.shadowMap.enabled
  50868. },
  50869. set: function (e) {
  50870. console.warn('THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled.'), (this.shadowMap.enabled = e)
  50871. }
  50872. },
  50873. shadowMapType: {
  50874. get: function () {
  50875. return this.shadowMap.type
  50876. },
  50877. set: function (e) {
  50878. console.warn('THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type.'), (this.shadowMap.type = e)
  50879. }
  50880. },
  50881. shadowMapCullFace: {
  50882. get: function () {
  50883. return this.shadowMap.cullFace
  50884. },
  50885. set: function (e) {
  50886. console.warn('THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace.'), (this.shadowMap.cullFace = e)
  50887. }
  50888. }
  50889. }),
  50890. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  50891. wrapS: {
  50892. get: function () {
  50893. return console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'), this.texture.wrapS
  50894. },
  50895. set: function (e) {
  50896. console.warn('THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS.'), (this.texture.wrapS = e)
  50897. }
  50898. },
  50899. wrapT: {
  50900. get: function () {
  50901. return console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'), this.texture.wrapT
  50902. },
  50903. set: function (e) {
  50904. console.warn('THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT.'), (this.texture.wrapT = e)
  50905. }
  50906. },
  50907. magFilter: {
  50908. get: function () {
  50909. return console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'), this.texture.magFilter
  50910. },
  50911. set: function (e) {
  50912. console.warn('THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter.'), (this.texture.magFilter = e)
  50913. }
  50914. },
  50915. minFilter: {
  50916. get: function () {
  50917. return console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'), this.texture.minFilter
  50918. },
  50919. set: function (e) {
  50920. console.warn('THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter.'), (this.texture.minFilter = e)
  50921. }
  50922. },
  50923. anisotropy: {
  50924. get: function () {
  50925. return console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'), this.texture.anisotropy
  50926. },
  50927. set: function (e) {
  50928. console.warn('THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy.'), (this.texture.anisotropy = e)
  50929. }
  50930. },
  50931. offset: {
  50932. get: function () {
  50933. return console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'), this.texture.offset
  50934. },
  50935. set: function (e) {
  50936. console.warn('THREE.WebGLRenderTarget: .offset is now .texture.offset.'), (this.texture.offset = e)
  50937. }
  50938. },
  50939. repeat: {
  50940. get: function () {
  50941. return console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'), this.texture.repeat
  50942. },
  50943. set: function (e) {
  50944. console.warn('THREE.WebGLRenderTarget: .repeat is now .texture.repeat.'), (this.texture.repeat = e)
  50945. }
  50946. },
  50947. format: {
  50948. get: function () {
  50949. return console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'), this.texture.format
  50950. },
  50951. set: function (e) {
  50952. console.warn('THREE.WebGLRenderTarget: .format is now .texture.format.'), (this.texture.format = e)
  50953. }
  50954. },
  50955. type: {
  50956. get: function () {
  50957. return console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'), this.texture.type
  50958. },
  50959. set: function (e) {
  50960. console.warn('THREE.WebGLRenderTarget: .type is now .texture.type.'), (this.texture.type = e)
  50961. }
  50962. },
  50963. generateMipmaps: {
  50964. get: function () {
  50965. return console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'), this.texture.generateMipmaps
  50966. },
  50967. set: function (e) {
  50968. console.warn('THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps.'), (this.texture.generateMipmaps = e)
  50969. }
  50970. }
  50971. }),
  50972. (n.GeometryUtils = {
  50973. merge: function (e, t, i) {
  50974. console.warn('THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.')
  50975. var r
  50976. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(), (r = t.matrix), (t = t.geometry)), e.merge(t, r, i)
  50977. },
  50978. center: function (e) {
  50979. return console.warn('THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead.'), e.center()
  50980. }
  50981. }),
  50982. (n.ImageUtils = {
  50983. crossOrigin: void 0,
  50984. loadTexture: function (e, t, i, r) {
  50985. console.warn('THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.')
  50986. var o = new n.TextureLoader()
  50987. o.setCrossOrigin(this.crossOrigin)
  50988. var a = o.load(e, i, void 0, r)
  50989. return t && (a.mapping = t), a
  50990. },
  50991. loadTextureCube: function (e, t, i, r) {
  50992. console.warn('THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.')
  50993. var o = new n.CubeTextureLoader()
  50994. o.setCrossOrigin(this.crossOrigin)
  50995. var a = o.load(e, i, void 0, r)
  50996. return t && (a.mapping = t), a
  50997. },
  50998. loadCompressedTexture: function () {
  50999. console.error('THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.')
  51000. },
  51001. loadCompressedTextureCube: function () {
  51002. console.error('THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.')
  51003. }
  51004. }),
  51005. (n.Projector = function () {
  51006. console.error('THREE.Projector has been moved to /examples/js/renderers/Projector.js.'),
  51007. (this.projectVector = function (e, t) {
  51008. console.warn('THREE.Projector: .projectVector() is now vector.project().'), e.project(t)
  51009. }),
  51010. (this.unprojectVector = function (e, t) {
  51011. console.warn('THREE.Projector: .unprojectVector() is now vector.unproject().'), e.unproject(t)
  51012. }),
  51013. (this.pickingRay = function (e, t) {
  51014. console.error('THREE.Projector: .pickingRay() is now raycaster.setFromCamera().')
  51015. })
  51016. }),
  51017. (n.CanvasRenderer = function () {
  51018. console.error('THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js'),
  51019. (this.domElement = document.createElement('canvas')),
  51020. (this.clear = function () {}),
  51021. (this.render = function () {}),
  51022. (this.setClearColor = function () {}),
  51023. (this.setSize = function () {})
  51024. }),
  51025. (n.MeshFaceMaterial = n.MultiMaterial),
  51026. (n.CurveUtils = {
  51027. tangentQuadraticBezier: function (e, t, i, n) {
  51028. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  51029. },
  51030. tangentCubicBezier: function (e, t, i, n, r) {
  51031. 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
  51032. },
  51033. tangentSpline: function (e, t, i, n, r) {
  51034. var o = 6 * e * e - 6 * e,
  51035. a = 3 * e * e - 4 * e + 1,
  51036. s = -6 * e * e + 6 * e,
  51037. l = 3 * e * e - 2 * e
  51038. return o + a + s + l
  51039. },
  51040. interpolate: function (e, t, i, n, r) {
  51041. var o = 0.5 * (i - e),
  51042. a = 0.5 * (n - t),
  51043. s = r * r,
  51044. l = r * s
  51045. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  51046. }
  51047. }),
  51048. (n.SceneUtils = {
  51049. createMultiMaterialObject: function (e, t) {
  51050. for (var i = new n.Group(), r = 0, o = t.length; r < o; r++) i.add(new n.Mesh(e, t[r]))
  51051. return i
  51052. },
  51053. detach: function (e, t, i) {
  51054. e.applyMatrix(t.matrixWorld), t.remove(e), i.add(e)
  51055. },
  51056. attach: function (e, t, i) {
  51057. var r = new n.Matrix4()
  51058. r.getInverse(i.matrixWorld), e.applyMatrix(r), t.remove(e), i.add(e)
  51059. }
  51060. }),
  51061. (n.ShapeUtils = {
  51062. area: function (e) {
  51063. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++) i += e[n].x * e[r].y - e[r].x * e[n].y
  51064. return 0.5 * i
  51065. },
  51066. triangulate: (function () {
  51067. function e(e, t, i, n, r, o) {
  51068. var a, s, l, c, h, u, d, p, f
  51069. if (((s = e[o[t]].x), (l = e[o[t]].y), (c = e[o[i]].x), (h = e[o[i]].y), (u = e[o[n]].x), (d = e[o[n]].y), Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))) return !1
  51070. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M
  51071. for (g = u - c, m = d - h, v = s - u, A = l - d, y = c - s, C = h - l, a = 0; a < r; a++)
  51072. if (
  51073. ((p = e[o[a]].x),
  51074. (f = e[o[a]].y),
  51075. !((p === s && f === l) || (p === c && f === h) || (p === u && f === d)) &&
  51076. ((I = p - s),
  51077. (E = f - l),
  51078. (b = p - c),
  51079. (w = f - h),
  51080. (_ = p - u),
  51081. (T = f - d),
  51082. (M = g * w - m * b),
  51083. (x = y * E - C * I),
  51084. (S = v * T - A * _),
  51085. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  51086. )
  51087. return !1
  51088. return !0
  51089. }
  51090. return function (t, i) {
  51091. var r = t.length
  51092. if (r < 3) return null
  51093. var o,
  51094. a,
  51095. s,
  51096. l = [],
  51097. c = [],
  51098. h = []
  51099. if (n.ShapeUtils.area(t) > 0) for (a = 0; a < r; a++) c[a] = a
  51100. else for (a = 0; a < r; a++) c[a] = r - 1 - a
  51101. var u = r,
  51102. d = 2 * u
  51103. for (a = u - 1; u > 2; ) {
  51104. if (d-- <= 0) return console.warn('THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()'), i ? h : l
  51105. if (((o = a), u <= o && (o = 0), (a = o + 1), u <= a && (a = 0), (s = a + 1), u <= s && (s = 0), e(t, o, a, s, u, c))) {
  51106. var p, f, g, m, v
  51107. for (p = c[o], f = c[a], g = c[s], l.push([t[p], t[f], t[g]]), h.push([c[o], c[a], c[s]]), m = a, v = a + 1; v < u; m++, v++) c[m] = c[v]
  51108. u--, (d = 2 * u)
  51109. }
  51110. }
  51111. return i ? h : l
  51112. }
  51113. })(),
  51114. triangulateShape: function (e, t) {
  51115. function i(e, t, i) {
  51116. 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
  51117. }
  51118. function r(e, t, n, r, o) {
  51119. var a = t.x - e.x,
  51120. s = t.y - e.y,
  51121. l = r.x - n.x,
  51122. c = r.y - n.y,
  51123. h = e.x - n.x,
  51124. u = e.y - n.y,
  51125. d = s * l - a * c,
  51126. p = s * h - a * u
  51127. if (Math.abs(d) > Number.EPSILON) {
  51128. var f
  51129. if (d > 0) {
  51130. if (p < 0 || p > d) return []
  51131. if (((f = c * h - l * u), f < 0 || f > d)) return []
  51132. } else {
  51133. if (p > 0 || p < d) return []
  51134. if (((f = c * h - l * u), f > 0 || f < d)) return []
  51135. }
  51136. if (0 === f) return !o || (0 !== p && p !== d) ? [e] : []
  51137. if (f === d) return !o || (0 !== p && p !== d) ? [t] : []
  51138. if (0 === p) return [n]
  51139. if (p === d) return [r]
  51140. var g = f / d
  51141. return [
  51142. {
  51143. x: e.x + g * a,
  51144. y: e.y + g * s
  51145. }
  51146. ]
  51147. }
  51148. if (0 !== p || c * h !== l * u) return []
  51149. var m = 0 === a && 0 === s,
  51150. v = 0 === l && 0 === c
  51151. if (m && v) return e.x !== n.x || e.y !== n.y ? [] : [e]
  51152. if (m) return i(n, r, e) ? [e] : []
  51153. if (v) return i(e, t, n) ? [n] : []
  51154. var A, y, C, I, E, b, w, _
  51155. return (
  51156. 0 !== a
  51157. ? (e.x < t.x ? ((A = e), (C = e.x), (y = t), (I = t.x)) : ((A = t), (C = t.x), (y = e), (I = e.x)),
  51158. n.x < r.x ? ((E = n), (w = n.x), (b = r), (_ = r.x)) : ((E = r), (w = r.x), (b = n), (_ = n.x)))
  51159. : (e.y < t.y ? ((A = e), (C = e.y), (y = t), (I = t.y)) : ((A = t), (C = t.y), (y = e), (I = e.y)),
  51160. n.y < r.y ? ((E = n), (w = n.y), (b = r), (_ = r.y)) : ((E = r), (w = r.y), (b = n), (_ = n.y))),
  51161. C <= w ? (I < w ? [] : I === w ? (o ? [] : [E]) : I <= _ ? [E, y] : [E, b]) : C > _ ? [] : C === _ ? (o ? [] : [A]) : I <= _ ? [A, y] : [A, b]
  51162. )
  51163. }
  51164. function o(e, t, i, n) {
  51165. var r = t.x - e.x,
  51166. o = t.y - e.y,
  51167. a = i.x - e.x,
  51168. s = i.y - e.y,
  51169. l = n.x - e.x,
  51170. c = n.y - e.y,
  51171. h = r * s - o * a,
  51172. u = r * c - o * l
  51173. if (Math.abs(h) > Number.EPSILON) {
  51174. var d = l * s - c * a
  51175. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  51176. }
  51177. return u > 0
  51178. }
  51179. function a(e, t) {
  51180. function i(e, t) {
  51181. var i = A.length - 1,
  51182. n = e - 1
  51183. n < 0 && (n = i)
  51184. var r = e + 1
  51185. r > i && (r = 0)
  51186. var a = o(A[e], A[n], A[r], s[t])
  51187. if (!a) return !1
  51188. var l = s.length - 1,
  51189. c = t - 1
  51190. c < 0 && (c = l)
  51191. var h = t + 1
  51192. return h > l && (h = 0), (a = o(s[t], s[c], s[h], A[e])), !!a
  51193. }
  51194. function n(e, t) {
  51195. var i, n, o
  51196. for (i = 0; i < A.length; i++) if (((n = i + 1), (n %= A.length), (o = r(e, t, A[i], A[n], !0)), o.length > 0)) return !0
  51197. return !1
  51198. }
  51199. function a(e, i) {
  51200. var n, o, a, s, l
  51201. for (n = 0; n < y.length; n++) for (o = t[y[n]], a = 0; a < o.length; a++) if (((s = a + 1), (s %= o.length), (l = r(e, i, o[a], o[s], !0)), l.length > 0)) return !0
  51202. return !1
  51203. }
  51204. 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++) y.push(I)
  51205. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  51206. if ((w--, w < 0)) {
  51207. console.log('Infinite Loop! Holes left:' + y.length + ', Probably Hole outside Shape!')
  51208. break
  51209. }
  51210. for (c = b; c < A.length; c++) {
  51211. ;(h = A[c]), (l = -1)
  51212. for (var I = 0; I < y.length; I++)
  51213. if (((d = y[I]), (p = h.x + ':' + h.y + ':' + d), void 0 === C[p])) {
  51214. s = t[d]
  51215. for (var _ = 0; _ < s.length; _++)
  51216. if (((u = s[_]), i(c, _) && !n(h, u) && !a(h, u))) {
  51217. ;(l = _), y.splice(I, 1), (f = A.slice(0, c + 1)), (g = A.slice(c)), (m = s.slice(l)), (v = s.slice(0, l + 1)), (A = f.concat(m).concat(v).concat(g)), (b = c)
  51218. break
  51219. }
  51220. if (l >= 0) break
  51221. C[p] = !0
  51222. }
  51223. if (l >= 0) break
  51224. }
  51225. }
  51226. return A
  51227. }
  51228. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++) Array.prototype.push.apply(f, t[g])
  51229. for (s = 0, l = f.length; s < l; s++) (u = f[s].x + ':' + f[s].y), void 0 !== p[u] && console.warn('THREE.Shape: Duplicate point', u), (p[u] = s)
  51230. var v = a(e, t),
  51231. A = n.ShapeUtils.triangulate(v, !1)
  51232. for (s = 0, l = A.length; s < l; s++) for (h = A[s], c = 0; c < 3; c++) (u = h[c].x + ':' + h[c].y), (d = p[u]), void 0 !== d && (h[c] = d)
  51233. return A.concat()
  51234. },
  51235. isClockWise: function (e) {
  51236. return n.ShapeUtils.area(e) < 0
  51237. },
  51238. b2: (function () {
  51239. function e(e, t) {
  51240. var i = 1 - e
  51241. return i * i * t
  51242. }
  51243. function t(e, t) {
  51244. return 2 * (1 - e) * e * t
  51245. }
  51246. function i(e, t) {
  51247. return e * e * t
  51248. }
  51249. return function (n, r, o, a) {
  51250. return e(n, r) + t(n, o) + i(n, a)
  51251. }
  51252. })(),
  51253. b3: (function () {
  51254. function e(e, t) {
  51255. var i = 1 - e
  51256. return i * i * i * t
  51257. }
  51258. function t(e, t) {
  51259. var i = 1 - e
  51260. return 3 * i * i * e * t
  51261. }
  51262. function i(e, t) {
  51263. var i = 1 - e
  51264. return 3 * i * e * e * t
  51265. }
  51266. function n(e, t) {
  51267. return e * e * e * t
  51268. }
  51269. return function (r, o, a, s, l) {
  51270. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  51271. }
  51272. })()
  51273. }),
  51274. (n.Curve = function () {}),
  51275. (n.Curve.prototype = {
  51276. constructor: n.Curve,
  51277. getPoint: function (e) {
  51278. return console.warn('THREE.Curve: Warning, getPoint() not implemented!'), null
  51279. },
  51280. getPointAt: function (e) {
  51281. var t = this.getUtoTmapping(e)
  51282. return this.getPoint(t)
  51283. },
  51284. getPoints: function (e) {
  51285. e || (e = 5)
  51286. var t,
  51287. i = []
  51288. for (t = 0; t <= e; t++) i.push(this.getPoint(t / e))
  51289. return i
  51290. },
  51291. getSpacedPoints: function (e) {
  51292. e || (e = 5)
  51293. var t,
  51294. i = []
  51295. for (t = 0; t <= e; t++) i.push(this.getPointAt(t / e))
  51296. return i
  51297. },
  51298. getLength: function () {
  51299. var e = this.getLengths()
  51300. return e[e.length - 1]
  51301. },
  51302. getLengths: function (e) {
  51303. if ((e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200), this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate))
  51304. return this.cacheArcLengths
  51305. this.needsUpdate = !1
  51306. var t,
  51307. i,
  51308. n = [],
  51309. r = this.getPoint(0),
  51310. o = 0
  51311. for (n.push(0), i = 1; i <= e; i++) (t = this.getPoint(i / e)), (o += t.distanceTo(r)), n.push(o), (r = t)
  51312. return (this.cacheArcLengths = n), n
  51313. },
  51314. updateArcLengths: function () {
  51315. ;(this.needsUpdate = !0), this.getLengths()
  51316. },
  51317. getUtoTmapping: function (e, t) {
  51318. var i,
  51319. n = this.getLengths(),
  51320. r = 0,
  51321. o = n.length
  51322. i = t ? t : e * n[o - 1]
  51323. for (var a, s = 0, l = o - 1; s <= l; )
  51324. if (((r = Math.floor(s + (l - s) / 2)), (a = n[r] - i), a < 0)) s = r + 1
  51325. else {
  51326. if (!(a > 0)) {
  51327. l = r
  51328. break
  51329. }
  51330. l = r - 1
  51331. }
  51332. if (((r = l), n[r] === i)) {
  51333. var c = r / (o - 1)
  51334. return c
  51335. }
  51336. var h = n[r],
  51337. u = n[r + 1],
  51338. d = u - h,
  51339. p = (i - h) / d,
  51340. c = (r + p) / (o - 1)
  51341. return c
  51342. },
  51343. getTangent: function (e) {
  51344. var t = 1e-4,
  51345. i = e - t,
  51346. n = e + t
  51347. i < 0 && (i = 0), n > 1 && (n = 1)
  51348. var r = this.getPoint(i),
  51349. o = this.getPoint(n),
  51350. a = o.clone().sub(r)
  51351. return a.normalize()
  51352. },
  51353. getTangentAt: function (e) {
  51354. var t = this.getUtoTmapping(e)
  51355. return this.getTangent(t)
  51356. }
  51357. }),
  51358. (n.Curve.create = function (e, t) {
  51359. return (e.prototype = Object.create(n.Curve.prototype)), (e.prototype.constructor = e), (e.prototype.getPoint = t), e
  51360. }),
  51361. (n.CurvePath = function () {
  51362. ;(this.curves = []), (this.autoClose = !1)
  51363. }),
  51364. (n.CurvePath.prototype = Object.create(n.Curve.prototype)),
  51365. (n.CurvePath.prototype.constructor = n.CurvePath),
  51366. (n.CurvePath.prototype.add = function (e) {
  51367. this.curves.push(e)
  51368. }),
  51369. (n.CurvePath.prototype.closePath = function () {
  51370. var e = this.curves[0].getPoint(0),
  51371. t = this.curves[this.curves.length - 1].getPoint(1)
  51372. e.equals(t) || this.curves.push(new n.LineCurve(t, e))
  51373. }),
  51374. (n.CurvePath.prototype.getPoint = function (e) {
  51375. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  51376. if (i[n] >= t) {
  51377. var r = i[n] - t,
  51378. o = this.curves[n],
  51379. a = 1 - r / o.getLength()
  51380. return o.getPointAt(a)
  51381. }
  51382. n++
  51383. }
  51384. return null
  51385. }),
  51386. (n.CurvePath.prototype.getLength = function () {
  51387. var e = this.getCurveLengths()
  51388. return e[e.length - 1]
  51389. }),
  51390. (n.CurvePath.prototype.getCurveLengths = function () {
  51391. if (this.cacheLengths && this.cacheLengths.length === this.curves.length) return this.cacheLengths
  51392. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++) (t += this.curves[i].getLength()), e.push(t)
  51393. return (this.cacheLengths = e), e
  51394. }),
  51395. (n.CurvePath.prototype.createPointsGeometry = function (e) {
  51396. var t = this.getPoints(e)
  51397. return this.createGeometry(t)
  51398. }),
  51399. (n.CurvePath.prototype.createSpacedPointsGeometry = function (e) {
  51400. var t = this.getSpacedPoints(e)
  51401. return this.createGeometry(t)
  51402. }),
  51403. (n.CurvePath.prototype.createGeometry = function (e) {
  51404. for (var t = new n.Geometry(), i = 0, r = e.length; i < r; i++) {
  51405. var o = e[i]
  51406. t.vertices.push(new n.Vector3(o.x, o.y, o.z || 0))
  51407. }
  51408. return t
  51409. }),
  51410. (n.Font = function (e) {
  51411. this.data = e
  51412. }),
  51413. (n.Font.prototype = {
  51414. constructor: n.Font,
  51415. generateShapes: function (e, t, i) {
  51416. function r(e) {
  51417. for (var i = String(e).split(''), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  51418. var c = o(i[l], n, r)
  51419. ;(r += c.offset), s.push(c.path)
  51420. }
  51421. return s
  51422. }
  51423. function o(e, t, r) {
  51424. var o = a.glyphs[e] || a.glyphs['?']
  51425. if (o) {
  51426. var s,
  51427. l,
  51428. c,
  51429. h,
  51430. u,
  51431. d,
  51432. p,
  51433. f,
  51434. g,
  51435. m,
  51436. v,
  51437. A = new n.Path(),
  51438. y = [],
  51439. C = n.ShapeUtils.b2,
  51440. I = n.ShapeUtils.b3
  51441. if (o.o)
  51442. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(' ')), b = 0, w = E.length; b < w; ) {
  51443. var _ = E[b++]
  51444. switch (_) {
  51445. case 'm':
  51446. ;(s = E[b++] * t + r), (l = E[b++] * t), A.moveTo(s, l)
  51447. break
  51448. case 'l':
  51449. ;(s = E[b++] * t + r), (l = E[b++] * t), A.lineTo(s, l)
  51450. break
  51451. case 'q':
  51452. if (((c = E[b++] * t + r), (h = E[b++] * t), (p = E[b++] * t + r), (f = E[b++] * t), A.quadraticCurveTo(p, f, c, h), (v = y[y.length - 1]))) {
  51453. ;(u = v.x), (d = v.y)
  51454. for (var T = 1; T <= i; T++) {
  51455. var x = T / i
  51456. C(x, u, p, c), C(x, d, f, h)
  51457. }
  51458. }
  51459. break
  51460. case 'b':
  51461. if (
  51462. ((c = E[b++] * t + r),
  51463. (h = E[b++] * t),
  51464. (p = E[b++] * t + r),
  51465. (f = E[b++] * t),
  51466. (g = E[b++] * t + r),
  51467. (m = E[b++] * t),
  51468. A.bezierCurveTo(p, f, g, m, c, h),
  51469. (v = y[y.length - 1]))
  51470. ) {
  51471. ;(u = v.x), (d = v.y)
  51472. for (var T = 1; T <= i; T++) {
  51473. var x = T / i
  51474. I(x, u, p, g, c), I(x, d, f, m, h)
  51475. }
  51476. }
  51477. }
  51478. }
  51479. return {
  51480. offset: o.ha * t,
  51481. path: A
  51482. }
  51483. }
  51484. }
  51485. void 0 === t && (t = 100), void 0 === i && (i = 4)
  51486. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++) Array.prototype.push.apply(l, s[c].toShapes())
  51487. return l
  51488. }
  51489. }),
  51490. (n.Path = function (e) {
  51491. n.CurvePath.call(this), (this.actions = []), e && this.fromPoints(e)
  51492. }),
  51493. (n.Path.prototype = Object.create(n.CurvePath.prototype)),
  51494. (n.Path.prototype.constructor = n.Path),
  51495. (n.Path.prototype.fromPoints = function (e) {
  51496. this.moveTo(e[0].x, e[0].y)
  51497. for (var t = 1, i = e.length; t < i; t++) this.lineTo(e[t].x, e[t].y)
  51498. }),
  51499. (n.Path.prototype.moveTo = function (e, t) {
  51500. this.actions.push({
  51501. action: 'moveTo',
  51502. args: [e, t]
  51503. })
  51504. }),
  51505. (n.Path.prototype.lineTo = function (e, t) {
  51506. var i = this.actions[this.actions.length - 1].args,
  51507. r = i[i.length - 2],
  51508. o = i[i.length - 1],
  51509. a = new n.LineCurve(new n.Vector2(r, o), new n.Vector2(e, t))
  51510. this.curves.push(a),
  51511. this.actions.push({
  51512. action: 'lineTo',
  51513. args: [e, t]
  51514. })
  51515. }),
  51516. (n.Path.prototype.quadraticCurveTo = function (e, t, i, r) {
  51517. var o = this.actions[this.actions.length - 1].args,
  51518. a = o[o.length - 2],
  51519. s = o[o.length - 1],
  51520. l = new n.QuadraticBezierCurve(new n.Vector2(a, s), new n.Vector2(e, t), new n.Vector2(i, r))
  51521. this.curves.push(l),
  51522. this.actions.push({
  51523. action: 'quadraticCurveTo',
  51524. args: [e, t, i, r]
  51525. })
  51526. }),
  51527. (n.Path.prototype.bezierCurveTo = function (e, t, i, r, o, a) {
  51528. var s = this.actions[this.actions.length - 1].args,
  51529. l = s[s.length - 2],
  51530. c = s[s.length - 1],
  51531. h = new n.CubicBezierCurve(new n.Vector2(l, c), new n.Vector2(e, t), new n.Vector2(i, r), new n.Vector2(o, a))
  51532. this.curves.push(h),
  51533. this.actions.push({
  51534. action: 'bezierCurveTo',
  51535. args: [e, t, i, r, o, a]
  51536. })
  51537. }),
  51538. (n.Path.prototype.splineThru = function (e) {
  51539. var t = Array.prototype.slice.call(arguments),
  51540. i = this.actions[this.actions.length - 1].args,
  51541. r = i[i.length - 2],
  51542. o = i[i.length - 1],
  51543. a = [new n.Vector2(r, o)]
  51544. Array.prototype.push.apply(a, e)
  51545. var s = new n.SplineCurve(a)
  51546. this.curves.push(s),
  51547. this.actions.push({
  51548. action: 'splineThru',
  51549. args: t
  51550. })
  51551. }),
  51552. (n.Path.prototype.arc = function (e, t, i, n, r, o) {
  51553. var a = this.actions[this.actions.length - 1].args,
  51554. s = a[a.length - 2],
  51555. l = a[a.length - 1]
  51556. this.absarc(e + s, t + l, i, n, r, o)
  51557. }),
  51558. (n.Path.prototype.absarc = function (e, t, i, n, r, o) {
  51559. this.absellipse(e, t, i, i, n, r, o)
  51560. }),
  51561. (n.Path.prototype.ellipse = function (e, t, i, n, r, o, a, s) {
  51562. var l = this.actions[this.actions.length - 1].args,
  51563. c = l[l.length - 2],
  51564. h = l[l.length - 1]
  51565. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  51566. }),
  51567. (n.Path.prototype.absellipse = function (e, t, i, r, o, a, s, l) {
  51568. var c = [e, t, i, r, o, a, s, l || 0],
  51569. h = new n.EllipseCurve(e, t, i, r, o, a, s, l)
  51570. this.curves.push(h)
  51571. var u = h.getPoint(1)
  51572. c.push(u.x),
  51573. c.push(u.y),
  51574. this.actions.push({
  51575. action: 'ellipse',
  51576. args: c
  51577. })
  51578. }),
  51579. (n.Path.prototype.getSpacedPoints = function (e) {
  51580. e || (e = 40)
  51581. for (var t = [], i = 0; i < e; i++) t.push(this.getPoint(i / e))
  51582. return this.autoClose && t.push(t[0]), t
  51583. }),
  51584. (n.Path.prototype.getPoints = function (e) {
  51585. e = e || 12
  51586. 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++) {
  51587. var A = this.actions[m],
  51588. y = A.action,
  51589. C = A.args
  51590. switch (y) {
  51591. case 'moveTo':
  51592. g.push(new n.Vector2(C[0], C[1]))
  51593. break
  51594. case 'lineTo':
  51595. g.push(new n.Vector2(C[0], C[1]))
  51596. break
  51597. case 'quadraticCurveTo':
  51598. ;(t = C[2]),
  51599. (i = C[3]),
  51600. (a = C[0]),
  51601. (s = C[1]),
  51602. g.length > 0 ? ((h = g[g.length - 1]), (l = h.x), (c = h.y)) : ((h = this.actions[m - 1].args), (l = h[h.length - 2]), (c = h[h.length - 1]))
  51603. for (var I = 1; I <= e; I++) {
  51604. var E = I / e
  51605. ;(u = p(E, l, a, t)), (d = p(E, c, s, i)), g.push(new n.Vector2(u, d))
  51606. }
  51607. break
  51608. case 'bezierCurveTo':
  51609. ;(t = C[4]),
  51610. (i = C[5]),
  51611. (a = C[0]),
  51612. (s = C[1]),
  51613. (r = C[2]),
  51614. (o = C[3]),
  51615. g.length > 0 ? ((h = g[g.length - 1]), (l = h.x), (c = h.y)) : ((h = this.actions[m - 1].args), (l = h[h.length - 2]), (c = h[h.length - 1]))
  51616. for (var I = 1; I <= e; I++) {
  51617. var E = I / e
  51618. ;(u = f(E, l, a, r, t)), (d = f(E, c, s, o, i)), g.push(new n.Vector2(u, d))
  51619. }
  51620. break
  51621. case 'splineThru':
  51622. h = this.actions[m - 1].args
  51623. var b = new n.Vector2(h[h.length - 2], h[h.length - 1]),
  51624. w = [b],
  51625. _ = e * C[0].length
  51626. w = w.concat(C[0])
  51627. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++) g.push(T.getPointAt(I / _))
  51628. break
  51629. case 'arc':
  51630. 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++) {
  51631. var E = I / N
  51632. L || (E = 1 - E), (x = P + E * D), (u = S + R * Math.cos(x)), (d = M + R * Math.sin(x)), g.push(new n.Vector2(u, d))
  51633. }
  51634. break
  51635. case 'ellipse':
  51636. var x,
  51637. B,
  51638. F,
  51639. S = C[0],
  51640. M = C[1],
  51641. V = C[2],
  51642. U = C[3],
  51643. P = C[4],
  51644. O = C[5],
  51645. L = !!C[6],
  51646. k = C[7],
  51647. D = O - P,
  51648. N = 2 * e
  51649. 0 !== k && ((B = Math.cos(k)), (F = Math.sin(k)))
  51650. for (var I = 1; I <= N; I++) {
  51651. var E = I / N
  51652. if ((L || (E = 1 - E), (x = P + E * D), (u = S + V * Math.cos(x)), (d = M + U * Math.sin(x)), 0 !== k)) {
  51653. var H = u,
  51654. G = d
  51655. ;(u = (H - S) * B - (G - M) * F + S), (d = (H - S) * F + (G - M) * B + M)
  51656. }
  51657. g.push(new n.Vector2(u, d))
  51658. }
  51659. }
  51660. }
  51661. var z = g[g.length - 1]
  51662. 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), this.autoClose && g.push(g[0]), g
  51663. }),
  51664. (n.Path.prototype.toShapes = function (e, t) {
  51665. function i(e) {
  51666. for (var t = [], i = new n.Path(), r = 0, o = e.length; r < o; r++) {
  51667. var a = e[r],
  51668. s = a.args,
  51669. l = a.action
  51670. 'moveTo' === l && 0 !== i.actions.length && (t.push(i), (i = new n.Path())), i[l].apply(i, s)
  51671. }
  51672. return 0 !== i.actions.length && t.push(i), t
  51673. }
  51674. function r(e) {
  51675. for (var t = [], i = 0, r = e.length; i < r; i++) {
  51676. var o = e[i],
  51677. a = new n.Shape()
  51678. ;(a.actions = o.actions), (a.curves = o.curves), t.push(a)
  51679. }
  51680. return t
  51681. }
  51682. function o(e, t) {
  51683. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  51684. var a = t[r],
  51685. s = t[o],
  51686. l = s.x - a.x,
  51687. c = s.y - a.y
  51688. if (Math.abs(c) > Number.EPSILON) {
  51689. if ((c < 0 && ((a = t[o]), (l = -l), (s = t[r]), (c = -c)), e.y < a.y || e.y > s.y)) continue
  51690. if (e.y === a.y) {
  51691. if (e.x === a.x) return !0
  51692. } else {
  51693. var h = c * (e.x - a.x) - l * (e.y - a.y)
  51694. if (0 === h) return !0
  51695. if (h < 0) continue
  51696. n = !n
  51697. }
  51698. } else {
  51699. if (e.y !== a.y) continue
  51700. if ((s.x <= e.x && e.x <= a.x) || (a.x <= e.x && e.x <= s.x)) return !0
  51701. }
  51702. }
  51703. return n
  51704. }
  51705. var a = n.ShapeUtils.isClockWise,
  51706. s = i(this.actions)
  51707. if (0 === s.length) return []
  51708. if (t === !0) return r(s)
  51709. var l,
  51710. c,
  51711. h,
  51712. u = []
  51713. if (1 === s.length) return (c = s[0]), (h = new n.Shape()), (h.actions = c.actions), (h.curves = c.curves), u.push(h), u
  51714. var d = !a(s[0].getPoints())
  51715. d = e ? !d : d
  51716. var p,
  51717. f = [],
  51718. g = [],
  51719. m = [],
  51720. v = 0
  51721. ;(g[v] = void 0), (m[v] = [])
  51722. for (var A = 0, y = s.length; A < y; A++)
  51723. (c = s[A]),
  51724. (p = c.getPoints()),
  51725. (l = a(p)),
  51726. (l = e ? !l : l),
  51727. l
  51728. ? (!d && g[v] && v++,
  51729. (g[v] = {
  51730. s: new n.Shape(),
  51731. p: p
  51732. }),
  51733. (g[v].s.actions = c.actions),
  51734. (g[v].s.curves = c.curves),
  51735. d && v++,
  51736. (m[v] = []))
  51737. : m[v].push({
  51738. h: c,
  51739. p: p[0]
  51740. })
  51741. if (!g[0]) return r(s)
  51742. if (g.length > 1) {
  51743. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++) f[E] = []
  51744. for (var E = 0, b = g.length; E < b; E++)
  51745. for (var w = m[E], _ = 0; _ < w.length; _++) {
  51746. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  51747. o(T.p, g[S].p) &&
  51748. (E !== S &&
  51749. I.push({
  51750. froms: E,
  51751. tos: S,
  51752. hole: _
  51753. }),
  51754. x ? ((x = !1), f[S].push(T)) : (C = !0))
  51755. x && f[E].push(T)
  51756. }
  51757. I.length > 0 && (C || (m = f))
  51758. }
  51759. for (var M, A = 0, R = g.length; A < R; A++) {
  51760. ;(h = g[A].s), u.push(h), (M = m[A])
  51761. for (var P = 0, O = M.length; P < O; P++) h.holes.push(M[P].h)
  51762. }
  51763. return u
  51764. }),
  51765. (n.Shape = function () {
  51766. n.Path.apply(this, arguments), (this.holes = [])
  51767. }),
  51768. (n.Shape.prototype = Object.create(n.Path.prototype)),
  51769. (n.Shape.prototype.constructor = n.Shape),
  51770. (n.Shape.prototype.extrude = function (e) {
  51771. return new n.ExtrudeGeometry(this, e)
  51772. }),
  51773. (n.Shape.prototype.makeGeometry = function (e) {
  51774. return new n.ShapeGeometry(this, e)
  51775. }),
  51776. (n.Shape.prototype.getPointsHoles = function (e) {
  51777. for (var t = [], i = 0, n = this.holes.length; i < n; i++) t[i] = this.holes[i].getPoints(e)
  51778. return t
  51779. }),
  51780. (n.Shape.prototype.extractAllPoints = function (e) {
  51781. return {
  51782. shape: this.getPoints(e),
  51783. holes: this.getPointsHoles(e)
  51784. }
  51785. }),
  51786. (n.Shape.prototype.extractPoints = function (e) {
  51787. return this.extractAllPoints(e)
  51788. }),
  51789. (n.LineCurve = function (e, t) {
  51790. ;(this.v1 = e), (this.v2 = t)
  51791. }),
  51792. (n.LineCurve.prototype = Object.create(n.Curve.prototype)),
  51793. (n.LineCurve.prototype.constructor = n.LineCurve),
  51794. (n.LineCurve.prototype.getPoint = function (e) {
  51795. var t = this.v2.clone().sub(this.v1)
  51796. return t.multiplyScalar(e).add(this.v1), t
  51797. }),
  51798. (n.LineCurve.prototype.getPointAt = function (e) {
  51799. return this.getPoint(e)
  51800. }),
  51801. (n.LineCurve.prototype.getTangent = function (e) {
  51802. var t = this.v2.clone().sub(this.v1)
  51803. return t.normalize()
  51804. }),
  51805. (n.QuadraticBezierCurve = function (e, t, i) {
  51806. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  51807. }),
  51808. (n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype)),
  51809. (n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve),
  51810. (n.QuadraticBezierCurve.prototype.getPoint = function (e) {
  51811. var t = n.ShapeUtils.b2
  51812. 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))
  51813. }),
  51814. (n.QuadraticBezierCurve.prototype.getTangent = function (e) {
  51815. var t = n.CurveUtils.tangentQuadraticBezier
  51816. 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()
  51817. }),
  51818. (n.CubicBezierCurve = function (e, t, i, n) {
  51819. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  51820. }),
  51821. (n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype)),
  51822. (n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve),
  51823. (n.CubicBezierCurve.prototype.getPoint = function (e) {
  51824. var t = n.ShapeUtils.b3
  51825. 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))
  51826. }),
  51827. (n.CubicBezierCurve.prototype.getTangent = function (e) {
  51828. var t = n.CurveUtils.tangentCubicBezier
  51829. 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()
  51830. }),
  51831. (n.SplineCurve = function (e) {
  51832. this.points = void 0 == e ? [] : e
  51833. }),
  51834. (n.SplineCurve.prototype = Object.create(n.Curve.prototype)),
  51835. (n.SplineCurve.prototype.constructor = n.SplineCurve),
  51836. (n.SplineCurve.prototype.getPoint = function (e) {
  51837. var t = this.points,
  51838. i = (t.length - 1) * e,
  51839. r = Math.floor(i),
  51840. o = i - r,
  51841. a = t[0 === r ? r : r - 1],
  51842. s = t[r],
  51843. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  51844. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  51845. h = n.CurveUtils.interpolate
  51846. return new n.Vector2(h(a.x, s.x, l.x, c.x, o), h(a.y, s.y, l.y, c.y, o))
  51847. }),
  51848. (n.EllipseCurve = function (e, t, i, n, r, o, a, s) {
  51849. ;(this.aX = e), (this.aY = t), (this.xRadius = i), (this.yRadius = n), (this.aStartAngle = r), (this.aEndAngle = o), (this.aClockwise = a), (this.aRotation = s || 0)
  51850. }),
  51851. (n.EllipseCurve.prototype = Object.create(n.Curve.prototype)),
  51852. (n.EllipseCurve.prototype.constructor = n.EllipseCurve),
  51853. (n.EllipseCurve.prototype.getPoint = function (e) {
  51854. var t = this.aEndAngle - this.aStartAngle
  51855. t < 0 && (t += 2 * Math.PI), t > 2 * Math.PI && (t -= 2 * Math.PI)
  51856. var i
  51857. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t
  51858. var r = this.aX + this.xRadius * Math.cos(i),
  51859. o = this.aY + this.yRadius * Math.sin(i)
  51860. if (0 !== this.aRotation) {
  51861. var a = Math.cos(this.aRotation),
  51862. s = Math.sin(this.aRotation),
  51863. l = r,
  51864. c = o
  51865. ;(r = (l - this.aX) * a - (c - this.aY) * s + this.aX), (o = (l - this.aX) * s + (c - this.aY) * a + this.aY)
  51866. }
  51867. return new n.Vector2(r, o)
  51868. }),
  51869. (n.ArcCurve = function (e, t, i, r, o, a) {
  51870. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  51871. }),
  51872. (n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype)),
  51873. (n.ArcCurve.prototype.constructor = n.ArcCurve),
  51874. (n.LineCurve3 = n.Curve.create(
  51875. function (e, t) {
  51876. ;(this.v1 = e), (this.v2 = t)
  51877. },
  51878. function (e) {
  51879. var t = new n.Vector3()
  51880. return t.subVectors(this.v2, this.v1), t.multiplyScalar(e), t.add(this.v1), t
  51881. }
  51882. )),
  51883. (n.QuadraticBezierCurve3 = n.Curve.create(
  51884. function (e, t, i) {
  51885. ;(this.v0 = e), (this.v1 = t), (this.v2 = i)
  51886. },
  51887. function (e) {
  51888. var t = n.ShapeUtils.b2
  51889. 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))
  51890. }
  51891. )),
  51892. (n.CubicBezierCurve3 = n.Curve.create(
  51893. function (e, t, i, n) {
  51894. ;(this.v0 = e), (this.v1 = t), (this.v2 = i), (this.v3 = n)
  51895. },
  51896. function (e) {
  51897. var t = n.ShapeUtils.b3
  51898. 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))
  51899. }
  51900. )),
  51901. (n.SplineCurve3 = n.Curve.create(
  51902. function (e) {
  51903. console.warn('THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3'), (this.points = void 0 == e ? [] : e)
  51904. },
  51905. function (e) {
  51906. var t = this.points,
  51907. i = (t.length - 1) * e,
  51908. r = Math.floor(i),
  51909. o = i - r,
  51910. a = t[0 == r ? r : r - 1],
  51911. s = t[r],
  51912. l = t[r > t.length - 2 ? t.length - 1 : r + 1],
  51913. c = t[r > t.length - 3 ? t.length - 1 : r + 2],
  51914. h = n.CurveUtils.interpolate
  51915. 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))
  51916. }
  51917. )),
  51918. (n.CatmullRomCurve3 = (function () {
  51919. function e() {}
  51920. var t = new n.Vector3(),
  51921. i = new e(),
  51922. r = new e(),
  51923. o = new e()
  51924. return (
  51925. (e.prototype.init = function (e, t, i, n) {
  51926. ;(this.c0 = e), (this.c1 = i), (this.c2 = -3 * e + 3 * t - 2 * i - n), (this.c3 = 2 * e - 2 * t + i + n)
  51927. }),
  51928. (e.prototype.initNonuniformCatmullRom = function (e, t, i, n, r, o, a) {
  51929. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o,
  51930. l = (i - t) / o - (n - t) / (o + a) + (n - i) / a
  51931. ;(s *= o), (l *= o), this.init(t, i, s, l)
  51932. }),
  51933. (e.prototype.initCatmullRom = function (e, t, i, n, r) {
  51934. this.init(t, i, r * (i - e), r * (n - t))
  51935. }),
  51936. (e.prototype.calc = function (e) {
  51937. var t = e * e,
  51938. i = t * e
  51939. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  51940. }),
  51941. n.Curve.create(
  51942. function (e) {
  51943. ;(this.points = e || []), (this.closed = !1)
  51944. },
  51945. function (e) {
  51946. var a,
  51947. s,
  51948. l,
  51949. c,
  51950. h = this.points
  51951. ;(c = h.length),
  51952. c < 2 && console.log('duh, you need at least 2 points'),
  51953. (a = (c - (this.closed ? 0 : 1)) * e),
  51954. (s = Math.floor(a)),
  51955. (l = a - s),
  51956. this.closed ? (s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length) : 0 === l && s === c - 1 && ((s = c - 2), (l = 1))
  51957. var u, d, p, f
  51958. if (
  51959. (this.closed || s > 0 ? (u = h[(s - 1) % c]) : (t.subVectors(h[0], h[1]).add(h[0]), (u = t)),
  51960. (d = h[s % c]),
  51961. (p = h[(s + 1) % c]),
  51962. this.closed || s + 2 < c ? (f = h[(s + 2) % c]) : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]), (f = t)),
  51963. void 0 === this.type || 'centripetal' === this.type || 'chordal' === this.type)
  51964. ) {
  51965. var g = 'chordal' === this.type ? 0.5 : 0.25,
  51966. m = Math.pow(u.distanceToSquared(d), g),
  51967. v = Math.pow(d.distanceToSquared(p), g),
  51968. A = Math.pow(p.distanceToSquared(f), g)
  51969. v < 1e-4 && (v = 1),
  51970. m < 1e-4 && (m = v),
  51971. A < 1e-4 && (A = v),
  51972. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  51973. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  51974. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  51975. } else if ('catmullrom' === this.type) {
  51976. var y = void 0 !== this.tension ? this.tension : 0.5
  51977. i.initCatmullRom(u.x, d.x, p.x, f.x, y), r.initCatmullRom(u.y, d.y, p.y, f.y, y), o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  51978. }
  51979. var C = new n.Vector3(i.calc(l), r.calc(l), o.calc(l))
  51980. return C
  51981. }
  51982. )
  51983. )
  51984. })()),
  51985. (n.ClosedSplineCurve3 = function (e) {
  51986. console.warn('THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3.'), n.CatmullRomCurve3.call(this, e), (this.type = 'catmullrom'), (this.closed = !0)
  51987. }),
  51988. (n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype)),
  51989. (n.BoxGeometry = function (e, t, i, r, o, a) {
  51990. n.Geometry.call(this),
  51991. (this.type = 'BoxGeometry'),
  51992. (this.parameters = {
  51993. width: e,
  51994. height: t,
  51995. depth: i,
  51996. widthSegments: r,
  51997. heightSegments: o,
  51998. depthSegments: a
  51999. }),
  52000. this.fromBufferGeometry(new n.BoxBufferGeometry(e, t, i, r, o, a)),
  52001. this.mergeVertices()
  52002. }),
  52003. (n.BoxGeometry.prototype = Object.create(n.Geometry.prototype)),
  52004. (n.BoxGeometry.prototype.constructor = n.BoxGeometry),
  52005. (n.CubeGeometry = n.BoxGeometry),
  52006. (n.BoxBufferGeometry = function (e, t, i, r, o, a) {
  52007. function s(e, t, i) {
  52008. var n = 0
  52009. return (n += e * t * 2), (n += e * i * 2), (n += i * t * 2), 4 * n
  52010. }
  52011. function l(e, t, i, r, o, a, s, l, h, u, I) {
  52012. 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++)
  52013. for (var L = O * b - _, D = 0; D < x; D++) {
  52014. var N = D * E - w
  52015. ;(P[e] = N * r),
  52016. (P[t] = L * o),
  52017. (P[i] = T),
  52018. (p[m] = P.x),
  52019. (p[m + 1] = P.y),
  52020. (p[m + 2] = P.z),
  52021. (P[e] = 0),
  52022. (P[t] = 0),
  52023. (P[i] = l > 0 ? 1 : -1),
  52024. (f[m] = P.x),
  52025. (f[m + 1] = P.y),
  52026. (f[m + 2] = P.z),
  52027. (g[v] = D / h),
  52028. (g[v + 1] = 1 - O / u),
  52029. (m += 3),
  52030. (v += 2),
  52031. (M += 1)
  52032. }
  52033. for (O = 0; O < u; O++)
  52034. for (D = 0; D < h; D++) {
  52035. var B = y + D + x * O,
  52036. F = y + D + x * (O + 1),
  52037. V = y + (D + 1) + x * (O + 1),
  52038. U = y + (D + 1) + x * O
  52039. ;(d[A] = B), (d[A + 1] = F), (d[A + 2] = U), (d[A + 3] = F), (d[A + 4] = V), (d[A + 5] = U), (A += 6), (R += 6)
  52040. }
  52041. c.addGroup(C, R, I), (C += R), (y += M)
  52042. }
  52043. n.BufferGeometry.call(this),
  52044. (this.type = 'BoxBufferGeometry'),
  52045. (this.parameters = {
  52046. width: e,
  52047. height: t,
  52048. depth: i,
  52049. widthSegments: r,
  52050. heightSegments: o,
  52051. depthSegments: a
  52052. })
  52053. var c = this
  52054. ;(r = Math.floor(r) || 1), (o = Math.floor(o) || 1), (a = Math.floor(a) || 1)
  52055. var h = s(r, o, a),
  52056. u = (h / 4) * 6,
  52057. d = new (u > 65535 ? Uint32Array : Uint16Array)(u),
  52058. p = new Float32Array(3 * h),
  52059. f = new Float32Array(3 * h),
  52060. g = new Float32Array(2 * h),
  52061. m = 0,
  52062. v = 0,
  52063. A = 0,
  52064. y = 0,
  52065. C = 0
  52066. l('z', 'y', 'x', -1, -1, i, t, e, a, o, 0),
  52067. l('z', 'y', 'x', 1, -1, i, t, -e, a, o, 1),
  52068. l('x', 'z', 'y', 1, 1, e, i, t, r, a, 2),
  52069. l('x', 'z', 'y', 1, -1, e, i, -t, r, a, 3),
  52070. l('x', 'y', 'z', 1, -1, e, t, i, r, o, 4),
  52071. l('x', 'y', 'z', -1, -1, e, t, -i, r, o, 5),
  52072. this.setIndex(new n.BufferAttribute(d, 1)),
  52073. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  52074. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  52075. this.addAttribute('uv', new n.BufferAttribute(g, 2))
  52076. }),
  52077. (n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52078. (n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry),
  52079. (n.CircleGeometry = function (e, t, i, r) {
  52080. n.Geometry.call(this),
  52081. (this.type = 'CircleGeometry'),
  52082. (this.parameters = {
  52083. radius: e,
  52084. segments: t,
  52085. thetaStart: i,
  52086. thetaLength: r
  52087. }),
  52088. this.fromBufferGeometry(new n.CircleBufferGeometry(e, t, i, r))
  52089. }),
  52090. (n.CircleGeometry.prototype = Object.create(n.Geometry.prototype)),
  52091. (n.CircleGeometry.prototype.constructor = n.CircleGeometry),
  52092. (n.CircleBufferGeometry = function (e, t, i, r) {
  52093. n.BufferGeometry.call(this),
  52094. (this.type = 'CircleBufferGeometry'),
  52095. (this.parameters = {
  52096. radius: e,
  52097. segments: t,
  52098. thetaStart: i,
  52099. thetaLength: r
  52100. }),
  52101. (e = e || 50),
  52102. (t = void 0 !== t ? Math.max(3, t) : 8),
  52103. (i = void 0 !== i ? i : 0),
  52104. (r = void 0 !== r ? r : 2 * Math.PI)
  52105. var o = t + 2,
  52106. a = new Float32Array(3 * o),
  52107. s = new Float32Array(3 * o),
  52108. l = new Float32Array(2 * o)
  52109. ;(s[2] = 1), (l[0] = 0.5), (l[1] = 0.5)
  52110. for (var c = 0, h = 3, u = 2; c <= t; c++, h += 3, u += 2) {
  52111. var d = i + (c / t) * r
  52112. ;(a[h] = e * Math.cos(d)), (a[h + 1] = e * Math.sin(d)), (s[h + 2] = 1), (l[u] = (a[h] / e + 1) / 2), (l[u + 1] = (a[h + 1] / e + 1) / 2)
  52113. }
  52114. for (var p = [], h = 1; h <= t; h++) p.push(h, h + 1, 0)
  52115. this.setIndex(new n.BufferAttribute(new Uint16Array(p), 1)),
  52116. this.addAttribute('position', new n.BufferAttribute(a, 3)),
  52117. this.addAttribute('normal', new n.BufferAttribute(s, 3)),
  52118. this.addAttribute('uv', new n.BufferAttribute(l, 2)),
  52119. (this.boundingSphere = new n.Sphere(new n.Vector3(), e))
  52120. }),
  52121. (n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52122. (n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry),
  52123. (n.CylinderBufferGeometry = function (e, t, i, r, o, a, s, l) {
  52124. function c() {
  52125. var e = (r + 1) * (o + 1)
  52126. return a === !1 && (e += 2 * (r + 1) + 2 * r), e
  52127. }
  52128. function h() {
  52129. var e = r * o * 2 * 3
  52130. return a === !1 && (e += 2 * r * 3), e
  52131. }
  52132. function u() {
  52133. var a,
  52134. c,
  52135. h = new n.Vector3(),
  52136. u = new n.Vector3(),
  52137. d = (t - e) / i
  52138. for (c = 0; c <= o; c++) {
  52139. var p = [],
  52140. f = c / o,
  52141. b = f * (t - e) + e
  52142. for (a = 0; a <= r; a++) {
  52143. var w = a / r
  52144. ;(u.x = b * Math.sin(w * l + s)),
  52145. (u.y = -f * i + E),
  52146. (u.z = b * Math.cos(w * l + s)),
  52147. m.setXYZ(y, u.x, u.y, u.z),
  52148. h.copy(u),
  52149. ((0 === e && 0 === c) || (0 === t && c === o)) && ((h.x = Math.sin(w * l + s)), (h.z = Math.cos(w * l + s))),
  52150. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  52151. v.setXYZ(y, h.x, h.y, h.z),
  52152. A.setXY(y, w, 1 - f),
  52153. p.push(y),
  52154. y++
  52155. }
  52156. I.push(p)
  52157. }
  52158. for (a = 0; a < r; a++)
  52159. for (c = 0; c < o; c++) {
  52160. var _ = I[c][a],
  52161. T = I[c + 1][a],
  52162. x = I[c + 1][a + 1],
  52163. S = I[c][a + 1]
  52164. g.setX(C, _), C++, g.setX(C, T), C++, g.setX(C, S), C++, g.setX(C, T), C++, g.setX(C, x), C++, g.setX(C, S), C++
  52165. }
  52166. }
  52167. function d(i) {
  52168. var o,
  52169. a,
  52170. c,
  52171. h = new n.Vector2(),
  52172. u = new n.Vector3(),
  52173. d = i === !0 ? e : t,
  52174. p = i === !0 ? 1 : -1
  52175. for (a = y, o = 1; o <= r; o++) m.setXYZ(y, 0, E * p, 0), v.setXYZ(y, 0, p, 0), i === !0 ? ((h.x = o / r), (h.y = 0)) : ((h.x = (o - 1) / r), (h.y = 1)), A.setXY(y, h.x, h.y), y++
  52176. for (c = y, o = 0; o <= r; o++) {
  52177. var f = o / r
  52178. ;(u.x = d * Math.sin(f * l + s)), (u.y = E * p), (u.z = d * Math.cos(f * l + s)), m.setXYZ(y, u.x, u.y, u.z), v.setXYZ(y, 0, p, 0), A.setXY(y, f, i === !0 ? 1 : 0), y++
  52179. }
  52180. for (o = 0; o < r; o++) {
  52181. var I = a + o,
  52182. b = c + o
  52183. i === !0 ? (g.setX(C, b), C++, g.setX(C, b + 1), C++, g.setX(C, I), C++) : (g.setX(C, b + 1), C++, g.setX(C, b), C++, g.setX(C, I), C++)
  52184. }
  52185. }
  52186. n.BufferGeometry.call(this),
  52187. (this.type = 'CylinderBufferGeometry'),
  52188. (this.parameters = {
  52189. radiusTop: e,
  52190. radiusBottom: t,
  52191. height: i,
  52192. radialSegments: r,
  52193. heightSegments: o,
  52194. openEnded: a,
  52195. thetaStart: s,
  52196. thetaLength: l
  52197. }),
  52198. (e = void 0 !== e ? e : 20),
  52199. (t = void 0 !== t ? t : 20),
  52200. (i = void 0 !== i ? i : 100),
  52201. (r = Math.floor(r) || 8),
  52202. (o = Math.floor(o) || 1),
  52203. (a = void 0 !== a && a),
  52204. (s = void 0 !== s ? s : 0),
  52205. (l = void 0 !== l ? l : 2 * Math.PI)
  52206. var p = c(),
  52207. f = h(),
  52208. g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f), 1),
  52209. m = new n.BufferAttribute(new Float32Array(3 * p), 3),
  52210. v = new n.BufferAttribute(new Float32Array(3 * p), 3),
  52211. A = new n.BufferAttribute(new Float32Array(2 * p), 2),
  52212. y = 0,
  52213. C = 0,
  52214. I = [],
  52215. E = i / 2
  52216. u(), a === !1 && (e > 0 && d(!0), t > 0 && d(!1)), this.setIndex(g), this.addAttribute('position', m), this.addAttribute('normal', v), this.addAttribute('uv', A)
  52217. }),
  52218. (n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52219. (n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry),
  52220. (n.CylinderGeometry = function (e, t, i, r, o, a, s, l) {
  52221. n.Geometry.call(this),
  52222. (this.type = 'CylinderGeometry'),
  52223. (this.parameters = {
  52224. radiusTop: e,
  52225. radiusBottom: t,
  52226. height: i,
  52227. radialSegments: r,
  52228. heightSegments: o,
  52229. openEnded: a,
  52230. thetaStart: s,
  52231. thetaLength: l
  52232. }),
  52233. this.fromBufferGeometry(new n.CylinderBufferGeometry(e, t, i, r, o, a, s, l)),
  52234. this.mergeVertices()
  52235. }),
  52236. (n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype)),
  52237. (n.CylinderGeometry.prototype.constructor = n.CylinderGeometry),
  52238. (n.EdgesGeometry = function (e, t) {
  52239. function i(e, t) {
  52240. return e - t
  52241. }
  52242. n.BufferGeometry.call(this), (t = void 0 !== t ? t : 1)
  52243. var r,
  52244. o = Math.cos(n.Math.degToRad(t)),
  52245. a = [0, 0],
  52246. s = {},
  52247. l = ['a', 'b', 'c']
  52248. e instanceof n.BufferGeometry ? ((r = new n.Geometry()), r.fromBufferGeometry(e)) : (r = e.clone()), r.mergeVertices(), r.computeFaceNormals()
  52249. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  52250. for (var p = h[u], f = 0; f < 3; f++) {
  52251. ;(a[0] = p[l[f]]), (a[1] = p[l[(f + 1) % 3]]), a.sort(i)
  52252. var g = a.toString()
  52253. void 0 === s[g]
  52254. ? (s[g] = {
  52255. vert1: a[0],
  52256. vert2: a[1],
  52257. face1: u,
  52258. face2: void 0
  52259. })
  52260. : (s[g].face2 = u)
  52261. }
  52262. var m = []
  52263. for (var g in s) {
  52264. var v = s[g]
  52265. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  52266. var A = c[v.vert1]
  52267. m.push(A.x), m.push(A.y), m.push(A.z), (A = c[v.vert2]), m.push(A.x), m.push(A.y), m.push(A.z)
  52268. }
  52269. }
  52270. this.addAttribute('position', new n.BufferAttribute(new Float32Array(m), 3))
  52271. }),
  52272. (n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52273. (n.EdgesGeometry.prototype.constructor = n.EdgesGeometry),
  52274. (n.ExtrudeGeometry = function (e, t) {
  52275. return 'undefined' == typeof e
  52276. ? void (e = [])
  52277. : (n.Geometry.call(this), (this.type = 'ExtrudeGeometry'), (e = Array.isArray(e) ? e : [e]), this.addShapeList(e, t), void this.computeFaceNormals())
  52278. })
  52279. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype)
  52280. ;(n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry),
  52281. (n.ExtrudeGeometry.prototype.addShapeList = function (e, t) {
  52282. for (var i = e.length, n = 0; n < i; n++) {
  52283. var r = e[n]
  52284. this.addShape(r, t)
  52285. }
  52286. }),
  52287. (n.ExtrudeGeometry.prototype.addShape = function (e, t) {
  52288. function i(e, t, i) {
  52289. return t || console.error('THREE.ExtrudeGeometry: vec does not exist'), t.clone().multiplyScalar(i).add(e)
  52290. }
  52291. function r(e, t, i) {
  52292. var r,
  52293. o,
  52294. a = 1,
  52295. s = e.x - t.x,
  52296. l = e.y - t.y,
  52297. c = i.x - e.x,
  52298. h = i.y - e.y,
  52299. u = s * s + l * l,
  52300. d = s * h - l * c
  52301. if (Math.abs(d) > Number.EPSILON) {
  52302. var p = Math.sqrt(u),
  52303. f = Math.sqrt(c * c + h * h),
  52304. g = t.x - l / p,
  52305. m = t.y + s / p,
  52306. v = i.x - h / f,
  52307. A = i.y + c / f,
  52308. y = ((v - g) * h - (A - m) * c) / (s * h - l * c)
  52309. ;(r = g + s * y - e.x), (o = m + l * y - e.y)
  52310. var C = r * r + o * o
  52311. if (C <= 2) return new n.Vector2(r, o)
  52312. a = Math.sqrt(C / 2)
  52313. } else {
  52314. var I = !1
  52315. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  52316. I ? ((r = -l), (o = s), (a = Math.sqrt(u))) : ((r = s), (o = l), (a = Math.sqrt(u / 2)))
  52317. }
  52318. return new n.Vector2(r / a, o / a)
  52319. }
  52320. function o() {
  52321. if (C) {
  52322. var e = 0,
  52323. t = z * e
  52324. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2] + t, G[1] + t, G[0] + t)
  52325. for (e = E + 2 * y, t = z * e, Y = 0; Y < W; Y++) (G = N[Y]), c(G[0] + t, G[1] + t, G[2] + t)
  52326. } else {
  52327. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[2], G[1], G[0])
  52328. for (Y = 0; Y < W; Y++) (G = N[Y]), c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  52329. }
  52330. }
  52331. function a() {
  52332. var e = 0
  52333. for (s(B, e), e += B.length, x = 0, S = L.length; x < S; x++) (T = L[x]), s(T, e), (e += T.length)
  52334. }
  52335. function s(e, t) {
  52336. var i, n
  52337. for (Y = e.length; --Y >= 0; ) {
  52338. ;(i = Y), (n = Y - 1), n < 0 && (n = e.length - 1)
  52339. var r = 0,
  52340. o = E + 2 * y
  52341. for (r = 0; r < o; r++) {
  52342. var a = z * r,
  52343. s = z * (r + 1),
  52344. l = t + i + a,
  52345. c = t + n + a,
  52346. u = t + n + s,
  52347. d = t + i + s
  52348. h(l, c, u, d, e, r, o, i, n)
  52349. }
  52350. }
  52351. }
  52352. function l(e, t, i) {
  52353. M.vertices.push(new n.Vector3(e, t, i))
  52354. }
  52355. function c(e, t, i) {
  52356. ;(e += R), (t += R), (i += R), M.faces.push(new n.Face3(e, t, i, null, null, 0))
  52357. var r = _.generateTopUV(M, e, t, i)
  52358. M.faceVertexUvs[0].push(r)
  52359. }
  52360. function h(e, t, i, r, o, a, s, l, c) {
  52361. ;(e += R), (t += R), (i += R), (r += R), M.faces.push(new n.Face3(e, t, r, null, null, 1)), M.faces.push(new n.Face3(t, i, r, null, null, 1))
  52362. var h = _.generateSideWallUV(M, e, t, i, r)
  52363. M.faceVertexUvs[0].push([h[0], h[1], h[3]]), M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  52364. }
  52365. var u,
  52366. d,
  52367. p,
  52368. f,
  52369. g,
  52370. m = void 0 !== t.amount ? t.amount : 100,
  52371. v = void 0 !== t.bevelThickness ? t.bevelThickness : 6,
  52372. A = void 0 !== t.bevelSize ? t.bevelSize : v - 2,
  52373. y = void 0 !== t.bevelSegments ? t.bevelSegments : 3,
  52374. C = void 0 === t.bevelEnabled || t.bevelEnabled,
  52375. I = void 0 !== t.curveSegments ? t.curveSegments : 12,
  52376. E = void 0 !== t.steps ? t.steps : 1,
  52377. b = t.extrudePath,
  52378. w = !1,
  52379. _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator
  52380. b &&
  52381. ((u = b.getSpacedPoints(E)),
  52382. (w = !0),
  52383. (C = !1),
  52384. (d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b, E, !1)),
  52385. (p = new n.Vector3()),
  52386. (f = new n.Vector3()),
  52387. (g = new n.Vector3())),
  52388. C || ((y = 0), (v = 0), (A = 0))
  52389. var T,
  52390. x,
  52391. S,
  52392. M = this,
  52393. R = this.vertices.length,
  52394. P = e.extractPoints(I),
  52395. O = P.shape,
  52396. L = P.holes,
  52397. D = !n.ShapeUtils.isClockWise(O)
  52398. if (D) {
  52399. for (O = O.reverse(), x = 0, S = L.length; x < S; x++) (T = L[x]), n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse())
  52400. D = !1
  52401. }
  52402. var N = n.ShapeUtils.triangulateShape(O, L),
  52403. B = O
  52404. for (x = 0, S = L.length; x < S; x++) (T = L[x]), (O = O.concat(T))
  52405. 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++, Z++, q++)
  52406. Z === X && (Z = 0), q === X && (q = 0), (j[Y] = r(B[Y], B[Z], B[q]))
  52407. var K,
  52408. Q = [],
  52409. J = j.concat()
  52410. for (x = 0, S = L.length; x < S; x++) {
  52411. for (T = L[x], K = [], Y = 0, X = T.length, Z = X - 1, q = Y + 1; Y < X; Y++, Z++, q++) Z === X && (Z = 0), q === X && (q = 0), (K[Y] = r(T[Y], T[Z], T[q]))
  52412. Q.push(K), (J = J.concat(K))
  52413. }
  52414. for (F = 0; F < y; F++) {
  52415. for (U = F / y, k = v * (1 - U), V = A * Math.sin((U * Math.PI) / 2), Y = 0, X = B.length; Y < X; Y++) (H = i(B[Y], j[Y], V)), l(H.x, H.y, -k)
  52416. for (x = 0, S = L.length; x < S; x++) for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++) (H = i(T[Y], K[Y], V)), l(H.x, H.y, -k)
  52417. }
  52418. for (V = A, Y = 0; Y < z; Y++)
  52419. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  52420. w ? (f.copy(d.normals[0]).multiplyScalar(H.x), p.copy(d.binormals[0]).multiplyScalar(H.y), g.copy(u[0]).add(f).add(p), l(g.x, g.y, g.z)) : l(H.x, H.y, 0)
  52421. var $
  52422. for ($ = 1; $ <= E; $++)
  52423. for (Y = 0; Y < z; Y++)
  52424. (H = C ? i(O[Y], J[Y], V) : O[Y]),
  52425. w ? (f.copy(d.normals[$]).multiplyScalar(H.x), p.copy(d.binormals[$]).multiplyScalar(H.y), g.copy(u[$]).add(f).add(p), l(g.x, g.y, g.z)) : l(H.x, H.y, (m / E) * $)
  52426. for (F = y - 1; F >= 0; F--) {
  52427. for (U = F / y, k = v * (1 - U), V = A * Math.sin((U * Math.PI) / 2), Y = 0, X = B.length; Y < X; Y++) (H = i(B[Y], j[Y], V)), l(H.x, H.y, m + k)
  52428. for (x = 0, S = L.length; x < S; x++) for (T = L[x], K = Q[x], Y = 0, X = T.length; Y < X; Y++) (H = i(T[Y], K[Y], V)), w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  52429. }
  52430. o(), a()
  52431. }),
  52432. (n.ExtrudeGeometry.WorldUVGenerator = {
  52433. generateTopUV: function (e, t, i, r) {
  52434. var o = e.vertices,
  52435. a = o[t],
  52436. s = o[i],
  52437. l = o[r]
  52438. return [new n.Vector2(a.x, a.y), new n.Vector2(s.x, s.y), new n.Vector2(l.x, l.y)]
  52439. },
  52440. generateSideWallUV: function (e, t, i, r, o) {
  52441. var a = e.vertices,
  52442. s = a[t],
  52443. l = a[i],
  52444. c = a[r],
  52445. h = a[o]
  52446. return Math.abs(s.y - l.y) < 0.01
  52447. ? [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)]
  52448. : [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)]
  52449. }
  52450. }),
  52451. (n.ShapeGeometry = function (e, t) {
  52452. n.Geometry.call(this), (this.type = 'ShapeGeometry'), Array.isArray(e) === !1 && (e = [e]), this.addShapeList(e, t), this.computeFaceNormals()
  52453. }),
  52454. (n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype)),
  52455. (n.ShapeGeometry.prototype.constructor = n.ShapeGeometry),
  52456. (n.ShapeGeometry.prototype.addShapeList = function (e, t) {
  52457. for (var i = 0, n = e.length; i < n; i++) this.addShape(e[i], t)
  52458. return this
  52459. }),
  52460. (n.ShapeGeometry.prototype.addShape = function (e, t) {
  52461. void 0 === t && (t = {})
  52462. var i,
  52463. r,
  52464. o,
  52465. a = void 0 !== t.curveSegments ? t.curveSegments : 12,
  52466. s = t.material,
  52467. l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator,
  52468. c = this.vertices.length,
  52469. h = e.extractPoints(a),
  52470. u = h.shape,
  52471. d = h.holes,
  52472. p = !n.ShapeUtils.isClockWise(u)
  52473. if (p) {
  52474. for (u = u.reverse(), i = 0, r = d.length; i < r; i++) (o = d[i]), n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse())
  52475. p = !1
  52476. }
  52477. var f = n.ShapeUtils.triangulateShape(u, d)
  52478. for (i = 0, r = d.length; i < r; i++) (o = d[i]), (u = u.concat(o))
  52479. var g,
  52480. m,
  52481. v = u.length,
  52482. A = f.length
  52483. for (i = 0; i < v; i++) (g = u[i]), this.vertices.push(new n.Vector3(g.x, g.y, 0))
  52484. for (i = 0; i < A; i++) {
  52485. m = f[i]
  52486. var y = m[0] + c,
  52487. C = m[1] + c,
  52488. I = m[2] + c
  52489. this.faces.push(new n.Face3(y, C, I, null, null, s)), this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  52490. }
  52491. }),
  52492. (n.LatheBufferGeometry = function (e, t, i, r) {
  52493. n.BufferGeometry.call(this),
  52494. (this.type = 'LatheBufferGeometry'),
  52495. (this.parameters = {
  52496. points: e,
  52497. segments: t,
  52498. phiStart: i,
  52499. phiLength: r
  52500. }),
  52501. (t = Math.floor(t) || 12),
  52502. (i = i || 0),
  52503. (r = r || 2 * Math.PI),
  52504. (r = n.Math.clamp(r, 0, 2 * Math.PI))
  52505. var o,
  52506. a,
  52507. s,
  52508. l = (t + 1) * e.length,
  52509. c = t * e.length * 2 * 3,
  52510. h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c), 1),
  52511. u = new n.BufferAttribute(new Float32Array(3 * l), 3),
  52512. d = new n.BufferAttribute(new Float32Array(2 * l), 2),
  52513. p = 0,
  52514. f = 0,
  52515. g = (1 / (e.length - 1), 1 / t),
  52516. m = new n.Vector3(),
  52517. v = new n.Vector2()
  52518. for (a = 0; a <= t; a++) {
  52519. var A = i + a * g * r,
  52520. y = Math.sin(A),
  52521. C = Math.cos(A)
  52522. for (s = 0; s <= e.length - 1; s++)
  52523. (m.x = e[s].x * y), (m.y = e[s].y), (m.z = e[s].x * C), u.setXYZ(p, m.x, m.y, m.z), (v.x = a / t), (v.y = s / (e.length - 1)), d.setXY(p, v.x, v.y), p++
  52524. }
  52525. for (a = 0; a < t; a++)
  52526. for (s = 0; s < e.length - 1; s++) {
  52527. o = s + a * e.length
  52528. var I = o,
  52529. E = o + e.length,
  52530. b = o + e.length + 1,
  52531. w = o + 1
  52532. h.setX(f, I), f++, h.setX(f, E), f++, h.setX(f, w), f++, h.setX(f, E), f++, h.setX(f, b), f++, h.setX(f, w), f++
  52533. }
  52534. if ((this.setIndex(h), this.addAttribute('position', u), this.addAttribute('uv', d), this.computeVertexNormals(), r === 2 * Math.PI)) {
  52535. var _ = this.attributes.normal.array,
  52536. T = new n.Vector3(),
  52537. x = new n.Vector3(),
  52538. S = new n.Vector3()
  52539. for (o = t * e.length * 3, a = 0, s = 0; a < e.length; a++, s += 3)
  52540. (T.x = _[s + 0]),
  52541. (T.y = _[s + 1]),
  52542. (T.z = _[s + 2]),
  52543. (x.x = _[o + s + 0]),
  52544. (x.y = _[o + s + 1]),
  52545. (x.z = _[o + s + 2]),
  52546. S.addVectors(T, x).normalize(),
  52547. (_[s + 0] = _[o + s + 0] = S.x),
  52548. (_[s + 1] = _[o + s + 1] = S.y),
  52549. (_[s + 2] = _[o + s + 2] = S.z)
  52550. }
  52551. }),
  52552. (n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52553. (n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry),
  52554. (n.LatheGeometry = function (e, t, i, r) {
  52555. n.Geometry.call(this),
  52556. (this.type = 'LatheGeometry'),
  52557. (this.parameters = {
  52558. points: e,
  52559. segments: t,
  52560. phiStart: i,
  52561. phiLength: r
  52562. }),
  52563. this.fromBufferGeometry(new n.LatheBufferGeometry(e, t, i, r)),
  52564. this.mergeVertices()
  52565. }),
  52566. (n.LatheGeometry.prototype = Object.create(n.Geometry.prototype)),
  52567. (n.LatheGeometry.prototype.constructor = n.LatheGeometry),
  52568. (n.PlaneGeometry = function (e, t, i, r) {
  52569. n.Geometry.call(this),
  52570. (this.type = 'PlaneGeometry'),
  52571. (this.parameters = {
  52572. width: e,
  52573. height: t,
  52574. widthSegments: i,
  52575. heightSegments: r
  52576. }),
  52577. this.fromBufferGeometry(new n.PlaneBufferGeometry(e, t, i, r))
  52578. }),
  52579. (n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype)),
  52580. (n.PlaneGeometry.prototype.constructor = n.PlaneGeometry),
  52581. (n.PlaneBufferGeometry = function (e, t, i, r) {
  52582. n.BufferGeometry.call(this),
  52583. (this.type = 'PlaneBufferGeometry'),
  52584. (this.parameters = {
  52585. width: e,
  52586. height: t,
  52587. widthSegments: i,
  52588. heightSegments: r
  52589. })
  52590. for (
  52591. var o = e / 2,
  52592. a = t / 2,
  52593. s = Math.floor(i) || 1,
  52594. l = Math.floor(r) || 1,
  52595. c = s + 1,
  52596. h = l + 1,
  52597. u = e / s,
  52598. d = t / l,
  52599. p = new Float32Array(c * h * 3),
  52600. f = new Float32Array(c * h * 3),
  52601. g = new Float32Array(c * h * 2),
  52602. m = 0,
  52603. v = 0,
  52604. A = 0;
  52605. A < h;
  52606. A++
  52607. )
  52608. for (var y = A * d - a, C = 0; C < c; C++) {
  52609. var I = C * u - o
  52610. ;(p[m] = I), (p[m + 1] = -y), (f[m + 2] = 1), (g[v] = C / s), (g[v + 1] = 1 - A / l), (m += 3), (v += 2)
  52611. }
  52612. m = 0
  52613. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  52614. for (var C = 0; C < s; C++) {
  52615. var b = C + c * A,
  52616. w = C + c * (A + 1),
  52617. _ = C + 1 + c * (A + 1),
  52618. T = C + 1 + c * A
  52619. ;(E[m] = b), (E[m + 1] = w), (E[m + 2] = T), (E[m + 3] = w), (E[m + 4] = _), (E[m + 5] = T), (m += 6)
  52620. }
  52621. this.setIndex(new n.BufferAttribute(E, 1)),
  52622. this.addAttribute('position', new n.BufferAttribute(p, 3)),
  52623. this.addAttribute('normal', new n.BufferAttribute(f, 3)),
  52624. this.addAttribute('uv', new n.BufferAttribute(g, 2))
  52625. }),
  52626. (n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52627. (n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry),
  52628. (n.RingBufferGeometry = function (e, t, i, r, o, a) {
  52629. n.BufferGeometry.call(this),
  52630. (this.type = 'RingBufferGeometry'),
  52631. (this.parameters = {
  52632. innerRadius: e,
  52633. outerRadius: t,
  52634. thetaSegments: i,
  52635. phiSegments: r,
  52636. thetaStart: o,
  52637. thetaLength: a
  52638. }),
  52639. (e = e || 20),
  52640. (t = t || 50),
  52641. (o = void 0 !== o ? o : 0),
  52642. (a = void 0 !== a ? a : 2 * Math.PI),
  52643. (i = void 0 !== i ? Math.max(3, i) : 8),
  52644. (r = void 0 !== r ? Math.max(1, r) : 1)
  52645. var s,
  52646. l,
  52647. c,
  52648. h = (i + 1) * (r + 1),
  52649. u = i * r * 2 * 3,
  52650. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  52651. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  52652. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  52653. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  52654. m = 0,
  52655. v = 0,
  52656. A = e,
  52657. y = (t - e) / r,
  52658. C = new n.Vector3(),
  52659. I = new n.Vector2()
  52660. for (l = 0; l <= r; l++) {
  52661. for (c = 0; c <= i; c++)
  52662. (s = o + (c / i) * a),
  52663. (C.x = A * Math.cos(s)),
  52664. (C.y = A * Math.sin(s)),
  52665. p.setXYZ(m, C.x, C.y, C.z),
  52666. f.setXYZ(m, 0, 0, 1),
  52667. (I.x = (C.x / t + 1) / 2),
  52668. (I.y = (C.y / t + 1) / 2),
  52669. g.setXY(m, I.x, I.y),
  52670. m++
  52671. A += y
  52672. }
  52673. for (l = 0; l < r; l++) {
  52674. var E = l * (i + 1)
  52675. for (c = 0; c < i; c++) {
  52676. s = c + E
  52677. var b = s,
  52678. w = s + i + 1,
  52679. _ = s + i + 2,
  52680. T = s + 1
  52681. d.setX(v, b), v++, d.setX(v, w), v++, d.setX(v, _), v++, d.setX(v, b), v++, d.setX(v, _), v++, d.setX(v, T), v++
  52682. }
  52683. }
  52684. this.setIndex(d), this.addAttribute('position', p), this.addAttribute('normal', f), this.addAttribute('uv', g)
  52685. }),
  52686. (n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52687. (n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry),
  52688. (n.RingGeometry = function (e, t, i, r, o, a) {
  52689. n.Geometry.call(this),
  52690. (this.type = 'RingGeometry'),
  52691. (this.parameters = {
  52692. innerRadius: e,
  52693. outerRadius: t,
  52694. thetaSegments: i,
  52695. phiSegments: r,
  52696. thetaStart: o,
  52697. thetaLength: a
  52698. }),
  52699. this.fromBufferGeometry(new n.RingBufferGeometry(e, t, i, r, o, a))
  52700. }),
  52701. (n.RingGeometry.prototype = Object.create(n.Geometry.prototype)),
  52702. (n.RingGeometry.prototype.constructor = n.RingGeometry),
  52703. (n.SphereGeometry = function (e, t, i, r, o, a, s) {
  52704. n.Geometry.call(this),
  52705. (this.type = 'SphereGeometry'),
  52706. (this.parameters = {
  52707. radius: e,
  52708. widthSegments: t,
  52709. heightSegments: i,
  52710. phiStart: r,
  52711. phiLength: o,
  52712. thetaStart: a,
  52713. thetaLength: s
  52714. }),
  52715. this.fromBufferGeometry(new n.SphereBufferGeometry(e, t, i, r, o, a, s))
  52716. }),
  52717. (n.SphereGeometry.prototype = Object.create(n.Geometry.prototype)),
  52718. (n.SphereGeometry.prototype.constructor = n.SphereGeometry),
  52719. (n.SphereBufferGeometry = function (e, t, i, r, o, a, s) {
  52720. n.BufferGeometry.call(this),
  52721. (this.type = 'SphereBufferGeometry'),
  52722. (this.parameters = {
  52723. radius: e,
  52724. widthSegments: t,
  52725. heightSegments: i,
  52726. phiStart: r,
  52727. phiLength: o,
  52728. thetaStart: a,
  52729. thetaLength: s
  52730. }),
  52731. (e = e || 50),
  52732. (t = Math.max(3, Math.floor(t) || 8)),
  52733. (i = Math.max(2, Math.floor(i) || 6)),
  52734. (r = void 0 !== r ? r : 0),
  52735. (o = void 0 !== o ? o : 2 * Math.PI),
  52736. (a = void 0 !== a ? a : 0),
  52737. (s = void 0 !== s ? s : Math.PI)
  52738. for (
  52739. var l = a + s,
  52740. c = (t + 1) * (i + 1),
  52741. h = new n.BufferAttribute(new Float32Array(3 * c), 3),
  52742. u = new n.BufferAttribute(new Float32Array(3 * c), 3),
  52743. d = new n.BufferAttribute(new Float32Array(2 * c), 2),
  52744. p = 0,
  52745. f = [],
  52746. g = new n.Vector3(),
  52747. m = 0;
  52748. m <= i;
  52749. m++
  52750. ) {
  52751. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  52752. var C = y / t,
  52753. I = -e * Math.cos(r + C * o) * Math.sin(a + A * s),
  52754. E = e * Math.cos(a + A * s),
  52755. b = e * Math.sin(r + C * o) * Math.sin(a + A * s)
  52756. g.set(I, E, b).normalize(), h.setXYZ(p, I, E, b), u.setXYZ(p, g.x, g.y, g.z), d.setXY(p, C, 1 - A), v.push(p), p++
  52757. }
  52758. f.push(v)
  52759. }
  52760. for (var w = [], m = 0; m < i; m++)
  52761. for (var y = 0; y < t; y++) {
  52762. var _ = f[m][y + 1],
  52763. T = f[m][y],
  52764. x = f[m + 1][y],
  52765. S = f[m + 1][y + 1]
  52766. ;(0 !== m || a > 0) && w.push(_, T, S), (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  52767. }
  52768. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w, 1)),
  52769. this.addAttribute('position', h),
  52770. this.addAttribute('normal', u),
  52771. this.addAttribute('uv', d),
  52772. (this.boundingSphere = new n.Sphere(new n.Vector3(), e))
  52773. }),
  52774. (n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52775. (n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry),
  52776. (n.TextGeometry = function (e, t) {
  52777. t = t || {}
  52778. var i = t.font
  52779. if (i instanceof n.Font == !1) return console.error('THREE.TextGeometry: font parameter is not an instance of THREE.Font.'), new n.Geometry()
  52780. var r = i.generateShapes(e, t.size, t.curveSegments)
  52781. ;(t.amount = void 0 !== t.height ? t.height : 50),
  52782. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  52783. void 0 === t.bevelSize && (t.bevelSize = 8),
  52784. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  52785. n.ExtrudeGeometry.call(this, r, t),
  52786. (this.type = 'TextGeometry')
  52787. }),
  52788. (n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype)),
  52789. (n.TextGeometry.prototype.constructor = n.TextGeometry),
  52790. (n.TorusBufferGeometry = function (e, t, i, r, o) {
  52791. n.BufferGeometry.call(this),
  52792. (this.type = 'TorusBufferGeometry'),
  52793. (this.parameters = {
  52794. radius: e,
  52795. tube: t,
  52796. radialSegments: i,
  52797. tubularSegments: r,
  52798. arc: o
  52799. }),
  52800. (e = e || 100),
  52801. (t = t || 40),
  52802. (i = Math.floor(i) || 8),
  52803. (r = Math.floor(r) || 6),
  52804. (o = o || 2 * Math.PI)
  52805. var a,
  52806. s,
  52807. l = (i + 1) * (r + 1),
  52808. c = i * r * 2 * 3,
  52809. h = new (c > 65535 ? Uint32Array : Uint16Array)(c),
  52810. u = new Float32Array(3 * l),
  52811. d = new Float32Array(3 * l),
  52812. p = new Float32Array(2 * l),
  52813. f = 0,
  52814. g = 0,
  52815. m = 0,
  52816. v = new n.Vector3(),
  52817. A = new n.Vector3(),
  52818. y = new n.Vector3()
  52819. for (a = 0; a <= i; a++)
  52820. for (s = 0; s <= r; s++) {
  52821. var C = (s / r) * o,
  52822. I = (a / i) * Math.PI * 2
  52823. ;(A.x = (e + t * Math.cos(I)) * Math.cos(C)),
  52824. (A.y = (e + t * Math.cos(I)) * Math.sin(C)),
  52825. (A.z = t * Math.sin(I)),
  52826. (u[f] = A.x),
  52827. (u[f + 1] = A.y),
  52828. (u[f + 2] = A.z),
  52829. (v.x = e * Math.cos(C)),
  52830. (v.y = e * Math.sin(C)),
  52831. y.subVectors(A, v).normalize(),
  52832. (d[f] = y.x),
  52833. (d[f + 1] = y.y),
  52834. (d[f + 2] = y.z),
  52835. (p[g] = s / r),
  52836. (p[g + 1] = a / i),
  52837. (f += 3),
  52838. (g += 2)
  52839. }
  52840. for (a = 1; a <= i; a++)
  52841. for (s = 1; s <= r; s++) {
  52842. var E = (r + 1) * a + s - 1,
  52843. b = (r + 1) * (a - 1) + s - 1,
  52844. w = (r + 1) * (a - 1) + s,
  52845. _ = (r + 1) * a + s
  52846. ;(h[m] = E), (h[m + 1] = b), (h[m + 2] = _), (h[m + 3] = b), (h[m + 4] = w), (h[m + 5] = _), (m += 6)
  52847. }
  52848. this.setIndex(new n.BufferAttribute(h, 1)),
  52849. this.addAttribute('position', new n.BufferAttribute(u, 3)),
  52850. this.addAttribute('normal', new n.BufferAttribute(d, 3)),
  52851. this.addAttribute('uv', new n.BufferAttribute(p, 2))
  52852. }),
  52853. (n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52854. (n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry),
  52855. (n.TorusGeometry = function (e, t, i, r, o) {
  52856. n.Geometry.call(this),
  52857. (this.type = 'TorusGeometry'),
  52858. (this.parameters = {
  52859. radius: e,
  52860. tube: t,
  52861. radialSegments: i,
  52862. tubularSegments: r,
  52863. arc: o
  52864. }),
  52865. this.fromBufferGeometry(new n.TorusBufferGeometry(e, t, i, r, o))
  52866. }),
  52867. (n.TorusGeometry.prototype = Object.create(n.Geometry.prototype)),
  52868. (n.TorusGeometry.prototype.constructor = n.TorusGeometry),
  52869. (n.TorusKnotBufferGeometry = function (e, t, i, r, o, a) {
  52870. function s(e, t, i, n, r) {
  52871. var o = Math.cos(e),
  52872. a = Math.sin(e),
  52873. s = (i / t) * e,
  52874. l = Math.cos(s)
  52875. ;(r.x = n * (2 + l) * 0.5 * o), (r.y = n * (2 + l) * a * 0.5), (r.z = n * Math.sin(s) * 0.5)
  52876. }
  52877. n.BufferGeometry.call(this),
  52878. (this.type = 'TorusKnotBufferGeometry'),
  52879. (this.parameters = {
  52880. radius: e,
  52881. tube: t,
  52882. tubularSegments: i,
  52883. radialSegments: r,
  52884. p: o,
  52885. q: a
  52886. }),
  52887. (e = e || 100),
  52888. (t = t || 40),
  52889. (i = Math.floor(i) || 64),
  52890. (r = Math.floor(r) || 8),
  52891. (o = o || 2),
  52892. (a = a || 3)
  52893. var l,
  52894. c,
  52895. h = (r + 1) * (i + 1),
  52896. u = r * i * 2 * 3,
  52897. d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u), 1),
  52898. p = new n.BufferAttribute(new Float32Array(3 * h), 3),
  52899. f = new n.BufferAttribute(new Float32Array(3 * h), 3),
  52900. g = new n.BufferAttribute(new Float32Array(2 * h), 2),
  52901. m = 0,
  52902. v = 0,
  52903. A = new n.Vector3(),
  52904. y = new n.Vector3(),
  52905. C = new n.Vector2(),
  52906. I = new n.Vector3(),
  52907. E = new n.Vector3(),
  52908. b = new n.Vector3(),
  52909. w = new n.Vector3(),
  52910. _ = new n.Vector3()
  52911. for (l = 0; l <= i; ++l) {
  52912. var T = (l / i) * o * Math.PI * 2
  52913. for (s(T, o, a, e, I), s(T + 0.01, o, a, e, E), w.subVectors(E, I), _.addVectors(E, I), b.crossVectors(w, _), _.crossVectors(b, w), b.normalize(), _.normalize(), c = 0; c <= r; ++c) {
  52914. var x = (c / r) * Math.PI * 2,
  52915. S = -t * Math.cos(x),
  52916. M = t * Math.sin(x)
  52917. ;(A.x = I.x + (S * _.x + M * b.x)),
  52918. (A.y = I.y + (S * _.y + M * b.y)),
  52919. (A.z = I.z + (S * _.z + M * b.z)),
  52920. p.setXYZ(m, A.x, A.y, A.z),
  52921. y.subVectors(A, I).normalize(),
  52922. f.setXYZ(m, y.x, y.y, y.z),
  52923. (C.x = l / i),
  52924. (C.y = c / r),
  52925. g.setXY(m, C.x, C.y),
  52926. m++
  52927. }
  52928. }
  52929. for (c = 1; c <= i; c++)
  52930. for (l = 1; l <= r; l++) {
  52931. var R = (r + 1) * (c - 1) + (l - 1),
  52932. P = (r + 1) * c + (l - 1),
  52933. O = (r + 1) * c + l,
  52934. L = (r + 1) * (c - 1) + l
  52935. d.setX(v, R), v++, d.setX(v, P), v++, d.setX(v, L), v++, d.setX(v, P), v++, d.setX(v, O), v++, d.setX(v, L), v++
  52936. }
  52937. this.setIndex(d), this.addAttribute('position', p), this.addAttribute('normal', f), this.addAttribute('uv', g)
  52938. }),
  52939. (n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  52940. (n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry),
  52941. (n.TorusKnotGeometry = function (e, t, i, r, o, a, s) {
  52942. n.Geometry.call(this),
  52943. (this.type = 'TorusKnotGeometry'),
  52944. (this.parameters = {
  52945. radius: e,
  52946. tube: t,
  52947. tubularSegments: i,
  52948. radialSegments: r,
  52949. p: o,
  52950. q: a
  52951. }),
  52952. void 0 !== s && console.warn('THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead.'),
  52953. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e, t, i, r, o, a)),
  52954. this.mergeVertices()
  52955. }),
  52956. (n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype)),
  52957. (n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry),
  52958. (n.TubeGeometry = function (e, t, i, r, o, a) {
  52959. function s(e, t, i) {
  52960. return R.vertices.push(new n.Vector3(e, t, i)) - 1
  52961. }
  52962. n.Geometry.call(this),
  52963. (this.type = 'TubeGeometry'),
  52964. (this.parameters = {
  52965. path: e,
  52966. segments: t,
  52967. radius: i,
  52968. radialSegments: r,
  52969. closed: o,
  52970. taper: a
  52971. }),
  52972. (t = t || 64),
  52973. (i = i || 1),
  52974. (r = r || 8),
  52975. (o = o || !1),
  52976. (a = a || n.TubeGeometry.NoTaper)
  52977. var l,
  52978. c,
  52979. h,
  52980. u,
  52981. d,
  52982. p,
  52983. f,
  52984. g,
  52985. m,
  52986. v,
  52987. A,
  52988. y,
  52989. C,
  52990. I,
  52991. E,
  52992. b,
  52993. w,
  52994. _,
  52995. T,
  52996. x,
  52997. S,
  52998. M = [],
  52999. R = this,
  53000. P = t + 1,
  53001. O = new n.Vector3(),
  53002. L = new n.TubeGeometry.FrenetFrames(e, t, o),
  53003. D = L.tangents,
  53004. N = L.normals,
  53005. B = L.binormals
  53006. for (this.tangents = D, this.normals = N, this.binormals = B, v = 0; v < P; v++)
  53007. for (M[v] = [], u = v / (P - 1), m = e.getPointAt(u), l = D[v], c = N[v], h = B[v], p = i * a(u), A = 0; A < r; A++)
  53008. (d = (A / r) * 2 * Math.PI),
  53009. (f = -p * Math.cos(d)),
  53010. (g = p * Math.sin(d)),
  53011. O.copy(m),
  53012. (O.x += f * c.x + g * h.x),
  53013. (O.y += f * c.y + g * h.y),
  53014. (O.z += f * c.z + g * h.z),
  53015. (M[v][A] = s(O.x, O.y, O.z))
  53016. for (v = 0; v < t; v++)
  53017. for (A = 0; A < r; A++)
  53018. (y = o ? (v + 1) % t : v + 1),
  53019. (C = (A + 1) % r),
  53020. (I = M[v][A]),
  53021. (E = M[y][A]),
  53022. (b = M[y][C]),
  53023. (w = M[v][C]),
  53024. (_ = new n.Vector2(v / t, A / r)),
  53025. (T = new n.Vector2((v + 1) / t, A / r)),
  53026. (x = new n.Vector2((v + 1) / t, (A + 1) / r)),
  53027. (S = new n.Vector2(v / t, (A + 1) / r)),
  53028. this.faces.push(new n.Face3(I, E, w)),
  53029. this.faceVertexUvs[0].push([_, T, S]),
  53030. this.faces.push(new n.Face3(E, b, w)),
  53031. this.faceVertexUvs[0].push([T.clone(), x, S.clone()])
  53032. this.computeFaceNormals(), this.computeVertexNormals()
  53033. }),
  53034. (n.TubeGeometry.prototype = Object.create(n.Geometry.prototype)),
  53035. (n.TubeGeometry.prototype.constructor = n.TubeGeometry),
  53036. (n.TubeGeometry.NoTaper = function (e) {
  53037. return 1
  53038. }),
  53039. (n.TubeGeometry.SinusoidalTaper = function (e) {
  53040. return Math.sin(Math.PI * e)
  53041. }),
  53042. (n.TubeGeometry.FrenetFrames = function (e, t, i) {
  53043. function r() {
  53044. ;(f[0] = new n.Vector3()),
  53045. (g[0] = new n.Vector3()),
  53046. (a = Number.MAX_VALUE),
  53047. (s = Math.abs(p[0].x)),
  53048. (l = Math.abs(p[0].y)),
  53049. (c = Math.abs(p[0].z)),
  53050. s <= a && ((a = s), d.set(1, 0, 0)),
  53051. l <= a && ((a = l), d.set(0, 1, 0)),
  53052. c <= a && d.set(0, 0, 1),
  53053. m.crossVectors(p[0], d).normalize(),
  53054. f[0].crossVectors(p[0], m),
  53055. g[0].crossVectors(p[0], f[0])
  53056. }
  53057. var o,
  53058. a,
  53059. s,
  53060. l,
  53061. c,
  53062. h,
  53063. u,
  53064. d = new n.Vector3(),
  53065. p = [],
  53066. f = [],
  53067. g = [],
  53068. m = new n.Vector3(),
  53069. v = new n.Matrix4(),
  53070. A = t + 1
  53071. for (this.tangents = p, this.normals = f, this.binormals = g, h = 0; h < A; h++) (u = h / (A - 1)), (p[h] = e.getTangentAt(u)), p[h].normalize()
  53072. for (r(), h = 1; h < A; h++)
  53073. (f[h] = f[h - 1].clone()),
  53074. (g[h] = g[h - 1].clone()),
  53075. m.crossVectors(p[h - 1], p[h]),
  53076. m.length() > Number.EPSILON && (m.normalize(), (o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1))), f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  53077. g[h].crossVectors(p[h], f[h])
  53078. if (i)
  53079. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)), o /= A - 1, p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o), h = 1; h < A; h++)
  53080. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)), g[h].crossVectors(p[h], f[h])
  53081. }),
  53082. (n.PolyhedronGeometry = function (e, t, i, r) {
  53083. function o(e) {
  53084. var t = e.normalize().clone()
  53085. t.index = u.vertices.push(t) - 1
  53086. var i = l(e) / 2 / Math.PI + 0.5,
  53087. r = c(e) / Math.PI + 0.5
  53088. return (t.uv = new n.Vector2(i, 1 - r)), t
  53089. }
  53090. function a(e, t, i, r) {
  53091. var o = new n.Face3(e.index, t.index, i.index, [e.clone(), t.clone(), i.clone()], void 0, r)
  53092. u.faces.push(o), C.copy(e).add(t).add(i).divideScalar(3)
  53093. var a = l(C)
  53094. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  53095. }
  53096. function s(e, t) {
  53097. 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++) {
  53098. l[h] = []
  53099. 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++) 0 === g && h === i ? (l[h][g] = d) : (l[h][g] = o(d.clone().lerp(p, g / f)))
  53100. }
  53101. for (var h = 0; h < i; h++)
  53102. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  53103. var m = Math.floor(g / 2)
  53104. 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)
  53105. }
  53106. }
  53107. function l(e) {
  53108. return Math.atan2(e.z, -e.x)
  53109. }
  53110. function c(e) {
  53111. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  53112. }
  53113. function h(e, t, i) {
  53114. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1, e.y)), 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + 0.5, e.y)), e.clone()
  53115. }
  53116. n.Geometry.call(this),
  53117. (this.type = 'PolyhedronGeometry'),
  53118. (this.parameters = {
  53119. vertices: e,
  53120. indices: t,
  53121. radius: i,
  53122. detail: r
  53123. }),
  53124. (i = i || 1),
  53125. (r = r || 0)
  53126. for (var u = this, d = 0, p = e.length; d < p; d += 3) o(new n.Vector3(e[d], e[d + 1], e[d + 2]))
  53127. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3, m++) {
  53128. var v = f[t[d]],
  53129. A = f[t[d + 1]],
  53130. y = f[t[d + 2]]
  53131. g[m] = new n.Face3(v.index, A.index, y.index, [v.clone(), A.clone(), y.clone()], void 0, m)
  53132. }
  53133. for (var C = new n.Vector3(), d = 0, p = g.length; d < p; d++) s(g[d], r)
  53134. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  53135. var I = this.faceVertexUvs[0][d],
  53136. E = I[0].x,
  53137. b = I[1].x,
  53138. w = I[2].x,
  53139. _ = Math.max(E, b, w),
  53140. T = Math.min(E, b, w)
  53141. _ > 0.9 && T < 0.1 && (E < 0.2 && (I[0].x += 1), b < 0.2 && (I[1].x += 1), w < 0.2 && (I[2].x += 1))
  53142. }
  53143. for (var d = 0, p = this.vertices.length; d < p; d++) this.vertices[d].multiplyScalar(i)
  53144. this.mergeVertices(), this.computeFaceNormals(), (this.boundingSphere = new n.Sphere(new n.Vector3(), i))
  53145. }),
  53146. (n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype)),
  53147. (n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry),
  53148. (n.DodecahedronGeometry = function (e, t) {
  53149. var i = (1 + Math.sqrt(5)) / 2,
  53150. r = 1 / i,
  53151. o = [
  53152. -1,
  53153. -1,
  53154. -1,
  53155. -1,
  53156. -1,
  53157. 1,
  53158. -1,
  53159. 1,
  53160. -1,
  53161. -1,
  53162. 1,
  53163. 1,
  53164. 1,
  53165. -1,
  53166. -1,
  53167. 1,
  53168. -1,
  53169. 1,
  53170. 1,
  53171. 1,
  53172. -1,
  53173. 1,
  53174. 1,
  53175. 1,
  53176. 0,
  53177. -r,
  53178. -i,
  53179. 0,
  53180. -r,
  53181. i,
  53182. 0,
  53183. r,
  53184. -i,
  53185. 0,
  53186. r,
  53187. i,
  53188. -r,
  53189. -i,
  53190. 0,
  53191. -r,
  53192. i,
  53193. 0,
  53194. r,
  53195. -i,
  53196. 0,
  53197. r,
  53198. i,
  53199. 0,
  53200. -i,
  53201. 0,
  53202. -r,
  53203. i,
  53204. 0,
  53205. -r,
  53206. -i,
  53207. 0,
  53208. r,
  53209. i,
  53210. 0,
  53211. r
  53212. ],
  53213. a = [
  53214. 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,
  53215. 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,
  53216. 1, 5, 9
  53217. ]
  53218. n.PolyhedronGeometry.call(this, o, a, e, t),
  53219. (this.type = 'DodecahedronGeometry'),
  53220. (this.parameters = {
  53221. radius: e,
  53222. detail: t
  53223. })
  53224. }),
  53225. (n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  53226. (n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry),
  53227. (n.IcosahedronGeometry = function (e, t) {
  53228. var i = (1 + Math.sqrt(5)) / 2,
  53229. 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],
  53230. o = [
  53231. 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,
  53232. 8, 1
  53233. ]
  53234. n.PolyhedronGeometry.call(this, r, o, e, t),
  53235. (this.type = 'IcosahedronGeometry'),
  53236. (this.parameters = {
  53237. radius: e,
  53238. detail: t
  53239. })
  53240. }),
  53241. (n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  53242. (n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry),
  53243. (n.OctahedronGeometry = function (e, t) {
  53244. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1],
  53245. 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]
  53246. n.PolyhedronGeometry.call(this, i, r, e, t),
  53247. (this.type = 'OctahedronGeometry'),
  53248. (this.parameters = {
  53249. radius: e,
  53250. detail: t
  53251. })
  53252. }),
  53253. (n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  53254. (n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry),
  53255. (n.TetrahedronGeometry = function (e, t) {
  53256. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1],
  53257. r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1]
  53258. n.PolyhedronGeometry.call(this, i, r, e, t),
  53259. (this.type = 'TetrahedronGeometry'),
  53260. (this.parameters = {
  53261. radius: e,
  53262. detail: t
  53263. })
  53264. }),
  53265. (n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype)),
  53266. (n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry),
  53267. (n.ParametricGeometry = function (e, t, i) {
  53268. n.Geometry.call(this),
  53269. (this.type = 'ParametricGeometry'),
  53270. (this.parameters = {
  53271. func: e,
  53272. slices: t,
  53273. stacks: i
  53274. })
  53275. var r,
  53276. o,
  53277. a,
  53278. s,
  53279. l,
  53280. c = this.vertices,
  53281. h = this.faces,
  53282. u = this.faceVertexUvs[0],
  53283. d = t + 1
  53284. for (r = 0; r <= i; r++) for (l = r / i, o = 0; o <= t; o++) (s = o / t), (a = e(s, l)), c.push(a)
  53285. var p, f, g, m, v, A, y, C
  53286. for (r = 0; r < i; r++)
  53287. for (o = 0; o < t; o++)
  53288. (p = r * d + o),
  53289. (f = r * d + o + 1),
  53290. (g = (r + 1) * d + o + 1),
  53291. (m = (r + 1) * d + o),
  53292. (v = new n.Vector2(o / t, r / i)),
  53293. (A = new n.Vector2((o + 1) / t, r / i)),
  53294. (y = new n.Vector2((o + 1) / t, (r + 1) / i)),
  53295. (C = new n.Vector2(o / t, (r + 1) / i)),
  53296. h.push(new n.Face3(p, f, m)),
  53297. u.push([v, A, C]),
  53298. h.push(new n.Face3(f, g, m)),
  53299. u.push([A.clone(), y, C.clone()])
  53300. this.computeFaceNormals(), this.computeVertexNormals()
  53301. }),
  53302. (n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype)),
  53303. (n.ParametricGeometry.prototype.constructor = n.ParametricGeometry),
  53304. (n.WireframeGeometry = function (e) {
  53305. function t(e, t) {
  53306. return e - t
  53307. }
  53308. n.BufferGeometry.call(this)
  53309. var i = [0, 0],
  53310. r = {},
  53311. o = ['a', 'b', 'c']
  53312. if (e instanceof n.Geometry) {
  53313. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  53314. for (var d = s[h], p = 0; p < 3; p++) {
  53315. ;(i[0] = d[o[p]]), (i[1] = d[o[(p + 1) % 3]]), i.sort(t)
  53316. var f = i.toString()
  53317. void 0 === r[f] && ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++)
  53318. }
  53319. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  53320. for (var p = 0; p < 2; p++) {
  53321. var m = a[c[2 * h + p]],
  53322. v = 6 * h + 3 * p
  53323. ;(g[v + 0] = m.x), (g[v + 1] = m.y), (g[v + 2] = m.z)
  53324. }
  53325. this.addAttribute('position', new n.BufferAttribute(g, 3))
  53326. } else if (e instanceof n.BufferGeometry)
  53327. if (null !== e.index) {
  53328. var A = e.index.array,
  53329. a = e.attributes.position,
  53330. y = e.groups,
  53331. l = 0
  53332. 0 === y.length && e.addGroup(0, A.length)
  53333. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  53334. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  53335. for (var p = 0; p < 3; p++) {
  53336. ;(i[0] = A[h + p]), (i[1] = A[h + ((p + 1) % 3)]), i.sort(t)
  53337. var f = i.toString()
  53338. void 0 === r[f] && ((c[2 * l] = i[0]), (c[2 * l + 1] = i[1]), (r[f] = !0), l++)
  53339. }
  53340. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  53341. for (var p = 0; p < 2; p++) {
  53342. var v = 6 * h + 3 * p,
  53343. T = c[2 * h + p]
  53344. ;(g[v + 0] = a.getX(T)), (g[v + 1] = a.getY(T)), (g[v + 2] = a.getZ(T))
  53345. }
  53346. this.addAttribute('position', new n.BufferAttribute(g, 3))
  53347. } else {
  53348. 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++)
  53349. for (var p = 0; p < 3; p++) {
  53350. var v = 18 * h + 6 * p,
  53351. S = 9 * h + 3 * p
  53352. ;(g[v + 0] = a[S]), (g[v + 1] = a[S + 1]), (g[v + 2] = a[S + 2])
  53353. var T = 9 * h + 3 * ((p + 1) % 3)
  53354. ;(g[v + 3] = a[T]), (g[v + 4] = a[T + 1]), (g[v + 5] = a[T + 2])
  53355. }
  53356. this.addAttribute('position', new n.BufferAttribute(g, 3))
  53357. }
  53358. }),
  53359. (n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype)),
  53360. (n.WireframeGeometry.prototype.constructor = n.WireframeGeometry),
  53361. (n.AxisHelper = function (e) {
  53362. e = e || 1
  53363. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e]),
  53364. i = new Float32Array([1, 0, 0, 1, 0.6, 0, 0, 1, 0, 0.6, 1, 0, 0, 0, 1, 0, 0.6, 1]),
  53365. r = new n.BufferGeometry()
  53366. r.addAttribute('position', new n.BufferAttribute(t, 3)), r.addAttribute('color', new n.BufferAttribute(i, 3))
  53367. var o = new n.LineBasicMaterial({
  53368. vertexColors: n.VertexColors
  53369. })
  53370. n.LineSegments.call(this, r, o)
  53371. }),
  53372. (n.AxisHelper.prototype = Object.create(n.LineSegments.prototype)),
  53373. (n.AxisHelper.prototype.constructor = n.AxisHelper),
  53374. (n.ArrowHelper = (function () {
  53375. var e = new n.Geometry()
  53376. e.vertices.push(new n.Vector3(0, 0, 0), new n.Vector3(0, 1, 0))
  53377. var t = new n.CylinderGeometry(0, 0.5, 1, 5, 1)
  53378. return (
  53379. t.translate(0, -0.5, 0),
  53380. function (i, r, o, a, s, l) {
  53381. n.Object3D.call(this),
  53382. void 0 === a && (a = 16776960),
  53383. void 0 === o && (o = 1),
  53384. void 0 === s && (s = 0.2 * o),
  53385. void 0 === l && (l = 0.2 * s),
  53386. this.position.copy(r),
  53387. (this.line = new n.Line(
  53388. e,
  53389. new n.LineBasicMaterial({
  53390. color: a
  53391. })
  53392. )),
  53393. (this.line.matrixAutoUpdate = !1),
  53394. this.add(this.line),
  53395. (this.cone = new n.Mesh(
  53396. t,
  53397. new n.MeshBasicMaterial({
  53398. color: a
  53399. })
  53400. )),
  53401. (this.cone.matrixAutoUpdate = !1),
  53402. this.add(this.cone),
  53403. this.setDirection(i),
  53404. this.setLength(o, s, l)
  53405. }
  53406. )
  53407. })()),
  53408. (n.ArrowHelper.prototype = Object.create(n.Object3D.prototype)),
  53409. (n.ArrowHelper.prototype.constructor = n.ArrowHelper),
  53410. (n.ArrowHelper.prototype.setDirection = (function () {
  53411. var e,
  53412. t = new n.Vector3()
  53413. return function (i) {
  53414. i.y > 0.99999
  53415. ? this.quaternion.set(0, 0, 0, 1)
  53416. : i.y < -0.99999
  53417. ? this.quaternion.set(1, 0, 0, 0)
  53418. : (t.set(i.z, 0, -i.x).normalize(), (e = Math.acos(i.y)), this.quaternion.setFromAxisAngle(t, e))
  53419. }
  53420. })()),
  53421. (n.ArrowHelper.prototype.setLength = function (e, t, i) {
  53422. void 0 === t && (t = 0.2 * e),
  53423. void 0 === i && (i = 0.2 * t),
  53424. this.line.scale.set(1, Math.max(0, e - t), 1),
  53425. this.line.updateMatrix(),
  53426. this.cone.scale.set(i, t, i),
  53427. (this.cone.position.y = e),
  53428. this.cone.updateMatrix()
  53429. }),
  53430. (n.ArrowHelper.prototype.setColor = function (e) {
  53431. this.line.material.color.set(e), this.cone.material.color.set(e)
  53432. }),
  53433. (n.BoxHelper = function (e) {
  53434. 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]),
  53435. i = new Float32Array(24),
  53436. r = new n.BufferGeometry()
  53437. r.setIndex(new n.BufferAttribute(t, 1)),
  53438. r.addAttribute('position', new n.BufferAttribute(i, 3)),
  53439. n.LineSegments.call(
  53440. this,
  53441. r,
  53442. new n.LineBasicMaterial({
  53443. color: 16776960
  53444. })
  53445. ),
  53446. void 0 !== e && this.update(e)
  53447. }),
  53448. (n.BoxHelper.prototype = Object.create(n.LineSegments.prototype)),
  53449. (n.BoxHelper.prototype.constructor = n.BoxHelper),
  53450. (n.BoxHelper.prototype.update = (function () {
  53451. var e = new n.Box3()
  53452. return function (t) {
  53453. if ((e.setFromObject(t), !e.isEmpty())) {
  53454. var i = e.min,
  53455. n = e.max,
  53456. r = this.geometry.attributes.position,
  53457. o = r.array
  53458. ;(o[0] = n.x),
  53459. (o[1] = n.y),
  53460. (o[2] = n.z),
  53461. (o[3] = i.x),
  53462. (o[4] = n.y),
  53463. (o[5] = n.z),
  53464. (o[6] = i.x),
  53465. (o[7] = i.y),
  53466. (o[8] = n.z),
  53467. (o[9] = n.x),
  53468. (o[10] = i.y),
  53469. (o[11] = n.z),
  53470. (o[12] = n.x),
  53471. (o[13] = n.y),
  53472. (o[14] = i.z),
  53473. (o[15] = i.x),
  53474. (o[16] = n.y),
  53475. (o[17] = i.z),
  53476. (o[18] = i.x),
  53477. (o[19] = i.y),
  53478. (o[20] = i.z),
  53479. (o[21] = n.x),
  53480. (o[22] = i.y),
  53481. (o[23] = i.z),
  53482. (r.needsUpdate = !0),
  53483. this.geometry.computeBoundingSphere()
  53484. }
  53485. }
  53486. })()),
  53487. (n.BoundingBoxHelper = function (e, t) {
  53488. var i = void 0 !== t ? t : 8947848
  53489. ;(this.object = e),
  53490. (this.box = new n.Box3()),
  53491. n.Mesh.call(
  53492. this,
  53493. new n.BoxGeometry(1, 1, 1),
  53494. new n.MeshBasicMaterial({
  53495. color: i,
  53496. wireframe: !0
  53497. })
  53498. )
  53499. }),
  53500. (n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype)),
  53501. (n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper),
  53502. (n.BoundingBoxHelper.prototype.update = function () {
  53503. this.box.setFromObject(this.object), this.box.size(this.scale), this.box.center(this.position)
  53504. }),
  53505. (n.CameraHelper = function (e) {
  53506. function t(e, t, n) {
  53507. i(e, n), i(t, n)
  53508. }
  53509. function i(e, t) {
  53510. r.vertices.push(new n.Vector3()), r.colors.push(new n.Color(t)), void 0 === a[e] && (a[e] = []), a[e].push(r.vertices.length - 1)
  53511. }
  53512. var r = new n.Geometry(),
  53513. o = new n.LineBasicMaterial({
  53514. color: 16777215,
  53515. vertexColors: n.FaceColors
  53516. }),
  53517. a = {},
  53518. s = 16755200,
  53519. l = 16711680,
  53520. c = 43775,
  53521. h = 16777215,
  53522. u = 3355443
  53523. t('n1', 'n2', s),
  53524. t('n2', 'n4', s),
  53525. t('n4', 'n3', s),
  53526. t('n3', 'n1', s),
  53527. t('f1', 'f2', s),
  53528. t('f2', 'f4', s),
  53529. t('f4', 'f3', s),
  53530. t('f3', 'f1', s),
  53531. t('n1', 'f1', s),
  53532. t('n2', 'f2', s),
  53533. t('n3', 'f3', s),
  53534. t('n4', 'f4', s),
  53535. t('p', 'n1', l),
  53536. t('p', 'n2', l),
  53537. t('p', 'n3', l),
  53538. t('p', 'n4', l),
  53539. t('u1', 'u2', c),
  53540. t('u2', 'u3', c),
  53541. t('u3', 'u1', c),
  53542. t('c', 't', h),
  53543. t('p', 'c', u),
  53544. t('cn1', 'cn2', u),
  53545. t('cn3', 'cn4', u),
  53546. t('cf1', 'cf2', u),
  53547. t('cf3', 'cf4', u),
  53548. n.LineSegments.call(this, r, o),
  53549. (this.camera = e),
  53550. this.camera.updateProjectionMatrix(),
  53551. (this.matrix = e.matrixWorld),
  53552. (this.matrixAutoUpdate = !1),
  53553. (this.pointMap = a),
  53554. this.update()
  53555. }),
  53556. (n.CameraHelper.prototype = Object.create(n.LineSegments.prototype)),
  53557. (n.CameraHelper.prototype.constructor = n.CameraHelper),
  53558. (n.CameraHelper.prototype.update = (function () {
  53559. function e(e, n, a, s) {
  53560. r.set(n, a, s).unproject(o)
  53561. var l = i[e]
  53562. if (void 0 !== l) for (var c = 0, h = l.length; c < h; c++) t.vertices[l[c]].copy(r)
  53563. }
  53564. var t,
  53565. i,
  53566. r = new n.Vector3(),
  53567. o = new n.Camera()
  53568. return function () {
  53569. ;(t = this.geometry), (i = this.pointMap)
  53570. var n = 1,
  53571. r = 1
  53572. o.projectionMatrix.copy(this.camera.projectionMatrix),
  53573. e('c', 0, 0, -1),
  53574. e('t', 0, 0, 1),
  53575. e('n1', -n, -r, -1),
  53576. e('n2', n, -r, -1),
  53577. e('n3', -n, r, -1),
  53578. e('n4', n, r, -1),
  53579. e('f1', -n, -r, 1),
  53580. e('f2', n, -r, 1),
  53581. e('f3', -n, r, 1),
  53582. e('f4', n, r, 1),
  53583. e('u1', 0.7 * n, 1.1 * r, -1),
  53584. e('u2', 0.7 * -n, 1.1 * r, -1),
  53585. e('u3', 0, 2 * r, -1),
  53586. e('cf1', -n, 0, 1),
  53587. e('cf2', n, 0, 1),
  53588. e('cf3', 0, -r, 1),
  53589. e('cf4', 0, r, 1),
  53590. e('cn1', -n, 0, -1),
  53591. e('cn2', n, 0, -1),
  53592. e('cn3', 0, -r, -1),
  53593. e('cn4', 0, r, -1),
  53594. (t.verticesNeedUpdate = !0)
  53595. }
  53596. })()),
  53597. (n.DirectionalLightHelper = function (e, t) {
  53598. n.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), (t = t || 1)
  53599. var i = new n.Geometry()
  53600. 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))
  53601. var r = new n.LineBasicMaterial({
  53602. fog: !1
  53603. })
  53604. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53605. (this.lightPlane = new n.Line(i, r)),
  53606. this.add(this.lightPlane),
  53607. (i = new n.Geometry()),
  53608. i.vertices.push(new n.Vector3(), new n.Vector3()),
  53609. (r = new n.LineBasicMaterial({
  53610. fog: !1
  53611. })),
  53612. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53613. (this.targetLine = new n.Line(i, r)),
  53614. this.add(this.targetLine),
  53615. this.update()
  53616. }),
  53617. (n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype)),
  53618. (n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper),
  53619. (n.DirectionalLightHelper.prototype.dispose = function () {
  53620. this.lightPlane.geometry.dispose(), this.lightPlane.material.dispose(), this.targetLine.geometry.dispose(), this.targetLine.material.dispose()
  53621. }),
  53622. (n.DirectionalLightHelper.prototype.update = (function () {
  53623. var e = new n.Vector3(),
  53624. t = new n.Vector3(),
  53625. i = new n.Vector3()
  53626. return function () {
  53627. e.setFromMatrixPosition(this.light.matrixWorld),
  53628. t.setFromMatrixPosition(this.light.target.matrixWorld),
  53629. i.subVectors(t, e),
  53630. this.lightPlane.lookAt(i),
  53631. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  53632. this.targetLine.geometry.vertices[1].copy(i),
  53633. (this.targetLine.geometry.verticesNeedUpdate = !0),
  53634. this.targetLine.material.color.copy(this.lightPlane.material.color)
  53635. }
  53636. })()),
  53637. (n.EdgesHelper = function (e, t, i) {
  53638. var r = void 0 !== t ? t : 16777215
  53639. n.LineSegments.call(
  53640. this,
  53641. new n.EdgesGeometry(e.geometry, i),
  53642. new n.LineBasicMaterial({
  53643. color: r
  53644. })
  53645. ),
  53646. (this.matrix = e.matrixWorld),
  53647. (this.matrixAutoUpdate = !1)
  53648. }),
  53649. (n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype)),
  53650. (n.EdgesHelper.prototype.constructor = n.EdgesHelper),
  53651. (n.FaceNormalsHelper = function (e, t, i, r) {
  53652. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  53653. var o = void 0 !== i ? i : 16776960,
  53654. a = void 0 !== r ? r : 1,
  53655. s = 0,
  53656. l = this.object.geometry
  53657. l instanceof n.Geometry ? (s = l.faces.length) : console.warn('THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.')
  53658. var c = new n.BufferGeometry(),
  53659. h = new n.Float32Attribute(2 * s * 3, 3)
  53660. c.addAttribute('position', h),
  53661. n.LineSegments.call(
  53662. this,
  53663. c,
  53664. new n.LineBasicMaterial({
  53665. color: o,
  53666. linewidth: a
  53667. })
  53668. ),
  53669. (this.matrixAutoUpdate = !1),
  53670. this.update()
  53671. }),
  53672. (n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  53673. (n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper),
  53674. (n.FaceNormalsHelper.prototype.update = (function () {
  53675. var e = new n.Vector3(),
  53676. t = new n.Vector3(),
  53677. i = new n.Matrix3()
  53678. return function () {
  53679. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld)
  53680. 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++) {
  53681. var u = s[c],
  53682. d = u.normal
  53683. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  53684. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  53685. r.setXYZ(l, e.x, e.y, e.z),
  53686. (l += 1),
  53687. r.setXYZ(l, t.x, t.y, t.z),
  53688. (l += 1)
  53689. }
  53690. return (r.needsUpdate = !0), this
  53691. }
  53692. })()),
  53693. (n.GridHelper = function (e, t) {
  53694. var i = new n.Geometry(),
  53695. r = new n.LineBasicMaterial({
  53696. vertexColors: n.VertexColors
  53697. })
  53698. ;(this.color1 = new n.Color(4473924)), (this.color2 = new n.Color(8947848))
  53699. for (var o = -e; o <= e; o += t) {
  53700. 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))
  53701. var a = 0 === o ? this.color1 : this.color2
  53702. i.colors.push(a, a, a, a)
  53703. }
  53704. n.LineSegments.call(this, i, r)
  53705. }),
  53706. (n.GridHelper.prototype = Object.create(n.LineSegments.prototype)),
  53707. (n.GridHelper.prototype.constructor = n.GridHelper),
  53708. (n.GridHelper.prototype.setColors = function (e, t) {
  53709. this.color1.set(e), this.color2.set(t), (this.geometry.colorsNeedUpdate = !0)
  53710. }),
  53711. (n.HemisphereLightHelper = function (e, t) {
  53712. n.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), (this.colors = [new n.Color(), new n.Color()])
  53713. var i = new n.SphereGeometry(t, 4, 2)
  53714. i.rotateX(-Math.PI / 2)
  53715. for (var r = 0, o = 8; r < o; r++) i.faces[r].color = this.colors[r < 4 ? 0 : 1]
  53716. var a = new n.MeshBasicMaterial({
  53717. vertexColors: n.FaceColors,
  53718. wireframe: !0
  53719. })
  53720. ;(this.lightSphere = new n.Mesh(i, a)), this.add(this.lightSphere), this.update()
  53721. }),
  53722. (n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype)),
  53723. (n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper),
  53724. (n.HemisphereLightHelper.prototype.dispose = function () {
  53725. this.lightSphere.geometry.dispose(), this.lightSphere.material.dispose()
  53726. }),
  53727. (n.HemisphereLightHelper.prototype.update = (function () {
  53728. var e = new n.Vector3()
  53729. return function () {
  53730. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  53731. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  53732. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  53733. (this.lightSphere.geometry.colorsNeedUpdate = !0)
  53734. }
  53735. })()),
  53736. (n.PointLightHelper = function (e, t) {
  53737. ;(this.light = e), this.light.updateMatrixWorld()
  53738. var i = new n.SphereGeometry(t, 4, 2),
  53739. r = new n.MeshBasicMaterial({
  53740. wireframe: !0,
  53741. fog: !1
  53742. })
  53743. r.color.copy(this.light.color).multiplyScalar(this.light.intensity), n.Mesh.call(this, i, r), (this.matrix = this.light.matrixWorld), (this.matrixAutoUpdate = !1)
  53744. }),
  53745. (n.PointLightHelper.prototype = Object.create(n.Mesh.prototype)),
  53746. (n.PointLightHelper.prototype.constructor = n.PointLightHelper),
  53747. (n.PointLightHelper.prototype.dispose = function () {
  53748. this.geometry.dispose(), this.material.dispose()
  53749. }),
  53750. (n.PointLightHelper.prototype.update = function () {
  53751. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  53752. }),
  53753. (n.SkeletonHelper = function (e) {
  53754. this.bones = this.getBoneList(e)
  53755. for (var t = new n.Geometry(), i = 0; i < this.bones.length; i++) {
  53756. var r = this.bones[i]
  53757. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3()), t.vertices.push(new n.Vector3()), t.colors.push(new n.Color(0, 0, 1)), t.colors.push(new n.Color(0, 1, 0)))
  53758. }
  53759. t.dynamic = !0
  53760. var o = new n.LineBasicMaterial({
  53761. vertexColors: n.VertexColors,
  53762. depthTest: !1,
  53763. depthWrite: !1,
  53764. transparent: !0
  53765. })
  53766. n.LineSegments.call(this, t, o), (this.root = e), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1), this.update()
  53767. }),
  53768. (n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype)),
  53769. (n.SkeletonHelper.prototype.constructor = n.SkeletonHelper),
  53770. (n.SkeletonHelper.prototype.getBoneList = function (e) {
  53771. var t = []
  53772. e instanceof n.Bone && t.push(e)
  53773. for (var i = 0; i < e.children.length; i++) t.push.apply(t, this.getBoneList(e.children[i]))
  53774. return t
  53775. }),
  53776. (n.SkeletonHelper.prototype.update = function () {
  53777. 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++) {
  53778. var a = this.bones[o]
  53779. a.parent instanceof n.Bone &&
  53780. (i.multiplyMatrices(t, a.matrixWorld), e.vertices[r].setFromMatrixPosition(i), i.multiplyMatrices(t, a.parent.matrixWorld), e.vertices[r + 1].setFromMatrixPosition(i), (r += 2))
  53781. }
  53782. ;(e.verticesNeedUpdate = !0), e.computeBoundingSphere()
  53783. }),
  53784. (n.SpotLightHelper = function (e) {
  53785. n.Object3D.call(this), (this.light = e), this.light.updateMatrixWorld(), (this.matrix = e.matrixWorld), (this.matrixAutoUpdate = !1)
  53786. var t = new n.CylinderGeometry(0, 1, 1, 8, 1, !0)
  53787. t.translate(0, -0.5, 0), t.rotateX(-Math.PI / 2)
  53788. var i = new n.MeshBasicMaterial({
  53789. wireframe: !0,
  53790. fog: !1
  53791. })
  53792. ;(this.cone = new n.Mesh(t, i)), this.add(this.cone), this.update()
  53793. }),
  53794. (n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype)),
  53795. (n.SpotLightHelper.prototype.constructor = n.SpotLightHelper),
  53796. (n.SpotLightHelper.prototype.dispose = function () {
  53797. this.cone.geometry.dispose(), this.cone.material.dispose()
  53798. }),
  53799. (n.SpotLightHelper.prototype.update = (function () {
  53800. var e = new n.Vector3(),
  53801. t = new n.Vector3()
  53802. return function () {
  53803. var i = this.light.distance ? this.light.distance : 1e4,
  53804. n = i * Math.tan(this.light.angle)
  53805. this.cone.scale.set(n, n, i),
  53806. e.setFromMatrixPosition(this.light.matrixWorld),
  53807. t.setFromMatrixPosition(this.light.target.matrixWorld),
  53808. this.cone.lookAt(t.sub(e)),
  53809. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  53810. }
  53811. })()),
  53812. (n.VertexNormalsHelper = function (e, t, i, r) {
  53813. ;(this.object = e), (this.size = void 0 !== t ? t : 1)
  53814. var o = void 0 !== i ? i : 16711680,
  53815. a = void 0 !== r ? r : 1,
  53816. s = 0,
  53817. l = this.object.geometry
  53818. l instanceof n.Geometry ? (s = 3 * l.faces.length) : l instanceof n.BufferGeometry && (s = l.attributes.normal.count)
  53819. var c = new n.BufferGeometry(),
  53820. h = new n.Float32Attribute(2 * s * 3, 3)
  53821. c.addAttribute('position', h),
  53822. n.LineSegments.call(
  53823. this,
  53824. c,
  53825. new n.LineBasicMaterial({
  53826. color: o,
  53827. linewidth: a
  53828. })
  53829. ),
  53830. (this.matrixAutoUpdate = !1),
  53831. this.update()
  53832. }),
  53833. (n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype)),
  53834. (n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper),
  53835. (n.VertexNormalsHelper.prototype.update = (function () {
  53836. var e = new n.Vector3(),
  53837. t = new n.Vector3(),
  53838. i = new n.Matrix3()
  53839. return function () {
  53840. var r = ['a', 'b', 'c']
  53841. this.object.updateMatrixWorld(!0), i.getNormalMatrix(this.object.matrixWorld)
  53842. var o = this.object.matrixWorld,
  53843. a = this.geometry.attributes.position,
  53844. s = this.object.geometry
  53845. if (s instanceof n.Geometry)
  53846. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  53847. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  53848. var m = l[p[r[f]]],
  53849. v = p.vertexNormals[f]
  53850. e.copy(m).applyMatrix4(o), t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e), a.setXYZ(h, e.x, e.y, e.z), (h += 1), a.setXYZ(h, t.x, t.y, t.z), (h += 1)
  53851. }
  53852. else if (s instanceof n.BufferGeometry)
  53853. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  53854. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  53855. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  53856. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  53857. a.setXYZ(h, e.x, e.y, e.z),
  53858. (h += 1),
  53859. a.setXYZ(h, t.x, t.y, t.z),
  53860. (h += 1)
  53861. return (a.needsUpdate = !0), this
  53862. }
  53863. })()),
  53864. (n.WireframeHelper = function (e, t) {
  53865. var i = void 0 !== t ? t : 16777215
  53866. n.LineSegments.call(
  53867. this,
  53868. new n.WireframeGeometry(e.geometry),
  53869. new n.LineBasicMaterial({
  53870. color: i
  53871. })
  53872. ),
  53873. (this.matrix = e.matrixWorld),
  53874. (this.matrixAutoUpdate = !1)
  53875. }),
  53876. (n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype)),
  53877. (n.WireframeHelper.prototype.constructor = n.WireframeHelper),
  53878. (n.ImmediateRenderObject = function (e) {
  53879. n.Object3D.call(this), (this.material = e), (this.render = function (e) {})
  53880. }),
  53881. (n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype)),
  53882. (n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject),
  53883. (n.MorphBlendMesh = function (e, t) {
  53884. n.Mesh.call(this, e, t), (this.animationsMap = {}), (this.animationsList = [])
  53885. var i = this.geometry.morphTargets.length,
  53886. r = '__default',
  53887. o = 0,
  53888. a = i - 1,
  53889. s = i / 1
  53890. this.createAnimation(r, o, a, s), this.setAnimationWeight(r, 1)
  53891. }),
  53892. (n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype)),
  53893. (n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh),
  53894. (n.MorphBlendMesh.prototype.createAnimation = function (e, t, i, n) {
  53895. var r = {
  53896. start: t,
  53897. end: i,
  53898. length: i - t + 1,
  53899. fps: n,
  53900. duration: (i - t) / n,
  53901. lastFrame: 0,
  53902. currentFrame: 0,
  53903. active: !1,
  53904. time: 0,
  53905. direction: 1,
  53906. weight: 1,
  53907. directionBackwards: !1,
  53908. mirroredLoop: !1
  53909. }
  53910. ;(this.animationsMap[e] = r), this.animationsList.push(r)
  53911. }),
  53912. (n.MorphBlendMesh.prototype.autoCreateAnimations = function (e) {
  53913. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  53914. var s = r.morphTargets[o],
  53915. l = s.name.match(i)
  53916. if (l && l.length > 1) {
  53917. var c = l[1]
  53918. n[c] ||
  53919. (n[c] = {
  53920. start: 1 / 0,
  53921. end: -(1 / 0)
  53922. })
  53923. var h = n[c]
  53924. o < h.start && (h.start = o), o > h.end && (h.end = o), t || (t = c)
  53925. }
  53926. }
  53927. for (var c in n) {
  53928. var h = n[c]
  53929. this.createAnimation(c, h.start, h.end, e)
  53930. }
  53931. this.firstAnimation = t
  53932. }),
  53933. (n.MorphBlendMesh.prototype.setAnimationDirectionForward = function (e) {
  53934. var t = this.animationsMap[e]
  53935. t && ((t.direction = 1), (t.directionBackwards = !1))
  53936. }),
  53937. (n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function (e) {
  53938. var t = this.animationsMap[e]
  53939. t && ((t.direction = -1), (t.directionBackwards = !0))
  53940. }),
  53941. (n.MorphBlendMesh.prototype.setAnimationFPS = function (e, t) {
  53942. var i = this.animationsMap[e]
  53943. i && ((i.fps = t), (i.duration = (i.end - i.start) / i.fps))
  53944. }),
  53945. (n.MorphBlendMesh.prototype.setAnimationDuration = function (e, t) {
  53946. var i = this.animationsMap[e]
  53947. i && ((i.duration = t), (i.fps = (i.end - i.start) / i.duration))
  53948. }),
  53949. (n.MorphBlendMesh.prototype.setAnimationWeight = function (e, t) {
  53950. var i = this.animationsMap[e]
  53951. i && (i.weight = t)
  53952. }),
  53953. (n.MorphBlendMesh.prototype.setAnimationTime = function (e, t) {
  53954. var i = this.animationsMap[e]
  53955. i && (i.time = t)
  53956. }),
  53957. (n.MorphBlendMesh.prototype.getAnimationTime = function (e) {
  53958. var t = 0,
  53959. i = this.animationsMap[e]
  53960. return i && (t = i.time), t
  53961. }),
  53962. (n.MorphBlendMesh.prototype.getAnimationDuration = function (e) {
  53963. var t = -1,
  53964. i = this.animationsMap[e]
  53965. return i && (t = i.duration), t
  53966. }),
  53967. (n.MorphBlendMesh.prototype.playAnimation = function (e) {
  53968. var t = this.animationsMap[e]
  53969. t ? ((t.time = 0), (t.active = !0)) : console.warn('THREE.MorphBlendMesh: animation[' + e + '] undefined in .playAnimation()')
  53970. }),
  53971. (n.MorphBlendMesh.prototype.stopAnimation = function (e) {
  53972. var t = this.animationsMap[e]
  53973. t && (t.active = !1)
  53974. }),
  53975. (n.MorphBlendMesh.prototype.update = function (e) {
  53976. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  53977. var r = this.animationsList[t]
  53978. if (r.active) {
  53979. var o = r.duration / r.length
  53980. ;(r.time += r.direction * e),
  53981. r.mirroredLoop
  53982. ? (r.time > r.duration || r.time < 0) &&
  53983. ((r.direction *= -1), r.time > r.duration && ((r.time = r.duration), (r.directionBackwards = !0)), r.time < 0 && ((r.time = 0), (r.directionBackwards = !1)))
  53984. : ((r.time = r.time % r.duration), r.time < 0 && (r.time += r.duration))
  53985. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1),
  53986. s = r.weight
  53987. a !== r.currentFrame &&
  53988. ((this.morphTargetInfluences[r.lastFrame] = 0),
  53989. (this.morphTargetInfluences[r.currentFrame] = 1 * s),
  53990. (this.morphTargetInfluences[a] = 0),
  53991. (r.lastFrame = r.currentFrame),
  53992. (r.currentFrame = a))
  53993. var l = (r.time % o) / o
  53994. r.directionBackwards && (l = 1 - l),
  53995. r.currentFrame !== r.lastFrame
  53996. ? ((this.morphTargetInfluences[r.currentFrame] = l * s), (this.morphTargetInfluences[r.lastFrame] = (1 - l) * s))
  53997. : (this.morphTargetInfluences[r.currentFrame] = s)
  53998. }
  53999. }
  54000. }),
  54001. 'undefined' != typeof i ? ('undefined' != typeof t && t.exports && (i = t.exports = n), (i.THREE = n)) : (this.THREE = n)
  54002. window.THREE = n
  54003. getObjLoader()
  54004. initByTHREE(THREE)
  54005. //getWebXRManager()
  54006. },
  54007. {}
  54008. ]
  54009. },
  54010. {},
  54011. [116]
  54012. )
  54013. /*
  54014. function getWebXRManager(){
  54015. class ArrayCamera extends THREE.PerspectiveCamera {
  54016. constructor(array = []) {
  54017. super();
  54018. this.isArrayCamera = true;
  54019. this.cameras = array;
  54020. }
  54021. }
  54022. function WebGLAnimation() {
  54023. let context = null;
  54024. let isAnimating = false;
  54025. let animationLoop = null;
  54026. let requestId = null;
  54027. function onAnimationFrame(time, frame) {
  54028. animationLoop(time, frame);
  54029. requestId = context.requestAnimationFrame(onAnimationFrame);
  54030. }
  54031. return {
  54032. start: function () {
  54033. if (isAnimating === true) return;
  54034. if (animationLoop === null) return;
  54035. requestId = context.requestAnimationFrame(onAnimationFrame);
  54036. isAnimating = true;
  54037. },
  54038. stop: function () {
  54039. context.cancelAnimationFrame(requestId);
  54040. isAnimating = false;
  54041. },
  54042. setAnimationLoop: function (callback) {
  54043. animationLoop = callback;
  54044. },
  54045. setContext: function (value) {
  54046. context = value;
  54047. }
  54048. };
  54049. }
  54050. function WebXRManager( renderer, gl ) {
  54051. var scope = this;
  54052. var session = null;
  54053. // var framebufferScaleFactor = 1.0;
  54054. var referenceSpace = null;
  54055. var referenceSpaceType = 'local-floor';
  54056. var pose = null;
  54057. var controllers = [];
  54058. var sortedInputSources = [];
  54059. function isPresenting() {
  54060. return session !== null && referenceSpace !== null;
  54061. }
  54062. //
  54063. var cameraL = new THREE.PerspectiveCamera();
  54064. cameraL.layers.enable( 1 );
  54065. cameraL.viewport = new THREE.Vector4();
  54066. var cameraR = new THREE.PerspectiveCamera();
  54067. cameraR.layers.enable( 2 );
  54068. cameraR.viewport = new THREE.Vector4();
  54069. var cameraVR = new ArrayCamera( [ cameraL, cameraR ] );
  54070. cameraVR.layers.enable( 1 );
  54071. cameraVR.layers.enable( 2 );
  54072. //
  54073. this.enabled = false;
  54074. this.getController = function ( id ) {
  54075. var controller = controllers[ id ];
  54076. if ( controller === undefined ) {
  54077. controller = new THREE.Group();
  54078. controller.matrixAutoUpdate = false;
  54079. controller.visible = false;
  54080. controllers[ id ] = controller;
  54081. }
  54082. return controller;
  54083. };
  54084. //
  54085. function onSessionEvent( event ) {
  54086. for ( var i = 0; i < controllers.length; i ++ ) {
  54087. if ( sortedInputSources[ i ] === event.inputSource ) {
  54088. controllers[ i ].dispatchEvent( { type: event.type } );
  54089. }
  54090. }
  54091. }
  54092. function onSessionEnd() {
  54093. renderer.setFramebuffer( null );
  54094. renderer.setRenderTarget( renderer.getRenderTarget() ); // Hack #15830
  54095. animation.stop();
  54096. scope.dispatchEvent( { type: 'sessionend' } );
  54097. }
  54098. function onRequestReferenceSpace( value ) {
  54099. referenceSpace = value;
  54100. animation.setContext( session );
  54101. animation.start();
  54102. scope.dispatchEvent( { type: 'sessionstart' } );
  54103. }
  54104. this.setFramebufferScaleFactor = function ( ) {
  54105. // framebufferScaleFactor = value;
  54106. };
  54107. this.setReferenceSpaceType = function ( value ) {
  54108. referenceSpaceType = value;
  54109. };
  54110. this.getSession = function () {
  54111. return session;
  54112. };
  54113. this.setSession = function ( value ) {
  54114. session = value;
  54115. if ( session !== null ) {
  54116. session.addEventListener( 'select', onSessionEvent );
  54117. session.addEventListener( 'selectstart', onSessionEvent );
  54118. session.addEventListener( 'selectend', onSessionEvent );
  54119. session.addEventListener( 'end', onSessionEnd );
  54120. // eslint-disable-next-line no-undef
  54121. session.updateRenderState( { baseLayer: new XRWebGLLayer( session, gl, { antialias: false } ) } );
  54122. session.requestReferenceSpace( referenceSpaceType ).then( onRequestReferenceSpace );
  54123. //
  54124. session.addEventListener( 'inputsourceschange', updateInputSources );
  54125. updateInputSources();
  54126. }
  54127. };
  54128. function updateInputSources() {
  54129. for ( var i = 0; i < controllers.length; i ++ ) {
  54130. sortedInputSources[ i ] = findInputSource( i );
  54131. }
  54132. }
  54133. function findInputSource( id ) {
  54134. var inputSources = session.inputSources;
  54135. for ( var i = 0; i < inputSources.length; i ++ ) {
  54136. var inputSource = inputSources[ i ];
  54137. var handedness = inputSource.handedness;
  54138. if ( id === 0 && ( handedness === 'none' || handedness === 'right' ) ) return inputSource;
  54139. if ( id === 1 && ( handedness === 'left' ) ) return inputSource;
  54140. }
  54141. }
  54142. //
  54143. function updateCamera( camera, parent ) {
  54144. if ( parent === null ) {
  54145. camera.matrixWorld.copy( camera.matrix );
  54146. } else {
  54147. camera.matrixWorld.multiplyMatrices( parent.matrixWorld, camera.matrix );
  54148. }
  54149. camera.matrixWorldInverse.getInverse( camera.matrixWorld );
  54150. }
  54151. this.getCamera = function ( camera ) {
  54152. if ( isPresenting() ) {
  54153. var parent = camera.parent;
  54154. var cameras = cameraVR.cameras;
  54155. updateCamera( cameraVR, parent );
  54156. for ( var i = 0; i < cameras.length; i ++ ) {
  54157. updateCamera( cameras[ i ], parent );
  54158. }
  54159. // update camera and its children
  54160. camera.matrixWorld.copy( cameraVR.matrixWorld );
  54161. var children = camera.children;
  54162. for ( var i = 0, l = children.length; i < l; i ++ ) {
  54163. children[ i ].updateMatrixWorld( true );
  54164. }
  54165. setProjectionFromUnion( cameraVR, cameraL, cameraR );
  54166. return cameraVR;
  54167. }
  54168. return camera;
  54169. };
  54170. this.isPresenting = isPresenting;
  54171. // Animation Loop
  54172. var onAnimationFrameCallback = null;
  54173. function onAnimationFrame( time, frame ) {
  54174. pose = frame.getViewerPose( referenceSpace );
  54175. if ( pose !== null ) {
  54176. var views = pose.views;
  54177. var baseLayer = session.renderState.baseLayer;
  54178. renderer.setFramebuffer( baseLayer.framebuffer );
  54179. for ( var i = 0; i < views.length; i ++ ) {
  54180. var view = views[ i ];
  54181. var viewport = baseLayer.getViewport( view );
  54182. var viewMatrix = view.transform.inverse.matrix;
  54183. var camera = cameraVR.cameras[ i ];
  54184. camera.matrix.fromArray( viewMatrix ).getInverse( camera.matrix );
  54185. camera.projectionMatrix.fromArray( view.projectionMatrix );
  54186. camera.viewport.set( viewport.x, viewport.y, viewport.width, viewport.height );
  54187. if ( i === 0 ) {
  54188. cameraVR.matrix.copy( camera.matrix );
  54189. }
  54190. }
  54191. }
  54192. //
  54193. for ( var i = 0; i < controllers.length; i ++ ) {
  54194. var controller = controllers[ i ];
  54195. var inputSource = sortedInputSources[ i ];
  54196. if ( inputSource ) {
  54197. var inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
  54198. if ( inputPose !== null ) {
  54199. controller.matrix.fromArray( inputPose.transform.matrix );
  54200. controller.matrix.decompose( controller.position, controller.rotation, controller.scale );
  54201. controller.visible = true;
  54202. continue;
  54203. }
  54204. }
  54205. controller.visible = false;
  54206. }
  54207. if ( onAnimationFrameCallback ) onAnimationFrameCallback( time );
  54208. }
  54209. var animation = new WebGLAnimation();
  54210. animation.setAnimationLoop( onAnimationFrame );
  54211. this.setAnimationLoop = function ( callback ) {
  54212. onAnimationFrameCallback = callback;
  54213. };
  54214. this.dispose = function () {};
  54215. // DEPRECATED
  54216. this.getStandingMatrix = function () {
  54217. console.warn( 'THREE.WebXRManager: getStandingMatrix() is no longer needed.' );
  54218. return new THREE.Matrix4();
  54219. };
  54220. this.getDevice = function () {
  54221. console.warn( 'THREE.WebXRManager: getDevice() has been deprecated.' );
  54222. };
  54223. this.setDevice = function () {
  54224. console.warn( 'THREE.WebXRManager: setDevice() has been deprecated.' );
  54225. };
  54226. this.setFrameOfReferenceType = function () {
  54227. console.warn( 'THREE.WebXRManager: setFrameOfReferenceType() has been deprecated.' );
  54228. };
  54229. this.submitFrame = function () {};
  54230. }
  54231. Object.assign( WebXRManager.prototype, THREE.EventDispatcher.prototype );
  54232. THREE.WebXRManager = WebXRManager
  54233. }
  54234. function getWebXRManager(){
  54235. class ArrayCamera extends THREE.PerspectiveCamera {
  54236. constructor(array = []) {
  54237. super();
  54238. this.isArrayCamera = true;
  54239. this.cameras = array;
  54240. }
  54241. }
  54242. class WebXRController {
  54243. constructor() {
  54244. this._targetRay = null;
  54245. this._grip = null;
  54246. this._hand = null;
  54247. }
  54248. getHandSpace() {
  54249. if (this._hand === null) {
  54250. this._hand = new THREE.Group();
  54251. this._hand.matrixAutoUpdate = false;
  54252. this._hand.visible = false;
  54253. this._hand.joints = {};
  54254. this._hand.inputState = {
  54255. pinching: false
  54256. };
  54257. }
  54258. return this._hand;
  54259. }
  54260. getTargetRaySpace() {
  54261. if (this._targetRay === null) {
  54262. this._targetRay = new THREE.Group();
  54263. this._targetRay.matrixAutoUpdate = false;
  54264. this._targetRay.visible = false;
  54265. this._targetRay.hasLinearVelocity = false;
  54266. this._targetRay.linearVelocity = new THREE.Vector3();
  54267. this._targetRay.hasAngularVelocity = false;
  54268. this._targetRay.angularVelocity = new THREE.Vector3();
  54269. }
  54270. return this._targetRay;
  54271. }
  54272. getGripSpace() {
  54273. if (this._grip === null) {
  54274. this._grip = new THREE.Group();
  54275. this._grip.matrixAutoUpdate = false;
  54276. this._grip.visible = false;
  54277. this._grip.hasLinearVelocity = false;
  54278. this._grip.linearVelocity = new THREE.Vector3();
  54279. this._grip.hasAngularVelocity = false;
  54280. this._grip.angularVelocity = new THREE.Vector3();
  54281. }
  54282. return this._grip;
  54283. }
  54284. dispatchEvent(event) {
  54285. if (this._targetRay !== null) {
  54286. this._targetRay.dispatchEvent(event);
  54287. }
  54288. if (this._grip !== null) {
  54289. this._grip.dispatchEvent(event);
  54290. }
  54291. if (this._hand !== null) {
  54292. this._hand.dispatchEvent(event);
  54293. }
  54294. return this;
  54295. }
  54296. disconnect(inputSource) {
  54297. this.dispatchEvent({
  54298. type: 'disconnected',
  54299. data: inputSource
  54300. });
  54301. if (this._targetRay !== null) {
  54302. this._targetRay.visible = false;
  54303. }
  54304. if (this._grip !== null) {
  54305. this._grip.visible = false;
  54306. }
  54307. if (this._hand !== null) {
  54308. this._hand.visible = false;
  54309. }
  54310. return this;
  54311. }
  54312. update(inputSource, frame, referenceSpace) {
  54313. let inputPose = null;
  54314. let gripPose = null;
  54315. let handPose = null;
  54316. const targetRay = this._targetRay;
  54317. const grip = this._grip;
  54318. const hand = this._hand;
  54319. if (inputSource && frame.session.visibilityState !== 'visible-blurred') {
  54320. if (hand && inputSource.hand) {
  54321. handPose = true;
  54322. for (const inputjoint of inputSource.hand.values()) {
  54323. // Update the joints groups with the XRJoint poses
  54324. const jointPose = frame.getJointPose(inputjoint, referenceSpace);
  54325. if (hand.joints[inputjoint.jointName] === undefined) {
  54326. // The transform of this joint will be updated with the joint pose on each frame
  54327. const joint = new THREE.Group();
  54328. joint.matrixAutoUpdate = false;
  54329. joint.visible = false;
  54330. hand.joints[inputjoint.jointName] = joint; // ??
  54331. hand.add(joint);
  54332. }
  54333. const joint = hand.joints[inputjoint.jointName];
  54334. if (jointPose !== null) {
  54335. joint.matrix.fromArray(jointPose.transform.matrix);
  54336. joint.matrix.decompose(joint.position, joint.rotation, joint.scale);
  54337. joint.jointRadius = jointPose.radius;
  54338. }
  54339. joint.visible = jointPose !== null;
  54340. } // Custom events
  54341. // Check pinchz
  54342. const indexTip = hand.joints['index-finger-tip'];
  54343. const thumbTip = hand.joints['thumb-tip'];
  54344. const distance = indexTip.position.distanceTo(thumbTip.position);
  54345. const distanceToPinch = 0.02;
  54346. const threshold = 0.005;
  54347. if (hand.inputState.pinching && distance > distanceToPinch + threshold) {
  54348. hand.inputState.pinching = false;
  54349. this.dispatchEvent({
  54350. type: 'pinchend',
  54351. handedness: inputSource.handedness,
  54352. target: this
  54353. });
  54354. } else if (!hand.inputState.pinching && distance <= distanceToPinch - threshold) {
  54355. hand.inputState.pinching = true;
  54356. this.dispatchEvent({
  54357. type: 'pinchstart',
  54358. handedness: inputSource.handedness,
  54359. target: this
  54360. });
  54361. }
  54362. } else {
  54363. if (grip !== null && inputSource.gripSpace) {
  54364. gripPose = frame.getPose(inputSource.gripSpace, referenceSpace);
  54365. if (gripPose !== null) {
  54366. grip.matrix.fromArray(gripPose.transform.matrix);
  54367. grip.matrix.decompose(grip.position, grip.rotation, grip.scale);
  54368. if (gripPose.linearVelocity) {
  54369. grip.hasLinearVelocity = true;
  54370. grip.linearVelocity.copy(gripPose.linearVelocity);
  54371. } else {
  54372. grip.hasLinearVelocity = false;
  54373. }
  54374. if (gripPose.angularVelocity) {
  54375. grip.hasAngularVelocity = true;
  54376. grip.angularVelocity.copy(gripPose.angularVelocity);
  54377. } else {
  54378. grip.hasAngularVelocity = false;
  54379. }
  54380. }
  54381. }
  54382. }
  54383. if (targetRay !== null) {
  54384. 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
  54385. if (inputPose === null && gripPose !== null) {
  54386. inputPose = gripPose;
  54387. }
  54388. if (inputPose !== null) {
  54389. targetRay.matrix.fromArray(inputPose.transform.matrix);
  54390. targetRay.matrix.decompose(targetRay.position, targetRay.rotation, targetRay.scale);
  54391. if (inputPose.linearVelocity) {
  54392. targetRay.hasLinearVelocity = true;
  54393. targetRay.linearVelocity.copy(inputPose.linearVelocity);
  54394. } else {
  54395. targetRay.hasLinearVelocity = false;
  54396. }
  54397. if (inputPose.angularVelocity) {
  54398. targetRay.hasAngularVelocity = true;
  54399. targetRay.angularVelocity.copy(inputPose.angularVelocity);
  54400. } else {
  54401. targetRay.hasAngularVelocity = false;
  54402. }
  54403. this.dispatchEvent(_moveEvent);
  54404. }
  54405. }
  54406. }
  54407. if (targetRay !== null) {
  54408. targetRay.visible = inputPose !== null;
  54409. }
  54410. if (grip !== null) {
  54411. grip.visible = gripPose !== null;
  54412. }
  54413. if (hand !== null) {
  54414. hand.visible = handPose !== null;
  54415. }
  54416. return this;
  54417. }
  54418. }
  54419. function WebGLAnimation() {
  54420. let context = null;
  54421. let isAnimating = false;
  54422. let animationLoop = null;
  54423. let requestId = null;
  54424. function onAnimationFrame(time, frame) {
  54425. animationLoop(time, frame);
  54426. requestId = context.requestAnimationFrame(onAnimationFrame);
  54427. }
  54428. return {
  54429. start: function () {
  54430. if (isAnimating === true) return;
  54431. if (animationLoop === null) return;
  54432. requestId = context.requestAnimationFrame(onAnimationFrame);
  54433. isAnimating = true;
  54434. },
  54435. stop: function () {
  54436. context.cancelAnimationFrame(requestId);
  54437. isAnimating = false;
  54438. },
  54439. setAnimationLoop: function (callback) {
  54440. animationLoop = callback;
  54441. },
  54442. setContext: function (value) {
  54443. context = value;
  54444. }
  54445. };
  54446. }
  54447. class WebXRManager extends THREE.EventDispatcher {
  54448. constructor(renderer, gl) {
  54449. super();
  54450. const scope = this;
  54451. let session = null;
  54452. let framebufferScaleFactor = 1.0;
  54453. let referenceSpace = null;
  54454. let referenceSpaceType = 'local-floor';
  54455. let customReferenceSpace = null;
  54456. let pose = null;
  54457. let glBinding = null;
  54458. let glProjLayer = null;
  54459. let glBaseLayer = null;
  54460. let xrFrame = null;
  54461. const attributes = gl.getContextAttributes();
  54462. let initialRenderTarget = null;
  54463. let newRenderTarget = null;
  54464. const controllers = [];
  54465. const controllerInputSources = []; //
  54466. const cameraL = new THREE.PerspectiveCamera();
  54467. cameraL.layers.enable(1);
  54468. cameraL.viewport = new THREE.Vector4();
  54469. const cameraR = new THREE.PerspectiveCamera();
  54470. cameraR.layers.enable(2);
  54471. cameraR.viewport = new THREE.Vector4();
  54472. const cameras = [cameraL, cameraR];
  54473. const cameraVR = new ArrayCamera();
  54474. cameraVR.layers.enable(1);
  54475. cameraVR.layers.enable(2);
  54476. let _currentDepthNear = null;
  54477. let _currentDepthFar = null; //
  54478. this.cameraAutoUpdate = true;
  54479. this.enabled = false;
  54480. this.isPresenting = false;
  54481. this.getController = function (index) {
  54482. let controller = controllers[index];
  54483. if (controller === undefined) {
  54484. controller = new WebXRController();
  54485. controllers[index] = controller;
  54486. }
  54487. return controller.getTargetRaySpace();
  54488. };
  54489. this.getControllerGrip = function (index) {
  54490. let controller = controllers[index];
  54491. if (controller === undefined) {
  54492. controller = new WebXRController();
  54493. controllers[index] = controller;
  54494. }
  54495. return controller.getGripSpace();
  54496. };
  54497. this.getHand = function (index) {
  54498. let controller = controllers[index];
  54499. if (controller === undefined) {
  54500. controller = new WebXRController();
  54501. controllers[index] = controller;
  54502. }
  54503. return controller.getHandSpace();
  54504. }; //
  54505. function onSessionEvent(event) {
  54506. const controllerIndex = controllerInputSources.indexOf(event.inputSource);
  54507. if (controllerIndex === -1) {
  54508. return;
  54509. }
  54510. const controller = controllers[controllerIndex];
  54511. if (controller !== undefined) {
  54512. controller.dispatchEvent({
  54513. type: event.type,
  54514. data: event.inputSource
  54515. });
  54516. }
  54517. }
  54518. function onSessionEnd() {
  54519. session.removeEventListener('select', onSessionEvent);
  54520. session.removeEventListener('selectstart', onSessionEvent);
  54521. session.removeEventListener('selectend', onSessionEvent);
  54522. session.removeEventListener('squeeze', onSessionEvent);
  54523. session.removeEventListener('squeezestart', onSessionEvent);
  54524. session.removeEventListener('squeezeend', onSessionEvent);
  54525. session.removeEventListener('end', onSessionEnd);
  54526. session.removeEventListener('inputsourceschange', onInputSourcesChange);
  54527. for (let i = 0; i < controllers.length; i++) {
  54528. const inputSource = controllerInputSources[i];
  54529. if (inputSource === null) continue;
  54530. controllerInputSources[i] = null;
  54531. controllers[i].disconnect(inputSource);
  54532. }
  54533. _currentDepthNear = null;
  54534. _currentDepthFar = null; // restore framebuffer/rendering state
  54535. renderer.setRenderTarget(initialRenderTarget);
  54536. glBaseLayer = null;
  54537. glProjLayer = null;
  54538. glBinding = null;
  54539. session = null;
  54540. newRenderTarget = null; //
  54541. animation.stop();
  54542. scope.isPresenting = false;
  54543. scope.dispatchEvent({
  54544. type: 'sessionend'
  54545. });
  54546. }
  54547. this.setFramebufferScaleFactor = function (value) {
  54548. framebufferScaleFactor = value;
  54549. if (scope.isPresenting === true) {
  54550. console.warn('THREE.WebXRManager: Cannot change framebuffer scale while presenting.');
  54551. }
  54552. };
  54553. this.setReferenceSpaceType = function (value) {
  54554. referenceSpaceType = value;
  54555. if (scope.isPresenting === true) {
  54556. console.warn('THREE.WebXRManager: Cannot change reference space type while presenting.');
  54557. }
  54558. };
  54559. this.getReferenceSpace = function () {
  54560. return customReferenceSpace || referenceSpace;
  54561. };
  54562. this.setReferenceSpace = function (space) {
  54563. customReferenceSpace = space;
  54564. };
  54565. this.getBaseLayer = function () {
  54566. return glProjLayer !== null ? glProjLayer : glBaseLayer;
  54567. };
  54568. this.getBinding = function () {
  54569. return glBinding;
  54570. };
  54571. this.getFrame = function () {
  54572. return xrFrame;
  54573. };
  54574. this.getSession = function () {
  54575. return session;
  54576. };
  54577. this.setSession = async function (value) {
  54578. session = value;
  54579. if (session !== null) {
  54580. initialRenderTarget = renderer.getCurrentRenderTarget();
  54581. session.addEventListener('select', onSessionEvent);
  54582. session.addEventListener('selectstart', onSessionEvent);
  54583. session.addEventListener('selectend', onSessionEvent);
  54584. session.addEventListener('squeeze', onSessionEvent);
  54585. session.addEventListener('squeezestart', onSessionEvent);
  54586. session.addEventListener('squeezeend', onSessionEvent);
  54587. session.addEventListener('end', onSessionEnd);
  54588. session.addEventListener('inputsourceschange', onInputSourcesChange);
  54589. if (attributes.xrCompatible !== true) {
  54590. await gl.makeXRCompatible();
  54591. }
  54592. if (session.renderState.layers === undefined || renderer.capabilities.isWebGL2 === false) {
  54593. const layerInit = {
  54594. antialias: session.renderState.layers === undefined ? attributes.antialias : true,
  54595. alpha: attributes.alpha,
  54596. depth: attributes.depth,
  54597. stencil: attributes.stencil,
  54598. framebufferScaleFactor: framebufferScaleFactor
  54599. };
  54600. glBaseLayer = new XRWebGLLayer(session, gl, layerInit);
  54601. session.updateRenderState({
  54602. baseLayer: glBaseLayer
  54603. });
  54604. newRenderTarget = new THREE.WebGLRenderTarget(glBaseLayer.framebufferWidth, glBaseLayer.framebufferHeight, {
  54605. format: THREE.RGBAFormat,
  54606. type: THREE.UnsignedByteType,
  54607. encoding: renderer.outputEncoding
  54608. });
  54609. } else {
  54610. let depthFormat = null;
  54611. let depthType = null;
  54612. let glDepthFormat = null;
  54613. if (attributes.depth) {
  54614. glDepthFormat = attributes.stencil ? gl.DEPTH24_STENCIL8 : gl.DEPTH_COMPONENT24;
  54615. depthFormat = attributes.stencil ? DepthStencilFormat : DepthFormat;
  54616. depthType = attributes.stencil ? UnsignedInt248Type : UnsignedIntType;
  54617. }
  54618. const projectionlayerInit = {
  54619. colorFormat: gl.RGBA8,
  54620. depthFormat: glDepthFormat,
  54621. scaleFactor: framebufferScaleFactor
  54622. };
  54623. glBinding = new XRWebGLBinding(session, gl);
  54624. glProjLayer = glBinding.createProjectionLayer(projectionlayerInit);
  54625. session.updateRenderState({
  54626. layers: [glProjLayer]
  54627. });
  54628. newRenderTarget = new THREE.WebGLRenderTarget(glProjLayer.textureWidth, glProjLayer.textureHeight, {
  54629. format: THREE.RGBAFormat,
  54630. type: THREE.UnsignedByteType,
  54631. depthTexture: new THREE.DepthTexture(glProjLayer.textureWidth, glProjLayer.textureHeight, depthType, undefined, undefined, undefined, undefined, undefined, undefined, depthFormat),
  54632. stencilBuffer: attributes.stencil,
  54633. encoding: renderer.outputEncoding,
  54634. samples: attributes.antialias ? 4 : 0
  54635. });
  54636. const renderTargetProperties = renderer.properties.get(newRenderTarget);
  54637. renderTargetProperties.__ignoreDepthValues = glProjLayer.ignoreDepthValues;
  54638. }
  54639. newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
  54640. // Set foveation to maximum.
  54641. this.setFoveation(1.0);
  54642. customReferenceSpace = null;
  54643. referenceSpace = await session.requestReferenceSpace(referenceSpaceType);
  54644. animation.setContext(session);
  54645. animation.start();
  54646. scope.isPresenting = true;
  54647. scope.dispatchEvent({
  54648. type: 'sessionstart'
  54649. });
  54650. }
  54651. };
  54652. function onInputSourcesChange(event) {
  54653. // Notify disconnected
  54654. for (let i = 0; i < event.removed.length; i++) {
  54655. const inputSource = event.removed[i];
  54656. const index = controllerInputSources.indexOf(inputSource);
  54657. if (index >= 0) {
  54658. controllerInputSources[index] = null;
  54659. controllers[index].dispatchEvent({
  54660. type: 'disconnected',
  54661. data: inputSource
  54662. });
  54663. }
  54664. } // Notify connected
  54665. for (let i = 0; i < event.added.length; i++) {
  54666. const inputSource = event.added[i];
  54667. let controllerIndex = controllerInputSources.indexOf(inputSource);
  54668. if (controllerIndex === -1) {
  54669. // Assign input source a controller that currently has no input source
  54670. for (let i = 0; i < controllers.length; i++) {
  54671. if (i >= controllerInputSources.length) {
  54672. controllerInputSources.push(inputSource);
  54673. controllerIndex = i;
  54674. break;
  54675. } else if (controllerInputSources[i] === null) {
  54676. controllerInputSources[i] = inputSource;
  54677. controllerIndex = i;
  54678. break;
  54679. }
  54680. } // If all controllers do currently receive input we ignore new ones
  54681. if (controllerIndex === -1) break;
  54682. }
  54683. const controller = controllers[controllerIndex];
  54684. if (controller) {
  54685. controller.dispatchEvent({
  54686. type: 'connected',
  54687. data: inputSource
  54688. });
  54689. }
  54690. }
  54691. } //
  54692. const cameraLPos = new THREE.Vector3();
  54693. const cameraRPos = new THREE.Vector3();
  54694. function setProjectionFromUnion(camera, cameraL, cameraR) {
  54695. cameraLPos.setFromMatrixPosition(cameraL.matrixWorld);
  54696. cameraRPos.setFromMatrixPosition(cameraR.matrixWorld);
  54697. const ipd = cameraLPos.distanceTo(cameraRPos);
  54698. const projL = cameraL.projectionMatrix.elements;
  54699. const projR = cameraR.projectionMatrix.elements; // VR systems will have identical far and near planes, and
  54700. // most likely identical top and bottom frustum extents.
  54701. // Use the left camera for these values.
  54702. const near = projL[14] / (projL[10] - 1);
  54703. const far = projL[14] / (projL[10] + 1);
  54704. const topFov = (projL[9] + 1) / projL[5];
  54705. const bottomFov = (projL[9] - 1) / projL[5];
  54706. const leftFov = (projL[8] - 1) / projL[0];
  54707. const rightFov = (projR[8] + 1) / projR[0];
  54708. const left = near * leftFov;
  54709. const right = near * rightFov; // Calculate the new camera's position offset from the
  54710. // left camera. xOffset should be roughly half `ipd`.
  54711. const zOffset = ipd / (-leftFov + rightFov);
  54712. const xOffset = zOffset * -leftFov; // TODO: Better way to apply this offset?
  54713. cameraL.matrixWorld.decompose(camera.position, camera.quaternion, camera.scale);
  54714. camera.translateX(xOffset);
  54715. camera.translateZ(zOffset);
  54716. camera.matrixWorld.compose(camera.position, camera.quaternion, camera.scale);
  54717. camera.matrixWorldInverse.copy(camera.matrixWorld).invert(); // Find the union of the frustum values of the cameras and scale
  54718. // the values so that the near plane's position does not change in world space,
  54719. // although must now be relative to the new union camera.
  54720. const near2 = near + zOffset;
  54721. const far2 = far + zOffset;
  54722. const left2 = left - xOffset;
  54723. const right2 = right + (ipd - xOffset);
  54724. const top2 = topFov * far / far2 * near2;
  54725. const bottom2 = bottomFov * far / far2 * near2;
  54726. camera.projectionMatrix.makePerspective(left2, right2, top2, bottom2, near2, far2);
  54727. }
  54728. function updateCamera(camera, parent) {
  54729. if (parent === null) {
  54730. camera.matrixWorld.copy(camera.matrix);
  54731. } else {
  54732. camera.matrixWorld.multiplyMatrices(parent.matrixWorld, camera.matrix);
  54733. }
  54734. camera.matrixWorldInverse.copy(camera.matrixWorld).invert();
  54735. }
  54736. this.updateCamera = function (camera) {
  54737. if (session === null) return;
  54738. cameraVR.near = cameraR.near = cameraL.near = camera.near;
  54739. cameraVR.far = cameraR.far = cameraL.far = camera.far;
  54740. if (_currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far) {
  54741. // Note that the new renderState won't apply until the next frame. See #18320
  54742. session.updateRenderState({
  54743. depthNear: cameraVR.near,
  54744. depthFar: cameraVR.far
  54745. });
  54746. _currentDepthNear = cameraVR.near;
  54747. _currentDepthFar = cameraVR.far;
  54748. }
  54749. const parent = camera.parent;
  54750. const cameras = cameraVR.cameras;
  54751. updateCamera(cameraVR, parent);
  54752. for (let i = 0; i < cameras.length; i++) {
  54753. updateCamera(cameras[i], parent);
  54754. }
  54755. cameraVR.matrixWorld.decompose(cameraVR.position, cameraVR.quaternion, cameraVR.scale); // update user camera and its children
  54756. camera.position.copy(cameraVR.position);
  54757. camera.quaternion.copy(cameraVR.quaternion);
  54758. camera.scale.copy(cameraVR.scale);
  54759. camera.matrix.copy(cameraVR.matrix);
  54760. camera.matrixWorld.copy(cameraVR.matrixWorld);
  54761. const children = camera.children;
  54762. for (let i = 0, l = children.length; i < l; i++) {
  54763. children[i].updateMatrixWorld(true);
  54764. } // update projection matrix for proper view frustum culling
  54765. if (cameras.length === 2) {
  54766. setProjectionFromUnion(cameraVR, cameraL, cameraR);
  54767. } else {
  54768. // assume single camera setup (AR)
  54769. cameraVR.projectionMatrix.copy(cameraL.projectionMatrix);
  54770. }
  54771. };
  54772. this.getCamera = function () {
  54773. return cameraVR;
  54774. };
  54775. this.getFoveation = function () {
  54776. if (glProjLayer !== null) {
  54777. return glProjLayer.fixedFoveation;
  54778. }
  54779. if (glBaseLayer !== null) {
  54780. return glBaseLayer.fixedFoveation;
  54781. }
  54782. return undefined;
  54783. };
  54784. this.setFoveation = function (foveation) {
  54785. // 0 = no foveation = full resolution
  54786. // 1 = maximum foveation = the edges render at lower resolution
  54787. if (glProjLayer !== null) {
  54788. glProjLayer.fixedFoveation = foveation;
  54789. }
  54790. if (glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined) {
  54791. glBaseLayer.fixedFoveation = foveation;
  54792. }
  54793. }; // Animation Loop
  54794. let onAnimationFrameCallback = null;
  54795. function onAnimationFrame(time, frame) {
  54796. pose = frame.getViewerPose(customReferenceSpace || referenceSpace);
  54797. xrFrame = frame;
  54798. if (pose !== null) {
  54799. const views = pose.views;
  54800. if (glBaseLayer !== null) {
  54801. renderer.setRenderTargetFramebuffer(newRenderTarget, glBaseLayer.framebuffer);
  54802. renderer.setRenderTarget(newRenderTarget);
  54803. }
  54804. let cameraVRNeedsUpdate = false; // check if it's necessary to rebuild cameraVR's camera list
  54805. if (views.length !== cameraVR.cameras.length) {
  54806. cameraVR.cameras.length = 0;
  54807. cameraVRNeedsUpdate = true;
  54808. }
  54809. for (let i = 0; i < views.length; i++) {
  54810. const view = views[i];
  54811. let viewport = null;
  54812. if (glBaseLayer !== null) {
  54813. viewport = glBaseLayer.getViewport(view);
  54814. } else {
  54815. const glSubImage = glBinding.getViewSubImage(glProjLayer, view);
  54816. viewport = glSubImage.viewport; // For side-by-side projection, we only produce a single texture for both eyes.
  54817. if (i === 0) {
  54818. renderer.setRenderTargetTextures(newRenderTarget, glSubImage.colorTexture, glProjLayer.ignoreDepthValues ? undefined : glSubImage.depthStencilTexture);
  54819. renderer.setRenderTarget(newRenderTarget);
  54820. }
  54821. }
  54822. let camera = cameras[i];
  54823. if (camera === undefined) {
  54824. camera = new THREE.PerspectiveCamera();
  54825. camera.layers.enable(i);
  54826. camera.viewport = new THREE.Vector4();
  54827. cameras[i] = camera;
  54828. }
  54829. camera.matrix.fromArray(view.transform.matrix);
  54830. camera.projectionMatrix.fromArray(view.projectionMatrix);
  54831. camera.viewport.set(viewport.x, viewport.y, viewport.width, viewport.height);
  54832. if (i === 0) {
  54833. cameraVR.matrix.copy(camera.matrix);
  54834. }
  54835. if (cameraVRNeedsUpdate === true) {
  54836. cameraVR.cameras.push(camera);
  54837. }
  54838. }
  54839. } //
  54840. for (let i = 0; i < controllers.length; i++) {
  54841. const inputSource = controllerInputSources[i];
  54842. const controller = controllers[i];
  54843. if (inputSource !== null && controller !== undefined) {
  54844. controller.update(inputSource, frame, customReferenceSpace || referenceSpace);
  54845. }
  54846. }
  54847. if (onAnimationFrameCallback) onAnimationFrameCallback(time, frame);
  54848. xrFrame = null;
  54849. }
  54850. const animation = new WebGLAnimation();
  54851. animation.setAnimationLoop(onAnimationFrame);
  54852. this.setAnimationLoop = function (callback) {
  54853. onAnimationFrameCallback = callback;
  54854. };
  54855. this.dispose = function () {};
  54856. }
  54857. }
  54858. THREE.WebXRManager = WebXRManager
  54859. } */
  54860. /*
  54861. var addMagnifier = function(){
  54862. class Magnifier extends THREE.Object3D {
  54863. constructor () {
  54864. super()
  54865. let circleGeo = new THREE.CircleGeometry(0.1, 100);
  54866. this.camera = new THREE.PerspectiveCamera(50, 1, 0.1, 1); //fov aspect near far
  54867. this.renderTarget = new THREE.WebGLRenderTarget(256,256, {
  54868. minFilter: THREE.LinearFilter, magFilter: THREE.LinearFilter,
  54869. format: THREE.RGBAFormat ,
  54870. //type: THREE.FloatType,
  54871. //minFilter: THREE.NearestFilter,
  54872. //magFilter: THREE.NearestFilter,
  54873. } )
  54874. this.mesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  54875. side: THREE.DoubleSide ,
  54876. map: this.renderTarget.texture ,
  54877. transparent:true,
  54878. depthTest: !1,
  54879. depthWrite: !1,
  54880. }))
  54881. this.overlayMesh = new THREE.Mesh(circleGeo, new THREE.MeshBasicMaterial({
  54882. side: THREE.DoubleSide ,
  54883. map: Texture.load('images/crosshair.png') ,
  54884. transparent:true,
  54885. depthTest: !1,
  54886. depthWrite: !1,
  54887. }))
  54888. this.add(this.mesh)
  54889. this.add(this.overlayMesh)
  54890. player.model.add(this);
  54891. player.magnifier = this;
  54892. }
  54893. update(aimPos){
  54894. const magDistance_ = 0.3;
  54895. var playerPos = player.position
  54896. var vec = playerPos.clone().sub(aimPos).normalize().multiplyScalar(magDistance_)
  54897. this.camera.position.copy(aimPos.clone().add(vec))
  54898. this.camera.lookAt(aimPos)
  54899. var playerCamera = player.camera
  54900. this.quaternion.copy(playerCamera.quaternion);
  54901. var pos2d = player.mouse.clone();
  54902. var shift = 400;
  54903. var clientHeight = player.domElement.clientHeight
  54904. var clientY = - (pos2d.y - 1) * clientHeight / 2;
  54905. pos2d.y = clientY < 300 ? pos2d.y - shift/clientHeight : pos2d.y + shift/clientHeight
  54906. let newPos = new THREE.Vector3(pos2d.x,pos2d.y,0.7).unproject(playerCamera);
  54907. this.position.copy(newPos)
  54908. var renderer = player.sceneRenderer.renderer
  54909. var oldAutoClear = renderer.autoClear
  54910. renderer.autoClear = false
  54911. //renderer.clear( true, true, true );
  54912. renderer.render(player.sceneRenderer.scene, this.camera, this.renderTarget, true)
  54913. renderer.autoClear = oldAutoClear
  54914. }
  54915. }
  54916. new Magnifier()
  54917. }
  54918. */
  54919. /*
  54920. 笔记:
  54921. 导览缩放的几处: 1 搜索smoothZoomFovTo 2 flightStepWalk里
  54922. {
  54923. //到导览中某个点位(假设点位不重复)
  54924. var id = 73
  54925. var p = player.model.heroLocations.find(e=>e.heroLocations && e.heroLocations.find(e=>e.panoId == id))
  54926. var i = player.model.heroLocations.indexOf(p)
  54927. var p1 = p.heroLocations.find(e=>e.panoId == id)
  54928. var j = p.heroLocations.indexOf(p1)
  54929. player.director.goToHighlight([i,j])
  54930. }
  54931. 展示版导览改为就近导览,所以一开始并非第一个。如果在最后一个点上会自动从头开始
  54932. 关于pc-nav 4k
  54933. 两种选择,1 按照正常流程,因为nav为4k所以直接使用4k的tiledPanoRenderTarget, 但useUltraHighResolutionPanos需要开启才能达到4k,否则是2k。这样的话第一个点位需要手动重新替换tiledPanoRenderTarget,所以废弃
  54934. 2 使zoomed一直为true,直接使用zoomRenderTarget。 参考之前写过的三屏的本地4k。 且创建的tiledPanoRenderTarget不能超过2048否则过渡卡顿;且直到到达该点后才能下载4k,否则不会渲染到zoomRenderTarget上
  54935. 如果body使用transform旋转90度,需要改的地方:
  54936. convertScreenPositionToNDC: function(e, t, i) {//rotate 90 body: transform: rotate(90deg);
  54937. return i = i || new n.Vector2,
  54938. i.y = e / $("#player").height() * 2 - 1, //注意,当body旋转90度后,虽然clientX和clinetY是按照正常垂直视角,但player的长宽和原先一样,不会因为倒转而交换
  54939. i.x = t / $("#player").width() * 2 - 1,
  54940. i
  54941. },
  54942. outsideControl的 n.prototype.onTouchMove = function(e) {中的
  54943. this.pan(this.panDelta.x, this.panDelta.y) 改为 this.pan(this.panDelta.y, -this.panDelta.x), //rotate 90
  54944. 还有
  54945. this.rotateLeft(2 * Math.PI * this.rotateDelta.y / $("#player").width() * this.rotateSpeed), //rotate 90
  54946. this.rotateUp(2 * Math.PI * -this.rotateDelta.x / $("#player").height() * this.rotateSpeed),
  54947. ===================
  54948. 一些事件
  54949. player.model.on("floor.changed",(currentFloor, mode, oldFloor)=>{//楼层变化
  54950. player.on("pano.chosen", 旧的pano, 新的pano) //点位变化前
  54951. player.on("flying.ended", 新位置, 旧位置, 新的pano, 旧的pano) //点位变化后
  54952. 一些后缀
  54953. &panoLabel 加pano标签
  54954. */