main_2018.js 2.4 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620266212662226623266242662526626266272662826629266302663126632266332663426635266362663726638266392664026641266422664326644266452664626647266482664926650266512665226653266542665526656266572665826659266602666126662266632666426665266662666726668266692667026671266722667326674266752667626677266782667926680266812668226683266842668526686266872668826689266902669126692266932669426695266962669726698266992670026701267022670326704267052670626707267082670926710267112671226713267142671526716267172671826719267202672126722267232672426725267262672726728267292673026731267322673326734267352673626737267382673926740267412674226743267442674526746267472674826749267502675126752267532675426755267562675726758267592676026761267622676326764267652676626767267682676926770267712677226773267742677526776267772677826779267802678126782267832678426785267862678726788267892679026791267922679326794267952679626797267982679926800268012680226803268042680526806268072680826809268102681126812268132681426815268162681726818268192682026821268222682326824268252682626827268282682926830268312683226833268342683526836268372683826839268402684126842268432684426845268462684726848268492685026851268522685326854268552685626857268582685926860268612686226863268642686526866268672686826869268702687126872268732687426875268762687726878268792688026881268822688326884268852688626887268882688926890268912689226893268942689526896268972689826899269002690126902269032690426905269062690726908269092691026911269122691326914269152691626917269182691926920269212692226923269242692526926269272692826929269302693126932269332693426935269362693726938269392694026941269422694326944269452694626947269482694926950269512695226953269542695526956269572695826959269602696126962269632696426965269662696726968269692697026971269722697326974269752697626977269782697926980269812698226983269842698526986269872698826989269902699126992269932699426995269962699726998269992700027001270022700327004270052700627007270082700927010270112701227013270142701527016270172701827019270202702127022270232702427025270262702727028270292703027031270322703327034270352703627037270382703927040270412704227043270442704527046270472704827049270502705127052270532705427055270562705727058270592706027061270622706327064270652706627067270682706927070270712707227073270742707527076270772707827079270802708127082270832708427085270862708727088270892709027091270922709327094270952709627097270982709927100271012710227103271042710527106271072710827109271102711127112271132711427115271162711727118271192712027121271222712327124271252712627127271282712927130271312713227133271342713527136271372713827139271402714127142271432714427145271462714727148271492715027151271522715327154271552715627157271582715927160271612716227163271642716527166271672716827169271702717127172271732717427175271762717727178271792718027181271822718327184271852718627187271882718927190271912719227193271942719527196271972719827199272002720127202272032720427205272062720727208272092721027211272122721327214272152721627217272182721927220272212722227223272242722527226272272722827229272302723127232272332723427235272362723727238272392724027241272422724327244272452724627247272482724927250272512725227253272542725527256272572725827259272602726127262272632726427265272662726727268272692727027271272722727327274272752727627277272782727927280272812728227283272842728527286272872728827289272902729127292272932729427295272962729727298272992730027301273022730327304273052730627307273082730927310273112731227313273142731527316273172731827319273202732127322273232732427325273262732727328273292733027331273322733327334273352733627337273382733927340273412734227343273442734527346273472734827349273502735127352273532735427355273562735727358273592736027361273622736327364273652736627367273682736927370273712737227373273742737527376273772737827379273802738127382273832738427385273862738727388273892739027391273922739327394273952739627397273982739927400274012740227403274042740527406274072740827409274102741127412274132741427415274162741727418274192742027421274222742327424274252742627427274282742927430274312743227433274342743527436274372743827439274402744127442274432744427445274462744727448274492745027451274522745327454274552745627457274582745927460274612746227463274642746527466274672746827469274702747127472274732747427475274762747727478274792748027481274822748327484274852748627487274882748927490274912749227493274942749527496274972749827499275002750127502275032750427505275062750727508275092751027511275122751327514275152751627517275182751927520275212752227523275242752527526275272752827529275302753127532275332753427535275362753727538275392754027541275422754327544275452754627547275482754927550275512755227553275542755527556275572755827559275602756127562275632756427565275662756727568275692757027571275722757327574275752757627577275782757927580275812758227583275842758527586275872758827589275902759127592275932759427595275962759727598275992760027601276022760327604276052760627607276082760927610276112761227613276142761527616276172761827619276202762127622276232762427625276262762727628276292763027631276322763327634276352763627637276382763927640276412764227643276442764527646276472764827649276502765127652276532765427655276562765727658276592766027661276622766327664276652766627667276682766927670276712767227673276742767527676276772767827679276802768127682276832768427685276862768727688276892769027691276922769327694276952769627697276982769927700277012770227703277042770527706277072770827709277102771127712277132771427715277162771727718277192772027721277222772327724277252772627727277282772927730277312773227733277342773527736277372773827739277402774127742277432774427745277462774727748277492775027751277522775327754277552775627757277582775927760277612776227763277642776527766277672776827769277702777127772277732777427775277762777727778277792778027781277822778327784277852778627787277882778927790277912779227793277942779527796277972779827799278002780127802278032780427805278062780727808278092781027811278122781327814278152781627817278182781927820278212782227823278242782527826278272782827829278302783127832278332783427835278362783727838278392784027841278422784327844278452784627847278482784927850278512785227853278542785527856278572785827859278602786127862278632786427865278662786727868278692787027871278722787327874278752787627877278782787927880278812788227883278842788527886278872788827889278902789127892278932789427895278962789727898278992790027901279022790327904279052790627907279082790927910279112791227913279142791527916279172791827919279202792127922279232792427925279262792727928279292793027931279322793327934279352793627937279382793927940279412794227943279442794527946279472794827949279502795127952279532795427955279562795727958279592796027961279622796327964279652796627967279682796927970279712797227973279742797527976279772797827979279802798127982279832798427985279862798727988279892799027991279922799327994279952799627997279982799928000280012800228003280042800528006280072800828009280102801128012280132801428015280162801728018280192802028021280222802328024280252802628027280282802928030280312803228033280342803528036280372803828039280402804128042280432804428045280462804728048280492805028051280522805328054280552805628057280582805928060280612806228063280642806528066280672806828069280702807128072280732807428075280762807728078280792808028081280822808328084280852808628087280882808928090280912809228093280942809528096280972809828099281002810128102281032810428105281062810728108281092811028111281122811328114281152811628117281182811928120281212812228123281242812528126281272812828129281302813128132281332813428135281362813728138281392814028141281422814328144281452814628147281482814928150281512815228153281542815528156281572815828159281602816128162281632816428165281662816728168281692817028171281722817328174281752817628177281782817928180281812818228183281842818528186281872818828189281902819128192281932819428195281962819728198281992820028201282022820328204282052820628207282082820928210282112821228213282142821528216282172821828219282202822128222282232822428225282262822728228282292823028231282322823328234282352823628237282382823928240282412824228243282442824528246282472824828249282502825128252282532825428255282562825728258282592826028261282622826328264282652826628267282682826928270282712827228273282742827528276282772827828279282802828128282282832828428285282862828728288282892829028291282922829328294282952829628297282982829928300283012830228303283042830528306283072830828309283102831128312283132831428315283162831728318283192832028321283222832328324283252832628327283282832928330283312833228333283342833528336283372833828339283402834128342283432834428345283462834728348283492835028351283522835328354283552835628357283582835928360283612836228363283642836528366283672836828369283702837128372283732837428375283762837728378283792838028381283822838328384283852838628387283882838928390283912839228393283942839528396283972839828399284002840128402284032840428405284062840728408284092841028411284122841328414284152841628417284182841928420284212842228423284242842528426284272842828429284302843128432284332843428435284362843728438284392844028441284422844328444284452844628447284482844928450284512845228453284542845528456284572845828459284602846128462284632846428465284662846728468284692847028471284722847328474284752847628477284782847928480284812848228483284842848528486284872848828489284902849128492284932849428495284962849728498284992850028501285022850328504285052850628507285082850928510285112851228513285142851528516285172851828519285202852128522285232852428525285262852728528285292853028531285322853328534285352853628537285382853928540285412854228543285442854528546285472854828549285502855128552285532855428555285562855728558285592856028561285622856328564285652856628567285682856928570285712857228573285742857528576285772857828579285802858128582285832858428585285862858728588285892859028591285922859328594285952859628597285982859928600286012860228603286042860528606286072860828609286102861128612286132861428615286162861728618286192862028621286222862328624286252862628627286282862928630286312863228633286342863528636286372863828639286402864128642286432864428645286462864728648286492865028651286522865328654286552865628657286582865928660286612866228663286642866528666286672866828669286702867128672286732867428675286762867728678286792868028681286822868328684286852868628687286882868928690286912869228693286942869528696286972869828699287002870128702287032870428705287062870728708287092871028711287122871328714287152871628717287182871928720287212872228723287242872528726287272872828729287302873128732287332873428735287362873728738287392874028741287422874328744287452874628747287482874928750287512875228753287542875528756287572875828759287602876128762287632876428765287662876728768287692877028771287722877328774287752877628777287782877928780287812878228783287842878528786287872878828789287902879128792287932879428795287962879728798287992880028801288022880328804288052880628807288082880928810288112881228813288142881528816288172881828819288202882128822288232882428825288262882728828288292883028831288322883328834288352883628837288382883928840288412884228843288442884528846288472884828849288502885128852288532885428855288562885728858288592886028861288622886328864288652886628867288682886928870288712887228873288742887528876288772887828879288802888128882288832888428885288862888728888288892889028891288922889328894288952889628897288982889928900289012890228903289042890528906289072890828909289102891128912289132891428915289162891728918289192892028921289222892328924289252892628927289282892928930289312893228933289342893528936289372893828939289402894128942289432894428945289462894728948289492895028951289522895328954289552895628957289582895928960289612896228963289642896528966289672896828969289702897128972289732897428975289762897728978289792898028981289822898328984289852898628987289882898928990289912899228993289942899528996289972899828999290002900129002290032900429005290062900729008290092901029011290122901329014290152901629017290182901929020290212902229023290242902529026290272902829029290302903129032290332903429035290362903729038290392904029041290422904329044290452904629047290482904929050290512905229053290542905529056290572905829059290602906129062290632906429065290662906729068290692907029071290722907329074290752907629077290782907929080290812908229083290842908529086290872908829089290902909129092290932909429095290962909729098290992910029101291022910329104291052910629107291082910929110291112911229113291142911529116291172911829119291202912129122291232912429125291262912729128291292913029131291322913329134291352913629137291382913929140291412914229143291442914529146291472914829149291502915129152291532915429155291562915729158291592916029161291622916329164291652916629167291682916929170291712917229173291742917529176291772917829179291802918129182291832918429185291862918729188291892919029191291922919329194291952919629197291982919929200292012920229203292042920529206292072920829209292102921129212292132921429215292162921729218292192922029221292222922329224292252922629227292282922929230292312923229233292342923529236292372923829239292402924129242292432924429245292462924729248292492925029251292522925329254292552925629257292582925929260292612926229263292642926529266292672926829269292702927129272292732927429275292762927729278292792928029281292822928329284292852928629287292882928929290292912929229293292942929529296292972929829299293002930129302293032930429305293062930729308293092931029311293122931329314293152931629317293182931929320293212932229323293242932529326293272932829329293302933129332293332933429335293362933729338293392934029341293422934329344293452934629347293482934929350293512935229353293542935529356293572935829359293602936129362293632936429365293662936729368293692937029371293722937329374293752937629377293782937929380293812938229383293842938529386293872938829389293902939129392293932939429395293962939729398293992940029401294022940329404294052940629407294082940929410294112941229413294142941529416294172941829419294202942129422294232942429425294262942729428294292943029431294322943329434294352943629437294382943929440294412944229443294442944529446294472944829449294502945129452294532945429455294562945729458294592946029461294622946329464294652946629467294682946929470294712947229473294742947529476294772947829479294802948129482294832948429485294862948729488294892949029491294922949329494294952949629497294982949929500295012950229503295042950529506295072950829509295102951129512295132951429515295162951729518295192952029521295222952329524295252952629527295282952929530295312953229533295342953529536295372953829539295402954129542295432954429545295462954729548295492955029551295522955329554295552955629557295582955929560295612956229563295642956529566295672956829569295702957129572295732957429575295762957729578295792958029581295822958329584295852958629587295882958929590295912959229593295942959529596295972959829599296002960129602296032960429605296062960729608296092961029611296122961329614296152961629617296182961929620296212962229623296242962529626296272962829629296302963129632296332963429635296362963729638296392964029641296422964329644296452964629647296482964929650296512965229653296542965529656296572965829659296602966129662296632966429665296662966729668296692967029671296722967329674296752967629677296782967929680296812968229683296842968529686296872968829689296902969129692296932969429695296962969729698296992970029701297022970329704297052970629707297082970929710297112971229713297142971529716297172971829719297202972129722297232972429725297262972729728297292973029731297322973329734297352973629737297382973929740297412974229743297442974529746297472974829749297502975129752297532975429755297562975729758297592976029761297622976329764297652976629767297682976929770297712977229773297742977529776297772977829779297802978129782297832978429785297862978729788297892979029791297922979329794297952979629797297982979929800298012980229803298042980529806298072980829809298102981129812298132981429815298162981729818298192982029821298222982329824298252982629827298282982929830298312983229833298342983529836298372983829839298402984129842298432984429845298462984729848298492985029851298522985329854298552985629857298582985929860298612986229863298642986529866298672986829869298702987129872298732987429875298762987729878298792988029881298822988329884298852988629887298882988929890298912989229893298942989529896298972989829899299002990129902299032990429905299062990729908299092991029911299122991329914299152991629917299182991929920299212992229923299242992529926299272992829929299302993129932299332993429935299362993729938299392994029941299422994329944299452994629947299482994929950299512995229953299542995529956299572995829959299602996129962299632996429965299662996729968299692997029971299722997329974299752997629977299782997929980299812998229983299842998529986299872998829989299902999129992299932999429995299962999729998299993000030001300023000330004300053000630007300083000930010300113001230013300143001530016300173001830019300203002130022300233002430025300263002730028300293003030031300323003330034300353003630037300383003930040300413004230043300443004530046300473004830049300503005130052300533005430055300563005730058300593006030061300623006330064300653006630067300683006930070300713007230073300743007530076300773007830079300803008130082300833008430085300863008730088300893009030091300923009330094300953009630097300983009930100301013010230103301043010530106301073010830109301103011130112301133011430115301163011730118301193012030121301223012330124301253012630127301283012930130301313013230133301343013530136301373013830139301403014130142301433014430145301463014730148301493015030151301523015330154301553015630157301583015930160301613016230163301643016530166301673016830169301703017130172301733017430175301763017730178301793018030181301823018330184301853018630187301883018930190301913019230193301943019530196301973019830199302003020130202302033020430205302063020730208302093021030211302123021330214302153021630217302183021930220302213022230223302243022530226302273022830229302303023130232302333023430235302363023730238302393024030241302423024330244302453024630247302483024930250302513025230253302543025530256302573025830259302603026130262302633026430265302663026730268302693027030271302723027330274302753027630277302783027930280302813028230283302843028530286302873028830289302903029130292302933029430295302963029730298302993030030301303023030330304303053030630307303083030930310303113031230313303143031530316303173031830319303203032130322303233032430325303263032730328303293033030331303323033330334303353033630337303383033930340303413034230343303443034530346303473034830349303503035130352303533035430355303563035730358303593036030361303623036330364303653036630367303683036930370303713037230373303743037530376303773037830379303803038130382303833038430385303863038730388303893039030391303923039330394303953039630397303983039930400304013040230403304043040530406304073040830409304103041130412304133041430415304163041730418304193042030421304223042330424304253042630427304283042930430304313043230433304343043530436304373043830439304403044130442304433044430445304463044730448304493045030451304523045330454304553045630457304583045930460304613046230463304643046530466304673046830469304703047130472304733047430475304763047730478304793048030481304823048330484304853048630487304883048930490304913049230493304943049530496304973049830499305003050130502305033050430505305063050730508305093051030511305123051330514305153051630517305183051930520305213052230523305243052530526305273052830529305303053130532305333053430535305363053730538305393054030541305423054330544305453054630547305483054930550305513055230553305543055530556305573055830559305603056130562305633056430565305663056730568305693057030571305723057330574305753057630577305783057930580305813058230583305843058530586305873058830589305903059130592305933059430595305963059730598305993060030601306023060330604306053060630607306083060930610306113061230613306143061530616306173061830619306203062130622306233062430625306263062730628306293063030631306323063330634306353063630637306383063930640306413064230643306443064530646306473064830649306503065130652306533065430655306563065730658306593066030661306623066330664306653066630667306683066930670306713067230673306743067530676306773067830679306803068130682306833068430685306863068730688306893069030691306923069330694306953069630697306983069930700307013070230703307043070530706307073070830709307103071130712307133071430715307163071730718307193072030721307223072330724307253072630727307283072930730307313073230733307343073530736307373073830739307403074130742307433074430745307463074730748307493075030751307523075330754307553075630757307583075930760307613076230763307643076530766307673076830769307703077130772307733077430775307763077730778307793078030781307823078330784307853078630787307883078930790307913079230793307943079530796307973079830799308003080130802308033080430805308063080730808308093081030811308123081330814308153081630817308183081930820308213082230823308243082530826308273082830829308303083130832308333083430835308363083730838308393084030841308423084330844308453084630847308483084930850308513085230853308543085530856308573085830859308603086130862308633086430865308663086730868308693087030871308723087330874308753087630877308783087930880308813088230883308843088530886308873088830889308903089130892308933089430895308963089730898308993090030901309023090330904309053090630907309083090930910309113091230913309143091530916309173091830919309203092130922309233092430925309263092730928309293093030931309323093330934309353093630937309383093930940309413094230943309443094530946309473094830949309503095130952309533095430955309563095730958309593096030961309623096330964309653096630967309683096930970309713097230973309743097530976309773097830979309803098130982309833098430985309863098730988309893099030991309923099330994309953099630997309983099931000310013100231003310043100531006310073100831009310103101131012310133101431015310163101731018310193102031021310223102331024310253102631027310283102931030310313103231033310343103531036310373103831039310403104131042310433104431045310463104731048310493105031051310523105331054310553105631057310583105931060310613106231063310643106531066310673106831069310703107131072310733107431075310763107731078310793108031081310823108331084310853108631087310883108931090310913109231093310943109531096310973109831099311003110131102311033110431105311063110731108311093111031111311123111331114311153111631117311183111931120311213112231123311243112531126311273112831129311303113131132311333113431135311363113731138311393114031141311423114331144311453114631147311483114931150311513115231153311543115531156311573115831159311603116131162311633116431165311663116731168311693117031171311723117331174311753117631177311783117931180311813118231183311843118531186311873118831189311903119131192311933119431195311963119731198311993120031201312023120331204312053120631207312083120931210312113121231213312143121531216312173121831219312203122131222312233122431225312263122731228312293123031231312323123331234312353123631237312383123931240312413124231243312443124531246312473124831249312503125131252312533125431255312563125731258312593126031261312623126331264312653126631267312683126931270312713127231273312743127531276312773127831279312803128131282312833128431285312863128731288312893129031291312923129331294312953129631297312983129931300313013130231303313043130531306313073130831309313103131131312313133131431315313163131731318313193132031321313223132331324313253132631327313283132931330313313133231333313343133531336313373133831339313403134131342313433134431345313463134731348313493135031351313523135331354313553135631357313583135931360313613136231363313643136531366313673136831369313703137131372313733137431375313763137731378313793138031381313823138331384313853138631387313883138931390313913139231393313943139531396313973139831399314003140131402314033140431405314063140731408314093141031411314123141331414314153141631417314183141931420314213142231423314243142531426314273142831429314303143131432314333143431435314363143731438314393144031441314423144331444314453144631447314483144931450314513145231453314543145531456314573145831459314603146131462314633146431465314663146731468314693147031471314723147331474314753147631477314783147931480314813148231483314843148531486314873148831489314903149131492314933149431495314963149731498314993150031501315023150331504315053150631507315083150931510315113151231513315143151531516315173151831519315203152131522315233152431525315263152731528315293153031531315323153331534315353153631537315383153931540315413154231543315443154531546315473154831549315503155131552315533155431555315563155731558315593156031561315623156331564315653156631567315683156931570315713157231573315743157531576315773157831579315803158131582315833158431585315863158731588315893159031591315923159331594315953159631597315983159931600316013160231603316043160531606316073160831609316103161131612316133161431615316163161731618316193162031621316223162331624316253162631627316283162931630316313163231633316343163531636316373163831639316403164131642316433164431645316463164731648316493165031651316523165331654316553165631657316583165931660316613166231663316643166531666316673166831669316703167131672316733167431675316763167731678316793168031681316823168331684316853168631687316883168931690316913169231693316943169531696316973169831699317003170131702317033170431705317063170731708317093171031711317123171331714317153171631717317183171931720317213172231723317243172531726317273172831729317303173131732317333173431735317363173731738317393174031741317423174331744317453174631747317483174931750317513175231753317543175531756317573175831759317603176131762317633176431765317663176731768317693177031771317723177331774317753177631777317783177931780317813178231783317843178531786317873178831789317903179131792317933179431795317963179731798317993180031801318023180331804318053180631807318083180931810318113181231813318143181531816318173181831819318203182131822318233182431825318263182731828318293183031831318323183331834318353183631837318383183931840318413184231843318443184531846318473184831849318503185131852318533185431855318563185731858318593186031861318623186331864318653186631867318683186931870318713187231873318743187531876318773187831879318803188131882318833188431885318863188731888318893189031891318923189331894318953189631897318983189931900319013190231903319043190531906319073190831909319103191131912319133191431915319163191731918319193192031921319223192331924319253192631927319283192931930319313193231933319343193531936319373193831939319403194131942319433194431945319463194731948319493195031951319523195331954319553195631957319583195931960319613196231963319643196531966319673196831969319703197131972319733197431975319763197731978319793198031981319823198331984319853198631987319883198931990319913199231993319943199531996319973199831999320003200132002320033200432005320063200732008320093201032011320123201332014320153201632017320183201932020320213202232023320243202532026320273202832029320303203132032320333203432035320363203732038320393204032041320423204332044320453204632047320483204932050320513205232053320543205532056320573205832059320603206132062320633206432065320663206732068320693207032071320723207332074320753207632077320783207932080320813208232083320843208532086320873208832089320903209132092320933209432095320963209732098320993210032101321023210332104321053210632107321083210932110321113211232113321143211532116321173211832119321203212132122321233212432125321263212732128321293213032131321323213332134321353213632137321383213932140321413214232143321443214532146321473214832149321503215132152321533215432155321563215732158321593216032161321623216332164321653216632167321683216932170321713217232173321743217532176321773217832179321803218132182321833218432185321863218732188321893219032191321923219332194321953219632197321983219932200322013220232203322043220532206322073220832209322103221132212322133221432215322163221732218322193222032221322223222332224322253222632227322283222932230322313223232233322343223532236322373223832239322403224132242322433224432245322463224732248322493225032251322523225332254322553225632257322583225932260322613226232263322643226532266322673226832269322703227132272322733227432275322763227732278322793228032281322823228332284322853228632287322883228932290322913229232293322943229532296322973229832299323003230132302323033230432305323063230732308323093231032311323123231332314323153231632317323183231932320323213232232323323243232532326323273232832329323303233132332323333233432335323363233732338323393234032341323423234332344323453234632347323483234932350323513235232353323543235532356323573235832359323603236132362323633236432365323663236732368323693237032371323723237332374323753237632377323783237932380323813238232383323843238532386323873238832389323903239132392323933239432395323963239732398323993240032401324023240332404324053240632407324083240932410324113241232413324143241532416324173241832419324203242132422324233242432425324263242732428324293243032431324323243332434324353243632437324383243932440324413244232443324443244532446324473244832449324503245132452324533245432455324563245732458324593246032461324623246332464324653246632467324683246932470324713247232473324743247532476324773247832479324803248132482324833248432485324863248732488324893249032491324923249332494324953249632497324983249932500325013250232503325043250532506325073250832509325103251132512325133251432515325163251732518325193252032521325223252332524325253252632527325283252932530325313253232533325343253532536325373253832539325403254132542325433254432545325463254732548325493255032551325523255332554325553255632557325583255932560325613256232563325643256532566325673256832569325703257132572325733257432575325763257732578325793258032581325823258332584325853258632587325883258932590325913259232593325943259532596325973259832599326003260132602326033260432605326063260732608326093261032611326123261332614326153261632617326183261932620326213262232623326243262532626326273262832629326303263132632326333263432635326363263732638326393264032641326423264332644326453264632647326483264932650326513265232653326543265532656326573265832659326603266132662326633266432665326663266732668326693267032671326723267332674326753267632677326783267932680326813268232683326843268532686326873268832689326903269132692326933269432695326963269732698326993270032701327023270332704327053270632707327083270932710327113271232713327143271532716327173271832719327203272132722327233272432725327263272732728327293273032731327323273332734327353273632737327383273932740327413274232743327443274532746327473274832749327503275132752327533275432755327563275732758327593276032761327623276332764327653276632767327683276932770327713277232773327743277532776327773277832779327803278132782327833278432785327863278732788327893279032791327923279332794327953279632797327983279932800328013280232803328043280532806328073280832809328103281132812328133281432815328163281732818328193282032821328223282332824328253282632827328283282932830328313283232833328343283532836328373283832839328403284132842328433284432845328463284732848328493285032851328523285332854328553285632857328583285932860328613286232863328643286532866328673286832869328703287132872328733287432875328763287732878328793288032881328823288332884328853288632887328883288932890328913289232893328943289532896328973289832899329003290132902329033290432905329063290732908329093291032911329123291332914329153291632917329183291932920329213292232923329243292532926329273292832929329303293132932329333293432935329363293732938329393294032941329423294332944329453294632947329483294932950329513295232953329543295532956329573295832959329603296132962329633296432965329663296732968329693297032971329723297332974329753297632977329783297932980329813298232983329843298532986329873298832989329903299132992329933299432995329963299732998329993300033001330023300333004330053300633007330083300933010330113301233013330143301533016330173301833019330203302133022330233302433025330263302733028330293303033031330323303333034330353303633037330383303933040330413304233043330443304533046330473304833049330503305133052330533305433055330563305733058330593306033061330623306333064330653306633067330683306933070330713307233073330743307533076330773307833079330803308133082330833308433085330863308733088330893309033091330923309333094330953309633097330983309933100331013310233103331043310533106331073310833109331103311133112331133311433115331163311733118331193312033121331223312333124331253312633127331283312933130331313313233133331343313533136331373313833139331403314133142331433314433145331463314733148331493315033151331523315333154331553315633157331583315933160331613316233163331643316533166331673316833169331703317133172331733317433175331763317733178331793318033181331823318333184331853318633187331883318933190331913319233193331943319533196331973319833199332003320133202332033320433205332063320733208332093321033211332123321333214332153321633217332183321933220332213322233223332243322533226332273322833229332303323133232332333323433235332363323733238332393324033241332423324333244332453324633247332483324933250332513325233253332543325533256332573325833259332603326133262332633326433265332663326733268332693327033271332723327333274332753327633277332783327933280332813328233283332843328533286332873328833289332903329133292332933329433295332963329733298332993330033301333023330333304333053330633307333083330933310333113331233313333143331533316333173331833319333203332133322333233332433325333263332733328333293333033331333323333333334333353333633337333383333933340333413334233343333443334533346333473334833349333503335133352333533335433355333563335733358333593336033361333623336333364333653336633367333683336933370333713337233373333743337533376333773337833379333803338133382333833338433385333863338733388333893339033391333923339333394333953339633397333983339933400334013340233403334043340533406334073340833409334103341133412334133341433415334163341733418334193342033421334223342333424334253342633427334283342933430334313343233433334343343533436334373343833439334403344133442334433344433445334463344733448334493345033451334523345333454334553345633457334583345933460334613346233463334643346533466334673346833469334703347133472334733347433475334763347733478334793348033481334823348333484334853348633487334883348933490334913349233493334943349533496334973349833499335003350133502335033350433505335063350733508335093351033511335123351333514335153351633517335183351933520335213352233523335243352533526335273352833529335303353133532335333353433535335363353733538335393354033541335423354333544335453354633547335483354933550335513355233553335543355533556335573355833559335603356133562335633356433565335663356733568335693357033571335723357333574335753357633577335783357933580335813358233583335843358533586335873358833589335903359133592335933359433595335963359733598335993360033601336023360333604336053360633607336083360933610336113361233613336143361533616336173361833619336203362133622336233362433625336263362733628336293363033631336323363333634336353363633637336383363933640336413364233643336443364533646336473364833649336503365133652336533365433655336563365733658336593366033661336623366333664336653366633667336683366933670336713367233673336743367533676336773367833679336803368133682336833368433685336863368733688336893369033691336923369333694336953369633697336983369933700337013370233703337043370533706337073370833709337103371133712337133371433715337163371733718337193372033721337223372333724337253372633727337283372933730337313373233733337343373533736337373373833739337403374133742337433374433745337463374733748337493375033751337523375333754337553375633757337583375933760337613376233763337643376533766337673376833769337703377133772337733377433775337763377733778337793378033781337823378333784337853378633787337883378933790337913379233793337943379533796337973379833799338003380133802338033380433805338063380733808338093381033811338123381333814338153381633817338183381933820338213382233823338243382533826338273382833829338303383133832338333383433835338363383733838338393384033841338423384333844338453384633847338483384933850338513385233853338543385533856338573385833859338603386133862338633386433865338663386733868338693387033871338723387333874338753387633877338783387933880338813388233883338843388533886338873388833889338903389133892338933389433895338963389733898338993390033901339023390333904339053390633907339083390933910339113391233913339143391533916339173391833919339203392133922339233392433925339263392733928339293393033931339323393333934339353393633937339383393933940339413394233943339443394533946339473394833949339503395133952339533395433955339563395733958339593396033961339623396333964339653396633967339683396933970339713397233973339743397533976339773397833979339803398133982339833398433985339863398733988339893399033991339923399333994339953399633997339983399934000340013400234003340043400534006340073400834009340103401134012340133401434015340163401734018340193402034021340223402334024340253402634027340283402934030340313403234033340343403534036340373403834039340403404134042340433404434045340463404734048340493405034051340523405334054340553405634057340583405934060340613406234063340643406534066340673406834069340703407134072340733407434075340763407734078340793408034081340823408334084340853408634087340883408934090340913409234093340943409534096340973409834099341003410134102341033410434105341063410734108341093411034111341123411334114341153411634117341183411934120341213412234123341243412534126341273412834129341303413134132341333413434135341363413734138341393414034141341423414334144341453414634147341483414934150341513415234153341543415534156341573415834159341603416134162341633416434165341663416734168341693417034171341723417334174341753417634177341783417934180341813418234183341843418534186341873418834189341903419134192341933419434195341963419734198341993420034201342023420334204342053420634207342083420934210342113421234213342143421534216342173421834219342203422134222342233422434225342263422734228342293423034231342323423334234342353423634237342383423934240342413424234243342443424534246342473424834249342503425134252342533425434255342563425734258342593426034261342623426334264342653426634267342683426934270342713427234273342743427534276342773427834279342803428134282342833428434285342863428734288342893429034291342923429334294342953429634297342983429934300343013430234303343043430534306343073430834309343103431134312343133431434315343163431734318343193432034321343223432334324343253432634327343283432934330343313433234333343343433534336343373433834339343403434134342343433434434345343463434734348343493435034351343523435334354343553435634357343583435934360343613436234363343643436534366343673436834369343703437134372343733437434375343763437734378343793438034381343823438334384343853438634387343883438934390343913439234393343943439534396343973439834399344003440134402344033440434405344063440734408344093441034411344123441334414344153441634417344183441934420344213442234423344243442534426344273442834429344303443134432344333443434435344363443734438344393444034441344423444334444344453444634447344483444934450344513445234453344543445534456344573445834459344603446134462344633446434465344663446734468344693447034471344723447334474344753447634477344783447934480344813448234483344843448534486344873448834489344903449134492344933449434495344963449734498344993450034501345023450334504345053450634507345083450934510345113451234513345143451534516345173451834519345203452134522345233452434525345263452734528345293453034531345323453334534345353453634537345383453934540345413454234543345443454534546345473454834549345503455134552345533455434555345563455734558345593456034561345623456334564345653456634567345683456934570345713457234573345743457534576345773457834579345803458134582345833458434585345863458734588345893459034591345923459334594345953459634597345983459934600346013460234603346043460534606346073460834609346103461134612346133461434615346163461734618346193462034621346223462334624346253462634627346283462934630346313463234633346343463534636346373463834639346403464134642346433464434645346463464734648346493465034651346523465334654346553465634657346583465934660346613466234663346643466534666346673466834669346703467134672346733467434675346763467734678346793468034681346823468334684346853468634687346883468934690346913469234693346943469534696346973469834699347003470134702347033470434705347063470734708347093471034711347123471334714347153471634717347183471934720347213472234723347243472534726347273472834729347303473134732347333473434735347363473734738347393474034741347423474334744347453474634747347483474934750347513475234753347543475534756347573475834759347603476134762347633476434765347663476734768347693477034771347723477334774347753477634777347783477934780347813478234783347843478534786347873478834789347903479134792347933479434795347963479734798347993480034801348023480334804348053480634807348083480934810348113481234813348143481534816348173481834819348203482134822348233482434825348263482734828348293483034831348323483334834348353483634837348383483934840348413484234843348443484534846348473484834849348503485134852348533485434855348563485734858348593486034861348623486334864348653486634867348683486934870348713487234873348743487534876348773487834879348803488134882348833488434885348863488734888348893489034891348923489334894348953489634897348983489934900349013490234903349043490534906349073490834909349103491134912349133491434915349163491734918349193492034921349223492334924349253492634927349283492934930349313493234933349343493534936349373493834939349403494134942349433494434945349463494734948349493495034951349523495334954349553495634957349583495934960349613496234963349643496534966349673496834969349703497134972349733497434975349763497734978349793498034981349823498334984349853498634987349883498934990349913499234993349943499534996349973499834999350003500135002350033500435005350063500735008350093501035011350123501335014350153501635017350183501935020350213502235023350243502535026350273502835029350303503135032350333503435035350363503735038350393504035041350423504335044350453504635047350483504935050350513505235053350543505535056350573505835059350603506135062350633506435065350663506735068350693507035071350723507335074350753507635077350783507935080350813508235083350843508535086350873508835089350903509135092350933509435095350963509735098350993510035101351023510335104351053510635107351083510935110351113511235113351143511535116351173511835119351203512135122351233512435125351263512735128351293513035131351323513335134351353513635137351383513935140351413514235143351443514535146351473514835149351503515135152351533515435155351563515735158351593516035161351623516335164351653516635167351683516935170351713517235173351743517535176351773517835179351803518135182351833518435185351863518735188351893519035191351923519335194351953519635197351983519935200352013520235203352043520535206352073520835209352103521135212352133521435215352163521735218352193522035221352223522335224352253522635227352283522935230352313523235233352343523535236352373523835239352403524135242352433524435245352463524735248352493525035251352523525335254352553525635257352583525935260352613526235263352643526535266352673526835269352703527135272352733527435275352763527735278352793528035281352823528335284352853528635287352883528935290352913529235293352943529535296352973529835299353003530135302353033530435305353063530735308353093531035311353123531335314353153531635317353183531935320353213532235323353243532535326353273532835329353303533135332353333533435335353363533735338353393534035341353423534335344353453534635347353483534935350353513535235353353543535535356353573535835359353603536135362353633536435365353663536735368353693537035371353723537335374353753537635377353783537935380353813538235383353843538535386353873538835389353903539135392353933539435395353963539735398353993540035401354023540335404354053540635407354083540935410354113541235413354143541535416354173541835419354203542135422354233542435425354263542735428354293543035431354323543335434354353543635437354383543935440354413544235443354443544535446354473544835449354503545135452354533545435455354563545735458354593546035461354623546335464354653546635467354683546935470354713547235473354743547535476354773547835479354803548135482354833548435485354863548735488354893549035491354923549335494354953549635497354983549935500355013550235503355043550535506355073550835509355103551135512355133551435515355163551735518355193552035521355223552335524355253552635527355283552935530355313553235533355343553535536355373553835539355403554135542355433554435545355463554735548355493555035551355523555335554355553555635557355583555935560355613556235563355643556535566355673556835569355703557135572355733557435575355763557735578355793558035581355823558335584355853558635587355883558935590355913559235593355943559535596355973559835599356003560135602356033560435605356063560735608356093561035611356123561335614356153561635617356183561935620356213562235623356243562535626356273562835629356303563135632356333563435635356363563735638356393564035641356423564335644356453564635647356483564935650356513565235653356543565535656356573565835659356603566135662356633566435665356663566735668356693567035671356723567335674356753567635677356783567935680356813568235683356843568535686356873568835689356903569135692356933569435695356963569735698356993570035701357023570335704357053570635707357083570935710357113571235713357143571535716357173571835719357203572135722357233572435725357263572735728357293573035731357323573335734357353573635737357383573935740357413574235743357443574535746357473574835749357503575135752357533575435755357563575735758357593576035761357623576335764357653576635767357683576935770357713577235773357743577535776357773577835779357803578135782357833578435785357863578735788357893579035791357923579335794357953579635797357983579935800358013580235803358043580535806358073580835809358103581135812358133581435815358163581735818358193582035821358223582335824358253582635827358283582935830358313583235833358343583535836358373583835839358403584135842358433584435845358463584735848358493585035851358523585335854358553585635857358583585935860358613586235863358643586535866358673586835869358703587135872358733587435875358763587735878358793588035881358823588335884358853588635887358883588935890358913589235893358943589535896358973589835899359003590135902359033590435905359063590735908359093591035911359123591335914359153591635917359183591935920359213592235923359243592535926359273592835929359303593135932359333593435935359363593735938359393594035941359423594335944359453594635947359483594935950359513595235953359543595535956359573595835959359603596135962359633596435965359663596735968359693597035971359723597335974359753597635977359783597935980359813598235983359843598535986359873598835989359903599135992359933599435995359963599735998359993600036001360023600336004360053600636007360083600936010360113601236013360143601536016360173601836019360203602136022360233602436025360263602736028360293603036031360323603336034360353603636037360383603936040360413604236043360443604536046360473604836049360503605136052360533605436055360563605736058360593606036061360623606336064360653606636067360683606936070360713607236073360743607536076360773607836079360803608136082360833608436085360863608736088360893609036091360923609336094360953609636097360983609936100361013610236103361043610536106361073610836109361103611136112361133611436115361163611736118361193612036121361223612336124361253612636127361283612936130361313613236133361343613536136361373613836139361403614136142361433614436145361463614736148361493615036151361523615336154361553615636157361583615936160361613616236163361643616536166361673616836169361703617136172361733617436175361763617736178361793618036181361823618336184361853618636187361883618936190361913619236193361943619536196361973619836199362003620136202362033620436205362063620736208362093621036211362123621336214362153621636217362183621936220362213622236223362243622536226362273622836229362303623136232362333623436235362363623736238362393624036241362423624336244362453624636247362483624936250362513625236253362543625536256362573625836259362603626136262362633626436265362663626736268362693627036271362723627336274362753627636277362783627936280362813628236283362843628536286362873628836289362903629136292362933629436295362963629736298362993630036301363023630336304363053630636307363083630936310363113631236313363143631536316363173631836319363203632136322363233632436325363263632736328363293633036331363323633336334363353633636337363383633936340363413634236343363443634536346363473634836349363503635136352363533635436355363563635736358363593636036361363623636336364363653636636367363683636936370363713637236373363743637536376363773637836379363803638136382363833638436385363863638736388363893639036391363923639336394363953639636397363983639936400364013640236403364043640536406364073640836409364103641136412364133641436415364163641736418364193642036421364223642336424364253642636427364283642936430364313643236433364343643536436364373643836439364403644136442364433644436445364463644736448364493645036451364523645336454364553645636457364583645936460364613646236463364643646536466364673646836469364703647136472364733647436475364763647736478364793648036481364823648336484364853648636487364883648936490364913649236493364943649536496364973649836499365003650136502365033650436505365063650736508365093651036511365123651336514365153651636517365183651936520365213652236523365243652536526365273652836529365303653136532365333653436535365363653736538365393654036541365423654336544365453654636547365483654936550365513655236553365543655536556365573655836559365603656136562365633656436565365663656736568365693657036571365723657336574365753657636577365783657936580365813658236583365843658536586365873658836589365903659136592365933659436595365963659736598365993660036601366023660336604366053660636607366083660936610366113661236613366143661536616366173661836619366203662136622366233662436625366263662736628366293663036631366323663336634366353663636637366383663936640366413664236643366443664536646366473664836649366503665136652366533665436655366563665736658366593666036661366623666336664366653666636667366683666936670366713667236673366743667536676366773667836679366803668136682366833668436685366863668736688366893669036691366923669336694366953669636697366983669936700367013670236703367043670536706367073670836709367103671136712367133671436715367163671736718367193672036721367223672336724367253672636727367283672936730367313673236733367343673536736367373673836739367403674136742367433674436745367463674736748367493675036751367523675336754367553675636757367583675936760367613676236763367643676536766367673676836769367703677136772367733677436775367763677736778367793678036781367823678336784367853678636787367883678936790367913679236793367943679536796367973679836799368003680136802368033680436805368063680736808368093681036811368123681336814368153681636817368183681936820368213682236823368243682536826368273682836829368303683136832368333683436835368363683736838368393684036841368423684336844368453684636847368483684936850368513685236853368543685536856368573685836859368603686136862368633686436865368663686736868368693687036871368723687336874368753687636877368783687936880368813688236883368843688536886368873688836889368903689136892368933689436895368963689736898368993690036901369023690336904369053690636907369083690936910369113691236913369143691536916369173691836919369203692136922369233692436925369263692736928369293693036931369323693336934369353693636937369383693936940369413694236943369443694536946369473694836949369503695136952369533695436955369563695736958369593696036961369623696336964369653696636967369683696936970369713697236973369743697536976369773697836979369803698136982369833698436985369863698736988369893699036991369923699336994369953699636997369983699937000370013700237003370043700537006370073700837009370103701137012370133701437015370163701737018370193702037021370223702337024370253702637027370283702937030370313703237033370343703537036370373703837039370403704137042370433704437045370463704737048370493705037051370523705337054370553705637057370583705937060370613706237063370643706537066370673706837069370703707137072370733707437075370763707737078370793708037081370823708337084370853708637087370883708937090370913709237093370943709537096370973709837099371003710137102371033710437105371063710737108371093711037111371123711337114371153711637117371183711937120371213712237123371243712537126371273712837129371303713137132371333713437135371363713737138371393714037141371423714337144371453714637147371483714937150371513715237153371543715537156371573715837159371603716137162371633716437165371663716737168371693717037171371723717337174371753717637177371783717937180371813718237183371843718537186371873718837189371903719137192371933719437195371963719737198371993720037201372023720337204372053720637207372083720937210372113721237213372143721537216372173721837219372203722137222372233722437225372263722737228372293723037231372323723337234372353723637237372383723937240372413724237243372443724537246372473724837249372503725137252372533725437255372563725737258372593726037261372623726337264372653726637267372683726937270372713727237273372743727537276372773727837279372803728137282372833728437285372863728737288372893729037291372923729337294372953729637297372983729937300373013730237303373043730537306373073730837309373103731137312373133731437315373163731737318373193732037321373223732337324373253732637327373283732937330373313733237333373343733537336373373733837339373403734137342373433734437345373463734737348373493735037351373523735337354373553735637357373583735937360373613736237363373643736537366373673736837369373703737137372373733737437375373763737737378373793738037381373823738337384373853738637387373883738937390373913739237393373943739537396373973739837399374003740137402374033740437405374063740737408374093741037411374123741337414374153741637417374183741937420374213742237423374243742537426374273742837429374303743137432374333743437435374363743737438374393744037441374423744337444374453744637447374483744937450374513745237453374543745537456374573745837459374603746137462374633746437465374663746737468374693747037471374723747337474374753747637477374783747937480374813748237483374843748537486374873748837489374903749137492374933749437495374963749737498374993750037501375023750337504375053750637507375083750937510375113751237513375143751537516375173751837519375203752137522375233752437525375263752737528375293753037531375323753337534375353753637537375383753937540375413754237543375443754537546375473754837549375503755137552375533755437555375563755737558375593756037561375623756337564375653756637567375683756937570375713757237573375743757537576375773757837579375803758137582375833758437585375863758737588375893759037591375923759337594375953759637597375983759937600376013760237603376043760537606376073760837609376103761137612376133761437615376163761737618376193762037621376223762337624376253762637627376283762937630376313763237633376343763537636376373763837639376403764137642376433764437645376463764737648376493765037651376523765337654376553765637657376583765937660376613766237663376643766537666376673766837669376703767137672376733767437675376763767737678376793768037681376823768337684376853768637687376883768937690376913769237693376943769537696376973769837699377003770137702377033770437705377063770737708377093771037711377123771337714377153771637717377183771937720377213772237723377243772537726377273772837729377303773137732377333773437735377363773737738377393774037741377423774337744377453774637747377483774937750377513775237753377543775537756377573775837759377603776137762377633776437765377663776737768377693777037771377723777337774377753777637777377783777937780377813778237783377843778537786377873778837789377903779137792377933779437795377963779737798377993780037801378023780337804378053780637807378083780937810378113781237813378143781537816378173781837819378203782137822378233782437825378263782737828378293783037831378323783337834378353783637837378383783937840378413784237843378443784537846378473784837849378503785137852378533785437855378563785737858378593786037861378623786337864378653786637867378683786937870378713787237873378743787537876378773787837879378803788137882378833788437885378863788737888378893789037891378923789337894378953789637897378983789937900379013790237903379043790537906379073790837909379103791137912379133791437915379163791737918379193792037921379223792337924379253792637927379283792937930379313793237933379343793537936379373793837939379403794137942379433794437945379463794737948379493795037951379523795337954379553795637957379583795937960379613796237963379643796537966379673796837969379703797137972379733797437975379763797737978379793798037981379823798337984379853798637987379883798937990379913799237993379943799537996379973799837999380003800138002380033800438005380063800738008380093801038011380123801338014380153801638017380183801938020380213802238023380243802538026380273802838029380303803138032380333803438035380363803738038380393804038041380423804338044380453804638047380483804938050380513805238053380543805538056380573805838059380603806138062380633806438065380663806738068380693807038071380723807338074380753807638077380783807938080380813808238083380843808538086380873808838089380903809138092380933809438095380963809738098380993810038101381023810338104381053810638107381083810938110381113811238113381143811538116381173811838119381203812138122381233812438125381263812738128381293813038131381323813338134381353813638137381383813938140381413814238143381443814538146381473814838149381503815138152381533815438155381563815738158381593816038161381623816338164381653816638167381683816938170381713817238173381743817538176381773817838179381803818138182381833818438185381863818738188381893819038191381923819338194381953819638197381983819938200382013820238203382043820538206382073820838209382103821138212382133821438215382163821738218382193822038221382223822338224382253822638227382283822938230382313823238233382343823538236382373823838239382403824138242382433824438245382463824738248382493825038251382523825338254382553825638257382583825938260382613826238263382643826538266382673826838269382703827138272382733827438275382763827738278382793828038281382823828338284382853828638287382883828938290382913829238293382943829538296382973829838299383003830138302383033830438305383063830738308383093831038311383123831338314383153831638317383183831938320383213832238323383243832538326383273832838329383303833138332383333833438335383363833738338383393834038341383423834338344383453834638347383483834938350383513835238353383543835538356383573835838359383603836138362383633836438365383663836738368383693837038371383723837338374383753837638377383783837938380383813838238383383843838538386383873838838389383903839138392383933839438395383963839738398383993840038401384023840338404384053840638407384083840938410384113841238413384143841538416384173841838419384203842138422384233842438425384263842738428384293843038431384323843338434384353843638437384383843938440384413844238443384443844538446384473844838449384503845138452384533845438455384563845738458384593846038461384623846338464384653846638467384683846938470384713847238473384743847538476384773847838479384803848138482384833848438485384863848738488384893849038491384923849338494384953849638497384983849938500385013850238503385043850538506385073850838509385103851138512385133851438515385163851738518385193852038521385223852338524385253852638527385283852938530385313853238533385343853538536385373853838539385403854138542385433854438545385463854738548385493855038551385523855338554385553855638557385583855938560385613856238563385643856538566385673856838569385703857138572385733857438575385763857738578385793858038581385823858338584385853858638587385883858938590385913859238593385943859538596385973859838599386003860138602386033860438605386063860738608386093861038611386123861338614386153861638617386183861938620386213862238623386243862538626386273862838629386303863138632386333863438635386363863738638386393864038641386423864338644386453864638647386483864938650386513865238653386543865538656386573865838659386603866138662386633866438665386663866738668386693867038671386723867338674386753867638677386783867938680386813868238683386843868538686386873868838689386903869138692386933869438695386963869738698386993870038701387023870338704387053870638707387083870938710387113871238713387143871538716387173871838719387203872138722387233872438725387263872738728387293873038731387323873338734387353873638737387383873938740387413874238743387443874538746387473874838749387503875138752387533875438755387563875738758387593876038761387623876338764387653876638767387683876938770387713877238773387743877538776387773877838779387803878138782387833878438785387863878738788387893879038791387923879338794387953879638797387983879938800388013880238803388043880538806388073880838809388103881138812388133881438815388163881738818388193882038821388223882338824388253882638827388283882938830388313883238833388343883538836388373883838839388403884138842388433884438845388463884738848388493885038851388523885338854388553885638857388583885938860388613886238863388643886538866388673886838869388703887138872388733887438875388763887738878388793888038881388823888338884388853888638887388883888938890388913889238893388943889538896388973889838899389003890138902389033890438905389063890738908389093891038911389123891338914389153891638917389183891938920389213892238923389243892538926389273892838929389303893138932389333893438935389363893738938389393894038941389423894338944389453894638947389483894938950389513895238953389543895538956389573895838959389603896138962389633896438965389663896738968389693897038971389723897338974389753897638977389783897938980389813898238983389843898538986389873898838989389903899138992389933899438995389963899738998389993900039001390023900339004390053900639007390083900939010390113901239013390143901539016390173901839019390203902139022390233902439025390263902739028390293903039031390323903339034390353903639037390383903939040390413904239043390443904539046390473904839049390503905139052390533905439055390563905739058390593906039061390623906339064390653906639067390683906939070390713907239073390743907539076390773907839079390803908139082390833908439085390863908739088390893909039091390923909339094390953909639097390983909939100391013910239103391043910539106391073910839109391103911139112391133911439115391163911739118391193912039121391223912339124391253912639127391283912939130391313913239133391343913539136391373913839139391403914139142391433914439145391463914739148391493915039151391523915339154391553915639157391583915939160391613916239163391643916539166391673916839169391703917139172391733917439175391763917739178391793918039181391823918339184391853918639187391883918939190391913919239193391943919539196391973919839199392003920139202392033920439205392063920739208392093921039211392123921339214392153921639217392183921939220392213922239223392243922539226392273922839229392303923139232392333923439235392363923739238392393924039241392423924339244392453924639247392483924939250392513925239253392543925539256392573925839259392603926139262392633926439265392663926739268392693927039271392723927339274392753927639277392783927939280392813928239283392843928539286392873928839289392903929139292392933929439295392963929739298392993930039301393023930339304393053930639307393083930939310393113931239313393143931539316393173931839319393203932139322393233932439325393263932739328393293933039331393323933339334393353933639337393383933939340393413934239343393443934539346393473934839349393503935139352393533935439355393563935739358393593936039361393623936339364393653936639367393683936939370393713937239373393743937539376393773937839379393803938139382393833938439385393863938739388393893939039391393923939339394393953939639397393983939939400394013940239403394043940539406394073940839409394103941139412394133941439415394163941739418394193942039421394223942339424394253942639427394283942939430394313943239433394343943539436394373943839439394403944139442394433944439445394463944739448394493945039451394523945339454394553945639457394583945939460394613946239463394643946539466394673946839469394703947139472394733947439475394763947739478394793948039481394823948339484394853948639487394883948939490394913949239493394943949539496394973949839499395003950139502395033950439505395063950739508395093951039511395123951339514395153951639517395183951939520395213952239523395243952539526395273952839529395303953139532395333953439535395363953739538395393954039541395423954339544395453954639547395483954939550395513955239553395543955539556395573955839559395603956139562395633956439565395663956739568395693957039571395723957339574395753957639577395783957939580395813958239583395843958539586395873958839589395903959139592395933959439595395963959739598395993960039601396023960339604396053960639607396083960939610396113961239613396143961539616396173961839619396203962139622396233962439625396263962739628396293963039631396323963339634396353963639637396383963939640396413964239643396443964539646396473964839649396503965139652396533965439655396563965739658396593966039661396623966339664396653966639667396683966939670396713967239673396743967539676396773967839679396803968139682396833968439685396863968739688396893969039691396923969339694396953969639697396983969939700397013970239703397043970539706397073970839709397103971139712397133971439715397163971739718397193972039721397223972339724397253972639727397283972939730397313973239733397343973539736397373973839739397403974139742397433974439745397463974739748397493975039751397523975339754397553975639757397583975939760397613976239763397643976539766397673976839769397703977139772397733977439775397763977739778397793978039781397823978339784397853978639787397883978939790397913979239793397943979539796397973979839799398003980139802398033980439805398063980739808398093981039811398123981339814398153981639817398183981939820398213982239823398243982539826398273982839829398303983139832398333983439835398363983739838398393984039841398423984339844398453984639847398483984939850398513985239853398543985539856398573985839859398603986139862398633986439865398663986739868398693987039871398723987339874398753987639877398783987939880398813988239883398843988539886398873988839889398903989139892398933989439895398963989739898398993990039901399023990339904399053990639907399083990939910399113991239913399143991539916399173991839919399203992139922399233992439925399263992739928399293993039931399323993339934399353993639937399383993939940399413994239943399443994539946399473994839949399503995139952399533995439955399563995739958399593996039961399623996339964399653996639967399683996939970399713997239973399743997539976399773997839979399803998139982399833998439985399863998739988399893999039991399923999339994399953999639997399983999940000400014000240003400044000540006400074000840009400104001140012400134001440015400164001740018400194002040021400224002340024400254002640027400284002940030400314003240033400344003540036400374003840039400404004140042400434004440045400464004740048400494005040051400524005340054400554005640057400584005940060400614006240063400644006540066400674006840069400704007140072400734007440075400764007740078400794008040081400824008340084400854008640087400884008940090400914009240093400944009540096400974009840099401004010140102401034010440105401064010740108401094011040111401124011340114401154011640117401184011940120401214012240123401244012540126401274012840129401304013140132401334013440135401364013740138401394014040141401424014340144401454014640147401484014940150401514015240153401544015540156401574015840159401604016140162401634016440165401664016740168401694017040171401724017340174401754017640177401784017940180401814018240183401844018540186401874018840189401904019140192401934019440195401964019740198401994020040201402024020340204402054020640207402084020940210402114021240213402144021540216402174021840219402204022140222402234022440225402264022740228402294023040231402324023340234402354023640237402384023940240402414024240243402444024540246402474024840249402504025140252402534025440255402564025740258402594026040261402624026340264402654026640267402684026940270402714027240273402744027540276402774027840279402804028140282402834028440285402864028740288402894029040291402924029340294402954029640297402984029940300403014030240303403044030540306403074030840309403104031140312403134031440315403164031740318403194032040321403224032340324403254032640327403284032940330403314033240333403344033540336403374033840339403404034140342403434034440345403464034740348403494035040351403524035340354403554035640357403584035940360403614036240363403644036540366403674036840369403704037140372403734037440375403764037740378403794038040381403824038340384403854038640387403884038940390403914039240393403944039540396403974039840399404004040140402404034040440405404064040740408404094041040411404124041340414404154041640417404184041940420404214042240423404244042540426404274042840429404304043140432404334043440435404364043740438404394044040441404424044340444404454044640447404484044940450404514045240453404544045540456404574045840459404604046140462404634046440465404664046740468404694047040471404724047340474404754047640477404784047940480404814048240483404844048540486404874048840489404904049140492404934049440495404964049740498404994050040501405024050340504405054050640507405084050940510405114051240513405144051540516405174051840519405204052140522405234052440525405264052740528405294053040531405324053340534405354053640537405384053940540405414054240543405444054540546405474054840549405504055140552405534055440555405564055740558405594056040561405624056340564405654056640567405684056940570405714057240573405744057540576405774057840579405804058140582405834058440585405864058740588405894059040591405924059340594405954059640597405984059940600406014060240603406044060540606406074060840609406104061140612406134061440615406164061740618406194062040621406224062340624406254062640627406284062940630406314063240633406344063540636406374063840639406404064140642406434064440645406464064740648406494065040651406524065340654406554065640657406584065940660406614066240663406644066540666406674066840669406704067140672406734067440675406764067740678406794068040681406824068340684406854068640687406884068940690406914069240693406944069540696406974069840699407004070140702407034070440705407064070740708407094071040711407124071340714407154071640717407184071940720407214072240723407244072540726407274072840729407304073140732407334073440735407364073740738407394074040741407424074340744407454074640747407484074940750407514075240753407544075540756407574075840759407604076140762407634076440765407664076740768407694077040771407724077340774407754077640777407784077940780407814078240783407844078540786407874078840789407904079140792407934079440795407964079740798407994080040801408024080340804408054080640807408084080940810408114081240813408144081540816408174081840819408204082140822408234082440825408264082740828408294083040831408324083340834408354083640837408384083940840408414084240843408444084540846408474084840849408504085140852408534085440855408564085740858408594086040861408624086340864408654086640867408684086940870408714087240873408744087540876408774087840879408804088140882408834088440885408864088740888408894089040891408924089340894408954089640897408984089940900409014090240903409044090540906409074090840909409104091140912409134091440915409164091740918409194092040921409224092340924409254092640927409284092940930409314093240933409344093540936409374093840939409404094140942409434094440945409464094740948409494095040951409524095340954409554095640957409584095940960409614096240963409644096540966409674096840969409704097140972409734097440975409764097740978409794098040981409824098340984409854098640987409884098940990409914099240993409944099540996409974099840999410004100141002410034100441005410064100741008410094101041011410124101341014410154101641017410184101941020410214102241023410244102541026410274102841029410304103141032410334103441035410364103741038410394104041041410424104341044410454104641047410484104941050410514105241053410544105541056410574105841059410604106141062410634106441065410664106741068410694107041071410724107341074410754107641077410784107941080410814108241083410844108541086410874108841089410904109141092410934109441095410964109741098410994110041101411024110341104411054110641107411084110941110411114111241113411144111541116411174111841119411204112141122411234112441125411264112741128411294113041131411324113341134411354113641137411384113941140411414114241143411444114541146411474114841149411504115141152411534115441155411564115741158411594116041161411624116341164411654116641167411684116941170411714117241173411744117541176411774117841179411804118141182411834118441185411864118741188411894119041191411924119341194411954119641197411984119941200412014120241203412044120541206412074120841209412104121141212412134121441215412164121741218412194122041221412224122341224412254122641227412284122941230412314123241233412344123541236412374123841239412404124141242412434124441245412464124741248412494125041251412524125341254412554125641257412584125941260412614126241263412644126541266412674126841269412704127141272412734127441275412764127741278412794128041281412824128341284412854128641287412884128941290412914129241293412944129541296412974129841299413004130141302413034130441305413064130741308413094131041311413124131341314413154131641317413184131941320413214132241323413244132541326413274132841329413304133141332413334133441335413364133741338413394134041341413424134341344413454134641347413484134941350413514135241353413544135541356413574135841359413604136141362413634136441365413664136741368413694137041371413724137341374413754137641377413784137941380413814138241383413844138541386413874138841389413904139141392413934139441395413964139741398413994140041401414024140341404414054140641407414084140941410414114141241413414144141541416414174141841419414204142141422414234142441425414264142741428414294143041431414324143341434414354143641437414384143941440414414144241443414444144541446414474144841449414504145141452414534145441455414564145741458414594146041461414624146341464414654146641467414684146941470414714147241473414744147541476414774147841479414804148141482414834148441485414864148741488414894149041491414924149341494414954149641497414984149941500415014150241503415044150541506415074150841509415104151141512415134151441515415164151741518415194152041521415224152341524415254152641527415284152941530415314153241533415344153541536415374153841539415404154141542415434154441545415464154741548415494155041551415524155341554415554155641557415584155941560415614156241563415644156541566415674156841569415704157141572415734157441575415764157741578415794158041581415824158341584415854158641587415884158941590415914159241593415944159541596415974159841599416004160141602416034160441605416064160741608416094161041611416124161341614416154161641617416184161941620416214162241623416244162541626416274162841629416304163141632416334163441635416364163741638416394164041641416424164341644416454164641647416484164941650416514165241653416544165541656416574165841659416604166141662416634166441665416664166741668416694167041671416724167341674416754167641677416784167941680416814168241683416844168541686416874168841689416904169141692416934169441695416964169741698416994170041701417024170341704417054170641707417084170941710417114171241713417144171541716417174171841719417204172141722417234172441725417264172741728417294173041731417324173341734417354173641737417384173941740417414174241743417444174541746417474174841749417504175141752417534175441755417564175741758417594176041761417624176341764417654176641767417684176941770417714177241773417744177541776417774177841779417804178141782417834178441785417864178741788417894179041791417924179341794417954179641797417984179941800418014180241803418044180541806418074180841809418104181141812418134181441815418164181741818418194182041821418224182341824418254182641827418284182941830418314183241833418344183541836418374183841839418404184141842418434184441845418464184741848418494185041851418524185341854418554185641857418584185941860418614186241863418644186541866418674186841869418704187141872418734187441875418764187741878418794188041881418824188341884418854188641887418884188941890418914189241893418944189541896418974189841899419004190141902419034190441905419064190741908419094191041911419124191341914419154191641917419184191941920419214192241923419244192541926419274192841929419304193141932419334193441935419364193741938419394194041941419424194341944419454194641947419484194941950419514195241953419544195541956419574195841959419604196141962419634196441965419664196741968419694197041971419724197341974419754197641977419784197941980419814198241983419844198541986419874198841989419904199141992419934199441995419964199741998419994200042001420024200342004420054200642007420084200942010420114201242013420144201542016420174201842019420204202142022420234202442025420264202742028420294203042031420324203342034420354203642037420384203942040420414204242043420444204542046420474204842049420504205142052420534205442055420564205742058420594206042061420624206342064420654206642067420684206942070420714207242073420744207542076420774207842079420804208142082420834208442085420864208742088420894209042091420924209342094420954209642097420984209942100421014210242103421044210542106421074210842109421104211142112421134211442115421164211742118421194212042121421224212342124421254212642127421284212942130421314213242133421344213542136421374213842139421404214142142421434214442145421464214742148421494215042151421524215342154421554215642157421584215942160421614216242163421644216542166421674216842169421704217142172421734217442175421764217742178421794218042181421824218342184421854218642187421884218942190421914219242193421944219542196421974219842199422004220142202422034220442205422064220742208422094221042211422124221342214422154221642217422184221942220422214222242223422244222542226422274222842229422304223142232422334223442235422364223742238422394224042241422424224342244422454224642247422484224942250422514225242253422544225542256422574225842259422604226142262422634226442265422664226742268422694227042271422724227342274422754227642277422784227942280422814228242283422844228542286422874228842289422904229142292422934229442295422964229742298422994230042301423024230342304423054230642307423084230942310423114231242313423144231542316423174231842319423204232142322423234232442325423264232742328423294233042331423324233342334423354233642337423384233942340423414234242343423444234542346423474234842349423504235142352423534235442355423564235742358423594236042361423624236342364423654236642367423684236942370423714237242373423744237542376423774237842379423804238142382423834238442385423864238742388423894239042391423924239342394423954239642397423984239942400424014240242403424044240542406424074240842409424104241142412424134241442415424164241742418424194242042421424224242342424424254242642427424284242942430424314243242433424344243542436424374243842439424404244142442424434244442445424464244742448424494245042451424524245342454424554245642457424584245942460424614246242463424644246542466424674246842469424704247142472424734247442475424764247742478424794248042481424824248342484424854248642487424884248942490424914249242493424944249542496424974249842499425004250142502425034250442505425064250742508425094251042511425124251342514425154251642517425184251942520425214252242523425244252542526425274252842529425304253142532425334253442535425364253742538425394254042541425424254342544425454254642547425484254942550425514255242553425544255542556425574255842559425604256142562425634256442565425664256742568425694257042571425724257342574425754257642577425784257942580425814258242583425844258542586425874258842589425904259142592425934259442595425964259742598425994260042601426024260342604426054260642607426084260942610426114261242613426144261542616426174261842619426204262142622426234262442625426264262742628426294263042631426324263342634426354263642637426384263942640426414264242643426444264542646426474264842649426504265142652426534265442655426564265742658426594266042661426624266342664426654266642667426684266942670426714267242673426744267542676426774267842679426804268142682426834268442685426864268742688426894269042691426924269342694426954269642697426984269942700427014270242703427044270542706427074270842709427104271142712427134271442715427164271742718427194272042721427224272342724427254272642727427284272942730427314273242733427344273542736427374273842739427404274142742427434274442745427464274742748427494275042751427524275342754427554275642757427584275942760427614276242763427644276542766427674276842769427704277142772427734277442775427764277742778427794278042781427824278342784427854278642787427884278942790427914279242793427944279542796427974279842799428004280142802428034280442805428064280742808428094281042811428124281342814428154281642817428184281942820428214282242823428244282542826428274282842829428304283142832428334283442835428364283742838428394284042841428424284342844428454284642847428484284942850428514285242853428544285542856428574285842859428604286142862428634286442865428664286742868428694287042871428724287342874428754287642877428784287942880428814288242883428844288542886428874288842889428904289142892428934289442895428964289742898428994290042901429024290342904429054290642907429084290942910429114291242913429144291542916429174291842919429204292142922429234292442925429264292742928429294293042931429324293342934429354293642937429384293942940429414294242943429444294542946429474294842949429504295142952429534295442955429564295742958429594296042961429624296342964429654296642967429684296942970429714297242973429744297542976429774297842979429804298142982429834298442985429864298742988429894299042991429924299342994429954299642997429984299943000430014300243003430044300543006430074300843009430104301143012430134301443015430164301743018430194302043021430224302343024430254302643027430284302943030430314303243033430344303543036430374303843039430404304143042430434304443045430464304743048430494305043051430524305343054430554305643057430584305943060430614306243063430644306543066430674306843069430704307143072430734307443075430764307743078430794308043081430824308343084430854308643087430884308943090430914309243093430944309543096430974309843099431004310143102431034310443105431064310743108431094311043111431124311343114431154311643117431184311943120431214312243123431244312543126431274312843129431304313143132431334313443135431364313743138431394314043141431424314343144431454314643147431484314943150431514315243153431544315543156431574315843159431604316143162431634316443165431664316743168431694317043171431724317343174431754317643177431784317943180431814318243183431844318543186431874318843189431904319143192431934319443195431964319743198431994320043201432024320343204432054320643207432084320943210432114321243213432144321543216432174321843219432204322143222432234322443225432264322743228432294323043231432324323343234432354323643237432384323943240432414324243243432444324543246432474324843249432504325143252432534325443255432564325743258432594326043261432624326343264432654326643267432684326943270432714327243273432744327543276432774327843279432804328143282432834328443285432864328743288432894329043291432924329343294432954329643297432984329943300433014330243303433044330543306433074330843309433104331143312433134331443315433164331743318433194332043321433224332343324433254332643327433284332943330433314333243333433344333543336433374333843339433404334143342433434334443345433464334743348433494335043351433524335343354433554335643357433584335943360433614336243363433644336543366433674336843369433704337143372433734337443375433764337743378433794338043381433824338343384433854338643387433884338943390433914339243393433944339543396433974339843399434004340143402434034340443405434064340743408434094341043411434124341343414434154341643417434184341943420434214342243423434244342543426434274342843429434304343143432434334343443435434364343743438434394344043441434424344343444434454344643447434484344943450434514345243453434544345543456434574345843459434604346143462434634346443465434664346743468434694347043471434724347343474434754347643477434784347943480434814348243483434844348543486434874348843489434904349143492434934349443495434964349743498434994350043501435024350343504435054350643507435084350943510435114351243513435144351543516435174351843519435204352143522435234352443525435264352743528435294353043531435324353343534435354353643537435384353943540435414354243543435444354543546435474354843549435504355143552435534355443555435564355743558435594356043561435624356343564435654356643567435684356943570435714357243573435744357543576435774357843579435804358143582435834358443585435864358743588435894359043591435924359343594435954359643597435984359943600436014360243603436044360543606436074360843609436104361143612436134361443615436164361743618436194362043621436224362343624436254362643627436284362943630436314363243633436344363543636436374363843639436404364143642436434364443645436464364743648436494365043651436524365343654436554365643657436584365943660436614366243663436644366543666436674366843669436704367143672436734367443675436764367743678436794368043681436824368343684436854368643687436884368943690436914369243693436944369543696436974369843699437004370143702437034370443705437064370743708437094371043711437124371343714437154371643717437184371943720437214372243723437244372543726437274372843729437304373143732437334373443735437364373743738437394374043741437424374343744437454374643747437484374943750437514375243753437544375543756437574375843759437604376143762437634376443765437664376743768437694377043771437724377343774437754377643777437784377943780437814378243783437844378543786437874378843789437904379143792437934379443795437964379743798437994380043801438024380343804438054380643807438084380943810438114381243813438144381543816438174381843819438204382143822438234382443825438264382743828438294383043831438324383343834438354383643837438384383943840438414384243843438444384543846438474384843849438504385143852438534385443855438564385743858438594386043861438624386343864438654386643867438684386943870438714387243873438744387543876438774387843879438804388143882438834388443885438864388743888438894389043891438924389343894438954389643897438984389943900439014390243903439044390543906439074390843909439104391143912439134391443915439164391743918439194392043921439224392343924439254392643927439284392943930439314393243933439344393543936439374393843939439404394143942439434394443945439464394743948439494395043951439524395343954439554395643957439584395943960439614396243963439644396543966439674396843969439704397143972439734397443975439764397743978439794398043981439824398343984439854398643987439884398943990439914399243993439944399543996439974399843999440004400144002440034400444005440064400744008440094401044011440124401344014440154401644017440184401944020440214402244023440244402544026440274402844029440304403144032440334403444035440364403744038440394404044041440424404344044440454404644047440484404944050440514405244053440544405544056440574405844059440604406144062440634406444065440664406744068440694407044071440724407344074440754407644077440784407944080440814408244083440844408544086440874408844089440904409144092440934409444095440964409744098440994410044101441024410344104441054410644107441084410944110441114411244113441144411544116441174411844119441204412144122441234412444125441264412744128441294413044131441324413344134441354413644137441384413944140441414414244143441444414544146441474414844149441504415144152441534415444155441564415744158441594416044161441624416344164441654416644167441684416944170441714417244173441744417544176441774417844179441804418144182441834418444185441864418744188441894419044191441924419344194441954419644197441984419944200442014420244203442044420544206442074420844209442104421144212442134421444215442164421744218442194422044221442224422344224442254422644227442284422944230442314423244233442344423544236442374423844239442404424144242442434424444245442464424744248442494425044251442524425344254442554425644257442584425944260442614426244263442644426544266442674426844269442704427144272442734427444275442764427744278442794428044281442824428344284442854428644287442884428944290442914429244293442944429544296442974429844299443004430144302443034430444305443064430744308443094431044311443124431344314443154431644317443184431944320443214432244323443244432544326443274432844329443304433144332443334433444335443364433744338443394434044341443424434344344443454434644347443484434944350443514435244353443544435544356443574435844359443604436144362443634436444365443664436744368443694437044371443724437344374443754437644377443784437944380443814438244383443844438544386443874438844389443904439144392443934439444395443964439744398443994440044401444024440344404444054440644407444084440944410444114441244413444144441544416444174441844419444204442144422444234442444425444264442744428444294443044431444324443344434444354443644437444384443944440444414444244443444444444544446444474444844449444504445144452444534445444455444564445744458444594446044461444624446344464444654446644467444684446944470444714447244473444744447544476444774447844479444804448144482444834448444485444864448744488444894449044491444924449344494444954449644497444984449944500445014450244503445044450544506445074450844509445104451144512445134451444515445164451744518445194452044521445224452344524445254452644527445284452944530445314453244533445344453544536445374453844539445404454144542445434454444545445464454744548445494455044551445524455344554445554455644557445584455944560445614456244563445644456544566445674456844569445704457144572445734457444575445764457744578445794458044581445824458344584445854458644587445884458944590445914459244593445944459544596445974459844599446004460144602446034460444605446064460744608446094461044611446124461344614446154461644617446184461944620446214462244623446244462544626446274462844629446304463144632446334463444635446364463744638446394464044641446424464344644446454464644647446484464944650446514465244653446544465544656446574465844659446604466144662446634466444665446664466744668446694467044671446724467344674446754467644677446784467944680446814468244683446844468544686446874468844689446904469144692446934469444695446964469744698446994470044701447024470344704447054470644707447084470944710447114471244713447144471544716447174471844719447204472144722447234472444725447264472744728447294473044731447324473344734447354473644737447384473944740447414474244743447444474544746447474474844749447504475144752447534475444755447564475744758447594476044761447624476344764447654476644767447684476944770447714477244773447744477544776447774477844779447804478144782447834478444785447864478744788447894479044791447924479344794447954479644797447984479944800448014480244803448044480544806448074480844809448104481144812448134481444815448164481744818448194482044821448224482344824448254482644827448284482944830448314483244833448344483544836448374483844839448404484144842448434484444845448464484744848448494485044851448524485344854448554485644857448584485944860448614486244863448644486544866448674486844869448704487144872448734487444875448764487744878448794488044881448824488344884448854488644887448884488944890448914489244893448944489544896448974489844899449004490144902449034490444905449064490744908449094491044911449124491344914449154491644917449184491944920449214492244923449244492544926449274492844929449304493144932449334493444935449364493744938449394494044941449424494344944449454494644947449484494944950449514495244953449544495544956449574495844959449604496144962449634496444965449664496744968449694497044971449724497344974449754497644977449784497944980449814498244983449844498544986449874498844989449904499144992449934499444995449964499744998449994500045001450024500345004450054500645007450084500945010450114501245013450144501545016450174501845019450204502145022450234502445025450264502745028450294503045031450324503345034450354503645037450384503945040450414504245043450444504545046450474504845049450504505145052450534505445055450564505745058450594506045061450624506345064450654506645067450684506945070450714507245073450744507545076450774507845079450804508145082450834508445085450864508745088450894509045091450924509345094450954509645097450984509945100451014510245103451044510545106451074510845109451104511145112451134511445115451164511745118451194512045121451224512345124451254512645127451284512945130451314513245133451344513545136451374513845139451404514145142451434514445145451464514745148451494515045151451524515345154451554515645157451584515945160451614516245163451644516545166451674516845169451704517145172451734517445175451764517745178451794518045181451824518345184451854518645187451884518945190451914519245193451944519545196451974519845199452004520145202452034520445205452064520745208452094521045211452124521345214452154521645217452184521945220452214522245223452244522545226452274522845229452304523145232452334523445235452364523745238452394524045241452424524345244452454524645247452484524945250452514525245253452544525545256452574525845259452604526145262452634526445265452664526745268452694527045271452724527345274452754527645277452784527945280452814528245283452844528545286452874528845289452904529145292452934529445295452964529745298452994530045301453024530345304453054530645307453084530945310453114531245313453144531545316453174531845319453204532145322453234532445325453264532745328453294533045331453324533345334453354533645337453384533945340453414534245343453444534545346453474534845349453504535145352453534535445355453564535745358453594536045361453624536345364453654536645367453684536945370453714537245373453744537545376453774537845379453804538145382453834538445385453864538745388453894539045391453924539345394453954539645397453984539945400454014540245403454044540545406454074540845409454104541145412454134541445415454164541745418454194542045421454224542345424454254542645427454284542945430454314543245433454344543545436454374543845439454404544145442454434544445445454464544745448454494545045451454524545345454454554545645457454584545945460454614546245463454644546545466454674546845469454704547145472454734547445475454764547745478454794548045481454824548345484454854548645487454884548945490454914549245493454944549545496454974549845499455004550145502455034550445505455064550745508455094551045511455124551345514455154551645517455184551945520455214552245523455244552545526455274552845529455304553145532455334553445535455364553745538455394554045541455424554345544455454554645547455484554945550455514555245553455544555545556455574555845559455604556145562455634556445565455664556745568455694557045571455724557345574455754557645577455784557945580455814558245583455844558545586455874558845589455904559145592455934559445595455964559745598455994560045601456024560345604456054560645607456084560945610456114561245613456144561545616456174561845619456204562145622456234562445625456264562745628456294563045631456324563345634456354563645637456384563945640456414564245643456444564545646456474564845649456504565145652456534565445655456564565745658456594566045661456624566345664456654566645667456684566945670456714567245673456744567545676456774567845679456804568145682456834568445685456864568745688456894569045691456924569345694456954569645697456984569945700457014570245703457044570545706457074570845709457104571145712457134571445715457164571745718457194572045721457224572345724457254572645727457284572945730457314573245733457344573545736457374573845739457404574145742457434574445745457464574745748457494575045751457524575345754457554575645757457584575945760457614576245763457644576545766457674576845769457704577145772457734577445775457764577745778457794578045781457824578345784457854578645787457884578945790457914579245793457944579545796457974579845799458004580145802458034580445805458064580745808458094581045811458124581345814458154581645817458184581945820458214582245823458244582545826458274582845829458304583145832458334583445835458364583745838458394584045841458424584345844458454584645847458484584945850458514585245853458544585545856458574585845859458604586145862458634586445865458664586745868458694587045871458724587345874458754587645877458784587945880458814588245883458844588545886458874588845889458904589145892458934589445895458964589745898458994590045901459024590345904459054590645907459084590945910459114591245913459144591545916459174591845919459204592145922459234592445925459264592745928459294593045931459324593345934459354593645937459384593945940459414594245943459444594545946459474594845949459504595145952459534595445955459564595745958459594596045961459624596345964459654596645967459684596945970459714597245973459744597545976459774597845979459804598145982459834598445985459864598745988459894599045991459924599345994459954599645997459984599946000460014600246003460044600546006460074600846009460104601146012460134601446015460164601746018460194602046021460224602346024460254602646027460284602946030460314603246033460344603546036460374603846039460404604146042460434604446045460464604746048460494605046051460524605346054460554605646057460584605946060460614606246063460644606546066460674606846069460704607146072460734607446075460764607746078460794608046081460824608346084460854608646087460884608946090460914609246093460944609546096460974609846099461004610146102461034610446105461064610746108461094611046111461124611346114461154611646117461184611946120461214612246123461244612546126461274612846129461304613146132461334613446135461364613746138461394614046141461424614346144461454614646147461484614946150461514615246153461544615546156461574615846159461604616146162461634616446165461664616746168461694617046171461724617346174461754617646177461784617946180461814618246183461844618546186461874618846189461904619146192461934619446195461964619746198461994620046201462024620346204462054620646207462084620946210462114621246213462144621546216462174621846219462204622146222462234622446225462264622746228462294623046231462324623346234462354623646237462384623946240462414624246243462444624546246462474624846249462504625146252462534625446255462564625746258462594626046261462624626346264462654626646267462684626946270462714627246273462744627546276462774627846279462804628146282462834628446285462864628746288462894629046291462924629346294462954629646297462984629946300463014630246303463044630546306463074630846309463104631146312463134631446315463164631746318463194632046321463224632346324463254632646327463284632946330463314633246333463344633546336463374633846339463404634146342463434634446345463464634746348463494635046351463524635346354463554635646357463584635946360463614636246363463644636546366463674636846369463704637146372463734637446375463764637746378463794638046381463824638346384463854638646387463884638946390463914639246393463944639546396463974639846399464004640146402464034640446405464064640746408464094641046411464124641346414464154641646417464184641946420464214642246423464244642546426464274642846429464304643146432464334643446435464364643746438464394644046441464424644346444464454644646447464484644946450464514645246453464544645546456464574645846459464604646146462464634646446465464664646746468464694647046471464724647346474464754647646477464784647946480464814648246483464844648546486464874648846489464904649146492464934649446495464964649746498464994650046501465024650346504465054650646507465084650946510465114651246513465144651546516465174651846519465204652146522465234652446525465264652746528465294653046531465324653346534465354653646537465384653946540465414654246543465444654546546465474654846549465504655146552465534655446555465564655746558465594656046561465624656346564465654656646567465684656946570465714657246573465744657546576465774657846579465804658146582465834658446585465864658746588465894659046591465924659346594465954659646597465984659946600466014660246603466044660546606466074660846609466104661146612466134661446615466164661746618466194662046621466224662346624466254662646627466284662946630466314663246633466344663546636466374663846639466404664146642466434664446645466464664746648466494665046651466524665346654466554665646657466584665946660466614666246663466644666546666466674666846669466704667146672466734667446675466764667746678466794668046681466824668346684466854668646687466884668946690466914669246693466944669546696466974669846699467004670146702467034670446705467064670746708467094671046711467124671346714467154671646717467184671946720467214672246723467244672546726467274672846729467304673146732467334673446735467364673746738467394674046741467424674346744467454674646747467484674946750467514675246753467544675546756467574675846759467604676146762467634676446765467664676746768467694677046771467724677346774467754677646777467784677946780467814678246783467844678546786467874678846789467904679146792467934679446795467964679746798467994680046801468024680346804468054680646807468084680946810468114681246813468144681546816468174681846819468204682146822468234682446825468264682746828468294683046831468324683346834468354683646837468384683946840468414684246843468444684546846468474684846849468504685146852468534685446855468564685746858468594686046861468624686346864468654686646867468684686946870468714687246873468744687546876468774687846879468804688146882468834688446885468864688746888468894689046891468924689346894468954689646897468984689946900469014690246903469044690546906469074690846909469104691146912469134691446915469164691746918469194692046921469224692346924469254692646927469284692946930469314693246933469344693546936469374693846939469404694146942469434694446945469464694746948469494695046951469524695346954469554695646957469584695946960469614696246963469644696546966469674696846969469704697146972469734697446975469764697746978469794698046981469824698346984469854698646987469884698946990469914699246993469944699546996469974699846999470004700147002470034700447005470064700747008470094701047011470124701347014470154701647017470184701947020470214702247023470244702547026470274702847029470304703147032470334703447035470364703747038470394704047041470424704347044470454704647047470484704947050470514705247053470544705547056470574705847059470604706147062470634706447065470664706747068470694707047071470724707347074470754707647077470784707947080470814708247083470844708547086470874708847089470904709147092470934709447095470964709747098470994710047101471024710347104471054710647107471084710947110471114711247113471144711547116471174711847119471204712147122471234712447125471264712747128471294713047131471324713347134471354713647137471384713947140471414714247143471444714547146471474714847149471504715147152471534715447155471564715747158471594716047161471624716347164471654716647167471684716947170471714717247173471744717547176471774717847179471804718147182471834718447185471864718747188471894719047191471924719347194471954719647197471984719947200472014720247203472044720547206472074720847209472104721147212472134721447215472164721747218472194722047221472224722347224472254722647227472284722947230472314723247233472344723547236472374723847239472404724147242472434724447245472464724747248472494725047251472524725347254472554725647257472584725947260472614726247263472644726547266472674726847269472704727147272472734727447275472764727747278472794728047281472824728347284472854728647287472884728947290472914729247293472944729547296472974729847299473004730147302473034730447305473064730747308473094731047311473124731347314473154731647317473184731947320473214732247323473244732547326473274732847329473304733147332473334733447335473364733747338473394734047341473424734347344473454734647347473484734947350473514735247353473544735547356473574735847359473604736147362473634736447365473664736747368473694737047371473724737347374473754737647377473784737947380473814738247383473844738547386473874738847389473904739147392473934739447395473964739747398473994740047401474024740347404474054740647407474084740947410474114741247413474144741547416474174741847419474204742147422474234742447425474264742747428474294743047431474324743347434474354743647437474384743947440474414744247443474444744547446474474744847449474504745147452474534745447455474564745747458474594746047461474624746347464474654746647467474684746947470474714747247473474744747547476474774747847479474804748147482474834748447485474864748747488474894749047491474924749347494474954749647497474984749947500475014750247503475044750547506475074750847509475104751147512475134751447515475164751747518475194752047521475224752347524475254752647527475284752947530475314753247533475344753547536475374753847539475404754147542475434754447545475464754747548475494755047551475524755347554475554755647557475584755947560475614756247563475644756547566475674756847569475704757147572475734757447575475764757747578475794758047581475824758347584475854758647587475884758947590475914759247593475944759547596475974759847599476004760147602476034760447605476064760747608476094761047611476124761347614476154761647617476184761947620476214762247623476244762547626476274762847629476304763147632476334763447635476364763747638476394764047641476424764347644476454764647647476484764947650476514765247653476544765547656476574765847659476604766147662476634766447665476664766747668476694767047671476724767347674476754767647677476784767947680476814768247683476844768547686476874768847689476904769147692476934769447695476964769747698476994770047701477024770347704477054770647707477084770947710477114771247713477144771547716477174771847719477204772147722477234772447725477264772747728477294773047731477324773347734477354773647737477384773947740477414774247743477444774547746477474774847749477504775147752477534775447755477564775747758477594776047761477624776347764477654776647767477684776947770477714777247773477744777547776477774777847779477804778147782477834778447785477864778747788477894779047791477924779347794477954779647797477984779947800478014780247803478044780547806478074780847809478104781147812478134781447815478164781747818478194782047821478224782347824478254782647827478284782947830478314783247833478344783547836478374783847839478404784147842478434784447845478464784747848478494785047851478524785347854478554785647857478584785947860478614786247863478644786547866478674786847869478704787147872478734787447875478764787747878478794788047881478824788347884478854788647887478884788947890478914789247893478944789547896478974789847899479004790147902479034790447905479064790747908479094791047911479124791347914479154791647917479184791947920479214792247923479244792547926479274792847929479304793147932479334793447935479364793747938479394794047941479424794347944479454794647947479484794947950479514795247953479544795547956479574795847959479604796147962479634796447965479664796747968479694797047971479724797347974479754797647977479784797947980479814798247983479844798547986479874798847989479904799147992479934799447995479964799747998479994800048001480024800348004480054800648007480084800948010480114801248013480144801548016480174801848019480204802148022480234802448025480264802748028480294803048031480324803348034480354803648037480384803948040480414804248043480444804548046480474804848049480504805148052480534805448055480564805748058480594806048061480624806348064480654806648067480684806948070480714807248073480744807548076480774807848079480804808148082480834808448085480864808748088480894809048091480924809348094480954809648097480984809948100481014810248103481044810548106481074810848109481104811148112481134811448115481164811748118481194812048121481224812348124481254812648127481284812948130481314813248133481344813548136481374813848139481404814148142481434814448145481464814748148481494815048151481524815348154481554815648157481584815948160481614816248163481644816548166481674816848169481704817148172481734817448175481764817748178481794818048181481824818348184481854818648187481884818948190481914819248193481944819548196481974819848199482004820148202482034820448205482064820748208482094821048211482124821348214482154821648217482184821948220482214822248223482244822548226482274822848229482304823148232482334823448235482364823748238482394824048241482424824348244482454824648247482484824948250482514825248253482544825548256482574825848259482604826148262482634826448265482664826748268482694827048271482724827348274482754827648277482784827948280482814828248283482844828548286482874828848289482904829148292482934829448295482964829748298482994830048301483024830348304483054830648307483084830948310483114831248313483144831548316483174831848319483204832148322483234832448325483264832748328483294833048331483324833348334483354833648337483384833948340483414834248343483444834548346483474834848349483504835148352483534835448355483564835748358483594836048361483624836348364483654836648367483684836948370483714837248373483744837548376483774837848379483804838148382483834838448385483864838748388483894839048391483924839348394483954839648397483984839948400484014840248403484044840548406484074840848409484104841148412484134841448415484164841748418484194842048421484224842348424484254842648427484284842948430484314843248433484344843548436484374843848439484404844148442484434844448445484464844748448484494845048451484524845348454484554845648457484584845948460484614846248463484644846548466484674846848469484704847148472484734847448475484764847748478484794848048481484824848348484484854848648487484884848948490484914849248493484944849548496484974849848499485004850148502485034850448505485064850748508485094851048511485124851348514485154851648517485184851948520485214852248523485244852548526485274852848529485304853148532485334853448535485364853748538485394854048541485424854348544485454854648547485484854948550485514855248553485544855548556485574855848559485604856148562485634856448565485664856748568485694857048571485724857348574485754857648577485784857948580485814858248583485844858548586485874858848589485904859148592485934859448595485964859748598485994860048601486024860348604486054860648607486084860948610486114861248613486144861548616486174861848619486204862148622486234862448625486264862748628486294863048631486324863348634486354863648637486384863948640486414864248643486444864548646486474864848649486504865148652486534865448655486564865748658486594866048661486624866348664486654866648667486684866948670486714867248673486744867548676486774867848679486804868148682486834868448685486864868748688486894869048691486924869348694486954869648697486984869948700487014870248703487044870548706487074870848709487104871148712487134871448715487164871748718487194872048721487224872348724487254872648727487284872948730487314873248733487344873548736487374873848739487404874148742487434874448745487464874748748487494875048751487524875348754487554875648757487584875948760487614876248763487644876548766487674876848769487704877148772487734877448775487764877748778487794878048781487824878348784487854878648787487884878948790487914879248793487944879548796487974879848799488004880148802488034880448805488064880748808488094881048811488124881348814488154881648817488184881948820488214882248823488244882548826488274882848829488304883148832488334883448835488364883748838488394884048841488424884348844488454884648847488484884948850488514885248853488544885548856488574885848859488604886148862488634886448865488664886748868488694887048871488724887348874488754887648877488784887948880488814888248883488844888548886488874888848889488904889148892488934889448895488964889748898488994890048901489024890348904489054890648907489084890948910489114891248913489144891548916489174891848919489204892148922489234892448925489264892748928489294893048931489324893348934489354893648937489384893948940489414894248943489444894548946489474894848949489504895148952489534895448955489564895748958489594896048961489624896348964489654896648967489684896948970489714897248973489744897548976489774897848979489804898148982489834898448985489864898748988489894899048991489924899348994489954899648997489984899949000490014900249003490044900549006490074900849009490104901149012490134901449015490164901749018490194902049021490224902349024490254902649027490284902949030490314903249033490344903549036490374903849039490404904149042490434904449045490464904749048490494905049051490524905349054490554905649057490584905949060490614906249063490644906549066490674906849069490704907149072490734907449075490764907749078490794908049081490824908349084490854908649087490884908949090490914909249093490944909549096490974909849099491004910149102491034910449105491064910749108491094911049111491124911349114491154911649117491184911949120491214912249123491244912549126491274912849129491304913149132491334913449135491364913749138491394914049141491424914349144491454914649147491484914949150491514915249153491544915549156491574915849159491604916149162491634916449165491664916749168491694917049171491724917349174491754917649177491784917949180491814918249183491844918549186491874918849189491904919149192491934919449195491964919749198491994920049201492024920349204492054920649207492084920949210492114921249213492144921549216492174921849219492204922149222492234922449225492264922749228492294923049231492324923349234492354923649237492384923949240492414924249243492444924549246492474924849249492504925149252492534925449255492564925749258492594926049261492624926349264492654926649267492684926949270492714927249273492744927549276492774927849279492804928149282492834928449285492864928749288492894929049291492924929349294492954929649297492984929949300493014930249303493044930549306493074930849309493104931149312493134931449315493164931749318493194932049321493224932349324493254932649327493284932949330493314933249333493344933549336493374933849339493404934149342493434934449345493464934749348493494935049351493524935349354493554935649357493584935949360493614936249363493644936549366493674936849369493704937149372493734937449375493764937749378493794938049381493824938349384493854938649387493884938949390493914939249393493944939549396493974939849399494004940149402494034940449405494064940749408494094941049411494124941349414494154941649417494184941949420494214942249423494244942549426494274942849429494304943149432494334943449435494364943749438494394944049441494424944349444494454944649447494484944949450494514945249453494544945549456494574945849459494604946149462494634946449465494664946749468494694947049471494724947349474494754947649477494784947949480494814948249483494844948549486494874948849489494904949149492494934949449495494964949749498494994950049501495024950349504495054950649507495084950949510495114951249513495144951549516495174951849519495204952149522495234952449525495264952749528495294953049531495324953349534495354953649537495384953949540495414954249543495444954549546495474954849549495504955149552495534955449555495564955749558495594956049561495624956349564495654956649567495684956949570495714957249573495744957549576495774957849579495804958149582495834958449585495864958749588495894959049591495924959349594495954959649597495984959949600496014960249603496044960549606496074960849609496104961149612496134961449615496164961749618496194962049621496224962349624496254962649627496284962949630496314963249633496344963549636496374963849639496404964149642496434964449645496464964749648496494965049651496524965349654496554965649657496584965949660496614966249663496644966549666496674966849669496704967149672496734967449675496764967749678496794968049681496824968349684496854968649687496884968949690496914969249693496944969549696496974969849699497004970149702497034970449705497064970749708497094971049711497124971349714497154971649717497184971949720497214972249723497244972549726497274972849729497304973149732497334973449735497364973749738497394974049741497424974349744497454974649747497484974949750497514975249753497544975549756497574975849759497604976149762497634976449765497664976749768497694977049771497724977349774497754977649777497784977949780497814978249783497844978549786497874978849789497904979149792497934979449795497964979749798497994980049801498024980349804498054980649807498084980949810498114981249813498144981549816498174981849819498204982149822498234982449825498264982749828498294983049831498324983349834498354983649837498384983949840498414984249843498444984549846498474984849849498504985149852498534985449855498564985749858498594986049861498624986349864498654986649867498684986949870498714987249873498744987549876498774987849879498804988149882498834988449885498864988749888498894989049891498924989349894498954989649897498984989949900499014990249903499044990549906499074990849909499104991149912499134991449915499164991749918499194992049921499224992349924499254992649927499284992949930499314993249933499344993549936499374993849939499404994149942499434994449945499464994749948499494995049951499524995349954499554995649957499584995949960499614996249963499644996549966499674996849969499704997149972499734997449975499764997749978499794998049981499824998349984499854998649987499884998949990499914999249993499944999549996499974999849999500005000150002500035000450005500065000750008500095001050011500125001350014500155001650017500185001950020500215002250023500245002550026500275002850029500305003150032500335003450035500365003750038500395004050041500425004350044500455004650047500485004950050500515005250053500545005550056500575005850059500605006150062500635006450065500665006750068500695007050071500725007350074500755007650077500785007950080500815008250083500845008550086500875008850089500905009150092500935009450095500965009750098500995010050101501025010350104501055010650107501085010950110501115011250113501145011550116501175011850119501205012150122501235012450125501265012750128501295013050131501325013350134501355013650137501385013950140501415014250143501445014550146501475014850149501505015150152501535015450155501565015750158501595016050161501625016350164501655016650167501685016950170501715017250173501745017550176501775017850179501805018150182501835018450185501865018750188501895019050191501925019350194501955019650197501985019950200502015020250203502045020550206502075020850209502105021150212502135021450215502165021750218502195022050221502225022350224502255022650227502285022950230502315023250233502345023550236502375023850239502405024150242502435024450245502465024750248502495025050251502525025350254502555025650257502585025950260502615026250263502645026550266502675026850269502705027150272502735027450275502765027750278502795028050281502825028350284502855028650287502885028950290502915029250293502945029550296502975029850299503005030150302503035030450305503065030750308503095031050311503125031350314503155031650317503185031950320503215032250323503245032550326503275032850329503305033150332503335033450335503365033750338503395034050341503425034350344503455034650347503485034950350503515035250353503545035550356503575035850359503605036150362503635036450365503665036750368503695037050371503725037350374503755037650377503785037950380503815038250383503845038550386503875038850389503905039150392503935039450395503965039750398503995040050401504025040350404504055040650407504085040950410504115041250413504145041550416504175041850419504205042150422504235042450425504265042750428504295043050431504325043350434504355043650437504385043950440504415044250443504445044550446504475044850449504505045150452504535045450455504565045750458504595046050461504625046350464504655046650467504685046950470504715047250473504745047550476504775047850479504805048150482504835048450485504865048750488504895049050491504925049350494504955049650497504985049950500505015050250503505045050550506505075050850509505105051150512505135051450515505165051750518505195052050521505225052350524505255052650527505285052950530505315053250533505345053550536505375053850539505405054150542505435054450545505465054750548505495055050551505525055350554505555055650557505585055950560505615056250563505645056550566505675056850569505705057150572505735057450575505765057750578505795058050581505825058350584505855058650587505885058950590505915059250593505945059550596505975059850599506005060150602506035060450605506065060750608506095061050611506125061350614506155061650617506185061950620506215062250623506245062550626506275062850629506305063150632506335063450635506365063750638506395064050641506425064350644506455064650647506485064950650506515065250653506545065550656506575065850659506605066150662506635066450665506665066750668506695067050671506725067350674506755067650677506785067950680506815068250683506845068550686506875068850689506905069150692506935069450695506965069750698506995070050701507025070350704507055070650707507085070950710507115071250713507145071550716507175071850719507205072150722507235072450725507265072750728507295073050731507325073350734507355073650737507385073950740507415074250743507445074550746507475074850749507505075150752507535075450755507565075750758507595076050761507625076350764507655076650767507685076950770507715077250773507745077550776507775077850779507805078150782507835078450785507865078750788507895079050791507925079350794507955079650797507985079950800508015080250803508045080550806508075080850809508105081150812508135081450815508165081750818508195082050821508225082350824508255082650827508285082950830508315083250833508345083550836508375083850839508405084150842508435084450845508465084750848508495085050851508525085350854508555085650857508585085950860508615086250863508645086550866508675086850869508705087150872508735087450875508765087750878508795088050881508825088350884508855088650887508885088950890508915089250893508945089550896508975089850899509005090150902509035090450905509065090750908509095091050911509125091350914509155091650917509185091950920509215092250923509245092550926509275092850929509305093150932509335093450935509365093750938509395094050941509425094350944509455094650947509485094950950509515095250953509545095550956509575095850959509605096150962509635096450965509665096750968509695097050971509725097350974509755097650977509785097950980509815098250983509845098550986509875098850989509905099150992509935099450995509965099750998509995100051001510025100351004510055100651007510085100951010510115101251013510145101551016510175101851019510205102151022510235102451025510265102751028510295103051031510325103351034510355103651037510385103951040510415104251043510445104551046510475104851049510505105151052510535105451055510565105751058510595106051061510625106351064510655106651067510685106951070510715107251073510745107551076510775107851079510805108151082510835108451085510865108751088510895109051091510925109351094510955109651097510985109951100511015110251103511045110551106511075110851109511105111151112511135111451115511165111751118511195112051121511225112351124511255112651127511285112951130511315113251133511345113551136511375113851139511405114151142511435114451145511465114751148511495115051151511525115351154511555115651157511585115951160511615116251163511645116551166511675116851169511705117151172511735117451175511765117751178511795118051181511825118351184511855118651187511885118951190511915119251193511945119551196511975119851199512005120151202512035120451205512065120751208512095121051211512125121351214512155121651217512185121951220512215122251223512245122551226512275122851229512305123151232512335123451235512365123751238512395124051241512425124351244512455124651247512485124951250512515125251253512545125551256512575125851259512605126151262512635126451265512665126751268512695127051271512725127351274512755127651277512785127951280512815128251283512845128551286512875128851289512905129151292512935129451295512965129751298512995130051301513025130351304513055130651307513085130951310513115131251313513145131551316513175131851319513205132151322513235132451325513265132751328513295133051331513325133351334513355133651337513385133951340513415134251343513445134551346513475134851349513505135151352513535135451355513565135751358513595136051361513625136351364513655136651367513685136951370513715137251373513745137551376513775137851379513805138151382513835138451385513865138751388513895139051391513925139351394513955139651397513985139951400514015140251403514045140551406514075140851409514105141151412514135141451415514165141751418514195142051421514225142351424514255142651427514285142951430514315143251433514345143551436514375143851439514405144151442514435144451445514465144751448514495145051451514525145351454514555145651457514585145951460514615146251463514645146551466514675146851469514705147151472514735147451475514765147751478514795148051481514825148351484514855148651487514885148951490514915149251493514945149551496514975149851499515005150151502515035150451505515065150751508515095151051511515125151351514515155151651517515185151951520515215152251523515245152551526515275152851529515305153151532515335153451535515365153751538515395154051541515425154351544515455154651547515485154951550515515155251553515545155551556515575155851559515605156151562515635156451565515665156751568515695157051571515725157351574515755157651577515785157951580515815158251583515845158551586515875158851589515905159151592515935159451595515965159751598515995160051601516025160351604516055160651607516085160951610516115161251613516145161551616516175161851619516205162151622516235162451625516265162751628516295163051631516325163351634516355163651637516385163951640516415164251643516445164551646516475164851649516505165151652516535165451655516565165751658516595166051661516625166351664516655166651667516685166951670516715167251673516745167551676516775167851679516805168151682516835168451685516865168751688516895169051691516925169351694516955169651697516985169951700517015170251703517045170551706517075170851709517105171151712517135171451715517165171751718517195172051721517225172351724517255172651727517285172951730517315173251733517345173551736517375173851739517405174151742517435174451745517465174751748517495175051751517525175351754517555175651757517585175951760517615176251763517645176551766517675176851769517705177151772517735177451775517765177751778517795178051781517825178351784517855178651787517885178951790517915179251793517945179551796517975179851799518005180151802518035180451805518065180751808518095181051811518125181351814518155181651817518185181951820518215182251823518245182551826518275182851829518305183151832518335183451835518365183751838518395184051841518425184351844518455184651847518485184951850518515185251853518545185551856518575185851859518605186151862518635186451865518665186751868518695187051871518725187351874518755187651877518785187951880518815188251883518845188551886518875188851889518905189151892518935189451895518965189751898518995190051901519025190351904519055190651907519085190951910519115191251913519145191551916519175191851919519205192151922519235192451925519265192751928519295193051931519325193351934519355193651937519385193951940519415194251943519445194551946519475194851949519505195151952519535195451955519565195751958519595196051961519625196351964519655196651967519685196951970519715197251973519745197551976519775197851979519805198151982519835198451985519865198751988519895199051991519925199351994519955199651997519985199952000520015200252003520045200552006520075200852009520105201152012520135201452015520165201752018520195202052021520225202352024520255202652027520285202952030520315203252033520345203552036520375203852039520405204152042520435204452045520465204752048520495205052051520525205352054520555205652057520585205952060520615206252063520645206552066520675206852069520705207152072520735207452075520765207752078520795208052081520825208352084520855208652087520885208952090520915209252093520945209552096520975209852099521005210152102521035210452105521065210752108521095211052111521125211352114521155211652117521185211952120521215212252123521245212552126521275212852129521305213152132521335213452135521365213752138521395214052141521425214352144521455214652147521485214952150521515215252153521545215552156521575215852159521605216152162521635216452165521665216752168521695217052171521725217352174521755217652177521785217952180521815218252183521845218552186521875218852189521905219152192521935219452195521965219752198521995220052201522025220352204522055220652207522085220952210522115221252213522145221552216522175221852219522205222152222522235222452225522265222752228522295223052231522325223352234522355223652237522385223952240522415224252243522445224552246522475224852249522505225152252522535225452255522565225752258522595226052261522625226352264522655226652267522685226952270522715227252273522745227552276522775227852279522805228152282522835228452285522865228752288522895229052291522925229352294522955229652297522985229952300523015230252303523045230552306523075230852309523105231152312523135231452315523165231752318523195232052321523225232352324523255232652327523285232952330523315233252333523345233552336523375233852339523405234152342523435234452345523465234752348523495235052351523525235352354523555235652357523585235952360523615236252363523645236552366523675236852369523705237152372523735237452375523765237752378523795238052381523825238352384523855238652387523885238952390523915239252393523945239552396523975239852399524005240152402524035240452405524065240752408524095241052411524125241352414524155241652417524185241952420524215242252423524245242552426524275242852429524305243152432524335243452435524365243752438524395244052441524425244352444524455244652447524485244952450524515245252453524545245552456524575245852459524605246152462524635246452465524665246752468524695247052471524725247352474524755247652477524785247952480524815248252483524845248552486524875248852489524905249152492524935249452495524965249752498524995250052501525025250352504525055250652507525085250952510525115251252513525145251552516525175251852519525205252152522525235252452525525265252752528525295253052531525325253352534525355253652537525385253952540525415254252543525445254552546525475254852549525505255152552525535255452555525565255752558525595256052561525625256352564525655256652567525685256952570525715257252573525745257552576525775257852579525805258152582525835258452585525865258752588525895259052591525925259352594525955259652597525985259952600526015260252603526045260552606526075260852609526105261152612526135261452615526165261752618526195262052621526225262352624526255262652627526285262952630526315263252633526345263552636526375263852639526405264152642526435264452645526465264752648526495265052651526525265352654526555265652657526585265952660526615266252663526645266552666526675266852669526705267152672526735267452675526765267752678526795268052681526825268352684526855268652687526885268952690526915269252693526945269552696526975269852699527005270152702527035270452705527065270752708527095271052711527125271352714527155271652717527185271952720527215272252723527245272552726527275272852729527305273152732527335273452735527365273752738527395274052741527425274352744527455274652747527485274952750527515275252753527545275552756527575275852759527605276152762527635276452765527665276752768527695277052771527725277352774527755277652777527785277952780527815278252783527845278552786527875278852789527905279152792527935279452795527965279752798527995280052801528025280352804528055280652807528085280952810528115281252813528145281552816528175281852819528205282152822528235282452825528265282752828528295283052831528325283352834528355283652837528385283952840528415284252843528445284552846528475284852849528505285152852528535285452855528565285752858528595286052861528625286352864528655286652867528685286952870528715287252873528745287552876528775287852879528805288152882528835288452885528865288752888528895289052891528925289352894528955289652897528985289952900529015290252903529045290552906529075290852909529105291152912529135291452915529165291752918529195292052921529225292352924529255292652927529285292952930529315293252933529345293552936529375293852939529405294152942529435294452945529465294752948529495295052951529525295352954529555295652957529585295952960529615296252963529645296552966529675296852969529705297152972529735297452975529765297752978529795298052981529825298352984529855298652987529885298952990529915299252993529945299552996529975299852999530005300153002530035300453005530065300753008530095301053011530125301353014530155301653017530185301953020530215302253023530245302553026530275302853029530305303153032530335303453035530365303753038530395304053041530425304353044530455304653047530485304953050530515305253053530545305553056530575305853059530605306153062530635306453065530665306753068530695307053071530725307353074530755307653077530785307953080530815308253083530845308553086530875308853089530905309153092530935309453095530965309753098530995310053101531025310353104531055310653107531085310953110531115311253113531145311553116531175311853119531205312153122531235312453125531265312753128531295313053131531325313353134531355313653137531385313953140531415314253143531445314553146531475314853149531505315153152531535315453155531565315753158531595316053161531625316353164531655316653167531685316953170531715317253173531745317553176531775317853179531805318153182531835318453185531865318753188531895319053191531925319353194531955319653197531985319953200532015320253203532045320553206532075320853209532105321153212532135321453215532165321753218532195322053221532225322353224532255322653227532285322953230532315323253233532345323553236532375323853239532405324153242532435324453245532465324753248532495325053251532525325353254532555325653257532585325953260532615326253263532645326553266532675326853269532705327153272532735327453275532765327753278532795328053281532825328353284532855328653287532885328953290532915329253293532945329553296532975329853299533005330153302533035330453305533065330753308533095331053311533125331353314533155331653317533185331953320533215332253323533245332553326533275332853329533305333153332533335333453335533365333753338533395334053341533425334353344533455334653347533485334953350533515335253353533545335553356533575335853359533605336153362533635336453365533665336753368533695337053371533725337353374533755337653377533785337953380533815338253383533845338553386533875338853389533905339153392533935339453395533965339753398533995340053401534025340353404534055340653407534085340953410534115341253413534145341553416534175341853419534205342153422534235342453425534265342753428534295343053431534325343353434534355343653437534385343953440534415344253443534445344553446534475344853449534505345153452534535345453455534565345753458534595346053461534625346353464534655346653467534685346953470534715347253473534745347553476534775347853479534805348153482534835348453485534865348753488534895349053491534925349353494534955349653497534985349953500535015350253503535045350553506535075350853509535105351153512535135351453515535165351753518535195352053521535225352353524535255352653527535285352953530535315353253533535345353553536535375353853539535405354153542535435354453545535465354753548535495355053551535525355353554535555355653557535585355953560535615356253563535645356553566535675356853569535705357153572535735357453575535765357753578535795358053581535825358353584535855358653587535885358953590535915359253593535945359553596535975359853599536005360153602536035360453605536065360753608536095361053611536125361353614536155361653617536185361953620536215362253623536245362553626536275362853629536305363153632536335363453635536365363753638536395364053641536425364353644536455364653647536485364953650536515365253653536545365553656536575365853659536605366153662536635366453665536665366753668536695367053671536725367353674536755367653677536785367953680536815368253683536845368553686536875368853689536905369153692536935369453695536965369753698536995370053701537025370353704537055370653707537085370953710537115371253713537145371553716537175371853719537205372153722537235372453725537265372753728537295373053731537325373353734537355373653737537385373953740537415374253743537445374553746537475374853749537505375153752537535375453755537565375753758537595376053761537625376353764537655376653767537685376953770537715377253773537745377553776537775377853779537805378153782537835378453785537865378753788537895379053791537925379353794537955379653797537985379953800538015380253803538045380553806538075380853809538105381153812538135381453815538165381753818538195382053821538225382353824538255382653827538285382953830538315383253833538345383553836538375383853839538405384153842538435384453845538465384753848538495385053851538525385353854538555385653857538585385953860538615386253863538645386553866538675386853869538705387153872538735387453875538765387753878538795388053881538825388353884538855388653887538885388953890538915389253893538945389553896538975389853899539005390153902539035390453905539065390753908539095391053911539125391353914539155391653917539185391953920539215392253923539245392553926539275392853929539305393153932539335393453935539365393753938539395394053941539425394353944539455394653947539485394953950539515395253953539545395553956539575395853959539605396153962539635396453965539665396753968539695397053971539725397353974539755397653977539785397953980539815398253983539845398553986539875398853989539905399153992539935399453995539965399753998539995400054001540025400354004540055400654007540085400954010540115401254013540145401554016540175401854019540205402154022540235402454025540265402754028540295403054031540325403354034540355403654037540385403954040540415404254043540445404554046540475404854049540505405154052540535405454055540565405754058540595406054061540625406354064540655406654067540685406954070540715407254073540745407554076540775407854079540805408154082540835408454085540865408754088540895409054091540925409354094540955409654097540985409954100541015410254103541045410554106541075410854109541105411154112541135411454115541165411754118541195412054121541225412354124541255412654127541285412954130541315413254133541345413554136541375413854139541405414154142541435414454145541465414754148541495415054151541525415354154541555415654157541585415954160541615416254163541645416554166541675416854169541705417154172541735417454175541765417754178541795418054181541825418354184541855418654187541885418954190541915419254193541945419554196541975419854199542005420154202542035420454205542065420754208542095421054211542125421354214542155421654217542185421954220542215422254223542245422554226542275422854229542305423154232542335423454235542365423754238542395424054241542425424354244542455424654247542485424954250542515425254253542545425554256542575425854259542605426154262542635426454265542665426754268542695427054271542725427354274542755427654277542785427954280542815428254283542845428554286542875428854289542905429154292542935429454295542965429754298542995430054301543025430354304543055430654307543085430954310543115431254313543145431554316543175431854319543205432154322543235432454325543265432754328543295433054331543325433354334543355433654337543385433954340543415434254343543445434554346543475434854349543505435154352543535435454355543565435754358543595436054361543625436354364543655436654367543685436954370543715437254373543745437554376543775437854379543805438154382543835438454385543865438754388543895439054391543925439354394543955439654397543985439954400544015440254403544045440554406544075440854409544105441154412544135441454415544165441754418544195442054421544225442354424544255442654427544285442954430544315443254433544345443554436544375443854439544405444154442544435444454445544465444754448544495445054451544525445354454544555445654457544585445954460544615446254463544645446554466544675446854469544705447154472544735447454475544765447754478544795448054481544825448354484544855448654487544885448954490544915449254493544945449554496544975449854499545005450154502545035450454505545065450754508545095451054511545125451354514545155451654517545185451954520545215452254523545245452554526545275452854529545305453154532545335453454535545365453754538545395454054541545425454354544545455454654547545485454954550545515455254553545545455554556545575455854559545605456154562545635456454565545665456754568545695457054571545725457354574545755457654577545785457954580545815458254583545845458554586545875458854589545905459154592545935459454595545965459754598545995460054601546025460354604546055460654607546085460954610546115461254613546145461554616546175461854619546205462154622546235462454625546265462754628546295463054631546325463354634546355463654637546385463954640546415464254643546445464554646546475464854649546505465154652546535465454655546565465754658546595466054661546625466354664546655466654667546685466954670546715467254673546745467554676546775467854679546805468154682546835468454685546865468754688546895469054691546925469354694546955469654697546985469954700547015470254703547045470554706547075470854709547105471154712547135471454715547165471754718547195472054721547225472354724547255472654727547285472954730547315473254733547345473554736547375473854739547405474154742547435474454745547465474754748547495475054751547525475354754547555475654757547585475954760547615476254763547645476554766547675476854769547705477154772547735477454775547765477754778547795478054781547825478354784547855478654787547885478954790547915479254793547945479554796547975479854799548005480154802548035480454805548065480754808548095481054811548125481354814548155481654817548185481954820548215482254823548245482554826548275482854829548305483154832548335483454835548365483754838548395484054841548425484354844548455484654847548485484954850548515485254853548545485554856548575485854859548605486154862548635486454865548665486754868548695487054871548725487354874548755487654877548785487954880548815488254883548845488554886548875488854889548905489154892548935489454895548965489754898548995490054901549025490354904549055490654907549085490954910549115491254913549145491554916549175491854919549205492154922549235492454925549265492754928549295493054931549325493354934549355493654937549385493954940549415494254943549445494554946549475494854949549505495154952549535495454955549565495754958549595496054961549625496354964549655496654967549685496954970549715497254973549745497554976549775497854979549805498154982549835498454985549865498754988549895499054991549925499354994549955499654997549985499955000550015500255003550045500555006550075500855009550105501155012550135501455015550165501755018550195502055021550225502355024550255502655027550285502955030550315503255033550345503555036550375503855039550405504155042550435504455045550465504755048550495505055051550525505355054550555505655057550585505955060550615506255063550645506555066550675506855069550705507155072550735507455075550765507755078550795508055081550825508355084550855508655087550885508955090550915509255093550945509555096550975509855099551005510155102551035510455105551065510755108551095511055111551125511355114551155511655117551185511955120551215512255123551245512555126551275512855129551305513155132551335513455135551365513755138551395514055141551425514355144551455514655147551485514955150551515515255153551545515555156551575515855159551605516155162551635516455165551665516755168551695517055171551725517355174551755517655177551785517955180551815518255183551845518555186551875518855189551905519155192551935519455195551965519755198551995520055201552025520355204552055520655207552085520955210552115521255213552145521555216552175521855219552205522155222552235522455225552265522755228552295523055231552325523355234552355523655237552385523955240552415524255243552445524555246552475524855249552505525155252552535525455255552565525755258552595526055261552625526355264552655526655267552685526955270552715527255273552745527555276552775527855279552805528155282552835528455285552865528755288552895529055291552925529355294552955529655297552985529955300553015530255303553045530555306553075530855309553105531155312553135531455315553165531755318553195532055321553225532355324553255532655327553285532955330553315533255333553345533555336553375533855339553405534155342553435534455345553465534755348553495535055351553525535355354553555535655357553585535955360553615536255363553645536555366553675536855369553705537155372553735537455375553765537755378553795538055381553825538355384553855538655387553885538955390553915539255393553945539555396553975539855399554005540155402554035540455405554065540755408554095541055411554125541355414554155541655417554185541955420554215542255423554245542555426554275542855429554305543155432554335543455435554365543755438554395544055441554425544355444554455544655447554485544955450554515545255453554545545555456554575545855459554605546155462554635546455465554665546755468554695547055471554725547355474554755547655477554785547955480554815548255483554845548555486554875548855489554905549155492554935549455495554965549755498554995550055501555025550355504555055550655507555085550955510555115551255513555145551555516555175551855519555205552155522555235552455525555265552755528555295553055531555325553355534555355553655537555385553955540555415554255543555445554555546555475554855549555505555155552555535555455555555565555755558555595556055561555625556355564555655556655567555685556955570555715557255573555745557555576555775557855579555805558155582555835558455585555865558755588555895559055591555925559355594555955559655597555985559955600556015560255603556045560555606556075560855609556105561155612556135561455615556165561755618556195562055621556225562355624556255562655627556285562955630556315563255633556345563555636556375563855639556405564155642556435564455645556465564755648556495565055651556525565355654556555565655657556585565955660556615566255663556645566555666556675566855669556705567155672556735567455675556765567755678556795568055681556825568355684556855568655687556885568955690556915569255693
  1. /* 许钟文修改的 标记 xzw
  2. 另外 所有"matter"字样已被我删除 原因:删除matterport信息
  3. */
  4. //czj 添加随机的时间
  5. function randomTime(){
  6. return new Date()
  7. }
  8. !function() {
  9. "use strict";
  10. function t(t, i) {
  11. return typeof t === i
  12. }
  13. function i(t, i) {
  14. return t instanceof i
  15. }
  16. function n(t) {
  17. return t && t.nodeType
  18. }
  19. function e(t) {
  20. return n(t) ? t : i(t, g) ? t[0] : void 0
  21. }
  22. function o(t, i, n) {
  23. return g.each(t, function(t, e) {
  24. n = i.call(e, n, t, e)
  25. }),
  26. n
  27. }
  28. function r(t, i, n) {
  29. var e, o, r;
  30. if (t === i)
  31. return !0;
  32. if (!t || !i || t.constructor !== i.constructor)
  33. return !1;
  34. for (e = 0,
  35. o = n.length; o > e; e += 1) {
  36. if (r = n[e],
  37. t[r] && y(t[r].equals) && !t[r].equals(i[r]))
  38. return !1;
  39. if (t[r] !== i[r])
  40. return !1
  41. }
  42. return !0
  43. }
  44. function s(t, i, n, e) {
  45. this.left = E(t),
  46. this.top = E(i),
  47. this.width = E(n),
  48. this.height = E(e),
  49. this.right = this.left + this.width,
  50. this.bottom = this.top + this.height
  51. }
  52. function h(t, i, n, e) {
  53. this.visible = t || 0,
  54. this.viewport = i || 0,
  55. this.possible = n || 0,
  56. this.rects = e && T({}, e) || null
  57. }
  58. function l(t, i) {
  59. this.els = t,
  60. this.viewport = i
  61. }
  62. function c(t, i, n) {
  63. var e;
  64. return g.inArray(n, q) >= 0 ? e = s.ofElement(t) : g.inArray(n, S) >= 0 && (e = h.of(t, i)),
  65. e ? e[n] : 0
  66. }
  67. function u(t, i) {
  68. return t.val - i.val
  69. }
  70. function a(t, i) {
  71. return i.val - t.val
  72. }
  73. function f(t) {
  74. var i = s.ofContent(t, !0)
  75. , n = s.ofViewport(t, !0)
  76. , e = i.width - n.width
  77. , o = i.height - n.height;
  78. this.content = i,
  79. this.viewport = n,
  80. this.width = 0 >= e ? null : n.left / e,
  81. this.height = 0 >= o ? null : n.top / o,
  82. this.left = n.left,
  83. this.top = n.top,
  84. this.right = i.right - n.right,
  85. this.bottom = i.bottom - n.bottom
  86. }
  87. function p(t) {
  88. this.el = t || window
  89. }
  90. function d(t, i) {
  91. this.context = t,
  92. this.viewport = i,
  93. this.init()
  94. }
  95. function v(t, i, n, e) {
  96. this.context = new l(t,i),
  97. this.property = n,
  98. this.descending = e,
  99. this.init()
  100. }
  101. function w(t) {
  102. t && t !== window && t !== document ? (this.context = t,
  103. this.$autoTarget = g(t)) : this.context = window,
  104. this.init()
  105. }
  106. var g = jQuery
  107. , m = g(window)
  108. , b = g(document)
  109. , T = g.extend
  110. , y = g.isFunction
  111. , k = Math.max
  112. , V = Math.min
  113. , E = Math.round
  114. , x = function() {
  115. var t = {}
  116. , i = 1;
  117. return function(n) {
  118. return n ? (t[n] || (t[n] = i,
  119. i += 1),
  120. t[n]) : 0
  121. }
  122. }();
  123. T(s.prototype, {
  124. equals: function(t) {
  125. return r(this, t, ["left", "top", "width", "height"])
  126. },
  127. area: function() {
  128. return this.width * this.height
  129. },
  130. relativeTo: function(t) {
  131. return new s(this.left - t.left,this.top - t.top,this.width,this.height)
  132. },
  133. intersection: function(t) {
  134. if (!i(t, s))
  135. return null;
  136. var n = k(this.left, t.left)
  137. , e = V(this.right, t.right)
  138. , o = k(this.top, t.top)
  139. , r = V(this.bottom, t.bottom)
  140. , h = e - n
  141. , l = r - o;
  142. return h >= 0 && l >= 0 ? new s(n,o,h,l) : null
  143. },
  144. envelope: function(t) {
  145. if (!i(t, s))
  146. return this;
  147. var n = V(this.left, t.left)
  148. , e = k(this.right, t.right)
  149. , o = V(this.top, t.top)
  150. , r = k(this.bottom, t.bottom)
  151. , h = e - n
  152. , l = r - o;
  153. return new s(n,o,h,l)
  154. }
  155. }),
  156. T(s, {
  157. ofContent: function(t, i) {
  158. return t && t !== document && t !== window ? i ? new s(0,0,t.scrollWidth,t.scrollHeight) : new s(t.offsetLeft - t.scrollLeft,t.offsetTop - t.scrollTop,t.scrollWidth,t.scrollHeight) : new s(0,0,b.width(),b.height())
  159. },
  160. ofViewport: function(t, i) {
  161. return t && t !== document && t !== window ? i ? new s(t.scrollLeft,t.scrollTop,t.clientWidth,t.clientHeight) : new s(t.offsetLeft,t.offsetTop,t.clientWidth,t.clientHeight) : new s(m.scrollLeft(),m.scrollTop(),m.width(),m.height())
  162. },
  163. ofElement: function(t) {
  164. var i = g(t);
  165. if (!i.is(":visible"))
  166. return null;
  167. var n = i.offset();
  168. return new s(n.left,n.top,i.outerWidth(),i.outerHeight())
  169. }
  170. }),
  171. T(h.prototype, {
  172. equals: function(t) {
  173. return this.fracsEqual(t) && this.rectsEqual(t)
  174. },
  175. fracsEqual: function(t) {
  176. return r(this, t, ["visible", "viewport", "possible"])
  177. },
  178. rectsEqual: function(t) {
  179. return r(this.rects, t.rects, ["document", "element", "viewport"])
  180. }
  181. }),
  182. T(h, {
  183. of: function(t, i) {
  184. var e, o, r;
  185. return t = n(t) && s.ofElement(t) || t,
  186. i = n(i) && s.ofViewport(i) || i || s.ofViewport(),
  187. t instanceof s && (e = t.intersection(i)) ? (o = e.area(),
  188. r = V(t.width, i.width) * V(t.height, i.height),
  189. new h(o / t.area(),o / i.area(),o / r,{
  190. document: e,
  191. element: e.relativeTo(t),
  192. viewport: e.relativeTo(i)
  193. })) : new h
  194. }
  195. });
  196. var q = ["width", "height", "left", "right", "top", "bottom"]
  197. , S = ["possible", "visible", "viewport"];
  198. T(l.prototype, {
  199. sorted: function(t, i) {
  200. var n = this.viewport;
  201. return g.map(this.els, function(i) {
  202. return {
  203. el: i,
  204. val: c(i, n, t)
  205. }
  206. }).sort(i ? a : u)
  207. },
  208. best: function(t, i) {
  209. return this.els.length ? this.sorted(t, i)[0] : null
  210. }
  211. }),
  212. T(f.prototype, {
  213. equals: function(t) {
  214. return r(this, t, ["width", "height", "left", "top", "right", "bottom", "content", "viewport"])
  215. }
  216. }),
  217. T(p.prototype, {
  218. equals: function(t) {
  219. return r(this, t, ["el"])
  220. },
  221. scrollState: function() {
  222. return new f(this.el)
  223. },
  224. scrollTo: function(t, i, n) {
  225. var e = g(this.el === window ? "html,body" : this.el);
  226. t = t || 0,
  227. i = i || 0,
  228. n = isNaN(n) ? 1e3 : n,
  229. e.stop(!0).animate({
  230. scrollLeft: t,
  231. scrollTop: i
  232. }, n)
  233. },
  234. scroll: function(t, i, n) {
  235. var e = this.el === window ? m : g(this.el);
  236. t = t || 0,
  237. i = i || 0,
  238. this.scrollTo(e.scrollLeft() + t, e.scrollTop() + i, n)
  239. },
  240. scrollToRect: function(t, i, n, e) {
  241. i = i || 0,
  242. n = n || 0,
  243. this.scrollTo(t.left - i, t.top - n, e)
  244. },
  245. scrollToElement: function(t, i, n, e) {
  246. var o = s.ofElement(t).relativeTo(s.ofContent(this.el));
  247. this.scrollToRect(o, i, n, e)
  248. }
  249. });
  250. var C = {
  251. init: function() {
  252. this.callbacks = g.Callbacks("memory unique"),
  253. this.currVal = null,
  254. this.prevVal = null,
  255. this.checkProxy = g.proxy(this.check, this),
  256. this.autoCheck()
  257. },
  258. bind: function(t) {
  259. this.callbacks.add(t)
  260. },
  261. unbind: function(t) {
  262. t ? this.callbacks.remove(t) : this.callbacks.empty()
  263. },
  264. trigger: function() {
  265. this.callbacks.fireWith(this.context, [this.currVal, this.prevVal])
  266. },
  267. check: function(t) {
  268. var i = this.updatedValue(t);
  269. return void 0 !== i && (this.prevVal = this.currVal,
  270. this.currVal = i,
  271. this.trigger(),
  272. !0)
  273. },
  274. $autoTarget: m,
  275. autoEvents: "load resize scroll",
  276. autoCheck: function(t) {
  277. this.$autoTarget[t === !1 ? "off" : "on"](this.autoEvents, this.checkProxy)
  278. }
  279. };
  280. T(d.prototype, C, {
  281. updatedValue: function() {
  282. var t = h.of(this.context, this.viewport);
  283. return this.currVal && this.currVal.equals(t) ? void 0 : t
  284. }
  285. }),
  286. T(v.prototype, C, {
  287. updatedValue: function() {
  288. var t = this.context.best(this.property, this.descending);
  289. return t && (t = t.val > 0 ? t.el : null,
  290. this.currVal !== t) ? t : void 0
  291. }
  292. }),
  293. T(w.prototype, C, {
  294. updatedValue: function() {
  295. var t = new f(this.context);
  296. return this.currVal && this.currVal.equals(t) ? void 0 : t
  297. }
  298. });
  299. var L = function(t, i) {
  300. var n = [].slice
  301. , e = jQuery
  302. , o = e.extend
  303. , r = e.isFunction
  304. , s = o({}, i)
  305. , h = function(i, n, o, s) {
  306. return o = r(o) ? o.apply(i, n) : o,
  307. r(s[o]) ? s[o].apply(i, n) : void e.error('Method "' + o + '" does not exist on jQuery.' + t)
  308. }
  309. , l = function() {
  310. return h(this, n.call(arguments), s.defaultStatic, l)
  311. }
  312. , c = function(t) {
  313. return r(c[t]) ? c[t].apply(this, n.call(arguments, 1)) : h(this, n.call(arguments), s.defaultMethod, c)
  314. }
  315. , u = function(t) {
  316. t && (o(l, t.statics),
  317. o(c, t.methods)),
  318. l.modplug = u
  319. };
  320. u.prev = {
  321. statics: e[t],
  322. methods: e.fn[t]
  323. },
  324. u(i),
  325. e[t] = l,
  326. e.fn[t] = c
  327. }
  328. , M = "fracs";
  329. L(M, {
  330. statics: {
  331. version: "0.15.0",
  332. Rect: s,
  333. Fractions: h,
  334. Group: l,
  335. ScrollState: f,
  336. Viewport: p,
  337. FracsCallbacks: d,
  338. GroupCallbacks: v,
  339. ScrollStateCallbacks: w,
  340. fracs: function(t, i) {
  341. return h.of(t, i)
  342. }
  343. },
  344. methods: {
  345. content: function(t) {
  346. return this.length ? s.ofContent(this[0], t) : null
  347. },
  348. envelope: function() {
  349. return o(this, function(t) {
  350. var i = s.ofElement(this);
  351. return t ? t.envelope(i) : i
  352. })
  353. },
  354. fracs: function(i, n, o) {
  355. t(i, "string") || (o = n,
  356. n = i,
  357. i = null),
  358. y(n) || (o = n,
  359. n = null),
  360. o = e(o);
  361. var r = M + ".fracs." + x(o);
  362. return "unbind" === i ? this.each(function() {
  363. var t = g(this).data(r);
  364. t && t.unbind(n)
  365. }) : "check" === i ? this.each(function() {
  366. var t = g(this).data(r);
  367. t && t.check()
  368. }) : y(n) ? this.each(function() {
  369. var t = g(this)
  370. , i = t.data(r);
  371. i || (i = new d(this,o),
  372. t.data(r, i)),
  373. i.bind(n)
  374. }) : this.length ? h.of(this[0], o) : null
  375. },
  376. intersection: function() {
  377. return o(this, function(t) {
  378. var i = s.ofElement(this);
  379. return t ? t.intersection(i) : i
  380. })
  381. },
  382. max: function(t, i, n) {
  383. return y(i) || (n = i,
  384. i = null),
  385. n = e(n),
  386. i ? (new v(this,n,t,!0).bind(i),
  387. this) : this.pushStack(new l(this,n).best(t, !0).el)
  388. },
  389. min: function(t, i, n) {
  390. return y(i) || (n = i,
  391. i = null),
  392. n = e(n),
  393. i ? (new v(this,n,t).bind(i),
  394. this) : this.pushStack(new l(this,n).best(t).el)
  395. },
  396. rect: function() {
  397. return this.length ? s.ofElement(this[0]) : null
  398. },
  399. scrollState: function(i, n) {
  400. var e = M + ".scrollState";
  401. return t(i, "string") || (n = i,
  402. i = null),
  403. "unbind" === i ? this.each(function() {
  404. var t = g(this).data(e);
  405. t && t.unbind(n)
  406. }) : "check" === i ? this.each(function() {
  407. var t = g(this).data(e);
  408. t && t.check()
  409. }) : y(n) ? this.each(function() {
  410. var t = g(this)
  411. , i = t.data(e);
  412. i || (i = new w(this),
  413. t.data(e, i)),
  414. i.bind(n)
  415. }) : this.length ? new f(this[0]) : null
  416. },
  417. scroll: function(t, i, n) {
  418. return this.each(function() {
  419. new p(this).scroll(t, i, n)
  420. })
  421. },
  422. scrollTo: function(t, i, n, o) {
  423. return g.isNumeric(t) && (o = n,
  424. n = i,
  425. i = t,
  426. t = null),
  427. t = e(t),
  428. this.each(function() {
  429. t ? new p(this).scrollToElement(t, i, n, o) : new p(this).scrollTo(i, n, o)
  430. })
  431. },
  432. scrollToThis: function(t, i, n, o) {
  433. return o = new p(e(o)),
  434. o.scrollToElement(this[0], t, i, n),
  435. this
  436. },
  437. softLink: function(t, i, n, o) {
  438. return o = new p(e(o)),
  439. this.filter("a[href^=#]").each(function() {
  440. var e = g(this);
  441. e.on("click", function() {
  442. o.scrollToElement(g(e.attr("href"))[0], t, i, n)
  443. })
  444. })
  445. },
  446. sort: function(i, n, o) {
  447. return t(n, "boolean") || (o = n,
  448. n = null),
  449. o = e(o),
  450. this.pushStack(g.map(new l(this,o).sorted(i, !n), function(t) {
  451. return t.el
  452. }))
  453. },
  454. viewport: function(t) {
  455. return this.length ? s.ofViewport(this[0], t) : null
  456. }
  457. },
  458. defaultStatic: "fracs",
  459. defaultMethod: "fracs"
  460. })
  461. }();
  462. if ("undefined" == typeof jQuery)
  463. throw new Error("Bootstrap's JavaScript requires jQuery");
  464. +function(t) {
  465. "use strict";
  466. function e(e) {
  467. return this.each(function() {
  468. var o = t(this)
  469. , s = o.data("bs.tooltip")
  470. , n = "object" == typeof e && e;
  471. (s || "destroy" != e) && (s || o.data("bs.tooltip", s = new i(this,n)),
  472. "string" == typeof e && s[e]())
  473. })
  474. }
  475. var i = function(t, e) {
  476. this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
  477. this.init("tooltip", t, e)
  478. };
  479. i.VERSION = "3.2.0",
  480. i.DEFAULTS = {
  481. animation: !0,
  482. placement: "top",
  483. selector: !1,
  484. template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
  485. trigger: "hover focus",
  486. title: "",
  487. delay: 0,
  488. html: !1,
  489. container: !1,
  490. viewport: {
  491. selector: "body",
  492. padding: 0
  493. }
  494. },
  495. i.prototype.init = function(e, i, o) {
  496. this.enabled = !0,
  497. this.type = e,
  498. this.$element = t(i),
  499. this.options = this.getOptions(o),
  500. this.$viewport = this.options.viewport && t(this.options.viewport.selector || this.options.viewport);
  501. for (var s = this.options.trigger.split(" "), n = s.length; n--; ) {
  502. var r = s[n];
  503. if ("click" == r)
  504. this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this));
  505. else if ("manual" != r) {
  506. var a = "hover" == r ? "mouseenter" : "focusin"
  507. , l = "hover" == r ? "mouseleave" : "focusout";
  508. this.$element.on(a + "." + this.type, this.options.selector, t.proxy(this.enter, this)),
  509. this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this))
  510. }
  511. }
  512. this.options.selector ? this._options = t.extend({}, this.options, {
  513. trigger: "manual",
  514. selector: ""
  515. }) : this.fixTitle()
  516. }
  517. ,
  518. i.prototype.getDefaults = function() {
  519. return i.DEFAULTS
  520. }
  521. ,
  522. i.prototype.getOptions = function(e) {
  523. return e = t.extend({}, this.getDefaults(), this.$element.data(), e),
  524. e.delay && "number" == typeof e.delay && (e.delay = {
  525. show: e.delay,
  526. hide: e.delay
  527. }),
  528. e
  529. }
  530. ,
  531. i.prototype.getDelegateOptions = function() {
  532. var e = {}
  533. , i = this.getDefaults();
  534. return this._options && t.each(this._options, function(t, o) {
  535. i[t] != o && (e[t] = o)
  536. }),
  537. e
  538. }
  539. ,
  540. i.prototype.enter = function(e) {
  541. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  542. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  543. t(e.currentTarget).data("bs." + this.type, i)),
  544. clearTimeout(i.timeout),
  545. i.hoverState = "in",
  546. i.options.delay && i.options.delay.show ? void (i.timeout = setTimeout(function() {
  547. "in" == i.hoverState && i.show()
  548. }, i.options.delay.show)) : i.show()
  549. }
  550. ,
  551. i.prototype.leave = function(e) {
  552. var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type);
  553. return i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  554. t(e.currentTarget).data("bs." + this.type, i)),
  555. clearTimeout(i.timeout),
  556. i.hoverState = "out",
  557. i.options.delay && i.options.delay.hide ? void (i.timeout = setTimeout(function() {
  558. "out" == i.hoverState && i.hide()
  559. }, i.options.delay.hide)) : i.hide()
  560. }
  561. ,
  562. i.prototype.show = function() {
  563. var e = t.Event("show.bs." + this.type);
  564. if (this.hasContent() && this.enabled) {
  565. this.$element.trigger(e);
  566. var i = t.contains(document.documentElement, this.$element[0]);
  567. if (e.isDefaultPrevented() || !i)
  568. return;
  569. var o = this
  570. , s = this.tip()
  571. , n = this.getUID(this.type);
  572. this.setContent(),
  573. s.attr("id", n),
  574. this.$element.attr("aria-describedby", n),
  575. this.options.animation && s.addClass("fade");
  576. var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement
  577. , a = /\s?auto?\s?/i
  578. , l = a.test(r);
  579. l && (r = r.replace(a, "") || "top"),
  580. s.detach().css({
  581. top: 0,
  582. left: 0,
  583. display: "block"
  584. }).addClass(r).data("bs." + this.type, this),
  585. this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element);
  586. var p = this.getPosition()
  587. , h = s[0].offsetWidth
  588. , f = s[0].offsetHeight;
  589. if (l) {
  590. var u = r
  591. , c = this.$element.parent()
  592. , d = this.getPosition(c);
  593. r = "bottom" == r && p.top + p.height + f - d.scroll > d.height ? "top" : "top" == r && p.top - d.scroll - f < 0 ? "bottom" : "right" == r && p.right + h > d.width ? "left" : "left" == r && p.left - h < d.left ? "right" : r,
  594. s.removeClass(u).addClass(r)
  595. }
  596. var g = this.getCalculatedOffset(r, p, h, f);
  597. this.applyPlacement(g, r);
  598. var y = function() {
  599. o.$element.trigger("shown.bs." + o.type),
  600. o.hoverState = null
  601. };
  602. t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", y).emulateTransitionEnd(150) : y()
  603. }
  604. }
  605. ,
  606. i.prototype.applyPlacement = function(e, i) {
  607. var o = this.tip()
  608. , s = o[0].offsetWidth
  609. , n = o[0].offsetHeight
  610. , r = parseInt(o.css("margin-top"), 10)
  611. , a = parseInt(o.css("margin-left"), 10);
  612. isNaN(r) && (r = 0),
  613. isNaN(a) && (a = 0),
  614. e.top = e.top + r,
  615. e.left = e.left + a,
  616. t.offset.setOffset(o[0], t.extend({
  617. using: function(t) {
  618. o.css({
  619. top: Math.round(t.top),
  620. left: Math.round(t.left)
  621. })
  622. }
  623. }, e), 0),
  624. o.addClass("in");
  625. var l = o[0].offsetWidth
  626. , p = o[0].offsetHeight;
  627. "top" == i && p != n && (e.top = e.top + n - p);
  628. var h = this.getViewportAdjustedDelta(i, e, l, p);
  629. h.left ? e.left += h.left : e.top += h.top;
  630. var f = h.left ? 2 * h.left - s + l : 2 * h.top - n + p
  631. , u = h.left ? "left" : "top"
  632. , c = h.left ? "offsetWidth" : "offsetHeight";
  633. o.offset(e),
  634. this.replaceArrow(f, o[0][c], u)
  635. }
  636. ,
  637. i.prototype.replaceArrow = function(t, e, i) {
  638. this.arrow().css(i, t ? 50 * (1 - t / e) + "%" : "")
  639. }
  640. ,
  641. i.prototype.setContent = function() {
  642. var t = this.tip()
  643. , e = this.getTitle();
  644. t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e),
  645. t.removeClass("fade in top bottom left right")
  646. }
  647. ,
  648. i.prototype.hide = function() {
  649. function e() {
  650. "in" != i.hoverState && o.detach(),
  651. i.$element.trigger("hidden.bs." + i.type)
  652. }
  653. var i = this
  654. , o = this.tip()
  655. , s = t.Event("hide.bs." + this.type);
  656. if (this.$element.removeAttr("aria-describedby"),
  657. this.$element.trigger(s),
  658. !s.isDefaultPrevented())
  659. return o.removeClass("in"),
  660. t.support.transition && this.$tip.hasClass("fade") ? o.one("bsTransitionEnd", e).emulateTransitionEnd(150) : e(),
  661. this.hoverState = null,
  662. this
  663. }
  664. ,
  665. i.prototype.fixTitle = function() {
  666. var t = this.$element;
  667. (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "")
  668. }
  669. ,
  670. i.prototype.hasContent = function() {
  671. return this.getTitle()
  672. }
  673. ,
  674. i.prototype.getPosition = function(e) {
  675. e = e || this.$element;
  676. var i = e[0]
  677. , o = "BODY" == i.tagName;
  678. return t.extend({}, "function" == typeof i.getBoundingClientRect ? i.getBoundingClientRect() : null, {
  679. scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop(),
  680. width: o ? t(window).width() : e.outerWidth(),
  681. height: o ? t(window).height() : e.outerHeight()
  682. }, o ? {
  683. top: 0,
  684. left: 0
  685. } : e.offset())
  686. }
  687. ,
  688. i.prototype.getCalculatedOffset = function(t, e, i, o) {
  689. return "bottom" == t ? {
  690. top: e.top + e.height,
  691. left: e.left + e.width / 2 - i / 2
  692. } : "top" == t ? {
  693. top: e.top - o,
  694. left: e.left + e.width / 2 - i / 2
  695. } : "left" == t ? {
  696. top: e.top + e.height / 2 - o / 2,
  697. left: e.left - i
  698. } : {
  699. top: e.top + e.height / 2 - o / 2,
  700. left: e.left + e.width
  701. }
  702. }
  703. ,
  704. i.prototype.getViewportAdjustedDelta = function(t, e, i, o) {
  705. var s = {
  706. top: 0,
  707. left: 0
  708. };
  709. if (!this.$viewport)
  710. return s;
  711. var n = this.options.viewport && this.options.viewport.padding || 0
  712. , r = this.getPosition(this.$viewport);
  713. if (/right|left/.test(t)) {
  714. var a = e.top - n - r.scroll
  715. , l = e.top + n - r.scroll + o;
  716. a < r.top ? s.top = r.top - a : l > r.top + r.height && (s.top = r.top + r.height - l)
  717. } else {
  718. var p = e.left - n
  719. , h = e.left + n + i;
  720. p < r.left ? s.left = r.left - p : h > r.width && (s.left = r.left + r.width - h)
  721. }
  722. return s
  723. }
  724. ,
  725. i.prototype.getTitle = function() {
  726. var t, e = this.$element, i = this.options;
  727. return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title)
  728. }
  729. ,
  730. i.prototype.getUID = function(t) {
  731. do
  732. t += ~~(1e6 * Math.random());
  733. while (document.getElementById(t));return t
  734. }
  735. ,
  736. i.prototype.tip = function() {
  737. return this.$tip = this.$tip || t(this.options.template)
  738. }
  739. ,
  740. i.prototype.arrow = function() {
  741. return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
  742. }
  743. ,
  744. i.prototype.validate = function() {
  745. this.$element[0].parentNode || (this.hide(),
  746. this.$element = null,
  747. this.options = null)
  748. }
  749. ,
  750. i.prototype.enable = function() {
  751. this.enabled = !0
  752. }
  753. ,
  754. i.prototype.disable = function() {
  755. this.enabled = !1
  756. }
  757. ,
  758. i.prototype.toggleEnabled = function() {
  759. this.enabled = !this.enabled
  760. }
  761. ,
  762. i.prototype.toggle = function(e) {
  763. var i = this;
  764. e && (i = t(e.currentTarget).data("bs." + this.type),
  765. i || (i = new this.constructor(e.currentTarget,this.getDelegateOptions()),
  766. t(e.currentTarget).data("bs." + this.type, i))),
  767. i.tip().hasClass("in") ? i.leave(i) : i.enter(i)
  768. }
  769. ,
  770. i.prototype.destroy = function() {
  771. clearTimeout(this.timeout),
  772. this.hide().$element.off("." + this.type).removeData("bs." + this.type)
  773. }
  774. ;
  775. var o = t.fn.tooltip;
  776. t.fn.tooltip = e,
  777. t.fn.tooltip.Constructor = i,
  778. t.fn.tooltip.noConflict = function() {
  779. return t.fn.tooltip = o,
  780. this
  781. }
  782. }(jQuery);
  783. !function(e, t, n) {
  784. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  785. }("Keen", this, function() {
  786. "use strict";
  787. function Keen() {
  788. return _init.apply(this, arguments)
  789. }
  790. function _init(e) {
  791. if (_isUndefined(e))
  792. throw new Error("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  793. if (_isUndefined(e.projectId) || "String" !== _type(e.projectId) || e.projectId.length < 1)
  794. throw new Error("Please provide a projectId");
  795. this.configure(e)
  796. }
  797. function _extend(e) {
  798. for (var t = 1; t < arguments.length; t++)
  799. for (var n in arguments[t])
  800. e[n] = arguments[t][n];
  801. return e
  802. }
  803. function _isUndefined(e) {
  804. return void 0 === e
  805. }
  806. function _type(e) {
  807. var t = e && e.constructor ? e.constructor.toString() : void 0;
  808. return t ? t.match(/function (.*)\(/)[1] : "Null"
  809. }
  810. function _each(e, t, n) {
  811. var r;
  812. if (!e)
  813. return 0;
  814. if (n = n ? n : e,
  815. "array" === _type(e)) {
  816. for (r = 0; r < e.length; r++)
  817. if (t.call(n, e[r], r, e) === !1)
  818. return 0
  819. } else
  820. for (r in e)
  821. if (e.hasOwnProperty(r) && t.call(n, e[r], r, e) === !1)
  822. return 0;
  823. return 1
  824. }
  825. function _parse_params(e) {
  826. for (var t, n = {}, r = /\+/g, i = /([^&=]+)=?([^&]*)/g, o = function(e) {
  827. return decodeURIComponent(e.replace(r, " "))
  828. }, a = e.split("?")[1]; t = i.exec(a); )
  829. n[o(t[1])] = o(t[2]);
  830. return n
  831. }
  832. function _set_protocol(e) {
  833. switch (e) {
  834. case "http":
  835. return "http";
  836. case "auto":
  837. return location.protocol.replace(/:/g, "");
  838. case "https":
  839. case void 0:
  840. default:
  841. return "https"
  842. }
  843. }
  844. function _set_request_type(e) {
  845. var t = e || "jsonp"
  846. , n = !1;
  847. return ("Object" === _type(XMLHttpRequest) || "Function" === _type(XMLHttpRequest)) && "withCredentials"in new XMLHttpRequest && (n = !0),
  848. null == t || "xhr" == t ? n ? "xhr" : "jsonp" : t
  849. }
  850. function _build_url(e) {
  851. return this.client.endpoint + "/projects/" + this.client.projectId + e
  852. }
  853. function _uploadEvent(e, t, n, r, i) {
  854. var o = _build_url.apply(this, ["/events/" + e])
  855. , a = {};
  856. n = n !== !1,
  857. this.client.globalProperties && (a = this.client.globalProperties(e));
  858. for (var c in t)
  859. t.hasOwnProperty(c) && (a[c] = t[c]);
  860. switch (this.client.requestType) {
  861. case "xhr":
  862. _request.xhr.apply(this, ["POST", o, null, a, this.client.writeKey, n, r, i]);
  863. break;
  864. case "jsonp":
  865. var s = JSON.stringify(a)
  866. , l = Keen.Base64.encode(s);
  867. o = o + "?api_key=" + this.client.writeKey,
  868. o = o + "&data=" + l,
  869. o = o + "&modified=" + (new Date).getTime(),
  870. _request.jsonp.apply(this, [o, this.client.writeKey, r, i]);
  871. break;
  872. case "beacon":
  873. var s = JSON.stringify(a)
  874. , l = Keen.Base64.encode(s);
  875. o = o + "?api_key=" + encodeURIComponent(this.client.writeKey),
  876. o = o + "&data=" + encodeURIComponent(l),
  877. o = o + "&modified=" + encodeURIComponent((new Date).getTime()),
  878. o += "&c=clv1",
  879. _request.beacon.apply(this, [o, null, r, i])
  880. }
  881. }
  882. Keen.prototype.configure = function(e) {
  883. return e.host = _isUndefined(e.host) ? "api.keen.io/3.0" : e.host.replace(/.*?:\/\//g, ""),
  884. e.protocol = _set_protocol(e.protocol),
  885. e.requestType = _set_request_type(e.requestType),
  886. this.client = {
  887. projectId: e.projectId,
  888. writeKey: e.writeKey,
  889. readKey: e.readKey,
  890. globalProperties: null,
  891. endpoint: e.protocol + "://" + e.host,
  892. requestType: e.requestType
  893. },
  894. Keen.trigger("client", this, e),
  895. this.trigger("ready"),
  896. this
  897. }
  898. ;
  899. var _request = {
  900. xhr: function(e, t, n, r, i, o, a, c) {
  901. if (!i)
  902. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  903. var s = new XMLHttpRequest;
  904. if (s.onreadystatechange = function() {
  905. if (4 == s.readyState)
  906. if (s.status >= 200 && s.status < 300) {
  907. var e;
  908. try {
  909. e = JSON.parse(s.responseText)
  910. } catch (e) {
  911. Keen.log("Could not JSON parse HTTP response: " + s.responseText),
  912. c && c(s, e)
  913. }
  914. a && e && a(e)
  915. } else
  916. Keen.log("HTTP request failed."),
  917. c && c(s, null)
  918. }
  919. ,
  920. s.open(e, t, o),
  921. i && s.setRequestHeader("Authorization", i),
  922. r && s.setRequestHeader("Content-Type", "application/json"),
  923. n)
  924. for (var l in n)
  925. n.hasOwnProperty(l) && s.setRequestHeader(l, n[l]);
  926. var u = r ? JSON.stringify(r) : null;
  927. s.send(u)
  928. },
  929. jsonp: function(e, t, n, r) {
  930. if (!t)
  931. return Keen.log("Please provide a writeKey for https://keen.io/project/" + this.client.projectId);
  932. if (t && e.indexOf("api_key") < 0) {
  933. var i = e.indexOf("?") > 0 ? "&" : "?";
  934. e = e + i + "api_key=" + t
  935. }
  936. for (var o = "keenJSONPCallback" + (new Date).getTime(); o in window; )
  937. o += "a";
  938. var a = !1;
  939. window[o] = function(e) {
  940. a = !0,
  941. n && e && n(e),
  942. window[o] = void 0
  943. }
  944. ,
  945. e = e + "&jsonp=" + o;
  946. var c = document.createElement("script");
  947. c.id = "keen-jsonp",
  948. c.src = e,
  949. document.getElementsByTagName("head")[0].appendChild(c),
  950. c.onreadystatechange = function() {
  951. a === !1 && "loaded" === this.readyState && (a = !0,
  952. r && r())
  953. }
  954. ,
  955. c.onerror = function() {
  956. a === !1 && (a = !0,
  957. r && r())
  958. }
  959. },
  960. beacon: function(e, t, n, r) {
  961. if (t && e.indexOf("api_key") < 0) {
  962. var i = e.indexOf("?") > 0 ? "&" : "?";
  963. e = e + i + "api_key=" + t
  964. }
  965. var o = !1
  966. , a = document.createElement("img");
  967. a.onload = function() {
  968. if (o = !0,
  969. "naturalHeight"in this) {
  970. if (this.naturalHeight + this.naturalWidth === 0)
  971. return void this.onerror()
  972. } else if (this.width + this.height === 0)
  973. return void this.onerror();
  974. n && n({
  975. created: !0
  976. })
  977. }
  978. ,
  979. a.onerror = function() {
  980. o = !0,
  981. r && r()
  982. }
  983. ,
  984. a.src = e
  985. }
  986. }
  987. , Events = Keen.Events = {
  988. on: function(e, t) {
  989. this.listeners || (this.listeners = {});
  990. var n = this.listeners[e] || (this.listeners[e] = []);
  991. return n.push({
  992. callback: t
  993. }),
  994. this
  995. },
  996. off: function(e, t) {
  997. if (!e && !t)
  998. return this.listeners = void 0,
  999. delete this.listeners,
  1000. this;
  1001. for (var n = this.listeners[e] || [], r = n.length; r--; )
  1002. t && t == n[r].callback && this.listeners[e].splice(r, 1),
  1003. t && 0 != n.length || (this.listeners[e] = void 0,
  1004. delete this.listeners[e]);
  1005. return this
  1006. },
  1007. trigger: function(e) {
  1008. if (!this.listeners)
  1009. return this;
  1010. for (var t = Array.prototype.slice.call(arguments, 1), n = this.listeners[e] || [], r = 0; r < n.length; r++)
  1011. n[r].callback.apply(this, t);
  1012. return this
  1013. }
  1014. };
  1015. _extend(Keen.prototype, Events),
  1016. _extend(Keen, Events),
  1017. Keen.loaded = !0,
  1018. Keen.utils = {
  1019. each: _each,
  1020. extend: _extend,
  1021. parseParams: _parse_params
  1022. },
  1023. Keen.ready = function(e) {
  1024. Keen.loaded ? e() : Keen.on("ready", e)
  1025. }
  1026. ,
  1027. Keen.log = function(e) {
  1028. "object" == typeof console && console.log("[Keen IO]", e)
  1029. }
  1030. ;
  1031. var Plugins = Keen.Plugins = {};
  1032. Keen.prototype.addEvent = function() {
  1033. _uploadEvent.apply(this, arguments)
  1034. }
  1035. ,
  1036. Keen.prototype.addEventSync = function(e, t, n, r) {
  1037. _uploadEvent.apply(this, [e, t, !1, n, r])
  1038. }
  1039. ,
  1040. Keen.prototype.trackExternalLink = function(e, t, n, r, i) {
  1041. var o = e
  1042. , a = o.metaKey
  1043. , c = o.target
  1044. , s = !1
  1045. , l = function() {};
  1046. return void 0 === r && (r = 500),
  1047. "A" === c.nodeName ? l = function() {
  1048. a || s || (s = !0,
  1049. window.location = c.href)
  1050. }
  1051. : "FORM" === c.nodeName && (l = function() {
  1052. s || (s = !0,
  1053. c.submit())
  1054. }
  1055. ),
  1056. i && (l = function() {
  1057. s || (s = !0,
  1058. i())
  1059. }
  1060. ),
  1061. _uploadEvent.call(this, t, n, l, l),
  1062. setTimeout(function() {
  1063. l()
  1064. }, r),
  1065. !!a && void 0
  1066. }
  1067. ,
  1068. Keen.prototype.setGlobalProperties = function(e) {
  1069. if (!this.client)
  1070. return Keen.log("Check out our JavaScript SDK Usage Guide: https://keen.io/docs/clients/javascript/usage-guide/");
  1071. if (!e || "function" != typeof e)
  1072. throw new Error("Invalid value for global properties: " + e);
  1073. this.client.globalProperties = e
  1074. }
  1075. ,
  1076. Keen.Base64 = {
  1077. map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1078. encode: function(e) {
  1079. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map;
  1080. for (e = this.utf8.encode(e); l < e.length; )
  1081. t = e.charCodeAt(l++),
  1082. n = e.charCodeAt(l++),
  1083. r = e.charCodeAt(l++),
  1084. i = t >> 2,
  1085. o = (3 & t) << 4 | n >> 4,
  1086. a = isNaN(n) ? 64 : (15 & n) << 2 | r >> 6,
  1087. c = isNaN(n) || isNaN(r) ? 64 : 63 & r,
  1088. s = s + u.charAt(i) + u.charAt(o) + u.charAt(a) + u.charAt(c);
  1089. return s
  1090. },
  1091. decode: function(e) {
  1092. var t, n, r, i, o, a, c, s = "", l = 0, u = this.map, f = String.fromCharCode;
  1093. for (e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""); l < e.length; )
  1094. t = u.indexOf(e.charAt(l++)),
  1095. n = u.indexOf(e.charAt(l++)),
  1096. r = u.indexOf(e.charAt(l++)),
  1097. i = u.indexOf(e.charAt(l++)),
  1098. o = t << 2 | n >> 4,
  1099. a = (15 & n) << 4 | r >> 2,
  1100. c = (3 & r) << 6 | i,
  1101. s = s + (f(o) + (64 != r ? f(a) : "")) + (64 != i ? f(c) : "");
  1102. return this.utf8.decode(s)
  1103. },
  1104. utf8: {
  1105. encode: function(e) {
  1106. for (var t, n = "", r = 0, i = String.fromCharCode; r < e.length; )
  1107. t = e.charCodeAt(r++),
  1108. 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);
  1109. return n
  1110. },
  1111. decode: function(e) {
  1112. for (var t, n, r = "", i = 0, o = String.fromCharCode; i < e.length; )
  1113. n = e.charCodeAt(i),
  1114. r += 128 > n ? [o(n), i++][0] : n > 191 && 224 > n ? [o((31 & n) << 6 | 63 & (t = e.charCodeAt(i + 1))), i += 2][0] : [o((15 & n) << 12 | (63 & (t = e.charCodeAt(i + 1))) << 6 | 63 & (c3 = e.charCodeAt(i + 2))), i += 3][0];
  1115. return r
  1116. }
  1117. }
  1118. },
  1119. "object" != typeof JSON && (JSON = {}),
  1120. function() {
  1121. function f(e) {
  1122. return 10 > e ? "0" + e : e
  1123. }
  1124. function quote(e) {
  1125. return escapable.lastIndex = 0,
  1126. escapable.test(e) ? '"' + e.replace(escapable, function(e) {
  1127. var t = meta[e];
  1128. return "string" == typeof t ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1129. }) + '"' : '"' + e + '"'
  1130. }
  1131. function str(e, t) {
  1132. var n, r, i, o, a, c = gap, s = t[e];
  1133. switch (s && "object" == typeof s && "function" == typeof s.toJSON && (s = s.toJSON(e)),
  1134. "function" == typeof rep && (s = rep.call(t, e, s)),
  1135. typeof s) {
  1136. case "string":
  1137. return quote(s);
  1138. case "number":
  1139. return isFinite(s) ? String(s) : "null";
  1140. case "boolean":
  1141. case "null":
  1142. return String(s);
  1143. case "object":
  1144. if (!s)
  1145. return "null";
  1146. if (gap += indent,
  1147. a = [],
  1148. "[object Array]" === Object.prototype.toString.apply(s)) {
  1149. for (o = s.length,
  1150. n = 0; o > n; n += 1)
  1151. a[n] = str(n, s) || "null";
  1152. return i = 0 === a.length ? "[]" : gap ? "[\n" + gap + a.join(",\n" + gap) + "\n" + c + "]" : "[" + a.join(",") + "]",
  1153. gap = c,
  1154. i
  1155. }
  1156. if (rep && "object" == typeof rep)
  1157. for (o = rep.length,
  1158. n = 0; o > n; n += 1)
  1159. "string" == typeof rep[n] && (r = rep[n],
  1160. i = str(r, s),
  1161. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1162. else
  1163. for (r in s)
  1164. Object.prototype.hasOwnProperty.call(s, r) && (i = str(r, s),
  1165. i && a.push(quote(r) + (gap ? ": " : ":") + i));
  1166. return i = 0 === a.length ? "{}" : gap ? "{\n" + gap + a.join(",\n" + gap) + "\n" + c + "}" : "{" + a.join(",") + "}",
  1167. gap = c,
  1168. i
  1169. }
  1170. }
  1171. "function" != typeof Date.prototype.toJSON && (Date.prototype.toJSON = function() {
  1172. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + f(this.getUTCMonth() + 1) + "-" + f(this.getUTCDate()) + "T" + f(this.getUTCHours()) + ":" + f(this.getUTCMinutes()) + ":" + f(this.getUTCSeconds()) + "Z" : null
  1173. }
  1174. ,
  1175. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  1176. return this.valueOf()
  1177. }
  1178. );
  1179. var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, gap, indent, meta = {
  1180. "\b": "\\b",
  1181. "\t": "\\t",
  1182. "\n": "\\n",
  1183. "\f": "\\f",
  1184. "\r": "\\r",
  1185. '"': '\\"',
  1186. "\\": "\\\\"
  1187. }, rep;
  1188. "function" != typeof JSON.stringify && (JSON.stringify = function(e, t, n) {
  1189. var r;
  1190. if (gap = "",
  1191. indent = "",
  1192. "number" == typeof n)
  1193. for (r = 0; n > r; r += 1)
  1194. indent += " ";
  1195. else
  1196. "string" == typeof n && (indent = n);
  1197. if (rep = t,
  1198. t && "function" != typeof t && ("object" != typeof t || "number" != typeof t.length))
  1199. throw new Error("JSON.stringify");
  1200. return str("", {
  1201. "": e
  1202. })
  1203. }
  1204. ),
  1205. "function" != typeof JSON.parse && (JSON.parse = function(text, reviver) {
  1206. function walk(e, t) {
  1207. var n, r, i = e[t];
  1208. if (i && "object" == typeof i)
  1209. for (n in i)
  1210. Object.prototype.hasOwnProperty.call(i, n) && (r = walk(i, n),
  1211. void 0 !== r ? i[n] = r : delete i[n]);
  1212. return reviver.call(e, t, i)
  1213. }
  1214. var j;
  1215. if (text = String(text),
  1216. cx.lastIndex = 0,
  1217. cx.test(text) && (text = text.replace(cx, function(e) {
  1218. return "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
  1219. })),
  1220. /^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, "")))
  1221. return j = eval("(" + text + ")"),
  1222. "function" == typeof reviver ? walk({
  1223. "": j
  1224. }, "") : j;
  1225. throw new SyntaxError("JSON.parse")
  1226. }
  1227. )
  1228. }(),
  1229. !function(e, t, n) {
  1230. "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  1231. }("domready", Keen.utils, function(e) {
  1232. function t(e) {
  1233. for (d = 1; e = r.shift(); )
  1234. e()
  1235. }
  1236. var n, r = [], i = !1, o = document, a = o.documentElement, c = a.doScroll, s = "DOMContentLoaded", l = "addEventListener", u = "onreadystatechange", f = "readyState", p = c ? /^loaded|^c/ : /^loaded|c/, d = p.test(o[f]);
  1237. return o[l] && o[l](s, n = function() {
  1238. o.removeEventListener(s, n, i),
  1239. t()
  1240. }
  1241. , i),
  1242. c && o.attachEvent(u, n = function() {
  1243. /^c/.test(o[f]) && (o.detachEvent(u, n),
  1244. t())
  1245. }
  1246. ),
  1247. e = c ? function(t) {
  1248. self != top ? d ? t() : r.push(t) : function() {
  1249. try {
  1250. a.doScroll("left")
  1251. } catch (n) {
  1252. return setTimeout(function() {
  1253. e(t)
  1254. }, 50)
  1255. }
  1256. t()
  1257. }()
  1258. }
  1259. : function(e) {
  1260. d ? e() : r.push(e)
  1261. }
  1262. });
  1263. var loaded = window.Keen, cached = window._Keen || {}, clients, ready;
  1264. if (loaded && cached) {
  1265. clients = cached.clients || {},
  1266. ready = cached.ready || [];
  1267. for (var instance in clients)
  1268. if (clients.hasOwnProperty(instance)) {
  1269. var client = clients[instance];
  1270. for (var method in Keen.prototype)
  1271. Keen.prototype.hasOwnProperty(method) && (loaded.prototype[method] = Keen.prototype[method]);
  1272. if (loaded.Query = Keen.Query ? Keen.Query : function() {}
  1273. ,
  1274. loaded.Visualization = Keen.Visualization ? Keen.Visualization : function() {}
  1275. ,
  1276. client._config && (client.configure.call(client, client._config),
  1277. delete client._config),
  1278. client._setGlobalProperties) {
  1279. for (var globals = client._setGlobalProperties, i = 0; i < globals.length; i++)
  1280. client.setGlobalProperties.apply(client, globals[i]);
  1281. delete client._setGlobalProperties
  1282. }
  1283. if (client._addEvent) {
  1284. for (var queue = client._addEvent || [], i = 0; i < queue.length; i++)
  1285. client.addEvent.apply(client, queue[i]);
  1286. delete client._addEvent
  1287. }
  1288. var callback = client._on || [];
  1289. if (client._on) {
  1290. for (var i = 0; i < callback.length; i++)
  1291. client.on.apply(client, callback[i]);
  1292. client.trigger("ready"),
  1293. delete client._on
  1294. }
  1295. }
  1296. for (var i = 0; i < ready.length; i++) {
  1297. var callback = ready[i];
  1298. Keen.on("ready", function() {
  1299. callback()
  1300. })
  1301. }
  1302. }
  1303. return Keen.loaded && setTimeout(function() {
  1304. Keen.utils.domready(function() {
  1305. Keen.trigger("ready")
  1306. })
  1307. }, 0),
  1308. Keen
  1309. });
  1310. !function() {
  1311. var t = window.analytics = window.analytics || [];
  1312. if (!t.initialize) {
  1313. if (t.invoked)
  1314. return void (window.console && console.error && console.error("Segment snippet included twice."));
  1315. t.invoked = !0,
  1316. t.methods = ["trackSubmit", "trackClick", "trackLink", "trackForm", "pageview", "identify", "reset", "group", "track", "ready", "alias", "debug", "page", "once", "off", "on"],
  1317. t.factory = function(e) {
  1318. return function() {
  1319. var n = Array.prototype.slice.call(arguments);
  1320. return n.unshift(e),
  1321. t.push(n),
  1322. t
  1323. }
  1324. }
  1325. ;
  1326. for (var e = 0; e < t.methods.length; e++) {
  1327. var n = t.methods[e];
  1328. t[n] = t.factory(n)
  1329. }
  1330. t.load = function(t) {
  1331. var e = document.createElement("script");
  1332. e.type = "text/javascript",
  1333. e.async = !0,
  1334. e.src = ("https:" === document.location.protocol ? "https://" : "http://") + "cdn.segment.com/analytics.js/v1/" + t + "/analytics.min.js";
  1335. var n = document.getElementsByTagName("script")[0];
  1336. n.parentNode.insertBefore(e, n)
  1337. }
  1338. ,
  1339. t.SNIPPET_VERSION = "4.0.0"
  1340. }
  1341. }();
  1342. !function(i, e) {
  1343. "use strict";
  1344. var s = ""
  1345. , r = "?"
  1346. , o = "function"
  1347. , a = "undefined"
  1348. , n = "object"
  1349. , t = "major"
  1350. , d = "model"
  1351. , w = "name"
  1352. , l = "type"
  1353. , p = "vendor"
  1354. , m = "version"
  1355. , c = "architecture"
  1356. , u = "console"
  1357. , g = "mobile"
  1358. , f = "tablet"
  1359. , h = "smarttv"
  1360. , b = {
  1361. has: function(i, e) {
  1362. return e.toLowerCase().indexOf(i.toLowerCase()) !== -1
  1363. },
  1364. lowerize: function(i) {
  1365. return i.toLowerCase()
  1366. }
  1367. }
  1368. , y = {
  1369. rgx: function() {
  1370. for (var i, s, r, t, d, w, l, p = 0, m = arguments; p < m.length; p += 2) {
  1371. var c = m[p]
  1372. , u = m[p + 1];
  1373. if (typeof i === a) {
  1374. i = {};
  1375. for (t in u)
  1376. d = u[t],
  1377. typeof d === n ? i[d[0]] = e : i[d] = e
  1378. }
  1379. for (s = r = 0; s < c.length; s++)
  1380. if (w = c[s].exec(this.getUA())) {
  1381. for (t = 0; t < u.length; t++)
  1382. l = w[++r],
  1383. d = u[t],
  1384. typeof d === n && d.length > 0 ? 2 == d.length ? typeof d[1] == o ? i[d[0]] = d[1].call(this, l) : i[d[0]] = d[1] : 3 == d.length ? typeof d[1] !== o || d[1].exec && d[1].test ? i[d[0]] = l ? l.replace(d[1], d[2]) : e : i[d[0]] = l ? d[1].call(this, l, d[2]) : e : 4 == d.length && (i[d[0]] = l ? d[3].call(this, l.replace(d[1], d[2])) : e) : i[d] = l ? l : e;
  1385. break
  1386. }
  1387. if (w)
  1388. break
  1389. }
  1390. return i
  1391. },
  1392. str: function(i, s) {
  1393. for (var o in s)
  1394. if (typeof s[o] === n && s[o].length > 0) {
  1395. for (var a = 0; a < s[o].length; a++)
  1396. if (b.has(s[o][a], i))
  1397. return o === r ? e : o
  1398. } else if (b.has(s[o], i))
  1399. return o === r ? e : o;
  1400. return i
  1401. }
  1402. }
  1403. , v = {
  1404. browser: {
  1405. oldsafari: {
  1406. major: {
  1407. 1: ["/8", "/1", "/3"],
  1408. 2: "/4",
  1409. "?": "/"
  1410. },
  1411. version: {
  1412. "1.0": "/8",
  1413. 1.2: "/1",
  1414. 1.3: "/3",
  1415. "2.0": "/412",
  1416. "2.0.2": "/416",
  1417. "2.0.3": "/417",
  1418. "2.0.4": "/419",
  1419. "?": "/"
  1420. }
  1421. }
  1422. },
  1423. device: {
  1424. sprint: {
  1425. model: {
  1426. "Evo Shift 4G": "7373KT"
  1427. },
  1428. vendor: {
  1429. HTC: "APA",
  1430. Sprint: "Sprint"
  1431. }
  1432. }
  1433. },
  1434. os: {
  1435. windows: {
  1436. version: {
  1437. ME: "4.90",
  1438. "NT 3.11": "NT3.51",
  1439. "NT 4.0": "NT4.0",
  1440. 2e3: "NT 5.0",
  1441. XP: ["NT 5.1", "NT 5.2"],
  1442. Vista: "NT 6.0",
  1443. 7: "NT 6.1",
  1444. 8: "NT 6.2",
  1445. 8.1: "NT 6.3",
  1446. RT: "ARM"
  1447. }
  1448. }
  1449. }
  1450. }
  1451. , k = {
  1452. browser: [[/(opera\smini)\/((\d+)?[\w\.-]+)/i, /(opera\s[mobiletab]+).+version\/((\d+)?[\w\.-]+)/i, /(opera).+version\/((\d+)?[\w\.]+)/i, /(opera)[\/\s]+((\d+)?[\w\.]+)/i], [w, m, t], [/\s(opr)\/((\d+)?[\w\.]+)/i], [[w, "Opera"], m, t], [/(kindle)\/((\d+)?[\w\.]+)/i, /(lunascape|maxthon|netfront|jasmine|blazer)[\/\s]?((\d+)?[\w\.]+)*/i, /(avant\s|iemobile|slim|baidu)(?:browser)?[\/\s]?((\d+)?[\w\.]*)/i, /(?:ms|\()(ie)\s((\d+)?[\w\.]+)/i, /(rekonq)((?:\/)[\w\.]+)*/i, /(chromium|flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron)\/((\d+)?[\w\.-]+)/i], [w, m, t], [/(trident).+rv[:\s]((\d+)?[\w\.]+).+like\sgecko/i], [[w, "IE"], m, t], [/(yabrowser)\/((\d+)?[\w\.]+)/i], [[w, "Yandex"], m, t], [/(comodo_dragon)\/((\d+)?[\w\.]+)/i], [[w, /_/g, " "], m, t], [/(chrome|omniweb|arora|[tizenoka]{5}\s?browser)\/v?((\d+)?[\w\.]+)/i], [w, m, t], [/(dolfin)\/((\d+)?[\w\.]+)/i], [[w, "Dolphin"], m, t], [/((?:android.+)crmo|crios)\/((\d+)?[\w\.]+)/i], [[w, "Chrome"], m, t], [/version\/((\d+)?[\w\.]+).+?mobile\/\w+\s(safari)/i], [m, t, [w, "Mobile Safari"]], [/version\/((\d+)?[\w\.]+).+?(mobile\s?safari|safari)/i], [m, t, w], [/webkit.+?(mobile\s?safari|safari)((\/[\w\.]+))/i], [w, [t, y.str, v.browser.oldsafari.major], [m, y.str, v.browser.oldsafari.version]], [/(konqueror)\/((\d+)?[\w\.]+)/i, /(webkit|khtml)\/((\d+)?[\w\.]+)/i], [w, m, t], [/(navigator|netscape)\/((\d+)?[\w\.-]+)/i], [[w, "Netscape"], m, t], [/(swiftfox)/i, /(icedragon|iceweasel|camino|chimera|fennec|maemo\sbrowser|minimo|conkeror)[\/\s]?((\d+)?[\w\.\+]+)/i, /(firefox|seamonkey|k-meleon|icecat|iceape|firebird|phoenix)\/((\d+)?[\w\.-]+)/i, /(mozilla)\/((\d+)?[\w\.]+).+rv\:.+gecko\/\d+/i, /(uc\s?browser|polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|qqbrowser)[\/\s]?((\d+)?[\w\.]+)/i, /(links)\s\(((\d+)?[\w\.]+)/i, /(gobrowser)\/?((\d+)?[\w\.]+)*/i, /(ice\s?browser)\/v?((\d+)?[\w\._]+)/i, /(mosaic)[\/\s]((\d+)?[\w\.]+)/i], [w, m, t], [/(apple(?:coremedia|))\/((\d+)[\w\._]+)/i, /(coremedia) v((\d+)[\w\._]+)/i], [w, m, t], [/(aqualung|lyssna|bsplayer)\/([\w\.-]+)/i], [w, m], [/(ares|ossproxy)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(audacious|audimusicstream|amarok|bass|core|dalvik|gnomemplayer|music on console|nsplayer|psp-internetradioplayer|videos)\/((\d+)[\w\.-]+)/i, /(clementine|music player daemon)\s((\d+)[\w\.-]+)/i, /(lg player|nexplayer)\s((\d+)[\d\.]+)/i, /player\/(nexplayer|lg player)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(nexplayer)\s((\d+)[\w\.-]+)/i], [w, m, t], [/(flrp)\/((\d+)[\w\.-]+)/i], [[w, "Flip Player"], m, t], [/(fstream|nativehost|queryseekspider|ia-archiver|facebookexternalhit)/i], [w], [/(gstreamer) souphttpsrc (?:\([^\)]+\)){0,1} libsoup\/((\d+)[\w\.-]+)/i], [w, m, t], [/(htc streaming player)\s[\w_]+\s\/\s((\d+)[\d\.]+)/i, /(java|python-urllib|python-requests|wget|libcurl)\/((\d+)[\w\.-_]+)/i, /(lavf)((\d+)[\d\.]+)/i], [w, m, t], [/(htc_one_s)\/((\d+)[\d\.]+)/i], [[w, /_/g, " "], m, t], [/(mplayer)(?:\s|\/)(?:(?:sherpya-){0,1}svn)(?:-|\s)(r\d+(?:-\d+[\w\.-]+){0,1})/i], [w, m], [/(mplayer)(?:\s|\/)((\d+)[\w\.-]+)/i, /(mplayer) unknown-((\d+)[\w\.\-]+)/i], [w, m, t], [/(mplayer)/i, /(yourmuze)/i, /(media player classic|nero showtime)/i], [w], [/(nero (?:home|scout))\/((\d+)[\w\.-]+)/i], [w, m, t], [/(nokia\d+)\/((\d+)[\w\.-]+)/i], [w, m, t], [/\s(songbird)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(winamp)3 version ((\d+)[\w\.-]+)/i, /(winamp)\s((\d+)[\w\.-]+)/i, /(winamp)mpeg\/((\d+)[\w\.-]+)/i], [w, m, t], [/(ocms-bot|tapinradio|tunein radio|unknown|winamp|inlight radio)/i], [w], [/(quicktime|rma|radioapp|radioclientapplication|soundtap|totem|stagefright|streamium)\/((\d+)[\w\.-]+)/i], [w, m, t], [/(smp)((\d+)[\d\.]+)/i], [w, m, t], [/(vlc) media player - version ((\d+)[\w\.]+)/i, /(vlc)\/((\d+)[\w\.-]+)/i, /(xbmc|gvfs|xine|xmms|irapp)\/((\d+)[\w\.-]+)/i, /(foobar2000)\/((\d+)[\d\.]+)/i, /(itunes)\/((\d+)[\d\.]+)/i], [w, m, t], [/(wmplayer)\/((\d+)[\w\.-]+)/i, /(windows-media-player)\/((\d+)[\w\.-]+)/i], [[w, /-/g, " "], m, t], [/windows\/((\d+)[\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ (home media server)/i], [m, t, [w, "Windows"]], [/(com\.riseupradioalarm)\/((\d+)[\d\.]*)/i], [w, m, t], [/(rad.io)\s((\d+)[\d\.]+)/i, /(radio.(?:de|at|fr))\s((\d+)[\d\.]+)/i], [[w, "rad.io"], m, t]],
  1453. cpu: [[/(?:(amd|x(?:(?:86|64)[_-])?|wow|win)64)[;\)]/i], [[c, "amd64"]], [/(ia32(?=;))/i], [[c, b.lowerize]], [/((?:i[346]|x)86)[;\)]/i], [[c, "ia32"]], [/windows\s(ce|mobile);\sppc;/i], [[c, "arm"]], [/((?:ppc|powerpc)(?:64)?)(?:\smac|;|\))/i], [[c, /ower/, "", b.lowerize]], [/(sun4\w)[;\)]/i], [[c, "sparc"]], [/(ia64(?=;)|68k(?=\))|arm(?=v\d+;)|(?:irix|mips|sparc)(?:64)?(?=;)|pa-risc)/i], [c, b.lowerize]],
  1454. device: [[/\((ipad|playbook);[\w\s\);-]+(rim|apple)/i], [d, p, [l, f]], [/applecoremedia\/[\w\.]+ \((ipad)/], [d, [p, "Apple"], [l, f]], [/(apple\s{0,1}tv)/i], [[d, "Apple TV"], [p, "Apple"]], [/(hp).+(touchpad)/i, /(kindle)\/([\w\.]+)/i, /\s(nook)[\w\s]+build\/(\w+)/i, /(dell)\s(strea[kpr\s\d]*[\dko])/i], [p, d, [l, f]], [/\((ip[honed|\s\w*]+);.+(apple)/i], [d, p, [l, g]], [/\((ip[honed|\s\w*]+);/i], [d, [p, "Apple"], [l, g]], [/(blackberry)[\s-]?(\w+)/i, /(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|huawei|meizu|motorola)[\s_-]?([\w-]+)*/i, /(hp)\s([\w\s]+\w)/i, /(asus)-?(\w+)/i], [p, d, [l, g]], [/\((bb10);\s(\w+)/i], [[p, "BlackBerry"], d, [l, g]], [/android.+((transfo[prime\s]{4,10}\s\w+|eeepc|slider\s\w+))/i], [[p, "Asus"], d, [l, f]], [/(sony)\s(tablet\s[ps])/i], [p, d, [l, f]], [/(nintendo)\s([wids3u]+)/i], [p, d, [l, u]], [/((playstation)\s[3portablevi]+)/i], [[p, "Sony"], d, [l, u]], [/(sprint\s(\w+))/i], [[p, y.str, v.device.sprint.vendor], [d, y.str, v.device.sprint.model], [l, g]], [/(htc)[;_\s-]+([\w\s]+(?=\))|\w+)*/i, /(zte)-(\w+)*/i, /(alcatel|geeksphone|huawei|lenovo|nexian|panasonic|(?=;\s)sony)[_\s-]?([\w-]+)*/i], [p, [d, /_/g, " "], [l, g]], [/\s((milestone|droid(?:[2-4x]|\s(?:bionic|x2|pro|razr))?(:?\s4g)?))[\w\s]+build\//i, /(mot)[\s-]?(\w+)*/i], [[p, "Motorola"], d, [l, g]], [/android.+\s((mz60\d|xoom[\s2]{0,2}))\sbuild\//i], [[p, "Motorola"], d, [l, f]], [/android.+((sch-i[89]0\d|shw-m380s|gt-p\d{4}|gt-n8000|sgh-t8[56]9))/i], [[p, "Samsung"], d, [l, f]], [/((s[cgp]h-\w+|gt-\w+|galaxy\snexus))/i, /(sam[sung]*)[\s-]*(\w+-?[\w-]*)*/i, /sec-((sgh\w+))/i], [[p, "Samsung"], d, [l, g]], [/(sie)-(\w+)*/i], [[p, "Siemens"], d, [l, g]], [/(maemo|nokia).*(n900|lumia\s\d+)/i, /(nokia)[\s_-]?([\w-]+)*/i], [[p, "Nokia"], d, [l, g]], [/android\s3\.[\s\w-;]{10}((a\d{3}))/i], [[p, "Acer"], d, [l, f]], [/android\s3\.[\s\w-;]{10}(lg?)-([06cv9]{3,4})/i], [[p, "LG"], d, [l, f]], [/((nexus\s[45]))/i, /(lg)[e;\s-\/]+(\w+)*/i], [[p, "LG"], d, [l, g]], [/android.+((ideatab[a-z0-9\-\s]+))/i], [[p, "Lenovo"], d, [l, f]], [/(lg) netcast\.tv/i], [p, [l, h]], [/(mobile|tablet);.+rv\:.+gecko\//i], [l, p, d]],
  1455. engine: [[/(presto)\/([\w\.]+)/i, /(webkit|trident|netfront|netsurf|amaya|lynx|w3m)\/([\w\.]+)/i, /(khtml|tasman|links)[\/\s]\(?([\w\.]+)/i, /(icab)[\/\s]([23]\.[\d\.]+)/i], [w, m], [/rv\:([\w\.]+).*(gecko)/i], [m, w]],
  1456. os: [[/microsoft\s(windows)\s(vista|xp)/i], [w, m], [/(windows)\snt\s6\.2;\s(arm)/i, /(windows\sphone(?:\sos)*|windows\smobile|windows)[\s\/]?([ntce\d\.\s]+\w)/i], [w, [m, y.str, v.os.windows.version]], [/(win(?=3|9|n)|win\s9x\s)([nt\d\.]+)/i], [[w, "Windows"], [m, y.str, v.os.windows.version]], [/\((bb)(10);/i], [[w, "BlackBerry"], m], [/(blackberry)\w*\/?([\w\.]+)*/i, /(tizen)\/([\w\.]+)/i, /(android|webos|palm\os|qnx|bada|rim\stablet\sos|meego)[\/\s-]?([\w\.]+)*/i], [w, m], [/(symbian\s?os|symbos|s60(?=;))[\/\s-]?([\w\.]+)*/i], [[w, "Symbian"], m], [/mozilla.+\(mobile;.+gecko.+firefox/i], [[w, "Firefox OS"], m], [/(nintendo|playstation)\s([wids3portablevu]+)/i, /(mint)[\/\s\(]?(\w+)*/i, /(joli|[kxln]?ubuntu|debian|[open]*suse|gentoo|arch|slackware|fedora|mandriva|centos|pclinuxos|redhat|zenwalk)[\/\s-]?([\w\.-]+)*/i, /(hurd|linux)\s?([\w\.]+)*/i, /(gnu)\s?([\w\.]+)*/i], [w, m], [/(cros)\s[\w]+\s([\w\.]+\w)/i], [[w, "Chromium OS"], m], [/(sunos)\s?([\w\.]+\d)*/i], [[w, "Solaris"], m], [/\s([frentopc-]{0,4}bsd|dragonfly)\s?([\w\.]+)*/i], [w, m], [/(ip[honead]+)(?:.*os\s*([\w]+)*\slike\smac|;\sopera)/i], [[w, "iOS"], [m, /_/g, "."]], [/(mac\sos\sx)\s?([\w\s\.]+\w)*/i], [w, [m, /_/g, "."]], [/(haiku)\s(\w+)/i, /(aix)\s((\d)(?=\.|\)|\s)[\w\.]*)*/i, /(macintosh|mac(?=_powerpc)|plan\s9|minix|beos|os\/2|amigaos|morphos|risc\sos)/i, /(unix)\s?([\w\.]+)*/i], [w, m]]
  1457. }
  1458. , x = function(e) {
  1459. var r = e || (i && i.navigator && i.navigator.userAgent ? i.navigator.userAgent : s);
  1460. return this instanceof x ? (this.getBrowser = function() {
  1461. return y.rgx.apply(this, k.browser)
  1462. }
  1463. ,
  1464. this.getCPU = function() {
  1465. return y.rgx.apply(this, k.cpu)
  1466. }
  1467. ,
  1468. this.getDevice = function() {
  1469. return y.rgx.apply(this, k.device)
  1470. }
  1471. ,
  1472. this.getEngine = function() {
  1473. return y.rgx.apply(this, k.engine)
  1474. }
  1475. ,
  1476. this.getOS = function() {
  1477. return y.rgx.apply(this, k.os)
  1478. }
  1479. ,
  1480. this.getResult = function() {
  1481. return {
  1482. ua: this.getUA(),
  1483. browser: this.getBrowser(),
  1484. engine: this.getEngine(),
  1485. os: this.getOS(),
  1486. device: this.getDevice(),
  1487. cpu: this.getCPU()
  1488. }
  1489. }
  1490. ,
  1491. this.getUA = function() {
  1492. return r
  1493. }
  1494. ,
  1495. this.setUA = function(i) {
  1496. return r = i,
  1497. this
  1498. }
  1499. ,
  1500. void this.setUA(r)) : new x(e).getResult()
  1501. };
  1502. if (typeof exports !== a)
  1503. typeof module !== a && module.exports && (exports = module.exports = x),
  1504. exports.UAParser = x;
  1505. else if (i.UAParser = x,
  1506. typeof define === o && define.amd && define(function() {
  1507. return x
  1508. }),
  1509. typeof i.jQuery !== a) {
  1510. var A = i.jQuery
  1511. , _ = new x;
  1512. A.ua = _.getResult(),
  1513. A.ua.get = function() {
  1514. return _.getUA()
  1515. }
  1516. ,
  1517. A.ua.set = function(i) {
  1518. _.setUA(i);
  1519. var e = _.getResult();
  1520. for (var s in e)
  1521. A.ua[s] = e[s]
  1522. }
  1523. }
  1524. }(this);
  1525. window.Modernizr = function(n, e, t) {
  1526. function o(n) {
  1527. d.cssText = n
  1528. }
  1529. function r(n, e) {
  1530. return typeof n === e
  1531. }
  1532. var i, c, u, a = "2.8.2", f = {}, s = e.documentElement, l = "modernizr", p = e.createElement(l), d = p.style, y = ({}.toString,
  1533. {}), w = [], b = w.slice, v = {}.hasOwnProperty;
  1534. u = r(v, "undefined") || r(v.call, "undefined") ? function(n, e) {
  1535. return e in n && r(n.constructor.prototype[e], "undefined")
  1536. }
  1537. : function(n, e) {
  1538. return v.call(n, e)
  1539. }
  1540. ,
  1541. Function.prototype.bind || (Function.prototype.bind = function(n) {
  1542. var e = this;
  1543. if ("function" != typeof e)
  1544. throw new TypeError;
  1545. var t = b.call(arguments, 1)
  1546. , o = function() {
  1547. if (this instanceof o) {
  1548. var r = function() {};
  1549. r.prototype = e.prototype;
  1550. var i = new r
  1551. , c = e.apply(i, t.concat(b.call(arguments)));
  1552. return Object(c) === c ? c : i
  1553. }
  1554. return e.apply(n, t.concat(b.call(arguments)))
  1555. };
  1556. return o
  1557. }
  1558. ),
  1559. y.webgl = function() {
  1560. return !!n.WebGLRenderingContext
  1561. }
  1562. ;
  1563. for (var h in y)
  1564. u(y, h) && (c = h.toLowerCase(),
  1565. f[c] = y[h](),
  1566. w.push((f[c] ? "" : "no-") + c));
  1567. return f.addTest = function(n, e) {
  1568. if ("object" == typeof n)
  1569. for (var o in n)
  1570. u(n, o) && f.addTest(o, n[o]);
  1571. else {
  1572. if (n = n.toLowerCase(),
  1573. f[n] !== t)
  1574. return f;
  1575. e = "function" == typeof e ? e() : e,
  1576. "undefined" != typeof enableClasses && enableClasses && (s.className += " " + (e ? "" : "no-") + n),
  1577. f[n] = e
  1578. }
  1579. return f
  1580. }
  1581. ,
  1582. o(""),
  1583. p = i = null,
  1584. f._version = a,
  1585. f
  1586. }(this, this.document);
  1587. !function(e, t, a) {
  1588. "use strict";
  1589. function n(t, h, m) {
  1590. function H(a) {
  1591. var n = 0
  1592. , i = Ee.length;
  1593. if (Ce.old = e.extend({}, Ce),
  1594. Ie = we ? 0 : be[ge.horizontal ? "width" : "height"](),
  1595. ke = Be[ge.horizontal ? "width" : "height"](),
  1596. ze = we ? t : Pe[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1597. Ee.length = 0,
  1598. Ce.start = 0,
  1599. Ce.end = q(ze - Ie, 0),
  1600. Re) {
  1601. n = Ne.length,
  1602. qe = Pe.children(ge.itemSelector),
  1603. Ne.length = 0;
  1604. var r, s = c(Pe, ge.horizontal ? "paddingLeft" : "paddingTop"), o = c(Pe, ge.horizontal ? "paddingRight" : "paddingBottom"), l = "border-box" === e(qe).css("boxSizing"), u = "none" !== qe.css("float"), f = 0, v = qe.length - 1;
  1605. ze = 0,
  1606. qe.each(function(t, a) {
  1607. var n = e(a)
  1608. , i = a.getBoundingClientRect()
  1609. , l = E(ge.horizontal ? i.width || i.right - i.left : i.height || i.bottom - i.top)
  1610. , d = c(n, ge.horizontal ? "marginLeft" : "marginTop")
  1611. , p = c(n, ge.horizontal ? "marginRight" : "marginBottom")
  1612. , h = l + d + p
  1613. , m = !d || !p
  1614. , g = {};
  1615. g.el = a,
  1616. g.size = m ? l : h,
  1617. g.half = g.size / 2,
  1618. g.start = ze + (m ? d : 0),
  1619. g.center = g.start - E(Ie / 2 - g.size / 2),
  1620. g.end = g.start - Ie + g.size,
  1621. t || (ze += s),
  1622. ze += h,
  1623. ge.horizontal || u || p && d && t > 0 && (ze -= N(d, p)),
  1624. t === v && (g.end += o,
  1625. ze += o,
  1626. f = m ? p : 0),
  1627. Ne.push(g),
  1628. r = g
  1629. }),
  1630. Pe[0].style[ge.horizontal ? "width" : "height"] = (l ? ze : ze - s - o) + "px",
  1631. ze -= f,
  1632. Ne.length ? (Ce.start = Ne[0][Me ? "center" : "start"],
  1633. Ce.end = Me ? r.center : ze > Ie ? r.end : Ce.start) : Ce.start = Ce.end = 0
  1634. }
  1635. if (Ce.center = E(Ce.end / 2 + Ce.start / 2),
  1636. Q(),
  1637. Se.length && ke > 0 && (ge.dynamicHandle ? (Te = Ce.start === Ce.end ? ke : E(ke * Ie / ze),
  1638. Te = d(Te, ge.minHandleSize, ke),
  1639. Se[0].style[ge.horizontal ? "width" : "height"] = Te + "px") : Te = Se[ge.horizontal ? "outerWidth" : "outerHeight"](),
  1640. xe.end = ke - Te,
  1641. it || j()),
  1642. !we && Ie > 0) {
  1643. var p = Ce.start
  1644. , h = "";
  1645. if (Re)
  1646. e.each(Ne, function(e, t) {
  1647. Me ? Ee.push(t.center) : t.start + t.size > p && p <= Ce.end && (p = t.start,
  1648. Ee.push(p),
  1649. p += Ie,
  1650. p > Ce.end && p < Ce.end + Ie && Ee.push(Ce.end))
  1651. });
  1652. else
  1653. for (; p - Ie < Ce.end; )
  1654. Ee.push(p),
  1655. p += Ie;
  1656. if (De[0] && i !== Ee.length) {
  1657. for (var m = 0; m < Ee.length; m++)
  1658. h += ge.pageBuilder.call(ye, m);
  1659. Ae = De.html(h).children(),
  1660. Ae.eq(Oe.activePage).addClass(ge.activeClass)
  1661. }
  1662. }
  1663. if (Oe.slideeSize = ze,
  1664. Oe.frameSize = Ie,
  1665. Oe.sbSize = ke,
  1666. Oe.handleSize = Te,
  1667. Re) {
  1668. a && null != ge.startAt && (W(ge.startAt),
  1669. ye[Le ? "toCenter" : "toStart"](ge.startAt));
  1670. var g = Ne[Oe.activeItem];
  1671. X(Le && g ? g.center : d(Ce.dest, Ce.start, Ce.end))
  1672. } else
  1673. a ? null != ge.startAt && X(ge.startAt, 1) : X(d(Ce.dest, Ce.start, Ce.end));
  1674. pe("load")
  1675. }
  1676. function X(e, t, a) {
  1677. if (Re && at.released && !a) {
  1678. var n = $(e)
  1679. , i = e > Ce.start && e < Ce.end;
  1680. Le ? (i && (e = Ne[n.centerItem].center),
  1681. Me && ge.activateMiddle && W(n.centerItem)) : i && (e = Ne[n.firstItem].start)
  1682. }
  1683. 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),
  1684. et.start = +new Date,
  1685. et.time = 0,
  1686. et.from = Ce.cur,
  1687. et.to = e,
  1688. et.delta = e - Ce.cur,
  1689. et.tweesing = at.tweese || at.init && !at.slidee,
  1690. et.immediate = !et.tweesing && (t || at.init && at.slidee || !ge.speed),
  1691. at.tweese = 0,
  1692. e !== Ce.dest && (Ce.dest = e,
  1693. pe("change"),
  1694. it || Y()),
  1695. K(),
  1696. Q(),
  1697. Z(),
  1698. F()
  1699. }
  1700. function Y() {
  1701. if (ye.initialized) {
  1702. if (!it)
  1703. return it = w(Y),
  1704. void (at.released && pe("moveStart"));
  1705. et.immediate ? Ce.cur = et.to : et.tweesing ? (et.tweeseDelta = et.to - Ce.cur,
  1706. x(et.tweeseDelta) < .1 ? Ce.cur = et.to : Ce.cur += et.tweeseDelta * (at.released ? ge.swingSpeed : ge.syncSpeed)) : (et.time = N(+new Date - et.start, ge.speed),
  1707. Ce.cur = et.from + et.delta * e.easing[ge.easing](et.time / ge.speed, et.time, 0, 1, ge.speed)),
  1708. et.to === Ce.cur ? (Ce.cur = et.to,
  1709. at.tweese = it = 0) : it = w(Y),
  1710. pe("move"),
  1711. 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"),
  1712. !it && at.released && pe("moveEnd"),
  1713. j()
  1714. }
  1715. }
  1716. function j() {
  1717. Se.length && (xe.cur = Ce.start === Ce.end ? 0 : ((at.init && !at.slidee ? Ce.dest : Ce.cur) - Ce.start) / (Ce.end - Ce.start) * xe.end,
  1718. xe.cur = d(E(xe.cur), xe.start, xe.end),
  1719. _e.hPos !== xe.cur && (_e.hPos = xe.cur,
  1720. f ? Se[0].style[f] = v + (ge.horizontal ? "translateX" : "translateY") + "(" + xe.cur + "px)" : Se[0].style[ge.horizontal ? "left" : "top"] = xe.cur + "px"))
  1721. }
  1722. function F() {
  1723. Ae[0] && _e.page !== Oe.activePage && (_e.page = Oe.activePage,
  1724. Ae.removeClass(ge.activeClass).eq(Oe.activePage).addClass(ge.activeClass),
  1725. pe("activePage", _e.page))
  1726. }
  1727. function M() {
  1728. tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) || ye.stop(),
  1729. ot = at.init ? w(M) : 0,
  1730. tt.now = +new Date,
  1731. tt.pos = Ce.cur + (tt.now - tt.lastTime) / 1e3 * tt.speed,
  1732. X(at.init ? tt.pos : E(tt.pos)),
  1733. at.init || Ce.cur !== Ce.dest || pe("moveEnd"),
  1734. tt.lastTime = tt.now
  1735. }
  1736. function L(e, t, n) {
  1737. if ("boolean" === i(t) && (n = t,
  1738. t = a),
  1739. t === a)
  1740. X(Ce[e], n);
  1741. else {
  1742. if (Le && "center" !== e)
  1743. return;
  1744. var r = ye.getPos(t);
  1745. r && X(r[e], n, !Le)
  1746. }
  1747. }
  1748. function R(e) {
  1749. return null != e ? l(e) ? e >= 0 && e < Ne.length ? e : -1 : qe.index(e) : -1
  1750. }
  1751. function U(e) {
  1752. return R(l(e) && 0 > e ? e + Ne.length : e)
  1753. }
  1754. function W(e, t) {
  1755. var a = R(e);
  1756. return !(!Re || 0 > a) && ((_e.active !== a || t) && (qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  1757. qe.eq(a).addClass(ge.activeClass),
  1758. _e.active = Oe.activeItem = a,
  1759. Z(),
  1760. pe("active", a)),
  1761. a)
  1762. }
  1763. function $(e) {
  1764. e = d(l(e) ? e : Ce.dest, Ce.start, Ce.end);
  1765. var t = {}
  1766. , a = Me ? 0 : Ie / 2;
  1767. if (!we)
  1768. for (var n = 0, i = Ee.length; i > n; n++) {
  1769. if (e >= Ce.end || n === Ee.length - 1) {
  1770. t.activePage = Ee.length - 1;
  1771. break
  1772. }
  1773. if (e <= Ee[n] + a) {
  1774. t.activePage = n;
  1775. break
  1776. }
  1777. }
  1778. if (Re) {
  1779. for (var r = !1, s = !1, o = !1, c = 0, u = Ne.length; u > c; c++)
  1780. if (r === !1 && e <= Ne[c].start + Ne[c].half && (r = c),
  1781. o === !1 && e <= Ne[c].center + Ne[c].half && (o = c),
  1782. c === u - 1 || e <= Ne[c].end + Ne[c].half) {
  1783. s = c;
  1784. break
  1785. }
  1786. t.firstItem = l(r) ? r : 0,
  1787. t.centerItem = l(o) ? o : t.firstItem,
  1788. t.lastItem = l(s) ? s : t.centerItem
  1789. }
  1790. return t
  1791. }
  1792. function Q(t) {
  1793. e.extend(Oe, $(t))
  1794. }
  1795. function Z() {
  1796. var e = Ce.dest <= Ce.start
  1797. , t = Ce.dest >= Ce.end
  1798. , a = (e ? 1 : 0) | (t ? 2 : 0);
  1799. if (_e.slideePosState !== a && (_e.slideePosState = a,
  1800. Je.is("button,input") && Je.prop("disabled", e),
  1801. Ke.is("button,input") && Ke.prop("disabled", t),
  1802. Je.add(Qe)[e ? "addClass" : "removeClass"](ge.disabledClass),
  1803. Ke.add($e)[t ? "addClass" : "removeClass"](ge.disabledClass)),
  1804. _e.fwdbwdState !== a && at.released && (_e.fwdbwdState = a,
  1805. Qe.is("button,input") && Qe.prop("disabled", e),
  1806. $e.is("button,input") && $e.prop("disabled", t)),
  1807. Re && null != Oe.activeItem) {
  1808. var n = 0 === Oe.activeItem
  1809. , i = Oe.activeItem >= Ne.length - 1
  1810. , r = (n ? 1 : 0) | (i ? 2 : 0);
  1811. _e.itemsButtonState !== r && (_e.itemsButtonState = r,
  1812. Ze.is("button,input") && Ze.prop("disabled", n),
  1813. Ge.is("button,input") && Ge.prop("disabled", i),
  1814. Ze[n ? "addClass" : "removeClass"](ge.disabledClass),
  1815. Ge[i ? "addClass" : "removeClass"](ge.disabledClass))
  1816. }
  1817. }
  1818. function G(e, t, a) {
  1819. if (e = U(e),
  1820. t = U(t),
  1821. e > -1 && t > -1 && e !== t && (!a || t !== e - 1) && (a || t !== e + 1)) {
  1822. qe.eq(e)[a ? "insertAfter" : "insertBefore"](Ne[t].el);
  1823. var n = t > e ? e : a ? t : t - 1
  1824. , i = e > t ? e : a ? t + 1 : t
  1825. , r = e > t;
  1826. null != Oe.activeItem && (e === Oe.activeItem ? _e.active = Oe.activeItem = a ? r ? t + 1 : t : r ? t : t - 1 : Oe.activeItem > n && Oe.activeItem < i && (_e.active = Oe.activeItem += r ? 1 : -1)),
  1827. H()
  1828. }
  1829. }
  1830. function J(e, t) {
  1831. for (var a = 0, n = Ve[e].length; n > a; a++)
  1832. if (Ve[e][a] === t)
  1833. return a;
  1834. return -1
  1835. }
  1836. function K() {
  1837. at.released && !ye.isPaused && ye.resume()
  1838. }
  1839. function V(e) {
  1840. return E(d(e, xe.start, xe.end) / xe.end * (Ce.end - Ce.start)) + Ce.start
  1841. }
  1842. function _() {
  1843. at.history[0] = at.history[1],
  1844. at.history[1] = at.history[2],
  1845. at.history[2] = at.history[3],
  1846. at.history[3] = at.delta
  1847. }
  1848. function ee(e) {
  1849. at.released = 0,
  1850. at.source = e,
  1851. at.slidee = "slidee" === e
  1852. }
  1853. function te(t) {
  1854. var a = "touchstart" === t.type
  1855. , n = t.data.source
  1856. , i = "slidee" === n;
  1857. at.init || !a && ie(t.target) || ("handle" !== n || ge.dragHandle && xe.start !== xe.end) && (!i || (a ? ge.touchDragging : ge.mouseDragging && t.which < 2)) && (a || r(t),
  1858. ee(n),
  1859. at.init = 0,
  1860. at.$source = e(t.target),
  1861. at.touch = a,
  1862. at.pointer = a ? t.originalEvent.touches[0] : t,
  1863. at.initX = at.pointer.pageX,
  1864. at.initY = at.pointer.pageY,
  1865. at.initPos = i ? Ce.cur : xe.cur,
  1866. at.start = +new Date,
  1867. at.time = 0,
  1868. at.path = 0,
  1869. at.delta = 0,
  1870. at.locked = 0,
  1871. at.history = [0, 0, 0, 0],
  1872. at.pathToLock = i ? a ? 30 : 10 : 0,
  1873. b.on(a ? z : I, ae),
  1874. ye.pause(1),
  1875. (i ? Pe : Se).addClass(ge.draggedClass),
  1876. pe("moveStart"),
  1877. i && (rt = setInterval(_, 10)))
  1878. }
  1879. function ae(e) {
  1880. if (at.released = "mouseup" === e.type || "touchend" === e.type,
  1881. at.pointer = at.touch ? e.originalEvent[at.released ? "changedTouches" : "touches"][0] : e,
  1882. at.pathX = at.pointer.pageX - at.initX,
  1883. at.pathY = at.pointer.pageY - at.initY,
  1884. at.path = D(A(at.pathX, 2) + A(at.pathY, 2)),
  1885. at.delta = ge.horizontal ? at.pathX : at.pathY,
  1886. at.released || !(at.path < 1)) {
  1887. if (!at.init) {
  1888. if (!(ge.horizontal ? x(at.pathX) > x(at.pathY) : x(at.pathX) < x(at.pathY)))
  1889. return ne();
  1890. at.init = 1
  1891. }
  1892. r(e),
  1893. !at.locked && at.path > at.pathToLock && at.slidee && (at.locked = 1,
  1894. at.$source.on(B, s)),
  1895. at.released && (ne(),
  1896. ge.releaseSwing && at.slidee && (at.swing = (at.delta - at.history[0]) / 40 * 300,
  1897. at.delta += at.swing,
  1898. at.tweese = x(at.swing) > 10)),
  1899. X(at.slidee ? E(at.initPos - at.delta) : V(at.initPos + at.delta))
  1900. }
  1901. }
  1902. function ne() {
  1903. clearInterval(rt),
  1904. at.released = !0,
  1905. b.off(at.touch ? z : I, ae),
  1906. (at.slidee ? Pe : Se).removeClass(ge.draggedClass),
  1907. setTimeout(function() {
  1908. at.$source.off(B, s)
  1909. }),
  1910. Ce.cur === Ce.dest && at.init && pe("moveEnd"),
  1911. ye.resume(1),
  1912. at.init = 0
  1913. }
  1914. function ie(t) {
  1915. return ~e.inArray(t.nodeName, k) || e(t).is(ge.interactive)
  1916. }
  1917. function re() {
  1918. ye.stop(),
  1919. b.off("mouseup", re)
  1920. }
  1921. function se(e) {
  1922. switch (r(e),
  1923. this) {
  1924. case $e[0]:
  1925. case Qe[0]:
  1926. ye.moveBy($e.is(this) ? ge.moveBy : -ge.moveBy),
  1927. b.on("mouseup", re);
  1928. break;
  1929. case Ze[0]:
  1930. ye.prev();
  1931. break;
  1932. case Ge[0]:
  1933. ye.next();
  1934. break;
  1935. case Je[0]:
  1936. ye.prevPage();
  1937. break;
  1938. case Ke[0]:
  1939. ye.nextPage()
  1940. }
  1941. }
  1942. function oe(e) {
  1943. return nt.curDelta = (ge.horizontal ? e.deltaY || e.deltaX : e.deltaY) || -e.wheelDelta,
  1944. nt.curDelta /= 1 === e.deltaMode ? 3 : 100,
  1945. Re ? (p = +new Date,
  1946. nt.last < p - nt.resetTime && (nt.delta = 0),
  1947. nt.last = p,
  1948. nt.delta += nt.curDelta,
  1949. x(nt.delta) < 1 ? nt.finalDelta = 0 : (nt.finalDelta = E(nt.delta / 1),
  1950. nt.delta %= 1),
  1951. nt.finalDelta) : nt.curDelta
  1952. }
  1953. function le(e) {
  1954. e.originalEvent[g] = ye;
  1955. var t = +new Date;
  1956. if (O + ge.scrollHijack > t && Ue[0] !== document && Ue[0] !== window)
  1957. return void (O = t);
  1958. if (ge.scrollBy && Ce.start !== Ce.end) {
  1959. var a = oe(e.originalEvent);
  1960. (ge.scrollTrap || a > 0 && Ce.dest < Ce.end || 0 > a && Ce.dest > Ce.start) && r(e, 1),
  1961. ye.slideBy(ge.scrollBy * a)
  1962. }
  1963. }
  1964. function ce(e) {
  1965. ge.clickBar && e.target === Be[0] && (r(e),
  1966. X(V((ge.horizontal ? e.pageX - Be.offset().left : e.pageY - Be.offset().top) - Te / 2)))
  1967. }
  1968. function de(e) {
  1969. if (ge.keyboardNavBy)
  1970. switch (e.which) {
  1971. case ge.horizontal ? 37 : 38:
  1972. r(e),
  1973. ye["pages" === ge.keyboardNavBy ? "prevPage" : "prev"]();
  1974. break;
  1975. case ge.horizontal ? 39 : 40:
  1976. r(e),
  1977. ye["pages" === ge.keyboardNavBy ? "nextPage" : "next"]()
  1978. }
  1979. }
  1980. function ue(e) {
  1981. return ie(this) ? void (e.originalEvent[g + "ignore"] = !0) : void (this.parentNode !== Pe[0] || e.originalEvent[g + "ignore"] || ye.activate(this))
  1982. }
  1983. function fe() {
  1984. this.parentNode === De[0] && ye.activatePage(Ae.index(this))
  1985. }
  1986. function ve(e) {
  1987. ge.pauseOnHover && ye["mouseenter" === e.type ? "pause" : "resume"](2)
  1988. }
  1989. function pe(e, t) {
  1990. if (Ve[e]) {
  1991. for (me = Ve[e].length,
  1992. T.length = 0,
  1993. he = 0; me > he; he++)
  1994. T.push(Ve[e][he]);
  1995. for (he = 0; me > he; he++)
  1996. T[he].call(ye, e, t)
  1997. }
  1998. }
  1999. var he, me, ge = e.extend({}, n.defaults, h), ye = this, we = l(t), be = e(t), Pe = ge.slidee ? e(ge.slidee).eq(0) : be.children().eq(0), Ie = 0, ze = 0, Ce = {
  2000. start: 0,
  2001. center: 0,
  2002. end: 0,
  2003. cur: 0,
  2004. dest: 0
  2005. }, Be = e(ge.scrollBar).eq(0), Se = Be.children().eq(0), ke = 0, Te = 0, xe = {
  2006. start: 0,
  2007. end: 0,
  2008. cur: 0
  2009. }, De = e(ge.pagesBar), Ae = 0, Ee = [], qe = 0, Ne = [], Oe = {
  2010. firstItem: 0,
  2011. lastItem: 0,
  2012. centerItem: 0,
  2013. activeItem: null,
  2014. activePage: 0
  2015. }, He = new u(be[0]), Xe = new u(Pe[0]), Ye = new u(Be[0]), je = new u(Se[0]), Fe = "basic" === ge.itemNav, Me = "forceCentered" === ge.itemNav, Le = "centered" === ge.itemNav || Me, Re = !we && (Fe || Le || Me), Ue = ge.scrollSource ? e(ge.scrollSource) : be, We = ge.dragSource ? e(ge.dragSource) : be, $e = e(ge.forward), Qe = e(ge.backward), Ze = e(ge.prev), Ge = e(ge.next), Je = e(ge.prevPage), Ke = e(ge.nextPage), Ve = {}, _e = {}, et = {}, tt = {}, at = {
  2016. released: 1
  2017. }, nt = {
  2018. last: 0,
  2019. delta: 0,
  2020. resetTime: 200
  2021. }, it = 0, rt = 0, st = 0, ot = 0;
  2022. we || (t = be[0]),
  2023. ye.initialized = 0,
  2024. ye.frame = t,
  2025. ye.slidee = Pe[0],
  2026. ye.pos = Ce,
  2027. ye.rel = Oe,
  2028. ye.items = Ne,
  2029. ye.pages = Ee,
  2030. ye.isPaused = 0,
  2031. ye.options = ge,
  2032. ye.dragging = at,
  2033. ye.reload = function() {
  2034. H()
  2035. }
  2036. ,
  2037. ye.getPos = function(e) {
  2038. if (Re) {
  2039. var t = R(e);
  2040. return -1 !== t && Ne[t]
  2041. }
  2042. var a = Pe.find(e).eq(0);
  2043. if (a[0]) {
  2044. var n = ge.horizontal ? a.offset().left - Pe.offset().left : a.offset().top - Pe.offset().top
  2045. , i = a[ge.horizontal ? "outerWidth" : "outerHeight"]();
  2046. return {
  2047. start: n,
  2048. center: n - Ie / 2 + i / 2,
  2049. end: n - Ie + i,
  2050. size: i
  2051. }
  2052. }
  2053. return !1
  2054. }
  2055. ,
  2056. ye.moveBy = function(e) {
  2057. tt.speed = e,
  2058. !at.init && tt.speed && Ce.cur !== (tt.speed > 0 ? Ce.end : Ce.start) && (tt.lastTime = +new Date,
  2059. tt.startPos = Ce.cur,
  2060. ee("button"),
  2061. at.init = 1,
  2062. pe("moveStart"),
  2063. y(ot),
  2064. M())
  2065. }
  2066. ,
  2067. ye.stop = function() {
  2068. "button" === at.source && (at.init = 0,
  2069. at.released = 1)
  2070. }
  2071. ,
  2072. ye.prev = function() {
  2073. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem - 1)
  2074. }
  2075. ,
  2076. ye.next = function() {
  2077. ye.activate(null == Oe.activeItem ? 0 : Oe.activeItem + 1)
  2078. }
  2079. ,
  2080. ye.prevPage = function() {
  2081. ye.activatePage(Oe.activePage - 1)
  2082. }
  2083. ,
  2084. ye.nextPage = function() {
  2085. ye.activatePage(Oe.activePage + 1)
  2086. }
  2087. ,
  2088. ye.slideBy = function(e, t) {
  2089. e && (Re ? ye[Le ? "toCenter" : "toStart"](d((Le ? Oe.centerItem : Oe.firstItem) + ge.scrollBy * e, 0, Ne.length)) : X(Ce.dest + e, t))
  2090. }
  2091. ,
  2092. ye.slideTo = function(e, t) {
  2093. X(e, t)
  2094. }
  2095. ,
  2096. ye.toStart = function(e, t) {
  2097. L("start", e, t)
  2098. }
  2099. ,
  2100. ye.toEnd = function(e, t) {
  2101. L("end", e, t)
  2102. }
  2103. ,
  2104. ye.toCenter = function(e, t) {
  2105. L("center", e, t)
  2106. }
  2107. ,
  2108. ye.getIndex = R,
  2109. ye.activate = function(e, t) {
  2110. var a = W(e);
  2111. ge.smart && a !== !1 && (Le ? ye.toCenter(a, t) : a >= Oe.lastItem ? ye.toStart(a, t) : a <= Oe.firstItem ? ye.toEnd(a, t) : K())
  2112. }
  2113. ,
  2114. ye.activatePage = function(e, t) {
  2115. l(e) && X(Ee[d(e, 0, Ee.length - 1)], t)
  2116. }
  2117. ,
  2118. ye.resume = function(e) {
  2119. ge.cycleBy && ge.cycleInterval && ("items" !== ge.cycleBy || Ne[0] && null != Oe.activeItem) && !(e < ye.isPaused) && (ye.isPaused = 0,
  2120. st ? st = clearTimeout(st) : pe("resume"),
  2121. st = setTimeout(function() {
  2122. switch (pe("cycle"),
  2123. ge.cycleBy) {
  2124. case "items":
  2125. ye.activate(Oe.activeItem >= Ne.length - 1 ? 0 : Oe.activeItem + 1);
  2126. break;
  2127. case "pages":
  2128. ye.activatePage(Oe.activePage >= Ee.length - 1 ? 0 : Oe.activePage + 1)
  2129. }
  2130. }, ge.cycleInterval))
  2131. }
  2132. ,
  2133. ye.pause = function(e) {
  2134. e < ye.isPaused || (ye.isPaused = e || 100,
  2135. st && (st = clearTimeout(st),
  2136. pe("pause")))
  2137. }
  2138. ,
  2139. ye.toggle = function() {
  2140. ye[st ? "pause" : "resume"]()
  2141. }
  2142. ,
  2143. ye.set = function(t, a) {
  2144. e.isPlainObject(t) ? e.extend(ge, t) : ge.hasOwnProperty(t) && (ge[t] = a)
  2145. }
  2146. ,
  2147. ye.add = function(t, a) {
  2148. var n = e(t);
  2149. Re ? (null == a || !Ne[0] || a >= Ne.length ? n.appendTo(Pe) : Ne.length && n.insertBefore(Ne[a].el),
  2150. null != Oe.activeItem && a <= Oe.activeItem && (_e.active = Oe.activeItem += n.length)) : Pe.append(n),
  2151. H()
  2152. }
  2153. ,
  2154. ye.remove = function(t) {
  2155. if (Re) {
  2156. var a = U(t);
  2157. if (a > -1) {
  2158. qe.eq(a).remove();
  2159. var n = a === Oe.activeItem;
  2160. null != Oe.activeItem && a < Oe.activeItem && (_e.active = --Oe.activeItem),
  2161. H(),
  2162. n && (_e.active = null,
  2163. ye.activate(Oe.activeItem))
  2164. }
  2165. } else
  2166. e(t).remove(),
  2167. H()
  2168. }
  2169. ,
  2170. ye.moveAfter = function(e, t) {
  2171. G(e, t, 1)
  2172. }
  2173. ,
  2174. ye.moveBefore = function(e, t) {
  2175. G(e, t)
  2176. }
  2177. ,
  2178. ye.on = function(e, t) {
  2179. if ("object" === i(e))
  2180. for (var a in e)
  2181. e.hasOwnProperty(a) && ye.on(a, e[a]);
  2182. else if ("function" === i(t))
  2183. for (var n = e.split(" "), r = 0, s = n.length; s > r; r++)
  2184. Ve[n[r]] = Ve[n[r]] || [],
  2185. -1 === J(n[r], t) && Ve[n[r]].push(t);
  2186. else if ("array" === i(t))
  2187. for (var o = 0, l = t.length; l > o; o++)
  2188. ye.on(e, t[o])
  2189. }
  2190. ,
  2191. ye.one = function(e, t) {
  2192. function a() {
  2193. t.apply(ye, arguments),
  2194. ye.off(e, a)
  2195. }
  2196. ye.on(e, a)
  2197. }
  2198. ,
  2199. ye.off = function(e, t) {
  2200. if (t instanceof Array)
  2201. for (var a = 0, n = t.length; n > a; a++)
  2202. ye.off(e, t[a]);
  2203. else
  2204. for (var i = e.split(" "), r = 0, s = i.length; s > r; r++)
  2205. if (Ve[i[r]] = Ve[i[r]] || [],
  2206. null == t)
  2207. Ve[i[r]].length = 0;
  2208. else {
  2209. var o = J(i[r], t);
  2210. -1 !== o && Ve[i[r]].splice(o, 1)
  2211. }
  2212. }
  2213. ,
  2214. ye.destroy = function() {
  2215. return Ue.add(Se).add(Be).add(De).add($e).add(Qe).add(Ze).add(Ge).add(Je).add(Ke).off("." + g),
  2216. b.off("keydown", de),
  2217. Ze.add(Ge).add(Je).add(Ke).removeClass(ge.disabledClass),
  2218. qe && null != Oe.activeItem && qe.eq(Oe.activeItem).removeClass(ge.activeClass),
  2219. De.empty(),
  2220. we || (be.off("." + g),
  2221. He.restore(),
  2222. Xe.restore(),
  2223. Ye.restore(),
  2224. je.restore(),
  2225. e.removeData(t, g)),
  2226. Ne.length = Ee.length = 0,
  2227. _e = {},
  2228. ye.initialized = 0,
  2229. ye
  2230. }
  2231. ,
  2232. ye.init = function() {
  2233. if (!ye.initialized) {
  2234. ye.on(m);
  2235. var e = ["overflow", "position"]
  2236. , t = ["position", "webkitTransform", "msTransform", "transform", "left", "top", "width", "height"];
  2237. He.save.apply(He, e),
  2238. Ye.save.apply(Ye, e),
  2239. Xe.save.apply(Xe, t),
  2240. je.save.apply(je, t);
  2241. var a = Se;
  2242. return we || (a = a.add(Pe),
  2243. be.css("overflow", "hidden"),
  2244. f || "static" !== be.css("position") || be.css("position", "relative")),
  2245. f ? v && a.css(f, v) : ("static" === Be.css("position") && Be.css("position", "relative"),
  2246. a.css({
  2247. position: "absolute"
  2248. })),
  2249. ge.forward && $e.on(S, se),
  2250. ge.backward && Qe.on(S, se),
  2251. ge.prev && Ze.on(B, se),
  2252. ge.next && Ge.on(B, se),
  2253. ge.prevPage && Je.on(B, se),
  2254. ge.nextPage && Ke.on(B, se),
  2255. Ue.on(C, le),
  2256. Be[0] && Be.on(B, ce),
  2257. Re && ge.activateOn && be.on(ge.activateOn + "." + g, "*", ue),
  2258. De[0] && ge.activatePageOn && De.on(ge.activatePageOn + "." + g, "*", fe),
  2259. We.on(P, {
  2260. source: "slidee"
  2261. }, te),
  2262. Se && Se.on(P, {
  2263. source: "handle"
  2264. }, te),
  2265. b.on("keydown", de),
  2266. we || (be.on("mouseenter." + g + " mouseleave." + g, ve),
  2267. be.on("scroll." + g, o)),
  2268. ye.initialized = 1,
  2269. H(!0),
  2270. ge.cycleBy && !we && ye[ge.startPaused ? "pause" : "resume"](),
  2271. ye
  2272. }
  2273. }
  2274. }
  2275. function i(e) {
  2276. return null == e ? String(e) : "object" == typeof e || "function" == typeof e ? Object.prototype.toString.call(e).match(/\s([a-z]+)/i)[1].toLowerCase() || "object" : typeof e
  2277. }
  2278. function r(e, t) {
  2279. e.preventDefault(),
  2280. t && e.stopPropagation()
  2281. }
  2282. function s(t) {
  2283. r(t, 1),
  2284. e(this).off(t.type, s)
  2285. }
  2286. function o() {
  2287. this.scrollLeft = 0,
  2288. this.scrollTop = 0
  2289. }
  2290. function l(e) {
  2291. return !isNaN(parseFloat(e)) && isFinite(e)
  2292. }
  2293. function c(e, t) {
  2294. return 0 | E(String(e.css(t)).replace(/[^\-0-9.]/g, ""))
  2295. }
  2296. function d(e, t, a) {
  2297. return t > e ? t : e > a ? a : e
  2298. }
  2299. function u(e) {
  2300. var t = {};
  2301. return t.style = {},
  2302. t.save = function() {
  2303. if (e && e.nodeType) {
  2304. for (var a = 0; a < arguments.length; a++)
  2305. t.style[arguments[a]] = e.style[arguments[a]];
  2306. return t
  2307. }
  2308. }
  2309. ,
  2310. t.restore = function() {
  2311. if (e && e.nodeType) {
  2312. for (var a in t.style)
  2313. t.style.hasOwnProperty(a) && (e.style[a] = t.style[a]);
  2314. return t
  2315. }
  2316. }
  2317. ,
  2318. t
  2319. }
  2320. var f, v, p, h = "sly", m = "Sly", g = h, y = t.cancelAnimationFrame || t.cancelRequestAnimationFrame, w = t.requestAnimationFrame, b = e(document), P = "touchstart." + g + " mousedown." + g, I = "mousemove." + g + " mouseup." + g, z = "touchmove." + g + " touchend." + g, C = (document.implementation.hasFeature("Event.wheel", "3.0") ? "wheel." : "mousewheel.") + g, B = "click." + g, S = "mousedown." + g, k = ["INPUT", "SELECT", "BUTTON", "TEXTAREA"], T = [], x = Math.abs, D = Math.sqrt, A = Math.pow, E = Math.round, q = Math.max, N = Math.min, O = 0;
  2321. b.on(C, function(e) {
  2322. var t = e.originalEvent[g]
  2323. , a = +new Date;
  2324. (!t || t.options.scrollHijack < a - O) && (O = a)
  2325. }),
  2326. function(e) {
  2327. function t(e) {
  2328. var t = (new Date).getTime()
  2329. , n = Math.max(0, 16 - (t - a))
  2330. , i = setTimeout(e, n);
  2331. return a = t,
  2332. i
  2333. }
  2334. w = e.requestAnimationFrame || e.webkitRequestAnimationFrame || t;
  2335. var a = (new Date).getTime()
  2336. , n = e.cancelAnimationFrame || e.webkitCancelAnimationFrame || e.clearTimeout;
  2337. y = function(t) {
  2338. n.call(e, t)
  2339. }
  2340. }(window),
  2341. function() {
  2342. function e(e) {
  2343. for (var n = 0, i = t.length; i > n; n++) {
  2344. var r = t[n] ? t[n] + e.charAt(0).toUpperCase() + e.slice(1) : e;
  2345. if (null != a.style[r])
  2346. return r
  2347. }
  2348. }
  2349. var t = ["", "webkit", "moz", "ms", "o"]
  2350. , a = document.createElement("div");
  2351. f = e("transform"),
  2352. v = e("perspective") ? "translateZ(0) " : ""
  2353. }(),
  2354. t[m] = n,
  2355. e.fn[h] = function(t, a) {
  2356. var r, s;
  2357. return e.isPlainObject(t) || (("string" === i(t) || t === !1) && (r = t === !1 ? "destroy" : t,
  2358. s = Array.prototype.slice.call(arguments, 1)),
  2359. t = {}),
  2360. this.each(function(i, o) {
  2361. var l = e.data(o, g);
  2362. l || r ? l && r && l[r] && l[r].apply(l, s) : l = e.data(o, g, new n(o,t,a).init())
  2363. })
  2364. }
  2365. ,
  2366. n.defaults = {
  2367. slidee: null,
  2368. horizontal: !1,
  2369. itemNav: null,
  2370. itemSelector: null,
  2371. smart: !1,
  2372. activateOn: null,
  2373. activateMiddle: !1,
  2374. scrollSource: null,
  2375. scrollBy: 0,
  2376. scrollHijack: 300,
  2377. scrollTrap: !1,
  2378. dragSource: null,
  2379. mouseDragging: !1,
  2380. touchDragging: !1,
  2381. releaseSwing: !1,
  2382. swingSpeed: .2,
  2383. elasticBounds: !1,
  2384. interactive: null,
  2385. scrollBar: null,
  2386. dragHandle: !1,
  2387. dynamicHandle: !1,
  2388. minHandleSize: 50,
  2389. clickBar: !1,
  2390. syncSpeed: .5,
  2391. pagesBar: null,
  2392. activatePageOn: null,
  2393. pageBuilder: function(e) {
  2394. return "<li>" + (e + 1) + "</li>"
  2395. },
  2396. forward: null,
  2397. backward: null,
  2398. prev: null,
  2399. next: null,
  2400. prevPage: null,
  2401. nextPage: null,
  2402. cycleBy: null,
  2403. cycleInterval: 5e3,
  2404. pauseOnHover: !1,
  2405. startPaused: !1,
  2406. moveBy: 300,
  2407. speed: 0,
  2408. easing: "swing",
  2409. startAt: null,
  2410. keyboardNavBy: null,
  2411. draggedClass: "dragged",
  2412. activeClass: "active",
  2413. disabledClass: "disabled"
  2414. }
  2415. }(jQuery, window);
  2416. !function e(t, i, n) {
  2417. function r(a, s) {
  2418. if (!i[a]) {
  2419. if (!t[a]) {
  2420. var l = "function" == typeof require && require;
  2421. if (!s && l)
  2422. return l(a, !0);
  2423. if (o)
  2424. return o(a, !0);
  2425. var c = new Error("Cannot find module '" + a + "'");
  2426. throw c.code = "MODULE_NOT_FOUND",
  2427. c
  2428. }
  2429. var h = i[a] = {
  2430. exports: {}
  2431. };
  2432. t[a][0].call(h.exports, function(e) {
  2433. var i = t[a][1][e];
  2434. return r(i ? i : e)
  2435. }, h, h.exports, e, t, i, n)
  2436. }
  2437. return i[a].exports
  2438. }
  2439. for (var o = "function" == typeof require && require, a = 0; a < n.length; a++)
  2440. r(n[a]);
  2441. return r
  2442. }({
  2443. 1: [function(e, t, i) {
  2444. (function(i) {
  2445. "use strict";
  2446. function n(e) {
  2447. this.player = null,
  2448. this.director = null,
  2449. this.modelManager = null,
  2450. this.container = null,
  2451. this.tagManager = null,
  2452. this.fadeInSpeed = e,
  2453. null !== this.fadeInSpeed && void 0 !== this.fadeInSpeed || (this.fadeInSpeed = 0)
  2454. }
  2455. var r = e("three")
  2456. , o = e("./util/logger")
  2457. , a = (e("./util/common"),
  2458. e("./enum/PlayerEvents"))
  2459. , s = e("./enum/DirectorEvents")
  2460. , l = e("./settings")
  2461. , c = e("./enum/Viewmode")
  2462. , h = (e("./enum/WarpStyle"),
  2463. e("./enum/BlackoutStyle"),
  2464. e("./enum/ModelManagerEvents"))
  2465. , u = e("./enum/tagEvents")
  2466. , d = e("./util/transitions")
  2467. , p = e("./util/lerp")
  2468. , f = new o(i);
  2469. n.prototype.init = function(e, t, i, n, r) {
  2470. this.player = t,
  2471. this.director = e,
  2472. this.modelManager = i,
  2473. this.tagManager = n,
  2474. this.container = r,
  2475. this.updateModel(),
  2476. this.bindEvents()
  2477. }
  2478. ,
  2479. n.prototype.bindEvents = function() {
  2480. this.modelManager.on(h.ActiveModelChanged, this.updateModel.bind(this)),
  2481. this.player.on(a.ModeChanging, this.handlePlayerModeChanging.bind(this)),
  2482. this.player.on(a.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  2483. this.player.on(a.ClosestPanoChanging, this.handleClosestPanoChanging.bind(this)),
  2484. this.player.on(a.StartInside, this.handleStartInside.bind(this)),
  2485. this.player.on(a.StartOutside, this.handleStartOutside.bind(this)),
  2486. this.player.on(a.WarpStarted, this.handleWarpStarted.bind(this)),
  2487. this.director.on(s.ActionInterrupted, this.handleActionInterruption.bind(this)),
  2488. this.tagManager.on(u.TagActivated, this.ontagActivated.bind(this)),
  2489. this.tagManager.on(u.TagNavigation, this.onNavigationTotag.bind(this))
  2490. }
  2491. ,
  2492. n.prototype.updateModel = function() {
  2493. this.model = this.modelManager.getActiveModel()
  2494. }
  2495. ,
  2496. n.prototype.handleWarpStarted = function() {
  2497. this.hidePlayerReticule()
  2498. }
  2499. ,
  2500. n.prototype.ontagActivated = function() {
  2501. this.hidePlayerReticule()
  2502. }
  2503. ,
  2504. n.prototype.onNavigationTotag = function() {
  2505. this.hidePlayerReticule()
  2506. }
  2507. ,
  2508. n.prototype.handlePlayerModeChanging = function(e, t, i) {
  2509. var n = this.modelManager.getActiveModel()
  2510. , r = this.player.is360View(t, i) || this.director.tourIsPlaying ? 0 : l[t].markerOpacity;
  2511. n.fadePanoMarkers(r),
  2512. n.setMode(t)
  2513. }
  2514. ,
  2515. n.prototype.handlePlayerModeChanged = function(e, t) {
  2516. var i = this.modelManager.getActiveModel()
  2517. , n = t === c.PANORAMA ? r.DoubleSide : r.FrontSide;
  2518. i.setSide(n),
  2519. i.setMode(t)
  2520. }
  2521. ,
  2522. n.prototype.handleClosestPanoChanging = function(e, t, i) {
  2523. i !== c.TRANSITIONING && (e && !this.director.tourIsPlaying && e.hoverOff(i),
  2524. t && !this.director.tourIsPlaying && t.hoverOn(i))
  2525. }
  2526. ,
  2527. n.prototype.handleActionInterruption = function() {}
  2528. ,
  2529. n.prototype.handleStartInside = function(e) {
  2530. var t = l[this.player.mode]
  2531. , i = e ? 0 : t.transitionTime * t.skyboxOpacityLength;
  2532. this.fadeIn(this.fadeInSpeed),
  2533. this.model.alpha = 0,
  2534. this.model.skybox.material.uniforms.opacity.value = 1,
  2535. this.model.fadePanoMarkers(e ? 0 : t.markerOpacity);
  2536. var n = this.player.reticule;
  2537. d.start(p.property(n.material, "opacity", 0), i, null, 0, null, "retReOpac")
  2538. }
  2539. ,
  2540. n.prototype.handleStartOutside = function(e) {
  2541. this.fadeIn(e)
  2542. }
  2543. ,
  2544. n.prototype.fadeIn = function(e) {
  2545. null !== e && void 0 !== e || (e = 2e3,
  2546. f.warn("DisplayController.fadeIn -> no transition time specified, defaulting to 2000 ms.")),
  2547. $(this.container).fadeIn(e)
  2548. }
  2549. ,
  2550. n.prototype.hidePlayerReticule = function() {
  2551. this.player.reticule.hide()
  2552. }
  2553. ,
  2554. t.exports = n
  2555. }
  2556. ).call(this, "/js/DisplayController.js")
  2557. }
  2558. , {
  2559. "./enum/BlackoutStyle": 18,
  2560. "./enum/DirectorEvents": 23,
  2561. "./enum/tagEvents": 32,
  2562. "./enum/ModelManagerEvents": 33,
  2563. "./enum/PlayerEvents": 40,
  2564. "./enum/Viewmode": 51,
  2565. "./enum/WarpStyle": 52,
  2566. "./settings": 166,
  2567. "./util/common": 185,
  2568. "./util/lerp": 188,
  2569. "./util/logger": 189,
  2570. "./util/transitions": 195,
  2571. three: 217
  2572. }],
  2573. 2: [function(e, t, i) {
  2574. "use strict";
  2575. function n() {
  2576. this.baseStartTime = performance.timing.navigationStart,
  2577. this.loadingStartTime = null,
  2578. this.waitingStartTime = null,
  2579. this.appReadyTime = null
  2580. }
  2581. n.prototype.setBaseStartTime = function(e) {
  2582. this.baseStartTime = e || Date.now()
  2583. }
  2584. ,
  2585. n.prototype.setWaitingStartTime = function(e) {
  2586. this.waitingStartTime = e || Date.now()
  2587. }
  2588. ,
  2589. n.prototype.setLoadingStartTime = function(e) {
  2590. this.loadingStartTime = e || Date.now()
  2591. }
  2592. ,
  2593. n.prototype.setAppReadyTime = function(e) {
  2594. this.appReadyTime = e || Date.now()
  2595. }
  2596. ,
  2597. n.prototype.calcFullLoadingTime = function() {
  2598. var e = this.appReadyTime - this.baseStartTime;
  2599. return this.waitingStartTime && (e -= this.loadingStartTime - this.waitingStartTime),
  2600. e
  2601. }
  2602. ,
  2603. t.exports = n
  2604. }
  2605. , {}],
  2606. 3: [function(e, t, i) {
  2607. (function(i) {
  2608. "use strict";
  2609. function n() {
  2610. return 100 * Math.random()
  2611. }
  2612. var r = e("./util/logger")
  2613. , o = e("./util/browser")
  2614. , a = new r(i)
  2615. , s = window.MP_AB_TESTS = window.MP_AB_TESTS || {
  2616. initialized: !1,
  2617. init: function(e, t) {
  2618. if (t = t || {},
  2619. !this.initialized) {
  2620. this.initialized = !0,
  2621. o.valueFromHash("tilegen") && (t.tilegen = 1 === o.valueFromHash("tilegen", 0)),
  2622. o.valueFromHash("imgopt") && (t.imgopt = 1 === o.valueFromHash("imgopt", 0));
  2623. for (var i in e) {
  2624. var r = i.match("^sc_tilegen_([0-9]+)$");
  2625. r && (s.tilegen = n() < parseInt(r[1]));
  2626. var l = i.match("^sc_imgopt_([0-9]+)$");
  2627. l && (s.imgopt = n() < parseInt(l[1]))
  2628. }
  2629. for (var c in t)
  2630. s[c] = t[c],
  2631. a.debug("A/B override:", c, s[c])
  2632. }
  2633. },
  2634. changeIfTileGenerating: function(e) {
  2635. return s.tilegen && (e += e.indexOf("?") === -1 ? "?" : "&",
  2636. e += "imgopt="+randomTime().getTime()),
  2637. e
  2638. },
  2639. changeIfImageOptimzing: function(e) {
  2640. return s.imgopt && e.indexOf("imgopt=1") === -1 && (e += e.indexOf("?") === -1 ? "?" : "&",
  2641. e += "imgopt=1"+randomTime().getTime()),
  2642. e
  2643. },
  2644. tilegen: !1,
  2645. imgopt: !1
  2646. };
  2647. t.exports = s
  2648. }
  2649. ).call(this, "/js/ab.js")
  2650. }
  2651. , {
  2652. "./util/browser": 182,
  2653. "./util/logger": 189
  2654. }],
  2655. 4: [function(e, t, i) {
  2656. (function(i) {
  2657. "use strict";
  2658. function n() {
  2659. return {
  2660. addons: [{
  2661. name: "keen:ua_parser",
  2662. input: {
  2663. ua_string: "user_agent"
  2664. },
  2665. output: "parsed_user_agent"
  2666. }]
  2667. }
  2668. }
  2669. function r(e, t, i, n) {
  2670. function r(t) {
  2671. l[t.sid] = !0;
  2672. var i = t.billboard.media && t.billboard.media.type
  2673. , n = {
  2674. tag_id: t.sid,
  2675. tags_visited: Object.keys(l).length,
  2676. tag_count: Object.keys(e.tags).length,
  2677. tag_view_count: ++E,
  2678. has_media: !!i
  2679. };
  2680. i && (n.media_type = i),
  2681. u("tag_opened", n)
  2682. }
  2683. var l = {}
  2684. , h = Date.now() - N
  2685. , f = null;
  2686. n && (f = Date.now() - window.navigationStart);
  2687. var g;
  2688. try {
  2689. g = e.data.player_options.highlight_reel && e.heroLocations.length > 1
  2690. } catch (e) {
  2691. g = !1
  2692. }
  2693. var v, A = e.supportsVR;
  2694. A || (v = "VR disabled at the model/account level",
  2695. m.valueFromHash("vr") === _.NONE ? v = "VR disabled, using &vr=0" : m.detectAndroid() ? b.isDeviceSupported(w.Android) || (v = "VR disabled, unsupported Android version") : m.detectIOS() && (b.isDeviceSupported(w.IOS) || (v = "VR disabled, unsupported iOS version"))),
  2696. u("model_loaded", {
  2697. duration: h,
  2698. duration_from_navigation_start: f,
  2699. has_hlr: g,
  2700. has_vr: A,
  2701. vr_reason: v
  2702. });
  2703. var I = 0;
  2704. e.panos.forEach(function(e) {
  2705. e.on("enter", function() {
  2706. c("pano_viewed", {
  2707. pano_id: e.id,
  2708. pano_view_count: ++I,
  2709. alignment_type: e.alignmentType,
  2710. interaction_source: O,
  2711. navigation_source: p
  2712. })
  2713. })
  2714. });
  2715. var E = 0;
  2716. for (var T in e.tags)
  2717. e.tags[T].billboard.on(M.OPENED, r.bind(this, e.tags[T]));
  2718. t.on("tour_auto", function(e) {
  2719. p = "tour_" + e
  2720. }),
  2721. t.on("tour_manual", function(e) {
  2722. O = "gui-" + e,
  2723. p = "tour_manual"
  2724. }),
  2725. i.on(C.InteractionKey, function() {
  2726. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionKey)
  2727. }),
  2728. i.on(C.InteractionDirect, function() {
  2729. t.mode === y.TRANSITIONING || t.flying || d(C.InteractionDirect)
  2730. }),
  2731. o(t),
  2732. a(),
  2733. s()
  2734. }
  2735. function o(e) {
  2736. I.on(T.OPENED, function() {
  2737. c("showcase_share_intent", {
  2738. pano_id: e.currentPano && e.currentPano.id
  2739. })
  2740. }),
  2741. I.on(T.LINK_CLICKED, function(t) {
  2742. c("showcase_share_action", {
  2743. channel: t.channel,
  2744. pano_id: e.currentPano && e.currentPano.id
  2745. })
  2746. }),
  2747. E.on(x.ORIGIN_LINK_CLICKED, function() {
  2748. c("showcase_share_origin_link_clicked")
  2749. })
  2750. }
  2751. function a() {}
  2752. function s() {
  2753. b.on(S.OPENED, c.bind(this, "showcase_gui", {
  2754. gui_action: "click_vr_button"
  2755. })),
  2756. b.on(S.LAUNCH, function(e) {
  2757. c("showcase_gui", {
  2758. gui_action: "launch_vr",
  2759. vr_platform: e.vr_platform,
  2760. vr_app: e.vr_app
  2761. })
  2762. }),
  2763. b.on(S.PREV, c.bind(this, "showcase_gui", {
  2764. gui_action: "vr_modal_prev"
  2765. })),
  2766. b.on(S.NEXT, function(e) {
  2767. c("showcase_gui", {
  2768. gui_action: e.nextAction
  2769. })
  2770. }),
  2771. b.on(S.CLOSED, c.bind(this, "showcase_gui", {
  2772. gui_action: "vr_modal_close"
  2773. })),
  2774. b.on(S.falseICECHOSEN, function(e) {
  2775. c("showcase_gui", {
  2776. gui_action: e.name + " "
  2777. })
  2778. }),
  2779. b.on(S.STORE, function(e) {
  2780. c("showcase_gui", {
  2781. gui_action: "launch_store",
  2782. store: e
  2783. })
  2784. })
  2785. }
  2786. function l(e, t) {
  2787. if (f)
  2788. try {
  2789. f.addEvent(e, v.extendObject({
  2790. host: window.location.host,
  2791. keen: n(),
  2792. user_agent: "${keen.user_agent}",
  2793. referrer: {
  2794. url: v.normalizeUrl(document.referrer),
  2795. domain: v.domainFromUrl(document.referrer),
  2796. url_original: document.referrer
  2797. },
  2798. embedded: m.inIframe(),
  2799. is_mobile: m.isMobile(),
  2800. version: "2.25.6-0-gd87e5b1"
  2801. }, t))
  2802. } catch (e) {
  2803. P.warn("analytics.report -> client.addEvent() error (is there blocking software installed?). Error message: " + e)
  2804. }
  2805. }
  2806. function c(e, t) {
  2807. if (t = t || {},
  2808. L)
  2809. try {
  2810. window.analytics.track(e, v.extendObject(t, B), {
  2811. context: {
  2812. app: {
  2813. name: "showcase",
  2814. version: "2.25.6-0-gd87e5b1"
  2815. },
  2816. screen: {
  2817. width: window.screen.width,
  2818. height: window.screen.height,
  2819. density: window.devicePixelRatio
  2820. }
  2821. }
  2822. })
  2823. } catch (t) {
  2824. console.warn("Failed to send data to segment for " + e)
  2825. }
  2826. }
  2827. function h(e, t) {
  2828. if (t = t || {},
  2829. navigator.sendBeacon && L)
  2830. try {
  2831. navigator.sendBeacon("https://api.segment.io/v1/t", JSON.stringify({
  2832. event: e,
  2833. anonymousId: window.analytics.user().anonymousId(),
  2834. properties: v.extendObject(t, B),
  2835. writeKey: L,
  2836. sentAt: Date.now(),
  2837. type: "track",
  2838. context: {
  2839. userAgent: m.userAgent(),
  2840. library: {
  2841. name: "showcase-beacon",
  2842. version: "2.25.6-0-gd87e5b1"
  2843. },
  2844. app: {
  2845. name: "showcase",
  2846. version: "2.25.6-0-gd87e5b1"
  2847. }
  2848. }
  2849. }))
  2850. } catch (e) {
  2851. console.warn("Failed to send async segment request")
  2852. }
  2853. }
  2854. function u(e, t) {
  2855. t = t || {},
  2856. c(e, t)
  2857. }
  2858. function d(e, t) {
  2859. O = e === C.InteractionGui ? "gui-" + t : e,
  2860. p = "self_guided"
  2861. }
  2862. var p, f, g = (e("three"),
  2863. e("./util/ajax"),
  2864. e("./ab")), m = e("./util/browser"), v = e("./util/common"), A = e("./settings"), y = (e("./localization/localize"),
  2865. e("./enum/Viewmode")), C = e("./enum/ControlEvents"), I = e("./gui/sharing/modal"), E = e("./gui/title/titleBar"), b = e("./gui/vr/vrModal"), w = e("./enum/VRPlatforms"), _ = e("./enum/VROption"), T = e("./gui/sharing/ShareEvents"), x = e("./gui/title/TitleEvents"), S = e("./gui/vr/vrEvent"), M = e("./tag/Billboard/BillboardEvent"), R = e("./util/logger"), P = new R(i), O = (e("./enum/PlayerEvents"),
  2866. "direct"), L = null, D = !1, N = null, B = null, F = v.uuid4();
  2867. t.exports = {
  2868. report: function(e, t, i, n) {
  2869. l("Session starts", {
  2870. model: e,
  2871. status: t,
  2872. loadtime: Date.now() - (N || Date.now()),
  2873. loadtime_from_navigation_start: i ? Date.now() - window.navigationStart : null,
  2874. autoplay: i,
  2875. quickstart: n,
  2876. ab_tilegen: g.tilegen,
  2877. ab_imgopt: g.imgopt
  2878. })
  2879. },
  2880. impression: function(e) {
  2881. e = e || {};
  2882. var t = void 0 === e.isVisible || e.isVisible
  2883. , i = (void 0 !== e.immediate && e.immediate,
  2884. window.location.search.substr(1).split("&"));
  2885. u("impression", {
  2886. visible: t,
  2887. url_params: i
  2888. })
  2889. },
  2890. initKeen: function(e) {
  2891. return e.token && e.appId ? void (f = new Keen({
  2892. projectId: e.appId,
  2893. writeKey: e.token,
  2894. readKey: "",
  2895. requestType: "xhr"
  2896. })) : void P.warn("no keen token/appId")
  2897. },
  2898. initSegment: function(e) {
  2899. return e.token ? (L = e.token,
  2900. window.analytics.load(e.token),
  2901. B = {
  2902. model_id: e.model,
  2903. start_source: e.startSource,
  2904. autoplay: e.autoplay,
  2905. quickstart: e.quickstart,
  2906. language_tag: A.languageTag,
  2907. is_mobile: m.isMobile(),
  2908. iframe: m.inIframe(),
  2909. aspect_ratio: m.aspectRatio(),
  2910. session_id: F,
  2911. window: {
  2912. width: $("#player").width(),
  2913. height: $("#player").height()
  2914. },
  2915. platform: {
  2916. browser: {
  2917. name: $.ua.browser.name,
  2918. major: $.ua.browser.major,
  2919. version: $.ua.browser.version
  2920. },
  2921. os: {
  2922. name: $.ua.os.name,
  2923. version: $.ua.os.version
  2924. },
  2925. device: {
  2926. vendor: $.ua.device.vendor,
  2927. model: $.ua.device.model,
  2928. type: $.ua.device.type
  2929. }
  2930. }
  2931. },
  2932. D = Math.random() < A.analytics.sessionTrackingRate,
  2933. P.debug("tracking sample rate = " + A.analytics.sessionTrackingRate),
  2934. void P.debug("tracking this session = " + D)) : void P.warn("no segment token")
  2935. },
  2936. sessionStart: function(e) {
  2937. P.debug("analytics user_session_start"),
  2938. c("session_started"),
  2939. N = Date.now(),
  2940. window.addEventListener("unload", function() {
  2941. h("session_ended", {
  2942. duration: Date.now() - N
  2943. })
  2944. })
  2945. },
  2946. modelLoaded: function(e, t, i, n) {
  2947. r(e, t, i, n)
  2948. },
  2949. loadComplete: function(e) {
  2950. var t = {
  2951. time_to_app_start: e
  2952. };
  2953. c("load_times", t)
  2954. },
  2955. track: function(e, t) {
  2956. D && (P.debug('analytics.track("' + e + '", ' + JSON.stringify(t) + " )"),
  2957. c(e, t))
  2958. },
  2959. trackAlways: function(e, t) {
  2960. P.debug('analytics.trackAlways("' + e + '", ' + JSON.stringify(t) + " )"),
  2961. c(e, t)
  2962. },
  2963. getSessionId: function() {
  2964. return F
  2965. },
  2966. updateInteraction: d
  2967. }
  2968. }
  2969. ).call(this, "/js/analytics.js")
  2970. }
  2971. , {
  2972. "./ab": 3,
  2973. "./enum/ControlEvents": 21,
  2974. "./enum/PlayerEvents": 40,
  2975. "./enum/VROption": 47,
  2976. "./enum/VRPlatforms": 49,
  2977. "./enum/Viewmode": 51,
  2978. "./gui/sharing/ShareEvents": 76,
  2979. "./gui/sharing/modal": 77,
  2980. "./gui/title/TitleEvents": 80,
  2981. "./gui/title/titleBar": 82,
  2982. "./gui/vr/vrEvent": 85,
  2983. "./gui/vr/vrModal": 87,
  2984. "./localization/localize": 108,
  2985. "./tag/Billboard/BillboardEvent": 120,
  2986. "./settings": 166,
  2987. "./util/ajax": 181,
  2988. "./util/browser": 182,
  2989. "./util/common": 185,
  2990. "./util/logger": 189,
  2991. three: 217
  2992. }],
  2993. 5: [function(e, t, i) {
  2994. "use strict";
  2995. function n() {
  2996. r.PerspectiveCamera.call(this, a.clampVFOV(o.dollhouseFOV), $("#player").width() / $("#player").height(), o.dollhouseNear, o.dollhouseFar),
  2997. this.controls = null
  2998. }
  2999. var r = e("three")
  3000. , o = e("../constants")
  3001. , a = e("../util/cameraLight");
  3002. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3003. n.prototype.updateAspect = function(e) {
  3004. this.aspect = e,
  3005. this.updateProjectionMatrix()
  3006. }
  3007. ,
  3008. t.exports = n
  3009. }
  3010. , {
  3011. "../constants": 8,
  3012. "../util/cameraLight": 184,
  3013. three: 217
  3014. }],
  3015. 6: [function(e, t, i) {
  3016. "use strict";
  3017. function n() {
  3018. var e = $("#player").width() / $("#player").height();
  3019. r.OrthographicCamera.call(this, -o.orthoBase, o.orthoBase, o.orthoBase / e, -o.orthoBase / e, o.orthoNear, o.orthoFar),
  3020. this.controls = null,
  3021. this.updateAspect(e)
  3022. }
  3023. var r = e("three")
  3024. , o = e("../constants");
  3025. n.prototype = Object.create(r.OrthographicCamera.prototype),
  3026. n.prototype.updateAspect = function(e) {
  3027. this.aspect = e,
  3028. this.top = o.orthoBase / e,
  3029. this.bottom = -o.orthoBase / e,
  3030. this.updateProjectionMatrix()
  3031. }
  3032. ,
  3033. t.exports = n
  3034. }
  3035. , {
  3036. "../constants": 8,
  3037. three: 217
  3038. }],
  3039. 7: [function(e, t, i) {
  3040. "use strict";
  3041. function n() {
  3042. r.PerspectiveCamera.call(this, a.clampVFOV(o.insideFOV), $("#player").width() / $("#player").height(), o.insideNear, o.insideFar),
  3043. this.controls = null
  3044. }
  3045. var r = e("three")
  3046. , o = e("../settings")
  3047. , a = e("../util/cameraLight");
  3048. n.prototype = Object.create(r.PerspectiveCamera.prototype),
  3049. n.prototype.updateAspect = function(e) {
  3050. this.aspect = e,
  3051. this.updateProjectionMatrix()
  3052. }
  3053. ,
  3054. t.exports = n
  3055. }
  3056. , {
  3057. "../settings": 166,
  3058. "../util/cameraLight": 184,
  3059. three: 217
  3060. }],
  3061. 8: [function(e, t, i) {
  3062. "use strict";
  3063. t.exports = {
  3064. signedUrlDefaultExpireTime: 24e4,
  3065. signedUrlCheckInterval: 1e4,
  3066. signedUrlRefreshBuffer: 15e3,
  3067. dollhouseFOV: 70,
  3068. dollhouseNear: 1,
  3069. dollhouseFar: 5e3,
  3070. insideFOV: 70,
  3071. insideFOVMax: 120,
  3072. insideNear: .1,
  3073. insideFar: 5e3,
  3074. insideLookSpeed: .12,
  3075. insideLookLimitUp: 40,
  3076. insideLookLimitDown: -40,
  3077. orthoNear: 1,
  3078. orthoFar: 5e3,
  3079. orthoBase: 10,
  3080. narrowLandscapeHeight: 290,
  3081. reallyNarrowLandscapeHeight: 250,
  3082. visionTilingStartDate: new Date("8/26/2016"),
  3083. visionTilingStartVersion: "1.1.407.13667",
  3084. windowHeightHighQualityThreshold: 900,
  3085. tourStepDelayDefault: 3500,
  3086. tourStepDelaySlideShow: 5e3,
  3087. workshopApsect: 9 / 16,
  3088. highQualityMaxZoom: 2,
  3089. ultraHighQualityMaxZoom: 3
  3090. }
  3091. }
  3092. , {}],
  3093. 9: [function(e, t, i) {
  3094. "use strict";
  3095. function n() {
  3096. this.activeControl = null,
  3097. this.controls = {},
  3098. this.cameras = {}
  3099. }
  3100. var r = e("./PanoramaControls")
  3101. , o = e("./DollhouseControls")
  3102. , a = e("./FloorplanControls")
  3103. , s = e("../cameras/PanoramaCamera")
  3104. , l = e("../cameras/DollhouseCamera")
  3105. , c = e("../cameras/FloorplanCamera")
  3106. , h = e("events").EventEmitter
  3107. , u = e("../enum/ControlEvents")
  3108. , d = e("../enum/ModelManagerEvents")
  3109. , p = e("../enum/Viewmode")
  3110. , f = e("../settings");
  3111. n.prototype = Object.create(h.prototype),
  3112. n.prototype.init = function(e, t) {
  3113. this.setUpControls(),
  3114. this.bindEvents(e, t)
  3115. }
  3116. ,
  3117. n.prototype.activateControls = function(e) {
  3118. this.activeControl && (this.activeControl.reset(),
  3119. this.activeControl.enabled = !1),
  3120. this.controls[e] && (this.controls[e].enabled = !0),
  3121. this.activeControl = this.controls[e]
  3122. }
  3123. ,
  3124. n.prototype.setUpControls = function() {
  3125. var e = {}
  3126. , t = {}
  3127. , i = [p.PANORAMA, p.DOLLHOUSE, p.FLOORPLAN]
  3128. , n = [s, l, c]
  3129. , h = [r, o, a];
  3130. i.forEach(function(i, r) {
  3131. e[i] = new n[r],
  3132. t[i] = new h[r](e[i]),
  3133. t[i].on(u.Move, this.emit.bind(this, u.Move)),
  3134. t[i].on(u.InputStart, this.emit.bind(this, u.InputStart)),
  3135. t[i].on(u.InteractionDirect, this.emit.bind(this, u.InteractionDirect)),
  3136. t[i].on(u.InteractionKey, this.emit.bind(this, u.InteractionKey)),
  3137. t[i].on(u.Pinch, this.emit.bind(this, u.Pinch)),
  3138. t[i].on(u.Scroll, this.emit.bind(this, u.Scroll))
  3139. }
  3140. .bind(this)),
  3141. this.controls = t,
  3142. this.cameras = e
  3143. }
  3144. ,
  3145. n.prototype.bindEvents = function(e, t) {
  3146. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  3147. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  3148. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  3149. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  3150. f.useWheel && (e.addEventListener("mousewheel", this.onMouseWheel.bind(this)),
  3151. e.addEventListener("DOMMouseScroll", this.onMouseWheel.bind(this))),
  3152. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  3153. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  3154. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  3155. e.addEventListener("contextmenu", function(e) {
  3156. e.preventDefault()
  3157. }),
  3158. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  3159. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  3160. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  3161. e.addEventListener("pointerout", this.onPointerCancel.bind(this)),
  3162. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  3163. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  3164. document.addEventListener("keyup", this.onKeyUp.bind(this)),
  3165. t.on(d.ActiveModelChanged, function(e) {
  3166. this.setModelForControls(e.model)
  3167. }
  3168. .bind(this))
  3169. }
  3170. ,
  3171. n.prototype.setModelForControls = function(e) {
  3172. this.controls[p.DOLLHOUSE].setZoomBounds(e.boundingBox);
  3173. var t = e.boundingBox.clone().expandByScalar(f.modelBoundsPadding);
  3174. [p.DOLLHOUSE, p.FLOORPLAN].forEach(function(e) {
  3175. this.controls[e].setBounds(t)
  3176. }
  3177. .bind(this))
  3178. }
  3179. ,
  3180. n.prototype.onMouseDown = function(e) {
  3181. e.preventDefault(),
  3182. this.activeControl && this.activeControl.onMouseDown(e)
  3183. }
  3184. ,
  3185. n.prototype.onMouseMove = function(e) {
  3186. e.preventDefault(),
  3187. this.activeControl && this.activeControl.onMouseMove(e)
  3188. }
  3189. ,
  3190. n.prototype.onMouseUp = function(e) {
  3191. e.preventDefault(),
  3192. this.activeControl && this.activeControl.onMouseUp(e)
  3193. }
  3194. ,
  3195. n.prototype.onMouseOver = function(e) {
  3196. e.preventDefault(),
  3197. this.activeControl && this.activeControl.onMouseOver(e)
  3198. }
  3199. ,
  3200. n.prototype.onMouseWheel = function(e) {
  3201. e.preventDefault(),
  3202. this.activeControl && this.activeControl.onMouseWheel(e)
  3203. }
  3204. ,
  3205. n.prototype.onTouchStart = function(e) {
  3206. e.preventDefault(),
  3207. this.activeControl && this.activeControl.onTouchStart(e)
  3208. }
  3209. ,
  3210. n.prototype.onTouchMove = function(e) {
  3211. e.preventDefault(),
  3212. this.activeControl && this.activeControl.onTouchMove(e)
  3213. }
  3214. ,
  3215. n.prototype.onTouchEnd = function(e) {
  3216. e.preventDefault(),
  3217. this.activeControl && this.activeControl.onTouchEnd(e)
  3218. }
  3219. ,
  3220. n.prototype.onPointerDown = function(e) {
  3221. if (e.preventDefault(),
  3222. this.activeControl)
  3223. switch (e.pointerType) {
  3224. case "mouse":
  3225. this.activeControl.onMouseDown(e);
  3226. break;
  3227. default:
  3228. this.activeControl.onPointerDown(e)
  3229. }
  3230. }
  3231. ,
  3232. n.prototype.onPointerMove = function(e) {
  3233. if (e.preventDefault(),
  3234. this.activeControl)
  3235. switch (e.pointerType) {
  3236. case "mouse":
  3237. this.activeControl.onMouseMove(e);
  3238. break;
  3239. default:
  3240. this.activeControl.onPointerMove(e)
  3241. }
  3242. }
  3243. ,
  3244. n.prototype.onPointerUp = function(e) {
  3245. if (e.preventDefault(),
  3246. this.activeControl)
  3247. switch (e.pointerType) {
  3248. case "mouse":
  3249. this.activeControl.onMouseUp(e);
  3250. break;
  3251. default:
  3252. this.activeControl.onPointerUp(e)
  3253. }
  3254. }
  3255. ,
  3256. n.prototype.onPointerCancel = function(e) {
  3257. e.preventDefault(),
  3258. this.activeControl && "mouse" !== e.pointerType && this.activeControl.onPointerUp(e)
  3259. }
  3260. ,
  3261. n.prototype.onKeyDown = function(e) {
  3262. e.metaKey || e.ctrlKey || (e.preventDefault(),
  3263. this.activeControl && this.activeControl.onKeyDown(e))
  3264. }
  3265. ,
  3266. n.prototype.onKeyUp = function(e) {
  3267. e.preventDefault(),
  3268. this.activeControl && this.activeControl.onKeyUp(e)
  3269. }
  3270. ,
  3271. t.exports = n
  3272. }
  3273. , {
  3274. "../cameras/DollhouseCamera": 5,
  3275. "../cameras/FloorplanCamera": 6,
  3276. "../cameras/PanoramaCamera": 7,
  3277. "../enum/ControlEvents": 21,
  3278. "../enum/ModelManagerEvents": 33,
  3279. "../enum/Viewmode": 51,
  3280. "../settings": 166,
  3281. "./DollhouseControls": 10,
  3282. "./FloorplanControls": 11,
  3283. "./PanoramaControls": 13,
  3284. events: 202
  3285. }],
  3286. 10: [function(e, t, i) {
  3287. "use strict";
  3288. function n(e) {
  3289. a.call(this, e),
  3290. this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3291. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle,
  3292. this.minDistance = o.dollhouseDefault.minDistance,
  3293. this.maxDistance = o.dollhouseDefault.maxDistance,
  3294. this.adjustedMinDistance = this.minDistance,
  3295. this.adjustedMaxDistance = this.maxDistance
  3296. }
  3297. var r = e("three")
  3298. , o = e("../settings")
  3299. , a = e("./OutsideControls");
  3300. n.prototype = Object.create(a.prototype),
  3301. n.prototype.pan = function(e, t) {
  3302. this.camera.updateMatrix();
  3303. var i = this.camera.position.clone().sub(this.target).length();
  3304. i *= Math.tan(this.camera.fov / 2 * Math.PI / 180),
  3305. this.panLeft(2 * e * i / $("#player").height()),
  3306. this.panUp(-2 * t * i / $("#player").height())
  3307. }
  3308. ,
  3309. n.prototype.updateZoom = function() {
  3310. var e = this.offset.length();
  3311. return e * this.scale
  3312. }
  3313. ,
  3314. n.prototype.setZoomBounds = function(e) {
  3315. var t = e.min.distanceTo(e.max);
  3316. this.adjustedMinDistance = Math.max(Math.min(t / 2, o.dollhouseDefault.minDistance), 0),
  3317. this.adjustedMaxDistance = Math.min(Math.max(t, o.dollhouseDefault.maxDistance), o.skyboxRadius),
  3318. this.minDistance = this.adjustedMinDistance,
  3319. this.maxDistance = this.adjustedMaxDistance
  3320. }
  3321. ,
  3322. n.prototype.resetRanges = function(e, t) {
  3323. e ? (this.minDistance = Math.min(e, this.minDistance),
  3324. this.maxDistance = Math.max(e, this.maxDistance)) : (this.minDistance = this.adjustedMinDistance,
  3325. this.maxDistance = this.adjustedMaxDistance),
  3326. t ? (this.minPolarAngle = r.Math.degToRad(-15),
  3327. this.maxPolarAngle = r.Math.degToRad(89.9)) : (this.minPolarAngle = o.dollhouseDefault.minPolarAngle,
  3328. this.maxPolarAngle = o.dollhouseDefault.maxPolarAngle)
  3329. }
  3330. ,
  3331. n.prototype.toJSON = function() {
  3332. return a.prototype.toJSON.call(this)
  3333. }
  3334. ,
  3335. t.exports = n
  3336. }
  3337. , {
  3338. "../settings": 166,
  3339. "./OutsideControls": 12,
  3340. three: 217
  3341. }],
  3342. 11: [function(e, t, i) {
  3343. "use strict";
  3344. function n(e) {
  3345. a.call(this, e),
  3346. this.minDistance = 15,
  3347. this.maxDistance = 50,
  3348. this.noRotateUpDown = !0,
  3349. this.minPolarAngle = 0,
  3350. this.maxPolarAngle = 0,
  3351. this.mouseActions[l.LEFT] = s.PAN,
  3352. this.mouseActions[l.MIDDLE] = s.DOLLY,
  3353. this.mouseActions[l.RIGHT] = s.ROTATE,
  3354. this.touchActions[1] = s.PAN,
  3355. this.touchActions[2] = s.ROTATE_DOLLY,
  3356. this.absoluteScale = 1,
  3357. this.currentScale = 1
  3358. }
  3359. var r = e("three")
  3360. , o = e("../settings")
  3361. , a = e("./OutsideControls")
  3362. , s = e("../enum/ControlActions")
  3363. , l = e("../enum/MouseButton")
  3364. , c = e("../util/math")
  3365. , h = e("../util/browser");
  3366. n.prototype = Object.create(a.prototype),
  3367. n.prototype.zoomToContain = function(e) {
  3368. var t = Math.max(e.x, e.z)
  3369. , i = Math.min(e.x, e.z)
  3370. , n = Math.max(t, i * this.camera.aspect)
  3371. , r = Math.max(i, t * this.camera.aspect);
  3372. this.absoluteScale = (h.aspectRatio() < 1 ? r : n) / 2 / o.orthoBase * 1.2,
  3373. this.currentScale = this.absoluteScale
  3374. }
  3375. ,
  3376. n.prototype.rotateToView = function(e, t) {
  3377. var i = 0
  3378. , n = h.aspectRatio() < 1
  3379. , r = e.x < e.z;
  3380. n === r ? t.z > 0 && (i = Math.PI) : i = t.x > 0 ? Math.PI / 2 : -Math.PI / 2,
  3381. this.rotateLeft(i),
  3382. this.update(0)
  3383. }
  3384. ,
  3385. n.prototype.pan = function(e, t) {
  3386. this.camera.updateMatrix(),
  3387. this.panLeft(e * (this.camera.right - this.camera.left) / $("#player").width()),
  3388. this.panUp(-t * (this.camera.top - this.camera.bottom) / $("#player").height())
  3389. }
  3390. ,
  3391. n.prototype.updateZoom = function() {
  3392. return this.absoluteScale *= this.scale - .03 * this.keyboardZoomSpeed,
  3393. this.absoluteScale = Math.max(o.zoomNearLimit, Math.min(this.absoluteScale, o.zoomFarLimit)),
  3394. this.currentScale = .8 * this.currentScale + .2 * this.absoluteScale,
  3395. this.camera.left = -o.orthoBase * this.currentScale,
  3396. this.camera.right = o.orthoBase * this.currentScale,
  3397. this.camera.top = o.orthoBase * this.currentScale / this.camera.aspect,
  3398. this.camera.bottom = -o.orthoBase * this.currentScale / this.camera.aspect,
  3399. this.camera.updateProjectionMatrix(),
  3400. this.offset.length()
  3401. }
  3402. ,
  3403. n.prototype.toJSON = function() {
  3404. var e = new r.Quaternion
  3405. , t = (new r.Quaternion).setFromAxisAngle(new r.Vector3(0,1,0), r.Math.degToRad(90))
  3406. , i = new r.Quaternion;
  3407. return function() {
  3408. var n = a.prototype.toJSON.call(this);
  3409. return e.copy(n.camera_quaternion),
  3410. i.copy(t),
  3411. i.multiply(e),
  3412. n.camera_quaternion.x = c.toPrecision(i.x, 4),
  3413. n.camera_quaternion.y = c.toPrecision(i.y, 4),
  3414. n.camera_quaternion.z = c.toPrecision(i.z, 4),
  3415. n.camera_quaternion.w = c.toPrecision(i.w, 4),
  3416. n.ortho_zoom = c.toPrecision(this.currentScale * this.camera.aspect, 4),
  3417. n
  3418. }
  3419. }(),
  3420. t.exports = n
  3421. }
  3422. , {
  3423. "../enum/ControlActions": 20,
  3424. "../enum/MouseButton": 34,
  3425. "../settings": 166,
  3426. "../util/browser": 182,
  3427. "../util/math": 190,
  3428. "./OutsideControls": 12,
  3429. three: 217
  3430. }],
  3431. 12: [function(e, t, i) {
  3432. "use strict";
  3433. function n(e) {
  3434. this.camera = e,
  3435. this.camera.controls = this,
  3436. this.enabled = !1,
  3437. this.target = new r.Vector3,
  3438. this.targetBounds = new r.Box3,
  3439. this.zoomSpeed = 1,
  3440. this.minDistance = 0,
  3441. this.maxDistance = 1 / 0,
  3442. this.noRotateUpDown = !1,
  3443. this.rotateSpeed = 1,
  3444. this.keyboardZoomSpeed = 0,
  3445. this.keyPanSpeed = 7,
  3446. this.autoRotate = !1,
  3447. this.autoRotateSpeed = 2,
  3448. this.autoPan = !1,
  3449. this.autoPanPosition = new r.Vector3,
  3450. this.minPolarAngle = r.Math.degToRad(25),
  3451. this.maxPolarAngle = r.Math.degToRad(65),
  3452. this.rotationAcceleration = new r.Vector2,
  3453. this.rotationSpeed = new r.Vector2,
  3454. this.panAcceleration = new r.Vector2,
  3455. this.panSpeed = new r.Vector2,
  3456. this.rotateStart = new r.Vector2,
  3457. this.rotateEnd = new r.Vector2,
  3458. this.rotateDelta = new r.Vector2,
  3459. this.panStart = new r.Vector2,
  3460. this.panEnd = new r.Vector2,
  3461. this.panDelta = new r.Vector2,
  3462. this.panOffset = new r.Vector3,
  3463. this.offset = new r.Vector3,
  3464. this.dollyStart = new r.Vector2,
  3465. this.dollyEnd = new r.Vector2,
  3466. this.dollyDelta = new r.Vector2,
  3467. this.phiDelta = 0,
  3468. this.thetaDelta = 0,
  3469. this.scale = 1,
  3470. this.panVector = new r.Vector3,
  3471. this.lastPosition = new r.Vector3,
  3472. this.state = c.NONE,
  3473. this.mouseActions = {},
  3474. this.mouseActions[h.LEFT] = c.ROTATE,
  3475. this.mouseActions[h.MIDDLE] = c.DOLLY,
  3476. this.mouseActions[h.RIGHT] = c.PAN,
  3477. this.touchActions = {},
  3478. this.touchActions[1] = c.ROTATE,
  3479. this.touchActions[2] = c.PAN_DOLLY,
  3480. this.lastMoveTime = 0,
  3481. this.pointersLimit = 2,
  3482. this.pointers = []
  3483. }
  3484. var r = e("three")
  3485. , o = e("../settings")
  3486. , a = e("../util/common")
  3487. , s = e("../util/math")
  3488. , l = e("../enum/Vectors")
  3489. , c = e("../enum/ControlActions")
  3490. , h = e("../enum/MouseButton")
  3491. , u = e("../enum/Keys")
  3492. , d = e("../enum/ControlEvents")
  3493. , p = e("events").EventEmitter
  3494. , f = 1e-6;
  3495. n.prototype = Object.create(p.prototype),
  3496. n.prototype.setBounds = function(e) {
  3497. this.targetBounds = e
  3498. }
  3499. ,
  3500. n.prototype.isEngaged = function() {
  3501. return this.state !== c.NONE
  3502. }
  3503. ,
  3504. n.prototype.rotateLeft = function(e) {
  3505. void 0 === e && (e = this.getAutoRotationAngle()),
  3506. this.thetaDelta -= e
  3507. }
  3508. ,
  3509. n.prototype.rotateUp = function(e) {
  3510. this.noRotateUpDown || (void 0 === e && (e = this.getAutoRotationAngle()),
  3511. this.phiDelta -= e)
  3512. }
  3513. ,
  3514. n.prototype.panLeft = function(e) {
  3515. var t = this.camera.matrix.elements;
  3516. this.panOffset.set(t[0], 0, t[2]).normalize(),
  3517. this.panOffset.multiplyScalar(-e),
  3518. this.panVector.add(this.panOffset)
  3519. }
  3520. ,
  3521. n.prototype.panUp = function(e) {
  3522. var t = this.camera.matrix.elements;
  3523. this.panOffset.set(t[4], 0, t[6]).normalize(),
  3524. this.panOffset.multiplyScalar(-e),
  3525. this.panVector.add(this.panOffset)
  3526. }
  3527. ,
  3528. n.prototype.startRotating = function(e, t) {
  3529. e && this.navRotationAcc("x", e),
  3530. t && this.navRotationAcc("y", t)
  3531. }
  3532. ,
  3533. n.prototype.stopRotating = function(e) {
  3534. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  3535. this.navRotationAcc("x", 0),
  3536. this.navRotationAcc("y", 0)
  3537. }
  3538. ,
  3539. n.prototype.setAutoPanPosition = function(e, t) {
  3540. var i = new r.Vector3
  3541. , n = new r.Vector3;
  3542. return function(e, t) {
  3543. i.copy(this.camera.position),
  3544. void 0 === e && null === e || i.setX(e),
  3545. void 0 === t && null === t || i.setZ(t);
  3546. var r = this.camera.position.distanceTo(this.target)
  3547. , o = l.FORWARD.clone().applyQuaternion(this.camera.quaternion);
  3548. this.targetClamped = !1,
  3549. n.copy(i).addScaledVector(o, r),
  3550. this.targetBounds.containsPoint(n) || (this.targetBounds.clampPoint(n, n),
  3551. i.copy(n).addScaledVector(o, -r),
  3552. this.targetClamped = !0),
  3553. this.autoPanPosition.x = i.x,
  3554. this.autoPanPosition.z = i.z,
  3555. this.autoPan && this.stopAutoPanning()
  3556. }
  3557. }(),
  3558. n.prototype.stopAutoPanning = function() {
  3559. var e = this.autoPan;
  3560. this.autoPan = !1,
  3561. this.emit(this.targetClamped ? d.AutoPanClamped : e ? d.AutoPanInterrupt : d.AutoPanComplete)
  3562. }
  3563. ,
  3564. n.prototype.dollyIn = function(e) {
  3565. void 0 === e && (e = this.getZoomScale()),
  3566. this.scale /= e
  3567. }
  3568. ,
  3569. n.prototype.dollyOut = function(e) {
  3570. void 0 === e && (e = this.getZoomScale()),
  3571. this.scale *= e
  3572. }
  3573. ,
  3574. n.prototype.updatePan = function(e) {
  3575. if (this.panSpeed.multiplyScalar(1 - o.panFriction).addScaledVector(this.panAcceleration, o.panAccelerationOutside * e),
  3576. this.pan(-this.panSpeed.x, this.panSpeed.y),
  3577. this.autoPan) {
  3578. var t = (new r.Vector3).copy(this.autoPanPosition).sub(this.camera.position);
  3579. t.setY(0).clampLength(0, 50 * e),
  3580. this.target.add(t),
  3581. this.camera.position.add(t),
  3582. this.autoPanPosition.x === this.camera.position.x && this.autoPanPosition.z === this.camera.position.z && (this.autoPan = !1,
  3583. this.stopAutoPanning())
  3584. }
  3585. }
  3586. ,
  3587. n.prototype.update = function(e) {
  3588. e || (e = 1 / 60),
  3589. this.rotationSpeed.multiplyScalar(1 - o.rotationFriction).addScaledVector(this.rotationAcceleration, o.rotationAccelerationOutside * e),
  3590. this.rotateLeft(-this.rotationSpeed.x),
  3591. this.noRotateUpDown || this.rotateUp(this.rotationSpeed.y),
  3592. this.updatePan(e);
  3593. var t = this.camera.position;
  3594. this.offset.copy(t).sub(this.target);
  3595. var i = Math.atan2(this.offset.x, this.offset.z)
  3596. , n = Math.atan2(Math.sqrt(this.offset.x * this.offset.x + this.offset.z * this.offset.z), this.offset.y);
  3597. this.autoRotate && this.rotateLeft(this.getAutoRotationAngle()),
  3598. i += this.thetaDelta,
  3599. n += this.phiDelta,
  3600. n = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, n)),
  3601. n = Math.max(f, Math.min(Math.PI - f, n));
  3602. var r = this.updateZoom();
  3603. r = Math.max(this.minDistance, Math.min(this.maxDistance, r)),
  3604. this.target.add(this.panVector),
  3605. this.targetBounds.clampPoint(this.target, this.target),
  3606. this.offset.x = r * Math.sin(n) * Math.sin(i),
  3607. this.offset.y = r * Math.cos(n),
  3608. this.offset.z = r * Math.sin(n) * Math.cos(i),
  3609. t.copy(this.target).add(this.offset),
  3610. this.camera.lookAt(this.target),
  3611. this.thetaDelta = 0,
  3612. this.phiDelta = 0,
  3613. this.scale = 1,
  3614. this.panVector.set(0, 0, 0),
  3615. this.lastPosition.distanceTo(this.camera.position) > 0 && this.lastPosition.copy(this.camera.position)
  3616. }
  3617. ,
  3618. n.prototype.getAutoRotationAngle = function() {
  3619. return 2 * Math.PI / 60 / 60 * this.autoRotateSpeed
  3620. }
  3621. ,
  3622. n.prototype.getZoomScale = function() {
  3623. return Math.pow(.95, this.zoomSpeed)
  3624. }
  3625. ,
  3626. n.prototype.onMouseDown = function(e) {
  3627. if (this.enabled) {
  3628. switch (e.preventDefault(),
  3629. this.stopAutoPanning(),
  3630. this.mouseDown = !0,
  3631. this.state = this.mouseActions[e.button],
  3632. this.state) {
  3633. case c.ROTATE:
  3634. this.rotateStart.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3635. this.rotationSpeed.set(0, 0);
  3636. break;
  3637. case c.DOLLY:
  3638. this.dollyStart.set(e.clientX, e.clientY);
  3639. break;
  3640. case c.PAN:
  3641. this.panStart.set(e.clientX, e.clientY)
  3642. }
  3643. this.emit(d.InputStart, "mouse")
  3644. }
  3645. }
  3646. ,
  3647. n.prototype.onMouseMove = function(e) {
  3648. if (this.enabled && this.mouseDown && 0 !== e.buttons) {
  3649. switch (e.preventDefault(),
  3650. this.state) {
  3651. case c.ROTATE:
  3652. this.rotateEnd.set(e.clientX, this.noRotateUpDown ? 0 : e.clientY),
  3653. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3654. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3655. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3656. this.rotateStart.copy(this.rotateEnd);
  3657. break;
  3658. case c.DOLLY:
  3659. this.dollyEnd.set(e.clientX, e.clientY),
  3660. this.dollyDelta.subVectors(this.dollyEnd, this.dollyStart);
  3661. var t = this.dollyDelta.y > 0 ? this.dollyIn : this.dollyOut;
  3662. t.call(this),
  3663. this.dollyStart.copy(this.dollyEnd);
  3664. break;
  3665. case c.PAN:
  3666. this.panEnd.set(e.clientX, e.clientY),
  3667. this.panDelta.subVectors(this.panEnd, this.panStart),
  3668. this.pan(this.panDelta.x, this.panDelta.y),
  3669. this.panStart.copy(this.panEnd)
  3670. }
  3671. this.emit(d.Move, "mouse"),
  3672. this.lastMoveTime = e.timeStamp,
  3673. this.update()
  3674. }
  3675. }
  3676. ,
  3677. n.prototype.onMouseUp = function(e) {
  3678. this.enabled && (this.mouseDown = !1,
  3679. this.state = c.NONE,
  3680. "mouseover" !== e.type && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3681. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y),
  3682. this.update(),
  3683. this.rotationAcceleration.set(0, 0),
  3684. this.rotateDelta.set(0, 0)))
  3685. }
  3686. ,
  3687. n.prototype.onMouseOver = function(e) {
  3688. 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  3689. }
  3690. ,
  3691. n.prototype.onMouseWheel = function(e) {
  3692. if (this.enabled && o.useWheel) {
  3693. this.emit(d.Move, "wheel");
  3694. var t = e.wheelDelta || -e.detail
  3695. , i = t > 0 ? this.dollyOut : this.dollyIn;
  3696. i.call(this),
  3697. this.update()
  3698. }
  3699. }
  3700. ,
  3701. n.prototype.onKeyDown = function(e) {
  3702. this.enabled && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  3703. this.handleKeyDown(e.which)))
  3704. }
  3705. ,
  3706. n.prototype.navRotationAcc = function(e, t) {
  3707. "y" === e ? this.noRotateUpDown ? this.keyboardZoomSpeed = t : this.rotationAcceleration.y = t : this.rotationAcceleration.x = t
  3708. }
  3709. ,
  3710. n.prototype.navPanAcc = function(e, t) {
  3711. this.stopAutoPanning(),
  3712. this.panAcceleration[e] = t
  3713. }
  3714. ,
  3715. n.prototype.handleKeyDown = function(e) {
  3716. var t = !0;
  3717. switch (e) {
  3718. case u.UPARROW:
  3719. case u.I:
  3720. this.navRotationAcc("y", 1);
  3721. break;
  3722. case u.DOWNARROW:
  3723. case u.K:
  3724. this.navRotationAcc("y", -1);
  3725. break;
  3726. case u.LEFTARROW:
  3727. case u.J:
  3728. this.navRotationAcc("x", -1);
  3729. break;
  3730. case u.RIGHTARROW:
  3731. case u.L:
  3732. this.navRotationAcc("x", 1);
  3733. break;
  3734. case u.W:
  3735. this.navPanAcc("y", 1);
  3736. break;
  3737. case u.S:
  3738. this.navPanAcc("y", -1);
  3739. break;
  3740. case u.A:
  3741. this.navPanAcc("x", -1);
  3742. break;
  3743. case u.D:
  3744. this.navPanAcc("x", 1);
  3745. break;
  3746. default:
  3747. t = !1
  3748. }
  3749. t && this.emit(d.Move, "key")
  3750. }
  3751. ,
  3752. n.prototype.onKeyUp = function(e) {
  3753. this.enabled && (e.preventDefault(),
  3754. e.stopPropagation(),
  3755. this.handleKeyUp(e.which))
  3756. }
  3757. ,
  3758. n.prototype.handleKeyUp = function(e) {
  3759. switch (e) {
  3760. case u.I:
  3761. case u.K:
  3762. case u.UPARROW:
  3763. case u.DOWNARROW:
  3764. this.keyboardZoomSpeed = 0,
  3765. this.rotationAcceleration.y = 0;
  3766. break;
  3767. case u.J:
  3768. case u.L:
  3769. case u.LEFTARROW:
  3770. case u.RIGHTARROW:
  3771. this.rotationAcceleration.x = 0;
  3772. break;
  3773. case u.S:
  3774. case u.W:
  3775. this.panAcceleration.y = 0;
  3776. break;
  3777. case u.A:
  3778. case u.D:
  3779. this.panAcceleration.x = 0
  3780. }
  3781. }
  3782. ,
  3783. n.prototype.onTouchStart = function(e) {
  3784. if (this.enabled || this.state === c.NONE) {
  3785. e.preventDefault(),
  3786. e.stopPropagation(),
  3787. this.stopAutoPanning();
  3788. var t = function() {
  3789. if (2 === e.touches.length) {
  3790. var t = e.touches[0].pageX - e.touches[1].pageX
  3791. , i = e.touches[0].pageY - e.touches[1].pageY;
  3792. this.dollyStart.set(t, i)
  3793. }
  3794. }
  3795. .bind(this)
  3796. , i = function() {
  3797. this.panStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3798. }
  3799. .bind(this)
  3800. , n = function() {
  3801. this.rotateStart.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY"))
  3802. }
  3803. .bind(this);
  3804. switch (this.state = this.touchActions[e.touches.length],
  3805. this.state) {
  3806. case c.PAN_DOLLY:
  3807. t();
  3808. case c.PAN:
  3809. i();
  3810. break;
  3811. case c.ROTATE_DOLLY:
  3812. t();
  3813. case c.ROTATE:
  3814. n()
  3815. }
  3816. this.rotationSpeed.set(0, 0),
  3817. this.emit(d.InputStart, "touch")
  3818. }
  3819. }
  3820. ,
  3821. n.prototype.onTouchMove = function(e) {
  3822. if (this.enabled && this.state !== c.NONE) {
  3823. e.preventDefault(),
  3824. e.stopPropagation();
  3825. var t = function() {
  3826. var t = e.touches[0].pageX - e.touches[1].pageX
  3827. , i = e.touches[0].pageY - e.touches[1].pageY;
  3828. this.dollyEnd.set(t, i);
  3829. var n = this.dollyStart.length() - this.dollyEnd.length();
  3830. n > 0 ? this.dollyOut(1 + n / 500) : this.dollyIn(1 - n / 500),
  3831. this.dollyStart.copy(this.dollyEnd)
  3832. }
  3833. .bind(this)
  3834. , i = function() {
  3835. this.panEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3836. this.panDelta.subVectors(this.panEnd, this.panStart),
  3837. this.pan(this.panDelta.x, this.panDelta.y),
  3838. this.panStart.copy(this.panEnd),
  3839. this.rotateDelta.set(0, 0)
  3840. }
  3841. .bind(this)
  3842. , n = function() {
  3843. this.rotateEnd.set(a.average(e.touches, "pageX"), a.average(e.touches, "pageY")),
  3844. this.rotateDelta.subVectors(this.rotateEnd, this.rotateStart),
  3845. this.rotateLeft(2 * Math.PI * this.rotateDelta.x / $("#player").width() * this.rotateSpeed),
  3846. this.rotateUp(2 * Math.PI * this.rotateDelta.y / $("#player").height() * this.rotateSpeed),
  3847. this.rotateStart.copy(this.rotateEnd)
  3848. }
  3849. .bind(this)
  3850. , r = function() {
  3851. if (2 === e.touches.length) {
  3852. var i = window.devicePixelRatio || 1
  3853. , r = e.touches[1].pageX - e.touches[0].pageX
  3854. , s = e.touches[1].pageY - e.touches[0].pageY
  3855. , l = Math.sqrt(r * r + s * s)
  3856. , h = Math.abs(this.dollyStart.length() - l);
  3857. if (h > o.input.touchMoveThreshold * i)
  3858. this.state = c.DOLLY,
  3859. t();
  3860. else {
  3861. var u = a.average(e.touches, "pageX")
  3862. , d = a.average(e.touches, "pageY")
  3863. , p = this.rotateDelta.set(u, d).sub(this.rotateStart).length();
  3864. p > o.input.touchMoveThreshold && (this.state = c.ROTATE,
  3865. this.rotateStart.set(u, d),
  3866. n())
  3867. }
  3868. }
  3869. }
  3870. .bind(this);
  3871. switch (this.state) {
  3872. case c.PAN_DOLLY:
  3873. t();
  3874. case c.PAN:
  3875. i();
  3876. break;
  3877. case c.ROTATE_DOLLY:
  3878. r();
  3879. break;
  3880. case c.DOLLY:
  3881. t();
  3882. break;
  3883. case c.ROTATE:
  3884. n();
  3885. break;
  3886. default:
  3887. this.state = c.NONE
  3888. }
  3889. this.lastMoveTime = e.timeStamp,
  3890. this.emit(d.Move, "touch")
  3891. }
  3892. }
  3893. ,
  3894. n.prototype.onTouchEnd = function(e) {
  3895. this.enabled && (this.state === c.ROTATE && (e.timeStamp > this.lastMoveTime + 100 ? (this.rotationSpeed.set(0, 0),
  3896. this.rotationAcceleration.set(0, 0)) : this.rotationAcceleration.set(-this.rotateDelta.x, this.rotateDelta.y)),
  3897. this.state = c.NONE,
  3898. this.update(),
  3899. this.rotationAcceleration.set(0, 0),
  3900. this.rotateDelta.set(0, 0))
  3901. }
  3902. ,
  3903. n.prototype.onPointerDown = function(e) {
  3904. this.enabled && ("touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  3905. id: e.pointerId,
  3906. pageX: e.pageX,
  3907. pageY: e.pageY
  3908. }),
  3909. e.touches = this.pointers,
  3910. this.onTouchStart(e)),
  3911. this.emit(d.InputStart, "pointer"))
  3912. }
  3913. ,
  3914. n.prototype.onPointerMove = function(e) {
  3915. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  3916. e.pointerId === t.id && (t.pageX = e.pageX,
  3917. t.pageY = e.pageY)
  3918. }),
  3919. e.touches = this.pointers,
  3920. this.onTouchMove(e))
  3921. }
  3922. ,
  3923. n.prototype.onPointerUp = function(e) {
  3924. this.enabled && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  3925. e.pointerId === t.id && this.pointers.splice(i, 1)
  3926. }
  3927. .bind(this)),
  3928. e.touches = this.pointers,
  3929. this.onTouchEnd(e))
  3930. }
  3931. ,
  3932. n.prototype.reset = function() {
  3933. this.state = c.NONE,
  3934. this.stopAutoPanning(),
  3935. this.rotationSpeed.set(0, 0),
  3936. this.rotationAcceleration.set(0, 0),
  3937. this.panSpeed.set(0, 0),
  3938. this.panAcceleration.set(0, 0)
  3939. }
  3940. ,
  3941. n.prototype.toJSON = function() {
  3942. var e = {
  3943. camera_position: {
  3944. x: s.toPrecision(this.camera.position.x, 4),
  3945. y: s.toPrecision(this.camera.position.y, 4),
  3946. z: s.toPrecision(this.camera.position.z, 4)
  3947. },
  3948. camera_quaternion: {
  3949. x: s.toPrecision(this.camera.quaternion.x, 4),
  3950. y: s.toPrecision(this.camera.quaternion.y, 4),
  3951. z: s.toPrecision(this.camera.quaternion.z, 4),
  3952. w: s.toPrecision(this.camera.quaternion.w, 4)
  3953. }
  3954. };
  3955. return e
  3956. }
  3957. ,
  3958. t.exports = n
  3959. }
  3960. , {
  3961. "../enum/ControlActions": 20,
  3962. "../enum/ControlEvents": 21,
  3963. "../enum/Keys": 30,
  3964. "../enum/MouseButton": 34,
  3965. "../enum/Vectors": 50,
  3966. "../settings": 166,
  3967. "../util/common": 185,
  3968. "../util/math": 190,
  3969. events: 202,
  3970. three: 217
  3971. }],
  3972. 13: [function(e, t, i) {
  3973. (function(i) {
  3974. "use strict";
  3975. function n(e) {
  3976. this.camera = e,
  3977. this.camera.controls = this,
  3978. this.target = new r.Vector3(0,0,0),
  3979. this.lookVector = new r.Vector3,
  3980. this.lookSpeed = .05,
  3981. this.rotationAcc = new r.Vector2,
  3982. this.rotationSpeed = new r.Vector2,
  3983. this.lat = 0,
  3984. this.lon = 0,
  3985. this.phi = 0,
  3986. this.theta = 0,
  3987. this.enabled = !1,
  3988. this.locked = !1,
  3989. this.pointer = new r.Vector2(0,0),
  3990. this.rotationHistory = [],
  3991. this.rotationDifference = new r.Vector2,
  3992. this.pointerDragOn = !1,
  3993. this.pointerDragStart = new r.Vector2(0,0),
  3994. this.pinchDistance = 0,
  3995. this.moveStart = new r.Vector2,
  3996. this.moveTolerance = .01,
  3997. this.pointersLimit = 2,
  3998. this.pointers = []
  3999. }
  4000. var r = e("three")
  4001. , o = e("../util/logger")
  4002. , a = e("../settings")
  4003. , s = e("../util/common")
  4004. , l = e("../util/math")
  4005. , c = (e("../enum/Vectors"),
  4006. e("../enum/MouseButton"))
  4007. , h = e("../enum/Keys")
  4008. , u = e("../enum/ControlEvents")
  4009. , d = e("events").EventEmitter;
  4010. new o(i);
  4011. n.prototype = Object.create(d.prototype),
  4012. n.prototype.usable = function() {
  4013. return this.enabled && !this.locked
  4014. }
  4015. ,
  4016. n.prototype.lookAt = function(e) {
  4017. var t = this.camera.position.clone().sub(e)
  4018. , i = Math.atan(t.z / t.x);
  4019. i += t.x < 0 ? Math.PI : 0,
  4020. i += t.x > 0 && t.z < 0 ? 2 * Math.PI : 0,
  4021. this.lon = r.Math.radToDeg(i) + 180;
  4022. var n = Math.sqrt(t.x * t.x + t.z * t.z)
  4023. , o = Math.atan(t.y / n);
  4024. this.lat = -r.Math.radToDeg(o)
  4025. }
  4026. ,
  4027. n.prototype.startRotationFrom = function(e, t) {
  4028. l.convertScreenPositionToNDC(e, t, this.pointer),
  4029. this.pointerDragOn = !0,
  4030. this.pointerDragStart.copy(this.pointer),
  4031. this.moveStart.copy(this.pointer),
  4032. this.rotationHistory = [],
  4033. this.rotationSpeed.set(0, 0)
  4034. }
  4035. ,
  4036. n.prototype.onMouseOver = function(e) {
  4037. !this.pointerDragOn || 0 !== e.which && 0 !== e.buttons || this.onMouseUp(e)
  4038. }
  4039. ,
  4040. n.prototype.onTouchStart = function(e) {
  4041. if (this.usable()) {
  4042. switch (e.preventDefault(),
  4043. e.stopPropagation(),
  4044. e.touches.length) {
  4045. case 1:
  4046. this.startRotationFrom(e.touches[0].clientX, e.touches[0].clientY);
  4047. break;
  4048. case 2:
  4049. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4050. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height();
  4051. this.pinchDistance = Math.sqrt(t * t + i * i)
  4052. }
  4053. this.emit(u.InputStart, "touch")
  4054. }
  4055. }
  4056. ,
  4057. n.prototype.onPointerDown = function(e) {
  4058. this.usable() && "touch" === e.pointerType && (this.pointers.length < this.pointersLimit && this.pointers.push({
  4059. id: e.pointerId,
  4060. clientX: e.clientX,
  4061. clientY: e.clientY
  4062. }),
  4063. e.touches = this.pointers,
  4064. this.onTouchStart(e),
  4065. this.emit(u.InputStart, "pointer"))
  4066. }
  4067. ,
  4068. n.prototype.onMouseDown = function(e) {
  4069. if (this.usable()) {
  4070. switch (e.preventDefault(),
  4071. e.stopPropagation(),
  4072. e.button) {
  4073. case c.LEFT:
  4074. this.startRotationFrom(e.clientX, e.clientY)
  4075. }
  4076. this.emit(u.InputStart, "mouse")
  4077. }
  4078. }
  4079. ,
  4080. n.prototype.updateRotation = function() {
  4081. if (this.usable() && this.pointerDragOn) {
  4082. var e = new r.Vector3(this.pointerDragStart.x,this.pointerDragStart.y,-1).unproject(this.camera)
  4083. , t = new r.Vector3(this.pointer.x,this.pointer.y,-1).unproject(this.camera)
  4084. , i = Math.sqrt(e.x * e.x + e.z * e.z)
  4085. , n = Math.sqrt(t.x * t.x + t.z * t.z)
  4086. , o = Math.atan2(e.y, i)
  4087. , a = Math.atan2(t.y, n);
  4088. this.rotationDifference.y = r.Math.radToDeg(o - a),
  4089. e.y = 0,
  4090. t.y = 0;
  4091. var s = Math.acos(e.dot(t) / e.length() / t.length());
  4092. isNaN(s) || (this.rotationDifference.x = r.Math.radToDeg(s),
  4093. this.pointerDragStart.x < this.pointer.x && (this.rotationDifference.x *= -1)),
  4094. this.pointerDragStart.copy(this.pointer)
  4095. }
  4096. }
  4097. ,
  4098. n.prototype.onMouseMove = function(e) {
  4099. this.usable() && (l.convertScreenPositionToNDC(e.clientX, e.clientY, this.pointer),
  4100. this.pointerDragOn && (Math.abs(this.pointer.x - this.moveStart.x) > this.moveTolerance || Math.abs(this.pointer.y - this.moveStart.y) > this.moveTolerance) && this.emit(u.Move, "mouse"))
  4101. }
  4102. ,
  4103. n.prototype.onTouchMove = function(e) {
  4104. if (this.usable())
  4105. switch (this.emit(u.Move, "touch"),
  4106. e.touches.length) {
  4107. case 1:
  4108. l.convertScreenPositionToNDC(e.touches[0].clientX, e.touches[0].clientY, this.pointer);
  4109. break;
  4110. case 2:
  4111. var t = (e.touches[0].clientX - e.touches[1].clientX) / $("#player").width()
  4112. , i = (e.touches[0].clientY - e.touches[1].clientY) / $("#player").height()
  4113. , n = this.pinchDistance - Math.sqrt(t * t + i * i);
  4114. Math.abs(n) > .01 && (this.emit(u.InteractionDirect),
  4115. this.emit(u.Pinch, n),
  4116. this.pinchDistance -= n)
  4117. }
  4118. }
  4119. ,
  4120. n.prototype.onPointerMove = function(e) {
  4121. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t) {
  4122. e.pointerId === t.id && (t.clientX = e.clientX,
  4123. t.clientY = e.clientY)
  4124. }),
  4125. e.touches = this.pointers,
  4126. this.onTouchMove(e))
  4127. }
  4128. ,
  4129. n.prototype.endRotation = function() {
  4130. this.pointerDragOn = !1;
  4131. var e = s.averageVectors(this.rotationHistory);
  4132. this.rotationSpeed.set(e.x * a.rotationAfterMoveMultiplier, e.y * a.rotationAfterMoveMultiplier)
  4133. }
  4134. ,
  4135. n.prototype.onTouchEnd = function(e) {
  4136. this.usable() && (e.preventDefault(),
  4137. e.stopPropagation(),
  4138. this.endRotation())
  4139. }
  4140. ,
  4141. n.prototype.onMouseUp = function(e) {
  4142. this.usable() && (e.preventDefault(),
  4143. e.stopPropagation(),
  4144. this.endRotation())
  4145. }
  4146. ,
  4147. n.prototype.onPointerUp = function(e) {
  4148. this.usable() && "touch" === e.pointerType && (this.pointers.forEach(function(t, i) {
  4149. e.pointerId === t.id && this.pointers.splice(i, 1)
  4150. }
  4151. .bind(this)),
  4152. e.touches = this.pointers,
  4153. this.onTouchEnd(e))
  4154. }
  4155. ,
  4156. n.prototype.update = function(e) {
  4157. this.lon,
  4158. this.lat;
  4159. for (this.updateRotation(),
  4160. this.rotationHistory.push(this.rotationDifference.clone()); this.rotationHistory.length > a.rotationAfterMoveHistoryCount; )
  4161. this.rotationHistory.shift();
  4162. this.lon += this.rotationDifference.x,
  4163. this.lat += this.rotationDifference.y,
  4164. this.rotationDifference.set(0, 0),
  4165. this.rotationSpeed.x = this.rotationSpeed.x * (1 - a.rotationFriction) + this.rotationAcc.x * a.rotationAccelerationInside,
  4166. this.rotationSpeed.y = this.rotationSpeed.y * (1 - a.rotationFriction) + this.rotationAcc.y * a.rotationAccelerationInside,
  4167. this.lon += this.rotationSpeed.x * e,
  4168. this.lat += this.rotationSpeed.y * e,
  4169. this.lat = Math.max(a.insideLookLimitDown, Math.min(a.insideLookLimitUp, this.lat)),
  4170. this.phi = r.Math.degToRad(90 - this.lat),
  4171. this.theta = r.Math.degToRad(this.lon),
  4172. this.lookVector.x = Math.sin(this.phi) * Math.cos(this.theta),
  4173. this.lookVector.y = Math.cos(this.phi),
  4174. this.lookVector.z = Math.sin(this.phi) * Math.sin(this.theta),
  4175. this.target.copy(this.lookVector).add(this.camera.position),
  4176. this.camera.lookAt(this.target)
  4177. }
  4178. ,
  4179. n.prototype.onMouseWheel = function(e) {
  4180. if (this.usable()) {
  4181. var t = e.wheelDelta || -e.detail;
  4182. this.emit(u.InteractionDirect),
  4183. this.emit(u.Scroll, t)
  4184. }
  4185. }
  4186. ,
  4187. n.prototype.onKeyDown = function(e) {
  4188. this.usable() && (e.metaKey || e.ctrlKey || (e.preventDefault(),
  4189. this.handleKeyDown(e.which)))
  4190. }
  4191. ,
  4192. n.prototype.handleKeyDown = function(e) {
  4193. var t = function(e, t) {
  4194. this.rotationAcc[e] = t
  4195. }
  4196. .bind(this);
  4197. this.emit(u.InteractionKey);
  4198. var i = !0;
  4199. switch (e) {
  4200. case h.LEFTARROW:
  4201. case h.J:
  4202. t("x", -1);
  4203. break;
  4204. case h.RIGHTARROW:
  4205. case h.L:
  4206. t("x", 1);
  4207. break;
  4208. case h.I:
  4209. t("y", 1);
  4210. break;
  4211. case h.K:
  4212. t("y", -1);
  4213. break;
  4214. default:
  4215. i = !1
  4216. }
  4217. i && this.emit(u.Move, "key")
  4218. }
  4219. ,
  4220. n.prototype.onKeyUp = function(e) {
  4221. this.usable() && (e.preventDefault(),
  4222. e.stopPropagation(),
  4223. this.handleKeyUp(e.which))
  4224. }
  4225. ,
  4226. n.prototype.handleKeyUp = function(e) {
  4227. switch (e) {
  4228. case h.LEFTARROW:
  4229. case h.J:
  4230. case h.RIGHTARROW:
  4231. case h.L:
  4232. this.rotationAcc.x = 0;
  4233. break;
  4234. case h.I:
  4235. case h.K:
  4236. this.rotationAcc.y = 0
  4237. }
  4238. }
  4239. ,
  4240. n.prototype.startRotating = function(e, t) {
  4241. e && (this.rotationAcc.x = e),
  4242. t && (this.rotationAcc.y = t)
  4243. }
  4244. ,
  4245. n.prototype.stopRotating = function(e) {
  4246. e && (this.rotationSpeed.x = this.rotationSpeed.y = 0),
  4247. this.rotationAcc.set(0, 0)
  4248. }
  4249. ,
  4250. n.prototype.reset = function() {
  4251. this.pointerDragOn = !1,
  4252. this.rotationAcc.set(0, 0),
  4253. this.rotationSpeed.set(0, 0),
  4254. this.pointers = []
  4255. }
  4256. ,
  4257. n.prototype.toJSON = function() {
  4258. var e = {
  4259. camera_position: {
  4260. x: l.toPrecision(this.camera.position.x, 4),
  4261. y: l.toPrecision(this.camera.position.y, 4),
  4262. z: l.toPrecision(this.camera.position.z, 4)
  4263. },
  4264. camera_quaternion: {
  4265. x: l.toPrecision(this.camera.quaternion.x, 4),
  4266. y: l.toPrecision(this.camera.quaternion.y, 4),
  4267. z: l.toPrecision(this.camera.quaternion.z, 4),
  4268. w: l.toPrecision(this.camera.quaternion.w, 4)
  4269. }
  4270. };
  4271. return e
  4272. }
  4273. ,
  4274. n.prototype.setStateFromJSON = function(e) {
  4275. this.camera.position.copy(e.camera_position),
  4276. this.camera.quaternion.copy(e.camera_quaternion)
  4277. }
  4278. ,
  4279. t.exports = n
  4280. }
  4281. ).call(this, "/js/controls/PanoramaControls.js")
  4282. }
  4283. , {
  4284. "../enum/ControlEvents": 21,
  4285. "../enum/Keys": 30,
  4286. "../enum/MouseButton": 34,
  4287. "../enum/Vectors": 50,
  4288. "../settings": 166,
  4289. "../util/common": 185,
  4290. "../util/logger": 189,
  4291. "../util/math": 190,
  4292. events: 202,
  4293. three: 217
  4294. }],
  4295. 14: [function(e, t, i) {
  4296. (function(i) {
  4297. "use strict";
  4298. var n = e("three")
  4299. , r = e("../enum/Viewmode")
  4300. , o = e("../util/logger")
  4301. , a = new o(i);
  4302. t.exports = {
  4303. serialize: function(e) {
  4304. return encodeURI(JSON.stringify(e))
  4305. },
  4306. deserialize: function(e) {
  4307. function t(e) {
  4308. function t(e, t) {
  4309. return e && "number" == typeof t && !isNaN(t)
  4310. }
  4311. return e.reduce(t, !0)
  4312. }
  4313. try {
  4314. var i = JSON.parse(decodeURI(e))
  4315. , o = {
  4316. mode: r.fromInt(i.camera_mode),
  4317. panoId: i.scan_id,
  4318. position: (new n.Vector3).copy(i.camera_position),
  4319. quaternion: (new n.Quaternion).copy(i.camera_quaternion),
  4320. zoom: i.ortho_zoom,
  4321. floorVisibility: i.floor_visibility
  4322. }
  4323. , s = o.position;
  4324. t([s.x, s.y, s.z]) || o.position.set(0, 0, 0);
  4325. var l = o.quaternion;
  4326. return t([l.x, l.y, l.z, l.w]) || o.quaternion.set(0, 0, 0, 1),
  4327. o
  4328. } catch (i) {
  4329. a.debug("Not able to parse start location as JSON; falling back to old array style parsing");
  4330. try {
  4331. var c = e.split(",")
  4332. , h = {
  4333. x: parseFloat(c[2]),
  4334. y: parseFloat(c[3]),
  4335. z: parseFloat(c[4])
  4336. }
  4337. , u = {
  4338. x: parseFloat(c[5]),
  4339. y: parseFloat(c[6]),
  4340. z: parseFloat(c[7]),
  4341. w: parseFloat(c[8])
  4342. };
  4343. return t([h.x, h.y, h.z]) || (h.x = 0,
  4344. h.y = 0,
  4345. h.z = 0),
  4346. t([u.x, u.y, u.z, u.w]) || (u.x = 0,
  4347. u.y = 0,
  4348. u.z = 0,
  4349. u.w = 1),
  4350. {
  4351. mode: r.fromInt(c[0]),
  4352. panoId: c[1],
  4353. position: (new n.Vector3).copy(h),
  4354. quaternion: (new n.Quaternion).copy(u)
  4355. }
  4356. } catch (t) {
  4357. a.warn('Invalid start override, ignoring: "' + e + '"', t.message)
  4358. }
  4359. }
  4360. return null
  4361. }
  4362. }
  4363. }
  4364. ).call(this, "/js/controls/serializer.js")
  4365. }
  4366. , {
  4367. "../enum/Viewmode": 51,
  4368. "../util/logger": 189,
  4369. three: 217
  4370. }],
  4371. 15: [function(e, t, i) {
  4372. (function(i) {
  4373. "use strict";
  4374. function n() {
  4375. this.endlessLoop = a.warp.loop,
  4376. this.clock = new r.Clock(!0),
  4377. this.model = null,
  4378. this.player = null,
  4379. this.currentItem = null,
  4380. this.destinationItem = null,
  4381. this.tourIsPlaying = !1,
  4382. this.transitionStage = y.None,
  4383. this.nextFunc = null,
  4384. this.onTheBus = !1,
  4385. this.tourInProgress = !1,
  4386. this.reachSource = null,
  4387. this.interrupted = !1,
  4388. this.nItems = 0,
  4389. this.walkingSectionPaused = !1
  4390. }
  4391. var r = e("three")
  4392. , o = e("./util/logger")
  4393. , a = e("./settings")
  4394. , s = e("./util/transitions")
  4395. , l = e("events").EventEmitter
  4396. , c = e("./enum/Viewmode")
  4397. , h = e("./analytics")
  4398. , u = e("./enum/WarpStyle")
  4399. , s = e("./util/transitions")
  4400. , d = (e("./model/ModelManager"),
  4401. e("./enum/ModelManagerEvents"))
  4402. , p = e("./enum/DirectorEvents")
  4403. , f = e("./enum/PlayerEvents")
  4404. , g = (e("./enum/ControlEvents"),
  4405. e("./enum/BlackoutStyle"))
  4406. , m = e("./enum/PathDiscardMode")
  4407. , v = e("./enum/PathDisplayMode")
  4408. , A = (e("./player"),
  4409. new o(i))
  4410. , y = Object.freeze({
  4411. None: 0,
  4412. Moving: 1,
  4413. Aiming: 2,
  4414. Interlude: 3
  4415. })
  4416. , C = Object.freeze({
  4417. Forward: 1,
  4418. NoChange: 0,
  4419. Backwards: -1
  4420. })
  4421. , I = s.getUniqueId();
  4422. n.prototype = Object.create(l.prototype),
  4423. n.prototype.init = function(e, t) {
  4424. this.player = e,
  4425. this.modelManager = t,
  4426. this.updateModel(),
  4427. this.resetAll(),
  4428. this.bindEvents()
  4429. }
  4430. ,
  4431. n.prototype.resetAll = function() {
  4432. if (this.currentItem = null,
  4433. this.destinationItem = null,
  4434. this.tourIsPlaying = !1,
  4435. this.bgmReplay(),//xzw
  4436. this.transitionStage = y.None,
  4437. this.nextFunc = null,
  4438. this.onTheBus = !1,
  4439. this.reachSource = null,
  4440. this.interrupted = !1,
  4441. this.model) {
  4442. var e = a.path.typ === u.WALK ? u.WALK : u.STD;
  4443. this.defaultWarpStyle = this.model.data.hasOwnProperty("player_options") && this.model.data.player_options && this.model.data.player_options.fast_transitions === !1 ? e : u.BLACK
  4444. } else
  4445. this.defaultWarpStyle = u.BLACK,
  4446. A.warn('No model yet, choosing "' + this.defaultWarpStyle + '" transitions');
  4447. this.resetSpecialTransition()
  4448. }
  4449. ,
  4450. n.prototype.updateModel = function() {
  4451. this.model = this.modelManager.getActiveModel(),
  4452. this.nItems = this.model.heroLocations.length
  4453. }
  4454. ,
  4455. n.prototype.bindEvents = function() {
  4456. this.modelManager.on(d.ActiveModelChanged, this.updateModel.bind(this)),
  4457. this.player.on(f.WarpInterruptedWithFlyTo, this.checkAndHandleWalkingtourInterruption.bind(this)),
  4458. this.player.on(f.Move, this.handlePlayerMove.bind(this)),
  4459. this.player.on(f.PanoChosen, this.handlePlayerPanoChosen.bind(this)),
  4460. this.player.on(f.ModeChanged, this.handlePlayerModeChanged.bind(this)),
  4461. this.player.on(f.InputStart, this.handlePlayerInputStart.bind(this)),
  4462. this.player.on(f.FlyingStarted, this.handlePlayerFlyingStarted.bind(this)),
  4463. this.player.once(f.Move, function() {
  4464. s.cancelById(I)
  4465. })
  4466. }
  4467. ,
  4468. n.prototype.checkAndHandleWalkingtourInterruption = function(e) {
  4469. return e === u.WALK && (this.interrupt(g.NONE),
  4470. this.pauseWalkingSection(),
  4471. this.player.fastForwardActivePanoFlight(),
  4472. !0)
  4473. }
  4474. ,
  4475. n.prototype.handlePlayerMove = function(e) {
  4476. this.transitionStage === y.Interlude && this.interrupt(g.NONE),
  4477. this.emit("update.controls")
  4478. }
  4479. ,
  4480. n.prototype.handlePlayerPanoChosen = function(e, t) {
  4481. this.intermediateState() || e.id === t.id || (this.onTheBus = !1,
  4482. this.emit("update.controls"))
  4483. }
  4484. ,
  4485. n.prototype.handlePlayerModeChanged = function(e, t) {
  4486. this.intermediateState() || e === t || (this.onTheBus = !1,
  4487. this.emit("update.controls"))
  4488. }
  4489. ,
  4490. n.prototype.handlePlayerInputStart = function(e) {
  4491. this.transitionStage === y.Interlude && this.interrupt(g.NONE)
  4492. }
  4493. ,
  4494. n.prototype.handlePlayerFlyingStarted = function() {
  4495. this.clearWalkingSectionPaused()
  4496. }
  4497. ,
  4498. n.prototype.describe = function() {
  4499. return {
  4500. nItems: this.nItems,
  4501. currentItem: this.currentItem,
  4502. destinationItem: this.destinationItem,
  4503. tourIsPlaying: this.tourIsPlaying,
  4504. onTheBus: this.onTheBus,
  4505. endlessLoop: this.endlessLoop,
  4506. viewMode: this.player.mode,
  4507. inTransition: this._inTransition(),
  4508. transitionStage: this.transitionStage,
  4509. tourInProgress: this.tourInProgress
  4510. }
  4511. }
  4512. ,
  4513. n.prototype._inTransition = function() {
  4514. return this.player.flying || this.player.isWarping() || this.player.isWaitingToWarp() || this.player.mode === c.TRANSITIONING || this.tourIsPlaying
  4515. }
  4516. ,
  4517. n.prototype.bounceable = function() {
  4518. var e = this.clock.getDelta();
  4519. return this.isInterrupted() || e < .9 && e > .01 || this.player.flying && !this.player.isWarping()
  4520. }
  4521. ,
  4522. n.prototype.currentMoveDirection = function() {
  4523. return null === this.currentItem || void 0 === this.currentItem ? C.Forward : this.destinationItem === this.currentItem ? C.NoChange : this.destinationItem > this.currentItem ? C.Forward : C.Backwards
  4524. }
  4525. ,
  4526. n.prototype.clearPath = function() {
  4527. this._inTransition() || this.player.path.discardPathObject()
  4528. }
  4529. ,
  4530. n.prototype.allFloors = function() {
  4531. this.model.toggleAllFloors()
  4532. }
  4533. ,
  4534. n.prototype.actionComplete = function(e) {
  4535. if (this.interrupted = !1,
  4536. this.transitionStage = y.None,
  4537. this.resetSpecialTransition(),
  4538. null !== this.destinationItem && this.setCurrentItem(this.destinationItem),
  4539. this.tourIsPlaying || (this.player.disablePreRendering(),
  4540. this.player.mode === c.PANORAMA && this.player.currentPano.isAligned() && this.model.fadePanoMarkers()),
  4541. this.emit("update.controls"),
  4542. this.nextFunc) {
  4543. var t = this.nextFunc;
  4544. this.nextFunc = null,
  4545. t()
  4546. }
  4547. }
  4548. ,
  4549. n.prototype.awaitCompletion = function(e, t) {
  4550. this.nextFunc = t,
  4551. e()
  4552. }
  4553. ,
  4554. n.prototype.updateSuccessFunction = function(e) {
  4555. this.nextFunc = e
  4556. }
  4557. ,
  4558. n.prototype.interrupt = function(e, t) {
  4559. return !!this.wouldInterrupt() && (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4560. this.tourIsPlaying = !1,
  4561. this.bgmReplay(),//xzw
  4562. this.interrupted = !0,
  4563. this.nextFunc = null,
  4564. this.emit(p.ActionInterrupted),
  4565. null !== e && void 0 !== e || (e = g.BEGINNING),
  4566. this.player.interruptAndFastForward(e, t),
  4567. !0)
  4568. }
  4569. ,
  4570. n.prototype.wouldInterrupt = function() {
  4571. return this.transitionStage !== y.None
  4572. }
  4573. ,
  4574. n.prototype.intermediateState = function() {
  4575. return this.transitionStage !== y.None
  4576. }
  4577. ,
  4578. n.prototype.isInterrupted = function() {
  4579. return this.interrupted
  4580. }
  4581. ,
  4582. n.prototype.pauseWalkingSection = function() {
  4583. this.walkingSectionPaused = !0
  4584. }
  4585. ,
  4586. n.prototype.clearWalkingSectionPaused = function() {
  4587. this.walkingSectionPaused = !1
  4588. }
  4589. ,
  4590. n.prototype.autoTour = function() {
  4591. var e = Date.now();
  4592. this.model.auxDataPromise.then(function() {
  4593. e = Date.now() - e;
  4594. var t = a.warp.auto
  4595. , i = this.model.data && this.model.data.player_options && this.model.data.player_options.highlight_reel;
  4596. t >= 0 && this.model.heroCount() > 1 && i && s.trigger({
  4597. duration: Math.max(1e3 * Math.min(300, t) - e, 0),
  4598. done: function() {
  4599. this.playTour()
  4600. }
  4601. .bind(this),
  4602. name: "_atr",
  4603. id: I
  4604. })
  4605. }
  4606. .bind(this))
  4607. }
  4608. ,
  4609. n.prototype.atDestinationPano = function() {
  4610. if (!this.player.currentPano || null === this.destinationItem)
  4611. return !1;
  4612. var e = this.player.currentPano.id;
  4613. if (void 0 === e)
  4614. return !1;
  4615. var t = this.model.heroLocations;
  4616. return null !== this.destinationItem && void 0 !== t[this.destinationItem] && e === t[this.destinationItem].panoId
  4617. }
  4618. ,
  4619. n.prototype.redirectToItem = function(e, t) {
  4620. if (null === e || void 0 === e)
  4621. return void A.warn("Director.redirectToItem() -> Redirecting to null item.");
  4622. if (!this.wouldInterrupt())
  4623. return void A.warn("Director.redirectToItem() -> Director cannot redirect if there is nothing to interrupt.");
  4624. if (this.player.mode === c.TRANSITIONING)
  4625. return void A.debug("Director.redirectToItem() -> Cannot redirect while transitioning.");
  4626. A.debug("Director.redirectToItem() -> Redirecting to " + e + " via " + t);
  4627. var i = function() {
  4628. s.setTimeout(function() {
  4629. this.setDestinationItem(e),
  4630. this.goToDestination(!0, g.BEGINNING, a.warp.warpInterruptionRedirectTime, !1)
  4631. }
  4632. .bind(this), 0)
  4633. }
  4634. .bind(this);
  4635. this.interrupt(g.END, 0),
  4636. this.updateSuccessFunction(i)
  4637. }
  4638. ,
  4639. n.prototype.useSpecialTransition = function(e) {
  4640. void 0 !== e && this.defaultWarpStyle !== u.BLACK && A.debug("useSpecialTransition(): " + e),
  4641. this.nextWarpStyle = u.BLACK
  4642. }
  4643. ,
  4644. n.prototype.resetSpecialTransition = function() {
  4645. this.nextWarpStyle = this.defaultWarpStyle
  4646. }
  4647. ,
  4648. n.prototype.arrivedAtDestination = function(e) {
  4649. if (this.player.flying || this.player.isWarping())
  4650. A.warn("Cannot advance to interlude or aiming while player is flying or warping.");
  4651. else {
  4652. this.transitionStage = y.Aiming;
  4653. var t = this.tourIsPlaying ? this.tourInterlude.bind(this, this.nextItem(this.currentItem)) : null;
  4654. this.player.model.fadePanoMarkers(0),
  4655. this.awaitCompletion(function() {
  4656. this.resetSpecialTransition(),
  4657. e ? this.player.aimTourCamera(this.destinationItem, v.Retain, v.Slow, this.actionComplete.bind(this)) : this.actionComplete()
  4658. }
  4659. .bind(this), t)
  4660. }
  4661. }
  4662. ,
  4663. n.prototype.goToDestination = function(e, t, i, n) {
  4664. //xzw add:
  4665. if(g_data2.tourAudio){
  4666. var tM = g_data2.tourAudio[this.model.heroLocations[this.destinationItem].sid];
  4667. if(tM && tM.music){
  4668. var s = g_Prefix+"/audio/"+g_index+"/"+tM.music;
  4669. if(g_tourAudio.src==s && !g_tourAudio.paused) return;
  4670. g_tourAudio.src = s;
  4671. g_playAudio = g_tourAudio;
  4672. g_play && g_tourAudio.play();
  4673. g_bgAudio && g_bgAudio.pause();
  4674. }
  4675. }
  4676. if (this.onTheBus = !0,
  4677. this.emit("update.controls"),
  4678. this.player.updateLastView(),
  4679. !n && this.atDestinationPano())
  4680. return void this.arrivedAtDestination(!0);
  4681. if (this.player.flying || this.player.isWarping())
  4682. A.warn("Cannot go to new destination while player is flying or warping.");
  4683. else {
  4684. var r = this.model.getHeroDescriptorByIndex(this.destinationItem)
  4685. , o = null
  4686. , a = null;
  4687. if (r.isPano()) {
  4688. var s = 0 === this.destinationItem || e ? u.BLACK : this.nextWarpStyle;
  4689. a = this.player.warpToPanoByHeroIndex.bind(this.player, this.destinationItem, v.Show, m.Slow, s, t, i, this.actionComplete.bind(this)),
  4690. o = this.arrivedAtDestination.bind(this, !0)
  4691. } else
  4692. a = this.player.warpToNonPanoByHeroIndex.bind(this.player, this.destinationItem, this.actionComplete.bind(this)),
  4693. o = this.arrivedAtDestination.bind(this, !1);
  4694. this.transitionStage = y.Moving,
  4695. this.model.fadePanoMarkers(0),
  4696. this.awaitCompletion(function() {
  4697. a()
  4698. }
  4699. .bind(this), o),
  4700. this.emit("update.controls")
  4701. }
  4702. }
  4703. ,
  4704. n.prototype.tourInterlude = function() {
  4705. if (h.trackAlways("reach_highlight", {
  4706. reach_source: this.reachSource
  4707. }),
  4708. this.model.fadePanoMarkers(0),
  4709. this.emit("update.controls"),
  4710. this.tourIsPlaying)
  4711. return this.atEndOfTour() && !this.endlessLoop ? (this.tourInProgress = !1,
  4712. this.stopTour(),
  4713. this.emit(p.TourEnd),
  4714. void (this.player.mode === c.PANORAMA && this.model.fadePanoMarkers(a.panorama.markerOpacity))) : void this.awaitCompletion(function() {
  4715. this.transitionStage = y.Interlude,
  4716. this.player.tourInterlude(this.nextItem(this.currentItem), this.actionComplete.bind(this))
  4717. }
  4718. .bind(this), this.goNext.bind(this))
  4719. }
  4720. ,
  4721. n.prototype.playTour = function() {
  4722. if (!this.bounceable())
  4723. return this.tourIsPlaying ? void A.info("tour is already playing") : void (this.wouldInterrupt() || (this.player.emit("tour_auto", this.defaultWarpStyle),
  4724. this.tourInProgress = !0,
  4725. this.reachSource = "play",
  4726. this.tourIsPlaying = !0,
  4727. this.wasZoomEnabled = this.player.zoomEnabled,
  4728. this.player.zoomEnabled = !1,
  4729. this.resetSpecialTransition(),
  4730. this.emit("update.controls"),
  4731. this.emit(p.TourStart),
  4732. this.player.enablePreRendering(),
  4733. this.walkingSectionPaused ? (this.clearWalkingSectionPaused(),
  4734. this.goToDestination()) : this.goNext()))
  4735. }
  4736. ,
  4737. n.prototype.bgmReplay = function() {//xzw add 结束tour后可能要继续播放背景音乐
  4738. if(g_tourAudio && g_tourAudio.paused && g_bgAudio && g_bgAudio.paused){
  4739. g_playAudio = g_bgAudio;
  4740. g_bgAudio.play()
  4741. }
  4742. }
  4743. ,
  4744. n.prototype.stopTour = function() {
  4745. this.isInterrupted() || this.transitionStage === y.Moving && this.checkAndHandleWalkingtourInterruption(this.nextWarpStyle) || (this.tourIsPlaying && (this.player.zoomEnabled = this.wasZoomEnabled),
  4746. this.tourIsPlaying = !1,
  4747. this.bgmReplay(),//xzw
  4748. this.interrupt(),
  4749. this.clearWalkingSectionPaused(),
  4750. this.resetSpecialTransition(),
  4751. this.emit("update.controls"))
  4752. }
  4753. ,
  4754. n.prototype.endTourProgress = function() {
  4755. this.tourInProgress = !1,
  4756. this.emit("update.controls"),
  4757. this.emit(p.TourEnd)
  4758. }
  4759. ,
  4760. n.prototype.goToHighlight = function(e) {
  4761. if (this.wouldInterrupt())
  4762. e === this.destinationItem ? this.interrupt() : this.redirectToItem(e, "goToHighlight");
  4763. else {
  4764. if (A.debug("<tour.goto " + e + ">"),
  4765. this.isInterrupted())
  4766. return;
  4767. this.clearWalkingSectionPaused(),
  4768. this.setDestinationItem(e),
  4769. this.useSpecialTransition("Hilight"),
  4770. this.goToDestination(),
  4771. h.trackAlways("reach_highlight", {
  4772. reach_source: "thumb"
  4773. })
  4774. }
  4775. }
  4776. ,
  4777. n.prototype.prevHighlight = function() {
  4778. this.bounceable() || (this.player.emit("tour_manual", "prev"),
  4779. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4780. this.reachSource = "prev",
  4781. this.goPrev()))
  4782. }
  4783. ,
  4784. n.prototype.nextHighlight = function() {
  4785. this.bounceable() || (this.player.emit("tour_manual", "next"),
  4786. this.interrupt(g.BEGINNING) || this.isInterrupted() || (this.clearWalkingSectionPaused(),
  4787. this.reachSource = "next",
  4788. this.goNext()))
  4789. }
  4790. ,
  4791. n.prototype.changeMode = function(e) {
  4792. var t = $.Deferred()
  4793. , i = t.resolve.bind(t)
  4794. , n = t.reject.bind(t);
  4795. this.emit(p.StartModeChange);
  4796. var r = function() {
  4797. return this.clearWalkingSectionPaused(),
  4798. !!this.wouldInterrupt() && (this.interrupt(),
  4799. !0)
  4800. }
  4801. .bind(this);
  4802. if (!r()) {
  4803. switch (e) {
  4804. case c.PANORAMA:
  4805. this.player.mode === c.PANORAMA ? this.player.currentPano.isAligned() || this.player.goToLastView(!0).done(i).fail(n) : this.player.insideMode(this.player.lastInsideView.pano).done(i).fail(n);
  4806. break;
  4807. case c.DOLLHOUSE:
  4808. case c.FLOORPLAN:
  4809. this.player.flyToNewMode({
  4810. mode: e
  4811. }).done(i).fail(n);
  4812. break;
  4813. case c.OUTDOOR:
  4814. this.player.model.has360Views && (this.player.mode !== c.PANORAMA || this.player.mode === c.PANORAMA && this.player.currentPano.isAligned()) && this.player.goToLastView(!1).done(i).fail(n)
  4815. }
  4816. return t.promise()
  4817. }
  4818. }
  4819. ,
  4820. n.prototype.atEndOfTour = function() {
  4821. var e = this.currentItem >= this.nItems - 1;
  4822. return e
  4823. }
  4824. ,
  4825. n.prototype.firstDestination = function() {
  4826. return this.nItems > 0 ? 0 : null
  4827. }
  4828. ,
  4829. n.prototype.finalDestination = function() {
  4830. return this.nItems > 0 ? this.nItems - 1 : null
  4831. }
  4832. ,
  4833. n.prototype.goPrev = function() {
  4834. this.tourAdvance(-1)
  4835. }
  4836. ,
  4837. n.prototype.goNext = function() {
  4838. this.tourAdvance(1)
  4839. }
  4840. ,
  4841. n.prototype.setDestinationItem = function(e) {
  4842. this.destinationItem = e,
  4843. this.emit("update.controls")
  4844. }
  4845. ,
  4846. n.prototype.setCurrentItem = function(e) {
  4847. this.currentItem = e,
  4848. this.emit("update.controls")
  4849. }
  4850. ,
  4851. n.prototype.nextItem = function(e) {
  4852. return null === e ? this.firstDestination() : e >= this.nItems - 1 ? this.endlessLoop ? this.firstDestination() : null : e + 1
  4853. }
  4854. ,
  4855. n.prototype.prevItem = function(e) {
  4856. return null === e ? this.firstDestination() : e < 0 ? this.endlessLoop ? this.lastDestination() : null : e - 1
  4857. }
  4858. ,
  4859. n.prototype.tourAdvance = function(e) {
  4860. A.debug("tourAdvance(" + e + ")"),
  4861. null === this.currentItem || void 0 === this.currentItem ? this.setDestinationItem(this.firstDestination()) : this.setDestinationItem(this.currentItem + e),
  4862. this.destinationItem < 0 ? (this.setDestinationItem(this.finalDestination()),
  4863. this.useSpecialTransition("reverse-looping to end")) : this.destinationItem >= this.nItems && (this.setDestinationItem(this.firstDestination()),
  4864. this.useSpecialTransition("looping back to start")),
  4865. this.goToDestination()
  4866. }
  4867. ,
  4868. t.exports = n
  4869. }
  4870. ).call(this, "/js/director.js")
  4871. }
  4872. , {
  4873. "./analytics": 4,
  4874. "./enum/BlackoutStyle": 18,
  4875. "./enum/ControlEvents": 21,
  4876. "./enum/DirectorEvents": 23,
  4877. "./enum/ModelManagerEvents": 33,
  4878. "./enum/PathDiscardMode": 38,
  4879. "./enum/PathDisplayMode": 39,
  4880. "./enum/PlayerEvents": 40,
  4881. "./enum/Viewmode": 51,
  4882. "./enum/WarpStyle": 52,
  4883. "./model/ModelManager": 140,
  4884. "./player": 155,
  4885. "./settings": 166,
  4886. "./util/logger": 189,
  4887. "./util/transitions": 195,
  4888. events: 202,
  4889. three: 217
  4890. }],
  4891. 16: [function(e, t, i) {
  4892. "use strict";
  4893. var n = e("three")
  4894. , r = e("./enum/Viewmode")
  4895. , o = (e("./settings"),
  4896. e("./util/transitions"))
  4897. , a = e("./enum/PlayerEvents")
  4898. , s = new n.ShaderPass(n.HorizontalBlurShader)
  4899. , l = new n.ShaderPass(n.VerticalBlurShader);
  4900. l.renderToScreen = !0;
  4901. var c = $("#player").width() / $("#player").height();
  4902. isNaN(c) && (c = 1);
  4903. var h = {
  4904. currentBlur: 0,
  4905. aspect: c,
  4906. blurStrength: 1,
  4907. hblurPass: s,
  4908. vblurPass: l,
  4909. bindEvents: function(e) {
  4910. e.on(a.ModeChanged, function(e, t) {
  4911. e === r.PANORAMA && (o.cancel(h.blur),
  4912. o.cancel(h.addBlur),
  4913. o.start(h.removeBlur, 500, null, 0, null, "deblur"))
  4914. })
  4915. },
  4916. blur: function(e) {
  4917. h.currentBlur = e;
  4918. var t = e * h.blurStrength;
  4919. l.uniforms.v.value = t / 512 * h.aspect,
  4920. s.uniforms.h.value = t / 512
  4921. },
  4922. addBlur: function(e) {
  4923. e = Math.max(e, h.currentBlur),
  4924. h.blur(e)
  4925. },
  4926. removeBlur: function(e) {
  4927. e = Math.min(1 - e, h.currentBlur),
  4928. h.blur(e)
  4929. }
  4930. };
  4931. h.blur(0),
  4932. t.exports = h
  4933. }
  4934. , {
  4935. "./enum/PlayerEvents": 40,
  4936. "./enum/Viewmode": 51,
  4937. "./settings": 166,
  4938. "./util/transitions": 195,
  4939. three: 217
  4940. }],
  4941. 17: [function(e, t, i) {
  4942. "use strict";
  4943. t.exports = {
  4944. UNKNOWN: 0,
  4945. ALIGNED: 1,
  4946. UNALIGNED: 2,
  4947. PLACED: 3
  4948. }
  4949. }
  4950. , {}],
  4951. 18: [function(e, t, i) {
  4952. "use strict";
  4953. t.exports = {
  4954. NONE: 0,
  4955. MIDDLE: 1,
  4956. END: 2,
  4957. BEGINNING: 3,
  4958. FADEIN: 4
  4959. }
  4960. }
  4961. , {}],
  4962. 19: [function(e, t, i) {
  4963. "use strict";
  4964. var n = e("three");
  4965. t.exports = {
  4966. newBlue: new n.Color(4967932),
  4967. altBlue: new n.Color(47355),
  4968. tagDefault: new n.Color(223357),
  4969. classicBlue: new n.Color(53759),
  4970. mpYellow: new n.Color(16502016),
  4971. mpOrange: new n.Color(16428055),
  4972. mpBlue: new n.Color(12096),
  4973. mpLtGrey: new n.Color(13751252),
  4974. mpDkGrey: new n.Color(10000019),
  4975. mpRed: new n.Color(12525854),
  4976. mpOrangeDesat: new n.Color(16764529),
  4977. mpBlueDesat: new n.Color(4034734),
  4978. mpRedDesat: new n.Color(14705505),
  4979. white: new n.Color(16777215),
  4980. black: new n.Color(0),
  4981. _desat: function(e, t) {
  4982. var i = t || .3
  4983. , r = (new n.Color).copy(e).getHSL();
  4984. return (new n.Color).setHSL(r.h, r.s * (1 - i), r.l)
  4985. },
  4986. _darken: function(e, t) {
  4987. var i = t || .2
  4988. , r = e.getHSL();
  4989. return (new n.Color).setHSL(r.h, r.s, r.l * (1 - i))
  4990. }
  4991. }
  4992. }
  4993. , {
  4994. three: 217
  4995. }],
  4996. 20: [function(e, t, i) {
  4997. "use strict";
  4998. t.exports = {
  4999. NONE: -1,
  5000. ROTATE: 0,
  5001. DOLLY: 1,
  5002. PAN: 2,
  5003. ROTATE_DOLLY: 3,
  5004. PAN_DOLLY: 4
  5005. }
  5006. }
  5007. , {}],
  5008. 21: [function(e, t, i) {
  5009. "use strict";
  5010. t.exports = {
  5011. Move: "move",
  5012. InteractionDirect: "interaction.direct",
  5013. InteractionKey: "interaction.key",
  5014. InteractionGui: "interaction.gui",
  5015. FlyInDirection: "fly.direction",
  5016. InputStart: "input.start",
  5017. Pinch: "input.pinch",
  5018. Scroll: "input.scroll",
  5019. AutoPanInterrupt: "autopan.interrupt",
  5020. AutoPanComplete: "autopan.complete",
  5021. AutoPanClamped: "autopan.clamped",
  5022. LongTap: "longtap"
  5023. }
  5024. }
  5025. , {}],
  5026. 22: [function(e, t, i) {
  5027. "use strict";
  5028. t.exports = Object.freeze({
  5029. FORWARD: "FORWARD",
  5030. LEFT: "LEFT",
  5031. RIGHT: "RIGHT",
  5032. BACK: "BACK",
  5033. UP: "UP",
  5034. DOWN: "DOWN"
  5035. })
  5036. }
  5037. , {}],
  5038. 23: [function(e, t, i) {
  5039. "use strict";
  5040. t.exports = {
  5041. ActionInterrupted: "action.interrupted",
  5042. TourStart: "tour.start",
  5043. TourEnd: "tour.end",
  5044. StartModeChange: "mode.startChange"
  5045. }
  5046. }
  5047. , {}],
  5048. 24: [function(e, t, i) {
  5049. "use strict";
  5050. t.exports = Object.freeze({
  5051. None: 0,
  5052. Queued: 1,
  5053. ForceQueued: 2,
  5054. Downloading: 3,
  5055. Downloaded: 4,
  5056. DownloadFailed: 5
  5057. })
  5058. }
  5059. , {}],
  5060. 25: [function(e, t, i) {
  5061. "use strict";
  5062. t.exports = {
  5063. GL_TEXTURE_CUBE_MAP_POSITIVE_X: 0,
  5064. GL_TEXTURE_CUBE_MAP_NEGATIVE_X: 1,
  5065. GL_TEXTURE_CUBE_MAP_POSITIVE_Y: 2,
  5066. GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: 3,
  5067. GL_TEXTURE_CUBE_MAP_POSITIVE_Z: 4,
  5068. GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: 5
  5069. }
  5070. }
  5071. , {}],
  5072. 26: [function(e, t, i) {
  5073. "use strict";
  5074. t.exports = {
  5075. Texture2D: 0,
  5076. TextureCube: 1
  5077. }
  5078. }
  5079. , {}],
  5080. 27: [function(e, t, i) {
  5081. "use strict";
  5082. t.exports = {
  5083. SMALL: "small",
  5084. LARGE: "large"
  5085. }
  5086. }
  5087. , {}],
  5088. 28: [function(e, t, i) {
  5089. "use strict";
  5090. var n = e("./Viewmode")
  5091. , r = {
  5092. LANDING: {},
  5093. NAVIGATION: "navigation",
  5094. MORE_HELP: "moreHelp",
  5095. TOUR_INTERACTION: {}
  5096. };
  5097. r.LANDING[n.PANORAMA] = "panorama.landing",
  5098. r.LANDING[n.OUTDOOR] = "outdoor.landing",
  5099. r.LANDING[n.DOLLHOUSE] = "dollhouse.landing",
  5100. r.LANDING[n.FLOORPLAN] = "floorplan.landing",
  5101. r.TOUR_INTERACTION.standard = "standard.tour",
  5102. r.TOUR_INTERACTION[n.OUTDOOR] = "outdoor.tour",
  5103. r.TOUR_INTERACTION[n.FLOORPLAN] = "floorplan.tour",
  5104. t.exports = r
  5105. }
  5106. , {
  5107. "./Viewmode": 51
  5108. }],
  5109. 29: [function(e, t, i) {
  5110. "use strict";
  5111. var n = {
  5112. UP: 1,
  5113. DOWN: -1,
  5114. LEFT: "L",
  5115. RIGHT: "R",
  5116. FORWARD: "F",
  5117. BACK: "B",
  5118. reverse: {},
  5119. opposite: function(e) {
  5120. return this.reverse[e.toString()]
  5121. }
  5122. };
  5123. !function() {
  5124. n.reverse[n.UP] = n.DOWN,
  5125. n.reverse[n.DOWN] = n.UP,
  5126. n.reverse[n.LEFT] = n.RIGHT,
  5127. n.reverse[n.RIGHT] = n.LEFT,
  5128. n.reverse[n.FORWARD] = n.BACK,
  5129. n.reverse[n.BACK] = n.FORWARD
  5130. }(),
  5131. t.exports = n
  5132. }
  5133. , {}],
  5134. 30: [function(e, t, i) {
  5135. "use strict";
  5136. var n = e("../util/browser")
  5137. , r = {
  5138. ZERO: 48,
  5139. ONE: 49,
  5140. TWO: 50,
  5141. THREE: 51,
  5142. FOUR: 52,
  5143. FIVE: 53,
  5144. SIX: 54,
  5145. SEVEN: 55,
  5146. EIGHT: 56,
  5147. NINE: 57,
  5148. LEFTARROW: 37,
  5149. UPARROW: 38,
  5150. RIGHTARROW: 39,
  5151. DOWNARROW: 40,
  5152. A: 65,
  5153. B: 66,
  5154. C: 67,
  5155. D: 68,
  5156. E: 69,
  5157. F: 70,
  5158. G: 71,
  5159. H: 72,
  5160. I: 73,
  5161. J: 74,
  5162. K: 75,
  5163. L: 76,
  5164. M: 77,
  5165. N: 78,
  5166. O: 79,
  5167. P: 80,
  5168. Q: 81,
  5169. R: 82,
  5170. S: 83,
  5171. T: 84,
  5172. U: 85,
  5173. V: 86,
  5174. W: 87,
  5175. X: 88,
  5176. Y: 89,
  5177. Z: 90,
  5178. SPACE: 32,
  5179. RETURN: 13,
  5180. SEMICOLON: 186,
  5181. PLUSEQUALS: 187,
  5182. DASHUNDERSCORE: 189,
  5183. OPENBRACKET: 219
  5184. };
  5185. n.detectFirefox() && (r.SEMICOLON = 59,
  5186. r.PLUSEQUALS = 61,
  5187. r.DASHUNDERSCORE = 173),
  5188. t.exports = r
  5189. }
  5190. , {
  5191. "../util/browser": 182
  5192. }],
  5193. 31: [function(e, t, i) {
  5194. "use strict";
  5195. t.exports = {
  5196. EN_US: "en-US",
  5197. ES_MX: "es-MX",
  5198. FR_FR: "fr-FR",
  5199. DE_DE: "de-DE",
  5200. RU_RU: "ru-RU",
  5201. CN_CN: "cn-CN",
  5202. JP_JP: "jp-JP"
  5203. }
  5204. }
  5205. , {}],
  5206. 32: [function(e, t, i) {
  5207. "use strict";
  5208. t.exports = {
  5209. TagActivated: "tag.activated",
  5210. TagDismissed: "tag.dismissed",
  5211. TagNavigation: "tag.navigation"
  5212. }
  5213. }
  5214. , {}],
  5215. 33: [function(e, t, i) {
  5216. "use strict";
  5217. t.exports = {
  5218. ModelAdded: "model-added",
  5219. ActiveModelChanged: "active-model-changed"
  5220. }
  5221. }
  5222. , {}],
  5223. 34: [function(e, t, i) {
  5224. "use strict";
  5225. t.exports = {
  5226. LEFT: 0,
  5227. MIDDLE: 1,
  5228. RIGHT: 2
  5229. }
  5230. }
  5231. , {}],
  5232. 35: [function(e, t, i) {
  5233. "use strict";
  5234. t.exports = {
  5235. PanoRenderComplete: "panorama.render.complete",
  5236. TileRenderFailure: "panorama.tile.render.failed",
  5237. TileRenderSuccess: "panorama.tile.render.success",
  5238. TileUploadAttempted: "panorama.tile.upload.attempted",
  5239. UploadAttemptedForAllTiles: "panorama.upload.attempted.all.tiles",
  5240. ZoomLevelRenderStarted: "panorama.zoom.render.started"
  5241. }
  5242. }
  5243. , {}],
  5244. 36: [function(e, t, i) {
  5245. "use strict";
  5246. t.exports = {
  5247. BASE: 1,
  5248. STANDARD: 2,
  5249. HIGH: 3,
  5250. ULTRAHIGH: 4
  5251. }
  5252. }
  5253. , {}],
  5254. 37: [function(e, t, i) {
  5255. "use strict";
  5256. t.exports = {
  5257. LoadComplete: "panorama.load.complete",
  5258. LoadFailed: "panorama.load.failed",
  5259. TileLoaded: "panorama.tile.loaded"
  5260. }
  5261. }
  5262. , {}],
  5263. 38: [function(e, t, i) {
  5264. "use strict";
  5265. t.exports = Object.freeze({
  5266. Standard: 0,
  5267. Slow: 1,
  5268. Retain: 2
  5269. })
  5270. }
  5271. , {}],
  5272. 39: [function(e, t, i) {
  5273. "use strict";
  5274. t.exports = Object.freeze({
  5275. Show: 0,
  5276. Hide: 1,
  5277. Retain: 2
  5278. })
  5279. }
  5280. , {}],
  5281. 40: [function(e, t, i) {
  5282. "use strict";
  5283. t.exports = {
  5284. Move: "move",
  5285. MoveComplete: "move.complete",
  5286. ModeChanged: "mode.changed",
  5287. ModeChanging: "mode.changing",
  5288. PanoChosen: "pano.chosen",
  5289. ClosestPanoChanging: "closest.pano.changing",
  5290. WarpStarted: "warp.started",
  5291. WarpInterrupted: "warp.interrupted",
  5292. WarpEnded: "warp.ended",
  5293. FlyinFinished: "flyin.finished",
  5294. FlyingStarted: "flying.started",
  5295. FlyingInterrupted: "flying.interrupted",
  5296. FlyingEnded: "flying.ended",
  5297. Ready: "ready",
  5298. StartInside: "start.inside",
  5299. StartOutside: "start.outside",
  5300. ViewChanged: "view.changed",
  5301. WarpInterruptedWithFlyTo: "warp.interrupted.flyto",
  5302. InputStart: "input.start"
  5303. }
  5304. }
  5305. , {}],
  5306. 41: [function(e, t, i) {
  5307. "use strict";
  5308. t.exports = Object.freeze({
  5309. DEFAULT: 0,
  5310. PANOMARKERS: 1,
  5311. RETICULE: 2,
  5312. TAG: 3
  5313. })
  5314. }
  5315. , {}],
  5316. 42: [function(e, t, i) {
  5317. "use strict";
  5318. t.exports = {
  5319. visibleFloor: 1,
  5320. ghostFloor: 3,
  5321. boundingSkybox: 1,
  5322. panoMarker: 2,
  5323. reticule: 3,
  5324. tagStem: 4,
  5325. tagDisc: 5,
  5326. ribbon: 100
  5327. }
  5328. }
  5329. , {}],
  5330. 43: [function(e, t, i) {
  5331. "use strict";
  5332. t.exports = {
  5333. ContextCreated: "scene-renderer-context-created",
  5334. AfterRender: "after-render",
  5335. MemoryUsageUpdated: "scene-renderer-memory-usage-updated"
  5336. }
  5337. }
  5338. , {}],
  5339. 44: [function(e, t, i) {
  5340. "use strict";
  5341. t.exports = {
  5342. IDLE: "idle",
  5343. BROWSE: "browse",
  5344. EXAMINE: "examine"
  5345. }
  5346. }
  5347. , {}],
  5348. 45: [function(e, t, i) {
  5349. "use strict";
  5350. t.exports = {
  5351. TileDownloadSuccess: "tiledownloader.download.success",
  5352. TileDownloadFailure: "tiledownloader.download.failure",
  5353. PanoDownloadComplete: "tiledownloader.pano.download.complete"
  5354. }
  5355. }
  5356. , {}],
  5357. 46: [function(e, t, i) {
  5358. "use strict";
  5359. t.exports = {
  5360. CardboardAndroid: "googlevr",
  5361. GearVR: "gearvr",
  5362. CardboardIOS: "googlevrios",
  5363. Cardboard: "googlevr"
  5364. }
  5365. }
  5366. , {}],
  5367. 47: [function(e, t, i) {
  5368. "use strict";
  5369. t.exports = {
  5370. NONE: 0,
  5371. CONTEXTUAL: 1,
  5372. ANDROID: 2
  5373. }
  5374. }
  5375. , {}],
  5376. 48: [function(e, t, i) {
  5377. "use strict";
  5378. var n = {
  5379. Title: 0,
  5380. Cardboard: 1
  5381. }
  5382. , r = {
  5383. Title: 0,
  5384. Cardboard: 1,
  5385. Gear: 2
  5386. };
  5387. !function() {
  5388. [n, r].forEach(function(e) {
  5389. e.pageCount = Object.keys(e).length
  5390. })
  5391. }(),
  5392. t.exports.ios = n,
  5393. t.exports.standard = r
  5394. }
  5395. , {}],
  5396. 49: [function(e, t, i) {
  5397. "use strict";
  5398. t.exports = {
  5399. Android: "android",
  5400. IOS: "ios",
  5401. Desktop: "desktop",
  5402. UnsupportedAndroid: "android-unsupported"
  5403. }
  5404. }
  5405. , {}],
  5406. 50: [function(e, t, i) {
  5407. "use strict";
  5408. var n = e("three");
  5409. t.exports = {
  5410. UP: new n.Vector3(0,1,0),
  5411. DOWN: new n.Vector3(0,-1,0),
  5412. LEFT: new n.Vector3(-1,0,0),
  5413. RIGHT: new n.Vector3(1,0,0),
  5414. FORWARD: new n.Vector3(0,0,-1),
  5415. BACK: new n.Vector3(0,0,1)
  5416. }
  5417. }
  5418. , {
  5419. three: 217
  5420. }],
  5421. 51: [function(e, t, i) {
  5422. "use strict";
  5423. var n = e("../exception/ViewmodeConvertException")
  5424. , r = e("./coreViewmodes")
  5425. , o = e("../util/common")
  5426. , a = {
  5427. MESH: "mesh",
  5428. OUTDOOR: "outdoor",
  5429. TRANSITIONING: "transitioning",
  5430. toInt: function(e) {
  5431. switch (e) {
  5432. case this.PANORAMA:
  5433. return 1;
  5434. case this.DOLLHOUSE:
  5435. return 2;
  5436. case this.FLOORPLAN:
  5437. return 3;
  5438. case this.OUTDOOR:
  5439. return 4;
  5440. case this.TRANSITIONING:
  5441. return -1
  5442. }
  5443. throw new n("No known conversion for Viewmode to int for mode: " + e)
  5444. },
  5445. fromInt: function(e) {
  5446. switch (e) {
  5447. case "1":
  5448. case 1:
  5449. return this.PANORAMA;
  5450. case "2":
  5451. case 2:
  5452. return this.DOLLHOUSE;
  5453. case "3":
  5454. case 3:
  5455. return this.FLOORPLAN;
  5456. case "4":
  5457. case 4:
  5458. return this.OUTDOOR
  5459. }
  5460. throw new n("No known conversion for int to viewmode for int: " + e)
  5461. },
  5462. convertWorkshopModeInt: function(e) {
  5463. switch (e) {
  5464. case "0":
  5465. case 0:
  5466. case undefined: //xzw add
  5467. return this.PANORAMA;
  5468. case "1":
  5469. case 1:
  5470. return this.FLOORPLAN;
  5471. case "2":
  5472. case 2:
  5473. return this.DOLLHOUSE;
  5474. case "3":
  5475. case 3:
  5476. return this.MESH
  5477. }
  5478. throw new n("No known conversion for Workshop int to viewmode for int: " + e)
  5479. }
  5480. };
  5481. o.extendObject(a, r),
  5482. t.exports = a
  5483. }
  5484. , {
  5485. "../exception/ViewmodeConvertException": 58,
  5486. "../util/common": 185,
  5487. "./coreViewmodes": 54
  5488. }],
  5489. 52: [function(e, t, i) {
  5490. "use strict";
  5491. t.exports = {
  5492. BLACK: "black",
  5493. STD: "std",
  5494. WALK: "walk"
  5495. }
  5496. }
  5497. , {}],
  5498. 53: [function(e, t, i) {
  5499. "use strict";
  5500. t.exports = {
  5501. ZoomIn: "zoom.in",
  5502. ZoomOut: "zoom.out",
  5503. ZoomMax: "zoom.max",
  5504. ZoomMin: "zoom.min"
  5505. }
  5506. }
  5507. , {}],
  5508. 54: [function(e, t, i) {
  5509. "use strict";
  5510. t.exports = {
  5511. PANORAMA: "panorama",
  5512. DOLLHOUSE: "dollhouse",
  5513. FLOORPLAN: "floorplan"
  5514. }
  5515. }
  5516. , {}],
  5517. 55: [function(e, t, i) {
  5518. "use strict";
  5519. function n(e) {
  5520. this.message = e
  5521. }
  5522. t.exports = n
  5523. }
  5524. , {}],
  5525. 56: [function(e, t, i) {
  5526. "use strict";
  5527. function n(e) {
  5528. r.call(this, e)
  5529. }
  5530. var r = e("./BasicException");
  5531. n.prototype = Object.create(r.prototype),
  5532. t.exports = n
  5533. }
  5534. , {
  5535. "./BasicException": 55
  5536. }],
  5537. 57: [function(e, t, i) {
  5538. "use strict";
  5539. function n(e) {
  5540. r.call(this, e)
  5541. }
  5542. var r = e("./BasicException");
  5543. n.prototype = Object.create(r.prototype),
  5544. t.exports = n
  5545. }
  5546. , {
  5547. "./BasicException": 55
  5548. }],
  5549. 58: [function(e, t, i) {
  5550. "use strict";
  5551. function n(e) {
  5552. r.call(this, e)
  5553. }
  5554. var r = e("./BasicException");
  5555. n.prototype = Object.create(r.prototype),
  5556. t.exports = n
  5557. }
  5558. , {
  5559. "./BasicException": 55
  5560. }],
  5561. 59: [function(e, t, i) {
  5562. (function(i) {
  5563. "use strict";
  5564. function n(e) {
  5565. var t = {};
  5566. if (e) {
  5567. var i = e.flags;
  5568. if (i)
  5569. for (var n in i)
  5570. i.hasOwnProperty(n) && (t[i[n]] = !0);
  5571. return t
  5572. }
  5573. return l.debug("Feature flags -> parseFeatureFlags: rawData is null."),
  5574. null
  5575. }
  5576. var r = e("./util/ajax")
  5577. , o = e("./util/showcase")
  5578. , a = e("./util/logger")
  5579. , s = ""
  5580. , l = new a(i)
  5581. , c = {};
  5582. t.exports = {
  5583. loadFeatureFlags: function(e) {
  5584. var t = $.Deferred();
  5585. return r.get(e.urlBase + s, {
  5586. responseType: "json",
  5587. prefetchFrom: "user",
  5588. auth: o.getAuthorizationHeader()
  5589. }).done(function(e) {
  5590. c = n(e),
  5591. c ? t.resolve(c) : t.reject("loading-failed")
  5592. }).fail(function() {
  5593. l.debug("Retrieval of feature flags failed."),
  5594. t.reject("loading-failed")
  5595. }),
  5596. t.promise()
  5597. },
  5598. getFlags: function() {
  5599. return c
  5600. },
  5601. updateDependentSettings: function(e, t) {
  5602. e = e || c,
  5603. e.labels && (t.labels.enabled = !0),
  5604. e.zooming && !t.zoom.forceOff && (t.zoom.enabled = !0),
  5605. e.showcase_sdk && (t.sdkInit = !0),
  5606. e.mobile_highq_override && (t.tiling.mobileHighQualityOverride = !0),
  5607. e.showcase_webvr && (t.vr.allowWebVR = !0),
  5608. e.uhql && (t.tiling.allowUltraHighResolution = !0),
  5609. e.hide_sc_sharing && (t.share.enabled = !1)
  5610. }
  5611. }
  5612. }
  5613. ).call(this, "/js/featureflags.js")
  5614. }
  5615. , {
  5616. "./util/ajax": 181,
  5617. "./util/logger": 189,
  5618. "./util/showcase": 193
  5619. }],
  5620. 60: [function(e, t, i) {
  5621. "use strict";
  5622. var n = (e("../util/common"),
  5623. {
  5624. status: 0,
  5625. set: function(e) {
  5626. if (isNaN(e))
  5627. return !1;
  5628. var t = $('.progressbar');
  5629. 0 > e && (e = 0);
  5630. e > 100 && (e = 100);
  5631. var width = parseInt(t.css('width').replace("px",""))/100; //获取进度条总长度除以100
  5632. var barperc = e*width;
  5633. var perc = Math.round(e);
  5634. var labelpos = (parseInt(barperc)-15);
  5635. t.find('.bar').css('width',barperc); //已经再跑颜色的百分比
  5636. t.find('.label').css('left', labelpos); //上面跟着的字的百分比
  5637. t.find('.perc').text(perc+'%'); //具体数字的百分比
  5638. this.status = e
  5639. },
  5640. done: function(e) {
  5641. return e || this.status ? (this.status = null,
  5642. this.set(100)) : this
  5643. }
  5644. });
  5645. t.exports.circleLoader = n
  5646. }
  5647. , {
  5648. "../util/common": 185
  5649. }],
  5650. 61: [function(e, t, i) {
  5651. "use strict";
  5652. t.exports = Object.freeze({
  5653. CLOSE: "modal.closer.close"
  5654. })
  5655. }
  5656. , {}],
  5657. 62: [function(e, t, i) {
  5658. "use strict";
  5659. function n(e, t) {
  5660. t && (t.stopPropagation(),
  5661. t.preventDefault()),
  5662. e && this.emit(l.CLOSE, e),
  5663. g.reset()
  5664. }
  5665. function r(e, t) {
  5666. function i() {
  5667. var t = e.offsetHeight >= $("#player").height() && e.offsetWidth >= $("#player").width();
  5668. t !== f && (f = t,
  5669. t ? (e.classList.add("closeByFooter"),
  5670. h.classList.add("closeByFooter")) : (e.classList.remove("closeByFooter"),
  5671. h.classList.remove("closeByFooter")))
  5672. }
  5673. t ? setTimeout(i, o.guiAnimationSpeed) : i()
  5674. }
  5675. var o = e("../../settings")
  5676. , a = (e("../../tag/Media/MediaEvent"),
  5677. e("../../util/browser"))
  5678. , s = e("../../util/common")
  5679. , l = e("./ModalCloserEvent")
  5680. , c = e("events").EventEmitter
  5681. , h = document.getElementsByClassName("footer")[0]
  5682. , u = h.querySelectorAll(".close")[0]
  5683. , d = null
  5684. , p = null
  5685. , f = null
  5686. , g = (a.isMobile(),
  5687. {
  5688. open: function(e) {
  5689. e && (r(e),
  5690. d && u.removeEventListener("click", d, !0),
  5691. d = n.bind(this, e.id),
  5692. u.addEventListener("click", d, !0),
  5693. p && window.removeEventListener("resize", p, !0),
  5694. p = r.bind(this, e),
  5695. window.addEventListener("resize", p, !0))
  5696. },
  5697. reset: function() {
  5698. h.classList.remove("closeByFooter"),
  5699. u.removeEventListener("click", d, !0),
  5700. window.removeEventListener("resize", p, !0),
  5701. d = p = f = null
  5702. }
  5703. });
  5704. s.extendObject(g, c.prototype),
  5705. t.exports = g
  5706. }
  5707. , {
  5708. "../../tag/Media/MediaEvent": 131,
  5709. "../../settings": 166,
  5710. "../../util/browser": 182,
  5711. "../../util/common": 185,
  5712. "./ModalCloserEvent": 61,
  5713. events: 202
  5714. }],
  5715. 63: [function(e, t, i) {
  5716. "use strict";
  5717. function n(e, t, i) {
  5718. var n = new r.GUI({
  5719. width: 400
  5720. })
  5721. , u = n.addFolder("Flydown from Dollhouse");
  5722. u.add(h.flydown, "movementEasing", Object.keys(a)),
  5723. u.add(h.flydown, "movementDelay", 0, 1).step(.01),
  5724. u.add(h.flydown, "rotationEasing", Object.keys(a)),
  5725. u.add(h.flydown, "rotationDelay", 0, 1).step(.01),
  5726. u.add(h.flydown, "modelTextureDelay", 0, 1).step(.01),
  5727. u.add(h.flydown, "skyboxDelay", 0, 1).step(.01),
  5728. u.add(h.dollhouseDefault, "minPolarAngle", 0, o.Math.degToRad(50)),
  5729. u.add(h.dollhouseDefault, "maxPolarAngle", o.Math.degToRad(50), o.Math.degToRad(170));
  5730. var d = n.addFolder("Transition between panos");
  5731. d.add(h.transition, "blur", 0, 10).onFinishChange(function() {}),
  5732. d.add(h.transition, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5733. h.transition.flyTime = 0,
  5734. d.__controllers.forEach(function(e) {
  5735. e.updateDisplay()
  5736. })
  5737. }),
  5738. d.add(h.transition, "flyTime", 0, 5e3).onFinishChange(function() {
  5739. h.transition.flySpeed = 0,
  5740. d.__controllers.forEach(function(e) {
  5741. e.updateDisplay()
  5742. })
  5743. }),
  5744. d.add(h.transition, "aimTime", 500, 2500).step(50),
  5745. d.add(h.transition, "aimSlowFactor", 1, 3).step(.1),
  5746. d.add(h.transition, "movementEasing", Object.keys(a));
  5747. var p = n.addFolder("Path Display");
  5748. p.add(h.path, "opacity", 0, 1).step(.01).onFinishChange(function() {}),
  5749. p.add(h.path, "height", 0, .2).step(.01).onFinishChange(function() {}),
  5750. p.add(h.path, "outsideHeight", 0, 2).step(.01).onFinishChange(function() {}),
  5751. p.add(h.path, "ribbonWidth", .01, .35).step(.01).onFinishChange(function() {}),
  5752. p.add(h.path, "waypointRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5753. p.add(h.path, "waypointPulse", 0, 3600).step(20).onFinishChange(function() {}),
  5754. p.add(h.path, "waypointIndoorRadius", .01, 1.2).step(.01).onFinishChange(function() {}),
  5755. p.add(h.path, "fadeInTime", 0, 1200).step(10).onFinishChange(function() {}),
  5756. p.add(h.path, "fadeOutTime", 0, 1200).step(10).onFinishChange(function() {}),
  5757. p.add(h.path, "color", Object.keys(l)).onFinishChange(function() {
  5758. h.path.color = l[h.path.color],
  5759. h.path.colorUp = l._desat(h.path.color),
  5760. h.path.colorDown = l.darken(h.path.color)
  5761. }),
  5762. p.add(h, "reticuleColor", Object.keys(l)).onFinishChange(function() {
  5763. h.reticuleColor = l[h.reticuleColor]
  5764. });
  5765. var f = n.addFolder("Warping")
  5766. , g = f.addFolder("Warp/Teleport");
  5767. g.add(h.warp, "softPushDist", 0, 2).onFinishChange(function() {}),
  5768. g.add(h.warp, "softPushEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5769. g.add(h.warp, "softBendAngle", 0, 45).onFinishChange(function() {}),
  5770. g.add(h.warp, "softBendTilt", 0, 45).onFinishChange(function() {}),
  5771. g.add(h.warp, "softBendEnd", 0, 1).step(.01).onFinishChange(function() {}),
  5772. g.add(h.warp, "burnsAngle", 0, 30).onFinishChange(function() {}),
  5773. g.add(h.warp, "minBurnsAngle", 0, 10).onFinishChange(function() {}),
  5774. g.add(h.warp, "brakeStrength", 1, 8).onFinishChange(function() {}),
  5775. g.add(h.warp, "minBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5776. g.add(h.warp, "maxBrakeAngle", 0, 5).step(.01).onFinishChange(function() {}),
  5777. g.add(h.path, "mapGuides").onFinishChange(function() {}),
  5778. g.add(h.warp, "teleportTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5779. g.add(h.warp, "outsideTime", 0, 5e3).step(10).onFinishChange(function() {}),
  5780. g.add(h.path, "typ", Object.keys(c)).onFinishChange(function() {
  5781. h.path.typ = c[h.path.typ]
  5782. }),
  5783. g.add(h.warp, "loop").onChange(function() {}).onFinishChange(function() {
  5784. t.endlessLoop = h.warp.loop
  5785. }),
  5786. g.add(h.warp, "walkSlideShowThreshhold", 1, 1e4).step(1).onFinishChange(function() {}),
  5787. g.add(h.warp, "walkExtraPanosDistance", 0, 3).step(.1).onFinishChange(function() {}),
  5788. g.add(h.transition, "fastForwardFactor", 1, 10).step(1).onFinishChange(function() {});
  5789. var m = f.addFolder("Long Warp Only");
  5790. m.add(h.warp, "minWarpTime", 0, 5e3).step(10).onFinishChange(function() {
  5791. h.warp.flySpeed = 0,
  5792. m.__controllers.forEach(function(e) {
  5793. e.updateDisplay()
  5794. })
  5795. }),
  5796. m.add(h.warp, "timePerMeter", 0, 5e3).step(10).onFinishChange(function() {}),
  5797. m.add(h.warp, "lookAheadMax", .01, 1).step(.01).onFinishChange(function() {}),
  5798. m.add(h.warp, "lookAheadDist", .01, 4).step(.01).onFinishChange(function() {}),
  5799. m.add(h.warp, "maxTurnPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5800. m.add(h.warp, "maxAimPerSec", 0, 720).step(1).onFinishChange(function() {}),
  5801. m.add(h.warp, "turnFriction", 0, 1).step(.01).onFinishChange(function() {}),
  5802. m.add(h.warp, "walkDelay", 0, 2e3).step(10).onFinishChange(function() {}),
  5803. m.add(h.transition, "flytimeMaxDistanceThreshold", 0, 25).step(10).onFinishChange(function() {}),
  5804. m.add(h.warp, "walkMaxDist", 0, 100).step(1).onFinishChange(function() {});
  5805. var v = n.addFolder("Warp Esoterica");
  5806. v.add(h.warp, "nearPanoDist", .01, 12).step(0).onFinishChange(function() {}),
  5807. v.add(h.warp, "blur", .01, 1).onFinishChange(function() {}),
  5808. v.add(h.warp, "flySpeed", 0, 10).step(.01).onFinishChange(function() {
  5809. h.warp.minWarpTime = 0,
  5810. v.__controllers.forEach(function(e) {
  5811. e.updateDisplay()
  5812. })
  5813. }),
  5814. v.add(h.warp, "showBunny").onFinishChange(function() {}),
  5815. v.add(h.warp, "fastTime", 0, 2500).step(10).onFinishChange(function() {}),
  5816. v.add(h.warp, "movementEasing", Object.keys(a));
  5817. var A = n.addFolder("Misc");
  5818. A.add(h, "dollhouseFOV", 10, 180).onChange(function() {
  5819. i.cameras[s.DOLLHOUSE].fov = h.dollhouseFOV
  5820. }),
  5821. A.add(h, "insideFOV", 10, 180).onChange(function() {
  5822. i.cameras[s.PANORAMA].fov = h.insideFOV
  5823. }),
  5824. A.add(h, "insideLookSpeed", .01, .3).step(.01).onChange(function() {}),
  5825. A.add(h, "rotationAccelerationInside", .1, 10).step(.1).onChange(function() {}),
  5826. A.add(h, "rotationAccelerationOutside", .1, 10).step(.1).onChange(function() {});
  5827. var y = n.addFolder("Navigation");
  5828. y.add(h.navigation, "panoScores").onFinishChange(function() {
  5829. h.navigation.panoScores || e.panos.forEach(function(e) {
  5830. e.floor.remove(e.text3d),
  5831. e.text3d = null
  5832. })
  5833. }),
  5834. y.add(h.navigation, "mouseDirection"),
  5835. y.add(h.navigation, "filterStrictness", 0, 1),
  5836. y.add(h.navigation, "angleFactor", -60, 0),
  5837. y.add(h.navigation, "directionFactor", 1, 20),
  5838. y.add(h.navigation, "distanceFactor", -5, 5),
  5839. y.add(h.navigation, "optionalityFactor", .1, 10);
  5840. var C = n.addFolder("tags")
  5841. , I = C.addFolder("Tag Creation");
  5842. I.add(h.tags.pole, "enabled").name("poleEnabled"),
  5843. I.add(h.tags.pole, "height", 0, 2.5).step(.01).name("poleHeight"),
  5844. I.add(h.tags.pole, "width", 1, 10).step(1).name("poleWidth"),
  5845. I.add(h.tags.pole, "opacity", .1, 1).step(.1).name("poleOpacity");
  5846. var E = C.addFolder("Visibility");
  5847. E.add(h.tags.visibility, "anyDistance"),
  5848. E.add(h.tags.visibility, "visibleDistance", .1, 30).step(.1),
  5849. E.add(h.tags.visibility, "cameraClearance", 0, 1).step(.01),
  5850. E.add(h.tags.visibility, "hideViaFloor"),
  5851. E.add(h.tags.visibility, "hideOffScreenDisc").name("hideEdgeDisc"),
  5852. E.add(h.tags.visibility, "hideOffScreenObject").name("hideEdgeObject");
  5853. var b = C.addFolder("Disc Parameters");
  5854. b.add(h.tags.disc.scale, "nearBound", .1, 10).step(.1),
  5855. b.add(h.tags.disc.scale, "farBound", .1, 20).step(.1).listen(),
  5856. b.add(h.tags.disc.scale, "linkFarBound").onChange(function(e) {
  5857. e && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - h.tags.disc.scale.linkPercent / 100))
  5858. }),
  5859. b.add(h.tags.disc.scale, "linkPercent", 0, 100).step(1).onChange(function(e) {
  5860. h.tags.disc.scale.linkFarBound && (h.tags.disc.scale.farBound = h.tags.visibility.visibleDistance * (1 - e / 100))
  5861. }),
  5862. b.add(h.tags.disc.scale, "maxSize", 40, 200).step(1),
  5863. b.add(h.tags.disc.scale, "minSize", 20, 100).step(1),
  5864. b.add(h.tags.disc.scale, "responsiveness", 0, 100).step(1);
  5865. var w = C.addFolder("Navigate");
  5866. w.add(h.tags.navigate, "nearestPano").name("nearestPano"),
  5867. w.add(h.tags.navigate, "lineOfSight").name("lineOfSight"),
  5868. w.add(h.tags.navigate, "reactivate").name("reactivate"),
  5869. w.add(h.tags.navigate, "aimAt", ["disc", "object", "pole", "nothing"]).name("aim at"),
  5870. w.add(h.tags.navigate, "tiltTolerance", 0, 50).step(1),
  5871. w.add(h.tags.navigate, "rotateSpeedFactor", 0, 5).step(.1);
  5872. var _ = n.addFolder("Debug");
  5873. _.add(h, "wireframe").onFinishChange(function() {
  5874. e.chunks.forEach(function(t) {
  5875. t.material && (t.wireframeTwin || (t.wireframeTwin = new o.WireframeHelper(t),
  5876. t.wireframeTwin.material.depthWrite = !1,
  5877. t.wireframeTwin.material.depthTest = !1,
  5878. t.wireframeTwin.material.opacity = .5,
  5879. t.wireframeTwin.material.transparent = !0),
  5880. h.wireframe ? e.add(t.wireframeTwin) : e.remove(t.wireframeTwin))
  5881. })
  5882. }),
  5883. _.add(h, "skyboxWireframe").onFinishChange(function() {
  5884. h.skyboxWireframe ? (e.skybox.wireframe = new o.WireframeHelper(e.skybox),
  5885. e.add(e.skybox.wireframe)) : (e.remove(e.skybox.wireframe),
  5886. e.skybox.wireframe = null)
  5887. }),
  5888. _.add(h, "showSweeps").onFinishChange(function() {
  5889. e.setSweepVisibility(h.showSweeps)
  5890. }),
  5891. _.add(h, "showMesh").onFinishChange(function() {
  5892. e.chunks.forEach(function(e) {
  5893. e.visible = h.showMesh
  5894. })
  5895. }),
  5896. _.add(h, "showFloors").onFinishChange(function() {
  5897. e.floors.forEach(function(e) {
  5898. e.collider.children.forEach(function(e) {
  5899. e.material.visible = h.showFloors
  5900. })
  5901. })
  5902. }),
  5903. _.add(h, "showSkyboxes").onFinishChange(function() {
  5904. e.panos.forEach(function(e) {
  5905. e.skyboxMesh.visible = h.showSkyboxes
  5906. })
  5907. }),
  5908. _.add(h, "showNeighbors").onChange(function() {}),
  5909. _.add(e, "alpha", 0, 1)
  5910. }
  5911. var r = e("../lib/dat.gui")
  5912. , o = e("three")
  5913. , a = e("../util/easing")
  5914. , s = e("../enum/Viewmode")
  5915. , l = e("../enum/Colors")
  5916. , c = e("../enum/WarpStyle")
  5917. , h = e("../settings");
  5918. e("../tag/tag");
  5919. r.GUI.prototype.removeFolder = function(e) {
  5920. var t = this.__folders[e];
  5921. t && (t.close(),
  5922. this.__ul.removeChild(t.domElement.parentNode),
  5923. delete this.__folders[e],
  5924. this.onResize())
  5925. }
  5926. ,
  5927. t.exports.toggle = n
  5928. }
  5929. , {
  5930. "../enum/Colors": 19,
  5931. "../enum/Viewmode": 51,
  5932. "../enum/WarpStyle": 52,
  5933. "../lib/dat.gui": 93,
  5934. "../tag/tag": 123,
  5935. "../settings": 166,
  5936. "../util/easing": 186,
  5937. three: 217
  5938. }],
  5939. 64: [function(e, t, i) {
  5940. (function(i) {
  5941. "use strict";
  5942. function n(e, t, i, n) {
  5943. $(".gui-error .error-problem-text").text(e),
  5944. $(".gui-error .error-solution-text").text(t),
  5945. $(".gui-error .error-explanation").text(i),
  5946. $(".gui-error .error-actions").html(n),
  5947. $(window).resize(),
  5948. $(".gui-error").fadeIn(),
  5949. $("#bottom-logo").fadeIn()
  5950. }
  5951. function r(e) {
  5952. var t = ['<div class="browser-tiles">', '<div class="tile">', '<a href="https://www.google.com/chrome/browser/" target="_blank">', '<img class="icon" src="images/icon_Google_Chrome_2011.png" ', 'rel="tiletip" title="Chrome"></a>', "</div>", '<div class="tile">', '<a href="https://www.mozilla.org/en-US/firefox/new/" target="_blank">', '<img class="icon" src="images/icon_Mozilla_Firefox.png" ', 'rel="tiletip" title="Firefox"></a>', "</div>", '<div class="tile">', '<a href="http://windows.microsoft.com/en-us/internet-explorer/download-ie" target="_blank">', '<img class="icon" src="images/icon_Internet_Explorer_10.png" ', 'rel="tiletip" title="Internet Explorer"></a>', "</div>", '<div class="tile">', '<a href="https://support.apple.com/en-us/HT204416" target="_blank">', '<img class="icon" src="images/icon_MacOSX_Safari.png" ', 'rel="tiletip" title="Safari"></a>', "</div>", "</div>"].join("");
  5953. n(e, h.ERROR_BROWSER_SOLUTION, h.ERROR_BROWSER_EXPLANATION, t),
  5954. s.isMobile() || $("[rel=tiletip]").tooltip({
  5955. placement: "bottom",
  5956. delay: {
  5957. show: 50,
  5958. hide: 0
  5959. },
  5960. trigger: "hover",
  5961. viewport: {
  5962. selector: "body",
  5963. padding: 10
  5964. }
  5965. })
  5966. }
  5967. function o() {
  5968. var e = s.isMobile() ? "" : '<span class="link install-browser">' + h.ERROR_GENERIC_ACTIONS_2 + "</span>" + h.ERROR_GENERIC_ACTIONS_3
  5969. , t = [h.ERROR_GENERIC_ACTIONS_1, e,].join("");
  5970. n(h.ERROR_GENERIC_PROBLEM, h.ERROR_GENERIC_SOLUTION, "", t),
  5971. s.isMobile() || $(".install-browser").on("click touchstart", function(e) {
  5972. e.preventDefault(),
  5973. e.stopPropagation(),
  5974. r(" ")
  5975. })
  5976. }
  5977. function a(e) {
  5978. if ($("head title").text(c.pageTitle),
  5979. $("#gui-message, #gui-loading, #nprogress, #gui-thumb, #bottom-logo").hide(),
  5980. $("#gui-loading").fadeOut(250),
  5981. $("#quick-blackout").hide(),
  5982. l.track("showcase_error", {
  5983. error_key: e
  5984. }),
  5985. h.locale || h.init(),
  5986. "webgl-unsupported" === e)
  5987. s.isMobile() ? o() : r(h.ERROR_WEBGL_UNSUPPORTED_PROBLEM);
  5988. else if ("webgl-ios" === e)
  5989. 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>.");
  5990. else if ("webgl-safari" === e)
  5991. n(h.ERROR_WEBGL_SAFARI_PROBLEM, "", "", h.ERROR_WEBGL_SAFARI_ACTIONS_1 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_2 + "</strong>. " + h.ERROR_WEBGL_SAFARI_ACTIONS_3 + "<strong>" + h.ERROR_WEBGL_SAFARI_ACTIONS_4 + "</strong>.");
  5992. else if ("webgl-generic" === e)
  5993. o();
  5994. else if ("missing-urls" === e)
  5995. n(h.ERROR_MISSING_URLS_PROBLEM, "", h.ERROR_MISSING_URLS_EXPLANATION);
  5996. else if ("loading-failed" === e)
  5997. 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>.");
  5998. else {
  5999. if ("loading-failed-maintenance" !== e)
  6000. return void d.error("Unhandled error: " + e);
  6001. n(h.ERROR_MAINTENANCE_PROBLEM, h.ERROR_MAINTENANCE_SOLUTION)
  6002. }
  6003. }
  6004. var s = e("./../util/browser")
  6005. , l = e("./../analytics")
  6006. , c = e("./../settings")
  6007. , h = e("../localization/localize")
  6008. , u = e("./../util/logger")
  6009. , d = new u(i)
  6010. , p = '"https://support.port.com/hc/articles/208220058"';
  6011. t.exports.error = a
  6012. }
  6013. ).call(this, "/js/gui/error.js")
  6014. }
  6015. , {
  6016. "../localization/localize": 108,
  6017. "./../analytics": 4,
  6018. "./../settings": 166,
  6019. "./../util/browser": 182,
  6020. "./../util/logger": 189
  6021. }],
  6022. 65: [function(e, t, i) {
  6023. (function(i) {
  6024. "use strict";
  6025. function n() {
  6026. Ue = [],
  6027. je.floors.visible && Ue.push(".gui-floor", ".gui-floor-title"),
  6028. Ue.push(".hideTarget", ".pinTop.right")
  6029. }
  6030. function r() {
  6031. for (var e in je)
  6032. if (je.hasOwnProperty(e)) {
  6033. var t = je[e];
  6034. if (!t.visible)
  6035. for (var i = 0; i < t.elements.length; i++)
  6036. $(t.elements[i]).hide()
  6037. }
  6038. je.highlight.visible && $(".pinBottom").addClass("highlightExists"),
  6039. je.tourControls.visible === !1 && $("#drawer").addClass("fullWidth"),
  6040. n()
  6041. }
  6042. function o(e, t) {
  6043. var i = !K.isMobile() && Q.zoom.enabled && t.mode === _e.PANORAMA && !e.tourIsPlaying;
  6044. $("#gui-zoomin").toggle(i),
  6045. $("#gui-zoomout").toggle(i)
  6046. }
  6047. function a() {
  6048. c(),
  6049. $(".pinBottom").toggleClass("open"),
  6050. $("#drawer").toggleClass("open"),
  6051. $(".footer").toggleClass("open"),
  6052. $("#drawer").hasClass("open") ? ($("#pullTab .icon").attr("data-original-title", Re.CLOSE_HIGHLIGHTS),
  6053. Ze("highlights")) : ($("#pullTab .icon").attr("data-original-title", Re.OPEN_HIGHLIGHTS),
  6054. ie.resetDrawer()),
  6055. setTimeout(function() {
  6056. $("#pullTab").toggleClass("opened");
  6057. }, $("#drawer").hasClass("open") ? 0 : Q.highlightAnimationDuration),
  6058. $(".pinBottom").hasClass("open") && s($(".vr-popup")) && $(".vr-popup").is(":visible") && Ae.dismiss()
  6059. }
  6060. function s(e) {
  6061. var t;
  6062. "none" !== e.css("display") ? t = e.position().top + e.outerHeight() : (e.attr("style", "visibility: hidden"),
  6063. t = e.position().top + e.outerHeight(),
  6064. e.attr("style", "display: none"));
  6065. var i = $("#player").outerHeight()
  6066. , n = i - 130;
  6067. return n < t + 25
  6068. }
  6069. function l(e) {
  6070. "touchstart" === e.type && e.preventDefault(),
  6071. e.stopPropagation()
  6072. }
  6073. function c() {
  6074. W && (W.reload(),
  6075. W.init())
  6076. }
  6077. function h(e) {
  6078. ne.show(e),
  6079. r()
  6080. }
  6081. function u(e) {
  6082. ne.progress(e)
  6083. }
  6084. function d(e, t, i) {
  6085. var n = t.player;
  6086. $("#gui-thumb").fadeOut(2500),
  6087. ne.hide(function() {
  6088. Ge = !1
  6089. }),
  6090. me.init(e, i),
  6091. de.finishSetup(Object.keys(e.tags).length),
  6092. i.on(Te.IMAGE_OPENED, Ze.bind(this, "tag"));
  6093. var s = function() {
  6094. i.dismissExaminedTag(),
  6095. i.disableHovering()
  6096. };
  6097. Ae.on(ye.OPENED, s),
  6098. Ce.on(Me.OPENED, s),
  6099. he.on(ue.OPENED, s),
  6100. fe.on(ge.OPENED, s);
  6101. var l = i.enableHovering.bind(i);
  6102. if (Ae.on(ye.CLOSED, l),
  6103. Ce.on(Me.CLOSED, l),
  6104. he.on(ue.CLOSED, l),
  6105. fe.on(ge.CLOSED, l),
  6106. Q.labels.enabled && Object.keys(e.labels).length,
  6107. e.floors.length <= 1 || !je.floors.visible ? je.floors.visible = !1 : (y(e, t),
  6108. C(e.currentFloor, n.mode)),
  6109. r(),
  6110. o(t, t.player),
  6111. $("#gui").fadeIn(1500),
  6112. je.highlight.visible && (2 !== Q.startHighlights || e.has360Views) && setTimeout(function() {
  6113. a(),
  6114. (!e.has360Views && 1 !== Q.startHighlights || e.has360Views && 0 === Q.startHighlights) && setTimeout(a, 2e3)
  6115. }, 2e3),
  6116. !K.isMobile())
  6117. for (var c = ["a", "#title-toggle", ".next-button", ".prev-button", ".gui-floor", ".meta-toggle", ".thumbImg", "logo-button"], h = 0; h < c.length; h++)
  6118. $(c[h]).addClass("hasHover");
  6119. O(e),
  6120. de.setupToggling();
  6121. //czj
  6122. navBorderRadius();
  6123. }
  6124. function navBorderRadius(){
  6125. var pullTab = $("#pullTab"),
  6126. mobileRadius = {
  6127. "bottom":{"border-bottom-left-radius":"10px","border-bottom-right-radius":"10px"},
  6128. "top":{"border-top-left-radius":"10px","border-top-right-radius":"10px"}
  6129. },
  6130. topRadius = {
  6131. "bottom":{"border-top-right-radius":"10px","border-bottom-right-radius":"10px"},
  6132. "top":{"border-bottom-left-radius":"10px","border-top-left-radius":"10px"}
  6133. }
  6134. function BorderRadius(bottom,top){
  6135. $("#gui-modes-map > div:visible:last").css(bottom);
  6136. if(pullTab.is(':visible')){
  6137. $(".viewContainer > div:visible:first").css(top);
  6138. }else{
  6139. $("#gui-modes-map > div:visible:first").css(top);
  6140. }
  6141. }
  6142. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  6143. BorderRadius(mobileRadius.bottom,mobileRadius.top);
  6144. }else{
  6145. BorderRadius(topRadius.bottom,topRadius.top);
  6146. }
  6147. }
  6148. function p(e) {
  6149. e || (e = 0),
  6150. We = !1,
  6151. window.setTimeout(function() {
  6152. We || (ze = !0,
  6153. $("#gui-spinner").stop(!0, !0).show())
  6154. }
  6155. .bind(this), e)
  6156. }
  6157. function f() {
  6158. $("#gui-spinner").stop(!0, !0),
  6159. $("#gui-spinner").fadeOut(1e3),
  6160. We = !0,
  6161. ze = !1
  6162. }
  6163. function g(e, t) {
  6164. var i = e.mode
  6165. , n = t || e.currentPano;
  6166. $("#gui-modes-dollhouse").toggleClass("active", i === _e.DOLLHOUSE),
  6167. $("#gui-modes-floorplan").toggleClass("active", i === _e.FLOORPLAN),
  6168. $("#gui-modes-inside").toggleClass("active", i === _e.PANORAMA),
  6169. i === _e.PANORAMA ? ($("#view-controllers").slideUp(500),
  6170. Q.show360Views.enabled && !n.isAligned() ? (
  6171. $(".gui-floor").addClass("hidden"),
  6172. $("#gui-modes-outside").addClass("desktop-only")) : (
  6173. $(".gui-floor").removeClass("hidden"),
  6174. $("#gui-modes-outside").removeClass("desktop-only")),
  6175. $("#gui-modes-outside").removeClass("hidden")) : i !== _e.TRANSITIONING && (f(),
  6176. Be = i,
  6177. $("#gui-modes-outside").addClass("hidden"),
  6178. e.model.has360Views && $(".gui-floor").removeClass("hidden"),
  6179. $("#view-controllers").is(":visible") || $("#view-controllers").slideDown(Q.guiAnimationSpeed))
  6180. }
  6181. function m(e, t) {
  6182. var i = t.player;
  6183. $("#gui-modes-inside").on("mousedown touchstart", function(e) {
  6184. l(e),
  6185. J.updateInteraction(Se.InteractionGui, "inside-button"),
  6186. J.track("USER", {
  6187. event_type: "showcase_gui",
  6188. gui_action: "click_inside_mode_button"
  6189. }),
  6190. t.changeMode(_e.PANORAMA);
  6191. }),
  6192. $("#gui-modes-outside").find("a").on("click", function(e) {
  6193. l(e),
  6194. J.track("showcase_gui", {
  6195. gui_action: "click_outside_mode_button"
  6196. }),
  6197. t.changeMode(Be)
  6198. }),
  6199. $("#gui-modes-floorplan").on("click", function(e) {
  6200. l(e),
  6201. i.mode !== _e.FLOORPLAN && (J.track("showcase_gui", {
  6202. gui_action: "click_floorplan_mode_button"
  6203. }),
  6204. t.changeMode(_e.FLOORPLAN));
  6205. }),
  6206. $("#gui-modes-dollhouse").on("click", function(e) {
  6207. l(e),
  6208. i.mode !== _e.DOLLHOUSE && (J.track("showcase_gui", {
  6209. gui_action: "click_dollhouse_mode_button"
  6210. }),
  6211. t.changeMode(_e.DOLLHOUSE));
  6212. })
  6213. }
  6214. function v(e, t) {
  6215. function i() {
  6216. document.getElementById("vr").classList.remove("hidden"),
  6217. Q.vr.allowWebVR ? K.getVRDisplay().then(function(e) {
  6218. K.supportsFullscreen() ? n(e) : (De.warn("Unable to use WebVR when full screen is not supported"),
  6219. $(".improper-embed").toggleClass("hidden", !1),
  6220. r())
  6221. }, function(e) {
  6222. r()
  6223. }) : r()
  6224. }
  6225. function n(i) {
  6226. De.info(i.displayName + " detected, VR button activates WebVR experience"),
  6227. Ie.init(e.data, t, i, q),
  6228. Ie.on(Ee.OPENED, Ze.bind(gui, "vr")),
  6229. Ie.on(Ee.SHOW_TERMS, fe.show.bind(fe))
  6230. }
  6231. function r() {
  6232. De.info("WebVR support not found, VR button activates native app VR modal"),
  6233. Ae.init(e.data, q),
  6234. Ae.on(ye.OPENED, function() {
  6235. var e = document.getElementById("vr-modal");
  6236. return function() {
  6237. Ze("vr"),
  6238. le.open(e)
  6239. }
  6240. }()),
  6241. Ae.on(ye.CLOSED, le.reset)
  6242. }
  6243. if (Q.vr.enabled && e.supportsVR && !K.valueFromHash("mls", 0))
  6244. switch (Q.vr.option) {
  6245. case Pe.CONTEXTUAL:
  6246. i();
  6247. break;
  6248. case Pe.ANDROID:
  6249. K.detectAndroid() && i();
  6250. break;
  6251. case Pe.NONE:
  6252. }
  6253. }
  6254. function A(e, t) {
  6255. $("#play").find("a").on("mousedown touchstart", function(e) {
  6256. l(e);
  6257. Ze("tour");
  6258. ve.play();
  6259. J.trackAlways("showcase_gui", {
  6260. gui_action: "play_highlights"
  6261. })
  6262. }),
  6263. $("#pause").find("a").on("mousedown touchstart", function(e) {
  6264. l(e),
  6265. ve.pause(),
  6266. J.trackAlways("showcase_gui", {
  6267. gui_action: "pause_highlights"
  6268. })
  6269. }),
  6270. $("#gui-zoomin").find("a").on("click", function(e) {
  6271. l(e),
  6272. t.player.zoomInIncrementally()
  6273. }),
  6274. $("#gui-zoomout").find("a").on("click", function(e) {
  6275. l(e),
  6276. t.player.zoomOutIncrementally()
  6277. })
  6278. }
  6279. function y(e, t) {
  6280. for (var i = $(".gui-floor"), n = 0; n < e.floors.length; n++) {
  6281. var r = $('<div class="floorChoice" data-index="' + n + '"></div>').text(e.floors.get(n).name);
  6282. $(".gui-floor").find(".container").prepend(r)
  6283. }
  6284. i.find(".container").prepend('<div class="floorChoice darkGlass allFloorBtn" data-index="all" style="display:none">' + Re.FLOOR_ALL + "</div>"),
  6285. i.on("click", function(e) {
  6286. l(e),
  6287. Ze("floor"),
  6288. i.toggleClass("open")
  6289. }),
  6290. $(".floorChoice").on("click", function(e) {
  6291. l(e);
  6292. var n = $(this).data("index");
  6293. "all" !== n ? (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6294. t.player.gotoFloor(n),
  6295. J.track("showcase_gui", {
  6296. gui_action: "click_floor_select_button",
  6297. interaction_source: "gui"
  6298. })) : (J.updateInteraction(Se.InteractionGui, "floor-control"),
  6299. Ze("move"),
  6300. t.allFloors(),
  6301. J.track("showcase_gui", {
  6302. gui_action: "click_toggle_all_floors_button",
  6303. interaction_source: "gui"
  6304. })),
  6305. i.removeClass("open")
  6306. })
  6307. }
  6308. function C(e, t) {
  6309. e && (t === _e.DOLLHOUSE || t === _e.FLOORPLAN ? $(".allFloorBtn").show() : $(".allFloorBtn").hide(),
  6310. e.model.allFloorsVisible ? ($(".gui-floor-title").text(Re.FLOOR_ALL),
  6311. $(".gui-floor-number").text(Re.FLOOR_ALL),
  6312. $(".floorChoice").removeClass("active"),
  6313. $('.floorChoice[data-index="all"]').addClass("active")) : ($(".gui-floor-title").text(e.name),
  6314. $(".gui-floor-number").text(" " + (e.floorIndex + 1)),
  6315. $(".floorChoice").removeClass("active"),
  6316. $(".floorChoice[data-index=" + e.floorIndex + "]").addClass("active")))
  6317. }
  6318. function I(e) {
  6319. return e.describe().inTransition
  6320. }
  6321. function E(e) {
  6322. $("<img/>").attr("src", e).on("load", function() {
  6323. $("#gui-thumb").css("backgroundImage", "url(" + e + ")").fadeIn(500),
  6324. $(this).remove()
  6325. })
  6326. }
  6327. function b(e, t, i) {
  6328. Fe = e.heroLocations.length;
  6329. var n = '<li class="thumbImg" data-index=""><img src=""></li>'
  6330. , r = 100 / Fe + "%"
  6331. , o = $("#thumb-container")
  6332. , a = $("#progressBar");
  6333. $("#status").find(".totalSteps").text(Fe);
  6334. for (var s = 0; s < Fe; s++) {
  6335. var c = e.heroLocations[s]
  6336. , h = $(n);
  6337. if (h.attr("data-index", s),
  6338. je.highlight.visible && h.find("img").attr("src", c.thumbUrl),
  6339. c.name) {
  6340. var u = $('<div class="overlay"></div>').text(c.name);
  6341. h.prepend(u)
  6342. }
  6343. if (e.has360Views && c.cameraMode === _e.PANORAMA) {
  6344. var d = e.panos.get(c.panoId)
  6345. , p = d && !d.isAligned()
  6346. , 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>';
  6347. h.prepend(f)
  6348. }
  6349. o.append(h),
  6350. a.append('<div class="step" data-idx="' + s + '" style="width:' + r + '"></div>')
  6351. }
  6352. j = 144 * Fe,
  6353. Y = 111 * Fe,
  6354. $(".thumbImg").on("mouseover", function() {
  6355. I(t) || i.showPathToHeroLocation($(this).data("index"))
  6356. }),
  6357. $(".thumbImg").on("mouseout", function() {
  6358. t.clearPath()
  6359. }),
  6360. $(".thumbImg").on("click", function(e) {
  6361. l(e);
  6362. var i = $(this);
  6363. J.updateInteraction(Se.InteractionGui, "thumbnail"),
  6364. J.trackAlways("showcase_gui", {
  6365. gui_action: "click_highlight"
  6366. }),
  6367. t.goToHighlight(i.data("index"))
  6368. }),
  6369. $(".previous").find("a").on("click", function(e) {
  6370. l(e),
  6371. J.trackAlways("showcase_gui", {
  6372. gui_action: "prev_highlight"
  6373. }),
  6374. t.prevHighlight()
  6375. }),
  6376. $(".next").find("a").on("click", function(e) {
  6377. l(e),
  6378. J.trackAlways("showcase_gui", {
  6379. gui_action: "next_highlight"
  6380. }),
  6381. t.nextHighlight()
  6382. }),
  6383. $("#drawer").on("mouseleave", function(e) {
  6384. l(e);
  6385. var t;
  6386. try {
  6387. t = new MouseEvent("mouseup",{
  6388. clientX: e.clientX,
  6389. clientY: e.clientY,
  6390. screenX: e.screenX,
  6391. screenY: e.screenY
  6392. })
  6393. } catch (i) {
  6394. t = document.createEvent("MouseEvents"),
  6395. t.initMouseEvent("mouseup", e.bubbles, e.cancelable, e.view, e.detail, e.screenX, e.screenY, e.clientX, e.clientY, e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, e.button, e.relatedTarget)
  6396. }
  6397. document.dispatchEvent(t)
  6398. }),
  6399. W = new Sly($("#scrollFrame"),{
  6400. horizontal: !0,
  6401. itemNav: "centered",
  6402. smart: !0,
  6403. scrollTrap: !0,
  6404. scrollBy: 1,
  6405. mouseDragging: !0,
  6406. touchDragging: !0,
  6407. speed: 300,
  6408. dragHandle: !0,
  6409. dynamicHandle: !0,
  6410. clickBar: !0,
  6411. scrollBar: $("#scroller"),
  6412. activateOn: null
  6413. }).init(),
  6414. W.on("active", function(e, t) {
  6415. Ve = t,
  6416. Ze("tour"),
  6417. $(".step").removeClass("active"),
  6418. $("#status").find(".curIdx").text(t + 1);
  6419. for (var i = 0; i <= t; i++)
  6420. $("#progressBar").find("[data-idx='" + i + "']").addClass("active")
  6421. }),
  6422. w()
  6423. }
  6424. function w() {
  6425. var e = $("#player").width() - 20
  6426. , t = $("#scroller")
  6427. , i = $("#drawer")
  6428. , n = $(".pinBottom");
  6429. if ($("#player").width() < 488 || $("#player").height() < 488)
  6430. t.addClass("hidden"),
  6431. i.addClass("noScroll"),
  6432. n.addClass("noScroll");
  6433. else {
  6434. var r = j > e
  6435. , o = !i.hasClass("noScroll")
  6436. , a = r !== o;
  6437. a && (t.toggleClass("hidden"),
  6438. i.toggleClass("noScroll"),
  6439. n.toggleClass("noScroll"))
  6440. }
  6441. }
  6442. function _(e) {
  6443. je.tourControls.visible = e.tour_buttons && K.valueFromHash("gt", 1),
  6444. je.coBrand.visible = e.presented_by && 1 !== Q.specialEdition && Q.brand && !K.valueFromHash("mls", !1),
  6445. je.highlight.visible = e.highlight_reel && 1 !== Q.specialEdition && Q.showHighlights
  6446. }
  6447. function T(e) {
  6448. function t(t, i) {
  6449. return !!e.player_options[t] && e[i || t]
  6450. }
  6451. $(".model-title").text(e.name);
  6452. var i = Q.pageTitle;
  6453. 2 !== K.valueFromHash("mls", 0) && (i = e.name + " - " + i),
  6454. document.title = i,
  6455. K.isMobile() ? $("#gui-fullscreen").css("display", "none") : ($("[rel=tooltip]").tooltip({
  6456. delay: {
  6457. show: 50,
  6458. hide: 0
  6459. },
  6460. trigger: "hover",
  6461. html: !1,
  6462. viewport: {
  6463. selector: "body",
  6464. padding: 10
  6465. }
  6466. }),
  6467. K.inIframe() && document.getElementsByClassName("pinBottom-container")[0].classList.add("embed")),
  6468. // 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"),
  6469. de.populate({
  6470. name: t("model_name", "name"),
  6471. coBrand: t("presented_by"),
  6472. description: t("model_summary", "summary"),
  6473. contactName: t("contact_name"),
  6474. address: t("address"),
  6475. phone: t("contact_phone"),
  6476. formattedPhone: e.formatted_contact_phone,
  6477. email: t("contact_email"),
  6478. url: t("external_url"),
  6479. socialSharing: e.enable_social_sharing && e.is_public
  6480. })
  6481. }
  6482. function x(e, t, i, n, r, o) {
  6483. function a() {
  6484. o.setLoadingStartTime(),
  6485. H(),
  6486. r ? (re.showMessage(t, i, je.coBrand.visible),
  6487. l()) : h(l)
  6488. }
  6489. var s = $.Deferred()
  6490. , l = s.resolve.bind(s);
  6491. return Ge = !0,
  6492. O(e),
  6493. e.data.player_options && _(e.data.player_options),
  6494. 1 === Q.specialEdition && $("body").addClass("specialEdition"),
  6495. Re.localizeGUI(),
  6496. T(e.data),
  6497. r || $(".quick").addClass("hidden"),
  6498. e.data.image && !r && E(e.data.image),
  6499. n ? (J.impression(),
  6500. a()) : (o.setWaitingStartTime(),
  6501. oe.show(r, a)),
  6502. s
  6503. }
  6504. function S(e, t, i, n, r, a, s) {
  6505. q = s,
  6506. e.outsideAllowed() || $("#gui-modes-outside").addClass("invisible"),
  6507. e.supportedModes[_e.PANORAMA] || $("#gui-modes-inside").addClass("invisible"),
  6508. ae.init(),
  6509. re.init(e, a),
  6510. Oe.init(e, t, n),
  6511. $(".icon").on("mouseover", function() {
  6512. t.player && t.player.reticule.hide()
  6513. }),
  6514. m(e, t),
  6515. A(e, t),
  6516. e.data.enable_social_sharing && e.data.is_public && Q.share.enabled && (Ce.init(e.data.name),
  6517. Ce.on(Me.OPENED, function() {
  6518. var e = document.getElementById("share-modal");
  6519. return function() {
  6520. Ze("share"),
  6521. le.open(e)
  6522. }
  6523. }()),
  6524. Ce.on(Me.CLOSED, le.reset)),
  6525. e.heroLocations.length > 1 ? b(e, t, i) : (je.highlight.visible = !1,
  6526. je.tourControls.visible = !1),
  6527. de.on(pe.OPEN_INFO, Ze.bind(this, "info")),
  6528. z(),
  6529. g(i),
  6530. v(e, r),
  6531. e.on("floor.changed", C),
  6532. e.on("waiting", R.bind(this, e)),
  6533. e.on("waiting-done", P.bind(this, e)),
  6534. i.on(xe.ModeChanged, function(e, n) {
  6535. g(i),
  6536. o(t, i),
  6537. n === _e.PANORAMA && i.currentPano && !i.currentPano.isAligned() && (n = _e.OUTDOOR),
  6538. he.updateMode(n)
  6539. }),
  6540. n.on(Se.Move, Ze.bind(this, "move")),
  6541. i.on(xe.Ready, function() {
  6542. ie.init(n, i, i.tagManager, t),
  6543. i.on(xe.ModeChanged, function(e, t) {
  6544. e !== t && $(".vr-popup").is(":visible") && Ae.dismiss()
  6545. })
  6546. }),
  6547. i.on(xe.PanoChosen, function(e, t) {
  6548. g(i, t),
  6549. he.updateMode(t && !t.isAligned() ? _e.OUTDOOR : _e.PANORAMA)
  6550. }),
  6551. le.on(ce.CLOSE, function(e) {
  6552. switch (e) {
  6553. case "vr-modal":
  6554. Ae.dismiss();
  6555. break;
  6556. case "share-modal":
  6557. Ce.hide();
  6558. break;
  6559. case "terms-modal":
  6560. fe.hide()
  6561. }
  6562. });
  6563. var l = $("#play").eq(0)
  6564. , c = $("#pause").eq(0)
  6565. , h = $(".pinBottom").toArray()
  6566. , u = $("#drawer").eq(0)
  6567. , d = $("#playHead").eq(0)
  6568. , p = $("#progressBar").eq(0)
  6569. , f = $("#thumb-container").eq(0)
  6570. , y = f.children()
  6571. , I = p.children();
  6572. t.on("update.controls", function() {
  6573. var n = t.describe();
  6574. n.tourIsPlaying || i.isWarping() ? (je.tourControls.visible && (l.hide(),
  6575. c.show()),
  6576. n.tourInProgress && (h.forEach(function(e) {
  6577. e.classList.add("playing")
  6578. }),
  6579. u.addClass("playing"),
  6580. d.addClass("playing"))) : (je.tourControls.visible && (l.show(),
  6581. c.hide()),
  6582. n.tourInProgress || (ve.stopTour(),
  6583. h.forEach(function(e) {
  6584. e.classList.remove("playing")
  6585. }),
  6586. u.removeClass("playing"),
  6587. d.removeClass("playing")));
  6588. var r, a, s;
  6589. if (null !== n.currentItem) {
  6590. var p, f;
  6591. $("#status").find(".curIdx").text(n.currentItem + 1),
  6592. n.onTheBus ? (p = "active",
  6593. f = "recent") : (f = "active",
  6594. p = "recent");
  6595. var g = null === n.destinationItem || n.currentItem === n.destinationItem;
  6596. for (r = 0; r < e.heroLocations.length; r += 1)
  6597. s = y.eq(r),
  6598. a = I.eq(r),
  6599. s.removeClass(f),
  6600. a.removeClass(f),
  6601. n.onTheBus && r === n.destinationItem ? (s.addClass(p),
  6602. a.addClass(p),
  6603. W.activate(r)) : n.onTheBus && g && r === n.currentItem ? (s.addClass(p),
  6604. a.addClass(p)) : (s.removeClass(p),
  6605. a.removeClass(p))
  6606. } else
  6607. for (r = 0; r < e.heroLocations.length; r += 1)
  6608. s = y.eq(r),
  6609. a = I.eq(r),
  6610. s.removeClass("active recent"),
  6611. a.removeClass("active recent");
  6612. o(t, i)
  6613. }),
  6614. document.addEventListener("keydown", function(n) {
  6615. switch (J.updateInteraction(Se.InteractionKey),
  6616. n.which) {
  6617. case we.ZERO:
  6618. Q.debug && e.toggleAlpha();
  6619. break;
  6620. case we.NINE:
  6621. Q.debug && se.toggle();
  6622. break;
  6623. case we.ONE:
  6624. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.PANORAMA);
  6625. break;
  6626. case we.TWO:
  6627. e.outsideAllowed() && !i.isInMode(_e.DOLLHOUSE, _e.TRANSITIONING) && t.changeMode(_e.DOLLHOUSE);
  6628. break;
  6629. case we.THREE:
  6630. e.outsideAllowed() && !i.isInMode(_e.FLOORPLAN, _e.TRANSITIONING) && t.changeMode(_e.FLOORPLAN);
  6631. break;
  6632. case we.FOUR:
  6633. i.isInMode(_e.TRANSITIONING) || t.changeMode(_e.OUTDOOR);
  6634. break;
  6635. case we.SPACE:
  6636. je.tourControls.visible && ($("#playHead").hasClass("playing") || Ze("tour"));
  6637. break;
  6638. case we.RETURN:
  6639. Q.debug && e.toggleExplodeUp();
  6640. break;
  6641. case we.P:
  6642. k();
  6643. break;
  6644. case we.U:
  6645. B();
  6646. break;
  6647. case we.X:
  6648. Q.debug && e.toggleExplode();
  6649. break;
  6650. case we.PLUSEQUALS:
  6651. t.player.activatePersistentZooming(!0),
  6652. ie.hideUi();
  6653. break;
  6654. case we.DASHUNDERSCORE:
  6655. t.player.activatePersistentZooming(!1),
  6656. ie.hideUi();
  6657. break;
  6658. case we.SEVEN:
  6659. De.info("Zoom level: " + t.player.zoomLevel + ", FOV: " + t.player.zoomFov);
  6660. break;
  6661. case we.EIGHT:
  6662. t.player.decreaseZoomSpeed();
  6663. break;
  6664. case we.NINE:
  6665. t.player.increaseZoomSpeed()
  6666. }
  6667. return i && i.reticule.hide(),
  6668. !0
  6669. }
  6670. .bind(this)),
  6671. document.addEventListener("keyup", function(e) {
  6672. switch (e.which) {
  6673. case we.PLUSEQUALS:
  6674. t.player.deactivatePersistentZooming();
  6675. break;
  6676. case we.DASHUNDERSCORE:
  6677. t.player.deactivatePersistentZooming()
  6678. }
  6679. }
  6680. .bind(this)),
  6681. F(e),
  6682. L(e, t.player),
  6683. M(i),
  6684. te.setAutoPlay(e.heroCount()),
  6685. he.init(i, a.mode),
  6686. he.on(ue.OPENED, Ze.bind(this, "help")),
  6687. fe.init(),
  6688. fe.on(ge.OPENED, function() {
  6689. var e = document.getElementById("terms-modal");
  6690. return function() {
  6691. Ze("terms"),
  6692. le.open(e)
  6693. }
  6694. }()),
  6695. fe.on(ge.CLOSED, le.reset),
  6696. Q.quickstart.enabled || re.delayLanding(a.mode).then(re.showMessage.bind(this, i, t, je.coBrand.visible)),
  6697. (Q.quickstart.enabled || i.model.outsideAllowed()) && ie.init(n, i, i.tagManager, t),
  6698. Q.profiling.enabled && se.show(),
  6699. ve.init(t)
  6700. }
  6701. function M(e) {
  6702. var t = function(e, t) {
  6703. $(e).find("a").each(function(e, i) {
  6704. t ? $(i).removeClass("buttonZoomDisabled").addClass("buttonZoomEnabled") : $(i).addClass("buttonZoomDisabled").removeClass("buttonZoomEnabled"),
  6705. i.style.pointerEvents = t ? "auto" : "none"
  6706. })
  6707. }
  6708. , i = function() {
  6709. e.zoomLevel >= Q.zoom.max ? t("#gui-zoomin", !1) : t("#gui-zoomin", !0),
  6710. e.zoomLevel <= Q.zoom.min ? t("#gui-zoomout", !1) : t("#gui-zoomout", !0)
  6711. };
  6712. e.on(Ne.ZoomMax, function() {
  6713. t("#gui-zoomin", !1),
  6714. t("#gui-zoomout", !0)
  6715. }),
  6716. e.on(Ne.ZoomMin, function() {
  6717. t("#gui-zoomin", !0),
  6718. t("#gui-zoomout", !1)
  6719. }),
  6720. e.on(Ne.ZoomIn, function() {
  6721. t("#gui-zoomout", !0)
  6722. }),
  6723. e.on(Ne.ZoomOut, function() {
  6724. t("#gui-zoomin", !0)
  6725. }),
  6726. i()
  6727. }
  6728. function R(e) {
  6729. O(e)
  6730. }
  6731. function P(e) {
  6732. O(e)
  6733. }
  6734. function O(e) {
  6735. var t = e.waitQueue.length;
  6736. t <= 0 ? f() : Ge || p(Q.modelComponentLoadSpinnerDelay)
  6737. }
  6738. function L(e, t) {
  6739. He = {
  6740. gui: null,
  6741. visible: !1,
  6742. model: e,
  6743. player: t
  6744. }
  6745. }
  6746. function D(e, t) {
  6747. function i() {
  6748. var i = t.toJSON();
  6749. n.linkToLocation = window.location.protocol + "//" + window.location.host + window.location.pathname + "?m=" + e.sid + "&start=" + be.serialize(i),
  6750. t.tagManager.activeTag && (n.linkToLocation += "&tag=" + t.tagManager.activeTag.sid)
  6751. }
  6752. var n = {}
  6753. , r = new Le.GUI({
  6754. autoPlace: !0,
  6755. width: "60%"
  6756. });
  6757. i(),
  6758. t.on(xe.ViewChanged, i),
  6759. r.add(n, "linkToLocation").name(Re.LINK_TO_LOCATION).listen(),
  6760. r.domElement.id = "datLinks";
  6761. var o = [].slice.call(r.domElement.querySelectorAll(".property-name"));
  6762. return o.forEach(function(e) {
  6763. if (!K.detectSafari()) {
  6764. var t = document.createElement("button");
  6765. t.classList.add("btn-deep-link"),
  6766. t.innerText = Re.MENU_COPY,
  6767. e.nextSibling.appendChild(t);
  6768. var i = function() {
  6769. alert(Re.LINK_ALERT_COPY),
  6770. t.hide()
  6771. };
  6772. t.addEventListener("click", function(e) {
  6773. try {
  6774. var t = e.target.parentNode.childNodes[0];
  6775. t.select();
  6776. var n = document.execCommand("copy");
  6777. t.blur(),
  6778. n || i()
  6779. } catch (e) {
  6780. i()
  6781. }
  6782. })
  6783. }
  6784. }),
  6785. $(r.__closeButton).hide(),
  6786. r
  6787. }
  6788. function N(e) {
  6789. He.gui || (He.gui = D(He.model, He.player)),
  6790. He.visible = e,
  6791. e ? $(He.gui.domElement).show() : $(He.gui.domElement).hide()
  6792. }
  6793. function B() {
  6794. N(!He.visible)
  6795. }
  6796. function F(e) {
  6797. ke = {
  6798. gui: null,
  6799. visible: !1,
  6800. model: e
  6801. }
  6802. }
  6803. function V(e) {
  6804. var t = new Le.GUI;
  6805. return t.add(Q, "showSweeps").name("Show sweeps").onFinishChange(function() {
  6806. e.setSweepVisibility(Q.showSweeps)
  6807. }),
  6808. t.add(Q, "rotationAccelerationInside", .1, 10).name("Rotation speed").step(.1),
  6809. t.add(Q.transition, "flyTime", 0, 5e3).name("Transition time").onFinishChange(function() {
  6810. Q.transition.flySpeed = 0,
  6811. t.__controllers.forEach(function(e) {
  6812. e.updateDisplay()
  6813. })
  6814. }),
  6815. t.add(Q.path, "opacity", 0, 1).name("Path opacity"),
  6816. $(t.__closeButton).hide(),
  6817. t
  6818. }
  6819. function U(e) {
  6820. ke.gui || (ke.gui = V(ke.model)),
  6821. ke.visible = e,
  6822. e ? $(ke.gui.domElement).show() : $(ke.gui.domElement).hide()
  6823. }
  6824. function k() {
  6825. U(!ke.visible)
  6826. }
  6827. function H() {
  6828. function e(e) {
  6829. e.target === t || $.contains(t, e.target) || e.target === i || $.contains(i, e.target) || e.target === n || $.contains(n, e.target) || e.preventDefault()
  6830. }
  6831. $("body").css("touch-action", "none"),
  6832. $("#gui-parent").find("*:not(#tag-billboards)").on("touchmove", function(e) {
  6833. e.preventDefault()
  6834. });
  6835. var t = document.getElementById("terms-text")
  6836. , i = document.getElementById("more-help-wrapper")
  6837. , n = (document.getElementById("navigation-help-wrapper"),
  6838. document.getElementById("help-dialog"),
  6839. document.getElementById("tag-billboards"));
  6840. Q.useWheel && (document.body.addEventListener("mousewheel", e),
  6841. document.body.addEventListener("DOMMouseScroll", e)),
  6842. $("#terms-text, #more-help-wrapper, #navigation-help-wrapper").off("touchmove").on("touchmove", function(e) {
  6843. e.stopPropagation()
  6844. })
  6845. }
  6846. function G(e, t) {
  6847. for (var i = []; e; )
  6848. i.push(e),
  6849. e = e.parentNode;
  6850. for (; t && i.indexOf(t) === -1; )
  6851. t = t.parentNode;
  6852. return t
  6853. }
  6854. function z() {
  6855. var e, t = function(t) {
  6856. e = 0 === t.button || 1 === t.which ? t.target : null
  6857. }, i = function(t) {
  6858. e !== t.target && (e = G(e, t.target));
  6859. var i = document.getElementById("gui-parent");
  6860. if (G(i, e) !== i && (e = null),
  6861. e) {
  6862. var n;
  6863. try {
  6864. n = new MouseEvent("click",t)
  6865. } catch (e) {
  6866. n = document.createEvent("MouseEvents"),
  6867. n.initMouseEvent("click", t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  6868. }
  6869. n.syntheticClick = !0,
  6870. e.dispatchEvent(n),
  6871. e = null
  6872. }
  6873. };
  6874. document.body.addEventListener("mousedown", t, !0),
  6875. document.body.addEventListener("mouseup", i, !0),
  6876. document.getElementById("gui-parent").addEventListener("click", function(e) {
  6877. e.syntheticClick || (e.stopPropagation(),
  6878. "A" === e.target.nodeName && e.preventDefault())
  6879. }, !0)
  6880. }
  6881. var W, j, Y, X, Z, q, K = (e("three"),
  6882. e("../util/ajax"),
  6883. e("../util/browser")), Q = e("../settings"), J = e("../analytics"), ee = (e("../util/transitions"),
  6884. e("../util/camera"),
  6885. e("../util/logger")), te = (e("../objects/Snapshot"),
  6886. e("./helpManager")), ie = e("./immersiveMode"), ne = e("./loadingScreen"), re = e("./landingScreen"), oe = e("./playButton"), ae = e("./populateModal"), se = e("./memoryUsage"), le = e("./closer/modalCloser"), ce = e("./closer/ModalCloserEvent"), he = e("./help/help"), ue = e("./help/HelpEvent"), de = e("./title/titleBar"), pe = e("./title/TitleEvents"), fe = e("./terms/terms"), ge = e("./terms/TermsEvent"), me = e("./title/tagToggle"), ve = e("./tourInteraction"), Ae = e("./vr/vrModal"), ye = e("./vr/vrEvent"), Ce = e("./sharing/modal"), Ie = e("./webvr/webVRgui"), Ee = e("./webvr/WebVrEvent"), be = e("../controls/serializer"), we = e("../enum/Keys"), _e = e("../enum/Viewmode"), Te = (e("../enum/BlackoutStyle"),
  6887. e("../tag/Media/MediaEvent")), xe = (e("../enum/PathDiscardMode"),
  6888. e("../enum/PathDisplayMode"),
  6889. e("../enum/DirectorEvents"),
  6890. e("../enum/PlayerEvents")), Se = e("../enum/ControlEvents"), Me = e("./sharing/ShareEvents"), Re = e("../localization/localize"), Pe = (e("../enum/Vectors"),
  6891. e("../enum/WarpStyle"),
  6892. e("../enum/AlignmentType"),
  6893. e("../enum/VROption")), Oe = e("./konami"), Le = e("../lib/dat.gui"), De = new ee(i), Ne = (e("../util/showcase"),
  6894. e("../enum/ZoomEvents")), Be = _e.DOLLHOUSE, Fe = 0, Ve = 0, Ue = [".hideTarget"], ke = null, He = null, Ge = !1, ze = !1, We = !1, je = {
  6895. coBrand: {
  6896. visible: !0,
  6897. elements: [".co-brand", "#loaderCoBrand"]
  6898. },
  6899. help: {
  6900. visible: !0,
  6901. elements: [".nav-help", "#nav-help"]
  6902. },
  6903. tourControls: {
  6904. visible: !0,
  6905. elements: [".next", ".previous", "#play"]
  6906. },
  6907. highlight: {
  6908. visible: !0,
  6909. elements: ["#drawer", "#pullTab"]
  6910. },
  6911. share: {
  6912. visible: !0,
  6913. elements: [".socialButton", "#share"]
  6914. },
  6915. fullScreen: {
  6916. visible: !0,
  6917. elements: ["#gui-fullscreen"]
  6918. },
  6919. floors: {
  6920. visible: !0,
  6921. elements: [".gui-floor"]
  6922. }
  6923. }, Ye = function() {
  6924. var e = document.getElementById("drawer");
  6925. return function() {
  6926. $("#player").height() < 400 && e.classList.contains("open") && a()
  6927. }
  6928. }(), Xe = function() {
  6929. var e = document.getElementById("meta-info");
  6930. return function() {
  6931. $("#player").height() < 400 && e.classList.contains("expand") && de.toggleMeta(!0)
  6932. }
  6933. }(), Ze = function(e) {
  6934. function t() {
  6935. u.classList.contains("expand") && de.toggleMeta(!0)
  6936. }
  6937. function i() {
  6938. fe.hide()
  6939. }
  6940. function n() {
  6941. he.close()
  6942. }
  6943. function r() {
  6944. Ae.dismiss()
  6945. }
  6946. function o() {
  6947. p.hasClass("open") && a(!0)
  6948. }
  6949. function l() {
  6950. Ce.hide()
  6951. }
  6952. function c() {
  6953. f.hasClass("open") && f.removeClass("open")
  6954. }
  6955. function h() {
  6956. d.classList.contains("fadeIn") && (d.classList.contains("landing") ? re.dismissModal() : d.classList.contains("tour") && ve.dismissModal())
  6957. }
  6958. var u = document.getElementById("meta-info")
  6959. , d = document.getElementById("interaction-modal")
  6960. , p = $("#drawer").eq(0)
  6961. , f = $(".gui-floor").eq(0)
  6962. , g = $(".vr-popup").eq(0);
  6963. return function(e) {
  6964. switch (e) {
  6965. case "info":
  6966. i(),
  6967. n(),
  6968. Ye(),
  6969. l(),
  6970. c(),
  6971. r(),
  6972. h();
  6973. break;
  6974. case "terms":
  6975. t(),
  6976. n(),
  6977. o(),
  6978. l(),
  6979. c(),
  6980. r(),
  6981. h();
  6982. break;
  6983. case "help":
  6984. t(),
  6985. i(),
  6986. l(),
  6987. c(),
  6988. r(),
  6989. h();
  6990. break;
  6991. case "vr":
  6992. t(),
  6993. i(),
  6994. l(),
  6995. c(),
  6996. n(),
  6997. h(),
  6998. s(g) && o();
  6999. break;
  7000. case "highlights":
  7001. Xe(),
  7002. i(),
  7003. l(),
  7004. c();
  7005. break;
  7006. case "share":
  7007. t(),
  7008. i(),
  7009. n(),
  7010. c(),
  7011. r(),
  7012. h();
  7013. break;
  7014. case "floor":
  7015. i(),
  7016. l(),
  7017. r();
  7018. break;
  7019. case "view":
  7020. c(),
  7021. l(),
  7022. i(),
  7023. r();
  7024. break;
  7025. case "tour":
  7026. i(),
  7027. l(),
  7028. c(),
  7029. r();
  7030. break;
  7031. case "move":
  7032. i(),
  7033. l(),
  7034. c(),
  7035. r();
  7036. break;
  7037. case "resize":
  7038. t(),
  7039. Ye(),
  7040. c();
  7041. break;
  7042. case "tag":
  7043. i(),
  7044. n(),
  7045. l(),
  7046. c(),
  7047. r()
  7048. }
  7049. }
  7050. }();
  7051. $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", function(e) {
  7052. $("#gui-fullscreen").toggle(!K.isFullscreen()),
  7053. $("#gui-fullscreen-exit").toggle(!!K.isFullscreen()),
  7054. setTimeout(function() {
  7055. $(".icon:visible").hide().show(0)
  7056. }, 100)
  7057. }),
  7058. $("#gui-fullscreen").find("a").on("click", function(e) {
  7059. l(e),
  7060. K.requestFullscreen($("body")[0]),
  7061. J.track("showcase_gui", {
  7062. gui_action: "click_enter_fullscreen",
  7063. interaction_source: "gui"
  7064. }),
  7065. W.reload()
  7066. }),
  7067. $("#gui-fullscreen-exit").find("a").on("click", function(e) {
  7068. l(e),
  7069. K.exitFullscreen(),
  7070. J.track("showcase_gui", {
  7071. gui_action: "click_exit_fullscreen",
  7072. interaction_source: "gui"
  7073. })
  7074. }),
  7075. $("#volume").find("a").on("click", function(e) {//xzw 声音
  7076. l(e);
  7077. if($("#volume img")[0].src.indexOf("btn_on.png")>-1)
  7078. {
  7079. g_play = 0;
  7080. //g_bgAudio.pause();
  7081. //g_tourAudio.pause(); //g_tourAudio.volume = 0;//ios 无法改变音量
  7082. g_playAudio && g_playAudio.pause();
  7083. $("#volume img").attr("src", "./images/Volume btn_off.png");
  7084. $("#volume").attr("title", "关闭声音");
  7085. }
  7086. else if($("#volume img")[0].src.indexOf("btn_off.png")>-1)
  7087. {
  7088. g_play = 1;
  7089. g_playAudio && g_playAudio.play()
  7090. /* if(g_tourAudio && g_tourAudio.src) g_tourAudio.play();
  7091. else if(g_bgAudio)g_bgAudio.play() */
  7092. $("#volume img").attr("src", "./images/Volume btn_on.png");
  7093. $("#volume").attr("title", "打开声音");
  7094. }
  7095. }),
  7096. $(window).on("resize", function(e) {
  7097. var t = e.target.innerHeight
  7098. , i = e.target.innerWidth;
  7099. t === X && i === Z || (je.highlight.visible && w(),
  7100. Ze("resize"),
  7101. $(".pinTop.right").removeClass("hideUnderMeta"),
  7102. c(),
  7103. X = t,
  7104. Z = i)
  7105. }).resize(),
  7106. K.supportsFullscreen() || $("#gui-fullscreen").hide(),
  7107. $("#pullTab").on("click", function(e) {
  7108. l(e),
  7109. $("#drawer").hasClass("open") ? (J.trackAlways("showcase_gui", {
  7110. gui_action: "hide_highlight_reel"
  7111. }),
  7112. $(this).addClass("open").children("img").attr("src","images/auto.png")) : (J.trackAlways("showcase_gui", {
  7113. gui_action: "show_highlight_reel"
  7114. }),
  7115. $(this).removeClass("open").children("img").attr("src","images/auto-suspend.png")),
  7116. a()
  7117. }),
  7118. $("#more-menu-button").on("click", function(e) {
  7119. l(e);
  7120. var t = $("#more-menu");
  7121. t.toggleClass("open")
  7122. }),
  7123. t.exports.init = S,
  7124. t.exports.startLoading = x,
  7125. t.exports.endLoading = d,
  7126. t.exports.onProgress = u
  7127. }
  7128. ).call(this, "/js/gui/gui.js")
  7129. }
  7130. , {
  7131. "../analytics": 4,
  7132. "../controls/serializer": 14,
  7133. "../enum/AlignmentType": 17,
  7134. "../enum/BlackoutStyle": 18,
  7135. "../enum/ControlEvents": 21,
  7136. "../enum/DirectorEvents": 23,
  7137. "../enum/Keys": 30,
  7138. "../enum/PathDiscardMode": 38,
  7139. "../enum/PathDisplayMode": 39,
  7140. "../enum/PlayerEvents": 40,
  7141. "../enum/VROption": 47,
  7142. "../enum/Vectors": 50,
  7143. "../enum/Viewmode": 51,
  7144. "../enum/WarpStyle": 52,
  7145. "../enum/ZoomEvents": 53,
  7146. "../lib/dat.gui": 93,
  7147. "../localization/localize": 108,
  7148. "../tag/Media/MediaEvent": 131,
  7149. "../objects/Snapshot": 153,
  7150. "../settings": 166,
  7151. "../util/ajax": 181,
  7152. "../util/browser": 182,
  7153. "../util/camera": 183,
  7154. "../util/logger": 189,
  7155. "../util/showcase": 193,
  7156. "../util/transitions": 195,
  7157. "./closer/ModalCloserEvent": 61,
  7158. "./closer/modalCloser": 62,
  7159. "./help/HelpEvent": 66,
  7160. "./help/help": 67,
  7161. "./helpManager": 68,
  7162. "./immersiveMode": 69,
  7163. "./konami": 70,
  7164. "./landingScreen": 71,
  7165. "./loadingScreen": 72,
  7166. "./memoryUsage": 73,
  7167. "./playButton": 74,
  7168. "./populateModal": 75,
  7169. "./sharing/ShareEvents": 76,
  7170. "./sharing/modal": 77,
  7171. "./terms/TermsEvent": 78,
  7172. "./terms/terms": 79,
  7173. "./title/TitleEvents": 80,
  7174. "./title/tagToggle": 81,
  7175. "./title/titleBar": 82,
  7176. "./tourInteraction": 84,
  7177. "./vr/vrEvent": 85,
  7178. "./vr/vrModal": 87,
  7179. "./webvr/WebVrEvent": 88,
  7180. "./webvr/webVRgui": 89,
  7181. three: 217
  7182. }],
  7183. 66: [function(e, t, i) {
  7184. "use strict";
  7185. t.exports = Object.freeze({
  7186. OPENED: "help.opened",
  7187. CLOSED: "help.closed"
  7188. })
  7189. }
  7190. , {}],
  7191. 67: [function(e, t, i) {
  7192. "use strict";
  7193. function n() {
  7194. g.on("click", function(e) {
  7195. if (S && S !== l.TRANSITIONING) {
  7196. var t = window.getComputedStyle(y).getPropertyValue("opacity") > 0;
  7197. t && !M ? R.close() : r()
  7198. }
  7199. }),
  7200. w.on("click", function(e) {
  7201. R.close()
  7202. }),
  7203. E.on("click", function(e) {
  7204. S && S !== l.TRANSITIONING && (s(),
  7205. o())
  7206. }),
  7207. b.on("click", function(e) {
  7208. s(),
  7209. a()
  7210. })
  7211. }
  7212. function r() {
  7213. S && S !== l.TRANSITIONING && (M = !0,
  7214. setTimeout(function() {
  7215. M = !1
  7216. }, d.help.modalStayDuration),
  7217. R.emit(h.OPENED),
  7218. m.addClass("open " + S),
  7219. g.addClass("open"),
  7220. s(),
  7221. o(),
  7222. y.style.removeProperty ? y.style.removeProperty("display") : y.style.removeAttribute("display"),
  7223. y.classList.add("fadeIn"))
  7224. }
  7225. function o() {
  7226. E.addClass("underline-tab"),
  7227. u.fill(_, c.NAVIGATION, S),
  7228. m.addClass(S)
  7229. }
  7230. function a() {
  7231. b.addClass("underline-tab"),
  7232. u.fill(T, c.MORE_HELP),
  7233. m.addClass("more-help")
  7234. }
  7235. function s(e, t) {
  7236. m.removeClass("more-help " + l.PANORAMA + " " + l.DOLLHOUSE + " " + l.FLOORPLAN + " " + l.OUTDOOR),
  7237. I.forEach(function(e) {
  7238. e.classList.remove("underline-tab")
  7239. })
  7240. }
  7241. var l = e("../../enum/Viewmode")
  7242. , c = e("../../enum/HelpModalType")
  7243. , h = e("./HelpEvent")
  7244. , u = (e("../helpManager"),
  7245. e("./../populateModal"))
  7246. , d = e("../../settings")
  7247. , p = e("../../util/common")
  7248. , f = e("events").EventEmitter
  7249. , g = $(".footer-help").eq(0)
  7250. , m = $("#help-dialog").eq(0)
  7251. , v = document.querySelector("#quick-logo")
  7252. , A = document.querySelector("#loaderCoBrand")
  7253. , y = document.querySelector("#help-dialog")
  7254. , C = document.querySelector(".footer")
  7255. , I = $(".help-tabs").children().toArray()
  7256. , E = $(".navigation-tab").eq(0)
  7257. , b = $(".more-help-tab").eq(0)
  7258. , w = ($("#interaction-modal").eq(0).find(".interaction").toArray(),
  7259. m.find(".close").eq(0))
  7260. , _ = m.find(".interactions").toArray()
  7261. , T = m.find(".ui-instructions").toArray()
  7262. , x = l.PANORAMA
  7263. , S = l.PANORAMA
  7264. , M = !1
  7265. , R = {
  7266. init: function(e, t) {
  7267. S = t,
  7268. x = t,
  7269. [y, A, v, C].forEach(function(e) {
  7270. e.classList.add(u.deviceType)
  7271. }),
  7272. n()
  7273. },
  7274. close: function() {
  7275. if (m.hasClass("open") && (this.emit(h.CLOSED),
  7276. g.removeClass("open"),
  7277. m.removeClass("open"),
  7278. y.classList.contains("fadeIn"))) {
  7279. y.classList.remove("fadeIn");
  7280. var e = S === l.TRANSITIONING ? x : S;
  7281. u.clear(_, c.NAVIGATION, e)
  7282. }
  7283. },
  7284. updateMode: function(e) {
  7285. x = S,
  7286. S = e
  7287. }
  7288. };
  7289. p.extendObject(R, f.prototype),
  7290. t.exports = R
  7291. }
  7292. , {
  7293. "../../enum/HelpModalType": 28,
  7294. "../../enum/Viewmode": 51,
  7295. "../../settings": 166,
  7296. "../../util/common": 185,
  7297. "../helpManager": 68,
  7298. "./../populateModal": 75,
  7299. "./HelpEvent": 66,
  7300. events: 202
  7301. }],
  7302. 68: [function(e, t, i) {
  7303. (function(i) {
  7304. "use strict";
  7305. var n = e("../util/browser")
  7306. , r = e("./../util/logger")
  7307. , o = e("./../settings")
  7308. , a = new r(i)
  7309. , s = function() {
  7310. var e;
  7311. try {
  7312. return e = window.localStorage.getItem("visitCount") || "0",
  7313. e = (parseFloat(e) + 1).toString(),
  7314. window.localStorage.setItem("visitCount", e),
  7315. a.debug("visitCount = " + e),
  7316. e
  7317. } catch (t) {
  7318. e = "1",
  7319. a.debug("couldn't set local storage")
  7320. }
  7321. }()
  7322. , l = !1;
  7323. t.exports = {
  7324. isHelpDisabled: function() {
  7325. return "0" === n.valueFromHash("help", null) || l
  7326. },
  7327. isLargeHelpEnabled: function() {
  7328. return ("1" === s || "1" === n.valueFromHash("help", null)) && !this.isHelpDisabled()
  7329. },
  7330. isSmallHelpEnabled: function() {
  7331. return "2" === n.valueFromHash("help", null) && !this.isHelpDisabled()
  7332. },
  7333. isHelpEnabled: function() {
  7334. return this.isLargeHelpEnabled() || this.isSmallHelpEnabled()
  7335. },
  7336. setAutoPlay: function(e) {
  7337. l = o.warp.auto >= 0 && e > 1
  7338. }
  7339. }
  7340. }
  7341. ).call(this, "/js/gui/helpManager.js")
  7342. }
  7343. , {
  7344. "../util/browser": 182,
  7345. "./../settings": 166,
  7346. "./../util/logger": 189
  7347. }],
  7348. 69: [function(e, t, i) {
  7349. "use strict";
  7350. function n(e, t, i, n) {
  7351. F = n,
  7352. r(e, t, i, F),
  7353. o(),
  7354. N = t.mode
  7355. }
  7356. function r(e, t, i, n) {
  7357. [C.PANORAMA, C.DOLLHOUSE, C.FLOORPLAN].forEach(function(t) {
  7358. e.controls[t].on(v.Move, a),
  7359. e.controls[t].on(v.LongTap, c)
  7360. }),
  7361. M.on("mousewheel DOMMouseScroll", a),
  7362. i.on(m.TagActivated, a),
  7363. i.on(m.TagNavigation, a),
  7364. t.on(A.FlyingEnded, s),
  7365. t.on(A.ModeChanging, function(e, t) {
  7366. B = t !== C.PANORAMA && e !== C.PANORAMA
  7367. }),
  7368. t.on(A.ModeChanged, function(e, i) {
  7369. N = t.mode,
  7370. i !== C.TRANSITIONING ? l() : a("modeChange")
  7371. }),
  7372. n.on(y.TourStart, function() {
  7373. L = !0,
  7374. a()
  7375. }),
  7376. n.on(y.TourEnd, function() {
  7377. L = !1,
  7378. l()
  7379. }),
  7380. n.on(y.ActionInterrupted, function() {
  7381. L = !1
  7382. }),
  7383. R.addEventListener("touchend", function() {
  7384. $("#pullTab").hasClass("opened") && !L && l()
  7385. }, !0)
  7386. }
  7387. function o() {
  7388. p.isMobile() ? (b.forEach(function(e) {
  7389. e.classList.add("mobile")
  7390. }),
  7391. w.click(l)) : (b.forEach(function(e) {
  7392. e.addEventListener("mouseleave", function() {
  7393. !M.is(":hover") && b[0].classList.contains("detectHover") && l()
  7394. }, !0)
  7395. }),
  7396. M.mouseleave(function() {
  7397. b[0].classList.contains("detectHover") && l()
  7398. }))
  7399. }
  7400. function a(e) {
  7401. D || d(e) && _.hasClass("playing") || (clearTimeout(O),
  7402. P = !0,
  7403. g.close(),
  7404. h(e),
  7405. N !== C.DOLLHOUSE && N !== C.FLOORPLAN && (x.hasClass("expand") && !S.hasClass("closed") || 2 === p.valueFromHash("title", 1) ,
  7406. _.hasClass("playing") || (b.forEach(function(e) {
  7407. e.classList.add("detectHover")
  7408. }),
  7409. O = setTimeout(l, f.immersive.timeToShowAgain))))
  7410. }
  7411. function s() {
  7412. _.hasClass("playing") || (clearTimeout(O),
  7413. O = setTimeout(l, f.immersive.timeToShowAgain))
  7414. }
  7415. function l() {
  7416. clearTimeout(O),
  7417. P = !1,
  7418. I.forEach(function(e) {
  7419. e.classList.remove("drawerOpen")
  7420. }),
  7421. L || E.forEach(function(e) {
  7422. e.classList.remove("duringTour")
  7423. }),
  7424. b.forEach(function(e) {
  7425. e.classList.remove("detectHover")
  7426. })
  7427. }
  7428. function c() {
  7429. P ? l() : a(),
  7430. D = !0,
  7431. setTimeout(function() {
  7432. D = !1
  7433. }, f.immersive.uiStayDuration)
  7434. }
  7435. function h(e) {
  7436. !d(e) && L ? E.forEach(function(e) {
  7437. e.classList.remove("drawerOpen"),
  7438. e.classList.add("duringTour")
  7439. }) : _.hasClass("open") ? E.forEach(function(e) {
  7440. e.classList.remove("duringTour"),
  7441. e.classList.add("drawerOpen")
  7442. }) : B || N === C.FLOORPLAN || N === C.DOLLHOUSE || E.forEach(function(e) {
  7443. e.classList.add("fadeOut")
  7444. })
  7445. }
  7446. function u() {
  7447. T.hasClass("duringTour") || (L = !1,
  7448. a("gui"),
  7449. l())
  7450. }
  7451. function d(e) {
  7452. return "mouse" === e || "touch" === e || "key" === e || "gui" === e
  7453. }
  7454. var p = e("../util/browser")
  7455. , f = e("../settings")
  7456. , g = e("./help/help")
  7457. , m = e("../enum/tagEvents")
  7458. , v = e("../enum/ControlEvents")
  7459. , A = e("../enum/PlayerEvents")
  7460. , y = e("../enum/DirectorEvents")
  7461. , A = e("../enum/PlayerEvents")
  7462. , C = e("../enum/Viewmode")
  7463. , I = $(".pinTop.left, .pinBottom-container, #drawer-container, #drawer, .footer").toArray()
  7464. , E = $(".pinBottom-container, #drawer-container, .footer").toArray()
  7465. , b = $("#hover-bottom, #hover-top").toArray()
  7466. , w = ($("#pullTab").eq(0),
  7467. $("#playHead").eq(0),
  7468. $(".pinBottom-container").eq(0))
  7469. , _ = $("#drawer").eq(0)
  7470. , T = $("#drawer-container").eq(0)
  7471. , x = $("#meta-info").eq(0)
  7472. , S = $(".pinTop.left").eq(0)
  7473. , M = $("#player").eq(0)
  7474. , R = document.getElementById("pullTab")
  7475. , P = !1
  7476. , O = null
  7477. , L = !1
  7478. , D = !1
  7479. , N = null
  7480. , B = !1
  7481. , F = null;
  7482. t.exports.init = n,
  7483. t.exports.hideUi = a,
  7484. t.exports.resetDrawer = u
  7485. }
  7486. , {
  7487. "../enum/ControlEvents": 21,
  7488. "../enum/DirectorEvents": 23,
  7489. "../enum/tagEvents": 32,
  7490. "../enum/PlayerEvents": 40,
  7491. "../enum/Viewmode": 51,
  7492. "../settings": 166,
  7493. "../util/browser": 182,
  7494. "./help/help": 67
  7495. }],
  7496. 70: [function(e, t, i) {
  7497. (function(i) {
  7498. "use strict";
  7499. function n(e, t, i) {
  7500. l.debug("konami has the modelInstance");
  7501. var n = [];
  7502. $(window).on("keydown", function(e) {
  7503. n.push(e.which),
  7504. n.length > o.secretPanelWord.length && n.shift(),
  7505. s.equalLists(n, o.secretPanelWord) && (l.debug("Developer mode active."),
  7506. o.debug = !0)
  7507. }),
  7508. $(window).on("keydown", function n(r) {
  7509. o.debug && 72 === r.which && (e && i ? (a.toggle(e, t, i),
  7510. $(window).off("keydown", n)) : console.warn("sorry we're not ready yet"))
  7511. })
  7512. }
  7513. var r = e("./../util/logger")
  7514. , o = e("./../settings")
  7515. , a = e("./debug")
  7516. , s = e("./../util/common")
  7517. , l = (e("./gui"),
  7518. new r(i));
  7519. o.console && $("body").append('<div id="debug-console"></div>'),
  7520. t.exports.init = n
  7521. }
  7522. ).call(this, "/js/gui/konami.js")
  7523. }
  7524. , {
  7525. "./../settings": 166,
  7526. "./../util/common": 185,
  7527. "./../util/logger": 189,
  7528. "./debug": 63,
  7529. "./gui": 65
  7530. }],
  7531. 71: [function(e, t, i) {
  7532. "use strict";
  7533. function n(e, t) {
  7534. E = t.mode === p.PANORAMA && t.pano && !t.pano.isAligned() ? p.OUTDOOR : t.mode
  7535. }
  7536. function r(e) {
  7537. var t = $.Deferred();
  7538. e || t.resolve();
  7539. var i = c.startupFlyinDelay;
  7540. return e === p.PANORAMA && (i += c.dollhouse.transitionTime),
  7541. setTimeout(t.resolve.bind(t), i),
  7542. t
  7543. }
  7544. function o(e, t, i) {
  7545. var n = 0;
  7546. c.quickstart.enabled && (a(i),
  7547. n = c.quickstart.showTextDelay + c.quickstart.fadeOutDelay);
  7548. var r = function() {
  7549. e.once(g.Move, l),
  7550. t.once(f.TourStart, l)
  7551. };
  7552. s(n, r)
  7553. }
  7554. function a(e) {
  7555. return e && (y.addClass("quick-brand"),
  7556. v.before(y),
  7557. A = $(".quick-brand").toArray()),
  7558. m.addClass("fadeOut"),
  7559. setTimeout(function() {
  7560. A.forEach(function(e) {
  7561. e.classList.add("fadeIn")
  7562. })
  7563. }, c.quickstart.showTextDelay),
  7564. setTimeout(function() {
  7565. A.forEach(function(e) {
  7566. e.classList.add("fadeOut")
  7567. })
  7568. }, c.quickstart.fadeOutDelay),
  7569. !0
  7570. }
  7571. function s(e, t) {
  7572. setTimeout(function() {
  7573. if (h.isHelpEnabled()) {
  7574. if (t(),
  7575. u.init(),
  7576. C.addClass("fadeIn landing " + u.deviceType),
  7577. h.isSmallHelpEnabled())
  7578. return void C.addClass("small");
  7579. u.fill(I, d.LANDING[E]),
  7580. C.addClass(E)
  7581. }
  7582. }, e)
  7583. //csz 用户引导界面
  7584. var helpData = {
  7585. "pc":["images/pc_step1.png","images/pc_step2.png","images/pc_step3.png"],
  7586. "mobile":["images/phone_step1.png","images/phone_step2.png","images/phone_step3.png"]
  7587. }
  7588. var navIcon = $(".nav-icon .icon");
  7589. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)) navIcon.attr("src",helpData.mobile[0]);
  7590. function paging(id){
  7591. id.on("click",function(){
  7592. var navPage = null;
  7593. $(this).attr("data-id") == "plus" ? navPage = +navIcon.attr("data-page")+1 : navPage = +navIcon.attr("data-page")-1;
  7594. if(navPage > helpData.length || navPage < 1) return false
  7595. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  7596. navIcon.attr({"data-page":navPage,"src":helpData.mobile[navPage - 1]});
  7597. }else{
  7598. navIcon.attr({"data-page":navPage,"src":helpData.pc[navPage - 1]});
  7599. }
  7600. })
  7601. };
  7602. paging($(".next-button"));
  7603. paging($(".prev-button"));
  7604. }
  7605. function l() {
  7606. u.clear(I, d.LANDING[E]),
  7607. C.removeClass("fadeIn")
  7608. }
  7609. var c = e("../settings")
  7610. , h = (e("./help/help"),
  7611. e("./helpManager"))
  7612. , u = e("./populateModal")
  7613. , d = e("../enum/HelpModalType")
  7614. , p = e("../enum/Viewmode")
  7615. , f = e("../enum/DirectorEvents")
  7616. , g = e("../enum/PlayerEvents")
  7617. , m = $("#quick-blackout").eq(0)
  7618. , v = $("#quick-logo").eq(0)
  7619. , A = $(".quick-brand").toArray()
  7620. , y = $("#loaderCoBrand").eq(0)
  7621. , C = $("#interaction-modal").eq(0)
  7622. , I = C.find(".interaction").toArray()
  7623. , E = ($("#model-title, .pinBottom-container, #drawer-container, #drawer, .footer").toArray(),
  7624. "");
  7625. t.exports.delayLanding = r,
  7626. t.exports.showMessage = o,
  7627. t.exports.init = n,
  7628. t.exports.dismissModal = l
  7629. }
  7630. , {
  7631. "../enum/DirectorEvents": 23,
  7632. "../enum/HelpModalType": 28,
  7633. "../enum/PlayerEvents": 40,
  7634. "../enum/Viewmode": 51,
  7635. "../settings": 166,
  7636. "./help/help": 67,
  7637. "./helpManager": 68,
  7638. "./populateModal": 75
  7639. }],
  7640. 72: [function(e, t, i) {
  7641. "use strict";
  7642. var n = e("./circleLoader").circleLoader;
  7643. t.exports = {
  7644. element: $("#gui-loading"),
  7645. hide: function(e) {
  7646. n.done(),
  7647. this.element.fadeOut(2500, e)
  7648. },
  7649. show: function(e) {
  7650. this.element.fadeIn(500, function() {
  7651. this.element.css("display", "table"),
  7652. e && e()
  7653. }
  7654. .bind(this))
  7655. },
  7656. progress: function(e) {
  7657. n.set(e)
  7658. }
  7659. }
  7660. }
  7661. , {
  7662. "./circleLoader": 60
  7663. }],
  7664. 73: [function(e, t, i) {
  7665. "use strict";
  7666. var n = e("../settings")
  7667. , r = $("#memory-info")
  7668. , o = r.find("#memory-gpu")
  7669. , a = !1;
  7670. t.exports = {
  7671. show: function() {
  7672. n.profiling.enabled && (r.show(),
  7673. a = !0)
  7674. },
  7675. hide: function() {
  7676. r.hide(),
  7677. a = !1
  7678. },
  7679. toggle: function() {
  7680. a ? this.hide() : this.show()
  7681. },
  7682. update: function(e) {
  7683. n.profiling.enabled && o.text(Math.floor(e / 1e6) + "MB")
  7684. }
  7685. }
  7686. }
  7687. , {
  7688. "../settings": 166
  7689. }],
  7690. 74: [function(e, t, i) {
  7691. "use strict";
  7692. var n = e("../util/browser")
  7693. , r = e("../analytics");
  7694. e("../settings");
  7695. t.exports = {
  7696. show: function(e, t) {
  7697. $("#gui-message").fadeIn(250, function() {
  7698. $(this).css("display", "table");
  7699. var e = $("#gui-message").fracs().visible >= .5;
  7700. r.impression({
  7701. visible: e,
  7702. immediate: !0
  7703. })
  7704. }),
  7705. e && $("#quick-blackout").addClass("fadeOut"),
  7706. $("#button-play").on("click", function(i) {
  7707. return n.inIframe() && n.isMobile() ? n.valueFromHash("nt", !1) ? window.open(self.location.href, "_blank") : void (top.location.href = self.location.href) : e ? (i.stopPropagation(),
  7708. $("#quick-blackout").removeClass("fadeOut"),
  7709. $("#gui-message").hide(),
  7710. void t()) : void $("#gui-message").fadeOut(500, function() {
  7711. t()
  7712. })
  7713. })
  7714. }
  7715. }
  7716. }
  7717. , {
  7718. "../analytics": 4,
  7719. "../settings": 166,
  7720. "../util/browser": 182
  7721. }],
  7722. 75: [function(e, t, i) {
  7723. "use strict";
  7724. function n(e, t, i, n) {
  7725. function r(e) {
  7726. return e.classList.contains(a)
  7727. }
  7728. var o = i ? this.assets[t][i][this.deviceType] : this.assets[t][this.deviceType];
  7729. //for (var a in o) {
  7730. //var s = e.find(r);
  7731. //for (var l in o[a]) {
  7732. //var c = o[a][l];
  7733. //if ("top-info" === l || "bottom-info" === l) {
  7734. //var h = n ? c : "";
  7735. //czj 注释掉第一次打开的用户引导
  7736. //s.querySelector("." + l).textContent = h
  7737. //} else {
  7738. //var u = n ? c : "";
  7739. //, d = s.querySelector("." + l);
  7740. //d.src = u,
  7741. //n ? d.classList.remove("hidden") : d.classList.add("hidden")
  7742. //}
  7743. //}
  7744. //}
  7745. //var p = Array.prototype.slice.call(e[0].parentElement.querySelectorAll("hr"));
  7746. // p.forEach(function(e) {
  7747. // n ? e.classList.remove("hidden") : e.classList.add("hidden")
  7748. // })
  7749. }
  7750. var r = e("../util/browser")
  7751. , o = e("../localization/localize")
  7752. , a = e("../enum/HelpModalType")
  7753. , s = (e("../enum/HelpModalSize"),
  7754. e("../enum/Viewmode"));
  7755. t.exports = {
  7756. init: function() {
  7757. if (!this.hasInitialized) {
  7758. this.hasInitialized = !0,
  7759. this.deviceType = r.isMobile() ? "mobile" : "desktop",
  7760. this.assets = {},
  7761. this.assets[a.LANDING[s.PANORAMA]] = {
  7762. desktop: {
  7763. left: {
  7764. "top-info": o.ROTATE,
  7765. "big-image": "images/nav_help_mouse_drag_left.png",
  7766. keyboard: "images/nav_help_keyboard_left_right.png"
  7767. },
  7768. middle: {
  7769. "top-info": o.MOVE,
  7770. "big-image": "images/nav_help_mouse_click.png",
  7771. keyboard: "images/nav_help_keyboard_up_down.png"
  7772. },
  7773. right: {
  7774. "top-info": o.ZOOM,
  7775. "big-image": "images/nav_help_mouse_zoom.png",
  7776. keyboard: "images/nav_help_zoom_keys.png"
  7777. }
  7778. },
  7779. mobile: {
  7780. left: {
  7781. "top-info": o.ROTATE,
  7782. "big-image": "images/nav_help_gesture_drag.png"
  7783. },
  7784. middle: {
  7785. "top-info": o.MOVE,
  7786. "big-image": "images/nav_help_gesture_tap.png"
  7787. },
  7788. right: {
  7789. "top-info": o.ZOOM,
  7790. "big-image": "images/nav_help_gesture_pinch.png"
  7791. }
  7792. }
  7793. },
  7794. this.assets[a.LANDING[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.LANDING[s.PANORAMA]])),
  7795. this.assets[a.LANDING[s.DOLLHOUSE]] = {
  7796. desktop: {
  7797. left: {
  7798. "top-info": o.ROTATE,
  7799. "big-image": "images/nav_help_mouse_drag_left.png",
  7800. keyboard: "images/nav_help_keyboard_left_right.png"
  7801. },
  7802. middle: {
  7803. "top-info": o.MOVE,
  7804. "big-image": "images/nav_help_mouse_position_right.png"
  7805. }
  7806. },
  7807. mobile: {
  7808. left: {
  7809. "top-info": o.ROTATE,
  7810. "big-image": "images/nav_help_gesture_drag.png"
  7811. },
  7812. middle: {
  7813. "top-info": o.MOVE,
  7814. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7815. }
  7816. }
  7817. },
  7818. this.assets[a.LANDING[s.FLOORPLAN]] = {
  7819. desktop: {
  7820. left: {
  7821. "top-info": o.MOVE,
  7822. "big-image": "images/nav_help_mouse_position_left.png"
  7823. },
  7824. middle: {
  7825. "top-info": o.ROTATE,
  7826. "big-image": "images/nav_help_mouse_drag_right.png",
  7827. keyboard: "images/nav_help_keyboard_left_right.png"
  7828. }
  7829. },
  7830. mobile: {
  7831. left: {
  7832. "top-info": o.MOVE,
  7833. "big-image": "images/nav_help_gesture_position.png"
  7834. },
  7835. middle: {
  7836. "top-info": o.ROTATE,
  7837. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7838. }
  7839. }
  7840. };
  7841. var e = {
  7842. "top-info": o.INSIDE,
  7843. "big-image": "images/nav_help_click_inside.png",
  7844. keyboard: "images/nav_help_inside_key.png"
  7845. };
  7846. this.assets[a.LANDING[s.OUTDOOR]].desktop.middle = e,
  7847. this.assets[a.LANDING[s.DOLLHOUSE]].desktop.right = e,
  7848. this.assets[a.LANDING[s.FLOORPLAN]].desktop.right = e;
  7849. var t = {
  7850. "top-info": o.INSIDE,
  7851. "big-image": "images/nav_help_tap_inside.png"
  7852. };
  7853. this.assets[a.LANDING[s.OUTDOOR]].mobile.middle = t,
  7854. this.assets[a.LANDING[s.DOLLHOUSE]].mobile.right = t,
  7855. this.assets[a.LANDING[s.FLOORPLAN]].mobile.right = t,
  7856. this.assets[a.NAVIGATION] = {},
  7857. this.assets[a.NAVIGATION][s.PANORAMA] = {
  7858. desktop: {
  7859. left: {
  7860. "top-info": o.HELP_DESKTOP_PANORAMA_1A,
  7861. "bottom-info": o.HELP_DESKTOP_PANORAMA_1B,
  7862. "big-image": "images/nav_help_mouse_drag_left.png",
  7863. keyboard: "images/nav_help_keyboard_left_right.png"
  7864. },
  7865. middle: {
  7866. "top-info": o.HELP_DESKTOP_PANORAMA_2A,
  7867. "bottom-info": o.HELP_DESKTOP_PANORAMA_2B,
  7868. "big-image": "images/nav_help_mouse_click.png",
  7869. keyboard: "images/nav_help_keyboard_up_down.png"
  7870. },
  7871. right: {
  7872. "top-info": o.HELP_DESKTOP_PANORAMA_3A,
  7873. "bottom-info": o.HELP_DESKTOP_PANORAMA_3B,
  7874. "big-image": "images/nav_help_mouse_zoom.png",
  7875. keyboard: "images/nav_help_zoom_keys.png"
  7876. }
  7877. },
  7878. mobile: {
  7879. left: {
  7880. "top-info": o.HELP_MOBILE_PANORAMA_1,
  7881. "big-image": "images/nav_help_gesture_drag.png"
  7882. },
  7883. middle: {
  7884. "top-info": o.HELP_MOBILE_PANORAMA_2,
  7885. "big-image": "images/nav_help_gesture_tap.png"
  7886. },
  7887. right: {
  7888. "top-info": o.HELP_MOBILE_3,
  7889. "big-image": "images/nav_help_gesture_pinch.png"
  7890. }
  7891. }
  7892. },
  7893. this.assets[a.NAVIGATION][s.DOLLHOUSE] = {
  7894. desktop: {
  7895. left: {
  7896. "top-info": o.HELP_DESKTOP_DOLLHOUSE_1A,
  7897. "bottom-info": o.HELP_DESKTOP_DOLLHOUSE_1B,
  7898. "big-image": "images/nav_help_mouse_drag_left.png",
  7899. keyboard: "images/nav_help_keyboard_all.png"
  7900. },
  7901. middle: {
  7902. "top-info": o.HELP_DESKTOP_DOLLHOUSE_2A,
  7903. "big-image": "images/nav_help_mouse_position_right.png"
  7904. },
  7905. right: {
  7906. "top-info": o.HELP_DESKTOP_DOLLHOUSE_3A,
  7907. "big-image": "images/nav_help_mouse_zoom.png"
  7908. }
  7909. },
  7910. mobile: {
  7911. left: {
  7912. "top-info": o.HELP_MOBILE_DOLLHOUSE_1,
  7913. "big-image": "images/nav_help_gesture_drag.png"
  7914. },
  7915. middle: {
  7916. "top-info": o.HELP_MOBILE_DOLLHOUSE_2,
  7917. "big-image": "images/nav_help_gesture_position_two_finger.png"
  7918. },
  7919. right: {
  7920. "top-info": o.HELP_MOBILE_3,
  7921. "big-image": "images/nav_help_gesture_pinch.png"
  7922. }
  7923. }
  7924. },
  7925. this.assets[a.NAVIGATION][s.FLOORPLAN] = {
  7926. desktop: {
  7927. left: {
  7928. "top-info": o.HELP_DESKTOP_FLOORPLAN_1A,
  7929. "big-image": "images/nav_help_mouse_position_left.png"
  7930. },
  7931. middle: {
  7932. "top-info": o.HELP_DESKTOP_FLOORPLAN_2A,
  7933. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_2B,
  7934. "big-image": "images/nav_help_mouse_drag_right.png",
  7935. keyboard: "images/nav_help_keyboard_left_right.png"
  7936. },
  7937. right: {
  7938. "top-info": o.HELP_DESKTOP_FLOORPLAN_3A,
  7939. "bottom-info": o.HELP_DESKTOP_FLOORPLAN_3B,
  7940. "big-image": "images/nav_help_mouse_zoom.png",
  7941. keyboard: "images/nav_help_keyboard_up_down.png"
  7942. }
  7943. },
  7944. mobile: {
  7945. left: {
  7946. "top-info": o.HELP_MOBILE_FLOORPLAN_1,
  7947. "big-image": "images/nav_help_gesture_position.png"
  7948. },
  7949. middle: {
  7950. "top-info": o.HELP_MOBILE_FLOORPLAN_2,
  7951. "big-image": "images/nav_help_gesture_drag_two_finger.png"
  7952. },
  7953. right: {
  7954. "top-info": o.HELP_MOBILE_3,
  7955. "big-image": "images/nav_help_gesture_pinch.png"
  7956. }
  7957. }
  7958. },
  7959. this.assets[a.NAVIGATION][s.OUTDOOR] = JSON.parse(JSON.stringify(this.assets[a.NAVIGATION][s.PANORAMA])),
  7960. this.assets[a.NAVIGATION][s.OUTDOOR].desktop.middle = {
  7961. "top-info": o.HELP_DESKTOP_360_2A,
  7962. "bottom-info": o.HELP_DESKTOP_360_2B,
  7963. "big-image": "images/nav_help_click_inside.png",
  7964. keyboard: "images/nav_help_inside_key.png"
  7965. },
  7966. this.assets[a.NAVIGATION][s.OUTDOOR].mobile.middle = {
  7967. "top-info": o.HELP_MOBILE_360_2,
  7968. "big-image": "images/nav_help_tap_inside.png"
  7969. },
  7970. this.assets[a.MORE_HELP] = {
  7971. desktop: {
  7972. "more-help-hlr": {
  7973. "top-info": o.HELP_MORE_HLR_A,
  7974. "big-image": "images/nav_help_expand.svg",
  7975. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  7976. },
  7977. "more-help-dollhouse": {
  7978. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  7979. "big-image": "images/nav_help_dollhouse.svg",
  7980. "bottom-info": o.HELP_DESKTOP_MORE_DOLLHOUSE_B
  7981. },
  7982. "more-help-floors": {
  7983. "top-info": o.HELP_MORE_FLOORS_A,
  7984. "big-image": "images/nav_help_floor picker.svg",
  7985. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  7986. },
  7987. "more-help-tag": {
  7988. "top-info": o.HELP_MORE_TAG_A,
  7989. "big-image": "images/nav_help_tag.svg",
  7990. "bottom-info": o.HELP_DESKTOP_MORE_TAG_B
  7991. },
  7992. "more-help-zoom": {
  7993. "top-info": o.HELP_MORE_ZOOM_A,
  7994. "big-image": "images/nav_help_zoom.svg",
  7995. "bottom-info": o.HELP_DESKTOP_MORE_ZOOM_B
  7996. },
  7997. "more-help-tour": {
  7998. "top-info": o.HELP_MORE_TOUR_A,
  7999. "big-image": "images/nav_help_play.png",
  8000. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8001. },
  8002. "more-help-inside": {
  8003. "top-info": o.HELP_MORE_INSIDE_A,
  8004. "big-image": "images/nav_help_inside.svg",
  8005. "bottom-info": o.HELP_DESKTOP_MORE_INSIDE_B
  8006. },
  8007. "more-help-vr": {
  8008. "top-info": o.HELP_MORE_VR_A,
  8009. "big-image": "images/nav_help_vr.svg",
  8010. "bottom-info": o.HELP_DESKTOP_MORE_VR_B
  8011. },
  8012. "more-help-360": {
  8013. "top-info": o.HELP_MORE_360_A,
  8014. "big-image": "images/nav_help_360.svg",
  8015. "bottom-info": o.HELP_DESKTOP_MORE_360_B
  8016. },
  8017. "more-help-fullscreen": {
  8018. "top-info": o.HELP_MORE_FULLSCREEN_A,
  8019. "big-image": "images/nav_help_fullscreen.svg",
  8020. "bottom-info": o.HELP_DESKTOP_MORE_FULLSCREEN_B
  8021. }
  8022. },
  8023. mobile: {
  8024. "more-help-hlr": {
  8025. "top-info": o.HELP_MORE_HLR_A,
  8026. "big-image": "images/nav_help_expand.svg",
  8027. "bottom-info": o.HELP_DESKTOP_MORE_HLR_B
  8028. },
  8029. "more-help-dollhouse": {
  8030. "top-info": o.HELP_MORE_DOLLHOUSE_A,
  8031. "big-image": "images/nav_help_dollhouse.svg",
  8032. "bottom-info": o.HELP_MOBILE_MORE_DOLLHOUSE_B
  8033. },
  8034. "more-help-floors": {
  8035. "top-info": o.HELP_MORE_FLOORS_A,
  8036. "big-image": "images/nav_help_floor picker.svg",
  8037. "bottom-info": o.HELP_DESKTOP_MORE_FLOORS_B
  8038. },
  8039. "more-help-tag": {
  8040. "top-info": o.HELP_MORE_TAG_A,
  8041. "big-image": "images/nav_help_tag.svg",
  8042. "bottom-info": o.HELP_MOBILE_MORE_TAG_B
  8043. },
  8044. "more-help-tour": {
  8045. "top-info": o.HELP_MORE_TOUR_A,
  8046. "big-image": "images/nav_help_play.png",
  8047. "bottom-info": o.HELP_DESKTOP_MORE_TOUR_B
  8048. },
  8049. "more-help-inside": {
  8050. "top-info": o.HELP_MORE_INSIDE_A,
  8051. "big-image": "images/nav_help_inside.svg",
  8052. "bottom-info": o.HELP_MOBILE_MORE_INSIDE_B
  8053. },
  8054. "more-help-vr": {
  8055. "top-info": o.HELP_MORE_VR_A,
  8056. "big-image": "images/webvr.svg",
  8057. "bottom-info": o.HELP_MOBILE_MORE_VR_B
  8058. },
  8059. "more-help-360": {
  8060. "top-info": o.HELP_MORE_360_A,
  8061. "big-image": "images/nav_help_360.svg",
  8062. "bottom-info": o.HELP_MOBILE_MORE_360_B
  8063. }
  8064. }
  8065. },
  8066. this.assets[a.TOUR_INTERACTION[s.PANORAMA]] = {
  8067. desktop: {
  8068. left: {
  8069. "top-info": o.ROTATE,
  8070. "big-image": "images/nav_help_mouse_drag_left.png",
  8071. keyboard: "images/nav_help_keyboard_left_right.png"
  8072. },
  8073. middle: {
  8074. "top-info": o.MOVE,
  8075. "big-image": "images/nav_help_mouse_click.png",
  8076. keyboard: "images/nav_help_keyboard_up_down.png"
  8077. },
  8078. right: {
  8079. "top-info": o.PLAY,
  8080. "big-image": "images/Desktop-help-play-button.svg",
  8081. keyboard: "images/Desktop-help-spacebar-2.svg"
  8082. }
  8083. },
  8084. mobile: {
  8085. left: {
  8086. "top-info": o.ROTATE,
  8087. "big-image": "images/nav_help_gesture_drag.png"
  8088. },
  8089. middle: {
  8090. "top-info": o.MOVE,
  8091. "big-image": "images/nav_help_gesture_tap.png"
  8092. },
  8093. right: {
  8094. "top-info": o.PLAY,
  8095. "big-image": "images/mobile-help-play-button.svg"
  8096. }
  8097. }
  8098. },
  8099. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.PANORAMA]])),
  8100. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].desktop.middle = this.assets[a.LANDING[s.OUTDOOR]].desktop.middle,
  8101. this.assets[a.TOUR_INTERACTION[s.OUTDOOR]].mobile.middle = this.assets[a.LANDING[s.OUTDOOR]].mobile.middle,
  8102. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]] = JSON.parse(JSON.stringify(this.assets[a.TOUR_INTERACTION[s.OUTDOOR]])),
  8103. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].desktop.left = this.assets[a.LANDING[s.FLOORPLAN]].desktop.left,
  8104. this.assets[a.TOUR_INTERACTION[s.FLOORPLAN]].mobile.left = this.assets[a.LANDING[s.FLOORPLAN]].mobile.left
  8105. }
  8106. },
  8107. fill: function(e, t, i) {
  8108. n.call(this, e, t, i, !0)
  8109. },
  8110. clear: function(e, t, i) {
  8111. n.call(this, e, t, i, !1)
  8112. }
  8113. }
  8114. }
  8115. , {
  8116. "../enum/HelpModalSize": 27,
  8117. "../enum/HelpModalType": 28,
  8118. "../enum/Viewmode": 51,
  8119. "../localization/localize": 108,
  8120. "../util/browser": 182
  8121. }],
  8122. 76: [function(e, t, i) {
  8123. "use strict";
  8124. t.exports = Object.freeze({
  8125. OPENED: "share.open",
  8126. CLOSED: "share.closed",
  8127. LINK_CLICKED: "share.linked"
  8128. })
  8129. }
  8130. , {}],
  8131. 77: [function(e, t, i) {
  8132. "use strict";
  8133. function n(e) {
  8134. function t(t, i) {
  8135. var n = window.screenY + ($("#player").height() - i) / 2
  8136. , r = window.screenX + ($("#player").width() - t) / 2
  8137. , o = "top=" + n + ",left=" + r + ",width=" + t + ",height=" + i;
  8138. I.emit(l.LINK_CLICKED, {
  8139. channel: e
  8140. }),
  8141. window.open(C[e], "shareWindow", o)
  8142. }
  8143. switch (e) {
  8144. case y.FACEBOOK:
  8145. t(580, 420);
  8146. break;
  8147. case y.TWITTER:
  8148. t(550, 440);
  8149. break;
  8150. case y.MAIL:
  8151. I.emit(l.LINK_CLICKED, {
  8152. channel: "email"
  8153. }),
  8154. window.open(C[e], "_blank");
  8155. break;
  8156. case y.LINKEDIN:
  8157. }
  8158. }
  8159. function r(e) {
  8160. I.emit(l.LINK_CLICKED, {
  8161. channel: "copylink"
  8162. });
  8163. var t = document.createRange();
  8164. t.selectNodeContents(v);
  8165. var i = window.getSelection();
  8166. i.removeAllRanges(),
  8167. i.addRange(t),
  8168. document.execCommand("copy"),
  8169. A.classList.remove("hidden"),
  8170. v.classList.add("highlighted")
  8171. }
  8172. function o(e) {
  8173. e && (e.stopPropagation(),
  8174. e.target === v) || (window.getSelection().removeAllRanges(),
  8175. v.classList.remove("highlighted"),
  8176. A.classList.add("hidden"))
  8177. }
  8178. var a = e("../../util/browser")
  8179. , s = e("../../localization/localize")
  8180. , l = e("./ShareEvents")
  8181. , c = e("../../util/common")
  8182. , h = e("events").EventEmitter
  8183. , u = document.getElementById("sharing")
  8184. , d = document.getElementById("share-modal")
  8185. , p = document.getElementById("share-close")
  8186. , f = document.getElementById("facebook-share")
  8187. , g = document.getElementById("twitter-share")
  8188. , m = document.getElementById("mail-share")
  8189. , v = document.getElementById("share-url-text")
  8190. , A = document.getElementById("copy-success")
  8191. , y = Object.freeze({
  8192. FACEBOOK: "facebook",
  8193. TWITTER: "twitter",
  8194. MAIL: "mail",
  8195. LINKEDIN: "linkedin"
  8196. })
  8197. , C = {};
  8198. C[y.FACEBOOK] = "http://www.facebook.com/sharer.php?u=" + encodeURIComponent(window.location.href + "&utm_source=1") + "&t=",
  8199. C[y.TWITTER] = "http://twitter.com/intent/tweet?text=",
  8200. C[y.MAIL] = "mailto:?subject=";
  8201. var I = {
  8202. init: function(e) {
  8203. var t = encodeURIComponent(s.SHARE_EXPLORE + e + " " + s.SHARE_AT + " ");
  8204. C[y.FACEBOOK] += t + encodeURIComponent(window.location.href + "&utm_source=1"),
  8205. C[y.TWITTER] += t + encodeURIComponent(window.location.href + "&utm_source=2 " + s.SHARE_WITH + " #port"),
  8206. C[y.MAIL] += encodeURIComponent(s.SHARE_EXPLORE + e + s.SHARE_3D) + "&body=" + t + encodeURIComponent(window.location.href + "&utm_source=3"),
  8207. u.addEventListener("click", this.toggle.bind(this)),
  8208. p.addEventListener("click", this.hide.bind(this)),
  8209. v.addEventListener("click", r),
  8210. d.addEventListener("click", o),
  8211. f.addEventListener("click", n.bind(this, y.FACEBOOK)),
  8212. g.addEventListener("click", n.bind(this, y.TWITTER)),
  8213. m.addEventListener("click", n.bind(this, y.MAIL)),
  8214. v.textContent = window.location.href + "&utm_source=4",
  8215. d.classList.add(a.isMobile() ? "mobile" : "desktop"),
  8216. u.classList.remove("hidden")
  8217. },
  8218. show: function() {
  8219. this.emit(l.OPENED),
  8220. d.classList.add("fadeIn")
  8221. },
  8222. hide: function() {
  8223. d.classList.contains("fadeIn") && (this.emit(l.CLOSED),
  8224. document.selection && document.selection.empty(),
  8225. window.getSelection().removeAllRanges(),
  8226. o(),
  8227. d.classList.remove("fadeIn"))
  8228. },
  8229. toggle: function() {
  8230. d.classList.contains("fadeIn") ? this.hide() : this.show()
  8231. }
  8232. };
  8233. c.extendObject(I, h.prototype),
  8234. t.exports = I
  8235. }
  8236. , {
  8237. "../../localization/localize": 108,
  8238. "../../util/browser": 182,
  8239. "../../util/common": 185,
  8240. "./ShareEvents": 76,
  8241. events: 202
  8242. }],
  8243. 78: [function(e, t, i) {
  8244. "use strict";
  8245. t.exports = Object.freeze({
  8246. OPENED: "terms.opened",
  8247. CLOSED: "terms.closed"
  8248. })
  8249. }
  8250. , {}],
  8251. 79: [function(e, t, i) {
  8252. "use strict";
  8253. var n = e("./TermsEvent")
  8254. , r = e("../../localization/localize")
  8255. , o = e("../../analytics")
  8256. , a = e("../../util/ajax")
  8257. , s = e("../../util/common")
  8258. , l = e("events").EventEmitter
  8259. , c = document.getElementById("terms-modal")
  8260. , h = {
  8261. init: function() {
  8262. $(".footer-terms").on("click", function(e) {
  8263. e.preventDefault(),
  8264. this.show()
  8265. }
  8266. .bind(this)),
  8267. $("#terms-modal .close").on("click", this.hide.bind(this))
  8268. },
  8269. show: function() {
  8270. this.emit(n.OPENED),
  8271. a.get("static/" + r.TERMS_TEXT_FILE).done(function(e) {
  8272. var t = $("#terms-text").html(e);
  8273. o.track("showcase_gui", {
  8274. gui_action: "click_terms_button",
  8275. interaction_source: "gui"
  8276. }),
  8277. t.find("a").attr("target", "_blank")
  8278. }).fail(function() {
  8279. $("#terms-text").html("<h1>" + r.TERMS_OF_USE + "</h1><p>" + r.TERMS_FAIL)
  8280. }),
  8281. c.classList.add("fadeIn")
  8282. },
  8283. hide: function(e) {
  8284. e && e.preventDefault(),
  8285. c.classList.contains("fadeIn") && this.emit(n.CLOSED),
  8286. c.classList.remove("fadeIn")
  8287. }
  8288. };
  8289. s.extendObject(h, l.prototype),
  8290. t.exports = h
  8291. }
  8292. , {
  8293. "../../analytics": 4,
  8294. "../../localization/localize": 108,
  8295. "../../util/ajax": 181,
  8296. "../../util/common": 185,
  8297. "./TermsEvent": 78,
  8298. events: 202
  8299. }],
  8300. 80: [function(e, t, i) {
  8301. "use strict";
  8302. t.exports = Object.freeze({
  8303. OPEN_INFO: "title.open.info",
  8304. CLOSE_INFO: "title.close.info",
  8305. SHOW_INFO: "title.show.info",
  8306. HIDE_INFO: "title.hide.info",
  8307. LINK_CLICKED: "title.link.click",
  8308. CONTACT_LINK_CLICKED: "title.contact.click",
  8309. ORIGIN_LINK_CLICKED: "title.origin.click"
  8310. })
  8311. }
  8312. , {}],
  8313. 81: [function(e, t, i) {
  8314. "use strict";
  8315. function n(e, t) {
  8316. o.tags.enabled && 0 !== Object.keys(e.tags).length && r(e, t)
  8317. }
  8318. function r(e, t) {
  8319. function i(i) {
  8320. e.shouldShowtags = "show" === this.value,
  8321. e.shouldShowtags ? t.showAlltags(o.tags.startup.fadeInDuration) : t.hideAlltags(o.tags.startup.fadeInDuration)
  8322. }
  8323. document.getElementById("tag-toggles").classList.remove("hidden"),
  8324. document.getElementById("radio-tag-show").checked = !0;
  8325. for (var n = document.getElementById("tag-inputs").querySelectorAll("input"), r = 0; r < n.length; r++)
  8326. n[r].addEventListener("change", i)
  8327. }
  8328. var o = e("../../settings");
  8329. t.exports.init = n
  8330. }
  8331. , {
  8332. "../../settings": 166
  8333. }],
  8334. 82: [function(e, t, i) {
  8335. (function(i) {
  8336. "use strict";
  8337. function n(e, t) {
  8338. return e && u.valueFromHash("title", 1) && 2 !== u.valueFromHash("mls", 0) ? (document.getElementsByClassName("titleText")[0].innerText = e,
  8339. e.length > g.minTooltipCharacters && I.parentElement.setAttribute("data-original-title", e),
  8340. t && 1 !== m.specialEdition && m.brand && !m.mls ? document.getElementById("cobrandTitle").innerText = t : (document.getElementsByClassName("co-brand")[0].classList.add("hidden"),
  8341. document.getElementById("gui-name").classList.add("noCoBrand"),
  8342. document.getElementById("cobrandTitle").classList.add("hidden")),
  8343. !0) : (document.getElementById("model-title").classList.add("hidden"),
  8344. !1)
  8345. }
  8346. function r(e) {
  8347. return e ? (L = !0,
  8348. void (_.innerText = e)) : void _.classList.add("hidden")
  8349. }
  8350. function o(e, t, i, n) {
  8351. if (!e && !t && !i || !m.brand || u.valueFromHash("mls", !1))
  8352. return void T.classList.add("hidden");
  8353. L = !0;
  8354. var r = []
  8355. , o = c(r, "<br>");
  8356. if (e && o('<span id="contactName">' + e + "</span>"),
  8357. t) {
  8358. var a = n || t
  8359. , s = u.isMobile() ? '<a id="phone" href="callto:' + t + '">' + a + "</a>" : "<span>" + a + "</span>";
  8360. o(s)
  8361. }
  8362. i && o('<a id="email" href="mailTo:' + i + '">' + i + "</a>"),
  8363. r[0] = "",
  8364. x.innerHTML = r.join("")
  8365. }
  8366. function a(e) {
  8367. if ("string" == typeof e)
  8368. try {
  8369. e = JSON.parse(e)
  8370. } catch (e) {
  8371. return y.warn("Unable to parse address data"),
  8372. void S.parentElement.classList.add("hidden")
  8373. }
  8374. if (!(e && (e.address_1 || e.address_2 || e.city || e.state || e.zip)))
  8375. return void S.parentElement.classList.add("hidden");
  8376. L = !0;
  8377. var t = []
  8378. , i = c(t, " ");
  8379. e.address_1 && i(e.address_1),
  8380. e.address_2 && i(e.address_2),
  8381. e.city && i(e.city, ", "),
  8382. e.state && i(e.state, ", "),
  8383. e.zip && i(e.zip, e.state ? " " : ", "),
  8384. t[0] = "",
  8385. S.innerText = t.join("")
  8386. }
  8387. function s(e) {
  8388. var t = document.createElement("a");
  8389. return t.id = "url",
  8390. t.target = "_blank",
  8391. t.href = e,
  8392. t.innerText = e,
  8393. t.addEventListener("click", N.emit.bind(N, v.ORIGIN_LINK_CLICKED)),
  8394. t
  8395. }
  8396. function l(e) {
  8397. return !(!e || u.inIframe() && document.referrer === e) && (R.classList.remove("hidden"),
  8398. P.innerHTML = f.WEBVR_LEARN_MORE + ": ",
  8399. P.appendChild(s(e)),
  8400. O.forEach(function(e) {
  8401. e.classList.add("share-link")
  8402. }),
  8403. !0)
  8404. }
  8405. function c(e, t) {
  8406. var i = e
  8407. , n = t;
  8408. return function(e, t) {
  8409. i.push(t || n, e)
  8410. }
  8411. }
  8412. function h() {
  8413. document.getElementById("title-toggle").addEventListener("click", N.toggleTitle.bind(N)),
  8414. L && I.addEventListener("click", N.toggleMeta.bind(N, !1));
  8415. var e = [].slice.call(_.querySelectorAll("a"));
  8416. e.forEach(function(e) {
  8417. e.addEventListener("click", N.emit.bind(N, v.LINK_CLICKED))
  8418. });
  8419. var t = [].slice.call(T.querySelectorAll("a"));
  8420. t.forEach(function(e) {
  8421. e.addEventListener("click", N.emit.bind(N, v.CONTACT_LINK_CLICKED, {
  8422. contact_type: e.getAttribute("id")
  8423. }))
  8424. })
  8425. }
  8426. var u = e("../../util/browser")
  8427. , d = e("../../util/common")
  8428. , p = e("../../util/logger")
  8429. , f = e("../../localization/localize")
  8430. , g = e("./titleBarSettings")
  8431. , m = e("../../settings")
  8432. , v = e("./TitleEvents")
  8433. , A = e("events").EventEmitter
  8434. , y = new p(i)
  8435. , C = document.querySelector(".pinTop.left")
  8436. , I = document.getElementsByClassName("title-container")[0]
  8437. , E = document.getElementById("title-toggle").querySelector("i")
  8438. , b = document.getElementById("meta-info-wrapper")
  8439. , w = document.getElementById("meta-info")
  8440. , _ = document.getElementById("meta-description")
  8441. , T = document.getElementsByClassName("contact-info")[0]
  8442. , x = document.getElementById("contact-data")
  8443. , S = document.getElementById("addressTxt")
  8444. , M = document.getElementById("tag-toggles")
  8445. , R = document.getElementById("share-origin")
  8446. , P = document.getElementById("share-link-wrapper")
  8447. , O = [w, b, I]
  8448. , L = !1
  8449. , D = !1
  8450. , N = {
  8451. populate: function(e) {
  8452. if (n(e.name, e.coBrand)) {
  8453. if (r(e.description),
  8454. o(e.contactName, e.phone, e.email, e.formatted_contact_phone),
  8455. a(e.address),
  8456. L) {
  8457. var t = document.createElement("br");
  8458. M.insertBefore(t, M.firstElementChild)
  8459. }
  8460. e.socialSharing && m.share.enabled && (D = l(e.url))
  8461. }
  8462. },
  8463. finishSetup: function(e) {
  8464. L = L || !!e,
  8465. h(),
  8466. L || (D ? I.classList.add("share-only") : I.classList.add("no-meta"))
  8467. },
  8468. toggleMeta: function(e, t) {
  8469. t && t.preventDefault();
  8470. var i = w.classList.contains("expand");
  8471. e && !i || (i ? (O.forEach(function(e) {
  8472. e.classList.remove("expand")
  8473. }),
  8474. this.emit(v.CLOSE_INFO)) : (O.forEach(function(e) {
  8475. e.classList.add("expand")
  8476. }),
  8477. this.emit(v.OPEN_INFO)))
  8478. },
  8479. setupToggling: function() {
  8480. b.style.height = w.offsetHeight + "px",
  8481. w.addEventListener("transitionend", function() {
  8482. b.style.height = w.offsetHeight + "px"
  8483. })
  8484. },
  8485. toggleTitle: function(e) {
  8486. e && e.preventDefault(),
  8487. C.classList.contains("closed") ? (C.classList.add("open"),
  8488. E.classList.remove("icon-dpad-right"),
  8489. E.classList.add("icon-dpad-left"),
  8490. this.emit(v.SHOW_INFO),
  8491. setTimeout(function() {
  8492. C.classList.remove("closed"),
  8493. C.classList.remove("open")
  8494. }, g.removeAnimationClasses)) : (C.classList.add("closed"),
  8495. E.classList.remove("icon-dpad-left"),
  8496. E.classList.add("icon-dpad-right"),
  8497. this.emit(v.HIDE_INFO))
  8498. }
  8499. };
  8500. d.extendObject(N, A.prototype),
  8501. t.exports = N
  8502. }
  8503. ).call(this, "/js/gui/title/titleBar.js")
  8504. }
  8505. , {
  8506. "../../localization/localize": 108,
  8507. "../../settings": 166,
  8508. "../../util/browser": 182,
  8509. "../../util/common": 185,
  8510. "../../util/logger": 189,
  8511. "./TitleEvents": 80,
  8512. "./titleBarSettings": 83,
  8513. events: 202
  8514. }],
  8515. 83: [function(e, t, i) {
  8516. "use strict";
  8517. t.exports = Object.freeze({
  8518. minTooltipCharacters: 19,
  8519. removeAnimationClasses: 500
  8520. })
  8521. }
  8522. , {}],
  8523. 84: [function(e, t, i) {
  8524. "use strict";
  8525. function n(e) {
  8526. C = e,
  8527. P.forEach(function(e) {
  8528. b.addEventListener(e, u.bind(this, !1), !0),
  8529. w.addEventListener(e, u.bind(this, !0), !0),
  8530. E.addEventListener(e, o, !0),
  8531. S.forEach(function(t) {
  8532. t.addEventListener(e, a, !0)
  8533. }),
  8534. $("#drawer img").on(e, a)
  8535. }),
  8536. document.addEventListener("keydown", u.bind(this, !1), !0),
  8537. C.on(v.TourStart, function() {
  8538. E.classList.add("playing")
  8539. })
  8540. }
  8541. function r() {
  8542. C.playTour(),
  8543. I && clearTimeout(I),
  8544. d(),
  8545. _.removeClass("fadeIn")
  8546. }
  8547. function o() {
  8548. E.classList.contains("playing") && (C.stopTour(),
  8549. _.addClass("fadeIn"),
  8550. setTimeout(function() {
  8551. _.removeClass("fadeIn")
  8552. }, p.tourInteraction.showPauseButton),
  8553. O || (clearTimeout(I),
  8554. I = setTimeout(h, p.tourInteraction.showModal)),
  8555. setTimeout(function() {
  8556. E.classList.remove("playing")
  8557. }, p.tourInteraction.allowNextClick))
  8558. }
  8559. function a() {
  8560. C.tourInProgress && (C.stopTour(),
  8561. C.endTourProgress(),
  8562. E.classList.remove("playing"))
  8563. }
  8564. function s() {
  8565. T.is(":visible") ? r() : o()
  8566. }
  8567. function l() {
  8568. x.hasClass("playing") && (clearTimeout(I),
  8569. C.atEndOfTour() ? c() : _.removeClass("fadeIn"))
  8570. }
  8571. function c() {
  8572. E.classList.remove("playing"),
  8573. h()
  8574. }
  8575. function h() {
  8576. if (!p.tourInteraction.disabled) {
  8577. M.removeClass("small landing " + g.FLOORPLAN + " " + g.OUTDOOR + " " + g.PANORAMA),
  8578. M.addClass("fadeIn tour " + m.deviceType);
  8579. var e = p.tourInteraction.smallModal ? y.SMALL : y.LARGE;
  8580. if (!p.tourInteraction.smallModal) {
  8581. var t;
  8582. 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,
  8583. m.fill(R, A.TOUR_INTERACTION[t]),
  8584. M.addClass(t)
  8585. }
  8586. M.addClass(e)
  8587. }
  8588. }
  8589. function u(e, t) {
  8590. if (t) {
  8591. var i = "keydown" === t.type
  8592. , n = t.which === f.SPACE || C.tourIsPlaying;
  8593. i && n || e || (O = !0),
  8594. C.atEndOfTour() && d(),
  8595. !C.tourIsPlaying && C.tourInProgress && (_.removeClass("fadeIn"),
  8596. d(),
  8597. t.which !== f.SPACE && a()),
  8598. i && n && s()
  8599. }
  8600. }
  8601. function d() {
  8602. M.removeClass("fadeIn")
  8603. }
  8604. var p = (e("../util/browser"),
  8605. e("../settings"))
  8606. , f = e("../enum/Keys")
  8607. , g = e("../enum/Viewmode")
  8608. , m = (e("./helpManager"),
  8609. e("./populateModal"))
  8610. , v = e("../enum/DirectorEvents")
  8611. , A = e("../enum/HelpModalType")
  8612. , y = e("../enum/HelpModalSize")
  8613. , C = null
  8614. , I = null
  8615. , E = document.getElementById("pause-overlay")
  8616. , b = document.getElementById("player")
  8617. , w = document.getElementById("gui")
  8618. , _ = $("#pause-icon").eq(0)
  8619. , T = $("#play").eq(0)
  8620. , x = $("#playHead").eq(0)
  8621. , S = $(".rightViewContainer, #previous, #next, #gui-modes-inside, #gui-modes-outside, #gui-modes-dollhouse, #gui-modes-floorplan").toArray()
  8622. , M = $("#interaction-modal").eq(0)
  8623. , R = $("#interaction-modal .interaction").toArray()
  8624. , P = ["touchstart", "mousedown", "pointerdown"]
  8625. , O = !1;
  8626. t.exports.init = n,
  8627. t.exports.play = r,
  8628. t.exports.pause = o,
  8629. t.exports.pauseWithoutCTA = a,
  8630. t.exports.togglePlay = s,
  8631. t.exports.stopTour = l,
  8632. t.exports.dismissModal = d
  8633. }
  8634. , {
  8635. "../enum/DirectorEvents": 23,
  8636. "../enum/HelpModalSize": 27,
  8637. "../enum/HelpModalType": 28,
  8638. "../enum/Keys": 30,
  8639. "../enum/Viewmode": 51,
  8640. "../settings": 166,
  8641. "../util/browser": 182,
  8642. "./helpManager": 68,
  8643. "./populateModal": 75
  8644. }],
  8645. 85: [function(e, t, i) {
  8646. "use strict";
  8647. t.exports = Object.freeze({
  8648. OPENED: "vr.modal.opened",
  8649. LAUNCH: "vr.modal.launch",
  8650. CLOSED: "vr.modal.closed",
  8651. NEXT: "vr.modal.next",
  8652. PREV: "vr.modal.prev",
  8653. STORE: "vr.modal.store",
  8654. falseICECHOSEN: "vr.modal.device"
  8655. })
  8656. }
  8657. , {}],
  8658. 86: [function(e, t, i) {
  8659. "use strict";
  8660. function n(e, t, i) {
  8661. function n(e, t, n, r) {
  8662. function o() {
  8663. return p + "&m=" + t + "&display=" + e
  8664. }
  8665. function s() {
  8666. var e = "&utm_medium=" + (a.inIframe() ? "embed" : "direct")
  8667. , t = "&utm_source=" + u
  8668. , n = "&utm_showcase_session_id=" + i;
  8669. return e + t + n
  8670. }
  8671. function l() {
  8672. return d + "&sids=" + t + "&lsid=" + t + "&ln=" + encodeURIComponent(n) + "&ld=" + encodeURIComponent(r) + "&display=" + e
  8673. }
  8674. return a.valueFromHash("vrcoll", !1) ? l() + s() : o() + s()
  8675. }
  8676. function r(e, t, i, r) {
  8677. var o = "https://api.branch.io/v1/url"
  8678. , a = n(e, t, i, r)
  8679. , s = {
  8680. responseType: "json",
  8681. data: {
  8682. branch_key: h.appConfig.branch_key,
  8683. data: {
  8684. m: t,
  8685. full_url: a,
  8686. $desktop_url: m,
  8687. $og_app_id: "331853976762864119",
  8688. $og_title: i,
  8689. $og_description: r,
  8690. $og_image_url: location.origin + "/api/v1/player/models/" + t + "/thumb",
  8691. $canonical_url: window.location.href
  8692. }
  8693. }
  8694. };
  8695. c.post(o, s).done(function(t) {
  8696. f[e] = t.url
  8697. }).fail(function(t) {
  8698. f[e] = t
  8699. }
  8700. .bind(this, a))
  8701. }
  8702. function o(e, t, i) {
  8703. for (var r in s) {
  8704. var o = s[r]
  8705. , a = n(o, e, t, i);
  8706. f[o] = a
  8707. }
  8708. }
  8709. var u = a.inIframe() ? encodeURIComponent(document.referrer) : encodeURIComponent(window.location.href)
  8710. , d = g + "/vr/dlist/?ret=" + u
  8711. , p = g + "/vr/show/?ret=" + u
  8712. , m = "https://support.port.com/hc/en-us/articles/224728887-What-do-I-need-for-Virtual-Reality";
  8713. switch (e) {
  8714. case l.IOS:
  8715. r(s.CardboardIOS, t.sid, t.name, t.summary);
  8716. break;
  8717. default:
  8718. o(t.sid, t.name, t.summary)
  8719. }
  8720. }
  8721. function r(e) {
  8722. var t = f[e];
  8723. window.open(t, "_blank")
  8724. }
  8725. function o(e) {
  8726. var t = u[e];
  8727. window.open(t, "_blank")
  8728. }
  8729. var a = e("../../util/browser")
  8730. , s = e("../../enum/VRApps")
  8731. , l = e("../../enum/VRPlatforms")
  8732. , c = e("../../util/ajax")
  8733. , h = e("../../settings")
  8734. , u = {};
  8735. u[s.CardboardAndroid] = "https://play.google.com/store/apps/details?id=com.port.mpvrcardboard&redirect_uri=",
  8736. u[s.CardboardIOS] = "https://itunes.apple.com/us/app/port-vr/id1168808473&redirect_uri=",
  8737. u[s.GearVR] = "https://www.oculus.com/experiences/gear-vr/811670972252145/?redirect_uri=";
  8738. for (var d in s) {
  8739. var p = s[d];
  8740. u[p] += encodeURIComponent(document.referrer + "&display=" + p)
  8741. }
  8742. var f = {}
  8743. , g = function() {
  8744. var e = window.location.host;
  8745. return e.indexOf(".port.com") === -1 && e.indexOf("localhost") === -1 && (e = "my.port.com"),
  8746. "https://" + e
  8747. }();
  8748. t.exports.init = n,
  8749. t.exports.launch = r,
  8750. t.exports.launchStore = o
  8751. }
  8752. , {
  8753. "../../enum/VRApps": 46,
  8754. "../../enum/VRPlatforms": 49,
  8755. "../../settings": 166,
  8756. "../../util/ajax": 181,
  8757. "../../util/browser": 182
  8758. }],
  8759. 87: [function(e, t, i) {
  8760. "use strict";
  8761. function n(e) {
  8762. var t;
  8763. switch (e) {
  8764. case m.IOS:
  8765. return t = p.iosVersion(),
  8766. t.major > 9 || 9 === t.major && t.minor >= 1;
  8767. case m.Android:
  8768. return t = p.androidVersion(),
  8769. t.major > 4 || 4 === t.major && t.minor > 4 || 4 === t.major && 4 === t.minor && t.patch >= 4
  8770. }
  8771. return !1
  8772. }
  8773. function r(e, t) {
  8774. function i(e) {
  8775. K.emit(A.STORE, {
  8776. type: e
  8777. }),
  8778. f.launchStore(e)
  8779. }
  8780. function r(e) {
  8781. switch (e !== _.pageCount && (a(e),
  8782. N.text(e + 1 + " / " + _.pageCount)),
  8783. e) {
  8784. case _.Title:
  8785. O.css("display", "none"),
  8786. L.text(u[e]),
  8787. o(s);
  8788. break;
  8789. case _.Cardboard:
  8790. O.css("display", "block"),
  8791. L.text(u[e]),
  8792. M.filter(".cardboard").off(),
  8793. M.filter(".gearvr").off(),
  8794. c(e, s),
  8795. h(H, X, Z);
  8796. break;
  8797. case _.Gear:
  8798. L.text(u[e]),
  8799. c(e, s),
  8800. T.addClass("lastPage"),
  8801. h(G, X, Z);
  8802. break;
  8803. case _.pageCount:
  8804. T.removeClass("fadeIn"),
  8805. K.emit(A.CLOSED)
  8806. }
  8807. B.filter("[src='']").hide()
  8808. }
  8809. var s = function() {
  8810. return p.detectAndroid() ? p.detectAndroidMobile() && n(m.Android) ? (T.addClass("supported"),
  8811. w = ".show-supported",
  8812. m.Android) : (T.addClass("unsupported"),
  8813. w = ".show-unsupported",
  8814. m.UnsupportedAndroid) : p.detectIPhone() || p.detectIPod() ? (T.addClass("ios"),
  8815. w = ".show-ios",
  8816. _ = v.ios,
  8817. m.IOS) : (T.addClass("desktop"),
  8818. w = ".show-desktop",
  8819. m.Desktop)
  8820. }();
  8821. f.init(s, e, t),
  8822. s !== m.Desktop && T.addClass("mobile");
  8823. var l = function(e) {
  8824. K.emit(A.LAUNCH, {
  8825. vr_platform: s,
  8826. vr_app: e
  8827. }),
  8828. f.launch(e)
  8829. };
  8830. q.cardboardAndroid = l.bind(this, g.CardboardAndroid),
  8831. q.gear = l.bind(this, g.GearVR),
  8832. q.cardboardIOS = l.bind(this, g.CardboardIOS),
  8833. d(),
  8834. $(".show-supported, .show-unsupported, .show-ios, .show-desktop").hide(),
  8835. $(w).show();
  8836. var u = [C.VR_LEARN_MORE_CAPS, C.VR_NEXT_CAPS, C.VR_GOT_IT_CAPS]
  8837. , y = ["vr_modal_learn_more", "vr_modal_next", "vr_modal_done"];
  8838. s === m.IOS && (u.splice(1, 1),
  8839. y.splice(1, 1)),
  8840. $("#vr").on("click", function(e) {
  8841. e.preventDefault(),
  8842. T.hasClass("fadeIn") ? K.dismiss() : (b = 0,
  8843. r(b),
  8844. T.addClass("fadeIn"),
  8845. K.emit(A.OPENED))
  8846. });
  8847. var I = "https://my.port.com/vr/show/?m=" + e.sid;
  8848. s === m.IOS ? $(".cardboardLink").on("click", i.bind(this, g.CardboardIOS)) : $(".cardboardLink").on("click", i.bind(this, g.CardboardAndroid)),
  8849. $(".gearLink").on("click", i.bind(this, g.GearVR)),
  8850. $("span.modelLink").text(I),
  8851. O.on("click", function(e) {
  8852. K.emit(A.PREV),
  8853. b--,
  8854. r(b)
  8855. }),
  8856. L.on("click", function(e) {
  8857. L.text();
  8858. K.emit(A.NEXT, {
  8859. nextAction: y[b]
  8860. }),
  8861. b++,
  8862. r(b)
  8863. }),
  8864. T.find(".close").on("click", K.dismiss)
  8865. }
  8866. function o(e) {
  8867. switch (e) {
  8868. case m.Android:
  8869. M.filter(".cardboard").off().on("click", q.cardboardAndroid),
  8870. M.filter(".gearvr").off().on("click", q.gear),
  8871. s(H, G, "logo-button", "same-line");
  8872. break;
  8873. case m.UnsupportedAndroid:
  8874. s("", z, "", "");
  8875. break;
  8876. case m.IOS:
  8877. M.filter(".cardboard").off().on("click", q.cardboardIOS),
  8878. s(H, "", "logo-button", "");
  8879. break;
  8880. case m.Desktop:
  8881. M.filter(".cardboard").off().on("click", l.bind(this, null, F, U)),
  8882. M.filter(".gearvr").off().on("click", l.bind(this, G, V, null)),
  8883. s(H, G, "logo-button", "same-line"),
  8884. Q.cardboard()
  8885. }
  8886. }
  8887. function a(e) {
  8888. $(".p1, .p2, .p3").hide(),
  8889. x.insertAfter(S),
  8890. T.removeClass("front-page"),
  8891. T.removeClass("details-page"),
  8892. T.removeClass("lastPage"),
  8893. M.removeClass("logo-button"),
  8894. M.removeClass("same-line"),
  8895. S.removeClass("headsetOptions"),
  8896. R.attr("src", ""),
  8897. R.filter(".second").removeClass("gear"),
  8898. R.css("display", "inline-block"),
  8899. R.off(),
  8900. P.filter(".second").css("display", ""),
  8901. D.css("display", "none"),
  8902. $(".p" + (e + 1) + w).show(),
  8903. R.filter(".third").insertBefore(P.filter(".third"))
  8904. }
  8905. function s(e, t, i, n) {
  8906. T.addClass("front-page"),
  8907. R.filter(".first").attr("src", e),
  8908. R.filter(".second").attr("src", t),
  8909. M.filter(".first").addClass(i),
  8910. M.filter(".second").addClass(i),
  8911. M.addClass(n),
  8912. ".show-desktop" === w && S.insertAfter(x)
  8913. }
  8914. function l(e, t, i) {
  8915. S.addClass("headsetOptions"),
  8916. M.off(),
  8917. R.filter(".second").attr("src", t),
  8918. D.css("display", "block"),
  8919. P.filter(".second").css("display", "none"),
  8920. D.on("click", function() {
  8921. a(_.Title),
  8922. o(m.Desktop)
  8923. }),
  8924. e && (K.emit(A.falseICECHOSEN, {
  8925. name: g.GearVR
  8926. }),
  8927. R.filter(".first").attr("src", e),
  8928. R.filter(".second").addClass("gear"),
  8929. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8930. Q.gearvr()),
  8931. i && (K.emit(A.falseICECHOSEN, {
  8932. name: g.Cardboard
  8933. }),
  8934. R.filter(".third").attr("src", i),
  8935. R.filter(".third").show(),
  8936. R.filter(".third").insertAfter(R.filter(".second")),
  8937. R.filter(".third").addClass("link"),
  8938. R.filter(".second").addClass("link"),
  8939. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8940. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid)),
  8941. Q.cardboard())
  8942. }
  8943. function c(e, t) {
  8944. switch (t) {
  8945. case m.IOS:
  8946. X = Y,
  8947. Z = j;
  8948. break;
  8949. case m.Desktop:
  8950. e === _.Cardboard ? (X = F,
  8951. Z = U,
  8952. R.filter(".second").on("click", f.launchStore.bind(this, g.CardboardIOS)),
  8953. R.filter(".third").on("click", f.launchStore.bind(this, g.CardboardAndroid))) : (X = V,
  8954. R.filter(".second").on("click", f.launchStore.bind(this, g.GearVR)),
  8955. Z = "");
  8956. break;
  8957. default:
  8958. e === _.Cardboard ? (X = z,
  8959. Z = j) : (X = k,
  8960. Z = W)
  8961. }
  8962. }
  8963. function h(e, t, i) {
  8964. T.find(".inner").addClass("details-page"),
  8965. T.addClass("details-page"),
  8966. R.filter(".first").attr("src", e),
  8967. R.filter(".second").attr("src", t),
  8968. R.filter(".third").attr("src", i)
  8969. }
  8970. function u() {
  8971. T.hasClass("fadeIn") && (T.removeClass("fadeIn"),
  8972. K.emit(A.CLOSED))
  8973. }
  8974. function d() {
  8975. var e = p.aspectRatio() > 1 && p.isMobile();
  8976. T.toggleClass("landscape", e).toggleClass("portrait", !e),
  8977. T.toggleClass("tiny", $("#player").height() <= y.narrowLandscapeHeight),
  8978. T.toggleClass("tinier", $("#player").height() <= y.reallyNarrowLandscapeHeight)
  8979. }
  8980. var p = e("../../util/browser")
  8981. , f = e("./vrLink")
  8982. , g = e("../../enum/VRApps")
  8983. , m = e("../../enum/VRPlatforms")
  8984. , v = e("../../enum/VRPages")
  8985. , A = e("./vrEvent")
  8986. , y = (e("../../settings"),
  8987. e("../../constants"))
  8988. , C = e("../../localization/localize")
  8989. , I = e("../../util/common")
  8990. , E = e("events").EventEmitter
  8991. , b = 0
  8992. , w = null
  8993. , _ = v.standard
  8994. , T = $(".vr-popup")
  8995. , x = T.find(".vr-popup-body")
  8996. , S = T.find(".vr-images")
  8997. , M = T.find(".img-container")
  8998. , R = T.find(".vr-sm-image")
  8999. , P = M.find(".vr-img-caption")
  9000. , O = $(".vr-buttons").find(".prev-button")
  9001. , L = $(".vr-buttons").find(".next-button")
  9002. , D = S.find(".front-close")
  9003. , N = $(".vr-page")
  9004. , B = T.find("img")
  9005. , F = "images/apple-store.png"
  9006. , V = "images/badge-oculus.png"
  9007. , U = "images/badge-cardboard.png"
  9008. , k = "images/logo-samsung.png"
  9009. , H = "images/headset-cardboard.png"
  9010. , G = "images/headset-gearvr.png"
  9011. , z = "images/ico-android-robot.png"
  9012. , W = "images/ico-gearvr.png"
  9013. , j = "images/ico-vr.png"
  9014. , Y = "images/apple-logo-white.svg"
  9015. , X = null
  9016. , Z = null
  9017. , q = {}
  9018. , K = {
  9019. init: r,
  9020. dismiss: u,
  9021. isDeviceSupported: n
  9022. };
  9023. I.extendObject(K, E.prototype),
  9024. $(window).resize(d);
  9025. var Q = function() {
  9026. var e = P.filter(".first").find(".cardboard")
  9027. , t = P.filter(".first").find(".gearvr");
  9028. return {
  9029. cardboard: function() {
  9030. t.addClass("hidden"),
  9031. e.removeClass("hidden")
  9032. },
  9033. gearvr: function() {
  9034. e.addClass("hidden"),
  9035. t.removeClass("hidden")
  9036. }
  9037. }
  9038. }();
  9039. t.exports = K
  9040. }
  9041. , {
  9042. "../../constants": 8,
  9043. "../../enum/VRApps": 46,
  9044. "../../enum/VRPages": 48,
  9045. "../../enum/VRPlatforms": 49,
  9046. "../../localization/localize": 108,
  9047. "../../settings": 166,
  9048. "../../util/browser": 182,
  9049. "../../util/common": 185,
  9050. "./vrEvent": 85,
  9051. "./vrLink": 86,
  9052. events: 202
  9053. }],
  9054. 88: [function(e, t, i) {
  9055. "use strict";
  9056. t.exports = Object.freeze({
  9057. OPENED: "webvr.modal.opened",
  9058. SHOW_TERMS: "webvr.footer.show.terms"
  9059. })
  9060. }
  9061. , {}],
  9062. 89: [function(e, t, i) {
  9063. (function(i) {
  9064. "use strict";
  9065. function n(e, t, i, n) {
  9066. function r(e) {
  9067. e.preventDefault(),
  9068. a(e.currentTarget.id)
  9069. }
  9070. function a(e) {
  9071. ne[e](),
  9072. Object.keys(ne).map(function(t, i) {
  9073. $("#" + t).toggleClass("tabs-underlined", t === e)
  9074. })
  9075. }
  9076. y = i,
  9077. v = t,
  9078. w.init(E.Android, e, n),
  9079. m();
  9080. var l = new RegExp("daydream","i")
  9081. , c = l.test(y.displayName);
  9082. c ? (a("tabdaydream"),
  9083. B.filter(".device-headset-side").attr("src", H),
  9084. D.find(".title").text(x.localizeText("WEBVR_FOR_DAYDREAM"))) : (a("tabcardboard"),
  9085. B.filter(".device-headset-side").attr("src", Y),
  9086. D.find(".title").text(x.localizeText("WEBVR_FOR_CARDBOARD"))),
  9087. $("#vr").on("click", function(e) {
  9088. e.preventDefault(),
  9089. g("click_webvr_button"),
  9090. L.is(":hidden") && (ie.emit(_.OPENED),
  9091. o())
  9092. }),
  9093. $(".webvr-popup .close").on("click", function(e) {
  9094. e.preventDefault(),
  9095. D.hasClass("hidden") ? (g("webvr_help_close"),
  9096. p()) : s()
  9097. }),
  9098. $("#tabcardboard").on("click", r),
  9099. $("#tabdaydream").on("click", r),
  9100. $("#tabnative").on("click", r),
  9101. $(".webvr-popup .open-with-app").on("click", function(e) {
  9102. e.preventDefault(),
  9103. g("webvr_learn_more"),
  9104. a("tabnative"),
  9105. p()
  9106. }),
  9107. $(".webvr-popup .help").on("click", function(e) {
  9108. e.preventDefault(),
  9109. g(D.hasClass("hidden") ? "webvr_help_close" : "webvr_help_show"),
  9110. p()
  9111. }),
  9112. $(".webvr-popup .terms").on("click", function(e) {
  9113. e.preventDefault(),
  9114. g("webvr_click_terms"),
  9115. s(),
  9116. ie.emit(_.SHOW_TERMS)
  9117. }),
  9118. F.on("click", function(e) {
  9119. e.preventDefault(),
  9120. g(ee),
  9121. window.open(J, "_blank")
  9122. }),
  9123. V.on("click", function(e) {
  9124. e.preventDefault(),
  9125. g("webvr_phone_link"),
  9126. window.open(te, "_blank")
  9127. }),
  9128. $(".webvr-popup .badge-cardboard").on("click", function(e) {
  9129. e.preventDefault(),
  9130. g("webvr_cardboard_link"),
  9131. w.launch(b.CardboardAndroid)
  9132. }),
  9133. $(".webvr-popup .badge-oculus").on("click", function(e) {
  9134. e.preventDefault(),
  9135. g("webvr_oculus_link"),
  9136. w.launch(b.GearVR)
  9137. })
  9138. }
  9139. function r() {
  9140. function e() {
  9141. y.isPresenting || (f(),
  9142. window.removeEventListener("vrdisplaypresentchange", e))
  9143. }
  9144. R.info("Headset mounted"),
  9145. v.suspend();
  9146. var t = document.createElement("canvas");
  9147. for (t.getContext("webgl"),
  9148. t.className = "webvr-canvas",
  9149. document.bgColor = "#000",
  9150. document.body.style.backgroundColor = "#000"; document.body.firstChild; )
  9151. document.body.removeChild(document.body.firstChild);
  9152. document.body.appendChild(t),
  9153. g("webvr_enter_app"),
  9154. y.requestPresent([{
  9155. source: t,
  9156. predistorted: !0
  9157. }]).catch(function(t) {
  9158. R.error("Failed to present: " + t),
  9159. g("webvr_exit_calibrate"),
  9160. e()
  9161. }),
  9162. A.then(function() {
  9163. window.dispatchEvent(new Event("vrapp-start"))
  9164. }),
  9165. window.addEventListener("vrdisplaypresentchange", e)
  9166. }
  9167. function o() {
  9168. O.fadeOut(I.guiAnimationSpeed),
  9169. L.fadeIn(I.guiAnimationSpeed),
  9170. a()
  9171. }
  9172. function a() {
  9173. if (!A) {
  9174. var e = C.valueFromHash("webvr") || I.appConfig.webvr_version
  9175. , t = "https://static.port.com/webvr/" + e + "/js/main.js";
  9176. A = new Promise(function(e, i) {
  9177. var n = document.createElement("script");
  9178. n.type = "text/javascript",
  9179. n.src = t,
  9180. n.onload = e,
  9181. document.head.appendChild(n)
  9182. }
  9183. )
  9184. }
  9185. D.find(".enter-button").on("click", r)
  9186. }
  9187. function s() {
  9188. g("webvr_modal_close"),
  9189. D.find(".enter-button").off("click", r),
  9190. L.fadeOut(I.guiAnimationSpeed, function() {
  9191. D.toggleClass("hidden", !1),
  9192. N.toggleClass("hidden", !0),
  9193. C.exitFullscreen()
  9194. }),
  9195. O.fadeIn(I.guiAnimationSpeed)
  9196. }
  9197. function l() {
  9198. k.toggleClass("hidden", !1),
  9199. U.toggleClass("hidden", !0)
  9200. }
  9201. function c() {
  9202. k.toggleClass("hidden", !0),
  9203. U.toggleClass("hidden", !1)
  9204. }
  9205. function h() {
  9206. B.filter(".device-headset").attr("src", G),
  9207. B.filter(".device-phone").attr("src", z),
  9208. J = Z,
  9209. ee = K,
  9210. F.text(x.localizeText("WEBVR_DAYDREAM_VIEW")),
  9211. V.text(x.localizeText("VR_NEED_DAYDREAM_PHONE")),
  9212. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !1),
  9213. c()
  9214. }
  9215. function u() {
  9216. B.filter(".badge-cardboard").attr("src", j),
  9217. B.filter(".badge-oculus").attr("src", X),
  9218. l()
  9219. }
  9220. function d() {
  9221. B.filter(".device-headset").attr("src", Y),
  9222. B.filter(".device-phone").attr("src", W),
  9223. J = q,
  9224. ee = Q,
  9225. F.text(x.localizeText("VR_GOOGLE_CARDBOARD")),
  9226. V.text(x.localizeText("VR_COMPATIBLE_ANDROID_LONG")),
  9227. $(".webvr-popup .detail.daydream-label").toggleClass("hidden", !0),
  9228. c()
  9229. }
  9230. function p() {
  9231. D.toggleClass("hidden"),
  9232. N.toggleClass("hidden")
  9233. }
  9234. function f() {
  9235. R.info("exiting webVR"),
  9236. g("webvr_exit_app"),
  9237. window.location.search.indexOf("&qs=1") === -1 ? window.location = window.location + "&qs=1" : window.location = window.location
  9238. }
  9239. function g(e) {
  9240. var t = C.isLandscape() ? "landscape" : "portrait";
  9241. T.trackAlways("showcase_gui", {
  9242. gui_action: e,
  9243. orientation: t
  9244. })
  9245. }
  9246. function m() {
  9247. var e = C.isLandscape();
  9248. L.toggleClass("landscape", e).toggleClass("portrait", !e)
  9249. }
  9250. var v, A, y, C = e("../../util/browser"), I = e("../../settings"), E = (e("./../gui"),
  9251. e("../../enum/VRPlatforms")), b = e("../../enum/VRApps"), w = e("./../vr/vrLink"), _ = e("./WebVrEvent"), T = e("../../analytics"), x = (e("../../constants"),
  9252. e("../../localization/localize")), S = e("../../util/common"), M = e("../../util/logger"), R = new M(i), P = e("events").EventEmitter, O = $("#gui"), L = $(".webvr-popup"), D = $(".webvr-popup .page.p1"), N = $(".webvr-popup .page.p2"), B = L.find(".image"), F = $(".webvr-popup .detail.headset"), V = $(".webvr-popup .detail.phone"), U = $(".webvr-popup .tab-content.webvr"), k = $(".webvr-popup .tab-content.native"), H = "images/device-daydream-side.png", G = "images/device-daydream.png", z = "images/device-pixel.png", W = "images/ico-android-robot.png", j = "images/badge-cardboard.png", Y = "images/headset-cardboard.png", X = "images/badge-oculus.png", Z = "https://madeby.google.com/vr/", q = "https://vr.google.com/cardboard/get-cardboard/", K = "webvr_daydream_link", Q = "webvr_cardboard_link", J = Z, ee = K, te = "https://vr.google.com/daydream/phones/", ie = {
  9253. init: n
  9254. }, ne = {
  9255. tabcardboard: d,
  9256. tabdaydream: h,
  9257. tabnative: u
  9258. };
  9259. S.extendObject(ie, P.prototype),
  9260. $(window).resize(m),
  9261. t.exports = ie
  9262. }
  9263. ).call(this, "/js/gui/webvr/webVRgui.js")
  9264. }
  9265. , {
  9266. "../../analytics": 4,
  9267. "../../constants": 8,
  9268. "../../enum/VRApps": 46,
  9269. "../../enum/VRPlatforms": 49,
  9270. "../../localization/localize": 108,
  9271. "../../settings": 166,
  9272. "../../util/browser": 182,
  9273. "../../util/common": 185,
  9274. "../../util/logger": 189,
  9275. "./../gui": 65,
  9276. "./../vr/vrLink": 86,
  9277. "./WebVrEvent": 88,
  9278. events: 202
  9279. }],
  9280. 90: [function(e, t, i) {
  9281. "use strict";
  9282. function n(e, t, i, n, o) {
  9283. n || 0 === n ? this.floorId = n : this.floorId = -1,
  9284. this.roomId = o || "",
  9285. this.labelId = e,
  9286. this.position = (new r.Vector3).copy(t),
  9287. this.text = i
  9288. }
  9289. var r = e("three")
  9290. , o = e("../util/browser");
  9291. n.prototype.build = function() {
  9292. var e = window.document.createElement("div");
  9293. o.isMobile() ? e.setAttribute("class", "gui-floorplan-label gui-floorplan-label-mobile") : e.setAttribute("class", "gui-floorplan-label");
  9294. var t = window.document.createElement("div");
  9295. t.setAttribute("class", "gui-floorplan-label-text");
  9296. var i = window.document.createTextNode(this.text);
  9297. t.appendChild(i),
  9298. e.appendChild(t),
  9299. window.document.body.appendChild(e),
  9300. this.labelGui = e,
  9301. this.textBlock = t,
  9302. $(this.labelGui).hide();
  9303. var n = window.getComputedStyle(this.labelGui);
  9304. this.initialTransform = n.transform || n.webkitTransform
  9305. }
  9306. ,
  9307. t.exports = n
  9308. }
  9309. , {
  9310. "../util/browser": 182,
  9311. three: 217
  9312. }],
  9313. 91: [function(e, t, i) {
  9314. "use strict";
  9315. function n() {
  9316. this.player = null,
  9317. this.modelManager = null,
  9318. this.container = null
  9319. }
  9320. var r = e("three")
  9321. , o = (e("../util/common"),
  9322. e("../enum/PlayerEvents"))
  9323. , a = (e("../enum/DirectorEvents"),
  9324. e("../enum/ModelManagerEvents"))
  9325. , s = e("../settings")
  9326. , l = e("../enum/Viewmode")
  9327. , c = (e("../enum/WarpStyle"),
  9328. e("../util/transitions"),
  9329. e("../util/lerp"),
  9330. e("../util/browser"));
  9331. n.prototype.init = function(e, t, i) {
  9332. this.player = e,
  9333. this.modelManager = t,
  9334. this.container = i,
  9335. this.updateModel(),
  9336. this.bindEvents()
  9337. }
  9338. ,
  9339. n.prototype.bindEvents = function() {
  9340. this.modelManager.on(a.ActiveModelChanged, this.updateModel.bind(this)),
  9341. this.player.on(o.ViewChanged, this.handlePlayerViewChanged.bind(this)),
  9342. this.player.on(o.ModeChanged, this.handlePlayerViewChanged.bind(this)),
  9343. this.player.on(o.StartInside, this.handleStartInside.bind(this)),
  9344. this.player.on(o.StartOutside, this.handleStartOutside.bind(this))
  9345. }
  9346. ,
  9347. n.prototype.updateModel = function() {
  9348. this.model = this.modelManager.getActiveModel()
  9349. }
  9350. ,
  9351. n.prototype.handlePlayerViewChanged = function() {
  9352. this.updateLabelVisibility(),
  9353. this.updateLabelDisplay()
  9354. }
  9355. ,
  9356. n.prototype.getLabelsForFloor = function(e, t) {
  9357. return t = t || [],
  9358. t.length = 0,
  9359. this.model.labels.forEach(function(i) {
  9360. this.labelVisibleForFloor(i, e) && t.push(i)
  9361. }
  9362. .bind(this)),
  9363. t
  9364. }
  9365. ,
  9366. n.prototype.getLabelsForCurrentFloor = function(e) {
  9367. return this.getLabelsForFloor(this.model.currentFloor.floorIndex, e)
  9368. }
  9369. ,
  9370. n.prototype.labelVisibleForFloor = function(e, t) {
  9371. var i = c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.mobile || !c.isMobile() && this.player.getLabelScaleFactor() < s.labels.zoomHideThreshhold.desktop;
  9372. if (!this.model.showingLabels || !e.labelGui || !i)
  9373. return !1;
  9374. var n = e.floorId === this.model.floors.size() - 1;
  9375. return this.model.allFloorsVisible ? n : e.floorId === t
  9376. }
  9377. ,
  9378. n.prototype.updateLabelVisibility = function(e) {
  9379. this.model.labels.forEach(function(e) {
  9380. this.supportedMode() && this.labelVisibleForFloor(e, this.model.currentFloor.floorIndex) ? this.showLabel(e, s.labels.fadeInDelay, s.labels.fadeInDuration) : this.hideLabel(e, s.labels.fadeOutDelay, s.labels.fadeOutDuration)
  9381. }
  9382. .bind(this))
  9383. }
  9384. ,
  9385. n.prototype.showAllLabels = function(e, t) {
  9386. this.model.labels.forEach(function(i) {
  9387. this.showLabel(i, e, t)
  9388. }
  9389. .bind(this))
  9390. }
  9391. ,
  9392. n.prototype.hideAllLabels = function(e, t) {
  9393. this.model.labels.forEach(function(i) {
  9394. this.hideLabel(i, e, t)
  9395. }
  9396. .bind(this))
  9397. }
  9398. ,
  9399. n.prototype.showLabel = function(e, t, i) {
  9400. this.model.showingLabels && (e.visible || (e.visible = !0,
  9401. e.labelGui.style.display = "block",
  9402. e.labelGui.style.opacity = 0,
  9403. $(e.labelGui).delay(t).fadeTo(i, 1)))
  9404. }
  9405. ,
  9406. n.prototype.hideLabel = function(e, t, i) {
  9407. e.visible && (e.visible = !1,
  9408. c.isMobile() ? $(e.labelGui).hide() : $(e.labelGui).delay(t).fadeOut(i))
  9409. }
  9410. ,
  9411. n.prototype.supportedMode = function() {
  9412. return this.player.mode === l.FLOORPLAN
  9413. }
  9414. ,
  9415. n.prototype.updateLabelDisplay = function() {
  9416. var e = (new r.Vector3,
  9417. new r.Vector3,
  9418. []);
  9419. return function() {
  9420. var t = this.player.getLabelScaleFactor()
  9421. , i = .6
  9422. , n = 1.2
  9423. , r = (1 - t) * n + i
  9424. , o = c.isMobile() ? s.labels.zoomTruncateThreshhold.mobile : s.labels.zoomTruncateThreshhold.desktop;
  9425. this.getLabelsForCurrentFloor(e);
  9426. for (var a = 0; a < e.length; a++) {
  9427. var l = e[a];
  9428. this.supportedMode() && l.labelGui && (this.updateProjectedGuiElement(l.labelGui, l.textBlock, l.position, r, r),
  9429. t >= o && l.text.length >= s.labels.minLengthForTruncate ? l.textBlock.innerText = l.text.substring(0, s.labels.truncateLength) + s.labels.truncateSuffix : l.textBlock.innerText = l.text)
  9430. }
  9431. }
  9432. }(),
  9433. n.prototype.updateProjectedGuiElement = function() {
  9434. var e = new r.Vector3;
  9435. new r.Vector3;
  9436. return function(t, i, n, r, o) {
  9437. i.style.fontSize = 100 * o + "%";
  9438. var a = $("#player").width()
  9439. , s = $("#player").height()
  9440. , l = .5 * a
  9441. , c = .5 * s;
  9442. e.copy(n),
  9443. e.project(this.player.camera);
  9444. var h = e.x * l + l
  9445. , u = -(e.y * c) + c;
  9446. h -= t.offsetWidth / 2,
  9447. u -= t.offsetHeight / 2,
  9448. t.style.left = h + "px",
  9449. t.style.top = u + "px"
  9450. }
  9451. }(),
  9452. n.prototype.handleStartInside = function(e) {
  9453. this.updateLabelVisibility()
  9454. }
  9455. ,
  9456. n.prototype.handleStartOutside = function() {
  9457. this.updateLabelVisibility()
  9458. }
  9459. ,
  9460. t.exports = n
  9461. }
  9462. , {
  9463. "../enum/DirectorEvents": 23,
  9464. "../enum/ModelManagerEvents": 33,
  9465. "../enum/PlayerEvents": 40,
  9466. "../enum/Viewmode": 51,
  9467. "../enum/WarpStyle": 52,
  9468. "../settings": 166,
  9469. "../util/browser": 182,
  9470. "../util/common": 185,
  9471. "../util/lerp": 188,
  9472. "../util/transitions": 195,
  9473. three: 217
  9474. }],
  9475. 92: [function(e, t, i) {
  9476. "use strict";
  9477. Array.prototype.findIndex || (Array.prototype.findIndex = function(e) {
  9478. if (null == this)
  9479. throw new TypeError("Array.prototype.findIndex called on null or undefined");
  9480. if ("function" != typeof e)
  9481. throw new TypeError("predicate must be a function");
  9482. for (var t, i = Object(this), n = i.length >>> 0, r = arguments[1], o = 0; o < n; o++)
  9483. if (t = i[o],
  9484. e.call(r, t, o, i))
  9485. return o;
  9486. return -1
  9487. }
  9488. ),
  9489. Array.prototype.find || Object.defineProperty(Array.prototype, "find", {
  9490. value: function(e) {
  9491. if (null == this)
  9492. throw new TypeError('"this" is null or not defined');
  9493. var t = Object(this)
  9494. , i = t.length >>> 0;
  9495. if ("function" != typeof e)
  9496. throw new TypeError("predicate must be a function");
  9497. for (var n = arguments[1], r = 0; r < i; ) {
  9498. var o = t[r];
  9499. if (e.call(n, o, r, t))
  9500. return o;
  9501. r++
  9502. }
  9503. }
  9504. })
  9505. }
  9506. , {}],
  9507. 93: [function(e, t, i) {
  9508. "use strict";
  9509. var n = n || {};
  9510. t.exports = n,
  9511. n.gui = n.gui || {},
  9512. n.utils = n.utils || {},
  9513. n.controllers = n.controllers || {},
  9514. n.dom = n.dom || {},
  9515. n.color = n.color || {},
  9516. n.utils.css = function() {
  9517. return {
  9518. load: function(e, t) {
  9519. t = t || document;
  9520. var i = t.createElement("link");
  9521. i.type = "text/css",
  9522. i.rel = "stylesheet",
  9523. i.href = e,
  9524. t.getElementsByTagName("head")[0].appendChild(i)
  9525. },
  9526. inject: function(e, t) {
  9527. t = t || document;
  9528. var i = document.createElement("style");
  9529. i.type = "text/css",
  9530. i.innerHTML = e,
  9531. t.getElementsByTagName("head")[0].appendChild(i)
  9532. }
  9533. }
  9534. }(),
  9535. n.utils.common = function() {
  9536. var e = Array.prototype.forEach
  9537. , t = Array.prototype.slice;
  9538. return {
  9539. BREAK: {},
  9540. extend: function(e) {
  9541. return this.each(t.call(arguments, 1), function(t) {
  9542. for (var i in t)
  9543. this.isUndefined(t[i]) || (e[i] = t[i])
  9544. }, this),
  9545. e
  9546. },
  9547. defaults: function(e) {
  9548. return this.each(t.call(arguments, 1), function(t) {
  9549. for (var i in t)
  9550. this.isUndefined(e[i]) && (e[i] = t[i])
  9551. }, this),
  9552. e
  9553. },
  9554. compose: function() {
  9555. var e = t.call(arguments);
  9556. return function() {
  9557. for (var i = t.call(arguments), n = e.length - 1; n >= 0; n--)
  9558. i = [e[n].apply(this, i)];
  9559. return i[0]
  9560. }
  9561. },
  9562. each: function(t, i, n) {
  9563. if (t)
  9564. if (e && t.forEach && t.forEach === e)
  9565. t.forEach(i, n);
  9566. else if (t.length === t.length + 0) {
  9567. for (var r = 0, o = t.length; r < o; r++)
  9568. if (r in t && i.call(n, t[r], r) === this.BREAK)
  9569. return
  9570. } else
  9571. for (var r in t)
  9572. if (i.call(n, t[r], r) === this.BREAK)
  9573. return
  9574. },
  9575. defer: function(e) {
  9576. setTimeout(e, 0)
  9577. },
  9578. toArray: function(e) {
  9579. return e.toArray ? e.toArray() : t.call(e)
  9580. },
  9581. isUndefined: function(e) {
  9582. return void 0 === e
  9583. },
  9584. isNull: function(e) {
  9585. return null === e
  9586. },
  9587. isNaN: function(e) {
  9588. return e !== e
  9589. },
  9590. isArray: Array.isArray || function(e) {
  9591. return e.constructor === Array
  9592. }
  9593. ,
  9594. isObject: function(e) {
  9595. return e === Object(e)
  9596. },
  9597. isNumber: function(e) {
  9598. return e === e + 0
  9599. },
  9600. isString: function(e) {
  9601. return e === e + ""
  9602. },
  9603. isBoolean: function(e) {
  9604. return e === !1 || e === !0
  9605. },
  9606. isFunction: function(e) {
  9607. return "[object Function]" === Object.prototype.toString.call(e)
  9608. }
  9609. }
  9610. }(),
  9611. n.controllers.Controller = function(e) {
  9612. var t = function(e, t) {
  9613. this.initialValue = e[t],
  9614. this.domElement = document.createElement("div"),
  9615. this.object = e,
  9616. this.property = t,
  9617. this.__onChange = void 0,
  9618. this.__onFinishChange = void 0
  9619. };
  9620. return e.extend(t.prototype, {
  9621. onChange: function(e) {
  9622. return this.__onChange = e,
  9623. this
  9624. },
  9625. onFinishChange: function(e) {
  9626. return this.__onFinishChange = e,
  9627. this
  9628. },
  9629. setValue: function(e) {
  9630. return this.object[this.property] = e,
  9631. this.__onChange && this.__onChange.call(this, e),
  9632. this.updateDisplay(),
  9633. this
  9634. },
  9635. getValue: function() {
  9636. return this.object[this.property]
  9637. },
  9638. updateDisplay: function() {
  9639. return this
  9640. },
  9641. isModified: function() {
  9642. return this.initialValue !== this.getValue()
  9643. }
  9644. }),
  9645. t
  9646. }(n.utils.common),
  9647. n.dom.dom = function(e) {
  9648. function t(t) {
  9649. if ("0" === t || e.isUndefined(t))
  9650. return 0;
  9651. var i = t.match(r);
  9652. return e.isNull(i) ? 0 : parseFloat(i[1])
  9653. }
  9654. var i = {
  9655. HTMLEvents: ["change"],
  9656. MouseEvents: ["click", "mousemove", "mousedown", "mouseup", "mouseover"],
  9657. KeyboardEvents: ["keydown"]
  9658. }
  9659. , n = {};
  9660. e.each(i, function(t, i) {
  9661. e.each(t, function(e) {
  9662. n[e] = i
  9663. })
  9664. });
  9665. var r = /(\d+(\.\d+)?)px/
  9666. , o = {
  9667. makeSelectable: function(e, t) {
  9668. void 0 !== e && void 0 !== e.style && (e.onselectstart = t ? function() {
  9669. return !1
  9670. }
  9671. : function() {}
  9672. ,
  9673. e.style.MozUserSelect = t ? "auto" : "none",
  9674. e.style.KhtmlUserSelect = t ? "auto" : "none",
  9675. e.unselectable = t ? "on" : "off")
  9676. },
  9677. makeFullscreen: function(t, i, n) {
  9678. e.isUndefined(i) && (i = !0),
  9679. e.isUndefined(n) && (n = !0),
  9680. t.style.position = "absolute",
  9681. i && (t.style.left = 0,
  9682. t.style.right = 0),
  9683. n && (t.style.top = 0,
  9684. t.style.bottom = 0)
  9685. },
  9686. fakeEvent: function(t, i, r, o) {
  9687. r = r || {};
  9688. var a = n[i];
  9689. if (!a)
  9690. throw new Error("Event type " + i + " not supported.");
  9691. var s = document.createEvent(a);
  9692. switch (a) {
  9693. case "MouseEvents":
  9694. var l = r.x || r.clientX || 0
  9695. , c = r.y || r.clientY || 0;
  9696. s.initMouseEvent(i, r.bubbles || !1, r.cancelable || !0, window, r.clickCount || 1, 0, 0, l, c, !1, !1, !1, !1, 0, null);
  9697. break;
  9698. case "KeyboardEvents":
  9699. var h = s.initKeyboardEvent || s.initKeyEvent;
  9700. e.defaults(r, {
  9701. cancelable: !0,
  9702. ctrlKey: !1,
  9703. altKey: !1,
  9704. shiftKey: !1,
  9705. metaKey: !1,
  9706. keyCode: void 0,
  9707. charCode: void 0
  9708. }),
  9709. h(i, r.bubbles || !1, r.cancelable, window, r.ctrlKey, r.altKey, r.shiftKey, r.metaKey, r.keyCode, r.charCode);
  9710. break;
  9711. default:
  9712. s.initEvent(i, r.bubbles || !1, r.cancelable || !0)
  9713. }
  9714. e.defaults(s, o),
  9715. t.dispatchEvent(s)
  9716. },
  9717. bind: function(e, t, i, n) {
  9718. return n = n || !1,
  9719. e.addEventListener ? e.addEventListener(t, i, n) : e.attachEvent && e.attachEvent("on" + t, i),
  9720. o
  9721. },
  9722. unbind: function(e, t, i, n) {
  9723. return n = n || !1,
  9724. e.removeEventListener ? e.removeEventListener(t, i, n) : e.detachEvent && e.detachEvent("on" + t, i),
  9725. o
  9726. },
  9727. addClass: function(e, t) {
  9728. if (void 0 === e.className)
  9729. e.className = t;
  9730. else if (e.className !== t) {
  9731. var i = e.className.split(/ +/);
  9732. i.indexOf(t) == -1 && (i.push(t),
  9733. e.className = i.join(" ").replace(/^\s+/, "").replace(/\s+$/, ""))
  9734. }
  9735. return o
  9736. },
  9737. removeClass: function(e, t) {
  9738. if (t)
  9739. if (void 0 === e.className)
  9740. ;
  9741. else if (e.className === t)
  9742. e.removeAttribute("class");
  9743. else {
  9744. var i = e.className.split(/ +/)
  9745. , n = i.indexOf(t);
  9746. n != -1 && (i.splice(n, 1),
  9747. e.className = i.join(" "))
  9748. }
  9749. else
  9750. e.className = void 0;
  9751. return o
  9752. },
  9753. hasClass: function(e, t) {
  9754. return new RegExp("(?:^|\\s+)" + t + "(?:\\s+|$)").test(e.className) || !1
  9755. },
  9756. getWidth: function(e) {
  9757. var i = getComputedStyle(e);
  9758. return t(i["border-left-width"]) + t(i["border-right-width"]) + t(i["padding-left"]) + t(i["padding-right"]) + t(i.width)
  9759. },
  9760. getHeight: function(e) {
  9761. var i = getComputedStyle(e);
  9762. return t(i["border-top-width"]) + t(i["border-bottom-width"]) + t(i["padding-top"]) + t(i["padding-bottom"]) + t(i.height)
  9763. },
  9764. getOffset: function(e) {
  9765. var t = {
  9766. left: 0,
  9767. top: 0
  9768. };
  9769. if (e.offsetParent)
  9770. do
  9771. t.left += e.offsetLeft,
  9772. t.top += e.offsetTop;
  9773. while (e = e.offsetParent);return t
  9774. },
  9775. isActive: function(e) {
  9776. return e === document.activeElement && (e.type || e.href)
  9777. }
  9778. };
  9779. return o
  9780. }(n.utils.common),
  9781. n.controllers.OptionController = function(e, t, i) {
  9782. var n = function(e, r, o) {
  9783. n.superclass.call(this, e, r);
  9784. var a = this;
  9785. if (this.__select = document.createElement("select"),
  9786. i.isArray(o)) {
  9787. var s = {};
  9788. i.each(o, function(e) {
  9789. s[e] = e
  9790. }),
  9791. o = s
  9792. }
  9793. i.each(o, function(e, t) {
  9794. var i = document.createElement("option");
  9795. i.innerHTML = t,
  9796. i.setAttribute("value", e),
  9797. a.__select.appendChild(i)
  9798. }),
  9799. this.updateDisplay(),
  9800. t.bind(this.__select, "change", function() {
  9801. var e = this.options[this.selectedIndex].value;
  9802. a.setValue(e)
  9803. }),
  9804. this.domElement.appendChild(this.__select)
  9805. };
  9806. return n.superclass = e,
  9807. i.extend(n.prototype, e.prototype, {
  9808. setValue: function(e) {
  9809. var t = n.superclass.prototype.setValue.call(this, e);
  9810. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9811. t
  9812. },
  9813. updateDisplay: function() {
  9814. return this.__select.value = this.getValue(),
  9815. n.superclass.prototype.updateDisplay.call(this)
  9816. }
  9817. }),
  9818. n
  9819. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9820. n.controllers.NumberController = function(e, t) {
  9821. function i(e) {
  9822. return e = e.toString(),
  9823. e.indexOf(".") > -1 ? e.length - e.indexOf(".") - 1 : 0
  9824. }
  9825. var n = function(e, r, o) {
  9826. n.superclass.call(this, e, r),
  9827. o = o || {},
  9828. this.__min = o.min,
  9829. this.__max = o.max,
  9830. this.__step = o.step,
  9831. t.isUndefined(this.__step) ? 0 == this.initialValue ? this.__impliedStep = 1 : this.__impliedStep = Math.pow(10, Math.floor(Math.log(this.initialValue) / Math.LN10)) / 10 : this.__impliedStep = this.__step,
  9832. this.__precision = i(this.__impliedStep)
  9833. };
  9834. return n.superclass = e,
  9835. t.extend(n.prototype, e.prototype, {
  9836. setValue: function(e) {
  9837. return void 0 !== this.__min && e < this.__min ? e = this.__min : void 0 !== this.__max && e > this.__max && (e = this.__max),
  9838. void 0 !== this.__step && e % this.__step != 0 && (e = Math.round(e / this.__step) * this.__step),
  9839. n.superclass.prototype.setValue.call(this, e)
  9840. },
  9841. min: function(e) {
  9842. return this.__min = e,
  9843. this
  9844. },
  9845. max: function(e) {
  9846. return this.__max = e,
  9847. this
  9848. },
  9849. step: function(e) {
  9850. return this.__step = e,
  9851. this.__impliedStep = e,
  9852. this.__precision = i(e),
  9853. this
  9854. }
  9855. }),
  9856. n
  9857. }(n.controllers.Controller, n.utils.common),
  9858. n.controllers.NumberControllerBox = function(e, t, i) {
  9859. function n(e, t) {
  9860. var i = Math.pow(10, t);
  9861. return Math.round(e * i) / i
  9862. }
  9863. var r = function(e, n, o) {
  9864. function a() {
  9865. var e = parseFloat(d.__input.value);
  9866. i.isNaN(e) || d.setValue(e)
  9867. }
  9868. function s() {
  9869. a(),
  9870. d.__onFinishChange && d.__onFinishChange.call(d, d.getValue())
  9871. }
  9872. function l(e) {
  9873. t.bind(window, "mousemove", c),
  9874. t.bind(window, "mouseup", h),
  9875. u = e.clientY
  9876. }
  9877. function c(e) {
  9878. var t = u - e.clientY;
  9879. d.setValue(d.getValue() + t * d.__impliedStep),
  9880. u = e.clientY
  9881. }
  9882. function h() {
  9883. t.unbind(window, "mousemove", c),
  9884. t.unbind(window, "mouseup", h)
  9885. }
  9886. this.__truncationSuspended = !1,
  9887. r.superclass.call(this, e, n, o);
  9888. var u, d = this;
  9889. this.__input = document.createElement("input"),
  9890. this.__input.setAttribute("type", "text"),
  9891. t.bind(this.__input, "change", a),
  9892. t.bind(this.__input, "blur", s),
  9893. t.bind(this.__input, "mousedown", l),
  9894. t.bind(this.__input, "keydown", function(e) {
  9895. 13 === e.keyCode && (d.__truncationSuspended = !0,
  9896. this.blur(),
  9897. d.__truncationSuspended = !1)
  9898. }),
  9899. this.updateDisplay(),
  9900. this.domElement.appendChild(this.__input)
  9901. };
  9902. return r.superclass = e,
  9903. i.extend(r.prototype, e.prototype, {
  9904. updateDisplay: function() {
  9905. return this.__input.value = this.__truncationSuspended ? this.getValue() : n(this.getValue(), this.__precision),
  9906. r.superclass.prototype.updateDisplay.call(this)
  9907. }
  9908. }),
  9909. r
  9910. }(n.controllers.NumberController, n.dom.dom, n.utils.common),
  9911. n.controllers.NumberControllerSlider = function(e, t, i, n, r) {
  9912. function o(e, t, i, n, r) {
  9913. return n + (r - n) * ((e - t) / (i - t))
  9914. }
  9915. var a = function(e, i, n, r, s) {
  9916. function l(e) {
  9917. t.bind(window, "mousemove", c),
  9918. t.bind(window, "mouseup", h),
  9919. c(e)
  9920. }
  9921. function c(e) {
  9922. e.preventDefault();
  9923. var i = t.getOffset(u.__background)
  9924. , n = t.getWidth(u.__background);
  9925. return u.setValue(o(e.clientX, i.left, i.left + n, u.__min, u.__max)),
  9926. !1
  9927. }
  9928. function h() {
  9929. t.unbind(window, "mousemove", c),
  9930. t.unbind(window, "mouseup", h),
  9931. u.__onFinishChange && u.__onFinishChange.call(u, u.getValue())
  9932. }
  9933. a.superclass.call(this, e, i, {
  9934. min: n,
  9935. max: r,
  9936. step: s
  9937. });
  9938. var u = this;
  9939. this.__background = document.createElement("div"),
  9940. this.__foreground = document.createElement("div"),
  9941. t.bind(this.__background, "mousedown", l),
  9942. t.addClass(this.__background, "slider"),
  9943. t.addClass(this.__foreground, "slider-fg"),
  9944. this.updateDisplay(),
  9945. this.__background.appendChild(this.__foreground),
  9946. this.domElement.appendChild(this.__background)
  9947. };
  9948. return a.superclass = e,
  9949. a.useDefaultStyles = function() {
  9950. i.inject(r)
  9951. }
  9952. ,
  9953. n.extend(a.prototype, e.prototype, {
  9954. updateDisplay: function() {
  9955. var e = (this.getValue() - this.__min) / (this.__max - this.__min);
  9956. return this.__foreground.style.width = 100 * e + "%",
  9957. a.superclass.prototype.updateDisplay.call(this)
  9958. }
  9959. }),
  9960. a
  9961. }(n.controllers.NumberController, n.dom.dom, n.utils.css, n.utils.common, "/**\n * dat-gui JavaScript Controller Library\n * http://code.google.com/p/dat-gui\n *\n * Copyright 2011 Data Arts Team, Google Creative Lab\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n */\n\n.slider {\n box-shadow: inset 0 2px 4px rgba(0,0,0,0.15);\n height: 1em;\n border-radius: 1em;\n background-color: #eee;\n padding: 0 0.5em;\n overflow: hidden;\n}\n\n.slider-fg {\n padding: 1px 0 2px 0;\n background-color: #aaa;\n height: 1em;\n margin-left: -0.5em;\n padding-right: 0.5em;\n border-radius: 1em 0 0 1em;\n}\n\n.slider-fg:after {\n display: inline-block;\n border-radius: 1em;\n background-color: #fff;\n border: 1px solid #aaa;\n content: '';\n float: right;\n margin-right: -1em;\n margin-top: -1px;\n height: 0.9em;\n width: 0.9em;\n}"),
  9962. n.controllers.FunctionController = function(e, t, i) {
  9963. var n = function(e, i, r) {
  9964. n.superclass.call(this, e, i);
  9965. var o = this;
  9966. this.__button = document.createElement("div"),
  9967. this.__button.innerHTML = void 0 === r ? "Fire" : r,
  9968. t.bind(this.__button, "click", function(e) {
  9969. return e.preventDefault(),
  9970. o.fire(),
  9971. !1
  9972. }),
  9973. t.addClass(this.__button, "button"),
  9974. this.domElement.appendChild(this.__button)
  9975. };
  9976. return n.superclass = e,
  9977. i.extend(n.prototype, e.prototype, {
  9978. fire: function() {
  9979. this.__onChange && this.__onChange.call(this),
  9980. this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  9981. this.getValue().call(this.object)
  9982. }
  9983. }),
  9984. n
  9985. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  9986. n.controllers.BooleanController = function(e, t, i) {
  9987. var n = function(e, i) {
  9988. function r() {
  9989. o.setValue(!o.__prev)
  9990. }
  9991. n.superclass.call(this, e, i);
  9992. var o = this;
  9993. this.__prev = this.getValue(),
  9994. this.__checkbox = document.createElement("input"),
  9995. this.__checkbox.setAttribute("type", "checkbox"),
  9996. t.bind(this.__checkbox, "change", r, !1),
  9997. this.domElement.appendChild(this.__checkbox),
  9998. this.updateDisplay()
  9999. };
  10000. return n.superclass = e,
  10001. i.extend(n.prototype, e.prototype, {
  10002. setValue: function(e) {
  10003. var t = n.superclass.prototype.setValue.call(this, e);
  10004. return this.__onFinishChange && this.__onFinishChange.call(this, this.getValue()),
  10005. this.__prev = this.getValue(),
  10006. t
  10007. },
  10008. updateDisplay: function() {
  10009. return this.getValue() === !0 ? (this.__checkbox.setAttribute("checked", "checked"),
  10010. this.__checkbox.checked = !0) : this.__checkbox.checked = !1,
  10011. n.superclass.prototype.updateDisplay.call(this)
  10012. }
  10013. }),
  10014. n
  10015. }(n.controllers.Controller, n.dom.dom, n.utils.common),
  10016. n.color.toString = function(e) {
  10017. return function(t) {
  10018. if (1 == t.a || e.isUndefined(t.a)) {
  10019. for (var i = t.hex.toString(16); i.length < 6; )
  10020. i = "0" + i;
  10021. return "#" + i
  10022. }
  10023. return "rgba(" + Math.round(t.r) + "," + Math.round(t.g) + "," + Math.round(t.b) + "," + t.a + ")"
  10024. }
  10025. }(n.utils.common),
  10026. n.color.interpret = function(e, t) {
  10027. var i, n, r = function() {
  10028. n = !1;
  10029. var e = arguments.length > 1 ? t.toArray(arguments) : arguments[0];
  10030. return t.each(o, function(r) {
  10031. if (r.litmus(e))
  10032. return t.each(r.conversions, function(r, o) {
  10033. if (i = r.read(e),
  10034. n === !1 && i !== !1)
  10035. return n = i,
  10036. i.conversionName = o,
  10037. i.conversion = r,
  10038. t.BREAK
  10039. }),
  10040. t.BREAK
  10041. }),
  10042. n
  10043. }, o = [{
  10044. litmus: t.isString,
  10045. conversions: {
  10046. THREE_CHAR_HEX: {
  10047. read: function(e) {
  10048. var t = e.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i);
  10049. return null !== t && {
  10050. space: "HEX",
  10051. hex: parseInt("0x" + t[1].toString() + t[1].toString() + t[2].toString() + t[2].toString() + t[3].toString() + t[3].toString())
  10052. }
  10053. },
  10054. write: e
  10055. },
  10056. SIX_CHAR_HEX: {
  10057. read: function(e) {
  10058. var t = e.match(/^#([A-F0-9]{6})$/i);
  10059. return null !== t && {
  10060. space: "HEX",
  10061. hex: parseInt("0x" + t[1].toString())
  10062. }
  10063. },
  10064. write: e
  10065. },
  10066. CSS_RGB: {
  10067. read: function(e) {
  10068. var t = e.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/);
  10069. return null !== t && {
  10070. space: "RGB",
  10071. r: parseFloat(t[1]),
  10072. g: parseFloat(t[2]),
  10073. b: parseFloat(t[3])
  10074. }
  10075. },
  10076. write: e
  10077. },
  10078. CSS_RGBA: {
  10079. read: function(e) {
  10080. var t = e.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\,\s*(.+)\s*\)/);
  10081. return null !== t && {
  10082. space: "RGB",
  10083. r: parseFloat(t[1]),
  10084. g: parseFloat(t[2]),
  10085. b: parseFloat(t[3]),
  10086. a: parseFloat(t[4])
  10087. }
  10088. },
  10089. write: e
  10090. }
  10091. }
  10092. }, {
  10093. litmus: t.isNumber,
  10094. conversions: {
  10095. HEX: {
  10096. read: function(e) {
  10097. return {
  10098. space: "HEX",
  10099. hex: e,
  10100. conversionName: "HEX"
  10101. }
  10102. },
  10103. write: function(e) {
  10104. return e.hex
  10105. }
  10106. }
  10107. }
  10108. }, {
  10109. litmus: t.isArray,
  10110. conversions: {
  10111. RGB_ARRAY: {
  10112. read: function(e) {
  10113. return 3 == e.length && {
  10114. space: "RGB",
  10115. r: e[0],
  10116. g: e[1],
  10117. b: e[2]
  10118. }
  10119. },
  10120. write: function(e) {
  10121. return [e.r, e.g, e.b]
  10122. }
  10123. },
  10124. RGBA_ARRAY: {
  10125. read: function(e) {
  10126. return 4 == e.length && {
  10127. space: "RGB",
  10128. r: e[0],
  10129. g: e[1],
  10130. b: e[2],
  10131. a: e[3]
  10132. }
  10133. },
  10134. write: function(e) {
  10135. return [e.r, e.g, e.b, e.a]
  10136. }
  10137. }
  10138. }
  10139. }, {
  10140. litmus: t.isObject,
  10141. conversions: {
  10142. RGBA_OBJ: {
  10143. read: function(e) {
  10144. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b) && t.isNumber(e.a)) && {
  10145. space: "RGB",
  10146. r: e.r,
  10147. g: e.g,
  10148. b: e.b,
  10149. a: e.a
  10150. }
  10151. },
  10152. write: function(e) {
  10153. return {
  10154. r: e.r,
  10155. g: e.g,
  10156. b: e.b,
  10157. a: e.a
  10158. }
  10159. }
  10160. },
  10161. RGB_OBJ: {
  10162. read: function(e) {
  10163. return !!(t.isNumber(e.r) && t.isNumber(e.g) && t.isNumber(e.b)) && {
  10164. space: "RGB",
  10165. r: e.r,
  10166. g: e.g,
  10167. b: e.b
  10168. }
  10169. },
  10170. write: function(e) {
  10171. return {
  10172. r: e.r,
  10173. g: e.g,
  10174. b: e.b
  10175. }
  10176. }
  10177. },
  10178. HSVA_OBJ: {
  10179. read: function(e) {
  10180. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v) && t.isNumber(e.a)) && {
  10181. space: "HSV",
  10182. h: e.h,
  10183. s: e.s,
  10184. v: e.v,
  10185. a: e.a
  10186. }
  10187. },
  10188. write: function(e) {
  10189. return {
  10190. h: e.h,
  10191. s: e.s,
  10192. v: e.v,
  10193. a: e.a
  10194. }
  10195. }
  10196. },
  10197. HSV_OBJ: {
  10198. read: function(e) {
  10199. return !!(t.isNumber(e.h) && t.isNumber(e.s) && t.isNumber(e.v)) && {
  10200. space: "HSV",
  10201. h: e.h,
  10202. s: e.s,
  10203. v: e.v
  10204. }
  10205. },
  10206. write: function(e) {
  10207. return {
  10208. h: e.h,
  10209. s: e.s,
  10210. v: e.v
  10211. }
  10212. }
  10213. }
  10214. }
  10215. }];
  10216. return r
  10217. }(n.color.toString, n.utils.common),
  10218. n.GUI = n.gui.GUI = function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f) {
  10219. function g(e, t, i, o) {
  10220. if (void 0 === t[i])
  10221. throw new Error("Object " + t + ' has no property "' + i + '"');
  10222. var a;
  10223. if (o.color)
  10224. a = new h(t,i);
  10225. else {
  10226. var s = [t, i].concat(o.factoryArgs);
  10227. a = n.apply(e, s)
  10228. }
  10229. o.before instanceof r && (o.before = o.before.__li),
  10230. A(e, a),
  10231. p.addClass(a.domElement, "c");
  10232. var l = document.createElement("span");
  10233. p.addClass(l, "property-name"),
  10234. l.innerHTML = a.property;
  10235. var c = document.createElement("div");
  10236. c.appendChild(l),
  10237. c.appendChild(a.domElement);
  10238. var u = m(e, c, o.before);
  10239. return p.addClass(u, V.CLASS_CONTROLLER_ROW),
  10240. p.addClass(u, typeof a.getValue()),
  10241. v(e, u, a),
  10242. e.__controllers.push(a),
  10243. a
  10244. }
  10245. function m(e, t, i) {
  10246. var n = document.createElement("li");
  10247. return t && n.appendChild(t),
  10248. i ? e.__ul.insertBefore(n, params.before) : e.__ul.appendChild(n),
  10249. e.onResize(),
  10250. n
  10251. }
  10252. function v(e, t, i) {
  10253. if (i.__li = t,
  10254. i.__gui = e,
  10255. f.extend(i, {
  10256. options: function(t) {
  10257. return arguments.length > 1 ? (i.remove(),
  10258. g(e, i.object, i.property, {
  10259. before: i.__li.nextElementSibling,
  10260. factoryArgs: [f.toArray(arguments)]
  10261. })) : f.isArray(t) || f.isObject(t) ? (i.remove(),
  10262. g(e, i.object, i.property, {
  10263. before: i.__li.nextElementSibling,
  10264. factoryArgs: [t]
  10265. })) : void 0
  10266. },
  10267. name: function(e) {
  10268. return i.__li.firstElementChild.firstElementChild.innerHTML = e,
  10269. i
  10270. },
  10271. listen: function() {
  10272. return i.__gui.listen(i),
  10273. i
  10274. },
  10275. remove: function() {
  10276. return i.__gui.remove(i),
  10277. i
  10278. }
  10279. }),
  10280. i instanceof l) {
  10281. var n = new s(i.object,i.property,{
  10282. min: i.__min,
  10283. max: i.__max,
  10284. step: i.__step
  10285. });
  10286. f.each(["updateDisplay", "onChange", "onFinishChange"], function(e) {
  10287. var t = i[e]
  10288. , r = n[e];
  10289. i[e] = n[e] = function() {
  10290. var e = Array.prototype.slice.call(arguments);
  10291. return t.apply(i, e),
  10292. r.apply(n, e)
  10293. }
  10294. }),
  10295. p.addClass(t, "has-slider"),
  10296. i.domElement.insertBefore(n.domElement, i.domElement.firstElementChild)
  10297. } else if (i instanceof s) {
  10298. var r = function(t) {
  10299. return f.isNumber(i.__min) && f.isNumber(i.__max) ? (i.remove(),
  10300. g(e, i.object, i.property, {
  10301. before: i.__li.nextElementSibling,
  10302. factoryArgs: [i.__min, i.__max, i.__step]
  10303. })) : t
  10304. };
  10305. i.min = f.compose(r, i.min),
  10306. i.max = f.compose(r, i.max)
  10307. } else
  10308. i instanceof o ? (p.bind(t, "click", function() {
  10309. p.fakeEvent(i.__checkbox, "click")
  10310. }),
  10311. p.bind(i.__checkbox, "click", function(e) {
  10312. e.stopPropagation()
  10313. })) : i instanceof a ? (p.bind(t, "click", function() {
  10314. p.fakeEvent(i.__button, "click")
  10315. }),
  10316. p.bind(t, "mouseover", function() {
  10317. p.addClass(i.__button, "hover")
  10318. }),
  10319. p.bind(t, "mouseout", function() {
  10320. p.removeClass(i.__button, "hover")
  10321. })) : i instanceof h && (p.addClass(t, "color"),
  10322. i.updateDisplay = f.compose(function(e) {
  10323. return t.style.borderLeftColor = i.__color.toString(),
  10324. e
  10325. }, i.updateDisplay),
  10326. i.updateDisplay());
  10327. i.setValue = f.compose(function(t) {
  10328. return e.getRoot().__preset_select && i.isModified() && T(e.getRoot(), !0),
  10329. t
  10330. }, i.setValue)
  10331. }
  10332. function A(e, t) {
  10333. var i = e.getRoot()
  10334. , n = i.__rememberedObjects.indexOf(t.object);
  10335. if (n != -1) {
  10336. var r = i.__rememberedObjectIndecesToControllers[n];
  10337. if (void 0 === r && (r = {},
  10338. i.__rememberedObjectIndecesToControllers[n] = r),
  10339. r[t.property] = t,
  10340. i.load && i.load.remembered) {
  10341. var o, a = i.load.remembered;
  10342. if (a[e.preset])
  10343. o = a[e.preset];
  10344. else {
  10345. if (!a[L])
  10346. return;
  10347. o = a[L]
  10348. }
  10349. if (o[n] && void 0 !== o[n][t.property]) {
  10350. var s = o[n][t.property];
  10351. t.initialValue = s,
  10352. t.setValue(s)
  10353. }
  10354. }
  10355. }
  10356. }
  10357. function y(e, t) {
  10358. return document.location.href + "." + t
  10359. }
  10360. function C(e) {
  10361. var t = e.__save_row = document.createElement("li");
  10362. p.addClass(e.domElement, "has-save"),
  10363. e.__ul.insertBefore(t, e.__ul.firstChild),
  10364. p.addClass(t, "save-row");
  10365. var i = document.createElement("span");
  10366. i.innerHTML = "&nbsp;",
  10367. p.addClass(i, "button gears");
  10368. var n = document.createElement("span");
  10369. n.innerHTML = "Save",
  10370. p.addClass(n, "button"),
  10371. p.addClass(n, "save");
  10372. var r = document.createElement("span");
  10373. r.innerHTML = "New",
  10374. p.addClass(r, "button"),
  10375. p.addClass(r, "save-as");
  10376. var o = document.createElement("span");
  10377. o.innerHTML = "Revert",
  10378. p.addClass(o, "button"),
  10379. p.addClass(o, "revert");
  10380. var a = e.__preset_select = document.createElement("select");
  10381. if (e.load && e.load.remembered ? f.each(e.load.remembered, function(t, i) {
  10382. w(e, i, i == e.preset)
  10383. }) : w(e, L, !1),
  10384. p.bind(a, "change", function() {
  10385. for (var t = 0; t < e.__preset_select.length; t++)
  10386. e.__preset_select[t].innerHTML = e.__preset_select[t].value;
  10387. e.preset = this.value
  10388. }),
  10389. t.appendChild(a),
  10390. t.appendChild(i),
  10391. t.appendChild(n),
  10392. t.appendChild(r),
  10393. t.appendChild(o),
  10394. D) {
  10395. var s = document.getElementById("dg-save-locally")
  10396. , l = document.getElementById("dg-local-explain");
  10397. s.style.display = "block";
  10398. var c = document.getElementById("dg-local-storage");
  10399. "true" === localStorage.getItem(y(e, "isLocal")) && c.setAttribute("checked", "checked");
  10400. var h = function() {
  10401. l.style.display = e.useLocalStorage ? "block" : "none"
  10402. };
  10403. h(),
  10404. p.bind(c, "change", function() {
  10405. e.useLocalStorage = !e.useLocalStorage,
  10406. h()
  10407. })
  10408. }
  10409. var u = document.getElementById("dg-new-constructor");
  10410. p.bind(u, "keydown", function(e) {
  10411. !e.metaKey || 67 !== e.which && 67 != e.keyCode || S.hide()
  10412. }),
  10413. p.bind(i, "click", function() {
  10414. u.innerHTML = JSON.stringify(e.getSaveObject(), void 0, 2),
  10415. S.show(),
  10416. u.focus(),
  10417. u.select()
  10418. }),
  10419. p.bind(n, "click", function() {
  10420. e.save()
  10421. }),
  10422. p.bind(r, "click", function() {
  10423. var t = prompt("Enter a new preset name.");
  10424. t && e.saveAs(t)
  10425. }),
  10426. p.bind(o, "click", function() {
  10427. e.revert()
  10428. })
  10429. }
  10430. function I(e) {
  10431. function t(t) {
  10432. return t.preventDefault(),
  10433. r = t.clientX,
  10434. p.addClass(e.__closeButton, V.CLASS_DRAG),
  10435. p.bind(window, "mousemove", i),
  10436. p.bind(window, "mouseup", n),
  10437. !1
  10438. }
  10439. function i(t) {
  10440. return t.preventDefault(),
  10441. e.width += r - t.clientX,
  10442. e.onResize(),
  10443. r = t.clientX,
  10444. !1
  10445. }
  10446. function n() {
  10447. p.removeClass(e.__closeButton, V.CLASS_DRAG),
  10448. p.unbind(window, "mousemove", i),
  10449. p.unbind(window, "mouseup", n)
  10450. }
  10451. e.__resize_handle = document.createElement("div"),
  10452. f.extend(e.__resize_handle.style, {
  10453. width: "6px",
  10454. marginLeft: "-3px",
  10455. height: "200px",
  10456. cursor: "ew-resize",
  10457. position: "absolute"
  10458. });
  10459. var r;
  10460. p.bind(e.__resize_handle, "mousedown", t),
  10461. p.bind(e.__closeButton, "mousedown", t),
  10462. e.domElement.insertBefore(e.__resize_handle, e.domElement.firstElementChild)
  10463. }
  10464. function E(e, t) {
  10465. e.domElement.style.width = t + "px",
  10466. e.__save_row && e.autoPlace && (e.__save_row.style.width = t + "px"),
  10467. e.__closeButton && (e.__closeButton.style.width = t + "px")
  10468. }
  10469. function b(e, t) {
  10470. var i = {};
  10471. return f.each(e.__rememberedObjects, function(n, r) {
  10472. var o = {}
  10473. , a = e.__rememberedObjectIndecesToControllers[r];
  10474. f.each(a, function(e, i) {
  10475. o[i] = t ? e.initialValue : e.getValue()
  10476. }),
  10477. i[r] = o
  10478. }),
  10479. i
  10480. }
  10481. function w(e, t, i) {
  10482. var n = document.createElement("option");
  10483. n.innerHTML = t,
  10484. n.value = t,
  10485. e.__preset_select.appendChild(n),
  10486. i && (e.__preset_select.selectedIndex = e.__preset_select.length - 1)
  10487. }
  10488. function _(e) {
  10489. for (var t = 0; t < e.__preset_select.length; t++)
  10490. e.__preset_select[t].value == e.preset && (e.__preset_select.selectedIndex = t)
  10491. }
  10492. function T(e, t) {
  10493. var i = e.__preset_select[e.__preset_select.selectedIndex];
  10494. t ? i.innerHTML = i.value + "*" : i.innerHTML = i.value
  10495. }
  10496. function x(e) {
  10497. 0 != e.length && u(function() {
  10498. x(e)
  10499. }),
  10500. f.each(e, function(e) {
  10501. e.updateDisplay()
  10502. })
  10503. }
  10504. e.inject(i);
  10505. var S, M, R = "dg", P = 72, O = 20, L = "Default", D = function() {
  10506. try {
  10507. return "localStorage"in window && null !== window.localStorage
  10508. } catch (e) {
  10509. return !1
  10510. }
  10511. }(), N = !0, B = !1, F = [], V = function(e) {
  10512. function t() {
  10513. var e = i.getRoot();
  10514. e.width += 1,
  10515. f.defer(function() {
  10516. e.width -= 1
  10517. })
  10518. }
  10519. var i = this;
  10520. this.domElement = document.createElement("div"),
  10521. this.__ul = document.createElement("ul"),
  10522. this.domElement.appendChild(this.__ul),
  10523. p.addClass(this.domElement, R),
  10524. this.__folders = {},
  10525. this.__controllers = [],
  10526. this.__rememberedObjects = [],
  10527. this.__rememberedObjectIndecesToControllers = [],
  10528. this.__listening = [],
  10529. e = e || {},
  10530. e = f.defaults(e, {
  10531. autoPlace: !0,
  10532. width: V.DEFAULT_WIDTH
  10533. }),
  10534. e = f.defaults(e, {
  10535. resizable: e.autoPlace,
  10536. hideable: e.autoPlace
  10537. }),
  10538. f.isUndefined(e.load) ? e.load = {
  10539. preset: L
  10540. } : e.preset && (e.load.preset = e.preset),
  10541. f.isUndefined(e.parent) && e.hideable && F.push(this),
  10542. e.resizable = f.isUndefined(e.parent) && e.resizable,
  10543. e.autoPlace && f.isUndefined(e.scrollable) && (e.scrollable = !0);
  10544. var n, r = D && "true" === localStorage.getItem(y(this, "isLocal"));
  10545. if (Object.defineProperties(this, {
  10546. parent: {
  10547. get: function() {
  10548. return e.parent
  10549. }
  10550. },
  10551. scrollable: {
  10552. get: function() {
  10553. return e.scrollable
  10554. }
  10555. },
  10556. autoPlace: {
  10557. get: function() {
  10558. return e.autoPlace
  10559. }
  10560. },
  10561. preset: {
  10562. get: function() {
  10563. return i.parent ? i.getRoot().preset : e.load.preset
  10564. },
  10565. set: function(t) {
  10566. i.parent ? i.getRoot().preset = t : e.load.preset = t,
  10567. _(this),
  10568. i.revert()
  10569. }
  10570. },
  10571. width: {
  10572. get: function() {
  10573. return e.width
  10574. },
  10575. set: function(t) {
  10576. e.width = t,
  10577. E(i, t)
  10578. }
  10579. },
  10580. name: {
  10581. get: function() {
  10582. return e.name
  10583. },
  10584. set: function(t) {
  10585. e.name = t,
  10586. a && (a.innerHTML = e.name)
  10587. }
  10588. },
  10589. closed: {
  10590. get: function() {
  10591. return e.closed
  10592. },
  10593. set: function(t) {
  10594. e.closed = t,
  10595. e.closed ? p.addClass(i.__ul, V.CLASS_CLOSED) : p.removeClass(i.__ul, V.CLASS_CLOSED),
  10596. this.onResize(),
  10597. i.__closeButton && (i.__closeButton.innerHTML = t ? V.TEXT_OPEN : V.TEXT_CLOSED)
  10598. }
  10599. },
  10600. load: {
  10601. get: function() {
  10602. return e.load
  10603. }
  10604. },
  10605. useLocalStorage: {
  10606. get: function() {
  10607. return r
  10608. },
  10609. set: function(e) {
  10610. D && (r = e,
  10611. e ? p.bind(window, "unload", n) : p.unbind(window, "unload", n),
  10612. localStorage.setItem(y(i, "isLocal"), e))
  10613. }
  10614. }
  10615. }),
  10616. f.isUndefined(e.parent)) {
  10617. if (e.closed = !1,
  10618. p.addClass(this.domElement, V.CLASS_MAIN),
  10619. p.makeSelectable(this.domElement, !1),
  10620. D && r) {
  10621. i.useLocalStorage = !0;
  10622. var o = localStorage.getItem(y(this, "gui"));
  10623. o && (e.load = JSON.parse(o))
  10624. }
  10625. this.__closeButton = document.createElement("div"),
  10626. this.__closeButton.innerHTML = V.TEXT_CLOSED,
  10627. p.addClass(this.__closeButton, V.CLASS_CLOSE_BUTTON),
  10628. this.domElement.appendChild(this.__closeButton),
  10629. p.bind(this.__closeButton, "click", function() {
  10630. i.closed = !i.closed
  10631. })
  10632. } else {
  10633. void 0 === e.closed && (e.closed = !0);
  10634. var a = document.createTextNode(e.name);
  10635. p.addClass(a, "controller-name");
  10636. var s = m(i, a)
  10637. , l = function(e) {
  10638. return e.preventDefault(),
  10639. i.closed = !i.closed,
  10640. !1
  10641. };
  10642. p.addClass(this.__ul, V.CLASS_CLOSED),
  10643. p.addClass(s, "title"),
  10644. p.bind(s, "click", l),
  10645. e.closed || (this.closed = !1)
  10646. }
  10647. e.autoPlace && (f.isUndefined(e.parent) && (N && (M = document.createElement("div"),
  10648. p.addClass(M, R),
  10649. p.addClass(M, V.CLASS_AUTO_PLACE_CONTAINER),
  10650. document.body.appendChild(M),
  10651. N = !1),
  10652. M.appendChild(this.domElement),
  10653. p.addClass(this.domElement, V.CLASS_AUTO_PLACE)),
  10654. this.parent || E(i, e.width)),
  10655. p.bind(window, "resize", function() {
  10656. i.onResize()
  10657. }),
  10658. p.bind(this.__ul, "webkitTransitionEnd", function() {
  10659. i.onResize()
  10660. }),
  10661. p.bind(this.__ul, "transitionend", function() {
  10662. i.onResize()
  10663. }),
  10664. p.bind(this.__ul, "oTransitionEnd", function() {
  10665. i.onResize()
  10666. }),
  10667. this.onResize(),
  10668. e.resizable && I(this),
  10669. n = function() {
  10670. D && "true" === localStorage.getItem(y(i, "isLocal")) && localStorage.setItem(y(i, "gui"), JSON.stringify(i.getSaveObject()))
  10671. }
  10672. ,
  10673. this.saveToLocalStorageIfPossible = n;
  10674. i.getRoot();
  10675. e.parent || t()
  10676. };
  10677. return V.toggleHide = function() {
  10678. B = !B,
  10679. f.each(F, function(e) {
  10680. e.domElement.style.zIndex = B ? -999 : 999,
  10681. e.domElement.style.opacity = B ? 0 : 1
  10682. })
  10683. }
  10684. ,
  10685. V.CLASS_AUTO_PLACE = "a",
  10686. V.CLASS_AUTO_PLACE_CONTAINER = "ac",
  10687. V.CLASS_MAIN = "main",
  10688. V.CLASS_CONTROLLER_ROW = "cr",
  10689. V.CLASS_TOO_TALL = "taller-than-window",
  10690. V.CLASS_CLOSED = "closed",
  10691. V.CLASS_CLOSE_BUTTON = "close-button",
  10692. V.CLASS_DRAG = "drag",
  10693. V.DEFAULT_WIDTH = 245,
  10694. V.TEXT_CLOSED = "Close Controls",
  10695. V.TEXT_OPEN = "Open Controls",
  10696. p.bind(window, "keydown", function(e) {
  10697. "text" === document.activeElement.type || e.which !== P && e.keyCode != P || V.toggleHide()
  10698. }, !1),
  10699. f.extend(V.prototype, {
  10700. add: function(e, t) {
  10701. return g(this, e, t, {
  10702. factoryArgs: Array.prototype.slice.call(arguments, 2)
  10703. })
  10704. },
  10705. addColor: function(e, t) {
  10706. return g(this, e, t, {
  10707. color: !0
  10708. })
  10709. },
  10710. remove: function(e) {
  10711. this.__ul.removeChild(e.__li),
  10712. this.__controllers.slice(this.__controllers.indexOf(e), 1);
  10713. var t = this;
  10714. f.defer(function() {
  10715. t.onResize()
  10716. })
  10717. },
  10718. destroy: function() {
  10719. this.autoPlace && M.removeChild(this.domElement)
  10720. },
  10721. addFolder: function(e) {
  10722. if (void 0 !== this.__folders[e])
  10723. throw new Error('You already have a folder in this GUI by the name "' + e + '"');
  10724. var t = {
  10725. name: e,
  10726. parent: this
  10727. };
  10728. t.autoPlace = this.autoPlace,
  10729. this.load && this.load.folders && this.load.folders[e] && (t.closed = this.load.folders[e].closed,
  10730. t.load = this.load.folders[e]);
  10731. var i = new V(t);
  10732. this.__folders[e] = i;
  10733. var n = m(this, i.domElement);
  10734. return p.addClass(n, "folder"),
  10735. i
  10736. },
  10737. open: function() {
  10738. this.closed = !1
  10739. },
  10740. close: function() {
  10741. this.closed = !0
  10742. },
  10743. onResize: function() {
  10744. var e = this.getRoot();
  10745. if (e.scrollable) {
  10746. var t = p.getOffset(e.__ul).top
  10747. , i = 0;
  10748. f.each(e.__ul.childNodes, function(t) {
  10749. e.autoPlace && t === e.__save_row || (i += p.getHeight(t))
  10750. }),
  10751. $("#player").height() - t - O < i ? (p.addClass(e.domElement, V.CLASS_TOO_TALL),
  10752. e.__ul.style.height = $("#player").height() - t - O + "px") : (p.removeClass(e.domElement, V.CLASS_TOO_TALL),
  10753. e.__ul.style.height = "auto")
  10754. }
  10755. e.__resize_handle && f.defer(function() {
  10756. e.__resize_handle.style.height = e.__ul.offsetHeight + "px"
  10757. }),
  10758. e.__closeButton && (e.__closeButton.style.width = e.width + "px")
  10759. },
  10760. remember: function() {
  10761. if (f.isUndefined(S) && (S = new d,
  10762. S.domElement.innerHTML = t),
  10763. this.parent)
  10764. throw new Error("You can only call remember on a top level GUI.");
  10765. var e = this;
  10766. f.each(Array.prototype.slice.call(arguments), function(t) {
  10767. 0 == e.__rememberedObjects.length && C(e),
  10768. e.__rememberedObjects.indexOf(t) == -1 && e.__rememberedObjects.push(t)
  10769. }),
  10770. this.autoPlace && E(this, this.width)
  10771. },
  10772. getRoot: function() {
  10773. for (var e = this; e.parent; )
  10774. e = e.parent;
  10775. return e
  10776. },
  10777. getSaveObject: function() {
  10778. var e = this.load;
  10779. return e.closed = this.closed,
  10780. this.__rememberedObjects.length > 0 && (e.preset = this.preset,
  10781. e.remembered || (e.remembered = {}),
  10782. e.remembered[this.preset] = b(this)),
  10783. e.folders = {},
  10784. f.each(this.__folders, function(t, i) {
  10785. e.folders[i] = t.getSaveObject()
  10786. }),
  10787. e
  10788. },
  10789. save: function() {
  10790. this.load.remembered || (this.load.remembered = {}),
  10791. this.load.remembered[this.preset] = b(this),
  10792. T(this, !1),
  10793. this.saveToLocalStorageIfPossible()
  10794. },
  10795. saveAs: function(e) {
  10796. this.load.remembered || (this.load.remembered = {},
  10797. this.load.remembered[L] = b(this, !0)),
  10798. this.load.remembered[e] = b(this),
  10799. this.preset = e,
  10800. w(this, e, !0),
  10801. this.saveToLocalStorageIfPossible()
  10802. },
  10803. revert: function(e) {
  10804. f.each(this.__controllers, function(t) {
  10805. this.getRoot().load.remembered ? A(e || this.getRoot(), t) : t.setValue(t.initialValue)
  10806. }, this),
  10807. f.each(this.__folders, function(e) {
  10808. e.revert(e)
  10809. }),
  10810. e || T(this.getRoot(), !1)
  10811. },
  10812. listen: function(e) {
  10813. var t = 0 == this.__listening.length;
  10814. this.__listening.push(e),
  10815. t && x(this.__listening)
  10816. }
  10817. }),
  10818. V
  10819. }(n.utils.css, '<div id="dg-save" class="dg dialogue">\n\n Here\'s the new load parameter for your <code>GUI</code>\'s constructor:\n\n <textarea id="dg-new-constructor"></textarea>\n\n <div id="dg-save-locally">\n\n <input id="dg-local-storage" type="checkbox"/> Automatically save\n values to <code>localStorage</code> on exit.\n\n <div id="dg-local-explain">The values saved to <code>localStorage</code> will\n override those passed to <code>dat.GUI</code>\'s constructor. This makes it\n easier to work incrementally, but <code>localStorage</code> is fragile,\n and your friends may not see the same values you do.\n \n </div>\n \n </div>\n\n</div>', ".dg {\n /** Clear list styles */\n /* Auto-place container */\n /* Auto-placed GUI's */\n /* Line items that don't contain folders. */\n /** Folder names */\n /** Hides closed items */\n /** Controller row */\n /** Name-half (left) */\n /** Controller-half (right) */\n /** Controller placement */\n /** Shorter number boxes when slider is present. */\n /** Ensure the entire boolean and function row shows a hand */ }\n .dg ul {\n list-style: none;\n margin: 0;\n padding: 0;\n width: 100%;\n clear: both; }\n .dg.ac {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n height: 0;\n z-index: 0; }\n .dg:not(.ac) .main {\n /** Exclude mains in ac so that we don't hide close button */\n overflow: hidden; }\n .dg.main {\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear; }\n .dg.main.taller-than-window {\n overflow-y: auto; }\n .dg.main.taller-than-window .close-button {\n opacity: 1;\n /* TODO, these are style notes */\n margin-top: -1px;\n border-top: 1px solid #2c2c2c; }\n .dg.main ul.closed .close-button {\n opacity: 1 !important; }\n .dg.main:hover .close-button,\n .dg.main .close-button.drag {\n opacity: 1; }\n .dg.main .close-button {\n /*opacity: 0;*/\n -webkit-transition: opacity 0.1s linear;\n -o-transition: opacity 0.1s linear;\n -moz-transition: opacity 0.1s linear;\n transition: opacity 0.1s linear;\n border: 0;\n position: absolute;\n line-height: 19px;\n height: 20px;\n /* TODO, these are style notes */\n cursor: pointer;\n text-align: center;\n background-color: #000; }\n .dg.main .close-button:hover {\n background-color: #111; }\n .dg.a {\n float: right;\n margin-right: 15px;\n overflow-x: hidden; }\n .dg.a.has-save > ul {\n margin-top: 27px; }\n .dg.a.has-save > ul.closed {\n margin-top: 0; }\n .dg.a .save-row {\n position: fixed;\n top: 0;\n z-index: 1002; }\n .dg li {\n -webkit-transition: height 0.1s ease-out;\n -o-transition: height 0.1s ease-out;\n -moz-transition: height 0.1s ease-out;\n transition: height 0.1s ease-out; }\n .dg li:not(.folder) {\n cursor: auto;\n height: 27px;\n line-height: 27px;\n overflow: hidden;\n padding: 0 4px 0 5px; }\n .dg li.folder {\n padding: 0;\n border-left: 4px solid rgba(0, 0, 0, 0); }\n .dg li.title {\n cursor: pointer;\n margin-left: -4px; }\n .dg .closed li:not(.title),\n .dg .closed ul li,\n .dg .closed ul li > * {\n height: 0;\n overflow: hidden;\n border: 0; }\n .dg .cr {\n clear: both;\n padding-left: 3px;\n height: 27px; }\n .dg .property-name {\n cursor: default;\n float: left;\n clear: left;\n width: 40%;\n overflow: hidden;\n text-overflow: ellipsis; }\n .dg .c {\n float: left;\n width: 60%; }\n .dg .c input[type=text] {\n border: 0;\n margin-top: 4px;\n padding: 3px;\n width: 100%;\n float: right; }\n .dg .has-slider input[type=text] {\n width: 30%;\n /*display: none;*/\n margin-left: 0; }\n .dg .slider {\n float: left;\n width: 66%;\n margin-left: -5px;\n margin-right: 0;\n height: 19px;\n margin-top: 4px; }\n .dg .slider-fg {\n height: 100%; }\n .dg .c input[type=checkbox] {\n margin-top: 9px; }\n .dg .c select {\n margin-top: 5px; }\n .dg .cr.function,\n .dg .cr.function .property-name,\n .dg .cr.function *,\n .dg .cr.boolean,\n .dg .cr.boolean * {\n cursor: pointer; }\n .dg .selector {\n display: none;\n position: absolute;\n margin-left: -9px;\n margin-top: 23px;\n z-index: 10; }\n .dg .c:hover .selector,\n .dg .selector.drag {\n display: block; }\n .dg li.save-row {\n padding: 0; }\n .dg li.save-row .button {\n display: inline-block;\n padding: 0px 6px; }\n .dg.dialogue {\n background-color: #222;\n width: 460px;\n padding: 15px;\n font-size: 13px;\n line-height: 15px; }\n\n/* TODO Separate style and structure */\n#dg-new-constructor {\n padding: 10px;\n color: #222;\n font-family: Monaco, monospace;\n font-size: 10px;\n border: 0;\n resize: none;\n box-shadow: inset 1px 1px 1px #888;\n word-wrap: break-word;\n margin: 12px 0;\n display: block;\n width: 440px;\n overflow-y: scroll;\n height: 100px;\n position: relative; }\n\n#dg-local-explain {\n display: none;\n font-size: 11px;\n line-height: 17px;\n border-radius: 3px;\n background-color: #333;\n padding: 8px;\n margin-top: 10px; }\n #dg-local-explain code {\n font-size: 10px; }\n\n#dat-gui-save-locally {\n display: none; }\n\n/** Main type */\n.dg {\n color: #eee;\n font: 11px 'Lucida Grande', sans-serif;\n text-shadow: 0 -1px 0 #111;\n /** Auto place */\n /* Controller row, <li> */\n /** Controllers */ }\n .dg.main {\n /** Scrollbar */ }\n .dg.main::-webkit-scrollbar {\n width: 5px;\n background: #1a1a1a; }\n .dg.main::-webkit-scrollbar-corner {\n height: 0;\n display: none; }\n .dg.main::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: #676767; }\n .dg li:not(.folder) {\n background: #1a1a1a;\n border-bottom: 1px solid #2c2c2c; }\n .dg li.save-row {\n line-height: 25px;\n background: #dad5cb;\n border: 0; }\n .dg li.save-row select {\n margin-left: 5px;\n width: 108px; }\n .dg li.save-row .button {\n margin-left: 5px;\n margin-top: 1px;\n border-radius: 2px;\n font-size: 9px;\n line-height: 7px;\n padding: 4px 4px 5px 4px;\n background: #c5bdad;\n color: #fff;\n text-shadow: 0 1px 0 #b0a58f;\n box-shadow: 0 -1px 0 #b0a58f;\n cursor: pointer; }\n .dg li.save-row .button.gears {\n background: #c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;\n height: 7px;\n width: 8px; }\n .dg li.save-row .button:hover {\n background-color: #bab19e;\n box-shadow: 0 -1px 0 #b0a58f; }\n .dg li.folder {\n border-bottom: 0; }\n .dg li.title {\n padding-left: 16px;\n background: black url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;\n cursor: pointer;\n border-bottom: 1px solid rgba(255, 255, 255, 0.2); }\n .dg .closed li.title {\n background-image: url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==); }\n .dg .cr.boolean {\n border-left: 3px solid #806787; }\n .dg .cr.function {\n border-left: 3px solid #e61d5f; }\n .dg .cr.number {\n border-left: 3px solid #2fa1d6; }\n .dg .cr.number input[type=text] {\n color: #2fa1d6; }\n .dg .cr.string {\n border-left: 3px solid #1ed36f; }\n .dg .cr.string input[type=text] {\n color: #1ed36f; }\n .dg .cr.function:hover, .dg .cr.boolean:hover {\n background: #111; }\n .dg .c input[type=text] {\n background: #303030;\n outline: none; }\n .dg .c input[type=text]:hover {\n background: #3c3c3c; }\n .dg .c input[type=text]:focus {\n background: #494949;\n color: #fff; }\n .dg .c .slider {\n background: #303030;\n cursor: ew-resize; }\n .dg .c .slider-fg {\n background: #2fa1d6; }\n .dg .c .slider:hover {\n background: #3c3c3c; }\n .dg .c .slider:hover .slider-fg {\n background: #44abda; }\n", n.controllers.factory = function(e, t, i, n, r, o, a) {
  10820. return function(s, l) {
  10821. var c = s[l];
  10822. return a.isArray(arguments[2]) || a.isObject(arguments[2]) ? new e(s,l,arguments[2]) : a.isNumber(c) ? a.isNumber(arguments[2]) && a.isNumber(arguments[3]) ? new i(s,l,arguments[2],arguments[3]) : new t(s,l,{
  10823. min: arguments[2],
  10824. max: arguments[3]
  10825. }) : a.isString(c) ? new n(s,l) : a.isFunction(c) ? new r(s,l,"") : a.isBoolean(c) ? new o(s,l) : void 0
  10826. }
  10827. }(n.controllers.OptionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.StringController = function(e, t, i) {
  10828. var n = function(e, i) {
  10829. function r() {
  10830. a.setValue(a.__input.value)
  10831. }
  10832. function o() {
  10833. a.__onFinishChange && a.__onFinishChange.call(a, a.getValue())
  10834. }
  10835. n.superclass.call(this, e, i);
  10836. var a = this;
  10837. this.__input = document.createElement("input"),
  10838. this.__input.setAttribute("type", "text"),
  10839. t.bind(this.__input, "keyup", r),
  10840. t.bind(this.__input, "change", r),
  10841. t.bind(this.__input, "blur", o),
  10842. t.bind(this.__input, "keydown", function(e) {
  10843. 13 === e.keyCode && this.blur()
  10844. }),
  10845. this.updateDisplay(),
  10846. this.domElement.appendChild(this.__input)
  10847. };
  10848. return n.superclass = e,
  10849. i.extend(n.prototype, e.prototype, {
  10850. updateDisplay: function() {
  10851. return t.isActive(this.__input) || (this.__input.value = this.getValue()),
  10852. n.superclass.prototype.updateDisplay.call(this)
  10853. }
  10854. }),
  10855. n
  10856. }(n.controllers.Controller, n.dom.dom, n.utils.common), n.controllers.FunctionController, n.controllers.BooleanController, n.utils.common), n.controllers.Controller, n.controllers.BooleanController, n.controllers.FunctionController, n.controllers.NumberControllerBox, n.controllers.NumberControllerSlider, n.controllers.OptionController, n.controllers.ColorController = function(e, t, i, n, r) {
  10857. function o(e, t, i, n) {
  10858. e.style.background = "",
  10859. r.each(l, function(r) {
  10860. e.style.cssText += "background: " + r + "linear-gradient(" + t + ", " + i + " 0%, " + n + " 100%); "
  10861. })
  10862. }
  10863. function a(e) {
  10864. e.style.background = "",
  10865. e.style.cssText += "background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);",
  10866. e.style.cssText += "background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10867. e.style.cssText += "background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10868. e.style.cssText += "background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);",
  10869. e.style.cssText += "background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);"
  10870. }
  10871. var s = function(e, l) {
  10872. function c(e) {
  10873. p(e),
  10874. t.bind(window, "mousemove", p),
  10875. t.bind(window, "mouseup", h)
  10876. }
  10877. function h() {
  10878. t.unbind(window, "mousemove", p),
  10879. t.unbind(window, "mouseup", h)
  10880. }
  10881. function u() {
  10882. var e = n(this.value);
  10883. e !== !1 ? (g.__color.__state = e,
  10884. g.setValue(g.__color.toOriginal())) : this.value = g.__color.toString()
  10885. }
  10886. function d() {
  10887. t.unbind(window, "mousemove", f),
  10888. t.unbind(window, "mouseup", d)
  10889. }
  10890. function p(e) {
  10891. e.preventDefault();
  10892. var i = t.getWidth(g.__saturation_field)
  10893. , n = t.getOffset(g.__saturation_field)
  10894. , r = (e.clientX - n.left + document.body.scrollLeft) / i
  10895. , o = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10896. return o > 1 ? o = 1 : o < 0 && (o = 0),
  10897. r > 1 ? r = 1 : r < 0 && (r = 0),
  10898. g.__color.v = o,
  10899. g.__color.s = r,
  10900. g.setValue(g.__color.toOriginal()),
  10901. !1
  10902. }
  10903. function f(e) {
  10904. e.preventDefault();
  10905. var i = t.getHeight(g.__hue_field)
  10906. , n = t.getOffset(g.__hue_field)
  10907. , r = 1 - (e.clientY - n.top + document.body.scrollTop) / i;
  10908. return r > 1 ? r = 1 : r < 0 && (r = 0),
  10909. g.__color.h = 360 * r,
  10910. g.setValue(g.__color.toOriginal()),
  10911. !1
  10912. }
  10913. s.superclass.call(this, e, l),
  10914. this.__color = new i(this.getValue()),
  10915. this.__temp = new i(0);
  10916. var g = this;
  10917. this.domElement = document.createElement("div"),
  10918. t.makeSelectable(this.domElement, !1),
  10919. this.__selector = document.createElement("div"),
  10920. this.__selector.className = "selector",
  10921. this.__saturation_field = document.createElement("div"),
  10922. this.__saturation_field.className = "saturation-field",
  10923. this.__field_knob = document.createElement("div"),
  10924. this.__field_knob.className = "field-knob",
  10925. this.__field_knob_border = "2px solid ",
  10926. this.__hue_knob = document.createElement("div"),
  10927. this.__hue_knob.className = "hue-knob",
  10928. this.__hue_field = document.createElement("div"),
  10929. this.__hue_field.className = "hue-field",
  10930. this.__input = document.createElement("input"),
  10931. this.__input.type = "text",
  10932. this.__input_textShadow = "0 1px 1px ",
  10933. t.bind(this.__input, "keydown", function(e) {
  10934. 13 === e.keyCode && u.call(this)
  10935. }),
  10936. t.bind(this.__input, "blur", u),
  10937. t.bind(this.__selector, "mousedown", function(e) {
  10938. t.addClass(this, "drag").bind(window, "mouseup", function(e) {
  10939. t.removeClass(g.__selector, "drag")
  10940. })
  10941. });
  10942. var m = document.createElement("div");
  10943. r.extend(this.__selector.style, {
  10944. width: "122px",
  10945. height: "102px",
  10946. padding: "3px",
  10947. backgroundColor: "#222",
  10948. boxShadow: "0px 1px 3px rgba(0,0,0,0.3)"
  10949. }),
  10950. r.extend(this.__field_knob.style, {
  10951. position: "absolute",
  10952. width: "12px",
  10953. height: "12px",
  10954. border: this.__field_knob_border + (this.__color.v < .5 ? "#fff" : "#000"),
  10955. boxShadow: "0px 1px 3px rgba(0,0,0,0.5)",
  10956. borderRadius: "12px",
  10957. zIndex: 1
  10958. }),
  10959. r.extend(this.__hue_knob.style, {
  10960. position: "absolute",
  10961. width: "15px",
  10962. height: "2px",
  10963. borderRight: "4px solid #fff",
  10964. zIndex: 1
  10965. }),
  10966. r.extend(this.__saturation_field.style, {
  10967. width: "100px",
  10968. height: "100px",
  10969. border: "1px solid #555",
  10970. marginRight: "3px",
  10971. display: "inline-block",
  10972. cursor: "pointer"
  10973. }),
  10974. r.extend(m.style, {
  10975. width: "100%",
  10976. height: "100%",
  10977. background: "none"
  10978. }),
  10979. o(m, "top", "rgba(0,0,0,0)", "#000"),
  10980. r.extend(this.__hue_field.style, {
  10981. width: "15px",
  10982. height: "100px",
  10983. display: "inline-block",
  10984. border: "1px solid #555",
  10985. cursor: "ns-resize"
  10986. }),
  10987. a(this.__hue_field),
  10988. r.extend(this.__input.style, {
  10989. outline: "none",
  10990. textAlign: "center",
  10991. color: "#fff",
  10992. border: 0,
  10993. fontWeight: "bold",
  10994. textShadow: this.__input_textShadow + "rgba(0,0,0,0.7)"
  10995. }),
  10996. t.bind(this.__saturation_field, "mousedown", c),
  10997. t.bind(this.__field_knob, "mousedown", c),
  10998. t.bind(this.__hue_field, "mousedown", function(e) {
  10999. f(e),
  11000. t.bind(window, "mousemove", f),
  11001. t.bind(window, "mouseup", d)
  11002. }),
  11003. this.__saturation_field.appendChild(m),
  11004. this.__selector.appendChild(this.__field_knob),
  11005. this.__selector.appendChild(this.__saturation_field),
  11006. this.__selector.appendChild(this.__hue_field),
  11007. this.__hue_field.appendChild(this.__hue_knob),
  11008. this.domElement.appendChild(this.__input),
  11009. this.domElement.appendChild(this.__selector),
  11010. this.updateDisplay()
  11011. };
  11012. s.superclass = e,
  11013. r.extend(s.prototype, e.prototype, {
  11014. updateDisplay: function() {
  11015. var e = n(this.getValue());
  11016. if (e !== !1) {
  11017. var t = !1;
  11018. r.each(i.COMPONENTS, function(i) {
  11019. if (!r.isUndefined(e[i]) && !r.isUndefined(this.__color.__state[i]) && e[i] !== this.__color.__state[i])
  11020. return t = !0,
  11021. {}
  11022. }, this),
  11023. t && r.extend(this.__color.__state, e)
  11024. }
  11025. r.extend(this.__temp.__state, this.__color.__state),
  11026. this.__temp.a = 1;
  11027. var a = this.__color.v < .5 || this.__color.s > .5 ? 255 : 0
  11028. , s = 255 - a;
  11029. r.extend(this.__field_knob.style, {
  11030. marginLeft: 100 * this.__color.s - 7 + "px",
  11031. marginTop: 100 * (1 - this.__color.v) - 7 + "px",
  11032. backgroundColor: this.__temp.toString(),
  11033. border: this.__field_knob_border + "rgb(" + a + "," + a + "," + a + ")"
  11034. }),
  11035. this.__hue_knob.style.marginTop = 100 * (1 - this.__color.h / 360) + "px",
  11036. this.__temp.s = 1,
  11037. this.__temp.v = 1,
  11038. o(this.__saturation_field, "left", "#fff", this.__temp.toString()),
  11039. r.extend(this.__input.style, {
  11040. backgroundColor: this.__input.value = this.__color.toString(),
  11041. color: "rgb(" + a + "," + a + "," + a + ")",
  11042. textShadow: this.__input_textShadow + "rgba(" + s + "," + s + "," + s + ",.7)"
  11043. })
  11044. }
  11045. });
  11046. var l = ["-moz-", "-o-", "-webkit-", "-ms-", ""];
  11047. return s
  11048. }(n.controllers.Controller, n.dom.dom, n.color.Color = function(e, t, i, n) {
  11049. function r(e, t, i) {
  11050. Object.defineProperty(e, t, {
  11051. get: function() {
  11052. return "RGB" === this.__state.space ? this.__state[t] : (a(this, t, i),
  11053. this.__state[t])
  11054. },
  11055. set: function(e) {
  11056. "RGB" !== this.__state.space && (a(this, t, i),
  11057. this.__state.space = "RGB"),
  11058. this.__state[t] = e
  11059. }
  11060. })
  11061. }
  11062. function o(e, t) {
  11063. Object.defineProperty(e, t, {
  11064. get: function() {
  11065. return "HSV" === this.__state.space ? this.__state[t] : (s(this),
  11066. this.__state[t])
  11067. },
  11068. set: function(e) {
  11069. "HSV" !== this.__state.space && (s(this),
  11070. this.__state.space = "HSV"),
  11071. this.__state[t] = e
  11072. }
  11073. })
  11074. }
  11075. function a(e, i, r) {
  11076. if ("HEX" === e.__state.space)
  11077. e.__state[i] = t.component_from_hex(e.__state.hex, r);
  11078. else {
  11079. if ("HSV" !== e.__state.space)
  11080. throw "Corrupted color state";
  11081. n.extend(e.__state, t.hsv_to_rgb(e.__state.h, e.__state.s, e.__state.v))
  11082. }
  11083. }
  11084. function s(e) {
  11085. var i = t.rgb_to_hsv(e.r, e.g, e.b);
  11086. n.extend(e.__state, {
  11087. s: i.s,
  11088. v: i.v
  11089. }),
  11090. n.isNaN(i.h) ? n.isUndefined(e.__state.h) && (e.__state.h = 0) : e.__state.h = i.h
  11091. }
  11092. var l = function() {
  11093. if (this.__state = e.apply(this, arguments),
  11094. this.__state === !1)
  11095. throw "Failed to interpret color arguments";
  11096. this.__state.a = this.__state.a || 1
  11097. };
  11098. return l.COMPONENTS = ["r", "g", "b", "h", "s", "v", "hex", "a"],
  11099. n.extend(l.prototype, {
  11100. toString: function() {
  11101. return i(this)
  11102. },
  11103. toOriginal: function() {
  11104. return this.__state.conversion.write(this)
  11105. }
  11106. }),
  11107. r(l.prototype, "r", 2),
  11108. r(l.prototype, "g", 1),
  11109. r(l.prototype, "b", 0),
  11110. o(l.prototype, "h"),
  11111. o(l.prototype, "s"),
  11112. o(l.prototype, "v"),
  11113. Object.defineProperty(l.prototype, "a", {
  11114. get: function() {
  11115. return this.__state.a
  11116. },
  11117. set: function(e) {
  11118. this.__state.a = e
  11119. }
  11120. }),
  11121. Object.defineProperty(l.prototype, "hex", {
  11122. get: function() {
  11123. return "HEX" !== !this.__state.space && (this.__state.hex = t.rgb_to_hex(this.r, this.g, this.b)),
  11124. this.__state.hex
  11125. },
  11126. set: function(e) {
  11127. this.__state.space = "HEX",
  11128. this.__state.hex = e
  11129. }
  11130. }),
  11131. l
  11132. }(n.color.interpret, n.color.math = function() {
  11133. var e;
  11134. return {
  11135. hsv_to_rgb: function(e, t, i) {
  11136. var n = Math.floor(e / 60) % 6
  11137. , r = e / 60 - Math.floor(e / 60)
  11138. , o = i * (1 - t)
  11139. , a = i * (1 - r * t)
  11140. , s = i * (1 - (1 - r) * t)
  11141. , l = [[i, s, o], [a, i, o], [o, i, s], [o, a, i], [s, o, i], [i, o, a]][n];
  11142. return {
  11143. r: 255 * l[0],
  11144. g: 255 * l[1],
  11145. b: 255 * l[2]
  11146. }
  11147. },
  11148. rgb_to_hsv: function(e, t, i) {
  11149. var n, r, o = Math.min(e, t, i), a = Math.max(e, t, i), s = a - o;
  11150. return 0 == a ? {
  11151. h: NaN,
  11152. s: 0,
  11153. v: 0
  11154. } : (r = s / a,
  11155. n = e == a ? (t - i) / s : t == a ? 2 + (i - e) / s : 4 + (e - t) / s,
  11156. n /= 6,
  11157. n < 0 && (n += 1),
  11158. {
  11159. h: 360 * n,
  11160. s: r,
  11161. v: a / 255
  11162. })
  11163. },
  11164. rgb_to_hex: function(e, t, i) {
  11165. var n = this.hex_with_component(0, 2, e);
  11166. return n = this.hex_with_component(n, 1, t),
  11167. n = this.hex_with_component(n, 0, i)
  11168. },
  11169. component_from_hex: function(e, t) {
  11170. return e >> 8 * t & 255
  11171. },
  11172. hex_with_component: function(t, i, n) {
  11173. return n << (e = 8 * i) | t & ~(255 << e)
  11174. }
  11175. }
  11176. }(), n.color.toString, n.utils.common), n.color.interpret, n.utils.common), n.utils.requestAnimationFrame = function() {
  11177. return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(e, t) {
  11178. window.setTimeout(e, 1e3 / 60)
  11179. }
  11180. }(), n.dom.CenteredDiv = function(e, t) {
  11181. var i = function() {
  11182. this.backgroundElement = document.createElement("div"),
  11183. t.extend(this.backgroundElement.style, {
  11184. backgroundColor: "rgba(0,0,0,0.8)",
  11185. top: 0,
  11186. left: 0,
  11187. display: "none",
  11188. zIndex: "1000",
  11189. opacity: 0,
  11190. WebkitTransition: "opacity 0.2s linear"
  11191. }),
  11192. e.makeFullscreen(this.backgroundElement),
  11193. this.backgroundElement.style.position = "fixed",
  11194. this.domElement = document.createElement("div"),
  11195. t.extend(this.domElement.style, {
  11196. position: "fixed",
  11197. display: "none",
  11198. zIndex: "1001",
  11199. opacity: 0,
  11200. WebkitTransition: "-webkit-transform 0.2s ease-out, opacity 0.2s linear"
  11201. }),
  11202. document.body.appendChild(this.backgroundElement),
  11203. document.body.appendChild(this.domElement);
  11204. var i = this;
  11205. e.bind(this.backgroundElement, "click", function() {
  11206. i.hide()
  11207. })
  11208. };
  11209. return i.prototype.show = function() {
  11210. var e = this;
  11211. this.backgroundElement.style.display = "block",
  11212. this.domElement.style.display = "block",
  11213. this.domElement.style.opacity = 0,
  11214. this.domElement.style.webkitTransform = "scale(1.1)",
  11215. this.layout(),
  11216. t.defer(function() {
  11217. e.backgroundElement.style.opacity = 1,
  11218. e.domElement.style.opacity = 1,
  11219. e.domElement.style.webkitTransform = "scale(1)"
  11220. })
  11221. }
  11222. ,
  11223. i.prototype.hide = function() {
  11224. var t = this
  11225. , i = function() {
  11226. t.domElement.style.display = "none",
  11227. t.backgroundElement.style.display = "none",
  11228. e.unbind(t.domElement, "webkitTransitionEnd", i),
  11229. e.unbind(t.domElement, "transitionend", i),
  11230. e.unbind(t.domElement, "oTransitionEnd", i)
  11231. };
  11232. e.bind(this.domElement, "webkitTransitionEnd", i),
  11233. e.bind(this.domElement, "transitionend", i),
  11234. e.bind(this.domElement, "oTransitionEnd", i),
  11235. this.backgroundElement.style.opacity = 0,
  11236. this.domElement.style.opacity = 0,
  11237. this.domElement.style.webkitTransform = "scale(1.1)"
  11238. }
  11239. ,
  11240. i.prototype.layout = function() {
  11241. this.domElement.style.left = $("#player").width() / 2 - e.getWidth(this.domElement) / 2 + "px",
  11242. this.domElement.style.top = $("#player").height() / 2 - e.getHeight(this.domElement) / 2 + "px"
  11243. }
  11244. ,
  11245. i
  11246. }(n.dom.dom, n.utils.common), n.dom.dom, n.utils.common)
  11247. }
  11248. , {}],
  11249. 94: [function(e, t, i) {
  11250. (function(e) {
  11251. "use strict";
  11252. function i(t) {
  11253. function i(e) {
  11254. for (var t = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], i = 0; i < 64; i++) {
  11255. var n = _((t[i] * e + 50) / 100);
  11256. n < 1 ? n = 1 : n > 255 && (n = 255),
  11257. T[G[i]] = n
  11258. }
  11259. for (var r = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], o = 0; o < 64; o++) {
  11260. var a = _((r[o] * e + 50) / 100);
  11261. a < 1 ? a = 1 : a > 255 && (a = 255),
  11262. x[G[o]] = a
  11263. }
  11264. for (var s = [1, 1.387039845, 1.306562965, 1.175875602, 1, .785694958, .5411961, .275899379], l = 0, c = 0; c < 8; c++)
  11265. for (var h = 0; h < 8; h++)
  11266. S[l] = 1 / (T[G[l]] * s[c] * s[h] * 8),
  11267. M[l] = 1 / (x[G[l]] * s[c] * s[h] * 8),
  11268. l++
  11269. }
  11270. function n(e, t) {
  11271. for (var i = 0, n = 0, r = new Array, o = 1; o <= 16; o++) {
  11272. for (var a = 1; a <= e[o]; a++)
  11273. r[t[n]] = [],
  11274. r[t[n]][0] = i,
  11275. r[t[n]][1] = o,
  11276. n++,
  11277. i++;
  11278. i *= 2
  11279. }
  11280. return r
  11281. }
  11282. function r() {
  11283. C = n(z, W),
  11284. I = n(X, Z),
  11285. E = n(j, Y),
  11286. b = n(q, K)
  11287. }
  11288. function o() {
  11289. for (var e = 1, t = 2, i = 1; i <= 15; i++) {
  11290. for (var n = e; n < t; n++)
  11291. P[32767 + n] = i,
  11292. R[32767 + n] = [],
  11293. R[32767 + n][1] = i,
  11294. R[32767 + n][0] = n;
  11295. for (var r = -(t - 1); r <= -e; r++)
  11296. P[32767 + r] = i,
  11297. R[32767 + r] = [],
  11298. R[32767 + r][1] = i,
  11299. R[32767 + r][0] = t - 1 + r;
  11300. e <<= 1,
  11301. t <<= 1
  11302. }
  11303. }
  11304. function a() {
  11305. for (var e = 0; e < 256; e++)
  11306. H[e] = 19595 * e,
  11307. H[e + 256 >> 0] = 38470 * e,
  11308. H[e + 512 >> 0] = 7471 * e + 32768,
  11309. H[e + 768 >> 0] = -11059 * e,
  11310. H[e + 1024 >> 0] = -21709 * e,
  11311. H[e + 1280 >> 0] = 32768 * e + 8421375,
  11312. H[e + 1536 >> 0] = -27439 * e,
  11313. H[e + 1792 >> 0] = -5329 * e
  11314. }
  11315. function s(e) {
  11316. for (var t = e[0], i = e[1] - 1; i >= 0; )
  11317. t & 1 << i && (N |= 1 << B),
  11318. i--,
  11319. B--,
  11320. B < 0 && (255 == N ? (l(255),
  11321. l(0)) : l(N),
  11322. B = 7,
  11323. N = 0)
  11324. }
  11325. function l(e) {
  11326. D.push(e)
  11327. }
  11328. function c(e) {
  11329. l(e >> 8 & 255),
  11330. l(255 & e)
  11331. }
  11332. function h(e, t) {
  11333. var i, n, r, o, a, s, l, c, h, u = 0, d = 8, p = 64;
  11334. for (h = 0; h < d; ++h) {
  11335. i = e[u],
  11336. n = e[u + 1],
  11337. r = e[u + 2],
  11338. o = e[u + 3],
  11339. a = e[u + 4],
  11340. s = e[u + 5],
  11341. l = e[u + 6],
  11342. c = e[u + 7];
  11343. var f = i + c
  11344. , g = i - c
  11345. , m = n + l
  11346. , v = n - l
  11347. , A = r + s
  11348. , y = r - s
  11349. , C = o + a
  11350. , I = o - a
  11351. , E = f + C
  11352. , b = f - C
  11353. , w = m + A
  11354. , _ = m - A;
  11355. e[u] = E + w,
  11356. e[u + 4] = E - w;
  11357. var T = .707106781 * (_ + b);
  11358. e[u + 2] = b + T,
  11359. e[u + 6] = b - T,
  11360. E = I + y,
  11361. w = y + v,
  11362. _ = v + g;
  11363. var x = .382683433 * (E - _)
  11364. , S = .5411961 * E + x
  11365. , M = 1.306562965 * _ + x
  11366. , R = .707106781 * w
  11367. , P = g + R
  11368. , L = g - R;
  11369. e[u + 5] = L + S,
  11370. e[u + 3] = L - S,
  11371. e[u + 1] = P + M,
  11372. e[u + 7] = P - M,
  11373. u += 8
  11374. }
  11375. for (u = 0,
  11376. h = 0; h < d; ++h) {
  11377. i = e[u],
  11378. n = e[u + 8],
  11379. r = e[u + 16],
  11380. o = e[u + 24],
  11381. a = e[u + 32],
  11382. s = e[u + 40],
  11383. l = e[u + 48],
  11384. c = e[u + 56];
  11385. var D = i + c
  11386. , N = i - c
  11387. , B = n + l
  11388. , F = n - l
  11389. , V = r + s
  11390. , U = r - s
  11391. , k = o + a
  11392. , H = o - a
  11393. , G = D + k
  11394. , z = D - k
  11395. , W = B + V
  11396. , j = B - V;
  11397. e[u] = G + W,
  11398. e[u + 32] = G - W;
  11399. var Y = .707106781 * (j + z);
  11400. e[u + 16] = z + Y,
  11401. e[u + 48] = z - Y,
  11402. G = H + U,
  11403. W = U + F,
  11404. j = F + N;
  11405. var X = .382683433 * (G - j)
  11406. , Z = .5411961 * G + X
  11407. , q = 1.306562965 * j + X
  11408. , K = .707106781 * W
  11409. , Q = N + K
  11410. , J = N - K;
  11411. e[u + 40] = J + Z,
  11412. e[u + 24] = J - Z,
  11413. e[u + 8] = Q + q,
  11414. e[u + 56] = Q - q,
  11415. u++
  11416. }
  11417. var $;
  11418. for (h = 0; h < p; ++h)
  11419. $ = e[h] * t[h],
  11420. O[h] = $ > 0 ? $ + .5 | 0 : $ - .5 | 0;
  11421. return O
  11422. }
  11423. function u() {
  11424. c(65504),
  11425. c(16),
  11426. l(74),
  11427. l(70),
  11428. l(73),
  11429. l(70),
  11430. l(0),
  11431. l(1),
  11432. l(1),
  11433. l(0),
  11434. c(1),
  11435. c(1),
  11436. l(0),
  11437. l(0)
  11438. }
  11439. function d(e, t) {
  11440. c(65472),
  11441. c(17),
  11442. l(8),
  11443. c(t),
  11444. c(e),
  11445. l(3),
  11446. l(1),
  11447. l(17),
  11448. l(0),
  11449. l(2),
  11450. l(17),
  11451. l(1),
  11452. l(3),
  11453. l(17),
  11454. l(1)
  11455. }
  11456. function p() {
  11457. c(65499),
  11458. c(132),
  11459. l(0);
  11460. for (var e = 0; e < 64; e++)
  11461. l(T[e]);
  11462. l(1);
  11463. for (var t = 0; t < 64; t++)
  11464. l(x[t])
  11465. }
  11466. function f() {
  11467. c(65476),
  11468. c(418),
  11469. l(0);
  11470. for (var e = 0; e < 16; e++)
  11471. l(z[e + 1]);
  11472. for (var t = 0; t <= 11; t++)
  11473. l(W[t]);
  11474. l(16);
  11475. for (var i = 0; i < 16; i++)
  11476. l(j[i + 1]);
  11477. for (var n = 0; n <= 161; n++)
  11478. l(Y[n]);
  11479. l(1);
  11480. for (var r = 0; r < 16; r++)
  11481. l(X[r + 1]);
  11482. for (var o = 0; o <= 11; o++)
  11483. l(Z[o]);
  11484. l(17);
  11485. for (var a = 0; a < 16; a++)
  11486. l(q[a + 1]);
  11487. for (var s = 0; s <= 161; s++)
  11488. l(K[s])
  11489. }
  11490. function g() {
  11491. c(65498),
  11492. c(12),
  11493. l(3),
  11494. l(1),
  11495. l(0),
  11496. l(2),
  11497. l(17),
  11498. l(3),
  11499. l(17),
  11500. l(0),
  11501. l(63),
  11502. l(0)
  11503. }
  11504. function m(e, t, i, n, r) {
  11505. for (var o, a = r[0], l = r[240], c = 16, u = 63, d = 64, p = h(e, t), f = 0; f < d; ++f)
  11506. L[G[f]] = p[f];
  11507. var g = L[0] - i;
  11508. i = L[0],
  11509. 0 == g ? s(n[0]) : (o = 32767 + g,
  11510. s(n[P[o]]),
  11511. s(R[o]));
  11512. for (var m = 63; m > 0 && 0 == L[m]; m--)
  11513. ;
  11514. if (0 == m)
  11515. return s(a),
  11516. i;
  11517. for (var v, A = 1; A <= m; ) {
  11518. for (var y = A; 0 == L[A] && A <= m; ++A)
  11519. ;
  11520. var C = A - y;
  11521. if (C >= c) {
  11522. v = C >> 4;
  11523. for (var I = 1; I <= v; ++I)
  11524. s(l);
  11525. C &= 15
  11526. }
  11527. o = 32767 + L[A],
  11528. s(r[(C << 4) + P[o]]),
  11529. s(R[o]),
  11530. A++
  11531. }
  11532. return m != u && s(a),
  11533. i
  11534. }
  11535. function v() {
  11536. for (var e = String.fromCharCode, t = 0; t < 256; t++)
  11537. k[t] = e(t)
  11538. }
  11539. function A(e) {
  11540. if (e <= 0 && (e = 1),
  11541. e > 100 && (e = 100),
  11542. w != e) {
  11543. var t = 0;
  11544. t = e < 50 ? Math.floor(5e3 / e) : Math.floor(200 - 2 * e),
  11545. i(t),
  11546. w = e
  11547. }
  11548. }
  11549. function y() {
  11550. var e = (new Date).getTime();
  11551. t || (t = 50),
  11552. v(),
  11553. r(),
  11554. o(),
  11555. a(),
  11556. A(t);
  11557. (new Date).getTime() - e
  11558. }
  11559. var C, I, E, b, w, _ = (Math.round,
  11560. Math.floor), T = new Array(64), x = new Array(64), S = new Array(64), M = new Array(64), R = new Array(65535), P = new Array(65535), O = new Array(64), L = new Array(64), D = [], N = 0, B = 7, F = new Array(64), V = new Array(64), U = new Array(64), k = new Array(256), H = new Array(2048), G = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], j = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], Y = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], X = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], Z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], q = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], K = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
  11561. this.encode = function(t, i) {
  11562. var n = ((new Date).getTime(),
  11563. i.quality);
  11564. n && A(n),
  11565. D = new Array,
  11566. N = 0,
  11567. B = 7,
  11568. c(65496),
  11569. u(),
  11570. p(),
  11571. d(t.width, t.height),
  11572. f(),
  11573. g();
  11574. var r = 0
  11575. , o = 0
  11576. , a = 0;
  11577. N = 0,
  11578. B = 7,
  11579. this.encode.displayName = "_encode_";
  11580. 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; ) {
  11581. for (l = 0; l < G; ) {
  11582. for (w = G * z + l,
  11583. _ = w,
  11584. T = -1,
  11585. x = 0,
  11586. R = 0; R < 64; R++)
  11587. x = (k ? 63 - R : R) >> 3,
  11588. T = 4 * (7 & R),
  11589. _ = w + x * G + T,
  11590. z + x >= L && (_ -= G * (z + 1 + x - L)),
  11591. l + T >= G && (_ -= l + T - G + 4),
  11592. h = P[_++],
  11593. v = P[_++],
  11594. y = P[_++],
  11595. F[R] = (H[h] + H[v + 256 >> 0] + H[y + 512 >> 0] >> 16) - 128,
  11596. V[R] = (H[h + 768 >> 0] + H[v + 1024 >> 0] + H[y + 1280 >> 0] >> 16) - 128,
  11597. U[R] = (H[h + 1280 >> 0] + H[v + 1536 >> 0] + H[y + 1792 >> 0] >> 16) - 128;
  11598. r = m(F, S, r, C, E),
  11599. o = m(V, M, o, I, b),
  11600. a = m(U, M, a, I, b),
  11601. l += 32
  11602. }
  11603. z += W
  11604. }
  11605. if (B >= 0) {
  11606. var j = [];
  11607. j[1] = B + 1,
  11608. j[0] = (1 << B + 1) - 1,
  11609. s(j)
  11610. }
  11611. return c(65497),
  11612. new e(D)
  11613. }
  11614. ,
  11615. y()
  11616. }
  11617. function n(e, t) {
  11618. t = t || {},
  11619. t.quality = t.quality || 50;
  11620. var n = t.quality
  11621. , r = new i(n)
  11622. , o = r.encode(e, t);
  11623. return {
  11624. data: o,
  11625. width: e.width,
  11626. height: e.height
  11627. }
  11628. }
  11629. t.exports.encode = n
  11630. }
  11631. ).call(this, e("buffer").Buffer)
  11632. }
  11633. , {
  11634. buffer: 198
  11635. }],
  11636. 95: [function(e, t, i) {
  11637. "use strict";
  11638. !function() {
  11639. if ("performance"in window == !1 && (window.performance = {}),
  11640. Date.now = Date.now || function() {
  11641. return (new Date).getTime()
  11642. }
  11643. ,
  11644. "now"in window.performance == !1) {
  11645. var e = Date.now();
  11646. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11647. window.performance.now = function() {
  11648. return Date.now() - e
  11649. }
  11650. }
  11651. }()
  11652. }
  11653. , {}],
  11654. 96: [function(e, t, i) {
  11655. "use strict";
  11656. var n = e("three");
  11657. n.EffectComposer = function(e, t) {
  11658. if (this.renderer = e,
  11659. void 0 === t) {
  11660. var i = {
  11661. minFilter: n.LinearFilter,
  11662. magFilter: n.LinearFilter,
  11663. format: n.RGBAFormat,
  11664. stencilBuffer: !1
  11665. }
  11666. , r = e.getSize();
  11667. t = new n.WebGLRenderTarget(r.width,r.height,i)
  11668. }
  11669. this.renderTarget1 = t,
  11670. this.renderTarget2 = t.clone(),
  11671. this.writeBuffer = this.renderTarget1,
  11672. this.readBuffer = this.renderTarget2,
  11673. this.passes = [],
  11674. void 0 === n.CopyShader && console.error("THREE.EffectComposer relies on THREE.CopyShader"),
  11675. this.copyPass = new n.ShaderPass(n.CopyShader)
  11676. }
  11677. ,
  11678. n.EffectComposer.prototype = {
  11679. swapBuffers: function() {
  11680. var e = this.readBuffer;
  11681. this.readBuffer = this.writeBuffer,
  11682. this.writeBuffer = e
  11683. },
  11684. addPass: function(e) {
  11685. this.passes.push(e)
  11686. },
  11687. insertPass: function(e, t) {
  11688. this.passes.splice(t, 0, e)
  11689. },
  11690. render: function(e) {
  11691. this.writeBuffer = this.renderTarget1,
  11692. this.readBuffer = this.renderTarget2;
  11693. var t, i, r = !1, o = this.passes.length;
  11694. for (i = 0; i < o; i++)
  11695. if (t = this.passes[i],
  11696. t.enabled) {
  11697. if (t.render(this.renderer, this.writeBuffer, this.readBuffer, e, r),
  11698. t.needsSwap) {
  11699. if (r) {
  11700. var a = this.renderer.context;
  11701. a.stencilFunc(a.NOTEQUAL, 1, 4294967295),
  11702. this.copyPass.render(this.renderer, this.writeBuffer, this.readBuffer, e),
  11703. a.stencilFunc(a.EQUAL, 1, 4294967295)
  11704. }
  11705. this.swapBuffers()
  11706. }
  11707. t instanceof n.MaskPass ? r = !0 : t instanceof n.ClearMaskPass && (r = !1)
  11708. }
  11709. },
  11710. reset: function(e) {
  11711. if (void 0 === e) {
  11712. var t = this.renderer.getSize();
  11713. e = this.renderTarget1.clone(),
  11714. e.setSize(t.width, t.height)
  11715. }
  11716. this.renderTarget1.dispose(),
  11717. this.renderTarget2.dispose(),
  11718. this.renderTarget1 = e,
  11719. this.renderTarget2 = e.clone(),
  11720. this.writeBuffer = this.renderTarget1,
  11721. this.readBuffer = this.renderTarget2
  11722. },
  11723. setSize: function(e, t) {
  11724. this.renderTarget1.setSize(e, t),
  11725. this.renderTarget2.setSize(e, t)
  11726. }
  11727. }
  11728. }
  11729. , {
  11730. three: 217
  11731. }],
  11732. 97: [function(e, t, i) {
  11733. "use strict";
  11734. var n = e("three");
  11735. n.MaskPass = function(e, t) {
  11736. this.scene = e,
  11737. this.camera = t,
  11738. this.enabled = !0,
  11739. this.clear = !0,
  11740. this.needsSwap = !1,
  11741. this.inverse = !1
  11742. }
  11743. ,
  11744. n.MaskPass.prototype = {
  11745. render: function(e, t, i, n) {
  11746. var r = e.context;
  11747. r.colorMask(!1, !1, !1, !1),
  11748. r.depthMask(!1);
  11749. var o, a;
  11750. this.inverse ? (o = 0,
  11751. a = 1) : (o = 1,
  11752. a = 0),
  11753. r.enable(r.STENCIL_TEST),
  11754. r.stencilOp(r.REPLACE, r.REPLACE, r.REPLACE),
  11755. r.stencilFunc(r.ALWAYS, o, 4294967295),
  11756. r.clearStencil(a),
  11757. e.render(this.scene, this.camera, i, this.clear),
  11758. e.render(this.scene, this.camera, t, this.clear),
  11759. r.colorMask(!0, !0, !0, !0),
  11760. r.depthMask(!0),
  11761. r.stencilFunc(r.EQUAL, 1, 4294967295),
  11762. r.stencilOp(r.KEEP, r.KEEP, r.KEEP)
  11763. }
  11764. },
  11765. n.ClearMaskPass = function() {
  11766. this.enabled = !0
  11767. }
  11768. ,
  11769. n.ClearMaskPass.prototype = {
  11770. render: function(e, t, i, n) {
  11771. var r = e.context;
  11772. r.disable(r.STENCIL_TEST)
  11773. }
  11774. }
  11775. }
  11776. , {
  11777. three: 217
  11778. }],
  11779. 98: [function(e, t, i) {
  11780. "use strict";
  11781. var n = e("three");
  11782. n.RenderPass = function(e, t, i, r, o) {
  11783. this.scene = e,
  11784. this.camera = t,
  11785. this.overrideMaterial = i,
  11786. this.clearColor = r,
  11787. this.clearAlpha = void 0 !== o ? o : 1,
  11788. this.oldClearColor = new n.Color,
  11789. this.oldClearAlpha = 1,
  11790. this.enabled = !0,
  11791. this.clear = !0,
  11792. this.needsSwap = !1
  11793. }
  11794. ,
  11795. n.RenderPass.prototype = {
  11796. render: function(e, t, i, n) {
  11797. this.scene.overrideMaterial = this.overrideMaterial,
  11798. this.clearColor && (this.oldClearColor.copy(e.getClearColor()),
  11799. this.oldClearAlpha = e.getClearAlpha(),
  11800. e.setClearColor(this.clearColor, this.clearAlpha)),
  11801. e.render(this.scene, this.camera, i, this.clear),
  11802. this.clearColor && e.setClearColor(this.oldClearColor, this.oldClearAlpha),
  11803. this.scene.overrideMaterial = null
  11804. }
  11805. }
  11806. }
  11807. , {
  11808. three: 217
  11809. }],
  11810. 99: [function(e, t, i) {
  11811. "use strict";
  11812. var n = e("three");
  11813. n.ShaderPass = function(e, t) {
  11814. this.textureID = void 0 !== t ? t : "tDiffuse",
  11815. e instanceof n.ShaderMaterial ? (this.uniforms = e.uniforms,
  11816. this.material = e) : e && (this.uniforms = n.UniformsUtils.clone(e.uniforms),
  11817. this.material = new n.ShaderMaterial({
  11818. defines: e.defines || {},
  11819. uniforms: this.uniforms,
  11820. vertexShader: e.vertexShader,
  11821. fragmentShader: e.fragmentShader
  11822. })),
  11823. this.renderToScreen = !1,
  11824. this.enabled = !0,
  11825. this.needsSwap = !0,
  11826. this.clear = !1,
  11827. this.camera = new n.OrthographicCamera(-1,1,1,-1,0,1),
  11828. this.scene = new n.Scene,
  11829. this.quad = new n.Mesh(new n.PlaneBufferGeometry(2,2),null),
  11830. this.scene.add(this.quad)
  11831. }
  11832. ,
  11833. n.ShaderPass.prototype = {
  11834. render: function(e, t, i, n) {
  11835. this.uniforms[this.textureID] && (this.uniforms[this.textureID].value = i),
  11836. this.quad.material = this.material,
  11837. this.renderToScreen ? e.render(this.scene, this.camera) : e.render(this.scene, this.camera, t, this.clear)
  11838. }
  11839. }
  11840. }
  11841. , {
  11842. three: 217
  11843. }],
  11844. 100: [function(e, t, i) {
  11845. "use strict";
  11846. var n = e("three");
  11847. n.CopyShader = {
  11848. uniforms: {
  11849. tDiffuse: {
  11850. type: "t",
  11851. value: null
  11852. },
  11853. opacity: {
  11854. type: "f",
  11855. value: 1
  11856. }
  11857. },
  11858. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11859. fragmentShader: ["uniform float opacity;", "uniform sampler2D tDiffuse;", "varying vec2 vUv;", "void main() {", "vec4 texel = texture2D( tDiffuse, vUv );", "gl_FragColor = opacity * texel;", "}"].join("\n")
  11860. }
  11861. }
  11862. , {
  11863. three: 217
  11864. }],
  11865. 101: [function(e, t, i) {
  11866. "use strict";
  11867. var n = e("three");
  11868. n.HorizontalBlurShader = {
  11869. uniforms: {
  11870. tDiffuse: {
  11871. type: "t",
  11872. value: null
  11873. },
  11874. h: {
  11875. type: "f",
  11876. value: 1 / 512
  11877. }
  11878. },
  11879. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11880. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float h;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  11881. }
  11882. }
  11883. , {
  11884. three: 217
  11885. }],
  11886. 102: [function(e, t, i) {
  11887. "use strict";
  11888. var n = e("three");
  11889. n.VerticalBlurShader = {
  11890. uniforms: {
  11891. tDiffuse: {
  11892. type: "t",
  11893. value: null
  11894. },
  11895. v: {
  11896. type: "f",
  11897. value: 1 / 512
  11898. }
  11899. },
  11900. vertexShader: ["varying vec2 vUv;", "void main() {", "vUv = uv;", "gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );", "}"].join("\n"),
  11901. fragmentShader: ["uniform sampler2D tDiffuse;", "uniform float v;", "varying vec2 vUv;", "void main() {", "vec4 sum = vec4( 0.0 );", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;", "sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;", "gl_FragColor = sum;", "}"].join("\n")
  11902. }
  11903. }
  11904. , {
  11905. three: 217
  11906. }],
  11907. 103: [function(e, t, i) {
  11908. "use strict";
  11909. var n = e("three");
  11910. !function() {
  11911. if ("performance"in window == 0 && (window.performance = {}),
  11912. "now"in window.performance == 0) {
  11913. var e = Date.now();
  11914. performance.timing && performance.timing.navigationStart && (e = performance.timing.navigationStart),
  11915. window.performance.now = function() {
  11916. return Date.now() - e
  11917. }
  11918. }
  11919. }(),
  11920. n.WebGLRenderer.prototype.paramThreeToGL = function(e) {
  11921. var t, i = this.extensions, r = this.context;
  11922. if (e === n.RepeatWrapping)
  11923. return r.REPEAT;
  11924. if (e === n.ClampToEdgeWrapping)
  11925. return r.CLAMP_TO_EDGE;
  11926. if (e === n.MirroredRepeatWrapping)
  11927. return r.MIRRORED_REPEAT;
  11928. if (e === n.NearestFilter)
  11929. return r.NEAREST;
  11930. if (e === n.NearestMipMapNearestFilter)
  11931. return r.NEAREST_MIPMAP_NEAREST;
  11932. if (e === n.NearestMipMapLinearFilter)
  11933. return r.NEAREST_MIPMAP_LINEAR;
  11934. if (e === n.LinearFilter)
  11935. return r.LINEAR;
  11936. if (e === n.LinearMipMapNearestFilter)
  11937. return r.LINEAR_MIPMAP_NEAREST;
  11938. if (e === n.LinearMipMapLinearFilter)
  11939. return r.LINEAR_MIPMAP_LINEAR;
  11940. if (e === n.UnsignedByteType)
  11941. return r.UNSIGNED_BYTE;
  11942. if (e === n.UnsignedShort4444Type)
  11943. return r.UNSIGNED_SHORT_4_4_4_4;
  11944. if (e === n.UnsignedShort5551Type)
  11945. return r.UNSIGNED_SHORT_5_5_5_1;
  11946. if (e === n.UnsignedShort565Type)
  11947. return r.UNSIGNED_SHORT_5_6_5;
  11948. if (e === n.ByteType)
  11949. return r.BYTE;
  11950. if (e === n.ShortType)
  11951. return r.SHORT;
  11952. if (e === n.UnsignedShortType)
  11953. return r.UNSIGNED_SHORT;
  11954. if (e === n.IntType)
  11955. return r.INT;
  11956. if (e === n.UnsignedIntType)
  11957. return r.UNSIGNED_INT;
  11958. if (e === n.FloatType)
  11959. return r.FLOAT;
  11960. if (t = i.get("OES_texture_half_float"),
  11961. null !== t && e === n.HalfFloatType)
  11962. return t.HALF_FLOAT_OES;
  11963. if (e === n.AlphaFormat)
  11964. return r.ALPHA;
  11965. if (e === n.RGBFormat)
  11966. return r.RGB;
  11967. if (e === n.RGBAFormat)
  11968. return r.RGBA;
  11969. if (e === n.LuminanceFormat)
  11970. return r.LUMINANCE;
  11971. if (e === n.LuminanceAlphaFormat)
  11972. return r.LUMINANCE_ALPHA;
  11973. if (e === n.AddEquation)
  11974. return r.FUNC_ADD;
  11975. if (e === n.SubtractEquation)
  11976. return r.FUNC_SUBTRACT;
  11977. if (e === n.ReverseSubtractEquation)
  11978. return r.FUNC_REVERSE_SUBTRACT;
  11979. if (e === n.ZeroFactor)
  11980. return r.ZERO;
  11981. if (e === n.OneFactor)
  11982. return r.ONE;
  11983. if (e === n.SrcColorFactor)
  11984. return r.SRC_COLOR;
  11985. if (e === n.OneMinusSrcColorFactor)
  11986. return r.ONE_MINUS_SRC_COLOR;
  11987. if (e === n.SrcAlphaFactor)
  11988. return r.SRC_ALPHA;
  11989. if (e === n.OneMinusSrcAlphaFactor)
  11990. return r.ONE_MINUS_SRC_ALPHA;
  11991. if (e === n.DstAlphaFactor)
  11992. return r.DST_ALPHA;
  11993. if (e === n.OneMinusDstAlphaFactor)
  11994. return r.ONE_MINUS_DST_ALPHA;
  11995. if (e === n.DstColorFactor)
  11996. return r.DST_COLOR;
  11997. if (e === n.OneMinusDstColorFactor)
  11998. return r.ONE_MINUS_DST_COLOR;
  11999. if (e === n.SrcAlphaSaturateFactor)
  12000. return r.SRC_ALPHA_SATURATE;
  12001. if (t = i.get("WEBGL_compressed_texture_s3tc"),
  12002. null !== t) {
  12003. if (e === n.RGB_S3TC_DXT1_Format)
  12004. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  12005. if (e === n.RGBA_S3TC_DXT1_Format)
  12006. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  12007. if (e === n.RGBA_S3TC_DXT3_Format)
  12008. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  12009. if (e === n.RGBA_S3TC_DXT5_Format)
  12010. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  12011. }
  12012. if (t = i.get("WEBGL_compressed_texture_pvrtc"),
  12013. null !== t) {
  12014. if (e === n.RGB_PVRTC_4BPPV1_Format)
  12015. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  12016. if (e === n.RGB_PVRTC_2BPPV1_Format)
  12017. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  12018. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  12019. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  12020. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  12021. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  12022. }
  12023. if (t = i.get("WEBGL_compressed_texture_etc1"),
  12024. null !== t && e === n.RGB_ETC1_Format)
  12025. return t.COMPRESSED_RGB_ETC1_WEBGL;
  12026. if (t = i.get("EXT_blend_minmax"),
  12027. null !== t) {
  12028. if (e === n.MinEquation)
  12029. return t.MIN_EXT;
  12030. if (e === n.MaxEquation)
  12031. return t.MAX_EXT
  12032. }
  12033. return 0
  12034. }
  12035. ,
  12036. n.WebGLState = function(e, t, i) {
  12037. var r = this
  12038. , o = new n.Vector4
  12039. , a = e.getParameter(e.MAX_VERTEX_ATTRIBS)
  12040. , s = new Uint8Array(a)
  12041. , l = new Uint8Array(a)
  12042. , c = new Uint8Array(a)
  12043. , h = {}
  12044. , u = null
  12045. , d = null
  12046. , p = null
  12047. , f = null
  12048. , g = null
  12049. , m = null
  12050. , v = null
  12051. , A = null
  12052. , y = !1
  12053. , C = null
  12054. , I = null
  12055. , E = null
  12056. , b = null
  12057. , w = null
  12058. , _ = null
  12059. , T = null
  12060. , x = null
  12061. , S = null
  12062. , M = null
  12063. , R = null
  12064. , P = null
  12065. , O = null
  12066. , L = null
  12067. , D = null
  12068. , N = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  12069. , B = void 0
  12070. , F = {}
  12071. , V = new n.Vector4
  12072. , U = null
  12073. , k = null
  12074. , H = new n.Vector4
  12075. , G = new n.Vector4;
  12076. this.init = function() {
  12077. this.clearColor(0, 0, 0, 1),
  12078. this.clearDepth(1),
  12079. this.clearStencil(0),
  12080. this.enable(e.DEPTH_TEST),
  12081. e.depthFunc(e.LEQUAL),
  12082. e.frontFace(e.CCW),
  12083. e.cullFace(e.BACK),
  12084. this.enable(e.CULL_FACE),
  12085. this.enable(e.BLEND),
  12086. e.blendEquation(e.FUNC_ADD),
  12087. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  12088. }
  12089. ,
  12090. this.initAttributes = function() {
  12091. for (var e = 0, t = s.length; e < t; e++)
  12092. s[e] = 0
  12093. }
  12094. ,
  12095. this.enableAttribute = function(i) {
  12096. if (s[i] = 1,
  12097. 0 === l[i] && (e.enableVertexAttribArray(i),
  12098. l[i] = 1),
  12099. 0 !== c[i]) {
  12100. var n = t.get("ANGLE_instanced_arrays");
  12101. n.vertexAttribDivisorANGLE(i, 0),
  12102. c[i] = 0
  12103. }
  12104. }
  12105. ,
  12106. this.enableAttributeAndDivisor = function(t, i, n) {
  12107. s[t] = 1,
  12108. 0 === l[t] && (e.enableVertexAttribArray(t),
  12109. l[t] = 1),
  12110. c[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  12111. c[t] = i)
  12112. }
  12113. ,
  12114. this.disableUnusedAttributes = function() {
  12115. for (var t = 0, i = l.length; t < i; t++)
  12116. l[t] !== s[t] && (e.disableVertexAttribArray(t),
  12117. l[t] = 0)
  12118. }
  12119. ,
  12120. this.enable = function(t) {
  12121. h[t] !== !0 && (e.enable(t),
  12122. h[t] = !0)
  12123. }
  12124. ,
  12125. this.disable = function(t) {
  12126. h[t] !== !1 && (e.disable(t),
  12127. h[t] = !1)
  12128. }
  12129. ,
  12130. this.getCompressedTextureFormats = function() {
  12131. if (null === u && (u = [],
  12132. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  12133. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  12134. u.push(i[n]);
  12135. return u
  12136. }
  12137. ,
  12138. this.setBlending = function(t, r, o, a, s, l, c, h) {
  12139. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  12140. t === d && h === y || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12141. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  12142. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12143. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12144. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12145. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  12146. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12147. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  12148. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  12149. d = t,
  12150. y = h),
  12151. t === n.CustomBlending ? (s = s || r,
  12152. l = l || o,
  12153. c = c || a,
  12154. r === p && s === m || (e.blendEquationSeparate(i(r), i(s)),
  12155. p = r,
  12156. m = s),
  12157. o === f && a === g && l === v && c === A || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  12158. f = o,
  12159. g = a,
  12160. v = l,
  12161. A = c)) : (p = null,
  12162. f = null,
  12163. g = null,
  12164. m = null,
  12165. v = null,
  12166. A = null)
  12167. }
  12168. ,
  12169. this.setDepthFunc = function(t) {
  12170. if (C !== t) {
  12171. if (t)
  12172. switch (t) {
  12173. case n.NeverDepth:
  12174. e.depthFunc(e.NEVER);
  12175. break;
  12176. case n.AlwaysDepth:
  12177. e.depthFunc(e.ALWAYS);
  12178. break;
  12179. case n.LessDepth:
  12180. e.depthFunc(e.LESS);
  12181. break;
  12182. case n.LessEqualDepth:
  12183. e.depthFunc(e.LEQUAL);
  12184. break;
  12185. case n.EqualDepth:
  12186. e.depthFunc(e.EQUAL);
  12187. break;
  12188. case n.GreaterEqualDepth:
  12189. e.depthFunc(e.GEQUAL);
  12190. break;
  12191. case n.GreaterDepth:
  12192. e.depthFunc(e.GREATER);
  12193. break;
  12194. case n.NotEqualDepth:
  12195. e.depthFunc(e.NOTEQUAL);
  12196. break;
  12197. default:
  12198. e.depthFunc(e.LEQUAL)
  12199. }
  12200. else
  12201. e.depthFunc(e.LEQUAL);
  12202. C = t
  12203. }
  12204. }
  12205. ,
  12206. this.setDepthTest = function(t) {
  12207. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  12208. }
  12209. ,
  12210. this.setDepthWrite = function(t) {
  12211. I !== t && (e.depthMask(t),
  12212. I = t)
  12213. }
  12214. ,
  12215. this.setColorWrite = function(t) {
  12216. E !== t && (e.colorMask(t, t, t, t),
  12217. E = t)
  12218. }
  12219. ,
  12220. this.setStencilFunc = function(t, i, n) {
  12221. w === t && _ === i && T === n || (e.stencilFunc(t, i, n),
  12222. w = t,
  12223. _ = i,
  12224. T = n)
  12225. }
  12226. ,
  12227. this.setStencilOp = function(t, i, n) {
  12228. x === t && S === i && M === n || (e.stencilOp(t, i, n),
  12229. x = t,
  12230. S = i,
  12231. M = n)
  12232. }
  12233. ,
  12234. this.setStencilTest = function(t) {
  12235. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  12236. }
  12237. ,
  12238. this.setStencilWrite = function(t) {
  12239. b !== t && (e.stencilMask(t),
  12240. b = t)
  12241. }
  12242. ,
  12243. this.setFlipSided = function(t) {
  12244. R !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  12245. R = t)
  12246. }
  12247. ,
  12248. this.setLineWidth = function(t) {
  12249. t !== P && (e.lineWidth(t),
  12250. P = t)
  12251. }
  12252. ,
  12253. this.setPolygonOffset = function(t, i, n) {
  12254. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  12255. !t || O === i && L === n || (e.polygonOffset(i, n),
  12256. O = i,
  12257. L = n)
  12258. }
  12259. ,
  12260. this.getScissorTest = function() {
  12261. return D
  12262. }
  12263. ,
  12264. this.setScissorTest = function(t) {
  12265. D = t,
  12266. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  12267. }
  12268. ,
  12269. this.activeTexture = function(t) {
  12270. void 0 === t && (t = e.TEXTURE0 + N - 1),
  12271. B !== t && (e.activeTexture(t),
  12272. B = t)
  12273. }
  12274. ,
  12275. this.bindTexture = function(t, i) {
  12276. void 0 === B && r.activeTexture();
  12277. var n = F[B];
  12278. void 0 === n && (n = {
  12279. type: void 0,
  12280. texture: void 0
  12281. },
  12282. F[B] = n),
  12283. n.type === t && n.texture === i || (e.bindTexture(t, i),
  12284. n.type = t,
  12285. n.texture = i)
  12286. }
  12287. ,
  12288. this.compressedTexImage2D = function() {
  12289. try {
  12290. e.compressedTexImage2D.apply(e, arguments)
  12291. } catch (e) {
  12292. console.error(e)
  12293. }
  12294. }
  12295. ,
  12296. this.texImage2D = function() {
  12297. try {
  12298. e.texImage2D.apply(e, arguments)
  12299. } catch (e) {
  12300. console.error(e)
  12301. }
  12302. }
  12303. ,
  12304. this.clearColor = function(t, i, n, r) {
  12305. o.set(t, i, n, r),
  12306. V.equals(o) === !1 && (e.clearColor(t, i, n, r),
  12307. V.copy(o))
  12308. }
  12309. ,
  12310. this.clearDepth = function(t) {
  12311. U !== t && (e.clearDepth(t),
  12312. U = t)
  12313. }
  12314. ,
  12315. this.clearStencil = function(t) {
  12316. k !== t && (e.clearStencil(t),
  12317. k = t)
  12318. }
  12319. ,
  12320. this.scissor = function(t) {
  12321. H.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  12322. H.copy(t))
  12323. }
  12324. ,
  12325. this.viewport = function(t) {
  12326. G.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  12327. G.copy(t))
  12328. }
  12329. ,
  12330. this.reset = function() {
  12331. for (var t = 0; t < l.length; t++)
  12332. 1 === l[t] && (e.disableVertexAttribArray(t),
  12333. l[t] = 0);
  12334. h = {},
  12335. u = null,
  12336. B = void 0,
  12337. F = {},
  12338. d = null,
  12339. E = null,
  12340. I = null,
  12341. b = null,
  12342. R = null
  12343. }
  12344. }
  12345. }
  12346. , {
  12347. three: 217
  12348. }],
  12349. 104: [function(e, t, i) {
  12350. (function(i, n) {
  12351. "use strict";
  12352. function r(e) {
  12353. this.urls = e;
  12354. var t = i("bWVzc2FnZSBiaW5hcnlfbWVzaCB7CglyZXBlYXRlZCBjaHVua19zaW1wbGUgY2h1bmsgPSAxOwoJcmVwZWF0ZWQgY2h1bmtfcXVhbnRpemVkIHF1YW50aXplZF9jaHVuayA9IDI7Cn0KCi8vIERlZmluaXRpb24gb2YgdmVydGljZXM6IDNEIGNvb3JkaW5hdGVzLCBhbmQgMkQgdGV4dHVyZSBjb29yZGluYXRlcy4KbWVzc2FnZSB2ZXJ0aWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgZmxvYXQgeHl6ID0gMSBbcGFja2VkPXRydWVdOyAgLy8geF8wLHlfMCx6XzAsIHhfMSx5XzEsel8xLCAuLi4KCXJlcGVhdGVkIGZsb2F0IHV2ID0gMiBbcGFja2VkPXRydWVdOyAgLy8gdV8wLHZfMCwgdV8xLHZfMSwgLi4uCn0KCi8vIEluZGV4ZXMgb2YgdmVydGljZXMgb2YgZmFjZXMKbWVzc2FnZSBmYWNlc19zaW1wbGUgewoJcmVwZWF0ZWQgdWludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgovLyBBIHNpbXBseSBlbmNvZGVkIGNodW5rLgovLyBUT0RPOiBhZGQgY2h1bmsgcHJvcGVyaXRlcyAoc3VjaCBhcyAicmVmbGVjdGl2ZSIpCm1lc3NhZ2UgY2h1bmtfc2ltcGxlIHsKCW9wdGlvbmFsIHZlcnRpY2VzX3NpbXBsZSB2ZXJ0aWNlcyA9IDE7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSAyOwoJb3B0aW9uYWwgc3RyaW5nIGNodW5rX25hbWUgPSAzOwoJb3B0aW9uYWwgc3RyaW5nIG1hdGVyaWFsX25hbWUgPSA0Owp9CgovLyBRdWFudGl6ZWQgdmVyc2lvbnMgZm9sbG93OgptZXNzYWdlIHZlcnRpY2VzX3F1YW50aXplZCB7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAxOwoJcmVwZWF0ZWQgZmxvYXQgdHJhbnNsYXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHggPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgeSA9IDQgW3BhY2tlZD10cnVlXTsKCXJlcGVhdGVkIHNpbnQzMiB6ID0gNSBbcGFja2VkPXRydWVdOwp9CgptZXNzYWdlIHV2X3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgbmFtZSA9IDE7CglvcHRpb25hbCBmbG9hdCBxdWFudGl6YXRpb24gPSAyOwoJcmVwZWF0ZWQgc2ludDMyIHUgPSAzIFtwYWNrZWQ9dHJ1ZV07CglyZXBlYXRlZCBzaW50MzIgdiA9IDQgW3BhY2tlZD10cnVlXTsKfQoKLy8gSW5kZXhlcyBvZiB2ZXJ0aWNlcyBvZiBmYWNlcwptZXNzYWdlIGZhY2VzX2NvbXByZXNzZWQgewoJcmVwZWF0ZWQgc2ludDMyIGZhY2VzID0gMSBbcGFja2VkPXRydWVdOyAvLyBpMDAsaTAxLGkwMiwgaTEwLGkxMSxpMTIsIC4uLgp9CgptZXNzYWdlIGNodW5rX3F1YW50aXplZCB7CglvcHRpb25hbCBzdHJpbmcgY2h1bmtfbmFtZSA9IDE7CglvcHRpb25hbCBzdHJpbmcgbWF0ZXJpYWxfbmFtZSA9IDI7CglvcHRpb25hbCB2ZXJ0aWNlc19xdWFudGl6ZWQgdmVydGljZXMgPSAzOwoJcmVwZWF0ZWQgdXZfcXVhbnRpemVkIHV2cyA9IDQ7CglvcHRpb25hbCBmYWNlc19zaW1wbGUgZmFjZXMgPSA1Owp9Cg==", "base64");
  12355. this.builder = a.loadProto(t),
  12356. this.decoder = this.builder.build("binary_mesh")
  12357. }
  12358. var o = e("three")
  12359. , a = e("protobufjs")
  12360. , s = e("../util/logger")
  12361. , l = (e("../util/common"),
  12362. e("../util/ajax"))
  12363. , c = e("../objects/Chunk")
  12364. , h = new s(n);
  12365. r.prototype = {
  12366. constructor: r,
  12367. load: function(e, t, i, n) {
  12368. return h.time("download"),
  12369. l.get(e, {
  12370. responseType: "arraybuffer"
  12371. }).done(function(r) {
  12372. h.timeEnd("download"),
  12373. this.parse(r, e, t, i, n)
  12374. }
  12375. .bind(this)).fail(n)
  12376. },
  12377. parse: function(e, t, i, n, r) {
  12378. var o = this.readProtobuf(e);
  12379. if (!o)
  12380. return r();
  12381. try {
  12382. h.time("convert to webgl"),
  12383. this.convertProtobufToSceneObject(o, t, i, n, r),
  12384. h.timeEnd("convert to webgl")
  12385. } catch (e) {
  12386. return h.error("failed parsing .dam"),
  12387. h.error(e.message),
  12388. r()
  12389. }
  12390. },
  12391. readProtobuf: function(e) {
  12392. var t;
  12393. try {
  12394. h.time("parse proto"),
  12395. t = this.decoder.decode(e),
  12396. h.timeEnd("parse proto")
  12397. } catch (e) {
  12398. return h.error("failed parsing proto for .dam"),
  12399. h.error(e.message),
  12400. null
  12401. }
  12402. return t
  12403. },
  12404. convertProtobufToSceneObject: function(e, t, i, n, r) {
  12405. function a(e) {
  12406. var i = new o.BufferGeometry;
  12407. return i.addAttribute("position", new o.BufferAttribute(new Float32Array(e.vertices.xyz,0,3),3)),
  12408. e.vertices.uv.length > 0 && i.addAttribute("uv", new o.BufferAttribute(new Float32Array(e.vertices.uv,0,2),2)),
  12409. i.setIndex(new o.BufferAttribute(new Uint32Array(e.faces.faces,0,1),1)),
  12410. i.applyMatrix(s),
  12411. i.computeBoundingBox(),
  12412. new c({
  12413. geometry: i,
  12414. textureName: e.material_name,
  12415. name: e.chunk_name,
  12416. meshUrl: t
  12417. })
  12418. }
  12419. if (0 === e.chunk.length)
  12420. return h.warn("No chunks in damfile..."),
  12421. i([]);
  12422. var s = new o.Matrix4;
  12423. s.set(1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0, 1);
  12424. var l = e.chunk.map(a);
  12425. return l ? i(l) : (h.error(".dam protobuf came out with no chunks..."),
  12426. r())
  12427. }
  12428. },
  12429. t.exports = r
  12430. }
  12431. ).call(this, e("buffer").Buffer, "/js/loaders/DamLoader.js")
  12432. }
  12433. , {
  12434. "../objects/Chunk": 144,
  12435. "../util/ajax": 181,
  12436. "../util/common": 185,
  12437. "../util/logger": 189,
  12438. buffer: 198,
  12439. protobufjs: 214,
  12440. three: 217
  12441. }],
  12442. 105: [function(e, t, i) {
  12443. (function(i) {
  12444. "use strict";
  12445. var n = (e("three"),
  12446. e("../settings"),
  12447. e("../util/browser"),
  12448. e("./DamLoader"))
  12449. , r = e("../util/logger")
  12450. , o = (e("../ab"),
  12451. new r(i));
  12452. t.exports = {
  12453. getLoaders: function() {
  12454. return [["_50k", ".dam", n], ["", ".dam", n]]
  12455. },
  12456. load: function(e, t, i, n, r, a) {
  12457. var s = this.getLoaders();
  12458. a = a || 0;
  12459. var l = s[a];
  12460. if (!l)
  12461. return void (r && r("No suitable model file found..."));
  12462. var c = l[0]
  12463. , h = l[1]
  12464. , u = new l[2](t)
  12465. , d = t.get(e + c + h);
  12466. d ? (o.debug("Trying " + c + h),
  12467. u.load(d, i, n, function() {
  12468. this.load(e, t, i, n, r, ++a)
  12469. }
  12470. .bind(this))) : (o.debug("Skipping " + h + ", not available"),
  12471. this.load(e, t, i, n, r, ++a))
  12472. }
  12473. }
  12474. }
  12475. ).call(this, "/js/loaders/ModelLoader.js")
  12476. }
  12477. , {
  12478. "../ab": 3,
  12479. "../settings": 166,
  12480. "../util/browser": 182,
  12481. "../util/logger": 189,
  12482. "./DamLoader": 104,
  12483. three: 217
  12484. }],
  12485. 106: [function(e, t, i) {
  12486. (function(i) {
  12487. "use strict";
  12488. var n = e("../util/common")
  12489. , r = e("../util/texture")
  12490. , o = e("../util/browser")
  12491. , a = e("../util/logger")
  12492. , s = e("../settings")
  12493. , l = new a(i);
  12494. t.exports = {
  12495. load: function(e, t) {
  12496. function i(e, i) {
  12497. e || (t.push(i),
  12498. p++,
  12499. d.notify(p, a),
  12500. p === a && d.resolve())
  12501. }
  12502. if (!e.chunks[0] || !e.chunks[0].meshUrl)
  12503. return $.when();
  12504. var a = n.countUnique(e.chunks.map(function(e) {
  12505. return e.textureName
  12506. }))
  12507. , c = e.chunks[0].meshUrl.indexOf("_50k") !== -1 ? "_50k" : ""
  12508. , h = "_50k" === c ? "high" : "low";
  12509. s.minimalMemoryMode && "high" === h && (o.detectSamsungS6() ? (l.warn("Galaxy S6 cannot handle large textures, turning down quality."),
  12510. h = "low") : a > s.maxMobileTextures && (l.warn("Model probably too large for mobile, turning down quality."),
  12511. h = "low"));
  12512. var u = e.data.job.uuid + c + "_texture_jpg_" + h + "/"
  12513. , d = $.Deferred()
  12514. , p = 0;
  12515. return e.chunks.forEach(function(t) {
  12516. if (!t.material.map && t.textureName) {
  12517. var n = e.urls.get(u + t.textureName);
  12518. t.setTextureMap(r.load(n, i.bind(this, r.isLoaded(n))))
  12519. }
  12520. }),
  12521. d.promise()
  12522. }
  12523. }
  12524. }
  12525. ).call(this, "/js/loaders/ModelTextureLoader.js")
  12526. }
  12527. , {
  12528. "../settings": 166,
  12529. "../util/browser": 182,
  12530. "../util/common": 185,
  12531. "../util/logger": 189,
  12532. "../util/texture": 194
  12533. }],
  12534. 107: [function(e, t, i) {
  12535. (function(i, n) {
  12536. "use strict";
  12537. function r(e) {
  12538. this.model = e,
  12539. this.modelDataPath = this.model.urls.get("vision.modeldata"),
  12540. this.sweepLocationsPath = this.model.urls.get("sweep_locations.csv");
  12541. var t = i("Ly8gUHJvdG9jb2wgQnVmZmVyIGZvciBwdWNrIHZpc2liaWxpdHkgYW5kIHJlbGF0ZWQgZGF0YQovLwovLyBUbyBkdW1wIG91dCBhIGJpbnJheSBtYW5pZmVzdCBpbiB0ZXh0IGZvcm1hdCwgeW91IGNhbiB1c2UgcHJvdG9jIGRpcmVjdGx5OgovLyAgIHByb3RvYyAtLXByb3RvX3BhdGggfi9kZXYvbXBfdmlzaW9uLyAgLS1kZWNvZGU9ZW9zLnN0b3JhZ2UuVmlzaW9uTW9kZWxkYXRhIH4vZGV2L21wX3Zpc2lvbi9lb3Mvc3RvcmFnZS92aXNpb25fbW9kZWxkYXRhLnByb3RvIDwgdmlzaW9uLm1vZGVsZGF0YQoKLy8gcGFja2FnZSBlb3Muc3RvcmFnZTsKCi8vIGltcG9ydCAiZW9zL2luZnJhL2NvbW1vbi5wcm90byI7Ci8vIFRoZSBmb2xsb3dpbmcgd2VyZSBtYW51YWxseSBleHRyYWN0ZWQgaGVyZSwgSlMgZG9lcyBub3QgbGlrZSBwcm90b2J1ZiBpbXBvcnRzCgptZXNzYWdlIEFmZmluZTNmIHsKCW9wdGlvbmFsIFF1YXRlcm5pb25mIHJvdGF0aW9uID0gMTsKCW9wdGlvbmFsIFZlY3RvcjNmIHRyYW5zbGF0aW9uID0gMjsKfQoKbWVzc2FnZSBRdWF0ZXJuaW9uZiB7CglvcHRpb25hbCBmbG9hdCB3ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHggPSAyOwoJb3B0aW9uYWwgZmxvYXQgeSA9IDM7CglvcHRpb25hbCBmbG9hdCB6ID0gNDsKfQoKbWVzc2FnZSBWZWN0b3IzZiB7CglvcHRpb25hbCBmbG9hdCB4ID0gMTsKCW9wdGlvbmFsIGZsb2F0IHkgPSAyOwoJb3B0aW9uYWwgZmxvYXQgeiA9IDM7Cn0KCi8vCi8vIE9uZSBzd2VlcCAvIHBhbm8KLy8KbWVzc2FnZSBTd2VlcExvY2F0aW9uIHsKCW9wdGlvbmFsIGJ5dGVzIHV1aWQgPSAxOyAgLyogdXVpZCAqLwoJb3B0aW9uYWwgQWZmaW5lM2YgcG9zZSA9IDI7ICAvKiBjYW1lcmEgcG9zZSAoeCwgeSx6KSBpbiBtZXRlciBhbmQgYSBxdWF0ZXJuaW9uKi8KCW9wdGlvbmFsIFZlY3RvcjNmIHB1Y2sgPSAzOyAgLyogcHVjayBsb2NhdGlvbiAtIHggYW55IGlzIGdlbmVyYWxseSB0aGUgc2FtZSBhcyBwb3NlLCB6IGlzIHRoZSBoZWlnaHQgb2YgdGhlIGNsb3Nlc3QgZmxvb3IgdW5kZXIgdGhlIGNhbWVyYSAqLwoJb3B0aW9uYWwgaW50MzIgZ3JvdXAgPSA0OyAgLyogZmxvb3IgaW5kZXggKi8KCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gNTsgIC8qIHJvb20gaW5kZXggKi8KCXJlcGVhdGVkIGludDMyIHZpc2libGVzID0gNjsgIC8qIGxpc3Qgb2YgaW5kaWNlcyB0byBhbGwgcHVja3MgdmlzaWJsZSBmcm9tIHRoaXMgcHVjayAqLwoJcmVwZWF0ZWQgZmxvYXQgc2NvcmVzID0gNzsgLyogdXNlZCBhcyBwYXJ0IG9mIHNjb3JpbmcgZnVuY3Rpb24gZm9yIGRldGVybWluaW5nIHdoaWNoIHB1Y2sgdG8gZ28gdG8gbmV4dCAqLwogIG9wdGlvbmFsIHN0cmluZyBzd2VlcF9uYW1lID0gODsKCiAgLy8gV2l0aCBvdXRkb29yIHBhbm9zLCB3ZSBoYXZlIGEgY291cGxlIG9mIGRpZmZlcmVudCBzaXR1YXRpb25zIGZvciBhbGlnbm1lbnQuIFRoZSBjb21tb24KICAvLyBjYXNlIGlzIHRoYXQgdGhlIHBhbm8gYWxpZ25lZCBub3JtYWxseS4gSXQgY291bGQgYWxzbyBoYXZlIGJlZW4gcGxhY2VkIG1hbnVhbGx5IGluCiAgLy8gQ2FwdHVyZUFwcCBvciBXb3Jrc2hvcCwgb3IgbGVmdCB1bmFsaWduZWQgZm9yIGhpZ2hsaWdodC1yZWVsIHZpZXdpbmcuCiAgZW51bSBBbGlnbm1lbnRUeXBlCiAgewogICAgICBVTktOT1dOID0gMDsKICAgICAgQUxJR05FRCA9IDE7CiAgICAgIFVOQUxJR05FRCA9IDI7CiAgICAgIE1BTlVBTExZX1BMQUNFRCA9IDM7CiAgfQogIG9wdGlvbmFsIEFsaWdubWVudFR5cGUgYWxpZ25tZW50X3R5cGUgPSA5IFtkZWZhdWx0ID0gQUxJR05FRF07Cn0KCm1lc3NhZ2UgU3ViZ3JvdXBJbmZvIHsKCW9wdGlvbmFsIGludDMyIHN1Ymdyb3VwID0gMTsKCW9wdGlvbmFsIGZsb2F0IGFyZWEgPSAyOyAvKiBmbG9vciBhcmVhIGluIG1eMiAoc3F1YXJlIG1ldGVyYWdlKSAqLwp9CgovKiBBbGwgcHVja3MgaW4gYSBtb2RlbC4gUHVja3MgYXJlIHN0b3JlZCBpbiBzY2FubmluZyBvcmRlci4gKi8KbWVzc2FnZSBWaXNpb25Nb2RlbGRhdGEgewoJcmVwZWF0ZWQgU3dlZXBMb2NhdGlvbiBzd2VlcExvY2F0aW9ucyA9IDE7CglyZXBlYXRlZCBTdWJncm91cEluZm8gc3ViZ3JvdXBJbmZvcyA9IDI7Cn0K", "base64")
  12542. , n = o.loadProto(t);
  12543. this.decoder = n.build("VisionModeldata")
  12544. }
  12545. var o = e("protobufjs")
  12546. , a = e("../util/ajax")
  12547. , s = (e("../util/common"),
  12548. e("../util/math"))
  12549. , l = e("../util/logger")
  12550. , c = new l(n);
  12551. r.prototype.load = function() {
  12552. return this.modelDataPath ? (c.info("Using vision.modeldata"),
  12553. this.loadVisionModelData()) : this.sweepLocationsPath ? (c.warn("Using sweep_locations.csv"),
  12554. this.loadSweepLocationsCSV()) : (c.warn("No sweep file found"),
  12555. $.when([]))
  12556. }
  12557. ,
  12558. r.prototype.loadVisionModelData = function() {
  12559. return a.get(this.modelDataPath, {
  12560. responseType: "arraybuffer"
  12561. }).then(function(e) {
  12562. var t;
  12563. try {
  12564. t = this.decoder.decode(e)
  12565. } catch (e) {
  12566. return c.warn("Could not decode vision.modeldata, trying sweep_locations.csv"),
  12567. this.loadSweepLocationsCSV()
  12568. }
  12569. var i = t.sweepLocations.map(function(e) {
  12570. return {
  12571. uuid: e.uuid.toUTF8().replace(/-/g, ""),
  12572. position: {
  12573. x: e.pose.translation.x,
  12574. y: e.pose.translation.y,
  12575. z: e.pose.translation.z
  12576. },
  12577. quaternion: {
  12578. x: e.pose.rotation.x,
  12579. y: e.pose.rotation.y,
  12580. z: e.pose.rotation.z,
  12581. w: e.pose.rotation.w
  12582. },
  12583. puck: {
  12584. x: e.puck.x,
  12585. y: e.puck.y,
  12586. z: e.puck.z
  12587. },
  12588. floor: e.group,
  12589. neighbours: e.visibles,
  12590. alignmentType: e.alignment_type
  12591. }
  12592. }).map(function(e) {
  12593. return e.position = s.convertVisionVector(e.position),
  12594. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12595. e.puck = s.convertVisionVector(e.puck),
  12596. e
  12597. });
  12598. return i.forEach(function(e) {
  12599. e.neighbours = e.neighbours.map(function(e) {
  12600. return i[e].uuid
  12601. })
  12602. }),
  12603. i
  12604. }
  12605. .bind(this), function() {
  12606. return c.warn("Could not load vision.modeldata, trying sweep_locations.csv"),
  12607. this.loadSweepLocationsCSV()
  12608. }
  12609. .bind(this))
  12610. }
  12611. ,
  12612. r.prototype.loadSweepLocationsCSV = function() {
  12613. return a.get(this.sweepLocationsPath).then(function(e) {
  12614. var t = e.split("\n").map(function(e) {
  12615. return e.split(", ")
  12616. }).filter(function(e) {
  12617. return e.length > 1
  12618. }).map(function(e) {
  12619. return {
  12620. uuid: e[0],
  12621. position: {
  12622. x: parseFloat(e[1]),
  12623. y: parseFloat(e[2]),
  12624. z: parseFloat(e[3])
  12625. },
  12626. quaternion: {
  12627. x: parseFloat(e[4]),
  12628. y: parseFloat(e[5]),
  12629. z: parseFloat(e[6]),
  12630. w: parseFloat(e[7])
  12631. }
  12632. }
  12633. }).map(function(e) {
  12634. return e.position = s.convertVisionVector(e.position),
  12635. e.quaternion = s.convertVisionQuaternion(e.quaternion),
  12636. e
  12637. });
  12638. return t
  12639. }).fail(function() {
  12640. c.warn("Could not load sweep_locations.csv, no sweeps loaded.")
  12641. })
  12642. }
  12643. ,
  12644. t.exports = r
  12645. }
  12646. ).call(this, e("buffer").Buffer, "/js/loaders/SweepDataLoader.js")
  12647. }
  12648. , {
  12649. "../util/ajax": 181,
  12650. "../util/common": 185,
  12651. "../util/logger": 189,
  12652. "../util/math": 190,
  12653. buffer: 198,
  12654. protobufjs: 214
  12655. }],
  12656. 108: [function(e, t, i) {
  12657. (function(i) {
  12658. "use strict";
  12659. function n() {
  12660. this.locale = null
  12661. }
  12662. var r = e("../settings")
  12663. , o = e("../util/common")
  12664. , a = e("../util/logger")
  12665. , s = e("../enum/Locale")
  12666. , l = new a(i);
  12667. n.prototype.init = function() {
  12668. var t;
  12669. switch (r.languageTag) {
  12670. case null:
  12671. case "en":
  12672. case s.EN_US:
  12673. this.locale = s.EN_US,
  12674. t = e("./strings-en-US");
  12675. break;
  12676. case "es":
  12677. case s.ES_MX:
  12678. this.locale = s.ES_MX,
  12679. t = e("./strings-es-MX");
  12680. break;
  12681. case "fr":
  12682. case s.FR_FR:
  12683. this.locale = s.FR_FR,
  12684. t = e("./strings-fr-FR");
  12685. break;
  12686. case "de":
  12687. case s.DE_DE:
  12688. this.locale = s.DE_DE,
  12689. t = e("./strings-de-DE");
  12690. break;
  12691. case "ru":
  12692. case s.RU_RU:
  12693. this.locale = s.RU_RU,
  12694. t = e("./strings-ru-RU");
  12695. break;
  12696. case "cn":
  12697. case s.CN_CN:
  12698. this.locale = s.CN_CN,
  12699. t = e("./strings-cn-CN");
  12700. break;
  12701. case "jp":
  12702. case s.JP_JP:
  12703. this.locale = s.JP_JP,
  12704. t = e("./strings-jp-JP");
  12705. break;
  12706. default:
  12707. l.info("Unsupported language tag, defaulting to 'en-US'"),
  12708. this.locale = s.EN_US,
  12709. t = e("./strings-en-US")
  12710. }
  12711. l.info("Using locale '" + this.locale + "'"),
  12712. o.extendObject(this, t)
  12713. }
  12714. ,
  12715. n.prototype.localizeGUI = function() {
  12716. var e = document.querySelector("#gui-parent");
  12717. this.localizeTree(e),
  12718. this.localizeLoadingText()
  12719. }
  12720. ,
  12721. n.prototype.localizeLoadingText = function() {
  12722. // var e = document.querySelector("#loader-cont")
  12723. // , t = e.getAttribute("title");
  12724. // e.removeAttribute("title"),
  12725. // e.setAttribute("data-status", t),
  12726. // e.classList.add(this.locale),
  12727. document.querySelector("#help-dialog").classList.add(this.locale),
  12728. document.querySelector("#interaction-modal").classList.add(this.locale),
  12729. document.querySelector("#gui").classList.add(this.locale);
  12730. }
  12731. ,
  12732. n.prototype.localizeTree = function(e) {
  12733. var t, i, n = /{\[{ ?(\w+) ?}\]}/;
  12734. if (e.nodeType === Node.TEXT_NODE)
  12735. t = e.data.match(n),
  12736. t && (i = t[1],
  12737. e.data = this.localizeText(i) || i);
  12738. else if (e.nodeType === Node.ELEMENT_NODE) {
  12739. var r = e.getAttribute("title");
  12740. r && (t = r.match(n),
  12741. t && (i = t[1],
  12742. e.setAttribute("title", this.localizeText(i) || i)))
  12743. }
  12744. for (e = e.firstChild; e; )
  12745. this.localizeTree(e),
  12746. e = e.nextSibling
  12747. }
  12748. ,
  12749. n.prototype.localizeText = function(t) {
  12750. var i = this[t];
  12751. return i || this.locale === s.EN_US || (l.warn("Localization key '" + t + "' not available for locale '" + this.locale + "', defaulting to English."),
  12752. i = e("./strings-en-US")[t]),
  12753. i || l.warn("Localization key '" + t + "' not available for locale 'en-US'"),
  12754. i
  12755. }
  12756. ,
  12757. t.exports = new n
  12758. }
  12759. ).call(this, "/js/localization/localize.js")
  12760. }
  12761. , {
  12762. "../enum/Locale": 31,
  12763. "../settings": 166,
  12764. "../util/common": 185,
  12765. "../util/logger": 189,
  12766. "./strings-cn-CN": 109,
  12767. "./strings-de-DE": 110,
  12768. "./strings-en-US": 111,
  12769. "./strings-es-MX": 112,
  12770. "./strings-fr-FR": 113,
  12771. "./strings-jp-JP": 114,
  12772. "./strings-ru-RU": 115
  12773. }],
  12774. 109: [function(e, t, i) {
  12775. "use strict";
  12776. t.exports = {
  12777. PAGE_TITLE: "",
  12778. LOADING: "正在加载",
  12779. PRESENTED_BY_CAPS: "呈现者:",
  12780. POWERED_BY: "技术支持:",
  12781. POWERED_BY_CAPS: "技术支持:",
  12782. DESKTOP_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12783. MOBILE_SHORT_CTA: "点击一次以探索这个 3D 空间。",
  12784. PRESENTED_BY: "呈现者:",
  12785. MORE: "更多 ",
  12786. LESS: "更少 ",
  12787. TAG_CONTENT: "tag™ 内容",
  12788. SHOW: "显示",
  12789. HIDE: "隐藏",
  12790. DOLLHOUSE: "场景屋",
  12791. FLOOR_PLAN: "楼层平面图",
  12792. OPEN_HIGHLIGHTS: "打开精彩片段",
  12793. CLOSE_HIGHLIGHTS: "关闭",
  12794. PREVIOUS: "上一个",
  12795. PLAY: "播放",
  12796. PAUSE: "暂停",
  12797. NEXT: "下一个",
  12798. EXPLORE_3D_SPACE: "探索 3D 空间",
  12799. VIEW_DOLLHOUSE: "观看场景屋",
  12800. SOCIAL_SHARING: "分享这个空间",
  12801. VIEW_IN_VR: "以 VR 观看",
  12802. VIEW_FULLSCREEN: "全屏观看",
  12803. EXIT_FULLSCREEN: " 退出全屏",
  12804. ZOOM_IN: "放大",
  12805. ZOOM_OUT: "缩小",
  12806. FLOOR_NAME: "楼层",
  12807. FLOOR_ALL: "全部",
  12808. TERMS: "条款",
  12809. PORT_TERMS: "port 条款",
  12810. TERMS_OF_USE: "使用条款",
  12811. CLOSE_TERMS: "关闭",
  12812. TERMS_TEXT_FILE: "terms-cn-CN.html",
  12813. TERMS_FAIL: "无法获取条款。请确保您有互联网连接以查看使用条款。",
  12814. WEBVR_FOR_DAYDREAM: "用于 Daydream 视图",
  12815. WEBVR_ENTER_WEBVR: "进入 VR",
  12816. WEBVR_DIFFERENT_HEADSET: "有其他耳机吗?",
  12817. WEBVR_LEARN_MORE: "了解更多",
  12818. WEBVR_VIEW_SPACE: "在 VR 中观看空间",
  12819. WEBVR_DAYDREAM_VIEW: "Daydream 视图",
  12820. WEBVR_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12821. WEBVR_FOR_CARDBOARD: "用于 Google Cardboard",
  12822. WEBVR_VIEW_CARDBOARD: "或在 Google Cardboard 上观看",
  12823. VR_VIEW_SPACE: "在虚拟现实中观看空间",
  12824. VR_LEARN_MORE_CAPS: "了解更多",
  12825. VR_PREVIOUS_CAPS: "上一个’,",
  12826. VR_NEXT_CAPS: "下一个",
  12827. VR_GOT_IT_CAPS: "明白了",
  12828. VR_SHOW_SUPPORTED: "点击以使用 VR 观看空间",
  12829. VR_SHOW_UNSUPPORTED: "很遗憾,您的设备不符合在 VR 中观看空间的最低要求。",
  12830. VR_SHOW_IOS_1: "点击以使用 VR 观看空间",
  12831. VR_SHOW_IOS_2: "需要有 port VR 应用程序和兼容的 iPhone 才能观看",
  12832. VR_WHAT_YOU_NEED: "关于...您需要什么",
  12833. VR_NEED_CARDBOARD: "您使用 Google Cardboard 时需要什么",
  12834. VR_NEED_SAMSUNG: "您使用 Samsung Gear VR 时需要什么",
  12835. VR_NEED_DAYDREAM: "需要事先与 DAYDREAM VIEW 配对",
  12836. VR_NEED_DAYDREAM_PHONE: "支持 Daydream 的手机",
  12837. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  12838. VR_GOOGLE_DAYDREAM: "Google Daydream",
  12839. VR_APP: "port VR 应用程序",
  12840. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  12841. VR_COMPATIBLE_IPHONES_1: "iPhones",
  12842. VR_COMPATIBLE_IPHONES_2: "iPhone 5s 和更高版本,运行 iOS 9.1 和更高版本",
  12843. VR_COMPATIBLE_IPHONES_3: "兼容的 iPhone",
  12844. VR_COMPATIBLE_ANDROID: "兼容的 Android 设备",
  12845. VR_COMPATIBLE_ANDROID_LONG: "4.5-5.5 英寸、运行 Android OS 4.4.4 和更高版本的兼容型 Android 设备显示屏",
  12846. VR_ANDROID_DETAIL: "4.5 至 5.5 英寸、运行 Android OS 4.4.4 和更高版本的显示屏",
  12847. VR_ANDROID_DVICES: "Android 设备",
  12848. VR_COMPATIBLE_SAMSUNG: "兼容的 Samsung 设备",
  12849. VR_SAMSUNG_DETAIL: "Galaxy S6 和更高版本",
  12850. VR_APP_FOR_CARDBOARD: "用于 Google Cardboard 的 port VR 应用程序",
  12851. VR_APP_FOR_SAMSUNG: "用于 Gear VR 的 port VR 应用程序",
  12852. VR_APP_FOR_ANDROID: "用于 Android 手机的 port VR 应用程序",
  12853. VR_APP_OPEN: "请使用 port VR 应用程序打开",
  12854. VR_DOWNLOAD_HERE: "在此下载",
  12855. VR_REQUIRE_HEADSET: "需要一副 VR 耳机并安装用于 Android 的 port VR 应用程序",
  12856. VR_REDIRECT_TO_STORE: "如果未安装应用程序,您将跳转到应用程序商店。",
  12857. VR_IMPROPER_EMBED: "port 空间未正确嵌入,无法在您的 Web 浏览器支持 VR。",
  12858. VR_OPEN_ANDROID_LINK: "在您的手机上打开链接",
  12859. VR_ANDROID_OPTIONS: "可用的 VR 耳机选项",
  12860. SHARE_TO: "分享到",
  12861. SHARE_LINK: "直接链接",
  12862. SHARE_EXPLORE: "探索",
  12863. SHARE_AT: "在",
  12864. SHARE_WITH: "使用",
  12865. SHARE_3D: "以 3D",
  12866. SHARE_COPIED: "已复制!",
  12867. ERROR_BROWSER_SOLUTION: "安装更新的浏览器以探索 3D。",
  12868. ERROR_BROWSER_EXPLANATION: "WebGL 需要现代的浏览器。",
  12869. ERROR_GENERIC_PROBLEM: "糟糕,出现问题。",
  12870. ERROR_GENERIC_SOLUTION: "重新启动您的浏览器。",
  12871. ERROR_GENERIC_ACTIONS_1: "如果问题仍然存在,",
  12872. ERROR_GENERIC_ACTIONS_2: "请安装支持的浏览器",
  12873. ERROR_GENERIC_ACTIONS_3: " 或",
  12874. ERROR_GENERIC_ACTIONS_4: "查看我们的故障排除指南",
  12875. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "浏览器不受支持。",
  12876. ERROR_WEBGL_IOS_PROBLEM: "iOS 版本不受支持。",
  12877. ERROR_WEBGL_IOS_SOLUTION: "升级到 iOS 8 或更高版本以在 3D 中探索。",
  12878. ERROR_WEBGL_IOS_ACTIONS_1: "点击 ",
  12879. ERROR_WEBGL_IOS_ACTIONS_2: "设置 > 通用 > 软件更新",
  12880. ERROR_WEBGL_SAFARI_PROBLEM: "启用 WebGL 以在 3D 中探索。",
  12881. ERROR_WEBGL_SAFARI_ACTIONS_1: "单击",
  12882. ERROR_WEBGL_SAFARI_ACTIONS_2: "菜单栏中的首选项 > 高级 > 显示开发菜单",
  12883. ERROR_WEBGL_SAFARI_ACTIONS_3: "然后单击",
  12884. ERROR_WEBGL_SAFARI_ACTIONS_4: "开发 > 启用 WebGL",
  12885. ERROR_MISSING_URLS_PROBLEM: "糟糕,没有此模型的全景。",
  12886. ERROR_MISSING_URLS_EXPLANATION: "这是较早的模型。网站所有者可能正在开发一种新模型。",
  12887. ERROR_LOADING_FAILED_PROBLEM: "糟糕,模式不可用。",
  12888. ERROR_LOADING_FAILED_ACTIONS_1: "如果问题仍然存在,",
  12889. ERROR_LOADING_FAILED_ACTIONS_2: "查看我们的故障排除指南",
  12890. ERROR_MAINTENANCE_PROBLEM: "正在进行维护",
  12891. ERROR_MAINTENANCE_SOLUTION: "请过几分钟再来。",
  12892. LINK_TO_LOCATION: "地点链接",
  12893. MENU_COPY: "复制",
  12894. LINK_ALERT_COPY: "请使用 CTRL/CMD + C 复制。",
  12895. ROTATE: "旋转",
  12896. MOVE: "移动",
  12897. INSIDE: "内部",
  12898. ZOOM: "缩放",
  12899. HELP: "小帮手",
  12900. HELP_NAVIGATION_TAB: "导航",
  12901. HELP_MORE_HELP_TAB: "更多帮助",
  12902. HELP_DESKTOP_PANORAMA_1A: "单击并拖动以环顾空间。",
  12903. HELP_DESKTOP_PANORAMA_2A: "单击整个空间内的圆环以四处移动。",
  12904. HELP_DESKTOP_PANORAMA_3A: "使用鼠标滚轮来放大和缩小。",
  12905. HELP_DESKTOP_PANORAMA_1B: "或者,使用箭头键向左向右转。",
  12906. HELP_DESKTOP_PANORAMA_2B: "或者,使用箭头键向前移动和向后移动。",
  12907. HELP_DESKTOP_PANORAMA_3B: "或者,使用加号和减号键来放大和缩小。",
  12908. HELP_DESKTOP_360_2A: "单击内部视图图标以进入空间。",
  12909. HELP_DESKTOP_360_2B: "或者,按 1 号键进入内部视图。 ",
  12910. HELP_DESKTOP_DOLLHOUSE_1A: "左键单击并向左、向右、向上和向下拖动以旋转场景屋。",
  12911. HELP_DESKTOP_DOLLHOUSE_2A: "右键单击并向左、向右、向上和向下拖动以改变场景屋在屏幕上的位置。",
  12912. HELP_DESKTOP_DOLLHOUSE_3A: "使用鼠标滚轮来放大和缩小。",
  12913. HELP_DESKTOP_DOLLHOUSE_1B: "或者,使用箭头键来旋转场景屋。",
  12914. HELP_DESKTOP_FLOORPLAN_1A: "左键单击并向左、向右、向上和向下拖动以改变楼层平面图在屏幕上的位置。",
  12915. HELP_DESKTOP_FLOORPLAN_2A: "右键单击并向左或向右拖动以旋转楼层平面图。",
  12916. HELP_DESKTOP_FLOORPLAN_3A: "使用鼠标滚轮来放大和缩小。",
  12917. HELP_DESKTOP_FLOORPLAN_2B: "或者,使用箭头键以向左或向右旋转。",
  12918. HELP_DESKTOP_FLOORPLAN_3B: "或者,使用箭头键来放大和缩小。",
  12919. HELP_MOBILE_PANORAMA_1: "触摸并拖动以环顾空间。",
  12920. HELP_MOBILE_PANORAMA_2: "点击整个空间内的圆环以四处移动。",
  12921. HELP_MOBILE_3: "使用捏合手势来放大和缩小。",
  12922. HELP_MOBILE_360_2: "点击内部视图图标以进入空间。",
  12923. HELP_MOBILE_DOLLHOUSE_1: "触摸并向上、向下、向左和向右拖动以旋转场景屋。",
  12924. HELP_MOBILE_DOLLHOUSE_2: "用两指触摸并拖动以定位场景屋。",
  12925. HELP_MOBILE_FLOORPLAN_1: "触摸并拖动以定位楼层平面图。",
  12926. HELP_MOBILE_FLOORPLAN_2: "用两指触摸并拖动以旋转楼层平面图。",
  12927. HELP_MORE_HLR_A: "精彩片段集锦",
  12928. HELP_DESKTOP_MORE_HLR_B: "打开以使用缩略图图像在空间中流览。",
  12929. HELP_MORE_DOLLHOUSE_A: "场景屋",
  12930. HELP_DESKTOP_MORE_DOLLHOUSE_B: "单击以查看和旋转 3D 内整个空间的俯视图。",
  12931. HELP_MOBILE_MORE_DOLLHOUSE_B: "点击以查看和旋转 3D 内整个空间的俯视图。",
  12932. HELP_MORE_FLOORS_A: "楼层选择器",
  12933. HELP_DESKTOP_MORE_FLOORS_B: "在空间中的楼层之间切换。",
  12934. HELP_MORE_TAG_A: "tag™ 贴文",
  12935. HELP_DESKTOP_MORE_TAG_B: "单击或悬停鼠标以查看空间中的功能信息。",
  12936. HELP_MOBILE_MORE_TAG_B: "点击以查看空间中的功能信息。",
  12937. HELP_MORE_ZOOM_A: "缩放控件",
  12938. HELP_DESKTOP_MORE_ZOOM_B: "使用这些控件来放大和缩小或使用滚轮。",
  12939. HELP_MORE_TOUR_A: "导览控件",
  12940. HELP_DESKTOP_MORE_TOUR_B: "通过导览播放、暂停以及向前和向后流览。",
  12941. HELP_MORE_INSIDE_A: "内部视图",
  12942. HELP_DESKTOP_MORE_INSIDE_B: "单击以探索空间内部。",
  12943. HELP_MOBILE_MORE_INSIDE_B: "点击以探索空间内部。",
  12944. HELP_MORE_VR_A: "VR 模式",
  12945. HELP_DESKTOP_MORE_VR_B: "单击以在虚拟现实中启动空间。",
  12946. HELP_MOBILE_MORE_VR_B: "点击以在虚拟现实中启动空间。",
  12947. HELP_MORE_360_A: "360° 视图",
  12948. HELP_DESKTOP_MORE_360_B: "单击精彩片段集锦中的 360 视图中以观看室外场景。",
  12949. HELP_MOBILE_MORE_360_B: "点击精彩片段集锦中的 360 视图中以观看室外场景。",
  12950. HELP_MORE_FULLSCREEN_A: "全屏",
  12951. HELP_DESKTOP_MORE_FULLSCREEN_B: "将 3D Showcase 扩展到全屏。",
  12952. CLOSE: "关闭"
  12953. }
  12954. }
  12955. , {}],
  12956. 110: [function(e, t, i) {
  12957. "use strict";
  12958. t.exports = {
  12959. PAGE_TITLE: "",
  12960. LOADING: "Lädt",
  12961. PRESENTED_BY_CAPS: "PRÄSENTIERT VON",
  12962. POWERED_BY: "Angetrieben von",
  12963. POWERED_BY_CAPS: "ANGETRIEBEN VON",
  12964. DESKTOP_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12965. MOBILE_SHORT_CTA: "Sehen sie sich in diesem 3D Raum um.",
  12966. PRESENTED_BY: "Präsentiert von ",
  12967. MORE: "Mehr ",
  12968. LESS: "Weniger ",
  12969. TAG_CONTENT: "tag™ Inhalt",
  12970. SHOW: "Anzeigen",
  12971. HIDE: "Verbergen",
  12972. DOLLHOUSE: "Puppenhaus",
  12973. FLOOR_PLAN: "Grundriss",
  12974. OPEN_HIGHLIGHTS: "Highlights anzeigen",
  12975. CLOSE_HIGHLIGHTS: "Schließen",
  12976. PREVIOUS: "Vorheriges",
  12977. PLAY: "Abspielen",
  12978. PAUSE: "Pausieren",
  12979. NEXT: "Nächstes",
  12980. EXPLORE_3D_SPACE: "Innenraum betreten",
  12981. VIEW_DOLLHOUSE: "Puppenhaus ansehen",
  12982. SOCIAL_SHARING: "Teilen Sie diesen Raum",
  12983. VIEW_IN_VR: "In VR ansehen",
  12984. VIEW_FULLSCREEN: "Ansicht im Vollbildmodus",
  12985. EXIT_FULLSCREEN: "Beenden des Vollbildmodus",
  12986. ZOOM_IN: "Vergrößern",
  12987. ZOOM_OUT: "Verkleinern",
  12988. FLOOR_NAME: "Etage ",
  12989. FLOOR_ALL: "Alle",
  12990. TERMS: "Bedingungen",
  12991. PORT_TERMS: "port Bedingungen",
  12992. TERMS_OF_USE: "Nutzungsbedingungen",
  12993. TERMS_TEXT_FILE: "terms-de-DE.html",
  12994. CLOSE_TERMS: "Schließen",
  12995. TERMS_FAIL: "Konnte die Nutzungsbedingungen nicht abrufen. Bitte stellen Sie sicher, dass Sie zum Internet verbunden sind.",
  12996. HELP: "Hilfe",
  12997. HELP_NAVIGATION_TAB: "Navigation",
  12998. HELP_MORE_HELP_TAB: "Hilfe-Details",
  12999. CLOSE: "Schließen",
  13000. HELP_DESKTOP_PANORAMA_1A: "Klicken und ziehen Sie um sich im Raum umzusehen.",
  13001. HELP_DESKTOP_PANORAMA_2A: "Klicken Sie auf die Ringe im Raum um sich zu bewegen.",
  13002. HELP_DESKTOP_PANORAMA_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13003. HELP_DESKTOP_PANORAMA_1B: "Oder verwenden Sie die Pfeiltasten um sich nach links und rechts zu bewegen.",
  13004. HELP_DESKTOP_PANORAMA_2B: "Oder verwenden Sie die Pfeiltasten um sich vorwärts und rückwärts zubewegen.",
  13005. HELP_DESKTOP_PANORAMA_3B: "Oder verwenden Sie die Plus- und Minus-Tasten zum Vergrößern und Verkleinern.",
  13006. HELP_DESKTOP_360_2A: "Klicken Sie die Innenansicht ikone, um diesen Raum zu starten .",
  13007. HELP_DESKTOP_360_2B: "Oder, drücken Sie die 1-Taste um die Innenraumansicht zu starten.",
  13008. HELP_DESKTOP_DOLLHOUSE_1A: "Klicken Sie mit der linken Maustaste und ziehen Sie nach links, rechts, oben und unten um das Puppenhaus zu drehen.",
  13009. 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.",
  13010. HELP_DESKTOP_DOLLHOUSE_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13011. HELP_DESKTOP_DOLLHOUSE_1B: "Oder verwenden Sie die Pfeiltasten um das Puppenhaus zu drehen.",
  13012. 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.",
  13013. HELP_DESKTOP_FLOORPLAN_2A: "Klicken Sie mit der rechten Maustaste und ziehen Sie nach links oder rechts um den Grundriss zu drehen.",
  13014. HELP_DESKTOP_FLOORPLAN_3A: "Verwenden Sie das Scrollrad zum Vergrößern und Verkleinern.",
  13015. HELP_DESKTOP_FLOORPLAN_2B: "Oder verwenden Sie die Pfeiltasten um das Modell nach links oder rechts zu drehen.",
  13016. HELP_DESKTOP_FLOORPLAN_3B: "Oder verwenden Sie die Pfeiltasten zum Vergrößern und Verkleinern.",
  13017. HELP_MOBILE_PANORAMA_1: "Berühren und ziehen an dem Raum um sich umzusehen.",
  13018. HELP_MOBILE_PANORAMA_2: "Klicken Sie auf die Ringe im Raum, um sich zu bewegen.",
  13019. HELP_MOBILE_3: "Benutzen Sie die Zoom-Gäste zum Vergrößern und Verkleinern.",
  13020. HELP_MOBILE_360_2: "Tippen Sie die Innenansicht ikone, um diesen Raum zu starten.",
  13021. HELP_MOBILE_DOLLHOUSE_1: "Berühren und nach oben, unten, links und rechts ziehen um das Puppenhaus zu drehen.",
  13022. HELP_MOBILE_DOLLHOUSE_2: "Berühren und mit zwei Fingern ziehen um das Puppenhaus zu positionieren.",
  13023. HELP_MOBILE_FLOORPLAN_1: "Berühren und ziehen, um den Grundriss zu positionieren.",
  13024. HELP_MOBILE_FLOORPLAN_2: "Berühren und ziehen mit zwei Fingern, um den Grundriss zu drehen.",
  13025. HELP_MORE_HLR_A: "Liste das Highlight",
  13026. HELP_DESKTOP_MORE_HLR_B: "Öffnen um durch den Raum mit Vorschau-Bildern zu navigieren.",
  13027. HELP_MORE_DOLLHOUSE_A: "Puppenhaus Ansicht",
  13028. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Klicken Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13029. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tippen Sie um die von oben nach unten Sicht des gesamten Raumes in 3D anzuzeigen und zu drehen.",
  13030. HELP_MORE_FLOORS_A: "Etage auswählen",
  13031. HELP_DESKTOP_MORE_FLOORS_B: "Zwischen den Etagen im Raum wechseln.",
  13032. HELP_MORE_TAG_A: "tag™ Posts",
  13033. HELP_DESKTOP_MORE_TAG_B: "Klicken Sie auf oder bewegen Sie Ihren Mauszeiger über die Informationen über die Funktionen im Raum.",
  13034. HELP_MOBILE_MORE_TAG_B: "Tippen Sie für Informationen über die Funktionen im Raum.",
  13035. HELP_MORE_ZOOM_A: "Zoom Steuerung",
  13036. HELP_DESKTOP_MORE_ZOOM_B: "Verwenden Sie diese Steuerung oder das Scrollrad zum Vergrößern und Verkleinern.",
  13037. HELP_MORE_TOUR_A: "Tour Steuerung",
  13038. HELP_DESKTOP_MORE_TOUR_B: "Abspielen, pausieren und vorwärts und rückwärts durch eine geführte Tour navigieren.",
  13039. HELP_MORE_INSIDE_A: "Innenansicht",
  13040. HELP_DESKTOP_MORE_INSIDE_B: "Klicken Sie hier um sich im Raum umzusehen.",
  13041. HELP_MOBILE_MORE_INSIDE_B: "Sehen Sie sich in diesen 3D Raum um.",
  13042. HELP_MORE_VR_A: "VR Modus",
  13043. HELP_DESKTOP_MORE_VR_B: "Klicken Sie hier, um den Raum in der virtuellen Realität zu starten.",
  13044. HELP_MOBILE_MORE_VR_B: "Tippen Sie um den Raum in der virtuellen Realität zu starten.",
  13045. HELP_MORE_360_A: "360° Views Ansicht ",
  13046. HELP_DESKTOP_MORE_360_B: "Klicken Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13047. HELP_MOBILE_MORE_360_B: "Tippen Sie die 360° Views Ansicht in das Highlight um Aussen-Szenen zu sehen.",
  13048. HELP_MORE_FULLSCREEN_A: "Vollbild",
  13049. HELP_DESKTOP_MORE_FULLSCREEN_B: "Erweitern Sie 3D Showcase im Vollbildmodus.",
  13050. WEBVR_FOR_CARDBOARD: "Für Google Cardboard",
  13051. WEBVR_FOR_DAYDREAM: "Für Daydream View",
  13052. WEBVR_ENTER_WEBVR: "Starten Sie VR",
  13053. WEBVR_DIFFERENT_HEADSET: "Haben Sie anderes Headset?",
  13054. WEBVR_LEARN_MORE: "Mehr Infos",
  13055. WEBVR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13056. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13057. WEBVR_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13058. WEBVR_VIEW_CARDBOARD: "Oder mit Google Cardboard ansehen",
  13059. VR_WHAT_YOU_NEED: "Was Sie dafür brauchen...",
  13060. VR_NEED_DAYDREAM_PHONE: "Daydream-fähiges Handy",
  13061. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13062. VR_APP: "port VR App",
  13063. VR_APP_OPEN: "Oder öffnen Sie die port VR App",
  13064. 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",
  13065. VR_SAMSUNG_DETAIL: "Galaxy S6 und neuer",
  13066. VR_APP_FOR_ANDROID: "port VR app für Android",
  13067. VR_NEED_DAYDREAM: "ERFORDERT VOR DER 'PAIRING' MIT DAYDREAM VIEW",
  13068. VR_VIEW_SPACE: "Ansicht des Raumes in VR",
  13069. VR_LEARN_MORE_CAPS: "MEHR INFOS",
  13070. VR_PREVIOUS_CAPS: "ZURÜCK",
  13071. VR_NEXT_CAPS: "WEITER",
  13072. VR_GOT_IT_CAPS: "VERSTANDEN",
  13073. VR_SHOW_SUPPORTED: "Tippen Sie um den Raum in VR zu sehen",
  13074. VR_SHOW_UNSUPPORTED: "Schade, aber Ihr Gerät erfüllt nicht die Mindestanforderungen um den Raum in VR zu sehen.",
  13075. VR_SHOW_IOS_1: "Tippen Sie um den Raum in VR zu sehen",
  13076. VR_SHOW_IOS_2: "port VR App sowie kompatibles iPhone sind von nöten um diesen Raum zu sehen",
  13077. VR_NEED_CARDBOARD: "Was Sie dafür brauchen ist Google Cardboard",
  13078. VR_NEED_SAMSUNG: "Was Sie dafür brauchen ist Samsung Gear VR",
  13079. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13080. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13081. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13082. VR_COMPATIBLE_IPHONES_2: "iPhone 5s oder neuer, mit iOS 9.1 und später",
  13083. VR_COMPATIBLE_IPHONES_3: "Kompatibles iPhones",
  13084. VR_COMPATIBLE_ANDROID: "Kompatibles Android Gerät",
  13085. VR_ANDROID_DETAIL: "Bildschirmdiagonale von 11,5 bis 14 cm (4,5 - 5,5 Zoll) und Android 4.4.4 und neuer",
  13086. VR_ANDROID_DVICES: "Android Geräte",
  13087. VR_COMPATIBLE_SAMSUNG: "Kompatible Samsung Geräte",
  13088. VR_APP_FOR_CARDBOARD: "port VR App für Google Cardboard",
  13089. VR_APP_FOR_SAMSUNG: "port VR App für Gear VR",
  13090. VR_DOWNLOAD_HERE: "Hier runterladen",
  13091. VR_REQUIRE_HEADSET: "Benötigt das ein VR-Headset und port VR App für Android installiert wird",
  13092. VR_REDIRECT_TO_STORE: "Wenn App nicht installiert ist, werden Sie zum App Store umgeleitet.",
  13093. VR_IMPROPER_EMBED: "Der port Raum ist nicht richtig eingebettet um VR in Ihrem Webbrowser zu unterstützen.",
  13094. VR_OPEN_ANDROID_LINK: "Öffnen Sie den Link auf Ihrem Handy",
  13095. VR_ANDROID_OPTIONS: "VR Headset Optionen",
  13096. SHARE_TO: "Teilen auf",
  13097. SHARE_LINK: "Direkter Link",
  13098. SHARE_EXPLORE: "Umsehen",
  13099. SHARE_AT: "auf",
  13100. SHARE_WITH: "mit",
  13101. SHARE_3D: "in 3D",
  13102. SHARE_COPIED: "Kopiert!",
  13103. ERROR_BROWSER_SOLUTION: "Installieren Sie einen neueren Browser um sich in 3D umzusehen.",
  13104. ERROR_BROWSER_EXPLANATION: "WebGL benötigt einen modernen Browser.",
  13105. ERROR_GENERIC_PROBLEM: "Huch, etwas ist schief gelaufen.",
  13106. ERROR_GENERIC_SOLUTION: "Starten Sie Ihren Browser neu.",
  13107. ERROR_GENERIC_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13108. ERROR_GENERIC_ACTIONS_2: "Installieren Sie einen unterstützten Browser",
  13109. ERROR_GENERIC_ACTIONS_3: " oder ",
  13110. ERROR_GENERIC_ACTIONS_4: "Sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13111. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser wird nicht unterstützt.",
  13112. ERROR_WEBGL_IOS_PROBLEM: "iOS-Version wird nicht unterstützt.",
  13113. ERROR_WEBGL_IOS_SOLUTION: "Aktualisieren Sie auf iOS 8 oder neuer um sich in 3D umzusehen.",
  13114. ERROR_WEBGL_IOS_ACTIONS_1: "Tippen ",
  13115. ERROR_WEBGL_IOS_ACTIONS_2: "Einstellungen > Allgemein > Softwareaktualisierung",
  13116. ERROR_WEBGL_SAFARI_PROBLEM: "Aktivieren Sie WebVR um sich in 3D umzusehen.",
  13117. ERROR_WEBGL_SAFARI_ACTIONS_1: "Klicken ",
  13118. ERROR_WEBGL_SAFARI_ACTIONS_2: "Präferenzen > Fortgeschrittene > Entwickler-Menü anzeigen",
  13119. ERROR_WEBGL_SAFARI_ACTIONS_3: "Klicken Sie dann ",
  13120. ERROR_WEBGL_SAFARI_ACTIONS_4: "Entwickler > WebGL Aktivieren",
  13121. ERROR_MISSING_URLS_PROBLEM: "Huch, es gibt keine Panoramen für dieses Modell .",
  13122. ERROR_MISSING_URLS_EXPLANATION: "Dies ist ein älteres Modell. Der Website-Besitzer hat eventuell ein neues Modell in Arbeit.",
  13123. ERROR_LOADING_FAILED_PROBLEM: "Huch, das Modell ist nicht verfügbar.",
  13124. ERROR_LOADING_FAILED_ACTIONS_1: "Wenn das Problem weiterhin besteht, ",
  13125. ERROR_LOADING_FAILED_ACTIONS_2: "sehen Sie unseren Leitfaden zur Fehlerbehebung",
  13126. ERROR_MAINTENANCE_PROBLEM: "Wartung im Gange.",
  13127. ERROR_MAINTENANCE_SOLUTION: "Bitte versuchen Sie es in ein paar Minuten nochmal.",
  13128. LINK_TO_LOCATION: "Link zu",
  13129. MENU_COPY: "Kopieren",
  13130. LINK_ALERT_COPY: "Bitte benutzen Sie CTRL/CMD + C zum kopieren.",
  13131. ROTATE: "Drehen",
  13132. INSIDE: "Drinnen",
  13133. MOVE: "Bewegen",
  13134. ZOOM: "Vergrößern"
  13135. }
  13136. }
  13137. , {}],
  13138. 111: [function(e, t, i) {
  13139. "use strict";
  13140. t.exports = {
  13141. PAGE_TITLE: "",
  13142. LOADING: "Loading",
  13143. PRESENTED_BY_CAPS: "PRESENTED BY",
  13144. POWERED_BY: "powered by ",
  13145. POWERED_BY_CAPS: "POWERED BY",
  13146. DESKTOP_SHORT_CTA: "Click to explore this 3D space.",
  13147. MOBILE_SHORT_CTA: "Tap to explore this 3D space.",
  13148. PRESENTED_BY: "Presented by ",
  13149. MORE: "More ",
  13150. LESS: "Less ",
  13151. TAG_CONTENT: "tag™ Content",
  13152. SHOW: "Show",
  13153. HIDE: "Hide",
  13154. DOLLHOUSE: "Dollhouse",
  13155. FLOOR_PLAN: "Floor plan",
  13156. OPEN_HIGHLIGHTS: "Open Highlights",
  13157. CLOSE_HIGHLIGHTS: "Close",
  13158. PREVIOUS: "Previous",
  13159. PLAY: "Play",
  13160. PAUSE: "Pause",
  13161. NEXT: "Next",
  13162. EXPLORE_3D_SPACE: "Explore 3D Space",
  13163. VIEW_DOLLHOUSE: "View dollhouse",
  13164. SOCIAL_SHARING: "Share this Space",
  13165. VIEW_IN_VR: "View in VR",
  13166. VIEW_FULLSCREEN: "全屏",
  13167. EXIT_FULLSCREEN: "退出全屏",
  13168. ZOOM_IN: "Zoom in",
  13169. ZOOM_OUT: "Zoom out",
  13170. FLOOR_NAME: "Floor ",
  13171. FLOOR_ALL: "All",
  13172. TERMS: "Terms",
  13173. PORT_TERMS: "port terms",
  13174. TERMS_OF_USE: "Terms of Use",
  13175. TERMS_TEXT_FILE: "terms-en-US.html",
  13176. CLOSE_TERMS: "Close",
  13177. TERMS_FAIL: "Could not fetch terms. Please make sure you have an internet connection to view the terms of use.",
  13178. HELP: "Help",
  13179. HELP_NAVIGATION_TAB: "Navigation",
  13180. HELP_MORE_HELP_TAB: "More Help",
  13181. CLOSE: "Close",
  13182. HELP_DESKTOP_PANORAMA_1A: "Click and Drag to look around the Space.",
  13183. HELP_DESKTOP_PANORAMA_2A: "Click on the rings throughout the space to move around.",
  13184. HELP_DESKTOP_PANORAMA_3A: "Use the scroll wheel to zoom in and out.",
  13185. HELP_DESKTOP_PANORAMA_1B: "Or, use the arrow keys to turn left and right.",
  13186. HELP_DESKTOP_PANORAMA_2B: "Or, use the arrow keys to move forward and back.",
  13187. HELP_DESKTOP_PANORAMA_3B: "Or, use the plus and minus keys to zoom in and out.",
  13188. HELP_DESKTOP_360_2A: "Click the Inside View icon to enter the Space.",
  13189. HELP_DESKTOP_360_2B: "Or, press the number 1 key to enter Inside View.",
  13190. HELP_DESKTOP_DOLLHOUSE_1A: "Left click and drag left, right, up, and down to rotate the Dollhouse.",
  13191. HELP_DESKTOP_DOLLHOUSE_2A: "Right click and drag left, right, up, and down to change the Dollhouse position on screen.",
  13192. HELP_DESKTOP_DOLLHOUSE_3A: "Use the scroll wheel to zoom in and out.",
  13193. HELP_DESKTOP_DOLLHOUSE_1B: "Or, use the arrow keys to rotate the Dollhouse.",
  13194. HELP_DESKTOP_FLOORPLAN_1A: "Left click and drag left, right, up, and down to change the Floorplan position on screen.",
  13195. HELP_DESKTOP_FLOORPLAN_2A: "Right click and drag left or right to rotate the Floorplan.",
  13196. HELP_DESKTOP_FLOORPLAN_3A: "Use the scroll wheel to zoom in and out.",
  13197. HELP_DESKTOP_FLOORPLAN_2B: "Or, use the arrow keys to rotate left or right.",
  13198. HELP_DESKTOP_FLOORPLAN_3B: "Or, use the arrow keys to zoom in and out.",
  13199. HELP_MOBILE_PANORAMA_1: "Touch and Drag to look around the Space.",
  13200. HELP_MOBILE_PANORAMA_2: "Tap on the rings throughout the Space to move around.",
  13201. HELP_MOBILE_3: "Use a pinch gesture to zoom in and out.",
  13202. HELP_MOBILE_360_2: "Tap the Inside View icon to enter the Space.",
  13203. HELP_MOBILE_DOLLHOUSE_1: "Touch and drag up, down, left, and right to rotate the Dollhouse.",
  13204. HELP_MOBILE_DOLLHOUSE_2: "Touch and drag with two fingers to position the Dollhouse.",
  13205. HELP_MOBILE_FLOORPLAN_1: "Touch and drag to position the Floorplan.",
  13206. HELP_MOBILE_FLOORPLAN_2: "Touch and drag with two fingers to rotate the Floorplan.",
  13207. HELP_MORE_HLR_A: "Highlight Reel",
  13208. HELP_DESKTOP_MORE_HLR_B: "Open to navigate through the Space using thumbnail images.",
  13209. HELP_MORE_DOLLHOUSE_A: "Dollhouse View",
  13210. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Click to view and rotate a top-down view of the entire Space in 3D.",
  13211. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tap to view and rotate a top-down view of the entire Space in 3D.",
  13212. HELP_MORE_FLOORS_A: "Floor Selector",
  13213. HELP_DESKTOP_MORE_FLOORS_B: "Switch between floors in the Space.",
  13214. HELP_MORE_TAG_A: "tag™ Posts",
  13215. HELP_DESKTOP_MORE_TAG_B: "Click or hover over for information about features in the Space.",
  13216. HELP_MOBILE_MORE_TAG_B: "Tap for information about features in the Space.",
  13217. HELP_MORE_ZOOM_A: "Zoom Controls",
  13218. HELP_DESKTOP_MORE_ZOOM_B: "Use these controls to zoom in and out or use the scroll wheel.",
  13219. HELP_MORE_TOUR_A: "Tour Controls",
  13220. HELP_DESKTOP_MORE_TOUR_B: "Play, pause, and navigate forward and backward through a Guided Tour.",
  13221. HELP_MORE_INSIDE_A: "Inside View",
  13222. HELP_DESKTOP_MORE_INSIDE_B: "Click to explore inside the Space.",
  13223. HELP_MOBILE_MORE_INSIDE_B: "Tap to explore inside the Space.",
  13224. HELP_MORE_VR_A: "VR Mode",
  13225. HELP_DESKTOP_MORE_VR_B: "Click to launch the Space in virtual reality.",
  13226. HELP_MOBILE_MORE_VR_B: "Tap to launch the Space in virtual reality.",
  13227. HELP_MORE_360_A: "360° Views",
  13228. HELP_DESKTOP_MORE_360_B: "Click 360 Views in the Highlight Reel to view outdoor scenes.",
  13229. HELP_MOBILE_MORE_360_B: "Tap 360 Views in the Highlight Reel to view outdoor scenes.",
  13230. HELP_MORE_FULLSCREEN_A: "Full screen",
  13231. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expand 3D Showcase to full screen.",
  13232. WEBVR_FOR_CARDBOARD: "For Google Cardboard",
  13233. WEBVR_VIEW_CARDBOARD: "Or View on Google Cardboard",
  13234. WEBVR_FOR_DAYDREAM: "For Daydream View",
  13235. WEBVR_ENTER_WEBVR: "ENTER VR",
  13236. WEBVR_DIFFERENT_HEADSET: "Have a different headset?",
  13237. WEBVR_LEARN_MORE: "Learn more",
  13238. WEBVR_VIEW_SPACE: "View Space in VR",
  13239. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13240. WEBVR_DAYDREAM_PHONE: "Daydream-ready phone",
  13241. VR_VIEW_SPACE: "View Space in Virtual Reality",
  13242. VR_LEARN_MORE_CAPS: "LEARN MORE",
  13243. VR_PREVIOUS_CAPS: "PREVIOUS",
  13244. VR_NEXT_CAPS: "NEXT",
  13245. VR_GOT_IT_CAPS: "GOT IT",
  13246. VR_SHOW_SUPPORTED: "Tap to view the Space in VR with",
  13247. VR_SHOW_UNSUPPORTED: "Sorry, but your device doesn't meet the minimum requirements to view a space in VR.",
  13248. VR_SHOW_IOS_1: "Tap to view the space in VR",
  13249. VR_SHOW_IOS_2: "Requires port VR app and compatible iPhone to view",
  13250. VR_WHAT_YOU_NEED: "What You'll Need For...",
  13251. VR_NEED_CARDBOARD: "What you'll need with Google Cardboard",
  13252. VR_NEED_SAMSUNG: "What you'll need with Samsung Gear VR",
  13253. VR_NEED_DAYDREAM: "NEEDS PRIOR PAIRING WITH DAYDREAM VIEW",
  13254. VR_NEED_DAYDREAM_PHONE: "Daydream-ready phone",
  13255. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13256. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13257. VR_APP: "port VR App",
  13258. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13259. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13260. VR_COMPATIBLE_IPHONES_2: "iPhone 5s and newer, running iOS 9.1 and higher",
  13261. VR_COMPATIBLE_IPHONES_3: "Compatible iPhones",
  13262. VR_COMPATIBLE_ANDROID: "Compatible Android Devices",
  13263. VR_COMPATIBLE_ANDROID_LONG: 'Compatible Android Devices Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13264. VR_ANDROID_DETAIL: 'Displays from 4.5"-5.5" running Android OS 4.4.4 and higher',
  13265. VR_ANDROID_DVICES: "Android Devices",
  13266. VR_COMPATIBLE_SAMSUNG: "Compatible Samsung Devices",
  13267. VR_SAMSUNG_DETAIL: "Galaxy S6 and Above",
  13268. VR_APP_FOR_CARDBOARD: "port VR app for Google Cardboard",
  13269. VR_APP_FOR_SAMSUNG: "port VR app for Gear VR",
  13270. VR_APP_FOR_ANDROID: "port VR app for Android Phones",
  13271. VR_APP_OPEN: "Open with the port VR app instead",
  13272. VR_DOWNLOAD_HERE: "Download here",
  13273. VR_REQUIRE_HEADSET: "Requires a VR headset and port VR app for Android to be installed",
  13274. VR_REDIRECT_TO_STORE: "If app is not installed, you will be redirected to the app store.",
  13275. VR_IMPROPER_EMBED: "The port Space is not embedded properly to support VR in your web browser.",
  13276. VR_OPEN_ANDROID_LINK: "Open the Link on Your Mobile Phone",
  13277. VR_ANDROID_OPTIONS: "Available VR Headset Options",
  13278. SHARE_TO: "Share to",
  13279. SHARE_LINK: "Direct Link",
  13280. SHARE_EXPLORE: "Explore ",
  13281. SHARE_AT: "at",
  13282. SHARE_WITH: "with",
  13283. SHARE_3D: " in 3D",
  13284. SHARE_COPIED: "Copied!",
  13285. ERROR_BROWSER_SOLUTION: "Install a new browser to explore in 3D.",
  13286. ERROR_BROWSER_EXPLANATION: "WebGL requires a modern browser.",
  13287. ERROR_GENERIC_PROBLEM: "Oops, something went wrong.",
  13288. ERROR_GENERIC_SOLUTION: "Restart your browser.",
  13289. ERROR_GENERIC_ACTIONS_1: "If the problem persists, ",
  13290. ERROR_GENERIC_ACTIONS_2: "install a supported browser",
  13291. ERROR_GENERIC_ACTIONS_3: " or ",
  13292. ERROR_GENERIC_ACTIONS_4: "see our troubleshooting guide",
  13293. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Browser not supported.",
  13294. ERROR_WEBGL_IOS_PROBLEM: "iOS version not supported.",
  13295. ERROR_WEBGL_IOS_SOLUTION: "Upgrade to iOS 8 or higher to explore in 3D.",
  13296. ERROR_WEBGL_IOS_ACTIONS_1: "Tap ",
  13297. ERROR_WEBGL_IOS_ACTIONS_2: "Settings > General > Software Update",
  13298. ERROR_WEBGL_SAFARI_PROBLEM: "Enable WebGL to explore in 3D.",
  13299. ERROR_WEBGL_SAFARI_ACTIONS_1: "Click ",
  13300. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferences > Advanced > Show Develop menu",
  13301. ERROR_WEBGL_SAFARI_ACTIONS_3: "Then click ",
  13302. ERROR_WEBGL_SAFARI_ACTIONS_4: "Develop > Enable WebGL",
  13303. ERROR_MISSING_URLS_PROBLEM: "Oops, there are no panoramas for this model.",
  13304. ERROR_MISSING_URLS_EXPLANATION: "This is an older model. The website owner may have a new model on the way.",
  13305. ERROR_LOADING_FAILED_PROBLEM: "模型不可用.",
  13306. ERROR_LOADING_FAILED_ACTIONS_1: "If the problem persists, ",
  13307. ERROR_LOADING_FAILED_ACTIONS_2: "see our troubleshooting guide",
  13308. ERROR_MAINTENANCE_PROBLEM: "Maintenance in progress.",
  13309. ERROR_MAINTENANCE_SOLUTION: "Please come back in a few minutes.",
  13310. LINK_TO_LOCATION: "Link to location",
  13311. MENU_COPY: "Copy",
  13312. LINK_ALERT_COPY: "Please use CTRL/CMD + C to copy.",
  13313. ROTATE: "Rotate",
  13314. INSIDE: "Inside",
  13315. MOVE: "Move",
  13316. ZOOM: "Zoom"
  13317. }
  13318. }
  13319. , {}],
  13320. 112: [function(e, t, i) {
  13321. "use strict";
  13322. t.exports = {
  13323. PAGE_TITLE: "",
  13324. LOADING: "Cargando",
  13325. PRESENTED_BY_CAPS: "PRESENTADO POR",
  13326. POWERED_BY: "potenciando por ",
  13327. POWERED_BY_CAPS: "POTENCIADO POR ",
  13328. DESKTOP_SHORT_CTA: "Haga clic para explorar este Espacio 3D.",
  13329. MOBILE_SHORT_CTA: "Pulse para explorar este Espacio 3D.",
  13330. PRESENTED_BY: "Presentado por ",
  13331. MORE: "Más ",
  13332. LESS: "Menos ",
  13333. TAG_CONTENT: "Contenido de tag™",
  13334. SHOW: "Mostrar",
  13335. HIDE: "Ocultar",
  13336. DOLLHOUSE: "Dollhouse",
  13337. FLOOR_PLAN: "Planos",
  13338. OPEN_HIGHLIGHTS: "Aspectos Destacados",
  13339. CLOSE_HIGHLIGHTS: "Cerrar",
  13340. PREVIOUS: "Anterior",
  13341. PLAY: "Play",
  13342. PAUSE: "Pausa",
  13343. NEXT: "Siguiente",
  13344. EXPLORE_3D_SPACE: "Explorar el Espacio 3D",
  13345. VIEW_DOLLHOUSE: "Ver dollhouse",
  13346. SOCIAL_SHARING: "Compartir este espacio",
  13347. VIEW_IN_VR: "Ver en realidad virtual",
  13348. VIEW_FULLSCREEN: "Ver en pantalla completa",
  13349. EXIT_FULLSCREEN: "Salir de pantalla completa",
  13350. ZOOM_IN: "Acercar",
  13351. ZOOM_OUT: "Alejar",
  13352. FLOOR_NAME: "Piso ",
  13353. FLOOR_ALL: "Todas",
  13354. TERMS: "Condiciones",
  13355. PORT_TERMS: "port términos de uso",
  13356. TERMS_OF_USE: "Términos de uso",
  13357. TERMS_TEXT_FILE: "terms-es-MX.html",
  13358. CLOSE_TERMS: "Cerrar",
  13359. 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.",
  13360. HELP: "Ayuda",
  13361. HELP_NAVIGATION_TAB: "Navegación",
  13362. HELP_MORE_HELP_TAB: "Más Ayuda",
  13363. CLOSE: "Cerrar",
  13364. HELP_DESKTOP_PANORAMA_1A: "Haga clic y arrastre para mirar alrededor del espacio.",
  13365. HELP_DESKTOP_PANORAMA_2A: "Haga clic en los aros a lo largo del espacio para moverse.",
  13366. HELP_DESKTOP_PANORAMA_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13367. HELP_DESKTOP_PANORAMA_1B: "O use las teclas de flecha para girar a la izquierda y a la derecha.",
  13368. HELP_DESKTOP_PANORAMA_2B: "O use las teclas de dirección para adelantar o retroceder.",
  13369. HELP_DESKTOP_PANORAMA_3B: "O use la tecla más para acercar y la tecla menos para alejar.",
  13370. HELP_DESKTOP_360_2A: "Haga clic en el icono Vista Interior para ingresar al Espacio.",
  13371. HELP_DESKTOP_360_2B: "O bien, presione la tecla numero 1 para entrar en la Vista Interior.",
  13372. HELP_DESKTOP_DOLLHOUSE_1A: "Haga clic izquierdo y arrastre hacia la izquierda, derecha, arriba o abajo para girar la Dollhouse.",
  13373. HELP_DESKTOP_DOLLHOUSE_2A: "Haga clic derecho y arrastre hacia la izquierda, derecha, arriba o abajo para cambiar la posición della dollhouse.",
  13374. HELP_DESKTOP_DOLLHOUSE_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13375. HELP_DESKTOP_DOLLHOUSE_1B: "O use las teclas de dirección para girar la Dollhouse.",
  13376. 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.",
  13377. HELP_DESKTOP_FLOORPLAN_2A: "Haga clic derecho y arrastre hacia la izquierda o derecha para girar la planta.",
  13378. HELP_DESKTOP_FLOORPLAN_3A: "Use la rueda de desplazamiento para acercar o alejar.",
  13379. HELP_DESKTOP_FLOORPLAN_2B: "O use las teclas para girar hacia la izquierda o derecha.",
  13380. HELP_DESKTOP_FLOORPLAN_3B: "O use las teclas de dirección para acercar o alejar.",
  13381. HELP_MOBILE_PANORAMA_1: "Toque y arrastre para mirar alrededor del espacio.",
  13382. HELP_MOBILE_PANORAMA_2: "Toque en los aros a lo largo del espacio para moverse.",
  13383. HELP_MOBILE_3: "Use el gesto de pellizcar para acercar o alejar.",
  13384. HELP_MOBILE_360_2: "Toque el ícono Vista Interior para entrar en el Espacio.",
  13385. HELP_MOBILE_DOLLHOUSE_1: "Toque y arrastre con dos dedos para cambiar la posición della dollhouse.",
  13386. HELP_MOBILE_DOLLHOUSE_2: "Toque y arrastre con dos dedos para cambiar la posición de la vista aérea.",
  13387. HELP_MOBILE_FLOORPLAN_1: "Toque y arrastre para cambiar la posición de la planta.",
  13388. HELP_MOBILE_FLOORPLAN_2: "Toque y arrastre con dos dedos para girar la planta.",
  13389. HELP_MORE_HLR_A: "Galería destacada",
  13390. HELP_DESKTOP_MORE_HLR_B: "Abra para navegar a través del espacio utilizando imágenes en miniatura.",
  13391. HELP_MORE_DOLLHOUSE_A: "Vista aérea por pisos",
  13392. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Haga clic para ver y girar la Dollhouse del espacio completo en 3D.",
  13393. HELP_MOBILE_MORE_DOLLHOUSE_B: "Toque para ver y girar la vista Dollhouse del espacio completo en 3D.",
  13394. HELP_MORE_FLOORS_A: "Seleccionador de plantas",
  13395. HELP_DESKTOP_MORE_FLOORS_B: "Cambie de una planta a otra en el espacio.",
  13396. HELP_MORE_TAG_A: "tag™ Posts",
  13397. HELP_DESKTOP_MORE_TAG_B: "Haga clic o coloque el cursor para obtener más información acerca de las características del espacio.",
  13398. HELP_MOBILE_MORE_TAG_B: "Toque para obtener más información acerca de las características del espacio.",
  13399. HELP_MORE_ZOOM_A: "Controles de zoom",
  13400. HELP_DESKTOP_MORE_ZOOM_B: "Use estos controles o la rueda de desplazamiento para acercar o alejar.",
  13401. HELP_MORE_TOUR_A: "Controles de recorrido",
  13402. HELP_DESKTOP_MORE_TOUR_B: "Reproduzca, pause, adelante o retroceda a través de un recorrido guiado.",
  13403. HELP_MORE_INSIDE_A: "Vista interior",
  13404. HELP_DESKTOP_MORE_INSIDE_B: "Haga clic para explorar el interior del espacio.",
  13405. HELP_MOBILE_MORE_INSIDE_B: "Toque para explorar el interior del espacio.",
  13406. HELP_MORE_VR_A: "Modo de realidad virtual",
  13407. HELP_DESKTOP_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13408. HELP_MOBILE_MORE_VR_B: "Toque para ver el espacio en realidad virtual.",
  13409. HELP_MORE_360_A: "360° Views",
  13410. HELP_DESKTOP_MORE_360_B: "Una vez que se encuentre en galería destacada, haga clic en vistas de 360º para ver el exterior.",
  13411. HELP_MOBILE_MORE_360_B: "Una vez que se encuentre en galería destacada, toque en vistas de 360º para ver el exterior.",
  13412. HELP_MORE_FULLSCREEN_A: "Pantalla completa",
  13413. HELP_DESKTOP_MORE_FULLSCREEN_B: "Expanda el escenario 3D para verlo en pantalla completa.",
  13414. WEBVR_FOR_CARDBOARD: "Para Google Cardboard",
  13415. WEBVR_FOR_DAYDREAM: "Para Daydream View",
  13416. WEBVR_ENTER_WEBVR: "ENTRAR VR",
  13417. WEBVR_DIFFERENT_HEADSET: "¿Tiene un auricular diferente?",
  13418. WEBVR_LEARN_MORE: "Más información",
  13419. WEBVR_VIEW_SPACE: "Ver Espacio en VR",
  13420. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13421. WEBVR_DAYDREAM_PHONE: "Daydream Teléfono listos",
  13422. WEBVR_VIEW_CARDBOARD: "O Ver en Google Cardboard",
  13423. VR_NEED_DAYDREAM: "Necesidades antes de acoplarse con Daydream View",
  13424. VR_NEED_DAYDREAM_PHONE: "Teléfono listo para Daydream",
  13425. VR_GOOGLE_DAYDREAM: "Daydream de Google",
  13426. VR_APP: "port VR App",
  13427. VR_COMPATIBLE_ANDROID_LONG: 'Compatible con los Dispositivos Android con Pantallas de 4.5"-5.5" operando Android OS 4.4.4 y posteriores',
  13428. VR_APP_FOR_ANDROID: "Aplicación port VR para Teléfonos Android",
  13429. VR_APP_OPEN: "Abrir con la aplicación port VR en su lugar",
  13430. VR_VIEW_SPACE: "Ver Espacio en realidad virtual",
  13431. VR_LEARN_MORE_CAPS: "SABER MÁS",
  13432. VR_PREVIOUS_CAPS: "ANTERIOR",
  13433. VR_NEXT_CAPS: "SIGUIENTE",
  13434. VR_GOT_IT_CAPS: "COMPRENDIDO",
  13435. VR_SHOW_SUPPORTED: "Pulse para ver el Espacio en realidad virtual con",
  13436. VR_SHOW_UNSUPPORTED: "Lo sentimos, pero su dispositivo no cumple los requisitos mínimos para ver un Espacio en realidad virtual.",
  13437. VR_SHOW_IOS_1: "Pulse para ver el Espacio en realidad virtual",
  13438. VR_SHOW_IOS_2: "Necesita la aplicación port VR y un iPhone compatible para ver",
  13439. VR_WHAT_YOU_NEED: "Lo que necesitaras...",
  13440. VR_NEED_CARDBOARD: "Lo que necesitaras con Google Cardboard",
  13441. VR_NEED_SAMSUNG: "Lo que necesitaras con el Samsung Gear VR",
  13442. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13443. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13444. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13445. VR_COMPATIBLE_IPHONES_2: "Compatible con iPhone 6S o superior y con iOS 9.1 en adelante",
  13446. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13447. VR_COMPATIBLE_ANDROID: "Dispositivos Android compatibles",
  13448. VR_ANDROID_DETAIL: "Pantallas de 11.43 cm a 13.97 cm con OS de Android 4.4.4 en adelante",
  13449. VR_ANDROID_DVICES: "Dispositivos Android",
  13450. VR_COMPATIBLE_SAMSUNG: "Dispositivos compatibles del Samsung",
  13451. VR_SAMSUNG_DETAIL: "Galaxy S5 en adelante",
  13452. VR_APP_FOR_CARDBOARD: "Aplicación port VR para Google Cardboard",
  13453. VR_APP_FOR_SAMSUNG: "Aplicación port VR para Gear VR",
  13454. VR_DOWNLOAD_HERE: "Descargar aquí",
  13455. VR_REQUIRE_HEADSET: "Necesita un casco de realidad virtual y que se instale la aplicación port VR para Android",
  13456. VR_REDIRECT_TO_STORE: "Si la aplicación no está instalada, se le redirigirá a la tienda de aplicaciones.",
  13457. VR_IMPROPER_EMBED: "El espacio de port no está incorporado correctamente para apoyar VR en su navegador web.",
  13458. VR_OPEN_ANDROID_LINK: "Abre el enlace en tu teléfono móvil",
  13459. VR_ANDROID_OPTIONS: "Opciones de auriculares en RV disponibles",
  13460. SHARE_TO: "Compartir en",
  13461. SHARE_LINK: "Enlace directo",
  13462. SHARE_EXPLORE: "Explorar ",
  13463. SHARE_AT: "en",
  13464. SHARE_WITH: "con",
  13465. SHARE_3D: " en 3D",
  13466. SHARE_COPIED: "¡Copiado!",
  13467. ERROR_BROWSER_SOLUTION: "Instale un nuevo navegador para explorar en 3D.",
  13468. ERROR_BROWSER_EXPLANATION: "WebGL requiere un navegador moderno.",
  13469. ERROR_GENERIC_PROBLEM: "Vaya, algo ha ido mal.",
  13470. ERROR_GENERIC_SOLUTION: "Reinicie su navegador.",
  13471. ERROR_GENERIC_ACTIONS_1: "Si el problema persiste, ",
  13472. ERROR_GENERIC_ACTIONS_2: "instale un navegador compatible",
  13473. ERROR_GENERIC_ACTIONS_3: " o ",
  13474. ERROR_GENERIC_ACTIONS_4: "consulte nuestra guía de solución de problemas",
  13475. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navegador no compatible.",
  13476. ERROR_WEBGL_IOS_PROBLEM: "Versión de iOS no compatible.",
  13477. ERROR_WEBGL_IOS_SOLUTION: "Actualice a iOS 8 o superior para explorar en 3D.",
  13478. ERROR_WEBGL_IOS_ACTIONS_1: "Pulse ",
  13479. ERROR_WEBGL_IOS_ACTIONS_2: "Ajustes > General > Actualización de software",
  13480. ERROR_WEBGL_SAFARI_PROBLEM: "Habilite WebGL para explorar en 3D.",
  13481. ERROR_WEBGL_SAFARI_ACTIONS_1: "Haga clic en ",
  13482. ERROR_WEBGL_SAFARI_ACTIONS_2: "Preferencias > Avanzado > Mostrar el menú Desarrollar",
  13483. ERROR_WEBGL_SAFARI_ACTIONS_3: "Después, haga clic en ",
  13484. ERROR_WEBGL_SAFARI_ACTIONS_4: "Desarrollar > Habilitar WebGL",
  13485. ERROR_MISSING_URLS_PROBLEM: "Vaya, no hay panoramas para este modelo.",
  13486. ERROR_MISSING_URLS_EXPLANATION: "Este es un modelo antiguo. El propietario del sitio web puede tener un nuevo modelo en mente.",
  13487. ERROR_LOADING_FAILED_PROBLEM: "Vaya, modelo no disponible.",
  13488. ERROR_LOADING_FAILED_ACTIONS_1: "Si el problema persiste, ",
  13489. ERROR_LOADING_FAILED_ACTIONS_2: "consulte nuestra guía de solución de problemas",
  13490. ERROR_MAINTENANCE_PROBLEM: "Mantenimiento en progreso.",
  13491. ERROR_MAINTENANCE_SOLUTION: "Regrese en unos minutos.",
  13492. LINK_TO_LOCATION: "Enlace a la ubicación",
  13493. MENU_COPY: "Copiar",
  13494. LINK_ALERT_COPY: "Utilice CTRL/CMD + C para copiar.",
  13495. ROTATE: "Girar",
  13496. INSIDE: "Interior",
  13497. MOVE: "Moverse",
  13498. ZOOM: "Acercar o alejar"
  13499. }
  13500. }
  13501. , {}],
  13502. 113: [function(e, t, i) {
  13503. "use strict";
  13504. t.exports = {
  13505. PAGE_TITLE: "",
  13506. LOADING: "Chargement",
  13507. PRESENTED_BY_CAPS: "PRÉSENTÉ PAR",
  13508. POWERED_BY: "alimenté par ",
  13509. POWERED_BY_CAPS: "ALIMENTÉ PAR",
  13510. DESKTOP_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13511. MOBILE_SHORT_CTA: "Cliquez pour explorer l'Espace 3D.",
  13512. PRESENTED_BY: "Présenté par ",
  13513. MORE: "Plus ",
  13514. LESS: "Moins ",
  13515. TAG_CONTENT: "Contenu tag™",
  13516. SHOW: "Montrer",
  13517. HIDE: "Cacher",
  13518. DOLLHOUSE: "Dollhouse",
  13519. FLOOR_PLAN: "Plan de sol",
  13520. OPEN_HIGHLIGHTS: "Ouvrir les faits saillants",
  13521. CLOSE_HIGHLIGHTS: "Fermer",
  13522. PREVIOUS: "Précédent",
  13523. PLAY: "Lecture",
  13524. PAUSE: "Pause",
  13525. NEXT: "Suivant",
  13526. EXPLORE_3D_SPACE: "Explorer l'Espace en 3D",
  13527. VIEW_DOLLHOUSE: "Voir dollhouse",
  13528. SOCIAL_SHARING: "Partager cet espace",
  13529. VIEW_IN_VR: "Voir en VR",
  13530. VIEW_FULLSCREEN: "Plein écran",
  13531. EXIT_FULLSCREEN: "Fermer plein écran",
  13532. ZOOM_IN: "Zoom avant",
  13533. ZOOM_OUT: "Zoom arrière",
  13534. FLOOR_NAME: "Étage ",
  13535. FLOOR_ALL: "Tous",
  13536. TERMS: "Mentions légales",
  13537. PORT_TERMS: "port mentions légales",
  13538. TERMS_OF_USE: "Conditions d'utilisation",
  13539. TERMS_TEXT_FILE: "terms-fr-FR.html",
  13540. CLOSE_TERMS: "Fermer",
  13541. TERMS_FAIL: "Impossible d'accéder aux mentions légales. Vérifiez que vous avez une connexion Internet pour afficher les conditions d'utilisation.",
  13542. HELP: "Aide",
  13543. HELP_NAVIGATION_TAB: "Navigation",
  13544. HELP_MORE_HELP_TAB: "Aide",
  13545. CLOSE: "Fermer",
  13546. HELP_DESKTOP_PANORAMA_1A: "Cliquez et faites glisser pour regarder autour de l’espace.",
  13547. HELP_DESKTOP_PANORAMA_2A: "Cliquez sur les anneaux pour vous déplacer.",
  13548. HELP_DESKTOP_PANORAMA_3A: "Utilisez la molette de votre souris pour zoomer.",
  13549. HELP_DESKTOP_PANORAMA_1B: "Ou utilisez les touches pour tourner.",
  13550. HELP_DESKTOP_PANORAMA_2B: "Ou utilisez les touches pour avancer et reculer.",
  13551. HELP_DESKTOP_PANORAMA_3B: "Ou utilisez les touches plus et moins pour zoomer.",
  13552. HELP_DESKTOP_360_2A: "Cliquez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13553. HELP_DESKTOP_360_2B: "Ou, appuyez sur la touche numéro 1 pour entrer dans la Vue Intérieure.",
  13554. HELP_DESKTOP_DOLLHOUSE_1A: "Faites un clic gauche et bougez votre souris pour faire pivoter la vue Dollhouse.",
  13555. HELP_DESKTOP_DOLLHOUSE_2A: "Faites un clic droit et bougez votre souris pour changer la position de la vue Dollhouse.",
  13556. HELP_DESKTOP_DOLLHOUSE_3A: "Utilisez la molette de votre souris pour zoomer.",
  13557. HELP_DESKTOP_DOLLHOUSE_1B: "Ou utilisez les touches pour faire pivoter la vue Dollhouse.",
  13558. HELP_DESKTOP_FLOORPLAN_1A: "Faites un clic droit pour changer la position du plan sur l’écran.",
  13559. HELP_DESKTOP_FLOORPLAN_2A: "Faites un clic droit et faites glisser à gauche ou à droite pour faire pivoter le plan.",
  13560. HELP_DESKTOP_FLOORPLAN_3A: "Utilisez la molette de votre souris pour zoomer.",
  13561. HELP_DESKTOP_FLOORPLAN_2B: "Ou utilisez les touches pour faire pivoter à gauche ou à droite.",
  13562. HELP_DESKTOP_FLOORPLAN_3B: "Ou utilisez les touches pour effectuer un zoom avant ou arrière.",
  13563. HELP_MOBILE_PANORAMA_1: "Touchez et faites glisser pour regarder autour de l’espace.",
  13564. HELP_MOBILE_PANORAMA_2: "Tapez sur les anneaux dans tout l’espace pour vous déplacer.",
  13565. HELP_MOBILE_3: "Utilisez un geste de pincement pour zoomer avant/arrière.",
  13566. HELP_MOBILE_360_2: "Tapez sur l’icône Vue Intérieure pour entrer dans l’Espace.",
  13567. HELP_MOBILE_DOLLHOUSE_1: "Touchez et faites glisser vers le haut/bas/gauche/droite pour faire pivoter la vue Dollhouse.",
  13568. HELP_MOBILE_DOLLHOUSE_2: "Touchez et faites glisser avec deux doigts pour positionner vue en coupe.",
  13569. HELP_MOBILE_FLOORPLAN_1: "Touchez et faites glisser pour positionner le plan.",
  13570. HELP_MOBILE_FLOORPLAN_2: "Touchez et faites glisser avec deux doigts pour faire pivoter le plan.",
  13571. HELP_MORE_HLR_A: "Carrousel",
  13572. HELP_DESKTOP_MORE_HLR_B: "Ouvrez pour naviguer dans l’espace en utilisant les vignettes.",
  13573. HELP_MORE_DOLLHOUSE_A: "Vue en coupe",
  13574. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Cliquez pour afficher et faire pivoter l’espace entier en 3D.",
  13575. HELP_MOBILE_MORE_DOLLHOUSE_B: "Tapez pour afficher et faire pivoter l’espace entier en 3D.",
  13576. HELP_MORE_FLOORS_A: "Sélecteur d’étage",
  13577. HELP_DESKTOP_MORE_FLOORS_B: "Basculer entre les étages dans l’espace.",
  13578. HELP_MORE_TAG_A: "tag™ Posts",
  13579. HELP_DESKTOP_MORE_TAG_B: "Cliquez ou survolez pour obtenir des informations sur l’espace.",
  13580. HELP_MOBILE_MORE_TAG_B: "Tapez pour obtenir des informations sur l’espace.",
  13581. HELP_MORE_ZOOM_A: "Commandes de zoom",
  13582. HELP_DESKTOP_MORE_ZOOM_B: "Utilisez votre clavier ou la molette de votre souris pour zoomer.",
  13583. HELP_MORE_TOUR_A: "Commandes de la visite",
  13584. HELP_DESKTOP_MORE_TOUR_B: "Mettez en marche ou en pause, avancez et reculez lors d'une visite guidée.",
  13585. HELP_MORE_INSIDE_A: "Vue intérieure",
  13586. HELP_DESKTOP_MORE_INSIDE_B: "Cliquez pour explorer l’intérieur de l’espace.",
  13587. HELP_MOBILE_MORE_INSIDE_B: "Tapez pour explorer l’intérieur de l’espace.",
  13588. HELP_MORE_VR_A: "Mode RV",
  13589. HELP_DESKTOP_MORE_VR_B: "Cliquez pour lancer l’espace en réalité virtuelle.",
  13590. HELP_MOBILE_MORE_VR_B: "Tapez pour lancer l’espace en réalité virtuelle.",
  13591. HELP_MORE_360_A: "Vues 360°",
  13592. HELP_DESKTOP_MORE_360_B: "Cliquez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13593. HELP_MOBILE_MORE_360_B: "Tapez sur vues 360°, dans le carrousel pour voir les scènes extérieures.",
  13594. HELP_MORE_FULLSCREEN_A: "Plein écran",
  13595. HELP_DESKTOP_MORE_FULLSCREEN_B: "Voir 3D Showcase en plein écran.",
  13596. WEBVR_FOR_CARDBOARD: "Pour Google Cardboard",
  13597. WEBVR_FOR_DAYDREAM: "Pour Daydream View",
  13598. WEBVR_ENTER_WEBVR: "ENTRER VR",
  13599. WEBVR_DIFFERENT_HEADSET: "Avez-vous un casque différent?",
  13600. WEBVR_LEARN_MORE: "En savoir plus",
  13601. WEBVR_VIEW_SPACE: "Voir Espace en VR",
  13602. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13603. WEBVR_DAYDREAM_PHONE: "Téléphone compatibles Daydream",
  13604. WEBVR_VIEW_CARDBOARD: "Ou Afficher sur Google Cardboard",
  13605. VR_VIEW_SPACE: "Voir l'Espace en Réalité Virtuelle",
  13606. VR_LEARN_MORE_CAPS: "EN SAVOIR PLUS",
  13607. VR_PREVIOUS_CAPS: "PRÉCÉDENT",
  13608. VR_NEXT_CAPS: "SUIVANT",
  13609. VR_GOT_IT_CAPS: "BIEN COMPRIS",
  13610. VR_SHOW_SUPPORTED: "Taper pour voir l'Espace en VR avec",
  13611. VR_SHOW_UNSUPPORTED: "Désolé mais votre appareil ne répond pas aux critères minimaux pour voir cet Espace en mode VR.",
  13612. VR_SHOW_IOS_1: "Taper pour voir l’Espace en Realité Virtuelle",
  13613. VR_SHOW_IOS_2: "Nécessite l’application port VR et un iPhone compatible pour voir",
  13614. VR_WHAT_YOU_NEED: "Ce dont vous aurez besoin pour...",
  13615. VR_NEED_CARDBOARD: "Ce dont vous aurez besoin avec Google Cardboard",
  13616. VR_NEED_SAMSUNG: "Ce dont vous aurez besoin avec Samsung Gear VR",
  13617. VR_NEED_DAYDREAM: "BESOINS AVANT APPARIEMENT AVEC DAYDREAM VIEW",
  13618. VR_NEED_DAYDREAM_PHONE: "Téléphone compatible avec Daydream",
  13619. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13620. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13621. VR_APP: "port VR App",
  13622. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13623. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13624. VR_COMPATIBLE_IPHONES_2: "iPhone 5s et plus récent, avec iOS 9.1 et plus récent",
  13625. VR_COMPATIBLE_IPHONES_3: "iPhones compatibles",
  13626. VR_COMPATIBLE_ANDROID: "Appareils Android compatibles",
  13627. 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",
  13628. VR_ANDROID_DETAIL: 'Écrans 4.5" à 5.5" avec Android 4.4.4 ou plus récent',
  13629. VR_ANDROID_DVICES: "Appareils Android",
  13630. VR_COMPATIBLE_SAMSUNG: "Appareils Samsung Compatibles",
  13631. VR_SAMSUNG_DETAIL: "Galaxy S6 et plus récents",
  13632. VR_APP_FOR_CARDBOARD: "Application port VR pour Google Cardboard",
  13633. VR_APP_FOR_SAMSUNG: "Application port VR pour Gear VR",
  13634. VR_APP_FOR_ANDROID: "Application port VR pour téléphones Android",
  13635. VR_APP_OPEN: "Ouvrir plutôt avec l’application port VR",
  13636. VR_DOWNLOAD_HERE: "Télécharger ici",
  13637. VR_REQUIRE_HEADSET: "Nécessite un casque VR et l'application port VR pour Android afin d'être installé",
  13638. VR_REDIRECT_TO_STORE: "Si l'application n'est pas installée, vous serez rediriger vers l'App store.",
  13639. VR_IMPROPER_EMBED: "L'Espace port n'est pas correctement intégré pour supporter VR dans votre navigateur Web.",
  13640. VR_OPEN_ANDROID_LINK: "Ouvrez ce lien avec votre appareil mobile",
  13641. VR_ANDROID_OPTIONS: "Options disponibles pour casque VR sous",
  13642. SHARE_TO: "Partager sur",
  13643. SHARE_LINK: "Lien direct",
  13644. SHARE_EXPLORE: "Explorer ",
  13645. SHARE_AT: "à",
  13646. SHARE_WITH: "avec",
  13647. SHARE_3D: " en 3D",
  13648. SHARE_COPIED: "Copié!",
  13649. ERROR_BROWSER_SOLUTION: "Installer un nouveau navigateur pour explorer en 3D.",
  13650. ERROR_BROWSER_EXPLANATION: "WebGL a besoin d'un navigateur récent.",
  13651. ERROR_GENERIC_PROBLEM: "Il y eu un problème.",
  13652. ERROR_GENERIC_SOLUTION: "Redémarrer votre navigateur.",
  13653. ERROR_GENERIC_ACTIONS_1: "Si le problème persiste, ",
  13654. ERROR_GENERIC_ACTIONS_2: "installez un navigateur plus récent",
  13655. ERROR_GENERIC_ACTIONS_3: " ou ",
  13656. ERROR_GENERIC_ACTIONS_4: "voir notre guide de dépannage",
  13657. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Navigateur non-supporté.",
  13658. ERROR_WEBGL_IOS_PROBLEM: "Version iOS non-supportée.",
  13659. ERROR_WEBGL_IOS_SOLUTION: "Mettre à jour avec iOS8 au minimum pour voir l'Espace en 3D.",
  13660. ERROR_WEBGL_IOS_ACTIONS_1: "Tapez ",
  13661. ERROR_WEBGL_IOS_ACTIONS_2: "Paramètres > Général > Mise à jour Software",
  13662. ERROR_WEBGL_SAFARI_PROBLEM: "Activez WegGL pour explorer en 3D.",
  13663. ERROR_WEBGL_SAFARI_ACTIONS_1: "Cliquez ",
  13664. ERROR_WEBGL_SAFARI_ACTIONS_2: "Préferences > Avancés > Voir menu développeur",
  13665. ERROR_WEBGL_SAFARI_ACTIONS_3: "Puis cliquez ",
  13666. ERROR_WEBGL_SAFARI_ACTIONS_4: "Développe > Activé WebGL",
  13667. ERROR_MISSING_URLS_PROBLEM: "Il n'y a pas de panoromas pour ce modèle.",
  13668. ERROR_MISSING_URLS_EXPLANATION: "Ceci est un ancien modèle. Le propriétaire du site a peut-être un nouveau modèle en cours.",
  13669. ERROR_LOADING_FAILED_PROBLEM: "Ce modèle n'est pas disponible.",
  13670. ERROR_LOADING_FAILED_ACTIONS_1: "Si le problème persiste, ",
  13671. ERROR_LOADING_FAILED_ACTIONS_2: "voir notre guide de dépannage",
  13672. ERROR_MAINTENANCE_PROBLEM: "Maintenance en cours.",
  13673. ERROR_MAINTENANCE_SOLUTION: "Revenez dans quelques instants.",
  13674. LINK_TO_LOCATION: "Lien vers l'emplacement",
  13675. MENU_COPY: "Copie",
  13676. LINK_ALERT_COPY: "Utiliser CTRL+CMD C pour copier.",
  13677. ROTATE: "Faire pivoter",
  13678. INSIDE: "Intérieure",
  13679. MOVE: "Se déplacer",
  13680. ZOOM: "Zoom"
  13681. }
  13682. }
  13683. , {}],
  13684. 114: [function(e, t, i) {
  13685. "use strict";
  13686. t.exports = {
  13687. PAGE_TITLE: "",
  13688. LOADING: "読み込み中",
  13689. PRESENTED_BY_CAPS: "PRESENTED BY",
  13690. POWERED_BY: "powered by",
  13691. POWERED_BY_CAPS: "POWERED BY",
  13692. DESKTOP_SHORT_CTA: "クリックしてこの3D Spaceを探索",
  13693. MOBILE_SHORT_CTA: "タップしてこの3D Spaceを探索",
  13694. PRESENTED_BY: "Presented by ",
  13695. MORE: "全て表示 ",
  13696. LESS: "閉じる ",
  13697. TAG_CONTENT: "tag™コンテンツ ",
  13698. SHOW: "表示",
  13699. HIDE: "非表示",
  13700. DOLLHOUSE: "ドールハウス",
  13701. FLOOR_PLAN: "フロアプラン",
  13702. OPEN_HIGHLIGHTS: "ハイライトを開く",
  13703. CLOSE_HIGHLIGHTS: "閉じる",
  13704. PREVIOUS: "前へ",
  13705. PLAY: "再生",
  13706. PAUSE: "一時停止",
  13707. NEXT: "次へ",
  13708. EXPLORE_3D_SPACE: "3DSpaceの探索",
  13709. VIEW_DOLLHOUSE: "ドールハウスの表示",
  13710. SOCIAL_SHARING: "このSpaceを共有する",
  13711. VIEW_IN_VR: "VRで表示",
  13712. VIEW_FULLSCREEN: "フルスクリーン表示",
  13713. EXIT_FULLSCREEN: "フルスクリーン表示を終了",
  13714. ZOOM_IN: "ズームイン",
  13715. ZOOM_OUT: "ズームアウト",
  13716. FLOOR_NAME: "フロア ",
  13717. FLOOR_ALL: "すべて",
  13718. TERMS: "規約",
  13719. PORT_TERMS: "port規約",
  13720. TERMS_OF_USE: "利用規約",
  13721. CLOSE_TERMS: "閉じる",
  13722. TERMS_TEXT_FILE: "terms-jp-JP.html",
  13723. TERMS_FAIL: "規約を取得できませんでした。利用規約を表示するためにインターネットに接続されていることを確認してください。",
  13724. WEBVR_FOR_DAYDREAM: "Daydream View用",
  13725. WEBVR_ENTER_WEBVR: "VRに入る",
  13726. WEBVR_DIFFERENT_HEADSET: "別のヘッドセットをお持ちですか?",
  13727. WEBVR_LEARN_MORE: "もっと詳しく",
  13728. WEBVR_VIEW_SPACE: "VRでSpaceを表示",
  13729. WEBVR_DAYDREAM_VIEW: "Daydream View",
  13730. WEBVR_DAYDREAM_PHONE: "Daydream対応スマホ",
  13731. WEBVR_FOR_CARDBOARD: "Google Cardboard用",
  13732. WEBVR_VIEW_CARDBOARD: "またはGoogle Cardboardで表示",
  13733. VR_VIEW_SPACE: "バーチャルリアリティでSpaceを表示",
  13734. VR_LEARN_MORE_CAPS: "もっと詳しく",
  13735. VR_PREVIOUS_CAPS: "前へ",
  13736. VR_NEXT_CAPS: "次へ",
  13737. VR_GOT_IT_CAPS: "了解",
  13738. VR_SHOW_SUPPORTED: "タップして次を使用してVRでSpaceを表示: ",
  13739. VR_SHOW_UNSUPPORTED: "お使いのデバイスはVRでSpaceを表示する最低要件を満たしていません",
  13740. VR_SHOW_IOS_1: "タップしてVRでSpaceを表示",
  13741. VR_SHOW_IOS_2: "表示するにはport VRアプリと互換性のあるiPhoneが必要です",
  13742. VR_WHAT_YOU_NEED: "必要なもの",
  13743. VR_NEED_CARDBOARD: "Google Cardboardに必要なもの",
  13744. VR_NEED_SAMSUNG: "Samsung Gear VRに必要なもの",
  13745. VR_NEED_DAYDREAM: "事前にDaydream Viewとのペアリングが必要です",
  13746. VR_NEED_DAYDREAM_PHONE: "Daydream対応スマホ",
  13747. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13748. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13749. VR_APP: "port VRアプリ",
  13750. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13751. VR_COMPATIBLE_IPHONES_1: "iPhone",
  13752. VR_COMPATIBLE_IPHONES_2: "iOS 9.1以降で動作するiPhone 5s以降のモデル",
  13753. VR_COMPATIBLE_IPHONES_3: "互換性のあるiPhone",
  13754. VR_COMPATIBLE_ANDROID: "互換性のあるAndroidデバイス",
  13755. VR_COMPATIBLE_ANDROID_LONG: "Android OS 4.4.4以降で動作する互換性のあるAndroidデバイスの4.5~5.5インチディスプレイ",
  13756. VR_ANDROID_DETAIL: "Android OS 4.4.4以降で動作する4.5~5.5インチディスプレイ",
  13757. VR_ANDROID_DVICES: "Androidデバイス",
  13758. VR_COMPATIBLE_SAMSUNG: "互換性のあるSamsungデバイス",
  13759. VR_SAMSUNG_DETAIL: "Galaxy S5以降のモデル",
  13760. VR_APP_FOR_CARDBOARD: "Google Cardboard用のport VRアプリ",
  13761. VR_APP_FOR_SAMSUNG: "Gear VR 用のport VRアプリ",
  13762. VR_APP_FOR_ANDROID: "Androidフォン用のport VRアプリ",
  13763. VR_APP_OPEN: "port VRアプリで開く",
  13764. VR_DOWNLOAD_HERE: "ここからダウンロード",
  13765. VR_REQUIRE_HEADSET: "Android 用のVRヘッドセットとport VRアプリ をインストールする必要があります",
  13766. VR_REDIRECT_TO_STORE: "アプリがインストールされていない場合、App Storeにリダイレクトされます",
  13767. VR_IMPROPER_EMBED: "お使いのウェブブラウザでVRがサポートされるようport Spaceが適切に埋め込まれていません。",
  13768. VR_OPEN_ANDROID_LINK: "お使いの携帯電話でリンクを開いてください",
  13769. VR_ANDROID_OPTIONS: "利用可能なVRヘッドセットオプション",
  13770. SHARE_TO: "共有先",
  13771. SHARE_LINK: "ダイレクトリンク",
  13772. SHARE_EXPLORE: "探索",
  13773. SHARE_AT: "場所",
  13774. SHARE_WITH: "使用アプリ",
  13775. SHARE_3D: "3Dで",
  13776. SHARE_COPIED: "コピーされました!",
  13777. ERROR_BROWSER_SOLUTION: "3D探索するには、新しいバージョンのブラウザをインストールしてください",
  13778. ERROR_BROWSER_EXPLANATION: "WebGLにはモダンブラウザが必要です。",
  13779. ERROR_GENERIC_PROBLEM: "問題が発生しました。",
  13780. ERROR_GENERIC_SOLUTION: "ブラウザを再起動してください。",
  13781. ERROR_GENERIC_ACTIONS_1: "問題が解決しない場合は、",
  13782. ERROR_GENERIC_ACTIONS_2: "サポートされているブラウザをインストールしてください",
  13783. ERROR_GENERIC_ACTIONS_3: "または",
  13784. ERROR_GENERIC_ACTIONS_4: "トラブルシューティングガイドを参照してください",
  13785. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "ブラウザがサポートされていません。",
  13786. ERROR_WEBGL_IOS_PROBLEM: "サポートされていないiOSバージョンです。",
  13787. ERROR_WEBGL_IOS_SOLUTION: "3D探索するには、iOS 8以降にアップグレードしてください。",
  13788. ERROR_WEBGL_IOS_ACTIONS_1: "以下の順にタップします:",
  13789. ERROR_WEBGL_IOS_ACTIONS_2: "設定 > 全般 > ソフトウェアの更新",
  13790. ERROR_WEBGL_SAFARI_PROBLEM: "WebGLを有効にして3Dで探索します。",
  13791. ERROR_WEBGL_SAFARI_ACTIONS_1: "以下の順にクリックします:",
  13792. ERROR_WEBGL_SAFARI_ACTIONS_2: "環境設定 > 詳細 > メニューバーに開発メニューを表示",
  13793. ERROR_WEBGL_SAFARI_ACTIONS_3: "その後、以下の順にクリックします:",
  13794. ERROR_WEBGL_SAFARI_ACTIONS_4: "開発 > WebGLを有効にする",
  13795. ERROR_MISSING_URLS_PROBLEM: "このモデルではパノラマを使用できません。",
  13796. ERROR_MISSING_URLS_EXPLANATION: "これは古いモデルです。ウェブサイト所有者が新しいモデルを開発中かもしれません。",
  13797. ERROR_LOADING_FAILED_PROBLEM: "モデルは利用できません。",
  13798. ERROR_LOADING_FAILED_ACTIONS_1: "問題が解決しない場合は、",
  13799. ERROR_LOADING_FAILED_ACTIONS_2: "トラブルシューティングガイドを参照してください",
  13800. ERROR_MAINTENANCE_PROBLEM: "メンテナンスは進行中です。",
  13801. ERROR_MAINTENANCE_SOLUTION: "しばらくしてからやり直し てください。",
  13802. LINK_TO_LOCATION: "ロケーションへのリンク",
  13803. MENU_COPY: "コピー",
  13804. LINK_ALERT_COPY: "コピーするにはCTRL/CMD + Cを使用してください。",
  13805. ROTATE: "回転",
  13806. MOVE: "移動",
  13807. INSIDE: "内側",
  13808. ZOOM: "ズーム",
  13809. HELP: "ヘルプ",
  13810. HELP_NAVIGATION_TAB: "ナビゲーション",
  13811. HELP_MORE_HELP_TAB: "その他のヘルプ",
  13812. HELP_DESKTOP_PANORAMA_1A: "Spaceを見回すには、クリックしてドラッグします。",
  13813. HELP_DESKTOP_PANORAMA_2A: "移動するには、Space全体にあるリングをクリックします。",
  13814. HELP_DESKTOP_PANORAMA_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13815. HELP_DESKTOP_PANORAMA_1B: "または、矢印キーを使用して左右に向きを変えます。",
  13816. HELP_DESKTOP_PANORAMA_2B: "または、矢印キーを使用して前後に向きを変えます。",
  13817. HELP_DESKTOP_PANORAMA_3B: "あるいは、プラス(+)キーまたはマイナス(-)キーを使用して、ズームイン、ズームアウトします。",
  13818. HELP_DESKTOP_360_2A: "内側ビューアイコンをクリックしてSpaceに入ります。",
  13819. HELP_DESKTOP_360_2B: "または、数字キー1を押して内側ビューに入ります。",
  13820. HELP_DESKTOP_DOLLHOUSE_1A: "左クリックと左右、上下のドラッグでドールハウスを回転します。",
  13821. HELP_DESKTOP_DOLLHOUSE_2A: "右クリックと左右、上下のドラッグでドールハウスの画面上の位置を変更します。",
  13822. HELP_DESKTOP_DOLLHOUSE_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13823. HELP_DESKTOP_DOLLHOUSE_1B: "または、矢印キーを使用してドールハウスを回転します。",
  13824. HELP_DESKTOP_FLOORPLAN_1A: "左ボタンを押しながら、上下左右にドラッグしてフロアプランの画面上の位置を変更します。",
  13825. HELP_DESKTOP_FLOORPLAN_2A: "右ボタンを押しながら左右にドラッグして、フロアプランを回転します。",
  13826. HELP_DESKTOP_FLOORPLAN_3A: "スクロールホイールを使用してズームイン、ズームアウトします。",
  13827. HELP_DESKTOP_FLOORPLAN_2B: "または、矢印キーを使用して左右に回転します。",
  13828. HELP_DESKTOP_FLOORPLAN_3B: "または、矢印キーを使用して、ズームイン、ズームアウトします。",
  13829. HELP_MOBILE_PANORAMA_1: "Spaceを見回すには、タッチしてドラッグします。",
  13830. HELP_MOBILE_PANORAMA_2: "移動するには、Space全体にあるリングをタップします。",
  13831. HELP_MOBILE_3: "ピンチジェスチャーを使用してズームイン、ズームアウトします。",
  13832. HELP_MOBILE_360_2: "内側ビューアイコンをタップしてSpaceに入ります。",
  13833. HELP_MOBILE_DOLLHOUSE_1: "タッチして上下左右にドラッグしてドールハウスを回転します。",
  13834. HELP_MOBILE_DOLLHOUSE_2: "タッチして、2本指でドラッグしてドールハウスを配置します。",
  13835. HELP_MOBILE_FLOORPLAN_1: "タッチ&ドラッグしてフロアプランを配置します。",
  13836. HELP_MOBILE_FLOORPLAN_2: "タッチして、2本指でドラッグしてフロアプランを回転します。",
  13837. HELP_MORE_HLR_A: "ハイライト",
  13838. HELP_DESKTOP_MORE_HLR_B: "サムネイル画像を使用してSpaceを移動するために開きます。",
  13839. HELP_MORE_DOLLHOUSE_A: "ドールハウス",
  13840. HELP_DESKTOP_MORE_DOLLHOUSE_B: "クリックして3DでSpace全体のトップダウンビューを表示して回転します。",
  13841. HELP_MOBILE_MORE_DOLLHOUSE_B: "タップして3DでSpace全体のトップダウンビューを表示して回転します。",
  13842. HELP_MORE_FLOORS_A: "フロアセレクター",
  13843. HELP_DESKTOP_MORE_FLOORS_B: "Space内のフロアを切り替えます。",
  13844. HELP_MORE_TAG_A: "tag™ Posts",
  13845. HELP_DESKTOP_MORE_TAG_B: "クリックするか、カーソルを置くとSpace内の機能についての説明が表示されます。",
  13846. HELP_MOBILE_MORE_TAG_B: "タップするとSpace内の機能についての説明が表示されます。",
  13847. HELP_MORE_ZOOM_A: "ズームコントロール",
  13848. HELP_DESKTOP_MORE_ZOOM_B: "これらのコントロールまたはスクロールホイールを使用して、ズームイン、ズームアウトします。",
  13849. HELP_MORE_TOUR_A: "ツアーコントロール",
  13850. HELP_DESKTOP_MORE_TOUR_B: "ガイド付きツアー中に再生、一時停止、前方・後方に移動します。",
  13851. HELP_MORE_INSIDE_A: "内側ビュー",
  13852. HELP_DESKTOP_MORE_INSIDE_B: "クリックしてSpace内を探索します。",
  13853. HELP_MOBILE_MORE_INSIDE_B: "タップしてSpace内を探索します。",
  13854. HELP_MORE_VR_A: "VRモード",
  13855. HELP_DESKTOP_MORE_VR_B: "クリックしてバーチャルリアリティでSpaceを起動します。",
  13856. HELP_MOBILE_MORE_VR_B: "タップしてバーチャルリアリティでSpaceを起動します。",
  13857. HELP_MORE_360_A: "360° Views",
  13858. HELP_DESKTOP_MORE_360_B: "Highlight Reelの360° Viewsをクリックして屋外シーンを表示します。",
  13859. HELP_MOBILE_MORE_360_B: "Highlight Reelの360° Viewsをタップして屋外シーンを表示します。",
  13860. HELP_MORE_FULLSCREEN_A: "フルスクリーン",
  13861. HELP_DESKTOP_MORE_FULLSCREEN_B: "3D Showcaseをフルスクリーン表示にします。",
  13862. CLOSE: "閉じる"
  13863. }
  13864. }
  13865. , {}],
  13866. 115: [function(e, t, i) {
  13867. "use strict";
  13868. t.exports = {
  13869. PAGE_TITLE: "",
  13870. LOADING: "Загрузка",
  13871. PRESENTED_BY_CAPS: "ПРЕДСТАВЛЕНО",
  13872. POWERED_BY: "разработано на платформе ",
  13873. POWERED_BY_CAPS: "РАЗРАБОТАНО НА ПЛАТФОРМЕ",
  13874. DESKTOP_SHORT_CTA: "Нажмите для просмотра.",
  13875. MOBILE_SHORT_CTA: "Нажмите для просмотра.",
  13876. PRESENTED_BY: "Представлено ",
  13877. MORE: "Больше ",
  13878. LESS: "Меньше ",
  13879. TAG_CONTENT: "tag™ Контент",
  13880. SHOW: "Показать",
  13881. HIDE: "Скрыть",
  13882. DOLLHOUSE: "Dollhouse",
  13883. FLOOR_PLAN: "Планировка",
  13884. OPEN_HIGHLIGHTS: "Открыть Фотоколлаж",
  13885. CLOSE_HIGHLIGHTS: "Закрыть",
  13886. PREVIOUS: "Предыдущий",
  13887. PLAY: "Воспроизвести",
  13888. PAUSE: "Пауза",
  13889. NEXT: "Следующий",
  13890. EXPLORE_3D_SPACE: "Просмотреть 3D модель",
  13891. VIEW_DOLLHOUSE: "Посмотреть Dollhouse",
  13892. SOCIAL_SHARING: "Поделиться этой моделью",
  13893. VIEW_IN_VR: "Посмотреть в VR",
  13894. VIEW_FULLSCREEN: "Полный экран",
  13895. EXIT_FULLSCREEN: "Выйти из полноэкранного режима",
  13896. ZOOM_IN: "Увеличить",
  13897. ZOOM_OUT: "Уменьшить",
  13898. FLOOR_NAME: "Этаж ",
  13899. FLOOR_ALL: "Все",
  13900. TERMS: "Условия",
  13901. PORT_TERMS: "Правила пользования",
  13902. TERMS_OF_USE: "Условия использования",
  13903. TERMS_TEXT_FILE: "terms-ru-RU.html",
  13904. CLOSE_TERMS: "Закрыть",
  13905. TERMS_FAIL: "Не удалось загрузить условия использования. Для просмотра условий использования, пожалуйста, убедитесь, что у Вас есть подключение к Интернету.",
  13906. HELP: "Помощь",
  13907. HELP_NAVIGATION_TAB: "Навигация",
  13908. HELP_MORE_HELP_TAB: "Доп. Помощь",
  13909. CLOSE: "Закрыть",
  13910. HELP_DESKTOP_PANORAMA_1A: "Нажмите и перетащите, чтобы осмотреть пространство вокруг.",
  13911. HELP_DESKTOP_PANORAMA_2A: "Для передвижения по модели нажимайте на круги .",
  13912. HELP_DESKTOP_PANORAMA_3A: "Используйте колесо прокрутки для увеличения и уменьшения.",
  13913. HELP_DESKTOP_PANORAMA_1B: "Или используйте клавиши со стрелками для поворота влево и вправо.",
  13914. HELP_DESKTOP_PANORAMA_2B: "Или используйте стрелки для перемещения вперед и назад.",
  13915. HELP_DESKTOP_PANORAMA_3B: "Или используйте клавиши ‘плюс’ и ‘минус’ для увеличения и уменьшения изображения.",
  13916. HELP_DESKTOP_360_2A: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13917. HELP_DESKTOP_360_2B: "или нажмите 1 на клавиатуре, чтобы увидеть внутреннюю панораму.",
  13918. HELP_DESKTOP_DOLLHOUSE_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы повернуть Dollhouse.",
  13919. HELP_DESKTOP_DOLLHOUSE_2A: "Нажмите правую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить позицию Dollhouse на экране.",
  13920. HELP_DESKTOP_DOLLHOUSE_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13921. HELP_DESKTOP_DOLLHOUSE_1B: "Или используйте клавиши со стрелками, чтобы повернуть Dollhouse.",
  13922. HELP_DESKTOP_FLOORPLAN_1A: "Нажмите левую кнопку мыши и перетащите влево, вправо, вверх и вниз, чтобы изменить положение Планировки на экране.",
  13923. HELP_DESKTOP_FLOORPLAN_2A: "Нажмите правую кнопку мыши и перетащите влево или вправо, чтобы повернуть Планировку.",
  13924. HELP_DESKTOP_FLOORPLAN_3A: "Используйте колесо прокрутки чтобы увеличить и уменьшить.",
  13925. HELP_DESKTOP_FLOORPLAN_2B: "Или используйте клавиши со стрелками для поворота влево или вправо.",
  13926. HELP_DESKTOP_FLOORPLAN_3B: "Или используйте стрелки для увеличения и уменьшения.",
  13927. HELP_MOBILE_PANORAMA_1: "Нажмите и перетащите, чтобы осмотреть модель.",
  13928. HELP_MOBILE_PANORAMA_2: "Для передвижения по модели нажимайте на круги.",
  13929. HELP_MOBILE_3: "Используйте движение двумя пальцами в разные стороны, чтобы увеличить и уменьшить.",
  13930. HELP_MOBILE_360_2: "Нажмите на значок ‘Вид Изнутри’, чтобы увидеть внутреннюю панораму.",
  13931. HELP_MOBILE_DOLLHOUSE_1: "Нажмите и перетащите вверх, вниз, влево и вправо, чтобы повернуть Dollhouse.",
  13932. HELP_MOBILE_DOLLHOUSE_2: "Нажмите и перетащите, чтобы расположить Dollhouse.",
  13933. HELP_MOBILE_FLOORPLAN_1: "Нажмите и перетащите, чтобы расположить план здания.",
  13934. HELP_MOBILE_FLOORPLAN_2: "Коснитесь и перетащите двумя пальцами, чтобы повернуть план здания.",
  13935. HELP_MORE_HLR_A: "Фотоколлаж",
  13936. HELP_DESKTOP_MORE_HLR_B: "Откройте для перемещения по модели, используя иконки изображений.",
  13937. HELP_MORE_DOLLHOUSE_A: "Dollhouse",
  13938. HELP_DESKTOP_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13939. HELP_MOBILE_MORE_DOLLHOUSE_B: "Нажмите и поверните сверху вниз чтобы просмотреть всю 3D модель.",
  13940. HELP_MORE_FLOORS_A: "Выбор Этажа",
  13941. HELP_DESKTOP_MORE_FLOORS_B: "Переключение между этажами.",
  13942. HELP_MORE_TAG_A: "tag™ Posts",
  13943. HELP_DESKTOP_MORE_TAG_B: "Нажмите или наведите курсор мыши для получения информации о функциях в Пространстве.",
  13944. HELP_MOBILE_MORE_TAG_B: "Нажмите для получения информации о функциях.",
  13945. HELP_MORE_ZOOM_A: "Масштаб",
  13946. HELP_DESKTOP_MORE_ZOOM_B: "Используйте эти кнопки для увеличения и уменьшения изображения или используйте колесо прокрутки.",
  13947. HELP_MORE_TOUR_A: "Управление Туром",
  13948. HELP_DESKTOP_MORE_TOUR_B: "Используйте кнопки Воспроизвести, Пауза, Вперед и Назад для управления фотоколлажем.",
  13949. HELP_MORE_INSIDE_A: "Вид Изнутри",
  13950. HELP_DESKTOP_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13951. HELP_MOBILE_MORE_INSIDE_B: "Нажмите, чтобы просмотреть модель изнутри.",
  13952. HELP_MORE_VR_A: "Режим VR",
  13953. HELP_DESKTOP_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13954. HELP_MOBILE_MORE_VR_B: "Нажмите, чтобы запустить модель в виртуальной реальности.",
  13955. HELP_MORE_360_A: "360° Views",
  13956. HELP_DESKTOP_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13957. HELP_MOBILE_MORE_360_B: "Нажмите на “360 Views” в фотоколлаже, чтобы просмотреть внешний пейзаж.",
  13958. HELP_MORE_FULLSCREEN_A: "Полный экран",
  13959. HELP_DESKTOP_MORE_FULLSCREEN_B: "Развернуть 3D Showcase во весь экран.",
  13960. WEBVR_FOR_CARDBOARD: "Для Google Cardboard",
  13961. WEBVR_FOR_DAYDREAM: "Для просмотра в Daydream",
  13962. WEBVR_ENTER_WEBVR: "ВОЙТИ В VR ",
  13963. WEBVR_DIFFERENT_HEADSET: "Есть другой VR-шлем?",
  13964. WEBVR_LEARN_MORE: "Узнать больше",
  13965. WEBVR_VIEW_SPACE: "Запустить модель в VR",
  13966. WEBVR_DAYDREAM_VIEW: "Посмотреть в Daydream",
  13967. WEBVR_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13968. WEBVR_VIEW_CARDBOARD: "Или просмотреть в Google Cardboard",
  13969. VR_WHAT_YOU_NEED: "Что Вам потребуется...",
  13970. VR_NEED_DAYDREAM_PHONE: "Daydream-готовый телефон",
  13971. VR_GOOGLE_DAYDREAM: "Google Daydream",
  13972. VR_APP: "port VR App",
  13973. VR_APP_OPEN: "Или открыть через приложение port VR",
  13974. VR_COMPATIBLE_ANDROID_LONG: 'Совместимые Android устройства с диагональю экрана 4.5"-5.5" дюймов и Android версией 4.4.4, и выше',
  13975. VR_SAMSUNG_DETAIL: "Galaxy S6 и выше",
  13976. VR_APP_FOR_ANDROID: "Приложение port VR для Android",
  13977. VR_NEED_DAYDREAM: "Необходимо для соединением с Daydream",
  13978. VR_VIEW_SPACE: "Запустить модель в VR",
  13979. VR_LEARN_MORE_CAPS: "УЗНАТЬ БОЛЬШЕ",
  13980. VR_PREVIOUS_CAPS: "ПРЕДЫДУЩИЙ",
  13981. VR_NEXT_CAPS: "СЛЕДУЮЩИЙ",
  13982. VR_GOT_IT_CAPS: "ЯСНО",
  13983. VR_SHOW_SUPPORTED: "Нажмите, чтобы просмотреть модель в VR с помощью",
  13984. VR_SHOW_UNSUPPORTED: "Извините, но Ваше устройство не соответствует минимальным требованиям для просмотра модели в VR.",
  13985. VR_SHOW_IOS_1: "Нажмите, чтобы просмотреть модель в VR",
  13986. VR_SHOW_IOS_2: "Для просмотра требуется приложение port VR и совместимый iPhone",
  13987. VR_NEED_CARDBOARD: "Что Вам потребуется для Google Cardboard",
  13988. VR_NEED_SAMSUNG: "Что Вам потребуется для Samsung Gear VR",
  13989. VR_GOOGLE_CARDBOARD: "Google Cardboard",
  13990. VR_SAMSUNG_GEAR_VR: "Samsung Gear VR",
  13991. VR_COMPATIBLE_IPHONES_1: "iPhones",
  13992. VR_COMPATIBLE_IPHONES_2: "iPhone 5s или новее с iOS 9.1 и выше",
  13993. VR_COMPATIBLE_IPHONES_3: "Совместимые модели iPhone",
  13994. VR_COMPATIBLE_ANDROID: "Совместимые Android устройства",
  13995. VR_ANDROID_DETAIL: 'Экран от 4.5" до 5.5" и Android 4.4.4, и выше',
  13996. VR_ANDROID_DVICES: "Android устройства",
  13997. VR_COMPATIBLE_SAMSUNG: "Совместимые Samsung устройства",
  13998. VR_APP_FOR_CARDBOARD: "Приложение port VR для Google Cardboard",
  13999. VR_APP_FOR_SAMSUNG: "Приложение port VR для Gear VR",
  14000. VR_DOWNLOAD_HERE: "Скачать здесь",
  14001. VR_REQUIRE_HEADSET: "Требуется VR-шлем и установленное приложение port VR для Android",
  14002. VR_REDIRECT_TO_STORE: "Если приложение не установлено, Вы будете перенаправлены на страницу магазина приложений.",
  14003. VR_IMPROPER_EMBED: "port модель не встроена должным образом для поддержки VR в вашем веб-браузере.",
  14004. VR_OPEN_ANDROID_LINK: "Откройте ссылку на Вашем мобильном телефоне",
  14005. VR_ANDROID_OPTIONS: "Доступные опции VR-шлемов",
  14006. SHARE_TO: "Поделиться",
  14007. SHARE_LINK: "Прямая ссылка",
  14008. SHARE_EXPLORE: "просмотреть",
  14009. SHARE_AT: "на",
  14010. SHARE_WITH: "с",
  14011. SHARE_3D: "в 3D",
  14012. SHARE_COPIED: "Скопировано!",
  14013. ERROR_BROWSER_SOLUTION: "установите новый браузер, чтобы просмотреть 3D пространство.",
  14014. ERROR_BROWSER_EXPLANATION: "WebGL требует современный браузер.",
  14015. ERROR_GENERIC_PROBLEM: "Ой, что-то пошло не так.",
  14016. ERROR_GENERIC_SOLUTION: "Перезапустите браузер.",
  14017. ERROR_GENERIC_ACTIONS_1: "Если проблема не устранена, ",
  14018. ERROR_GENERIC_ACTIONS_2: "установите поддерживаемый браузер",
  14019. ERROR_GENERIC_ACTIONS_3: " или ",
  14020. ERROR_GENERIC_ACTIONS_4: "смотрите наше руководство по устранению неполадок",
  14021. ERROR_WEBGL_UNSUPPORTED_PROBLEM: "Браузер не поддерживается.",
  14022. ERROR_WEBGL_IOS_PROBLEM: "iOS-версия не поддерживается.",
  14023. ERROR_WEBGL_IOS_SOLUTION: "Обновите до iOS 8 или выше, чтобы просмотреть пространство в 3D.",
  14024. ERROR_WEBGL_IOS_ACTIONS_1: "Нажмите ",
  14025. ERROR_WEBGL_IOS_ACTIONS_2: "Настройки > Общие > Обновление ПО",
  14026. ERROR_WEBGL_SAFARI_PROBLEM: "Включите WebGL для 3D-просмотра.",
  14027. ERROR_WEBGL_SAFARI_ACTIONS_1: "Нажмите ",
  14028. ERROR_WEBGL_SAFARI_ACTIONS_2: "Настойки > Дополнения > Показывать меню “Разработка” в строке меню",
  14029. ERROR_WEBGL_SAFARI_ACTIONS_3: "Затем нажмите ",
  14030. ERROR_WEBGL_SAFARI_ACTIONS_4: "Разработка > Разрешить WebGL",
  14031. ERROR_MISSING_URLS_PROBLEM: "Ой, для этой модели нет панорамы.",
  14032. ERROR_MISSING_URLS_EXPLANATION: "Эта модель устарела. У владельца веб-сайта может быть новая модель.",
  14033. ERROR_LOADING_FAILED_PROBLEM: "Ой, модель недоступна.",
  14034. ERROR_LOADING_FAILED_ACTIONS_1: "Если проблема не устранена, ",
  14035. ERROR_LOADING_FAILED_ACTIONS_2: "посмотрите наше руководство по устранению неполадок",
  14036. ERROR_MAINTENANCE_PROBLEM: "Выполняется техническое обслуживание.",
  14037. ERROR_MAINTENANCE_SOLUTION: "Пожалуйста, попробуйте снова через несколько минут.",
  14038. LINK_TO_LOCATION: "Ссылка на местоположение",
  14039. MENU_COPY: "Копировать",
  14040. LINK_ALERT_COPY: "Для того, чтобы скопировать, пожалуйста, используйте CTRL/CMD + C.",
  14041. ROTATE: "Вращать",
  14042. MOVE: "Передвигаться",
  14043. INSIDE: "Вид изнутри",
  14044. ZOOM: "Масштаб"
  14045. }
  14046. }
  14047. , {}],
  14048. 116: [function(e, t, i) {//main.js
  14049. (function(t) {
  14050. "use strict";
  14051. function i() {
  14052. var e = Y.getModelIDFromQueryString();
  14053. if (!e)
  14054. return b(null, "loading-failed");
  14055. var t = Y.parseSidUrl(e)
  14056. , i = l()
  14057. , a = c()
  14058. , s = o()
  14059. , u = V.quickstart.enabled
  14060. , g = null
  14061. , m = null
  14062. , v = null
  14063. , w = null
  14064. , T = null
  14065. , x = null
  14066. , S = null
  14067. , M = null
  14068. , R = null
  14069. , P = null
  14070. , O = null
  14071. , L = null
  14072. , N = new ue;
  14073. r(s);
  14074. /* h({ //MP开头写法
  14075. urlBase: t.urlBase
  14076. }).then...... */
  14077. $.ajax(g_Prefix+"data/"+window.number+"/someData.json"+"?"+randomTime().getTime(),{dataType: "json"}).done( function(e){ //改
  14078. e.files.templates[0] = g_Prefix+e.files.templates[0].replace("{{number}}",window.number);
  14079. window.MP_PREFETCHED_MODELDATA = e;
  14080. h({
  14081. urlBase: t.urlBase
  14082. })//xzw someData.js是我整合的 原本在html里 但这样每个场景的html都不一样了
  14083. }).then(function(i) {
  14084. return re.init(),
  14085. d(t, e) //getModel and load
  14086. }).then(function(e) {
  14087. return P = e,
  14088. p(P, V.appConfig.segment_key, V.appConfig.keen_write_key, V.appConfig.keen_project_id, {
  14089. startSource: i,
  14090. autoplay: V.autoplay,
  14091. quickstart: u
  14092. }),
  14093. P.urls.init()
  14094. }).then(function() {
  14095. return P.loadPanos()
  14096. }).then(function() {
  14097. m = X.getStartCameraOptions(P, P.panos),
  14098. S = A(P),
  14099. O = y(u, m.mode),
  14100. v = O.controls,
  14101. w = O.player,
  14102. T = O.director,
  14103. x = O.tagManager,
  14104. M = O.tileDownloader,
  14105. R = O.qualityManager,
  14106. L = O.panoRenderer,
  14107. C(P, S, O, s),
  14108. w.director = T,//xzw add
  14109. P.supportsTiles && M.start(),
  14110. !u || m.mode === D.PANORAMA && m.pano || (de.warn("Tried to quickstart, but failed as we are not starting in inside mode."),
  14111. u = !1);
  14112. var e = null;
  14113. if (u) {
  14114. de.warn("Quickstart engaged. Hold on to your knickers.");
  14115. var t = v.controls[D.PANORAMA];
  14116. g = new ie(R,S.scene,S.camera,t,s),
  14117. _(S, s, P),
  14118. e = g.load(m).then(function() {
  14119. S.addComponent(g),
  14120. S.once(le.AfterRender, function() {
  14121. de.warn("First render after quickstart load finished.")
  14122. })
  14123. })
  14124. }
  14125. return $.when(e, U.startLoading(P, w, T, V.autoplay, u, N))
  14126. }).then(function() {
  14127. return f(P, U.onProgress, i, !u, a)
  14128. }).then(function() {
  14129. if (m.quickstart = u,
  14130. I(P, S, O, s),
  14131. S.started || _(S, s, P),
  14132. H.modelLoaded(P, w, v, V.autoplay),
  14133. E(w, P, m, V.autoplay).done(function() {
  14134. T.autoTour()
  14135. }),
  14136. !P.supportsTiles) {
  14137. var e = new Z(P,w);
  14138. e.start()
  14139. }
  14140. u && (S.removeComponent(g),
  14141. g.destroy(),
  14142. m.pano.enter()),
  14143. U.init(P, T, w, v, S, m, H.getSessionId()),
  14144. U.endLoading(P, T, x),
  14145. S.once(le.AfterRender, function() {
  14146. N.setAppReadyTime();
  14147. var e = N.calcFullLoadingTime();
  14148. de.warn("Total load time: " + e / 1e3),
  14149. H.loadComplete(e),
  14150. de.warn("First render after model load finished.")
  14151. }),
  14152. S.on(le.MemoryUsageUpdated, n)
  14153. }).fail(b.bind(this, e))
  14154. }
  14155. function n(e) {
  14156. ce.update(e)
  14157. }
  14158. function r(e) {
  14159. de.info("Version", "2.25.6-0-gd87e5b1"),
  14160. q.defaultMaxListeners = 1e3,
  14161. a(e),
  14162. s()
  14163. }
  14164. function o() {
  14165. return document.getElementById("player")
  14166. }
  14167. function a(e) {
  14168. e.addEventListener("dragenter", T, !1),
  14169. e.addEventListener("dragover", T, !1)
  14170. }
  14171. function s() {
  14172. F.valueFromHash("title", !0) || $(document).ready(function() {
  14173. var e = $(".model-title");
  14174. e.hide()
  14175. })
  14176. }
  14177. function l() {
  14178. return F.valueFromHash("play", !1) ? "autoplay" : F.inIframe() ? "click" : "fullpage"
  14179. }
  14180. function c() {
  14181. return {
  14182. panoElementsToLoad: 6,
  14183. modelElementsToLoad: 0,
  14184. totalElementsLoaded: 0,
  14185. totalElementsToLoad: 0,
  14186. totalPercentageLoaded: 0,
  14187. progressCallback: null
  14188. }
  14189. }
  14190. function h(e) {
  14191. return K.loadFeatureFlags(e).done(function(e) {
  14192. K.updateDependentSettings(e, V)
  14193. })
  14194. }
  14195. // function u(e) {
  14196. // return Q.get(e.urlBase + "/api/v1/config/showcase", {
  14197. // responseType: "json",
  14198. // prefetchFrom: "config"
  14199. // }).then(function(e) {
  14200. // return e ? void j.extendObject(V.appConfig, e) : {}
  14201. // }, function(e) {
  14202. // return de.warn("Failed loading runtime config, using defaults."),
  14203. // $.when({})
  14204. // })
  14205. // }
  14206. function d(e, t) {
  14207. var i = B.getModel({
  14208. url: t,
  14209. floors: F.valueFromHash("f", !0),
  14210. autoload: !1
  14211. })
  14212. ;
  14213. return $.when(i, n).then(null, function(e) {
  14214. return this
  14215. })
  14216. }
  14217. function p(e, t, i, n, r) {
  14218. de.info("Model data loaded"),
  14219. de.debug("UUID: " + e.data.job.uuid),
  14220. J.init(K.getFlags()),
  14221. i && H.initKeen({
  14222. token: i,
  14223. appId: n
  14224. }),
  14225. H.initSegment({
  14226. model: e.sid,
  14227. version: "2.25.6-0-gd87e5b1",
  14228. startSource: r.startSource,
  14229. token: t,
  14230. autoplay: r.autoplay,
  14231. quickstart: r.quickstart
  14232. })
  14233. }
  14234. function f(e, t, i, n, r) {
  14235. return r.progressCallback = t,
  14236. H.sessionStart(),
  14237. e.load(n).progress(g.bind(this, r))
  14238. }
  14239. function g(e, t) {
  14240. e.modelElementsToLoad = t[1],
  14241. v(e),
  14242. m(e)
  14243. }
  14244. function m(e) {
  14245. e.totalElementsLoaded++,
  14246. e.totalPercentageLoaded = e.totalElementsLoaded / e.totalElementsToLoad,
  14247. e.progressCallback && e.progressCallback(100 * e.totalPercentageLoaded)
  14248. }
  14249. function v(e) {
  14250. e.totalElementsToLoad = e.modelElementsToLoad + e.panoElementsToLoad
  14251. }
  14252. function A(e) {
  14253. var t = new x.PerspectiveCamera;
  14254. t.layers.enable(he.PANOMARKERS),
  14255. t.layers.enable(he.RETICULE),
  14256. t.layers.enable(he.TAG);
  14257. var i = new x.Scene
  14258. , n = new x.AmbientLight(16777215);
  14259. i.add(n),
  14260. i.skybox = new W,
  14261. i.add(i.skybox),
  14262. i.plane = new x.Mesh(new x.PlaneBufferGeometry(1e5,1e5),new x.RawShaderMaterial({
  14263. side: x.DoubleSide
  14264. })),
  14265. i.plane.position.y = 0,
  14266. i.plane.rotateX(-Math.PI / 2),
  14267. i.plane.material.visible = !1,
  14268. i.add(i.plane),
  14269. i.updateMatrixWorld(),
  14270. V.showScreenshotLocations && e.data.images.forEach(function(e) {
  14271. if (e.metadata && e.metadata.camera_position) {
  14272. var t = e.metadata.camera_position
  14273. , n = new x.Mesh(new x.BoxGeometry(.3,.3,.3));
  14274. n.position = t.clone(),
  14275. i.add(n);
  14276. var r = e.metadata.camera_quaternion
  14277. , o = new x.Vector3(0,0,-1).applyQuaternion(r);
  14278. i.add(new x.ArrowHelper(o,t.clone(),1,16711680))
  14279. }
  14280. }),
  14281. V.showAxis && (i.add(new x.ArrowHelper(new x.Vector3(0,1,0),new x.Vector3(0,0,0),1,255)),
  14282. i.add(new x.ArrowHelper(new x.Vector3(0,0,1),new x.Vector3(0,0,0),1,16711680)),
  14283. i.add(new x.ArrowHelper(new x.Vector3(1,0,0),new x.Vector3(0,0,0),1,65280)));
  14284. var r = new te(i,t,z);
  14285. return r
  14286. }
  14287. function y(e, t) {
  14288. var i = e ? 1 : 1e3
  14289. , n = J.tilegen || J.imgopt ? 6 : 2;
  14290. n = F.valueFromHash("tileconc", n);
  14291. var r = new ne
  14292. , o = new ae({
  14293. concurrentDownloads: n
  14294. })
  14295. , a = new se
  14296. , s = new P
  14297. , l = new M
  14298. , c = new S(t)
  14299. , h = new R
  14300. , u = new O(i)
  14301. , d = new L
  14302. , p = new oe;
  14303. return {
  14304. qualityManager: r,
  14305. panoRenderer: a,
  14306. tileDownloader: o,
  14307. player: c,
  14308. director: l,
  14309. modelManager: s,
  14310. tagManager: p,
  14311. displayController: u,
  14312. labelDisplayController: d,
  14313. controls: h
  14314. }
  14315. }
  14316. function C(e, t, i, n) {
  14317. var r = i.controls
  14318. , o = i.qualityManager
  14319. , a = i.panoRenderer
  14320. , s = i.tileDownloader
  14321. , l = i.modelManager;
  14322. r.init(n, l),
  14323. ee.init(i.director, r, i.player, l, t),
  14324. o.init(l),
  14325. s.init(o),
  14326. a.init(t, s, o),
  14327. l.init(s, a, o),
  14328. l.addModel(e),
  14329. t.addComponent(G)
  14330. }
  14331. function I(e, t, i, n) {
  14332. var r = i.qualityManager
  14333. , o = i.panoRenderer
  14334. , a = i.tileDownloader
  14335. , s = i.modelManager
  14336. , l = i.player
  14337. , c = i.director
  14338. , h = i.tagManager
  14339. , u = i.displayController
  14340. , d = i.labelDisplayController
  14341. , p = i.controls;
  14342. t.scene.add(e),
  14343. t.qualityManager = r;
  14344. var f = {
  14345. camera: t.camera,
  14346. director: c,
  14347. modelManager: s,
  14348. tileDownloader: a,
  14349. panoRenderer: o,
  14350. qualityManager: r,
  14351. tagManager: h,
  14352. container: n,
  14353. controls: p
  14354. };
  14355. l.init(f),
  14356. l.setScene(t.scene),
  14357. h.init(s, l),
  14358. c.init(l, s),
  14359. u.init(c, l, s, h, n),
  14360. d.init(l, s, n),
  14361. z.bindEvents(l),
  14362. t.addComponent(h),
  14363. t.addComponent(l),
  14364. t.addComponent(o)
  14365. l.sceneRenderer = t; //xzw add 方便resize
  14366. }
  14367. function E(e, t, i, n) {
  14368. return de.info("Starting player in " + i.mode),
  14369. H.report(t.sid, "started-playing", n, i.quickstart),
  14370. e.start(i)
  14371. }
  14372. function b(e, t) {
  14373. de.error(t),
  14374. k.error(t),
  14375. H.report(e, "error-" + t)
  14376. }
  14377. function w(e) {
  14378. var t = F.details();
  14379. t && "Safari" === t.name && t.version > 500 && t.version < 600 ? (k.error("webgl-safari"),
  14380. H.report(e, "error-webgl-safari")) : (k.error("webgl-generic"),
  14381. H.report(e, "error-webgl-generic"))
  14382. }
  14383. function _(e, t, i) {
  14384. try {
  14385. e.start(t)
  14386. } catch (e) {
  14387. throw de.warn(e.message),
  14388. w(i.sid),
  14389. e
  14390. }
  14391. }
  14392. function T(e) {
  14393. e.stopPropagation(),
  14394. e.preventDefault()
  14395. }
  14396. e("./lib/three75-shim"),
  14397. e("./lib/array-polyfill"),
  14398. e("./lib/performance-polyfill"),
  14399. e("./lib/shaders/CopyShader.js"),
  14400. e("./lib/shaders/HorizontalBlurShader.js"),
  14401. e("./lib/shaders/VerticalBlurShader.js"),
  14402. e("./lib/postprocessing/EffectComposer.js"),
  14403. e("./lib/postprocessing/RenderPass.js"),
  14404. e("./lib/postprocessing/MaskPass.js"),
  14405. e("./lib/postprocessing/ShaderPass.js"),
  14406. window.Promise || (window.Promise = e("promise-polyfill"));
  14407. var x = e("three")
  14408. , S = (e("./util/sentry"),
  14409. e("./player"))
  14410. , M = e("./director")
  14411. , R = e("./controls/CameraControls")
  14412. , P = e("./model/ModelManager")
  14413. , O = e("./DisplayController")
  14414. , L = e("./label/LabelDisplayController")
  14415. , D = e("./enum/Viewmode")
  14416. , N = e("./util/logger")
  14417. , B = e("./showcase")
  14418. , F = e("./util/browser")
  14419. , V = e("./settings")
  14420. , U = e("./gui/gui")
  14421. , k = e("./gui/error")
  14422. , H = e("./analytics")
  14423. , G = e("./util/transitions")
  14424. , z = e("./effects")
  14425. , W = e("./objects/Skybox")
  14426. , j = e("./util/common")
  14427. , Y = (e("./util/PanoramaCollection"),
  14428. e("./util/math"),
  14429. e("./util/showcase"))
  14430. , X = e("./util/camera")
  14431. , Z = (e("./objects/Panorama"),
  14432. e("./cameras/PanoramaCamera"),
  14433. e("./preloaders"))
  14434. , q = e("events").EventEmitter
  14435. , K = e("./featureflags")
  14436. , Q = (e("./util/lerp"),
  14437. e("./util/ajax"))
  14438. , J = e("./ab")
  14439. , ee = e("./sdk/automation.js")
  14440. , te = e("./scene/SceneRenderer")
  14441. , ie = e("./scene/QuickstartManager")
  14442. , ne = e("./tile/QualityManager.js")
  14443. , re = e("./localization/localize")
  14444. , oe = e("./tag/tagManager")
  14445. , ae = e("./tile/TileDownloader")
  14446. , se = e("./tile/PanoRenderer")
  14447. , le = (e("./enum/PanoSizeClass"),
  14448. e("./enum/PanoramaEvents"),
  14449. e("./enum/SceneRendererEvents"))
  14450. , ce = e("./gui/memoryUsage")
  14451. , he = e("./enum/RenderLayers")
  14452. , ue = e("./TimingData")
  14453. , de = new N(t);
  14454. N.level = V.logLevel,
  14455. N.consoleEnabled = V.console,
  14456. i()
  14457. }
  14458. ).call(this, "/js/main.js")
  14459. }
  14460. , {
  14461. "./DisplayController": 1,
  14462. "./TimingData": 2,
  14463. "./ab": 3,
  14464. "./analytics": 4,
  14465. "./cameras/PanoramaCamera": 7,
  14466. "./controls/CameraControls": 9,
  14467. "./director": 15,
  14468. "./effects": 16,
  14469. "./enum/PanoSizeClass": 36,
  14470. "./enum/PanoramaEvents": 37,
  14471. "./enum/RenderLayers": 41,
  14472. "./enum/SceneRendererEvents": 43,
  14473. "./enum/Viewmode": 51,
  14474. "./featureflags": 59,
  14475. "./gui/error": 64,
  14476. "./gui/gui": 65,
  14477. "./gui/memoryUsage": 73,
  14478. "./label/LabelDisplayController": 91,
  14479. "./lib/array-polyfill": 92,
  14480. "./lib/performance-polyfill": 95,
  14481. "./lib/postprocessing/EffectComposer.js": 96,
  14482. "./lib/postprocessing/MaskPass.js": 97,
  14483. "./lib/postprocessing/RenderPass.js": 98,
  14484. "./lib/postprocessing/ShaderPass.js": 99,
  14485. "./lib/shaders/CopyShader.js": 100,
  14486. "./lib/shaders/HorizontalBlurShader.js": 101,
  14487. "./lib/shaders/VerticalBlurShader.js": 102,
  14488. "./lib/three75-shim": 103,
  14489. "./localization/localize": 108,
  14490. "./tag/tagManager": 124,
  14491. "./model/ModelManager": 140,
  14492. "./objects/Panorama": 148,
  14493. "./objects/Skybox": 152,
  14494. "./player": 155,
  14495. "./preloaders": 156,
  14496. "./scene/QuickstartManager": 157,
  14497. "./scene/SceneRenderer": 158,
  14498. "./sdk/automation.js": 164,
  14499. "./settings": 166,
  14500. "./showcase": 168,
  14501. "./tile/PanoRenderer": 169,
  14502. "./tile/QualityManager.js": 170,
  14503. "./tile/TileDownloader": 171,
  14504. "./util/PanoramaCollection": 178,
  14505. "./util/ajax": 181,
  14506. "./util/browser": 182,
  14507. "./util/camera": 183,
  14508. "./util/common": 185,
  14509. "./util/lerp": 188,
  14510. "./util/logger": 189,
  14511. "./util/math": 190,
  14512. "./util/sentry": 192,
  14513. "./util/showcase": 193,
  14514. "./util/transitions": 195,
  14515. events: 202,
  14516. "promise-polyfill": 213,
  14517. three: 217
  14518. }],
  14519. 117: [function(e, t, i) {
  14520. "use strict";
  14521. function n(e) {
  14522. e = e || {},
  14523. r.RawShaderMaterial.call(this, a.extendObject({
  14524. fragmentShader: o.cube.fragmentShader,
  14525. vertexShader: o.cube.vertexShader,
  14526. uniforms: r.UniformsUtils.clone(o.cube.uniforms),
  14527. name: "CubemapMaterial"
  14528. }, e))
  14529. }
  14530. var r = e("three")
  14531. , o = e("../shaders")
  14532. , a = e("../util/common");
  14533. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14534. n.prototype.constructor = n,
  14535. t.exports = n
  14536. }
  14537. , {
  14538. "../shaders": 167,
  14539. "../util/common": 185,
  14540. three: 217
  14541. }],
  14542. 118: [function(e, t, i) {
  14543. "use strict";
  14544. function n(e) {
  14545. e = e || {},
  14546. r.RawShaderMaterial.call(this, a.extendObject({
  14547. fragmentShader: o.model.fragmentShader,
  14548. vertexShader: o.model.vertexShader,
  14549. uniforms: r.UniformsUtils.clone(o.model.uniforms),
  14550. name: "ModelTextureMaterial"
  14551. }, e))
  14552. }
  14553. var r = e("three")
  14554. , o = e("../shaders")
  14555. , a = e("../util/common");
  14556. n.prototype = Object.create(r.RawShaderMaterial.prototype),
  14557. n.prototype.constructor = n,
  14558. n.prototype.setProjectedPanos = function(e, t, i) {
  14559. i && (this.uniforms.progress.value = 0),
  14560. e.ensureSkyboxReadyForRender(),
  14561. this.uniforms.pano0Map.value = e.getSkyboxTexture(),
  14562. this.uniforms.pano0Position.value.copy(e.position),
  14563. this.uniforms.pano0Matrix.value.copy(e.skyboxMesh.matrixWorld),
  14564. t.ensureSkyboxReadyForRender(),
  14565. this.uniforms.pano1Map.value = t.getSkyboxTexture(),
  14566. this.uniforms.pano1Position.value.copy(t.position),
  14567. this.uniforms.pano1Matrix.value.copy(t.skyboxMesh.matrixWorld)
  14568. }
  14569. ,
  14570. t.exports = n
  14571. }
  14572. , {
  14573. "../shaders": 167,
  14574. "../util/common": 185,
  14575. three: 217
  14576. }],
  14577. 119: [function(e, t, i) {
  14578. (function(i) {
  14579. "use strict";
  14580. function n(e, t, i, n) {
  14581. this.div = null,
  14582. this.body = null,
  14583. this.label = e,
  14584. this.description = t,
  14585. this.parsedDescription = [],
  14586. this.media = i || {
  14587. type: null
  14588. },
  14589. this.loadingSpinner = null,
  14590. this.parser = new r({
  14591. supportLinks: !u.valueFromHash("mls"),
  14592. keepLinkLabels: !0
  14593. }),
  14594. this.state = I.CLOSED,
  14595. this.orientation = "",
  14596. this.initialTransform = "",
  14597. this.hovering = !1,
  14598. this.openTransition = null,
  14599. this.closeTransition = null,
  14600. this.openPromise = null,
  14601. this.closePromise = null,
  14602. this.animationTransition = null,
  14603. this.animationScale = 0
  14604. }
  14605. var r = e("../Parser/DescriptionParser")
  14606. , o = e("../Media/Link")
  14607. , a = e("../Media/Image")
  14608. , s = e("../Media/EmbedlyPlayer")
  14609. , l = e("../Media/EmbedlyEmbed")
  14610. , c = e("../../util/transitions")
  14611. , h = e("../../util/lerp")
  14612. , u = e("../../util/browser")
  14613. , d = e("./BillboardEvent")
  14614. , p = e("../Media/MediaEvent")
  14615. , f = e("../Parser/DescriptionChunkType")
  14616. , g = e("events").EventEmitter
  14617. , m = e("./billboardSettings")
  14618. , v = e("./overlaySettings")
  14619. , A = e("../../util/logger")
  14620. , y = new A(i)
  14621. , C = document.getElementById("tag-billboards");
  14622. C.addEventListener("touchend", function(e) {
  14623. C.style.pointerEvents = "none"
  14624. }),
  14625. C.addEventListener("touchcancel", function(e) {
  14626. C.style.pointerEvents = "none"
  14627. });
  14628. var I = {
  14629. CLOSED: "closed",
  14630. OPENING: "opening",
  14631. OPEN: "open",
  14632. CLOSING: "closing",
  14633. ACTIVE: "active"
  14634. };
  14635. n.prototype = Object.create(g.prototype),
  14636. n.prototype.build = function(e) {
  14637. this.parsedDescription = this.parser.parse(this.description);
  14638. var t = document.createElement("div");
  14639. t.className = "tag-container has-hotzone",
  14640. this.div = t,
  14641. this.body = document.createElement("div"),
  14642. this.body.className = "tag-body";
  14643. var i = document.createElement("div");
  14644. i.classList.add("tag-content");
  14645. var n = document.createElement("div");
  14646. n.classList.add("tag-text-content");
  14647. var r = document.createElement("div");
  14648. r.className = "tag-label",
  14649. r.textContent = this.label,
  14650. n.appendChild(r);
  14651. var o = document.createElement("div");
  14652. o.className = "tag-desc",
  14653. n.appendChild(o),
  14654. i.appendChild(n),
  14655. this.body.appendChild(i),
  14656. this.appendDescriptionElements(this.parsedDescription, o),
  14657. this.appendMedia(),
  14658. t.appendChild(this.body),
  14659. C.appendChild(t),
  14660. this.bindEvents(t, this.body)
  14661. }
  14662. ,
  14663. n.prototype.bindEvents = function(e, t) {
  14664. var i = function(e) {
  14665. return function(t) {
  14666. if (!this.div.classList.contains("overlay")) {
  14667. var i, n = document.getElementById("player");
  14668. try {
  14669. i = new MouseEvent(e,t)
  14670. } catch (n) {
  14671. i = document.createEvent("MouseEvents"),
  14672. i.initMouseEvent(e, t.bubbles, t.cancelable, t.view, t.detail, t.screenX, t.screenY, t.clientX, t.clientY, t.ctrlKey, t.altKey, t.shiftKey, t.metaKey, t.button, t.relatedTarget)
  14673. }
  14674. n.dispatchEvent(i)
  14675. }
  14676. }
  14677. };
  14678. t.addEventListener("mousedown", function(e) {
  14679. e.stopPropagation()
  14680. }),
  14681. t.addEventListener("mouseup", function(e) {
  14682. e.stopPropagation()
  14683. }),
  14684. e.addEventListener("touchstart", function(e) {
  14685. C.style.pointerEvents = "auto"
  14686. }),
  14687. e.addEventListener("mousedown", i("mousedown").bind(this)),
  14688. e.addEventListener("mouseup", i("mouseup").bind(this)),
  14689. t.addEventListener("mouseover", function(t) {
  14690. this.state === I.OPEN && e.classList.remove("has-hotzone")
  14691. }
  14692. .bind(this)),
  14693. e.addEventListener("mouseenter", function(e) {
  14694. this.state !== I.CLOSING && (this.hovering = !0,
  14695. this.emit(d.ENTER))
  14696. }
  14697. .bind(this)),
  14698. e.addEventListener("mouseleave", function(e) {
  14699. this.hovering = !1,
  14700. this.emit(d.LEAVE)
  14701. }
  14702. .bind(this)),
  14703. e.addEventListener("gesturestart", function(e) {
  14704. e.preventDefault()
  14705. });
  14706. var n = e.querySelector(".tag-text-content")
  14707. , r = 0;
  14708. n.addEventListener("touchstart", function(e) {
  14709. r = e.changedTouches[0].clientY
  14710. }),
  14711. n.addEventListener("touchmove", function(t) {
  14712. function i(e) {
  14713. e && (0 === e.scrollTop && t.changedTouches[0].clientY > r || e.scrollTop + e.clientHeight - e.scrollHeight === 0 && t.changedTouches[0].clientY < r) && t.preventDefault()
  14714. }
  14715. return e.classList.contains("overlay") ? i(this.querySelector(".tag-desc")) : void i(this)
  14716. }),
  14717. e.addEventListener("touchmove", function(e) {
  14718. 0 === (n.compareDocumentPosition(e.target) & Node.DOCUMENT_POSITION_CONTAINED_BY) && e.preventDefault()
  14719. })
  14720. }
  14721. ,
  14722. n.prototype.appendDescriptionElements = function(e, t) {
  14723. e.length > 0 && this.div.classList.add("has-text"),
  14724. e.forEach(function(e, i) {
  14725. switch (e.type) {
  14726. case f.TEXT:
  14727. t.appendChild(this.createTextElement(e.text));
  14728. break;
  14729. case f.LINK:
  14730. t.appendChild(this.createLinkElement(e.link))
  14731. }
  14732. }
  14733. .bind(this))
  14734. }
  14735. ,
  14736. n.prototype.appendLoadingSpinner = function() {
  14737. this.loadingSpinner = document.createElement("div"),
  14738. this.loadingSpinner.classList.add("loading-spinner");
  14739. var e = document.createElement("div");
  14740. e.classList.add("gui-spinner-icon"),
  14741. this.loadingSpinner.appendChild(e),
  14742. this.body.appendChild(this.loadingSpinner)
  14743. }
  14744. ,
  14745. n.prototype.onMediaLoadFinished = function() {
  14746. this.loadingSpinner && (this.loadingSpinner.parentNode.removeChild(this.loadingSpinner),
  14747. this.applyOrientation(this.orientation),
  14748. this.loadingSpinner = null)
  14749. }
  14750. ,
  14751. n.prototype.appendMedia = function() {
  14752. if (this.media && this.media.type && "error" !== this.media.type && (!u.valueFromHash("mls", 0) || this.media.type === f.IMAGE)) {
  14753. this.appendLoadingSpinner();
  14754. var e = document.createElement("div");
  14755. e.classList.add("tag-media-content");
  14756. var t = document.createElement("i");
  14757. switch (["icon", "icon-close-thin", "close"].forEach(function(e) {
  14758. t.classList.add(e)
  14759. }),
  14760. this.body.appendChild(t),
  14761. this.body.appendChild(e),
  14762. this.media.type) {
  14763. case f.IMAGE:
  14764. e.appendChild(this.createImageElement(this.media, this.body));
  14765. break;
  14766. case f.VIDEO:
  14767. e.appendChild(this.createVideoElement(this.media, this.body));
  14768. break;
  14769. case f.RICH:
  14770. e.appendChild(this.createEmbedElement(this.media, this.body))
  14771. }
  14772. }
  14773. }
  14774. ,
  14775. n.prototype.createTextElement = function(e) {
  14776. var t = document.createElement("span");
  14777. return t.textContent = e,
  14778. t
  14779. }
  14780. ;
  14781. n.prototype.createLinkElement = function(e) {
  14782. var t = new o(e);
  14783. return t.on(p.LINK_CLICK, this.emit.bind(this, p.LINK_CLICK)),
  14784. t.createDomElement()
  14785. }
  14786. ,
  14787. n.prototype.createImageElement = function(e, t) {
  14788. function i() {
  14789. function e() {
  14790. m || (r.classList.remove("view-image"),
  14791. c.classList.add("overlay"),
  14792. i(),
  14793. window.addEventListener("resize", b),
  14794. c.addEventListener("click", a),
  14795. g.addEventListener("click", l),
  14796. f.addEventListener("click", s),
  14797. m = !0,
  14798. o.emit(p.IMAGE_OPENED))
  14799. }
  14800. function i() {
  14801. t.classList.add("show-info"),
  14802. h.classList.remove("collapsible"),
  14803. h.style.height = "";
  14804. var e = parseFloat(getComputedStyle(I).lineHeight)
  14805. , i = y + e
  14806. , r = c.clientWidth - 2 * v.boundaryWidth - C
  14807. , a = c.clientHeight - 2 * v.boundaryHeight - C - i
  14808. , s = a
  14809. , l = s * n.aspect;
  14810. l > r && (l = r,
  14811. s = l / n.aspect),
  14812. s > a && (s = a,
  14813. l = s * n.aspect),
  14814. l += C,
  14815. s += C + i,
  14816. t.style.width = l + "px",
  14817. t.style.height = s + "px",
  14818. u.style.paddingTop = e + C + "px",
  14819. o.description.length > 0 && (h.classList.add("collapsible"),
  14820. h.style.height = h.clientHeight + 12 + "px",
  14821. E.style.height = "calc(100% - " + I.clientHeight + "px)")
  14822. }
  14823. function a(e) {
  14824. e.target === c && s()
  14825. }
  14826. function s() {
  14827. m && (m = !1,
  14828. r.classList.add("view-image"),
  14829. c.classList.remove("overlay"),
  14830. h.style.height = "",
  14831. u.style.paddingTop = "",
  14832. t.style.width = "",
  14833. t.style.height = "",
  14834. window.removeEventListener("resize", b),
  14835. c.removeEventListener("click", a),
  14836. g.removeEventListener("click", l),
  14837. f.removeEventListener("click", s),
  14838. o.emit(p.IMAGE_CLOSED),
  14839. o.close(!0))
  14840. }
  14841. function l(e) {
  14842. t.classList.toggle("show-info")
  14843. }
  14844. var c = o.div
  14845. , h = c.getElementsByClassName("tag-content")[0]
  14846. , u = c.getElementsByClassName("tag-media-content")[0]
  14847. , f = t.getElementsByClassName("close")[0]
  14848. , g = h.getElementsByClassName("tag-label")[0];
  14849. c.classList.add("has-image"),
  14850. r.classList.add("view-image"),
  14851. c.classList.add(n.aspect >= 1 ? "image-landscape" : "image-portrait"),
  14852. o.applyOrientation(o.orientation);
  14853. var m = !1
  14854. , A = getComputedStyle(h)
  14855. , y = parseFloat(A.paddingTop) + parseFloat(A.paddingBottom)
  14856. , C = 2 * parseFloat(getComputedStyle(u).paddingLeft)
  14857. , I = h.querySelector(".tag-label")
  14858. , E = h.querySelector(".tag-desc")
  14859. , b = function() {
  14860. var e, t, n = 0;
  14861. return function() {
  14862. clearInterval(e),
  14863. clearTimeout(t),
  14864. e = setInterval(function() {
  14865. var e = c.clientHeight;
  14866. n !== e && (i(),
  14867. n = e)
  14868. }, 100),
  14869. t = setTimeout(clearInterval.bind(this, e), 1e3)
  14870. }
  14871. }();
  14872. n.on(p.IMAGE_OPENING, e),
  14873. o.on(d.ACTIVATE, e),
  14874. o.on(p.IMAGE_CLOSED, n.onClosed.bind(n)),
  14875. o.on(d.CLOSING, s)
  14876. }
  14877. var n = new a
  14878. , r = n.createDomElement();
  14879. this.once(d.OPENED, function() {
  14880. n.load(e.src).then(i).catch(function(t) {
  14881. y.warn("Failed to load image:", e.src),
  14882. y.warn("with error:", t)
  14883. }).then(this.onMediaLoadFinished.bind(this))
  14884. });
  14885. var o = this;
  14886. return r
  14887. }
  14888. ,
  14889. n.prototype.createVideoElement = function(e, t) {
  14890. var i = new s({
  14891. autoPlay: !0,
  14892. autoResume: !0,
  14893. startMuted: !1,
  14894. loop: !1
  14895. })
  14896. , n = i.createDomElement();
  14897. return this.once(d.OPENED, function() {
  14898. i.load(e.src).then(function() {
  14899. this.div.classList.add("has-video"),
  14900. this.state !== I.OPEN && this.state !== I.ACTIVE || (i.show(),
  14901. i.play()),
  14902. this.on(d.OPENING, i.show.bind(i)),
  14903. this.on(d.OPENED, i.play.bind(i)),
  14904. this.on(d.CLOSING, i.pause.bind(i)),
  14905. this.on(d.CLOSED, i.hide.bind(i))
  14906. }
  14907. .bind(this)).catch(function(t) {
  14908. y.warn("Failed to embed video:", e.src),
  14909. y.warn("with error:", t)
  14910. }).then(this.onMediaLoadFinished.bind(this))
  14911. }
  14912. .bind(this)),
  14913. n
  14914. }
  14915. ,
  14916. n.prototype.createEmbedElement = function(e, t) {
  14917. var i = new l
  14918. , n = i.createDomElement();
  14919. return this.once(d.OPENED, function() {
  14920. i.load(e.src).then(function() {
  14921. this.div.classList.add("has-embed"),
  14922. this.state !== I.OPEN && this.state !== I.ACTIVE || i.show(),
  14923. this.applyOrientation(this.orientation),
  14924. this.on(d.OPENING, i.show.bind(i)),
  14925. this.on(d.CLOSED, i.hide.bind(i))
  14926. }
  14927. .bind(this)).catch(function(t) {
  14928. y.warn("Failed to embed:", e.src),
  14929. y.warn("with error:", t)
  14930. }).then(this.onMediaLoadFinished.bind(this))
  14931. }
  14932. .bind(this)),
  14933. n
  14934. }
  14935. ,
  14936. n.prototype.open = function(e) {
  14937. return this.openPromise = $.Deferred(),
  14938. this.state === I.ACTIVE ? this.openPromise.resolve().promise() : (this.hovering || this.div.classList.add("has-hotzone"),
  14939. this.openTransition ? e && this.setActiveState() : this.openTransition = c.setTimeout(function() {
  14940. this.state !== I.OPEN && (this.emit(d.OPENING),
  14941. e && this.emit(d.ACTIVATING),
  14942. this.state = I.OPENING,
  14943. this.animateOpen(function() {
  14944. e && this.setActiveState(),
  14945. this.openPromise.resolve()
  14946. }
  14947. .bind(this)))
  14948. }
  14949. .bind(this), m.animation.openDelay),
  14950. c.cancel(this.closeTransition),
  14951. this.closePromise && this.closePromise.reject(),
  14952. this.closeTransition = void 0,
  14953. this.openPromise.promise())
  14954. }
  14955. ,
  14956. n.prototype.close = function(e) {
  14957. return this.closePromise = $.Deferred(),
  14958. !e && this.hovering ? this.closePromise.reject().promise() : (this.closeTransition || (this.closeTransition = c.setTimeout(function() {
  14959. this.state !== I.CLOSED && (this.emit(d.CLOSING),
  14960. this.state = I.CLOSING,
  14961. this.animateClose())
  14962. }
  14963. .bind(this), m.animation.closeDelay)),
  14964. c.cancel(this.openTransition),
  14965. this.openPromise && this.openPromise.reject(),
  14966. this.openTransition = void 0,
  14967. this.closePromise.resolve(),
  14968. this.closePromise.promise())
  14969. }
  14970. ,
  14971. n.prototype.setActiveState = function() {
  14972. this.state !== I.CLOSED && (this.state = I.ACTIVE,
  14973. this.emit(d.ACTIVATE),
  14974. this.div.classList.remove("has-hotzone"))
  14975. }
  14976. ,
  14977. n.prototype.animateOpen = function(e) {
  14978. if (this.state === I.OPENING) {
  14979. if (c.cancel(this.animationTransition),
  14980. u.detectSamsungNative())
  14981. return this.boardOrientation = null,
  14982. this.div.style.visibility = "visible",
  14983. this.emit(d.OPENED),
  14984. this.state = I.OPEN,
  14985. void (e && e());
  14986. this.div.style.webkitTransform = "scale(0)",
  14987. this.div.style.transform = "scale(0)",
  14988. this.div.style.visibility = "visible",
  14989. this.animationTransition = c.start(h.property(this, "animationScale", 1), m.animation.openDuration, function() {
  14990. this.emit(d.OPENED),
  14991. this.state = I.OPEN,
  14992. e && e()
  14993. }
  14994. .bind(this))
  14995. }
  14996. }
  14997. ,
  14998. n.prototype.animateClose = function(e) {
  14999. this.state === I.CLOSING && (c.cancel(this.animationTransition),
  15000. this.animationTransition = c.start(h.property(this, "animationScale", 0), m.animation.closeDuration, function() {
  15001. this.emit(d.CLOSED),
  15002. this.state = I.CLOSED,
  15003. this.div.style.visibility = "hidden",
  15004. this.div.classList.contains("has-hotzone") || this.div.classList.add("has-hotzone"),
  15005. e && e()
  15006. }
  15007. .bind(this)))
  15008. }
  15009. ,
  15010. n.prototype.needsUpdate = function() {
  15011. return this.state !== I.CLOSED
  15012. }
  15013. ,
  15014. n.prototype.update = function(e, t) {
  15015. if (this.needsUpdate()) {
  15016. var i = (this.updateOrientation(e),
  15017. this.calcScale(t))
  15018. , n = {
  15019. x: (e.x + 1) * $("#player").width() / 2,
  15020. y: (e.y + 1) * $("#player").height() / 2
  15021. };
  15022. this.div.screenTransform = this.initialTransform + " translate(" + n.x + "px, " + n.y + "px) scale(" + i * this.animationScale + ")",
  15023. this.div.style.webkitTransform = this.div.screenTransform,
  15024. this.div.style.transform = this.div.screenTransform
  15025. }
  15026. }
  15027. ,
  15028. n.prototype.getDimensions = function() {
  15029. return this.div.getBoundingClientRect()
  15030. }
  15031. ,
  15032. n.prototype.calcScale = function(e) {
  15033. return Math.sqrt(e / 40) * m.boardToDiscRatio
  15034. }
  15035. ,
  15036. n.prototype.updateOrientation = function(e) {
  15037. if (this.state !== I.ACTIVE) {
  15038. var t = 1 / 3
  15039. , i = e.y < -t ? 0 : e.y < t ? 1 : 2
  15040. , n = e.x < -t ? 0 : e.x < t ? 1 : 2
  15041. , r = "";
  15042. r += 0 === n ? "right" : 2 === n ? "left" : "",
  15043. r += 0 === i ? "-down" : 2 === i ? "-up" : "",
  15044. 1 === n && (r = 0 === i ? "bottom" : 2 === i ? "top" : "",
  15045. 1 === i && (r = $("#player").width() > $("#player").height() ? e.x < 0 ? "right" : "left" : e.y < 0 ? "bottom" : "top")),
  15046. 1 === n && 1 === i && r === this.orientation || this.applyOrientation(r)
  15047. }
  15048. }
  15049. ,
  15050. n.prototype.applyOrientation = function(e) {
  15051. this.div.style.transform = this.div.style.webkitTransform = "",
  15052. this.div.classList.remove("tag-container-" + this.orientation),
  15053. this.div.classList.add("tag-container-" + e);
  15054. var t = window.getComputedStyle(this.div);
  15055. this.initialTransform = t.transform || t.webkitTransform,
  15056. "none" === this.initialTransform && (this.initialTransform = "");
  15057. var i = t.transform.slice(7, -1).split(",")
  15058. , n = -i[4]
  15059. , r = -i[5];
  15060. this.div.style.webkitTransformOrigin = n + "px " + r + "px",
  15061. this.div.style.transformOrigin = n + "px " + r + "px",
  15062. this.orientation = e
  15063. }
  15064. ,
  15065. t.exports = n
  15066. }
  15067. ).call(this, "/js/tag/Billboard/Billboard.js")
  15068. }
  15069. , {
  15070. "../../util/browser": 182,
  15071. "../../util/lerp": 188,
  15072. "../../util/logger": 189,
  15073. "../../util/transitions": 195,
  15074. "../Media/EmbedlyEmbed": 125,
  15075. "../Media/EmbedlyPlayer": 126,
  15076. "../Media/Image": 128,
  15077. "../Media/Link": 129,
  15078. "../Media/MediaEvent": 131,
  15079. "../Parser/DescriptionChunkType": 133,
  15080. "../Parser/DescriptionParser": 134,
  15081. "./BillboardEvent": 120,
  15082. "./billboardSettings": 121,
  15083. "./overlaySettings": 122,
  15084. events: 202
  15085. }],
  15086. 120: [function(e, t, i) {
  15087. "use strict";
  15088. t.exports = Object.freeze({
  15089. ENTER: "billboard.enter",
  15090. LEAVE: "billboard.leave",
  15091. OPENING: "billboard.opening",
  15092. OPENED: "billboard.open",
  15093. CLOSING: "billboard.closing",
  15094. CLOSED: "billboard.closed",
  15095. ACTIVATING: "billboard.activating",
  15096. ACTIVATE: "billboard.activate"
  15097. })
  15098. }
  15099. , {}],
  15100. 121: [function(e, t, i) {
  15101. "use strict";
  15102. t.exports = Object.freeze({
  15103. animation: Object.freeze({
  15104. hoverOnClosing: !1,
  15105. openDelay: 100,
  15106. closeDelay: 50,
  15107. openDuration: 200,
  15108. closeDuration: 100
  15109. }),
  15110. boardToDiscRatio: 1.2
  15111. })
  15112. }
  15113. , {}],
  15114. 122: [function(e, t, i) {
  15115. "use strict";
  15116. t.exports = Object.freeze({
  15117. boundaryWidth: 30,
  15118. boundaryHeight: 0
  15119. })
  15120. }
  15121. , {}],
  15122. "hot": [function(e, t, i) {//热点
  15123. "use strict";
  15124. function hot(sid,d,model){
  15125. this.sid = sid;
  15126. this.position = this.conversionArray(d.position);
  15127. this.rotation = this.conversionArray(d.rotation);
  15128. this.link = d.link;
  15129. this.model = model;
  15130. this.size = d.size;
  15131. this.build();
  15132. }
  15133. var r = e("three")
  15134. , f = e("../shaders")
  15135. , a = e("../settings")
  15136. , s = e("../enum/Viewmode")
  15137. , p = e("../objects/Panorama")
  15138. , te = e("../util/texture")
  15139. var raycaster = new r.Raycaster;
  15140. var geometry = new r.PlaneBufferGeometry( 0.13, 0.13,1,1);
  15141. var shaderMaterial = new r.ShaderMaterial( {
  15142. uniforms: f.hot.uniforms,
  15143. vertexShader: f.hot.vertexShader,
  15144. fragmentShader: f.hot.fragmentShader
  15145. });
  15146. shaderMaterial.transparent = true;
  15147. f.hot.uniforms.texture1.value = te.load(g_HotImage.point);
  15148. f.hot.uniforms.texture2.value = te.load(g_HotImage.point2);
  15149. //czj 判断是否是数组 如果不是将对象转换为数组
  15150. hot.prototype.conversionArray = function(obj){
  15151. if(Object.prototype.toString.call(obj)=='[object Array]') return obj;
  15152. var arr = []
  15153. for (var i in obj) {
  15154. arr.push(obj[i]); //属性
  15155. }
  15156. return arr
  15157. }
  15158. hot.prototype.build = function(){
  15159. var sprite = new r.Mesh( geometry, shaderMaterial );
  15160. sprite.dynamic = true;
  15161. sprite.position.copy(new r.Vector3().fromArray(this.position));
  15162. sprite.rotation.copy(new r.Euler().fromArray(this.rotation));
  15163. this.size && sprite.scale.set(this.size,this.size,this.size);
  15164. sprite.name = this.sid;
  15165. sprite.type = "hotSprite";
  15166. sprite.belongHot = this;
  15167. if(this.link) sprite.hotLink = this.link;
  15168. this.mesh = sprite;
  15169. this.model.add(sprite);
  15170. }
  15171. hot.prototype.closestPanoTowardTag = function(e, t) {
  15172. var i = []
  15173. , o = []
  15174. , l = this.mesh.position;
  15175. if (e === s.PANORAMA) {
  15176. var c = .5
  15177. , h = t.position.clone().sub(l).normalize();
  15178. i.push(p.filters.isPanoAligned()),
  15179. i.push(p.filters.inPanoDirection(l, h, c)),
  15180. i.push(p.filters.isNeighbourPanoTo(t)),
  15181. o.push(p.scoreFunctions.direction(l, h))
  15182. }
  15183. var u = new r.Vector3
  15184. , d = function(e) {
  15185. u.copy(l).sub(e.position);
  15186. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15187. , i = a.tags.navigate.tiltTolerance;
  15188. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15189. }
  15190. , f = function(e) {
  15191. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15192. };
  15193. i.push(f, d),
  15194. o.push(p.scoreFunctions.distanceSquared(this.mesh, -2));
  15195. var g = t.model.panos.sortByScore(i, o);
  15196. if (g && a.tags.navigate.lineOfSight) {
  15197. for (var m = 0; m < g.length; m++) {
  15198. var v = g[m].pano
  15199. , A = v.position.distanceTo(l);
  15200. raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15201. var y = raycaster.intersectObjects(t.model.colliders);
  15202. if (0 === y.length || y[0].distance > A)
  15203. return v
  15204. }
  15205. return null
  15206. }
  15207. return g && g.length > 0 && g[0].pano
  15208. },
  15209. hot.prototype.examine = function(e) {
  15210. var hotPop = document.getElementById('popup');
  15211. //获取那个热点的链接
  15212. if(this.link){
  15213. g_currentHot = this;
  15214. hotPop.style.display = "block";
  15215. hotPop.classList.add("wait");
  15216. var myElement = document.createElement("iframe");
  15217. //打开热点的时候把背景音乐关闭了,避免与热点里面的音乐冲突
  15218. g_bgAudio && g_bgAudio.pause();
  15219. //给热点后面加上随机数,让热点确保是最新的
  15220. var hotLinkParameter = this.link.substring(this.link.indexOf("html")+4);
  15221. var hotLinkHttp = null;
  15222. hotLinkParameter.indexOf("?") == -1 ? hotLinkHttp = this.link + "?time="+randomTime().getTime() : hotLinkHttp = this.link + "&time="+randomTime().getTime();
  15223. hotLinkHttp.indexOf("https") == -1 ? myElement.src = hotLinkHttp.substr(0, 4) + "s" + hotLinkHttp.substr(4) : myElement.src = hotLinkHttp;
  15224. myElement.id = "id1";
  15225. myElement.allowTransparency = "true";
  15226. myElement.style.width = "100%";
  15227. myElement.style.height = "100%";
  15228. myElement.scrolling = "no";
  15229. var element=document.getElementById("id1"); //判断页面是否有iframe
  15230. if (typeof(element)== "undefined" || element == null){
  15231. document.getElementById("popup").appendChild(myElement);
  15232. }
  15233. //setTimeout(function(){$('#player').on("click",e.closePopup);},20)
  15234. }
  15235. var t = e.mode
  15236. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15237. , n = this.mesh.position;
  15238. e.flyingToTag = true;
  15239. var o = function() {
  15240. e.flyingToTag = false;
  15241. if(this.link){
  15242. hotPop.classList.remove("wait");
  15243. }
  15244. }.bind(this);
  15245. if (t === s.PANORAMA){
  15246. var l = {
  15247. pano: i,
  15248. lookAtPoint: n,
  15249. duration: null,
  15250. maxDistanceOverride: null,
  15251. skipWarpingCheck: !1
  15252. };
  15253. e.flyToPano(l, o)
  15254. }else {
  15255. var c = {
  15256. pano: i
  15257. };
  15258. if (n) {
  15259. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15260. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15261. }
  15262. c.callback = o,
  15263. c.duration = 1500,
  15264. c.mode = s.PANORAMA,
  15265. e.flyToNewMode(c)
  15266. }
  15267. },
  15268. t.exports = hot;
  15269. }
  15270. , {
  15271. three: 217,
  15272. "../shaders":167,
  15273. "../enum/Viewmode":51,
  15274. "../objects/Panorama":148,
  15275. "../util/texture":194,
  15276. "../settings":166
  15277. }],
  15278. 123: [function(e, t, i) {//tag
  15279. (function(i) {
  15280. "use strict";
  15281. function n(e, t, i) {
  15282. var n = i.version || "0";
  15283. "0" !== n && I.info("tag defined using version " + n),
  15284. this.model = e,
  15285. this.sid = t,
  15286. this.color = (new r.Color).set(i.color || l.tagDefault),
  15287. this.hoverColor = l._darken(this.color, .2),
  15288. this.floor = null,
  15289. this.floorIndex = i.floor,
  15290. this.mode = s.PANORAMA,
  15291. i.preferred_camera && i.preferred_camera.mode && (this.mode = i.preferred_camera.mode),
  15292. this.obj3d = null,
  15293. this.disc = null,
  15294. this.materials = {
  15295. disc: null,
  15296. pole: null
  15297. },
  15298. this.position = (new r.Vector3).copy(i.position),
  15299. this.discPosition = (new r.Vector3).copy(i.stem.direction),
  15300. this.discWorldPosition = null,
  15301. this.discScale = .05,
  15302. this.poleEnabled = i.stem.enabled,
  15303. this.billboard = new o(i.label,i.description,i.media,this),
  15304. this.visibleTransition = null,
  15305. this.hoveringDisc = !1
  15306. }
  15307. var r = e("three")
  15308. , o = e("./Billboard/Billboard")
  15309. , a = e("../settings")
  15310. , s = e("../enum/Viewmode")
  15311. , l = e("../enum/Colors")
  15312. , c = e("../enum/RenderLayers")
  15313. , h = e("../enum/RenderOrder")
  15314. , u = (e("../util/common"),
  15315. e("../util/math"))
  15316. , d = e("../util/texture")
  15317. , p = e("../objects/Panorama")
  15318. , f = e("../shaders")
  15319. , g = e("../util/transitions")
  15320. , m = e("../util/lerp")
  15321. , v = e("../util/easing")
  15322. , A = e("./Billboard/BillboardEvent")
  15323. , y = e("events").EventEmitter
  15324. , C = e("../util/logger")
  15325. , I = new C(i)
  15326. , E = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFigDGhCnowAABQFJREFUeNrtXTtyFEEMHXX5FK7iAiYFQ+KAiMyZCQnxRXwVFwkngSKD2BQXEYlNLXaZnZ7RX0/xbrek96RW9/RnWSCthSoaxcys4iwiAgGagN2FFATQe5OBAHpvMhBA700GAvC9iUBVgZd2dmTd9siIAvxOB9/RI9GI3kftf3a0t0YG2OOEaOk0qy2UyWFZKutMthGc09tWiuyQKkuvke2miE6ouOYe1QcE4HsTgSIY2gX4iP4ZHcFn5kt+KpfmFfhK2zXXDMgR/FdE9D3ivNyaqMz8YlmW3x46kIfjNQyxXlnzskG6X8psQJjlVGObJPtLqXj1DSGWvhyZFI70EUVTv3tf3VkEAWmDLwV8xmmehe17+6DIymFHkL6fKaJS2BFk5+8RzUlVwY9qG0ViY2XwLfyzpV2KoEQX4C18NdsmAfzeJBiRDekg3ruGhpCi7wC+eXH4XqI9kc+Rs4wE+DZ+XNPeiKY0MoHtUHCyU6nTLOBnISoz84yuRETP6bqmLdrjiMhOjXw0zJKsx9oaxcC/1j4atizLdaah4GidYEEAbfC9NpVGsmsrVgTwe5PgZEkqUbaSP+iRds9CxuiPeo4ggr2z2A1Efg/dNs0CokV/Bgd7b3mf7X9EWQCpFF2ZhqiZDHDqFf0p79/zXYhajRWt7cgr/Wc/OOrli7U4DmllAb6eDRr4jKhAVDoyHtl/otNAfOrNt9YwIoJX8lr2QDYdYh1xIehN4QB+G46YUtW/2GHF4tfFWPvpGK7RMsCvBsP4F2SAptHv4atVGQDVe9/ZxLEh4AOiP+aMYMLnH48OAUj/fYeBsUBaCwgAAtQYEzvWAcgAEBAA4kwArCHknkkgAyADQEAACAgAAQEgIMC8dH3vJ4JI+B4ZABkAAgI4S8fFpCg2IwMgA0BAgOfT1BVclH6o+S+GR++3wbawmOO/BC5/t4RhLt93DWFUiwxU/ygCIZIEsH4FnJk/FY5+Edsk6zJa82McEI2V/qUKwH8yQNTz6wBfrwAUrwEwm7AFz6wI9GBvpSwQ2X9Dml3RbsWqBL4GPjOvhp2hHsihOzO/1FgH+Dnx2/PuJFDQecanP1ZnhBnlcVl0Dttn8Btahnnfmg3w5YcAzKcLDlVp3wyKNhxkfC1kWRK/GfRgbPVHo7RlbGGedy3wWBdmvnEA/qb0s3GSw4BlpFgQLqIdKgTISgINIrR8OnZFxxeRa4RDsf6/oZ27MCBthlUrmipFv8g6gMeb9wBfLphEnoxh5luQwBz8W4n2TNMNhgMb3820J7YUvAVMZAL/wBHvHJnAF/zZNkkj2rdGdhciaPlnS7ubUzBIkB980RpAaoGicl2wA3y1U9q0E2TWBLNKNtD2w572h6Zh96uoF3vaz5wR9urPzBfaQSZ1no8NouD1sixfk2B/TkTfovtUjACWCkceGiztk+rL/JNpxYMj1jZJ9ueyc7fCjmEvG1zOBko75r44vJXu91C0CjqN9pn51itw1Cps64slJHSLpIuVbmoLQTOXGFjvLKJnxBj4iwhBQlEY7hWBHhLJJ9TRaADvQIAtlXoVIkS2m6I7IzMRMthqfjh0S8F1sDv7LAHoZ1u2knt990h7rq7S4VBPWyi787ycWOVy7DCvh0t8M38kV4JgX0meFIr0mTtkcVV1W1jEYjZ0dY0dQc0JkJkMWaaubebXAL0QASKRIftqJa5lbwQ2BPJE/gA4gL5xbiNHuQAAAABJRU5ErkJggg==")
  15327. , b = d.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QYPFgoIKnA4CwAAAkVJREFUeNrt3Uluw0AMRFHTvv+NrSibBAgyILGjodn16gbS/yxyYUOXi0SnZnyodV3XXV5WVREgBHaKFAV6tgwFerYMBXq2DAV8tggFfLYIBXy2CAV8tggFfrYEBXy2CAV+tgQFfrYEBXy2CAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgQFfrYEBX62BAV+tgRXry5cHNOf3QIFfrYEBX62BG4AN4DpT26BAj9bAivACjD9yS2gATSA6U9uAQ2gAUx/cgtoAA1g+pNbQAOEhwBWgPpPXgMawAoQK0D9x64BDWAFiBWg/mPXgAawAoQAQgAJPgIdgLmHoAawAoQAQgAhgBBACCAEEAIIAYQAQgAhgBBACCAEEAIIAYQAQgAhgEwQfw1LBe+vYUIAIQAB3rIsy4vXEXwEOgTzDkArQAhgBXyKNZBT/xpACGAFfBNrIKP+NYAQwAr4IdbA/PWvAcR3A5OnXwOIbwcnT78GkN8bQAvMO/1/bgA/FglvAC0w5/Q/JAAJ5oPvCJTHGkALzDX9TwlAgnngPy0ACeaA7waQ5xtAC/Sf/n8LQILe8DcRgAR94W8mAAl6wt9UABL0g7+5ACToBX8XAUjQB/5uApCgB/xdBSDB+PB3F4AEY8M/RAAijAn+cAFIMB78wwUgwVjwTxGACGOAf8/1zAf2a+Nz4Z/aANrgXPBDCZAmwgjghxRgdhFGAj+0ALOJMCL4FgJ0lmFk6C0F6CBDF+jtBfiY+/2+3G63K+ihAhzZEN1hi3zJK04kLKvtOfg1AAAAAElFTkSuQmCC")
  15328. , w = new r.PlaneBufferGeometry(1,1);
  15329. n.prototype = Object.create(y.prototype),
  15330. n.raycaster = new r.Raycaster,
  15331. n.prototype.bindEvents = function() {
  15332. this.billboard.on(A.ENTER, this.setHoverState.bind(this)),
  15333. this.billboard.on(A.LEAVE, this.setFreeState.bind(this))
  15334. }
  15335. ,
  15336. n.prototype.build = function() {
  15337. return this.floor = this.model.floors.get(this.floorIndex) || this.model.floors.first(),
  15338. this.floor && (this.billboard.build(this.model.sid),
  15339. this.obj3d = this.buildObject3D(),
  15340. this.floor.add(this.obj3d)),
  15341. this
  15342. }
  15343. ,
  15344. n.prototype.buildObject3D = function() {
  15345. var e = new r.Object3D;
  15346. e.position.copy(this.position);
  15347. var t = r.UniformsUtils.clone(f.tagDisc.uniforms);
  15348. t.bg.value = b,
  15349. t.mask.value = E,
  15350. t.color.value.copy(this.color),
  15351. this.materials.disc = new r.RawShaderMaterial({
  15352. transparent: !0,
  15353. vertexShader: f.tagDisc.vertexShader,
  15354. fragmentShader: f.tagDisc.fragmentShader,
  15355. uniforms: t
  15356. }),
  15357. this.disc = new r.Mesh(w,this.materials.disc),
  15358. this.disc.layers.set(c.TAG),
  15359. this.disc.position.copy(this.discPosition),
  15360. this.disc.renderOrder = h.tagDisc,
  15361. this.disc.tag = this;
  15362. var i = this.buildPole();
  15363. return i.layers.set(c.TAG),
  15364. i.renderOrder = h.tagStem,
  15365. e.add(i),
  15366. e.layers.set(c.TAG),
  15367. e.add(this.disc)
  15368. }
  15369. ,
  15370. n.prototype.buildPole = function() {
  15371. var e = new r.BufferGeometry
  15372. , t = new Float32Array(6);
  15373. return t[0] = t[1] = t[2] = 0,
  15374. t[3] = this.discPosition.x,
  15375. t[4] = this.discPosition.y,
  15376. t[5] = this.discPosition.z,
  15377. e.addAttribute("position", new r.BufferAttribute(t,3)),
  15378. this.materials.pole = new r.LineBasicMaterial({
  15379. linewidth: a.tags.pole.width,
  15380. color: a.tags.pole.color,
  15381. opacity: 0,
  15382. visible: this.poleEnabled,
  15383. transparent: !0,
  15384. depthWrite: !1
  15385. }),
  15386. new r.Line(e,this.materials.pole)
  15387. }
  15388. ,
  15389. n.prototype.setFreeState = function(e) {
  15390. !e && this.hoveringDisc || this.billboard.close(e).then(function() {
  15391. this.materials.disc.uniforms.color.value = this.color
  15392. }
  15393. .bind(this))
  15394. }
  15395. ,
  15396. n.prototype.setHoverState = function(e) {
  15397. this.billboard.open(e),
  15398. this.materials.disc.uniforms.color.value = this.hoverColor
  15399. }
  15400. ,
  15401. n.prototype.hide = function(e, t) {
  15402. var i = $.Deferred();
  15403. if (0 === this.materials.disc.uniforms.opacity.value && !g.isRunning(this.visibleTransition))
  15404. return i.resolve().promise();
  15405. e = e || 0,
  15406. t = t || 0,
  15407. g.cancel(this.visibleTransition);
  15408. var n = this.materials.disc.uniforms.opacity.value / a.tags.disc.opacity
  15409. , r = t + e
  15410. , o = t / r;
  15411. return this.visibleTransition = g.start(function(e) {
  15412. var t = m.property(e.materials.disc.uniforms.opacity, "value", 0)
  15413. , i = m.property(e.materials.pole, "opacity", 0);
  15414. return function(n) {
  15415. t(n),
  15416. e.materials.pole && i(n)
  15417. }
  15418. }(this), r * n, function() {
  15419. i.resolve()
  15420. }, o, v[a.warp.blendEasing]),
  15421. i.promise()
  15422. }
  15423. ,
  15424. n.prototype.show = function(e, t) {
  15425. var i = $.Deferred();
  15426. if (this.materials.disc.uniforms.opacity.value === a.tags.disc.opacity && !g.isRunning(this.visibleTransition))
  15427. return i.resolve().promise();
  15428. e = e || 0,
  15429. t = t || 0,
  15430. g.cancel(this.visibleTransition);
  15431. var n = (a.tags.disc.opacity - this.materials.disc.uniforms.opacity.value) / a.tags.disc.opacity
  15432. , r = t + e
  15433. , o = t / r;
  15434. return this.visibleTransition = g.start(function(e) {
  15435. var t = m.property(e.materials.disc.uniforms.opacity, "value", a.tags.disc.opacity)
  15436. , i = m.property(e.materials.pole, "opacity", a.tags.pole.opacity);
  15437. return function(n) {
  15438. t(n),
  15439. e.materials.pole && i(n)
  15440. }
  15441. }(this), r * n, function() {
  15442. i.resolve()
  15443. }, o, v[a.warp.blendEasing]),
  15444. i.promise()
  15445. }
  15446. ,
  15447. n.prototype.closestPanoTowardTag = function(e, t) {
  15448. var i = []
  15449. , o = []
  15450. , l = this.disc.getWorldPosition();
  15451. if (e === s.PANORAMA) {
  15452. var c = .5
  15453. , h = t.position.clone().sub(l).normalize();
  15454. i.push(p.filters.isPanoAligned()),
  15455. i.push(p.filters.inPanoDirection(l, h, c)),
  15456. i.push(p.filters.isNeighbourPanoTo(t)),
  15457. o.push(p.scoreFunctions.direction(l, h))
  15458. }
  15459. var u = new r.Vector3
  15460. , d = function(e) {
  15461. u.copy(l).sub(e.position);
  15462. var t = -r.Math.radToDeg(Math.atan(u.y / Math.sqrt(u.x * u.x + u.z * u.z)))
  15463. , i = a.tags.navigate.tiltTolerance;
  15464. return a.insideLookLimitDown - i < t && t < a.insideLookLimitUp + i
  15465. }
  15466. , f = function(e) {
  15467. return Math.abs(e.position.x - l.x) > a.tags.visibility.cameraClearance || Math.abs(e.position.z - l.z) > a.tags.visibility.cameraClearance
  15468. };
  15469. i.push(f, d),
  15470. o.push(p.scoreFunctions.distanceSquared(this, -2));
  15471. var g = this.model.panos.sortByScore(i, o);
  15472. if (a.tags.navigate.lineOfSight) {
  15473. for (var m = 0; m < g.length; m++) {
  15474. var v = g[m].pano
  15475. , A = v.position.distanceTo(l);
  15476. if (!a.tags.visibility.anyDistance && A > a.tags.visibility.visibleDistance)
  15477. return null;
  15478. n.raycaster.set(v.position, l.clone().sub(v.position).normalize());
  15479. var y = n.raycaster.intersectObjects(this.model.colliders);
  15480. if (0 === y.length || y[0].distance > A)
  15481. return v
  15482. }
  15483. return null
  15484. }
  15485. return g.length > 0 && g[0].pano
  15486. }
  15487. ,
  15488. n.prototype.examine = function(e) {
  15489. var t = e.mode
  15490. , i = a.tags.navigate.nearestPano && this.closestPanoTowardTag(t, e.currentPano) || e.currentPano
  15491. , n = this.disc.getWorldPosition();
  15492. this.billboard.setActiveState();
  15493. var o = function() {
  15494. var t = this.billboard.getDimensions()
  15495. , n = new r.Vector3;
  15496. u.convertScreenPositionToNDC(t.left + t.width / 2, t.top + t.height / 2, n),
  15497. n.unproject(e.camera),
  15498. e.flyToPano({
  15499. pano: i,
  15500. lookAtPoint: n
  15501. })
  15502. }
  15503. .bind(this);
  15504. if (t === s.PANORAMA)
  15505. if (i !== e.currentPano) {
  15506. var l = {
  15507. pano: i,
  15508. lookAtPoint: n,
  15509. duration: null,
  15510. maxDistanceOverride: null,
  15511. skipWarpingCheck: !1
  15512. };
  15513. e.flyToPano(l, o)
  15514. } else
  15515. setTimeout(function() {
  15516. this.billboard.open().then(function() {
  15517. o()
  15518. })
  15519. }
  15520. .bind(this), 0);
  15521. else {
  15522. var c = {
  15523. pano: i
  15524. };
  15525. if (n) {
  15526. var h = (new r.Matrix4).lookAt(i.position, n, new r.Vector3(0,1,0));
  15527. c.quaternion = (new r.Quaternion).setFromRotationMatrix(h)
  15528. }
  15529. c.callback = o,
  15530. c.duration = 1500,
  15531. c.mode = s.PANORAMA,
  15532. e.flyToNewMode(c)
  15533. }
  15534. }
  15535. ,
  15536. n.prototype.update = function(e, t) {
  15537. var i = new r.Vector3;
  15538. return function(e, t) {
  15539. this.discWorldPosition = this.disc.getWorldPosition(),
  15540. this.updateDisc(e, t),
  15541. this.billboard.needsUpdate() && (i.copy(this.discWorldPosition).project(t),
  15542. i.z < 1 && (i.y *= -1,
  15543. this.billboard.update(i, this.getDiscRadius(i, t))))
  15544. }
  15545. }(),
  15546. n.prototype.updateDisc = function(e, t) {
  15547. var i = new r.Vector3
  15548. , o = new r.Vector3
  15549. , l = new r.Vector3
  15550. , c = new r.Vector3
  15551. , h = new r.Vector3;
  15552. return function(e, t) {
  15553. var u = a.tags.visibility
  15554. , d = a.tags.disc.scale
  15555. , p = e === s.DOLLHOUSE || e === s.FLOORPLAN ? a.tags.visibility.visibleDistance : t.position.distanceTo(this.discWorldPosition);
  15556. if (this.obj3d.visible = 0 !== this.disc.material.opacity && (u.anyDistance || p <= u.visibleDistance || e === s.TRANSITIONING) && (!u.hideViaFloor || this.tagVisibleOnCurrentFloor(e)) && (!u.hideOffScreenDisc || !this.offScreen(this.disc, t)) && (!u.hideOffScreenObject || !this.offScreen(this.obj3d, t)),
  15557. this.obj3d.visible) {
  15558. this.disc.quaternion.copy(t.quaternion);
  15559. var f = d.maxSize - (d.maxSize - d.minSize) * r.Math.smoothstep(p, d.nearBound, d.farBound);
  15560. i.copy(this.discWorldPosition).project(t),
  15561. o.set($("#player").width() / 2, $("#player").height() / 2, 1).multiply(i),
  15562. l.set(f / 2, 0, 0).add(o),
  15563. c.set(2 / $("#player").width(), 2 / $("#player").height(), 1).multiply(l),
  15564. h.copy(c).unproject(t);
  15565. var g = h.distanceTo(this.discWorldPosition)
  15566. , m = 1 + a.tags.disc.scale.responsiveness / 100 * (n.viewportScale() - 1);
  15567. this.discScale = g * m,
  15568. this.disc.scale.set(this.discScale, this.discScale, this.discScale)
  15569. }
  15570. }
  15571. }(),
  15572. n.prototype.getDiscRadius = function(e, t) {
  15573. var i = new r.Vector3;
  15574. return function(e, t) {
  15575. return i.set(-this.discScale / 2, 0, 0).applyQuaternion(t.quaternion).add(this.discWorldPosition).project(t),
  15576. Math.abs(e.x - i.x) * $("#player").width()
  15577. }
  15578. }(),
  15579. n.prototype.tagVisibleOnCurrentFloor = function(e) {
  15580. return !(e === s.DOLLHOUSE || e === s.FLOORPLAN) || this.model.allFloorsVisible || !this.floor.hidden
  15581. }
  15582. ,
  15583. n.prototype.offScreen = function(e, t) {
  15584. var i = e.getWorldPosition().project(t);
  15585. return !(-1 < i.x && i.x < 1 && -1 < i.y && i.y < 1)
  15586. }
  15587. ,
  15588. n.viewportScale = function() {
  15589. return n.viewportWidth === $("#player").width() && n.viewportHeight === $("#player").height() || (n.viewportWidth = $("#player").width(),
  15590. n.viewportHeight = $("#player").height(),
  15591. n.currentViewportScale = Math.sqrt(Math.min(n.viewportWidth, n.viewportHeight) / a.tags.disc.scale.baseViewportSize)),
  15592. n.currentViewportScale
  15593. }
  15594. ,
  15595. t.exports = n
  15596. }
  15597. ).call(this, "/js/tag/tag.js")
  15598. }
  15599. , {
  15600. "../enum/Colors": 19,
  15601. "../enum/RenderLayers": 41,
  15602. "../enum/RenderOrder": 42,
  15603. "../enum/Viewmode": 51,
  15604. "../objects/Panorama": 148,
  15605. "../settings": 166,
  15606. "../shaders": 167,
  15607. "../util/common": 185,
  15608. "../util/easing": 186,
  15609. "../util/lerp": 188,
  15610. "../util/logger": 189,
  15611. "../util/math": 190,
  15612. "../util/texture": 194,
  15613. "../util/transitions": 195,
  15614. "./Billboard/Billboard": 119,
  15615. "./Billboard/BillboardEvent": 120,
  15616. events: 202,
  15617. three: 217
  15618. }],
  15619. 124: [function(e, t, i) {
  15620. (function(i) {
  15621. "use strict";
  15622. function n() {
  15623. this.tagState = y.IDLE,
  15624. this.intersectTag = null,
  15625. this.hoveredTag = null,
  15626. this.activeTag = null,
  15627. this.tagDiscs = [],
  15628. this.raycaster = new r.Raycaster,
  15629. this.modelManager = null,
  15630. this.player = null,
  15631. this.totaltags = 0,
  15632. this.navigatingViaTag = !1,
  15633. this.enabled = !1
  15634. }
  15635. var r = e("three")
  15636. , o = e("../util/logger")
  15637. , a = e("../util/common")
  15638. , s = e("../controls/serializer")
  15639. , l = e("../objects/Snapshot")
  15640. , c = e("../settings")
  15641. , h = e("./Billboard/BillboardEvent")
  15642. , u = e("./Media/MediaEvent")
  15643. , d = e("./Media/LinkType")
  15644. , p = e("../enum/Viewmode")
  15645. , f = e("../enum/WarpStyle")
  15646. , g = e("../enum/BlackoutStyle")
  15647. , m = e("../enum/ModelManagerEvents")
  15648. , v = e("../enum/tagEvents")
  15649. , A = e("../enum/PlayerEvents")
  15650. , y = (e("../util/lerp"),
  15651. e("../enum/TagStates"))
  15652. , C = e("events").EventEmitter
  15653. , I = new o(i);
  15654. a.extend(n, C),
  15655. n.prototype.init = function(e, t) {
  15656. this.modelManager = e,
  15657. this.player = t,
  15658. this.updateModel(),
  15659. this.bindEvents()
  15660. }
  15661. ,
  15662. n.prototype.update = function(e) {
  15663. this.updateTags(this.player.mode, this.player.camera, this.player.currentPano, this.player.flying)
  15664. }
  15665. ,
  15666. n.prototype.updateTags = function(e, t, i, n) {
  15667. for (var r in this.model.tags)
  15668. this.model.tags[r].update(e, t, i, n)
  15669. }
  15670. ,
  15671. n.prototype.updateModel = function() {
  15672. this.model = this.modelManager.getActiveModel(),
  15673. this.gettagsFromModel(),
  15674. this.totaltags = Object.keys(this.model.tags).length
  15675. }
  15676. ,
  15677. n.prototype.gettagsFromModel = function() {
  15678. this.tagDiscs = [];
  15679. for (var e in this.model.tags) {
  15680. var t = this.model.tags[e].disc;
  15681. t && this.tagDiscs.push(t)
  15682. }
  15683. }
  15684. ,
  15685. n.prototype.bindEvents = function() {
  15686. function e() {
  15687. Object.keys(this.model.tags).forEach(function(e) {
  15688. var t = this.model.tags[e];
  15689. t.bindEvents(),
  15690. t.billboard.on(u.LINK_CLICK, function(e) {
  15691. e.type === d.NAVIGATION && this.navigateViaLink(e.url)
  15692. }
  15693. .bind(this)),
  15694. t.billboard.on(u.IMAGE_OPENED, function() {
  15695. this.tagState = y.EXAMINE,
  15696. this.emit(u.IMAGE_OPENED)
  15697. }
  15698. .bind(this)),
  15699. t.billboard.on(h.CLOSING, this.dismissExaminedTag.bind(this))
  15700. }
  15701. .bind(this))
  15702. }
  15703. this.modelManager.on(m.ActiveModelChanged, this.updateModel.bind(this)),
  15704. this.modelManager.on(m.ActiveModelChanged, e.bind(this)),
  15705. this.player.on(A.ModeChanging, this.onPlayerModeChanging.bind(this)),
  15706. this.player.on(A.PanoChosen, this.onPanoChange.bind(this)),
  15707. this.player.on(A.Ready, this.onPlayerReady.bind(this)),
  15708. this.player.on(A.FlyingEnded, this.onPlayerFlyingEnded.bind(this)),
  15709. this.player.on(A.WarpStarted, this.handleWarpStart.bind(this)),
  15710. this.player.on(A.WarpInterrupted, this.handleWarpInterruption.bind(this)),
  15711. e.call(this)
  15712. }
  15713. ,
  15714. n.prototype.navigateViaLink = function(e) {
  15715. var t = s.deserialize(e);
  15716. if (t)
  15717. if (t.mode === p.PANORAMA) {
  15718. try {
  15719. this.player.model.panos.get(t.panoId)
  15720. } catch (e) {
  15721. return void I.warn("Unable to find panorama location", t.panoId)
  15722. }
  15723. this.player.warpToPanoById(t.panoId, t.quaternion, null, null, f.BLACK)
  15724. } else {
  15725. var i = {
  15726. cameraMode: t.mode,
  15727. position: t.position,
  15728. quaternion: t.quaternion,
  15729. scanId: t.panoId,
  15730. orthoZoom: t.zoom,
  15731. floorVisibility: t.floorVisibility,
  15732. thumbUrl: null,
  15733. name: null
  15734. };
  15735. this.player.flyToNewMode({
  15736. mode: t.mode,
  15737. duration: c.warp.outsideTime,
  15738. warpDest: new l(i),
  15739. force: !0
  15740. })
  15741. }
  15742. }
  15743. ,
  15744. n.prototype.handleWarpStart = function(e, t, i, n) {
  15745. this.dismissExaminedTag(),
  15746. t === f.BLACK && (null !== n && void 0 !== n || (n = c.warp.teleportTime),
  15747. e && (i = g.END),
  15748. this.hideShowTagsForBlackoutStyle(i, n))
  15749. }
  15750. ,
  15751. n.prototype.handleWarpInterruption = function(e, t, i) {
  15752. null !== i && void 0 !== i || (i = c.warp.teleportTime),
  15753. this.hideShowTagsForBlackoutStyle(t, i)
  15754. }
  15755. ,
  15756. n.prototype.hideShowTagsForBlackoutStyle = function(e, t) {
  15757. var i = 0
  15758. , n = 0
  15759. , r = t / 2;
  15760. switch (null !== e && void 0 !== e || (e = g.MIDDLE),
  15761. e) {
  15762. case g.END:
  15763. this.hideAlltags(r);
  15764. break;
  15765. case g.BEGINNING:
  15766. this.hideAlltags().done(this.showAlltags.bind(this, r));
  15767. break;
  15768. case g.NONE:
  15769. break;
  15770. case g.MIDDLE:
  15771. i = r,
  15772. n = r,
  15773. this.hideAlltags(n),
  15774. setTimeout(function() {
  15775. this.showAlltags(i)
  15776. }
  15777. .bind(this), n);
  15778. break;
  15779. case g.FADEIN:
  15780. setTimeout(function() {
  15781. this.showAlltags(r)
  15782. }
  15783. .bind(this), r)
  15784. }
  15785. }
  15786. ,
  15787. n.prototype.onPlayerModeChanging = function(e, t) {
  15788. t !== p.PANORAMA && this.dismissExaminedTag(),
  15789. t === p.PANORAMA && player.currentPano && !player.currentPano.isAligned() && (t = p.OUTDOOR);
  15790. var i = t !== p.OUTDOOR;
  15791. i !== this.model.tagsShown && (i ? this.showAlltags(c.tags.startup.fadeInDuration) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15792. }
  15793. ,
  15794. n.prototype.onPanoChange = function(e, t) {
  15795. var i = this.navigatingViaTag;
  15796. if (this.navigatingViaTag = !1,
  15797. !i) {
  15798. this.dismissExaminedTag();
  15799. var n = e && !e.isAligned() ? p.OUTDOOR : p.PANORAMA
  15800. , r = t && !t.isAligned() ? p.OUTDOOR : p.PANORAMA;
  15801. n !== r && (r === p.PANORAMA ? this.showAlltags(c.tags.startup.fadeInDuration, null, !0) : this.hideAlltags(c.tags.startup.fadeInDuration))
  15802. }
  15803. }
  15804. ,
  15805. n.prototype.onPlayerReady = function(e, t, i) {
  15806. this.startAlltags(e, t ? i : null)
  15807. }
  15808. ,
  15809. n.prototype.onPlayerFlyingEnded = function(e, t) {
  15810. this.updateClosestTags(e)
  15811. }
  15812. ,
  15813. n.prototype.dismissExaminedTag = function() {
  15814. this.activeTag && this.tagState === y.EXAMINE && this.dismissActiveTag(),
  15815. this.hoveredTag && (this.hoveredTag.setFreeState(!0),
  15816. this.hoveredTag = null)
  15817. }
  15818. ,
  15819. n.prototype.startAlltags = function(e, t) {
  15820. this.model.shouldShowtags = c.tags.enabled,
  15821. this.enabled = !0,
  15822. e || (this.showAlltags(c.tags.startup.fadeInDuration, c.tags.startup.fadeInDelay),
  15823. t && setTimeout(function() {
  15824. this.activateTag(this.model.getTagBySid(t))
  15825. }
  15826. .bind(this), c.tags.startup.fadeInDuration / 2))
  15827. }
  15828. ,
  15829. n.prototype.showAlltags = function(e, t, i) {
  15830. function n() {
  15831. o++,
  15832. o === this.totaltags && (this.model.tagsShown = !0,
  15833. r.resolve())
  15834. }
  15835. var r = $.Deferred();
  15836. if (!i && this.player.mode === p.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || !this.model.shouldShowtags)
  15837. return r.resolve().promise();
  15838. var o = 0;
  15839. for (var a in this.model.tags) {
  15840. var s = this.model.tags[a];
  15841. s.show(e, t).done(n.bind(this))
  15842. }
  15843. return r.promise()
  15844. }
  15845. ,
  15846. n.prototype.hideAlltags = function(e, t) {
  15847. function i() {
  15848. r++,
  15849. r === this.totaltags && (this.model.tagsShown = !1,
  15850. n.resolve())
  15851. }
  15852. var n = $.Deferred()
  15853. , r = 0;
  15854. for (var o in this.model.tags) {
  15855. var a = this.model.tags[o];
  15856. a.hide(e, t).done(i.bind(this)),
  15857. a === this.activeTag && this.dismissActiveTag()
  15858. }
  15859. return n.promise()
  15860. }
  15861. ,
  15862. n.prototype.enableHovering = function() {
  15863. this.enabled = !0
  15864. }
  15865. ,
  15866. n.prototype.disableHovering = function() {
  15867. this.enabled = !1
  15868. }
  15869. ,
  15870. n.prototype.activateTag = function(e, t) {
  15871. t = t || y.EXAMINE,
  15872. this.activeTag = e,
  15873. this.activeTag.hoveringDisc = !0,
  15874. this.activeTag.setHoverState(t === y.EXAMINE),
  15875. this.tagState = t,
  15876. this.emit(v.TagActivated, e)
  15877. }
  15878. ,
  15879. n.prototype.dismissActiveTag = function() {
  15880. this.activeTag.hoveringDisc = !1,
  15881. this.activeTag.setFreeState(!0);
  15882. var e = this.activeTag;
  15883. this.activeTag = null,
  15884. this.tagState = y.IDLE,
  15885. this.emit(v.TagDismissed, e)
  15886. }
  15887. ,
  15888. n.prototype.clickedOnTag = function(e) {
  15889. var t = function() {
  15890. this.navigatingViaTag = !0,
  15891. this.activeTag.examine(this.player),
  15892. this.emit(v.TagNavigation, this.activeTag)
  15893. }
  15894. .bind(this);
  15895. return this.tagState !== y.EXAMINE ? (this.activateTag(this.intersectTag, y.EXAMINE),
  15896. this.activeTag = this.intersectTag,
  15897. t(),
  15898. !0) : (this.dismissActiveTag(),
  15899. !1)
  15900. }
  15901. ,
  15902. n.prototype.intersecttag = function() {
  15903. var e = new r.Vector3
  15904. , t = new r.Vector3
  15905. , i = new r.Vector3;
  15906. return function(n, r, o) {
  15907. if (!this.enabled)
  15908. return null;
  15909. var a = null
  15910. , s = this.tagDiscs.filter(function(e) {
  15911. return e.parent.visible
  15912. });
  15913. if (s.length > 0) {
  15914. var l = this.model.floors.reduce(function(e, t) {
  15915. return t.hidden ? e : e.concat(t.collider.children)
  15916. }, s);
  15917. e.set(n.x, n.y, -1).unproject(o),
  15918. t.set(n.x, n.y, 1).unproject(o),
  15919. i.copy(t).sub(e).normalize(),
  15920. this.raycaster.set(e, i);
  15921. var c = this.raycaster.intersectObjects(l);
  15922. c.length > 0 && s.indexOf(c[0].object) !== -1 && (a = c[0].object.tag)
  15923. }
  15924. return this.intersectTag = a,
  15925. r && (this.activeTag && a !== this.activeTag && (this.tagState === y.BROWSE || this.tagState === y.EXAMINE && a) && this.dismissActiveTag(),
  15926. a && a !== this.activeTag && (a.listeners(h.ENTER).length < 1 && (a.billboard.on(h.ENTER, function() {
  15927. this.hoveredTag = a
  15928. }
  15929. .bind(this)),
  15930. a.billboard.on(h.LEAVE, function() {
  15931. this.hoveredTag = null
  15932. }
  15933. .bind(this))),
  15934. this.activateTag(a, y.BROWSE))),
  15935. a
  15936. }
  15937. }(),
  15938. n.prototype.rankedtagInDirection = function() {
  15939. var e = []
  15940. , t = []
  15941. , i = new r.Vector3
  15942. , n = new r.Vector3
  15943. , o = new r.Vector3;
  15944. return function(r, a, s, l) {
  15945. var c = 0;
  15946. t.length = 0;
  15947. for (var h = 0; h < this.closesttags.length; h++) {
  15948. var u = this.closesttags[h];
  15949. n.copy(u.position),
  15950. n.add(u.discPosition),
  15951. i.copy(a),
  15952. i.sub(n).negate(),
  15953. i.normalize();
  15954. var d = i.dot(l);
  15955. if (d >= 0) {
  15956. o.copy(n),
  15957. o.project(s);
  15958. var p = this.intersecttag(o, !1, s);
  15959. if (p) {
  15960. if (c >= e.length)
  15961. for (var f = 0; f < 64; f++)
  15962. e.push({
  15963. tag: u,
  15964. dot: d
  15965. });
  15966. var g = e[c];
  15967. g.tag = u,
  15968. g.dot = d,
  15969. g.position = math.projectPositionToCanvas(n, s),
  15970. t.push(g),
  15971. c++
  15972. }
  15973. }
  15974. }
  15975. return t.sort(function(e, t) {
  15976. return e.dot > t.dot ? -1 : e.dot < t.dot ? 1 : 0
  15977. }),
  15978. r < t.length ? t[r].tag : null
  15979. }
  15980. }(),
  15981. n.prototype.updateClosestTags = function() {
  15982. var e = new r.Vector3
  15983. , t = 30;
  15984. return function(i) {
  15985. this.closesttags || (this.closesttags = []),
  15986. this.closesttags.length = 0;
  15987. var n = this.model.tags;
  15988. if (n)
  15989. for (var r in n)
  15990. if (n.hasOwnProperty(r)) {
  15991. var o = n[r]
  15992. , a = o.position;
  15993. e.copy(i),
  15994. e.sub(a).negate();
  15995. var s = e.lengthSq();
  15996. s < t && this.closesttags.push(o)
  15997. }
  15998. }
  15999. }(),
  16000. t.exports = n
  16001. }
  16002. ).call(this, "/js/tag/tagManager.js")
  16003. }
  16004. , {
  16005. "../controls/serializer": 14,
  16006. "../enum/BlackoutStyle": 18,
  16007. "../enum/tagEvents": 32,
  16008. "../enum/ModelManagerEvents": 33,
  16009. "../enum/PlayerEvents": 40,
  16010. "../enum/TagStates": 44,
  16011. "../enum/Viewmode": 51,
  16012. "../enum/WarpStyle": 52,
  16013. "../objects/Snapshot": 153,
  16014. "../settings": 166,
  16015. "../util/common": 185,
  16016. "../util/lerp": 188,
  16017. "../util/logger": 189,
  16018. "./Billboard/BillboardEvent": 120,
  16019. "./Media/LinkType": 130,
  16020. "./Media/MediaEvent": 131,
  16021. events: 202,
  16022. three: 217
  16023. }],
  16024. 125: [function(e, t, i) {
  16025. (function(i) {
  16026. "use strict";
  16027. function n() {
  16028. this.embedWrapper = null,
  16029. this.embedElement = null
  16030. }
  16031. var r = e("../../util/ajax")
  16032. , o = e("./mediaSettings")
  16033. , a = e("../../settings")
  16034. , s = e("../../util/logger")
  16035. , l = new s(i);
  16036. n.prototype.createDomElement = function() {
  16037. return this.embedWrapper = document.createElement("div"),
  16038. this.embedWrapper.classList.add("tag-embed"),
  16039. this.embedWrapper.classList.add("hidden"),
  16040. this.embedWrapper
  16041. }
  16042. ,
  16043. n.prototype.load = function(e) {
  16044. var t = "https://api.embedly.com/1/oembed?key=" + a.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&maxwidth=" + o.maxEmbedWidth;
  16045. return new Promise(function(e, i) {
  16046. r.get(t).then(function(t) {
  16047. if (t = JSON.parse(t),
  16048. t.html && t.html.indexOf("<script") === -1) {
  16049. this.embedWrapper.innerHTML = t.html;
  16050. var n = Math.min(t.width, o.maxEmbedWidth) || o.maxEmbedWidth;
  16051. if (this.embedWrapper.style.width = n + "px",
  16052. t.height) {
  16053. var r = t.height / t.width;
  16054. this.embedWrapper.style.height = n * r + "px"
  16055. }
  16056. this.embedElement = this.embedWrapper.firstChild;
  16057. var a = [];
  16058. try {
  16059. a = [].slice.call(this.embedElement.querySelectorAll("a"))
  16060. } catch (e) {
  16061. l.debug("Error getting `a` elements for embed; was it an iframe?")
  16062. }
  16063. a.forEach(function(e) {
  16064. e.setAttribute("target", "_blank")
  16065. }),
  16066. this.embedElement.classList.add("hidden"),
  16067. this.embedWrapper.classList.remove("hidden"),
  16068. e()
  16069. } else
  16070. i("Not a valid embed")
  16071. }
  16072. .bind(this), function(e) {
  16073. i(e.response)
  16074. })
  16075. }
  16076. .bind(this))
  16077. }
  16078. ,
  16079. n.prototype.show = function() {
  16080. this.embedElement && this.embedElement.classList.remove("hidden")
  16081. }
  16082. ,
  16083. n.prototype.hide = function() {
  16084. this.embedElement && this.embedElement.classList.add("hidden")
  16085. }
  16086. ,
  16087. t.exports = n
  16088. }
  16089. ).call(this, "/js/tag/Media/EmbedlyEmbed.js")
  16090. }
  16091. , {
  16092. "../../settings": 166,
  16093. "../../util/ajax": 181,
  16094. "../../util/logger": 189,
  16095. "./mediaSettings": 132
  16096. }],
  16097. 126: [function(e, t, i) {
  16098. (function(i) {
  16099. "use strict";
  16100. function n(e) {
  16101. o.call(this),
  16102. this.options = e,
  16103. this.playerControls = null,
  16104. this.state = s.NOT_READY
  16105. }
  16106. var r = e("../../util/browser")
  16107. , o = e("./EmbedlyEmbed")
  16108. , a = e("../../util/logger")
  16109. , s = (new a(i),
  16110. Object.freeze({
  16111. NOT_READY: "player.not.ready",
  16112. CUED: "player.cued",
  16113. PLAYING: "player.playing",
  16114. PAUSED: "player.paused"
  16115. }));
  16116. n.prototype = Object.create(o.prototype),
  16117. n.prototype.createDomElement = function() {
  16118. return this.embedWrapper = document.createElement("div"),
  16119. this.embedWrapper.classList.add("tag-video"),
  16120. this.embedWrapper.classList.add("hidden"),
  16121. this.embedWrapper
  16122. }
  16123. ,
  16124. n.prototype.load = function(e) {
  16125. var t = function() {
  16126. function e(e) {
  16127. this.playerState = s.CUED,
  16128. this.options.startMuted && this.playerControls.mute()
  16129. }
  16130. function t(e) {
  16131. this.playerState = e
  16132. }
  16133. function i(e) {
  16134. this.playerControls.setCurrentTime(0),
  16135. this.options.loop ? this.playerControls.play() : this.playerControls.pause()
  16136. }
  16137. this.playerControls = new playerjs.Player(this.embedElement),
  16138. this.playerControls.on("ready", e.bind(this)),
  16139. this.playerControls.on("play", t.bind(this, s.PLAYING)),
  16140. this.playerControls.on("pause", t.bind(this, s.PAUSED)),
  16141. this.playerControls.on("ended", i.bind(this))
  16142. }
  16143. .bind(this);
  16144. return o.prototype.load.call(this, e).then(t.bind(this))
  16145. }
  16146. ,
  16147. n.prototype.play = function() {
  16148. var e = r.isMobile();
  16149. return function() {
  16150. this.playerState !== s.NOT_READY && this.playerControls && !e && (this.state === s.CUED && this.options.autoPlay || this.options.autoResume) && this.playerControls.play()
  16151. }
  16152. }(),
  16153. n.prototype.pause = function() {
  16154. this.playerState !== s.NOT_READY && this.playerControls && this.playerControls.pause()
  16155. }
  16156. ,
  16157. t.exports = n
  16158. }
  16159. ).call(this, "/js/tag/Media/EmbedlyPlayer.js")
  16160. }
  16161. , {
  16162. "../../util/browser": 182,
  16163. "../../util/logger": 189,
  16164. "./EmbedlyEmbed": 125
  16165. }],
  16166. 127: [function(e, t, i) {
  16167. (function(i) {
  16168. "use strict";
  16169. function n(e) {
  16170. function t() {
  16171. return a.debug("requesting file from embedly:", e.href),
  16172. r.get(e.href, {
  16173. responseType: e.responseType
  16174. }).then(function(t) {
  16175. return a.debug("requesting file finished:", e.href),
  16176. t
  16177. })
  16178. }
  16179. function i() {}
  16180. return s = new Promise(function(e, n) {
  16181. s.catch(i).then(function() {
  16182. t().then(e, n)
  16183. })
  16184. }
  16185. )
  16186. }
  16187. var r = e("../../util/ajax")
  16188. , o = (e("./mediaSettings"),
  16189. e("../../util/logger"))
  16190. , a = new o(i)
  16191. , s = Promise.resolve();
  16192. t.exports.enqueue = n
  16193. }
  16194. ).call(this, "/js/tag/Media/EmbedlyQueue.js")
  16195. }
  16196. , {
  16197. "../../util/ajax": 181,
  16198. "../../util/logger": 189,
  16199. "./mediaSettings": 132
  16200. }],
  16201. 128: [function(e, t, i) {
  16202. (function(i) {
  16203. "use strict";
  16204. function n() {
  16205. this.imageWrapper = null,
  16206. this.width = 0,
  16207. this.height = 0,
  16208. this.aspect = 1
  16209. }
  16210. var r = e("./MediaEvent")
  16211. , o = e("./EmbedlyQueue")
  16212. , a = e("events").EventEmitter
  16213. , s = e("../../util/logger")
  16214. , l = e("../../settings");
  16215. new s(i);
  16216. n.prototype = Object.create(a.prototype),
  16217. n.prototype.createDomElement = function() {
  16218. return this.imageWrapper = document.createElement("div"),
  16219. this.imageWrapper.classList.add("tag-image"),
  16220. this.imageWrapper.classList.add("hidden"),
  16221. this.imageWrapper.addEventListener("click", function(e) {
  16222. e.stopPropagation(),
  16223. this.emit(r.IMAGE_OPENING),
  16224. this.imageWrapper.style.pointerEvents = "none"
  16225. }
  16226. .bind(this)),
  16227. this.imageWrapper
  16228. }
  16229. ,
  16230. n.prototype.onClosed = function() {
  16231. this.imageWrapper.style.pointerEvents = "auto"
  16232. }
  16233. ,
  16234. n.prototype.load = function(e) {
  16235. var t = Math.max(window.screen.height, window.screen.width)
  16236. , i = "https://i.embed.ly/1/display/resize?key=" + l.appConfig.embedly_key + "&url=" + encodeURIComponent(e) + "&width=" + t + "&height=" + t;
  16237. return new Promise(function(e, t) {
  16238. function n(t) {
  16239. var i = t.target;
  16240. this.width = i.naturalWidth,
  16241. this.height = i.naturalHeight,
  16242. this.aspect = this.width / this.height;
  16243. var n = t.target.src;
  16244. this.imageWrapper.style.backgroundImage = 'url("' + n + '")',
  16245. this.imageWrapper.style.width = this.width + "px",
  16246. this.imageWrapper.style.height = this.height + "px",
  16247. this.imageWrapper.classList.remove("hidden"),
  16248. e()
  16249. }
  16250. o.enqueue({
  16251. href: i,
  16252. responseType: "arraybuffer"
  16253. }).then(function(e) {
  16254. var t = new Uint8Array(e)
  16255. , i = new Blob([t])
  16256. , r = new window.Image;
  16257. r.addEventListener("load", n.bind(this));
  16258. var o = URL.createObjectURL(i);
  16259. r.src = o
  16260. }
  16261. .bind(this), t)
  16262. }
  16263. .bind(this))
  16264. }
  16265. ,
  16266. t.exports = n
  16267. }
  16268. ).call(this, "/js/tag/Media/Image.js")
  16269. }
  16270. , {
  16271. "../../settings": 166,
  16272. "../../util/logger": 189,
  16273. "./EmbedlyQueue": 127,
  16274. "./MediaEvent": 131,
  16275. events: 202
  16276. }],
  16277. 129: [function(e, t, i) {
  16278. "use strict";
  16279. function n(e) {
  16280. this.label = e.label,
  16281. this.href = e.url,
  16282. this.type = this.updateLinkForType(),
  16283. this.domElement = null,
  16284. this.id = c++
  16285. }
  16286. var r = e("./LinkType")
  16287. , o = e("./MediaEvent")
  16288. , a = e("../../util/browser")
  16289. , s = e("../../analytics")
  16290. , l = e("events").EventEmitter
  16291. , c = 0;
  16292. n.prototype = Object.create(l.prototype),
  16293. n.prototype.updateLinkForType = function() {
  16294. function e(e) {
  16295. var t = new RegExp("[#&?]start=([^#&?]*)")
  16296. , i = t.exec(e);
  16297. return i[1]
  16298. }
  16299. function t(e) {
  16300. return e + "&play=1"
  16301. }
  16302. var i = a.valueFromHash("m") || a.valueFromHash("model");
  16303. return this.href.indexOf("port.com/show") !== -1 || this.href.indexOf(window.location.host + "/show") !== -1 ? this.href.indexOf(i) !== -1 && this.href.indexOf("start=") !== -1 ? (this.href = e(this.href),
  16304. r.NAVIGATION) : (this.href = t(this.href),
  16305. r.MODEL) : r.EXT_LINK
  16306. }
  16307. ;
  16308. var h = {};
  16309. n.prototype.createDomElement = function() {
  16310. function e(e) {
  16311. switch (e.stopPropagation(),
  16312. h[this.id] = !0,
  16313. s.trackAlways("click_tag_link", {
  16314. link_type: this.type,
  16315. link_count: c,
  16316. links_clicked: Object.keys(h).length
  16317. }),
  16318. this.type) {
  16319. case r.MODEL:
  16320. window.location.replace(this.href);
  16321. break;
  16322. case r.EXT_LINK:
  16323. window.open(this.href, "_blank")
  16324. }
  16325. this.emit(o.LINK_CLICK, {
  16326. type: this.type,
  16327. url: this.href
  16328. })
  16329. }
  16330. if (this.domElement = document.createElement("a"),
  16331. this.domElement.classList.add("tag-link"),
  16332. this.domElement.textContent = this.label,
  16333. this.type === r.EXT_LINK) {
  16334. this.domElement.textContent += " ";
  16335. var t = document.createElement("i");
  16336. t.classList.add("icon-ext-link"),
  16337. t.title = "Link to external web site",
  16338. this.domElement.appendChild(t)
  16339. }
  16340. return this.domElement.addEventListener("click", e.bind(this)),
  16341. this.domElement
  16342. }
  16343. ,
  16344. t.exports = n
  16345. }
  16346. , {
  16347. "../../analytics": 4,
  16348. "../../util/browser": 182,
  16349. "./LinkType": 130,
  16350. "./MediaEvent": 131,
  16351. events: 202
  16352. }],
  16353. 130: [function(e, t, i) {
  16354. "use strict";
  16355. t.exports = {
  16356. NAVIGATION: "navigation",
  16357. MODEL: "model",
  16358. EXT_LINK: "ext-link"
  16359. }
  16360. }
  16361. , {}],
  16362. 131: [function(e, t, i) {
  16363. "use strict";
  16364. t.exports = Object.freeze({
  16365. LINK_CLICK: "mtmedia.link",
  16366. IMAGE_LOADED: "mtmedia.image.loaded",
  16367. IMAGE_OPENING: "mtmedia.image.opening",
  16368. IMAGE_OPENED: "mtmedia.image.opened",
  16369. IMAGE_CLOSING: "mtmedia.image.closing",
  16370. IMAGE_CLOSED: "mtmedia.image.closed",
  16371. VIDEO_START: "mtmedia.video.start",
  16372. VIDEO_PAUSE: "mtmedia.video.pause",
  16373. VIDEO_ENDED: "mtmedia.video.end"
  16374. })
  16375. }
  16376. , {}],
  16377. 132: [function(e, t, i) {
  16378. "use strict";
  16379. t.exports = Object.freeze({
  16380. maxEmbedWidth: 350,
  16381. defaultAspectRatio: .75
  16382. })
  16383. }
  16384. , {}],
  16385. 133: [function(e, t, i) {
  16386. "use strict";
  16387. t.exports = Object.freeze({
  16388. TEXT: "text",
  16389. LINK: "link",
  16390. IMAGE: "photo",
  16391. VIDEO: "video",
  16392. RICH: "rich"
  16393. })
  16394. }
  16395. , {}],
  16396. 134: [function(e, t, i) {
  16397. "use strict";
  16398. function n(e) {
  16399. this.capabilities = {
  16400. links: {
  16401. enable: e.supportLinks,
  16402. keepLabels: e.keepLinkLabels
  16403. }
  16404. }
  16405. }
  16406. var r = e("./DescriptionChunkType");
  16407. n.prototype.parse = function(e, t) {
  16408. var i = []
  16409. , n = e.split("[").map(function(e, t) {
  16410. return 0 === t ? e : "[" + e
  16411. });
  16412. return n.forEach(function(e) {
  16413. var n = this.findMarkdown(e);
  16414. if (n) {
  16415. if (n.url.indexOf("javascript:") !== -1)
  16416. return;
  16417. this.addLinkChunk(i, n, t),
  16418. this.addTextChunk(i, e.slice(n.markdown.length))
  16419. } else
  16420. this.addTextChunk(i, e)
  16421. }
  16422. .bind(this)),
  16423. i
  16424. }
  16425. ,
  16426. n.prototype.findMarkdown = function(e) {
  16427. var t = /\[([^\]]*)\]\((.*)\)/
  16428. , i = e.match(t);
  16429. if (i) {
  16430. for (var n = i[2], r = 1, o = 0; o < n.length && ("(" === n[o] ? r++ : ")" === n[o] && r--,
  16431. 0 !== r); )
  16432. o++;
  16433. var a = n.length - o;
  16434. return {
  16435. markdown: i[0].substring(0, i[0].length - a),
  16436. label: i[1],
  16437. url: i[2].substring(0, o)
  16438. }
  16439. }
  16440. }
  16441. ,
  16442. n.prototype.addTextChunk = function(e, t) {
  16443. 0 !== t.length && e.push({
  16444. type: r.TEXT,
  16445. text: t
  16446. })
  16447. }
  16448. ,
  16449. n.prototype.addLinkChunk = function(e, t) {
  16450. if (!this.capabilities.links.enable)
  16451. return void (this.capabilities.links.keepLabels && this.addTextChunk(e, t.label));
  16452. var i = {
  16453. label: t.label,
  16454. url: t.url
  16455. };
  16456. i.url.indexOf("://") === -1 && (i.url = "http://" + i.url),
  16457. e.push({
  16458. type: r.LINK,
  16459. link: i
  16460. })
  16461. }
  16462. ,
  16463. t.exports = n
  16464. }
  16465. , {
  16466. "./DescriptionChunkType": 133
  16467. }],
  16468. 135: [function(e, t, i) {
  16469. (function(i) {
  16470. "use strict";
  16471. var n = e("../util/logger")
  16472. , r = new n(i)
  16473. , o = {
  16474. parseIdsFromChunkName: function(e, t) {
  16475. t.floorId = o.parseFloor(e),
  16476. t.roomId = o.parseRoom(e)
  16477. },
  16478. parseFloor: function(e) {
  16479. var t = e.match(/_group([0-9]+)/);
  16480. if (!t)
  16481. return 0;
  16482. try {
  16483. return parseInt(t[1], 10)
  16484. } catch (e) {
  16485. return r.warn('Non-int value "' + t[1] + '" for mesh group, defaulting to floor 0'),
  16486. 0
  16487. }
  16488. },
  16489. parseRoom: function(e) {
  16490. var t = e.match(/_sub([0-9]+)/);
  16491. if (!t)
  16492. return -1;
  16493. try {
  16494. return parseInt(t[1], 10)
  16495. } catch (e) {
  16496. return r.warn('Non-int value "' + t[1] + '" for mesh subgroup, defaulting to subgroup 0'),
  16497. 0
  16498. }
  16499. }
  16500. };
  16501. t.exports = o
  16502. }
  16503. ).call(this, "/js/model/Chunks.js")
  16504. }
  16505. , {
  16506. "../util/logger": 189
  16507. }],
  16508. 136: [function(e, t, i) {
  16509. (function(i) {
  16510. "use strict";
  16511. function n(e) {
  16512. s.call(this),
  16513. this.model = e,
  16514. this.exploded = !1
  16515. }
  16516. var r = e("../objects/Floor")
  16517. , o = (e("../settings"),
  16518. e("../util/logger"))
  16519. , a = e("../util/transitions")
  16520. , s = e("../util/IndexedCollection")
  16521. , l = e("../util/common")
  16522. , c = e("../util/easing");
  16523. new o(i);
  16524. l.inherit(n, s),
  16525. n.prototype.add = function(e) {
  16526. s.prototype.add.call(this, e),
  16527. this.model.add(e)
  16528. }
  16529. ,
  16530. n.prototype.getIndex = function(e) {
  16531. return e.floorIndex
  16532. }
  16533. ,
  16534. n.prototype.build = function() {
  16535. this.list.forEach(function(e) {
  16536. e.build()
  16537. })
  16538. }
  16539. ,
  16540. n.prototype.size = function() {
  16541. return this.length
  16542. }
  16543. ,
  16544. n.prototype.sort = function() {
  16545. s.prototype.sort.call(this, function(e, t) {
  16546. return e.floorIndex - t.floorIndex
  16547. })
  16548. }
  16549. ,
  16550. n.prototype.nextFloor = function(e, t) {
  16551. return this.index[e.floorIndex + t] || null
  16552. }
  16553. ,
  16554. n.prototype.getFloorAtPoint = function(e) {
  16555. for (var t = null, i = 1 / 0, n = 0; n < this.list.length; n++) {
  16556. var r = this.list[n]
  16557. , o = r.distanceToPoint(e);
  16558. (!t || i > o) && (i = o,
  16559. t = r)
  16560. }
  16561. return t
  16562. }
  16563. ,
  16564. n.prototype.getOrMakeFloor = function(e) {
  16565. var t = this.index[e];
  16566. return t || (t = new r(this.model,e),
  16567. this.add(t)),
  16568. t
  16569. }
  16570. ,
  16571. n.prototype.hide = function() {
  16572. this.list.forEach(function(e) {
  16573. e.hide()
  16574. })
  16575. }
  16576. ,
  16577. n.prototype.show = function() {
  16578. this.list.forEach(function(e) {
  16579. e.show()
  16580. })
  16581. }
  16582. ,
  16583. n.prototype.names = function() {
  16584. return this.list.reduce(function(e, t) {
  16585. return e.concat(t.name)
  16586. }, [])
  16587. }
  16588. ,
  16589. n.prototype.toggleExplodeHorizontal = function() {
  16590. function e(e, t) {
  16591. r.copy(e.position),
  16592. e.position.x = i[e.floorIndex] * t,
  16593. e.position.y = 1 * e.floorIndex * t,
  16594. r.sub(e.position).multiplyScalar(-1),
  16595. e.panos.forEach(function(e) {
  16596. e.translate(r)
  16597. })
  16598. }
  16599. var t, i = [], n = 0;
  16600. this.list.forEach(function(e, r, o) {
  16601. t = r > 0 ? Math.max(o[r - 1].boundingBox.max.x - e.boundingBox.min.x, e.boundingBox.size().x / 2) : 0,
  16602. n += t,
  16603. i[r] = n
  16604. }),
  16605. i = i.map(function(e) {
  16606. return e - n / 2
  16607. });
  16608. var r = this.list[0].position.clone();
  16609. this.exploded ? this.list.forEach(function(t) {
  16610. a.start(function(i) {
  16611. e(t, 1 - i)
  16612. }, 1500, null, 0, c.easeOutExpo)
  16613. }) : this.list.forEach(function(t) {
  16614. a.start(function(i) {
  16615. e(t, i)
  16616. }, 1500, null, 0, c.easeOutExpo)
  16617. }),
  16618. this.exploded = !this.exploded
  16619. }
  16620. ,
  16621. n.prototype.toggleExplodeVertical = function() {
  16622. function e(e, i) {
  16623. var n = n.copy(e.position);
  16624. e.position.y = (5 * e.floorIndex - t.y / 2) * i,
  16625. n.sub(e.position).multiplyScalar(-1),
  16626. e.panos.forEach(function(e) {
  16627. e.translate(n)
  16628. })
  16629. }
  16630. var t = this.model.size;
  16631. this.list[0].position.clone();
  16632. this.exploded ? this.list.forEach(function(t) {
  16633. a.start(function(i) {
  16634. e(t, 1 - i)
  16635. }, 1500, null, 0, c.easeOutExpo)
  16636. }) : this.list.forEach(function(t) {
  16637. a.start(function(i) {
  16638. e(t, i)
  16639. }, 1500, null, 0, c.easeOutExpo)
  16640. }),
  16641. this.exploded = !this.exploded
  16642. }
  16643. ,
  16644. t.exports = n
  16645. }
  16646. ).call(this, "/js/model/FloorCollection.js")
  16647. }
  16648. , {
  16649. "../objects/Floor": 146,
  16650. "../settings": 166,
  16651. "../util/IndexedCollection": 175,
  16652. "../util/common": 185,
  16653. "../util/easing": 186,
  16654. "../util/logger": 189,
  16655. "../util/transitions": 195
  16656. }],
  16657. 137: [function(e, t, i) {
  16658. (function(i) {
  16659. "use strict";
  16660. function n() {
  16661. c.call(this)
  16662. }
  16663. var r = e("../settings")
  16664. , o = e("../util/logger")
  16665. , a = e("../enum/Viewmode")
  16666. , s = e("../objects/Snapshot")
  16667. , l = (e("../util/math"),
  16668. e("../util/common"))
  16669. , c = e("../util/IndexedCollection")
  16670. , h = new o(i);
  16671. l.inherit(n, c),
  16672. n.prototype.getImage = function(e) {
  16673. return e && this.index.hasOwnProperty(e) ? this.index[e] : null
  16674. }
  16675. ,
  16676. n.prototype.filterByModesAndReel = function(e, t) {
  16677. for (var i = [], n = 0; n < t.length; n += 1) {
  16678. var r = t[n]
  16679. , o = this.index[r.sid];
  16680. o && i.push(o)
  16681. }
  16682. var s = e[a.DOLLHOUSE]
  16683. , l = e[a.FLOORPLAN];
  16684. i = i.filter(function(e) {
  16685. if (!e.metadata || void 0 === e.metadata.camera_mode)
  16686. return !0;
  16687. var t;
  16688. try {
  16689. t = a.convertWorkshopModeInt(e.metadata.camera_mode)
  16690. } catch (e) {
  16691. return h.debug(e.message),
  16692. !1
  16693. }
  16694. return t === a.PANORAMA || t === a.FLOORPLAN && l || t === a.DOLLHOUSE && s
  16695. }),
  16696. i.length !== this.list.length && h.info("Disallowed " + (this.list.length - i.length) + " highlight images"),
  16697. this.list = i,
  16698. this.reIndex()
  16699. }
  16700. ,
  16701. n.prototype.getHeroLocations = function(e) {
  16702. if (0 === this.list.length)
  16703. return [];
  16704. for (var t = [], i = 1; i < this.list.length; ++i) {
  16705. var o = this.list[i]
  16706. , l = o.thumbnail_signed_src
  16707. , c = o.name;
  16708. if (o.metadata && void 0 !== o.metadata.camera_quaternion) {
  16709. if (!r.show360Views.enabled && o.metadata.scan_id) {
  16710. var h = e.get(o.metadata.scan_id);
  16711. if (h && !h.isAligned())
  16712. continue
  16713. }
  16714. var u = a.convertWorkshopModeInt(o.metadata.camera_mode);
  16715. if (u === a.MESH)
  16716. continue;
  16717. var d = {
  16718. cameraMode: u,
  16719. position: o.metadata.camera_position,
  16720. quaternion: o.metadata.camera_quaternion,
  16721. panoId: o.metadata.scan_id,
  16722. orthoZoom: o.metadata.ortho_zoom,
  16723. floorVisibility: void 0 !== o.metadata.floor_visibility ? o.metadata.floor_visibility.slice(0) : [],
  16724. thumbUrl: g_Prefix + l + "?"+ randomTime().getTime(),
  16725. name: n.filterImageName(c),
  16726. sid: o.sid //xzw add g_tourAudio要用
  16727. }
  16728. , p = new s(d);
  16729. t.push(p)
  16730. }
  16731. }
  16732. return t
  16733. }
  16734. ,
  16735. n.prototype.getIndex = function(e) {
  16736. return e.sid
  16737. }
  16738. ,
  16739. n.filterImageName = function(e) {
  16740. return "" === e || e.match(/^[0-9.]+_[0-9.]+$/) ? null : e
  16741. }
  16742. ,
  16743. t.exports = n
  16744. }
  16745. ).call(this, "/js/model/ImageCollection.js")
  16746. }
  16747. , {
  16748. "../enum/Viewmode": 51,
  16749. "../objects/Snapshot": 153,
  16750. "../settings": 166,
  16751. "../util/IndexedCollection": 175,
  16752. "../util/common": 185,
  16753. "../util/logger": 189,
  16754. "../util/math": 190
  16755. }],
  16756. 138: [function(e, t, i) {
  16757. (function(i) {
  16758. "use strict";
  16759. function n() {
  16760. u.call(this)
  16761. }
  16762. var r = e("../label/Label")
  16763. , o = e("../settings")
  16764. , a = e("../util/logger")
  16765. , s = e("../util/math")
  16766. , l = e("../util/ajax")
  16767. , c = e("./RoomCollection")
  16768. , h = e("../util/common")
  16769. , u = e("../util/IndexedCollection");
  16770. new a(i);
  16771. h.inherit(n, u),
  16772. n.prototype.getIndex = function(e) {
  16773. return e.labelId
  16774. }
  16775. ,
  16776. n.prototype.associateWithRooms = function(e) {
  16777. this.forEach(function(t) {
  16778. e.forEach(function(e) {
  16779. e.roomId === t.roomId && (t.room = e)
  16780. })
  16781. })
  16782. }
  16783. ,
  16784. n.prototype.createFromLabelData = function(e) {
  16785. e.forEach(function(e) {
  16786. var t = n.parseRoomIndexFromWorkshopRoomId(e.roomId);
  16787. t = c.generateRoomId(e.floorId, t);
  16788. var i = new r(e.sid,e.position || e.positions[0],e.text,e.floorId,t);
  16789. i.position = s.convertWorkshopVector(i.position),
  16790. this.add(i),
  16791. i.build()
  16792. }
  16793. .bind(this))
  16794. }
  16795. ,
  16796. n.prototype.load = function(e, t) {
  16797. return l.get(e, {
  16798. responseType: "json",
  16799. auth: t ? o.authorizationHeader : null
  16800. }).done(function(e) {
  16801. var t = [];
  16802. for (var i in e) {
  16803. var n = e[i];
  16804. t.push(n)
  16805. }
  16806. this.createFromLabelData(t)
  16807. }
  16808. .bind(this))
  16809. }
  16810. ,
  16811. n.parseRoomIndexFromWorkshopRoomId = function(e) {
  16812. var t = -1;
  16813. if (e) {
  16814. var i = e.split("_");
  16815. t = parseInt(i[0])
  16816. }
  16817. return t
  16818. }
  16819. ,
  16820. t.exports = n
  16821. }
  16822. ).call(this, "/js/model/LabelCollection.js")
  16823. }
  16824. , {
  16825. "../label/Label": 90,
  16826. "../settings": 166,
  16827. "../util/IndexedCollection": 175,
  16828. "../util/ajax": 181,
  16829. "../util/common": 185,
  16830. "../util/logger": 189,
  16831. "../util/math": 190,
  16832. "./RoomCollection": 141
  16833. }],
  16834. 139: [function(e, t, i) {
  16835. (function(i) {
  16836. "use strict";
  16837. function n(e, t) {
  16838. o.Object3D.call(this),
  16839. this.sid = t.sid,
  16840. this.data = t,
  16841. this.options = e,
  16842. this.urls = new s(e.urlFiles),
  16843. this.isPublic = void 0 !== t.is_public && t.is_public,
  16844. this.images = new _(this),
  16845. this.images.extend(t.images),
  16846. this.heroImage = this.images.getImage(t.icon),
  16847. this.heroLocations = [],
  16848. this.outdoorPanoLocations = [],
  16849. this.floors = new d(this),
  16850. this.floorsEnabled = void 0 === e.floors || e.floors,
  16851. this.changingFloor = !1,
  16852. this.chunks = [],
  16853. this.panos = new A,
  16854. this.colliders = [],
  16855. this.loadPanosPromise = null,
  16856. this.loadMeshTexturesPromise = null,
  16857. this.auxDataPromise = null,
  16858. this.meshTexturesLoaded = !1,
  16859. this.meshTextures = [],
  16860. this.tags = {},
  16861. this.tagsShown = !1,
  16862. this.shouldShowtags = !1,
  16863. this.has360Views = !1,
  16864. this.showingLabels = f.labels.enabled && t.player_options.labels,
  16865. this.supportedModes = {},
  16866. this.supportedModes[c.PANORAMA] = !0,
  16867. this.supportedModes[c.DOLLHOUSE] = !t.player_options || t.player_options.dollhouse && w.valueFromHash("dh", 1),
  16868. this.supportedModes[c.FLOORPLAN] = !t.player_options || t.player_options.floor_plan && w.valueFromHash("dh", 1),
  16869. this.supportedModes[c.TRANSITIONING] = !0,
  16870. this.supportsTiles = this.configureTiling(),
  16871. this.supportsVR = t.is_vr,
  16872. this.mode = c.DOLLHOUSE,
  16873. this.size = null,
  16874. this.center = null,
  16875. this.boundingBox = new o.Box3,
  16876. this.currentFloor = null,
  16877. this.allFloorsVisible = !0,
  16878. this.projectedPano0 = null,
  16879. this.projectedPano1 = null,
  16880. this.floorsEnabled && t.floors && t.floors.indexOf(",") !== -1 && t.floors.split(",").forEach(function(e, t) {
  16881. this.addFloor(new u(this,t,e.trim()))
  16882. }
  16883. .bind(this)),
  16884. this.waitQueue = [],
  16885. this.on("load", function(e) {
  16886. 0 !== this.waitQueue.length && (this.waitQueue = this.waitQueue.filter(function(e) {
  16887. return !e.isLoadedCallback()
  16888. }),
  16889. 0 === this.waitQueue.length && this.emit("waiting-done"))
  16890. }
  16891. .bind(this)),
  16892. this.setupCustomProperties()
  16893. this.hots = {};
  16894. }
  16895. function r() {
  16896. try {
  16897. var e = document.createElement("canvas")
  16898. , t = e.getContext("webgl");
  16899. t || (t = e.getContext("experimental-webgl"));
  16900. var i = t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE);
  16901. return i
  16902. } catch (e) {
  16903. return 0
  16904. }
  16905. }
  16906. var o = e("three")
  16907. , a = e("../util/ajax")
  16908. , s = e("../util/ModelUrls")
  16909. , l = e("../objects/BoundingTextureSkybox")
  16910. , c = e("../enum/Viewmode")
  16911. , h = e("../enum/RenderOrder")
  16912. , u = (e("../enum/AlignmentType"),
  16913. e("../objects/Floor"))
  16914. , d = e("./FloorCollection")
  16915. , p = e("../objects/Chunk")
  16916. , f = (e("../objects/Room"),
  16917. e("../objects/Snapshot"),
  16918. e("../label/Label"),
  16919. e("../util/math"),
  16920. e("../settings"))
  16921. ,ss = e("../shaders")
  16922. , g = e("../util/logger")
  16923. , m = e("../tag/tag")
  16924. , v = (e("../tag/tagManager"),
  16925. e("../objects/Panorama"))
  16926. , A = e("../util/PanoramaCollection")
  16927. , y = e("../loaders/ModelLoader")
  16928. , C = e("../loaders/ModelTextureLoader")
  16929. , I = e("../loaders/SweepDataLoader")
  16930. , E = e("../util/transitions")
  16931. , b = (e("../util/easing"),
  16932. e("../util/lerp"),
  16933. e("../util/common"))
  16934. , w = (e("../util/texture"),
  16935. e("./../util/browser"))
  16936. , _ = e("./ImageCollection")
  16937. , T = e("./RoomCollection")
  16938. , x = e("./LabelCollection")
  16939. , S = e("./Chunks")
  16940. , M = e("./../util/showcase")
  16941. , R = e("../exception/BasicException")
  16942. , P = (e("../constants")
  16943. ,e("events").EventEmitter)
  16944. ,Hot = e("hot")
  16945. , O = new g(i);
  16946. n.prototype = Object.create(o.Object3D.prototype),
  16947. b.extend(n, P),
  16948. n.prototype.setupCustomProperties = function() {
  16949. var e = f.modelAlpha;
  16950. Object.defineProperty(this, "alpha", {
  16951. get: function() {
  16952. return e
  16953. },
  16954. set: function(t) {
  16955. e = t,
  16956. this.chunks.forEach(function(t) {
  16957. t.material && t.material.uniforms.modelAlpha && (t.material.uniforms.modelAlpha.value = e)
  16958. })
  16959. }
  16960. })
  16961. }
  16962. ,
  16963. n.prototype.configureTiling = function() {
  16964. var e = r();
  16965. if (e < 2048)
  16966. return !1;
  16967. O.warn("Max cube texture size: " + e);
  16968. for (var t = 0; t < f.tiling.tilingFlagNames.length; t++) {
  16969. var i = f.tiling.tilingFlagNames[t];
  16970. if ("1" === w.valueFromHash(i, null))
  16971. return !0;
  16972. if ("0" === w.valueFromHash(i, null))
  16973. return !1
  16974. }
  16975. //--------------------------------------------许钟文-------------------------------------------
  16976. return true;
  16977. //return !!M.modelDataPromisesTiles(this.data) 免去访问mdoeldata.json的vision_version,不明白这是什么
  16978. //--------------------------------------------e n d -------------------------------------------
  16979. }
  16980. ,
  16981. n.prototype.toggleAlpha = function() {
  16982. this.alpha < 1 ? this.alpha = 1 : this.alpha = 0
  16983. }
  16984. ,
  16985. n.prototype.load = function(e) {
  16986. var t = function() {
  16987. return $.when(this.loadPanos(), this.loadMesh())
  16988. }
  16989. , i = this.urls.init().then(t.bind(this));
  16990. return e ? i = i.then(this.loadMeshTextures.bind(this)) : i.then(this.loadMeshTextures.bind(this)),
  16991. this.auxDataPromise = $.when( /*this.loadHighlightReel(), this.loadtags() */this.loadhots(), this.loadLabels()),
  16992. $.when(i, this.auxDataPromise).done(this.build.bind(this)) //不要另外使用active_reel文件
  16993. }
  16994. ,
  16995. n.prototype.loadMesh = function() {
  16996. function e(e) {
  16997. O.error(e),
  16998. n.reject("loading-failed")
  16999. }
  17000. function t(e, t) {
  17001. n.notify(e, t)
  17002. }
  17003. function i(e, t) {
  17004. if (0 === e.length) {
  17005. O.warn("No geometry found for model, loading faux geometry, disabling outside mode"),
  17006. r.supportedModes[c.DOLLHOUSE] = !1,
  17007. r.supportedModes[c.FLOORPLAN] = !1;
  17008. var i = new p({
  17009. geometry: new o.PlaneBufferGeometry(5,5,1,1)
  17010. });
  17011. i.material.visible = !1,
  17012. i.rotateX(-Math.PI / 2),
  17013. i.geometry.computeBoundingBox(),
  17014. e = [i]
  17015. }
  17016. e.forEach(function(e) {
  17017. var t = r.floorsEnabled ? S.parseFloor(e.name) : 0;
  17018. r.addChunk(t, e)
  17019. }),
  17020. r.floors.sort(),
  17021. n.resolve(r)
  17022. }
  17023. var n = $.Deferred()
  17024. , r = this;
  17025. return y.load(r.data.job.uuid, r.urls, i, t, e),
  17026. n.promise()
  17027. }
  17028. ,
  17029. n.prototype.loadMeshTextures = function() {
  17030. return this.loadTexturesPromise ? this.loadTexturesPromise : (this.loadTexturesPromise = C.load(this, this.meshTextures).then(function() {
  17031. this.meshTexturesLoaded = !0
  17032. }
  17033. .bind(this)),
  17034. this.loadTexturesPromise)
  17035. }
  17036. ,
  17037. /* n.prototype.loadtags = function() {//xzw改
  17038. var e = $.Deferred();
  17039. if (!f.tags.enabled)
  17040. return e.resolve();
  17041. //var t = this.options.urlBase + "/api/v1/jsonstore/model/tags/" + this.sid;
  17042. t = "data/" + this.sid + "/tags.json"
  17043. return a.get(t, {
  17044. responseType: "json",
  17045. auth: this.isPublic ? null : f.authorizationHeader
  17046. }).done(function(t) {
  17047. var i = 0
  17048. , n = 0;
  17049. for (var r in t) {
  17050. var o = t[r];
  17051. o.enabled && (n++,
  17052. (o.label.length || o.description.length) && (this.tags[r] = new m(this,r,o),
  17053. i++))
  17054. }
  17055. i !== n && O.warn("Disallowed " + (n - i) + " tags with no text data"),
  17056. e.resolve()
  17057. }
  17058. .bind(this)).fail(function() {
  17059. O.warn("Getting tags failed, not displaying tags."),
  17060. e.resolve()
  17061. }),
  17062. e
  17063. } */
  17064. n.prototype.shineHots = function(){ //xzw
  17065. E.trigger({
  17066. func: function(e) {
  17067. if(e<=0.5) ss.hot.uniforms.opac.value = 2*e;
  17068. else ss.hot.uniforms.opac.value = -2*e + 2;
  17069. }.bind(this),
  17070. cycling: true,
  17071. duration: 3000,
  17072. //easing: "easeInOutQuad",
  17073. name: "hotShine"
  17074. })
  17075. },
  17076. n.prototype.audioAutoPlay = function(audio){
  17077. if(!audio) return
  17078. //https://www.cnblogs.com/interdrp/p/4211883.html 部分资料
  17079. audio.load(); // iOS 9 还需要额外的 load 一下, 否则直接 play 无效
  17080. var play = function(){
  17081. audio.play();
  17082. console.log('begin play bgm')
  17083. document.removeEventListener("touchstart",play);
  17084. $('#player')[0].removeEventListener("touchstart", play);
  17085. };
  17086. audio.play();
  17087. document.addEventListener("WeixinJSBridgeReady", function () {
  17088. alert("123");
  17089. audio.play();
  17090. }, false);
  17091. document.addEventListener("touchstart", play);//ios需要加个事件才能播放 不能自动播放;如果还有浏览器不行,换成别的交互事件
  17092. $('#player')[0].addEventListener("touchstart", play);
  17093. audio.addEventListener('ended', function () {
  17094. audio.play();
  17095. });
  17096. }
  17097. n.prototype.loadhots = function() {//xzw
  17098. var e = $.Deferred();
  17099. var t = g_Prefix+"data/" + this.sid + "/data2.js" +'?'+ randomTime().getTime();
  17100. return a.get(t, {
  17101. responseType: "json",
  17102. auth: this.isPublic ? null : f.authorizationHeader
  17103. }).done(function(t) {
  17104. g_data2 = t;
  17105. this.hotsCount = 0;
  17106. for(var i in t.hots){
  17107. this.hotsCount ++;
  17108. this.hots[i] = new Hot(i, t.hots[i], this);
  17109. }
  17110. g_index = w.valueFromHash("m");
  17111. if(t.tourAudio){
  17112. g_tourAudio = new Audio;
  17113. g_tourAudio.loop = false;
  17114. g_tourAudio.addEventListener('ended', function () {
  17115. var ev = document.createEvent("MouseEvent");
  17116. ev.initEvent("tourAudioEnded",true,true);
  17117. window.dispatchEvent(ev);
  17118. });
  17119. }
  17120. if(t.hasBGM){
  17121. g_bgAudio = new Audio;
  17122. g_bgAudio.src = g_Prefix+"audio/"+g_index+"/background.mp3";
  17123. g_bgAudio.loop = true;
  17124. g_bgAudio.autoplay = true;
  17125. g_bgAudio.id = "bgaudio";
  17126. g_playAudio = g_bgAudio;
  17127. this.audioAutoPlay(g_bgAudio)
  17128. }
  17129. /* g_audio=t.audio;
  17130. g_Text=t.texts;
  17131. g_TextShow=t.showText;
  17132. g_weixinTitle=t.weixintitle;
  17133. if("undefined" != typeof(t.roof))
  17134. {
  17135. g_roof=t.roof;
  17136. }
  17137. if("undefined" != typeof(t.dollhouseminDistance))
  17138. {
  17139. I.dollhouseDefault.minDistance=t.dollhouseminDistance;
  17140. } */
  17141. e.resolve()
  17142. }.bind(this)).fail(function() {
  17143. console.log('没有热点')
  17144. e.resolve()
  17145. }),
  17146. e
  17147. }
  17148. ,
  17149. n.prototype.loadPanos = function() {
  17150. if (this.loadPanosPromise)
  17151. return this.loadPanosPromise;
  17152. var e = new I(this);
  17153. return this.loadPanosPromise = e.load().then(function(e) {
  17154. return this.data.sweeps && Object.keys(this.data.sweeps).length > 0 && (e = e.filter(function(e) {
  17155. return this.data.sweeps[e.uuid].enabled
  17156. }
  17157. .bind(this))),
  17158. this.panos.extend(e.map(function(e) {
  17159. return new v(this,e.uuid,e,this.supportsTiles)
  17160. }
  17161. .bind(this))),
  17162. this.panos.forEach(function(e) {
  17163. e.neighbourUUIDs && (e.neighbourUUIDs.forEach(function(t) {
  17164. var i = this.panos.get(t);
  17165. i && this.panos.setNeighbour(e, i, !0)
  17166. }
  17167. .bind(this)),
  17168. e.neighbourPanos = this.panos.getNeighbours(e) || this.panos.setNeighbour(e, e, !0))
  17169. }
  17170. .bind(this)),
  17171. 0 === this.panos.length && (O.warn("Model has no panos, turning off inside mode"),
  17172. this.supportedModes[c.PANORAMA] = !1),
  17173. $.when(this)
  17174. }
  17175. .bind(this)),
  17176. this.loadPanosPromise
  17177. }
  17178. ,
  17179. n.prototype.loadHighlightReel = function() {//xzw
  17180. var e = $.Deferred()
  17181. // , t = this.options.urlBase + "/api/v1/jsonstore/model/highlights/" + this.sid + "/active_reel";
  17182. ,t = this.options.urlBase + "data/" + this.sid + "/active_reel.json";
  17183. return a.get(t, {
  17184. responseType: "json",
  17185. auth: this.isPublic ? null : f.authorizationHeader
  17186. }).done(function(t) {
  17187. t.reel ? (O.info("Got highlight reel with " + t.reel.length + " items"),
  17188. this.images.filterByModesAndReel(this.supportedModes, t.reel)) : O.info("No highlight reel found"),
  17189. e.resolve()
  17190. }
  17191. .bind(this)).fail(function() {
  17192. O.warn("Getting highlight reel failed, no highlights available"),
  17193. e.resolve()
  17194. }),
  17195. e
  17196. }
  17197. ,
  17198. n.prototype.waitForLoad = function(e, t) {
  17199. t() || (this.waitQueue.push({
  17200. object: e,
  17201. isLoadedCallback: t
  17202. }),
  17203. 1 === this.waitQueue.length && this.emit("waiting"))
  17204. }
  17205. ,
  17206. n.prototype.hide = function() {
  17207. this.floors.hide()
  17208. }
  17209. ,
  17210. n.prototype.show = function() {
  17211. this.floors.show()
  17212. }
  17213. ,
  17214. n.prototype.floorNames = function() {
  17215. return this.floors.names()
  17216. }
  17217. ,
  17218. n.prototype.warpDestFloors = function(e, t) {
  17219. if (!e || this.floors.length !== e.length)
  17220. return void this.toggleAllFloors(!0);
  17221. var i = e.findIndex(function(e) {
  17222. return e
  17223. }
  17224. .bind(this));
  17225. i !== -1 && this.setFloor(this.floors.list[i], null, t)
  17226. }
  17227. ,
  17228. n.prototype.setFloor = function(e, t, i) {
  17229. this.allFloorsVisible && this.emit("allfloors.toggled", !1, this.currentFloor),
  17230. this.allFloorsVisible = !1,
  17231. this._setFloor(e, t, i)
  17232. }
  17233. ,
  17234. n.prototype.toggleAllFloors = function(e) {
  17235. this.allFloorsVisible = void 0 !== e ? e : !this.allFloorsVisible,
  17236. this.emit("allfloors.toggled", this.allFloorsVisible, this.currentFloor),
  17237. this._setFloor(this.currentFloor)
  17238. }
  17239. ,
  17240. n.prototype._setFloor = function(e, t, i) {
  17241. t = t || this.mode,
  17242. this.emit("floor.changed", e, t, this.currentFloor),
  17243. this.currentFloor = e;
  17244. var n;
  17245. if (t === c.PANORAMA) {
  17246. if (this.show(),
  17247. this.shouldShowtags && this.tagsShown)
  17248. for (n in this.tags)
  17249. this.tags[n].show(f.showFloorDuration)
  17250. } else if ((t === c.FLOORPLAN || t === c.DOLLHOUSE) && (this.floors.list.forEach(function(e, t) {
  17251. e.toggle(e === this.currentFloor || this.allFloorsVisible, i || this.allFloorsVisible)
  17252. }
  17253. .bind(this)),
  17254. this.shouldShowtags && this.tagsShown))
  17255. for (n in this.tags) {
  17256. var r = this.tags[n];
  17257. this.allFloorsVisible ? r.show(f.showFloorDuration) : r.floor === this.currentFloor ? r.show(f.showFloorDuration, f.showFloorDelay) : r.hide(f.hideFloorDuration, f.hideFloorDelay)
  17258. }
  17259. var o = this
  17260. , a = e;
  17261. E.start(function() {}, f.showFloorDelay, function() {
  17262. o.floors.forEach(function(e) {
  17263. e.chunks.forEach(function(t) {
  17264. t.renderOrder = e === a ? h.visibleFloor : h.ghostFloor
  17265. })
  17266. })
  17267. }
  17268. .bind(this))
  17269. }
  17270. ,
  17271. n.prototype.toggleExplode = function() {
  17272. this.floors.toggleExplodeHorizontal()
  17273. }
  17274. ,
  17275. n.prototype.toggleExplodeUp = function() {
  17276. this.floors.toggleExplodeVertical()
  17277. }
  17278. ,
  17279. n.prototype.nextFloor = function(e) {
  17280. return this.floors.nextFloor(this.currentFloor, e)
  17281. }
  17282. ,
  17283. n.prototype.addFloor = function(e) {
  17284. this.floors.add(e)
  17285. }
  17286. ,
  17287. n.prototype.getFloorAtPoint = function(e) {
  17288. return this.floors.getFloorAtPoint(e)
  17289. }
  17290. ,
  17291. n.prototype.getTagBySid = function(e) {
  17292. return this.tags[e]
  17293. }
  17294. ,
  17295. n.prototype.addChunk = function(e, t) {
  17296. this.floors.getOrMakeFloor(e).addChunk(t),
  17297. this.chunks.push(t)
  17298. }
  17299. ,
  17300. n.prototype.setMode = function(e) {
  17301. if (!this.supportedModes[e])
  17302. throw new R("Mode not supported for this model: " + e);
  17303. this.mode = e,
  17304. this.chunks.forEach(function(t) {
  17305. t.setMode(e)
  17306. })
  17307. }
  17308. ,
  17309. n.prototype.build = function() {
  17310. this.heroLocations = this.images.getHeroLocations(this.panos);
  17311. var e = function() {
  17312. return !!(this.heroImage && this.heroImage.metadata && this.heroImage.metadata.scan_id && this.panos.get(this.heroImage.metadata.scan_id)) && !this.panos.get(this.heroImage.metadata.scan_id).isAligned()
  17313. }
  17314. .bind(this)();
  17315. this.has360Views = f.show360Views.enabled && this.heroLocations.some(function(e) {
  17316. return e.cameraMode === c.PANORAMA && this.panos.get(e.panoId) && !this.panos.get(e.panoId).isAligned()
  17317. }
  17318. .bind(this)) || e,
  17319. null === this.heroImage && O.warn("No hero image defined."),
  17320. this.currentFloor = this.floors.last(),
  17321. this.floors.build(),
  17322. this.colliders = this.floors.reduce(function(e, t) {
  17323. return e.concat(t.collider.children)
  17324. }, []),
  17325. this.panos.forEach(function(e) {
  17326. e.build1(),
  17327. e.on("enter", function() {
  17328. e.floor !== this.currentFloor && this.setFloor(e.floor)
  17329. }
  17330. .bind(this))
  17331. }
  17332. .bind(this)),
  17333. this.panos.forEach(function(e) {
  17334. e.build2()
  17335. }),
  17336. this.floors.forEach(function(e) {
  17337. this.boundingBox.union(e.boundingBox)
  17338. }
  17339. .bind(this)),
  17340. this.size = this.boundingBox.size(),
  17341. this.center = this.boundingBox.center(),
  17342. this.floors.forEach(function(e) {
  17343. O.info("Floor " + e + ": " + e.children.length + " chunks, " + e.panos.length + " panos.")
  17344. }
  17345. .bind(this)),
  17346. this.panos.populate_path_graph(),
  17347. this.skybox = new l(this.boundingBox),
  17348. this.skybox.matrixWorldNeedsUpdate = !0,
  17349. this.add(this.skybox);
  17350. setTimeout(function(){
  17351. this.hotsCount && this.shineHots();
  17352. }.bind(this),1300)//xzw 热点开始闪烁
  17353. for (var t in this.tags)
  17354. this.tags[t].build();
  17355. return O.debug("Done building model"),
  17356. v.raycastsDone > 0 && (O.warn("raycasts: " + v.raycastsDone),
  17357. O.warn("raycasts skipped: " + v.raycastsSkipped)),
  17358. this.buildRooms(),
  17359. this.labels.associateWithRooms(this.rooms),
  17360. $.when(this)
  17361. }
  17362. ,
  17363. n.prototype.loadLabels = function() {//xzw
  17364. this.labels = new x(this);
  17365. var e = $.Deferred();
  17366. if (!this.showingLabels)
  17367. return e.resolve();
  17368. // var t = this.options.urlBase + "/api/v1/jsonstore/model/labels/" + this.sid;
  17369. var t = "data/" + this.sid + "/labels.json";
  17370. return this.labels.load(t, !this.isPublic).done(e.resolve.bind(e)).fail(function() {
  17371. O.warn("Getting labels failed, not displaying labels."),
  17372. e.resolve()
  17373. }),
  17374. e
  17375. }
  17376. ,
  17377. n.prototype.buildRooms = function() {
  17378. this.rooms = new T(this),
  17379. this.rooms.createFromChunks(this.chunks),
  17380. this.rooms.calcRoomBoundaries()
  17381. }
  17382. ,
  17383. n.prototype.updateProjectedPanos = function() {
  17384. this.projectedPano0 && this.projectedPano1 && this.setProjectedPanos(this.projectedPano0, this.projectedPano1, !1)
  17385. }
  17386. ,
  17387. n.prototype.setProjectedPanos = function(e, t, i) {
  17388. void 0 !== i && null !== i || (i = !0),
  17389. i = !!i,
  17390. this.projectedPano0 = e,
  17391. this.projectedPano1 = t,
  17392. this.skybox.material.setProjectedPanos(e, t, i),
  17393. this.chunks.forEach(function(n) {
  17394. n.materialInside.setProjectedPanos(e, t, i)
  17395. })
  17396. }
  17397. ,
  17398. n.prototype.setSide = function(e) {
  17399. this.floors.forEach(function(t) {
  17400. t.collider.material.side = e
  17401. })
  17402. }
  17403. ,
  17404. n.prototype.heroCount = function() {
  17405. return this.heroLocations ? this.heroLocations.length : 0
  17406. }
  17407. ,
  17408. n.prototype.getHeroDescriptorByIndex = function(e) {
  17409. if (e < 0)
  17410. return O.warn("Model.getHeroDescriptorByHeroIndex() -> heroIndex is less than 0."),
  17411. null;
  17412. var t = this.heroCount();
  17413. if (t < 1)
  17414. return O.warn("Model.getHeroDescriptorByIndex() -> No hero locations in this model"),
  17415. null;
  17416. var i = this.heroLocations[e];
  17417. return void 0 === i ? (O.warn("Model.getHeroDescriptorByIndex() -> Index " + e + " is not a validindex"),
  17418. null) : i
  17419. }
  17420. ,
  17421. n.prototype.findPanoramicHero = function() {
  17422. for (var e in this.heroLocations)
  17423. if (this.heroLocations[e].cameraMode === c.PANORAMA)
  17424. return this.heroLocations[e];
  17425. return null
  17426. }
  17427. ,
  17428. n.prototype.listImagePanos = function() {
  17429. var e = []
  17430. , t = this;
  17431. return this.images.forEach(function(i) {
  17432. if (i.metadata && i.metadata.scan_id) {
  17433. var n = t.panos.get(i.metadata.scan_id);
  17434. n && (t.supportsTiles || n.isLoaded("high") || e.push(n))
  17435. }
  17436. }),
  17437. e
  17438. }
  17439. ,
  17440. n.prototype.fadePanoMarkers = function(e, t) {
  17441. this.panos.fadeMarkerOpacity(e, t)
  17442. }
  17443. ,
  17444. n.prototype.setSweepVisibility = function(e) {
  17445. this.panos.forEach(function(t) {
  17446. t.marker && (t.marker.visible = e)
  17447. })
  17448. }
  17449. ,
  17450. n.prototype.outsideAllowed = function() {
  17451. return this.supportedModes[c.DOLLHOUSE] && this.supportedModes[c.FLOORPLAN]
  17452. }
  17453. ,
  17454. t.exports = n
  17455. }
  17456. ).call(this, "/js/model/Model.js")
  17457. }
  17458. , {
  17459. "../constants": 8,
  17460. "../enum/AlignmentType": 17,
  17461. "../enum/RenderOrder": 42,
  17462. "../enum/Viewmode": 51,
  17463. "../exception/BasicException": 55,
  17464. "../label/Label": 90,
  17465. "../loaders/ModelLoader": 105,
  17466. "../loaders/ModelTextureLoader": 106,
  17467. "../loaders/SweepDataLoader": 107,
  17468. "../tag/tag": 123,
  17469. "../tag/tagManager": 124,
  17470. "../objects/BoundingTextureSkybox": 143,
  17471. "../objects/Chunk": 144,
  17472. "../objects/Floor": 146,
  17473. "../objects/Panorama": 148,
  17474. "../objects/Room": 150,
  17475. "../objects/Snapshot": 153,
  17476. "../settings": 166,
  17477. "../shaders": 167,
  17478. "../util/ModelUrls": 177,
  17479. "../util/PanoramaCollection": 178,
  17480. "../util/ajax": 181,
  17481. "../util/common": 185,
  17482. "../util/easing": 186,
  17483. "../util/lerp": 188,
  17484. "../util/logger": 189,
  17485. "../util/math": 190,
  17486. "../util/texture": 194,
  17487. "../util/transitions": 195,
  17488. "./../util/browser": 182,
  17489. "./../util/showcase": 193,
  17490. "./Chunks": 135,
  17491. "./FloorCollection": 136,
  17492. "./ImageCollection": 137,
  17493. "./LabelCollection": 138,
  17494. "./RoomCollection": 141,
  17495. events: 202,
  17496. three: 217,
  17497. "hot": "hot"
  17498. }],
  17499. 140: [function(e, t, i) {
  17500. "use strict";
  17501. function n() {
  17502. this.modelMap = {},
  17503. this.activeModel = null,
  17504. this.modelCount = 0,
  17505. this.tileDownloader = null,
  17506. this.panoRenderer = null
  17507. }
  17508. var r = (e("three"),
  17509. e("../util/common"))
  17510. , o = e("../exception/BasicException")
  17511. , a = e("../enum/ModelManagerEvents")
  17512. , s = e("../enum/PanoRendererEvents")
  17513. , l = e("events").EventEmitter;
  17514. n.prototype.init = function(e, t, i) {
  17515. this.tileDownloader = e,
  17516. this.panoRenderer = t,
  17517. this.qualityManager = i,
  17518. this.bindEvents()
  17519. }
  17520. ,
  17521. n.prototype.bindEvents = function() {
  17522. this.panoRenderer.on(s.TileRenderSuccess, this.onTileRendered.bind(this))
  17523. }
  17524. ,
  17525. n.prototype.onTileRendered = function(e, t, i, n) {}
  17526. ,
  17527. n.prototype.addModel = function(e) {
  17528. this.modelMap[e.sid] = e,
  17529. 0 === this.modelCount && this.activateModel(e.sid),
  17530. this.modelCount++,
  17531. this.emit(a.ModelAdded)
  17532. }
  17533. ,
  17534. n.prototype.getModel = function(e) {
  17535. return this.modelMap[e]
  17536. }
  17537. ,
  17538. n.prototype.activateModel = function(e) {
  17539. var t = this.modelMap[e];
  17540. if (!t)
  17541. throw new o("Tried to activate invalid model!");
  17542. var i = this.activeModel;
  17543. this.activeModel = t,
  17544. this.tileDownloader.setPanoData(t.panos, t.listImagePanos(), t.sid),
  17545. this.tileDownloader.setUrls(t.urls),
  17546. t.panos.forEach(function(e) {
  17547. e.attachToPanoRenderer(this.panoRenderer),
  17548. e.tileDownloader = this.tileDownloader,
  17549. e.qualityManager = this.qualityManager
  17550. }
  17551. .bind(this)),
  17552. this.emit(a.ActiveModelChanged, {
  17553. oldModel: i,
  17554. model: t
  17555. })
  17556. }
  17557. ,
  17558. n.prototype.getActiveModel = function() {
  17559. return this.activeModel
  17560. }
  17561. ,
  17562. r.extend(n, l),
  17563. t.exports = n
  17564. }
  17565. , {
  17566. "../enum/ModelManagerEvents": 33,
  17567. "../enum/PanoRendererEvents": 35,
  17568. "../exception/BasicException": 55,
  17569. "../util/common": 185,
  17570. events: 202,
  17571. three: 217
  17572. }],
  17573. 141: [function(e, t, i) {
  17574. (function(i) {
  17575. "use strict";
  17576. function n() {
  17577. s.call(this)
  17578. }
  17579. var r = e("../objects/Room")
  17580. , o = (e("../settings"),
  17581. e("../util/logger"))
  17582. , a = (e("../util/transitions"),
  17583. e("../util/easing"),
  17584. e("../util/common"))
  17585. , s = e("../util/IndexedCollection")
  17586. , l = e("./Chunks");
  17587. new o(i);
  17588. a.inherit(n, s),
  17589. n.prototype.getIndex = function(e) {
  17590. return e.roomId
  17591. }
  17592. ,
  17593. n.prototype.calcRoomBoundaries = function() {
  17594. this.forEach(function(e) {
  17595. e.calcBoundaries()
  17596. })
  17597. }
  17598. ,
  17599. n.prototype.createFromChunks = function(e) {
  17600. var t = {
  17601. floorId: -1,
  17602. roomId: -1
  17603. }
  17604. , i = {};
  17605. e.forEach(function(e) {
  17606. l.parseIdsFromChunkName(e.name, t);
  17607. var o = i[t.roomId];
  17608. if (!o) {
  17609. var a = n.generateRoomId(t.floorId, t.roomId);
  17610. o = new r(t.floorId,a),
  17611. this.add(o),
  17612. i[t.roomId] = o
  17613. }
  17614. o.addChunk(e)
  17615. }
  17616. .bind(this)),
  17617. this.calcRoomBoundaries()
  17618. }
  17619. ,
  17620. n.generateRoomId = function(e, t) {
  17621. return e + "_" + t
  17622. }
  17623. ,
  17624. t.exports = n
  17625. }
  17626. ).call(this, "/js/model/RoomCollection.js")
  17627. }
  17628. , {
  17629. "../objects/Room": 150,
  17630. "../settings": 166,
  17631. "../util/IndexedCollection": 175,
  17632. "../util/common": 185,
  17633. "../util/easing": 186,
  17634. "../util/logger": 189,
  17635. "../util/transitions": 195,
  17636. "./Chunks": 135
  17637. }],
  17638. 142: [function(e, t, i) {
  17639. "use strict";
  17640. function n(e, t, i) {
  17641. e = e.clone();
  17642. var n = e.size()
  17643. , o = new r.BoxGeometry(n.x,n.y,n.z);
  17644. o.boundingBox = e,
  17645. r.Mesh.call(this, o, t),
  17646. this.position.copy(e.center()),
  17647. this.frustumCulled = !1,
  17648. i && this.add(new r.WireframeHelper(this))
  17649. }
  17650. var r = e("three");
  17651. n.prototype = Object.create(r.Mesh.prototype),
  17652. n.prototype.constructor = n,
  17653. t.exports = n
  17654. }
  17655. , {
  17656. three: 217
  17657. }],
  17658. 143: [function(e, t, i) {
  17659. (function(i) {
  17660. "use strict";
  17661. function n(e) {
  17662. h.time("Computing a nice bounding cubemap");
  17663. var t = new a({
  17664. side: r.BackSide,
  17665. transparent: !0
  17666. });
  17667. t.uniforms.modelAlpha.value = 0,
  17668. t.uniforms.opacity.value = 1 - s.modelAlpha,
  17669. this.renderOrder = l.boundingSkybox,
  17670. o.call(this, e, t),
  17671. h.timeEnd("Computing a nice bounding cubemap")
  17672. }
  17673. var r = e("three")
  17674. , o = (e("../enum/Viewmode"),
  17675. e("../shaders"),
  17676. e("./BoundingMesh"))
  17677. , a = e("../materials/ModelTextureMaterial")
  17678. , s = e("../settings")
  17679. , l = e("../enum/RenderOrder")
  17680. , c = e("../util/logger")
  17681. , h = new c(i);
  17682. n.prototype = Object.create(o.prototype),
  17683. n.prototype.constructor = n,
  17684. t.exports = n
  17685. }
  17686. ).call(this, "/js/objects/BoundingTextureSkybox.js")
  17687. }
  17688. , {
  17689. "../enum/RenderOrder": 42,
  17690. "../enum/Viewmode": 51,
  17691. "../materials/ModelTextureMaterial": 118,
  17692. "../settings": 166,
  17693. "../shaders": 167,
  17694. "../util/logger": 189,
  17695. "./BoundingMesh": 142,
  17696. three: 217
  17697. }],
  17698. 144: [function(e, t, i) {
  17699. "use strict";
  17700. function n(e) {
  17701. this.materialInside = new s({
  17702. side: r.DoubleSide
  17703. });
  17704. var t = r.UniformsUtils.clone(o.modelOutside.uniforms);
  17705. this.materialOutside = new r.RawShaderMaterial({
  17706. fragmentShader: o.modelOutside.fragmentShader,
  17707. vertexShader: o.modelOutside.vertexShader,
  17708. uniforms: t,
  17709. side: r.FrontSide,
  17710. name: "chunkOut"
  17711. }),
  17712. r.Mesh.call(this, e.geometry, this.materialInside),
  17713. this.name = e.name || "",
  17714. this.textureName = e.textureName,
  17715. this.meshUrl = e.meshUrl
  17716. }
  17717. var r = e("three")
  17718. , o = e("../shaders")
  17719. , a = e("../enum/Viewmode")
  17720. , s = e("../materials/ModelTextureMaterial");
  17721. n.prototype = Object.create(r.Mesh.prototype),
  17722. n.prototype.setTextureMap = function(e) {
  17723. this.materialInside.uniforms.map.value = e,
  17724. this.materialOutside.uniforms.map.value = e
  17725. }
  17726. ,
  17727. n.prototype.setMode = function(e) {
  17728. var t = e === a.DOLLHOUSE || e === a.FLOORPLAN ? this.materialOutside : this.materialInside;
  17729. t.side = e === a.PANORAMA ? r.DoubleSide : r.FrontSide,
  17730. t.transparent = this.material.transparent,
  17731. t.uniforms.opacity.value = this.material.uniforms.opacity.value,
  17732. this.material = t
  17733. }
  17734. ,
  17735. t.exports = n
  17736. }
  17737. , {
  17738. "../enum/Viewmode": 51,
  17739. "../materials/ModelTextureMaterial": 118,
  17740. "../shaders": 167,
  17741. three: 217
  17742. }],
  17743. 145: [function(e, t, i) {
  17744. "use strict";
  17745. function n(e) {
  17746. this.chunksize = e || 10,
  17747. this.chunks = {},
  17748. this.boundingBoxes = {},
  17749. this.children = [],
  17750. this.offset = new r.Vector3(0,.5,0),
  17751. this.material = new r.MeshBasicMaterial({
  17752. color: 16777215 * Math.random(),
  17753. side: r.DoubleSide
  17754. })
  17755. }
  17756. var r = e("three");
  17757. e("../enum/Viewmode");
  17758. n.prototype.add = function(e) {
  17759. var t, i, n, o, a, s, l, c, h, u, d, p, f, g, m = e.attributes;
  17760. m ? (t = m.position.array,
  17761. i = void 0 !== e.index ? e.index.array : void 0) : (t = e.vertices,
  17762. n = e.faces);
  17763. var v = new r.Vector3;
  17764. if (i)
  17765. for (o = 0,
  17766. a = i.length; o < a; o += 3) {
  17767. var A = 3 * i[o]
  17768. , y = 3 * i[o + 1]
  17769. , C = 3 * i[o + 2];
  17770. s = (t[A] + t[y] + t[C]) / 3,
  17771. l = (t[A + 1] + t[y + 1] + t[C + 1]) / 3,
  17772. c = (t[A + 2] + t[y + 2] + t[C + 2]) / 3,
  17773. h = Math.floor(s / this.chunksize),
  17774. u = Math.floor(l / this.chunksize),
  17775. d = Math.floor(c / this.chunksize),
  17776. p = h + "." + u + "." + d,
  17777. p in this.chunks ? (g = this.chunks[p],
  17778. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17779. f = this.boundingBoxes[p] = new r.Box3),
  17780. 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]),
  17781. f.expandByPoint(v.set(t[A], t[A + 1], t[A + 2])),
  17782. f.expandByPoint(v.set(t[y], t[y + 1], t[y + 2])),
  17783. f.expandByPoint(v.set(t[C], t[C + 1], t[C + 2]))
  17784. }
  17785. else
  17786. for (o = 0,
  17787. a = t.length; o < a; o += 9)
  17788. s = (t[o] + t[o + 3] + t[o + 6]) / 3,
  17789. l = (t[o + 1] + t[o + 4] + t[o + 7]) / 3,
  17790. c = (t[o + 2] + t[o + 5] + t[o + 8]) / 3,
  17791. h = Math.floor(s / this.chunksize),
  17792. u = Math.floor(l / this.chunksize),
  17793. d = Math.floor(c / this.chunksize),
  17794. p = h + "." + u + "." + d,
  17795. p in this.chunks ? (g = this.chunks[p],
  17796. f = this.boundingBoxes[p]) : (g = this.chunks[p] = [],
  17797. f = this.boundingBoxes[p] = new r.Box3),
  17798. 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]),
  17799. f.expandByPoint(v.set(t[o], t[o + 1], t[o + 2])),
  17800. f.expandByPoint(v.set(t[o + 3], t[o + 4], t[o + 5])),
  17801. f.expandByPoint(v.set(t[o + 6], t[o + 7], t[o + 8]))
  17802. }
  17803. ,
  17804. n.prototype.build = function() {
  17805. var e = new r.Object3D;
  17806. e.material = this.material;
  17807. for (var t in this.chunks) {
  17808. var i = this.chunks[t]
  17809. , n = new r.BufferGeometry;
  17810. n.addAttribute("position", new r.BufferAttribute(new Float32Array(i),3)),
  17811. n.boundingBox = this.boundingBoxes[t];
  17812. var o = new r.Mesh(n,this.material);
  17813. o.material.visible = !1,
  17814. e.add(o),
  17815. this.chunks[t] = []
  17816. }
  17817. return e
  17818. }
  17819. ,
  17820. t.exports = n
  17821. }
  17822. , {
  17823. "../enum/Viewmode": 51,
  17824. three: 217
  17825. }],
  17826. 146: [function(e, t, i) {
  17827. "use strict";
  17828. function n(e, t, i) {
  17829. r.Object3D.call(this),
  17830. this.model = e,
  17831. this.floorIndex = t,
  17832. this.name = i || d.FLOOR_NAME + (t + 1),
  17833. this.panos = [],
  17834. this.chunks = [],
  17835. this.colliderBuilder = new l(3),
  17836. this.collider = null,
  17837. this.center = null,
  17838. this.boundingBox = new r.Box3,
  17839. this.size = null,
  17840. this.hidden = !1,
  17841. this.conservativeBoundingBox = new r.Box3,
  17842. this.debugColor = 16777215 * Math.random(),
  17843. this.transition = null
  17844. }
  17845. var r = e("three")
  17846. , o = e("../settings")
  17847. , a = e("../util/common")
  17848. , s = e("../util/lerp")
  17849. , l = e("./ChunkedCollider")
  17850. , c = e("../util/transitions")
  17851. , h = e("../util/easing")
  17852. , u = (e("../objects/Panorama"),
  17853. e("../enum/RenderOrder"))
  17854. , d = e("../localization/localize");
  17855. n.prototype = Object.create(r.Object3D.prototype),
  17856. n.prototype.enter = function(e) {
  17857. this.model.setFloor(this, e)
  17858. }
  17859. ,
  17860. n.prototype.hide = function(e) {
  17861. if (!this.hidden || this.transition) {
  17862. this.chunks.forEach(function(e) {
  17863. e.material.transparent = !0
  17864. }),
  17865. c.cancel(this.transition);
  17866. var t = e ? 0 : o.hideFloorDuration + o.hideFloorDelay
  17867. , i = e ? 0 : o.hideFloorDelay / t;
  17868. this.transition = c.start(s.allUniforms(this.chunks, "opacity", .08), t, function() {
  17869. this.hidden = !0
  17870. }
  17871. .bind(this), i, h.easeInOutQuad)
  17872. }
  17873. }
  17874. ,
  17875. n.prototype.show = function(e) {
  17876. if (this.hidden || this.transition) {
  17877. this.hidden = !1,
  17878. c.cancel(this.transition);
  17879. var t = e ? o.showFloorDuration : o.showFloorDuration + o.showFloorDelay
  17880. , i = e ? 0 : o.showFloorDelay / t;
  17881. this.transition = c.start(s.allUniforms(this.chunks, "opacity", 1), t, function() {
  17882. this.hidden || this.chunks.forEach(function(e) {
  17883. e.material.transparent = !1
  17884. })
  17885. }
  17886. .bind(this), i, h.easeInOutQuad)
  17887. }
  17888. }
  17889. ,
  17890. n.prototype.toggle = function(e, t) {
  17891. e = void 0 === e ? this.hidden : e,
  17892. e ? this.show(t) : this.hide(t)
  17893. }
  17894. ,
  17895. n.prototype.containsPoint = function(e) {
  17896. return this.collider.children.some(function(t) {
  17897. return t.geometry.boundingBox || t.geometry.computeBoundingBox(),
  17898. t.geometry.boundingBox.containsPoint(e)
  17899. })
  17900. }
  17901. ,
  17902. n.prototype.distanceToPoint = function(e) {
  17903. var t = null
  17904. , i = 1 / 0;
  17905. return this.collider.children.forEach(function(n) {
  17906. n.geometry.boundingBox || n.geometry.computeBoundingBox();
  17907. var r = n.geometry.boundingBox.distanceToPoint(e);
  17908. (!t || i > r) && (i = r,
  17909. t = n)
  17910. }),
  17911. i
  17912. }
  17913. ,
  17914. n.prototype.addChunk = function(e) {
  17915. e.renderOrder = u.ghostFloor,
  17916. this.add(e),
  17917. this.chunks.push(e),
  17918. this.boundingBox.union(e.geometry.boundingBox),
  17919. this.size = this.boundingBox.size(),
  17920. this.colliderBuilder.add(e.geometry)
  17921. }
  17922. ,
  17923. n.prototype.addPano = function(e) {
  17924. this.panos.push(e),
  17925. this.add(e.skyboxMesh),
  17926. e.marker && this.add(e.marker);
  17927. var t = new r.Vector3(1,1,1)
  17928. , i = (new r.Box3).setFromCenterAndSize(e.position, t);
  17929. this.boundingBox.union(i)
  17930. }
  17931. ,
  17932. n.prototype.build = function() {
  17933. this.collider = this.colliderBuilder.build(!0),
  17934. this.add(this.collider),
  17935. this.center = this.boundingBox.center(),
  17936. this.conservativeBoundingBox.copy(this.boundingBox),
  17937. this.conservativeBoundingBox.min.y = a.lowerMedian(this.collider.children.map(function(e) {
  17938. return e.geometry.boundingBox.min.y
  17939. }), 5),
  17940. this.conservativeBoundingBox.max.y = a.lowerMedian(this.collider.children.map(function(e) {
  17941. return e.geometry.boundingBox.max.y
  17942. }), 5),
  17943. this.colliderBuilder = null
  17944. }
  17945. ,
  17946. n.prototype.toShortString = function() {
  17947. return a.nth(this.floorIndex + 1)
  17948. }
  17949. ,
  17950. n.prototype.toString = function() {
  17951. return this.name
  17952. }
  17953. ,
  17954. t.exports = n
  17955. }
  17956. , {
  17957. "../enum/RenderOrder": 42,
  17958. "../localization/localize": 108,
  17959. "../objects/Panorama": 148,
  17960. "../settings": 166,
  17961. "../util/common": 185,
  17962. "../util/easing": 186,
  17963. "../util/lerp": 188,
  17964. "../util/transitions": 195,
  17965. "./ChunkedCollider": 145,
  17966. three: 217
  17967. }],
  17968. 147: [function(e, t, i) {
  17969. "use strict";
  17970. function n(e) {
  17971. this.player = e,
  17972. this.obj3d = null,
  17973. this.UP = new r.Vector3(0,1,0)
  17974. }
  17975. var r = e("three")
  17976. , o = e("../settings");
  17977. n.prototype.prefs = {
  17978. linewidth: 3,
  17979. height: .07,
  17980. opacity: .45,
  17981. endScale: .05
  17982. },
  17983. n.prototype.discard = function() {
  17984. if (this.obj3d) {
  17985. var e = this.obj3d.parent;
  17986. e && e.remove(this.obj3d)
  17987. }
  17988. this.obj3d = null
  17989. }
  17990. ,
  17991. n.prototype.draw = function() {
  17992. if (this.discard(),
  17993. o.showNeighbors) {
  17994. var e = this.player.currentPano.floor;
  17995. this.obj3d = new r.Object3D;
  17996. var t = this.player.model.panos.getNeighbours(this.player.currentPano)
  17997. , i = this.player.currentPano.floorPosition.clone().sub(this.player.model.position);
  17998. i.y += this.prefs.height;
  17999. var n = .1525
  18000. , a = .127
  18001. , s = .0127
  18002. , l = .1
  18003. , c = .19
  18004. , h = .2032
  18005. , u = .2286
  18006. , d = .255
  18007. , p = new r.Matrix4;
  18008. for (var f in t)
  18009. if (t[f]) {
  18010. var g = this.player.model.panos.get(f)
  18011. , m = (g.position.clone().sub(this.player.model.position),
  18012. g.position.clone().sub(g.floorPosition))
  18013. , v = g.floorPosition.clone().sub(this.player.model.position);
  18014. v.y += this.prefs.height;
  18015. var A = new r.Geometry;
  18016. 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)),
  18017. A.vertices.push(new r.Vector3(0,-d,0), new r.Vector3(d,-d,0), new r.Vector3(d,n,0), new r.Vector3(-n,n,0), new r.Vector3(-n,a,0), new r.Vector3(-c,l,0), new r.Vector3(-c,-h,0), new r.Vector3(-n,-u,0), new r.Vector3(-n,-d,0), new r.Vector3(0,-d,0)),
  18018. p.identity().setPosition(m),
  18019. A.applyMatrix(p),
  18020. A.vertices.push(new r.Vector3(0,-this.prefs.endScale,0)),
  18021. A.vertices.push(new r.Vector3(-this.prefs.endScale,-this.prefs.endScale,0), new r.Vector3(-this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,this.prefs.endScale,0), new r.Vector3(this.prefs.endScale,-this.prefs.endScale,0)),
  18022. p.lookAt(v, i, this.UP).setPosition(v),
  18023. A.applyMatrix(p),
  18024. A.vertices.push(v, i);
  18025. var y = new r.Line(A,new r.LineBasicMaterial({
  18026. color: g.debugColor.getHex(),
  18027. transparent: !0,
  18028. opacity: this.prefs.opacity,
  18029. depthWrite: !1,
  18030. name: "sLine" + f,
  18031. linewidth: this.prefs.linewidth
  18032. }));
  18033. this.obj3d.add(y)
  18034. }
  18035. e.add(this.obj3d)
  18036. }
  18037. }
  18038. ,
  18039. n.prototype.update = function() {
  18040. o.showNeighbors && this.obj3d && this.obj3d.updateMatrixWorld()
  18041. }
  18042. ,
  18043. t.exports = n
  18044. }
  18045. , {
  18046. "../settings": 166,
  18047. three: 217
  18048. }],
  18049. 148: [function(e, t, i) {
  18050. (function(i) {
  18051. "use strict";
  18052. function n(e, t, i, n) {
  18053. this.model = e,
  18054. this.id = t,
  18055. this.alignmentType = i.alignmentType || l.ALIGNED,
  18056. this.neighbourUUIDs = i.neighbours || null,
  18057. this.neighbourPanos = null,
  18058. this.floor = null,
  18059. this.floorIndex = i.floor,
  18060. this.failedLoadingAt = 0,
  18061. this.maxLoadRetries = 4,
  18062. this.origin = i.position.clone(),
  18063. this.position = this.alignmentType === l.UNALIGNED ? new r.Vector3(0,-5,0) : i.position.clone(),
  18064. this.quaternion = i.quaternion.clone(),
  18065. this.skyboxMesh = new r.Mesh(E),
  18066. this.skyboxMesh.position.copy(this.position),
  18067. this.skyboxMesh.quaternion.copy(this.quaternion),
  18068. this.skyboxMesh.name = "skybox",
  18069. this.skyboxMesh.visible = !1,
  18070. this.skyboxMesh.updateMatrix(),
  18071. this.skyboxMesh.updateMatrixWorld(),
  18072. this.marker = null,
  18073. this.isAligned() && (this.marker = new r.Mesh(b,new r.MeshBasicMaterial({
  18074. map: w,
  18075. side: r.DoubleSide,
  18076. opacity: 0,
  18077. transparent: !0,
  18078. depthWrite: !1
  18079. })),
  18080. this.marker.renderOrder = s.panoMarker,
  18081. this.marker.name = "marker",
  18082. this.marker.pano = this,
  18083. this.marker.layers.set(v.PANOMARKERS),
  18084. this.marker.updateMatrixWorld(),
  18085. a.colorMarkerOnLoad && this.on("load", function() {
  18086. this.marker.material.color.set(65280)
  18087. })),
  18088. this.debugColor = (new r.Color).setHSL(.06 + .53 * Math.random(), .8 + .2 * Math.random(), .5 + .2 * Math.random()),
  18089. this.floorPosition = i.puck ? i.puck.clone() : null,
  18090. this.tiled = n,
  18091. this.tiled ? this.solidSkybox = null : (this.solidSkybox = new r.Texture([null, null, null, null, null, null]),
  18092. this.solidSkybox.flipY = !1,
  18093. a.minimalMemoryMode && (this.solidSkybox.minFilter = r.LinearFilter,
  18094. this.solidSkybox.magFilter = r.LinearFilter,
  18095. this.solidSkybox.generateMipmaps = !1)),
  18096. this.zoomed = !1,
  18097. this.panoRenderer = null,
  18098. this.qualityManager = null,
  18099. this.tileDownloader = null,
  18100. this.tiledPanoRenderTarget = null,
  18101. this.minimumTiledPanoLoaded = !1,
  18102. this.highestPartialTileRenderOpCompleted = 0,
  18103. this.highestFullTileRenderOpCompleted = 0,
  18104. this.shouldRedrawOnBaseLoaded = !1,
  18105. this.lockUntilRenderingComplete = !1,
  18106. a.colorMarkerOnLoad && this.on("load", function() {
  18107. this.marker.material.color.set(65280)
  18108. })
  18109. }
  18110. var r = e("three")
  18111. , o = e("../util/logger")
  18112. , a = e("../settings")
  18113. , s = (e("../enum/Viewmode"),
  18114. e("../enum/RenderOrder"))
  18115. , l = e("../enum/AlignmentType")
  18116. , c = (e("../util/common"),
  18117. e("../util/transitions"))
  18118. , h = e("../util/lerp")
  18119. , u = e("../util/ajax")
  18120. , d = e("../util/texture")
  18121. , p = e("../util/panorama")
  18122. , f = (e("../enum/TileDownloaderEvents"),
  18123. e("../enum/PanoramaEvents"))
  18124. , g = e("../enum/PanoRendererEvents")
  18125. , m = e("../enum/PanoSizeClass")
  18126. , v = e("../enum/RenderLayers")
  18127. , A = (e("../scene/SceneRenderer"),
  18128. e("../enum/GLCubeFaces"),
  18129. e("../exception/BasicException"))
  18130. , y = e("../tile/TileUtils")
  18131. , C = e("events").EventEmitter
  18132. , I = new o(i)
  18133. , E = new r.SphereBufferGeometry(.1)
  18134. , b = new r.PlaneBufferGeometry(.4,.4,1,1)
  18135. , w = d.load("./images/marker-256x256.png");
  18136. n.prototype = Object.create(C.prototype),
  18137. n.prototype.enter = function() {
  18138. var e = null;
  18139. return function() {
  18140. this.setZoomed(!1),
  18141. this.emit("enter", {
  18142. oldPano: e,
  18143. newPano: this
  18144. }),
  18145. e = this
  18146. }
  18147. }(),
  18148. n.prototype.exit = function() {
  18149. this.tiled ? (this.clearWaitDeferreds(),
  18150. this.minimumTiledPanoLoaded = !1,
  18151. this.tiledPanoRenderTarget = null,
  18152. this.setZoomed(!1),
  18153. this.panoRenderer.deactivateTiledPano(this),
  18154. this.highestPartialTileRenderOpCompleted = 0,
  18155. this.highestFullTileRenderOpCompleted = 0) : (this.solidSkybox.dispose(),
  18156. this.solidSkybox.loaded = !1,
  18157. this.solidSkybox.version = 0),
  18158. this.emit("exit")
  18159. }
  18160. ,
  18161. n.prototype.hoverOn = function(e) {
  18162. this.marker && (c.start(h.property(this.marker.material, "opacity", a[e].markerOpacityOnHover), 250),
  18163. a.navigation.panoScores & a.navigation.mouseDirection && this.addTextSprite("HIT", 12525854))
  18164. }
  18165. ,
  18166. n.prototype.hoverOff = function(e) {
  18167. this.marker && c.start(h.property(this.marker.material, "opacity", a[e].markerOpacity), 250)
  18168. }
  18169. ,
  18170. n.prototype.build1 = function() {
  18171. this.floor = this.floor || this.model.floors.get(this.floorIndex) || this.raycastToFindFloor() || this.model.getFloorAtPoint(this.position),
  18172. this.floor.addPano(this),
  18173. this.floorPosition = this.floorPosition || this.raycastFloorPosition(),
  18174. this.neighbourPanos = this.neighbourPanos || this.findNeighourPanos(),
  18175. a.colorMarkerByFloor && this.marker && this.marker.material.color.set(this.floor.debugColor)
  18176. }
  18177. ,
  18178. n.prototype.build2 = function() {
  18179. this.floorPosition = this.floorPosition || this.interpolateFloorPosition(),
  18180. this.height = this.position.distanceTo(this.floorPosition),
  18181. this.placeMarker()
  18182. }
  18183. ,
  18184. n.prototype.interpolateFloorPosition = function() {
  18185. var e = this.model.panos.filter(n.filters.isNeighbourPanoTo(this)).filter(function(e) {
  18186. return !!e.floorPosition
  18187. }).sort(function(e, t) {
  18188. return e.position.distanceTo(this.position) - t.position.distanceTo(this.position)
  18189. }
  18190. .bind(this))
  18191. , t = this.position.clone();
  18192. return e.length >= 2 ? t.y = (e[0].floorPosition.y + e[1].floorPosition.y) / 2 : t.add(a.noMeshFloorPositionOffset),
  18193. t
  18194. }
  18195. ,
  18196. n.prototype.raycastFloorPosition = function() {
  18197. I.warn("Performance warning: Raycasting to find floor position");
  18198. var e = new r.Raycaster(this.position,new r.Vector3(0,-1,0))
  18199. , t = e.intersectObjects(this.model.colliders);
  18200. return t.length ? t[0].point : null
  18201. }
  18202. ,
  18203. n.prototype.raycastToFindFloor = function() {
  18204. var e = [new r.Vector3(0,-1,0), new r.Vector3(1,-1,0), new r.Vector3(0,-1,1), new r.Vector3(-1,-1,0), new r.Vector3(0,-1,-1), new r.Vector3(1,0,0), new r.Vector3(0,0,1), new r.Vector3(-1,0,0), new r.Vector3(0,0,-1)];
  18205. return function() {
  18206. I.warn("Performance warning: Raycasting to find floor index");
  18207. for (var t = 0; t < e.length; t++) {
  18208. var i = new r.Raycaster(this.position.clone(),e[t].clone())
  18209. , n = i.intersectObjects(this.model.colliders);
  18210. if (n.length)
  18211. return n[0].object.parent.parent
  18212. }
  18213. return null
  18214. }
  18215. }(),
  18216. n.prototype.placeMarker = function() {
  18217. this.marker && (this.marker.position.copy(this.floorPosition),
  18218. this.marker.position.y += .05,
  18219. this.marker.lookAt(new r.Vector3(0,1,0).add(this.marker.position)))
  18220. }
  18221. ,
  18222. n.prototype.translate = function(e) {
  18223. this.position.add(e),
  18224. this.floorPosition.add(e)
  18225. }
  18226. ,
  18227. n.prototype.findClosestMidtpointPanoTo = function(e) {
  18228. (new r.Vector3).addVectors(this.position, e.position).divideScalar(2);
  18229. return this.model.panos.find([n.filters.notIn([this, e])], [n.sortFunctions.distanceToPoint(point)])
  18230. }
  18231. ,
  18232. n.prototype.attachToPanoRenderer = function(e) {
  18233. this.panoRenderer = e,
  18234. this.panoRenderer.on(g.TileRenderSuccess, this.onTileRendered.bind(this)),
  18235. this.panoRenderer.on(g.PanoRenderComplete, this.onPanoRendered.bind(this)),
  18236. this.panoRenderer.on(g.TileRenderFailure, this.onTileRenderFail.bind(this)),
  18237. this.panoRenderer.on(g.UploadAttemptedForAllTiles, this.onUploadAttemptedForAllTiles.bind(this))
  18238. }
  18239. ;
  18240. var _ = {};
  18241. n.prototype.getWaitDeferred = function(e) {
  18242. var t = _[this.id];
  18243. t || (t = {},
  18244. _[this.id] = t);
  18245. var i = t[e];
  18246. return i || (i = {
  18247. deferred: $.Deferred(),
  18248. active: !1
  18249. },
  18250. t[e] = i),
  18251. i
  18252. }
  18253. ,
  18254. n.prototype.resetWaitDeferred = function(e) {
  18255. var t = this.getWaitDeferred(e);
  18256. t.active = !1,
  18257. t.deferred = $.Deferred()
  18258. }
  18259. ,
  18260. n.prototype.clearWaitDeferreds = function() {
  18261. var e = _[this.id];
  18262. e || (e = {},
  18263. _[this.id] = e);
  18264. for (var t in e)
  18265. if (e.hasOwnProperty(t)) {
  18266. var i = e[t];
  18267. i.active = !1,
  18268. i.deferred = $.Deferred()
  18269. }
  18270. }
  18271. ,
  18272. n.prototype.loadTiledPano = function() {
  18273. var e = (new r.Vector3,
  18274. [])
  18275. , t = [];
  18276. return function(i, n, r, o, a, s) {
  18277. null !== o && void 0 !== o || (o = !0),
  18278. null !== a && void 0 !== a || (a = !0);
  18279. var l = this.getWaitDeferred(i)
  18280. , c = l.deferred
  18281. , h = null
  18282. , u = null;
  18283. if (r && ("number" == typeof r ? h = r : (h = r.hFov,
  18284. u = r.vFov)),
  18285. !this.isLoaded(i)) {
  18286. if (!l.active) {
  18287. if (l.active = !0,
  18288. r) {
  18289. var d = y.matchingTilesInDirection(this, i, n, h, u);
  18290. e[this.id + ":" + i] = {
  18291. tileCount: 0,
  18292. targetTileCount: d
  18293. },
  18294. I.info("Loading partial pano: " + this.id + " with " + d + " tiles")
  18295. }
  18296. t[this.id] || (t[this.id] = !0,
  18297. this.on(f.LoadComplete, function(e, t) {
  18298. var i = this.getWaitDeferred(e).deferred;
  18299. i && "pending" === i.state() && this.highestPartialTileRenderOpCompleted >= e && (i.resolve(e, t),
  18300. this.resetWaitDeferred(e))
  18301. }
  18302. .bind(this)),
  18303. this.on(f.LoadFailed, function(e) {
  18304. var t = this.getWaitDeferred(e).deferred;
  18305. t && "pending" === t.state() && this.highestPartialTileRenderOpCompleted >= e && (t.reject(e),
  18306. this.resetWaitDeferred(e))
  18307. }
  18308. .bind(this)),
  18309. this.on(f.TileLoaded, function(t, i, n) {
  18310. var r = this.getWaitDeferred(t).deferred;
  18311. if (r && "pending" === r.state()) {
  18312. r.notify(t, i, n);
  18313. var o = e[this.id + ":" + t];
  18314. o && (o.tileCount++,
  18315. o.tileCount === o.targetTileCount && (this.onPanoRendered(this.id, t, n, !0),
  18316. r.resolve(t, n),
  18317. this.resetWaitDeferred(t)))
  18318. }
  18319. }
  18320. .bind(this)))
  18321. }
  18322. this.tileDownloader.clearForceQueue(),
  18323. this.tileDownloader.forceQueueTilesForPano(this, i, n, h, u, s),
  18324. this.tiledPanoRenderTarget = this.panoRenderer.activateTiledPano(this, this.qualityManager.getMaxNavPanoSize(), o),
  18325. this.panoRenderer.renderPanoTiles(this.id, n, a)
  18326. }
  18327. return c.promise()
  18328. }
  18329. }(),
  18330. n.prototype.onUploadAttemptedForAllTiles = function(e, t, i) {
  18331. if (e === this.id) {
  18332. var n = this.qualityManager.getPanoSize(m.BASE);
  18333. t === n && this.shouldRedrawOnBaseLoaded && (this.shouldRedrawOnBaseLoaded = !1,
  18334. this.panoRenderer.resetRenderStatus(this.id, !0, !1),
  18335. this.panoRenderer.renderPanoTiles(this.id, null, !0, !0))
  18336. }
  18337. }
  18338. ,
  18339. n.prototype.onTileRendered = function(e, t, i, n) {
  18340. e === this.id && this.emit(f.TileLoaded, t, i, n)
  18341. }
  18342. ,
  18343. n.prototype.onPanoRendered = function(e, t, i, n) {
  18344. e === this.id && (this.minimumTiledPanoLoaded = !0,
  18345. this.updateSkyboxForZoomLevel(),
  18346. t > this.highestPartialTileRenderOpCompleted && (this.highestPartialTileRenderOpCompleted = t),
  18347. !n && t > this.highestFullTileRenderOpCompleted && (this.highestFullTileRenderOpCompleted = t),
  18348. this.emit("load", t),
  18349. this.model.emit("load", this),
  18350. this.emit(f.LoadComplete, t, i))
  18351. }
  18352. ,
  18353. n.prototype.setZoomed = function(e) {
  18354. this.zoomed = e,
  18355. this.updateSkyboxForZoomLevel()
  18356. }
  18357. ,
  18358. n.prototype.ensureSkyboxReadyForRender = function() {
  18359. this.tiled || (this.solidSkybox.loaded || (this.solidSkybox.needsUpdate = !0),
  18360. this.solidSkybox.loaded = !0)
  18361. }
  18362. ,
  18363. n.prototype.updateSkyboxForZoomLevel = function() {
  18364. this.minimumTiledPanoLoaded && this.model.updateProjectedPanos()
  18365. }
  18366. ,
  18367. n.prototype.getSkyboxTexture = function() {
  18368. return this.tiled ? this.minimumTiledPanoLoaded ? this.zoomed ? this.panoRenderer.zoomRenderTarget.texture : this.tiledPanoRenderTarget.texture : null : this.solidSkybox
  18369. }
  18370. ,
  18371. n.prototype.onTileRenderFail = function(e, t, i) {
  18372. e === this.id && this.emit(f.LoadFailed, t)
  18373. }
  18374. ,
  18375. n.prototype.isLoaded = function(e) {
  18376. if (this.tiled) {
  18377. if (e && "string" == typeof e)
  18378. throw new A("Wrong panoSize given to Panorama.isLoaded(); a tiled pano uses PanoSizeClass");
  18379. return !!this.minimumTiledPanoLoaded && (!e || this.highestPartialTileRenderOpCompleted >= e)
  18380. }
  18381. if (e && "number" == typeof e)
  18382. throw new A("Wrong panoSize given to Panorama.isLoaded(); a non-tiled pano uses high/low.");
  18383. return !!this.solidSkybox.high || e in this.solidSkybox
  18384. }
  18385. ,
  18386. n.prototype.loadCube = function(e) {
  18387. if (this.isLoaded(e))
  18388. return I.info("Skipping load of pano, already loaded"),
  18389. $.when();
  18390. this.emit("loading", e),
  18391. this.model.emit("loading", this);
  18392. var t = p.getCubemapUrls(this.model.urls, this.id, e)
  18393. , i = t.filter(function(e) {
  18394. return !e
  18395. });
  18396. "low" === e && i.length > 0 && (I.info("Pano", this.id, "not available in low res, loading high res right away"),
  18397. e = "high",
  18398. t = p.getCubemapUrls(this.model.urls, this.id, e));
  18399. var n = 0
  18400. , r = [0, 1, 2, 3, 4, 5].map(function(e, i, n) {
  18401. return u.getImage(t[i])
  18402. }
  18403. .bind(this));
  18404. return $.when(r[0], r[1], r[2], r[3], r[4], r[5]).then(function(t, i, n, r, o, a) {
  18405. return this.solidSkybox[e] = [t, i, n, r, o, a],
  18406. "high" !== e && this.solidSkybox.high || (this.solidSkybox.image = this.solidSkybox[e],
  18407. this.solidSkybox.low = null),
  18408. this.solidSkybox.needsUpdate = !0,
  18409. this.emit("load", e),
  18410. this.model.emit("load", this),
  18411. this
  18412. }
  18413. .bind(this), function() {
  18414. I.error("Downloading cubemap for pano", this.id, "failed"),
  18415. this.failedLoadingAt = Date.now()
  18416. }
  18417. .bind(this), function() {
  18418. return $.when(++n, 6)
  18419. })
  18420. }
  18421. ,
  18422. n.raycastsSkipped = 0,
  18423. n.raycastsDone = 0,
  18424. n.prototype.findNeighourPanos = function() {
  18425. return this.model.panos.setNeighbour(this.id, this.id, !1),
  18426. this.model.panos.forEach(function(e) {
  18427. if (e !== this && (!this.model.panos.neighbourMap[this.id] || void 0 === this.model.panos.neighbourMap[this.id][e.id])) {
  18428. var t = this.position.distanceTo(e.position);
  18429. if (t > a.panoramaNeighbourMaxDistance)
  18430. return this.model.panos.setNeighbour(this, e, !1),
  18431. void n.raycastsSkipped++;
  18432. var i = e.position.clone().sub(this.position).normalize()
  18433. , o = new r.Raycaster(this.position,i.clone(),0,t)
  18434. , s = o.intersectObjects(this.model.colliders);
  18435. n.raycastsDone++,
  18436. this.model.panos.setNeighbour(this, e, 0 === s.length),
  18437. a.showNeighbourRaycasts && (s.length ? this.floor.model.add(new r.ArrowHelper(i,this.position,s[0].distance,16711680)) : this.floor.model.add(new r.ArrowHelper(i,this.position,t,16777215,0,0)))
  18438. }
  18439. }
  18440. .bind(this)),
  18441. this.model.panos.neighbourMap[this.id]
  18442. }
  18443. ,
  18444. n.prototype.worldPosition = function() {
  18445. return this.position
  18446. }
  18447. ,
  18448. n.prototype.addTextSprite = function(e, t) {
  18449. this.removeTextSprite();
  18450. var i = document.createElement("canvas")
  18451. , n = i.getContext("2d");
  18452. i.width = 256,
  18453. i.height = 256;
  18454. var o = "Arial"
  18455. , a = 60;
  18456. n.font = "bold " + a + "px " + o,
  18457. n.fillStyle = "white";
  18458. var s = n.measureText(e).width;
  18459. n.fillText(e, (i.width - s) / 2, (i.height + a) / 2);
  18460. var l = new r.Texture(i);
  18461. l.needsUpdate = !0;
  18462. var c = new r.SpriteMaterial({
  18463. map: l,
  18464. color: t || 16428055
  18465. });
  18466. this.text3d = new r.Sprite(c),
  18467. this.text3d.position.copy(this.skyboxMesh.position),
  18468. this.floor.add(this.text3d)
  18469. }
  18470. ,
  18471. n.prototype.removeTextSprite = function() {
  18472. this.text3d && (this.floor.remove(this.text3d),
  18473. this.text3d = null)
  18474. }
  18475. ,
  18476. n.prototype.isAligned = function() {
  18477. return this.alignmentType === l.ALIGNED
  18478. }
  18479. ,
  18480. n.filters = {
  18481. inDirection: function(e, t, i) {
  18482. return function(n) {
  18483. var r = n.position.clone().sub(e).normalize();
  18484. return r.dot(t) > i
  18485. }
  18486. },
  18487. inFloorDirection: function(e, t, i) {
  18488. return function(n) {
  18489. var r = n.floorPosition.clone().sub(e).normalize();
  18490. return r.dot(t) > i
  18491. }
  18492. },
  18493. inPanoDirection: function(e, t, i) {
  18494. return i = a.navigation.panoScores ? a.navigation.filterStrictness : i,
  18495. function(n) {
  18496. var r = n.floorPosition.clone().sub(e).normalize()
  18497. , o = n.position.clone().sub(e).normalize();
  18498. return r.dot(t) > i || o.dot(t) > i
  18499. }
  18500. },
  18501. atFloor: function(e) {
  18502. return function(t) {
  18503. return !e || t.floor === e
  18504. }
  18505. },
  18506. not: function(e) {
  18507. return function(t) {
  18508. return t !== e
  18509. }
  18510. },
  18511. notIn: function(e) {
  18512. return function(t) {
  18513. return e.indexOf(t) === -1
  18514. }
  18515. },
  18516. isLoaded: function() {
  18517. return function(e) {
  18518. return e.isLoaded()
  18519. }
  18520. },
  18521. isNotLoaded: function() {
  18522. return function(e) {
  18523. return !e.isLoaded()
  18524. }
  18525. },
  18526. isCloseEnoughTo: function(e, t) {
  18527. return function(i) {
  18528. return e.distanceTo(i.floorPosition) < t
  18529. }
  18530. },
  18531. hasMinimumHeightDifferenceTo: function(e, t) {
  18532. return function(i) {
  18533. return Math.abs(i.position.y - e.y) > t
  18534. }
  18535. },
  18536. isNotBehindNormal: function(e, t) {
  18537. var i = new r.Vector3;
  18538. return t = t.clone(),
  18539. function(n) {
  18540. var r = i.copy(n.position).sub(e).normalize();
  18541. return r.dot(t) > 0
  18542. }
  18543. },
  18544. isNeighbourPanoTo: function(e) {
  18545. return function(t) {
  18546. return !e || !e.neighbourPanos || !!e.neighbourPanos[t.id]
  18547. }
  18548. },
  18549. isNeighbourOfNeighbourTo: function(e) {
  18550. return function(t) {
  18551. return !!e.neighbourPanos[t.id] || e.neighbourUUIDs.some(function(i) {
  18552. var n = e.model.panos.get(i);
  18553. return !!n && n.neighbourPanos[t.id]
  18554. })
  18555. }
  18556. },
  18557. isNotRecentlyFailed: function(e) {
  18558. return function(t) {
  18559. return Date.now() - t.failedLoadingAt > e
  18560. }
  18561. },
  18562. isOnVisibleFloor: function() {
  18563. return function(e) {
  18564. return !e.floor.hidden
  18565. }
  18566. },
  18567. isPanoAligned: function() {
  18568. return function(e) {
  18569. return e.isAligned()
  18570. }
  18571. }
  18572. },
  18573. n.sortFunctions = {
  18574. distanceToPoint: function(e) {
  18575. return function(t, i) {
  18576. return t.position.distanceTo(e) - i.position.distanceTo(e)
  18577. }
  18578. },
  18579. floorDistanceToPoint: function(e) {
  18580. return function(t, i) {
  18581. return t.floorPosition.distanceTo(e) - i.floorPosition.distanceTo(e)
  18582. }
  18583. },
  18584. choose: function(e) {
  18585. return function(t, i) {
  18586. return e.id === t.id ? -1 : e.id === i.id ? 1 : 0
  18587. }
  18588. }
  18589. },
  18590. n.scoreFunctions = {
  18591. distance: function(e, t) {
  18592. return t = t || a.navigation.distanceFactor,
  18593. function(i) {
  18594. return e ? e.position.distanceTo(i.position) * t : 0
  18595. }
  18596. },
  18597. distanceSquared: function(e, t) {
  18598. return t = t || a.navigation.distanceFactor,
  18599. function(i) {
  18600. return e ? e.position.distanceToSquared(i.position) * t : 0
  18601. }
  18602. },
  18603. direction: function(e, t) {
  18604. return function(i) {
  18605. var n = i.position.clone().sub(e).normalize();
  18606. return n.dot(t) * a.navigation.directionFactor
  18607. }
  18608. },
  18609. angle: function(e, t) {
  18610. return function(i) {
  18611. var n = i.position.clone().sub(e).normalize();
  18612. return n.angleTo(t) * a.navigation.angleFactor
  18613. }
  18614. },
  18615. inFieldOfView: function(e, t) {
  18616. return function(i) {
  18617. var n = i.position.clone().sub(e).normalize();
  18618. return n.dot(t) > .75 ? 10 : -1
  18619. }
  18620. },
  18621. optionality: function(e) {
  18622. return function(t) {
  18623. var i = t.neighbourUUIDs.filter(function(t) {
  18624. return !(t in e.neighbourUUIDs) && t !== e.id
  18625. });
  18626. return i.length * a.navigation.optionalityFactor
  18627. }
  18628. },
  18629. penalizeHeightDifferenceUnder: function(e, t) {
  18630. return function(i) {
  18631. return e.y - i.position.y < t ? -20 : 0
  18632. }
  18633. }
  18634. },
  18635. t.exports = n
  18636. }
  18637. ).call(this, "/js/objects/Panorama.js")
  18638. }
  18639. , {
  18640. "../enum/AlignmentType": 17,
  18641. "../enum/GLCubeFaces": 25,
  18642. "../enum/PanoRendererEvents": 35,
  18643. "../enum/PanoSizeClass": 36,
  18644. "../enum/PanoramaEvents": 37,
  18645. "../enum/RenderLayers": 41,
  18646. "../enum/RenderOrder": 42,
  18647. "../enum/TileDownloaderEvents": 45,
  18648. "../enum/Viewmode": 51,
  18649. "../exception/BasicException": 55,
  18650. "../scene/SceneRenderer": 158,
  18651. "../settings": 166,
  18652. "../tile/TileUtils": 174,
  18653. "../util/ajax": 181,
  18654. "../util/common": 185,
  18655. "../util/lerp": 188,
  18656. "../util/logger": 189,
  18657. "../util/panorama": 191,
  18658. "../util/texture": 194,
  18659. "../util/transitions": 195,
  18660. events: 202,
  18661. three: 217
  18662. }],
  18663. 149: [function(e, t, i) {
  18664. "use strict";
  18665. function n(e) {
  18666. var t = r.UniformsUtils.clone(c.waypoint.uniforms);
  18667. t.map.value = d,
  18668. t.opacity.value = 0,
  18669. t.color.value.set(o.reticuleColor),
  18670. r.Mesh.call(this, new r.PlaneBufferGeometry(.4,.4,1,1), new r.RawShaderMaterial({
  18671. side: r.DoubleSide,
  18672. depthWrite: !1,
  18673. depthTest: !1,
  18674. transparent: !0,
  18675. vertexShader: c.waypoint.vertexShader,
  18676. fragmentShader: c.waypoint.fragmentShader,
  18677. uniforms: t,
  18678. name: "waypoint",
  18679. opacity: 0
  18680. })),
  18681. this.layers.set(h.RETICULE),
  18682. this.renderOrder = u.reticule,
  18683. this.player = e,
  18684. this.direction = new r.Vector3,
  18685. this.hidden = !0,
  18686. this.mouseLastMoveTime = Date.now()
  18687. }
  18688. var r = e("three")
  18689. , o = e("../settings")
  18690. , a = e("../util/transitions")
  18691. , s = e("../util/texture")
  18692. , l = e("../util/lerp")
  18693. , c = e("../shaders")
  18694. , h = e("../enum/RenderLayers")
  18695. , u = e("../enum/RenderOrder")
  18696. , d = s.load("./images/reticule-256x256.png");
  18697. n.prototype = Object.create(r.Mesh.prototype),
  18698. n.prototype.move = function(e, t, i) {
  18699. this.hidden = i,
  18700. this.mouseLastMoveTime = Date.now()
  18701. }
  18702. ,
  18703. n.prototype.hide = function() {
  18704. this.hidden || (this.hidden = !0,
  18705. a.start(l.property(this.material.uniforms.opacity, "value", 0), o.reticuleOpacityTransitionTime))
  18706. }
  18707. ,
  18708. n.prototype.show = function() {
  18709. this.hidden = !1,
  18710. this.material.opacity <= 0 && a.start(l.property(this.material.uniforms.opacity, "value", o[this.player.mode].reticuleOpacity), o.reticuleOpacityTransitionTime)
  18711. }
  18712. ,
  18713. n.prototype.update = function() {
  18714. Date.now() - this.mouseLastMoveTime > o.hideReticuleTimeout && !this.hidden && this.hide()
  18715. }
  18716. ,
  18717. n.prototype.updatePosition = function(e, t) {
  18718. if (!this.hidden) {
  18719. if (!t)
  18720. return this.hide();
  18721. var i = t.point
  18722. , n = e.distanceTo(i)
  18723. , r = 1 + .01 * n;
  18724. n < 1 && (r -= 1 - n),
  18725. this.show(),
  18726. this.scale.set(r, r, r),
  18727. this.direction = this.direction.multiplyScalar(.8),
  18728. this.direction.add(t.face.normal.clone().multiplyScalar(.2)),
  18729. this.position.copy(i).add(t.face.normal.clone().multiplyScalar(.01)),
  18730. this.lookAt(this.position.clone().add(this.direction))
  18731. }
  18732. }
  18733. ,
  18734. n.prototype.writeAstag = function() {
  18735. var e = Math.floor(4294967296 * (1 + Math.random())).toString(16) + Math.floor(16 * (1 + Math.random())).toString(16)
  18736. , t = new Date;
  18737. this.tagCount = "undefined" == typeof this.tagCount ? 1 : this.tagCount + 1;
  18738. var i = {
  18739. enabled: !0,
  18740. version: "0",
  18741. created: t.toISOString(),
  18742. created_by: "APITest",
  18743. position: this.position.clone(),
  18744. stem: {
  18745. enabled: o.tags.pole.enabled,
  18746. direction: this.direction.multiplyScalar(o.tags.pole.height)
  18747. },
  18748. label: "tag " + this.tagCount,
  18749. description: "Description " + e,
  18750. floor: function(e) {
  18751. if (e.currentFloor) {
  18752. var t = e.floors.indexOf(e.currentFloor);
  18753. return t > -1 ? t : void 0
  18754. }
  18755. }(this.player.model),
  18756. type: "info",
  18757. metadata: {
  18758. preferred_camera: {
  18759. mode: this.player.mode
  18760. }
  18761. }
  18762. };
  18763. console.log("--------------------------"),
  18764. console.log(JSON.stringify(i));
  18765. var n = this.player.model.addtag(e, i).build();
  18766. n && (n.disc && this.player.tagDiscs.push(n.disc),
  18767. n.visible || n.show(o.tags.startup.fadeInDuration))
  18768. }
  18769. ,
  18770. t.exports = n
  18771. }
  18772. , {
  18773. "../enum/RenderLayers": 41,
  18774. "../enum/RenderOrder": 42,
  18775. "../settings": 166,
  18776. "../shaders": 167,
  18777. "../util/lerp": 188,
  18778. "../util/texture": 194,
  18779. "../util/transitions": 195,
  18780. three: 217
  18781. }],
  18782. 150: [function(e, t, i) {
  18783. "use strict";
  18784. function n(e, t) {
  18785. this.chunks = [],
  18786. this.floorId = e,
  18787. this.roomId = t,
  18788. this.position = new r.Vector3
  18789. }
  18790. var r = e("three");
  18791. n.prototype.addChunk = function(e) {
  18792. this.chunks.push(e)
  18793. }
  18794. ,
  18795. n.prototype.calcBoundaries = function() {
  18796. 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++) {
  18797. var s = this.chunks[a]
  18798. , l = s.geometry.attributes.position;
  18799. if (l)
  18800. for (var c = 0; c < l.array.length; c += 3)
  18801. e.set(l.array[c], l.array[c + 1], l.array[c + 2]),
  18802. t.add(e),
  18803. 0 === c ? (i.copy(e),
  18804. n.copy(e)) : (i.max(e),
  18805. n.min(e)),
  18806. o++
  18807. }
  18808. o > 0 ? (t.multiplyScalar(1 / o),
  18809. this.average = t) : this.average = null,
  18810. this.boundsMax = i,
  18811. this.boundsMin = n,
  18812. this.center = new r.Vector3,
  18813. this.center.copy(i).sub(n).multiplyScalar(.5).add(n)
  18814. }
  18815. ,
  18816. t.exports = n
  18817. }
  18818. , {
  18819. three: 217
  18820. }],
  18821. 151: [function(e, t, i) {
  18822. (function(i) {
  18823. "use strict";
  18824. function n(e, t, i) {
  18825. this.obj3d = null,
  18826. this.nodes = [],
  18827. this.colorHull = [],
  18828. this.shortPaths = {},
  18829. this.floorHull = null,
  18830. this.cameraHull = null,
  18831. this.floorPathDistance = 0,
  18832. this.floorCurvePoints = null,
  18833. this.floorCurveColors = null,
  18834. this.camCurvePoints = null,
  18835. this.warpDestHeroLoc = null,
  18836. this.warpDestPano = null,
  18837. this.warpPathPoints = null,
  18838. this.warpPathLengths = [0],
  18839. this.warpLength = 0,
  18840. this.closeWarpDistance = 4,
  18841. this.UP = A.UP.clone(),
  18842. this.longestStep = 0,
  18843. this.upcomingTransType = null,
  18844. this.burnsDir = 1,
  18845. this.prevNextDist = 0,
  18846. this.nextI = 0,
  18847. this.activeTransType = null,
  18848. this.lastTransType = null,
  18849. this.bunnyObj = null,
  18850. this.director = e,
  18851. this.player = t,
  18852. this.playerControls = i,
  18853. this.modelManager = t.modelManager,
  18854. this.updateModel(),
  18855. this.updateDefaultsFromModelData(),
  18856. this.bindEvents(),
  18857. this.warping = !1,
  18858. this.waitingToWarp = !1,
  18859. this.warpInterrupted = !1,
  18860. this.warpInterruptionBlackoutStyle = null,
  18861. this.warpInterruptionTravelTime = null
  18862. }
  18863. var r = e("three")
  18864. , o = e("../util/logger")
  18865. , a = e("../enum/Viewmode")
  18866. , s = e("../enum/RenderOrder")
  18867. , l = e("../enum/WarpStyle")
  18868. , c = e("../settings")
  18869. , h = e("../util/math")
  18870. , u = e("../util/lerp")
  18871. , d = e("../util/easing")
  18872. , p = e("../util/transitions")
  18873. , f = e("../objects/Snapshot")
  18874. , g = e("../effects")
  18875. , m = e("../shaders")
  18876. , v = (e("../gui/gui"),
  18877. e("../util/texture"))
  18878. , A = e("../enum/Vectors")
  18879. , y = (e("../model/ModelManager"),
  18880. new o(i))
  18881. , C = e("../enum/PlayerEvents")
  18882. , I = e("../enum/BlackoutStyle")
  18883. , E = e("../enum/ModelManagerEvents")
  18884. , b = e("../constants")
  18885. , w = {
  18886. path: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAIAAAAAgCAYAAADaInAlAAAACXBIWXMAAAsTAAALEwEAmpwYAAAKxGlDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjarZZnUFP5Gsbfc046CS0hAlJCb4IU6dJrAAXpYCMkIQmEEFJQsKEiruBaEBHBsqIrIAquBZC1IBZsi2DvC7IoqOtiwYbK/cAS7r1z74c7c9+ZM/ObZ97/c57/OV8eAOogRyoVo5oA2RKFLDYskJWcksoi/g54oIEmUMCUw5VLA2JiouA/DwLw4Q4gAAA37TlSqRj+t9Hi8eVcACQGANJ5cm42AHIMAOniSmUKAKwIAMwWKaQKAKwOABiy5JRUAOwkADAE49wNAIz0cf4DABiy+NggAOwTAInK4cgEAFQcALDyuAIFANUcABwlPJEEgBoPAL5cIYcHQC0HgGnZ2Tk8AGo7AFin/5OP4F8801WeHI5AxeN3AQAAUrBILhVz8uH/Pdli5cQ7TAGAKpSFxwKAJQBSl5UTqWJJ+uzoCRbxACZYqAxPmGCuPCh1gnmc4MgJVmYlBEwwRzZ5VqRgx0+wLCdW5c+Xh8Sp/PnsKFUG8WwVZ4hC2RNcIIxPmuA8UeLsCZZnxUVO7gSpdJkyVpU5QxaqumO2fDIblzOZQSGMD5/MlqzKwOMHh6h0SYJqX6oIVHlKxTGqfb44TKXL8+JUZxWyeJWeyYmImfSJUX0fiAchKEECPOCDDNIhB8SgABYEgwjkIAUxcCAfQMFfrAAACMqR5stEAqGCFSCVivkstoTrMI3l7OjkCpCcksoa/+XvmIAAAMK8MqnltgN4lgAggkmNYwZw4hkA/cOkZvYWgLoJ4FQ3VynLG9dwAAB4oIAGMEAPjMAMrMEenMENvMEfQiACoiEeUmABcEEI2SCDRbAUVkIxlMIm2ApVsBv2Qh0cgiPQAifhLFyEq9ANt+Eh9MIAvIRh+ACjCIIQERpCR/QQY8QCsUOcEQ/EFwlBopBYJAVJQwSIBFEiS5HVSClShlQhe5B65BfkBHIWuYz0IPeRPmQIeYt8QTGUijJQQ9QSnY56oAFoJBqPzkcFaC5agBahG9BKtAY9iDajZ9Gr6G20F32JjmCAqWFMzASzxzywICwaS8UyMBm2HCvBKrAarBFrwzqxm1gv9gr7jCPg6DgWzh7njQvHJeC4uFzcctx6XBWuDteMO4+7ievDDeO+42l4A7wd3gvPxifjBfhF+GJ8BX4//jj+Av42fgD/gUAgMAlWBHdCOCGFkElYQlhP2EloIrQTegj9hBEikahHtCP6EKOJHKKCWEzcTjxIPEO8QRwgfiKpkYxJzqRQUipJQlpFqiAdIJ0m3SA9J42SNckWZC9yNJlHzidvJO8jt5GvkwfIoxQtihXFhxJPyaSspFRSGikXKI8o79TU1EzVPNXmqInUCtUq1Q6rXVLrU/tM1abaUoOo86hK6gZqLbWdep/6jkajWdL8aak0BW0DrZ52jvaE9kmdru6gzlbnqa9Qr1ZvVr+h/lqDrGGhEaCxQKNAo0LjqMZ1jVeaZE1LzSBNjuZyzWrNE5p3NUe06FpOWtFa2VrrtQ5oXdYa1CZqW2qHaPO0i7T3ap/T7qdjdDN6EJ1LX03fR79AH2AQGFYMNiOTUco4xOhiDOto68zQSdRZrFOtc0qnl4kxLZlsppi5kXmEeYf5ZYrhlIAp/CnrpjROuTHlo+5UXX9dvm6JbpPubd0veiy9EL0svc16LXqP9XH6tvpz9Bfp79K/oP9qKmOq91Tu1JKpR6Y+MEANbA1iDZYY7DW4ZjBiaGQYZig13G54zvCVEdPI3yjTqNzotNGQMd3Y11hkXG58xvgFS4cVwBKzKlnnWcMmBibhJkqTPSZdJqOmVqYJpqtMm0wfm1HMPMwyzMrNOsyGzY3NZ5kvNW8wf2BBtvCwEFpss+i0+GhpZZlkudayxXLQSteKbVVg1WD1yJpm7Weda11jfcuGYONhk2Wz06bbFrV1tRXaVttet0Pt3OxEdjvteqbhp3lOk0yrmXbXnmofYJ9n32Df58B0iHJY5dDi8Hq6+fTU6Zund07/7ujqKHbc5/jQSdspwmmVU5vTW2dbZ65ztfMtF5pLqMsKl1aXNzPsZvBn7Jpxz5XuOst1rWuH6zc3dzeZW6PbkLu5e5r7Dve7HgyPGI/1Hpc88Z6Bnis8T3p+9nLzUngd8frL2947y/uA9+BMq5n8mftm9vuY+nB89vj0+rJ803x/8u31M/Hj+NX4PfU38+f57/d/HmATkBlwMOB1oGOgLPB44Mcgr6BlQe3BWHBYcElwV4h2SEJIVciTUNNQQWhD6HCYa9iSsPZwfHhk+Obwu2xDNpddzx6OcI9YFnE+khoZF1kV+TTKNkoW1TYLnRUxa8usR7MtZktmt0RDNDt6S/TjGKuY3Jhf5xDmxMypnvMs1il2aWxnHD1uYdyBuA/xgfEb4x8mWCcoEzoSNRLnJdYnfkwKTipL6k2enrws+WqKfooopTWVmJqYuj91ZG7I3K1zB+a5ziued2e+1fzF8y8v0F8gXnBqocZCzsKjafi0pLQDaV850Zwazkg6O31H+jA3iLuN+5LnzyvnDfF9+GX85xk+GWUZgwIfwRbBkNBPWCF8JQoSVYneZIZn7s78mBWdVZs1Jk4SN2WTstOyT0i0JVmS8zlGOYtzeqR20mJpb65X7tbcYVmkbL8ckc+XtyoYCqnimtJauUbZl+ebV533aVHioqOLtRZLFl/Lt81fl/+8ILTg5yW4JdwlHUtNlq5c2rcsYNme5cjy9OUdK8xWFK0YKAwrrFtJWZm18rdVjqvKVr1fnbS6rciwqLCof03YmoZi9WJZ8d213mt3/4D7QfRD1zqXddvXfS/hlVwpdSytKP26nrv+yo9OP1b+OLYhY0PXRreNuzYRNkk23dnst7muTKusoKx/y6wtzeWs8pLy91sXbr1cMaNi9zbKNuW23sqoytbt5ts3bf9aJay6XR1Y3bTDYMe6HR938nbe2OW/q3G34e7S3V9+Ev10b0/YnuYay5qKvYS9eXuf7Uvc1/mzx8/1+/X3l+7/Viup7a2LrTtf715ff8DgwMYGtEHZMHRw3sHuQ8GHWhvtG/c0MZtKD8Nh5eEXv6T9cudI5JGOox5HG49ZHNtxnH68pBlpzm8ebhG29LamtPaciDjR0ebddvxXh19rT5qcrD6lc2rjacrpotNjZwrOjLRL21+dFZzt71jY8fBc8rlb5+ec77oQeeHSxdCL5zoDOs9c8rl08rLX5RNXPK60XHW72nzN9drx31x/O97l1tV83f16a7dnd1vPzJ7TN/xunL0ZfPPiLfatq7dn3+65k3Dn3t15d3vv8e4N3hfff/Mg78How8JH+EcljzUfVzwxeFLzu83vTb1uvaf6gvuuPY17+rCf2//yD/kfXweKntGeVTw3fl4/6Dx4cih0qPvF3BcDL6UvR18V/6n1547X1q+P/eX/17Xh5OGBN7I3Y2/Xv9N7V/t+xvuOkZiRJx+yP4x+LPmk96nus8fnzi9JX56PLvpK/Fr5zeZb2/fI74/GssfGpBwZBwAAMABAMzIA3tYC0FIA6N0AFPXxzvx310cmW/9/4/FeDQAAbgC1/gAJhQBR7QC72gEsCse7dQwAxPsD6uKiev4eeYaL87gXVQaA/zQ29s4QgNgG8E02Nja6c2zs2z4A7D5Ae+54VwcAIGgClFnpWusMd8e8L/z3zvwPWFMLsyHkoksAAD+UaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJBZG9iZSBYTVAgQ29yZSA1LjYtYzA2NyA3OS4xNTc3NDcsIDIwMTUvMDMvMzAtMjM6NDA6NDIgICAgICAgICI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgICAgICAgICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgICAgICAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgICAgICAgICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgICAgICAgICAgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiCiAgICAgICAgICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPHhtcDpDcmVhdG9yVG9vbD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwveG1wOkNyZWF0b3JUb29sPgogICAgICAgICA8eG1wOkNyZWF0ZURhdGU+MjAxNS0wNy0yMVQxODoyMDo1My0wNzowMDwveG1wOkNyZWF0ZURhdGU+CiAgICAgICAgIDx4bXA6TWV0YWRhdGFEYXRlPjIwMTUtMDctMjFUMTg6MjE6MzgtMDc6MDA8L3htcDpNZXRhZGF0YURhdGU+CiAgICAgICAgIDx4bXA6TW9kaWZ5RGF0ZT4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC94bXA6TW9kaWZ5RGF0ZT4KICAgICAgICAgPGRjOmZvcm1hdD5pbWFnZS9wbmc8L2RjOmZvcm1hdD4KICAgICAgICAgPHhtcE1NOkluc3RhbmNlSUQ+eG1wLmlpZDoyYWI5MzcwNS0xYjZjLTQ1ZGMtYTQyNy1jYWQzOGNiZTUxYjM8L3htcE1NOkluc3RhbmNlSUQ+CiAgICAgICAgIDx4bXBNTTpEb2N1bWVudElEPmFkb2JlOmRvY2lkOnBob3Rvc2hvcDpjYjc1NjFhOC03MDlhLTExNzgtOTQ1Zi1kNDlkZmJlYjBjMWE8L3htcE1NOkRvY3VtZW50SUQ+CiAgICAgICAgIDx4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3htcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPHhtcE1NOkhpc3Rvcnk+CiAgICAgICAgICAgIDxyZGY6U2VxPgogICAgICAgICAgICAgICA8cmRmOmxpIHJkZjpwYXJzZVR5cGU9IlJlc291cmNlIj4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmFjdGlvbj5jcmVhdGVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6Y2Y4NGFiMzItZTUwNi00ZGM1LThlMWQtNTI4MTI4YTdjZTljPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIwOjUzLTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MWIzNzcxZGMtZGU3Ni00YTQ4LTkzNjEtMGQ4NzdkOWY0ODkwPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPmNvbnZlcnRlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5mcm9tIGFwcGxpY2F0aW9uL3ZuZC5hZG9iZS5waG90b3Nob3AgdG8gaW1hZ2UvcG5nPC9zdEV2dDpwYXJhbWV0ZXJzPgogICAgICAgICAgICAgICA8L3JkZjpsaT4KICAgICAgICAgICAgICAgPHJkZjpsaSByZGY6cGFyc2VUeXBlPSJSZXNvdXJjZSI+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDphY3Rpb24+ZGVyaXZlZDwvc3RFdnQ6YWN0aW9uPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6cGFyYW1ldGVycz5jb252ZXJ0ZWQgZnJvbSBhcHBsaWNhdGlvbi92bmQuYWRvYmUucGhvdG9zaG9wIHRvIGltYWdlL3BuZzwvc3RFdnQ6cGFyYW1ldGVycz4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgICAgIDxyZGY6bGkgcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6YWN0aW9uPnNhdmVkPC9zdEV2dDphY3Rpb24+CiAgICAgICAgICAgICAgICAgIDxzdEV2dDppbnN0YW5jZUlEPnhtcC5paWQ6MmFiOTM3MDUtMWI2Yy00NWRjLWE0MjctY2FkMzhjYmU1MWIzPC9zdEV2dDppbnN0YW5jZUlEPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6d2hlbj4yMDE1LTA3LTIxVDE4OjIxOjM4LTA3OjAwPC9zdEV2dDp3aGVuPgogICAgICAgICAgICAgICAgICA8c3RFdnQ6c29mdHdhcmVBZ2VudD5BZG9iZSBQaG90b3Nob3AgQ0MgMjAxNSAoTWFjaW50b3NoKTwvc3RFdnQ6c29mdHdhcmVBZ2VudD4KICAgICAgICAgICAgICAgICAgPHN0RXZ0OmNoYW5nZWQ+Lzwvc3RFdnQ6Y2hhbmdlZD4KICAgICAgICAgICAgICAgPC9yZGY6bGk+CiAgICAgICAgICAgIDwvcmRmOlNlcT4KICAgICAgICAgPC94bXBNTTpIaXN0b3J5PgogICAgICAgICA8eG1wTU06RGVyaXZlZEZyb20gcmRmOnBhcnNlVHlwZT0iUmVzb3VyY2UiPgogICAgICAgICAgICA8c3RSZWY6aW5zdGFuY2VJRD54bXAuaWlkOjFiMzc3MWRjLWRlNzYtNGE0OC05MzYxLTBkODc3ZDlmNDg5MDwvc3RSZWY6aW5zdGFuY2VJRD4KICAgICAgICAgICAgPHN0UmVmOmRvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOmRvY3VtZW50SUQ+CiAgICAgICAgICAgIDxzdFJlZjpvcmlnaW5hbERvY3VtZW50SUQ+eG1wLmRpZDpjZjg0YWIzMi1lNTA2LTRkYzUtOGUxZC01MjgxMjhhN2NlOWM8L3N0UmVmOm9yaWdpbmFsRG9jdW1lbnRJRD4KICAgICAgICAgPC94bXBNTTpEZXJpdmVkRnJvbT4KICAgICAgICAgPHBob3Rvc2hvcDpDb2xvck1vZGU+MzwvcGhvdG9zaG9wOkNvbG9yTW9kZT4KICAgICAgICAgPHBob3Rvc2hvcDpJQ0NQcm9maWxlPkRpc3BsYXk8L3Bob3Rvc2hvcDpJQ0NQcm9maWxlPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICAgICA8dGlmZjpYUmVzb2x1dGlvbj43MjAwMDAvMTAwMDA8L3RpZmY6WFJlc29sdXRpb24+CiAgICAgICAgIDx0aWZmOllSZXNvbHV0aW9uPjcyMDAwMC8xMDAwMDwvdGlmZjpZUmVzb2x1dGlvbj4KICAgICAgICAgPHRpZmY6UmVzb2x1dGlvblVuaXQ+MjwvdGlmZjpSZXNvbHV0aW9uVW5pdD4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT42NTUzNTwvZXhpZjpDb2xvclNwYWNlPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTI4PC9leGlmOlBpeGVsWERpbWVuc2lvbj4KICAgICAgICAgPGV4aWY6UGl4ZWxZRGltZW5zaW9uPjMyPC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz6SKsKfAAAAIGNIUk0AAG11AABzoAAA/N0AAINkAABw6AAA7GgAADA+AAAQkOTsmeoAAAOCSURBVHja7FtRi9ZADJxETzkQRf3/P9FTREQ9bXwpUvYyk+x3PiawtPS6/UozmUyyexYROO0OwItzOICX57g7j68u4/U57pfzewDvAXxcjh8AvAPwFsCb83ljuf0G8A3A13N8AvAZwMN5/gDgC4DvAH4s4+d5fATw6xyPAP5cjtfx6JcfjuRl7Lxu5GXjcp8lc7Nnx/hY2rGcW/JNlU+c+Mmyb+/EYdlEBpDKjABkjH8vFWxVAAW5toIgGFquL2FLlDNErUyRzTnGt20LcW7NAFTs/G+uF2hhP+KCKa7zjuQ5wwR7LGDi75mTbbkWimFcUHYkkRwLSNRLZekjRgO0GSAKBr4y7yGeIwOuKwI7uSrIvLhBNwwD8MCCCFBbwGCVCPeGas9yfZYmgoDGyH1jmgGy75h9a1tYg6Vny0Dhzei2BTSWRPmKNicIHOs5nwWlCjQIFo+MNZQIZKVHCJa4vtQxOf9Z9B8b6ZcBKEQpHkwDmEgHVb8gA5VNBXAzC1jBBkyrHYSln1Rj3mwmdOlGiZVhg9t6AJ0G3CHmKuBQAFTlBFP4saA3EqEyVqcAE9VUFdVW9A7QqQKqvn6QFzVRekxLuA+AaDR/lJ+iUVmEEoHsWizAMdK06LDHWG4H8kWfTipQ5XkKHm+gMaOnIDUmGtXD2F4TKDYYuttClhrARPSuVBJCcIAgeVLAfi+ARXrcEHBWlYEg9T2aFAQiTGJRrGO6CjiEAOyIvRDs0C4DoxB1IdgkCmCM5eaLg00wg9Jrnvgy1kDsVgHMwUaYIjufdYB9HRBLjW8bDBJFKvEqBWTNhm6f2gn9T/T3HFh1ZdVyPBORqU7zotbPqAmiCcQ0wUT/bTqAAcFEeraiX1NWAQwMCkms73y93wcEWzoA4Ov+rETMloplC943Kagj8kB+eNLAXjMoim+WNdiOokfwBAzVaiCr7x29JUlLxOCwQC0A15EtrWe7fzos29IAlbiIhgaYrWDPF4HVPUpzKT+VKSCj8o6g6+wDHCDsCUGgXvQxUSGorfo0BWRUrh6OQm3OruD9FACiqyqwOPQ+AroaaM2HZ6jKjtYUk2M5vXvh8Crdtpp83U2h1b8lOZ5uCwv09reN1WW4LeLbGvpKtfFlCsjyjxGVupYfFVCGBfZKwayFfv3G3mQUxhyt/QBRqFRD/m9hPj78byxggnUrMW7Kn38HAONAllI0EmS1AAAAAElFTkSuQmCC"),
  18887. pathEnd: v.load("./images/End.png"),
  18888. pathStart: v.loadBase64("iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAYAAABccqhmAAAAAXNSR0IArs4c6QAAM6VJREFUeAHtfQl0HNWZ7r3VXd2SLLEa2xgc2ySGxwOMiSRsC2IsG1vbMCGGsCYsWcibGSAhEEJeFkyIhyRAkknmvXOGJBMggQAhDAlIsjFY4NjCtqSwH55xDjYDAWN2JGvp6q77vr/UMpLcS3V3Lbeqbx3L3V1177989///uvvlTF2BRmBx96uVNbFpsyMiMpcx83Cu8UOh0FQm6FMcyuk7YwcLxivwGWOcxXEvxgSLW7/xH64E7o8I+hRshH5zJobx+R7uvc0Yf4dx8Q5+vy1M+tTeSPHUzv7EnleebJg1hPvqCigCsAV1yY7A0q6uaGVlw9EiwuZzTTueC34UnBsOz+dwzmb4Kb8QbDdk2QVZdgouXham+TxPsWeHhrpferyxMemnbIp3fgRUAMiPkacplnbtrKioObIOBbOQMz4fzjWfcX4sftMbOzAXag4jTIgXERieFUzgj20d7n+t9/HGuVSzUJckCKgA4HNBtGzsP4xVVZ4CRz9F4wyfvBYixXwWyy32CejZZwq2GXpuZoNDmzuX1LzlFjNFNz8CKgDkx8jRFLW9vfoMduKpqDq3oPregrf78Y4yCBoxIZ4HFp3AonM3e2ZTX12dETQVgiyvCgAelN6KTXtn6nH9DDg7nJ4vB8tqD9gGkcWAEOIxNB06jRHjofWnTnk9iEoESWYVAFwqreVbBqbH9djZ6LA7V3B+KoBWWBeANfoM0KcoNuG/e0eMxP2PLap+s4DsKqlNBJRR2gTKTrKm7g8OieiVn8Wb/ly86U9DHs1OPpUmLwImagZPoGZwb8oY+sO6hgPfzZtDJbCFgAoAtmDKnai5x1iqcf5lpFqFtiyNt6vLJQTQX0CjCA8gIvxybb3+uEtsyoasCgBFFvXKzf3TIrGKSzSNfQm1+3lFklHZSkJA7DBN9qtUYvj2R06p2VMSqTLNrAJAgQXftDVxYiSqXY0Zc+fhba8XmF0ldwEB1AoM9LDck0qat65bGHvGBRahJakCgM2ibe4zmiKMXYO3/ek2s6hkviAgHk0xdsvaWn2dL+wDxlQFgFwFdt99kZa5Z16IDr1r8HdCrqTqmVwIoNPwOfzd0rnzwbvYOecgJqgrEwIqAGRCZfVqrbXtW+cyrq2G4x+dKYm6FwwEEAReYsJc3dF+071s9WozGFJ7J6UKABOx5q09SfTkixswlHfcxEfqV6AREOIFIfj1HfXRB6AHphmoixBQASBtB609xgqg8WO88Rco0wgvAqgRPA33v7ajXl8fXi3ta1b2AWDFluF5uh65FSvvzrAPm0oZdASwQvEhw0hdvX5RxY6g61KK/GUbAFq2vHMAix7wXUzguRIAhnX1XSm2UQ55E5hQ9HOW/PDGzkWHflgOCk/WsSwDQOu2xKUsov0Qyk+bDIj6XX4IoENgD0uZ13WcHPtNuWlfVgGgqXv4E5FY5Da08xvLraCVvvkRQP9AVyqRumxdQ8Xf8qcOR4qyCADWllrVp34d1f3V6OirDEfRKS1cQUCwITQLVg8NbPpJOWxpFvoA0NKTOAlv/F/j7yRXDEYRDSUCqA08hb8vdtbHngqlgmmlQr1ctaUv8TXOta3K+cNswu7oRjZDtkM25A4HOaiGsgbQ9pf3DxaVU36DQvy0HDArKYKMAGoCf+JDey9t/9RB7wVZj0yyhy4AtPYmFmIK771QbHYmhdU9hUAxCGCk4BVMKT63oy62tZj8suYJVROgtdf4Ojbh+YtyflnNLbhyjdqU9pdRGwuuHpMlD0UNwNqKK151u5rNN7l41W83EKBZhKmRwUvCsDVZ4ANA81ZjcSTC78Hw3sfcKGxFUyGQEQHB/juVEuetXag/mfF5QG4GuQnAW/uMb2gRvlE5f0CsLUxi4oVDtkc2CLUC+yINpOB0fFbVAUfehSr/qjDZlNIlmAigSfDA4IevXRjEY88CFwBO7333wBiv+TOcf0kwzUVJHUYEEAQ2JkT/Pz5ad8gHQdIvUAGgqXfv4REeWwvnx6GZ6lIIyIUAgsCzKZFoXlc35Q25JMsuTWACwOi6/egjEHhOdnXUE4WAvwhgvsAuw0iuDMo+A4EIAK1bE3UsqnVA2MP8LV7FXSGQHwEEgbdY0mztWBjrzZ/a3xTSjwK09Rin86jWpZzfX0NR3O0jQLZKNku2az+XPymlDgDNPSPnMY23Axp1mq4/9qG4Fo9ANdmuZcPF03A9p7QBoK03cYWmRe4GAmq7LtfNQDFwCYEY2TDZskv0SyYrZR8AJldcj57+1SVrV2YE0PbcixN0X8IqyO3Y1OIljYm3hckGBNf6hSb6IymGT7PfNMx+QzP6d7/yaj9BNGP2rBrd1Gs0XavhplaTijB88houzBqusWqT8anYTOVorIo7BtulHw2jmVJm0JasLkYIVnfU6jeUTMhhAtIFACtacu3nDusZNnKvw9Gfg8Nv50xsT5l8OzeN7Z2Lql7zQtGWLYNHCk0/JqKJYwTjx8CIKDDQyUkzveAfWB7CvLK9LvYLmeSXKgBQe4mqTBBKKrn8LjCrV1mwLixH3WCkzA2yDjFZQ7URbRmWY+OPNaIQ1ajNOONBOQrTTF2wtj5+z7jbvn6VxtGsHtPRDj/V5mfsfVS3n4C9bMBfV0dd/HlYCewnUBdv7R05HrG8EX/L0Cw5DdIfFCgN3BE2wUzR1l6vP+oO+cKoShEAaJyfhk0gevn29gu0zzm73zTFnWvb12wM3Tl2OG+xue3bSzSNX8QFOxs1hJrCTDVUqQdE0myUYZ6A7wEgPcNvMwQpv+qiYCnBxXpmmne+Z+x58MmGWUOhMvMsyizufrXyYH3amUzTEAw4HcmGk9fL60J17i3MGDzF7+acrwFgdG5/vBtCzCmz4n9GCHYnM0fu7ji5end56T5R29ZtAzOYFr+Ac3YRmgonTnwa7l8IArtSYqTBz7UDvgWA9Kq+jWW0sMdEz/0DjIsfttfG+sJt2sVp19aXqGWCX4cRBVrmLe0cleK0y5yLFhBhFeESv1YR+hIA0uv515XDkl686ZOo4v6eJ1I3tS+Ov5jZDNTd8Qi0PTlyrIhFvoVuz/NRM4iOfxbG7wgCG7GfQJMf+wn4EQB4W6/xR0T5z4SxMMfplMD3242k8cNHFlbuHHdffbWJwMqtQ3P1qH4dkl+Cv1CPDiEIPICJQmdDT7QMvLs8DwAtPca16An+kXcqesxJsEFU9W8bMoxbNjRU/d1j7qFkt6x78IhKXb8GL43LUJuqCqWSUApB4FoEgZu91M/TAEAbeNI+aqGt1gn2h6FE4irl+O6YsBUIYrGfIgh81h0O/lKl5qKZEku83GjUswBAW3dHY1OeQuGFcPdescMU7PLOOv0Rf02oPLi39BorNc7+HaMG80KnMXYbTib2nuTVluNe9bTyCPbtD53zj54k+z3zzV0nKOf3zhUJa8IcC56+h3pzuOZO4AVp+YpHcHpSA0DEvhqryW7xSCdP2GCqbnsylbxCdfB5AndWJtRRGI1Ef4Gpxm1ZEwXwAYLbNQh0t7otuusBAKerLuJCo3a/7rYyntAX7E201b7SUR/9kyf8FBNbCLT2JD8NG/sP1DKn28ogeSLYmCG4uaSzNrbFTVFdDQDWKb1V1U+ByWw3lfCKNt76XZi9d0G5z97zCu9C+aRnFd6N2kBjoXllTI/xwFf44MBJbp5K7GofgHVEdzic3xSmuKHj4TWnK+eX0VVGZaKyoTKissIdU15J7UlGL07yIXupi0sFHu5crT2Jq7im/cQd6t5RRVVsNxbsXNhZq2NprrqCgkBLn7EMC43uQrNgRlBkzianycyr0BT4Wbbnpdx3JQA09SY+GWHaluC3+8Vjw8bIhY8tqn6zFJBVXn8QWL5lYHqFHr8Lw4XL/ZHAGa5Wf4AwF3bWx55yhuJHVBxvAizt6opGGP9VkJ0fbS9MyhLXtz+0ZqVy/o+MJWjfqOyoDKksrTINmgJpecmX0K/xa/Itp1VwvAYQ9Km+FG1NkbpIpm2bnC70cqRnbTfHI3cG+cWEzWK+2Vmv/9jJ8nM0ADR1D38iGos+i6GYSieF9JDWADqQVnXU6+s95KlYeYRAa4+xgmv8AbAL5s5TmPSUTCTnr2uo+JtTkDnaBIjEIrcF1flRRXzL2qZJOb9TtiUdHQrsVMZU1tIJZ0cgvFgtH7OT1mYaxwJAS0/iC0Edf4VB7GLJ5Kky7NFms9xUsiIRsMoYZW2VeZE0/MxGPta6LXGpUzI40gRo2fLOAVw/cAeITXNKMK/oYHLPcymWaPJzWyavdFV8PkLA2o6OxdbBoeg8g0BdCF57hPHBvM5Fh35YquDO1ACiB3w3kM7PRPdg/8AS5fylmlHw8lOZU9ljuKc7aNJbvgafc0LukmsAtKtvTI/SvvWB2rGF3vxkAI83Hvy+E0AqGsFEYGnXewdV1VRjrUrgagKJhJE8vtRdhUuuAeh6hFYsBcv5aTdWVPuV8wfTaZ2UmmyAbCGAfQKxtO+VBEdJNYD0sEqgNsFAQb812uFX8VJJyKnMoUKgdevw0Swa3QSHCNT5FBi2XlnKsHUpNQBs6sscnZTggUUNYNOl1o6Fyvk9wDpQLCybgG1A6IFACT7qg0W/yIsOAFh/vQrtpgVBAcuaT02TfBbGeoMis5LTWwTINmgiGNmKt5yL50Y+SL5YLIXiAgDOeePcWnJZLF9P86Haj3JNXVRKVclTgRUz3xAgGyFbIZvxTYgCGVu+CJ8sMJuVvKiqQ2vPyPkcx3gXw9CPPLR3HLZXutEP3opnMBHA2RXfwzbkNwRFeoFjxzvq478vVN7Co8Z992Gxn7a6UEb+pRePdT68Zo1//BXnICLQ/vCaH6AS8FhgZCefJN8s8Cq4BoApvxdpmnZHgXx8SY623O6R5PACtaQ3M/y0XyM9cXvfuczc5b9L+wnEoxVPYwVhIDYVMU3zYuwZcGchyBZcA0Dj/xuFMPAxrUk7+Sjnz14CGtO+Sn/ZU5T3E7IdsiGgEIjtxdAheE2hJVZQAGjuM5rQLjq+UCZ+pEev341qG6/syK/YtHcmakhn0R99z56yvJ+QDZEtBQEFms1o+WgBwhYUANDAKDjCFCCLY0lp996O9jXfd4xgCAnF4rF/Gd1phun0PYQqOqYS2ZK1I7RjFN0jVKiP2u4DaNqaODEa1Z52T3SHKNO+/ebwArV7b3Y86Xj2KTWzXsVErqlWKsHe3tv/6iw/jqfOLqVcT2jLca5VPA3MpD93IJk0F6xbGHvGDoK2awCRqHa1HYJ+p0GV9ivK+XOXwpTqIy7c5/yUFIHAupc7W1k/JZsi2woCCIX4qq0AQL2hmBZxnuzKo5r2sDqxJ38pCY1fOTlVpnuT05T7b7It2Fi79DjAVy2ftSGorQAQi8Qvln4zRdovLZXcz7BtYFBWSTDBpRGLOOZPVpru0bPJ99XviQjQeZCyH0hKvko+O1HyzL9sBQBNY1/KnF2eu9jY4V/VQZ35ywPzW7MO++V6lp9yeaQgGzOZuEl2be36bN4A0NxjLJX/HHaxQ+zZdbPsheK3fHSSLoaKzsgmBz2jNNmeq/tpBPbswipYsUNuPPi8Ud/NLWXeAICJP1/OTcL/p6Zgl3e2zhvxXxK5JYhGo1dAwlxlrqXTyK2Iz9KRrZHN+SxGXvZ2fDfnMGBT9weHROJTXkeieF5ufiUQ7A/tddFz/GIfFL5Lu/ZUV9Uc8hrahwfmkhk93R8M9r975OON04K1Lj6XUi49a+tN3ocRlM+6RL5ksijL4VRi7xHrGg58NxuxXG8DFolVniO58w8OJRJXZVNO3f8Igcrqgy7J5/yUmtJQ2o9yqm/ZELBsT7DBbM/9vo+yrCAfziVHzgAAc8iZORdhT54JcduGhqq/e8Ir2EzQvOdU/bd1pdPmrB3aIhTyRJbtwQblVjO3D2cNANbMJ85Pk1i5xJBh3CKxfNKI1tyTbIFTH21XIEpLeeymL+d0aRtMyIoByvI08uVs8mUNAKj/n4VM2Z9no+jRfQxZ/Ua9/e2BrXGRdegvG4Vi8mSjFeb7ZINkixLrqKV9OaOIWR2cC35uxhwS3ETnRjKZNH4kgSjSi7Cyd+R/oGG/omBBkcfKW3DG8stAtkg2KavmuXw5YwCwlopyfqqsCqHn9fdq0o+90omyyFfRmC+4PU95KK89LuWdyrJF2KSsKAj4crYl3xkDgB7XzyjGaDwCwOSJlPQzsTzCIicbOvUGrv/5nIlyPURei0auNOqZhUDaJqXcOIR8mXw6U1FlDACoMsrbASTEA+2L4y9mUkbdm4hA1QHVX0bhT5l41/4vyks07Oco35SWTcI2pUUgi0/vFwBqe3t19Bwul1WRZADmYUuBnbVBJHdgow/QKGKzSSkw8FoILn7oNUu7/Minybcnp98vAMxgJ1Lbv3pyQjl+i2fW1cX+KocsckvROnfVmXiDzy5VSqJBtEqlUw7522tjfVgjYGsjDh/wqE779gTW+wUA9GZKW/2HbHdOkF79yIoADotwrAPPSVpZBQ7JA5ltNJNv7xcAMH1QzgAgWIqZI4E5jMRPe27dlliAfpxPOSYDaFk0HSMYYkJko2SrEl6ZfHtCAGjZ2H8YDEfKXX+xPfN6tdWXPavimvY1eyntp3KDpn3uwUlpbR0GW5VSYvi25ePjhJsQAFhV5Snjnsn11TRV9d9Giazc3D9NcOe3byOaRNuGCCqJzLY6yccnBgAm5AwAgvW/Z+x5UFlWfgT0eMX/Qsed48u3iSbRzi+BSmHZKmxWTiQm+viEAKBxJmUAwNvn/icbZg3JCag8UtEwj2DcNScl2pmGkuRBQA5JyFbJZuWQZqIUk318XwCgveIxYah2YnI5fpmmUNV/G0UxwzzhXHT0HG4jaVFJiDbxKCpzmWWS12Z57aivjxbIvgBQUXNkHW7FJCyn99e2r9kooVzSiSQi2pVuC+UFD7d18IJ+2mbf94JXgTxiaV+3su0LAGjjLSyQkCfJsQ/7E2z1ainnWHsCgE0mbduMBmztXW8zedHJiAfxKppAuWSEzVq2K6G+4319XADYf694OWQXG+SQQ24pcLCHYxN/8mnqJa98ssj9XE7bHX8uxL4AgCmM82UEMynkBFEmrFq2DB4JeVZ5KNOqNE8PWQaPlby2+5GvWwFgaVdXFBOAjpUNYuy08tYj9fEXZJNLNnl4VKeTfqNeyUW8iKdX/ILKh2yXbFg6+eHrls9DMCsAVFY2HO3G2HHJigvWBRrAUF3ZEFjc/WolqnSeL9klnsQ7m1zqvoUADqyybFgqOMjXyedJKCsAiAiTsvrPhKna/3lM56D49M9h049D8yRz/jF4WrydpxwuipLa8JjPWwEA87ylnP9vpFQAyOcNmtj/pN98eZx67idvp3Rwm46sNjzm81YA0Bj/uNtAFEH/9fWLKnYUka9ssjRvM5b7ungLi0ssGcoG8cIVTdvw64XndDcHNgo9ijiMNgGEmOMuuyKoC/FcEbnKKosWyX7Sr1dAyCCDV7oWzUdKWxZzSR8rAGAK8Bx8l+pCz992qQSSTJiW3uGPoyOuzW+xSAaSxW85ZOYvpy3zOYSZZvUic5b15BBK5MfFmVABIAfwnEXynfSbI7ejj7C+xJLFUaJhIiajLWModwb5vlYTmzZbRrBTJlcBIEvBnLLprRrU2i7N8tiH2/zSUZl8YB0AlrLaMvm+FhERqy0gG47cNFQAyFIoB1YceCki+AFZHnt+m2QhmTxnHBCGstoy+T76AMzDZcMRbaa9nYuqXpNNLknkwQ7P/HJJZNknRlomvu+G+rIPAbJlsul9N6T5Yh6ucY17P4kkDwBcqPZ/Noha+5Lo+OPzsj337z6fNyqbfxJIzVmIl2STj3yfRgGmyiYYdp5R1f8shYIOJc9W/WURIettmWXLKrRnD/j/84yVfUZTNSbkqwEwCaOlfUzdS9myZeR/4u1/unscSqXMTx+VsVQ64cuPRQHyTWqD76MGIKSrAeAginfCZwKla6Tp8p/WGwQZSy+JwingTft24bncziGmYgzXh4UkefTChor9eZKU3eOm7g8Owcqyz0mvOGS0ZJVeUG8FlNGmyfexnoMd4i0UNriZmgoAk2CKxqq+jFV/VZNuy/cTMlqyyieZvxLJadMHUx+A43vIl4o0TgFSAWA8iDidFx2jgdmAw5JVnSg8vgThZvLZNMqpgkYB5AsAKdUEGG89bUetWoXJNrPG35P5O8lKMssso9eyCTltOo6VwPJtBa5FzAGvC0hmfuhBlnboLxtuQZQ5my5O3JfSpuH71Ako3VkApmGqJkDa6tr6ErWYZSfliU25HINkJtlzpSmnZzLaNPk++gDkawIYmqECQNo7BNMC9/Yfc+wgyz6mg1OfUto0fJ/6AKSrAex+5VUVAFAwy7cMTEeUDuxRXCQ76eCUEwWZjqQ2jRqAuqRFIB6J/xOEky5AFwBYLK1DAVlUUi8RoACQ8JKhHV4zZs/Cevfyvo6774UY2tGunfTrFbqkA+niFT9Z+Uhq0wkaBRiRDTTd1Ms+AHxs7rzzUDbBrz5DB0sX2YzMY3mktGn4voZ1ytLVADRdK/sAoGn+bffttG+ESZdisZHRpsn3aRRAuhoAN8s7ADT3Gqdi1V+IhtB47ahOxbpP8PNJadPwfSn7AFIRVtY1gAjzf7tvp10ujDoVgpGkNp3ARCAxXIgiXqTlJi/bALBy2yCm/PLPeIGztzz4Z0Z185arLNxktGnyfaoBvCcLSGNycGGWbQCIRvTL0fmHF2bILuhk6RYyteyqI6lNv0edgO/YVcKrdFxj1V7xkolPbe/rVVg29iWZZHJUFuhm6ego0WAQk9Gm4ftvowbApdupxGRcul2KvDCz6WLq57GSTr79GRxSnnQjHR0iFygycto0fwfzAOTbfkvj/OhAla5TwoZo6C8rJOWgYwblpbRp+D71AUhXAxBCHJMBw1Dfau0xVuCcPWz6Ge6LdCRdw63l/tpJatNva8KUrwaAI6/LrwbAwzf0t78bpO+Uk65jIEho0+T7qAFob4zJKMsnVpFNadkyeKQs8rgtR1P38CcQ9Frd5iMNfehq6SyNQO4KQrZMNu0ul2Koa29oKZ7aWUxWt/MITS+bZoAWi14JA8G/8rhIV9K5PLTFxvuS2jL5vtaf2POKjAUR0cqjH6BlyzsHoBp2iYxl4KZMpDPp7iYPWWjLasvk+9qTDbOGhGC7ZQFrTA7sWFoeNQC95gt495ffxCfSmXQvg0tGWyafJ99HIKZL7LI+JPoP1cTwB4DVqzUutMslgt1TUSzdgYGnTH1gJqctj/p8GnwuXz8A5yf4UFaesmxu+84/YHLMxz1lKhEz0p0wkEgkd0SR0pZHfd4KADi04GV3NC+J6swVW4YlPAa7JJ0mZMbrP7Abfk5QpIQfYccgbcMzS4DIlaxjPj8aAEzzeVe4lEhUj2jLSiQhbfaVPSPHY7us0OpnF3jCgLCwmz5o6WS1YZH2eSsA8BR7VkpgeXgDQJTLf9KvVzYRaiwkteExn7cCwNBQ90tYGSTdzkDoHW+EEaIPJVzX8q0fHgqlLgyXVsVrQ1gQJsVTkDYnZj5bNiyVgOTr5PMklBUAHm9sTDIhXpRKSggDwzgM1cPjZJOrVHnikcrLoFxlqXRCkx9YWJiERqFRRVp70cyDDUunFnzd8nkIZgWAUQG5lM2AaMjayUu7uqIIbf8snVH4LhD/51FsfBfEQQF4o4PEHCT1ka/vCwA4zFHKAABnWeag5r6TqpzScBaGv8pmnYNdwAkTwsZu+mCkk9N2x/v6uADAtsoIKnqJT2MhmiyiRYJ71p/b9hEqbGiSF9muhBf6APb5+r4AMNz/Wi9kle6MAMh0UHPbt5dIiGPBIjVvS9SjRrO44Ixlk4EvHsUo+AqnbfYgCTVJpH3dEm1fAHi8cS52BxZ9EgrMcLDERTLKVahMEU29/fNhFhaM5LVZ0Tfq66MlsS8A0E9TsM35CsiP51ywsxd3vxroXvOm3r2Ho+p1jh/4BYknYURYBUnmybKSrZLNTr4vw+/JPj4hAKB6KmUAwJBZzcH6tDNlALBYGaIs9k/o6NKLzV8u+QgjwirI+lq2Sqsdpbwm+vjEADA4JGcAICA1LbDNgJaOHXHB+VektAcJhSKsCDMJRbMnksy2OsnHJwSAziU1b2FCkJTrArjgK1q3DcywVwJypeLTZ5+PCSHT5JJKXmkIK8JMXgmzS0Y2SraaPYWPT+Dblo+PE2FCAKD72Cigc9xzeb7SaTla/AJ5BCpAEsHLftVfAWiNJg0qZmSjkp7slMm39wsAaIPJGQBgFpAtcM2A1m3GEowHLyjYAco8A2FG2AUNBpltNJNv7xcAdrNnNgH0ATmB5ye29SWCdWx2pIy2+3baaAKG3aht8hOdhsEhegNp355Abr8A0FdXZ+AQg8cmpJLph+DXySROLllaNw/NRnvw07nSqGfZESDsCMPsKSR7IrFtkk+Tb09GbL8AYCUQQtpmANoBq9qeHDl2siIy/hbxaDhP+vUKbLSlLQy94lcCH8smYZslkHA3axafzhgAjBHjIUzIwD8pL03EIt+SUrJxQq1ct3sKJoPLfdIvjfhIOuozBiVhSFiO/Zb1M22TGf3Jb5nJl8mnM8mRUeD1p055nQtBfQFyXoKdv3Lr0Fw5hRuVKnLoIdRhKd1ccPQEv4u//5tKmSe31+kn0B99p3v0TEJMD0pjKaFooyJZtgiblFVA8mXy6UzyZQwAlBCbBt6bKYMM99CbGdWjusx9ATgOnktz8g0cmzZ86UCd7pxXXt5+eEdd9F/WnhzrGStL+k736BmlobRWnrEEPn+mscT0ADkvskWySTmly+3LWUFdvmVgeoVeQVEja5DwWeHE0EjiqA0NVX/3WY792Df3GU0Rxtfu98DrG6jeC87uZKmR33acXF3Q4S/WpKtI/POY034R+l1837QzxUTz2lp9ndcQ5uO3rHvwiMp47GWki+VL69Nzc9gYnvnYouo3M/HP6tyUAT2HT2TKJMm9WKWuXyOJLBPEAKj+TfwR7B1hsv8jkmY9Ve87avWbC3V+UobyUF6iQbSIJmoH70xQ1MMfvmKaQ8+0Dcrq/KjMiSeyOT+plTUAWDoLeZsBlnycX0YR2PouyX+tW4ePxpSlZi/Foeo6CrrdNNlnd728fWZHffTyjoUx2t/BkYtoEU2iTTyIl/dNBN48iq0jKjlCxLI92KAjxNwikseHc7ZbUsbQHyKxKT9D+6bCLflKostZVWUs9lPQkGeZrebhSb+jPfh3jCRHfpsrypeE8bjML5xzXOIFxu7HrfutJmI0/nl8v9iLJgLaqjhJzDpR+PJxIvn61bI92KCvQuRgjiA9TD6cIwltvJv7au1N3oUAIPUcfFOIps46/ZHcmrj/9PTedw+M8wNeA6dq17hRNZyz32P3htvba2NSbOAyOgNOuwRNhPMhm5vbew+MiA+PfLTukA9cw9cm4ZZeYyWGKKXrkxgvPgLA3ejczbn9fO4mAKjBuX45nqiM3zXO/l2G5aMxVvNF4OO486er+A+jHX42VcPba6NXyOL8ZA8kC8lEspGMaCI87FIToTqNsa9mSLZGNuerEDaY2/HdvDUA4tPWZ7yEGtg8Gzx9SwJlv4dawI2+CYBNINv+4Tt/wxtwrlMywJGewySOOxLJkd95UcV3Sm6iQ02EWDT+ORjYxVjYc4JjtAXb2f7wDz6BjWJNx2gWSAhv/+/i7f/9ArN5nFzsaK/V0R+V+7IVAFp6jGuxx9mPcpPy+algQ0bKOO6RhZU7/ZCkpTd5Jt4K/1Uyb1TxYdl3m6jir6uL/bVkehIQaOpNfFJj2iWobtJS2ZKbCNjW6jOdddEH/VCNJv3oEf0F6FHpB3+7PE1TfLOzXv9xvvR5mwBEIJUYvh1Vuv0WEuQj7ulzFEg0Ev2FpzzHMdNY8Sf9WlV8Jh5iKXYWVaNh3FeGxfkJItKFdCLdSEfsS/9QKU2EUrAeV2RFfbVsTHLnJ18ln7WjoK0aABFq7UveicTU6yv1hTbomRiy+pOXQjZvGZkf0SPPFMrTOqBBsDuSI8O/e+SUmj2F5g9y+pWb+6dF4xWfw5v0YhygN79QXVJG6sS1i+KeHmbjWC2vUGULTI9m4287aqM0FT3vZTsANG1NnBiNak/npeh3AsHeFObwgmImvxQreltf8tfI+wVb+QV7G45/N9r3t3fWx56ylSfkiVp6Eiehn+ASBAJqIky1qe5/ouOROl09uaytvrSKpyHfdE8YlsAkmTQXrFsYs/VCstUEIFlGCYpHS5DLm6xUQFr8bq9OE1ra++FUVLlyDpOOVnfFn1OMrdrNnp7ZUad/VTn/R+ZAWBAmhA1hhNnrf87XRCDMCfuPqLj4jU6mIpsKgPMDu0ftOj8hZrsGQImlmeNOwuS5hClu6KjXV+dJVvLjth7j20zjP8hMSDwDOe4QQyO/m7wZY+b06u4YAi0b+w/jlRhF0PjFMNMTx+5P+DTFd9rr9TUT7rnwo7XHWA05rneBtOMkC10zUVAAIGlbe41nHR3WcRyCfQQxa1Ws6KzVN+y74/CX2t5efQZfsAtkZ+4jPVrFvwsTKG7vODkmf5Npn+DyfmndlliAIHsJmggX4pU1/q3/+m7x9JxMO904pU1Ln7EMqxHXg57t2rJTvAulQ8PGqEkV1J9SsFJgckuhgvmUXsOWUnfReLRb/KeLE84G7ZmojtI2an+i4al0Ff9ryvmdQ52whGF/jbAljAlrwpywT5eBc8zGUSLbIRvCrYL9ZBwZ774KcXOhzApWrHPng3ehADAxSP4LU5hnVOjxu1zrD9Aip2G8/ioxOHQEDPRMGpt2820kP+LuSkjYEsaENWFO2DOUgStc0e4n2yEbcoW+w0TJJzt2Pnh3oWQLbgIQg9aekfO5FimYWaHCOZZeiOuxrPX7jtFThEKPQFuv8T0scrohKIoKM3VBR30ca0QKuwquARD5jvab7sVCYywMC8aFo6ZWN/eMnBcMaZWUfiNAtkI247cctvnDFy2ftJ3ho4RF1QAoe2tP8izse3X/R6Tk/ma1GYVow8gAdeioSyGQEQH0+K/Am78dVX89YwIJb9ICLEx++2MxohUdAMCMY0TgrxgRWFAMY5/yDGB3m0YnN8vwSQ/F1gUEWrcm6nhU6wJpx1d0uiCuRRJtf+og/SR+iGJ4FNUESDPChDZ2bTFMfcxTzaJah2w7y/iIh2KdRsCyCdgGfgbG+S3RR32wKOen/KUEAEbVaVrYYQkSkP9Q5TmMRaPrmnr3Hh4QkZWYLiNg2QJswrINl3k5SZ58r9QmbUkBgJQxjNTV+Eg4qZjbtFDQcyIstm5p13sHuc1L0ZcbAbIBsgWyCbkl3U+6RNr39ntQyI2SA8D6RRU7sBnHzwthKkNams1YdUB1uwoCMpSGPzJQ2ZMNBGRm6wSQyOfI9ybcLOJHyQHA4pn88EY0QgK3nBVTSxuqaqo3quZAEZYT8CxU5lT2ZANBU8XyNficE3I7EgA6Fx36IUuZMp/UkxUriv4RHu9WHYNZIQrdAyprKvMgvvmtwoCvWT7nQMmg6ePchWHBDQC10TmK3lFCVH2LJc1WNUToHeZ+cKKhPhoJguEf5gf/Unli2K8Lw37LSqUzlt+RGsAYsVQidRmGBofGfgfpkwyCxoCtiSBBElzJahsBKlsq46A6P/mW5WO2Nc6f0NEAsK6h4m/onFidn620KappFpiaNixt+RQtmFWmKFsQCNY4/ziNybfIx8bdKvmrowGApBka2PQTVFMCu9UVTQHVsNDJWgxCO8GoK9gI0HbtWNhDZRqk6b2TQSefIt+afL/U36gNOX+N7vGmbQ0y4KOoiMeGjZELg7Ynv/MlGkyK1vFltByc8eXB1CBthdZ+E+ZCN7aRc+UNR4IKbgZtmnAGG+HL49GKp2lXmAwP1S2JEaAyo7ILuvMTxORLbjg/0XYlABDhztrYz1Bt8XR7buLr9IVazAzaEor2hXNtYxGnhS5neqjyU1lRmVHZBR0K8iHyJbf0cKUJMCZs21/eP1hUVT8FJrPH7gX5E4XRxcyRC7zccjzIeHktO23dTbv3BnUoejJeGJp+hQ8OnNT+qYPem/zMqd+uBgASsrU3sRAVjb8Evz8gDTmdOyDYV7w+fMSpAg8rHexP8WnY2H9g01DX9oD0ErvRPQ/NT3XUxba6ydf1AEDCY4LQ1xGVb3VTEa9pozbQnkwlr/DrLEKv9ZWVH53VR8d1wb7aZJWxGLlgX1djwo/jvf6TZfEkABDT1j7jz5h3fcZkAQL9GxMzsCTzX8WeXTd3ts4bCbQuAROejujm0+Z8Azb1v/HWl/qgzkKhtZb51ur/WGi+YtK71gk4WZjUyOAlmMn035PvB/o3DA9vnhu16XOew5HRKwOtS4CEJ6wJc8I+bM5PPmL5ikfl4VkNgPRp3mos1iJ8I9pqUY/085aNYH8YSiSu2tBQ9XdvGZcHt2Xdg0dUxmI/hdN/Nowao92fNFNiydqF+pNe6edpACCl0BSgalvec8u9AsBxPoINYsfk24YM4xYVCJxB13J8Xb8G07Qvg/NXOUNVPiqo+l/bUasXfLhHKZp4HgAgLEcQuB9BAIdAhvpKYBjnN8mk8SPVUVhcOVMHnx7VaZn5JfiLFUclGLng/A/A+emkKZiNd5cfAYAt7dpZUXXAkdiGiS/xTlV/OFG1Dm+t3/NE6qb2xfEX/ZEiWFzbnhw5VsQi34IrnB/a5uK4IoHzbxz88LWmxxvnDo+77clXXwIAaXZ677sHxngN7chS0GGGnqDiDhOcVSoeYFz8sL021ucOi2BTbetL1GLe63Wo6lPt0LMOaj9Rg/M/mxD9Sx6tO+QDP+TwLQCQsrQtk7UzC2Nz/FDeP544NlywOzGr8O5yn1WYnr13Ad70F6F1mPkYcP8KylXOqOvvSomRhnV1U95wlVEO4r4GAJJrxZbheboe3QxBArlDSw5s8z8SLCW4WM9M8873jD0PPtkwK5CbqeRXdGKKxd2vVh6sTzuTadpFOH0XJ/GwyMQU4f8F53/LMJKnOLGxZylo+R4ASPggnshSCugZ8wrWLzi73zTFnWvb12zEwiMzY7qg3sQinea2by/RNA6nZ2fD6WuCqooDcktzQpUUAYAAbesxTmeatWNLqHt7bRrP+5gK+gQ6hDckhdjwSH38BeTztHfYppy5kvGVPSPHRTlfhqr9MkzaOQ2J1TkMdIaGKdra6/VHc4Hn1TNpAgApTNs2WTu3wGK8AiAIfKi6CPfvYsLcYKTMDX5XG7NhZjXnItoyxumPNaIQy69Zlw0c3Ec5ChPHeK+tj9+TI5mnj6RztLbexBUwoMAdNOJpqTH2OkYUnoNBbedMbE+ZfDs3je2di6pe80KOli2DRwpNPyaiiWME48fAiI5Bz/0J4D3TC/6B5SHMK9vrYr+QSX7pAgCBg4lC12N4cLVMQAVBFgSEvVyI7XBK/IkdGhNvo1+hn5ka+hdEv0ixfi1iDpiG2W9oRv/uV17tJ71mzJ5Vo5t6jaZrNWZKq+YRVoPOuRqmmfhkNSbjU1Ee8xBsjhHccvgpQcBDKhmFuL69Tv++VDJBGCkDAIFENQHBtX+DgNLKKFthKnnkQ4Cq/VyYX5XtzT+GlNTORX0CES1yB4RVHYNjJaY+g4RAImWmLpapzT8ZPKkDAAmbHh34L3wN7H7uk0FXv8sCgQH09n9Glt7+bIhLHwBI8KAf55QNfHU/nAig2h+YY+YCEQDITNIzBh+BwHPCaTZKqzAgAOffhRl+K2Udqp2McWAWXBCgNG+aFk9MVkL9VgjIgADZJtloUJyfMAtMACBhadEErZwC0Bvpt7oUArIgQDZJtunnwp5isAhUACAFadkkrZ0G4A8Uo7DKoxBwGgGyRbJJv5b0lqJPYPoAMijJW3qwvRjna8ph04gM+qtbPiNAm71gzca3O+utbbzQ/A/eFeQAYKFNG41GIvweTBf6WPDgVxIHFgHavTclzvNyA083sApcE2AyCFQAycTek1ANe2jyM/VbIeAGAmRrZHNBd37CJvA1gHEFzLFf/NcxZ/0mNAn0cffVV4WAIwigym/A+b/VOXpiTyCr/JOBCFMAsHSzziLk2r1QbPZkZdVvhUCxCMDbX8Fi3nPdPquvWPmKzRf4JsBkxamA6ERVdM4E/mjyybqp3/4gQLZENhU25yc0Q1cDGG8irT2Jq7C3wI9Uk2A8Kuq7XQSoyo+3/jc76nEaUUivUAcAKrOWnsRJGCr8Nf5OCmkZKrVcQABv/afw98XO+thTLpCXhmTomgCTkaUCHOzfdDI22/wm9mQqi113J2OgfheAAGyEbIVsJuzOT6iEvgYwvuibuoc/EYlFbkNtoHH8ffVdIUAI4I3flUqkLlvXUPG3ckGkrALAWKGiWfAFrmk3QflpY/fUZ/kigB7+PSxlXtdxcuw35YZC6JsAmQoUVbv/FMYH80whbsHzRKY06l5ZIJAgGyBbKEfnpxIuyxrAeNMe3WcgcismEJ0x/r76Hm4EaDafYaSuDtLSXTdKpOwDwBiorT0GHVH1Y/QPLBi7pz7DhwDa+U+jM/jajnp9ffi0K1wjFQAmYsZbe5KrOBc3YJ/74yY+Ur8CjYAQLwjBr++oj9IycjT71UUIlGUfQI6iFzCQP7Y/vGa+wAkueFu8lCOtehQABKgMqSypTKlsIbJy/nHlpmoA48DY7+t990Va5p55ocb5N1AjOH6/5+qGvAgI8Tw6+G7u3PngXeycc1LyCuqvZCoA2MS/uc9owhnW16Df9HSbWVQyXxAQj8Lbb1lbq6/zhX3AmKoAUGCBNW1NnBiJalejInmeWmNQIHguJbfm7HN2Typp3rpuYewZl9iEkqwKAEUW6/ItA9NjkfjFmsa+hFrBvCLJqGwlISB2mCb7VSI1csdji6rfLIlUmWZWAcCBgm/uMZain+DLGEY8C4DGHSCpSGRBAD14I6h9/RHt+1+urdcfz5JM3baJgAoANoGyk6yp+4NDIrHKc1AjOAfzCU5DHjXKYge4/Gng7+IJdODfl0oM3beu4cB382dRKewgoAKAHZSKSNO6bWAGi8TOwjHb5+JI7VMBtMK6ABzxpsepumIT/ruXpRJ/7Di5encB2VVSmwgoo7QJVCnJVmzaO1OP62dgKLEFNYPloKUOOs0M6ADe9I9hWV6nMWI8tP7UKa9nTqbuOoWACgBOIWmTznH3vRCbc9TRp6DnGsGAtZT9/AKM1wOLTmDRuZs9s6mvrs6wCaVK5gACKgA4AGIpJFo29h/GqipPQY33FI0zfPJa0IuVQlPivFh5KfpMwTZDz81scGhz55KatySWN/SiqQAgWREv7dpZUVFzZB0KZiFWKM6Hw8xHLeFY/A7U6MJob714EY7+LFbe4Y9tHe5/rffxxrnDkkFe1uKoABCA4l/a1RWtrGw4WkTYfGxkcjw6Fo9CYJgL55qDqvMMP1VA9R2dc2IXZNmJDruXhWk+z1Ps2aGh7pceb2xM+imb4p0fARUA8mMkdYrF3a9W1sSmzY6ICAKCeTjX+KEQeCr60PEppqKA6ffBgvEKfMYxFhHDvRjG0qlGMdbUSOD+CN7SCdynDVJGOBP0pn4P996Bc7/NuMAne1uY9Km9keKpnf2JPa882TBL7bMIYIJ6/X8QmpCW0hsGOwAAAABJRU5ErkJggg==")
  18889. };
  18890. n.prototype.setScene = function(e) {
  18891. this.createCpm(e),
  18892. this.createBunnyObj(e)
  18893. }
  18894. ,
  18895. n.prototype.updateModel = function() {
  18896. this.model = this.modelManager.getActiveModel()
  18897. }
  18898. ,
  18899. n.prototype.bindEvents = function() {
  18900. this.modelManager.on(E.ActiveModelChanged, this.updateModel.bind(this))
  18901. }
  18902. ,
  18903. n.prototype.updateDefaultsFromModelData = function() {
  18904. this.model.data
  18905. }
  18906. ,
  18907. n.prototype.pointPathDistance = function(e) {
  18908. for (var t = 0, i = 1; i < e.length; i += 1)
  18909. t += e[i - 1].distanceTo(e[i]);
  18910. return t
  18911. }
  18912. ,
  18913. n.prototype.pointPathLengths = function(e) {
  18914. for (var t = [0], i = 1; i < e.length; i += 1)
  18915. t.push(t[i - 1] + e[i - 1].distanceTo(e[i]));
  18916. return t
  18917. }
  18918. ,
  18919. n.prototype.interpAlongPath = function(e, t, i) {
  18920. var n, o = new r.Vector3, a = t[t.length - 1];
  18921. if (i < 1) {
  18922. n = i * a;
  18923. for (var s = 1; s < t.length; s += 1)
  18924. if (t[s] > n) {
  18925. var l = (n - t[s - 1]) / (t[s] - t[s - 1]);
  18926. return o.copy(e[s]),
  18927. o.sub(e[s - 1]),
  18928. o.multiplyScalar(l),
  18929. o.add(e[s - 1]),
  18930. o
  18931. }
  18932. } else
  18933. o.copy(e[e.length - 1]);
  18934. return o
  18935. }
  18936. ,
  18937. n.prototype.pathHeight = function() {
  18938. return this.player.mode !== a.FLOORPLAN ? c.path.height : c.path.outsideHeight
  18939. }
  18940. ,
  18941. n.prototype.createBunnyObj = function(e) {
  18942. this.bunnyObj || (this.bunnyObj = new r.AxisHelper(.1),
  18943. this.bunnyObj.visible = c.warp.showBunny),
  18944. this.bunnyObj.parent && this.bunnyObj.parent.remove(bunnyObj),
  18945. e.add(this.bunnyObj)
  18946. }
  18947. ,
  18948. n.prototype.createCpm = function(e) {
  18949. if (!this.currentPanoMarker) {
  18950. var t = this.makeWaypointObj(w.pathEnd, "Current");
  18951. t.material.uniforms.opacity.value = 0,
  18952. this.currentPanoMarker = {
  18953. mesh: t,
  18954. placed: !1
  18955. }
  18956. }
  18957. this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18958. this.placeCpm(),
  18959. this.currentPanoMarker.mesh.parent || e.add(this.currentPanoMarker.mesh)
  18960. }
  18961. ,
  18962. n.prototype.placeCpm = function() {
  18963. if (c.path.mapGuides && this.player.currentPano && this.player.currentPano.isAligned()) {
  18964. var e = this.player.currentPano.floor;
  18965. this.currentPanoMarker.mesh.parent !== this.player.currentPano.floor && (this.currentPanoMarker.mesh.parent && this.currentPanoMarker.mesh.parent.remove(this.currentPanoMarker.mesh),
  18966. e.add(this.currentPanoMarker.mesh)),
  18967. this.currentPanoMarker.mesh.position.copy(this.player.currentPano.floorPosition).sub(e.position),
  18968. this.currentPanoMarker.mesh.position.y += this.pathHeight(),
  18969. this.currentPanoMarker.placed = !0
  18970. } else
  18971. this.popOutCpm()
  18972. }
  18973. ,
  18974. n.prototype.fadeInCpm = function(e) {
  18975. this.player.mode === a.PANORAMA && this.player.currentPano && !this.player.currentPano.isAligned() || c.path.mapGuides && this.currentPanoMarker.placed && p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 1), e)
  18976. }
  18977. ,
  18978. n.prototype.fadeOutCpm = function(e) {
  18979. p.start(u.property(this.currentPanoMarker.mesh.material.uniforms.opacity, "value", 0), e)
  18980. }
  18981. ,
  18982. n.prototype.popInCpm = function() {
  18983. c.path.mapGuides && this.currentPanoMarker.placed && this.fadeInCpm(2)
  18984. }
  18985. ,
  18986. n.prototype.popOutCpm = function() {
  18987. this.fadeOutCpm(2)
  18988. }
  18989. ,
  18990. n.prototype.brushPrefs = {
  18991. linewidth: 7,
  18992. strokeWidth: 15,
  18993. cvSegments: 48,
  18994. paveStep: .1,
  18995. paveWidth: .2,
  18996. lookBlendDist: 3,
  18997. maxTurn: r.Math.degToRad(2)
  18998. },
  18999. n.prototype.panoPathDistance = function(e) {
  19000. var t = this.model.panos;
  19001. if (!e || e.length < 2)
  19002. return 0;
  19003. for (var i = [], n = 0; n < e.length; n += 1)
  19004. i.push(t.get(e[n]).floorPosition);
  19005. return this.pointPathDistance(i)
  19006. }
  19007. ,
  19008. n.prototype.loadTileTexture = function(e) {
  19009. var t = v.load(e, function(t) {
  19010. t.wrapS = r.RepeatWrapping,
  19011. t.wrapT = r.RepeatWrapping,
  19012. t.needsUpdate = !0,
  19013. y.debug('path texture "' + e + '" is ready')
  19014. }, function() {
  19015. y.error('path texture "' + e + '" failed')
  19016. });
  19017. return t.mapping = r.UVMapping,
  19018. t
  19019. }
  19020. ,
  19021. n.prototype.buildWarpDestinationDescriptor = function(e, t, i, n, r, o) {
  19022. var a = {
  19023. cameraMode: n,
  19024. position: e,
  19025. quaternion: t,
  19026. panoId: i,
  19027. orthoZoom: o,
  19028. floorVisibility: r,
  19029. thumbUrl: null,
  19030. name: null
  19031. };
  19032. return new f(a)
  19033. }
  19034. ,
  19035. n.prototype.buildWarpDestinationDescriptorFromHero = function(e) {
  19036. return this.buildWarpDestinationDescriptor(e.position, e.quaternion, this.getHeroId(e), e.cameraMode, e.floorVisibility, e.orthoZoom)
  19037. }
  19038. ,
  19039. n.prototype.setWarpDestination = function(e) {
  19040. this.warpDestHeroLoc = e
  19041. }
  19042. ,
  19043. n.prototype.setWarpDestinationByHeroIndex = function(e) {
  19044. var t = this.getHeroDescriptorByHeroIndex(e);
  19045. return null !== t && (this.setWarpDestination(t),
  19046. !0)
  19047. }
  19048. ,
  19049. n.prototype.setWarpDestinationByPano = function(e, t) {
  19050. var i = this.model.panos.get(e.id);
  19051. return !!i && this.setWarpDestinationByPanoId(e.id, t)
  19052. }
  19053. ,
  19054. n.prototype.setWarpDestinationByPanoId = function(e, t) {
  19055. var i = this.model.panos.get(e);
  19056. if (i) {
  19057. t = t || new r.Quaternion;
  19058. var n = this.buildWarpDestinationDescriptor(i.position, t, i.id, "panorama", [], -1);
  19059. return this.setWarpDestination(n),
  19060. !0
  19061. }
  19062. return !1
  19063. }
  19064. ,
  19065. n.prototype.getHeroDescriptorByHeroIndex = function(e) {
  19066. var t = this.model.heroCount();
  19067. if (null !== this.warpDestHeroLoc && t < 2)
  19068. return y.info("ShowPath.getHeroDescriptorByHeroIndex() -> Only one hero location is available."),
  19069. this.model.getHeroDescriptorByIndex(0);
  19070. var i = this.model.getHeroDescriptorByIndex(e);
  19071. if (i) {
  19072. var n = i.isPano() ? i.panoId : i.cameraMode;
  19073. y.debug('ShowPath.getHeroDescriptorByHeroIndex() -> New brush/warp destination: "' + n + '" out of ' + t + " choices.")
  19074. }
  19075. return i
  19076. }
  19077. ,
  19078. n.prototype.getHeroDescriptorByPano = function(e) {
  19079. var t = this.model.panos.get(e.id);
  19080. return t ? this.getHeroDescriptorByPanoId(e.id) : null
  19081. }
  19082. ,
  19083. n.prototype.getHeroDescriptorByPanoId = function(e) {
  19084. var t = this.getHeroIndexFromPanoId(e);
  19085. return this.getHeroDescriptorByHeroIndex(t)
  19086. }
  19087. ,
  19088. n.prototype.getHeroIndexFromPanoId = function(e) {
  19089. for (var t = 0; t < this.model.heroLocations.length; t++) {
  19090. var i = this.model.heroLocations[t]
  19091. , n = this.getHeroId(i);
  19092. if (n && n === e)
  19093. return t
  19094. }
  19095. return -1
  19096. }
  19097. ,
  19098. n.prototype.getHeroPano = function(e) {
  19099. if (null === e)
  19100. return y.warn("getHeroPano(): no destination"),
  19101. null;
  19102. var t = this.getHeroId(e)
  19103. , i = this.model.panos.get(t);
  19104. return void 0 === i && (i = null,
  19105. "" !== t && y.debug('unable to find pano "' + t + '"')),
  19106. i
  19107. }
  19108. ,
  19109. n.prototype.getHeroId = function(e) {
  19110. return e.panoId
  19111. }
  19112. ,
  19113. n.prototype.setWarpDestPano = function() {
  19114. return this.warpDestPano = this.getHeroPano(this.warpDestHeroLoc),
  19115. this.warpDestPano
  19116. }
  19117. ,
  19118. n.prototype.brushToWarpPano = function(e, t) {
  19119. if (this.discardPathObject(),
  19120. !this.setWarpDestPano())
  19121. return !1;
  19122. if (this.warpDestHeroLoc.cameraMode !== a.PANORAMA && y.warn("Can only brush from pano to pano"),
  19123. !this.warpDestPano)
  19124. return y.info("No brush"),
  19125. !1;
  19126. if (!this.player.currentPano)
  19127. return y.debug("No current pano, visibility undefined"),
  19128. !1;
  19129. if (!this.warpDestPano)
  19130. return y.info("No wPano, visibility undefined"),
  19131. !1;
  19132. if (!this.warpDestPano.isAligned())
  19133. return y.debug("Cannot brush to unaligned pano"),
  19134. !1;
  19135. var i = (e === l.STD || e === l.WALK) && c.path.mapGuides
  19136. , n = !0;
  19137. if (this.player.currentPano.id === this.warpDestPano.id)
  19138. y.debug("Already at destination pano");
  19139. else {
  19140. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19141. n = void 0 === this.nodes || null === this.nodes || this.nodes.length < 1,
  19142. this.obj3d = new r.Object3D,
  19143. y.debug('Brushing from "' + this.player.currentPano.id + '" to "' + this.warpDestPano.id + '" (' + (this.nodes ? this.nodes.length : 0) + ")"),
  19144. n ? (y.info('No "walkable" route, using fall-back warp style transition'),
  19145. e = t) : (this.setPathHulls(this.nodes),
  19146. this.setFloorCurves(),
  19147. i && ("chevron" === c.path.style ? this.obj3d.add(this.drawPathPavement(this.floorCurvePoints)) : "ribbon" === c.path.style && this.obj3d.add(this.drawPathRibbon(this.floorCurvePoints, this.floorCurveColors)))),
  19148. this.player.currentPano.floor.add(this.obj3d);
  19149. var o = this.player.mode === a.DOLLHOUSE || this.player.mode === a.FLOORPLAN
  19150. , s = e === l.STD;
  19151. if (!n && (i || s)) {
  19152. if (o) {
  19153. var h = this.makeStartMarker(this.floorHull[0], this.floorCurvePoints);
  19154. this.obj3d.add(h)
  19155. }
  19156. var u = this.makeEndMarker(this.floorHull[this.floorHull.length - 1]);
  19157. this.obj3d.add(u)
  19158. }
  19159. this.appearSlow()
  19160. }
  19161. return this.upcomingTransType = e,
  19162. !n
  19163. }
  19164. ,
  19165. n.prototype.findShortestPath = function(e, t) {
  19166. if (!e || !t)
  19167. return null;
  19168. var i = c.warp.walkExtraPanosDistance
  19169. , n = e.id + ":" + t.id + ":" + i;
  19170. if (this.shortPaths.hasOwnProperty(n))
  19171. return this.shortPaths[n] ? this.shortPaths[n].slice() : null;
  19172. var r = t.id + ":" + e.id + ":" + i;
  19173. if (this.shortPaths.hasOwnProperty(r))
  19174. return this.shortPaths[r] ? this.shortPaths[r].slice().reverse() : null;
  19175. var o = this.model.panos.aStarSearch(e, t);
  19176. return this.model.panos.includeNodesNearPath(o, i),
  19177. this.shortPaths[n] = o ? o.slice() : null,
  19178. o
  19179. }
  19180. ,
  19181. n.prototype.makePathHulls = function(e) {
  19182. var t, i, n, r, o, a = 0, s = [], l = [], h = [], u = this.model.panos;
  19183. t = u.get(e[0]),
  19184. r = t.floor.floorIndex;
  19185. for (var d = 0; d < e.length; d += 1)
  19186. t = u.get(e[d]),
  19187. i = t.floorPosition.clone().sub(this.model.position),
  19188. i.y += this.pathHeight(),
  19189. s.push(i),
  19190. l.push(t.position.clone()),
  19191. n = t.floor.floorIndex,
  19192. h.push(n > r ? c.path.colorUp : n < r ? c.path.colorDown : c.path.color),
  19193. d > 0 && (o = l[d].distanceTo(l[d - 1]),
  19194. o > a && (a = o));
  19195. return a > this.longestStep && (this.longestStep = a,
  19196. y.debug("path contains " + a + " meter segment")),
  19197. {
  19198. floor: s,
  19199. camera: l,
  19200. color: h
  19201. }
  19202. }
  19203. ,
  19204. n.prototype.makeFloorCurves = function(e, t, i) {
  19205. var n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19206. , o = this.pointPathDistance(e) - 2 * n
  19207. , s = e.slice(0)
  19208. , l = s[1].clone().sub(s[0]);
  19209. l.y = 0,
  19210. l.normalize().multiplyScalar(n),
  19211. s[0] = (new r.Vector3).copy(s[0]).add(l),
  19212. l = s[s.length - 2].clone().sub(s[s.length - 1]),
  19213. l.y = 0,
  19214. l.normalize().multiplyScalar(n),
  19215. s[s.length - 1] = (new r.Vector3).copy(s[s.length - 1]).add(l);
  19216. var h = new r.CatmullRomCurve3(s)
  19217. , u = Math.floor(o / i);
  19218. u = 4 * Math.floor(u / 4),
  19219. u = Math.max(4, u);
  19220. for (var d, p, f, g = h.getSpacedPoints(u), m = [], v = new r.Vector3, A = 0; A < g.length; A += 1) {
  19221. f = 0,
  19222. d = g[A].distanceTo(e[0]);
  19223. for (var y = 1; y < e.length; y += 1)
  19224. v.copy(g[A]).sub(e[y]),
  19225. v.y *= 4,
  19226. p = v.length(),
  19227. p < d && (f = y);
  19228. m.push(t[f])
  19229. }
  19230. return {
  19231. distance: o,
  19232. points: g,
  19233. colors: m
  19234. }
  19235. }
  19236. ,
  19237. n.prototype.makeCameraCurvePoints = function(e, t) {
  19238. var i = this.pointPathDistance(e)
  19239. , n = new r.CatmullRomCurve3(e);
  19240. return n.getSpacedPoints(Math.max(2, Math.floor(i / t)))
  19241. }
  19242. ,
  19243. n.prototype.makeCameraCurveTangents = function(e, t) {
  19244. var i = this.pointPathDistance(e)
  19245. , n = new r.CatmullRomCurve3(e)
  19246. , o = Math.max(2, Math.floor(i / t));
  19247. o || (o = 5);
  19248. for (var a = [], s = 0; s <= o; s++)
  19249. a.push(n.getTangentAt(s / o));
  19250. return a
  19251. }
  19252. ,
  19253. n.prototype.setPathHulls = function(e) {
  19254. var t = this.makePathHulls(e);
  19255. this.floorHull = t.floor,
  19256. this.cameraHull = t.camera,
  19257. this.colorHull = t.color
  19258. }
  19259. ,
  19260. n.prototype.setFloorCurves = function() {
  19261. var e = this.makeFloorCurves(this.floorHull, this.colorHull, this.brushPrefs.paveStep);
  19262. this.floorPathDistance = e.distance,
  19263. this.floorCurvePoints = e.points,
  19264. this.floorCurveColors = e.colors
  19265. }
  19266. ,
  19267. n.prototype.setCameraCurvePoints = function() {
  19268. this.camCurvePoints = this.makeCameraCurvePoints(this.cameraHull, c.warp.stepFactor * this.brushPrefs.paveStep)
  19269. }
  19270. ,
  19271. n.prototype.chooseWarpPath = function(e) {
  19272. var t, i, n, o = this.playerControls.cameras[a.PANORAMA];
  19273. if (this.player.currentPano === this.warpDestPano || !e)
  19274. return this.warpPathPoints = null,
  19275. this.warpLength = 0,
  19276. !1;
  19277. this.nodes = this.findShortestPath(this.player.currentPano, this.warpDestPano),
  19278. void 0 === this.nodes || null === this.nodes || this.nodes.length < 1 ? (y.debug("warp path to unreachable node"),
  19279. t = this.warpDestPano.position.clone().sub(o.position),
  19280. i = t.clone().negate(),
  19281. t.multiplyScalar(.15).add(o.position),
  19282. i.multiplyScalar(.15).add(this.warpDestPano.position),
  19283. t.y = o.position.y,
  19284. i.y = this.warpDestPano.position.y,
  19285. n = new r.CubicBezierCurve3(o.position.clone(),t,i,this.warpDestPano.position.clone()),
  19286. this.warpPathPoints = n.getSpacedPoints(this.brushPrefs.cvSegments)) : (y.debug("follow warp path (path distance was " + this.nodes.length + " nodes, " + this.floorPathDistance + ")"),
  19287. this.setCameraCurvePoints(),
  19288. this.warpPathPoints = this.camCurvePoints.slice(0)),
  19289. this.warpLength = 0,
  19290. this.warpPathLengths = [0];
  19291. for (var s = new r.Vector3, l = new r.Vector3, h = Math.cos(r.Math.degToRad(c.warp.minBrakeAngle)), u = Math.cos(r.Math.degToRad(c.warp.maxBrakeAngle)), d = 1; d < this.warpPathPoints.length; d += 1) {
  19292. s.copy(this.warpPathPoints[d - 1]).sub(this.warpPathPoints[d]);
  19293. var p = s.length();
  19294. s.y *= c.warp.climbEffort;
  19295. var f = s.length() / p;
  19296. if (d > 1) {
  19297. s.setY(0).normalize(),
  19298. l.copy(this.warpPathPoints[d - 2]).sub(this.warpPathPoints[d - 1]).setY(0).normalize();
  19299. var g = Math.min(1, s.dot(l))
  19300. , m = 1 + (c.warp.brakeStrength - 1) * (1 - r.Math.smoothstep(g, u, h));
  19301. f = Math.max(m, f)
  19302. }
  19303. this.warpLength += p * f,
  19304. this.warpPathLengths[d] = this.warpLength
  19305. }
  19306. return !0
  19307. }
  19308. ,
  19309. n.prototype.drawPathRibbon = function(e, t) {
  19310. this.bunnyObj.visible = c.warp.showBunny;
  19311. for (var i = .6 * c.path.ribbonWidth * .5, n = new r.Vector3, o = new r.Vector3(0,this.pathHeight(),0), l = new r.Geometry, h = new r.Vector3, u = 0; u < e.length; u += 1) {
  19312. h.copy(e[u]),
  19313. 0 === u ? h.sub(e[u + 1]) : h.sub(e[u - 1]).negate(),
  19314. h.normalize(),
  19315. n.crossVectors(h, A.UP),
  19316. n.multiplyScalar(i);
  19317. var d = (new r.Vector3).copy(e[u]).add(o);
  19318. d.sub(n),
  19319. l.vertices.push(d),
  19320. d = (new r.Vector3).copy(e[u]).add(o),
  19321. d.add(n),
  19322. l.vertices.push(d)
  19323. }
  19324. var p, f = 0;
  19325. for (u = 0; u < e.length - 1; u += 1) {
  19326. var g = 2 * u
  19327. , v = f;
  19328. f += e[u + 1].distanceTo(e[u]);
  19329. var y = f
  19330. , C = t[u]
  19331. , I = t[u + 1];
  19332. p = new r.Face3(g,g + 1,g + 2),
  19333. p.vertexColors = [new r.Color(C), new r.Color(C), new r.Color(I)],
  19334. l.faces.push(p),
  19335. l.faceVertexUvs[0].push([new r.Vector2(0,v), new r.Vector2(1,v), new r.Vector2(0,y)]),
  19336. p = new r.Face3(g + 2,g + 1,g + 3),
  19337. p.vertexColors = [new r.Color(I), new r.Color(C), new r.Color(I)],
  19338. l.faces.push(p),
  19339. l.faceVertexUvs[0].push([new r.Vector2(0,y), new r.Vector2(1,v), new r.Vector2(1,y)])
  19340. }
  19341. l.computeFaceNormals(),
  19342. l.computeVertexNormals();
  19343. var E, b;
  19344. this.player.mode === a.PANORAMA ? (b = r.UniformsUtils.clone(m.ribbon.uniforms),
  19345. b.map.value = w.path,
  19346. b.opacity.value = 0,
  19347. b.color.value.set(c.path.color),
  19348. E = new r.RawShaderMaterial({
  19349. side: r.DoubleSide,
  19350. depthWrite: !1,
  19351. transparent: !0,
  19352. vertexShader: m.ribbon.vertexShader,
  19353. fragmentShader: m.ribbon.fragmentShader,
  19354. uniforms: b,
  19355. name: "ribbonT",
  19356. opacity: 0
  19357. })) : E = new r.MeshBasicMaterial({
  19358. color: 16777215,
  19359. side: r.DoubleSide,
  19360. name: "ribbonOut",
  19361. vertexColors: r.VertexColors
  19362. });
  19363. var _ = new r.Mesh(l,E);
  19364. return _.name = "ribbon",
  19365. this.player.mode === a.PANORAMA && (_.renderOrder = s.ribbon),
  19366. _
  19367. }
  19368. ,
  19369. n.prototype.drawPathPavement = function(e) {
  19370. for (var t, i = .25, n = new r.Vector3, o = new r.Geometry, s = new r.Vector3, l = 0; l < e.length; l += 1)
  19371. s.copy(e[l]),
  19372. 0 === l ? s.sub(e[l + 1]).negate() : s.sub(e[l - 1]),
  19373. s.normalize(),
  19374. n.crossVectors(s, A.UP),
  19375. n.multiplyScalar(this.brushPrefs.paveWidth),
  19376. t = (new r.Vector3).copy(e[l]),
  19377. t.sub(n),
  19378. o.vertices.push(t),
  19379. o.vertices.push((new r.Vector3).copy(e[l])),
  19380. t = (new r.Vector3).copy(e[l]),
  19381. t.add(n),
  19382. o.vertices.push(t);
  19383. var h, u, d;
  19384. for (l = 0; l < e.length - 1; l += 1)
  19385. h = 3 * l + 1,
  19386. u = l * i,
  19387. d = u + i,
  19388. o.faces.push(new r.Face3(h - 1,h,h + 3)),
  19389. o.faceVertexUvs[0].push([new r.Vector2(0,u), new r.Vector2(.5,u), new r.Vector2(.5,d)]),
  19390. o.faces.push(new r.Face3(h + 3,h + 2,h - 1)),
  19391. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(0,d), new r.Vector2(0,u)]),
  19392. o.faces.push(new r.Face3(h + 3,h,h + 1)),
  19393. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(.5,u), new r.Vector2(1,u)]),
  19394. o.faces.push(new r.Face3(h + 3,h + 1,h + 4)),
  19395. o.faceVertexUvs[0].push([new r.Vector2(.5,d), new r.Vector2(1,u), new r.Vector2(1,d)]);
  19396. var p = this.player.mode === a.PANORAMA ? new r.MeshBasicMaterial({
  19397. color: c.path.color,
  19398. side: r.DoubleSide,
  19399. transparent: !0,
  19400. depthWrite: !1,
  19401. opacity: 0,
  19402. name: "paveT",
  19403. map: w.path
  19404. }) : new r.MeshBasicMaterial({
  19405. color: c.path.color,
  19406. side: r.DoubleSide,
  19407. transparent: !0,
  19408. depthWrite: !1,
  19409. opacity: 1,
  19410. name: "paveO",
  19411. map: w.path
  19412. });
  19413. return new r.Mesh(o,p)
  19414. }
  19415. ,
  19416. n.prototype.hintPrefs = {
  19417. rad: .18,
  19418. width: .0125,
  19419. depth: .0625,
  19420. setBack: -.04,
  19421. markRad: .25,
  19422. markInnerRad: .16
  19423. },
  19424. n.prototype.makeWaypointObj = function(e, t) {
  19425. var i = new r.Geometry
  19426. , n = this.player.mode === a.PANORAMA ? c.path.waypointIndoorRadius : c.path.waypointRadius
  19427. , o = this.pathHeight();
  19428. 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)),
  19429. i.faces.push(new r.Face3(0,1,2), new r.Face3(2,3,0)),
  19430. i.faceVertexUvs[0].push([new r.Vector2(0,0), new r.Vector2(1,0), new r.Vector2(1,1)]),
  19431. i.faceVertexUvs[0].push([new r.Vector2(1,1), new r.Vector2(0,1), new r.Vector2(0,0)]);
  19432. var s = r.UniformsUtils.clone(m.waypoint.uniforms);
  19433. s.map.value = e,
  19434. s.opacity.value = 0,
  19435. s.color.value.set(c.path.color);
  19436. var l = {
  19437. side: r.DoubleSide,
  19438. depthWrite: !1,
  19439. transparent: !0,
  19440. vertexShader: m.waypoint.vertexShader,
  19441. fragmentShader: m.waypoint.fragmentShader,
  19442. uniforms: s,
  19443. name: "waypoint",
  19444. opacity: 0
  19445. };
  19446. this.player.mode !== a.PANORAMA && (l.depthTest = !1,
  19447. l.name = "wayPtOut");
  19448. var h = new r.RawShaderMaterial(l)
  19449. , u = new r.Mesh(i,h);
  19450. return u.name = t,
  19451. u
  19452. }
  19453. ,
  19454. n.prototype.makeStartMarker = function(e, t) {
  19455. var i = (new r.Vector3).copy(t[1]).sub(t[0]);
  19456. i.y = 0,
  19457. i.normalize();
  19458. var n = Math.acos(i.x)
  19459. , o = this.makeWaypointObj(w.pathStart, "Start");
  19460. return o.rotateOnAxis(new r.Vector3(0,1,0), n),
  19461. o.position.copy(e),
  19462. o
  19463. }
  19464. ,
  19465. n.prototype.makeEndMarker = function(e) {
  19466. var t = this.makeWaypointObj(w.pathEnd, "End")
  19467. , i = this.model.panos.get(this.nodes[0]).floor.floorIndex
  19468. , n = this.model.panos.get(this.nodes[this.nodes.length - 1]).floor.floorIndex;
  19469. return i < n ? t.material.uniforms.color.value.set(c.path.colorUp) : i > n && t.material.uniforms.color.value.set(c.path.colorDown),
  19470. t.position.copy(e),
  19471. t
  19472. }
  19473. ,
  19474. n.prototype.pathClean = function(e) {
  19475. if (e) {
  19476. for (var t in e.children)
  19477. this.pathClean(e.children[t]);
  19478. e.geometry && e.geometry.dispose(),
  19479. e.material && e.material.dispose()
  19480. }
  19481. }
  19482. ,
  19483. n.prototype.discardPathObject = function() {
  19484. if (this.obj3d) {
  19485. var e = this.obj3d.parent;
  19486. e && e.remove(this.obj3d),
  19487. this.pathClean(this.obj3d)
  19488. }
  19489. this.obj3d = null,
  19490. this.popInCpm()
  19491. }
  19492. ,
  19493. n.prototype.discardSlow = function() {
  19494. if (this.obj3d) {
  19495. if (this.player.mode !== a.PANORAMA)
  19496. return void this.discardPathObject();
  19497. for (var e, t = this, i = 0, n = function() {
  19498. this.discardPathObject()
  19499. }
  19500. .bind(this), r = 0; r < t.obj3d.children.length; r += 1)
  19501. e = t.obj3d.children[r],
  19502. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", 0), c.path.fadeOutTime, n, 0, d[c.warp.blendEasing]),
  19503. i += 1,
  19504. n = null);
  19505. 0 === i && this.discardPathObject(),
  19506. this.player.mode !== a.PANORAMA && this.fadeInCpm(c.path.fadeInTime - 3)
  19507. }
  19508. }
  19509. ,
  19510. n.prototype.appearSlow = function() {
  19511. var e, t = this;
  19512. this.fadeOutCpm(c.path.fadeInTime);
  19513. for (var i = this.player.mode === a.PANORAMA ? c.path.opacity : 1, n = 0; n < t.obj3d.children.length; n += 1)
  19514. e = t.obj3d.children[n],
  19515. void 0 !== e.material && e.material.transparent === !0 && (void 0 !== e.material.uniforms ? p.start(u.property(e.material.uniforms.opacity, "value", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]) : p.start(u.property(e.material, "opacity", i), c.path.fadeInTime, null, 0, d[c.warp.blendEasing]))
  19516. }
  19517. ,
  19518. n.prototype.update = function() {
  19519. this.obj3d && this.obj3d.updateMatrixWorld()
  19520. }
  19521. ,
  19522. n.prototype.calcBurnsAmount = function(e) {
  19523. var t = r.Math.degToRad(c.warp.burnsAngle);
  19524. if (this.player.mode === a.PANORAMA) {
  19525. var i = this.burnsDir * t;
  19526. if (this.upcomingTransType === l.BLACK)
  19527. return i;
  19528. var n = e;
  19529. if (null === n)
  19530. return y.warn("Transition request for non-highlight"),
  19531. i;
  19532. var o = this.getHeroDescriptorByHeroIndex(n);
  19533. if (null === o)
  19534. return i;
  19535. if (!o.isPano())
  19536. return i;
  19537. var s = this.getHeroPano(o)
  19538. , h = this.playerControls.cameras[a.PANORAMA]
  19539. , u = A.FORWARD.clone().applyQuaternion(h.quaternion).setY(0).normalize()
  19540. , d = Math.min(r.Math.degToRad(c.warp.minBurnsAngle), t)
  19541. , p = function(e) {
  19542. var i = Math.acos(Math.min(1, e.dot(u)))
  19543. , n = (new r.Vector3).crossVectors(u, e);
  19544. return Math.max(d, Math.min(Math.abs(i), t)) * Math.sign(n.y)
  19545. };
  19546. if (s === this.player.currentPano)
  19547. return i = p(A.FORWARD.clone().applyQuaternion(o.quaternion).setY(0).normalize());
  19548. var f = this.findShortestPath(this.player.currentPano, s);
  19549. if (void 0 === f || null === f || f.length < 1)
  19550. return y.debug("Empty path ahead..."),
  19551. i;
  19552. var g = this.makePathHulls(f)
  19553. , m = new r.CatmullRomCurve3(g.camera)
  19554. , v = Math.min(.1, c.warp.lookAheadDist / m.getLength());
  19555. return i = p(m.getPointAt(v).clone().sub(h.position).setY(0).normalize())
  19556. }
  19557. return this.player.mode === a.DOLLHOUSE ? .02 * this.burnsDir : this.burnsDir
  19558. }
  19559. ,
  19560. n.prototype.waitNextStep = function(e, t, time) {//xzw 改时间
  19561. var i = (time==void 0)? c.warp.tourStepDelay : time; //
  19562. i || (i = this.lastTransType === l.BLACK ? b.tourStepDelaySlideShow : b.tourStepDelayDefault);
  19563. var n = new r.Euler
  19564. , o = new r.Vector3;
  19565. y.debug("Starting wait: " + (void 0 !== t));
  19566. var s = this.calcBurnsAmount(e)
  19567. , h = function() {
  19568. this.endWarpState(),
  19569. this.player.mode === a.DOLLHOUSE && (this.playerControls.cameras[a.DOLLHOUSE].controls.rotationAcceleration.x = 0),
  19570. t && t()
  19571. }
  19572. .bind(this)
  19573. , u = function(e, t) {
  19574. if (this.warpInterrupted)
  19575. return h(),
  19576. !0;
  19577. var r = t || 1e3 / 60;
  19578. if (c.warp.doBurns)
  19579. if (this.player.mode === a.PANORAMA) {
  19580. var l = this.playerControls.cameras[a.PANORAMA];
  19581. n.setFromQuaternion(l.quaternion, c.warp.eOrder);
  19582. var u = r * s / i;
  19583. n.y += u,
  19584. o.set(0, 0, -1),
  19585. o.applyEuler(n),
  19586. o.add(l.position),
  19587. l.controls.lookAt(o),
  19588. l.controls.lookVector.copy(o),
  19589. l.lookAt(o)
  19590. } else
  19591. this.player.mode === a.DOLLHOUSE ? this.playerControls.controls[a.DOLLHOUSE].rotationAcceleration.x = s : this.playerControls.controls[a.FLOORPLAN].absoluteScale *= .9996
  19592. }
  19593. .bind(this);
  19594. this.startWarpState(),
  19595. p.start(u, i, h, 0, d.easeInOutQuad, "wait")
  19596. }
  19597. ,
  19598. n.prototype.warpToNonPano = function(e) {
  19599. if (this.discardPathObject(),
  19600. this.warpDestHeroLoc.cameraMode === a.DOLLHOUSE || this.warpDestHeroLoc.cameraMode === a.FLOORPLAN) {
  19601. var t = function() {
  19602. e && e()
  19603. }
  19604. .bind(this);
  19605. this.player.flyToNewMode({
  19606. mode: this.warpDestHeroLoc.cameraMode,
  19607. duration: c.warp.outsideTime,
  19608. warpDest: this.warpDestHeroLoc,
  19609. callback: t,
  19610. force: !0
  19611. })
  19612. } else
  19613. y.warn("no warp destination!!!"),
  19614. e && e()
  19615. }
  19616. ,
  19617. n.prototype._resetWarpShaderParams = function(e) {
  19618. this.player.mode === a.PANORAMA && (void 0 !== e.material.uniforms.blackout && (e.material.uniforms.blackout.value = 0),
  19619. void 0 !== e.material.uniforms.modelAlpha && (e.material.uniforms.modelAlpha.value = 0))
  19620. }
  19621. ,
  19622. n.prototype._clearWarpShading = function() {
  19623. for (var e = this.model.chunks, t = 0; t < e.length; t += 1)
  19624. this._resetWarpShaderParams(e[t]),
  19625. e[t].visible = !0;
  19626. this._resetWarpShaderParams(this.model.skybox)
  19627. }
  19628. ,
  19629. n.prototype._warpStopFlying = function() {
  19630. this.activeTransType = null,
  19631. this.placeCpm()
  19632. }
  19633. ,
  19634. n.prototype._wrapupTravelOnlyBits = function() {
  19635. this._warpStopFlying(),
  19636. this.warpPathPoints && (this.player.currentPano.exit(),
  19637. this.warpDestPano.enter(),
  19638. this.player.currentPano = this.warpDestPano),
  19639. this.player.spider.draw(),
  19640. this.placeCpm()
  19641. }
  19642. ,
  19643. n.prototype._wrapupTravel = function(e) {
  19644. this._wrapupTravelOnlyBits(),
  19645. this.warpCameraAim(e)
  19646. }
  19647. ,
  19648. n.prototype._wrapupWarpShading = function(e) {
  19649. this._clearWarpShading(),
  19650. this._wrapupTravel(e)
  19651. }
  19652. ,
  19653. n.prototype.wrapupWarpShadingOnly = function(e, t) {
  19654. t !== I.END && this._clearWarpShading(),
  19655. this._wrapupTravelOnlyBits(),
  19656. this.upcomingTransType = null,
  19657. e && e()
  19658. }
  19659. ,
  19660. n.prototype._warpCameraAim = function(e, t) {
  19661. var i = this.warpDestHeroLoc.quaternion
  19662. , n = this.playerControls.cameras[a.PANORAMA]
  19663. , o = new r.Vector3(0,0,1).applyQuaternion(i).normalize()
  19664. , s = new r.Vector3(0,0,1).applyQuaternion(n.quaternion).normalize()
  19665. , l = s.dot(o)
  19666. , u = r.Math.radToDeg(Math.acos(l))
  19667. , f = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(i, c.warp.eOrder)
  19668. , g = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19669. , m = new r.Euler(f.x - g.x,f.y - g.y,f.z - g.z,c.warp.eOrder);
  19670. m.y = h.constrainedTurn(m.y),
  19671. this.burnsDir = Math.sign(m.y);
  19672. var v = new r.Euler(0,0,0,c.warp.eOrder)
  19673. , A = new r.Vector3
  19674. , C = function(e, t) {
  19675. return !!this.warpInterrupted || (v.x = g.x + e * m.x,
  19676. v.y = g.y + e * m.y,
  19677. v.z = g.z + e * m.z,
  19678. A.set(0, 0, -1),
  19679. A.applyEuler(v),
  19680. A.add(n.position),
  19681. n.controls.lookAt(A),
  19682. n.controls.lookVector.copy(A),
  19683. void n.lookAt(A))
  19684. }
  19685. .bind(this);
  19686. return u > c.warp.minRotation ? p.start(C, e, t, 0, d[c.warp.movementEasing]) : (y.debug("Aim angle only is " + u.toPrecision(3) + " degrees, skipping explicit re-aim"),
  19687. void (t && t()))
  19688. }
  19689. ,
  19690. n.prototype._warpBendAim = function(e, t, i, n) {
  19691. var o = n || 0
  19692. , s = this.playerControls.cameras[a.PANORAMA]
  19693. , l = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19694. , u = (new r.Euler).setFromQuaternion(s.quaternion, c.warp.eOrder)
  19695. , f = new r.Euler(l.x - u.x,l.y - u.y,l.z - u.z,c.warp.eOrder);
  19696. f.y = h.constrainedTurn(f.y);
  19697. var g = Math.min(r.Math.degToRad(c.warp.softBendTilt), Math.abs(f.x));
  19698. f.x = g * Math.sign(f.x),
  19699. g = Math.min(r.Math.degToRad(Math.max(0, c.warp.softBendAngle)), g),
  19700. this.burnsDir = Math.sign(f.y),
  19701. g *= Math.sign(f.y),
  19702. f.y = g;
  19703. var m = new r.Euler(0,0,0,c.warp.eOrder)
  19704. , v = new r.Vector3
  19705. , A = function(e, t) {
  19706. if (e < .5)
  19707. m.x = u.x + e * f.x,
  19708. m.y = u.y + e * f.y,
  19709. m.z = u.z + e * f.z;
  19710. else {
  19711. var i = (1 - e) * c.warp.softBendEnd;
  19712. m.x = l.x - i * f.x,
  19713. m.y = l.y - i * f.y,
  19714. m.z = l.z - i * f.z
  19715. }
  19716. v.set(0, 0, -1),
  19717. v.applyEuler(m),
  19718. v.add(s.position),
  19719. s.controls.lookAt(v),
  19720. s.controls.lookVector.copy(v),
  19721. s.lookAt(v)
  19722. }
  19723. .bind(this);
  19724. return p.start(A, t, i, o, d[c.warp.movementEasing])
  19725. }
  19726. ,
  19727. n.prototype._warpStepCameraAim = function(e, t, i) {
  19728. var n = this.playerControls.cameras[a.PANORAMA]
  19729. , o = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19730. , s = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder)
  19731. , l = new r.Euler(o.x - s.x,o.y - s.y,o.z - s.z,c.warp.eOrder);
  19732. l.y = h.constrainedTurn(l.y),
  19733. this.burnsDir = Math.sign(l.y);
  19734. var u = new r.Euler(0,0,0,c.warp.eOrder)
  19735. , f = new r.Vector3
  19736. , g = function(e, t) {
  19737. e < .5 ? u.copy(s) : u.copy(o),
  19738. f.set(0, 0, -1),
  19739. f.applyEuler(u),
  19740. f.add(n.position),
  19741. n.controls.lookAt(f),
  19742. n.controls.lookVector.copy(f),
  19743. n.lookAt(f)
  19744. }
  19745. .bind(this);
  19746. return p.start(g, t, i, 0, d[c.warp.movementEasing])
  19747. }
  19748. ,
  19749. n.prototype.setBurnsDir = function() {
  19750. var e = this.playerControls.cameras[a.PANORAMA]
  19751. , t = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19752. , i = (new r.Euler).setFromQuaternion(e.quaternion, c.warp.eOrder)
  19753. , n = new r.Euler(t.x - i.x,t.y - i.y,t.z - i.z,c.warp.eOrder);
  19754. n.y = h.constrainedTurn(n.y),
  19755. this.burnsDir = Math.sign(n.y)
  19756. }
  19757. ,
  19758. n.prototype.stepWarpPath = function(e, t) {
  19759. var i = this.playerControls.cameras[a.PANORAMA];
  19760. if (!this.warpPathPoints)
  19761. return i.position.copy(this.warpDestPano.position),
  19762. !0;
  19763. var n = this.warpPathPoints[0]
  19764. , o = this.warpDestPano.position;
  19765. if (null !== this.nodes && this.cameraHull.length > 1) {
  19766. var s = new r.Vector3;
  19767. e < .5 ? s.copy(this.cameraHull[1]).sub(n).normalize().multiplyScalar(c.warp.softPushDist * e).add(n) : s.copy(this.cameraHull[this.cameraHull.length - 2]).sub(o).normalize().multiplyScalar(c.warp.softPushDist * c.warp.softPushEnd * (1 - e)).add(o),
  19768. i.position.copy(s)
  19769. } else
  19770. e < .5 ? i.position.copy(n) : i.position.copy(o)
  19771. }
  19772. ,
  19773. n.prototype.interruptAndFastForward = function(e, t) {
  19774. this.warping && (this.warpInterrupted = !0,
  19775. this.warpInterruptionBlackoutStyle = e,
  19776. this.warpInterruptionTravelTime = t,
  19777. null !== this.warpInterruptionBlackoutStyle && void 0 !== this.warpInterruptionBlackoutStyle || (this.warpInterruptionBlackoutStyle = I.MIDDLE),
  19778. null !== this.warpInterruptionTravelTime && void 0 !== this.warpInterruptionTravelTime || (this.warpInterruptionTravelTime = c.minWarpTime))
  19779. }
  19780. ,
  19781. n.prototype.warpCameraAim = function(e) {
  19782. var t = c.warp.minWarpTime;
  19783. if (this.upcomingTransType === l.BLACK)
  19784. t = c.warp.teleportTime;
  19785. else {
  19786. var i = this.playerControls.cameras[a.PANORAMA]
  19787. , n = new r.Euler(0,0,0,c.warp.eOrder).setFromQuaternion(this.warpDestHeroLoc.quaternion, c.warp.eOrder)
  19788. , o = (new r.Euler).setFromQuaternion(i.quaternion, c.warp.eOrder)
  19789. , s = new r.Euler(n.x - o.x,n.y - o.y,n.z - o.z,c.warp.eOrder);
  19790. s.y = h.constrainedTurn(s.y);
  19791. var u = 1e3 * Math.abs(s.y) / r.Math.degToRad(c.warp.maxAimPerSec);
  19792. t = Math.max(t, u)
  19793. }
  19794. var d = function() {
  19795. this._warpStopFlying(),
  19796. this.discardSlow(),
  19797. e && e()
  19798. }
  19799. .bind(this);
  19800. this._warpCameraAim(t, d)
  19801. }
  19802. ,
  19803. n.prototype.warpCommonParameters = function(e, t, i, n) {
  19804. this.model.skybox.material.uniforms.blackout.value = n;
  19805. var r = u.uniform(this.model.skybox, "progress", 1)
  19806. , o = u.allUniforms(this.model.chunks, "progress", 1)
  19807. , a = !1
  19808. , s = function() {
  19809. if (this.warpInterrupted)
  19810. return a = !0,
  19811. !0
  19812. }
  19813. .bind(this)
  19814. , l = function(e, t) {
  19815. return i && a ? (this.model.skybox.material.uniforms.progress.value = 0,
  19816. !0) : void r(e, t)
  19817. }
  19818. .bind(this)
  19819. , h = function(e, t) {
  19820. return i && a ? (o(0),
  19821. !0) : void o(e, t)
  19822. }
  19823. .bind(this);
  19824. p.start(s, e, null, t, null, "safeHaltWatch"),
  19825. p.start(l, e, null, t, d[c.warp.blendEasing], "skyboxProgress"),
  19826. p.start(h, e, null, t, d[c.warp.blendEasing], "chunkProgress")
  19827. }
  19828. ,
  19829. n.prototype.warpTravel_STD = function(e) {
  19830. var t, i = Math.min(c.warp.lookAheadMax, c.warp.lookAheadDist / this.warpLength), n = this.playerControls.cameras[a.PANORAMA], o = (Math.min(.25, 3 / this.warpLength),
  19831. Math.min(.35, 7 / this.warpLength)), s = new r.Euler(0,0,0,c.warp.eOrder), f = new r.Vector3, m = (new r.Euler).setFromQuaternion(n.quaternion, c.warp.eOrder), v = (new r.Euler).copy(m), C = n.position.clone(), E = new r.Matrix4, b = new r.Euler, w = c.warp.minWarpTime;
  19832. w += this.warpLength * c.warp.timePerMeter,
  19833. c.warp.flySpeed > .01 && (w = 1e3 * this.warpLength / c.warp.flySpeed);
  19834. var _ = !1
  19835. , T = this.warpDestHeroLoc.quaternion
  19836. , x = new r.Vector3(0,0,-1).applyQuaternion(T).normalize()
  19837. , S = this.warpPathPoints[this.warpPathPoints.length - 1].clone().sub(this.warpPathPoints[this.warpPathPoints.length - 2]).normalize()
  19838. , M = S.dot(x)
  19839. , R = r.Math.radToDeg(Math.acos(M))
  19840. , P = function(e) {
  19841. var t = o
  19842. , i = r.Math.smoothstep(e, 0, t) * (1 - r.Math.smoothstep(e, 1 - t, 1));
  19843. return i
  19844. }
  19845. , O = function() {
  19846. return E.lookAt(C, t, A.UP),
  19847. s.setFromRotationMatrix(E, c.warp.eOrder),
  19848. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19849. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19850. h.constrainedTurn(b.y)
  19851. }
  19852. .bind(this)
  19853. , L = function(e, t) {
  19854. if (this.warpInterrupted)
  19855. return _ = !0,
  19856. !0
  19857. }
  19858. .bind(this)
  19859. , D = function(e, t) {
  19860. return _ || !this.warpPathPoints ? (g.blur(0),
  19861. !0) : void g.blur(e)
  19862. }
  19863. .bind(this)
  19864. , N = u.allUniforms(this.model.chunks, "modelAlpha", 1)
  19865. , B = function(e, t) {
  19866. return _ || !this.warpPathPoints ? (N(0),
  19867. !0) : void N(e, t)
  19868. }
  19869. .bind(this)
  19870. , F = function(e, t) {
  19871. if (!this.warpPathPoints)
  19872. return n.position.copy(this.warpDestPano.position),
  19873. !0;
  19874. if (_)
  19875. return !0;
  19876. var i = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, e);
  19877. n.position.copy(i),
  19878. C = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, .99 * e)
  19879. }
  19880. .bind(this)
  19881. , V = function(e, n) {
  19882. return this.warpPathPoints ? !!_ || void (t = this.interpAlongPath(this.warpPathPoints, this.warpPathLengths, Math.min(e + i, 1))) : (y.debug("Lost bunny."),
  19883. !0)
  19884. }
  19885. .bind(this)
  19886. , U = function(e, o) {
  19887. if (_)
  19888. return y.debug(">>>> Walkthrough interupted at t=" + e),
  19889. !0;
  19890. if (!this.warpPathPoints)
  19891. return !0;
  19892. var a = this.warpLength * e
  19893. , l = r.Math.smoothstep(a, 0, this.brushPrefs.lookBlendDist)
  19894. , u = r.Math.smoothstep(a, this.warpLength - this.brushPrefs.lookBlendDist, this.warpLength);
  19895. c.warp.matchCam && (l *= 1 - u),
  19896. E.lookAt(C, t, A.UP),
  19897. s.setFromRotationMatrix(E, c.warp.eOrder),
  19898. m.setFromQuaternion(n.quaternion, c.warp.eOrder),
  19899. b.set(s.x - m.x, s.y - m.y, s.z - m.z, c.warp.eOrder),
  19900. b.y = h.constrainedTurn(b.y),
  19901. s.x = m.x + l * b.x,
  19902. s.y = m.y + l * b.y,
  19903. s.z = m.z + l * b.z,
  19904. b.set(s.x - v.x, s.y - v.y, s.z - v.z, c.warp.eOrder),
  19905. b.y = h.constrainedTurn(b.y);
  19906. var d = r.Math.degToRad(c.warp.maxTurnPerSec) * o / 1e3;
  19907. b.y = Math.sign(b.y) * Math.min(d, Math.abs(b.y)),
  19908. v.x = v.x + b.x * c.warp.turnFriction,
  19909. v.y = v.y + b.y * c.warp.turnFriction,
  19910. v.z = v.z + b.z * c.warp.turnFriction,
  19911. v.x = Math.max(r.Math.degToRad(c.warp.minDownAngle), v.x);
  19912. var p = t.clone().sub(C).normalize();
  19913. if (R < c.warp.maxAimRotation && u > 0) {
  19914. var g = 1 - u;
  19915. p.x = p.x * g + u * S.x,
  19916. p.y = p.y * g + u * S.y,
  19917. p.z = p.z * g + u * S.z,
  19918. p.normalize()
  19919. }
  19920. this.bunnyObj.position.copy(n.position).add(p),
  19921. f.set(0, 0, -1).applyEuler(v).normalize(),
  19922. f.multiplyScalar(8),
  19923. f.add(n.position),
  19924. e > 1 - i && c.warp.matchCam || (n.controls.lookAt(f),
  19925. n.controls.lookVector.copy(f),
  19926. n.lookAt(f))
  19927. }
  19928. .bind(this)
  19929. , k = function() {
  19930. _ ? (this.discardSlow(),
  19931. this.upcomingTransType = l.BLACK,
  19932. this.warpTravel_BLACK(-.5, this.warpInterruptionTravelTime, I.BEGINNING, e)) : this._wrapupWarpShading(e)
  19933. }
  19934. .bind(this);
  19935. V(0);
  19936. var H = c.warp.motionLeadTime + 1e3 * Math.abs(O()) / r.Math.degToRad(c.warp.maxTurnPerSec);
  19937. w += H;
  19938. var G = H / w;
  19939. this.warpCommonParameters(w, G, !0, I.NONE),
  19940. p.start(L, w, null, 0, null, "_haltWatcher"),
  19941. c.warp.blur > 0 && (g.blurStrength = c.warp.blur,
  19942. p.start(D, w, null, G, P, "blurring")),
  19943. p.start(B, w, null, G, P, "modelAlpha"),
  19944. p.start(F, w, null, G, d[c.warp.blendEasing], "followPath"),
  19945. p.start(V, w, null, G, d[c.warp.blendEasing], "goBunny"),
  19946. p.start(U, w, k, 0, d[c.warp.blendEasing], "lookAtBunny")
  19947. }
  19948. ,
  19949. n.prototype.warpTravel_BLACK = function(e, t, i, n) {
  19950. var r = e || 0;
  19951. void 0 !== t && null !== t || (t = c.warp.teleportTime),
  19952. this.warpCommonParameters(t, r, !1, i),
  19953. this.model.chunks.forEach(function(e) {
  19954. e.material.uniforms.blackout.value = i
  19955. }),
  19956. this._warpBendAim(null, t, null, r);
  19957. var o = function() {
  19958. this.wrapupWarpShadingOnly(n, i)
  19959. }
  19960. .bind(this);
  19961. p.start(this.stepWarpPath.bind(this), t, o, r, d[c.warp.blendEasing], "stepMotion")
  19962. }
  19963. ,
  19964. n.prototype.flightStepWalk = function(e, t, i) {
  19965. var n = .001
  19966. , o = 1
  19967. , a = 1.2
  19968. , s = new r.Vector3
  19969. , h = new r.Vector3
  19970. , u = function(e, t) {
  19971. var i = Math.min(this.player.position.distanceTo(e.position), c.transition.flytimeMaxDistanceThreshold)
  19972. , r = i * c.transition.flytimeDistanceMultiplier + c.transition.flyTime;
  19973. h.copy(A.FORWARD),
  19974. this.player.getDirection(h),
  19975. s.copy(t).sub(e.position).normalize();
  19976. var l = s.dot(h)
  19977. , u = Math.acos(l)
  19978. , d = u / r;
  19979. return d > n && (r *= d / n,
  19980. u < o && (r *= a)),
  19981. r
  19982. };
  19983. return function(e, t, i) {
  19984. if (this.warpInterrupted)
  19985. i && i();
  19986. else if (this.activeTransType !== l.WALK)
  19987. this._clearWarpShading(),
  19988. this._warpStopFlying(),
  19989. this.player.spider.draw(),
  19990. this.placeCpm(),
  19991. i && i();
  19992. else if (this.player.currentPano !== e) {
  19993. var n = {
  19994. pano: e,
  19995. lookAtPoint: t,
  19996. duration: null,
  19997. maxDistanceOverride: c.warp.walkMaxDist,
  19998. skipWarpingCheck: !1,
  19999. constantMoveSpeed: !0
  20000. };
  20001. n.duration = u.call(this, e, t),
  20002. this.player.nonInterruptingFlyToPano(n, i)
  20003. } else
  20004. i && i()
  20005. }
  20006. }(),
  20007. n.prototype.makeWalkFlightFunc = function(e, t, i) {
  20008. return this.flightStepWalk.bind(this, e, t, i)
  20009. }
  20010. ,
  20011. n.prototype.warpTravel_WALK = function() {
  20012. var e = [];
  20013. return function(t) {
  20014. var i = this.player.model.panos;
  20015. e.length = 0;
  20016. for (var n = null, o = !1, a = 0; a < this.nodes.length; a++) {
  20017. var s = this.nodes[a]
  20018. , l = i.get(s);
  20019. a === this.nodes.length - 1;
  20020. o = n && l.position.distanceTo(n.position) < c.warp.walkMinDist,
  20021. n && o || (e.push(s),
  20022. n = l)
  20023. }
  20024. o && this.nodes.length > 1 && (e[e.length - 1] = this.nodes[this.nodes.length - 1]);
  20025. var h = e.length
  20026. , u = i.get(e[h - 1])
  20027. , d = new Array(h + 1);
  20028. d[d.length - 1] = function() {
  20029. t && t()
  20030. }
  20031. .bind(this);
  20032. for (var p = h - 1, f = d.length - 1; f > 0; f -= 1) {
  20033. var g = e[p];
  20034. u = i.get(g);
  20035. var m = new r.Vector3;
  20036. this.getLookAtForWalkingTourNode(e, p, m),
  20037. d[f - 1] = this.makeWalkFlightFunc(u, m, d[f]),
  20038. p--
  20039. }
  20040. d[0]()
  20041. }
  20042. }(),
  20043. n.prototype.getLookAtForWalkingTourNode = function() {
  20044. var e = new r.Vector3
  20045. , t = new r.Vector3
  20046. , i = new r.Vector3
  20047. , n = new r.Vector3
  20048. , o = new r.Vector3
  20049. , a = .65
  20050. , s = .75
  20051. , l = .2
  20052. , c = .4
  20053. , h = .2
  20054. , u = 3;
  20055. return function(r, d, p) {
  20056. var f = r.length;
  20057. if (d >= f)
  20058. return !1;
  20059. var g = 1
  20060. , m = 1;
  20061. t.set(0, 0, 0),
  20062. o.set(0, 0, 0);
  20063. for (var v = null, A = d; A < d + u && !(A >= f); A++) {
  20064. if (v = this.player.model.panos.get(r[A]),
  20065. this.getOrientationForWalkingTourNode(r, A, i),
  20066. A === d && e.copy(i),
  20067. n.copy(i),
  20068. A > d) {
  20069. var y = n.dot(e) < a;
  20070. g *= y ? l : s,
  20071. m *= y ? h : c
  20072. }
  20073. i.multiplyScalar(g),
  20074. t.add(i),
  20075. o.lerp(v.position, m)
  20076. }
  20077. return t.normalize(),
  20078. p.copy(o),
  20079. p.add(t),
  20080. !0
  20081. }
  20082. }(),
  20083. n.prototype.getOrientationForWalkingTourNode = function(e, t, i) {
  20084. var n = e.length;
  20085. if (t >= n)
  20086. return !1;
  20087. if (t === n - 1)
  20088. i.copy(A.FORWARD).applyQuaternion(this.warpDestHeroLoc.quaternion);
  20089. else {
  20090. var r = this.player.model.panos.get(e[t])
  20091. , o = this.player.model.panos.get(e[t + 1]);
  20092. i.copy(o.position).sub(r.position)
  20093. }
  20094. return i.normalize(),
  20095. !0
  20096. }
  20097. ,
  20098. n.prototype.warpCameraTravel = function(e, t, i, n) {
  20099. if (this.activeTransType = this.upcomingTransType,
  20100. this.lastTransType = this.activeTransType,
  20101. this.upcomingTransType = null,
  20102. !e) {
  20103. var r = function() {
  20104. this._wrapupTravel(n)
  20105. }
  20106. .bind(this)
  20107. , o = {
  20108. pano: this.warpDestPano,
  20109. lookAtPoint: null,
  20110. duration: null,
  20111. maxDistanceOverride: null,
  20112. skipWarpingCheck: !1
  20113. };
  20114. return void this.player.flyToPano(o, r)
  20115. }
  20116. this.activeTransType === l.BLACK ? this.warpTravel_BLACK(null, i, t, n) : this.activeTransType === l.WALK ? this.warpTravel_WALK(function() {
  20117. this._clearWarpShading(),
  20118. this._warpStopFlying(),
  20119. this.player.spider.draw(),
  20120. this.placeCpm(),
  20121. n && n()
  20122. }
  20123. .bind(this)) : this.warpTravel_STD(n)
  20124. }
  20125. ,
  20126. n.prototype.startWarpState = function() {
  20127. this.warping = !0,
  20128. this.warpInterrupted = !1,
  20129. this.warpInterruptionBlackoutStyle = null,
  20130. this.warpInterruptionTravelTime = null
  20131. }
  20132. ,
  20133. n.prototype.endWarpState = function() {
  20134. this.warping = !1
  20135. }
  20136. ,
  20137. n.prototype.warpToPano = function(e, t, i, n) {
  20138. if (this.warping)
  20139. return void y.warn("Cannot warp when already warping");
  20140. if (this.upcomingTransType = e,
  20141. this.activeTransType = null,
  20142. !this.setWarpDestPano())
  20143. return this.upcomingTransType = null,
  20144. void this.warpToNonPano(n);
  20145. if (this.player.mode !== a.PANORAMA)
  20146. return this.upcomingTransType = null,
  20147. this.discardSlow(),
  20148. void this.player.flyToNewMode({
  20149. mode: a.PANORAMA,
  20150. pano: this.warpDestPano,
  20151. duration: c.warp.outsideTime,
  20152. warpDest: this.warpDestHeroLoc,
  20153. callback: n,
  20154. force: !0
  20155. });
  20156. if (!this.warpDestPano)
  20157. return y.warn("no warp destination, callback dropped"),
  20158. void (this.upcomingTransType = null);
  20159. var r = !(this.model.panos.isNeighbour(this.player.currentPano, this.warpDestPano) && this.warpDestPano !== this.player.currentPano && this.warpDestPano.position.distanceTo(this.player.currentPano.position) < c.warp.nearPanoDist)
  20160. , o = this.chooseWarpPath(r);
  20161. if (o && this.upcomingTransType !== l.WALK) {
  20162. var s = function() {
  20163. this.waitingToWarp = !1,
  20164. this.warpToPano(e, t, i, n)
  20165. }
  20166. .bind(this);
  20167. if (this.player.checkAndWaitForPanoLoad(this.warpDestPano, "high", "low", this.player.basePanoSize, s))
  20168. return void (this.waitingToWarp = !0)
  20169. }
  20170. this.player.currentPano || (y.warn("Arrived at a very strange spot!"),
  20171. this.player.currentPano = this.warpDestPano,
  20172. this.placeCpm(),
  20173. this.fadeOutCpm(c.path.fadeOutTime),
  20174. this.player.spider.draw()),
  20175. y.debug("Warping to pano ", this.warpDestPano.position),
  20176. this.upcomingTransType !== l.WALK && this.player.emit(C.PanoChosen, this.player.currentPano, this.warpDestPano),
  20177. this.startWarpState();
  20178. var h = function() {
  20179. this.endWarpState(),
  20180. n && n()
  20181. }
  20182. .bind(this);
  20183. o ? this.warpCameraTravel(r, t, i, h) : this.warpCameraAim(h),
  20184. this.player.smoothZoomToDefault(c.zoom.restoreTime)
  20185. }
  20186. ,
  20187. t.exports = n
  20188. }
  20189. ).call(this, "/js/objects/ShowPath.js")
  20190. }
  20191. , {
  20192. "../constants": 8,
  20193. "../effects": 16,
  20194. "../enum/BlackoutStyle": 18,
  20195. "../enum/ModelManagerEvents": 33,
  20196. "../enum/PlayerEvents": 40,
  20197. "../enum/RenderOrder": 42,
  20198. "../enum/Vectors": 50,
  20199. "../enum/Viewmode": 51,
  20200. "../enum/WarpStyle": 52,
  20201. "../gui/gui": 65,
  20202. "../model/ModelManager": 140,
  20203. "../objects/Snapshot": 153,
  20204. "../settings": 166,
  20205. "../shaders": 167,
  20206. "../util/easing": 186,
  20207. "../util/lerp": 188,
  20208. "../util/logger": 189,
  20209. "../util/math": 190,
  20210. "../util/texture": 194,
  20211. "../util/transitions": 195,
  20212. three: 217
  20213. }],
  20214. 152: [function(e, t, i) {
  20215. "use strict";
  20216. function n() {
  20217. var e = new r.SphereBufferGeometry(a.skyboxRadius,20,5)
  20218. , t = new r.RawShaderMaterial({
  20219. fragmentShader: o.skysphere.fragmentShader,
  20220. vertexShader: o.skysphere.vertexShader,
  20221. uniforms: r.UniformsUtils.clone(o.skysphere.uniforms),
  20222. side: r.BackSide,
  20223. name: "skysphere"
  20224. });
  20225. t.uniforms.radius.value = e.parameters.radius,
  20226. r.Mesh.call(this, e, t)
  20227. }
  20228. var r = e("three")
  20229. , o = e("../shaders")
  20230. , a = e("../settings");
  20231. n.prototype = Object.create(r.Mesh.prototype),
  20232. n.prototype.constructor = n,
  20233. t.exports = n
  20234. }
  20235. , {
  20236. "../settings": 166,
  20237. "../shaders": 167,
  20238. three: 217
  20239. }],
  20240. 153: [function(e, t, i) {
  20241. (function(i) {
  20242. "use strict";
  20243. function n(e) {
  20244. o.call(this, e),
  20245. this.sid = e.sid,//xzw add
  20246. this.panoId = e.panoId,
  20247. this.orthoZoom = e.orthoZoom,
  20248. this.floorVisibility = e.floorVisibility,
  20249. this.thumbUrl = e.thumbUrl,
  20250. this.name = e.name
  20251. }
  20252. var r = (e("three"),
  20253. e("../util/logger"))
  20254. , o = (e("../settings"),
  20255. e("../enum/Viewmode"),
  20256. e("../util/common"),
  20257. e("../util/transitions"),
  20258. e("../util/lerp"),
  20259. e("../util/ajax"),
  20260. e("../util/texture"),
  20261. e("./View"));
  20262. e("events").EventEmitter,
  20263. new r(i);
  20264. n.prototype = Object.create(o.prototype),
  20265. n.prototype.isPano = function() {
  20266. return this.panoId && "" !== this.panoId
  20267. }
  20268. ,
  20269. t.exports = n
  20270. }
  20271. ).call(this, "/js/objects/Snapshot.js")
  20272. }
  20273. , {
  20274. "../enum/Viewmode": 51,
  20275. "../settings": 166,
  20276. "../util/ajax": 181,
  20277. "../util/common": 185,
  20278. "../util/lerp": 188,
  20279. "../util/logger": 189,
  20280. "../util/texture": 194,
  20281. "../util/transitions": 195,
  20282. "./View": 154,
  20283. events: 202,
  20284. three: 217
  20285. }],
  20286. 154: [function(e, t, i) {
  20287. (function(i) {
  20288. "use strict";
  20289. function n(e) {
  20290. e = e || {},
  20291. this.position = new r.Vector3,
  20292. this.quaternion = new r.Quaternion,
  20293. this.update(e)
  20294. }
  20295. var r = e("three")
  20296. , o = e("../util/logger")
  20297. , a = (e("../settings"),
  20298. e("../enum/Viewmode"),
  20299. e("../util/common"),
  20300. e("../util/transitions"),
  20301. e("../util/lerp"),
  20302. e("../util/ajax"),
  20303. e("../util/texture"),
  20304. e("events").EventEmitter);
  20305. new o(i);
  20306. n.prototype = Object.create(a.prototype),
  20307. n.prototype.isValid = function() {
  20308. return !!this.cameraMode
  20309. }
  20310. ,
  20311. n.prototype.update = function(e) {
  20312. return this.cameraMode = e.cameraMode || this.cameraMode,
  20313. this.pano = e.pano || this.pano,
  20314. e.position && this.position.copy(e.position),
  20315. e.quaternion && this.quaternion.copy(e.quaternion),
  20316. this
  20317. }
  20318. ,
  20319. t.exports = n
  20320. }
  20321. ).call(this, "/js/objects/View.js")
  20322. }
  20323. , {
  20324. "../enum/Viewmode": 51,
  20325. "../settings": 166,
  20326. "../util/ajax": 181,
  20327. "../util/common": 185,
  20328. "../util/lerp": 188,
  20329. "../util/logger": 189,
  20330. "../util/texture": 194,
  20331. "../util/transitions": 195,
  20332. events: 202,
  20333. three: 217
  20334. }],
  20335. 155: [function(e, t, i) {//player.js
  20336. (function(i) {
  20337. "use strict";
  20338. function n(e) {
  20339. this.currentPano = null,
  20340. this.nextPano = null,
  20341. this.camera = null,
  20342. this.paused = !1,
  20343. this.flying = !1,
  20344. this.sceneIntersectionPlane = null,
  20345. this.target = new r.Vector3,
  20346. this.mouse = new r.Vector3(1.1,1.1,.5),
  20347. this.mouseAtMouseDown = new r.Vector2,
  20348. this.mouseCouldBeClickToMove = !1,
  20349. this.mouseLastMoveTime = Date.now(),
  20350. this.mouseDown = !1,
  20351. this.mouseDownTimer = null,
  20352. this.couldBeLongTap = !1,
  20353. this.containsMouse = !0,
  20354. this.isTouchEvent = !1,
  20355. this.isPanoHover = !1,
  20356. this.reticule = new a(this),
  20357. this.panoMarkers = [],
  20358. this.spider = new h(this),
  20359. this.quaternion = new r.Quaternion,
  20360. this.position = new r.Vector3(15,10,15),
  20361. this.previousState = null,
  20362. this.lastInsideView = new c,
  20363. this.last360View = new c,
  20364. this.raycaster = new r.Raycaster,
  20365. this.intersect = null,
  20366. this.lastChangeTime = Date.now(),
  20367. this.history = new I,
  20368. this.cameraControls = null,
  20369. this.path = null,
  20370. this.model = null,
  20371. this.domElement = null,
  20372. this.cachedPanoCandidates = null,
  20373. this.basePanoSize = 0,
  20374. this.standardPanoSize = 0,
  20375. this.highPanoSize = 0,
  20376. this.ultraHighPanoSize = 0,
  20377. this.zoomLevel = 1,
  20378. this.zooming = 0,
  20379. this.zoomSpeed = .5,
  20380. this.scrollZoomSpeed = .06,
  20381. this.zoomSpeedAdjust = .05,
  20382. this.defaultZoomIncrement = .2,
  20383. this.baseFov = f.insideFOV,
  20384. this.zoomFov = this.baseFov,
  20385. this.zoomEnabled = !0,
  20386. this.preRenderingEnabled = !1,
  20387. this.setupCustomProperties(e),
  20388. this.zoomStats = new L
  20389. }
  20390. var r = e("three")
  20391. , o = e("./util/logger")
  20392. , a = e("./objects/Reticule")
  20393. , s = e("./objects/Panorama")
  20394. , l = e("./objects/ShowPath")
  20395. , c = e("./objects/View")
  20396. , h = (e("./objects/Snapshot"),
  20397. e("./objects/NSpider"))
  20398. , u = e("./enum/Viewmode")
  20399. , d = (e("./enum/TagStates"),
  20400. e("./enum/Vectors"))
  20401. , p = e("./enum/Keys")
  20402. , f = (e("./enum/AlignmentType"),
  20403. e("./settings"))
  20404. , g = e("./util/common")
  20405. , m = (e("./util/browser"),
  20406. e("./util/math"))
  20407. , v = e("./util/lerp")
  20408. , A = e("./util/easing")
  20409. , y = e("./util/transitions")
  20410. , C = e("events").EventEmitter
  20411. , I = (e("./shaders"),
  20412. e("./util/history"))
  20413. , E = (e("./util/camera"),
  20414. e("./model/ModelManager"),
  20415. e("./enum/PathDiscardMode"))
  20416. , b = e("./enum/PathDisplayMode")
  20417. , w = e("./enum/PlayerEvents")
  20418. , _ = e("./enum/ControlEvents")
  20419. , T = e("./enum/ModelManagerEvents")
  20420. , x = e("./enum/WarpStyle")
  20421. , S = e("./enum/BlackoutStyle")
  20422. , M = e("./exception/BasicException")
  20423. , R = e("./enum/PanoSizeClass")
  20424. , P = (e("./tile/TileDownloader"),
  20425. e("./tile/TilePrioritizer"))
  20426. , O = (e("./enum/PanoramaEvents"),
  20427. e("./enum/ZoomEvents"))
  20428. , L = e("./util/ZoomStats")
  20429. , D = e("./constants")
  20430. , N = e("./util/common")
  20431. , B = e("./util/cameraLight")
  20432. , Hot = e('hot')
  20433. , F = new o(i)
  20434. , V = Object.freeze({
  20435. FlyToPano: y.getUniqueId(),
  20436. FlyToNewMode: y.getUniqueId(),
  20437. FlyToSameMode: y.getUniqueId(),
  20438. FlyToViewFloor: y.getUniqueId(),
  20439. LookTransition: y.getUniqueId(),
  20440. ZoomTransition: y.getUniqueId()
  20441. });
  20442. n.prototype = Object.create(C.prototype),
  20443. n.prototype.init = function(e) {
  20444. this.modelManager = e.modelManager,
  20445. this.tileDownloader = e.tileDownloader,
  20446. this.panoRenderer = e.panoRenderer,
  20447. this.qualityManager = e.qualityManager,
  20448. this.domElement = e.container,
  20449. this.camera = e.camera,
  20450. this.tagManager = e.tagManager,
  20451. this.cameraControls = e.controls,
  20452. this.path = new l(e.director,this,e.controls),
  20453. this.basePanoSize = this.qualityManager.getPanoSize(R.BASE),
  20454. this.standardPanoSize = this.qualityManager.getPanoSize(R.STANDARD),
  20455. this.highPanoSize = this.qualityManager.getPanoSize(R.HIGH),
  20456. this.ultraHighPanoSize = this.qualityManager.getPanoSize(R.ULTRAHIGH),
  20457. this.tileDownloader.processPriorityQueue = !1,
  20458. this.tileDownloader.tilePrioritizer = new P(this.qualityManager,this.basePanoSize,this.standardPanoSize,this.highPanoSize,this.ultraHighPanoSize),
  20459. this.bindEvents(e.container),
  20460. this.updateModel()
  20461. }
  20462. n.prototype.closePopup = function() {//xzw 关闭热点页面
  20463. if(!g_currentHot) return;
  20464. g_currentHot = null;
  20465. var hotPop = document.getElementById('popup');
  20466. hotPop.style.display = "none";
  20467. hotPop.removeChild(document.getElementById("id1"));
  20468. $("#popup iframe:last").remove();
  20469. var _bgaudio = document.getElementById("bgaudio");
  20470. //判断音乐是否暂停或者是否存在
  20471. if(g_bgAudio && g_bgAudio.paused && g_bgAudio.readyState != 0)
  20472. {
  20473. g_bgAudio.play();
  20474. }
  20475. //$('#player').off("click",this.closePopup);
  20476. return false
  20477. }
  20478. n.prototype.setupCustomProperties = function(e) {
  20479. var t = e || u.PANORAMA;
  20480. Object.defineProperty(this, "mode", {
  20481. get: function() {
  20482. return t
  20483. },
  20484. set: function(e) {
  20485. var i = t;
  20486. t = e,
  20487. this.onModeUpdated(i, t)
  20488. }
  20489. })
  20490. }
  20491. ,
  20492. n.prototype.isInMode = function() {
  20493. for (var e = 0; e < arguments.length; e++)
  20494. if (this.mode === arguments[e])
  20495. return !0;
  20496. return !1
  20497. }
  20498. ,
  20499. n.prototype.isOutsideMode = function(e) {
  20500. return e = e || this.mode,
  20501. e === u.DOLLHOUSE || e === u.FLOORPLAN
  20502. }
  20503. ,
  20504. n.prototype.is360View = function(e, t) {
  20505. return e === u.PANORAMA && t && !t.isAligned()
  20506. }
  20507. ,
  20508. n.prototype.setScene = function(e) {
  20509. this.sceneIntersectionPlane = e.plane,
  20510. this.path.setScene(e),
  20511. this.moveReticuleToScene(e)
  20512. }
  20513. ,
  20514. n.prototype.moveReticuleToScene = function(e) {
  20515. this.reticule.parent && this.reticule.parent.remove(this.reticule),
  20516. e.add(this.reticule)
  20517. }
  20518. ,
  20519. n.prototype.updateModel = function() {
  20520. function e(e, t, n) {
  20521. this.mode === u.DOLLHOUSE && e !== n && i.call(this, e.center.y)
  20522. }
  20523. function t(e, t) {
  20524. if (this.mode === u.DOLLHOUSE) {
  20525. var n = e ? this.model.center.y : n = t.center.y;
  20526. i.call(this, n)
  20527. }
  20528. }
  20529. function i(e) {
  20530. var t = this.cameraControls.cameras[u.DOLLHOUSE]
  20531. , i = this.cameraControls.controls[u.DOLLHOUSE]
  20532. , n = t.position.y + (e - i.target.y)
  20533. , r = f.showFloorDuration + f.showFloorDelay;
  20534. y.start(v.property(i.target, "y", e), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor),
  20535. y.start(v.property(t.position, "y", n), r, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToViewFloor)
  20536. }
  20537. this.model = this.modelManager.getActiveModel(),
  20538. this.model.on("floor.changed", e.bind(this)),
  20539. this.model.on("allfloors.toggled", t.bind(this)),
  20540. this.on(w.PanoChosen, this.model.setProjectedPanos.bind(this.model))
  20541. }
  20542. ,
  20543. n.prototype.updateModelDependentData = function() {
  20544. this.cameraControls.setModelForControls(this.model),
  20545. this.getPanoMarkersFromModel(this.model)
  20546. }
  20547. ,
  20548. n.prototype.onModelChanged = function() {
  20549. this.updateModel(),
  20550. this.updateModelDependentData()
  20551. }
  20552. ,
  20553. n.prototype.getPanoMarkersFromModel = function(e) {
  20554. this.panoMarkers = e.panos.list.reduce(function(e, t) {
  20555. return t.marker ? e.concat(t.marker) : e
  20556. }, [])
  20557. }
  20558. ,
  20559. n.prototype.handleControlMove = function(e) {
  20560. this.emit(w.Move, e)
  20561. }
  20562. ,
  20563. n.prototype.handleControlInputStart = function(e) {
  20564. this.emit(w.InputStart, e)
  20565. }
  20566. ,
  20567. n.prototype.onModeUpdated = function(e, t) {
  20568. this.cameraControls.activateControls(t),
  20569. this.emit(w.ModeChanged, e, t)
  20570. }
  20571. ,
  20572. n.prototype.isWarping = function() {
  20573. return this.path.warping
  20574. }
  20575. ,
  20576. n.prototype.isWaitingToWarp = function() {
  20577. return this.path.waitingToWarp
  20578. }
  20579. ,
  20580. n.prototype.getLabelScaleFactor = function() {
  20581. if (this.isOutsideMode()) {
  20582. var e = 10
  20583. , t = Math.sqrt(this.cameraControls.controls[u.FLOORPLAN].currentScale / e);
  20584. return t
  20585. }
  20586. return .5
  20587. }
  20588. ,
  20589. n.prototype.changeMusic = function() {//xzw add
  20590. if(!this.director.tourIsPlaying && g_play && g_bgAudio){
  20591. g_playAudio = g_bgAudio;
  20592. g_bgAudio.play();
  20593. }else{
  20594. if(!g_play){
  20595. g_playAudio = g_bgAudio;
  20596. }else{//防止再次播放时重播一遍
  20597. g_playAudio = null;
  20598. }
  20599. }
  20600. }
  20601. ,
  20602. n.prototype.bindEvents = function(e) {
  20603. e !== document && e.setAttribute("tabindex", -1),
  20604. e.addEventListener("mousedown", this.onMouseDown.bind(this)),
  20605. e.addEventListener("mousemove", this.onMouseMove.bind(this)),
  20606. e.addEventListener("mouseover", this.onMouseOver.bind(this)),
  20607. e.addEventListener("mouseout", this.onMouseOut.bind(this)),
  20608. e.addEventListener("mouseup", this.onMouseUp.bind(this)),
  20609. this.modelManager.on(T.ActiveModelChanged, this.onModelChanged.bind(this)),
  20610. e.addEventListener("touchstart", this.onTouchStart.bind(this)),
  20611. e.addEventListener("touchmove", this.onTouchMove.bind(this)),
  20612. e.addEventListener("touchend", this.onTouchEnd.bind(this)),
  20613. e.addEventListener("pointerdown", this.onPointerDown.bind(this)),
  20614. e.addEventListener("pointermove", this.onPointerMove.bind(this)),
  20615. e.addEventListener("pointerup", this.onPointerUp.bind(this)),
  20616. e.addEventListener("pointerout", this.onPointerOut.bind(this)),
  20617. e.addEventListener("pointercancel", this.onPointerCancel.bind(this)),
  20618. document.addEventListener("keydown", this.onKeyDown.bind(this)),
  20619. this.cameraControls.on(_.Move, this.handleControlMove.bind(this)),
  20620. this.cameraControls.on(_.InputStart, this.handleControlInputStart.bind(this)),
  20621. this.cameraControls.on(_.Pinch, this.handleControlPinch.bind(this)),
  20622. this.cameraControls.on(_.Scroll, this.handleControlScroll.bind(this)),
  20623. window.addEventListener("tourAudioEnded", this.changeMusic.bind(this))//xzw add
  20624. //判断是否是移动端,如果是给关闭按钮添加touchstart事件
  20625. if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)){
  20626. $('#closepop').on("touchstart",this.closePopup.bind(this));
  20627. }else{
  20628. $('#closepop').on("click",this.closePopup.bind(this));
  20629. }
  20630. }
  20631. ,
  20632. n.prototype.onMouseDown = function(e) {
  20633. e.currentTarget !== document && e.currentTarget.focus(),
  20634. 0 === e.button && (this.handleInputStart.call(this, e.clientX, e.clientY, !1),
  20635. this.updateIntersect())
  20636. }
  20637. ,
  20638. n.prototype.onMouseMove = function(e) {
  20639. this.isTouchEvent = !1,
  20640. this.handleInputMove.call(this, e.clientX, e.clientY, !1)
  20641. }
  20642. ,
  20643. n.prototype.onMouseOver = function(e) {
  20644. this.containsMouse = !0,
  20645. !this.mouseDown || 0 !== e.which && 0 !== e.buttons || (this.mouseDown = !1)
  20646. }
  20647. ,
  20648. n.prototype.onMouseOut = function(e) {
  20649. this.containsMouse = !1
  20650. }
  20651. ,
  20652. n.prototype.onMouseUp = function(e) {
  20653. this.handleInputEnd.call(this, e.clientX, e.clientY, !1);
  20654. }
  20655. ,
  20656. n.prototype.onTouchStart = function(e) {
  20657. if (e.currentTarget !== document && e.currentTarget.focus(),
  20658. !this.mouseDown) {
  20659. this.couldBeLongTap = !0;
  20660. var t = g.average(e.changedTouches, "clientX")
  20661. , i = g.average(e.changedTouches, "clientY");
  20662. this.handleInputStart.call(this, t, i, !0),
  20663. this.mouseDownTimer = setTimeout(function() {
  20664. this.updateIntersect(),
  20665. this.handleInputEnd.call(this, t, i, !0)
  20666. }
  20667. .bind(this), f.input.longTapThreshold)
  20668. }
  20669. }
  20670. ,
  20671. n.prototype.onTouchMove = function(e) {
  20672. var t = g.average(e.changedTouches, "clientX")
  20673. , i = g.average(e.changedTouches, "clientY");
  20674. this.handleInputMove.call(this, t, i, !0)
  20675. }
  20676. ,
  20677. n.prototype.onTouchEnd = function(e) {
  20678. if (clearTimeout(this.mouseDownTimer),
  20679. this.mouseDown) {
  20680. this.couldBeLongTap = !1,
  20681. this.updateIntersect();
  20682. var t = g.average(e.changedTouches, "clientX")
  20683. , i = g.average(e.changedTouches, "clientY");
  20684. this.handleInputEnd.call(this, t, i, !0)
  20685. }
  20686. }
  20687. ,
  20688. n.prototype.onPointerDown = function(e) {
  20689. return e.currentTarget !== document && e.currentTarget.focus(),
  20690. this.mouseDown || "mouse" === e.pointerType ? this.onMouseDown(e) : (this.couldBeLongTap = !0,
  20691. this.handleInputStart.call(this, e.clientX, e.clientY, !0),
  20692. void (this.mouseDownTimer = setTimeout(function() {
  20693. this.updateIntersect(),
  20694. this.handleInputEnd.call(this, e.clientX, e.clientY, !0)
  20695. }
  20696. .bind(this), f.input.longTapThreshold)))
  20697. }
  20698. ,
  20699. n.prototype.onPointerMove = function(e) {
  20700. "mouse" !== e.pointerType ? this.handleInputMove.call(this, e.clientX, e.clientY, !0) : this.onMouseMove(e)
  20701. }
  20702. ,
  20703. n.prototype.onPointerUp = function(e) {
  20704. return this.mouseDown && "mouse" !== e.pointerType ? (clearTimeout(this.mouseDownTimer),
  20705. this.couldBeLongTap = !1,
  20706. this.updateIntersect(),
  20707. void this.handleInputEnd.call(this, e.clientX, e.clientY, !0)) : this.onMouseUp(e)
  20708. }
  20709. ,
  20710. n.prototype.onPointerOut = function(e) {
  20711. this.mouseDown = !1
  20712. }
  20713. ,
  20714. n.prototype.onPointerCancel = function(e) {
  20715. this.mouseDown = !1
  20716. }
  20717. ,
  20718. n.prototype.onKeyDown = function(e) {
  20719. var t = function() {
  20720. this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, "key")
  20721. }
  20722. .bind(this)
  20723. , i = e.which;
  20724. switch (i) {
  20725. case p.F:
  20726. t(),
  20727. this.changeFloor(-1);
  20728. break;
  20729. case p.R:
  20730. t(),
  20731. this.changeFloor(1)
  20732. }
  20733. if (this.mode === u.PANORAMA)
  20734. switch (i) {
  20735. case p.UPARROW:
  20736. case p.W:
  20737. this.flyLocalDirection(d.FORWARD.clone());
  20738. break;
  20739. case p.DOWNARROW:
  20740. case p.S:
  20741. this.flyLocalDirection(d.BACK.clone());
  20742. break;
  20743. case p.A:
  20744. this.flyLocalDirection(d.LEFT.clone());
  20745. break;
  20746. case p.D:
  20747. this.flyLocalDirection(d.RIGHT.clone())
  20748. }
  20749. }
  20750. ,
  20751. n.prototype.handleScrollPinchZoom = function() {
  20752. return function(e) {
  20753. var t = e
  20754. , i = this.zoomLevel;
  20755. this.zoomBy(t),
  20756. this.currentPano && this.zoomStats.addZoomAction(i, this.zoomLevel, this.currentPano.id)
  20757. }
  20758. }(),
  20759. n.prototype.handleControlPinch = function(e) {
  20760. f.zoom.enabled ? this.handleScrollPinchZoom(1 - e) : this.flyLocalDirection(new r.Vector3(0,0,e).normalize())
  20761. }
  20762. ,
  20763. n.prototype.handleControlScroll = function(e) {
  20764. f.zoom.enabled ? (e > 0 ? e = 1 + this.scrollZoomSpeed : e < 0 && (e = 1 - this.scrollZoomSpeed),
  20765. 0 !== e && this.handleScrollPinchZoom(e)) : this.flyLocalDirection(new r.Vector3(0,0,-e).normalize())
  20766. }
  20767. ,
  20768. n.prototype.handleInputStart = function(e, t, i) {
  20769. this.isTouchEvent = i,
  20770. m.convertScreenPositionToNDC(e, t, this.mouse),
  20771. m.convertScreenPositionToNDC(e, t, this.mouseAtMouseDown),
  20772. this.mouseCouldBeClickToMove = !0,
  20773. this.mouseDown = !0
  20774. }
  20775. ,
  20776. n.prototype.handleInputMove = function(e, t, i) {
  20777. this.isTouchEvent = i,
  20778. m.convertScreenPositionToNDC(e, t, this.mouse),
  20779. this.mouseAtMouseDown.distanceTo(this.mouse) > f.input.moveToleranceNDC && (this.mouseCouldBeClickToMove = !1,
  20780. this.couldBeLongTap = !1,
  20781. clearTimeout(this.mouseDownTimer)),
  20782. this.mouseLastMoveTime = Date.now(),
  20783. this.reticule.move(e, t, i)
  20784. }
  20785. ,
  20786. n.prototype.handleInputEnd = function(e, t, i) {//xzw
  20787. if (this.isTouchEvent = i,
  20788. this.mouseDown = !1,
  20789. this.cameraControls.controls[u.PANORAMA].emit("interaction.direct"),
  20790. !i && this.couldBeLongTap)
  20791. return !0;
  20792. if (this.handleLongTap())
  20793. return !0;
  20794. if (this.mouseCouldBeClickToMove) {
  20795. if (this.flying)
  20796. return this.path.activeTransType === x.WALK && this.emit(w.WarpInterruptedWithFlyTo, this.path.activeTransType),
  20797. !0;
  20798. if(this.checkHotClick())//add
  20799. return !0;
  20800. if (this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.Move, this.isTouchEvent ? "touch" : "mouse"),
  20801. this.history.invalidate(),
  20802. this.intersect)
  20803. return this.flyToPanoClosestToMouse();
  20804. if (this.mode === u.PANORAMA) {
  20805. var n = this.closestPanoInDirection(this.getMouseDirection());
  20806. return n ? this.flyToPano({
  20807. pano: n
  20808. }) : this.bump(this.getMouseDirection())
  20809. }
  20810. }
  20811. this.intersect && this.closestPano && this.closestPano.hoverOff(this.mode)
  20812. }
  20813. ,
  20814. n.prototype.handleLongTap = function() {
  20815. if (this.couldBeLongTap && (!this.isPanoHover || this.mode !== u.PANORAMA))
  20816. return this.cameraControls.activeControl && this.cameraControls.activeControl.emit(_.LongTap, "touch"),
  20817. !0
  20818. }
  20819. ,
  20820. n.prototype.checktagClick = function() {
  20821. if (this.tagManager.intersectTag) {
  20822. var e = this.isTouchEvent
  20823. , t = this.tagManager.clickedOnTag(e, this);
  20824. return e || t || y.cancelById(V.LookTransition),
  20825. !0
  20826. }
  20827. if (this.tagManager.activeTag)
  20828. return this.tagManager.dismissActiveTag(),
  20829. !1
  20830. }
  20831. ,
  20832. n.prototype.rankedtagInDirection = function(e, t) {
  20833. return this.tagManager.rankedtagInDirection(e, this.position, this.camera, t)
  20834. }
  20835. ,
  20836. n.prototype.start = function(e) {
  20837. var t = e.mode
  20838. , i = e.pano
  20839. , n = e.position
  20840. , r = e.quaternion
  20841. , o = e.tag
  20842. , a = e.quickstart
  20843. , s = $.Deferred();
  20844. this.updateModelDependentData(),
  20845. this.updateFromControls(),
  20846. this.findDefaultViews();
  20847. var l = this.is360View(t, i);
  20848. return !this.model.outsideAllowed() || l || a ? this.startInside(i, n, r, o, s) : this.startOutside(e, s),
  20849. s.done(function(e) {
  20850. this.emit(w.Ready, l, e, o)
  20851. }
  20852. .bind(this)),
  20853. s.promise()
  20854. }
  20855. ,
  20856. n.prototype.startOutside = function(e, t) {
  20857. var i = e.mode
  20858. , n = e.pano
  20859. , r = e.position
  20860. , o = e.quaternion
  20861. , a = e.zoom
  20862. , s = e.floorVisibility
  20863. , l = e.tag;
  20864. this.emit(w.StartOutside, f[i].transitionTime),
  20865. this.isOutsideMode(i) ? (this.model.warpDestFloors(s, !0),
  20866. y.cancelById(V.FlyToViewFloor),
  20867. i === u.FLOORPLAN ? this.floorplanMode(r, o, a) : this.dollhouseMode(r, o),
  20868. t.resolve(!1)) : this.startInsideWithFlyin(n, r, o, l, t)
  20869. }
  20870. ,
  20871. n.prototype.startInside = function(e, t, i, n, r) {
  20872. r = r || $.Deferred(),
  20873. this.currentPano = e;
  20874. var o = e && !e.isAligned();
  20875. if (t = o ? e.position : t || e.position,
  20876. i = i || e.quaternion,
  20877. e) {
  20878. var a = this.startInside.bind(this, e, t, i, n, r);
  20879. if (this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, a))
  20880. return
  20881. }
  20882. return this.mode = u.PANORAMA,
  20883. e.floor.enter(this.mode),
  20884. this.emit(w.PanoChosen, this.currentPano, this.currentPano),
  20885. this.switchCameraMode(this.mode, i),
  20886. this.emit(w.StartInside, o),
  20887. r.resolve(!0),
  20888. r
  20889. }
  20890. ,
  20891. n.prototype.startInsideWithFlyin = function(e, t, i, n, r) {
  20892. if (r = r || $.Deferred(),
  20893. this.dollhouseMode(),
  20894. !e)
  20895. return F.warn("Player.startInsideWithFlyin() -> targetPano is invalid."),
  20896. r.resolve(!1),
  20897. r;
  20898. t = t || e.position;
  20899. var o = i || this.cameraControls.activeControl.camera.quaternion
  20900. , a = e.position;
  20901. return this.fitDollhouse(a, t, o),
  20902. setTimeout(function(t) {
  20903. this.cameraControls.activeControl && (this.cameraControls.activeControl.maxDistance = t);
  20904. var n = {
  20905. mode: u.PANORAMA,
  20906. pano: e,
  20907. quaternion: i,
  20908. callback: function() {
  20909. this.emit(w.FlyinFinished),
  20910. r.resolve(!0)
  20911. }
  20912. .bind(this)
  20913. };
  20914. this.flyToNewMode(n)
  20915. }.bind(this, this.cameraControls.activeControl.maxDistance), f.startupFlyinDelay),
  20916. r
  20917. }
  20918. ,
  20919. n.prototype.checkAndWaitForPanoLoad = function() {
  20920. var e = {}
  20921. , t = {}
  20922. , i = 5e3
  20923. , n = function() {
  20924. for (var n in e)
  20925. if (e.hasOwnProperty(n) && e[n]) {
  20926. var r = performance.now() - t[n];
  20927. if (r < i)
  20928. return !0
  20929. }
  20930. return !1
  20931. };
  20932. return function(r, o, a, s, l, c, h, u, d, p) {
  20933. if (n())
  20934. return !0;
  20935. var f = function(t, i, n) {
  20936. N.delayOneFrame(function() {
  20937. e[t] = !1,
  20938. l && l(i, n)
  20939. }
  20940. .bind(this))
  20941. }
  20942. .bind(this, r.id)
  20943. , g = function(t, i) {
  20944. N.delayOneFrame(function() {
  20945. e[t] = !1,
  20946. c && c(i)
  20947. }
  20948. .bind(this))
  20949. }
  20950. .bind(this, r.id);
  20951. try {
  20952. return null !== u && void 0 !== u || (u = !0),
  20953. 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),
  20954. e[r.id] && (t[r.id] = performance.now()),
  20955. e[r.id]
  20956. } catch (n) {
  20957. throw e[r.id] = !1,
  20958. t[r.id] = performance.now() - i,
  20959. n
  20960. }
  20961. }
  20962. }(),
  20963. n.prototype.checkAndWaitForWholePanoLoad = function(e, t, i, n, r) {
  20964. if (!e)
  20965. throw new M("Player.checkAndWaitForWholePanoLoad() -> Cannot load texture for null pano.");
  20966. return r && this.model.waitForLoad(e, function() {
  20967. return e.isLoaded(i)
  20968. }),
  20969. !e.isLoaded(t) && (e.loadCube(t).done(n),
  20970. !0)
  20971. }
  20972. ,
  20973. n.prototype.checkAndWaitForTiledPanoLoad = function() {
  20974. var e = new r.Vector3;
  20975. return function(t, i, n, r, o, a, s, l) {
  20976. if (!t)
  20977. throw new M("Player.checkAndWaitForTiledPanoLoad() -> Cannot load texture for null pano.");
  20978. return e.copy(d.FORWARD),
  20979. this.getDirection(e),
  20980. !t.isLoaded(i) && (a && this.model.waitForLoad(t, function() {
  20981. return t.isLoaded(i)
  20982. }),
  20983. t.loadTiledPano(i, e, null, s, l).done(function(e, t) {
  20984. n && n(e, t)
  20985. }
  20986. .bind(this)).fail(function(e) {
  20987. r && r(e)
  20988. }
  20989. .bind(this)).progress(function(e, t, i) {
  20990. o && o(e, t, i)
  20991. }
  20992. .bind(this)),
  20993. !0)
  20994. }
  20995. }(),
  20996. n.prototype.switchCameraMode = function(e, t) {
  20997. var i = this.cameraControls.controls[e]
  20998. , n = i.camera;
  20999. switch (e) {
  21000. case u.PANORAMA:
  21001. n.position.copy(this.currentPano.position);
  21002. var o = t ? d.FORWARD.clone().applyQuaternion(t) : this.getDirection().setY(0).normalize();
  21003. i.lookAt(o.add(n.position));
  21004. break;
  21005. case u.DOLLHOUSE:
  21006. var a = this.position.clone();
  21007. 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),
  21008. n.position.copy(a),
  21009. i.target.copy(this.target.clone().setY(this.model.center.y));
  21010. break;
  21011. case u.FLOORPLAN:
  21012. n.position.copy(this.model.center).setY(f.floorplan.cameraHeight),
  21013. i.target.copy(this.model.center).setY(0),
  21014. i.zoomToContain(this.model.size),
  21015. i.rotateToView(this.model.size, this.getDirection())
  21016. }
  21017. i.update(0)
  21018. }
  21019. ,
  21020. n.prototype.update = function() {
  21021. var e = (new r.Vector3,
  21022. {})
  21023. , t = [];
  21024. return function(i) {
  21025. this.updatePersistentZooming(i),
  21026. this.updateFromControls(i),
  21027. this.getCurrentNodePanos(t),
  21028. this.hasChanged(e) && (this.lastChangeTime = Date.now(),
  21029. !this.mouseDown && this.containsMouse && this.updateIntersect(),
  21030. this.emit(w.ViewChanged)),
  21031. this.model.supportsTiles && (this.updateTileDownloader(t),
  21032. this.updatePanoRenderer(t)),
  21033. this.updatePreRendering(t),
  21034. this.reticule.update(),
  21035. this.path.update(),
  21036. this.spider.update(),
  21037. this.cachedPanoCandidates && f.navigation.panoScores && this.model.panos.showPanoScores(this.cachedPanoCandidates),
  21038. this.updateControlLocks(),
  21039. this.model.supportsTiles && this.updateZoomPano()
  21040. }
  21041. }(),
  21042. n.prototype.updatePersistentZooming = function(e) {
  21043. 1 === this.zooming ? this.zoomBy(1 + this.zoomSpeed * e) : this.zooming === -1 && this.zoomBy(1 - this.zoomSpeed * e)
  21044. }
  21045. ,
  21046. n.prototype.updateControlLocks = function() {
  21047. this.currentPano && this.model.supportsTiles && (this.cameraControls.controls[u.PANORAMA].locked = !this.currentPano.highestFullTileRenderOpCompleted && this.currentPano.lockUntilRenderingComplete)
  21048. }
  21049. ,
  21050. n.prototype.updatePanoRenderer = function() {
  21051. var e = new r.Vector3;
  21052. return function(t) {
  21053. var i = this.nextPano || this.currentPano;
  21054. this.panoRenderer.hasQueuedTiles() && i && (e.copy(d.FORWARD),
  21055. this.getDirection(e),
  21056. this.panoRenderer.updateDirection(e))
  21057. }
  21058. }(),
  21059. n.prototype.cleanupInactivePanos = function() {
  21060. var e = []
  21061. , t = [];
  21062. return function() {
  21063. e.length = 0,
  21064. e.push(this.currentPano),
  21065. this.nextPano && e.push(this.nextPano),
  21066. t.length = 0;
  21067. for (var i = 0; i < this.panoRenderer.activePanos.length; i++)
  21068. t.push(this.panoRenderer.activePanos[i]);
  21069. for (var n = 0; n < t.length; n++) {
  21070. for (var r = t[n], o = !0, a = 0; a < e.length; a++)
  21071. r.id === e[a].id && (o = !1);
  21072. o && r.exit()
  21073. }
  21074. }
  21075. }(),
  21076. n.prototype.updatePreRendering = function() {
  21077. var e = {};
  21078. return function(t) {
  21079. if (1 === f.tiling.preRenderTourPanos && this.preRenderingEnabled) {
  21080. var i = this.nextPano || this.currentPano;
  21081. if (i && t && t.length > 1) {
  21082. var n = t.findIndex(function(e) {
  21083. if (e.id === i.id)
  21084. return !0
  21085. });
  21086. if (n >= 0 && n + 1 < t.length) {
  21087. var r = t[n + 1];
  21088. r.isLoaded(this.basePanoSize) || e[r.id] || (window.setTimeout(function(t) {
  21089. this.checkAndWaitForPanoLoad(t, "high", "low", this.basePanoSize, null, null, null, !1, !1, !1),
  21090. window.setTimeout(function(t) {
  21091. e[t.id] = !1
  21092. }
  21093. .bind(this, t), f.tiling.panoPreRenderRepeatDelay)
  21094. }
  21095. .bind(this, r), f.tiling.panoPreRenderDelay),
  21096. e[r.id] = !0)
  21097. }
  21098. }
  21099. }
  21100. }
  21101. }(),
  21102. n.prototype.enablePreRendering = function() {
  21103. this.preRenderingEnabled = !0
  21104. }
  21105. ,
  21106. n.prototype.disablePreRendering = function() {
  21107. this.preRenderingEnabled = !1,
  21108. this.cleanupInactivePanos()
  21109. }
  21110. ,
  21111. n.prototype.updateTileDownloader = function() {
  21112. var e = new r.Vector3;
  21113. return function(t) {
  21114. var i = this.nextPano || this.currentPano;
  21115. i && (e.copy(d.FORWARD),
  21116. this.getDirection(e),
  21117. this.tileDownloader.tilePrioritizer.updateCriteria(i, this.position, e, t.length > 0 ? t : null),
  21118. this.tileDownloader.processPriorityQueue = !0)
  21119. }
  21120. }(),
  21121. n.prototype.updateFromControls = function(e) {
  21122. null !== e && void 0 !== e || (e = 0),
  21123. this.cameraControls.activeControl && (this.cameraControls.activeControl.update(e),
  21124. this.quaternion.copy(this.cameraControls.activeControl.camera.quaternion),
  21125. this.position.copy(this.cameraControls.activeControl.camera.position),
  21126. this.target.copy(this.cameraControls.activeControl.target),
  21127. this.cameraControls.activeControl.camera.updateProjectionMatrix(),
  21128. this.camera.projectionMatrix.copy(this.cameraControls.activeControl.camera.projectionMatrix)),
  21129. this.camera.position.copy(this.position),
  21130. this.camera.quaternion.copy(this.quaternion),
  21131. this.camera.updateMatrix(),
  21132. this.camera.updateMatrixWorld()
  21133. }
  21134. ,
  21135. n.prototype.hasChanged = function(e) {
  21136. if (!this.previousState)
  21137. return this.previousState = {
  21138. allFloorsVisible: this.model.allFloorsVisible,
  21139. position: this.position.clone(),
  21140. quaternion: this.quaternion.clone(),
  21141. mouse: this.mouse.clone(),
  21142. labelScaleFactor: this.getLabelScaleFactor(),
  21143. currentFloor: this.model.currentFloor,
  21144. projectionMatrix: this.camera.projectionMatrix.clone(),
  21145. worldMatrix: this.camera.matrixWorld.clone(),
  21146. mode: this.mode,
  21147. modelPosition: this.model.position.clone(),
  21148. modelCenter: this.model.center.clone(),
  21149. zoomLevel: this.zoomLevel
  21150. },
  21151. !0;
  21152. var t = this.model.allFloorsVisible === this.previousState.allFloorsVisible && this.position.equals(this.previousState.position) && this.quaternion.equals(this.previousState.quaternion) && this.mouse.equals(this.previousState.mouse) && this.getLabelScaleFactor() === this.previousState.labelScaleFactor && this.model.currentFloor === this.previousState.currentFloor && this.camera.projectionMatrix.equals(this.previousState.projectionMatrix) && this.camera.matrixWorld.equals(this.previousState.worldMatrix) && this.mode === this.previousState.mode && this.model.position.equals(this.previousState.modelPosition) && this.model.center.equals(this.previousState.modelCenter) && null === this.nextPano && this.zoomLevel === this.previousState.zoomLevel;
  21153. return e.allFloorsVisible = this.model.allFloorsVisible !== this.previousState.allFloorsVisible,
  21154. e.moved = !this.position.equals(this.previousState.position),
  21155. e.rotated = !this.quaternion.equals(this.previousState.quaternion),
  21156. e.mouseMoved = !this.mouse.equals(this.previousState.mouse),
  21157. e.labelScaleFactor = this.getLabelScaleFactor() !== this.previousState.labelScaleFactor,
  21158. e.floorChanged = this.model.currentFloor !== this.previousState.currentFloor,
  21159. e.cameraProjectionChanged = !this.camera.projectionMatrix.equals(this.previousState.projectionMatrix),
  21160. e.cameraWorldMatrixChanged = !this.camera.matrixWorld.equals(this.previousState.worldMatrix),
  21161. e.modeChanged = this.mode !== this.previousState.mode,
  21162. e.modelPositionChanged = !this.model.position.equals(this.previousState.modelPosition),
  21163. e.modelCenterChanged = !this.model.center.equals(this.previousState.modelCenter),
  21164. e.nextPanoActive = null !== this.nextPano,
  21165. e.zoomLevel = this.zoomLevel !== this.previousState.zoomLevel,
  21166. this.previousState.allFloorsVisible = this.model.allFloorsVisible,
  21167. this.previousState.position.copy(this.position),
  21168. this.previousState.quaternion.copy(this.quaternion),
  21169. this.previousState.mouse.copy(this.mouse),
  21170. this.previousState.labelScaleFactor = this.getLabelScaleFactor(),
  21171. this.previousState.currentFloor = this.model.currentFloor,
  21172. this.previousState.projectionMatrix.copy(this.camera.projectionMatrix),
  21173. this.previousState.worldMatrix.copy(this.camera.matrixWorld),
  21174. this.previousState.mode = this.mode,
  21175. this.previousState.modelPosition.copy(this.model.position),
  21176. this.previousState.modelCenter.copy(this.model.center),
  21177. this.previousState.zoomLevel = this.zoomLevel,
  21178. !t
  21179. }
  21180. ,
  21181. n.prototype.updateIntersect = function() {
  21182. var e = this.flying || this.isWarping()
  21183. , t = this.isOutsideMode() && this.cameraControls.controls[this.mode].isEngaged()
  21184. , i = y.getById(V.LookTransition)
  21185. , n = !(e || t || this.isTouchEvent || i.length && i[0].running);
  21186. //this.tagManager.intersecttag(this.mouse, n, this.camera) || (this.intersect = this.getMouseIntersect(),//--MP
  21187. this.intersect = this.getMouseIntersect(); //xzw change
  21188. this.intersect && this.updateClosestPano(this.intersect),
  21189. this.closestPano || this.closestPanoInDirection(this.getMouseDirection()) ? (this.reticule.updatePosition(this.position, this.intersect),
  21190. f.navigation.panoScores && !f.navigation.mouseDirection && this.closestPanoInDirection(this.getDirection())) : this.reticule.hide()
  21191. }
  21192. ,
  21193. n.prototype.checkHotClick = function() {
  21194. if(this.intersectHot){
  21195. this.intersectHot.examine(this);
  21196. /* g_touraudio.pause();
  21197. g_bgaudio = false;
  21198. document.getElementById("bgaudio").pause();
  21199. var sWidth = document.body.scrollWidth;
  21200. var sHeight = document.body.scrollHeight;
  21201. var pop1 = document.getElementById('popup');
  21202. pop1.style.display = "block";
  21203. var myElement = document.createElement("iframe");
  21204. myElement.src = g_HotMeshes[i].hotLink;
  21205. myElement.id = "id1";
  21206. myElement.allowTransparency = "true";
  21207. myElement.style.width = "100%";
  21208. myElement.style.height = "100%";
  21209. myElement.scrolling = "no";
  21210. var element=document.getElementById("id1");
  21211. if (typeof(element)== "undefined" || element == null){
  21212. document.getElementById("popup").appendChild(myElement);
  21213. }
  21214. var oClose = document.getElementById("closepop");
  21215. oClose.onclick = function() {
  21216. pop1.style.display = "none";
  21217. document.getElementById("popup").removeChild(document.getElementById("id1"));
  21218. $("#popup iframe:last").remove();
  21219. document.getElementById("bgaudio").play();
  21220. } */
  21221. return true;
  21222. }
  21223. },
  21224. n.prototype.getMouseDirection = function(e) {
  21225. e = e || this.mouse;
  21226. var t = new r.Vector3(e.x,e.y,-1).unproject(this.camera)
  21227. , i = new r.Vector3(e.x,e.y,1).unproject(this.camera);
  21228. return i.sub(t).normalize()
  21229. }
  21230. ,
  21231. n.prototype.getMouseIntersect = function(e, t) {//xzw change
  21232. e = e || this.mouse.clone(),
  21233. t = t || this.model.floors.reduce(function(e, t) {
  21234. return t.hidden ? e : e.concat(t.collider.children)
  21235. }, this.mode === u.PANORAMA ? this.panoMarkers : []);
  21236. for(var i in this.model.hots){
  21237. t.push(this.model.hots[i].mesh);
  21238. }
  21239. var i = new r.Vector3(e.x,e.y,-1).unproject(this.camera);
  21240. this.raycaster.set(i, this.getMouseDirection(e));
  21241. var n = this.raycaster.intersectObjects(t);
  21242. if (0 === n.length){
  21243. this.intersectHot = null; //add
  21244. if(g_HotStatus!="add") $("#player").css("cursor","");
  21245. return null;
  21246. }
  21247. var o = n[0];
  21248. if(o.object.type == "hotSprite"){ //add
  21249. this.intersectHot = o.object.belongHot;
  21250. $("#player").css("cursor","pointer");
  21251. return;
  21252. }
  21253. this.intersectHot = null;
  21254. if(g_HotStatus!="add") $("#player").css("cursor","");
  21255. if (o.face) {
  21256. o.normal = o.face.normal.applyQuaternion(o.object.quaternion);
  21257. var a = this.position.clone().sub(o.point);
  21258. a.dot(o.normal) < 0 && o.normal.negate(),
  21259. this.currentPano ? o.onFloor = o.point.y < this.position.y - .5 * this.currentPano.height : o.onFloor = o.point.y < this.position.y - .5,
  21260. o.horizontal = o.normal.y > .8
  21261. }
  21262. return o
  21263. }
  21264. ,
  21265. n.prototype.updateClosestPano = function(e) {
  21266. var t = [s.filters.isPanoAligned()];
  21267. if (this.mode === u.PANORAMA) {
  21268. if (!this.currentPano)
  21269. return;
  21270. t.push(s.filters.not(this.currentPano)),
  21271. t.push(s.filters.inFloorDirection(this.currentPano.floorPosition, this.getDirection(), .25)),
  21272. t.push(s.filters.isNeighbourPanoTo(this.currentPano)),
  21273. t.push(s.filters.isCloseEnoughTo(e.point, f.panoFloorClickRadius)),
  21274. t.push(s.filters.isNotBehindNormal(e.point, e.normal))
  21275. } else
  21276. t.push(s.filters.isOnVisibleFloor()),
  21277. this.mode !== u.FLOORPLAN && t.push(s.filters.inDirection(this.position, this.getDirection(), .25));
  21278. var i = this.model.panos.find(t, [s.sortFunctions.floorDistanceToPoint(e.point)]);
  21279. i !== this.closestPano ? (i && (this.isPanoHover = !0),
  21280. this.emit(w.ClosestPanoChanging, this.closestPano, i, this.mode),
  21281. this.closestPano = i) : this.isPanoHover = !1
  21282. }
  21283. ,
  21284. n.prototype.dollhouseMode = function(e, t) {
  21285. this.emit(w.ModeChanging, this.mode, u.DOLLHOUSE),
  21286. this.mode = u.DOLLHOUSE,
  21287. this.cameraControls.controls[u.DOLLHOUSE].reset();
  21288. var i = new r.Vector3(this.model.center.x,0,this.model.center.z)
  21289. , n = new r.Vector3(15,10,15);
  21290. if (e && t) {
  21291. var o = d.FORWARD.clone().applyQuaternion(t)
  21292. , a = this.model.center.clone().sub(e)
  21293. , s = a.dot(o);
  21294. s > 0 ? (i = o.clone().multiplyScalar(s).add(e),
  21295. n.copy(e)) : F.warn("Tried to initiate dollhouse mode that wasn't looking at the model", e, t)
  21296. }
  21297. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(0, !0),
  21298. this.cameraControls.controls[u.DOLLHOUSE].target.copy(i),
  21299. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(n),
  21300. this.updateFromControls(),
  21301. this.model.alpha = 1,
  21302. this.model.skybox.material.uniforms.opacity.value = 0
  21303. }
  21304. ,
  21305. n.prototype.insideMode = function(e, t) {
  21306. var i = $.Deferred()
  21307. , n = t || null;
  21308. if (this.mode !== u.PANORAMA && this.mode !== u.TRANSITIONING) {
  21309. var r = [s.filters.isPanoAligned()];
  21310. this.model.currentFloor && r.push(s.filters.atFloor(this.model.currentFloor)),
  21311. e = e || this.currentPano || this.model.panos.find(r, [s.sortFunctions.distanceToPoint(this.cameraControls.activeControl.target)]),
  21312. this.flyToNewMode({
  21313. mode: u.PANORAMA,
  21314. pano: e,
  21315. callback: n
  21316. }).done(i.resolve.bind(i)).fail(i.reject.bind(i))
  21317. } else {
  21318. var o = this.mode === u.PANORAMA ? "Already in panorama mode" : "Cannot change mode during mode transition";
  21319. i.reject(o)
  21320. }
  21321. return i.promise()
  21322. }
  21323. ,
  21324. n.prototype.fitDollhouse = function(e, t, i) {
  21325. var n = d.FORWARD.clone().applyQuaternion(i);
  21326. this.cameraControls.activeControl.target.copy(n).add(e);
  21327. var o = d.RIGHT.clone().applyQuaternion(i)
  21328. , a = d.UP.clone()
  21329. , s = o.clone().applyAxisAngle(a, Math.PI / 2)
  21330. , l = this.model.boundingBox.max.clone()
  21331. , c = this.model.boundingBox.min.clone()
  21332. , 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)]
  21333. , u = 0
  21334. , p = 0
  21335. , g = 0;
  21336. h.forEach(function(e, t, i) {
  21337. var n = Math.abs(e.dot(o))
  21338. , r = e.dot(s);
  21339. n > u && (u = n,
  21340. p = r),
  21341. r > g && (g = r)
  21342. });
  21343. 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)))
  21344. , v = s.clone().multiplyScalar(p).add(t)
  21345. , A = s.clone().multiplyScalar(g).add(t);
  21346. p = u / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * this.cameraControls.activeControl.camera.aspect * (Math.PI / 180)),
  21347. g = m / Math.tan(this.cameraControls.activeControl.camera.fov / 2 * (Math.PI / 180)),
  21348. p = Math.max(p, 10),
  21349. g = Math.max(g, 10);
  21350. var y = n.clone().multiplyScalar(-p).add(v).sub(t).length()
  21351. , C = n.clone().multiplyScalar(-g).add(v).sub(t).length();
  21352. this.cameraControls.activeControl.maxDistance = f.skyboxRadius - 1,
  21353. y >= C ? this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(v).add(n.multiplyScalar(1.1 * -p)) : this.cameraControls.activeControl.camera.position.set(0, 6, 0).add(A).add(n.multiplyScalar(1.1 * -g))
  21354. }
  21355. ,
  21356. n.prototype.floorplanMode = function(e, t, i) {
  21357. this.mode = u.FLOORPLAN;
  21358. var n = this.cameraControls.controls[u.FLOORPLAN];
  21359. n.reset();
  21360. var r = e ? e : this.model.center;
  21361. if (n.target.copy(r).setY(0),
  21362. n.camera.position.copy(r).setY(f.floorplan.cameraHeight),
  21363. i ? (n.currentScale = i / ($("#player").width() / $("#player").height()),
  21364. n.absoluteScale = n.currentScale) : n.zoomToContain(this.model.size),
  21365. t) {
  21366. var o = d.LEFT.clone().applyQuaternion(t);
  21367. n.rotateLeft(-Math.atan2(o.x, o.z))
  21368. } else
  21369. n.rotateToView(this.model.size, this.getDirection());
  21370. n.update(0)
  21371. }
  21372. ,
  21373. n.prototype.nonInterruptingFlyToPano = function(e, t) {
  21374. return e.skipWarpingCheck = !0,
  21375. this.flyToPano(e, t)
  21376. }
  21377. ,
  21378. n.prototype.flyToPano = function(e, t) {
  21379. var i = e.pano
  21380. , n = e.lookAtPoint
  21381. , o = e.duration
  21382. , a = e.aimDuration
  21383. , s = e.maxDistanceOverride
  21384. , l = e.skipWarpingCheck
  21385. , c = e.constantMoveSpeed
  21386. , h = null
  21387. , p = null;
  21388. if (this.isWarping() && !l && (this.path.activeTransType === x.BLACK || this.path.activeTransType === x.STD))
  21389. return F.warn("Player.flyToPano() -> Cannot fly when warping"),
  21390. t && t(),
  21391. !1;
  21392. if (this.updateLastView(),
  21393. this.mode !== u.PANORAMA) {
  21394. var m;
  21395. return n && (m = (new r.Quaternion).setFromUnitVectors(d.FORWARD, n.sub(i.position).normalize())),
  21396. void this.flyToNewMode({
  21397. mode: u.PANORAMA,
  21398. pano: i,
  21399. duration: o,
  21400. quaternion: m,
  21401. callback: t
  21402. })
  21403. }
  21404. if (!i || (h = g.deepExtend(e),
  21405. p = function() {
  21406. N.delayOneFrame(function() {
  21407. this.flyToPano(h, t)
  21408. }
  21409. .bind(this))
  21410. }
  21411. .bind(this),
  21412. !this.checkAndWaitForPanoLoad(i, "high", "low", this.basePanoSize, p))) {
  21413. var C = function(e) {
  21414. t && t(e)
  21415. }
  21416. .bind(this);
  21417. this.currentPano || (this.currentPano = i,
  21418. this.path.placeCpm(),
  21419. this.path.fadeOutCpm(f.path.fadeOutTime),
  21420. this.spider.draw());
  21421. var I = o;
  21422. if ("number" != typeof o) {
  21423. var E = s || f.transition.flytimeMaxDistanceThreshold;
  21424. I = Math.min(this.currentPano.position.distanceTo(i.position), E) * f.transition.flytimeDistanceMultiplier + f.transition.flyTime
  21425. }
  21426. if (f.transition.flySpeed > .01 && (I = 1e3 * this.currentPano.position.distanceTo(i.position) / f.transition.flySpeed),
  21427. 1 !== this.zoomLevel)
  21428. switch (f.zoom.transitionStyle) {
  21429. case 1:
  21430. this.smoothZoomToDefault(I / 2);
  21431. break;
  21432. case 2:
  21433. return h = g.deepExtend(e),
  21434. p = this.flyToPano.bind(this, h, t),
  21435. void this.smoothZoomToDefault(f.zoom.restoreTime * (this.zoomLevel - 1), p)
  21436. }
  21437. if (n) {
  21438. y.cancelById(V.LookTransition),
  21439. I *= f.transition.aimSlowFactor;
  21440. var b = this.cameraControls.activeControl.camera.quaternion.clone()
  21441. , _ = (new r.Matrix4).lookAt(i.position, n, d.UP)
  21442. , T = (new r.Quaternion).setFromRotationMatrix(_)
  21443. , S = b.clone()
  21444. , M = new r.Vector3;
  21445. if (i === this.currentPano) {
  21446. var R = d.FORWARD.clone().applyQuaternion(b)
  21447. , P = d.FORWARD.clone().applyQuaternion(T)
  21448. , O = R.angleTo(P);
  21449. return void 0 !== a && null !== a || (a = 1 * Math.sqrt(O) / f.tags.navigate.rotateSpeedFactor * 1e3),
  21450. void y.start(function(e) {
  21451. S.copy(b),
  21452. v.quaternion(S, T)(e),
  21453. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21454. this.cameraControls.activeControl.lookAt(M)
  21455. }
  21456. .bind(this), a, C, 0, A[f.transition.movementEasing], null, V.LookTransition)
  21457. }
  21458. }
  21459. if (i === this.currentPano || this.flying)
  21460. return void C();
  21461. this.flying = !0;
  21462. var L = this.position.clone()
  21463. , D = this.currentPano;
  21464. F.debug("Flying to pano ", i.position),
  21465. this.emit(w.PanoChosen, this.currentPano, i),
  21466. this.emit(w.FlyingStarted, i.position, L, i, D),
  21467. n && y.start(function(e) {
  21468. S.copy(b),
  21469. v.quaternion(S, T)(e),
  21470. M.copy(d.FORWARD).applyQuaternion(S).add(this.cameraControls.activeControl.camera.position),
  21471. this.cameraControls.activeControl.lookAt(M)
  21472. }
  21473. .bind(this), I, null, 0, A[f.transition.movementEasing], null, V.LookTransition);
  21474. var B = c ? null : A[f.transition.movementEasing];
  21475. this.nextPano = i,
  21476. y.start(v.uniform(this.model.skybox, "progress", 1), I, null, 0, A[f.transition.blendEasing], "skyFly", V.FlyToPano),
  21477. y.start(v.allUniforms(this.model.chunks, "progress", 1), I, null, 0, A[f.transition.blendEasing], "chunkFly", V.FlyToPano),
  21478. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, i.position), I, function(e) {
  21479. this.flying = !1,
  21480. this.currentPano !== i && this.currentPano.exit(),
  21481. i.enter(),
  21482. this.currentPano = i,
  21483. this.nextPano = null,
  21484. this.path.placeCpm(),
  21485. this.path.fadeOutCpm(f.path.fadeOutTime),
  21486. this.spider.draw(),
  21487. this.emit(w.FlyingEnded, i.position, L, i, D),
  21488. C(e)
  21489. }
  21490. .bind(this), 0, B, "camFly", V.FlyToPano)
  21491. }
  21492. }
  21493. ,
  21494. n.prototype.fastForwardActivePanoFlight = function(e) {
  21495. e = e || f.transition.fastForwardFactor / 10 * 4 + 1,
  21496. y.adjustSpeed(V.FlyToPano, e),
  21497. y.adjustSpeed(V.LookTransition, e)
  21498. }
  21499. ,
  21500. n.prototype.flyToPanoClosestToMouse = function() {
  21501. if (Date.now() - this.mouseLastMoveTime > 50 && (this.intersect = this.getMouseIntersect(),
  21502. this.intersect && this.updateClosestPano(this.intersect)),
  21503. this.closestPano)
  21504. return this.flyToPano({
  21505. pano: this.closestPano
  21506. });
  21507. var e = this.getMouseDirection();
  21508. this.flyDirection(e) || this.flyToPano({
  21509. pano: this.currentPano
  21510. })
  21511. }
  21512. ,
  21513. n.prototype.flyLocalDirection = function(e) {
  21514. var t = this.getDirection(e)
  21515. , i = 1 === e.z ? .4 : .75
  21516. , n = 1 === Math.abs(e.x);
  21517. return this.flyDirection(t, i, n)
  21518. }
  21519. ,
  21520. n.prototype.flyDirection = function(e, t, i) {
  21521. this.closePopup();//xzw add
  21522. var n = $.Deferred();
  21523. this.history.invalidate();
  21524. var r = this.closestPanoInDirection(e, t, i);
  21525. return r ? this.flyToPano({
  21526. pano: r
  21527. }, n.resolve.bind(n, !0)) : (this.bump(e),
  21528. n.resolve(!1)),
  21529. n.promise()
  21530. }
  21531. ,
  21532. n.prototype.closestPanoInDirection = function(e, t, i) {
  21533. return this.rankedPanoInDirection(0, e, t, i)
  21534. }
  21535. ,
  21536. n.prototype.rankedPanoInDirection = function() {
  21537. var e = {
  21538. pano: null,
  21539. candidates: []
  21540. };
  21541. return function(t, i, n, r) {
  21542. t || (t = 0),
  21543. n = void 0 !== n ? n : .75;
  21544. var o = r ? "angle" : "direction";
  21545. return this.model.panos.findRankedByScore(t, [s.filters.isPanoAligned(), s.filters.inPanoDirection(this.position, i, n), s.filters.isNeighbourPanoTo(this.currentPano), s.filters.not(this.currentPano)], [s.scoreFunctions.distanceSquared(this.currentPano), s.scoreFunctions[o](this.position, i)], e),
  21546. this.cachedPanoCandidates = e.candidates,
  21547. e.pano
  21548. }
  21549. }(),
  21550. n.prototype.bump = function(e) {
  21551. if (this.mode === u.PANORAMA && !this.flying && !this.isWarping()) {
  21552. var t, i, n, r = f.transition, o = (r.flytimeMaxDistanceThreshold * r.flytimeDistanceMultiplier + r.flyTime) / 8, a = this.camera.getWorldDirection().dot(e), s = Math.abs(a) > .5;
  21553. if (s)
  21554. t = function() {
  21555. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", a > 0 ? 1.04 : .96), o, i, 0, A.easeInOutSine, "bumpZStart")
  21556. }
  21557. .bind(this),
  21558. i = function() {
  21559. y.start(v.property(this.cameraControls.cameras[u.PANORAMA], "zoom", 1), 5 * o, n, 0, A.easeInOutSine, "bumpZRelax")
  21560. }
  21561. .bind(this);
  21562. else {
  21563. var l = this.camera.position.clone()
  21564. , c = e.clone();
  21565. this.raycaster.set(l, c);
  21566. var h = this.model.floors.reduce(function(e, t) {
  21567. return e.concat(t.collider.children)
  21568. }, [])
  21569. , d = this.raycaster.intersectObjects(h)
  21570. , p = d.length > 0 ? d[0].distance / 25 : .04
  21571. , g = l.clone().add(c.multiplyScalar(p));
  21572. t = function() {
  21573. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, g), o, i, 0, A.easeInOutSine, "bumpTStart")
  21574. }
  21575. .bind(this),
  21576. i = function() {
  21577. y.start(v.vector(this.cameraControls.cameras[u.PANORAMA].position, l), 5 * o, n, 0, A.easeInOutSine, "bumpTRelax")
  21578. }
  21579. .bind(this)
  21580. }
  21581. n = function() {
  21582. this.flying = !1
  21583. }
  21584. .bind(this),
  21585. this.flying = !0,
  21586. t()
  21587. }
  21588. }
  21589. ,
  21590. n.prototype.changeFloor = function(e) {
  21591. if (!this.is360View(this.mode, this.currentPano))
  21592. if (this.mode === u.PANORAMA) {
  21593. var t = this.history.reversePano(e);
  21594. t && t.isAligned() ? this.flyToPano({
  21595. pano: t
  21596. }) : this.changeFloorByScore(e)
  21597. } else
  21598. this.model.setFloor(this.model.nextFloor(e) || this.model.currentFloor)
  21599. }
  21600. ,
  21601. n.prototype.changeFloorByScore = function() {
  21602. var e = {
  21603. pano: null,
  21604. candidates: []
  21605. };
  21606. return function(t) {
  21607. var i = this.model.nextFloor(t);
  21608. return i ? (this.model.panos.lowestByScore([s.filters.atFloor(i), s.filters.isPanoAligned()], [s.scoreFunctions.distance(this.currentPano), s.scoreFunctions.direction(this.position, new r.Vector3(0,t,0)), s.scoreFunctions.penalizeHeightDifferenceUnder(this.position, .5)], e),
  21609. void (e.pano ? (this.cachedPanoCandidates = e.candidates,
  21610. this.history.push(t, this.currentPano),
  21611. this.flyToPano({
  21612. pano: e.pano
  21613. })) : F.warn("No pano found on selected floor, not moving there."))) : void F.debug("player.changeFloor(" + t + "): no such floor")
  21614. }
  21615. }(),
  21616. n.prototype.gotoFloor = function(e) {
  21617. var t = e - this.model.currentFloor.floorIndex;
  21618. this.changeFloor(t)
  21619. }
  21620. ,
  21621. n.prototype.getDirection = function(e) {
  21622. return e = e ? e : (new r.Vector3).copy(d.FORWARD),
  21623. e.applyQuaternion(this.camera.quaternion)
  21624. }
  21625. ,
  21626. n.prototype.flyToSameMode = function(e, t, i, n, o) {
  21627. if (o = o || $.Deferred(),
  21628. this.mode === u.TRANSITIONING)
  21629. return F.warn("should not be transitioning here"),
  21630. n && n(!1),
  21631. o.reject().promise();
  21632. var a = i || !1
  21633. , s = i ? i.position : this.position
  21634. , l = this.position.clone()
  21635. , c = this.currentPano;
  21636. if (F.debug("New pose in mode " + this.mode),
  21637. !e || (retryCallback = function() {
  21638. N.delayOneFrame(function() {
  21639. this.flyToSameMode(e, t, i, n, o)
  21640. }
  21641. .bind(this))
  21642. }
  21643. .bind(this),
  21644. !this.checkAndWaitForPanoLoad(e, "high", "low", this.basePanoSize, retryCallback))) {
  21645. var h = function() {
  21646. this.emit(w.FlyingEnded, s, l, e, c),
  21647. n && n(!0)
  21648. }
  21649. .bind(this)
  21650. , d = f[this.mode]
  21651. , p = void 0 !== t ? t : d.transitionTime
  21652. , g = new r.Vector3
  21653. , C = new r.Vector3;
  21654. if (this.emit(w.FlyingStarted, s, l, e, c),
  21655. this.mode === u.PANORAMA)
  21656. F.warn("we should not be here for panorama views");
  21657. else if (this.mode === u.DOLLHOUSE)
  21658. if (a) {
  21659. var I = new r.Vector3(0,1,0);
  21660. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21661. this.model.warpDestFloors(i.floorVisibility),
  21662. C.copy(i.position);
  21663. var E = new r.Vector3(0,0,-1).applyQuaternion(i.quaternion)
  21664. , b = new r.Raycaster(C.clone(),E.clone(),0,1 / 0)
  21665. , _ = b.intersectObjects(this.model.colliders)
  21666. , T = 3;
  21667. _.length ? (g.copy(_[0].point),
  21668. T = .75 * C.distanceTo(g)) : (g.copy(E).multiplyScalar(3).add(C),
  21669. F.debug("Tried to restore dollhouse mode that did not intersect...", i.position, i.quaternion));
  21670. var x = (new r.Matrix4).lookAt(C, g, I)
  21671. , S = (new r.Euler).setFromRotationMatrix(x, f.warp.eOrder)
  21672. , M = g.distanceTo(C)
  21673. , R = (new r.Matrix4).lookAt(this.cameraControls.cameras[u.DOLLHOUSE].position, this.cameraControls.controls[u.DOLLHOUSE].target, I)
  21674. , P = (new r.Euler).setFromRotationMatrix(R, f.warp.eOrder)
  21675. , O = this.cameraControls.cameras[u.DOLLHOUSE].position.distanceTo(this.cameraControls.controls[u.DOLLHOUSE].target);
  21676. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(Math.min(O, T), !0);
  21677. var L = new r.Euler(S.x - P.x,S.y - P.y,S.z - P.z,f.warp.eOrder);
  21678. L.y = L.y > Math.PI ? L.y -= 2 * Math.PI : L.y < -Math.PI ? L.y += 2 * Math.PI : L.y,
  21679. this.path.burnsDir = Math.sign(L.y);
  21680. var D = new r.Euler(0,0,0,f.warp.eOrder)
  21681. , B = new r.Vector3;
  21682. y.start(v.vector(this.cameraControls.controls[u.DOLLHOUSE].target, g), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21683. y.start(function(e, t) {
  21684. D.x = P.x + e * L.x,
  21685. D.y = P.y + e * L.y,
  21686. D.z = P.z + e * L.z;
  21687. var i = O + e * (M - O);
  21688. B.set(0, 0, i).applyEuler(D).add(this.cameraControls.controls[u.DOLLHOUSE].target),
  21689. this.cameraControls.cameras[u.DOLLHOUSE].position.copy(B).add(this.model.position)
  21690. }
  21691. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode),
  21692. y.start(function(e, t) {
  21693. this.cameraControls.controls[u.DOLLHOUSE].update(),
  21694. this.quaternion.copy(this.cameraControls.cameras[u.DOLLHOUSE].quaternion),
  21695. this.position.copy(this.cameraControls.cameras[u.DOLLHOUSE].position)
  21696. }
  21697. .bind(this), p, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21698. } else
  21699. F.warn("invalid warp destination in flyToSameMode()? ignore it then");
  21700. else if (this.path.placeCpm(),
  21701. this.path.fadeInCpm(f.path.fadeInTime),
  21702. i) {
  21703. this.model.warpDestFloors(i.floorVisibility);
  21704. var U = this.cameraControls.cameras[u.FLOORPLAN]
  21705. , k = this.cameraControls.controls[u.FLOORPLAN]
  21706. , H = k.target.clone()
  21707. , G = i.position.clone().sub(H)
  21708. , z = U.position.clone().sub(k.target)
  21709. , W = z.length()
  21710. , j = new r.Vector3(-1,0,0).applyQuaternion(i.quaternion).normalize()
  21711. , Y = Math.atan2(k.offset.x, k.offset.z)
  21712. , X = Math.atan2(j.x, j.z)
  21713. , Z = k.absoluteScale
  21714. , q = m.convertWorkshopOrthoZoom(i.orthoZoom);
  21715. y.start(function(e, t) {
  21716. k.target.copy(G).multiplyScalar(e).add(H);
  21717. var i = Y + (X - Y) * e;
  21718. k.offset.x = W * Math.sin(i),
  21719. k.offset.z = W * Math.cos(i),
  21720. U.position.copy(k.target).add(k.offset),
  21721. k.absoluteScale = Z + e * (q - Z),
  21722. k.update(),
  21723. this.quaternion.copy(U.quaternion),
  21724. this.position.copy(U.position),
  21725. this.target.copy(k.target),
  21726. this.camera.projectionMatrix.copy(U.projectionMatrix)
  21727. }
  21728. .bind(this), p, null, 0, A[f.flydown.movementEasing], null, V.FlyToSameMode)
  21729. } else
  21730. F.info("flyToSameMode() funny floorplan view? skipping");
  21731. return y.setTimeout(function(e) {
  21732. this.mode = e,
  21733. h(),
  21734. o.resolve(!0)
  21735. }
  21736. .bind(this, this.mode), p, V.FlyToSameMode),
  21737. this.mode = u.TRANSITIONING,
  21738. o.promise()
  21739. }
  21740. }
  21741. ,
  21742. n.prototype.flyToNewMode = function(e, t) {
  21743. e = e || {};
  21744. var i = e.mode
  21745. , n = e.pano
  21746. , o = e.duration
  21747. , a = e.warpDest
  21748. , s = e.callback
  21749. , l = e.force
  21750. , c = e.quaternion;
  21751. if (t = t || $.Deferred(),
  21752. this.isWarping())
  21753. return F.warn("Player.flyToNewMode() -> Cannot fly when warping"),
  21754. s && s(!1),
  21755. t.reject("Cannot change mode during tour transition").promise();
  21756. if (this.mode === u.TRANSITIONING)
  21757. return s && s(!1),
  21758. t.reject("Cannot change mode during mode transition").promise();
  21759. if (i === this.mode)
  21760. return l ? (this.flyToSameMode(n, o, a, s).done(t.resolve.bind(t)).fail(t.reject.bind(t)),
  21761. t.promise()) : (s && s(!1),
  21762. t.reject("Already in " + i + " mode").promise());
  21763. var h = a || !1;
  21764. F.debug("Switching mode to " + i);
  21765. var d = function() {
  21766. N.delayOneFrame(function() {
  21767. this.flyToNewMode(e, t)
  21768. }
  21769. .bind(this))
  21770. }
  21771. .bind(this);
  21772. if (n && this.checkAndWaitForPanoLoad(n, "low", "low", this.basePanoSize, d))
  21773. return t.promise();
  21774. if (!this.model.meshTexturesLoaded && this.isOutsideMode(i))
  21775. return F.info("Waiting for model textures to be loaded before going out to dollhouse"),
  21776. this.model.waitForLoad(this.model, function() {
  21777. return this.model.meshTexturesLoaded;
  21778. }
  21779. .bind(this)),
  21780. this.model.loadMeshTextures().done(d),
  21781. t.promise();
  21782. this.history.invalidate(),
  21783. this.updateLastView();
  21784. var p = this.mode
  21785. , C = this.cameraControls.cameras[i];
  21786. e = g.deepExtend({}, f[i], f[p + "-" + i]);
  21787. var I = void 0 !== o ? o : e.transitionTime;
  21788. this.emit(w.ModeChanging, p, i, n),
  21789. n && (this.currentPano = n),
  21790. this.switchCameraMode(i, c),
  21791. y.cancelById(V.LookTransition);
  21792. var _ = (new r.Vector3).copy(this.position);
  21793. if (i === u.PANORAMA)
  21794. this.emit(w.PanoChosen, n, n),
  21795. setTimeout(function() {
  21796. n.floor.enter(i)
  21797. }
  21798. .bind(this), I / 2),
  21799. this.path.fadeOutCpm(f.path.fadeOutTime);
  21800. else if (i === u.DOLLHOUSE) {
  21801. if (h && (this.model.stayPut = !0),
  21802. a ? (this.cameraControls.controls[u.DOLLHOUSE].resetRanges(1, !0),
  21803. this.model.warpDestFloors(a.floorVisibility)) : this.model.toggleAllFloors(!0),
  21804. this.path.placeCpm(),
  21805. this.path.fadeInCpm(f.path.fadeInTime),
  21806. h) {
  21807. var T = new r.Vector3(this.model.center.x,0,this.model.center.z);
  21808. _.set(15, 10, 15);
  21809. var M = new r.Vector3(0,0,-1).applyQuaternion(a.quaternion)
  21810. , R = new r.Raycaster(a.position.clone(),M.clone(),0,1 / 0)
  21811. , P = R.intersectObjects([this.sceneIntersectionPlane]);
  21812. P.length ? (T.copy(P[0].point),
  21813. _.copy(a.position),
  21814. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(.75 * _.distanceTo(T), !0)) : (F.warn("Tried to restore dollhouse mode that did not intersect...", a.position, a.quaternion),
  21815. this.cameraControls.controls[u.DOLLHOUSE].resetRanges(3, !0)),
  21816. this.cameraControls.controls[u.DOLLHOUSE].target.copy(T),
  21817. _.add(this.model.position),
  21818. C.position.copy(_),
  21819. this.cameraControls.controls[u.DOLLHOUSE].update()
  21820. }
  21821. } else if (this.path.placeCpm(),
  21822. this.path.fadeInCpm(f.path.fadeInTime),
  21823. a) {
  21824. this.model.warpDestFloors(a.floorVisibility);
  21825. var O = this.cameraControls.cameras[u.FLOORPLAN]
  21826. , L = this.cameraControls.controls[u.FLOORPLAN]
  21827. , D = O.position.clone().sub(L.target)
  21828. , B = new r.Vector3(-1,0,0).applyQuaternion(a.quaternion).normalize()
  21829. , U = Math.atan2(B.x, B.z);
  21830. L.target.copy(a.position);
  21831. var k = D.length();
  21832. L.offset.x = k * Math.sin(U),
  21833. L.offset.y = 0,
  21834. L.offset.z = k * Math.cos(U),
  21835. O.position.copy(L.target).add(L.offset);
  21836. L.target.clone().sub(C.position);
  21837. C.quaternion.copy(a.quaternion),
  21838. L.currentScale = m.convertWorkshopOrthoZoom(a.orthoZoom),
  21839. L.absoluteScale = L.currentScale,
  21840. L.update()
  21841. } else
  21842. this.model.currentFloor.enter(i);
  21843. var H = this.currentPano
  21844. , G = this.position.clone();
  21845. return this.emit(w.FlyingStarted, _, G, n, this.currentPano),
  21846. this.flying = !0,
  21847. this.isOutsideMode(i) && this.is360View(p, H) ? (h || i !== u.DOLLHOUSE || (C.position.set(15, 10, 15),
  21848. C.controls.target.set(this.model.center.x, 0, this.model.center.z),
  21849. C.controls.update()),
  21850. e.blackoutStyle = S.FADEIN,
  21851. I = f.show360Views.transitionTime,
  21852. this.fade360View(I, C, e)) : this.isOutsideMode(p) && this.is360View(i, n) ? (h && this.switchCameraMode(i, h.quaternion),
  21853. this.mode = i,
  21854. this.path && this.path.popOutCpm(),
  21855. e.blackoutStyle = S.END,
  21856. I = f.show360Views.transitionTime,
  21857. this.fade360View(I, C, e)) : (y.start(v.property(this.model, "alpha", e.modelAlpha, null), I * e.modelAlphaLength, null, e.modelAlphaDelay, null, V.FlyToNewMode),
  21858. y.start(v.vector(this.position, C.position), I, null, f.flydown.movementDelay, A[f.flydown.movementEasing], null, V.FlyToNewMode),
  21859. y.start(v.quaternion(this.quaternion, C.quaternion), I * e.rotationDuration, null, e.rotationDelay, A[f.flydown.rotationEasing], null, V.FlyToNewMode),
  21860. y.start(v.matrix4(this.camera.projectionMatrix, C.projectionMatrix), I * e.cameraMatrixDuration, null, e.cameraMatrixDelay, e.cameraMatrixEase, null, V.FlyToNewMode),
  21861. y.start(v.uniform(this.model.skybox, "opacity", e.skyboxOpacity), I * e.skyboxOpacityLength, null, e.skyboxOpacityDelay, null, V.FlyToNewMode),
  21862. y.start(v.property(this.reticule.material.uniforms.opacity, "value", 0), I, null, V.FlyToNewMode)),
  21863. y.setTimeout(function() {
  21864. this.flying = !1,
  21865. p === u.PANORAMA && i !== u.PANORAMA ? this.currentPano.exit() : p !== u.PANORAMA && i === u.PANORAMA && (this.currentPano !== H && H.exit(),
  21866. this.currentPano.enter(),
  21867. this.path.placeCpm(),
  21868. this.path.fadeOutCpm(f.path.fadeOutTime),
  21869. this.spider.draw()),
  21870. p === u.DOLLHOUSE && this.cameraControls.controls[u.DOLLHOUSE].resetRanges(),
  21871. this.mode = i,
  21872. this.emit(w.FlyingEnded, _, G, this.currentPano, H),
  21873. h && p !== u.PANORAMA && i === u.PANORAMA ? this.startWarp(b.Retain, E.Retain, x.BLACK, null, null, s) : (s && s(),
  21874. t.resolve())
  21875. }
  21876. .bind(this), I, V.FlyToNewMode),
  21877. this.mode = u.TRANSITIONING,
  21878. t.promise()
  21879. }
  21880. ,
  21881. n.prototype.fade360View = function(e, t, i) {
  21882. this.tagManager.hideShowTagsForBlackoutStyle(i.blackoutStyle, e),
  21883. $(this.domElement).fadeOut(.5 * e, function() {
  21884. this.model.skybox.material.uniforms.opacity.value = i.skyboxOpacity,
  21885. this.model.alpha = i.modelAlpha,
  21886. this.position.copy(t.position),
  21887. this.quaternion.copy(t.quaternion),
  21888. this.camera.projectionMatrix.copy(t.projectionMatrix),
  21889. $(this.domElement).fadeIn(.5 * e)
  21890. }
  21891. .bind(this))
  21892. }
  21893. ,
  21894. n.prototype.findDefaultViews = function() {
  21895. this.findDefaultView(this.lastInsideView, !0),
  21896. this.findDefaultView(this.last360View, !1)
  21897. }
  21898. ,
  21899. n.prototype.findDefaultView = function(e, t) {
  21900. var i, n = this.model.heroLocations, r = this.model.panos, o = n.findIndex(function(e) {
  21901. if (e.cameraMode !== u.PANORAMA)
  21902. return !1;
  21903. var i = r.get(e.panoId);
  21904. return i && i.isAligned() === t
  21905. });
  21906. o >= 0 ? (i = r.get(n[o].panoId),
  21907. e.update({
  21908. cameraMode: u.PANORAMA,
  21909. pano: i,
  21910. position: n[o].position,
  21911. quaternion: n[o].quaternion
  21912. })) : (o = r.list.findIndex(function(e) {
  21913. return e.isAligned() === t
  21914. }),
  21915. o >= 0 ? (i = r.list[o],
  21916. e.update({
  21917. cameraMode: u.PANORAMA,
  21918. pano: i,
  21919. position: i.position
  21920. })) : F.warn("There are no", t ? "inside" : "360º", "views in this model"))
  21921. }
  21922. ,
  21923. n.prototype.updateLastView = function() {
  21924. if (this.mode === u.PANORAMA) {
  21925. var e = this.currentPano.isAligned() ? this.lastInsideView : this.last360View;
  21926. e.update({
  21927. pano: this.currentPano,
  21928. position: this.position,
  21929. quaternion: this.quaternion
  21930. })
  21931. }
  21932. }
  21933. ,
  21934. n.prototype.goToLastView = function(e, t) {
  21935. var i = $.Deferred()
  21936. , n = i.resolve.bind(i)
  21937. , r = i.reject.bind(i)
  21938. , o = e ? this.lastInsideView : this.last360View;
  21939. return this.isInMode(u.PANORAMA) && this.currentPano.isAligned() !== e && this.updateLastView(),
  21940. this.isInMode(u.PANORAMA) ? (this.path && this.path.popOutCpm(),
  21941. this.fadeToView(e, o, f.show360Views.transitionTime, t).done(n).fail(r)) : this.isOutsideMode() && this.flyToNewMode({
  21942. mode: o.cameraMode,
  21943. pano: o.pano,
  21944. quaternion: o.quaternion,
  21945. callback: t
  21946. }).done(n).fail(r),
  21947. i.promise()
  21948. }
  21949. ,
  21950. n.prototype.fadeToView = function(e, t, i, n) {
  21951. var r = $.Deferred()
  21952. , o = r.resolve.bind(r)
  21953. , a = r.reject.bind(r);
  21954. if (!t.isValid() || t.cameraMode === u.PANORAMA && !t.pano)
  21955. return F.warn("Tried to fade to an illegal view", t.cameraMode),
  21956. a("Cannot go to illegal view"),
  21957. r.promise();
  21958. var s = (f[t.cameraMode],
  21959. function() {
  21960. $(this.domElement).fadeIn(.5 * i),
  21961. n && n(),
  21962. o()
  21963. }
  21964. .bind(this))
  21965. , l = e ? S.FADEIN : S.END;
  21966. return this.tagManager.hideShowTagsForBlackoutStyle(l, i),
  21967. $(this.domElement).fadeOut(.5 * i, function() {
  21968. this.model.fadePanoMarkers(e ? f.panorama.markerOpacity : 0),
  21969. t.cameraMode === u.PANORAMA ? this.flyToPano({
  21970. pano: t.pano,
  21971. lookAtPoint: d.FORWARD.clone().applyQuaternion(t.quaternion).add(t.pano.position),
  21972. duration: 0
  21973. }, s) : this.flyToNewMode({
  21974. mode: t.cameraMode,
  21975. quaternion: t.quaternion,
  21976. duration: 0,
  21977. callback: s
  21978. })
  21979. }
  21980. .bind(this)),
  21981. r.promise()
  21982. }
  21983. ,
  21984. n.prototype.startWarp = function(e, t, i, n, r, o) {
  21985. if (this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !1),
  21986. this.flying)
  21987. return F.warn("Player.startWarp() -> Cannot warp when flying"),
  21988. o && o(),
  21989. !1;
  21990. null !== e && void 0 !== e || (e = b.Show),
  21991. this.history.invalidate(),
  21992. e !== b.Retain ? this.path.brushToWarpPano(i, x.BLACK) || (i = x.BLACK) : i = this.path.upcomingTransType;
  21993. var a = this.path.warpDestPano && !this.path.warpDestPano.isAligned();
  21994. return this.emit(w.WarpStarted, a, i, n, r),
  21995. n = n || S.MIDDLE,
  21996. this.path.warpToPano(i, n, r, function() {
  21997. t === E.Slow ? this.path.discardSlow() : t === E.Standard && this.path.discardPathObject(),
  21998. this.emit(w.WarpEnded, i),
  21999. this.cameraControls.activeControl && (this.cameraControls.activeControl.enabled = !0),
  22000. o && o()
  22001. }
  22002. .bind(this)),
  22003. e === b.Hide && this.path.discardPathObject(),
  22004. !0
  22005. }
  22006. ,
  22007. n.prototype.warpToPanoById = function(e, t, i, n, r, o, a, s) {
  22008. return this.path.setWarpDestinationByPanoId(e, t) ? this.startWarp(i, n, r, o, a, s) : (F.warn("Player.warpToPanoById() -> Could not setWarpDestinationByPanoId()"),
  22009. s && s(),
  22010. !1)
  22011. }
  22012. ,
  22013. n.prototype.warpToPanoByHeroIndex = function(e, t, i, n, r, o, a) {
  22014. return this.path.setWarpDestinationByHeroIndex(e) ? this.startWarp(t, i, n, r, o, a) : (F.warn("Player.warpToPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22015. a && a(),
  22016. !1)
  22017. }
  22018. ,
  22019. n.prototype.warpToPano = function(e, t, i, n, r, o, a, s) {
  22020. return this.warpToPanoById(e.id, t, i, n, r, o, a, s)
  22021. }
  22022. ,
  22023. n.prototype.warpToNonPanoByHeroIndex = function(e, t) {
  22024. return this.path.setWarpDestinationByHeroIndex(e) ? (this.path.warpToNonPano(t),
  22025. !0) : (F.warn("Player.warpToNonPanoByHeroIndex() -> Could not setWarpDestinationByHeroIndex()"),
  22026. t && t(),
  22027. !1)
  22028. }
  22029. ,
  22030. n.prototype.aimTourCamera = function(e, t, i, n) {
  22031. return F.debug("player.aimTourCamera(" + e + ") calling warpToPanoByHeroIndex(" + e + ")"),
  22032. this.warpToPanoByHeroIndex(e, t, i, null, null, null, n)
  22033. }
  22034. ,
  22035. n.prototype.showPathToHeroLocation = function(e) {
  22036. this.path.setWarpDestinationByHeroIndex(e) && this.path.brushToWarpPano(x.STD, x.BLACK)
  22037. }
  22038. ,
  22039. n.prototype.tourInterlude = function(e, t) {
  22040. this.history.invalidate();
  22041. this.path.discardSlow();
  22042. //xzw:
  22043. var a = g_data2.tourAudio && g_data2.tourAudio[this.model.heroLocations[this.director.currentItem].sid];
  22044. var rotTime = a && a.time;
  22045. this.path.waitNextStep(e, function() {
  22046. t && t()
  22047. }.bind(this), rotTime)
  22048. }
  22049. ,
  22050. n.prototype.stopInterlude = function() {
  22051. this.interruptAndFastForward(null, 0)
  22052. }
  22053. ,
  22054. n.prototype.interruptAndFastForward = function(e, t) {
  22055. this.isWarping() && this.emit(w.WarpInterrupted, this.path.activeTransType, e, t),
  22056. this.flying && this.emit(w.FlyingInterrupted),
  22057. this.path.interruptAndFastForward(e, t)
  22058. }
  22059. ,
  22060. n.prototype.setSize = function(e, t) {
  22061. var i = e / t;
  22062. this.baseFov = B.clampVFOV(f.insideFOV, f.insideFOVMax, e, t);
  22063. var n = B.getHFOVFromVFOV(f.insideFOV, e, t);
  22064. n > f.insideFOVMax ? this.baseFov = B.getVFOVFromHFOV(f.insideFOVMax, e, t) : this.baseFov = f.insideFOV;
  22065. for (var r in this.cameraControls.cameras) {
  22066. var o = this.cameraControls.cameras[r];
  22067. o.fov = this.baseFov * (1 / this.zoomLevel),
  22068. o.updateAspect(i)
  22069. }
  22070. }
  22071. ,
  22072. n.prototype.toJSON = function() {
  22073. var e = {};
  22074. return this.cameraControls.activeControl ? (e = this.cameraControls.activeControl.toJSON(),
  22075. e.camera_mode = u.toInt(this.mode),
  22076. this.isOutsideMode() ? this.model.allFloorsVisible ? e.floor_visibility = [] : e.floor_visibility = this.model.floors.list.map(function(e) {
  22077. return e.hidden ? 0 : 1
  22078. }) : u.PANORAMA && (e.scan_id = this.currentPano.id),
  22079. e) : e
  22080. }
  22081. ,
  22082. n.prototype.getCurrentNodePanos = function(e) {
  22083. this.model.panos.map;
  22084. if (e.length = 0,
  22085. this.path.nodes)
  22086. for (var t = 0; t < this.path.nodes.length; t++) {
  22087. var i = this.path.nodes[t];
  22088. e.push(this.model.panos.get(i))
  22089. }
  22090. }
  22091. ,
  22092. n.prototype.zoomIncrementally = function(e) {
  22093. var t = this.zoomLevel;
  22094. this.zoomTo(this.zoomLevel + e),
  22095. t !== this.zoomLevel && this.currentPano && this.zoomStats.addZoomAction(t, this.zoomLevel, this.currentPano.id)
  22096. }
  22097. ,
  22098. n.prototype.zoomInIncrementally = function(e) {
  22099. e = e || this.defaultZoomIncrement,
  22100. this.zoomIncrementally(e)
  22101. }
  22102. ,
  22103. n.prototype.zoomOutIncrementally = function(e) {
  22104. e = e || -this.defaultZoomIncrement,
  22105. this.zoomIncrementally(e)
  22106. }
  22107. ,
  22108. n.prototype.zoomBy = function(e) {
  22109. this.zoomTo(this.zoomLevel * e)
  22110. }
  22111. ,
  22112. n.prototype.zoomIn = function() {
  22113. this.zoomBy(1 + this.zoomSpeed)
  22114. }
  22115. ,
  22116. n.prototype.zoomOut = function() {
  22117. this.zoomBy(1 - this.zoomSpeed)
  22118. }
  22119. ,
  22120. n.prototype.zoomTo = function(e, t) {
  22121. if (t || f.zoom.enabled && this.mode === u.PANORAMA && this.zoomEnabled) {
  22122. if (e < f.zoom.min && (e = f.zoom.min),
  22123. e > f.zoom.max && (e = f.zoom.max),
  22124. e > this.zoomLevel ? (this.emit(O.ZoomIn),
  22125. e === f.zoom.max && this.emit(O.ZoomMax)) : e < this.zoomLevel && (this.emit(O.ZoomOut),
  22126. e === f.zoom.min && this.emit(O.ZoomMin)),
  22127. this.cameraControls.activeControl) {
  22128. var i = this.cameraControls.activeControl.camera;
  22129. this.zoomLevel = e,
  22130. i.fov = this.baseFov * (1 / this.zoomLevel),
  22131. i.updateProjectionMatrix(),
  22132. this.zoomFov = i.fov
  22133. }
  22134. }
  22135. }
  22136. ,
  22137. n.prototype.increaseZoomSpeed = function() {
  22138. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed + this.zoomSpeedAdjust)
  22139. }
  22140. ,
  22141. n.prototype.decreaseZoomSpeed = function() {
  22142. this.zoomSpeed = this.clampZoomSpeed(this.zoomSpeed - this.zoomSpeedAdjust)
  22143. }
  22144. ,
  22145. n.prototype.clampZoomSpeed = function(e) {
  22146. return e < 0 ? 0 : e
  22147. }
  22148. ,
  22149. n.prototype.activatePersistentZooming = function(e) {
  22150. this.zooming = e ? 1 : -1
  22151. }
  22152. ,
  22153. n.prototype.deactivatePersistentZooming = function() {
  22154. this.zooming = 0
  22155. }
  22156. ,
  22157. n.prototype.zoomDefault = function() {
  22158. this.zoomTo(1, !0)
  22159. }
  22160. ,
  22161. n.prototype.smoothZoomToDefault = function(e, t) {
  22162. var i, n = this.zoomLevel, r = function(e) {
  22163. e > 1 && (e = 1),
  22164. i = n * (1 - e) + e,
  22165. this.zoomTo(i, !0)
  22166. }
  22167. .bind(this), o = function() {
  22168. this.zoomDefault(),
  22169. t && window.setTimeout(t, 50)
  22170. }
  22171. .bind(this);
  22172. y.start(r, e, o, null, 0, A[f.transition.blendEasing])
  22173. }
  22174. ,
  22175. n.prototype.updateZoomPano = function() {
  22176. if (!this.panoRenderer.zoomPanoRenderingDisabled && this.mode === u.PANORAMA) {
  22177. var e = this.currentPano;
  22178. if (e) {
  22179. var t = this.zoomLevel > f.zoom.activationThreshold
  22180. , i = this.flying && this.nextPano && this.nextPano !== this.currentPano
  22181. , n = !i && !this.isWarping()
  22182. , r = t && n;
  22183. this.tileDownloader.tilePrioritizer.setZoomingActive(r),
  22184. this.panoRenderer.setZoomingActive(r, e, !0);
  22185. var o = function(e, t) {
  22186. this.panoRenderer.resetRenderStatus(e.id, !1, !0, this.qualityManager.getMaxNavPanoSize()),
  22187. this.panoRenderer.clearAllQueuedUploadsForPano(e.id),
  22188. this.panoRenderer.renderPanoTiles(e.id, null, !1, !1),
  22189. e.setZoomed(t)
  22190. }
  22191. .bind(this);
  22192. r && !e.zoomed ? (o(e, !0),
  22193. this.panoRenderer.enableUltraHighQualityMode(function() {
  22194. this.qualityManager.useUltraHighResolutionPanos && !f.zoom.overridemax && (f.zoom.max = D.ultraHighQualityMaxZoom),
  22195. r && o(e, !0)
  22196. }
  22197. .bind(this))) : !t && e.zoomed && o(e, !1)
  22198. }
  22199. }
  22200. }
  22201. ,
  22202. t.exports = n
  22203. }
  22204. ).call(this, "/js/player.js")
  22205. }
  22206. , {
  22207. "./constants": 8,
  22208. "./enum/AlignmentType": 17,
  22209. "./enum/BlackoutStyle": 18,
  22210. "./enum/ControlEvents": 21,
  22211. "./enum/Keys": 30,
  22212. "./enum/ModelManagerEvents": 33,
  22213. "./enum/PanoSizeClass": 36,
  22214. "./enum/PanoramaEvents": 37,
  22215. "./enum/PathDiscardMode": 38,
  22216. "./enum/PathDisplayMode": 39,
  22217. "./enum/PlayerEvents": 40,
  22218. "./enum/TagStates": 44,
  22219. "./enum/Vectors": 50,
  22220. "./enum/Viewmode": 51,
  22221. "./enum/WarpStyle": 52,
  22222. "./enum/ZoomEvents": 53,
  22223. "./exception/BasicException": 55,
  22224. "./model/ModelManager": 140,
  22225. "./objects/NSpider": 147,
  22226. "./objects/Panorama": 148,
  22227. "./objects/Reticule": 149,
  22228. "./objects/ShowPath": 151,
  22229. "./objects/Snapshot": 153,
  22230. "./objects/View": 154,
  22231. "./settings": 166,
  22232. "./shaders": 167,
  22233. "./tile/TileDownloader": 171,
  22234. "./tile/TilePrioritizer": 172,
  22235. "./util/ZoomStats": 179,
  22236. "./util/browser": 182,
  22237. "./util/camera": 183,
  22238. "./util/cameraLight": 184,
  22239. "./util/common": 185,
  22240. "./util/easing": 186,
  22241. "./util/history": 187,
  22242. "./util/lerp": 188,
  22243. "./util/logger": 189,
  22244. "./util/math": 190,
  22245. "./util/transitions": 195,
  22246. "hot":"hot",
  22247. "scaleImg":"scaleImg",
  22248. events: 202,
  22249. three: 217
  22250. }],
  22251. "scaleImg":[function(t, e){// xzw
  22252. var OUTPUT = e;
  22253. (function(){function t(t,a,i,r){function h(){B="object"==typeof i?i:a.src||r?u:document.createElement("canvas"),B.width=s,B.height=f,G=B.getContext("2d")}
  22254. function n(t){if(t){var e,a=G.getImageData(0,0,s,f),i=a.data;for(e=0;at>e;e+=4)
  22255. i[e]=t[e]*it|0,i[e+1]=t[e+1]*it|0,i[e+2]=t[e+2]*it|0,i[e+3]=t[e+3]*it|0;return delete t,a}
  22256. return G.getImageData(0,0,s,f)}
  22257. function o(t,e,a,i,r){return.5*(i-e+(2*e-5*a+4*i-r+(3*(a-i)+r-e)*t)*t)*t+a}
  22258. a||(a=t.input,i=t.output,r=t.inputRemovable,t.scale&&(t=t.scale));var u,d;if(a.src)
  22259. if(u=document.createElement("canvas"),null!=a.naturalWidth)
  22260. u.width=a.naturalWidth,u.height=a.naturalHeight;else if(null!=a.runtimeStyle){var l=a.runtimeStyle,c=l.width,g=l.height;l.width="auto",l.height="auto",u.width=a.width,u.height=a.height,l.width=c,l.height=g}else{var c=a.width,g=a.height;a.removeAttribute&&(a.removeAttribute("width"),a.removeAttribute("height")),u.width=a.width,u.height=a.height,a.width=c,a.height=g}
  22261. else
  22262. u=a;d=u.getContext("2d"),a.src&&d.drawImage(a,0,0);var s,f,m=u.width,w=u.height,p=d.getImageData(0,0,m,w).data;if(!m||!w)
  22263. return!1;(a.src||r)&&u.clearRect(0,0,m,w),"object"==typeof t?t.width?(s=t.width+.5|0,f=t.height+.5|0):(s=m*t.scaleX+.5|0,f=w*t.scaleY+.5|0):(s=t*m+.5|0,f=t*w+.5|0);var v,b,y,x,D,I,A,j,R,k,C,E,F,L,S,U,W,H,alpha,X,Y,q,z,B,G,J,K,M,N,O,P,Q,T,V,Z,$=s<<2,_=m<<2,tt=0,et=0,at=$*f,it=255.99/255,rt=s/m,ht=f/w,nt=rt*ht;if(rt>1||ht>1)
  22264. for(h(),J=n(),K=J.data,x=0;f>x;x++)
  22265. 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)
  22266. v=y/rt,j=0|v,z=v-j,T=j<<2,Q=1>j?T:T-4,m-2>j?(V=T+4,Z=T+8):V=Z=j>m-2?T:T+4,H=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,X=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,Y=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,++Q,++T,++V,++Z,alpha=o(q,o(z,p[M+Q],p[M+T],p[M+V],p[M+Z]),o(z,p[N+Q],p[N+T],p[N+V],p[N+Z]),o(z,p[O+Q],p[O+T],p[O+V],p[O+Z]),o(z,p[P+Q],p[P+T],p[P+V],p[P+Z]))*it|0,K[et]=H>=0?256>H?H:255:0,K[et+1]=X>=0?256>X?X:255:0,K[et+2]=Y>=0?256>Y?Y:255:0,K[et+3]=alpha>=0?256>alpha?alpha:255:0;else{if(e.Float32Array)
  22267. W=new Float32Array(at);else
  22268. for(W=[],et=0;at>et;++et)
  22269. W[et]=0;for(b=0;w>b;b++)
  22270. 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)
  22271. switch(y=v*rt,I=0|y,et=D+(I<<2),S=!!((I-(y+rt|0))*(m-1-v)),S&&(C=I+1-y,E=y+rt-I-1),H=p[tt],X=p[tt+1],Y=p[tt+2],alpha=p[tt+3],S+U){case 0:W[et]+=H*nt,W[et+1]+=X*nt,W[et+2]+=Y*nt,W[et+3]+=alpha*nt;break;case 1:k=C*ht,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*ht,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;break;case 2:k=rt*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=rt*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k;break;default:k=C*F,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*F,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k,k=C*L,et+=$,W[et]+=H*k,W[et+1]+=X*k,W[et+2]+=Y*k,W[et+3]+=alpha*k,k=E*L,W[et+4]+=H*k,W[et+5]+=X*k,W[et+6]+=Y*k,W[et+7]+=alpha*k;}
  22272. delete p,h(),J=n(W)}
  22273. if(G.putImageData(J,0,0),"string"==typeof i){if("png"===i||"jpeg"===i){var ot;return ot=r&&a.src?a:new Image,ot.width=s,ot.height=f,ot.src=B.toDataURL("image/"+i,0.85),ot}
  22274. if("png-src"===i||"jpeg-src"===i)
  22275. return B.toDataURL("image/"+i.split("-")[0],0.85)}
  22276. return B}
  22277. var e=this;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.scale=t):c=t}).call(this);
  22278. OUTPUT.exports = c;
  22279. }, {}
  22280. ],
  22281. 156: [function(e, t, i) {
  22282. (function(i) {
  22283. "use strict";
  22284. function n(e, t) {
  22285. this.model = e,
  22286. this.panos = e.panos,
  22287. this.player = t,
  22288. this.imagePanos = this.listImagePanos(),
  22289. this.retryMinimumTime = 1e4
  22290. }
  22291. var r = (e("three"),
  22292. e("./enum/Viewmode"))
  22293. , o = (e("./settings"),
  22294. e("./objects/Panorama"))
  22295. , a = e("./util/logger")
  22296. , s = new a(i);
  22297. n.prototype.start = function() {
  22298. this.loadNextPano(function(e) {
  22299. e ? this.start() : (s.debug("No suitable pano loaded, waiting a little while before looking again"),
  22300. setTimeout(function() {
  22301. this.start()
  22302. }
  22303. .bind(this), 1e3))
  22304. }
  22305. .bind(this))
  22306. }
  22307. ,
  22308. n.prototype.validLoadTarget = function(e) {
  22309. return e && !e.isLoaded("high") && Date.now() - e.failedLoadingAt > this.retryMinimumTime
  22310. }
  22311. ,
  22312. n.prototype.listImagePanos = function() {
  22313. var e = []
  22314. , t = this;
  22315. return this.model.images.forEach(function(i) {
  22316. if (i.metadata && i.metadata.scan_id) {
  22317. var n = t.model.panos.get(i.metadata.scan_id);
  22318. n && !n.isLoaded("high") && e.push(n)
  22319. }
  22320. }),
  22321. e
  22322. }
  22323. ,
  22324. n.prototype.nextNotLoadedImage = function() {
  22325. for (; this.imagePanos.length > 0; ) {
  22326. var e = this.imagePanos[0];
  22327. if (!e.isLoaded("high"))
  22328. return e;
  22329. this.imagePanos.shift()
  22330. }
  22331. return null
  22332. }
  22333. ,
  22334. n.prototype.loadNextPano = function(e) {
  22335. var t, i, n = this.model.waitQueue.filter(function(e) {
  22336. return e.object instanceof o
  22337. });
  22338. n.length > 0 ? (t = n[0].object,
  22339. s.debug("Overrode pano selection: Flying to an unloaded pano " + t.id)) : this.validLoadTarget(this.player.currentPano) ? (t = this.player.currentPano,
  22340. s.debug("Overrode pano selection: Currently at an unloaded pano " + t.id)) : this.validLoadTarget(this.player.closestPano) ? (t = this.player.closestPano,
  22341. s.debug("Overrode pano selection: Hovering over an unloaded pano " + t.id)) : this.validLoadTarget(this.nextNotLoadedImage()) ? (i = "high",
  22342. t = this.imagePanos[0],
  22343. s.debug("Overrode pano selection: Highlight image " + t.id)) : this.player.mode === r.PANORAMA && (t = this.panos.lowestByScore([this.validLoadTarget.bind(this), o.filters.isNeighbourPanoTo(this.player.currentPano)], [o.scoreFunctions.distance(this.player.currentPano), o.scoreFunctions.direction(this.player.position, this.player.getDirection()), o.scoreFunctions.inFieldOfView(this.player.position, this.player.getDirection())]),
  22344. t && s.debug("Normal pano selection: neighbor " + t.id)),
  22345. t ? (i = i || t.isLoaded("low") ? "high" : "low",
  22346. s.debug("Preloading " + i + "-res pano " + t.id),
  22347. t.loadCube(i).done(e).fail(function() {
  22348. s.warn("Failed preloading pano", t.id, ", marking it as failed and forgetting it for a while"),
  22349. e()
  22350. })) : e && e(null)
  22351. }
  22352. ,
  22353. t.exports = n
  22354. }
  22355. ).call(this, "/js/preloaders.js")
  22356. }
  22357. , {
  22358. "./enum/Viewmode": 51,
  22359. "./objects/Panorama": 148,
  22360. "./settings": 166,
  22361. "./util/logger": 189,
  22362. three: 217
  22363. }],
  22364. 157: [function(e, t, i) {
  22365. (function(i) {
  22366. "use strict";
  22367. function n(e, t, i, n, r) {
  22368. this.qualityManager = e,
  22369. this.scene = t,
  22370. this.camera = i,
  22371. this.container = r,
  22372. this.controls = n,
  22373. this.controls.enabled = !0,
  22374. this.controls.locked = !0,
  22375. this.quickstartCamera = n.camera,
  22376. this.quickstartCamera.fov = h.clampVFOV(a.insideFOV, a.insideFOVMax, $("#player").width(), $("#player").height()),
  22377. this.skybox = null
  22378. }
  22379. var r = e("three")
  22380. , o = e("../util/logger")
  22381. , a = e("../constants")
  22382. , s = (e("../util/transitions"),
  22383. e("../util/lerp"),
  22384. e("../util/easing"),
  22385. e("../enum/Vectors"))
  22386. , l = e("../enum/PanoSizeClass")
  22387. , c = (e("../materials/ModelTextureMaterial"),
  22388. e("../materials/CubemapMaterial"))
  22389. , h = (e("../cameras/PanoramaCamera"),
  22390. e("../controls/PanoramaControls"),
  22391. e("../tile/TileUtils"),
  22392. e("../util/camera"),
  22393. e("../util/cameraLight"))
  22394. , u = (e("../util/browser"),
  22395. e("../settings"),
  22396. e("../gui/helpManager"),
  22397. new o(i));
  22398. n.prototype.load = function(e) {
  22399. e.pano.shouldRedrawOnBaseLoaded = !0;
  22400. var t, i, n = this, r = s.FORWARD.clone().applyQuaternion(e.quaternion), o = r.clone().negate();
  22401. this.controls.lookAt(r.add(this.quickstartCamera.position));
  22402. var a = this.qualityManager.getPanoSize(l.BASE)
  22403. , c = this.qualityManager.getPanoSize(l.STANDARD);
  22404. if (e.pano.tiled) {
  22405. u.warn("Loading startPano, TILED", e.pano.id);
  22406. var d = h.getHFOVForCamera(this.quickstartCamera, $("#player").width(), $("#player").height())
  22407. , p = this.quickstartCamera.fov;
  22408. u.warn("Quickstart loading tiles in frustum: [horizontal FOV: " + d + ", vertical FOV: " + p + "]"),
  22409. t = e.pano.loadTiledPano(c, r, {
  22410. hFov: d,
  22411. vFov: p
  22412. }, !1, !1, !0),
  22413. i = e.pano.loadTiledPano(a, o, null, !1, !1, !0)
  22414. } else
  22415. u.warn("Loading startPano", e.pano.id),
  22416. t = e.pano.loadCube("high");
  22417. return $.when(t).then(function() {
  22418. n.init(e.pano, e.quaternion),
  22419. e.pano.tiled ? i.done(function() {
  22420. e.pano.lockUntilRenderingComplete = !1,
  22421. this.controls.locked = !1
  22422. }
  22423. .bind(this)) : this.controls.locked = !1
  22424. }
  22425. .bind(this))
  22426. }
  22427. ,
  22428. n.prototype.init = function(e, t) {
  22429. u.info("Quickstart done loading, adding scene objects"),
  22430. e.lockUntilRenderingComplete = !0,
  22431. this.skybox = new r.Mesh(new r.CubeGeometry(1,1,1),new c({
  22432. side: r.BackSide
  22433. })),
  22434. this.skybox.material.uniforms.map.value = e.getSkyboxTexture(),
  22435. this.skybox.quaternion.copy(e.quaternion),
  22436. this.scene.add(this.skybox),
  22437. $(this.container).show()
  22438. }
  22439. ,
  22440. n.prototype.update = function(e) {
  22441. this.controls.update(e),
  22442. this.camera.copy(this.quickstartCamera)
  22443. }
  22444. ,
  22445. n.prototype.setSize = function(e, t) {
  22446. this.quickstartCamera.updateAspect(e / t)
  22447. }
  22448. ,
  22449. n.prototype.destroy = function() {
  22450. this.scene.remove(this.skybox)
  22451. }
  22452. ,
  22453. t.exports = n
  22454. }
  22455. ).call(this, "/js/scene/QuickstartManager.js")
  22456. }
  22457. , {
  22458. "../cameras/PanoramaCamera": 7,
  22459. "../constants": 8,
  22460. "../controls/PanoramaControls": 13,
  22461. "../enum/PanoSizeClass": 36,
  22462. "../enum/Vectors": 50,
  22463. "../gui/helpManager": 68,
  22464. "../materials/CubemapMaterial": 117,
  22465. "../materials/ModelTextureMaterial": 118,
  22466. "../settings": 166,
  22467. "../tile/TileUtils": 174,
  22468. "../util/browser": 182,
  22469. "../util/camera": 183,
  22470. "../util/cameraLight": 184,
  22471. "../util/easing": 186,
  22472. "../util/lerp": 188,
  22473. "../util/logger": 189,
  22474. "../util/transitions": 195,
  22475. three: 217
  22476. }],
  22477. 158: [function(e, t, i) {
  22478. "use strict";
  22479. function n(e, t, i) {
  22480. this.scene = e,
  22481. this.camera = t,
  22482. this.renderer = null,
  22483. this.effects = i,
  22484. this.animateCallback = null,
  22485. this.composer = null,
  22486. this.qualityManager = null,
  22487. e.renderWidth = 0,
  22488. e.renderHeight = 0,
  22489. this.updateClock = new r.Clock,
  22490. this.components = [],
  22491. this.updateListeners = [],
  22492. this.resizeListeners = [],
  22493. this.forceUpdateSize = !1,
  22494. this.started = !1,
  22495. this.textures = {},
  22496. this.suspendedObjects = []
  22497. }
  22498. var r = e("three")
  22499. , o = e("../shaders")
  22500. , a = e("../enum/SceneRendererEvents")
  22501. , s = e("../enum/GLTextureType")
  22502. , l = e("../enum/GLCubeFaces")
  22503. , c = e("../exception/BasicException")
  22504. , h = e("../exception/RendererCreationException")
  22505. , u = e("../settings")
  22506. , d = e("events").EventEmitter;
  22507. window.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame,
  22508. n.prototype = Object.create(d.prototype),
  22509. n.prototype.addComponent = function(e) {
  22510. this.components.push(e),
  22511. e.update && this.updateListeners.push(e),
  22512. e.setSize && (this.resizeListeners.push(e),
  22513. this.forceUpdateSize = !0)
  22514. }
  22515. ,
  22516. n.prototype.removeComponent = function(e) {
  22517. var t = function(t) {
  22518. return t !== e
  22519. };
  22520. this.components = this.components.filter(t),
  22521. this.updateListeners = this.updateListeners.filter(t),
  22522. this.resizeListeners = this.resizeListeners.filter(t)
  22523. }
  22524. ,
  22525. n.prototype.start = function(e) {
  22526. if (this.started)
  22527. throw new c("Can't start SceneRenderer, already started");
  22528. this.createContext(e),
  22529. this.initComposer(),
  22530. this.started = !0,
  22531. (p = p.bind(this))()
  22532. }
  22533. ,
  22534. n.prototype.createContext = function(e) {
  22535. try {
  22536. this.renderer = new r.WebGLRenderer,
  22537. this.renderer.autoClear = !0,
  22538. this.renderer.setPixelRatio(window.devicePixelRatio ? window.devicePixelRatio : 1),
  22539. this.renderer.setSize($("#player").width(), $("#player").height(), false), //改
  22540. this.emit(a.ContextCreated)
  22541. } catch (e) {
  22542. throw new h("Unable to create a WebGL rendering context")
  22543. }
  22544. u.profiling.enabled && this.overrideTextures(),
  22545. e.appendChild(this.renderer.domElement)
  22546. }
  22547. ,
  22548. n.prototype.overrideTextures = function() {
  22549. var e = this.renderer.context
  22550. , t = 0
  22551. , i = e.createTexture;
  22552. e.createTexture = function() {
  22553. var n = i.call(e);
  22554. return n.id = t++,
  22555. this.textures[n.id] = n,
  22556. n
  22557. }
  22558. .bind(this);
  22559. var n = e.texImage2D;
  22560. e.texImage2D = function(t, i, r, o, a, l, c, h, u) {
  22561. var d, p = this.getTextureTypeFromTarget(e, t);
  22562. d = p === s.TextureCube ? e.getParameter(e.TEXTURE_BINDING_CUBE_MAP) : e.getParameter(e.TEXTURE_BINDING_2D),
  22563. void 0 !== c ? n.call(e, t, i, r, o, a, l, c, h, u) : (c = o,
  22564. h = a,
  22565. u = l,
  22566. o = u.naturalWidth,
  22567. a = u.naturalHeight,
  22568. n.call(e, t, i, r, c, h, u));
  22569. var f = this.textures[d.id];
  22570. f.width = p === s.TextureCube ? 6 * o : o,
  22571. f.height = a
  22572. }
  22573. .bind(this);
  22574. var r = e.deleteTexture;
  22575. e.deleteTexture = function(t) {
  22576. delete this.textures[t.id],
  22577. r.call(e, t)
  22578. }
  22579. .bind(this)
  22580. }
  22581. ,
  22582. n.prototype.updateTextureMemory = function() {
  22583. var e = null;
  22584. return function() {
  22585. var t = 0;
  22586. for (var i in this.textures) {
  22587. var n = this.textures[i];
  22588. n.width && n.height && (t += n.width * n.height * 4)
  22589. }
  22590. t !== e && this.emit(a.MemoryUsageUpdated, t),
  22591. e = t
  22592. }
  22593. }(),
  22594. n.prototype.getTextureTypeFromTarget = function(e, t) {
  22595. switch (t) {
  22596. case e.TEXTURE_CUBE_MAP_POSITIVE_X:
  22597. case e.TEXTURE_CUBE_MAP_NEGATIVE_X:
  22598. case e.TEXTURE_CUBE_MAP_POSITIVE_Y:
  22599. case e.TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22600. case e.TEXTURE_CUBE_MAP_POSITIVE_Z:
  22601. case e.TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22602. return s.TextureCube;
  22603. case e.TEXTURE_2D:
  22604. return s.Texture2D;
  22605. default:
  22606. return null
  22607. }
  22608. }
  22609. ,
  22610. n.prototype.initComposer = function() {
  22611. this.composer = new r.EffectComposer(this.renderer),
  22612. this.composer.addPass(new r.RenderPass(this.scene,this.camera)),
  22613. this.composer.addPass(this.effects.hblurPass),
  22614. this.composer.addPass(this.effects.vblurPass)
  22615. }
  22616. ,
  22617. n.prototype.setSize = function(e, t, devicePixelRatio) {
  22618. this.renderWidth = e,
  22619. this.renderHeight = t,
  22620. this.effects.aspect = e / t,
  22621. /* this.renderer.setSize(e, t), -----MP */
  22622. this.renderer.setSize(e, t, false, devicePixelRatio), //改 为了防止给canvas设置宽高
  22623. this.composer.setSize(e, t);
  22624. for (var i = 0; i < this.resizeListeners.length; i++)
  22625. this.resizeListeners[i].setSize(e, t)
  22626. }
  22627. ,
  22628. n.prototype.render = function() {
  22629. this.effects.currentBlur > 0 ? this.composer.render() : this.renderer.render(this.scene, this.camera)
  22630. }
  22631. ,
  22632. n.prototype.updateComponents = function() {
  22633. for (var e = Math.min(1, this.updateClock.getDelta()), t = 0; t < this.updateListeners.length; t++)
  22634. this.updateListeners[t].update(e)
  22635. }
  22636. ,
  22637. n.prototype.suspend = function() {
  22638. this.started = !1,
  22639. this.suspendedObjects = this.scene.children.map(function(e) {
  22640. return this.scene.remove(e),
  22641. e
  22642. }
  22643. .bind(this)),
  22644. this.render()
  22645. }
  22646. ,
  22647. n.prototype.resume = function() {
  22648. this.suspendedObjects.forEach(function(e) {
  22649. this.scene.add(e)
  22650. }
  22651. .bind(this)),
  22652. this.suspendedObjects = [],
  22653. this.started = !0,
  22654. p()
  22655. }
  22656. ;
  22657. var p = function() {
  22658. this.started && (window.requestAnimationFrame(p),
  22659. this.updateComponents(),
  22660. this.updateTextureMemory(),
  22661. this.render(),
  22662. this.emit(a.AfterRender))
  22663. };
  22664. n.prototype.getImageData = function() {
  22665. var e = document.createElement("canvas")
  22666. , t = e.getContext("2d");
  22667. return function(i, n, r) {
  22668. return e.width === n && e.height === r || (e.width = n,
  22669. e.height = r),
  22670. t.drawImage(i, 0, 0, n, r),
  22671. t.getImageData(0, 0, n, r)
  22672. }
  22673. }(),
  22674. n.prototype.initSizedTexture2D = function(e, t, i) {
  22675. var n = this.renderer
  22676. , o = n.context
  22677. , a = n.state
  22678. , s = new r.Texture(null);
  22679. s.flipY = !1,
  22680. i !== !0 && (i = !1),
  22681. s.generateMipmaps = i;
  22682. var l = n.paramThreeToGL(s.format)
  22683. , c = n.paramThreeToGL(s.type)
  22684. , h = n.properties.get(s)
  22685. , u = o.createTexture();
  22686. a.bindTexture(o.TEXTURE_2D, u),
  22687. o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL, s.flipY),
  22688. o.texImage2D(o.TEXTURE_2D, 0, l, e, e, 0, l, c, null),
  22689. s.wrapS = t,
  22690. s.wrapT = t;
  22691. var d = n.paramThreeToGL(t);
  22692. return o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_S, d),
  22693. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_WRAP_T, d),
  22694. i ? (s.magFilter = r.LinearFilter,
  22695. s.minFilter = r.LinearMipMapLinearFilter,
  22696. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22697. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR_MIPMAP_NEAREST),
  22698. o.generateMipmap(o.TEXTURE_2D)) : (s.magFilter = r.LinearFilter,
  22699. s.minFilter = r.LinearFilter,
  22700. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MAG_FILTER, o.LINEAR),
  22701. o.texParameteri(o.TEXTURE_2D, o.TEXTURE_MIN_FILTER, o.LINEAR)),
  22702. a.bindTexture(o.TEXTURE_2D, null),
  22703. h.__webglTexture = u,
  22704. s
  22705. }
  22706. ,
  22707. n.prototype.initSizedCubeMap = function(e, t) {
  22708. var i = this.renderer
  22709. , n = i.context
  22710. , o = i.state
  22711. , a = new r.CubeTexture([null, null, null, null, null, null]);
  22712. a.flipY = !1,
  22713. a.generateMipmaps = t;
  22714. var s = i.paramThreeToGL(a.format)
  22715. , l = i.paramThreeToGL(a.type)
  22716. , c = i.properties.get(a)
  22717. , h = n.createTexture();
  22718. o.bindTexture(n.TEXTURE_CUBE_MAP, h),
  22719. n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL, a.flipY);
  22720. for (var u = 0; u < 6; u++)
  22721. n.texImage2D(n.TEXTURE_CUBE_MAP_POSITIVE_X + u, 0, s, e, e, 0, s, l, null);
  22722. return t ? (a.magFilter = r.LinearFilter,
  22723. a.minFilter = r.LinearMipMapLinearFilter,
  22724. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22725. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR_MIPMAP_LINEAR),
  22726. n.texParameteri(n.TEXTURE_CUBE_MAP, n.GENERATE_MIPMAP, n.TRUE),
  22727. n.generateMipmap(n.TEXTURE_CUBE_MAP)) : (a.magFilter = r.LinearFilter,
  22728. a.minFilter = r.LinearFilter,
  22729. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MAG_FILTER, n.LINEAR),
  22730. n.texParameteri(n.TEXTURE_CUBE_MAP, n.TEXTURE_MIN_FILTER, n.LINEAR)),
  22731. o.bindTexture(n.TEXTURE_CUBE_MAP, null),
  22732. c.__image__webglTextureCube = h,
  22733. a
  22734. }
  22735. ,
  22736. n.prototype.deallocateCubeTexture = function(e) {
  22737. var t = this.renderer
  22738. , i = t.context
  22739. , n = t.properties.get(e);
  22740. i.deleteTexture(n.__image__webglTextureCube)
  22741. }
  22742. ,
  22743. n.prototype.uploadTexture2D = function(e, t, i, n, r, o) {
  22744. var a = this.renderer
  22745. , s = a.context
  22746. , l = a.state
  22747. , c = a.properties.get(t);
  22748. l.bindTexture(s.TEXTURE_2D, c.__webglTexture),
  22749. s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22750. s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  22751. s.pixelStorei(s.UNPACK_ALIGNMENT, t.unpackAlignment),
  22752. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_S, a.paramThreeToGL(t.wrapS)),
  22753. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_WRAP_T, a.paramThreeToGL(t.wrapT)),
  22754. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MAG_FILTER, a.paramThreeToGL(t.magFilter)),
  22755. s.texParameteri(s.TEXTURE_2D, s.TEXTURE_MIN_FILTER, a.paramThreeToGL(t.minFilter)),
  22756. s.texSubImage2D(s.TEXTURE_2D, 0, i, n, s.RGBA, s.UNSIGNED_BYTE, e),
  22757. t.generateMipmaps && s.generateMipmap(s.TEXTURE_2D),
  22758. l.bindTexture(s.TEXTURE_2D, null)
  22759. }
  22760. ,
  22761. n.prototype.uploadTexture3D = function(e, t, i, n, r, o, a) {
  22762. var s = this.renderer
  22763. , l = s.context
  22764. , c = s.state
  22765. , h = s.properties.get(t);
  22766. c.bindTexture(l.TEXTURE_CUBE_MAP, h.__image__webglTextureCube),
  22767. l.pixelStorei(l.UNPACK_FLIP_Y_WEBGL, t.flipY),
  22768. l.texSubImage2D(r, 0, i, n, l.RGBA, l.UNSIGNED_BYTE, e),
  22769. t.generateMipmaps && l.generateMipmap(l.TEXTURE_CUBE_MAP),
  22770. c.bindTexture(l.TEXTURE_CUBE_MAP, null)
  22771. }
  22772. ,
  22773. n.prototype.rebuildMipMaps2D = function(e) {
  22774. var t = this.renderer
  22775. , i = t.context
  22776. , n = t.state;
  22777. t.properties.get(e);
  22778. i.generateMipmap(i.TEXTURE_2D),
  22779. n.bindTexture(i.TEXTURE_2D, null)
  22780. }
  22781. ,
  22782. n.prototype.rebuildMipMaps3D = function(e) {
  22783. var t = this.renderer
  22784. , i = t.context
  22785. , n = t.state
  22786. , r = t.properties.get(e);
  22787. n.bindTexture(i.TEXTURE_CUBE_MAP, r.__image__webglTextureCube),
  22788. i.generateMipmap(i.TEXTURE_CUBE_MAP),
  22789. n.bindTexture(i.TEXTURE_CUBE_MAP, null)
  22790. }
  22791. ,
  22792. n.prototype.renderToCubeMap = function() {
  22793. var e = !1
  22794. , t = null
  22795. , i = null
  22796. , n = null
  22797. , a = null
  22798. , s = null
  22799. , l = 1;
  22800. return function(c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w) {
  22801. var _ = this.renderer;
  22802. _.context;
  22803. e || (i = new r.OrthographicCamera(l / -2,l / 2,l / 2,l / -2,-200,200),
  22804. i.position.z = 150,
  22805. t = new r.Scene,
  22806. t.add(i),
  22807. n = new r.ShaderMaterial({
  22808. uniforms: {
  22809. tDiffuse: {
  22810. type: "t",
  22811. value: null
  22812. },
  22813. alpha: {
  22814. type: "f",
  22815. value: 1
  22816. }
  22817. },
  22818. vertexShader: o.basicTextured.vertexShader,
  22819. fragmentShader: o.basicTextured.fragmentShader,
  22820. depthWrite: !1,
  22821. depthTest: !1,
  22822. side: r.DoubleSide
  22823. }),
  22824. a = new r.PlaneBufferGeometry(l,l),
  22825. s = new r.Mesh(a,n),
  22826. s.position.z = 0,
  22827. t.add(s),
  22828. e = !0);
  22829. var T = a.getAttribute("uv");
  22830. T.setDynamic(!0),
  22831. T.needsUpdate = !0;
  22832. var x = T.array
  22833. , S = p / u
  22834. , M = f / d
  22835. , R = g / u
  22836. , P = m / d;
  22837. x[0] = S,
  22838. x[1] = M + P,
  22839. x[2] = S + R,
  22840. x[3] = M + P,
  22841. x[4] = S,
  22842. x[5] = M,
  22843. x[6] = S + R,
  22844. x[7] = M;
  22845. var O = a.getAttribute("position");
  22846. O.setDynamic(!0),
  22847. O.needsUpdate = !0;
  22848. var L = O.array
  22849. , D = v / h.width - l / 2
  22850. , N = A / h.height - l / 2
  22851. , B = y / h.width
  22852. , F = C / h.height;
  22853. L[0] = D,
  22854. L[1] = N + F,
  22855. L[3] = D + B,
  22856. L[4] = N + F,
  22857. L[6] = D,
  22858. L[7] = N,
  22859. L[9] = D + B,
  22860. L[10] = N;
  22861. this.renderer.properties.get(c);
  22862. n.uniforms.tDiffuse.value = c,
  22863. n.blending = E || r.NoBlending,
  22864. n.transparent = !!b,
  22865. void 0 !== w && null !== w || (w = 1),
  22866. n.uniforms.alpha.value = w,
  22867. n.needUpdate = !0,
  22868. h.activeCubeFace = I,
  22869. h.viewport.set(0, 0, h.width, h.height);
  22870. var V = this.renderer.autoClear;
  22871. this.renderer.autoClear = !1,
  22872. this.renderer.render(t, i, h, !1),
  22873. this.renderer.autoClear = V
  22874. }
  22875. }(),
  22876. n.prototype.copyCubeMap = function() {
  22877. var e = !1
  22878. , t = null
  22879. , i = null
  22880. , a = null
  22881. , s = null
  22882. , l = null
  22883. , c = new r.Euler;
  22884. new r.Vector3;
  22885. return function(h, u, d, p, f, g, m, v, A) {
  22886. this.renderer;
  22887. if (!e) {
  22888. var y = 2;
  22889. i = new r.OrthographicCamera(y / -2,y / 2,y / 2,y / -2,0,200),
  22890. i.position.set(0, 0, 0),
  22891. t = new r.Scene,
  22892. t.add(i),
  22893. a = new r.ShaderMaterial({
  22894. uniforms: {
  22895. tDiffuse: {
  22896. type: "t",
  22897. value: null
  22898. },
  22899. alpha: {
  22900. type: "f",
  22901. value: 1
  22902. }
  22903. },
  22904. vertexShader: o.copyCubeMap.vertexShader,
  22905. fragmentShader: o.copyCubeMap.fragmentShader,
  22906. depthWrite: !1,
  22907. depthTest: !1,
  22908. side: r.DoubleSide
  22909. }),
  22910. s = new r.BoxGeometry(y,y,y),
  22911. l = new r.Mesh(s,a),
  22912. t.add(l),
  22913. e = !0
  22914. }
  22915. for (var C = 0; C < 6; C++)
  22916. n.getCubeOrientationForCubeFace(C, c),
  22917. l.rotation.copy(c),
  22918. l.matrixWorldNeedsUpdate = !0,
  22919. l.updateMatrixWorld(),
  22920. a.uniforms.tDiffuse.value = h,
  22921. a.blending = m || r.NoBlending,
  22922. a.transparent = !!v,
  22923. void 0 !== A && null !== A || (A = 1),
  22924. a.uniforms.alpha.value = A,
  22925. a.needUpdate = !0,
  22926. u.activeCubeFace = C,
  22927. u.viewport.set(0, 0, f, g),
  22928. this.renderer.render(t, i, u, !1)
  22929. }
  22930. }(),
  22931. n.getLookAtForCubeFace = function(e, t) {
  22932. switch (e) {
  22933. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  22934. t.set(1, 0, 0);
  22935. break;
  22936. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  22937. t.set(-1, 0, 0);
  22938. break;
  22939. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  22940. t.set(0, 1, 0);
  22941. break;
  22942. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22943. t.set(0, -1, 0);
  22944. break;
  22945. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  22946. t.set(0, 0, 1);
  22947. break;
  22948. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22949. t.set(0, 0, -1)
  22950. }
  22951. }
  22952. ,
  22953. n.getCubeOrientationForCubeFace = function(e, t) {
  22954. switch (e) {
  22955. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  22956. t.set(0, -Math.PI / 2, 0);
  22957. break;
  22958. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  22959. t.set(0, Math.PI / 2, 0);
  22960. break;
  22961. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  22962. t.set(Math.PI / 2, Math.PI, 0);
  22963. break;
  22964. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  22965. t.set(-Math.PI / 2, Math.PI, 0);
  22966. break;
  22967. case l.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  22968. t.set(0, -Math.PI, 0);
  22969. break;
  22970. case l.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  22971. t.set(0, 0, 0)
  22972. }
  22973. }
  22974. ,
  22975. t.exports = n
  22976. }
  22977. , {
  22978. "../enum/GLCubeFaces": 25,
  22979. "../enum/GLTextureType": 26,
  22980. "../enum/SceneRendererEvents": 43,
  22981. "../exception/BasicException": 55,
  22982. "../exception/RendererCreationException": 57,
  22983. "../settings": 166,
  22984. "../shaders": 167,
  22985. events: 202,
  22986. three: 217
  22987. }],
  22988. 159: [function(e, t, i) {
  22989. "use strict";
  22990. function n(e) {
  22991. this.messenger = new a(e),
  22992. this.clientKey = null
  22993. }
  22994. var r = e("../util/ajax")
  22995. , o = e("./PostMessageType")
  22996. , a = e("./postmessage")
  22997. , s = e("./VersionInfo")
  22998. , l = e("events").EventEmitter
  22999. , c = window.location.origin + "/api/v1/user/";
  23000. n.prototype = Object.create(l.prototype),
  23001. n.prototype.bindEvents = function() {
  23002. this.messenger.on(o.ACTION, this.onMessageReceived.bind(this))
  23003. }
  23004. ,
  23005. n.prototype.waitForConnection = function() {
  23006. var e = new Promise(function(e, t) {
  23007. this.messenger.on(o.CONNECT, function(i) {
  23008. this.onConnectionReceived(i).then(e.bind(this, i.sdkVersion), t.bind())
  23009. }
  23010. .bind(this))
  23011. }
  23012. .bind(this));
  23013. return e
  23014. }
  23015. ,
  23016. n.prototype.onConnectionReceived = function(e) {
  23017. return this.messenger.setTarget(e.source, e.origin),
  23018. this.verifyConnection(e).then(function(t, i) {
  23019. this.messenger.send({
  23020. type: o.ACCEPT,
  23021. toId: e.fromId,
  23022. warning: i
  23023. }),
  23024. this.clientKey = t,
  23025. this.messenger.removeAllListeners(o.CONNECT),
  23026. this.bindEvents()
  23027. }
  23028. .bind(this), function(t) {
  23029. this.messenger.send({
  23030. type: o.REJECT,
  23031. toId: e.fromId,
  23032. reason: t
  23033. }),
  23034. this.messenger.setTarget()
  23035. }
  23036. .bind(this))
  23037. }
  23038. ,
  23039. n.prototype.verifyConnection = function(e) {
  23040. return new Promise(function(t, i) {
  23041. var n;
  23042. if (s.isDeprecated(e.sdkVersion))
  23043. n = "This version of the SDK is being deprecated. Please see http://www.port.com for more info";
  23044. else if (!s.isSupported(e.sdkVersion))
  23045. return i("This version of the SDK isn't supported. Get the latest version here: http://www.port.com");
  23046. var o = {
  23047. cache: !1,
  23048. headers: {
  23049. "X-port-Application-Key": e.applicationKey,
  23050. "X-port-Referrer": e.origin
  23051. }
  23052. };
  23053. r.get(c, o).done(t.bind(this, e.applicationKey, n)).fail(i.bind(this, "key/referrer mismatch"))
  23054. }
  23055. )
  23056. }
  23057. ,
  23058. n.prototype.onMessageReceived = function(e) {
  23059. if (this.validateClientApplicationKey(e.applicationKey)) {
  23060. var t = this;
  23061. e.onDone = function(i) {
  23062. i.toId = e.fromId,
  23063. i.uid = e.uid,
  23064. i.type = o.RESPONSE,
  23065. t.messenger.send(i)
  23066. }
  23067. ,
  23068. this.emit(o.ACTION, e)
  23069. }
  23070. }
  23071. ,
  23072. n.prototype.validateClientApplicationKey = function(e) {
  23073. return this.clientKey === e
  23074. }
  23075. ,
  23076. n.prototype.sendEvent = function(e, t) {
  23077. this.messenger.send({
  23078. type: o.EVENT,
  23079. eventType: e,
  23080. eventData: t
  23081. })
  23082. }
  23083. ,
  23084. t.exports = n
  23085. }
  23086. , {
  23087. "../util/ajax": 181,
  23088. "./PostMessageType": 160,
  23089. "./VersionInfo": 163,
  23090. "./postmessage": 165,
  23091. events: 202
  23092. }],
  23093. 160: [function(e, t, i) {
  23094. "use strict";
  23095. t.exports = Object.freeze({
  23096. CONNECT: "postmessage.connect",
  23097. ACCEPT: "postmessage.accept",
  23098. REJECT: "postmessage.reject",
  23099. ACTION: "postmessage.action",
  23100. RESPONSE: "postmessage.response",
  23101. EVENT: "postmessage.event"
  23102. })
  23103. }
  23104. , {}],
  23105. 161: [function(e, t, i) {
  23106. "use strict";
  23107. t.exports = Object.freeze({
  23108. MOVE: "sdk.move",
  23109. ENTER_PANO: "sdk.enterpano",
  23110. MODEL_LOADED: "sdk.modelloaded"
  23111. })
  23112. }
  23113. , {}],
  23114. 162: [function(e, t, i) {
  23115. "use strict";
  23116. t.exports = Object.freeze({
  23117. FLY: "transition.fly",
  23118. FADEOUT: "transition.fade",
  23119. INSTANT: "transition.instant"
  23120. })
  23121. }
  23122. , {}],
  23123. 163: [function(e, t, i) {
  23124. "use strict";
  23125. t.exports = {
  23126. current: "1.0",
  23127. supported: ["1.0"],
  23128. deprecated: [],
  23129. isSupported: function(e) {
  23130. return this.supported.indexOf(e) !== -1
  23131. },
  23132. isDeprecated: function(e) {
  23133. return this.deprecated.indexOf(e) !== -1
  23134. },
  23135. isValid: function(e) {
  23136. return this.isSupported(e) || this.isDeprecated(e)
  23137. }
  23138. }
  23139. }
  23140. , {}],
  23141. 164: [function(e, t, i) {
  23142. (function(i) {
  23143. "use strict";
  23144. function n(e, t, i) {
  23145. e && (e = e.toLowerCase().trim());
  23146. var n = new I.UP.clone
  23147. , r = Math.PI / 3
  23148. , o = Math.PI / 2;
  23149. switch (e) {
  23150. case "left":
  23151. i.copy(t),
  23152. i.applyAxisAngle(n, o);
  23153. break;
  23154. case "right":
  23155. i.copy(t),
  23156. i.applyAxisAngle(n, -o);
  23157. break;
  23158. case "forwardleft":
  23159. i.copy(t),
  23160. i.applyAxisAngle(n, r);
  23161. break;
  23162. case "forwardright":
  23163. i.copy(t),
  23164. i.applyAxisAngle(n, -r);
  23165. break;
  23166. case "forward":
  23167. default:
  23168. i.copy(t)
  23169. }
  23170. return i
  23171. }
  23172. function r(e, t) {
  23173. if (e) {
  23174. var i = {
  23175. pano: e,
  23176. lookAtPoint: null,
  23177. duration: null,
  23178. maxDistanceOverride: null,
  23179. skipWarpingCheck: !1
  23180. };
  23181. this.player.flyToPano(i, function() {
  23182. t && t({
  23183. success: !0,
  23184. message: "Transition complete."
  23185. })
  23186. })
  23187. } else
  23188. R.warn("Showcase -> clickPanoObject: Unable to find pano."),
  23189. t && t({
  23190. success: !1,
  23191. error: "Unable to find pano."
  23192. })
  23193. }
  23194. function o(e, t) {
  23195. var i = this.findRankedPano(e, t);
  23196. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedPanoObject: Unable to find nearby pano."),
  23197. null)
  23198. }
  23199. function a(e, t) {
  23200. var i = this.findRankedtag(e, t);
  23201. return i >= 0 ? this.handleToObject[i] : (R.warn("Showcase -> findRankedtagObject: Unable to find nearby tag."),
  23202. null)
  23203. }
  23204. function s(e, t) {
  23205. t.copy(I.FORWARD),
  23206. e.getDirection(t)
  23207. }
  23208. function l(e) {
  23209. function t(e) {
  23210. var t = (new c.Euler).setFromQuaternion(e.quaternion, "YXZ");
  23211. return {
  23212. x: c.Math.radToDeg(t._x),
  23213. y: c.Math.radToDeg(t._y),
  23214. z: c.Math.radToDeg(t._z)
  23215. }
  23216. }
  23217. var i = function(e) {
  23218. return e.alignmentType !== m.ALIGNED ? null : {
  23219. x: e.position.x,
  23220. y: e.position.y,
  23221. z: e.position.z
  23222. }
  23223. };
  23224. return {
  23225. panos: e.panos.list.map(function(n) {
  23226. var r = y.getCubemapUrls(e.urls, n.id, "high")[C.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z];
  23227. return {
  23228. uuid: n.id,
  23229. aligned: n.alignmentType === m.ALIGNED,
  23230. neighbourUUIDs: n.neighbourUUIDs.slice(),
  23231. position: i(n),
  23232. rotation: t(n),
  23233. thumbnail: r
  23234. }
  23235. })
  23236. }
  23237. }
  23238. var c = e("three")
  23239. , h = e("./ApiHost")
  23240. , u = e("../util/logger")
  23241. , d = e("../util/common")
  23242. , p = e("../util/math")
  23243. , f = e("../enum/ModelManagerEvents")
  23244. , g = e("./PostMessageType")
  23245. , m = e("../enum/AlignmentType")
  23246. , v = e("../enum/Direction")
  23247. , A = e("./TransitionStyles")
  23248. , y = e("../util/panorama")
  23249. , C = e("../enum/GLCubeFaces")
  23250. , I = e("../enum/Vectors")
  23251. , E = e("../enum/Viewmode")
  23252. , b = e("../enum/WarpStyle")
  23253. , w = (e("../enum/Keys"),
  23254. e("../enum/PlayerEvents"))
  23255. , _ = e("../sdk/SdkEvents")
  23256. , I = e("../enum/Vectors")
  23257. , T = e("../enum/ControlEvents")
  23258. , x = e("../enum/RenderLayers")
  23259. , S = (e("../constants"),
  23260. e("../settings"))
  23261. , M = e("../lib/jpeg_encoder")
  23262. , R = new u(i)
  23263. , P = function() {
  23264. var e = function e() {
  23265. e.playerDirection.copy(e.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23266. e.player.getDirection(e.playerDirection),
  23267. e.projectVectors();
  23268. var t = e.playerDirection.angleTo(e.lastFacingDirection);
  23269. if (e.angleTravelled += Math.abs(t),
  23270. e.angleTravelled >= Math.abs(e.angle)) {
  23271. if (e.active = !1,
  23272. e.onDone) {
  23273. var i = e.onDone;
  23274. i()
  23275. }
  23276. } else
  23277. e.lastFacingDirection.copy(e.playerDirection),
  23278. window.setTimeout(e, 4)
  23279. };
  23280. return e.active = !1,
  23281. e.angle = 0,
  23282. e.angleTravelled = 0,
  23283. e.playerDirection = new c.Vector3,
  23284. e.lastFacingDirection = new c.Vector3,
  23285. e.onDone = null,
  23286. e.player = null,
  23287. e.start = function(t, i, n, r) {
  23288. e.active = !0,
  23289. t && i && (i = 0),
  23290. e.angle = t || i,
  23291. e.xAngle = t,
  23292. e.yAngle = i,
  23293. e.angleTravelled = 0,
  23294. e.playerDirection.copy(n.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23295. n.getDirection(e.playerDirection),
  23296. e.lastFacingDirection.copy(e.playerDirection),
  23297. e.projectVectors(),
  23298. e.onDone = r,
  23299. e.player = n,
  23300. e()
  23301. }
  23302. ,
  23303. e.projectVectors = function() {
  23304. e.xAngle && (e.playerDirection.projectOnPlane(I.UP),
  23305. e.lastFacingDirection.projectOnPlane(I.UP))
  23306. }
  23307. ,
  23308. e
  23309. }()
  23310. , O = function() {
  23311. var e = new c.Vector3;
  23312. return function(t) {
  23313. t ? (e.copy(t.position),
  23314. e.add(t.discPosition),
  23315. p.projectPositionToCanvas(e, this.player.camera, e),
  23316. this.click(e.x, e.y)) : R.warn("Showcase -> clicktagObject: Unable to find tag.")
  23317. }
  23318. }()
  23319. , L = function() {
  23320. return this.player.mode === E.PANORAMA ? S.insideLookLimitUp : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.minPolarAngle) : null
  23321. }
  23322. , D = function() {
  23323. return this.player.mode === E.PANORAMA ? S.insideLookLimitDown : this.player.mode === E.DOLLHOUSE ? 90 - c.Math.radToDeg(S.dollhouseDefault.maxPolarAngle) : null
  23324. }
  23325. , N = function(e) {
  23326. var t = new c.Vector3;
  23327. return function(e) {
  23328. var i = this.player.getDirection();
  23329. t.copy(i);
  23330. var n = t.y;
  23331. t.y = 0,
  23332. t.normalize();
  23333. var r = c.Math.radToDeg(t.angleTo(i)) * (n < 0 ? -1 : 1);
  23334. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.PANORAMA)
  23335. return 0 !== e && R.warn("Cannot rotate in y direction when in " + this.player.mode + " mode"),
  23336. 0;
  23337. this.player.mode === E.DOLLHOUSE && (r = -r);
  23338. var o = L.call(this) - .1
  23339. , a = D.call(this) + .1
  23340. , s = r + e;
  23341. s > o ? s = o : s < a && (s = a);
  23342. var l = s - r;
  23343. return e > 0 && l < .01 && (l = 0),
  23344. e < 0 && l > -.01 && (l = 0),
  23345. l
  23346. }
  23347. }()
  23348. , B = function() {
  23349. var e = new c.Euler;
  23350. return function(t) {
  23351. return e.setFromQuaternion(t.quaternion, "YXZ"),
  23352. {
  23353. position: {
  23354. x: t.position.x,
  23355. y: t.position.y,
  23356. z: t.position.z
  23357. },
  23358. rotation: {
  23359. x: c.Math.radToDeg(e.x),
  23360. y: c.Math.radToDeg(e.y),
  23361. z: 0
  23362. },
  23363. pano: t.currentPano ? t.currentPano.id : null,
  23364. mode: t.mode
  23365. }
  23366. }
  23367. }()
  23368. , F = null;
  23369. t.exports = {
  23370. init: function(e, t, i, n, r) {
  23371. V.init(e, t, i, r),
  23372. F = new Promise(function(e, t) {
  23373. i.on(w.Ready, function() {
  23374. e()
  23375. })
  23376. }
  23377. .bind(this));
  23378. var o = new h(window)
  23379. , a = o.waitForConnection();
  23380. a.then(function(e) {
  23381. o.on(g.ACTION, V.onMessageReceive.bind(V))
  23382. });
  23383. var s = function() {
  23384. var e = Date.now();
  23385. return function() {
  23386. if (!(Date.now() - e < 100)) {
  23387. var t = B(i);
  23388. o.sendEvent(_.MOVE, {
  23389. state: t
  23390. }),
  23391. e = Date.now()
  23392. }
  23393. }
  23394. }();
  23395. i.on(w.Move, s),
  23396. i.on(w.ViewChanged, s),
  23397. n.on(f.ActiveModelChanged, function(e) {
  23398. function t(e) {
  23399. var t, i = e.newPano.id;
  23400. e.oldPano && (t = e.oldPano.id),
  23401. i !== t && o.sendEvent(_.ENTER_PANO, {
  23402. oldPano: t,
  23403. newPano: i
  23404. })
  23405. }
  23406. var i = e.model
  23407. , n = e.oldModel;
  23408. V.model = i,
  23409. a.then(function() {
  23410. o.sendEvent(_.MODEL_LOADED, {
  23411. metadata: l(i)
  23412. })
  23413. }),
  23414. n && n.panos.forEach(function(e) {
  23415. e.removeEventListener("enter", t)
  23416. }),
  23417. i.panos.forEach(function(e) {
  23418. e.on("enter", t)
  23419. })
  23420. })
  23421. }
  23422. };
  23423. var V = {
  23424. director: null,
  23425. player: null,
  23426. controls: null,
  23427. sceneRenderer: null,
  23428. model: null,
  23429. init: function(e, t, i, n) {
  23430. this.director = e,
  23431. this.player = i,
  23432. this.controls = t,
  23433. this.sceneRenderer = n
  23434. },
  23435. handleToObject: {},
  23436. objectToHandle: {},
  23437. handleCount: 0,
  23438. onMessageReceive: function(e) {
  23439. if (e) {
  23440. var t = e.targetFunction
  23441. , i = e.params
  23442. , n = e.onDone;
  23443. t && this[t] && this[t](i, n)
  23444. }
  23445. },
  23446. waitForInit: function(e, t) {
  23447. F.then(t.bind({
  23448. success: !0,
  23449. message: "Init complete."
  23450. }))
  23451. },
  23452. moveToPano: function(e, t) {
  23453. var i = new c.Euler(0,0,0,"YXZ")
  23454. , n = new c.Quaternion;
  23455. return function(e, t) {
  23456. var r = e.pano
  23457. , o = e.rotation
  23458. , a = e.transition;
  23459. if (!this.model)
  23460. return t({
  23461. success: !1,
  23462. error: "The model has not been loaded yet"
  23463. });
  23464. var s = this.model.panos.get(r);
  23465. if (!s)
  23466. return t({
  23467. success: !1,
  23468. error: r + " does not exist in this model"
  23469. });
  23470. if (!o)
  23471. return t({
  23472. sucess: !1,
  23473. erorr: o + " is not a valid rotation"
  23474. });
  23475. i.set(c.Math.degToRad(o.x || 0), c.Math.degToRad(o.y || 0), c.Math.degToRad(o.z || 0), "YXZ"),
  23476. console.log(o.z);
  23477. var l = {
  23478. success: !0,
  23479. message: r
  23480. };
  23481. if (a === A.FADEOUT)
  23482. n.setFromEuler(i),
  23483. this.player.warpToPano(s, n, null, null, b.BLACK, null, null, t.bind(this, l));
  23484. else {
  23485. var h, u;
  23486. a === A.INSTANT && (h = 0,
  23487. u = 0);
  23488. var d = I.FORWARD.clone().applyEuler(i).add(s.position);
  23489. this.player.flyToPano({
  23490. pano: s,
  23491. lookAtPoint: d,
  23492. duration: h,
  23493. aimDuration: u
  23494. }, t.bind(this, l))
  23495. }
  23496. }
  23497. }(),
  23498. moveInDirection: function(e, t) {
  23499. var i = e.direction;
  23500. return "undefined" == typeof v[i] ? (R.warn("Showcase -> moveInDirection: Cannot move in invalid direction."),
  23501. void (t && t({
  23502. success: !1,
  23503. error: "Invalid direction."
  23504. }))) : void this.player.flyLocalDirection(I[i].clone()).then(function(e) {
  23505. t(e ? {
  23506. success: !0,
  23507. message: "moved " + i
  23508. } : {
  23509. success: !1,
  23510. error: "Cannot move in direction: " + i
  23511. })
  23512. })
  23513. },
  23514. getPose: function(e, t) {
  23515. this.player.camera.position,
  23516. (new c.Euler).setFromQuaternion(this.player.camera.quaternion, "YXZ");
  23517. return t({
  23518. success: !0,
  23519. message: B(this.player)
  23520. })
  23521. },
  23522. takeScreenShot: function() {
  23523. var e = new c.PerspectiveCamera
  23524. , t = new c.WebGLRenderTarget;
  23525. return function(i, n) {
  23526. if (!i.resolution)
  23527. return n({
  23528. success: !1,
  23529. error: "An invalid resolution was specified"
  23530. });
  23531. if (i.resolution.width === -1 || i.resolution.height === -1) {
  23532. var r = this.sceneRenderer.renderer.getSize();
  23533. i.resolution.width = r.width,
  23534. i.resolution.height = r.height
  23535. }
  23536. e.layers.set(x.DEFAULT),
  23537. i.visibleObjects && (i.visibleObjects.showtags && e.layers.enable(x.TAG),
  23538. i.visibleObjects.showPucks && e.layers.enable(x.PANOMARKERS),
  23539. i.visibleObjects.showReticule && e.layers.enable(x.RETICULE));
  23540. var o = i.resolution.width
  23541. , a = i.resolution.height
  23542. , s = o / a;
  23543. e.position.copy(this.sceneRenderer.camera.position),
  23544. e.quaternion.copy(this.sceneRenderer.camera.quaternion),
  23545. e.projectionMatrix.copy(this.player.camera.projectionMatrix),
  23546. e.projectionMatrix.elements[0] = this.player.camera.projectionMatrix.elements[5] / s,
  23547. t.setSize(o, a),
  23548. this.sceneRenderer.renderer.render(this.sceneRenderer.scene, e, t);
  23549. var l = new Uint8Array(o * a * 4);
  23550. this.sceneRenderer.renderer.readRenderTargetPixels(t, 0, 0, o, a, l);
  23551. var c = M.encode({
  23552. data: l,
  23553. width: o,
  23554. height: a,
  23555. heading: 180,
  23556. pitch: 0
  23557. }, {
  23558. quality: 75,
  23559. flipY: !0
  23560. })
  23561. , h = "data:image/jpg;base64," + d.uint8ToBase64(c.data);
  23562. n({
  23563. success: !0,
  23564. message: h
  23565. })
  23566. }
  23567. }(),
  23568. findRankedPano: function(e, t) {
  23569. var i = new c.Vector3
  23570. , r = new c.Vector3;
  23571. return function(e, t) {
  23572. s(this.player, r),
  23573. n(t, r, i);
  23574. var o = this.player.rankedPanoInDirection(e, i);
  23575. if (o) {
  23576. var a = this.objectToHandle[o.id];
  23577. return a || (this.objectToHandle[o.id] = a = this.handleCount++,
  23578. this.handleToObject[a] = o),
  23579. a
  23580. }
  23581. return R.warn("Showcase -> findRankedPano: Unable to find nearby pano."),
  23582. -1
  23583. }
  23584. }(),
  23585. findRankedtag: function(e, t) {
  23586. var i = new c.Vector3
  23587. , r = new c.Vector3;
  23588. return function(e, t) {
  23589. s(this.player, r),
  23590. n(t, r, i);
  23591. var o = this.player.rankedtagInDirection(e, i);
  23592. if (o) {
  23593. var a = this.objectToHandle[o.sid];
  23594. return a || (this.objectToHandle[o.sid] = a = this.handleCount++,
  23595. this.handleToObject[a] = o),
  23596. a
  23597. }
  23598. return R.warn("Showcase -> findRankedtag: Unable to find nearby tag."),
  23599. -1
  23600. }
  23601. }(),
  23602. clickNearesttag: function(e) {
  23603. this.clickRankedtag(0, e)
  23604. },
  23605. clickRankedtag: function(e, t) {
  23606. var i = a.call(this, e, t);
  23607. i && O.call(this, i)
  23608. },
  23609. clickNearestPano: function(e, t) {
  23610. this.clickRankedPano(0, e, t)
  23611. },
  23612. clickRankedPano: function(e, t, i) {
  23613. var n = o.call(this, e, t);
  23614. n ? r.call(this, n, i) : i(null)
  23615. },
  23616. clickPano: function(e, t) {
  23617. var i = this.handleTable[e];
  23618. i ? r.call(this, i, t) : t(null)
  23619. },
  23620. rotateDirection: function() {
  23621. return function(e, t) {
  23622. var i = e.direction
  23623. , n = e.angle;
  23624. if (!P.active) {
  23625. var r = 0
  23626. , o = 0
  23627. , a = 0
  23628. , s = 0;
  23629. if (!n || isNaN(n))
  23630. return R.warn("Showcase -> rotateDirection: Invalid rotation angle."),
  23631. void (t && t({
  23632. success: !1,
  23633. error: "Invalid rotation angle."
  23634. }));
  23635. if (this.player.mode === E.TRANSITIONING)
  23636. return R.warn("Automation -> rotateDirection: Cannot rotate while transitioning"),
  23637. void (t && t({
  23638. success: !1,
  23639. error: "Cannot rotate while transitioning"
  23640. }));
  23641. if (i === v.RIGHT || i === v.LEFT)
  23642. i === v.RIGHT && (n = -n),
  23643. r = n > 0 ? -1 : 1,
  23644. a = n;
  23645. else {
  23646. if (i !== v.UP && i !== v.DOWN)
  23647. return R.warn("Showcase -> rotateDirection: Invalid direction for rotation: " + i),
  23648. void (t && t({
  23649. success: !1,
  23650. error: "Invalid direction for rotation."
  23651. }));
  23652. if (this.player.mode === E.FLOORPLAN)
  23653. return R.warn("Showcase -> rotateDirection: Cannot rotate " + i + " in floorplan mode"),
  23654. void (t && t({
  23655. success: !1,
  23656. error: "Cannot rotate " + i + " in floorplan mode"
  23657. }));
  23658. if (i === v.DOWN && (n = -n),
  23659. n = N.call(this, n),
  23660. 0 === n)
  23661. return R.warn("Showcase -> rotateDirection: Already at maximum rotation in direction: " + i),
  23662. void (t && t({
  23663. success: !1,
  23664. error: "Already at maximum rotation in direction: " + i
  23665. }));
  23666. o = n > 0 ? 1 : -1,
  23667. s = n
  23668. }
  23669. var l = n;
  23670. n = c.Math.degToRad(n),
  23671. a = c.Math.degToRad(a),
  23672. s = c.Math.degToRad(s);
  23673. var h = this.controls.activeControl
  23674. , u = function() {
  23675. h.stopRotating(!0),
  23676. t && t({
  23677. success: !0,
  23678. message: "Rotated " + l.toFixed(2) + "° in direction: " + e.direction
  23679. })
  23680. };
  23681. h.startRotating(r, o),
  23682. P.start(a, s, this.player, u)
  23683. }
  23684. }
  23685. }(),
  23686. rotate: function() {
  23687. var e = new c.Vector3
  23688. , t = new c.Vector3;
  23689. return function(i, n) {
  23690. var r = i.xAngle
  23691. , o = i.yAngle;
  23692. if (!P.active) {
  23693. if (r = r || 0,
  23694. o = o || 0,
  23695. isNaN(r) || isNaN(o))
  23696. return R.warn("Showcase -> rotate: Invalid rotation angle."),
  23697. void (n && n({
  23698. success: !1,
  23699. error: "Invalid rotation angle."
  23700. }));
  23701. if (this.player.mode === E.TRANSITIONING)
  23702. return R.warn("Automation -> rotate: Cannot rotate while transitioning"),
  23703. void (n && n({
  23704. success: !1,
  23705. error: "Cannot rotate while transitioning"
  23706. }));
  23707. Math.abs(r) < .01 && (r = 0),
  23708. Math.abs(o) < .01 && (o = 0);
  23709. var a = o;
  23710. o = N.call(this, o),
  23711. r = -r;
  23712. var s = a > 0 ? "UP" : "DOWN";
  23713. if (!r && a && !o)
  23714. return R.warn("Showcase -> rotate: Already at maximum rotation in direction: " + s),
  23715. void (n && n({
  23716. success: !1,
  23717. error: "Already at maximum rotation in direction: " + s
  23718. }));
  23719. a > o && R.warn("Showcase -> rotate: Reached maximum rotation in direction: " + s);
  23720. var l = o;
  23721. o = c.Math.degToRad(o),
  23722. r = c.Math.degToRad(r),
  23723. e.copy(this.player.mode === E.FLOORPLAN ? I.UP : I.FORWARD),
  23724. this.player.getDirection(e),
  23725. t.copy(e).applyAxisAngle(I.UP, r),
  23726. t.applyAxisAngle(I.RIGHT, o);
  23727. var h = (e.angleTo(t),
  23728. r > 0 ? -1 : r < 0 ? 1 : 0)
  23729. , u = o > 0 ? 1 : o < 0 ? -1 : 0;
  23730. Math.abs(r) > Math.abs(o) ? u *= Math.abs(o / r) : Math.abs(o) > Math.abs(r) && (h *= Math.abs(r / o));
  23731. var d = this.controls.activeControl
  23732. , p = function() {
  23733. d.stopRotating(!0),
  23734. n && n({
  23735. success: !0,
  23736. message: "Rotated " + i.xAngle.toFixed(2) + "° horizontally, " + l.toFixed(2) + "° vertically"
  23737. })
  23738. };
  23739. d.startRotating(h, u),
  23740. P.start(r, o, this.player, p)
  23741. }
  23742. }
  23743. }(),
  23744. panCamera: function(e, t) {
  23745. function i(e) {
  23746. switch (r.removeAllListeners(T.AutoPanComplete),
  23747. r.removeAllListeners(T.AutoPanInterrupt),
  23748. r.removeAllListeners(T.AutoPanClamped),
  23749. e) {
  23750. case T.AutoPanInterrupt:
  23751. t({
  23752. success: !0,
  23753. message: "Camera panning interrupted."
  23754. });
  23755. break;
  23756. case T.AutoPanClamped:
  23757. if (r.autoPanPosition.x !== n.x || r.autoPanPosition.z !== n.z) {
  23758. if (Math.abs(this.player.position.x - r.autoPanPosition.x) < .01 && Math.abs(this.player.position.z - r.autoPanPosition.z) < .01)
  23759. return void t({
  23760. success: !1,
  23761. error: "Already at edge of current model bounds."
  23762. });
  23763. var i = "The view point is outside the bounds for the current model. ";
  23764. i += "The view point was clamped to " + o(r.target.x, r.target.z),
  23765. console.warn(i)
  23766. }
  23767. case T.AutoPanComplete:
  23768. t({
  23769. success: !0,
  23770. message: "Panned camera to position " + o(r.autoPanPosition.x, r.autoPanPosition.z)
  23771. })
  23772. }
  23773. }
  23774. if (this.player.mode !== E.DOLLHOUSE && this.player.mode !== E.FLOORPLAN)
  23775. return t({
  23776. success: !1,
  23777. error: "Camera panning is not available in the current mode: " + this.player.mode
  23778. });
  23779. var n = e.position
  23780. , r = this.player.control;
  23781. r.setAutoPanPosition(n.x, n.z),
  23782. r.autoPan = !0;
  23783. var o = function(e, t) {
  23784. return "(" + e.toFixed(2) + ", " + t.toFixed(2) + ")"
  23785. };
  23786. r.on(T.AutoPanComplete, i.bind(this, T.AutoPanComplete)),
  23787. r.on(T.AutoPanInterrupt, i.bind(this, T.AutoPanInterrupt)),
  23788. r.on(T.AutoPanClamped, i.bind(this, T.AutoPanClamped))
  23789. },
  23790. click: function(e, t) {
  23791. var i = e.x
  23792. , n = e.y
  23793. , r = e.percentage;
  23794. r === !0 && (i = i / 100 * $("#player").width(),
  23795. n = n / 100 * $("#player").height()),
  23796. this.player.handleInputStart(i, n),
  23797. this.player.updateIntersect(),
  23798. this.player.handleInputEnd(i, n)
  23799. },
  23800. mouseOver: function(e, t) {
  23801. var i = e.x
  23802. , n = e.y
  23803. , r = e.percentage;
  23804. r === !0 && (i = i / 100 * $("#player").width(),
  23805. n = n / 100 * $("#player").height()),
  23806. this.player.handleInputMove(i, n),
  23807. this.player.updateIntersect()
  23808. },
  23809. moveToMode: function(e, t) {
  23810. function i(e) {
  23811. t(e ? {
  23812. success: !1,
  23813. error: "Failed to load new mode: " + e
  23814. } : {
  23815. success: !0,
  23816. message: "Moved to new mode: " + n
  23817. })
  23818. }
  23819. var n = e.mode;
  23820. n === E.PANORAMA || n === E.DOLLHOUSE || n === E.FLOORPLAN ? this.director.changeMode(n).then(function() {
  23821. i()
  23822. }, function(e) {
  23823. i(e)
  23824. }) : t({
  23825. success: !1,
  23826. error: "Invalid mode selection"
  23827. })
  23828. }
  23829. }
  23830. }
  23831. ).call(this, "/js/sdk/automation.js")
  23832. }
  23833. , {
  23834. "../constants": 8,
  23835. "../enum/AlignmentType": 17,
  23836. "../enum/ControlEvents": 21,
  23837. "../enum/Direction": 22,
  23838. "../enum/GLCubeFaces": 25,
  23839. "../enum/Keys": 30,
  23840. "../enum/ModelManagerEvents": 33,
  23841. "../enum/PlayerEvents": 40,
  23842. "../enum/RenderLayers": 41,
  23843. "../enum/Vectors": 50,
  23844. "../enum/Viewmode": 51,
  23845. "../enum/WarpStyle": 52,
  23846. "../lib/jpeg_encoder": 94,
  23847. "../sdk/SdkEvents": 161,
  23848. "../settings": 166,
  23849. "../util/common": 185,
  23850. "../util/logger": 189,
  23851. "../util/math": 190,
  23852. "../util/panorama": 191,
  23853. "./ApiHost": 159,
  23854. "./PostMessageType": 160,
  23855. "./TransitionStyles": 162,
  23856. three: 217
  23857. }],
  23858. 165: [function(e, t, i) {
  23859. "use strict";
  23860. function n(e) {
  23861. this.sourceWindow = e,
  23862. this.targetWindow = null,
  23863. this.targetOrigin = null,
  23864. this.id = Math.floor(1e5 * Math.random()),
  23865. this.bindEvents()
  23866. }
  23867. var r = e("./PostMessageType")
  23868. , o = e("events").EventEmitter;
  23869. n.prototype = Object.create(o.prototype),
  23870. n.prototype.bindEvents = function() {
  23871. this.sourceWindow.addEventListener("message", this.onPostmessageReceived.bind(this))
  23872. }
  23873. ,
  23874. n.prototype.setTarget = function(e, t) {
  23875. this.targetWindow = e,
  23876. this.targetOrigin = t
  23877. }
  23878. ,
  23879. n.prototype.onPostmessageReceived = function(e) {
  23880. var t = e.origin || e.originalEvent.origin
  23881. , i = e.source;
  23882. switch (e.data.type) {
  23883. case r.CONNECT:
  23884. break;
  23885. case r.RESPONSE:
  23886. if (this.id !== e.data.toId)
  23887. return;
  23888. default:
  23889. if (!this.validateMessageOrigin(t))
  23890. return
  23891. }
  23892. var n = e.data;
  23893. n.source = i,
  23894. n.origin = t,
  23895. n.timestamp = Date.now(),
  23896. this.emit(e.data.type, n)
  23897. }
  23898. ,
  23899. n.prototype.validateMessageOrigin = function(e) {
  23900. return "*" === this.targetOrigin || e === this.targetOrigin
  23901. }
  23902. ,
  23903. n.prototype.send = function(e) {
  23904. this.targetWindow && this.targetOrigin && (e.fromId = this.id,
  23905. this.targetWindow.postMessage(e, this.targetOrigin))
  23906. }
  23907. ,
  23908. t.exports = n
  23909. }
  23910. , {
  23911. "./PostMessageType": 160,
  23912. events: 202
  23913. }],
  23914. 166: [function(e, t, i) {
  23915. "use strict";
  23916. var n = e("three")
  23917. , r = e("./util/browser")
  23918. , o = e("./enum/Viewmode")
  23919. , a = e("./enum/VROption")
  23920. , s = e("./enum/Colors")
  23921. , l = e("./enum/WarpStyle")
  23922. , c = e("./util/easing")
  23923. , h = e("./util/common")
  23924. , u = e("./util/showcase")
  23925. , d = e("./constants")
  23926. , p = {
  23927. debug: !1,
  23928. version: "2.25.6-0-gd87e5b1",
  23929. languageTag: r.valueFromHash("lang", null),
  23930. pageTitle: "四维虚拟漫游",
  23931. authorizationHeader: u.getAuthorizationHeader(),
  23932. autoplay: r.valueFromHash("play", !1) || !r.inIframe(),
  23933. logLevel: r.valueFromHash("log", 2),
  23934. skyboxRadius: 2500,
  23935. modelBoundsPadding: 5,
  23936. showNeighbors: !1,
  23937. brand: r.valueFromHash("brand", !0),
  23938. showHighlights: r.valueFromHash("hhl", !0) && r.valueFromHash("hr", 1),
  23939. startHighlights: r.valueFromHash("hl", -1),
  23940. specialEdition: r.valueFromHash("bn", 0),
  23941. useWheel: r.valueFromHash("wh", !0),
  23942. crossOrigin: "anonymous",
  23943. fancierTransition: !1,
  23944. wireframe: !1,
  23945. skyboxWireframe: !1,
  23946. modelAlpha: 1,
  23947. highlightPanoSelection: !1,
  23948. showSweeps: !0,
  23949. showSkyboxes: !1,
  23950. showMesh: !0,
  23951. showFloors: !1,
  23952. showFloorDuration: 300,
  23953. showFloorDelay: 300,
  23954. hideFloorDuration: 300,
  23955. hideFloorDelay: 0,
  23956. reticuleOpacityTransitionTime: 250,
  23957. reticuleColor: s.newBlue,
  23958. markerOpacityTransitionTime: 500,
  23959. guiAnimationSpeed: 250,
  23960. highlightAnimationDuration: 500,
  23961. modelComponentLoadSpinnerDelay: 150,
  23962. captureErrors: !1,
  23963. maxMobileTextures: 6,
  23964. minimalMemoryMode: r.valueFromHash("m3", r.isMobile()),
  23965. startupFlyinDelay: 3e3,
  23966. dollhouseDefault: {
  23967. minDistance: 15,
  23968. maxDistance: 50,
  23969. minPolarAngle: n.Math.degToRad(10),
  23970. maxPolarAngle: n.Math.degToRad(90)
  23971. },
  23972. hideReticuleTimeout: 1e3,
  23973. analytics: {
  23974. inactivityThreshold: 30,
  23975. sessionTrackingRate: .15,
  23976. maxTrackedErrors: 20,
  23977. sessionDurationPingFrequency: 10,
  23978. sessionDurationTimeout: 15
  23979. },
  23980. flydown: {
  23981. movementEasing: "easeInOutQuad",
  23982. movementDelay: .001,
  23983. rotationEasing: "easeInOutQuad",
  23984. rotationDelay: .5,
  23985. modelTextureDelay: .75,
  23986. skyboxDelay: .75
  23987. },
  23988. transition: {
  23989. flySpeed: .01,
  23990. flyTime: 750,
  23991. flytimeMaxDistanceThreshold: 5,
  23992. flytimeDistanceMultiplier: 150,
  23993. aimTime: 1500,
  23994. aimSlowFactor: 1.5,
  23995. blur: .8,
  23996. movementEasing: "easeInOutQuad",
  23997. blendEasing: "easeInOutQuad",
  23998. fastForwardFactor: r.valueFromHash("mfis", 3)
  23999. },
  24000. show360Views: {
  24001. enabled: !0,
  24002. transitionTime: 1e3
  24003. },
  24004. quickstart: {
  24005. enabled: 1 === r.valueFromHash("qust", 0) || 1 === r.valueFromHash("qs", 0),
  24006. animation: 1400,
  24007. showTextDelay: 500,
  24008. fadeOutDelay: 3e3,
  24009. fovChange: 10
  24010. },
  24011. appConfig: {
  24012. webvr_version: null,
  24013. segment_key: null,
  24014. embedly_key: null,
  24015. branch_key: null,
  24016. keen_write_key: null,
  24017. keen_project_id: null
  24018. },
  24019. vr: {
  24020. enabled: !0,
  24021. allowWebVR: !1,
  24022. option: r.valueFromHash("vr", a.CONTEXTUAL)
  24023. },
  24024. share: {
  24025. enabled: !r.valueFromHash("mls", 0) && r.valueFromHash("brand", !0)
  24026. },
  24027. input: {
  24028. longTapThreshold: 200,
  24029. moveToleranceNDC: .08,
  24030. touchMoveThreshold: 25
  24031. },
  24032. help: {
  24033. modalStayDuration: 600
  24034. },
  24035. immersive: {
  24036. timeToShowAgain: 1250,
  24037. uiStayDuration: 600
  24038. },
  24039. tourInteraction: {
  24040. disabled: "0" === r.valueFromHash("tourcta", null),
  24041. showPauseButton: 1e3,
  24042. showModal: 1500,
  24043. allowNextClick: 200,
  24044. largeModal: "1" === r.valueFromHash("tourcta", null),
  24045. smallModal: "2" === r.valueFromHash("tourcta", null)
  24046. },
  24047. labels: {
  24048. enabled: !1,
  24049. hideUntilStart: !0,
  24050. fadeInDuration: 250,
  24051. fadeInDelay: 250,
  24052. fadeOutDuration: 250,
  24053. fadeOutDelay: 0,
  24054. zoomHideThreshhold: {
  24055. mobile: r.isSmallScreen() ? .45 : .6,
  24056. desktop: 2
  24057. },
  24058. zoomTruncateThreshhold: {
  24059. mobile: r.isSmallScreen() ? .35 : .45,
  24060. desktop: .85
  24061. },
  24062. minLengthForTruncate: 16,
  24063. truncateLength: 12,
  24064. truncateSuffix: "..."
  24065. },
  24066. tags: {
  24067. enabled: r.valueFromHash("mt", 1),
  24068. startup: {
  24069. hideUntilStart: !0,
  24070. fadeInDuration: 500,
  24071. fadeInDelay: 100
  24072. },
  24073. visibility: {
  24074. anyDistance: !0,
  24075. visibleDistance: 8,
  24076. cameraClearance: .1,
  24077. alphaTestLevel: .05,
  24078. hideViaFloor: !0,
  24079. hideOffScreenDisc: !1,
  24080. hideOffScreenObject: !1
  24081. },
  24082. disc: {
  24083. opacity: 1,
  24084. disabledOpacity: .5,
  24085. scale: {
  24086. nearBound: 1.5,
  24087. farBound: 4.8,
  24088. linkFarBound: !1,
  24089. linkPercent: 40,
  24090. maxSize: 80,
  24091. minSize: 40,
  24092. baseViewportSize: 800,
  24093. responsiveness: 100
  24094. }
  24095. },
  24096. pole: {
  24097. enabled: !0,
  24098. height: .5,
  24099. width: 2,
  24100. opacity: .5,
  24101. color: "white"
  24102. },
  24103. navigate: {
  24104. nearestPano: !0,
  24105. lineOfSight: !0,
  24106. reactivate: !0,
  24107. aimAt: "disc",
  24108. tiltTolerance: 25,
  24109. rotateSpeedFactor: .6
  24110. }
  24111. },
  24112. path: {
  24113. color: s.newBlue,
  24114. colorUp: s._desat(s.newBlue, .5),
  24115. colorDown: s._darken(s.newBlue, .35),
  24116. opacity: .5,
  24117. style: "ribbon",
  24118. height: .025,
  24119. ribbonWidth: .24,
  24120. outsideHeight: .5,
  24121. waypointRadius: .5,
  24122. waypointIndoorRadius: .24,
  24123. waypointPulse: 1e3,
  24124. typ: l.BLACK,
  24125. meshFree: r.valueFromHash("mf", 1),
  24126. mapGuides: r.valueFromHash("guides", !0),
  24127. fadeInTime: 400,
  24128. fadeOutTime: 300
  24129. },
  24130. warp: {
  24131. nearPanoDist: .1,
  24132. matchCam: !1,
  24133. blur: .33,
  24134. fastTime: 1500,
  24135. teleportTime: 1500,
  24136. outsideTime: 2e3,
  24137. lookAheadMax: .3,
  24138. lookAheadDist: 2.5,
  24139. softPushDist: .37,
  24140. softPushEnd: .3,
  24141. softBendAngle: 8,
  24142. softBendTilt: 4,
  24143. softBendEnd: .3,
  24144. doBurns: r.valueFromHash("kb", !0),
  24145. burnsAngle: 35,
  24146. minBurnsAngle: 35,
  24147. minDownAngle: -35,
  24148. maxTurnPerSec: 280,
  24149. maxAimPerSec: 35,
  24150. minRotation: 12,
  24151. maxAimRotation: 33.2,
  24152. turnFriction: .2,
  24153. flySpeed: .01,
  24154. minWarpTime: 1200,
  24155. warpInterruptionRedirectTime: 500,
  24156. tourStepDelay: r.valueFromHash("st", 0),
  24157. walkDelay: 0,
  24158. walkMaxDist: 50,
  24159. walkMinDist: .8,
  24160. walkSlideShowThreshhold: 3e3,
  24161. walkExtraPanosDistance: .4,
  24162. timePerMeter: 800,
  24163. motionLeadTime: 500,
  24164. movementEasing: "easeInOutQuad",
  24165. blendEasing: "easeInOutQuad",
  24166. showBunny: !1,
  24167. loop: r.valueFromHash("lp", !1),
  24168. auto: r.valueFromHash("ts", -1),
  24169. eOrder: "YXZ",
  24170. stepFactor: .25,
  24171. brakeStrength: 2,
  24172. minBrakeAngle: .1,
  24173. maxBrakeAngle: 1.8,
  24174. climbEffort: 4
  24175. },
  24176. rotationFriction: .05,
  24177. rotationAccelerationInside: 4.5,
  24178. rotationAccelerationOutside: .15,
  24179. rotationAfterMoveMultiplier: 40,
  24180. rotationAfterMoveHistoryCount: 5,
  24181. panFriction: .09,
  24182. panAccelerationOutside: 60,
  24183. onload: r.valueFromHash("onload", o.PANORAMA),
  24184. zoomNearLimit: .1,
  24185. zoomFarLimit: 10,
  24186. navigation: {
  24187. panoScores: !1,
  24188. mouseDirection: !0,
  24189. filterStrictness: .75,
  24190. angleFactor: -30,
  24191. directionFactor: 10,
  24192. distanceFactor: -1,
  24193. optionalityFactor: 3
  24194. },
  24195. sdkInit: !1,
  24196. secretPanelWord: [38, 38, 40, 40, 37, 39, 37, 39, 66, 65],
  24197. console: r.valueFromHash("console", !1),
  24198. noMeshFloorPositionOffset: new n.Vector3(0,-1.2,0),
  24199. panoramaNeighbourMaxDistance: 5,
  24200. panoFloorClickRadius: .35,
  24201. showScreenshotLocations: !1,
  24202. showAxis: !1,
  24203. showNeighbourRaycasts: !1,
  24204. colorMarkerOnLoad: !1,
  24205. colorMarkerByFloor: !1,
  24206. tiling: {
  24207. panoPreRenderRepeatDelay: 2500,
  24208. panoPreRenderDelay: 500,
  24209. preRenderTourPanos: r.valueFromHash("tileprerender", 0),
  24210. tilingFlagNames: ["usetiles", "tiles"],
  24211. maxNavPanoQuality: r.valueFromHash("maxtileq", null),
  24212. maxZoomPanoQuality: r.valueFromHash("maxztileq", null),
  24213. overlayStyle: r.valueFromHash("tileoverlay", 0),
  24214. uploadIntervalDelay: r.valueFromHash("tileupdelay", 10),
  24215. initialIntervalDelay: r.valueFromHash("itiledelay", 0),
  24216. maxNonBaseUploadsPerFrame: r.valueFromHash("maxnbtpf", 2),
  24217. maxBaseUploadsPerFrame: r.valueFromHash("maxbtpf", 6),
  24218. customCompression: r.valueFromHash("tilecustcomp", 0),
  24219. mobileHighQualityOverride: !1,
  24220. allowUltraHighResolution: !1
  24221. },
  24222. zoom: {
  24223. enabled: !1,
  24224. forceOff: r.valueFromHash("nozoom", 0),
  24225. overridemax: r.valueFromHash("maxzoom", null),
  24226. overridemin: r.valueFromHash("minzoom", null),
  24227. max: d.highQualityMaxZoom,
  24228. min: 1,
  24229. transitionStyle: r.valueFromHash("zoomtrans", 1),
  24230. activationThreshold: 1.1,
  24231. restoreTime: 500
  24232. },
  24233. profiling: {
  24234. enabled: r.valueFromHash("mem", !1)
  24235. }
  24236. };
  24237. p = h.deepExtend(p, d, {
  24238. insideFOV: r.valueFromHash("fov", d.insideFOV),
  24239. insideFOVMax: r.valueFromHash("fovmax", d.insideFOVMax),
  24240. panorama: {
  24241. transitionTime: 1e3,
  24242. modelAlpha: 0,
  24243. modelAlphaDelay: p.flydown.modelTextureDelay,
  24244. modelAlphaLength: 1,
  24245. skyboxOpacity: 1,
  24246. skyboxOpacityDelay: p.flydown.skyboxDelay,
  24247. skyboxOpacityLength: .9,
  24248. fovLength: 1,
  24249. fovDelay: 0,
  24250. cameraMatrixDuration: .8,
  24251. cameraMatrixDelay: 0,
  24252. cameraMatrixEase: c.easeInCubic,
  24253. reticuleOpacity: 1,
  24254. markerOpacity: .3,
  24255. markerOpacityOnHover: 1
  24256. },
  24257. dollhouse: {
  24258. transitionTime: 1e3,
  24259. modelAlpha: 1,
  24260. modelAlphaDelay: 0,
  24261. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24262. skyboxOpacity: 0,
  24263. skyboxOpacityDelay: 0,
  24264. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24265. fovLength: 1,
  24266. fovDelay: 0,
  24267. cameraMatrixDuration: .8,
  24268. cameraMatrixDelay: .3,
  24269. cameraMatrixEase: c.easeInCubic,
  24270. reticuleOpacity: 1,
  24271. markerOpacity: 0,
  24272. markerOpacityOnHover: 0
  24273. },
  24274. floorplan: {
  24275. transitionTime: 1e3,
  24276. modelAlpha: 1,
  24277. modelAlphaDelay: 0,
  24278. modelAlphaLength: 1 - p.flydown.modelTextureDelay,
  24279. skyboxOpacity: 0,
  24280. skyboxOpacityDelay: 0,
  24281. skyboxOpacityLength: 1 - p.flydown.skyboxDelay,
  24282. fovLength: 1,
  24283. fovDelay: 0,
  24284. cameraMatrixDuration: .5,
  24285. cameraMatrixDelay: 0,
  24286. cameraMatrixEase: c.easeOutCubic,
  24287. reticuleOpacity: 1,
  24288. markerOpacity: 0,
  24289. markerOpacityOnHover: 0,
  24290. cameraHeight: 50
  24291. },
  24292. transitioning: {
  24293. reticuleOpacity: 0,
  24294. markerOpacity: .3,
  24295. markerOpacityOnHover: 1
  24296. },
  24297. "floorplan-dollhouse": {
  24298. rotationDelay: 0,
  24299. rotationDuration: 1
  24300. },
  24301. "floorplan-panorama": {
  24302. rotationDelay: .5,
  24303. rotationDuration: 1
  24304. },
  24305. "dollhouse-panorama": {
  24306. rotationDelay: .5,
  24307. rotationDuration: 1
  24308. },
  24309. "dollhouse-floorplan": {
  24310. rotationDelay: 0,
  24311. rotationDuration: 1,
  24312. cameraMatrixDuration: 1.05,
  24313. cameraMatrixDelay: .5
  24314. },
  24315. "panorama-dollhouse": {
  24316. rotationDelay: 0,
  24317. rotationDuration: .5
  24318. },
  24319. "panorama-floorplan": {
  24320. transitionTime: 1500,
  24321. rotationDelay: 0,
  24322. rotationDuration: .5
  24323. }
  24324. }),
  24325. p.path.meshFree && (p.path.typ = l.WALK),
  24326. p.zoom.max = p.zoom.overridemax || p.zoom.max,
  24327. p.zoom.min = p.zoom.overridemin || p.zoom.min,
  24328. t.exports = p
  24329. }
  24330. , {
  24331. "./constants": 8,
  24332. "./enum/Colors": 19,
  24333. "./enum/VROption": 47,
  24334. "./enum/Viewmode": 51,
  24335. "./enum/WarpStyle": 52,
  24336. "./util/browser": 182,
  24337. "./util/common": 185,
  24338. "./util/easing": 186,
  24339. "./util/showcase": 193,
  24340. three: 217
  24341. }],
  24342. 167: [function(e, t, i) {
  24343. "use strict";
  24344. var n = e("three")
  24345. , r = e("./settings")
  24346. , o = "precision highp float;\nprecision highp int;\n\nuniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\n"
  24347. , a = "precision highp float;\nprecision highp int;\n\nuniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n";
  24348. t.exports = {
  24349. basicTextured: {
  24350. uniforms: {
  24351. tDiffuse: {
  24352. type: "t",
  24353. value: null
  24354. },
  24355. alpha: {
  24356. type: "f",
  24357. value: 1
  24358. }
  24359. },
  24360. vertexShader: "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24361. fragmentShader: "varying vec2 vUv;\nuniform float alpha;\nuniform sampler2D tDiffuse;\nvoid main() {\n vec4 texColor = texture2D(tDiffuse, vUv);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"
  24362. },
  24363. copyCubeMap: {
  24364. uniforms: {
  24365. tDiffuse: {
  24366. type: "t",
  24367. value: null
  24368. },
  24369. alpha: {
  24370. type: "f",
  24371. value: 1
  24372. }
  24373. },
  24374. vertexShader: "varying vec3 vWorldPos;\nvoid main() {\n vWorldPos = vec3(-position.x, -position.y, position.z);\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24375. fragmentShader: "varying vec3 vWorldPos;\nuniform float alpha;\nuniform samplerCube tDiffuse;\nvoid main() {\n vec4 texColor = textureCube(tDiffuse, vWorldPos);\n gl_FragColor = vec4(texColor.rgb, texColor.a * alpha);\n}"
  24376. },
  24377. cube: {
  24378. uniforms: {
  24379. map: {
  24380. type: "t",
  24381. value: null
  24382. },
  24383. opacity: {
  24384. type: "f",
  24385. value: 1
  24386. }
  24387. },
  24388. vertexShader: o + "varying vec3 vWorldPosition;\n\nvoid main() {\n vWorldPosition = position;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}\n",
  24389. fragmentShader: a + "uniform samplerCube map;\nuniform float opacity;\n\nvarying vec3 vWorldPosition;\n\nvoid main() {\n vec4 color = textureCube( map, vec3( -vWorldPosition.x, vWorldPosition.yz ) );\n gl_FragColor = vec4(color.rgb, opacity);\n}\n"
  24390. },
  24391. model: {
  24392. uniforms: {
  24393. map: {
  24394. type: "t",
  24395. value: null
  24396. },
  24397. modelAlpha: {
  24398. type: "f",
  24399. value: r.modelAlpha
  24400. },
  24401. opacity: {
  24402. type: "f",
  24403. value: 1
  24404. },
  24405. progress: {
  24406. type: "f",
  24407. value: 0
  24408. },
  24409. blackout: {
  24410. type: "i",
  24411. value: 0
  24412. },
  24413. pano0Map: {
  24414. type: "t",
  24415. value: null
  24416. },
  24417. pano0Position: {
  24418. type: "v3",
  24419. value: new n.Vector3
  24420. },
  24421. pano0Matrix: {
  24422. type: "m4",
  24423. value: new n.Matrix4
  24424. },
  24425. pano1Map: {
  24426. type: "t",
  24427. value: null
  24428. },
  24429. pano1Position: {
  24430. type: "v3",
  24431. value: new n.Vector3
  24432. },
  24433. pano1Matrix: {
  24434. type: "m4",
  24435. value: new n.Matrix4
  24436. }
  24437. },
  24438. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\n\nvoid main() {\n\n vUv = uv;\n vec4 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 gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24439. fragmentShader: a + "uniform sampler2D map;\nuniform float modelAlpha;\nuniform float opacity;\nuniform 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\nvoid main() {\n\tconst vec4 BLACK = vec4(0.0, 0.0, 0.0, 1.0);\n\tconst vec4 GREY = vec4(0.5, 0.5, 0.5, 1.0);\n\n\tvec4 colorFromPanos;\n\tvec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz);\n\tvec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz);\n\n\tif (blackout == 0) {\n\t\tcolorFromPanos = mix(colorFromPano0, colorFromPano1, progress);\n\t} else if (blackout == 1) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, min(1.0, progress*2.0));\n\t\tcolorFromPanos = mix(colorFromPanos, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} else if (blackout == 2) {\n\t\tcolorFromPanos = mix(colorFromPano0, BLACK, progress);\n\t} else if (blackout == 3) {\n\t\tcolorFromPanos = mix(BLACK, colorFromPano1, max(0.0, progress * 2.0 - 1.0));\n\t} \n\n\tvec4 colorFromTexture = texture2D( map, vUv );\n\tcolorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n\tfloat whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n\tcolorFromPanos = mix(colorFromPanos, GREY, whiteness);\n\tgl_FragColor = vec4(colorFromPanos.rgb, opacity);\n}\n"
  24440. },
  24441. hot:{
  24442. uniforms:{
  24443. color:{
  24444. type: "c",
  24445. value: new n.Color( 0xff2200 )
  24446. },
  24447. opac:{
  24448. type: "f",
  24449. value: 0
  24450. },
  24451. texture1:{
  24452. type: "t",
  24453. value: null
  24454. },
  24455. texture2:{
  24456. type: "t",
  24457. value: null
  24458. }
  24459. },
  24460. vertexShader:"varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv ;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24461. fragmentShader:"varying vec3 vNormal;\n\nvarying vec2 vUv;\n\nuniform float opac;\n\nuniform vec3 color;\n\nuniform sampler2D texture1;\n\nuniform sampler2D texture2;\n\nvoid main() {\n\nvec4 tcolor1 = texture2D( texture1, vUv );\n\nvec4 tcolor2 = texture2D( texture2, vUv );\n\ngl_FragColor = tcolor1+ vec4(opac)*tcolor2;}\n"
  24462. },
  24463. modelOutside: {
  24464. uniforms: {
  24465. map: {
  24466. type: "t",
  24467. value: null
  24468. },
  24469. opacity: {
  24470. type: "f",
  24471. value: 1
  24472. }
  24473. },
  24474. vertexShader: o + "varying vec2 vUv;\n\nvoid main() {\n\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24475. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\n\nvec4 white = vec4(0.5, 0.5, 0.5, 1.0);\n\nvoid main() {\n\n vec4 colorFromTexture = texture2D( map, vUv );\n float whiteness = 1.0 - smoothstep(0.1, 0.2, opacity);\n colorFromTexture = mix(colorFromTexture, white, whiteness);\n gl_FragColor = vec4(colorFromTexture.rgb, opacity);\n\n}\n"
  24476. },
  24477. ribbon: {
  24478. uniforms: {
  24479. map: {
  24480. type: "t",
  24481. value: null
  24482. },
  24483. opacity: {
  24484. type: "f",
  24485. value: 1
  24486. },
  24487. color: {
  24488. type: "c",
  24489. value: new n.Color(r.path.color)
  24490. }
  24491. },
  24492. vertexShader: o + "varying vec2 vUv;\nvarying vec3 vN;\nvarying vec4 vP;\n\nvoid main() {\n\n vUv = uv;\n vN= normalMatrix * normal;\n vP = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vP;\n}\n",
  24493. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nvarying vec2 vUv;\nuniform vec3 color;\nvarying vec3 vN; // show-1182\nvarying vec4 vP; // show-1182\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tvec3 vNn = normalize(vN);\n\tvec3 vPn = normalize(vP.xyz);\n\tfloat f = pow(1.0-abs(dot(vNn,vPn)),0.2);\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromTexture.a *= f;\n gl_FragColor = vec4((color.rgb*colorFromTexture.rgb),\n \t\t\t\t\t\t(opacity*colorFromTexture.a));\n}\n"
  24494. },
  24495. waypoint: {
  24496. uniforms: {
  24497. map: {
  24498. type: "t",
  24499. value: null
  24500. },
  24501. opacity: {
  24502. type: "f",
  24503. value: 1
  24504. },
  24505. pulse: {
  24506. type: "f",
  24507. value: 1
  24508. },
  24509. nearFade: {
  24510. type: "v2",
  24511. value: new n.Vector2(2 * r.insideNear,2 * r.path.waypointIndoorRadius)
  24512. },
  24513. color: {
  24514. type: "c",
  24515. value: new n.Color(r.reticuleColor)
  24516. }
  24517. },
  24518. vertexShader: o + "varying vec2 vUv;\nvarying vec4 vPointView;\n\nvoid main() {\n\n vUv = uv;\n vPointView = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * vPointView;\n\n}\n",
  24519. fragmentShader: a + "uniform sampler2D map;\nuniform float opacity;\nuniform float pulse; // another opacity, with a different clock\nuniform vec2 nearFade;\nvarying vec2 vUv;\nvarying vec4 vPointView;\nuniform vec3 color;\n\nvoid main() {\n\t// TODO add scroll-in and pulsing behaviors\n\tfloat depthFade = min(1.0, (abs(vPointView.z)-nearFade.x)/(nearFade.y-nearFade.x));\n vec4 colorFromTexture = texture2D( map, vUv );\t\t// we only use the alpha!\n gl_FragColor = vec4(color.rgb,\n \t\t\t\t\t\t(pulse*opacity*colorFromTexture.a * depthFade));\n}\n"
  24520. },
  24521. modelDebug: {
  24522. uniforms: {
  24523. map: {
  24524. type: "t",
  24525. value: null
  24526. },
  24527. modelAlpha: {
  24528. type: "f",
  24529. value: r.modelAlpha
  24530. },
  24531. depthmapRatio: {
  24532. type: "f",
  24533. value: 0
  24534. },
  24535. opacity: {
  24536. type: "f",
  24537. value: 1
  24538. },
  24539. progress: {
  24540. type: "f",
  24541. value: 0
  24542. },
  24543. considerOcclusion: {
  24544. type: "i",
  24545. value: r.fancierTransition
  24546. },
  24547. highlightPanoSelection: {
  24548. type: "i",
  24549. value: 0
  24550. },
  24551. useThirdPano: {
  24552. type: "i",
  24553. value: r.useThirdPano
  24554. },
  24555. pano0Map: {
  24556. type: "t",
  24557. value: null
  24558. },
  24559. pano0Depth: {
  24560. type: "t",
  24561. value: null
  24562. },
  24563. pano0Position: {
  24564. type: "v3",
  24565. value: new n.Vector3
  24566. },
  24567. pano0Matrix: {
  24568. type: "m4",
  24569. value: new n.Matrix4
  24570. },
  24571. pano0Weight: {
  24572. type: "f",
  24573. value: r.transition.pano0Weight
  24574. },
  24575. pano1Map: {
  24576. type: "t",
  24577. value: null
  24578. },
  24579. pano1Depth: {
  24580. type: "t",
  24581. value: null
  24582. },
  24583. pano1Position: {
  24584. type: "v3",
  24585. value: new n.Vector3
  24586. },
  24587. pano1Matrix: {
  24588. type: "m4",
  24589. value: new n.Matrix4
  24590. },
  24591. pano1Weight: {
  24592. type: "f",
  24593. value: r.transition.pano1Weight
  24594. },
  24595. pano2Map: {
  24596. type: "t",
  24597. value: null
  24598. },
  24599. pano2Depth: {
  24600. type: "t",
  24601. value: null
  24602. },
  24603. pano2Position: {
  24604. type: "v3",
  24605. value: new n.Vector3
  24606. },
  24607. pano2Matrix: {
  24608. type: "m4",
  24609. value: new n.Matrix4
  24610. },
  24611. pano2Weight: {
  24612. type: "f",
  24613. value: r.transition.pano2Weight
  24614. }
  24615. },
  24616. vertexShader: o + "uniform vec3 pano0Position;\nuniform mat4 pano0Matrix;\n\nuniform vec3 pano1Position;\nuniform mat4 pano1Matrix;\n\nuniform vec3 pano2Position;\nuniform mat4 pano2Matrix;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vUv = uv;\n worldPosition = modelMatrix * vec4(position, 1.0);\n\n vec3 positionLocalToPanoCenter0 = worldPosition.xyz - pano0Position;\n vWorldPosition0 = (vec4(positionLocalToPanoCenter0, 1.0) * pano0Matrix).xyz;\n vWorldPosition0.x *= -1.0;\n\n vec3 positionLocalToPanoCenter1 = worldPosition.xyz - pano1Position;\n vWorldPosition1 = (vec4(positionLocalToPanoCenter1, 1.0) * pano1Matrix).xyz;\n vWorldPosition1.x *= -1.0;\n\n vec3 positionLocalToPanoCenter2 = worldPosition.xyz - pano2Position;\n vWorldPosition2 = (vec4(positionLocalToPanoCenter2, 2.0) * pano2Matrix).xyz;\n vWorldPosition2.x *= -1.0;\n\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24617. fragmentShader: a + "uniform sampler2D map;\nuniform float depthmapRatio;\nuniform float modelAlpha;\nuniform float opacity;\nuniform float progress;\nuniform int considerOcclusion;\nuniform int highlightPanoSelection;\nuniform int useThirdPano;\n\nuniform vec3 pano0Position;\nuniform samplerCube pano0Map;\nuniform samplerCube pano0Depth;\nuniform float pano0Weight;\n\nuniform vec3 pano1Position;\nuniform samplerCube pano1Map;\nuniform samplerCube pano1Depth;\nuniform float pano1Weight;\n\nuniform vec3 pano2Position;\nuniform samplerCube pano2Map;\nuniform samplerCube pano2Depth;\nuniform float pano2Weight;\n\nvarying vec2 vUv;\nvarying vec3 vWorldPosition0;\nvarying vec3 vWorldPosition1;\nvarying vec3 vWorldPosition2;\n\nvarying vec4 worldPosition;\n\nvoid main() {\n\n vec4 depthFromPano0 = textureCube( pano0Depth, vWorldPosition0.xyz );\n vec4 depthFromPano1 = textureCube( pano1Depth, vWorldPosition1.xyz );\n vec4 depthFromPano2 = textureCube( pano2Depth, vWorldPosition2.xyz );\n\n vec4 colorFromPano0 = textureCube( pano0Map, vWorldPosition0.xyz );\n vec4 colorFromPano1 = textureCube( pano1Map, vWorldPosition1.xyz );\n vec4 colorFromPano2 = textureCube( pano2Map, vWorldPosition2.xyz );\n\n float distanceToPano0 = distance(worldPosition.xyz, pano0Position);\n float distanceToPano1 = distance(worldPosition.xyz, pano1Position);\n float distanceToPano2 = distance(worldPosition.xyz, pano2Position);\n\n float cameraToPano0 = distance(cameraPosition.xyz, pano0Position);\n float cameraToPano1 = distance(cameraPosition.xyz, pano1Position);\n float cameraToPano2 = distance(cameraPosition.xyz, pano2Position);\n\n float contributionFromPano0 = cameraToPano0 == 0.0 ? 1000.0 : pano0Weight / cameraToPano0;\n float contributionFromPano1 = cameraToPano1 == 0.0 ? 1000.0 : pano1Weight / cameraToPano1;\n float contributionFromPano2 = cameraToPano2 == 0.0 ? 1000.0 : pano2Weight / cameraToPano2;\n\n contributionFromPano0 *= 1.0 / distanceToPano0;\n contributionFromPano1 *= 1.0 / distanceToPano1;\n contributionFromPano2 *= 1.0 / distanceToPano2;\n\n if(considerOcclusion == 1) {\n bool occludedFromPano0 = distanceToPano0 / 10.0 > 1.01 - depthFromPano0.x;\n bool occludedFromPano1 = distanceToPano1 / 10.0 > 1.01 - depthFromPano1.x;\n bool occludedFromPano2 = distanceToPano2 / 10.0 > 1.01 - depthFromPano2.x;\n\n if(occludedFromPano0){contributionFromPano0 *= 0.1;}\n if(occludedFromPano1){contributionFromPano1 *= 0.1;}\n if(occludedFromPano2){contributionFromPano2 *= 0.1;}\n //if(occludedFromPano0 && occludedFromPano1 && !occludedFromPano2) { contributionFromPano2 += 0.5; }\n }\n\n float contributionSum = contributionFromPano0 + contributionFromPano1 + contributionFromPano2;\n contributionFromPano0 /= contributionSum;\n contributionFromPano1 /= contributionSum;\n contributionFromPano2 /= contributionSum;\n\n vec4 colorFromPanos = colorFromPano0 * contributionFromPano0;\n colorFromPanos += colorFromPano1 * contributionFromPano1;\n colorFromPanos += colorFromPano2 * contributionFromPano2;\n\n vec4 depthFromPanos = depthFromPano0 * contributionFromPano0;\n depthFromPanos += depthFromPano1 * contributionFromPano1;\n depthFromPanos += depthFromPano2 * contributionFromPano2;\n\n vec4 colorFromTexture = texture2D( map, vUv );\n colorFromPanos = mix(colorFromPanos, colorFromTexture, modelAlpha);\n\n if(highlightPanoSelection == 1) {\n colorFromPanos.r = contributionFromPano0;\n colorFromPanos.g = contributionFromPano1;\n colorFromPanos.b = contributionFromPano2;\n }\n\n gl_FragColor = vec4(mix(colorFromPanos, depthFromPanos, depthmapRatio).rgb, opacity);\n\n}\n"
  24618. },
  24619. customDepth: {
  24620. uniforms: {
  24621. panoPosition: {
  24622. type: "v3",
  24623. value: new n.Vector3
  24624. }
  24625. },
  24626. vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24627. fragmentShader: a + "uniform vec3 panoPosition;\nvarying vec4 worldPosition;\n\nvoid main() {\n\n float depth = distance(worldPosition.xyz, panoPosition);\n float color = 1.0 - depth / 10.0;\n gl_FragColor = vec4(color, color, color, 1.0);\n\n}\n"
  24628. },
  24629. skysphere: {
  24630. uniforms: {
  24631. radius: {
  24632. type: "f",
  24633. value: 0
  24634. }
  24635. },
  24636. vertexShader: o + "varying vec4 worldPosition;\n\nvoid main() {\n\n worldPosition = modelMatrix * vec4(position, 1.0);\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n}\n",
  24637. fragmentShader: a + "varying vec4 worldPosition;\nuniform float radius;\n\nvoid main() {\n\n vec4 topColor = vec4(0.094, 0.102, 0.11, 1.0);\n vec4 bottomColor = vec4(0.2, 0.216, 0.235, 1.0);\n float normalizedHeight = (worldPosition.y + radius) / (radius * 2.0);\n float ratio = smoothstep(0.0, 0.5, normalizedHeight);\n gl_FragColor = mix(bottomColor, topColor, ratio);\n\n}\n"
  24638. },
  24639. tagDisc: {
  24640. uniforms: {
  24641. opacity: {
  24642. type: "f",
  24643. value: 0
  24644. },
  24645. color: {
  24646. type: "c",
  24647. value: new n.Color
  24648. },
  24649. bg: {
  24650. type: "t",
  24651. value: null
  24652. },
  24653. mask: {
  24654. type: "t",
  24655. value: null
  24656. }
  24657. },
  24658. vertexShader: o + "varying vec2 vUv;\nvoid main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n}",
  24659. fragmentShader: a + "uniform float opacity;\nuniform vec3 color;\nuniform sampler2D bg;\nuniform sampler2D mask;\n\nvarying vec2 vUv;\n\nvoid main() {\n vec4 maskColor = texture2D(mask, vUv);\n vec4 bgColor = texture2D(bg, vUv);\n vec3 mappedColor = mix(bgColor.rgb, color, maskColor.a);\n gl_FragColor = vec4(mappedColor, bgColor.a * opacity);\n}\n"
  24660. }
  24661. }
  24662. }
  24663. , {
  24664. "./settings": 166,
  24665. three: 217
  24666. }],
  24667. 168: [function(e, t, i) {
  24668. (function(i) {
  24669. "use strict";
  24670. var n = e("three")
  24671. , r = (e("url"),
  24672. e("./util/ajax"))
  24673. , o = e("./settings")
  24674. , a = e("./util/logger")
  24675. , s = e("./util/math")
  24676. , l = e("./util/showcase")
  24677. , c = e("./objects/Panorama")
  24678. , h = new a(i)
  24679. , u = e("./model/Model")
  24680. , d = e("./shaders")
  24681. , p = e("./util/transitions")
  24682. , f = e("./objects/Chunk")
  24683. , g = e("./objects/Reticule")
  24684. , m = e("./objects/Skybox")
  24685. , v = e("./objects/Floor")
  24686. , A = e("./cameras/DollhouseCamera")
  24687. , y = e("./cameras/FloorplanCamera")
  24688. , C = e("./cameras/PanoramaCamera")
  24689. , I = e("./controls/DollhouseControls")
  24690. , E = e("./controls/FloorplanControls")
  24691. , b = e("./controls/PanoramaControls");
  24692. n.ImageUtils.crossOrigin = o.crossOrigin,
  24693. t.exports = {
  24694. shaders: d,
  24695. transitions: p,
  24696. Model: u,
  24697. Chunk: f,
  24698. Floor: v,
  24699. Skybox: m,
  24700. Reticule: g,
  24701. Panorama: c,
  24702. DollhouseCamera: A,
  24703. FloorplanCamera: y,
  24704. PanoramaCamera: C,
  24705. DollhouseControls: I,
  24706. FloorplanControls: E,
  24707. PanoramaControls: b,
  24708. getModel: function(e) {
  24709. if (!e.url)
  24710. throw 'getModel(): missing parameter "url"';
  24711. e.autoload = void 0 === e.autoload || e.autoload;
  24712. var t = l.parseSidUrl(e.url);
  24713. e.urlBase = t.urlBase,
  24714. e.urlModel = t.urlModel,
  24715. e.urlFiles = t.urlFiles;
  24716. var i = this._getPlatformError();
  24717. return i ? $.Deferred().reject(i).promise() : (this.options = e,
  24718. this._loadModel().then(this._buildModel.bind(this)))
  24719. },
  24720. _getPlatformError: function() {
  24721. return "IE" === $.ua.browser.name && parseInt($.ua.browser.major) < 11 ? "webgl-unsupported" : "iOS" === $.ua.os.name && /^[0-7][$\.]/.test($.ua.os.version) ? "webgl-ios" : Modernizr.webgl ? null : "webgl-unsupported"
  24722. },
  24723. _loadModel: function() {
  24724. return r.get(this.options.urlModel, {
  24725. responseType: "json",
  24726. prefetchFrom: "model",
  24727. auth: l.getAuthorizationHeader()
  24728. }).then(null, function() {
  24729. return h.warn("Model loading failed at initial metadata load"),
  24730. "loading-failed"
  24731. })
  24732. },
  24733. _buildModel: function(e) {
  24734. e = l.normalizeModeldata(e, s);
  24735. var t = new u(this.options,e);
  24736. return this.options.autoload ? t.load(!0) : $.when(t)
  24737. }
  24738. }
  24739. }
  24740. ).call(this, "/js/showcase.js")
  24741. }
  24742. , {
  24743. "./cameras/DollhouseCamera": 5,
  24744. "./cameras/FloorplanCamera": 6,
  24745. "./cameras/PanoramaCamera": 7,
  24746. "./controls/DollhouseControls": 10,
  24747. "./controls/FloorplanControls": 11,
  24748. "./controls/PanoramaControls": 13,
  24749. "./model/Model": 139,
  24750. "./objects/Chunk": 144,
  24751. "./objects/Floor": 146,
  24752. "./objects/Panorama": 148,
  24753. "./objects/Reticule": 149,
  24754. "./objects/Skybox": 152,
  24755. "./settings": 166,
  24756. "./shaders": 167,
  24757. "./util/ajax": 181,
  24758. "./util/logger": 189,
  24759. "./util/math": 190,
  24760. "./util/showcase": 193,
  24761. "./util/transitions": 195,
  24762. three: 217,
  24763. url: 208
  24764. }],
  24765. 169: [function(e, t, i) {
  24766. "use strict";
  24767. function n() {
  24768. var e = {
  24769. renderTarget: null,
  24770. inUse: !1,
  24771. size: -1,
  24772. pano: null
  24773. };
  24774. return e
  24775. }
  24776. function r(e) {
  24777. M.push(e)
  24778. }
  24779. function o(e) {
  24780. var t = n();
  24781. return t.inUse = !0,
  24782. t.size = e,
  24783. r(t),
  24784. t
  24785. }
  24786. function a(e) {
  24787. for (var t = 0; t < M.length; t++) {
  24788. var i = M[t];
  24789. if (!i.inUse && i.size === e)
  24790. return i.inUse = !0,
  24791. i
  24792. }
  24793. return null
  24794. }
  24795. function s(e) {
  24796. for (var t = 0; t < M.length; t++) {
  24797. var i = M[t];
  24798. if (i.renderTarget === e)
  24799. return i.inUse = !1,
  24800. !0
  24801. }
  24802. return !1
  24803. }
  24804. function l() {
  24805. this.tileDirectory = {},
  24806. this.activeRenderTargetDescriptors = {},
  24807. this.activePanos = [],
  24808. this.panoLODDescriptors = {},
  24809. this.panoDescriptors = {},
  24810. this.tileTrees = {},
  24811. this.sceneRenderer = null,
  24812. this.tileDownloader = null,
  24813. this.forceQueue = [],
  24814. this.uploadQueues = {},
  24815. this.uploadInterval = null,
  24816. this.uploadIntervalCancelled = !1,
  24817. this.usingTileOverlay = !1,
  24818. this.overlayTilesLoaded = !1,
  24819. this.overlayTileBase = null,
  24820. this.overlayTilesBasic = {},
  24821. this.overlayTilesEnhanced = {},
  24822. this.zoomRenderTarget = null,
  24823. this.zoomPano = null,
  24824. this.zoomingActive = !1,
  24825. this.zoomPanoId = null,
  24826. this.zoomPanoRenderingDisabled = !1,
  24827. this.direction = new h.Vector3,
  24828. this.initTime = -1,
  24829. this.maxBaseUploadsPerFrame = x,
  24830. this.maxNonBaseUploadsPerFrame = T
  24831. }
  24832. function c() {
  24833. this.uploadIntervalCancelled || (this.overlayTilesLoaded || !this.usingTileOverlay ? (b = !0,
  24834. this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  24835. this.peekNextFromUploadQueue() ? this.refreshUploadInterval(w) : this.uploadInterval = null) : this.refreshUploadInterval(this.uploadIntervalDelay))
  24836. }
  24837. var h = e("three")
  24838. , u = e("../exception/BasicException")
  24839. , d = e("../settings")
  24840. , p = e("../enum/PanoSizeClass")
  24841. , f = (e("../objects/Panorama"),
  24842. e("../enum/PanoRendererEvents"))
  24843. , g = e("../enum/SceneRendererEvents")
  24844. , m = e("../enum/TileDownloaderEvents")
  24845. , v = e("../enum/Vectors")
  24846. , A = (e("../enum/GLCubeFaces"),
  24847. e("../objects/Panorama"),
  24848. e("./TileTree"))
  24849. , y = (e("./TileDownloader"),
  24850. e("./TilePrioritizer"))
  24851. , C = e("./TileUtils")
  24852. , p = e("../enum/PanoSizeClass")
  24853. , I = (e("../util/browser"),
  24854. e("../util/panorama"))
  24855. , E = e("events").EventEmitter
  24856. , b = !1
  24857. , w = d.tiling.uploadIntervalDelay
  24858. , _ = d.tiling.initialIntervalDelay
  24859. , T = d.tiling.maxNonBaseUploadsPerFrame
  24860. , x = d.tiling.maxBaseUploadsPerFrame
  24861. , S = {
  24862. Base: 0,
  24863. Remaining: 1
  24864. }
  24865. , M = [];
  24866. l.prototype = Object.create(E.prototype),
  24867. l.prototype.init = function(e, t, i) {
  24868. this.sceneRenderer = e,
  24869. this.tileDownloader = t,
  24870. this.qualityManager = i,
  24871. this.bindEvents(),
  24872. this.sceneRenderer.on(g.ContextCreated, this.loadOverlayTiles.bind(this)),
  24873. this.initTime = performance.now()
  24874. }
  24875. ,
  24876. l.prototype.getActivePanoTextures = function(e) {
  24877. e = e || [];
  24878. for (var t = 0; t < M.length; t++) {
  24879. var i = M[t];
  24880. i.renderTarget && i.renderTarget.texture && e.push(i.renderTarget.texture)
  24881. }
  24882. }
  24883. ,
  24884. l.prototype.hasQueuedTiles = function() {
  24885. var e = this.peekNextFromUploadQueue();
  24886. return null !== e && void 0 !== e
  24887. }
  24888. ,
  24889. l.prototype.getActiveRenderTargetDescriptor = function(e) {
  24890. return this.activeRenderTargetDescriptors[e]
  24891. }
  24892. ,
  24893. l.prototype.setActiveRenderTargetDescriptor = function(e, t) {
  24894. this.activeRenderTargetDescriptors[e] = t
  24895. }
  24896. ,
  24897. l.prototype.loadOverlayTiles = function() {
  24898. if (0 !== d.tiling.overlayStyle) {
  24899. var e = 0
  24900. , t = function(t, n, r) {
  24901. t = n ? t[n] = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping) : this.overlayTileBase = this.sceneRenderer.initSizedTexture2D(C.TILE_SIZE, h.ClampToEdgeWrapping),
  24902. this.sceneRenderer.uploadTexture2D(r, t, 0, 0, C.TILE_SIZE, C.TILE_SIZE),
  24903. e++,
  24904. e === i.length && (this.overlayTilesLoaded = !0)
  24905. }
  24906. .bind(this)
  24907. , i = [["images/outlineBase.png", t.bind(this, this.overlayTileBase, null)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 256)], ["images/outlineBasic512.png", t.bind(this, this.overlayTilesBasic, 512)], ["images/outlineBasic1024.png", t.bind(this, this.overlayTilesBasic, 1024)], ["images/outlineBasic2048.png", t.bind(this, this.overlayTilesBasic, 2048)], ["images/outlineBasic4096.png", t.bind(this, this.overlayTilesBasic, 4096)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 256)], ["images/outlineEnhanced512.png", t.bind(this, this.overlayTilesEnhanced, 512)], ["images/outlineEnhanced1024.png", t.bind(this, this.overlayTilesEnhanced, 1024)], ["images/outlineEnhanced2048.png", t.bind(this, this.overlayTilesEnhanced, 2048)], ["images/outlineEnhanced4096.png", t.bind(this, this.overlayTilesEnhanced, 4096)]];
  24908. i.forEach(function(e) {
  24909. this.tileDownloader.loadImage(e[0], 0, e[1])
  24910. }
  24911. .bind(this)),
  24912. this.usingTileOverlay = !0
  24913. } else
  24914. this.usingTileOverlay = !1
  24915. }
  24916. ,
  24917. l.prototype.bindEvents = function() {
  24918. this.tileDownloader.on(m.TileDownloadSuccess, this.onTileDownloaded.bind(this))
  24919. }
  24920. ,
  24921. l.prototype.setupZoomRenderTarget = function() {
  24922. if (this.qualityManager.getMaxZoomPanoSize() >= this.qualityManager.getMaxNavPanoSize()) {
  24923. if (this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize())
  24924. return;
  24925. var e = this.zoomRenderTarget;
  24926. if (this.zoomRenderTarget = this.initTiledPano(this.qualityManager.getMaxZoomPanoSize(), !1),
  24927. e) {
  24928. var t = e.width
  24929. , i = this.zoomRenderTarget.width;
  24930. this.sceneRenderer.copyCubeMap(e.texture, this.zoomRenderTarget, t, t, i, i),
  24931. e.texture.dispose(),
  24932. e.texture.loaded = !1,
  24933. e.texture.version = 0,
  24934. this.sceneRenderer.deallocateCubeTexture(e.texture),
  24935. e.texture = null
  24936. }
  24937. this.zoomPanoRenderingDisabled = !1
  24938. } else
  24939. this.zoomPanoRenderingDisabled = !0
  24940. }
  24941. ,
  24942. l.prototype.enableUltraHighQualityMode = function(e) {
  24943. if (!this.qualityManager.ultraHighQualityModeEnabled()) {
  24944. var t = this.qualityManager.getPanoSize(p.ULTRAHIGH);
  24945. this.tileDownloader.testDownload(t, C.TILE_SIZE, function(t) {
  24946. t && (this.qualityManager.enableUltraHighQualityMode(),
  24947. this.setupZoomRenderTarget(),
  24948. e())
  24949. }
  24950. .bind(this))
  24951. }
  24952. }
  24953. ,
  24954. l.prototype.activateTiledPano = function(e, t, i) {
  24955. i && this.clearAllQueuedUploads();
  24956. for (var n = 0; n < C.FACES_PER_PANO; n++)
  24957. this.initTileTree(e.id, n, this.qualityManager.getMaxPossiblePanoSize());
  24958. this.linkAllTilesAndNodes(e);
  24959. var r = this.getActiveRenderTargetDescriptor(e.id)
  24960. , l = t;
  24961. if (l > this.qualityManager.getMaxNavPanoSize() && (l = this.qualityManager.getMaxNavPanoSize()),
  24962. !r || l !== r.size) {
  24963. if (r && s(r.renderTarget),
  24964. r = a(l),
  24965. !r) {
  24966. var c = this.initTiledPano(l, !1);
  24967. r = o(c.width),
  24968. r.renderTarget = c
  24969. }
  24970. r.pano = e,
  24971. this.resetPanoDescriptor(e.id),
  24972. this.resetPanoLODDescriptors(e.id),
  24973. this.resetRenderStatus(e.id, !0, !0)
  24974. }
  24975. this.setActiveRenderTargetDescriptor(e.id, r);
  24976. var h = i ? 0 : 1;
  24977. return this.updateActivePanos(e, h),
  24978. r.renderTarget
  24979. }
  24980. ,
  24981. l.prototype.deactivateTiledPano = function(e) {
  24982. var t = this.getActiveRenderTargetDescriptor(e.id);
  24983. this.isRenderTargetDescriptorValid(t) && s(t.renderTarget),
  24984. this.setActiveRenderTargetDescriptor(e.id, null);
  24985. var i = this.getUploadQueueForPano(e.id);
  24986. this.clearUploadQueue(i),
  24987. this.updateActivePanos()
  24988. }
  24989. ,
  24990. l.prototype.updateActivePanos = function() {
  24991. var e = [];
  24992. return function(t, i) {
  24993. e.length = 0;
  24994. for (var n = 0; n < this.activePanos.length; n++) {
  24995. t && e.length === i && e.push(t);
  24996. var r = this.activePanos[n]
  24997. , o = this.getActiveRenderTargetDescriptor(r.id);
  24998. t && r.id === t.id || !this.isRenderTargetDescriptorValid(o) || e.push(r)
  24999. }
  25000. t && i >= e.length && e.push(t),
  25001. this.activePanos.length = 0,
  25002. this.activePanos.push.apply(this.activePanos, e)
  25003. }
  25004. }(),
  25005. l.prototype.getActivePanoCount = function() {
  25006. return this.activePanos.length
  25007. }
  25008. ,
  25009. l.prototype.resetRenderStatus = function(e, t, i, n) {
  25010. var r = null;
  25011. n && (r = A.getLevelCountForSize(C.TILE_SIZE, n) + 1);
  25012. for (var o = function(e, n, r, o) {
  25013. i && (n.tile.zoomUploaded = !1),
  25014. t && (n.tile.uploaded = !1)
  25015. }, a = 0; a < C.FACES_PER_PANO; a++) {
  25016. var s = this.getTileTree(e, a);
  25017. s.breadthFirst({
  25018. callback: o.bind(this, a),
  25019. minLevel: r
  25020. })
  25021. }
  25022. }
  25023. ,
  25024. l.prototype.copyBaseRenderStatusToZoomed = function(e) {
  25025. for (var t = A.getLevelCountForSize(C.TILE_SIZE, this.qualityManager.getMaxNavPanoSize()), i = function(e, t, i, n) {
  25026. t.tile.zoomUploaded = t.tile.uploaded,
  25027. t.zoomCovered = t.covered
  25028. }, n = 0; n < C.FACES_PER_PANO; n++) {
  25029. var r = this.getTileTree(e, n);
  25030. r.breadthFirst({
  25031. callback: i.bind(this, n),
  25032. maxLevel: t
  25033. })
  25034. }
  25035. }
  25036. ,
  25037. l.prototype.renderPanoTiles = function() {
  25038. var e = [];
  25039. return function(t, i, n, r) {
  25040. this.zoomRenderTarget && this.zoomRenderTarget.width === this.qualityManager.getMaxZoomPanoSize() || this.zoomPanoRenderingDisabled || this.setupZoomRenderTarget(),
  25041. i = i || this.direction || v.FORWARD;
  25042. var o = this.getActiveRenderTargetDescriptor(t);
  25043. if (!this.isRenderTargetDescriptorValid(o))
  25044. throw new u("PanoRenderer.renderPanoTiles() -> Cannot render to a pano that is not activated.");
  25045. for (var a = 0; a < C.FACES_PER_PANO; a++) {
  25046. var s = this.getTileTree(t, a);
  25047. e.length = 0,
  25048. s.breadthFirst({
  25049. saveVisited: e
  25050. });
  25051. for (var l = 0; l < e.length; l++) {
  25052. var c = e[l];
  25053. this.queueTileUpload(c.tile, !1, r || 0 === l && n)
  25054. }
  25055. }
  25056. this.updateDirection(i)
  25057. }
  25058. }(),
  25059. l.prototype.isRenderTargetDescriptorValid = function(e) {
  25060. return e && e.renderTarget
  25061. }
  25062. ,
  25063. l.prototype.isPanoActive = function(e) {
  25064. var t = this.getActiveRenderTargetDescriptor(e);
  25065. return this.isRenderTargetDescriptorValid(t)
  25066. }
  25067. ,
  25068. l.prototype.isPanoZoomed = function(e) {
  25069. return this.zoomingActive && this.zoomPanoId === e
  25070. }
  25071. ,
  25072. l.prototype.initTileTree = function(e, t, i) {
  25073. var n = this.tileTrees[e];
  25074. n || (n = [],
  25075. this.tileTrees[e] = n);
  25076. var r = n[t];
  25077. if (!r) {
  25078. var o = A.getLevelCountForSize(C.TILE_SIZE, i);
  25079. r = new A(C.TILE_SIZE,o),
  25080. n[t] = r
  25081. }
  25082. }
  25083. ,
  25084. l.prototype.getTileTree = function(e, t) {
  25085. var i = this.tileTrees[e];
  25086. if (!i)
  25087. throw new u("PanoRenderer.getTileTree() -> Tree array not yet initialized!");
  25088. var n = i[t];
  25089. if (!n)
  25090. throw new u("PanoRenderer.getTileTree() -> Tree not yet initialized!");
  25091. return n
  25092. }
  25093. ,
  25094. l.prototype.initTiledPano = function(e, t) {
  25095. var i = this.sceneRenderer.renderer
  25096. , n = (i.context,
  25097. new h.WebGLRenderTargetCube(e,e,{
  25098. stencilBuffer: !1
  25099. }))
  25100. , r = new h.CubeTexture([]);
  25101. n.texture = r,
  25102. r.image = [null, null, null, null, null, null],
  25103. r.flipY = !0,
  25104. t ? (r.generateMipmaps = !0,
  25105. r.magFilter = h.LinearFilter,
  25106. r.minFilter = h.LinearMipMapLinearFilter) : (r.generateMipmaps = !1,
  25107. r.magFilter = h.LinearFilter,
  25108. r.minFilter = h.LinearFilter),
  25109. r.format = h.RGBAFormat,
  25110. i.setRenderTarget(n),
  25111. i.setRenderTarget(null);
  25112. var o = i.properties.get(r);
  25113. return o.__image__webglTextureCube = o.__webglTexture,
  25114. n
  25115. }
  25116. ,
  25117. l.prototype.getUploadQueueForPano = function(e) {
  25118. var t = this.uploadQueues[e];
  25119. return t || (t = [],
  25120. this.uploadQueues[e] = t),
  25121. t
  25122. }
  25123. ,
  25124. l.prototype.isTileUploaded = function(e) {
  25125. return this.isPanoZoomed(e.panoId) ? e.zoomUploaded : e.uploaded
  25126. }
  25127. ,
  25128. l.prototype.setUploaded = function(e, t) {
  25129. this.isPanoZoomed(e.panoId) ? e.zoomUploaded = t : e.uploaded = t
  25130. }
  25131. ,
  25132. l.prototype.queueTileUpload = function(e, t, i) {
  25133. var n = this.getActiveRenderTargetDescriptor(e.panoId);
  25134. if (this.isRenderTargetDescriptorValid(n) && e.downloaded && !this.isTileUploaded(e) && (!e.uploadQueued || i) && (!(e.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive)) {
  25135. var r = this.getUploadQueueForPano(e.panoId);
  25136. i ? this.uploadTile(e, !1) : (this.shoulPushToFrontOfQueue(e) ? this.forceQueue.push(e) : t && this.direction ? y.insertSortedPanoTile(r, e, n.pano, this.direction) : r.push(e),
  25137. e.uploadQueued = !0,
  25138. this.uploadInterval || this.uploadIntervalCancelled || this.refreshUploadInterval(0))
  25139. }
  25140. }
  25141. ,
  25142. l.prototype.shoulPushToFrontOfQueue = function(e) {
  25143. return 0 === A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25144. }
  25145. ,
  25146. l.prototype.getTopUploadQueue = function() {
  25147. for (var e = null, t = null, i = S.Base; i <= S.Remaining; i++)
  25148. for (var n = 0; n < this.activePanos.length; n++)
  25149. if (e = this.activePanos[n],
  25150. t = this.getUploadQueueForPano(e.id),
  25151. t.length > 0)
  25152. switch (i) {
  25153. case S.Base:
  25154. if (0 === t[0].level)
  25155. return t;
  25156. break;
  25157. case S.Remaining:
  25158. return t
  25159. }
  25160. return null
  25161. }
  25162. ,
  25163. l.prototype.getNextFromUploadQueue = function() {
  25164. var e = function(e) {
  25165. var t = e.shift();
  25166. return t.uploadQueued = !1,
  25167. t
  25168. };
  25169. return function() {
  25170. if (this.forceQueue.length > 0)
  25171. return e(this.forceQueue);
  25172. var t = this.getTopUploadQueue();
  25173. return t && t.length > 0 ? e(t) : null
  25174. }
  25175. }(),
  25176. l.prototype.peekNextFromUploadQueue = function() {
  25177. if (this.forceQueue.length > 0)
  25178. return this.forceQueue[0];
  25179. var e = this.getTopUploadQueue();
  25180. return e && e.length > 0 ? e[0] : null
  25181. }
  25182. ,
  25183. l.prototype.clearAllQueuedUploads = function() {
  25184. this.clearAllUploadQueues(null, 0)
  25185. }
  25186. ,
  25187. l.prototype.clearAllQueuedUploadsForPano = function(e) {
  25188. this.clearAllUploadQueues(e, 0)
  25189. }
  25190. ,
  25191. l.prototype.clearAllUploadQueues = function(e, t) {
  25192. if (e)
  25193. this.clearUploadQueue(this.getUploadQueueForPano(e), t),
  25194. this.clearUploadQueue(this.forceQueue, t, e);
  25195. else {
  25196. for (var i = 0; i < this.activePanos.length; i++) {
  25197. var n = this.activePanos[i];
  25198. this.clearUploadQueue(this.getUploadQueueForPano(n.id), t)
  25199. }
  25200. this.clearUploadQueue(this.forceQueue, t)
  25201. }
  25202. }
  25203. ,
  25204. l.prototype.clearUploadQueue = function(e, t, i) {
  25205. void 0 !== t && null !== t || (t = 0);
  25206. for (var n = 0; n < e.length; ) {
  25207. var r = e[n];
  25208. (!i || i && i === r.tile.panoId) && r.level >= t ? (r.uploadQueued = !1,
  25209. e.splice(n, 1)) : n++
  25210. }
  25211. }
  25212. ,
  25213. l.prototype.refreshUploadInterval = function() {
  25214. var e = null;
  25215. return function(t) {
  25216. this.uploadIntervalCancelled || (e || (e = c.bind(this)),
  25217. null !== t && void 0 !== t || (t = w),
  25218. b || (t = _),
  25219. this.uploadInterval = window.setTimeout(e, t),
  25220. this.uploadIntervalDelay = t)
  25221. }
  25222. }(),
  25223. l.prototype.update = function() {
  25224. var e = performance.now()
  25225. , t = 0;
  25226. return function() {
  25227. this.uploadIntervalCancelled = !0,
  25228. window.clearTimeout(this.uploadInterval),
  25229. this.uploadInterval = null;
  25230. var i = performance.now() - e;
  25231. !(i > w || 0 === t) || !this.overlayTilesLoaded && this.usingTileOverlay || (this.updateUploadQueue(this.maxNonBaseUploadsPerFrame, this.maxBaseUploadsPerFrame),
  25232. e = performance.now()),
  25233. t++
  25234. }
  25235. }(),
  25236. l.prototype.updateUploadQueue = function(e, t) {
  25237. e || (e = 1);
  25238. for (var i = 0, n = 0; ; ) {
  25239. if (n >= t || i >= e)
  25240. break;
  25241. var r = this.getNextFromUploadQueue();
  25242. if (!r)
  25243. break;
  25244. if (0 !== r.level ? i++ : n++,
  25245. !(r.panoSize > this.qualityManager.getMaxNavPanoSize()) || this.zoomingActive) {
  25246. var o = this.getActiveRenderTargetDescriptor(r.panoId);
  25247. this.isRenderTargetDescriptorValid(o) && this.uploadTile(r, r.forceUpload)
  25248. }
  25249. }
  25250. }
  25251. ,
  25252. l.prototype.updateDirection = function(e) {
  25253. if (e = e || this.direction) {
  25254. this.direction = e;
  25255. for (var t = 0; t < this.activePanos.length; t++) {
  25256. var i = this.activePanos[t]
  25257. , n = this.getUploadQueueForPano(i.id);
  25258. y.sortPanoTiles(n, i, this.direction)
  25259. }
  25260. }
  25261. }
  25262. ,
  25263. l.prototype.uploadTile = function() {
  25264. var e = {}
  25265. , t = (new h.Vector4,
  25266. d.tiling.overlayStyle);
  25267. return function(i, n) {
  25268. var r = i.panoId
  25269. , o = i.image
  25270. , a = i.tileSize
  25271. , s = i.panoSize
  25272. , l = i.tileIndex
  25273. , c = (i.faceTileIndex,
  25274. i.totalTiles)
  25275. , u = (i.face,
  25276. i.tileX)
  25277. , d = i.tileY
  25278. , p = !0
  25279. , g = !1
  25280. , m = (this.getPanoDescriptor(r),
  25281. this.getPanoLODDescriptor(r, s))
  25282. , v = this.getActiveRenderTargetDescriptor(r)
  25283. , A = v.renderTarget
  25284. , y = v.size;
  25285. if (this.isPanoZoomed(r) && (A = this.zoomRenderTarget,
  25286. y = this.qualityManager.getMaxZoomPanoSize()),
  25287. this.isRenderTargetDescriptorValid(v) || (p = !1,
  25288. g = !1),
  25289. n || (this.anyUploaded(i.node) && (p = !1,
  25290. g = !0),
  25291. this.isTileUploaded(i) && (p = !1,
  25292. g = !1)),
  25293. p) {
  25294. var C = u * a
  25295. , I = d * a
  25296. , E = a / s * y
  25297. , b = C / s * y
  25298. , w = I / s * y;
  25299. e[a] || (e[a] = this.sceneRenderer.initSizedTexture2D(a, h.ClampToEdgeWrapping));
  25300. var _ = e[a];
  25301. if (this.sceneRenderer.uploadTexture2D(o, _, 0, 0, a, a),
  25302. 1 === t || 2 === t) {
  25303. var T = 1 === t ? this.overlayTilesBasic : this.overlayTilesEnhanced;
  25304. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace),
  25305. this.sceneRenderer.renderToCubeMap(T[s], A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace, h.NormalBlending, !0, .5)
  25306. } else
  25307. this.sceneRenderer.renderToCubeMap(_, A, a, a, 0, 0, a, a, b, w, E, E, i.cubeFace);
  25308. m.uploadCount++,
  25309. this.emit(f.TileRenderSuccess, r, s, l, c),
  25310. m.uploadCount === c && this.emit(f.PanoRenderComplete, r, s, c),
  25311. this.setUploaded(i, !0),
  25312. this.addCoverageForNode(i.node)
  25313. } else
  25314. this.setUploaded(i, !1);
  25315. return i.uploadAttempted || (m.uploadAttempts++,
  25316. this.emit(f.TileUploadAttempted, r, s, l, c)),
  25317. i.uploadAttempted = !0,
  25318. m.uploadAttempts === c && this.emit(f.UploadAttemptedForAllTiles, r, s, c),
  25319. g
  25320. }
  25321. }(),
  25322. l.prototype.linkTileAndNode = function(e, t) {
  25323. t.tile = e,
  25324. e.node = t
  25325. }
  25326. ,
  25327. l.prototype.linkAllTilesAndNodes = function(e) {
  25328. for (var t = function(t, i, n, r, o) {
  25329. var a = this.getTileDirectoryEntry(e.id, i, r, o);
  25330. this.linkTileAndNode(a, n)
  25331. }, i = 0; i < C.FACES_PER_PANO; i++) {
  25332. var n = this.getTileTree(e.id, i);
  25333. n.breadthFirst({
  25334. callback: t.bind(this, n, i)
  25335. })
  25336. }
  25337. }
  25338. ,
  25339. l.prototype.anyUploaded = function(e) {
  25340. if (!e)
  25341. return !1;
  25342. if (e.tile && this.isTileUploaded(e.tile))
  25343. return !0;
  25344. if (e.children)
  25345. for (var t = 0; t < e.children.length; t++) {
  25346. var i = e.children[t];
  25347. if (this.anyUploaded(i))
  25348. return !0
  25349. }
  25350. return !1
  25351. }
  25352. ,
  25353. l.prototype.setNodeCovered = function(e, t) {
  25354. this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered = t : e.covered = t
  25355. }
  25356. ,
  25357. l.prototype.isNodeCovered = function(e) {
  25358. return !!e && (this.isPanoZoomed(e.tile.panoId) ? e.zoomCovered : e.covered)
  25359. }
  25360. ,
  25361. l.prototype.addCoverageForNode = function(e) {
  25362. if (this.setNodeCovered(e, !0),
  25363. e.parent && e.covered) {
  25364. var t = e.parent;
  25365. this.nodeSubcovered(t) && this.addCoverageForNode(t, !0)
  25366. }
  25367. }
  25368. ,
  25369. l.prototype.calcFullCoverage = function(e) {
  25370. var t = !1;
  25371. if (e.children)
  25372. for (var i = 0; i < e.children.length; i++) {
  25373. var n = e.children[i];
  25374. t = t || this.calcFullCoverage(n)
  25375. }
  25376. e.covered = e.tile.uploaded || t
  25377. }
  25378. ,
  25379. l.prototype.nodeSubcovered = function(e) {
  25380. if (!e.children)
  25381. return !1;
  25382. for (var t = 0; t < e.children.length; t++)
  25383. if (!e.children[t] || !this.isNodeCovered(e.children[t]))
  25384. return !1;
  25385. return !0
  25386. }
  25387. ,
  25388. l.prototype.resetPanoDescriptor = function(e) {
  25389. this.getPanoDescriptor(e)
  25390. }
  25391. ,
  25392. l.prototype.getPanoDescriptor = function(e) {
  25393. var t = this.panoDescriptors[e];
  25394. return t || (t = {},
  25395. this.panoDescriptors[e] = t),
  25396. t
  25397. }
  25398. ,
  25399. l.prototype.resetPanoLODDescriptors = function(e) {
  25400. var t = this.getPanoLODDescriptors(e);
  25401. for (var i in t)
  25402. if (t.hasOwnProperty(i)) {
  25403. var n = t[i];
  25404. n.uploadCount = 0,
  25405. n.uploadAttempts = 0
  25406. }
  25407. }
  25408. ,
  25409. l.prototype.getPanoLODDescriptor = function(e, t) {
  25410. var i = this.getPanoLODDescriptors(e)
  25411. , n = i[t];
  25412. return n || (n = {
  25413. uploadCount: 0,
  25414. uploadAttempts: 0
  25415. },
  25416. i[t] = n),
  25417. n
  25418. }
  25419. ,
  25420. l.prototype.getPanoLODDescriptors = function(e) {
  25421. var t = this.panoLODDescriptors[e];
  25422. return t || (t = {},
  25423. this.panoLODDescriptors[e] = t),
  25424. t
  25425. }
  25426. ,
  25427. l.prototype.onTileDownloaded = function(e) {
  25428. var t = A.getLevelCountForSize(C.TILE_SIZE, e.panoSize)
  25429. , i = this.getTileDirectoryEntry(e.panoId, e.face, t, e.faceTileIndex);
  25430. if (i.downloaded = !0,
  25431. i.image = e.image,
  25432. i.panoSize = e.panoSize,
  25433. i.tileX = e.tileX,
  25434. i.tileY = e.tileY,
  25435. i.totalTiles = e.totalTiles,
  25436. i.tileIndex = e.tileIndex,
  25437. i.faceTileIndex = e.faceTileIndex,
  25438. i.face = e.face,
  25439. i.cubeFace = I.mapFaceToCubemapFace(e.face),
  25440. i.panoId = e.panoId,
  25441. i.tileSize = e.tileSize,
  25442. i.direction = (new h.Vector3).copy(e.direction),
  25443. i.node = null,
  25444. i.level = A.getLevelCountForSize(C.TILE_SIZE, i.panoSize),
  25445. this.isPanoActive(i.panoId)) {
  25446. var n = this.getTileTree(i.panoId, i.face)
  25447. , r = n.getSubNode(i.panoSize, i.tileX, i.tileY);
  25448. this.linkTileAndNode(i, r),
  25449. this.queueTileUpload(i, !0)
  25450. }
  25451. }
  25452. ,
  25453. l.prototype.getTileDirectoryEntry = function(e, t, i, n) {
  25454. var r = this.tileDirectory[e];
  25455. r || (r = {},
  25456. this.tileDirectory[e] = r);
  25457. var o = 16384 * t + 1024 * i + n
  25458. , a = r[o];
  25459. return a || (a = {
  25460. downloaded: !1,
  25461. uploaded: !1,
  25462. zoomUploaded: !1
  25463. },
  25464. r[o] = a),
  25465. a._key = e + ":" + t + ":" + i + ":" + n,
  25466. a._tileKey = o,
  25467. a
  25468. }
  25469. ,
  25470. l.prototype.setZoomingActive = function(e, t, i) {
  25471. this.zoomPanoRenderingDisabled || e === this.zoomingActive && this.zoomPanoId === t.id || (this.zoomingActive = e,
  25472. this.zoomPanoId = t.id,
  25473. this.zoomingActive && (this.zoomPanoId !== t.id || i) && this.updateZoomedPanoFromBase(t))
  25474. }
  25475. ,
  25476. l.prototype.updateZoomedPanoFromBase = function(e) {
  25477. if (!this.zoomPanoRenderingDisabled) {
  25478. var t = this.getActiveRenderTargetDescriptor(e.id);
  25479. if (t && t.renderTarget) {
  25480. var i = this.qualityManager.getMaxZoomPanoSize()
  25481. , n = t.renderTarget
  25482. , r = t.size;
  25483. this.sceneRenderer.copyCubeMap(n.texture, this.zoomRenderTarget, r, r, i, i),
  25484. this.copyBaseRenderStatusToZoomed(e.id)
  25485. }
  25486. }
  25487. }
  25488. ,
  25489. t.exports = l
  25490. }
  25491. , {
  25492. "../enum/GLCubeFaces": 25,
  25493. "../enum/PanoRendererEvents": 35,
  25494. "../enum/PanoSizeClass": 36,
  25495. "../enum/SceneRendererEvents": 43,
  25496. "../enum/TileDownloaderEvents": 45,
  25497. "../enum/Vectors": 50,
  25498. "../exception/BasicException": 55,
  25499. "../objects/Panorama": 148,
  25500. "../settings": 166,
  25501. "../util/browser": 182,
  25502. "../util/panorama": 191,
  25503. "./TileDownloader": 171,
  25504. "./TilePrioritizer": 172,
  25505. "./TileTree": 173,
  25506. "./TileUtils": 174,
  25507. events: 202,
  25508. three: 217
  25509. }],
  25510. 170: [function(e, t, i) {
  25511. "use strict";
  25512. function n(e, t, i) {
  25513. this.maxNavPanoSize = -1,
  25514. this.maxZoomPanoSize = -1,
  25515. this.devicePixelDensity = e,
  25516. this.deviceScreenSize = t,
  25517. this.clientBandwidth = i,
  25518. this.panoSizeClassMap = {},
  25519. this.useHighResolutionPanos = !0,
  25520. this.useUltraHighResolutionPanos = !1,
  25521. this.modelHasUltraHighPanos = !1
  25522. }
  25523. var r = e("../enum/PanoSizeClass")
  25524. , o = e("../settings")
  25525. , a = e("../util/browser")
  25526. , s = e("../constants")
  25527. , l = e("../util/showcase")
  25528. , c = e("../enum/ModelManagerEvents");
  25529. n.prototype.init = function(e) {
  25530. this.buildPanoSizeClassMap(this.devicePixelDensity, this.deviceScreenSize, this.clientBandwidth),
  25531. this.ultraHighSize = this.getPanoSize(r.ULTRAHIGH),
  25532. this.highSize = this.getPanoSize(r.HIGH),
  25533. this.standardSize = this.getPanoSize(r.STANDARD),
  25534. this.baseSize = this.getPanoSize(r.BASE),
  25535. o.tiling.maxZoomPanoQuality && this.ultraHighSize <= o.tiling.maxZoomPanoQuality && (o.tiling.allowUltraHighResolution = !0),
  25536. this.highQualityThreshold = a.valueFromHash("threshold2k", s.windowHeightHighQualityThreshold),
  25537. this.updateMaximums(),
  25538. e.on(c.ActiveModelChanged, this.onModelChanged.bind(this))
  25539. }
  25540. ,
  25541. n.prototype.updateFromModel = function(e) {
  25542. this.updateHighResolutionSettings(e),
  25543. this.updateUltraHighResolutionSettings(e)
  25544. }
  25545. ,
  25546. n.prototype.updateHighResolutionSettings = function(e) {
  25547. //---------------------许钟文---------原始的会判断modeldata里version,以致useHighResolutionPanos为false,所以我直接变为true啦----------------------------------
  25548. //l.modelDataPromisesTiles(e.data) ? this.useHighResolutionPanos = !0 : this.useHighResolutionPanos = !1,
  25549. this.useHighResolutionPanos = !0;
  25550. //----------------------e n d -----------------------------------------------------------------
  25551. this.updateMaximums()
  25552. }
  25553. ,
  25554. n.prototype.updateUltraHighResolutionSettings = function(e) {
  25555. o.tiling.allowUltraHighResolution && this.modelHasUltraHighPanos ? this.useUltraHighResolutionPanos = !0 : this.useUltraHighResolutionPanos = !1,
  25556. this.updateMaximums()
  25557. }
  25558. ,
  25559. n.prototype.enableUltraHighQualityMode = function() {
  25560. this.modelHasUltraHighPanos = !0,
  25561. this.updateUltraHighResolutionSettings(null)
  25562. }
  25563. ,
  25564. n.prototype.ultraHighQualityModeEnabled = function() {
  25565. return this.modelHasUltraHighPanos
  25566. }
  25567. ,
  25568. n.prototype.onModelChanged = function(e) {
  25569. this.updateFromModel(e.model),
  25570. this.updateMaximums()
  25571. }
  25572. ,
  25573. n.prototype.updateMaximums = function() {
  25574. this.maxNavPanoSize = o.tiling.maxNavPanoQuality || this.detectMaxNavPanoSize(),
  25575. this.maxZoomPanoSize = o.tiling.maxZoomPanoQuality || this.detectMaxZoomPanoSize(),
  25576. this.maxZoomPanoSize < this.maxNavPanoSize && (this.maxNavPanoSize = this.maxZoomPanoSize)
  25577. }
  25578. ,
  25579. n.prototype.buildPanoSizeClassMap = function() {
  25580. this.panoSizeClassMap[r.BASE] = 512,
  25581. this.panoSizeClassMap[r.STANDARD] = 1024,
  25582. this.panoSizeClassMap[r.HIGH] = 2048,
  25583. this.panoSizeClassMap[r.ULTRAHIGH] = 4096
  25584. }
  25585. ,
  25586. n.prototype.getPanoSize = function(e) {
  25587. return this.panoSizeClassMap[e]
  25588. }
  25589. ,
  25590. n.prototype.getMaxPossiblePanoSize = function() {
  25591. return this.getPanoSize(r.ULTRAHIGH)
  25592. }
  25593. ,
  25594. n.prototype.getMaxPanoSize = function() {
  25595. return this.maxZoomPanoSize
  25596. }
  25597. ,
  25598. n.prototype.getMaxNavPanoSize = function() {
  25599. return this.maxNavPanoSize
  25600. }
  25601. ,
  25602. n.prototype.getMaxZoomPanoSize = function() {
  25603. return this.maxZoomPanoSize
  25604. }
  25605. ,
  25606. n.prototype.detectMaxNavPanoSizeClass = function() {
  25607. return this.useHighResolutionPanos ? a.isMobile() ? r.STANDARD : $("#player").height() < this.highQualityThreshold ? r.STANDARD : r.HIGH : r.STANDARD
  25608. }
  25609. ,
  25610. n.prototype.detectMaxNavPanoSize = function() {
  25611. var e = this.detectMaxNavPanoSizeClass();
  25612. return this.getPanoSize(e)
  25613. }
  25614. ,
  25615. n.prototype.detectMaxZoomPanoSize = function() {
  25616. 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)
  25617. }
  25618. ,
  25619. t.exports = n
  25620. }
  25621. , {
  25622. "../constants": 8,
  25623. "../enum/ModelManagerEvents": 33,
  25624. "../enum/PanoSizeClass": 36,
  25625. "../settings": 166,
  25626. "../util/browser": 182,
  25627. "../util/showcase": 193
  25628. }],
  25629. 171: [function(e, t, i) {
  25630. (function(i) {
  25631. "use strict";
  25632. function n(e) {
  25633. this.panos = null,
  25634. this.retryMinimumTime = 1e4,
  25635. this.urls = null,
  25636. this.panoLoadCallbacks = {},
  25637. this.downloadDescriptors = {},
  25638. this.priorityQueue = [],
  25639. this.forceQueue = [],
  25640. this.activeDownloads = [],
  25641. this.qualityManager = null,
  25642. this.tilePrioritizer = null,
  25643. this.refreshInterval = null,
  25644. this.processPriorityQueue = !1,
  25645. this.concurrentDownloads = e.concurrentDownloads || 1,
  25646. this.downloadTestResults = {}
  25647. }
  25648. var r = e("three")
  25649. , o = (e("../enum/Viewmode"),
  25650. e("../settings"))
  25651. , a = (e("../objects/Panorama"),
  25652. e("../util/logger"))
  25653. , s = (e("../enum/Vectors"),
  25654. e("../enum/PanoSizeClass"),
  25655. e("../enum/TileDownloaderEvents"))
  25656. , l = e("./TilePrioritizer")
  25657. , c = e("./TileUtils")
  25658. , h = (e("../enum/GLCubeFaces"),
  25659. e("../enum/DownloadStatus"))
  25660. , u = e("../util/panorama")
  25661. , d = e("../util/ajax")
  25662. , p = e("../ab")
  25663. , f = e("events").EventEmitter
  25664. , g = (new a(i),
  25665. Object.freeze({
  25666. Testing: 1,
  25667. Success: 2,
  25668. Fail: 3
  25669. }));
  25670. n.prototype = Object.create(f.prototype),
  25671. n.IDLE_REFRESH_DELAY = 500,
  25672. n.ACTIVE_REFRESH_DELAY = 16,
  25673. n.DOWNLOAD_RETRIES = 4,
  25674. n.prototype.init = function(e) {
  25675. this.qualityManager = e
  25676. }
  25677. ,
  25678. n.prototype.setUrls = function(e) {
  25679. this.urls = e
  25680. }
  25681. ,
  25682. n.prototype.setPanoData = function(e, t, i) {
  25683. this.panos = e,
  25684. this.imagePanos = t,
  25685. this.panoGroupId = i
  25686. }
  25687. ,
  25688. n.prototype.start = function() {
  25689. this.refreshUpdateInterval(0)
  25690. }
  25691. ,
  25692. n.prototype.stop = function() {
  25693. window.cancel(this.refreshInterval)
  25694. }
  25695. ,
  25696. n.prototype.refreshUpdateInterval = function(e) {
  25697. e || (e = 0),
  25698. this.refreshInterval = window.setTimeout(function() {
  25699. var e = this.update();
  25700. e ? this.refreshUpdateInterval(n.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(n.IDLE_REFRESH_DELAY)
  25701. }
  25702. .bind(this), e)
  25703. }
  25704. ,
  25705. n.prototype.update = function() {
  25706. var e = this.forceQueue.length > 0;
  25707. return this.processQueueForDownloading(this.forceQueue),
  25708. this.processPriorityQueue && (this.queuePrioritizedTilesForPanos(this.panos),
  25709. this.priorityQueue.length > 0 && (e = !0),
  25710. this.processQueueForDownloading(this.priorityQueue)),
  25711. e
  25712. }
  25713. ,
  25714. n.prototype.forceQueueTilesForPano = function() {
  25715. var e = []
  25716. , t = [];
  25717. return function(i, n, r, o, a, s) {
  25718. e.length = 0;
  25719. for (var u = this.getTileDownloadDescriptors(i, n), d = 0; d < u.length; d++) {
  25720. var p = u[d];
  25721. p.status !== h.None && p.status !== h.Queued || e.push(p)
  25722. }
  25723. if (r && e.length > 0) {
  25724. l.sortPanoTiles(e, i, r),
  25725. t.length = 0,
  25726. c.matchingTilesInDirection(i, n, r, o, a, t);
  25727. for (var f = 0, g = function(e) {
  25728. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  25729. }; f < e.length; ) {
  25730. var m = e[f]
  25731. , v = t.findIndex(g);
  25732. v < 0 ? e.splice(f, 1) : f++
  25733. }
  25734. }
  25735. for (var A = 0; A < e.length; A++)
  25736. this.forceQueue.push(e[A]);
  25737. this.setStatusForAllDescriptors(this.forceQueue, h.ForceQueued),
  25738. this.clearFromQueue(this.priorityQueue, h.ForceQueued, !1),
  25739. s && this.processQueueForDownloading(this.forceQueue, !0)
  25740. }
  25741. }(),
  25742. n.prototype.clearForceQueue = function() {
  25743. this.clearQueue(this.forceQueue)
  25744. }
  25745. ,
  25746. n.prototype.queuePrioritizedTilesForPanos = function(e) {
  25747. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  25748. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  25749. this.clearFromQueue(this.priorityQueue, h.None, !0),
  25750. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, h.Queued))
  25751. }
  25752. ,
  25753. n.prototype.clearQueue = function(e) {
  25754. this.setStatusForAllDescriptors(e, h.None),
  25755. e.length = 0
  25756. }
  25757. ,
  25758. n.prototype.clearFromQueue = function(e, t, i) {
  25759. for (var n = 0; n < e.length; n++) {
  25760. var r = e[n];
  25761. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  25762. }
  25763. }
  25764. ,
  25765. n.prototype.setStatusForAllDescriptors = function(e, t) {
  25766. for (var i = 0; i < e.length; i++) {
  25767. var n = e[i];
  25768. n && (n.status = t)
  25769. }
  25770. }
  25771. ,
  25772. n.prototype.setStatusOrRemoveForAllDescriptors = function(e, t) {
  25773. for (var i = 0; i < e.length; i++) {
  25774. var n = e[i];
  25775. n && (n.status !== t ? n.status = t : e[i] = null)
  25776. }
  25777. }
  25778. ,
  25779. n.prototype.getTileDownloadDescriptors = function(e, t) {
  25780. var i = this.getAllTileDownloadDescriptorsForPano(e)
  25781. , n = i[t];
  25782. return n || (n = this.buildDownloadDescriptorArray(t),
  25783. i[t] = n,
  25784. this.initTileDownloadDescriptors(n, e, t)),
  25785. n
  25786. }
  25787. ,
  25788. n.prototype.getAllTileDownloadDescriptorsForPano = function(e) {
  25789. var t = this.downloadDescriptors[e.id];
  25790. return t || (t = {},
  25791. this.downloadDescriptors[e.id] = t),
  25792. t
  25793. }
  25794. ,
  25795. n.prototype.processQueueForDownloading = function(e, t) {
  25796. if (this.cleanupActiveDownloads(),
  25797. this.activeDownloads.length < this.concurrentDownloads || t)
  25798. for (var i = t ? e.length : this.concurrentDownloads - this.activeDownloads.length, n = 0, r = 0; n < i && e.length > 0; r++) {
  25799. var o = e.shift();
  25800. o && (this.startDownload(o),
  25801. n++)
  25802. }
  25803. }
  25804. ,
  25805. n.prototype.testDownload = function(e, t, i) {
  25806. var n = this.downloadTestResults[e];
  25807. if (n)
  25808. return void (n === g.Success ? i(!0) : n === g.Fail && i(!1));
  25809. this.downloadTestResults[e] = g.Testing;
  25810. var r = this.panos.list[0]
  25811. , o = this.getTileUrl(r.id, e, t, 0)
  25812. , a = function(t) {
  25813. this.downloadTestResults[e] = g.Success,
  25814. i(!0)
  25815. }
  25816. .bind(this)
  25817. , s = function() {
  25818. this.downloadTestResults[e] = g.Fail,
  25819. i(!1)
  25820. }
  25821. .bind(this);
  25822. this.loadImage(o, 0, a, s)
  25823. }
  25824. ,
  25825. n.prototype.startDownload = function(e) {
  25826. e.status = h.Downloading;
  25827. var t = this.getTileUrl(e.pano.id, e.panoSize, e.tileSize, e.tileIndex);
  25828. this.activeDownloads.push(e),
  25829. this.loadImage(t, n.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  25830. }
  25831. ,
  25832. n.prototype.downloadFailed = function(e, t) {}
  25833. ,
  25834. n.prototype.downloadComplete = function(e, t) {
  25835. if (e.panoGroupId === this.panoGroupId) {
  25836. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  25837. e.status = h.Downloaded,
  25838. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  25839. var n = {
  25840. panoId: e.pano.id,
  25841. image: t,
  25842. tileSize: e.tileSize,
  25843. panoSize: e.panoSize,
  25844. tileIndex: e.tileIndex,
  25845. faceTileIndex: e.faceTileIndex,
  25846. totalTiles: e.totalTiles,
  25847. face: e.face,
  25848. tileX: e.tileX,
  25849. tileY: e.tileY,
  25850. direction: e.direction
  25851. };
  25852. e.image = t,
  25853. this.emit(s.TileDownloadSuccess, n),
  25854. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  25855. panoId: e.pano.id,
  25856. tileSize: e.tileSize,
  25857. panoSize: e.panoSize
  25858. },
  25859. this.emit(s.PanoDownloadComplete, n),
  25860. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  25861. }
  25862. }
  25863. ,
  25864. n.prototype.cleanupActiveDownloads = function() {
  25865. var e = [];
  25866. return function() {
  25867. e.length = 0;
  25868. for (var t = 0; t < this.activeDownloads.length; t++) {
  25869. var i = this.activeDownloads[t];
  25870. i.status !== h.Downloaded && i.status !== h.Failed && e.push(i)
  25871. }
  25872. this.activeDownloads.length = 0,
  25873. this.activeDownloads.push.apply(this.activeDownloads, e)
  25874. }
  25875. }(),
  25876. n.prototype.isPanoDownloaded = function(e, t) {
  25877. var i = this.getTileDownloadDescriptors(e, t);
  25878. if (i.length <= 0)
  25879. return !1;
  25880. for (var n = 0; n < i.length; n++) {
  25881. var r = i[n];
  25882. if (r.status !== h.Downloaded)
  25883. return !1
  25884. }
  25885. return !0
  25886. }
  25887. ,
  25888. n.prototype.setPanoLoadCallbacks = function(e, t, i, n, r) {
  25889. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  25890. this.panoLoadCallbacks[o] = {
  25891. onLoad: i,
  25892. onFail: n,
  25893. onProgress: r
  25894. }
  25895. }
  25896. ,
  25897. n.prototype.getPanoLoadCallbacks = function(e, t) {
  25898. var i = e.id + ":" + t;
  25899. return this.panoLoadCallbacks[i]
  25900. }
  25901. ,
  25902. n.prototype.buildDownloadDescriptorArray = function(e) {
  25903. for (var t = c.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  25904. var r = this.buildDownloadDescriptor();
  25905. i.push(r)
  25906. }
  25907. return i
  25908. }
  25909. ,
  25910. n.prototype.buildDownloadDescriptor = function() {
  25911. var e = {
  25912. panoGroupId: null,
  25913. pano: null,
  25914. panoSize: -1,
  25915. tileSize: -1,
  25916. tileIndex: -1,
  25917. totalTiles: -1,
  25918. faceTileIndex: -1,
  25919. status: h.None,
  25920. url: null,
  25921. image: null,
  25922. direction: new r.Vector3,
  25923. face: -1,
  25924. cubeFace: -1,
  25925. tileX: -1,
  25926. tileY: -1
  25927. };
  25928. return e
  25929. }
  25930. ,
  25931. n.prototype.initTileDownloadDescriptors = function(e, t, i) {
  25932. for (var n = 0; n < e.length; n++) {
  25933. var r = e[n];
  25934. this.initTileDownloadDescriptor(r, t, i, n)
  25935. }
  25936. }
  25937. ,
  25938. n.prototype.initTileDownloadDescriptor = function(e, t, i, n) {
  25939. var r = i >= c.TILE_SIZE ? c.TILE_SIZE : i;
  25940. e.face = c.getFaceForTile(i, n),
  25941. e.cubeFace = u.mapFaceToCubemapFace(e.face),
  25942. e.panoGroupId = this.panoGroupId,
  25943. e.pano = t,
  25944. e.panoSize = i,
  25945. e.tileSize = r,
  25946. e.tileIndex = n,
  25947. e.totalTiles = c.getTileCountForSize(i),
  25948. e.status = h.None,
  25949. e.image = null,
  25950. c.getTileLocation(e.panoSize, e.tileIndex, e),
  25951. c.getTileVector(e.panoSize, e.tileSize, e.cubeFace, e.tileX, e.tileY, c.LocationOnTile.Center, 0, e.direction)
  25952. }
  25953. ,
  25954. n.prototype.getTileUrl = function() {
  25955. var e = {
  25956. 256: "256",
  25957. 512: "512",
  25958. 1024: "1k",
  25959. 2048: "2k",
  25960. 4096: "4k"
  25961. }
  25962. , t = {
  25963. face: -1,
  25964. faceTileIndex: -1,
  25965. tileX: -1,
  25966. tileY: -1
  25967. };
  25968. return function(i, n, r, a) {
  25969. c.getTileLocation(n, a, t);
  25970. var s = Math.floor(n / r)
  25971. , l = s * s
  25972. , h = Math.floor(a / l)
  25973. , u = "";
  25974. 1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  25975. var d = this.urls.get("tiles/" + i + "/" + e[n] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg");
  25976. return d = p.changeIfTileGenerating(d)
  25977. }
  25978. }(),
  25979. n.prototype.loadImage = function(e, t, i, n) {
  25980. d.getImage(e, t).then(function(e) {
  25981. i(e)
  25982. }).fail(n)
  25983. }
  25984. ,
  25985. t.exports = n
  25986. }
  25987. ).call(this, "/js/tile/TileDownloader.js")
  25988. }
  25989. , {
  25990. "../ab": 3,
  25991. "../enum/DownloadStatus": 24,
  25992. "../enum/GLCubeFaces": 25,
  25993. "../enum/PanoSizeClass": 36,
  25994. "../enum/TileDownloaderEvents": 45,
  25995. "../enum/Vectors": 50,
  25996. "../enum/Viewmode": 51,
  25997. "../objects/Panorama": 148,
  25998. "../settings": 166,
  25999. "../util/ajax": 181,
  26000. "../util/logger": 189,
  26001. "../util/panorama": 191,
  26002. "./TilePrioritizer": 172,
  26003. "./TileUtils": 174,
  26004. events: 202,
  26005. three: 217
  26006. }],
  26007. 172: [function(e, t, i) {
  26008. (function(i) {
  26009. "use strict";
  26010. function n(e, t, i, o, a) {
  26011. this.qualityManager = e,
  26012. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26013. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize(),
  26014. this.baseSize = t,
  26015. this.standardSize = i,
  26016. this.highSize = o,
  26017. this.ultraHighSize = a,
  26018. this.priorityCriteria = new n.PriorityCriteria(null,new r.Vector3(0,0,0),new r.Vector3(0,0,-1),new r.Vector3(0,0,-1))
  26019. }
  26020. var r = e("three")
  26021. , o = (e("../enum/Viewmode"),
  26022. e("../settings"),
  26023. e("../settings"),
  26024. e("../objects/Panorama"))
  26025. , a = e("../util/logger")
  26026. , s = (e("../enum/Vectors"),
  26027. e("../enum/PanoSizeClass"),
  26028. e("../enum/ModelManagerEvents"),
  26029. e("../enum/GLCubeFaces"),
  26030. e("../enum/DownloadStatus"))
  26031. , l = (e("../util/browser"),
  26032. e("./TileUtils"))
  26033. , c = e("../util/math")
  26034. , h = (e("events").EventEmitter,
  26035. new a(i),
  26036. Object.freeze({
  26037. None: 0,
  26038. DirectionalFOV: 1
  26039. }));
  26040. n.PriorityCriteria = function(e, t, i, n, o) {
  26041. this.pano = e,
  26042. this.cameraPosition = (new r.Vector3).copy(t),
  26043. this.cameraDir = (new r.Vector3).copy(i),
  26044. this.panoSpaceDir = (new r.Vector3).copy(n),
  26045. this.upcomingPanos = o,
  26046. this.copy = function(e) {
  26047. this.pano = e.pano,
  26048. this.cameraPosition.copy(e.cameraPosition),
  26049. this.cameraDir.copy(e.cameraDir),
  26050. this.panoSpaceDir.copy(e.panoSpaceDir),
  26051. this.upcomingPanos = o
  26052. }
  26053. ,
  26054. this.zoomingActive = !1
  26055. }
  26056. ,
  26057. n.DIRECTIONAL_FOV = 180,
  26058. n.DIRECTIONAL_FOV_NARROW = 120,
  26059. n.MAX_SCORED_PANOS_TOCONSIDER = 6,
  26060. n.MAX_SCORED_PANOS_TOADD = 2,
  26061. n.MAX_UPCOMING_PANOS_TOADD = 3,
  26062. n.DIRECTION_SCORE_STRICTNESS = .75,
  26063. n.appendQueue = function(e, t) {
  26064. if (e && t)
  26065. for (var i = 0; i < t.length; i++)
  26066. e.push(t[i])
  26067. }
  26068. ,
  26069. n.prototype.updateCriteria = function(e, t, i, n) {
  26070. this.priorityCriteria.pano = e,
  26071. this.priorityCriteria.cameraPosition.copy(t),
  26072. this.priorityCriteria.cameraDir.copy(i),
  26073. this.priorityCriteria.upcomingPanos = n,
  26074. this.maxNavQuality = this.qualityManager.getMaxNavPanoSize(),
  26075. this.maxZoomQuality = this.qualityManager.getMaxZoomPanoSize()
  26076. }
  26077. ,
  26078. n.prototype.filterAndPrioritize = function() {
  26079. var e = []
  26080. , t = []
  26081. , i = [];
  26082. return function(r, o, a) {
  26083. this.populateNeighborPanos(this.priorityCriteria.pano, o, e),
  26084. this.populateScoredPanos(this.priorityCriteria.pano, o, t, this.priorityCriteria.cameraDir, n.MAX_SCORED_PANOS_TOCONSIDER);
  26085. var s = this.baseSize
  26086. , l = this.standardSize
  26087. , c = this.highSize
  26088. , h = this.ultraHighSize;
  26089. this.queueTilesForPano(r, a, this.priorityCriteria.pano, s),
  26090. this.priorityCriteria.upcomingPanos && this.queueTilesForPanos(r, this.priorityCriteria.upcomingPanos, a, s, n.MAX_UPCOMING_PANOS_TOADD),
  26091. i.length = 0,
  26092. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26093. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26094. n.appendQueue(r, i),
  26095. this.queueTilesForPanos(r, t, a, s, n.MAX_SCORED_PANOS_TOADD),
  26096. i.length = 0,
  26097. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26098. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV_NARROW),
  26099. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26100. n.appendQueue(r, i),
  26101. i.length = 0,
  26102. this.canDownloadSize(l) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, l, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26103. this.canDownloadSize(c) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, c, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26104. this.canDownloadSize(h) && this.queueTilesInDirectionForPano(i, a, this.priorityCriteria.pano, h, this.priorityCriteria.cameraPosition, this.priorityCriteria.cameraDir, n.DIRECTIONAL_FOV),
  26105. n.sortPanoTiles(i, this.priorityCriteria.pano, this.priorityCriteria.cameraDir),
  26106. n.appendQueue(r, i),
  26107. this.queueTilesForPanos(r, e, a, s)
  26108. }
  26109. }(),
  26110. n.prototype.canDownloadSize = function(e) {
  26111. return this.maxNavQuality >= e || this.maxZoomQuality >= e && this.zoomingActive
  26112. }
  26113. ,
  26114. n.prototype.populateNeighborPanos = function(e, t, i) {
  26115. i = i || [],
  26116. i.length = 0;
  26117. var n = t.getNeighbours(e);
  26118. for (var r in n)
  26119. if (n.hasOwnProperty(r)) {
  26120. var o = t.get(r);
  26121. i.push(o)
  26122. }
  26123. return i
  26124. }
  26125. ,
  26126. n.prototype.populateScoredPanos = function(e, t, i, r, a) {
  26127. i = i || [],
  26128. i.length = 0;
  26129. var s = [o.filters.inPanoDirection(e.position, r, n.DIRECTION_SCORE_STRICTNESS), o.filters.not(e)]
  26130. , l = [o.scoreFunctions.distanceSquared(e), o.scoreFunctions.direction(e.position, r)]
  26131. , c = t.sortByScore(s, l);
  26132. if (c)
  26133. for (var h = 0; h < c.length && h < a; h++) {
  26134. var u = c[h].pano;
  26135. i.push(u)
  26136. }
  26137. return i
  26138. }
  26139. ,
  26140. n.prototype.queueTilesForPanos = function(e, t, i, n, r) {
  26141. for (var o = 0, a = 0; a < t.length; a++) {
  26142. var s = t[a]
  26143. , l = this.queueTilesForPano(e, i, s, n);
  26144. if (o += l > 0 ? 1 : 0,
  26145. r && o >= r)
  26146. break
  26147. }
  26148. return o
  26149. }
  26150. ,
  26151. n.prototype.queueTilesForPano = function() {
  26152. var e = {
  26153. filter: h.None
  26154. };
  26155. return function(t, i, n, r) {
  26156. return this.filterAndQueueTileDownloadDescriptors(t, i, n, r, e)
  26157. }
  26158. }(),
  26159. n.prototype.queueTilesForPanosInDirection = function() {
  26160. var e = new r.Vector3;
  26161. return function(t, i, n, r, o, a, s, l) {
  26162. for (var h = 0, u = 0; u < n.length; u++) {
  26163. var d = n[u];
  26164. e.copy(d.position),
  26165. e.sub(o),
  26166. e.normalize();
  26167. var p = Math.max(Math.min(a.dot(e), 1), -1)
  26168. , f = c.getFOVDotThreshold(s);
  26169. if (p >= f) {
  26170. var g = this.queueTilesInDirectionForPano(t, i, d, r, o, a, s);
  26171. if (h += g > 0 ? 1 : 0,
  26172. l && h >= l)
  26173. break
  26174. }
  26175. }
  26176. return h
  26177. }
  26178. }(),
  26179. n.prototype.queueTilesInDirectionForPanos = function(e, t, i, n, r, o, a, s) {
  26180. for (var l = 0, c = 0; c < i.length; c++) {
  26181. var h = i[c]
  26182. , u = this.queueTilesInDirectionForPano(e, t, h, n, o, a);
  26183. if (l += u > 0 ? 1 : 0,
  26184. s && l >= s)
  26185. break
  26186. }
  26187. return l
  26188. }
  26189. ,
  26190. n.prototype.queueTilesInDirectionForPano = function() {
  26191. var e = {
  26192. filter: h.DirectionalFOV,
  26193. direction: new r.Vector3,
  26194. fov: 60
  26195. }
  26196. , t = new r.Vector3;
  26197. return function(i, n, r, o, a, s, c) {
  26198. return t.copy(s),
  26199. l.getRelativeDirection(r.quaternion, t),
  26200. e.direction.copy(t),
  26201. e.fov = c,
  26202. this.filterAndQueueTileDownloadDescriptors(i, n, r, o, e)
  26203. }
  26204. }(),
  26205. n.prototype.filterAndQueueTileDownloadDescriptors = function() {
  26206. var e = [];
  26207. return function(t, i, n, r, o) {
  26208. var a = i.getTileDownloadDescriptors(n, r);
  26209. e.length = 0,
  26210. this.filterTileDownloadDescriptors(n, a, e, o);
  26211. for (var s = 0, l = 0; l < e.length; l++) {
  26212. var c = e[l];
  26213. c && (t.push(c),
  26214. s++)
  26215. }
  26216. return s
  26217. }
  26218. }(),
  26219. n.prototype.filterTileDownloadDescriptors = function() {
  26220. new r.Vector3;
  26221. return function(e, t, i, n) {
  26222. var r, o;
  26223. switch (n.filter) {
  26224. case h.DirectionalFOV:
  26225. for (r = 0; r < t.length; r++)
  26226. o = t[r],
  26227. l.isTileWithinFOV(o.panoSize, o.tileSize, o.face, o.tileX, o.tileY, n.direction, n.fov) && i.push(o);
  26228. break;
  26229. default:
  26230. for (r = 0; r < t.length; r++)
  26231. o = t[r],
  26232. i.push(o)
  26233. }
  26234. for (r = 0; r < i.length; r++)
  26235. o = i[r],
  26236. this.canIncludeDescriptor(o) || (i[r] = null)
  26237. }
  26238. }(),
  26239. n.prototype.canIncludeDescriptor = function(e) {
  26240. return e.status !== s.Downloading && e.status !== s.Downloaded
  26241. }
  26242. ,
  26243. n.prototype.canIncludePano = function(e, t) {
  26244. return !e.isLoaded(t)
  26245. }
  26246. ,
  26247. n.getFOVDotThreshold = function(e) {
  26248. return Math.cos(r.Math.degToRad(e / 2))
  26249. }
  26250. ;
  26251. var u = function() {
  26252. var e = function e(t, i) {
  26253. var n = e._panoSpaceDir
  26254. , r = e._fovThreshold
  26255. , o = e._fovThresholdNarrow
  26256. , a = Math.max(Math.min(n.dot(t.direction), 1), -1)
  26257. , s = Math.max(Math.min(n.dot(i.direction), 1), -1);
  26258. return t._dot = a,
  26259. i._dot = s,
  26260. 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)
  26261. };
  26262. return e._panoSpaceDir = new r.Vector3,
  26263. e._fovThreshold = -1,
  26264. e._fovThresholdNarrow = -1,
  26265. e
  26266. }();
  26267. n.sortPanoTiles = function(e, t, i) {
  26268. u._panoSpaceDir.copy(i),
  26269. l.getRelativeDirection(t.quaternion, u._panoSpaceDir),
  26270. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26271. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV),
  26272. e.sort(u)
  26273. }
  26274. ,
  26275. n.insertSortedPanoTile = function(e, t, i, r) {
  26276. u._panoSpaceDir.copy(r),
  26277. l.getRelativeDirection(i.quaternion, u._panoSpaceDir),
  26278. u._fovThresholdNarrow = c.getFOVDotThreshold(n.DIRECTIONAL_FOV_NARROW),
  26279. u._fovThreshold = c.getFOVDotThreshold(n.DIRECTIONAL_FOV);
  26280. for (var o = -1, a = 0; a < e.length; a++) {
  26281. var s = u(t, e[a]);
  26282. if (s <= 0) {
  26283. o = a;
  26284. break
  26285. }
  26286. }
  26287. if (o === -1)
  26288. e[e.length] = t;
  26289. else {
  26290. for (var h = e.length; h > o; h--)
  26291. e[h] = e[h - 1];
  26292. e[o] = t
  26293. }
  26294. }
  26295. ,
  26296. n.prototype.setZoomingActive = function(e) {
  26297. e !== this.zoomingActive && (this.zoomingActive = e)
  26298. }
  26299. ,
  26300. t.exports = n
  26301. }
  26302. ).call(this, "/js/tile/TilePrioritizer.js")
  26303. }
  26304. , {
  26305. "../enum/DownloadStatus": 24,
  26306. "../enum/GLCubeFaces": 25,
  26307. "../enum/ModelManagerEvents": 33,
  26308. "../enum/PanoSizeClass": 36,
  26309. "../enum/Vectors": 50,
  26310. "../enum/Viewmode": 51,
  26311. "../objects/Panorama": 148,
  26312. "../settings": 166,
  26313. "../util/browser": 182,
  26314. "../util/logger": 189,
  26315. "../util/math": 190,
  26316. "./TileUtils": 174,
  26317. events: 202,
  26318. three: 217
  26319. }],
  26320. 173: [function(e, t, i) {
  26321. "use strict";
  26322. function n(e, t) {
  26323. this.levels = t,
  26324. this.tileSize = e,
  26325. this.root = null,
  26326. this.allNodes = [],
  26327. a(this)
  26328. }
  26329. function r(e, t) {
  26330. this.tree = e,
  26331. this.parent = t,
  26332. this.children = [],
  26333. this.id = ++u
  26334. }
  26335. function o(e, t, i, r, a, s, l, h) {
  26336. if (e) {
  26337. l = l || n.TraversalType.PreOrder;
  26338. var u = r * c + i;
  26339. if (l === n.TraversalType.PreOrder && (a && a(e, t, u, i, r),
  26340. s && s.push(e)),
  26341. e.children && 0 !== e.children.length) {
  26342. for (var d = r * c, p = i * c, f = 0; f < c; f++)
  26343. for (var g = 0; g < c; g++)
  26344. o(e.children[g * c + f], t + 1, p + f, d + g, a, s, l, h);
  26345. l === n.TraversalType.PostOrder && (a && a(e, t, u, i, r),
  26346. s && s.push(e))
  26347. }
  26348. }
  26349. }
  26350. function a(e) {
  26351. e.root = s(e, null, 0)
  26352. }
  26353. function s(e, t, i) {
  26354. if (i > e.levels)
  26355. return null;
  26356. var n = new r(e,t);
  26357. e.allNodes.push(n);
  26358. for (var o = 0; o < h; o++)
  26359. n.children[o] = s(e, n, i + 1);
  26360. return n
  26361. }
  26362. function l(e, t, i, n, r) {
  26363. if (!e)
  26364. return null;
  26365. if (0 === i)
  26366. return e;
  26367. if (!e.children || 0 === e.children.length)
  26368. return null;
  26369. var o = Math.pow(c, i)
  26370. , a = o / c
  26371. , s = n % a
  26372. , h = r % a
  26373. , u = Math.floor(r / a)
  26374. , d = Math.floor(n / a)
  26375. , p = u * c + d
  26376. , f = e.children[p];
  26377. return l(f, t + 1, i - 1, s, h)
  26378. }
  26379. var c = (e("three"),
  26380. e("./TileUtils"),
  26381. e("../objects/Panorama"),
  26382. e("../util/panorama"),
  26383. e("events").EventEmitter,
  26384. 2)
  26385. , h = c * c;
  26386. n.TraversalType = Object.freeze({
  26387. PreOrder: 0,
  26388. PostOrder: 1
  26389. });
  26390. var u = 0;
  26391. n.getLevelCountForSize = function(e, t) {
  26392. var i = 0;
  26393. for (t < e && (t = e); ; ) {
  26394. if (t /= c,
  26395. t < e)
  26396. break;
  26397. i++
  26398. }
  26399. return i
  26400. }
  26401. ,
  26402. n.getSizeForLevel = function(e, t) {
  26403. return Math.pow(c, t) * e
  26404. }
  26405. ,
  26406. n.prototype.getSubNode = function(e, t, i) {
  26407. (!t || e < this.tileSize) && (t = 0),
  26408. (!i || e < this.tileSize) && (i = 0),
  26409. e < this.tileSize && (e = this.tileSize);
  26410. var r = n.getLevelCountForSize(this.tileSize, e)
  26411. , o = l(this.root, 0, r, t, i);
  26412. return o
  26413. }
  26414. ,
  26415. n.prototype.breadthFirst = function(e) {
  26416. e = e || {};
  26417. var t = !!e.nullLevelEnd
  26418. , i = e.maxLevel
  26419. , n = e.minLevel
  26420. , r = e.callback
  26421. , o = e.saveVisited
  26422. , a = []
  26423. , s = {}
  26424. , l = 0
  26425. , c = 0;
  26426. for (a.push(this.root),
  26427. a.push(s); a.length > 0 && !(i && l > i); ) {
  26428. var h = a.shift();
  26429. if (h === s)
  26430. (!n || l >= n) && (r && t && r(null),
  26431. o && t && o.push(null)),
  26432. a.length > 0 && a.push(s),
  26433. l++,
  26434. c = 0;
  26435. else {
  26436. if (h.children)
  26437. for (var u = 0; u < h.children.length; u++) {
  26438. var d = h.children[u];
  26439. d && a.push(h.children[u])
  26440. }
  26441. var p = this.getFaceIndexFromNode(h);
  26442. (!n || l >= n) && (r && r(h, l, p),
  26443. o && o.push(h)),
  26444. c++
  26445. }
  26446. }
  26447. }
  26448. ,
  26449. n.prototype.getFaceIndexFromNode = function(e) {
  26450. if (!e)
  26451. return -1;
  26452. for (var t = 1, i = e, n = 0, r = 0; ; ) {
  26453. var o = i.parent;
  26454. if (!o)
  26455. break;
  26456. for (var a = -1, s = 0; s < o.children.length; s++)
  26457. o.children[s] === i && (a = s);
  26458. var l = a % c
  26459. , h = Math.floor(a / c);
  26460. n = l * t + n,
  26461. r = h * t + r,
  26462. t *= c,
  26463. i = o
  26464. }
  26465. return r * t + n
  26466. }
  26467. ,
  26468. n.prototype.depthFirst = function(e, t, i) {
  26469. o(this.root, 0, 0, 0, e, t, i, this.tileSize)
  26470. }
  26471. ,
  26472. t.exports = n
  26473. }
  26474. , {
  26475. "../objects/Panorama": 148,
  26476. "../util/panorama": 191,
  26477. "./TileUtils": 174,
  26478. events: 202,
  26479. three: 217
  26480. }],
  26481. 174: [function(e, t, i) {
  26482. "use strict";
  26483. var n = e("../enum/GLCubeFaces")
  26484. , r = e("../util/MathLight")
  26485. , o = {};
  26486. o.TILE_SIZE = 512,
  26487. o.FACES_PER_PANO = 6,
  26488. o.LocationOnTile = {
  26489. Center: 0,
  26490. UpperLeft: 1,
  26491. UpperRight: 2,
  26492. LowerRight: 3,
  26493. LowerLeft: 4
  26494. },
  26495. o.getTileVector = function() {
  26496. return function(e, t, i, a, s, l, c, h) {
  26497. l = l || o.LocationOnTile.Center;
  26498. var u = e / t
  26499. , d = a / u;
  26500. s = -s + (u - 1);
  26501. var p = s / u
  26502. , f = t / e
  26503. , g = 2 * f
  26504. , m = g / 2
  26505. , v = 2 * d - 1 + m
  26506. , A = 2 * p - 1 + m;
  26507. switch (l) {
  26508. case o.LocationOnTile.UpperLeft:
  26509. v -= m,
  26510. A += m,
  26511. v += c * g;
  26512. break;
  26513. case o.LocationOnTile.UpperRight:
  26514. v += m,
  26515. A += m,
  26516. A -= c * g;
  26517. break;
  26518. case o.LocationOnTile.LowerRight:
  26519. v += m,
  26520. A -= m,
  26521. v -= c * g;
  26522. break;
  26523. case o.LocationOnTile.LowerLeft:
  26524. v -= m,
  26525. A -= m,
  26526. A += c * g;
  26527. break;
  26528. case o.LocationOnTile.Center:
  26529. }
  26530. switch (i) {
  26531. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  26532. r.setVector(h, -1, A, -v);
  26533. break;
  26534. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  26535. r.setVector(h, 1, A, v);
  26536. break;
  26537. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  26538. r.setVector(h, -v, 1, -A);
  26539. break;
  26540. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  26541. r.setVector(h, -v, -1, A);
  26542. break;
  26543. case n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  26544. r.setVector(h, -v, A, 1);
  26545. break;
  26546. case n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  26547. r.setVector(h, v, A, -1)
  26548. }
  26549. r.normalize(h)
  26550. }
  26551. }(),
  26552. o.getFaceForTile = function(e, t) {
  26553. var i = o.TILE_SIZE;
  26554. e < o.TILE_SIZE && (i = e);
  26555. var n = Math.floor(e / i)
  26556. , r = n * n;
  26557. return Math.floor(t / r)
  26558. }
  26559. ,
  26560. o.getTileLocation = function(e, t, i) {
  26561. var n = o.TILE_SIZE;
  26562. e < o.TILE_SIZE && (n = e);
  26563. var r = o.getFaceForTile(e, t)
  26564. , a = Math.floor(e / n)
  26565. , s = a * a
  26566. , l = t - r * s;
  26567. i.tileX = l % a,
  26568. i.tileY = Math.floor(l / a),
  26569. i.face = r,
  26570. i.faceTileIndex = l
  26571. }
  26572. ,
  26573. o.getTileCountForSize = function(e) {
  26574. if (e <= o.TILE_SIZE)
  26575. return o.FACES_PER_PANO;
  26576. var t = Math.floor(e / o.TILE_SIZE)
  26577. , i = t * t
  26578. , n = i * o.FACES_PER_PANO;
  26579. return n
  26580. }
  26581. ,
  26582. o.getRelativeDirection = function() {
  26583. var e = new r.Matrix4
  26584. , t = new r.Quaternion;
  26585. return function(i, n) {
  26586. t.copy(i),
  26587. t.inverse(),
  26588. e.makeRotationFromQuaternion(t),
  26589. e.applyToVector3(n),
  26590. r.normalize(n)
  26591. }
  26592. }(),
  26593. o.matchingTilesInDirection = function() {
  26594. var e = new r.Vector3
  26595. , t = new r.Vector3(0,0,-1)
  26596. , i = new r.Quaternion
  26597. , n = function(e, t) {
  26598. e.push({
  26599. face: t.face,
  26600. faceTileIndex: t.faceTileIndex,
  26601. tileX: t.tileX,
  26602. tileY: t.tileY
  26603. })
  26604. }
  26605. , a = function() {
  26606. var e = {
  26607. face: -1,
  26608. faceTileIndex: -1,
  26609. tileX: -1,
  26610. tileY: -1
  26611. };
  26612. return function(t, i, r) {
  26613. for (var a = o.getTileCountForSize(t), s = 0, l = 0; l < a; l++)
  26614. o.getTileLocation(t, l, e),
  26615. i && !i(e) || (s++,
  26616. r && n(r, e));
  26617. return s
  26618. }
  26619. }();
  26620. return function(n, s, l, c, h, u) {
  26621. var d = s < o.TILE_SIZE ? s : o.TILE_SIZE;
  26622. o.getTileCountForSize(s);
  26623. if (!c && !h)
  26624. return a(s, null, u);
  26625. var p = !!h;
  26626. if (h = h || c,
  26627. h = Math.max(0, Math.min(h, 360)),
  26628. c = Math.max(0, Math.min(c, 360)),
  26629. r.copyVector(l, e),
  26630. o.getRelativeDirection(n.quaternion, e),
  26631. p) {
  26632. i.setFromUnitVectors(e, t);
  26633. var f = function(e) {
  26634. return o.isTileWithinFrustum(s, d, e.face, e.tileX, e.tileY, i, c, h)
  26635. };
  26636. return a(s, f, u)
  26637. }
  26638. var g = function(t) {
  26639. return o.isTileWithinFOV(s, d, t.face, t.tileX, t.tileY, e, c)
  26640. };
  26641. return a(s, g, u)
  26642. }
  26643. }(),
  26644. o.isTileWithinFrustum = function() {
  26645. var e = new r.Vector3
  26646. , t = 1e-5;
  26647. return function(i, n, a, s, l, c, h, u) {
  26648. for (var d = Math.tan(.5 * u * r.RADIANS_PER_DEGREE), p = -d, f = Math.tan(.5 * h * r.RADIANS_PER_DEGREE), g = -f, m = o.mapFaceToCubemapFace(a), v = 0, A = 0, y = 0, C = 0, I = 0, E = 0, b = o.LocationOnTile.Center; b <= o.LocationOnTile.LowerLeft; b++)
  26649. if (o.getTileVector(i, n, m, s, l, b, 0, e),
  26650. r.applyQuaternionToVector(c, e),
  26651. e.z >= -t)
  26652. I++;
  26653. else {
  26654. var w = -1 / e.z
  26655. , _ = e.x * w
  26656. , T = e.y * w;
  26657. T > d ? v++ : T < p && A++,
  26658. _ > f ? y++ : _ < g && C++,
  26659. E++
  26660. }
  26661. return A !== E && v !== E && y !== E && C !== E
  26662. }
  26663. }(),
  26664. o.isTileWithinFOV = function() {
  26665. var e = new r.Vector3
  26666. , t = new r.Vector3(0,1,0)
  26667. , i = new r.Vector3(1,0,0);
  26668. return function(n, a, s, l, c, h, u) {
  26669. var d = o.mapFaceToCubemapFace(s);
  26670. if (r.cross(h, t, i),
  26671. o.getTileVector(n, a, d, l, c, o.LocationOnTile.Center, 0, e),
  26672. o.isWithinFOV(e, h, u, null))
  26673. return !0;
  26674. for (var p = u / 360, f = Math.floor(1 / p), g = 0, m = 0; m < f; m++) {
  26675. for (var v = o.LocationOnTile.UpperLeft; v <= o.LocationOnTile.LowerLeft; v++)
  26676. if (o.getTileVector(n, a, d, l, c, v, g, e),
  26677. o.isWithinFOV(e, h, u, null))
  26678. return !0;
  26679. g += p
  26680. }
  26681. return !1
  26682. }
  26683. }(),
  26684. o.isWithinFOV = function() {
  26685. var e = new r.Vector3
  26686. , t = new r.Vector3;
  26687. return function(i, n, o, a) {
  26688. if (r.copyVector(i, t),
  26689. a) {
  26690. r.copyVector(a, e),
  26691. r.normalize(e);
  26692. var s = r.dot(e, i);
  26693. e.x *= s,
  26694. e.y *= s,
  26695. e.z *= s,
  26696. r.subVector(t, e)
  26697. }
  26698. var l = o / 2 * r.RADIANS_PER_DEGREE
  26699. , c = Math.cos(l)
  26700. , h = r.dot(t, n);
  26701. return h >= c
  26702. }
  26703. }(),
  26704. o.mapFaceToCubemapFace = function() {
  26705. var e = {
  26706. 0: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  26707. 1: n.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  26708. 2: n.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  26709. 3: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  26710. 4: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  26711. 5: n.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  26712. };
  26713. return function(t) {
  26714. return e[t]
  26715. }
  26716. }(),
  26717. t.exports = o
  26718. }
  26719. , {
  26720. "../enum/GLCubeFaces": 25,
  26721. "../util/MathLight": 176
  26722. }],
  26723. 175: [function(e, t, i) {
  26724. (function(i) {
  26725. "use strict";
  26726. function n() {
  26727. this.list = [],
  26728. this.index = {},
  26729. Object.defineProperty(this, "length", {
  26730. get: function() {
  26731. return this.list.length
  26732. }
  26733. })
  26734. }
  26735. var r = (e("./common"),
  26736. e("./logger"));
  26737. new r(i);
  26738. n.prototype.forEach = function(e) {
  26739. this.list.forEach(e)
  26740. }
  26741. ,
  26742. n.prototype.add = function(e) {
  26743. this.list.push(e),
  26744. this.index[this.getIndex(e)] = e
  26745. }
  26746. ,
  26747. n.prototype.getIndex = function(e) {
  26748. throw new Error("IndexedCollection.getIndex not implemented in subclass.")
  26749. }
  26750. ,
  26751. n.prototype.extend = function(e) {
  26752. for (var t = 0; t < e.length; t++)
  26753. this.add(e[t])
  26754. }
  26755. ,
  26756. n.prototype.get = function(e) {
  26757. return this.index[e]
  26758. }
  26759. ,
  26760. n.prototype.first = function() {
  26761. return this.list[0]
  26762. }
  26763. ,
  26764. n.prototype.last = function() {
  26765. return this.list[this.list.length - 1]
  26766. }
  26767. ,
  26768. n.prototype.reIndex = function() {
  26769. this.index = {};
  26770. var e = this;
  26771. this.forEach(function(t) {
  26772. e.index[e.getIndex(t)] = t
  26773. })
  26774. }
  26775. ,
  26776. n.prototype.filter = function(e) {
  26777. var t = this.list.filter(e);
  26778. return this.reIndex(),
  26779. t
  26780. }
  26781. ,
  26782. n.prototype.reduce = function(e, t) {
  26783. return this.list.reduce(e, t)
  26784. }
  26785. ,
  26786. n.prototype.sort = function(e) {
  26787. return this.list.sort(e)
  26788. }
  26789. ,
  26790. n.prototype.indexOf = function(e) {
  26791. for (var t = 0; t < this.list.length; ++t)
  26792. if (this.list[t] === e)
  26793. return t;
  26794. return -1
  26795. }
  26796. ,
  26797. t.exports = n
  26798. }
  26799. ).call(this, "/js/util/IndexedCollection.js")
  26800. }
  26801. , {
  26802. "./common": 185,
  26803. "./logger": 189
  26804. }],
  26805. 176: [function(e, t, i) {
  26806. "use strict";
  26807. var n = e("../constants")
  26808. , r = {};
  26809. r.RADIANS_PER_DEGREE = Math.PI / 180,
  26810. r.DEGREES_PER_RADIAN = 180 / Math.PI,
  26811. r.Vector3 = function(e, t, i) {
  26812. this.x = e || 0,
  26813. this.y = t || 0,
  26814. this.z = i || 0
  26815. }
  26816. ,
  26817. r.Matrix4 = function() {
  26818. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  26819. arguments.length > 0 && console.error("MathLight.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  26820. }
  26821. ,
  26822. r.Matrix4.prototype = {
  26823. identity: function() {
  26824. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  26825. this
  26826. },
  26827. copy: function(e) {
  26828. return this.elements.set(e.elements),
  26829. this
  26830. },
  26831. applyToVector3: function(e) {
  26832. var t = e.x
  26833. , i = e.y
  26834. , n = e.z
  26835. , r = this.elements;
  26836. return e.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  26837. e.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  26838. e.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  26839. this
  26840. },
  26841. getInverse: function(e, t) {
  26842. var i = this.elements
  26843. , n = e.elements
  26844. , r = n[0]
  26845. , o = n[1]
  26846. , a = n[2]
  26847. , s = n[3]
  26848. , l = n[4]
  26849. , c = n[5]
  26850. , h = n[6]
  26851. , u = n[7]
  26852. , d = n[8]
  26853. , p = n[9]
  26854. , f = n[10]
  26855. , g = n[11]
  26856. , m = n[12]
  26857. , v = n[13]
  26858. , A = n[14]
  26859. , y = n[15]
  26860. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  26861. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  26862. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  26863. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  26864. , w = r * C + o * I + a * E + s * b;
  26865. if (0 === w) {
  26866. var _ = "MathLight.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  26867. if (t)
  26868. throw new Error(_);
  26869. return console.warn(_),
  26870. this.identity()
  26871. }
  26872. var T = 1 / w;
  26873. return i[0] = C * T,
  26874. i[1] = (v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y) * T,
  26875. i[2] = (c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y) * T,
  26876. i[3] = (p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g) * T,
  26877. i[4] = I * T,
  26878. i[5] = (d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y) * T,
  26879. i[6] = (m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y) * T,
  26880. i[7] = (l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g) * T,
  26881. i[8] = E * T,
  26882. i[9] = (m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y) * T,
  26883. i[10] = (l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y) * T,
  26884. i[11] = (d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g) * T,
  26885. i[12] = b * T,
  26886. i[13] = (d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A) * T,
  26887. i[14] = (m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A) * T,
  26888. i[15] = (l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f) * T,
  26889. this
  26890. },
  26891. makeRotationFromQuaternion: function(e) {
  26892. var t = this.elements
  26893. , i = e.x
  26894. , n = e.y
  26895. , r = e.z
  26896. , o = e.w
  26897. , a = i + i
  26898. , s = n + n
  26899. , l = r + r
  26900. , c = i * a
  26901. , h = i * s
  26902. , u = i * l
  26903. , d = n * s
  26904. , p = n * l
  26905. , f = r * l
  26906. , g = o * a
  26907. , m = o * s
  26908. , v = o * l;
  26909. return t[0] = 1 - (d + f),
  26910. t[4] = h - v,
  26911. t[8] = u + m,
  26912. t[1] = h + v,
  26913. t[5] = 1 - (c + f),
  26914. t[9] = p - g,
  26915. t[2] = u - m,
  26916. t[6] = p + g,
  26917. t[10] = 1 - (c + d),
  26918. t[3] = 0,
  26919. t[7] = 0,
  26920. t[11] = 0,
  26921. t[12] = 0,
  26922. t[13] = 0,
  26923. t[14] = 0,
  26924. t[15] = 1,
  26925. this
  26926. }
  26927. },
  26928. r.Quaternion = function(e, t, i, n) {
  26929. this._x = e || 0,
  26930. this._y = t || 0,
  26931. this._z = i || 0,
  26932. this._w = void 0 !== n ? n : 1
  26933. }
  26934. ,
  26935. r.Quaternion.prototype = {
  26936. get x() {
  26937. return this._x
  26938. },
  26939. set x(e) {
  26940. this._x = e
  26941. },
  26942. get y() {
  26943. return this._y
  26944. },
  26945. set y(e) {
  26946. this._y = e
  26947. },
  26948. get z() {
  26949. return this._z
  26950. },
  26951. set z(e) {
  26952. this._z = e
  26953. },
  26954. get w() {
  26955. return this._w
  26956. },
  26957. set w(e) {
  26958. this._w = e
  26959. },
  26960. copy: function(e) {
  26961. this._x = e.x,
  26962. this._y = e.y,
  26963. this._z = e.z,
  26964. this._w = e.w
  26965. },
  26966. inverse: function() {
  26967. return this.conjugate().normalize()
  26968. },
  26969. conjugate: function() {
  26970. return this._x *= -1,
  26971. this._y *= -1,
  26972. this._z *= -1,
  26973. this
  26974. },
  26975. length: function() {
  26976. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  26977. },
  26978. normalize: function() {
  26979. var e = this.length();
  26980. return 0 === e ? (this._x = 0,
  26981. this._y = 0,
  26982. this._z = 0,
  26983. this._w = 1) : (e = 1 / e,
  26984. this._x = this._x * e,
  26985. this._y = this._y * e,
  26986. this._z = this._z * e,
  26987. this._w = this._w * e),
  26988. this
  26989. },
  26990. setFromAxisAngle: function(e, t) {
  26991. var i = t / 2
  26992. , n = Math.sin(i);
  26993. return this._x = e.x * n,
  26994. this._y = e.y * n,
  26995. this._z = e.z * n,
  26996. this._w = Math.cos(i),
  26997. this
  26998. },
  26999. setFromUnitVectors: function() {
  27000. var e, t, i = 1e-6;
  27001. return function(n, o) {
  27002. return void 0 === e && (e = new r.Vector3),
  27003. t = r.dot(n, o) + 1,
  27004. t < i ? (t = 0,
  27005. 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),
  27006. this._x = e.x,
  27007. this._y = e.y,
  27008. this._z = e.z,
  27009. this._w = t,
  27010. this.normalize()
  27011. }
  27012. }(),
  27013. multiply: function(e) {
  27014. return this.multiplyQuaternions(this, e)
  27015. },
  27016. premultiply: function(e) {
  27017. return this.multiplyQuaternions(e, this)
  27018. },
  27019. multiplyQuaternions: function(e, t) {
  27020. var i = e._x
  27021. , n = e._y
  27022. , r = e._z
  27023. , o = e._w
  27024. , a = t._x
  27025. , s = t._y
  27026. , l = t._z
  27027. , c = t._w;
  27028. return this._x = i * c + o * a + n * l - r * s,
  27029. this._y = n * c + o * s + r * a - i * l,
  27030. this._z = r * c + o * l + i * s - n * a,
  27031. this._w = o * c - i * a - n * s - r * l,
  27032. this
  27033. }
  27034. },
  27035. r.convertWorkshopVector = function(e) {
  27036. return new r.Vector3(-e.x,e.y,e.z)
  27037. }
  27038. ,
  27039. r.convertWorkshopQuaternion = function(e) {
  27040. 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))
  27041. }
  27042. ;
  27043. r.convertWorkshopOrthoZoom = function(e) {//xzw
  27044. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / n.workshopApsect
  27045. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  27046. }
  27047. ,
  27048. r.convertWorkshopPanoramaQuaternion = function(e) {
  27049. 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))
  27050. }
  27051. ,
  27052. r.normalize = function(e) {
  27053. var t = e.x * e.x + e.y * e.y + e.z * e.z
  27054. , i = Math.sqrt(t);
  27055. e.x /= i,
  27056. e.y /= i,
  27057. e.z /= i
  27058. }
  27059. ,
  27060. r.dot = function(e, t) {
  27061. return e.x * t.x + e.y * t.y + e.z * t.z
  27062. }
  27063. ,
  27064. r.cross = function(e, t, i) {
  27065. var n = e.x
  27066. , r = e.y
  27067. , o = e.z;
  27068. i.x = r * t.z - o * t.y,
  27069. i.y = o * t.x - n * t.z,
  27070. i.z = n * t.y - r * t.x
  27071. }
  27072. ,
  27073. r.setVector = function(e, t, i, n) {
  27074. e.x = t,
  27075. e.y = i,
  27076. e.z = n
  27077. }
  27078. ,
  27079. r.copyVector = function(e, t) {
  27080. t.x = e.x,
  27081. t.y = e.y,
  27082. t.z = e.z
  27083. }
  27084. ,
  27085. r.addVector = function(e, t) {
  27086. e.x += t.x,
  27087. e.y += t.y,
  27088. e.z += t.z
  27089. }
  27090. ,
  27091. r.subVector = function(e, t) {
  27092. e.x -= t.x,
  27093. e.y -= t.y,
  27094. e.z -= t.z
  27095. }
  27096. ,
  27097. r.applyQuaternionToVector = function(e, t) {
  27098. var i = t.x
  27099. , n = t.y
  27100. , r = t.z
  27101. , o = e.x
  27102. , a = e.y
  27103. , s = e.z
  27104. , l = e.w
  27105. , c = l * i + a * r - s * n
  27106. , h = l * n + s * i - o * r
  27107. , u = l * r + o * n - a * i
  27108. , d = -o * i - a * n - s * r;
  27109. t.x = c * l + d * -o + h * -s - u * -a,
  27110. t.y = h * l + d * -a + u * -o - c * -s,
  27111. t.z = u * l + d * -s + c * -a - h * -o
  27112. }
  27113. ,
  27114. r.angleBetweenVectors = function(e, t) {
  27115. return Math.acos(r.dot(e, t))
  27116. }
  27117. ,
  27118. t.exports = r
  27119. }
  27120. , {
  27121. "../constants": 8
  27122. }],
  27123. 177: [function(e, t, i) {
  27124. (function(i) {
  27125. "use strict";
  27126. function n(e) {
  27127. this.cache = null,
  27128. this.expires = 0
  27129. }
  27130. function r() {
  27131. this.baseUrl = null,
  27132. this.cache = null,
  27133. this.expires = 0
  27134. }
  27135. function o() {
  27136. this.baseUrl = null,
  27137. this.expires = 0
  27138. }
  27139. function a(e) {
  27140. this.initialLoadingPromise = null,
  27141. this.endpoint = e + "?type=3",
  27142. this.urlContainer = null,
  27143. this.authorizationHeader = h.getAuthorizationHeader(),
  27144. this.containerClasses = [o, r, n]
  27145. }
  27146. var s = e("./ajax")
  27147. , l = e("./logger")
  27148. , c = e("../constants")
  27149. , h = e("./showcase")
  27150. , u = (e("../ab"),
  27151. new l(i));
  27152. n.prototype = {
  27153. version: 1,
  27154. validate: function(e) {
  27155. return "catalog.json"in e && Object.keys(e).length > 0
  27156. },
  27157. update: function(e) {
  27158. return this.cache = e,
  27159. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27160. $.when()
  27161. },
  27162. get: function(e) {
  27163. return this.cache[e]
  27164. }
  27165. },
  27166. r.prototype = {
  27167. version: 2,
  27168. validate: function(e) {
  27169. return "catalog.json"in e && "base.url"in e && Object.keys(e).length > 1
  27170. },
  27171. update: function(e) {
  27172. return this.baseUrl = e["base.url"],
  27173. this.cache = e,
  27174. this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27175. $.when()
  27176. },
  27177. get: function(e) {
  27178. var t = this.cache[e];
  27179. return t ? this.baseUrl.replace("{{filename}}", e) + t : null
  27180. }
  27181. },
  27182. o.prototype = {
  27183. version: 3,
  27184. validate: function(e) {
  27185. return e.templates && e.catalog_file && (!e.expires || 1e3 * e.expires > Date.now())
  27186. },
  27187. update: function(e) {
  27188. return this.baseUrl = e.templates[0],
  27189. e.expires ? this.expires = 1e3 * e.expires : this.expires = Date.now() + c.signedUrlDefaultExpireTime,
  27190. $.when()
  27191. },
  27192. get: function(e) {
  27193. return this.baseUrl.replace("{{filename}}", e)
  27194. }
  27195. },
  27196. a.prototype = {
  27197. init: function() {
  27198. return this.initialLoadingPromise ? this.initialLoadingPromise : (setInterval(function() {
  27199. var e = this.urlContainer ? this.urlContainer.expires : Date.now();
  27200. Date.now() + c.signedUrlRefreshBuffer > e && (u.debug("Refreshing urls..."),
  27201. this.refresh().done(function() {
  27202. u.debug("Refreshed")
  27203. }).fail(function() {
  27204. u.error("Failed url refresh, urls might go stale soon")
  27205. }))
  27206. }
  27207. .bind(this), c.signedUrlCheckInterval),
  27208. this.initialLoadingPromise = this.refresh(),
  27209. this.initialLoadingPromise)
  27210. },
  27211. refresh: function(e) { //已经在someData.js里加载过了 不用再加载file了吧
  27212. e = e || {};
  27213. /*var t = void 0 === e.cache || e.cache;
  27214. return s.get( this.endpoint , { //file
  27215. responseType: "json",
  27216. prefetchFrom: t ? "files" : null,
  27217. cache: t,
  27218. auth: this.authorizationHeader
  27219. }).then(function(e) {
  27220. if (this.urlContainer && this.urlContainer.validate(e))
  27221. return this.urlContainer.update(e);
  27222. for (var i = 0; i < this.containerClasses.length; i++) {
  27223. var n = this.containerClasses[i]
  27224. , r = new n;
  27225. if (r.validate(e))
  27226. return u.info("Using urls version " + r.version),
  27227. this.urlContainer = r,
  27228. this.urlContainer.update(e)
  27229. }
  27230. return t ? this.refresh({
  27231. cache: !1
  27232. }) : $.Deferred().reject("missing-urls")
  27233. }
  27234. .bind(this), function(e) {
  27235. return "loading-failed"
  27236. }) */
  27237. return $.Deferred().resolve();
  27238. },
  27239. get: function(e) {
  27240. //return this.urlContainer.get(e)
  27241. return window.MP_PREFETCHED_MODELDATA.files.templates[0].replace("{{filename}}", e)
  27242. }
  27243. },
  27244. t.exports = a
  27245. }
  27246. ).call(this, "/js/util/ModelUrls.js")
  27247. }
  27248. , {
  27249. "../ab": 3,
  27250. "../constants": 8,
  27251. "./ajax": 181,
  27252. "./logger": 189,
  27253. "./showcase": 193
  27254. }],
  27255. 178: [function(e, t, i) {
  27256. (function(i) {
  27257. "use strict";
  27258. function n() {
  27259. u.call(this),
  27260. this.neighbourMap = {},
  27261. this.map = null
  27262. }
  27263. var r = e("three")
  27264. , o = e("./common")
  27265. , a = e("../settings")
  27266. , s = e("../objects/Panorama")
  27267. , a = e("../settings")
  27268. , l = e("./aStar")
  27269. , c = e("./logger")
  27270. , h = new c(i)
  27271. , u = e("./IndexedCollection")
  27272. , d = e("./transitions");
  27273. o.inherit(n, u),
  27274. n.prototype.getIndex = function(e) {
  27275. return e.id
  27276. }
  27277. ,
  27278. n.prototype.find = function(e, t) {
  27279. var i = o.filterAll(this.list, e);
  27280. return 0 === i.length ? null : (t && t.forEach(function(e) {
  27281. i = o.stableSort(i, e)
  27282. }),
  27283. i[0])
  27284. }
  27285. ,
  27286. n.prototype.sortByScore = function(e, t) {
  27287. var i = o.filterAll(this.list, e);
  27288. return 0 === i.length ? null : i = i.map(function(e) {
  27289. return {
  27290. pano: e,
  27291. score: t.reduce(function(t, i) {
  27292. return t + i(e)
  27293. }, 0)
  27294. }
  27295. }).sort(function(e, t) {
  27296. return t.score - e.score;
  27297. })
  27298. }
  27299. ,
  27300. n.prototype.lowestByScore = function(e, t, i) {
  27301. return this.findRankedByScore(0, e, t, i)
  27302. }
  27303. ,
  27304. n.prototype.findRankedByScore = function(e, t, i, n) {
  27305. n && (n.candidates = null,
  27306. n.pano = null),
  27307. e || (e = 0);
  27308. var r = this.sortByScore(t, i);
  27309. return !r || 0 === r.length || e >= r.length ? null : (n && (n.candidates = r,
  27310. n.pano = r[e].pano),
  27311. r[e].pano)
  27312. }
  27313. ,
  27314. n.prototype.showPanoScores = function(e) {
  27315. this.list.forEach(function(e) {
  27316. e.removeTextSprite()
  27317. });
  27318. var t = 6344768;
  27319. e.forEach(function(e) {
  27320. e.pano.addTextSprite(e.score.toFixed(2), t),
  27321. t = 16428055
  27322. })
  27323. }
  27324. ,
  27325. n.prototype.isNeighbour = function(e, t) {
  27326. return this.neighbourMap[e.id][t.id]
  27327. }
  27328. ,
  27329. n.prototype.getNeighbours = function(e) {
  27330. return this.neighbourMap[e.id]
  27331. }
  27332. ,
  27333. n.prototype.setNeighbour = function(e, t, i) {
  27334. return this.neighbourMap[e.id] || (this.neighbourMap[e.id] = {}),
  27335. this.neighbourMap[t.id] || (this.neighbourMap[t.id] = {}),
  27336. this.neighbourMap[e.id][e.id] = !0,
  27337. this.neighbourMap[t.id][t.id] = !0,
  27338. this.neighbourMap[e.id][t.id] = i,
  27339. this.neighbourMap[t.id][e.id] = i,
  27340. this.neighbourMap[e.id]
  27341. }
  27342. ,
  27343. n.prototype.findClosest = function(e, t) {
  27344. var i = [s.filters.isPanoAligned()];
  27345. return t && i.push(s.filters.inDirection(e, t, .75)),
  27346. this.find(i, [s.sortFunctions.distanceToPoint(e)])
  27347. }
  27348. ,
  27349. n.prototype.dualNeighbors = function(e, t) {
  27350. var i, n = [];
  27351. for (i in this.neighbourMap[e.id])
  27352. this.neighbourMap[t.id][i] && n.push(i);
  27353. return n
  27354. }
  27355. ,
  27356. n.prototype.populate_path_graph = function() {
  27357. var e, t, i, n, o, a, s, l, c = Date.now(), u = {}, d = 0, p = new r.Vector3(0,0,0), f = 0, g = 0;
  27358. for (e = 0; e < this.list.length; e += 1) {
  27359. o = this.list[e],
  27360. s = {},
  27361. l = !1,
  27362. i = o.neighbourPanos || o.findNeighourPanos();
  27363. for (t in i)
  27364. if (i[t]) {
  27365. a = this.index[t],
  27366. p.copy(o.floorPosition),
  27367. p.sub(a.floorPosition);
  27368. var m = Math.sqrt(p.x * p.x + p.z * p.z)
  27369. , v = (Math.abs(p.y) / Math.max(m, .01),
  27370. Math.max(0, Math.abs(p.y) - .2));
  27371. v > 0 ? (f += 1,
  27372. v = Math.pow(4 * v, 2),
  27373. m = Math.pow(m, 2),
  27374. n = Math.sqrt(v * v + m * m)) : (g += 1,
  27375. n = p.length()),
  27376. s[a.id] = n,
  27377. l = !0
  27378. }
  27379. l ? u[o.id] = s : d += 1
  27380. }
  27381. this.map = u,
  27382. h.info("graph ready in " + (Date.now() - c) + "ms, " + d + " had no neighbors")
  27383. }
  27384. ,
  27385. n.prototype.aStarSearch = function(e, t) {
  27386. var i = Date.now()
  27387. , n = new l({
  27388. start: e,
  27389. isEnd: function(e) {
  27390. return e === t
  27391. },
  27392. neighbor: function(e) {
  27393. var t = e.neighbourPanos || e.findNeighourPanos()
  27394. , i = [];
  27395. for (var n in t)
  27396. i.push(this.index[n]);
  27397. return i
  27398. }
  27399. .bind(this),
  27400. distance: function(e, t) {
  27401. var i = this.map[e.id]
  27402. , n = i[t.id];
  27403. return n
  27404. }
  27405. .bind(this),
  27406. heuristic: function(e, t) {
  27407. return 1
  27408. }
  27409. .bind(this),
  27410. hash: function(e) {
  27411. return e.id
  27412. },
  27413. timeout: 5e3
  27414. });
  27415. if (h.debug("A* search in " + (Date.now() - i) + "ms"),
  27416. "success" !== n.status)
  27417. return h.debug("Did not find A* path from " + e + " to " + t),
  27418. null;
  27419. h.debug("Total cost " + n.cost.toPrecision(3) + ", " + n.path.length + " steps");
  27420. var r = [];
  27421. return n.path.forEach(function(e) {
  27422. r.push(e.id)
  27423. }),
  27424. r
  27425. }
  27426. ,
  27427. n.prototype.includeNodesNearPath = function() {
  27428. var e = new r.Vector3
  27429. , t = new r.Vector3
  27430. , i = new r.Vector3
  27431. , n = new r.Vector3
  27432. , o = new r.Vector3
  27433. , a = new r.Vector3
  27434. , s = new r.Vector3
  27435. , l = new r.Vector3
  27436. , c = []
  27437. , h = new r.Vector3
  27438. , u = new r.Vector3;
  27439. return function(r, d) {
  27440. if (r)
  27441. for (var p = function(e, t, i) {
  27442. return o.copy(t).sub(e),
  27443. o.dot(i)
  27444. }, f = function(e, t) {
  27445. return p(h, e.position, i) - p(h, t.position, i)
  27446. }, g = 0; g < r.length - 1; ) {
  27447. var m = r[g]
  27448. , v = r[g + 1]
  27449. , A = this.index[m]
  27450. , y = this.index[v];
  27451. h.copy(A.position),
  27452. u.copy(y.position),
  27453. c.length = 0,
  27454. e.copy(u).sub(h),
  27455. i.copy(e).normalize();
  27456. for (var C = 0; C < this.list.length; C++) {
  27457. var I = this.list[C];
  27458. o.copy(I.position).sub(h);
  27459. var E = o.dot(i);
  27460. if (E > 0) {
  27461. s.copy(i),
  27462. s.multiplyScalar(E),
  27463. a.copy(o),
  27464. a.sub(s);
  27465. var b = a.length();
  27466. if (b < d) {
  27467. t.copy(e).negate(),
  27468. n.copy(t).normalize(),
  27469. l.copy(I.position).sub(u);
  27470. var w = l.dot(n);
  27471. w > 0 && c.push(I)
  27472. }
  27473. }
  27474. }
  27475. if (c.length > 0) {
  27476. c.sort(f);
  27477. for (var _ = r.length + c.length - 1; _ >= g + c.length; _--)
  27478. r[_] = r[_ - c.length];
  27479. for (var T = 0; T < c.length; T++)
  27480. r[T + g + 1] = c[T].id
  27481. }
  27482. g += c.length + 1
  27483. }
  27484. }
  27485. }(),
  27486. n.prototype.fadeMarkerOpacity = function(e, t) {
  27487. var i = void 0 === e ? a.panorama.markerOpacity : e
  27488. , n = this.list.findIndex(function(e) {
  27489. return e.marker
  27490. });
  27491. if (!(n < 0)) {
  27492. var r = this.list[n].marker.material.opacity;
  27493. if (r !== e) {
  27494. var o = i - r;
  27495. d.trigger({
  27496. func: function(e, t) {
  27497. var i = r + e * o;
  27498. this.forEach(function(e) {
  27499. e.marker && (e.marker.material.opacity = i)
  27500. })
  27501. }
  27502. .bind(this),
  27503. duration: void 0 === t ? a.markerOpacityTransitionTime : t,
  27504. name: "_fpm"
  27505. })
  27506. }
  27507. }
  27508. }
  27509. ,
  27510. t.exports = n
  27511. }
  27512. ).call(this, "/js/util/PanoramaCollection.js")
  27513. }
  27514. , {
  27515. "../objects/Panorama": 148,
  27516. "../settings": 166,
  27517. "./IndexedCollection": 175,
  27518. "./aStar": 180,
  27519. "./common": 185,
  27520. "./logger": 189,
  27521. "./transitions": 195,
  27522. three: 217
  27523. }],
  27524. 179: [function(e, t, i) {
  27525. "use strict";
  27526. function n() {
  27527. this.actionSequence = [],
  27528. this.actionSequenceInProgress = !1
  27529. }
  27530. function r(e, t, i, n) {
  27531. s.trackAlways("zoom_" + e, {
  27532. from: t,
  27533. to: i,
  27534. pano: n
  27535. })
  27536. }
  27537. function o(e, t) {
  27538. r("initial", 1, e, t)
  27539. }
  27540. function a(e, t, i) {
  27541. r("followup", e, t, i)
  27542. }
  27543. var s = e("../analytics");
  27544. n.prototype.reset = function(e) {
  27545. this.actionSequenceInProgress = !1,
  27546. this.actionSequence.length = 0
  27547. }
  27548. ,
  27549. n.prototype.addZoomAction = function() {
  27550. var e = null
  27551. , t = null
  27552. , i = !1
  27553. , n = function() {
  27554. if (e = null,
  27555. this.actionSequence.length > 0) {
  27556. var i = this.actionSequence[0].start
  27557. , n = this.actionSequence[this.actionSequence.length - 1].end;
  27558. 1 === i ? o(n, t) : a(i, n, t)
  27559. }
  27560. this.reset()
  27561. };
  27562. return function(r, o, a) {
  27563. if (r !== o) {
  27564. i || (n = n.bind(this),
  27565. i = !0),
  27566. e && (window.clearTimeout(e),
  27567. e = null),
  27568. a === t && this.actionSequenceInProgress || (this.reset(),
  27569. t = a),
  27570. this.actionSequenceInProgress = !0;
  27571. var s = {
  27572. start: r,
  27573. end: o
  27574. };
  27575. this.actionSequence.push(s),
  27576. e = window.setTimeout(n, 150)
  27577. }
  27578. }
  27579. }(),
  27580. t.exports = n
  27581. }
  27582. , {
  27583. "../analytics": 4
  27584. }],
  27585. 180: [function(e, t, i) {
  27586. "use strict";
  27587. function n(e) {
  27588. void 0 === e.timeout && (e.timeout = 1 / 0);
  27589. var t = e.hash || o
  27590. , i = {
  27591. data: e.start,
  27592. g: 0,
  27593. h: e.heuristic(e.start)
  27594. }
  27595. , n = i;
  27596. i.f = i.h;
  27597. var h = new s
  27598. , u = new l(a)
  27599. , d = c();
  27600. u.push(i),
  27601. d.set(t(i.data), i);
  27602. for (var p = new Date; u.size(); ) {
  27603. if (new Date - p > e.timeout)
  27604. return {
  27605. status: "timeout",
  27606. cost: n.g,
  27607. path: r(n)
  27608. };
  27609. var f = u.pop();
  27610. if (d.delete(t(f.data)),
  27611. e.isEnd(f.data))
  27612. return {
  27613. status: "success",
  27614. cost: f.g,
  27615. path: r(f)
  27616. };
  27617. h.add(t(f.data));
  27618. for (var g = e.neighbor(f.data), m = 0; m < g.length; m++) {
  27619. var v = g[m];
  27620. if (!h.contains(t(v))) {
  27621. var A = f.g + e.distance(f.data, v)
  27622. , y = d.get(t(v))
  27623. , C = !1;
  27624. if (void 0 === y)
  27625. y = {
  27626. data: v
  27627. },
  27628. d.set(t(v), y);
  27629. else {
  27630. if (y.g < A)
  27631. continue;
  27632. C = !0
  27633. }
  27634. y.parent = f,
  27635. y.g = A,
  27636. y.h = e.heuristic(v),
  27637. y.f = A + y.h,
  27638. y.h < n.h && (n = y),
  27639. C ? u.heapify() : u.push(y)
  27640. }
  27641. }
  27642. }
  27643. return {
  27644. status: "noPath",
  27645. cost: n.g,
  27646. path: r(n)
  27647. }
  27648. }
  27649. function r(e) {
  27650. if (void 0 !== e.parent) {
  27651. var t = r(e.parent);
  27652. return t.push(e.data),
  27653. t
  27654. }
  27655. return [e.data]
  27656. }
  27657. function o(e) {
  27658. return e.toString()
  27659. }
  27660. function a(e, t) {
  27661. return e.f - t.f
  27662. }
  27663. var s = e("Set")
  27664. , l = e("heap")
  27665. , c = e("dict");
  27666. t.exports = n
  27667. }
  27668. , {
  27669. Set: 196,
  27670. dict: 210,
  27671. heap: 211
  27672. }],
  27673. 181: [function(e, t, i) {
  27674. (function(i) {
  27675. "use strict";
  27676. function n(e, t, i) {
  27677. var n = new XMLHttpRequest;
  27678. if (i && "withCredentials"in n)
  27679. n.open(e, t, i);
  27680. else if ("undefined" != typeof XDomainRequest)
  27681. n = new XDomainRequest,
  27682. n.open(e, t);
  27683. else {
  27684. if (i)
  27685. throw "Browser does not support CORS!";
  27686. n.open(e, t)
  27687. }
  27688. return n
  27689. }
  27690. function r(e, t, i) {
  27691. function o() {
  27692. u.warn("Retrying ", t),
  27693. r(e, t, i).done(c.resolve.bind(c)).progress(c.notify.bind(c)).fail(c.reject.bind(c))
  27694. }
  27695. function a(e, t) {
  27696. var i = e.response;
  27697. if ("json" === t && "object" != typeof i)
  27698. try {
  27699. i = JSON.parse(e.responseText)
  27700. } catch (e) {
  27701. return void c.reject({
  27702. error: "Failed parsing JSON"
  27703. })
  27704. }
  27705. else if ("image/jpeg" === t) {
  27706. var n = new Uint8Array(e.response)
  27707. , r = new Blob([n],{
  27708. type: "image/jpeg"
  27709. })
  27710. , o = URL.createObjectURL(r);
  27711. i = new Image,
  27712. i.src = o,
  27713. i.crossOrigin = "Anonymous",
  27714. i.onload = function() {
  27715. URL.revokeObjectURL(o)
  27716. }
  27717. }
  27718. return i
  27719. }
  27720. var s = n(e, t, !1);
  27721. if (i = i || {},
  27722. i.retries = void 0 !== i.retries ? i.retries : 0,
  27723. i.retry = void 0 !== i.retry ? i.retry : "get" === e.toLowerCase(),
  27724. i.responseType)
  27725. if (["arraybuffer", "text", "json"].indexOf(i.responseType) > -1)
  27726. s.responseType = i.responseType;
  27727. else {
  27728. if ("image/jpeg" !== i.responseType)
  27729. throw new Error('reponseType can only be one of "arraybuffer", "text" or "json", "image/jpeg"');
  27730. s.responseType = "arraybuffer"
  27731. }
  27732. if ("json" === i.responseType && s.setRequestHeader("Accept", "application/json"),
  27733. i.auth && s.setRequestHeader("Authorization", i.auth),
  27734. "object" == typeof i.data && (i.data = JSON.stringify(i.data),
  27735. s.setRequestHeader("Content-Type", "application/json")),
  27736. "object" == typeof i.headers)
  27737. for (var l in i.headers)
  27738. s.setRequestHeader(l, i.headers[l]);
  27739. var c = $.Deferred();
  27740. return s.onreadystatechange = function(e) {
  27741. if (4 === this.readyState)
  27742. if (this.status >= 500 && this.status <= 600 && i.retry && i.retries < 3)
  27743. i.retries++,
  27744. setTimeout(o, 1e3);
  27745. else if (200 === this.status) {
  27746. var t = a(this, i.responseType);
  27747. c.resolve(t)
  27748. } else
  27749. c.reject(this)
  27750. }
  27751. ,
  27752. s.onprogress = function(e) {
  27753. c.notify(e)
  27754. }
  27755. ,
  27756. s.send(i.data),
  27757. c.promise()
  27758. }
  27759. function o(e) {
  27760. return Object.keys(e).sort().map(function(t) {
  27761. return {
  27762. key: t,
  27763. value: e[t]
  27764. }
  27765. })
  27766. }
  27767. function a(e, t) {
  27768. var i = t.responseType || null
  27769. , n = t.auth || null
  27770. , r = t.prefetchFrom || null
  27771. , a = e + "__" + i + "__" + n + "__" + r;
  27772. return t.headers && o(t.headers).forEach(function(e) {
  27773. a += "__" + e.key + ":" + e.value
  27774. }),
  27775. a
  27776. }
  27777. function s(e, t) {
  27778. return window.MP_REQUEST_CACHE ? window.MP_REQUEST_CACHE[a(e, t)] : null
  27779. }
  27780. function l(e, t, i) {
  27781. window.MP_REQUEST_CACHE && (window.MP_REQUEST_CACHE[a(e, t)] = i)
  27782. }
  27783. var c = e("./logger")
  27784. , h = e("../ab")
  27785. , u = new c(i);
  27786. window.URL = window.URL || window.webkitURL,
  27787. window.MP_REQUEST_CACHE = window.MP_REQUEST_CACHE || {},
  27788. window.MP_PREFETCHED_MODELDATA = window.MP_PREFETCHED_MODELDATA || {}
  27789. /* setTimeout(function() {//MP-- xzw delete
  27790. window.MP_REQUEST_CACHE = null,
  27791. window.MP_PREFETCHED_MODELDATA = {}
  27792. }, 6e4),
  27793. window.onpageshow = function(e) {
  27794. e.persisted && (window.MP_REQUEST_CACHE = null,
  27795. window.MP_PREFETCHED_MODELDATA = {})
  27796. } */
  27797. ,
  27798. t.exports = {
  27799. get: function(e, t) {
  27800. t = t || {};
  27801. var i = void 0 === t.cache || t.cache;
  27802. if (i) {
  27803. var n = s(e, t);
  27804. if (n)
  27805. return n
  27806. }
  27807. var o;
  27808. return o = t.prefetchFrom && window.MP_PREFETCHED_MODELDATA[t.prefetchFrom] ? $.when(window.MP_PREFETCHED_MODELDATA[t.prefetchFrom]) : r("GET", e, t),
  27809. i && l(e, t, o),
  27810. o
  27811. },
  27812. post: function(e, t) {
  27813. return r("POST", e, t)
  27814. },
  27815. patch: function(e, t) {
  27816. return r("PATCH", e, t)
  27817. },
  27818. getImage: function(e, t) {
  27819. function i() {
  27820. u.warn("Retrying ", e),
  27821. o.getImage(e, t - 1).done(n.resolve.bind(n)).progress(n.notify.bind(n)).fail(n.reject.bind(n))
  27822. }
  27823. var n = $.Deferred()
  27824. , r = new Image
  27825. , o = this;
  27826. return e = h.changeIfImageOptimzing(e),
  27827. null !== t && void 0 !== t || (t = 3),
  27828. r.onerror = function() {
  27829. t > 0 ? setTimeout(i, 1e3) : n.reject()
  27830. }
  27831. ,
  27832. r.onload = function() {
  27833. n.resolve(r)
  27834. }
  27835. ,
  27836. r.crossOrigin = "anonymous",
  27837. r.src = e,
  27838. n
  27839. }
  27840. }
  27841. }
  27842. ).call(this, "/js/util/ajax.js")
  27843. }
  27844. , {
  27845. "../ab": 3,
  27846. "./logger": 189
  27847. }],
  27848. 182: [function(e, t, i) {
  27849. "use strict";
  27850. function n(e, t) {
  27851. var i = window.navigator.userAgent
  27852. , n = i.match(e);
  27853. return n = n ? n[1].split(t) : [],
  27854. {
  27855. major: parseInt(n[0]) || 0,
  27856. minor: parseInt(n[1]) || 0,
  27857. patch: parseInt(n[2]) || 0
  27858. }
  27859. }
  27860. var r = e("../exception/DeviceMismatchException");
  27861. t.exports = {
  27862. isFullscreen: function() {
  27863. return document.fullscreenElement || document.mozFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || document.msFullscreenElement
  27864. },
  27865. supportsFullscreen: function() {
  27866. return document.fullscreenEnabled || document.mozFullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled
  27867. },
  27868. isPointerLocked: function() {
  27869. return document.pointerLockElement || document.mozPointerLockElement || document.webkitPointerLockElement
  27870. },
  27871. requestFullscreen: function(e, t) {
  27872. e.requestFullscreen ? e.requestFullscreen() : e.mozRequestFullScreen ? e.mozRequestFullScreen() : e.webkitRequestFullscreen ? e.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT) : e.msRequestFullscreen && e.msRequestFullscreen(),
  27873. t && $(document).on("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", browser.requestPointerLock)
  27874. },
  27875. requestPointerLock: function() {
  27876. var e;
  27877. if (document.fullscreenElement)
  27878. e = document.fullscreenElement();
  27879. else if (document.mozFullscreenElement)
  27880. e = document.mozFullscreenElement();
  27881. else if (document.mozFullScreenElement)
  27882. e = document.mozFullScreenElement();
  27883. else {
  27884. if (!document.webkitFullscreenElement)
  27885. return;
  27886. e = document.webkitFullscreenElement()
  27887. }
  27888. e.requestPointerLock = e.requestPointerLock || e.mozRequestPointerLock || e.webkitRequestPointerLock,
  27889. e.requestPointerLock(),
  27890. $(document).off("fullscreenchange webkitfullscreenchange mozfullscreenchange MSFullscreenChange", this)
  27891. },
  27892. exitPointerLock: function() {
  27893. document.exitPointerLock = document.exitPointerLock || document.mozExitPointerLock || document.webkitExitPointerLock,
  27894. document.exitPointerLock()
  27895. },
  27896. exitFullscreen: function() {
  27897. document.exitFullscreen ? document.exitFullscreen() : document.msExitFullscreen ? document.msExitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitExitFullscreen && document.webkitExitFullscreen()
  27898. },
  27899. details: function() {
  27900. var e = navigator.userAgent.match("(Firefox|Chrome|Safari)/([\\d]+)");
  27901. return e ? {
  27902. name: e[1],
  27903. version: parseInt(e[2]),
  27904. platform: navigator.platform
  27905. } : {}
  27906. },
  27907. is: function(e) {
  27908. return this.details() && this.details().name === e
  27909. },
  27910. inIframe: function() {
  27911. return window.parent !== window
  27912. },
  27913. aspectRatio: function() {
  27914. var e = $("#player").width() / $("#player").height();
  27915. return isFinite(e) ? e : 0
  27916. },
  27917. userAgent: function() {
  27918. return window.navigator.userAgent
  27919. },
  27920. isMobile: function() {
  27921. var e = navigator.userAgent || navigator.vendor || window.opera;
  27922. return /(android|bb\d+|meego).+mobile|android|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(e) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(e.substr(0, 4))
  27923. },
  27924. isLandscape: function() {
  27925. return this.isMobile && this.aspectRatio() > 1
  27926. },
  27927. isSmallScreen: function() {
  27928. var e = screen.width / window.devicePixelRatio;
  27929. return e < 240
  27930. },
  27931. detectIE: function() {
  27932. var e = window.navigator.userAgent
  27933. , t = e.indexOf("MSIE ");
  27934. return t !== -1 || !!navigator.userAgent.match(/Trident.*rv\:11\./)
  27935. },
  27936. detectSafari: function() {
  27937. var e = window.navigator.userAgent
  27938. , t = e.indexOf("Safari");
  27939. return t !== -1 && !this.detectChrome()
  27940. },
  27941. detectFirefox: function() {
  27942. var e = window.navigator.userAgent;
  27943. return e.indexOf("Firefox") !== -1
  27944. },
  27945. detectChrome: function() {
  27946. var e = window.navigator.userAgent;
  27947. return e.indexOf("Chrome") !== -1 && !this.detectOpera()
  27948. },
  27949. detectOpera: function() {
  27950. var e = window.navigator.userAgent;
  27951. return e.indexOf("OPR") !== -1
  27952. },
  27953. detectIOS: function() {
  27954. return this.detectIPhone() || this.detectIPad() || this.detectIPod()
  27955. },
  27956. detectIPad: function() {
  27957. var e = window.navigator.userAgent
  27958. , t = /iPad/;
  27959. return t.test(e)
  27960. },
  27961. detectIPod: function() {
  27962. var e = window.navigator.userAgent
  27963. , t = /iPod/;
  27964. return t.test(e)
  27965. },
  27966. detectIPhone: function() {
  27967. var e = window.navigator.userAgent
  27968. , t = /iPhone/;
  27969. return t.test(e)
  27970. },
  27971. detectAndroid: function() {
  27972. var e = window.navigator.userAgent;
  27973. return e.indexOf("Android") !== -1
  27974. },
  27975. detectAndroidMobile: function() {
  27976. var e = window.navigator.userAgent;
  27977. return this.detectAndroid() && e.indexOf("Mobile") !== -1
  27978. },
  27979. detectSamsungNative: function() {
  27980. var e = window.navigator.userAgent;
  27981. return e.indexOf("SM-G900H") !== -1 || e.indexOf("GT-I9500") !== -1 || e.indexOf("SM-N900") !== -1
  27982. },
  27983. detectSamsungS6: function() {
  27984. var e = window.navigator.userAgent;
  27985. return e.indexOf("SM-G92") !== -1
  27986. },
  27987. detectWebVR: function() {
  27988. return !(!window.navigator.getVRDisplays || !window.VRDisplay)
  27989. },
  27990. getVRDisplay: function() {
  27991. var e = $.Deferred();
  27992. return this.detectWebVR() ? (navigator.getVRDisplays().then(function(t) {
  27993. t.length >= 1 && e.resolve(t[0]),
  27994. e.reject(null)
  27995. }),
  27996. e) : e.reject(null)
  27997. },
  27998. iosVersion: function() {
  27999. if (!this.detectIOS())
  28000. throw new r("Did not detect an iDevice");
  28001. var e = /((?:\d+\_?){1,3}) like Mac OS/
  28002. , t = "_";
  28003. return n(e, t)
  28004. },
  28005. androidVersion: function() {
  28006. if (!this.detectAndroid())
  28007. throw new r("Did not detect an Android based device");
  28008. var e = /Android ((?:\d+\.?){1,3})/
  28009. , t = ".";
  28010. return n(e, t)
  28011. },
  28012. valueFromCookie: function(e, t) {
  28013. var i = new RegExp(e + "=([0-9a-f]+)(; ?|$)").exec(document.cookie);
  28014. if (!i)
  28015. return t;
  28016. var n = i[1];
  28017. return "boolean" == typeof t ? "true" === n || "1" === n : "number" == typeof t ? parseFloat(n) : n
  28018. },
  28019. valueFromHash: function(e, t) {
  28020. var i = new RegExp("[#&?]" + e + "=([^#&?]*)")
  28021. , n = i.exec(window.location.href);
  28022. if (!n)
  28023. return t;
  28024. var r = n[1];
  28025. return "boolean" == typeof t ? "true" === r || "1" === r : "number" == typeof t ? parseFloat(r) : window.decodeURIComponent(r)
  28026. }
  28027. }
  28028. }
  28029. , {
  28030. "../exception/DeviceMismatchException": 56
  28031. }],
  28032. 183: [function(e, t, i) {
  28033. (function(i) {
  28034. "use strict";
  28035. function n(e, t) {
  28036. var i = r(t);
  28037. if (Object.keys(i).length > 0)
  28038. return i;
  28039. if (e.heroImage)
  28040. i = o(e, t);
  28041. else if (e.data.camera_start) {
  28042. var n = e.data.camera_start;
  28043. try {
  28044. Object.keys(n).length > 0 && !l.isEmptyQuaternion(n.camera.quaternion) && (i.mode = h.convertWorkshopModeInt(n.mode),
  28045. i.position = n.camera.position,
  28046. //i.quaternion = n.camera.quaternion,
  28047. i.quaternion = new th.Quaternion().fromArray(n.camera.quaternion),//xzw
  28048. i.zoom = l.convertWorkshopOrthoZoom(n.camera.zoom),
  28049. n.pano && (i.pano = t.get(n.pano.uuid) || t.findClosest(i.position),
  28050. d.debug("Using camera_start"),
  28051. d.debug("Modeldata pano: ", i.pano.quaternion),
  28052. d.debug("Camera start pano: ", n.pano.quaternion)),
  28053. i.mode !== h.PANORAMA && (i.floorVisibility = e.heroImage.metadata.floor_visibility))
  28054. } catch (e) {
  28055. d.warn(e.message)
  28056. }
  28057. }
  28058. if (e.outsideAllowed() || i.mode === h.PANORAMA || (i = {}),
  28059. i.mode === h.MESH && i.position && (i.mode = h.PANORAMA,
  28060. i.pano = t.findClosest(i.position),
  28061. i.quaternion = i.pano.quaternion),
  28062. 0 === Object.keys(i).length) {
  28063. var a = t.list[0];
  28064. a && (i.mode = h.PANORAMA,
  28065. i.pano = a,
  28066. i.position = a.position,
  28067. i.quaternion = a.quaternion,
  28068. d.info("Starting at 1st pano " + a.id))
  28069. }
  28070. return i.mode = i.mode || h.DOLLHOUSE,
  28071. i
  28072. }
  28073. function r(e) {
  28074. var t = c.valueFromHash("start", "")
  28075. , i = {};
  28076. if ("" !== t) {
  28077. d.debug("Start override found in parameters, trying to parse..."),
  28078. i = a(t) || {};
  28079. var n = c.valueFromHash("tag", null);
  28080. n && (i.tag = n),
  28081. i.panoId && (i.pano = e.get(i.panoId))
  28082. }
  28083. return i
  28084. }
  28085. function o(e, t) {
  28086. if (!e.heroImage || !e.heroImage.metadata.camera_position)
  28087. return {};
  28088. var i = {}
  28089. , n = e.heroImage.metadata;
  28090. d.debug("Using start position from thumbnail image"),
  28091. i.position = n.camera_position,
  28092. i.quaternion = n.camera_quaternion;
  28093. try {
  28094. i.mode = h.convertWorkshopModeInt(n.camera_mode),
  28095. i.mode === h.PANORAMA ? i.pano = t.get(n.scan_id) : i.floorVisibility = n.floor_visibility
  28096. } catch (e) {
  28097. d.debug(e.message)
  28098. }
  28099. return i
  28100. }
  28101. function a(e) {
  28102. return s.deserialize(e)
  28103. }
  28104. var s = e("../controls/serializer")
  28105. , l = e("../util/math")
  28106. , c = e("./browser")
  28107. , h = e("../enum/Viewmode")
  28108. , u = e("../util/logger")
  28109. , th = e("three")//xzw
  28110. , d = new u(i);
  28111. t.exports = {
  28112. getStartCameraOptions: n
  28113. }
  28114. }
  28115. ).call(this, "/js/util/camera.js")
  28116. }
  28117. , {
  28118. "../controls/serializer": 14,
  28119. "../enum/Viewmode": 51,
  28120. "../util/logger": 189,
  28121. "../util/math": 190,
  28122. "./browser": 182,
  28123. "three": 217
  28124. }],
  28125. 184: [function(e, t, i) {
  28126. "use strict";
  28127. function n(e, t, i) {
  28128. return o(e.fov, t, i)
  28129. }
  28130. var r = e("./MathLight")
  28131. , o = function(e, t, i) {
  28132. var n = t
  28133. , o = i
  28134. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (n / o)) * r.DEGREES_PER_RADIAN;
  28135. return a
  28136. }
  28137. , a = function(e, t, i) {
  28138. var n = t
  28139. , o = i
  28140. , a = 2 * Math.atan(Math.tan(e * r.RADIANS_PER_DEGREE / 2) * (o / n)) * r.DEGREES_PER_RADIAN;
  28141. return a
  28142. }
  28143. , s = function(e, t, i, n) {
  28144. var r = o(e, i, n);
  28145. return r > t ? a(t, i, n) : e
  28146. };
  28147. t.exports = {
  28148. clampVFOV: s,
  28149. getHFOVForCamera: n,
  28150. getHFOVFromVFOV: o,
  28151. getVFOVFromHFOV: a
  28152. }
  28153. }
  28154. , {
  28155. "./MathLight": 176
  28156. }],
  28157. 185: [function(e, t, i) {
  28158. "use strict";
  28159. var n = e("three");
  28160. t.exports = {
  28161. delayOneFrame: function(e) {
  28162. window.setTimeout(e, 1)
  28163. },
  28164. normalizeUrl: function(e) {
  28165. return e.replace("https://", "http://")
  28166. },
  28167. domainFromUrl: function(e) {
  28168. var t = /^([^:]*:\/\/)?(www\.)?([^\/]+)/.exec(e);
  28169. return t ? t[3] : e
  28170. },
  28171. average: function(e, t) {
  28172. if (0 === e.length)
  28173. return null;
  28174. for (var i = 0, n = 0, r = 0; r < e.length; r++) {
  28175. var o = t ? e[r][t] : e[r];
  28176. i += o,
  28177. n++
  28178. }
  28179. return i / n
  28180. },
  28181. countUnique: function(e) {
  28182. for (var t = {}, i = 0; i < e.length; i++)
  28183. t[e[i]] = 1 + (t[e[i]] || 0);
  28184. return Object.keys(t).length
  28185. },
  28186. averageVectors: function(e, t) {
  28187. var i = new n.Vector3;
  28188. if (0 === e.length)
  28189. return i;
  28190. for (var r = 0, o = 0; o < e.length; o++) {
  28191. var a = t ? e[o][t] : e[o];
  28192. i.add(a),
  28193. r++
  28194. }
  28195. return i.divideScalar(r)
  28196. },
  28197. equalLists: function(e, t) {
  28198. if (e.length !== t.length)
  28199. return !1;
  28200. for (var i = 0; i < e.length; i++)
  28201. if (e[i] !== t[i])
  28202. return !1;
  28203. return !0
  28204. },
  28205. lowerMedian: function(e, t) {
  28206. if (0 === e.length)
  28207. return null;
  28208. t = t || 2,
  28209. e.sort(function(e, t) {
  28210. return e - t
  28211. });
  28212. var i = Math.floor(e.length / t);
  28213. return e[i]
  28214. },
  28215. stableSort: function(e, t) {
  28216. return e.map(function(e, t) {
  28217. return {
  28218. value: e,
  28219. index: t
  28220. }
  28221. }).sort(function(e, i) {
  28222. var n = t(e.value, i.value);
  28223. return 0 !== n ? n : e.index - i.index
  28224. }).map(function(e) {
  28225. return e.value
  28226. })
  28227. },
  28228. filterAll: function(e, t) {
  28229. return e.filter(function(e) {
  28230. return t.every(function(t) {
  28231. return t(e)
  28232. })
  28233. })
  28234. },
  28235. formatDate: function(e) {
  28236. return [e.getFullYear(), e.getMonth() + 1, e.getDate()].join("-")
  28237. },
  28238. formatDatetime: function(e) {
  28239. return [e.getFullYear(), e.getMonth() + 1, e.getDate(), e.getHours(), e.getMinutes()].join("-")
  28240. },
  28241. randomString: function(e) {
  28242. for (var t = "", i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", n = 0; n < e; n++)
  28243. t += i.charAt(Math.floor(Math.random() * i.length));
  28244. return t
  28245. },
  28246. uint8ToBase64: function(e, t) {
  28247. t && "number" == typeof t || (t = 8192);
  28248. for (var i = [], n = 0; n < e.length; n += t)
  28249. i.push(String.fromCharCode.apply(null, e.subarray(n, n + t)));
  28250. return btoa(i.join(""))
  28251. },
  28252. uuid4: function e(t) {
  28253. return t ? (t ^ 16 * Math.random() >> t / 4).toString(16) : ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, e)
  28254. },
  28255. nth: function(e) {
  28256. return e %= 10,
  28257. 1 === e ? e + "st" : 2 === e ? e + "nd" : 3 === e ? e + "rd" : e + "th"
  28258. },
  28259. extendObject: function(e, t) {
  28260. return Object.keys(t).forEach(function(i) {
  28261. e[i] = t[i]
  28262. }),
  28263. e
  28264. },
  28265. deepExtend: function e(t) {
  28266. t = t || {};
  28267. for (var i = 1; i < arguments.length; i++) {
  28268. var n = arguments[i];
  28269. if (n)
  28270. for (var r in n)
  28271. n.hasOwnProperty(r) && ("object" == typeof n[r] ? t[r] = e(t[r], n[r]) : t[r] = n[r])
  28272. }
  28273. return t
  28274. },
  28275. inherit: function(e, t) {
  28276. e.prototype = Object.create(t.prototype),
  28277. e.prototype.constructor = e
  28278. },
  28279. extend: function(e, t) {
  28280. for (var i in t.prototype)
  28281. e.prototype[i] = t.prototype[i]
  28282. }
  28283. },
  28284. Math.sign = function(e) {
  28285. return e < 0 ? -1 : 1
  28286. }
  28287. }
  28288. , {
  28289. three: 217
  28290. }],
  28291. 186: [function(e, t, i) {
  28292. "use strict";
  28293. var n = {};
  28294. n.linearTween = function(e, t, i, n) {
  28295. return i * e / n + t
  28296. }
  28297. ,
  28298. n.easeInQuad = function(e, t, i, n) {
  28299. return e /= n,
  28300. i * e * e + t
  28301. }
  28302. ,
  28303. n.easeOutQuad = function(e, t, i, n) {
  28304. return e /= n,
  28305. -i * e * (e - 2) + t
  28306. }
  28307. ,
  28308. n.easeInOutQuad = function(e, t, i, n) {
  28309. return e /= n / 2,
  28310. e < 1 ? i / 2 * e * e + t : (e--,
  28311. -i / 2 * (e * (e - 2) - 1) + t)
  28312. }
  28313. ,
  28314. n.easeInCubic = function(e, t, i, n) {
  28315. return e /= n,
  28316. i * e * e * e + t
  28317. }
  28318. ,
  28319. n.easeOutCubic = function(e, t, i, n) {
  28320. return e /= n,
  28321. e--,
  28322. i * (e * e * e + 1) + t
  28323. }
  28324. ,
  28325. n.easeInOutCubic = function(e, t, i, n) {
  28326. return e /= n / 2,
  28327. e < 1 ? i / 2 * e * e * e + t : (e -= 2,
  28328. i / 2 * (e * e * e + 2) + t)
  28329. }
  28330. ,
  28331. n.easeInQuart = function(e, t, i, n) {
  28332. return e /= n,
  28333. i * e * e * e * e + t
  28334. }
  28335. ,
  28336. n.easeOutQuart = function(e, t, i, n) {
  28337. return e /= n,
  28338. e--,
  28339. -i * (e * e * e * e - 1) + t
  28340. }
  28341. ,
  28342. n.easeInOutQuart = function(e, t, i, n) {
  28343. return e /= n / 2,
  28344. e < 1 ? i / 2 * e * e * e * e + t : (e -= 2,
  28345. -i / 2 * (e * e * e * e - 2) + t)
  28346. }
  28347. ,
  28348. n.easeInQuint = function(e, t, i, n) {
  28349. return e /= n,
  28350. i * e * e * e * e * e + t
  28351. }
  28352. ,
  28353. n.easeOutQuint = function(e, t, i, n) {
  28354. return e /= n,
  28355. e--,
  28356. i * (e * e * e * e * e + 1) + t
  28357. }
  28358. ,
  28359. n.easeInOutQuint = function(e, t, i, n) {
  28360. return e /= n / 2,
  28361. e < 1 ? i / 2 * e * e * e * e * e + t : (e -= 2,
  28362. i / 2 * (e * e * e * e * e + 2) + t)
  28363. }
  28364. ,
  28365. n.easeInSine = function(e, t, i, n) {
  28366. return -i * Math.cos(e / n * (Math.PI / 2)) + i + t
  28367. }
  28368. ,
  28369. n.easeOutSine = function(e, t, i, n) {
  28370. return i * Math.sin(e / n * (Math.PI / 2)) + t
  28371. }
  28372. ,
  28373. n.easeInOutSine = function(e, t, i, n) {
  28374. return -i / 2 * (Math.cos(Math.PI * e / n) - 1) + t
  28375. }
  28376. ,
  28377. n.easeInExpo = function(e, t, i, n) {
  28378. return i * Math.pow(2, 10 * (e / n - 1)) + t
  28379. }
  28380. ,
  28381. n.easeOutExpo = function(e, t, i, n) {
  28382. return i * (-Math.pow(2, -10 * e / n) + 1) + t
  28383. }
  28384. ,
  28385. n.easeInOutExpo = function(e, t, i, n) {
  28386. return e /= n / 2,
  28387. e < 1 ? i / 2 * Math.pow(2, 10 * (e - 1)) + t : (e--,
  28388. i / 2 * (-Math.pow(2, -10 * e) + 2) + t)
  28389. }
  28390. ,
  28391. n.easeInCirc = function(e, t, i, n) {
  28392. return e /= n,
  28393. -i * (Math.sqrt(1 - e * e) - 1) + t
  28394. }
  28395. ,
  28396. n.easeOutCirc = function(e, t, i, n) {
  28397. return e /= n,
  28398. e--,
  28399. i * Math.sqrt(1 - e * e) + t
  28400. }
  28401. ,
  28402. n.easeInOutCirc = function(e, t, i, n) {
  28403. return e /= n / 2,
  28404. e < 1 ? -i / 2 * (Math.sqrt(1 - e * e) - 1) + t : (e -= 2,
  28405. i / 2 * (Math.sqrt(1 - e * e) + 1) + t)
  28406. }
  28407. ,
  28408. n.easeInElastic = function(e, t, i, n) {
  28409. var r = 1.70158
  28410. , o = 0
  28411. , a = i;
  28412. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28413. a < Math.abs(i) ? (a = i,
  28414. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28415. -(a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t)
  28416. }
  28417. ,
  28418. n.easeOutElastic = function(e, t, i, n) {
  28419. var r = 1.70158
  28420. , o = 0
  28421. , a = i;
  28422. return 0 === e ? t : 1 === (e /= n) ? t + i : (o || (o = .3 * n),
  28423. a < Math.abs(i) ? (a = i,
  28424. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28425. a * Math.pow(2, -10 * e) * Math.sin((e * n - r) * (2 * Math.PI) / o) + i + t)
  28426. }
  28427. ,
  28428. n.easeInOutElastic = function(e, t, i, n) {
  28429. var r = 1.70158
  28430. , o = 0
  28431. , a = i;
  28432. return 0 === e ? t : 2 === (e /= n / 2) ? t + i : (o || (o = n * (.3 * 1.5)),
  28433. a < Math.abs(i) ? (a = i,
  28434. r = o / 4) : r = o / (2 * Math.PI) * Math.asin(i / a),
  28435. e < 1 ? -.5 * (a * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o)) + t : a * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * n - r) * (2 * Math.PI) / o) * .5 + i + t)
  28436. }
  28437. ,
  28438. n.easeInBack = function(e, t, i, n, r) {
  28439. return void 0 === r && (r = 1.70158),
  28440. i * (e /= n) * e * ((r + 1) * e - r) + t
  28441. }
  28442. ,
  28443. n.easeOutBack = function(e, t, i, n, r) {
  28444. return void 0 === r && (r = 1.70158),
  28445. i * ((e = e / n - 1) * e * ((r + 1) * e + r) + 1) + t
  28446. }
  28447. ,
  28448. n.easeInOutBack = function(e, t, i, n, r) {
  28449. return void 0 === r && (r = 1.70158),
  28450. (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
  28451. }
  28452. ,
  28453. n.easeOutBounce = function(e, t, i, n) {
  28454. return (e /= n) < 1 / 2.75 ? i * (7.5625 * e * e) + t : e < 2 / 2.75 ? i * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t : e < 2.5 / 2.75 ? i * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t : i * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
  28455. }
  28456. ,
  28457. n.easeInBounce = function(e, t, i, r) {
  28458. return i - n.easeOutBounce(r - e, 0, i, r) + t
  28459. }
  28460. ,
  28461. n.easeInOutBounce = function(e, t, i, r) {
  28462. return e < r / 2 ? .5 * n.easeInBounce(2 * e, 0, i, r) + t : .5 * n.easeOutBounce(x, 2 * e - r, 0, i, r) + .5 * i + t
  28463. }
  28464. ,
  28465. t.exports = n
  28466. }
  28467. , {}],
  28468. 187: [function(e, t, i) {
  28469. "use strict";
  28470. function n() {
  28471. this.events = [],
  28472. this.valid = !1
  28473. }
  28474. var r = e("../enum/Joystick");
  28475. n.prototype.push = function(e, t) {
  28476. this.events.push({
  28477. direction: e,
  28478. pano: t
  28479. }),
  28480. this.valid = !0
  28481. }
  28482. ,
  28483. n.prototype.pop = function(e) {
  28484. var t = this.events.pop();
  28485. return this.events.length < 1 && (this.valid = !1),
  28486. t
  28487. }
  28488. ,
  28489. n.prototype.peek = function() {
  28490. return this.events.length ? this.events[this.events.length - 1] : {
  28491. direction: null,
  28492. pano: null
  28493. }
  28494. }
  28495. ,
  28496. n.prototype.invalidate = function() {
  28497. this.events = [],
  28498. this.valid = !1
  28499. }
  28500. ,
  28501. n.prototype.reversePano = function(e) {
  28502. if (!this.valid)
  28503. return null;
  28504. var t = this.peek();
  28505. return r.opposite(e) === t.direction ? (this.pop(),
  28506. t.pano) : null
  28507. }
  28508. ,
  28509. t.exports = n
  28510. }
  28511. , {
  28512. "../enum/Joystick": 29
  28513. }],
  28514. 188: [function(e, t, i) {
  28515. "use strict";
  28516. t.exports = {
  28517. vector: function(e, t) {
  28518. var i = e.clone();
  28519. return t = t.clone(),
  28520. function(n) {
  28521. e.set(i.x * (1 - n) + t.x * n, i.y * (1 - n) + t.y * n, i.z * (1 - n) + t.z * n)
  28522. }
  28523. },
  28524. quaternion: function(e, t) {
  28525. var i = e.clone();
  28526. return function(n) {
  28527. e.copy(i).slerp(t, n)
  28528. }
  28529. },
  28530. property: function(e, t, i, n) {
  28531. var r = e[t];
  28532. return function(o) {
  28533. e[t] = r * (1 - o) + i * o,
  28534. n && n(e[t])
  28535. }
  28536. },
  28537. uniform: function(e, t, i) {
  28538. var n = e.material.uniforms[t].value;
  28539. return function(r) {
  28540. e.material.uniforms[t] && (e.material.uniforms[t].value = n * (1 - r) + i * r)
  28541. }
  28542. },
  28543. matrix4: function(e, t) {
  28544. var i = e.clone();
  28545. return function(n) {
  28546. for (var r = e.elements, o = i.elements, a = t.elements, s = 0; s < 16; s++)
  28547. r[s] = o[s] * (1 - n) + a[s] * n
  28548. }
  28549. },
  28550. allUniforms: function(e, t, i) {
  28551. var n = e.map(function(e) {
  28552. return this.uniform(e, t, i)
  28553. }
  28554. .bind(this));
  28555. return function(e) {
  28556. n.forEach(function(t) {
  28557. t(e)
  28558. })
  28559. }
  28560. }
  28561. }
  28562. }
  28563. , {}],
  28564. 189: [function(e, t, i) {
  28565. "use strict";
  28566. function n(e) {
  28567. var t, i, o, a, s = e.split("/"), l = "[" + s[s.length - 1].replace(".js", "") + "]", c = {};
  28568. if (n.consoleEnabled) {
  28569. var h = function(e) {
  28570. $("#debug-console").append("<p>" + e + "</p>"),
  28571. $("#debug-console")[0].scrollTop = $("#debug-console")[0].scrollHeight
  28572. };
  28573. t = function(e) {
  28574. h(Array.prototype.slice.call(arguments).join(" "))
  28575. }
  28576. ,
  28577. i = function(e) {
  28578. h(Array.prototype.slice.call(arguments).join(" "))
  28579. }
  28580. ,
  28581. o = function(e) {
  28582. h("WARN: " + Array.prototype.slice.call(arguments).join(" "))
  28583. }
  28584. ,
  28585. a = function(e) {
  28586. h("ERROR: " + Array.prototype.slice.call(arguments).join(" "))
  28587. }
  28588. } else
  28589. console.log ? (t = console.log,
  28590. i = console.info ? console.info : console.log,
  28591. o = console.warn ? console.warn : console.log,
  28592. a = console.error ? console.error : console.log) : t = i = o = a = function() {}
  28593. ;
  28594. var u = function(e) {
  28595. return [l, n.timestamp()].concat(Array.prototype.slice.call(e))
  28596. }
  28597. , d = function(t, i) {
  28598. if (r) {
  28599. var o = Array.prototype.slice.call(t).join(" ");
  28600. r.captureMessage(o, {
  28601. level: i,
  28602. path: e,
  28603. timestamp: n.timestamp()
  28604. })
  28605. }
  28606. }
  28607. , p = function(t, i) {
  28608. if (r) {
  28609. var o = Array.prototype.slice.call(t).join(" ");
  28610. r.captureException(new Error(o), {
  28611. level: i,
  28612. path: e,
  28613. timestamp: n.timestamp()
  28614. })
  28615. }
  28616. };
  28617. return {
  28618. debug: function() {
  28619. n.level >= n.levels.debug && t.apply(console, u(arguments))
  28620. },
  28621. info: function() {
  28622. n.level >= n.levels.info && i.apply(console, u(arguments))
  28623. },
  28624. warn: function() {
  28625. d(arguments, "warn"),
  28626. n.level >= n.levels.warn && o.apply(console, u(arguments))
  28627. },
  28628. error: function() {
  28629. p(arguments, "error"),
  28630. n.level >= n.levels.error && a.apply(console, u(arguments))
  28631. },
  28632. v3str: function(e, t) {
  28633. var i = void 0 === t ? 2 : t;
  28634. return "(" + e.x.toPrecision(i) + ", " + e.y.toPrecision(i) + ", " + e.z.toPrecision(i) + ")"
  28635. },
  28636. eulstr: function(e, t) {
  28637. var i = void 0 === t ? 2 : t;
  28638. return "(" + THREE.Math.radToDeg(e.x).toPrecision(i) + ", " + THREE.Math.radToDeg(e.y).toPrecision(i) + ", " + THREE.Math.radToDeg(e.z).toPrecision(i) + ' "' + e.order + '")'
  28639. },
  28640. time: function(e) {
  28641. n.level >= n.levels.debug && (c[e] = Date.now())
  28642. },
  28643. timeEnd: function(e) {
  28644. if (n.level >= n.levels.debug) {
  28645. var t = c[e];
  28646. if (!t)
  28647. return;
  28648. var i = (Date.now() - t) / 1e3;
  28649. this.debug(e, i + "s")
  28650. }
  28651. }
  28652. }
  28653. }
  28654. var r = window.Raven;
  28655. n.timestamp = function() {
  28656. return (Date.now() - window.navigationStart) / 1e3 + "s"
  28657. }
  28658. ,
  28659. n.levels = {
  28660. debug: 3,
  28661. info: 2,
  28662. warn: 1,
  28663. error: 0
  28664. },
  28665. n.level = n.levels.info,
  28666. t.exports = n
  28667. }
  28668. , {}],
  28669. 190: [function(e, t, i) {
  28670. "use strict";
  28671. var n = e("three")
  28672. , r = e("../enum/GLCubeFaces")
  28673. , o = e("../constants");
  28674. t.exports = {
  28675. convertVisionVector: function(e) {
  28676. return new n.Vector3(e.x,e.z,-e.y)
  28677. },
  28678. convertVisionQuaternion: function(e) {
  28679. 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)))
  28680. },
  28681. convertWorkshopVector: function(e) {
  28682. return new n.Vector3(-e.x,e.y,e.z)
  28683. },
  28684. convertWorkshopQuaternion: function(e) {
  28685. 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))
  28686. },
  28687. convertWorkshopPanoramaQuaternion: function(e) {
  28688. 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)))
  28689. },
  28690. convertWorkshopOrthoZoom: function(e) {// xzw
  28691. //return e === -1 ? -1 : e / 16 * ($("#player").width() / $("#player").height()) / o.workshopApsect
  28692. //return e;
  28693. return e === -1 ? -1 : e * ($("#player").width() / $("#player").height()) / g_snapShotWidth * g_snapShotHeight;
  28694. },
  28695. toPrecision: function(e, t) {//xzw change
  28696. var f = function(e, t){
  28697. var i = Math.pow(10, t);
  28698. return Math.round(e * i) / i
  28699. }
  28700. if(e instanceof Array){
  28701. for(var s=0; s<e.length; s++){
  28702. e[s] = f(e[s],t);
  28703. }
  28704. return e;
  28705. }
  28706. else return f(e,t)
  28707. },
  28708. isEmptyQuaternion: function(e) {
  28709. return 0 === Math.abs(e.x) && 0 === Math.abs(e.y) && 0 === Math.abs(e.z) && 0 === Math.abs(e.w)
  28710. },
  28711. projectPositionToCanvas: function(e, t, i) {
  28712. i = i || new n.Vector3,
  28713. i.copy(e);
  28714. var r = .5 * $("#player").width()
  28715. , o = .5 * $("#player").height();
  28716. return i.project(t),
  28717. i.x = i.x * r + r,
  28718. i.y = -(i.y * o) + o,
  28719. i
  28720. },
  28721. convertScreenPositionToNDC: function(e, t, i) {
  28722. return i = i || new n.Vector2,
  28723. i.x = e / $("#player").width() * 2 - 1,
  28724. i.y = 2 * -(t / $("#player").height()) + 1,
  28725. i
  28726. },
  28727. constrainedTurn: function(e) {
  28728. var t = e % (2 * Math.PI);
  28729. return t = t > Math.PI ? t -= 2 * Math.PI : t < -Math.PI ? t += 2 * Math.PI : t
  28730. },
  28731. getFOVDotThreshold: function(e) {
  28732. return Math.cos(n.Math.degToRad(e / 2))
  28733. },
  28734. transform2DForwardVectorByCubeFace: function(e, t, i, n) {
  28735. switch (e) {
  28736. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_X:
  28737. i.set(1, t.y, t.x);
  28738. break;
  28739. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
  28740. i.set(-1, t.y, -t.x);
  28741. break;
  28742. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
  28743. i.set(-t.x, 1, -t.y);
  28744. break;
  28745. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
  28746. i.set(-t.x, -1, t.y);
  28747. break;
  28748. case r.GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
  28749. i.set(-t.x, t.y, 1);
  28750. break;
  28751. case r.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
  28752. i.set(t.x, t.y, -1)
  28753. }
  28754. n && i.normalize()
  28755. }
  28756. }
  28757. }
  28758. , {
  28759. "../constants": 8,
  28760. "../enum/GLCubeFaces": 25,
  28761. three: 217
  28762. }],
  28763. 191: [function(e, t, i) {
  28764. "use strict";
  28765. function n(e, t, i) {
  28766. return a.map(function(n, o) {
  28767. return e.get("pan/" + i + "/" + t + "_skybox" + r(n) + ".jpg")
  28768. }
  28769. .bind(this))
  28770. }
  28771. function r(e) {
  28772. return s[e]
  28773. }
  28774. var o = e("../enum/GLCubeFaces")
  28775. , a = [0, 1, 2, 3, 4, 5]
  28776. , s = {
  28777. 0: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Y,
  28778. 1: o.GL_TEXTURE_CUBE_MAP_POSITIVE_Z,
  28779. 2: o.GL_TEXTURE_CUBE_MAP_POSITIVE_X,
  28780. 3: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z,
  28781. 4: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
  28782. 5: o.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
  28783. };
  28784. t.exports = {
  28785. mapFaceToCubemapFace: r,
  28786. getCubemapUrls: n
  28787. }
  28788. }
  28789. , {
  28790. "../enum/GLCubeFaces": 25
  28791. }],
  28792. 192: [function(e, t, i) {
  28793. "use strict";
  28794. t.exports = {
  28795. captureErrors: function(e, t, i) {
  28796. if ("Raven"in window) {
  28797. Raven.config(e, t).install(),
  28798. i && Raven.setTagsContext(i);
  28799. var n = console.warn
  28800. , r = console.error;
  28801. console.warn = function() {
  28802. var e = Array.prototype.slice.call(arguments);
  28803. Raven.captureMessage(e.join(" "), {
  28804. level: "warning"
  28805. }),
  28806. n.apply(console, e)
  28807. }
  28808. ,
  28809. console.error = function() {
  28810. var e = Array.prototype.slice.call(arguments);
  28811. Raven.captureException(new Error(e.join(" ")), {
  28812. level: "error"
  28813. }),
  28814. r.apply(console, e)
  28815. }
  28816. } else
  28817. console.error("Raven not found, not capturing errors.")
  28818. }
  28819. }
  28820. }
  28821. , {}],
  28822. 193: [function(e, t, i) {
  28823. (function(i) {
  28824. "use strict";
  28825. var n = e("./browser")
  28826. , r = e("../constants")
  28827. , o = e("url")
  28828. , a = e("./logger")
  28829. , ss = e('three')
  28830. , s = new a(i)
  28831. , l = {
  28832. getAuthorizationHeader: function() {
  28833. var e = n.valueFromHash("auth");
  28834. if (e)
  28835. return e.replace(",", " ");
  28836. var t = n.valueFromCookie("token");
  28837. return t ? "Token " + t : null
  28838. },
  28839. parseSidUrl: function(e) {
  28840. var t, i;
  28841. t=g_Prefix;
  28842. if (e = e || "",
  28843. e.match(/^https?/)) {
  28844. var n = o.parse(e);
  28845. t = g_Prefix,
  28846. i = e
  28847. } else //xzw 原先的不能用
  28848. //t = window.location.protocol + "//" + window.location.host, //MP
  28849. t = g_Prefix
  28850. //i = t + "/api/player/models/" + e; //MP
  28851. i = t + "data/" + e;
  28852. return {
  28853. urlBase: t,
  28854. urlModel: i,
  28855. urlFiles: i + (i.match(/\/$/) ? "files" : "/files"),
  28856. urlThumb: i + (i.match(/\/$/) ? "thumb" : "/thumb")
  28857. }
  28858. },
  28859. getModelIDFromQueryString: function() {
  28860. return n.valueFromHash("model") || n.valueFromHash("m")
  28861. },
  28862. normalizeModeldata: function(e, t) {//xzw 修改导览images数据
  28863. e = JSON.parse(JSON.stringify(e));
  28864. var i = null;
  28865. if (e.images.forEach(function(n) {
  28866. if(!n.metadata) return;
  28867. if ("string" == typeof n.metadata)
  28868. try {
  28869. n.metadata = JSON.parse(n.metadata)
  28870. } catch (e) {
  28871. s.warn("Unable to parse image metadata"),
  28872. n.metadata = null
  28873. }
  28874. else{
  28875. "object" == typeof n.metadata && s.debug("image.metadata already a JSON object");
  28876. }
  28877. if(n.metadata.camera_position instanceof Array){//xzw 改的格式
  28878. n.metadata.camera_position = new ss.Vector3().fromArray(n.metadata.camera_position);
  28879. n.metadata.camera_quaternion = new ss.Quaternion().fromArray(n.metadata.camera_quaternion);
  28880. }else{
  28881. n.metadata.camera_quaternion && (n.metadata.camera_quaternion = t.convertWorkshopQuaternion(n.metadata.camera_quaternion)),
  28882. n.metadata.camera_position && (n.metadata.camera_position = t.convertWorkshopVector(n.metadata.camera_position))
  28883. }
  28884. !i && e.icon && e.icon === n.sid && (i = n.metadata)
  28885. }),
  28886. //icon初始视角的:
  28887. i && i.camera_quaternion && i.camera_position && i.scan_position && i.scan_quaternion) {
  28888. var n = {};
  28889. n.pano = {
  28890. quaternion: t.convertWorkshopPanoramaQuaternion(i.scan_quaternion),
  28891. position: t.convertWorkshopVector(i.scan_position),
  28892. uuid: i.scan_id
  28893. },
  28894. n.camera = {
  28895. quaternion: i.camera_quaternion,
  28896. position: i.camera_position
  28897. },
  28898. e.startPano = n
  28899. }
  28900. return e
  28901. },
  28902. visionVersionToInt: function() {
  28903. var e = new RegExp(["(?:[0-9.]+\\.){1,4}", "([0-9]+)", "[^\\.]*$"].join(""));
  28904. return function(t) {
  28905. if (!t)
  28906. throw new Error("Vision version is required");
  28907. var i = e.exec(t);
  28908. if (null === i)
  28909. throw new Error("String is not a vision version: " + t);
  28910. return parseInt(i[1])
  28911. }
  28912. }(),
  28913. modelDataPromisesTiles: function(e) {
  28914. if (e.vision_version)
  28915. try {
  28916. return l.visionVersionToInt(e.vision_version) >= l.visionVersionToInt(r.visionTilingStartVersion)
  28917. } catch (t) {
  28918. s.warn("Invalid vision version: " + e.vision_version)
  28919. }
  28920. var t = e.created ? new Date(e.created) : null;
  28921. return t && t >= r.visionTilingStartDate
  28922. }
  28923. };
  28924. t.exports = l
  28925. }
  28926. ).call(this, "/js/util/showcase.js")
  28927. }
  28928. , {
  28929. "../constants": 8,
  28930. "./browser": 182,
  28931. "./logger": 189,
  28932. three:217,
  28933. url: 208
  28934. }],
  28935. 194: [function(e, t, i) {
  28936. "use strict";
  28937. var n = e("../util/ajax")
  28938. , r = e("three")
  28939. , o = e("../settings")
  28940. , a = {};
  28941. t.exports = {
  28942. load: function(e, t, i) {
  28943. var s = a[e];
  28944. return s ? (t && setTimeout(function() {
  28945. t(s)
  28946. }, 1),
  28947. s) : (s = new r.Texture,
  28948. o.minimalMemoryMode && (s.minFilter = r.LinearFilter,
  28949. s.magFilter = r.LinearFilter,
  28950. s.generateMipmaps = !1),
  28951. s.sourceFile = e,
  28952. a[e] = s,
  28953. n.getImage(e).then(function(e) {
  28954. s.image = e,
  28955. s.needsUpdate = !0,
  28956. t && t(s)
  28957. }).fail(i),
  28958. s)
  28959. },
  28960. loadBase64: function(e, t) {
  28961. t = t || "png";
  28962. var i = new r.Texture;
  28963. return i.image = document.createElement("img"),
  28964. i.image.setAttribute("src", "data:image/" + t + ";base64," + e),
  28965. o.minimalMemoryMode && (i.minFilter = r.LinearFilter,
  28966. i.magFilter = r.LinearFilter,
  28967. i.generateMipmaps = !1),
  28968. i.needsUpdate = !0,
  28969. i
  28970. },
  28971. isLoaded: function(e) {
  28972. return !!a[e]
  28973. }
  28974. }
  28975. }
  28976. , {
  28977. "../settings": 166,
  28978. "../util/ajax": 181,
  28979. three: 217
  28980. }],
  28981. 195: [function(e, t, i) {
  28982. "use strict";
  28983. var n = e("./easing");
  28984. t.exports = {
  28985. globalDone: null,
  28986. funcs: [],
  28987. counter: 0,
  28988. uniqueID: 0,
  28989. start: function(e, t, i, r, o, a, s) {
  28990. return r = r || 0,
  28991. this.funcs.push({
  28992. func: e,
  28993. current: -r * Math.abs(t),
  28994. duration: (1 - Math.max(r, 0)) * Math.abs(t),
  28995. done: i,
  28996. easing: o || n.linearTween,
  28997. cycling: t < 0,
  28998. running: !0,
  28999. debug: r < 0,
  29000. name: a || "T" + this.counter,
  29001. id: void 0 === s ? this.counter : s,
  29002. paused: !1
  29003. }),
  29004. e(0, 16),
  29005. this.counter += 1,
  29006. e
  29007. },
  29008. trigger: function(e) {
  29009. var t = void 0 === e.delayRatio ? 0 : e.delayRatio
  29010. , i = e.func || function() {}
  29011. , r = void 0 === e.duration ? 0 : e.duration;
  29012. void 0 !== e.cycling && e.cycling && (r = -Math.abs(r));
  29013. var o = e.done || null
  29014. , a = e.easing || n.linearTween
  29015. , s = e.name || "R" + this.counter
  29016. , l = void 0 === e.id ? this.counter : e.id;
  29017. return this.start(i, r, o, t, a, s, l)
  29018. },
  29019. setTimeout: function(e, t, i) {
  29020. var n = void 0 === i ? this.counter : i;
  29021. return this.trigger({
  29022. done: e,
  29023. duration: void 0 === t ? 0 : t,
  29024. name: "O" + this.counter,
  29025. id: n
  29026. })
  29027. },
  29028. pause: function() {
  29029. this.paused = !0
  29030. },
  29031. resume: function() {
  29032. this.paused = !1
  29033. },
  29034. update: function(e) {
  29035. this.funcs.forEach(function(t) {
  29036. if (!(t.paused || (t.current += 1e3 * e,
  29037. t.current < 0)))
  29038. if (t.current >= t.duration && !t.cycling) {
  29039. var i = t.easing(1, 0, 1, 1);
  29040. t.func(i, 1e3 * e),
  29041. t.done && t.done(),
  29042. t.running = !1
  29043. } else {
  29044. var n = t.easing(t.current % t.duration / t.duration, 0, 1, 1)
  29045. , r = t.func(n, 1e3 * e) || !1;
  29046. r && (t.done && t.done(),
  29047. t.running = !1)
  29048. }
  29049. });
  29050. var t = this.funcs.length;
  29051. this.funcs = this.funcs.filter(function(e) {
  29052. return e.running
  29053. });
  29054. var i = this.funcs.length;
  29055. if (t > 0 && 0 === i && this.globalDone) {
  29056. var n = this.globalDone;
  29057. this.globalDone = null,
  29058. n()
  29059. }
  29060. },
  29061. adjustSpeed: function(e, t) {
  29062. for (var i = this.getById(e), n = 0; n < i.length; n++) {
  29063. var r = i[n];
  29064. r.duration /= t,
  29065. r.current /= t
  29066. }
  29067. },
  29068. getById: function(e) {
  29069. return this.funcs.filter(function(t) {
  29070. return e === t.id
  29071. })
  29072. },
  29073. get: function(e) {
  29074. for (var t = 0; t < this.funcs.length; t += 1)
  29075. if (this.funcs[t].func === e)
  29076. return this.funcs[t];
  29077. return null
  29078. },
  29079. isRunning: function(e) {
  29080. var t = this.get(e);
  29081. return null !== t && t.running
  29082. },
  29083. countActive: function() {
  29084. for (var e = 0, t = 0; t < this.funcs.length; t += 1)
  29085. e += this.funcs[t].running;
  29086. return e
  29087. },
  29088. listActive: function() {
  29089. for (var e = [], t = 0; t < this.funcs.length; t += 1)
  29090. this.funcs[t].running && e.push(this.funcs[t].name);
  29091. return e
  29092. },
  29093. done: function(e) {
  29094. this.globalDone = e
  29095. },
  29096. cancelById: function(e) {
  29097. var t = void 0 === e ? 0 : e;
  29098. this.funcs = this.funcs.filter(function(e) {
  29099. return e.id !== t
  29100. })
  29101. },
  29102. cancel: function(e) {
  29103. this.funcs = this.funcs.filter(function(t) {
  29104. return t.func !== e
  29105. })
  29106. },
  29107. getUniqueId: function() {
  29108. return this.uniqueID -= 1,
  29109. this.uniqueID
  29110. }
  29111. }
  29112. }
  29113. , {
  29114. "./easing": 186
  29115. }],
  29116. 196: [function(e, t, i) {
  29117. function n(e) {
  29118. if (this.set = {},
  29119. this.infContains = function() {
  29120. return !0
  29121. }
  29122. ,
  29123. "object" == typeof e)
  29124. if (e instanceof Array)
  29125. for (var t = 0; t < e.length; t++)
  29126. this.set[e[t]] = !0;
  29127. else
  29128. this.set = e;
  29129. else if ("function" == typeof e)
  29130. this.infContains = e;
  29131. else if ("undefined" != typeof e)
  29132. throw new Error("set must be either an array or an object.")
  29133. }
  29134. t.exports = n,
  29135. n.prototype.contains = function(e) {
  29136. return !!this.set[e]
  29137. }
  29138. ,
  29139. n.prototype.has = n.prototype.contains,
  29140. n.prototype.add = function(e) {
  29141. if (1 == arguments.length)
  29142. this.set[e] = !0;
  29143. else
  29144. for (var t = 0; t < arguments.length; t++)
  29145. this.set[arguments[t]] = !0
  29146. }
  29147. ,
  29148. n.prototype.addAll = function(e) {
  29149. if ("object" != typeof e && !(e instanceof Array))
  29150. throw new Error("arr must be an array.");
  29151. for (var t = 0; t < e.length; t++)
  29152. this.add(e[t])
  29153. }
  29154. ,
  29155. n.prototype.remove = function(e) {
  29156. if (1 == arguments.length)
  29157. delete this.set[e];
  29158. else
  29159. for (var t = 0; t < arguments.length; t++)
  29160. delete this.set[arguments[t]]
  29161. }
  29162. ,
  29163. n.prototype.delete = n.prototype.remove,
  29164. n.prototype.clear = function() {
  29165. this.set = {}
  29166. }
  29167. ,
  29168. n.prototype.size = function() {
  29169. return Object.keys(this.set).length
  29170. }
  29171. ,
  29172. n.prototype.toString = function() {
  29173. return "{" + Object.keys(this.set).toString() + "}"
  29174. }
  29175. ,
  29176. n.prototype.toArray = function() {
  29177. return "undefined" == typeof this.set ? [] : Object.keys(this.set)
  29178. }
  29179. ,
  29180. n.prototype["*values"] = n.prototype.toArray
  29181. }
  29182. , {}],
  29183. 197: [function(e, t, i) {}
  29184. , {}],
  29185. 198: [function(e, t, i) {
  29186. (function(t) {
  29187. "use strict";
  29188. function n() {
  29189. try {
  29190. var e = new Uint8Array(1);
  29191. return e.__proto__ = {
  29192. __proto__: Uint8Array.prototype,
  29193. foo: function() {
  29194. return 42
  29195. }
  29196. },
  29197. 42 === e.foo() && "function" == typeof e.subarray && 0 === e.subarray(1, 1).byteLength
  29198. } catch (e) {
  29199. return !1
  29200. }
  29201. }
  29202. function r() {
  29203. return a.TYPED_ARRAY_SUPPORT ? 2147483647 : 1073741823
  29204. }
  29205. function o(e, t) {
  29206. if (r() < t)
  29207. throw new RangeError("Invalid typed array length");
  29208. return a.TYPED_ARRAY_SUPPORT ? (e = new Uint8Array(t),
  29209. e.__proto__ = a.prototype) : (null === e && (e = new a(t)),
  29210. e.length = t),
  29211. e
  29212. }
  29213. function a(e, t, i) {
  29214. if (!(a.TYPED_ARRAY_SUPPORT || this instanceof a))
  29215. return new a(e,t,i);
  29216. if ("number" == typeof e) {
  29217. if ("string" == typeof t)
  29218. throw new Error("If encoding is specified then the first argument must be a string");
  29219. return h(this, e)
  29220. }
  29221. return s(this, e, t, i)
  29222. }
  29223. function s(e, t, i, n) {
  29224. if ("number" == typeof t)
  29225. throw new TypeError('"value" argument must not be a number');
  29226. return "undefined" != typeof ArrayBuffer && t instanceof ArrayBuffer ? p(e, t, i, n) : "string" == typeof t ? u(e, t, i) : f(e, t)
  29227. }
  29228. function l(e) {
  29229. if ("number" != typeof e)
  29230. throw new TypeError('"size" argument must be a number');
  29231. if (e < 0)
  29232. throw new RangeError('"size" argument must not be negative')
  29233. }
  29234. function c(e, t, i, n) {
  29235. return l(t),
  29236. 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)
  29237. }
  29238. function h(e, t) {
  29239. if (l(t),
  29240. e = o(e, t < 0 ? 0 : 0 | g(t)),
  29241. !a.TYPED_ARRAY_SUPPORT)
  29242. for (var i = 0; i < t; ++i)
  29243. e[i] = 0;
  29244. return e
  29245. }
  29246. function u(e, t, i) {
  29247. if ("string" == typeof i && "" !== i || (i = "utf8"),
  29248. !a.isEncoding(i))
  29249. throw new TypeError('"encoding" must be a valid string encoding');
  29250. var n = 0 | v(t, i);
  29251. e = o(e, n);
  29252. var r = e.write(t, i);
  29253. return r !== n && (e = e.slice(0, r)),
  29254. e
  29255. }
  29256. function d(e, t) {
  29257. var i = t.length < 0 ? 0 : 0 | g(t.length);
  29258. e = o(e, i);
  29259. for (var n = 0; n < i; n += 1)
  29260. e[n] = 255 & t[n];
  29261. return e
  29262. }
  29263. function p(e, t, i, n) {
  29264. if (t.byteLength,
  29265. i < 0 || t.byteLength < i)
  29266. throw new RangeError("'offset' is out of bounds");
  29267. if (t.byteLength < i + (n || 0))
  29268. throw new RangeError("'length' is out of bounds");
  29269. return t = void 0 === i && void 0 === n ? new Uint8Array(t) : void 0 === n ? new Uint8Array(t,i) : new Uint8Array(t,i,n),
  29270. a.TYPED_ARRAY_SUPPORT ? (e = t,
  29271. e.__proto__ = a.prototype) : e = d(e, t),
  29272. e
  29273. }
  29274. function f(e, t) {
  29275. if (a.isBuffer(t)) {
  29276. var i = 0 | g(t.length);
  29277. return e = o(e, i),
  29278. 0 === e.length ? e : (t.copy(e, 0, 0, i),
  29279. e)
  29280. }
  29281. if (t) {
  29282. if ("undefined" != typeof ArrayBuffer && t.buffer instanceof ArrayBuffer || "length"in t)
  29283. return "number" != typeof t.length || K(t.length) ? o(e, 0) : d(e, t);
  29284. if ("Buffer" === t.type && $(t.data))
  29285. return d(e, t.data)
  29286. }
  29287. throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")
  29288. }
  29289. function g(e) {
  29290. if (e >= r())
  29291. throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + r().toString(16) + " bytes");
  29292. return 0 | e
  29293. }
  29294. function m(e) {
  29295. return +e != e && (e = 0),
  29296. a.alloc(+e)
  29297. }
  29298. function v(e, t) {
  29299. if (a.isBuffer(e))
  29300. return e.length;
  29301. if ("undefined" != typeof ArrayBuffer && "function" == typeof ArrayBuffer.isView && (ArrayBuffer.isView(e) || e instanceof ArrayBuffer))
  29302. return e.byteLength;
  29303. "string" != typeof e && (e = "" + e);
  29304. var i = e.length;
  29305. if (0 === i)
  29306. return 0;
  29307. for (var n = !1; ; )
  29308. switch (t) {
  29309. case "ascii":
  29310. case "latin1":
  29311. case "binary":
  29312. return i;
  29313. case "utf8":
  29314. case "utf-8":
  29315. case void 0:
  29316. return j(e).length;
  29317. case "ucs2":
  29318. case "ucs-2":
  29319. case "utf16le":
  29320. case "utf-16le":
  29321. return 2 * i;
  29322. case "hex":
  29323. return i >>> 1;
  29324. case "base64":
  29325. return Z(e).length;
  29326. default:
  29327. if (n)
  29328. return j(e).length;
  29329. t = ("" + t).toLowerCase(),
  29330. n = !0
  29331. }
  29332. }
  29333. function A(e, t, i) {
  29334. var n = !1;
  29335. if ((void 0 === t || t < 0) && (t = 0),
  29336. t > this.length)
  29337. return "";
  29338. if ((void 0 === i || i > this.length) && (i = this.length),
  29339. i <= 0)
  29340. return "";
  29341. if (i >>>= 0,
  29342. t >>>= 0,
  29343. i <= t)
  29344. return "";
  29345. for (e || (e = "utf8"); ; )
  29346. switch (e) {
  29347. case "hex":
  29348. return L(this, t, i);
  29349. case "utf8":
  29350. case "utf-8":
  29351. return M(this, t, i);
  29352. case "ascii":
  29353. return P(this, t, i);
  29354. case "latin1":
  29355. case "binary":
  29356. return O(this, t, i);
  29357. case "base64":
  29358. return S(this, t, i);
  29359. case "ucs2":
  29360. case "ucs-2":
  29361. case "utf16le":
  29362. case "utf-16le":
  29363. return D(this, t, i);
  29364. default:
  29365. if (n)
  29366. throw new TypeError("Unknown encoding: " + e);
  29367. e = (e + "").toLowerCase(),
  29368. n = !0
  29369. }
  29370. }
  29371. function y(e, t, i) {
  29372. var n = e[t];
  29373. e[t] = e[i],
  29374. e[i] = n
  29375. }
  29376. function C(e, t, i, n, r) {
  29377. if (0 === e.length)
  29378. return -1;
  29379. if ("string" == typeof i ? (n = i,
  29380. i = 0) : i > 2147483647 ? i = 2147483647 : i < -2147483648 && (i = -2147483648),
  29381. i = +i,
  29382. isNaN(i) && (i = r ? 0 : e.length - 1),
  29383. i < 0 && (i = e.length + i),
  29384. i >= e.length) {
  29385. if (r)
  29386. return -1;
  29387. i = e.length - 1
  29388. } else if (i < 0) {
  29389. if (!r)
  29390. return -1;
  29391. i = 0
  29392. }
  29393. if ("string" == typeof t && (t = a.from(t, n)),
  29394. a.isBuffer(t))
  29395. return 0 === t.length ? -1 : I(e, t, i, n, r);
  29396. if ("number" == typeof t)
  29397. return t &= 255,
  29398. a.TYPED_ARRAY_SUPPORT && "function" == typeof Uint8Array.prototype.indexOf ? r ? Uint8Array.prototype.indexOf.call(e, t, i) : Uint8Array.prototype.lastIndexOf.call(e, t, i) : I(e, [t], i, n, r);
  29399. throw new TypeError("val must be string, number or Buffer")
  29400. }
  29401. function I(e, t, i, n, r) {
  29402. function o(e, t) {
  29403. return 1 === a ? e[t] : e.readUInt16BE(t * a)
  29404. }
  29405. var a = 1
  29406. , s = e.length
  29407. , l = t.length;
  29408. if (void 0 !== n && (n = String(n).toLowerCase(),
  29409. "ucs2" === n || "ucs-2" === n || "utf16le" === n || "utf-16le" === n)) {
  29410. if (e.length < 2 || t.length < 2)
  29411. return -1;
  29412. a = 2,
  29413. s /= 2,
  29414. l /= 2,
  29415. i /= 2
  29416. }
  29417. var c;
  29418. if (r) {
  29419. var h = -1;
  29420. for (c = i; c < s; c++)
  29421. if (o(e, c) === o(t, h === -1 ? 0 : c - h)) {
  29422. if (h === -1 && (h = c),
  29423. c - h + 1 === l)
  29424. return h * a
  29425. } else
  29426. h !== -1 && (c -= c - h),
  29427. h = -1
  29428. } else
  29429. for (i + l > s && (i = s - l),
  29430. c = i; c >= 0; c--) {
  29431. for (var u = !0, d = 0; d < l; d++)
  29432. if (o(e, c + d) !== o(t, d)) {
  29433. u = !1;
  29434. break
  29435. }
  29436. if (u)
  29437. return c
  29438. }
  29439. return -1
  29440. }
  29441. function E(e, t, i, n) {
  29442. i = Number(i) || 0;
  29443. var r = e.length - i;
  29444. n ? (n = Number(n),
  29445. n > r && (n = r)) : n = r;
  29446. var o = t.length;
  29447. if (o % 2 !== 0)
  29448. throw new TypeError("Invalid hex string");
  29449. n > o / 2 && (n = o / 2);
  29450. for (var a = 0; a < n; ++a) {
  29451. var s = parseInt(t.substr(2 * a, 2), 16);
  29452. if (isNaN(s))
  29453. return a;
  29454. e[i + a] = s
  29455. }
  29456. return a
  29457. }
  29458. function b(e, t, i, n) {
  29459. return q(j(t, e.length - i), e, i, n)
  29460. }
  29461. function w(e, t, i, n) {
  29462. return q(Y(t), e, i, n)
  29463. }
  29464. function _(e, t, i, n) {
  29465. return w(e, t, i, n)
  29466. }
  29467. function T(e, t, i, n) {
  29468. return q(Z(t), e, i, n)
  29469. }
  29470. function x(e, t, i, n) {
  29471. return q(X(t, e.length - i), e, i, n)
  29472. }
  29473. function S(e, t, i) {
  29474. return 0 === t && i === e.length ? Q.fromByteArray(e) : Q.fromByteArray(e.slice(t, i))
  29475. }
  29476. function M(e, t, i) {
  29477. i = Math.min(e.length, i);
  29478. for (var n = [], r = t; r < i; ) {
  29479. var o = e[r]
  29480. , a = null
  29481. , s = o > 239 ? 4 : o > 223 ? 3 : o > 191 ? 2 : 1;
  29482. if (r + s <= i) {
  29483. var l, c, h, u;
  29484. switch (s) {
  29485. case 1:
  29486. o < 128 && (a = o);
  29487. break;
  29488. case 2:
  29489. l = e[r + 1],
  29490. 128 === (192 & l) && (u = (31 & o) << 6 | 63 & l,
  29491. u > 127 && (a = u));
  29492. break;
  29493. case 3:
  29494. l = e[r + 1],
  29495. c = e[r + 2],
  29496. 128 === (192 & l) && 128 === (192 & c) && (u = (15 & o) << 12 | (63 & l) << 6 | 63 & c,
  29497. u > 2047 && (u < 55296 || u > 57343) && (a = u));
  29498. break;
  29499. case 4:
  29500. l = e[r + 1],
  29501. c = e[r + 2],
  29502. h = e[r + 3],
  29503. 128 === (192 & l) && 128 === (192 & c) && 128 === (192 & h) && (u = (15 & o) << 18 | (63 & l) << 12 | (63 & c) << 6 | 63 & h,
  29504. u > 65535 && u < 1114112 && (a = u))
  29505. }
  29506. }
  29507. null === a ? (a = 65533,
  29508. s = 1) : a > 65535 && (a -= 65536,
  29509. n.push(a >>> 10 & 1023 | 55296),
  29510. a = 56320 | 1023 & a),
  29511. n.push(a),
  29512. r += s
  29513. }
  29514. return R(n)
  29515. }
  29516. function R(e) {
  29517. var t = e.length;
  29518. if (t <= ee)
  29519. return String.fromCharCode.apply(String, e);
  29520. for (var i = "", n = 0; n < t; )
  29521. i += String.fromCharCode.apply(String, e.slice(n, n += ee));
  29522. return i
  29523. }
  29524. function P(e, t, i) {
  29525. var n = "";
  29526. i = Math.min(e.length, i);
  29527. for (var r = t; r < i; ++r)
  29528. n += String.fromCharCode(127 & e[r]);
  29529. return n
  29530. }
  29531. function O(e, t, i) {
  29532. var n = "";
  29533. i = Math.min(e.length, i);
  29534. for (var r = t; r < i; ++r)
  29535. n += String.fromCharCode(e[r]);
  29536. return n
  29537. }
  29538. function L(e, t, i) {
  29539. var n = e.length;
  29540. (!t || t < 0) && (t = 0),
  29541. (!i || i < 0 || i > n) && (i = n);
  29542. for (var r = "", o = t; o < i; ++o)
  29543. r += W(e[o]);
  29544. return r
  29545. }
  29546. function D(e, t, i) {
  29547. for (var n = e.slice(t, i), r = "", o = 0; o < n.length; o += 2)
  29548. r += String.fromCharCode(n[o] + 256 * n[o + 1]);
  29549. return r
  29550. }
  29551. function N(e, t, i) {
  29552. if (e % 1 !== 0 || e < 0)
  29553. throw new RangeError("offset is not uint");
  29554. if (e + t > i)
  29555. throw new RangeError("Trying to access beyond buffer length")
  29556. }
  29557. function B(e, t, i, n, r, o) {
  29558. if (!a.isBuffer(e))
  29559. throw new TypeError('"buffer" argument must be a Buffer instance');
  29560. if (t > r || t < o)
  29561. throw new RangeError('"value" argument is out of bounds');
  29562. if (i + n > e.length)
  29563. throw new RangeError("Index out of range")
  29564. }
  29565. function F(e, t, i, n) {
  29566. t < 0 && (t = 65535 + t + 1);
  29567. for (var r = 0, o = Math.min(e.length - i, 2); r < o; ++r)
  29568. e[i + r] = (t & 255 << 8 * (n ? r : 1 - r)) >>> 8 * (n ? r : 1 - r)
  29569. }
  29570. function V(e, t, i, n) {
  29571. t < 0 && (t = 4294967295 + t + 1);
  29572. for (var r = 0, o = Math.min(e.length - i, 4); r < o; ++r)
  29573. e[i + r] = t >>> 8 * (n ? r : 3 - r) & 255
  29574. }
  29575. function U(e, t, i, n, r, o) {
  29576. if (i + n > e.length)
  29577. throw new RangeError("Index out of range");
  29578. if (i < 0)
  29579. throw new RangeError("Index out of range")
  29580. }
  29581. function k(e, t, i, n, r) {
  29582. return r || U(e, t, i, 4, 3.4028234663852886e38, -3.4028234663852886e38),
  29583. J.write(e, t, i, n, 23, 4),
  29584. i + 4
  29585. }
  29586. function H(e, t, i, n, r) {
  29587. return r || U(e, t, i, 8, 1.7976931348623157e308, -1.7976931348623157e308),
  29588. J.write(e, t, i, n, 52, 8),
  29589. i + 8
  29590. }
  29591. function G(e) {
  29592. if (e = z(e).replace(te, ""),
  29593. e.length < 2)
  29594. return "";
  29595. for (; e.length % 4 !== 0; )
  29596. e += "=";
  29597. return e
  29598. }
  29599. function z(e) {
  29600. return e.trim ? e.trim() : e.replace(/^\s+|\s+$/g, "")
  29601. }
  29602. function W(e) {
  29603. return e < 16 ? "0" + e.toString(16) : e.toString(16)
  29604. }
  29605. function j(e, t) {
  29606. t = t || 1 / 0;
  29607. for (var i, n = e.length, r = null, o = [], a = 0; a < n; ++a) {
  29608. if (i = e.charCodeAt(a),
  29609. i > 55295 && i < 57344) {
  29610. if (!r) {
  29611. if (i > 56319) {
  29612. (t -= 3) > -1 && o.push(239, 191, 189);
  29613. continue
  29614. }
  29615. if (a + 1 === n) {
  29616. (t -= 3) > -1 && o.push(239, 191, 189);
  29617. continue
  29618. }
  29619. r = i;
  29620. continue
  29621. }
  29622. if (i < 56320) {
  29623. (t -= 3) > -1 && o.push(239, 191, 189),
  29624. r = i;
  29625. continue
  29626. }
  29627. i = (r - 55296 << 10 | i - 56320) + 65536
  29628. } else
  29629. r && (t -= 3) > -1 && o.push(239, 191, 189);
  29630. if (r = null,
  29631. i < 128) {
  29632. if ((t -= 1) < 0)
  29633. break;
  29634. o.push(i)
  29635. } else if (i < 2048) {
  29636. if ((t -= 2) < 0)
  29637. break;
  29638. o.push(i >> 6 | 192, 63 & i | 128)
  29639. } else if (i < 65536) {
  29640. if ((t -= 3) < 0)
  29641. break;
  29642. o.push(i >> 12 | 224, i >> 6 & 63 | 128, 63 & i | 128)
  29643. } else {
  29644. if (!(i < 1114112))
  29645. throw new Error("Invalid code point");
  29646. if ((t -= 4) < 0)
  29647. break;
  29648. o.push(i >> 18 | 240, i >> 12 & 63 | 128, i >> 6 & 63 | 128, 63 & i | 128)
  29649. }
  29650. }
  29651. return o
  29652. }
  29653. function Y(e) {
  29654. for (var t = [], i = 0; i < e.length; ++i)
  29655. t.push(255 & e.charCodeAt(i));
  29656. return t
  29657. }
  29658. function X(e, t) {
  29659. for (var i, n, r, o = [], a = 0; a < e.length && !((t -= 2) < 0); ++a)
  29660. i = e.charCodeAt(a),
  29661. n = i >> 8,
  29662. r = i % 256,
  29663. o.push(r),
  29664. o.push(n);
  29665. return o
  29666. }
  29667. function Z(e) {
  29668. return Q.toByteArray(G(e))
  29669. }
  29670. function q(e, t, i, n) {
  29671. for (var r = 0; r < n && !(r + i >= t.length || r >= e.length); ++r)
  29672. t[r + i] = e[r];
  29673. return r
  29674. }
  29675. function K(e) {
  29676. return e !== e
  29677. }
  29678. var Q = e("base64-js")
  29679. , J = e("ieee754")
  29680. , $ = e("isarray");
  29681. i.Buffer = a,
  29682. i.SlowBuffer = m,
  29683. i.INSPECT_MAX_BYTES = 50,
  29684. a.TYPED_ARRAY_SUPPORT = void 0 !== t.TYPED_ARRAY_SUPPORT ? t.TYPED_ARRAY_SUPPORT : n(),
  29685. i.kMaxLength = r(),
  29686. a.poolSize = 8192,
  29687. a._augment = function(e) {
  29688. return e.__proto__ = a.prototype,
  29689. e
  29690. }
  29691. ,
  29692. a.from = function(e, t, i) {
  29693. return s(null, e, t, i)
  29694. }
  29695. ,
  29696. a.TYPED_ARRAY_SUPPORT && (a.prototype.__proto__ = Uint8Array.prototype,
  29697. a.__proto__ = Uint8Array,
  29698. "undefined" != typeof Symbol && Symbol.species && a[Symbol.species] === a && Object.defineProperty(a, Symbol.species, {
  29699. value: null,
  29700. configurable: !0
  29701. })),
  29702. a.alloc = function(e, t, i) {
  29703. return c(null, e, t, i)
  29704. }
  29705. ,
  29706. a.allocUnsafe = function(e) {
  29707. return h(null, e)
  29708. }
  29709. ,
  29710. a.allocUnsafeSlow = function(e) {
  29711. return h(null, e)
  29712. }
  29713. ,
  29714. a.isBuffer = function(e) {
  29715. return !(null == e || !e._isBuffer)
  29716. }
  29717. ,
  29718. a.compare = function(e, t) {
  29719. if (!a.isBuffer(e) || !a.isBuffer(t))
  29720. throw new TypeError("Arguments must be Buffers");
  29721. if (e === t)
  29722. return 0;
  29723. for (var i = e.length, n = t.length, r = 0, o = Math.min(i, n); r < o; ++r)
  29724. if (e[r] !== t[r]) {
  29725. i = e[r],
  29726. n = t[r];
  29727. break
  29728. }
  29729. return i < n ? -1 : n < i ? 1 : 0
  29730. }
  29731. ,
  29732. a.isEncoding = function(e) {
  29733. switch (String(e).toLowerCase()) {
  29734. case "hex":
  29735. case "utf8":
  29736. case "utf-8":
  29737. case "ascii":
  29738. case "latin1":
  29739. case "binary":
  29740. case "base64":
  29741. case "ucs2":
  29742. case "ucs-2":
  29743. case "utf16le":
  29744. case "utf-16le":
  29745. return !0;
  29746. default:
  29747. return !1
  29748. }
  29749. }
  29750. ,
  29751. a.concat = function(e, t) {
  29752. if (!$(e))
  29753. throw new TypeError('"list" argument must be an Array of Buffers');
  29754. if (0 === e.length)
  29755. return a.alloc(0);
  29756. var i;
  29757. if (void 0 === t)
  29758. for (t = 0,
  29759. i = 0; i < e.length; ++i)
  29760. t += e[i].length;
  29761. var n = a.allocUnsafe(t)
  29762. , r = 0;
  29763. for (i = 0; i < e.length; ++i) {
  29764. var o = e[i];
  29765. if (!a.isBuffer(o))
  29766. throw new TypeError('"list" argument must be an Array of Buffers');
  29767. o.copy(n, r),
  29768. r += o.length
  29769. }
  29770. return n
  29771. }
  29772. ,
  29773. a.byteLength = v,
  29774. a.prototype._isBuffer = !0,
  29775. a.prototype.swap16 = function() {
  29776. var e = this.length;
  29777. if (e % 2 !== 0)
  29778. throw new RangeError("Buffer size must be a multiple of 16-bits");
  29779. for (var t = 0; t < e; t += 2)
  29780. y(this, t, t + 1);
  29781. return this
  29782. }
  29783. ,
  29784. a.prototype.swap32 = function() {
  29785. var e = this.length;
  29786. if (e % 4 !== 0)
  29787. throw new RangeError("Buffer size must be a multiple of 32-bits");
  29788. for (var t = 0; t < e; t += 4)
  29789. y(this, t, t + 3),
  29790. y(this, t + 1, t + 2);
  29791. return this
  29792. }
  29793. ,
  29794. a.prototype.swap64 = function() {
  29795. var e = this.length;
  29796. if (e % 8 !== 0)
  29797. throw new RangeError("Buffer size must be a multiple of 64-bits");
  29798. for (var t = 0; t < e; t += 8)
  29799. y(this, t, t + 7),
  29800. y(this, t + 1, t + 6),
  29801. y(this, t + 2, t + 5),
  29802. y(this, t + 3, t + 4);
  29803. return this
  29804. }
  29805. ,
  29806. a.prototype.toString = function() {
  29807. var e = 0 | this.length;
  29808. return 0 === e ? "" : 0 === arguments.length ? M(this, 0, e) : A.apply(this, arguments)
  29809. }
  29810. ,
  29811. a.prototype.equals = function(e) {
  29812. if (!a.isBuffer(e))
  29813. throw new TypeError("Argument must be a Buffer");
  29814. return this === e || 0 === a.compare(this, e)
  29815. }
  29816. ,
  29817. a.prototype.inspect = function() {
  29818. var e = ""
  29819. , t = i.INSPECT_MAX_BYTES;
  29820. return this.length > 0 && (e = this.toString("hex", 0, t).match(/.{2}/g).join(" "),
  29821. this.length > t && (e += " ... ")),
  29822. "<Buffer " + e + ">"
  29823. }
  29824. ,
  29825. a.prototype.compare = function(e, t, i, n, r) {
  29826. if (!a.isBuffer(e))
  29827. throw new TypeError("Argument must be a Buffer");
  29828. if (void 0 === t && (t = 0),
  29829. void 0 === i && (i = e ? e.length : 0),
  29830. void 0 === n && (n = 0),
  29831. void 0 === r && (r = this.length),
  29832. t < 0 || i > e.length || n < 0 || r > this.length)
  29833. throw new RangeError("out of range index");
  29834. if (n >= r && t >= i)
  29835. return 0;
  29836. if (n >= r)
  29837. return -1;
  29838. if (t >= i)
  29839. return 1;
  29840. if (t >>>= 0,
  29841. i >>>= 0,
  29842. n >>>= 0,
  29843. r >>>= 0,
  29844. this === e)
  29845. return 0;
  29846. 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)
  29847. if (c[u] !== h[u]) {
  29848. o = c[u],
  29849. s = h[u];
  29850. break
  29851. }
  29852. return o < s ? -1 : s < o ? 1 : 0
  29853. }
  29854. ,
  29855. a.prototype.includes = function(e, t, i) {
  29856. return this.indexOf(e, t, i) !== -1
  29857. }
  29858. ,
  29859. a.prototype.indexOf = function(e, t, i) {
  29860. return C(this, e, t, i, !0)
  29861. }
  29862. ,
  29863. a.prototype.lastIndexOf = function(e, t, i) {
  29864. return C(this, e, t, i, !1)
  29865. }
  29866. ,
  29867. a.prototype.write = function(e, t, i, n) {
  29868. if (void 0 === t)
  29869. n = "utf8",
  29870. i = this.length,
  29871. t = 0;
  29872. else if (void 0 === i && "string" == typeof t)
  29873. n = t,
  29874. i = this.length,
  29875. t = 0;
  29876. else {
  29877. if (!isFinite(t))
  29878. throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");
  29879. t |= 0,
  29880. isFinite(i) ? (i |= 0,
  29881. void 0 === n && (n = "utf8")) : (n = i,
  29882. i = void 0)
  29883. }
  29884. var r = this.length - t;
  29885. if ((void 0 === i || i > r) && (i = r),
  29886. e.length > 0 && (i < 0 || t < 0) || t > this.length)
  29887. throw new RangeError("Attempt to write outside buffer bounds");
  29888. n || (n = "utf8");
  29889. for (var o = !1; ; )
  29890. switch (n) {
  29891. case "hex":
  29892. return E(this, e, t, i);
  29893. case "utf8":
  29894. case "utf-8":
  29895. return b(this, e, t, i);
  29896. case "ascii":
  29897. return w(this, e, t, i);
  29898. case "latin1":
  29899. case "binary":
  29900. return _(this, e, t, i);
  29901. case "base64":
  29902. return T(this, e, t, i);
  29903. case "ucs2":
  29904. case "ucs-2":
  29905. case "utf16le":
  29906. case "utf-16le":
  29907. return x(this, e, t, i);
  29908. default:
  29909. if (o)
  29910. throw new TypeError("Unknown encoding: " + n);
  29911. n = ("" + n).toLowerCase(),
  29912. o = !0
  29913. }
  29914. }
  29915. ,
  29916. a.prototype.toJSON = function() {
  29917. return {
  29918. type: "Buffer",
  29919. data: Array.prototype.slice.call(this._arr || this, 0)
  29920. }
  29921. }
  29922. ;
  29923. var ee = 4096;
  29924. a.prototype.slice = function(e, t) {
  29925. var i = this.length;
  29926. e = ~~e,
  29927. t = void 0 === t ? i : ~~t,
  29928. e < 0 ? (e += i,
  29929. e < 0 && (e = 0)) : e > i && (e = i),
  29930. t < 0 ? (t += i,
  29931. t < 0 && (t = 0)) : t > i && (t = i),
  29932. t < e && (t = e);
  29933. var n;
  29934. if (a.TYPED_ARRAY_SUPPORT)
  29935. n = this.subarray(e, t),
  29936. n.__proto__ = a.prototype;
  29937. else {
  29938. var r = t - e;
  29939. n = new a(r,void 0);
  29940. for (var o = 0; o < r; ++o)
  29941. n[o] = this[o + e]
  29942. }
  29943. return n
  29944. }
  29945. ,
  29946. a.prototype.readUIntLE = function(e, t, i) {
  29947. e |= 0,
  29948. t |= 0,
  29949. i || N(e, t, this.length);
  29950. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29951. n += this[e + o] * r;
  29952. return n
  29953. }
  29954. ,
  29955. a.prototype.readUIntBE = function(e, t, i) {
  29956. e |= 0,
  29957. t |= 0,
  29958. i || N(e, t, this.length);
  29959. for (var n = this[e + --t], r = 1; t > 0 && (r *= 256); )
  29960. n += this[e + --t] * r;
  29961. return n
  29962. }
  29963. ,
  29964. a.prototype.readUInt8 = function(e, t) {
  29965. return t || N(e, 1, this.length),
  29966. this[e]
  29967. }
  29968. ,
  29969. a.prototype.readUInt16LE = function(e, t) {
  29970. return t || N(e, 2, this.length),
  29971. this[e] | this[e + 1] << 8
  29972. }
  29973. ,
  29974. a.prototype.readUInt16BE = function(e, t) {
  29975. return t || N(e, 2, this.length),
  29976. this[e] << 8 | this[e + 1]
  29977. }
  29978. ,
  29979. a.prototype.readUInt32LE = function(e, t) {
  29980. return t || N(e, 4, this.length),
  29981. (this[e] | this[e + 1] << 8 | this[e + 2] << 16) + 16777216 * this[e + 3]
  29982. }
  29983. ,
  29984. a.prototype.readUInt32BE = function(e, t) {
  29985. return t || N(e, 4, this.length),
  29986. 16777216 * this[e] + (this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3])
  29987. }
  29988. ,
  29989. a.prototype.readIntLE = function(e, t, i) {
  29990. e |= 0,
  29991. t |= 0,
  29992. i || N(e, t, this.length);
  29993. for (var n = this[e], r = 1, o = 0; ++o < t && (r *= 256); )
  29994. n += this[e + o] * r;
  29995. return r *= 128,
  29996. n >= r && (n -= Math.pow(2, 8 * t)),
  29997. n
  29998. }
  29999. ,
  30000. a.prototype.readIntBE = function(e, t, i) {
  30001. e |= 0,
  30002. t |= 0,
  30003. i || N(e, t, this.length);
  30004. for (var n = t, r = 1, o = this[e + --n]; n > 0 && (r *= 256); )
  30005. o += this[e + --n] * r;
  30006. return r *= 128,
  30007. o >= r && (o -= Math.pow(2, 8 * t)),
  30008. o
  30009. }
  30010. ,
  30011. a.prototype.readInt8 = function(e, t) {
  30012. return t || N(e, 1, this.length),
  30013. 128 & this[e] ? (255 - this[e] + 1) * -1 : this[e]
  30014. }
  30015. ,
  30016. a.prototype.readInt16LE = function(e, t) {
  30017. t || N(e, 2, this.length);
  30018. var i = this[e] | this[e + 1] << 8;
  30019. return 32768 & i ? 4294901760 | i : i
  30020. }
  30021. ,
  30022. a.prototype.readInt16BE = function(e, t) {
  30023. t || N(e, 2, this.length);
  30024. var i = this[e + 1] | this[e] << 8;
  30025. return 32768 & i ? 4294901760 | i : i
  30026. }
  30027. ,
  30028. a.prototype.readInt32LE = function(e, t) {
  30029. return t || N(e, 4, this.length),
  30030. this[e] | this[e + 1] << 8 | this[e + 2] << 16 | this[e + 3] << 24
  30031. }
  30032. ,
  30033. a.prototype.readInt32BE = function(e, t) {
  30034. return t || N(e, 4, this.length),
  30035. this[e] << 24 | this[e + 1] << 16 | this[e + 2] << 8 | this[e + 3]
  30036. }
  30037. ,
  30038. a.prototype.readFloatLE = function(e, t) {
  30039. return t || N(e, 4, this.length),
  30040. J.read(this, e, !0, 23, 4)
  30041. }
  30042. ,
  30043. a.prototype.readFloatBE = function(e, t) {
  30044. return t || N(e, 4, this.length),
  30045. J.read(this, e, !1, 23, 4)
  30046. }
  30047. ,
  30048. a.prototype.readDoubleLE = function(e, t) {
  30049. return t || N(e, 8, this.length),
  30050. J.read(this, e, !0, 52, 8)
  30051. }
  30052. ,
  30053. a.prototype.readDoubleBE = function(e, t) {
  30054. return t || N(e, 8, this.length),
  30055. J.read(this, e, !1, 52, 8)
  30056. }
  30057. ,
  30058. a.prototype.writeUIntLE = function(e, t, i, n) {
  30059. if (e = +e,
  30060. t |= 0,
  30061. i |= 0,
  30062. !n) {
  30063. var r = Math.pow(2, 8 * i) - 1;
  30064. B(this, e, t, i, r, 0)
  30065. }
  30066. var o = 1
  30067. , a = 0;
  30068. for (this[t] = 255 & e; ++a < i && (o *= 256); )
  30069. this[t + a] = e / o & 255;
  30070. return t + i
  30071. }
  30072. ,
  30073. a.prototype.writeUIntBE = function(e, t, i, n) {
  30074. if (e = +e,
  30075. t |= 0,
  30076. i |= 0,
  30077. !n) {
  30078. var r = Math.pow(2, 8 * i) - 1;
  30079. B(this, e, t, i, r, 0)
  30080. }
  30081. var o = i - 1
  30082. , a = 1;
  30083. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30084. this[t + o] = e / a & 255;
  30085. return t + i
  30086. }
  30087. ,
  30088. a.prototype.writeUInt8 = function(e, t, i) {
  30089. return e = +e,
  30090. t |= 0,
  30091. i || B(this, e, t, 1, 255, 0),
  30092. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30093. this[t] = 255 & e,
  30094. t + 1
  30095. }
  30096. ,
  30097. a.prototype.writeUInt16LE = function(e, t, i) {
  30098. return e = +e,
  30099. t |= 0,
  30100. i || B(this, e, t, 2, 65535, 0),
  30101. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30102. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30103. t + 2
  30104. }
  30105. ,
  30106. a.prototype.writeUInt16BE = function(e, t, i) {
  30107. return e = +e,
  30108. t |= 0,
  30109. i || B(this, e, t, 2, 65535, 0),
  30110. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30111. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30112. t + 2
  30113. }
  30114. ,
  30115. a.prototype.writeUInt32LE = function(e, t, i) {
  30116. return e = +e,
  30117. t |= 0,
  30118. i || B(this, e, t, 4, 4294967295, 0),
  30119. a.TYPED_ARRAY_SUPPORT ? (this[t + 3] = e >>> 24,
  30120. this[t + 2] = e >>> 16,
  30121. this[t + 1] = e >>> 8,
  30122. this[t] = 255 & e) : V(this, e, t, !0),
  30123. t + 4
  30124. }
  30125. ,
  30126. a.prototype.writeUInt32BE = function(e, t, i) {
  30127. return e = +e,
  30128. t |= 0,
  30129. i || B(this, e, t, 4, 4294967295, 0),
  30130. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30131. this[t + 1] = e >>> 16,
  30132. this[t + 2] = e >>> 8,
  30133. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30134. t + 4
  30135. }
  30136. ,
  30137. a.prototype.writeIntLE = function(e, t, i, n) {
  30138. if (e = +e,
  30139. t |= 0,
  30140. !n) {
  30141. var r = Math.pow(2, 8 * i - 1);
  30142. B(this, e, t, i, r - 1, -r)
  30143. }
  30144. var o = 0
  30145. , a = 1
  30146. , s = 0;
  30147. for (this[t] = 255 & e; ++o < i && (a *= 256); )
  30148. e < 0 && 0 === s && 0 !== this[t + o - 1] && (s = 1),
  30149. this[t + o] = (e / a >> 0) - s & 255;
  30150. return t + i
  30151. }
  30152. ,
  30153. a.prototype.writeIntBE = function(e, t, i, n) {
  30154. if (e = +e,
  30155. t |= 0,
  30156. !n) {
  30157. var r = Math.pow(2, 8 * i - 1);
  30158. B(this, e, t, i, r - 1, -r)
  30159. }
  30160. var o = i - 1
  30161. , a = 1
  30162. , s = 0;
  30163. for (this[t + o] = 255 & e; --o >= 0 && (a *= 256); )
  30164. e < 0 && 0 === s && 0 !== this[t + o + 1] && (s = 1),
  30165. this[t + o] = (e / a >> 0) - s & 255;
  30166. return t + i
  30167. }
  30168. ,
  30169. a.prototype.writeInt8 = function(e, t, i) {
  30170. return e = +e,
  30171. t |= 0,
  30172. i || B(this, e, t, 1, 127, -128),
  30173. a.TYPED_ARRAY_SUPPORT || (e = Math.floor(e)),
  30174. e < 0 && (e = 255 + e + 1),
  30175. this[t] = 255 & e,
  30176. t + 1
  30177. }
  30178. ,
  30179. a.prototype.writeInt16LE = function(e, t, i) {
  30180. return e = +e,
  30181. t |= 0,
  30182. i || B(this, e, t, 2, 32767, -32768),
  30183. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30184. this[t + 1] = e >>> 8) : F(this, e, t, !0),
  30185. t + 2
  30186. }
  30187. ,
  30188. a.prototype.writeInt16BE = function(e, t, i) {
  30189. return e = +e,
  30190. t |= 0,
  30191. i || B(this, e, t, 2, 32767, -32768),
  30192. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 8,
  30193. this[t + 1] = 255 & e) : F(this, e, t, !1),
  30194. t + 2
  30195. }
  30196. ,
  30197. a.prototype.writeInt32LE = function(e, t, i) {
  30198. return e = +e,
  30199. t |= 0,
  30200. i || B(this, e, t, 4, 2147483647, -2147483648),
  30201. a.TYPED_ARRAY_SUPPORT ? (this[t] = 255 & e,
  30202. this[t + 1] = e >>> 8,
  30203. this[t + 2] = e >>> 16,
  30204. this[t + 3] = e >>> 24) : V(this, e, t, !0),
  30205. t + 4
  30206. }
  30207. ,
  30208. a.prototype.writeInt32BE = function(e, t, i) {
  30209. return e = +e,
  30210. t |= 0,
  30211. i || B(this, e, t, 4, 2147483647, -2147483648),
  30212. e < 0 && (e = 4294967295 + e + 1),
  30213. a.TYPED_ARRAY_SUPPORT ? (this[t] = e >>> 24,
  30214. this[t + 1] = e >>> 16,
  30215. this[t + 2] = e >>> 8,
  30216. this[t + 3] = 255 & e) : V(this, e, t, !1),
  30217. t + 4
  30218. }
  30219. ,
  30220. a.prototype.writeFloatLE = function(e, t, i) {
  30221. return k(this, e, t, !0, i)
  30222. }
  30223. ,
  30224. a.prototype.writeFloatBE = function(e, t, i) {
  30225. return k(this, e, t, !1, i)
  30226. }
  30227. ,
  30228. a.prototype.writeDoubleLE = function(e, t, i) {
  30229. return H(this, e, t, !0, i)
  30230. }
  30231. ,
  30232. a.prototype.writeDoubleBE = function(e, t, i) {
  30233. return H(this, e, t, !1, i)
  30234. }
  30235. ,
  30236. a.prototype.copy = function(e, t, i, n) {
  30237. if (i || (i = 0),
  30238. n || 0 === n || (n = this.length),
  30239. t >= e.length && (t = e.length),
  30240. t || (t = 0),
  30241. n > 0 && n < i && (n = i),
  30242. n === i)
  30243. return 0;
  30244. if (0 === e.length || 0 === this.length)
  30245. return 0;
  30246. if (t < 0)
  30247. throw new RangeError("targetStart out of bounds");
  30248. if (i < 0 || i >= this.length)
  30249. throw new RangeError("sourceStart out of bounds");
  30250. if (n < 0)
  30251. throw new RangeError("sourceEnd out of bounds");
  30252. n > this.length && (n = this.length),
  30253. e.length - t < n - i && (n = e.length - t + i);
  30254. var r, o = n - i;
  30255. if (this === e && i < t && t < n)
  30256. for (r = o - 1; r >= 0; --r)
  30257. e[r + t] = this[r + i];
  30258. else if (o < 1e3 || !a.TYPED_ARRAY_SUPPORT)
  30259. for (r = 0; r < o; ++r)
  30260. e[r + t] = this[r + i];
  30261. else
  30262. Uint8Array.prototype.set.call(e, this.subarray(i, i + o), t);
  30263. return o
  30264. }
  30265. ,
  30266. a.prototype.fill = function(e, t, i, n) {
  30267. if ("string" == typeof e) {
  30268. if ("string" == typeof t ? (n = t,
  30269. t = 0,
  30270. i = this.length) : "string" == typeof i && (n = i,
  30271. i = this.length),
  30272. 1 === e.length) {
  30273. var r = e.charCodeAt(0);
  30274. r < 256 && (e = r)
  30275. }
  30276. if (void 0 !== n && "string" != typeof n)
  30277. throw new TypeError("encoding must be a string");
  30278. if ("string" == typeof n && !a.isEncoding(n))
  30279. throw new TypeError("Unknown encoding: " + n)
  30280. } else
  30281. "number" == typeof e && (e &= 255);
  30282. if (t < 0 || this.length < t || this.length < i)
  30283. throw new RangeError("Out of range index");
  30284. if (i <= t)
  30285. return this;
  30286. t >>>= 0,
  30287. i = void 0 === i ? this.length : i >>> 0,
  30288. e || (e = 0);
  30289. var o;
  30290. if ("number" == typeof e)
  30291. for (o = t; o < i; ++o)
  30292. this[o] = e;
  30293. else {
  30294. var s = a.isBuffer(e) ? e : j(new a(e,n).toString())
  30295. , l = s.length;
  30296. for (o = 0; o < i - t; ++o)
  30297. this[o + t] = s[o % l]
  30298. }
  30299. return this
  30300. }
  30301. ;
  30302. var te = /[^+\/0-9A-Za-z-_]/g
  30303. }
  30304. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30305. }
  30306. , {
  30307. "base64-js": 199,
  30308. ieee754: 200,
  30309. isarray: 201
  30310. }],
  30311. 199: [function(e, t, i) {
  30312. "use strict";
  30313. function n(e) {
  30314. var t = e.length;
  30315. if (t % 4 > 0)
  30316. throw new Error("Invalid string. Length must be a multiple of 4");
  30317. return "=" === e[t - 2] ? 2 : "=" === e[t - 1] ? 1 : 0
  30318. }
  30319. function r(e) {
  30320. return 3 * e.length / 4 - n(e)
  30321. }
  30322. function o(e) {
  30323. var t, i, r, o, a, s, l = e.length;
  30324. a = n(e),
  30325. s = new u(3 * l / 4 - a),
  30326. r = a > 0 ? l - 4 : l;
  30327. var c = 0;
  30328. for (t = 0,
  30329. i = 0; t < r; t += 4,
  30330. i += 3)
  30331. o = h[e.charCodeAt(t)] << 18 | h[e.charCodeAt(t + 1)] << 12 | h[e.charCodeAt(t + 2)] << 6 | h[e.charCodeAt(t + 3)],
  30332. s[c++] = o >> 16 & 255,
  30333. s[c++] = o >> 8 & 255,
  30334. s[c++] = 255 & o;
  30335. return 2 === a ? (o = h[e.charCodeAt(t)] << 2 | h[e.charCodeAt(t + 1)] >> 4,
  30336. s[c++] = 255 & o) : 1 === a && (o = h[e.charCodeAt(t)] << 10 | h[e.charCodeAt(t + 1)] << 4 | h[e.charCodeAt(t + 2)] >> 2,
  30337. s[c++] = o >> 8 & 255,
  30338. s[c++] = 255 & o),
  30339. s
  30340. }
  30341. function a(e) {
  30342. return c[e >> 18 & 63] + c[e >> 12 & 63] + c[e >> 6 & 63] + c[63 & e]
  30343. }
  30344. function s(e, t, i) {
  30345. for (var n, r = [], o = t; o < i; o += 3)
  30346. n = (e[o] << 16) + (e[o + 1] << 8) + e[o + 2],
  30347. r.push(a(n));
  30348. return r.join("")
  30349. }
  30350. function l(e) {
  30351. for (var t, i = e.length, n = i % 3, r = "", o = [], a = 16383, l = 0, h = i - n; l < h; l += a)
  30352. o.push(s(e, l, l + a > h ? h : l + a));
  30353. return 1 === n ? (t = e[i - 1],
  30354. r += c[t >> 2],
  30355. r += c[t << 4 & 63],
  30356. r += "==") : 2 === n && (t = (e[i - 2] << 8) + e[i - 1],
  30357. r += c[t >> 10],
  30358. r += c[t >> 4 & 63],
  30359. r += c[t << 2 & 63],
  30360. r += "="),
  30361. o.push(r),
  30362. o.join("")
  30363. }
  30364. i.byteLength = r,
  30365. i.toByteArray = o,
  30366. i.fromByteArray = l;
  30367. for (var c = [], h = [], u = "undefined" != typeof Uint8Array ? Uint8Array : Array, d = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", p = 0, f = d.length; p < f; ++p)
  30368. c[p] = d[p],
  30369. h[d.charCodeAt(p)] = p;
  30370. h["-".charCodeAt(0)] = 62,
  30371. h["_".charCodeAt(0)] = 63
  30372. }
  30373. , {}],
  30374. 200: [function(e, t, i) {
  30375. i.read = function(e, t, i, n, r) {
  30376. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  30377. for (u += d,
  30378. o = p & (1 << -h) - 1,
  30379. p >>= -h,
  30380. h += s; h > 0; o = 256 * o + e[t + u],
  30381. u += d,
  30382. h -= 8)
  30383. ;
  30384. for (a = o & (1 << -h) - 1,
  30385. o >>= -h,
  30386. h += n; h > 0; a = 256 * a + e[t + u],
  30387. u += d,
  30388. h -= 8)
  30389. ;
  30390. if (0 === o)
  30391. o = 1 - c;
  30392. else {
  30393. if (o === l)
  30394. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  30395. a += Math.pow(2, n),
  30396. o -= c
  30397. }
  30398. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  30399. }
  30400. ,
  30401. i.write = function(e, t, i, n, r, o) {
  30402. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  30403. for (t = Math.abs(t),
  30404. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  30405. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  30406. t * (l = Math.pow(2, -a)) < 1 && (a--,
  30407. l *= 2),
  30408. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  30409. t * l >= 2 && (a++,
  30410. l /= 2),
  30411. a + u >= h ? (s = 0,
  30412. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  30413. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  30414. a = 0)); r >= 8; e[i + p] = 255 & s,
  30415. p += f,
  30416. s /= 256,
  30417. r -= 8)
  30418. ;
  30419. for (a = a << r | s,
  30420. c += r; c > 0; e[i + p] = 255 & a,
  30421. p += f,
  30422. a /= 256,
  30423. c -= 8)
  30424. ;
  30425. e[i + p - f] |= 128 * g
  30426. }
  30427. }
  30428. , {}],
  30429. 201: [function(e, t, i) {
  30430. var n = {}.toString;
  30431. t.exports = Array.isArray || function(e) {
  30432. return "[object Array]" == n.call(e)
  30433. }
  30434. }
  30435. , {}],
  30436. 202: [function(e, t, i) {
  30437. function n() {
  30438. this._events = this._events || {},
  30439. this._maxListeners = this._maxListeners || void 0
  30440. }
  30441. function r(e) {
  30442. return "function" == typeof e
  30443. }
  30444. function o(e) {
  30445. return "number" == typeof e
  30446. }
  30447. function a(e) {
  30448. return "object" == typeof e && null !== e
  30449. }
  30450. function s(e) {
  30451. return void 0 === e
  30452. }
  30453. t.exports = n,
  30454. n.EventEmitter = n,
  30455. n.prototype._events = void 0,
  30456. n.prototype._maxListeners = void 0,
  30457. n.defaultMaxListeners = 10,
  30458. n.prototype.setMaxListeners = function(e) {
  30459. if (!o(e) || e < 0 || isNaN(e))
  30460. throw TypeError("n must be a positive number");
  30461. return this._maxListeners = e,
  30462. this
  30463. }
  30464. ,
  30465. n.prototype.emit = function(e) {
  30466. var t, i, n, o, l, c;
  30467. if (this._events || (this._events = {}),
  30468. "error" === e && (!this._events.error || a(this._events.error) && !this._events.error.length)) {
  30469. if (t = arguments[1],
  30470. t instanceof Error)
  30471. throw t;
  30472. var h = new Error('Uncaught, unspecified "error" event. (' + t + ")");
  30473. throw h.context = t,
  30474. h
  30475. }
  30476. if (i = this._events[e],
  30477. s(i))
  30478. return !1;
  30479. if (r(i))
  30480. switch (arguments.length) {
  30481. case 1:
  30482. i.call(this);
  30483. break;
  30484. case 2:
  30485. i.call(this, arguments[1]);
  30486. break;
  30487. case 3:
  30488. i.call(this, arguments[1], arguments[2]);
  30489. break;
  30490. default:
  30491. o = Array.prototype.slice.call(arguments, 1),
  30492. i.apply(this, o)
  30493. }
  30494. else if (a(i))
  30495. for (o = Array.prototype.slice.call(arguments, 1),
  30496. c = i.slice(),
  30497. n = c.length,
  30498. l = 0; l < n; l++)
  30499. c[l].apply(this, o);
  30500. return !0
  30501. }
  30502. ,
  30503. n.prototype.addListener = function(e, t) {
  30504. var i;
  30505. if (!r(t))
  30506. throw TypeError("listener must be a function");
  30507. return this._events || (this._events = {}),
  30508. this._events.newListener && this.emit("newListener", e, r(t.listener) ? t.listener : t),
  30509. this._events[e] ? a(this._events[e]) ? this._events[e].push(t) : this._events[e] = [this._events[e], t] : this._events[e] = t,
  30510. a(this._events[e]) && !this._events[e].warned && (i = s(this._maxListeners) ? n.defaultMaxListeners : this._maxListeners,
  30511. i && i > 0 && this._events[e].length > i && (this._events[e].warned = !0,
  30512. console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.", this._events[e].length),
  30513. "function" == typeof console.trace && console.trace())),
  30514. this
  30515. }
  30516. ,
  30517. n.prototype.on = n.prototype.addListener,
  30518. n.prototype.once = function(e, t) {
  30519. function i() {
  30520. this.removeListener(e, i),
  30521. n || (n = !0,
  30522. t.apply(this, arguments))
  30523. }
  30524. if (!r(t))
  30525. throw TypeError("listener must be a function");
  30526. var n = !1;
  30527. return i.listener = t,
  30528. this.on(e, i),
  30529. this
  30530. }
  30531. ,
  30532. n.prototype.removeListener = function(e, t) {
  30533. var i, n, o, s;
  30534. if (!r(t))
  30535. throw TypeError("listener must be a function");
  30536. if (!this._events || !this._events[e])
  30537. return this;
  30538. if (i = this._events[e],
  30539. o = i.length,
  30540. n = -1,
  30541. i === t || r(i.listener) && i.listener === t)
  30542. delete this._events[e],
  30543. this._events.removeListener && this.emit("removeListener", e, t);
  30544. else if (a(i)) {
  30545. for (s = o; s-- > 0; )
  30546. if (i[s] === t || i[s].listener && i[s].listener === t) {
  30547. n = s;
  30548. break
  30549. }
  30550. if (n < 0)
  30551. return this;
  30552. 1 === i.length ? (i.length = 0,
  30553. delete this._events[e]) : i.splice(n, 1),
  30554. this._events.removeListener && this.emit("removeListener", e, t)
  30555. }
  30556. return this
  30557. }
  30558. ,
  30559. n.prototype.removeAllListeners = function(e) {
  30560. var t, i;
  30561. if (!this._events)
  30562. return this;
  30563. if (!this._events.removeListener)
  30564. return 0 === arguments.length ? this._events = {} : this._events[e] && delete this._events[e],
  30565. this;
  30566. if (0 === arguments.length) {
  30567. for (t in this._events)
  30568. "removeListener" !== t && this.removeAllListeners(t);
  30569. return this.removeAllListeners("removeListener"),
  30570. this._events = {},
  30571. this
  30572. }
  30573. if (i = this._events[e],
  30574. r(i))
  30575. this.removeListener(e, i);
  30576. else if (i)
  30577. for (; i.length; )
  30578. this.removeListener(e, i[i.length - 1]);
  30579. return delete this._events[e],
  30580. this
  30581. }
  30582. ,
  30583. n.prototype.listeners = function(e) {
  30584. var t;
  30585. return t = this._events && this._events[e] ? r(this._events[e]) ? [this._events[e]] : this._events[e].slice() : []
  30586. }
  30587. ,
  30588. n.prototype.listenerCount = function(e) {
  30589. if (this._events) {
  30590. var t = this._events[e];
  30591. if (r(t))
  30592. return 1;
  30593. if (t)
  30594. return t.length
  30595. }
  30596. return 0
  30597. }
  30598. ,
  30599. n.listenerCount = function(e, t) {
  30600. return e.listenerCount(t)
  30601. }
  30602. }
  30603. , {}],
  30604. 203: [function(e, t, i) {
  30605. function n() {
  30606. throw new Error("setTimeout has not been defined")
  30607. }
  30608. function r() {
  30609. throw new Error("clearTimeout has not been defined")
  30610. }
  30611. function o(e) {
  30612. if (u === setTimeout)
  30613. return setTimeout(e, 0);
  30614. if ((u === n || !u) && setTimeout)
  30615. return u = setTimeout,
  30616. setTimeout(e, 0);
  30617. try {
  30618. return u(e, 0)
  30619. } catch (t) {
  30620. try {
  30621. return u.call(null, e, 0)
  30622. } catch (t) {
  30623. return u.call(this, e, 0)
  30624. }
  30625. }
  30626. }
  30627. function a(e) {
  30628. if (d === clearTimeout)
  30629. return clearTimeout(e);
  30630. if ((d === r || !d) && clearTimeout)
  30631. return d = clearTimeout,
  30632. clearTimeout(e);
  30633. try {
  30634. return d(e)
  30635. } catch (t) {
  30636. try {
  30637. return d.call(null, e)
  30638. } catch (t) {
  30639. return d.call(this, e)
  30640. }
  30641. }
  30642. }
  30643. function s() {
  30644. m && f && (m = !1,
  30645. f.length ? g = f.concat(g) : v = -1,
  30646. g.length && l())
  30647. }
  30648. function l() {
  30649. if (!m) {
  30650. var e = o(s);
  30651. m = !0;
  30652. for (var t = g.length; t; ) {
  30653. for (f = g,
  30654. g = []; ++v < t; )
  30655. f && f[v].run();
  30656. v = -1,
  30657. t = g.length
  30658. }
  30659. f = null,
  30660. m = !1,
  30661. a(e)
  30662. }
  30663. }
  30664. function c(e, t) {
  30665. this.fun = e,
  30666. this.array = t
  30667. }
  30668. function h() {}
  30669. var u, d, p = t.exports = {};
  30670. !function() {
  30671. try {
  30672. u = "function" == typeof setTimeout ? setTimeout : n
  30673. } catch (e) {
  30674. u = n
  30675. }
  30676. try {
  30677. d = "function" == typeof clearTimeout ? clearTimeout : r
  30678. } catch (e) {
  30679. d = r
  30680. }
  30681. }();
  30682. var f, g = [], m = !1, v = -1;
  30683. p.nextTick = function(e) {
  30684. var t = new Array(arguments.length - 1);
  30685. if (arguments.length > 1)
  30686. for (var i = 1; i < arguments.length; i++)
  30687. t[i - 1] = arguments[i];
  30688. g.push(new c(e,t)),
  30689. 1 !== g.length || m || o(l)
  30690. }
  30691. ,
  30692. c.prototype.run = function() {
  30693. this.fun.apply(null, this.array)
  30694. }
  30695. ,
  30696. p.title = "browser",
  30697. p.browser = !0,
  30698. p.env = {},
  30699. p.argv = [],
  30700. p.version = "",
  30701. p.versions = {},
  30702. p.on = h,
  30703. p.addListener = h,
  30704. p.once = h,
  30705. p.off = h,
  30706. p.removeListener = h,
  30707. p.removeAllListeners = h,
  30708. p.emit = h,
  30709. p.binding = function(e) {
  30710. throw new Error("process.binding is not supported")
  30711. }
  30712. ,
  30713. p.cwd = function() {
  30714. return "/"
  30715. }
  30716. ,
  30717. p.chdir = function(e) {
  30718. throw new Error("process.chdir is not supported")
  30719. }
  30720. ,
  30721. p.umask = function() {
  30722. return 0
  30723. }
  30724. }
  30725. , {}],
  30726. 204: [function(e, t, i) {
  30727. (function(e) {
  30728. !function(n) {
  30729. function r(e) {
  30730. throw new RangeError(L[e])
  30731. }
  30732. function o(e, t) {
  30733. for (var i = e.length, n = []; i--; )
  30734. n[i] = t(e[i]);
  30735. return n
  30736. }
  30737. function a(e, t) {
  30738. var i = e.split("@")
  30739. , n = "";
  30740. i.length > 1 && (n = i[0] + "@",
  30741. e = i[1]),
  30742. e = e.replace(O, ".");
  30743. var r = e.split(".")
  30744. , a = o(r, t).join(".");
  30745. return n + a
  30746. }
  30747. function s(e) {
  30748. for (var t, i, n = [], r = 0, o = e.length; r < o; )
  30749. t = e.charCodeAt(r++),
  30750. t >= 55296 && t <= 56319 && r < o ? (i = e.charCodeAt(r++),
  30751. 56320 == (64512 & i) ? n.push(((1023 & t) << 10) + (1023 & i) + 65536) : (n.push(t),
  30752. r--)) : n.push(t);
  30753. return n
  30754. }
  30755. function l(e) {
  30756. return o(e, function(e) {
  30757. var t = "";
  30758. return e > 65535 && (e -= 65536,
  30759. t += B(e >>> 10 & 1023 | 55296),
  30760. e = 56320 | 1023 & e),
  30761. t += B(e)
  30762. }).join("")
  30763. }
  30764. function c(e) {
  30765. return e - 48 < 10 ? e - 22 : e - 65 < 26 ? e - 65 : e - 97 < 26 ? e - 97 : E
  30766. }
  30767. function h(e, t) {
  30768. return e + 22 + 75 * (e < 26) - ((0 != t) << 5)
  30769. }
  30770. function u(e, t, i) {
  30771. var n = 0;
  30772. for (e = i ? N(e / T) : e >> 1,
  30773. e += N(e / t); e > D * w >> 1; n += E)
  30774. e = N(e / D);
  30775. return N(n + (D + 1) * e / (e + _))
  30776. }
  30777. function d(e) {
  30778. var t, i, n, o, a, s, h, d, p, f, g = [], m = e.length, v = 0, A = S, y = x;
  30779. for (i = e.lastIndexOf(M),
  30780. i < 0 && (i = 0),
  30781. n = 0; n < i; ++n)
  30782. e.charCodeAt(n) >= 128 && r("not-basic"),
  30783. g.push(e.charCodeAt(n));
  30784. for (o = i > 0 ? i + 1 : 0; o < m; ) {
  30785. for (a = v,
  30786. s = 1,
  30787. h = E; o >= m && r("invalid-input"),
  30788. d = c(e.charCodeAt(o++)),
  30789. (d >= E || d > N((I - v) / s)) && r("overflow"),
  30790. v += d * s,
  30791. p = h <= y ? b : h >= y + w ? w : h - y,
  30792. !(d < p); h += E)
  30793. f = E - p,
  30794. s > N(I / f) && r("overflow"),
  30795. s *= f;
  30796. t = g.length + 1,
  30797. y = u(v - a, t, 0 == a),
  30798. N(v / t) > I - A && r("overflow"),
  30799. A += N(v / t),
  30800. v %= t,
  30801. g.splice(v++, 0, A)
  30802. }
  30803. return l(g)
  30804. }
  30805. function p(e) {
  30806. var t, i, n, o, a, l, c, d, p, f, g, m, v, A, y, C = [];
  30807. for (e = s(e),
  30808. m = e.length,
  30809. t = S,
  30810. i = 0,
  30811. a = x,
  30812. l = 0; l < m; ++l)
  30813. g = e[l],
  30814. g < 128 && C.push(B(g));
  30815. for (n = o = C.length,
  30816. o && C.push(M); n < m; ) {
  30817. for (c = I,
  30818. l = 0; l < m; ++l)
  30819. g = e[l],
  30820. g >= t && g < c && (c = g);
  30821. for (v = n + 1,
  30822. c - t > N((I - i) / v) && r("overflow"),
  30823. i += (c - t) * v,
  30824. t = c,
  30825. l = 0; l < m; ++l)
  30826. if (g = e[l],
  30827. g < t && ++i > I && r("overflow"),
  30828. g == t) {
  30829. for (d = i,
  30830. p = E; f = p <= a ? b : p >= a + w ? w : p - a,
  30831. !(d < f); p += E)
  30832. y = d - f,
  30833. A = E - f,
  30834. C.push(B(h(f + y % A, 0))),
  30835. d = N(y / A);
  30836. C.push(B(h(d, 0))),
  30837. a = u(i, v, n == o),
  30838. i = 0,
  30839. ++n
  30840. }
  30841. ++i,
  30842. ++t
  30843. }
  30844. return C.join("")
  30845. }
  30846. function f(e) {
  30847. return a(e, function(e) {
  30848. return R.test(e) ? d(e.slice(4).toLowerCase()) : e
  30849. })
  30850. }
  30851. function g(e) {
  30852. return a(e, function(e) {
  30853. return P.test(e) ? "xn--" + p(e) : e
  30854. })
  30855. }
  30856. var m = "object" == typeof i && i && !i.nodeType && i
  30857. , v = "object" == typeof t && t && !t.nodeType && t
  30858. , A = "object" == typeof e && e;
  30859. A.global !== A && A.window !== A && A.self !== A || (n = A);
  30860. var y, C, I = 2147483647, E = 36, b = 1, w = 26, _ = 38, T = 700, x = 72, S = 128, M = "-", R = /^xn--/, P = /[^\x20-\x7E]/, O = /[\x2E\u3002\uFF0E\uFF61]/g, L = {
  30861. overflow: "Overflow: input needs wider integers to process",
  30862. "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  30863. "invalid-input": "Invalid input"
  30864. }, D = E - b, N = Math.floor, B = String.fromCharCode;
  30865. if (y = {
  30866. version: "1.4.1",
  30867. ucs2: {
  30868. decode: s,
  30869. encode: l
  30870. },
  30871. decode: d,
  30872. encode: p,
  30873. toASCII: g,
  30874. toUnicode: f
  30875. },
  30876. "function" == typeof define && "object" == typeof define.amd && define.amd)
  30877. define("punycode", function() {
  30878. return y
  30879. });
  30880. else if (m && v)
  30881. if (t.exports == m)
  30882. v.exports = y;
  30883. else
  30884. for (C in y)
  30885. y.hasOwnProperty(C) && (m[C] = y[C]);
  30886. else
  30887. n.punycode = y
  30888. }(this)
  30889. }
  30890. ).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {})
  30891. }
  30892. , {}],
  30893. 205: [function(e, t, i) {
  30894. "use strict";
  30895. function n(e, t) {
  30896. return Object.prototype.hasOwnProperty.call(e, t)
  30897. }
  30898. t.exports = function(e, t, i, o) {
  30899. t = t || "&",
  30900. i = i || "=";
  30901. var a = {};
  30902. if ("string" != typeof e || 0 === e.length)
  30903. return a;
  30904. var s = /\+/g;
  30905. e = e.split(t);
  30906. var l = 1e3;
  30907. o && "number" == typeof o.maxKeys && (l = o.maxKeys);
  30908. var c = e.length;
  30909. l > 0 && c > l && (c = l);
  30910. for (var h = 0; h < c; ++h) {
  30911. var u, d, p, f, g = e[h].replace(s, "%20"), m = g.indexOf(i);
  30912. m >= 0 ? (u = g.substr(0, m),
  30913. d = g.substr(m + 1)) : (u = g,
  30914. d = ""),
  30915. p = decodeURIComponent(u),
  30916. f = decodeURIComponent(d),
  30917. n(a, p) ? r(a[p]) ? a[p].push(f) : a[p] = [a[p], f] : a[p] = f
  30918. }
  30919. return a
  30920. }
  30921. ;
  30922. var r = Array.isArray || function(e) {
  30923. return "[object Array]" === Object.prototype.toString.call(e)
  30924. }
  30925. }
  30926. , {}],
  30927. 206: [function(e, t, i) {
  30928. "use strict";
  30929. function n(e, t) {
  30930. if (e.map)
  30931. return e.map(t);
  30932. for (var i = [], n = 0; n < e.length; n++)
  30933. i.push(t(e[n], n));
  30934. return i
  30935. }
  30936. var r = function(e) {
  30937. switch (typeof e) {
  30938. case "string":
  30939. return e;
  30940. case "boolean":
  30941. return e ? "true" : "false";
  30942. case "number":
  30943. return isFinite(e) ? e : "";
  30944. default:
  30945. return ""
  30946. }
  30947. };
  30948. t.exports = function(e, t, i, s) {
  30949. return t = t || "&",
  30950. i = i || "=",
  30951. null === e && (e = void 0),
  30952. "object" == typeof e ? n(a(e), function(a) {
  30953. var s = encodeURIComponent(r(a)) + i;
  30954. return o(e[a]) ? n(e[a], function(e) {
  30955. return s + encodeURIComponent(r(e))
  30956. }).join(t) : s + encodeURIComponent(r(e[a]))
  30957. }).join(t) : s ? encodeURIComponent(r(s)) + i + encodeURIComponent(r(e)) : ""
  30958. }
  30959. ;
  30960. var o = Array.isArray || function(e) {
  30961. return "[object Array]" === Object.prototype.toString.call(e)
  30962. }
  30963. , a = Object.keys || function(e) {
  30964. var t = [];
  30965. for (var i in e)
  30966. Object.prototype.hasOwnProperty.call(e, i) && t.push(i);
  30967. return t
  30968. }
  30969. }
  30970. , {}],
  30971. 207: [function(e, t, i) {
  30972. "use strict";
  30973. i.decode = i.parse = e("./decode"),
  30974. i.encode = i.stringify = e("./encode")
  30975. }
  30976. , {
  30977. "./decode": 205,
  30978. "./encode": 206
  30979. }],
  30980. 208: [function(e, t, i) {
  30981. "use strict";
  30982. function n() {
  30983. this.protocol = null,
  30984. this.slashes = null,
  30985. this.auth = null,
  30986. this.host = null,
  30987. this.port = null,
  30988. this.hostname = null,
  30989. this.hash = null,
  30990. this.search = null,
  30991. this.query = null,
  30992. this.pathname = null,
  30993. this.path = null,
  30994. this.href = null
  30995. }
  30996. function r(e, t, i) {
  30997. if (e && c.isObject(e) && e instanceof n)
  30998. return e;
  30999. var r = new n;
  31000. return r.parse(e, t, i),
  31001. r
  31002. }
  31003. function o(e) {
  31004. return c.isString(e) && (e = r(e)),
  31005. e instanceof n ? e.format() : n.prototype.format.call(e)
  31006. }
  31007. function a(e, t) {
  31008. return r(e, !1, !0).resolve(t)
  31009. }
  31010. function s(e, t) {
  31011. return e ? r(e, !1, !0).resolveObject(t) : t
  31012. }
  31013. var l = e("punycode")
  31014. , c = e("./util");
  31015. i.parse = r,
  31016. i.resolve = a,
  31017. i.resolveObject = s,
  31018. i.format = o,
  31019. i.Url = n;
  31020. var h = /^([a-z0-9.+-]+:)/i
  31021. , u = /:[0-9]*$/
  31022. , d = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/
  31023. , p = ["<", ">", '"', "`", " ", "\r", "\n", "\t"]
  31024. , f = ["{", "}", "|", "\\", "^", "`"].concat(p)
  31025. , g = ["'"].concat(f)
  31026. , m = ["%", "/", "?", ";", "#"].concat(g)
  31027. , v = ["/", "?", "#"]
  31028. , A = 255
  31029. , y = /^[+a-z0-9A-Z_-]{0,63}$/
  31030. , C = /^([+a-z0-9A-Z_-]{0,63})(.*)$/
  31031. , I = {
  31032. javascript: !0,
  31033. "javascript:": !0
  31034. }
  31035. , E = {
  31036. javascript: !0,
  31037. "javascript:": !0
  31038. }
  31039. , b = {
  31040. http: !0,
  31041. https: !0,
  31042. ftp: !0,
  31043. gopher: !0,
  31044. file: !0,
  31045. "http:": !0,
  31046. "https:": !0,
  31047. "ftp:": !0,
  31048. "gopher:": !0,
  31049. "file:": !0
  31050. }
  31051. , w = e("querystring");
  31052. n.prototype.parse = function(e, t, i) {
  31053. if (!c.isString(e))
  31054. throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
  31055. var n = e.indexOf("?")
  31056. , r = n !== -1 && n < e.indexOf("#") ? "?" : "#"
  31057. , o = e.split(r)
  31058. , a = /\\/g;
  31059. o[0] = o[0].replace(a, "/"),
  31060. e = o.join(r);
  31061. var s = e;
  31062. if (s = s.trim(),
  31063. !i && 1 === e.split("#").length) {
  31064. var u = d.exec(s);
  31065. if (u)
  31066. return this.path = s,
  31067. this.href = s,
  31068. this.pathname = u[1],
  31069. u[2] ? (this.search = u[2],
  31070. t ? this.query = w.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : t && (this.search = "",
  31071. this.query = {}),
  31072. this
  31073. }
  31074. var p = h.exec(s);
  31075. if (p) {
  31076. p = p[0];
  31077. var f = p.toLowerCase();
  31078. this.protocol = f,
  31079. s = s.substr(p.length)
  31080. }
  31081. if (i || p || s.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  31082. var _ = "//" === s.substr(0, 2);
  31083. !_ || p && E[p] || (s = s.substr(2),
  31084. this.slashes = !0)
  31085. }
  31086. if (!E[p] && (_ || p && !b[p])) {
  31087. for (var T = -1, x = 0; x < v.length; x++) {
  31088. var S = s.indexOf(v[x]);
  31089. S !== -1 && (T === -1 || S < T) && (T = S)
  31090. }
  31091. var M, R;
  31092. R = T === -1 ? s.lastIndexOf("@") : s.lastIndexOf("@", T),
  31093. R !== -1 && (M = s.slice(0, R),
  31094. s = s.slice(R + 1),
  31095. this.auth = decodeURIComponent(M)),
  31096. T = -1;
  31097. for (var x = 0; x < m.length; x++) {
  31098. var S = s.indexOf(m[x]);
  31099. S !== -1 && (T === -1 || S < T) && (T = S)
  31100. }
  31101. T === -1 && (T = s.length),
  31102. this.host = s.slice(0, T),
  31103. s = s.slice(T),
  31104. this.parseHost(),
  31105. this.hostname = this.hostname || "";
  31106. var P = "[" === this.hostname[0] && "]" === this.hostname[this.hostname.length - 1];
  31107. if (!P)
  31108. for (var O = this.hostname.split(/\./), x = 0, L = O.length; x < L; x++) {
  31109. var D = O[x];
  31110. if (D && !D.match(y)) {
  31111. for (var N = "", B = 0, F = D.length; B < F; B++)
  31112. N += D.charCodeAt(B) > 127 ? "x" : D[B];
  31113. if (!N.match(y)) {
  31114. var V = O.slice(0, x)
  31115. , U = O.slice(x + 1)
  31116. , k = D.match(C);
  31117. k && (V.push(k[1]),
  31118. U.unshift(k[2])),
  31119. U.length && (s = "/" + U.join(".") + s),
  31120. this.hostname = V.join(".");
  31121. break
  31122. }
  31123. }
  31124. }
  31125. this.hostname.length > A ? this.hostname = "" : this.hostname = this.hostname.toLowerCase(),
  31126. P || (this.hostname = l.toASCII(this.hostname));
  31127. var H = this.port ? ":" + this.port : ""
  31128. , G = this.hostname || "";
  31129. this.host = G + H,
  31130. this.href += this.host,
  31131. P && (this.hostname = this.hostname.substr(1, this.hostname.length - 2),
  31132. "/" !== s[0] && (s = "/" + s))
  31133. }
  31134. if (!I[f])
  31135. for (var x = 0, L = g.length; x < L; x++) {
  31136. var z = g[x];
  31137. if (s.indexOf(z) !== -1) {
  31138. var W = encodeURIComponent(z);
  31139. W === z && (W = escape(z)),
  31140. s = s.split(z).join(W)
  31141. }
  31142. }
  31143. var j = s.indexOf("#");
  31144. j !== -1 && (this.hash = s.substr(j),
  31145. s = s.slice(0, j));
  31146. var Y = s.indexOf("?");
  31147. if (Y !== -1 ? (this.search = s.substr(Y),
  31148. this.query = s.substr(Y + 1),
  31149. t && (this.query = w.parse(this.query)),
  31150. s = s.slice(0, Y)) : t && (this.search = "",
  31151. this.query = {}),
  31152. s && (this.pathname = s),
  31153. b[f] && this.hostname && !this.pathname && (this.pathname = "/"),
  31154. this.pathname || this.search) {
  31155. var H = this.pathname || ""
  31156. , X = this.search || "";
  31157. this.path = H + X
  31158. }
  31159. return this.href = this.format(),
  31160. this
  31161. }
  31162. ,
  31163. n.prototype.format = function() {
  31164. var e = this.auth || "";
  31165. e && (e = encodeURIComponent(e),
  31166. e = e.replace(/%3A/i, ":"),
  31167. e += "@");
  31168. var t = this.protocol || ""
  31169. , i = this.pathname || ""
  31170. , n = this.hash || ""
  31171. , r = !1
  31172. , o = "";
  31173. this.host ? r = e + this.host : this.hostname && (r = e + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]"),
  31174. this.port && (r += ":" + this.port)),
  31175. this.query && c.isObject(this.query) && Object.keys(this.query).length && (o = w.stringify(this.query));
  31176. var a = this.search || o && "?" + o || "";
  31177. return t && ":" !== t.substr(-1) && (t += ":"),
  31178. this.slashes || (!t || b[t]) && r !== !1 ? (r = "//" + (r || ""),
  31179. i && "/" !== i.charAt(0) && (i = "/" + i)) : r || (r = ""),
  31180. n && "#" !== n.charAt(0) && (n = "#" + n),
  31181. a && "?" !== a.charAt(0) && (a = "?" + a),
  31182. i = i.replace(/[?#]/g, function(e) {
  31183. return encodeURIComponent(e)
  31184. }),
  31185. a = a.replace("#", "%23"),
  31186. t + r + i + a + n
  31187. }
  31188. ,
  31189. n.prototype.resolve = function(e) {
  31190. return this.resolveObject(r(e, !1, !0)).format()
  31191. }
  31192. ,
  31193. n.prototype.resolveObject = function(e) {
  31194. if (c.isString(e)) {
  31195. var t = new n;
  31196. t.parse(e, !1, !0),
  31197. e = t
  31198. }
  31199. for (var i = new n, r = Object.keys(this), o = 0; o < r.length; o++) {
  31200. var a = r[o];
  31201. i[a] = this[a]
  31202. }
  31203. if (i.hash = e.hash,
  31204. "" === e.href)
  31205. return i.href = i.format(),
  31206. i;
  31207. if (e.slashes && !e.protocol) {
  31208. for (var s = Object.keys(e), l = 0; l < s.length; l++) {
  31209. var h = s[l];
  31210. "protocol" !== h && (i[h] = e[h])
  31211. }
  31212. return b[i.protocol] && i.hostname && !i.pathname && (i.path = i.pathname = "/"),
  31213. i.href = i.format(),
  31214. i
  31215. }
  31216. if (e.protocol && e.protocol !== i.protocol) {
  31217. if (!b[e.protocol]) {
  31218. for (var u = Object.keys(e), d = 0; d < u.length; d++) {
  31219. var p = u[d];
  31220. i[p] = e[p]
  31221. }
  31222. return i.href = i.format(),
  31223. i
  31224. }
  31225. if (i.protocol = e.protocol,
  31226. e.host || E[e.protocol])
  31227. i.pathname = e.pathname;
  31228. else {
  31229. for (var f = (e.pathname || "").split("/"); f.length && !(e.host = f.shift()); )
  31230. ;
  31231. e.host || (e.host = ""),
  31232. e.hostname || (e.hostname = ""),
  31233. "" !== f[0] && f.unshift(""),
  31234. f.length < 2 && f.unshift(""),
  31235. i.pathname = f.join("/")
  31236. }
  31237. if (i.search = e.search,
  31238. i.query = e.query,
  31239. i.host = e.host || "",
  31240. i.auth = e.auth,
  31241. i.hostname = e.hostname || e.host,
  31242. i.port = e.port,
  31243. i.pathname || i.search) {
  31244. var g = i.pathname || ""
  31245. , m = i.search || "";
  31246. i.path = g + m
  31247. }
  31248. return i.slashes = i.slashes || e.slashes,
  31249. i.href = i.format(),
  31250. i
  31251. }
  31252. var v = i.pathname && "/" === i.pathname.charAt(0)
  31253. , A = e.host || e.pathname && "/" === e.pathname.charAt(0)
  31254. , y = A || v || i.host && e.pathname
  31255. , C = y
  31256. , I = i.pathname && i.pathname.split("/") || []
  31257. , f = e.pathname && e.pathname.split("/") || []
  31258. , w = i.protocol && !b[i.protocol];
  31259. if (w && (i.hostname = "",
  31260. i.port = null,
  31261. i.host && ("" === I[0] ? I[0] = i.host : I.unshift(i.host)),
  31262. i.host = "",
  31263. e.protocol && (e.hostname = null,
  31264. e.port = null,
  31265. e.host && ("" === f[0] ? f[0] = e.host : f.unshift(e.host)),
  31266. e.host = null),
  31267. y = y && ("" === f[0] || "" === I[0])),
  31268. A)
  31269. i.host = e.host || "" === e.host ? e.host : i.host,
  31270. i.hostname = e.hostname || "" === e.hostname ? e.hostname : i.hostname,
  31271. i.search = e.search,
  31272. i.query = e.query,
  31273. I = f;
  31274. else if (f.length)
  31275. I || (I = []),
  31276. I.pop(),
  31277. I = I.concat(f),
  31278. i.search = e.search,
  31279. i.query = e.query;
  31280. else if (!c.isNullOrUndefined(e.search)) {
  31281. if (w) {
  31282. i.hostname = i.host = I.shift();
  31283. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31284. _ && (i.auth = _.shift(),
  31285. i.host = i.hostname = _.shift())
  31286. }
  31287. return i.search = e.search,
  31288. i.query = e.query,
  31289. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31290. i.href = i.format(),
  31291. i
  31292. }
  31293. if (!I.length)
  31294. return i.pathname = null,
  31295. i.search ? i.path = "/" + i.search : i.path = null,
  31296. i.href = i.format(),
  31297. i;
  31298. 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--)
  31299. T = I[M],
  31300. "." === T ? I.splice(M, 1) : ".." === T ? (I.splice(M, 1),
  31301. S++) : S && (I.splice(M, 1),
  31302. S--);
  31303. if (!y && !C)
  31304. for (; S--; S)
  31305. I.unshift("..");
  31306. !y || "" === I[0] || I[0] && "/" === I[0].charAt(0) || I.unshift(""),
  31307. x && "/" !== I.join("/").substr(-1) && I.push("");
  31308. var R = "" === I[0] || I[0] && "/" === I[0].charAt(0);
  31309. if (w) {
  31310. i.hostname = i.host = R ? "" : I.length ? I.shift() : "";
  31311. var _ = !!(i.host && i.host.indexOf("@") > 0) && i.host.split("@");
  31312. _ && (i.auth = _.shift(),
  31313. i.host = i.hostname = _.shift())
  31314. }
  31315. return y = y || i.host && I.length,
  31316. y && !R && I.unshift(""),
  31317. I.length ? i.pathname = I.join("/") : (i.pathname = null,
  31318. i.path = null),
  31319. c.isNull(i.pathname) && c.isNull(i.search) || (i.path = (i.pathname ? i.pathname : "") + (i.search ? i.search : "")),
  31320. i.auth = e.auth || i.auth,
  31321. i.slashes = i.slashes || e.slashes,
  31322. i.href = i.format(),
  31323. i
  31324. }
  31325. ,
  31326. n.prototype.parseHost = function() {
  31327. var e = this.host
  31328. , t = u.exec(e);
  31329. t && (t = t[0],
  31330. ":" !== t && (this.port = t.substr(1)),
  31331. e = e.substr(0, e.length - t.length)),
  31332. e && (this.hostname = e)
  31333. }
  31334. }
  31335. , {
  31336. "./util": 209,
  31337. punycode: 204,
  31338. querystring: 207
  31339. }],
  31340. 209: [function(e, t, i) {
  31341. "use strict";
  31342. t.exports = {
  31343. isString: function(e) {
  31344. return "string" == typeof e
  31345. },
  31346. isObject: function(e) {
  31347. return "object" == typeof e && null !== e
  31348. },
  31349. isNull: function(e) {
  31350. return null === e
  31351. },
  31352. isNullOrUndefined: function(e) {
  31353. return null == e
  31354. }
  31355. }
  31356. }
  31357. , {}],
  31358. 210: [function(e, t, i) {
  31359. "use strict";
  31360. function n(e) {
  31361. return l + e
  31362. }
  31363. function r(e) {
  31364. return e.substring(l.length)
  31365. }
  31366. function o(e, t) {
  31367. for (var i in t)
  31368. Object.defineProperty(e, i, {
  31369. value: t[i],
  31370. configurable: !0,
  31371. writable: !0
  31372. })
  31373. }
  31374. function a(e) {
  31375. if ("string" != typeof e)
  31376. throw new TypeError("key must be a string.")
  31377. }
  31378. var s = Object.prototype.hasOwnProperty
  31379. , l = "~";
  31380. t.exports = function(e) {
  31381. var t = Object.create(null)
  31382. , i = 0
  31383. , l = {};
  31384. return o(l, {
  31385. get: function(e, i) {
  31386. a(e);
  31387. var r = n(e);
  31388. return r in t ? t[r] : i
  31389. },
  31390. set: function(e, r) {
  31391. a(e);
  31392. var o = n(e);
  31393. return o in t || ++i,
  31394. t[o] = r
  31395. },
  31396. has: function(e) {
  31397. return a(e),
  31398. n(e)in t
  31399. },
  31400. delete: function(e) {
  31401. a(e);
  31402. var r = n(e);
  31403. return r in t && (--i,
  31404. delete t[r],
  31405. !0)
  31406. },
  31407. clear: function() {
  31408. t = Object.create(null),
  31409. i = 0
  31410. },
  31411. forEach: function(e, i) {
  31412. if ("function" != typeof e)
  31413. throw new TypeError("`callback` must be a function");
  31414. for (var n in t)
  31415. if (s.call(t, n)) {
  31416. var o = r(n)
  31417. , a = t[n];
  31418. e.call(i, a, o, l)
  31419. }
  31420. }
  31421. }),
  31422. Object.defineProperty(l, "size", {
  31423. get: function() {
  31424. return i
  31425. },
  31426. configurable: !0
  31427. }),
  31428. "object" == typeof e && null !== e && Object.keys(e).forEach(function(t) {
  31429. l.set(t, e[t])
  31430. }),
  31431. l
  31432. }
  31433. }
  31434. , {}],
  31435. 211: [function(e, t, i) {
  31436. t.exports = e("./lib/heap")
  31437. }
  31438. , {
  31439. "./lib/heap": 212
  31440. }],
  31441. 212: [function(e, t, i) {
  31442. (function() {
  31443. var e, n, r, o, a, s, l, c, h, u, d, p, f, g, m;
  31444. r = Math.floor,
  31445. u = Math.min,
  31446. n = function(e, t) {
  31447. return e < t ? -1 : e > t ? 1 : 0
  31448. }
  31449. ,
  31450. h = function(e, t, i, o, a) {
  31451. var s;
  31452. if (null == i && (i = 0),
  31453. null == a && (a = n),
  31454. i < 0)
  31455. throw new Error("lo must be non-negative");
  31456. for (null == o && (o = e.length); i < o; )
  31457. s = r((i + o) / 2),
  31458. a(t, e[s]) < 0 ? o = s : i = s + 1;
  31459. return [].splice.apply(e, [i, i - i].concat(t)),
  31460. t
  31461. }
  31462. ,
  31463. s = function(e, t, i) {
  31464. return null == i && (i = n),
  31465. e.push(t),
  31466. g(e, 0, e.length - 1, i)
  31467. }
  31468. ,
  31469. a = function(e, t) {
  31470. var i, r;
  31471. return null == t && (t = n),
  31472. i = e.pop(),
  31473. e.length ? (r = e[0],
  31474. e[0] = i,
  31475. m(e, 0, t)) : r = i,
  31476. r
  31477. }
  31478. ,
  31479. c = function(e, t, i) {
  31480. var r;
  31481. return null == i && (i = n),
  31482. r = e[0],
  31483. e[0] = t,
  31484. m(e, 0, i),
  31485. r
  31486. }
  31487. ,
  31488. l = function(e, t, i) {
  31489. var r;
  31490. return null == i && (i = n),
  31491. e.length && i(e[0], t) < 0 && (r = [e[0], t],
  31492. t = r[0],
  31493. e[0] = r[1],
  31494. m(e, 0, i)),
  31495. t
  31496. }
  31497. ,
  31498. o = function(e, t) {
  31499. var i, o, a, s, l, c;
  31500. for (null == t && (t = n),
  31501. s = function() {
  31502. c = [];
  31503. for (var t = 0, i = r(e.length / 2); 0 <= i ? t < i : t > i; 0 <= i ? t++ : t--)
  31504. c.push(t);
  31505. return c
  31506. }
  31507. .apply(this).reverse(),
  31508. l = [],
  31509. o = 0,
  31510. a = s.length; o < a; o++)
  31511. i = s[o],
  31512. l.push(m(e, i, t));
  31513. return l
  31514. }
  31515. ,
  31516. f = function(e, t, i) {
  31517. var r;
  31518. if (null == i && (i = n),
  31519. r = e.indexOf(t),
  31520. r !== -1)
  31521. return g(e, 0, r, i),
  31522. m(e, r, i)
  31523. }
  31524. ,
  31525. d = function(e, t, i) {
  31526. var r, a, s, c, h;
  31527. if (null == i && (i = n),
  31528. a = e.slice(0, t),
  31529. !a.length)
  31530. return a;
  31531. for (o(a, i),
  31532. h = e.slice(t),
  31533. s = 0,
  31534. c = h.length; s < c; s++)
  31535. r = h[s],
  31536. l(a, r, i);
  31537. return a.sort(i).reverse()
  31538. }
  31539. ,
  31540. p = function(e, t, i) {
  31541. var r, s, l, c, d, p, f, g, m, v;
  31542. if (null == i && (i = n),
  31543. 10 * t <= e.length) {
  31544. if (c = e.slice(0, t).sort(i),
  31545. !c.length)
  31546. return c;
  31547. for (l = c[c.length - 1],
  31548. g = e.slice(t),
  31549. d = 0,
  31550. f = g.length; d < f; d++)
  31551. r = g[d],
  31552. i(r, l) < 0 && (h(c, r, 0, null, i),
  31553. c.pop(),
  31554. l = c[c.length - 1]);
  31555. return c
  31556. }
  31557. for (o(e, i),
  31558. v = [],
  31559. s = p = 0,
  31560. m = u(t, e.length); 0 <= m ? p < m : p > m; s = 0 <= m ? ++p : --p)
  31561. v.push(a(e, i));
  31562. return v
  31563. }
  31564. ,
  31565. g = function(e, t, i, r) {
  31566. var o, a, s;
  31567. for (null == r && (r = n),
  31568. o = e[i]; i > t && (s = i - 1 >> 1,
  31569. a = e[s],
  31570. r(o, a) < 0); )
  31571. e[i] = a,
  31572. i = s;
  31573. return e[i] = o
  31574. }
  31575. ,
  31576. m = function(e, t, i) {
  31577. var r, o, a, s, l;
  31578. for (null == i && (i = n),
  31579. o = e.length,
  31580. l = t,
  31581. a = e[t],
  31582. r = 2 * t + 1; r < o; )
  31583. s = r + 1,
  31584. s < o && !(i(e[r], e[s]) < 0) && (r = s),
  31585. e[t] = e[r],
  31586. t = r,
  31587. r = 2 * t + 1;
  31588. return e[t] = a,
  31589. g(e, l, t, i)
  31590. }
  31591. ,
  31592. e = function() {
  31593. function e(e) {
  31594. this.cmp = null != e ? e : n,
  31595. this.nodes = []
  31596. }
  31597. return e.push = s,
  31598. e.pop = a,
  31599. e.replace = c,
  31600. e.pushpop = l,
  31601. e.heapify = o,
  31602. e.updateItem = f,
  31603. e.nlargest = d,
  31604. e.nsmallest = p,
  31605. e.prototype.push = function(e) {
  31606. return s(this.nodes, e, this.cmp)
  31607. }
  31608. ,
  31609. e.prototype.pop = function() {
  31610. return a(this.nodes, this.cmp)
  31611. }
  31612. ,
  31613. e.prototype.peek = function() {
  31614. return this.nodes[0]
  31615. }
  31616. ,
  31617. e.prototype.contains = function(e) {
  31618. return this.nodes.indexOf(e) !== -1
  31619. }
  31620. ,
  31621. e.prototype.replace = function(e) {
  31622. return c(this.nodes, e, this.cmp)
  31623. }
  31624. ,
  31625. e.prototype.pushpop = function(e) {
  31626. return l(this.nodes, e, this.cmp)
  31627. }
  31628. ,
  31629. e.prototype.heapify = function() {
  31630. return o(this.nodes, this.cmp)
  31631. }
  31632. ,
  31633. e.prototype.updateItem = function(e) {
  31634. return f(this.nodes, e, this.cmp)
  31635. }
  31636. ,
  31637. e.prototype.clear = function() {
  31638. return this.nodes = []
  31639. }
  31640. ,
  31641. e.prototype.empty = function() {
  31642. return 0 === this.nodes.length
  31643. }
  31644. ,
  31645. e.prototype.size = function() {
  31646. return this.nodes.length
  31647. }
  31648. ,
  31649. e.prototype.clone = function() {
  31650. var t;
  31651. return t = new e,
  31652. t.nodes = this.nodes.slice(0),
  31653. t
  31654. }
  31655. ,
  31656. e.prototype.toArray = function() {
  31657. return this.nodes.slice(0)
  31658. }
  31659. ,
  31660. e.prototype.insert = e.prototype.push,
  31661. e.prototype.top = e.prototype.peek,
  31662. e.prototype.front = e.prototype.peek,
  31663. e.prototype.has = e.prototype.contains,
  31664. e.prototype.copy = e.prototype.clone,
  31665. e
  31666. }(),
  31667. function(e, n) {
  31668. return "function" == typeof define && define.amd ? define([], n) : "object" == typeof i ? t.exports = n() : e.Heap = n()
  31669. }(this, function() {
  31670. return e
  31671. })
  31672. }
  31673. ).call(this)
  31674. }
  31675. , {}],
  31676. 213: [function(e, t, i) {
  31677. !function(e) {
  31678. function i() {}
  31679. function n(e, t) {
  31680. return function() {
  31681. e.apply(t, arguments)
  31682. }
  31683. }
  31684. function r(e) {
  31685. if ("object" != typeof this)
  31686. throw new TypeError("Promises must be constructed via new");
  31687. if ("function" != typeof e)
  31688. throw new TypeError("not a function");
  31689. this._state = 0,
  31690. this._handled = !1,
  31691. this._value = void 0,
  31692. this._deferreds = [],
  31693. h(e, this)
  31694. }
  31695. function o(e, t) {
  31696. for (; 3 === e._state; )
  31697. e = e._value;
  31698. return 0 === e._state ? void e._deferreds.push(t) : (e._handled = !0,
  31699. void r._immediateFn(function() {
  31700. var i = 1 === e._state ? t.onFulfilled : t.onRejected;
  31701. if (null === i)
  31702. return void (1 === e._state ? a : s)(t.promise, e._value);
  31703. var n;
  31704. try {
  31705. n = i(e._value)
  31706. } catch (e) {
  31707. return void s(t.promise, e)
  31708. }
  31709. a(t.promise, n)
  31710. }))
  31711. }
  31712. function a(e, t) {
  31713. try {
  31714. if (t === e)
  31715. throw new TypeError("A promise cannot be resolved with itself.");
  31716. if (t && ("object" == typeof t || "function" == typeof t)) {
  31717. var i = t.then;
  31718. if (t instanceof r)
  31719. return e._state = 3,
  31720. e._value = t,
  31721. void l(e);
  31722. if ("function" == typeof i)
  31723. return void h(n(i, t), e)
  31724. }
  31725. e._state = 1,
  31726. e._value = t,
  31727. l(e)
  31728. } catch (t) {
  31729. s(e, t)
  31730. }
  31731. }
  31732. function s(e, t) {
  31733. e._state = 2,
  31734. e._value = t,
  31735. l(e)
  31736. }
  31737. function l(e) {
  31738. 2 === e._state && 0 === e._deferreds.length && r._immediateFn(function() {
  31739. e._handled || r._unhandledRejectionFn(e._value)
  31740. });
  31741. for (var t = 0, i = e._deferreds.length; t < i; t++)
  31742. o(e, e._deferreds[t]);
  31743. e._deferreds = null
  31744. }
  31745. function c(e, t, i) {
  31746. this.onFulfilled = "function" == typeof e ? e : null,
  31747. this.onRejected = "function" == typeof t ? t : null,
  31748. this.promise = i
  31749. }
  31750. function h(e, t) {
  31751. var i = !1;
  31752. try {
  31753. e(function(e) {
  31754. i || (i = !0,
  31755. a(t, e))
  31756. }, function(e) {
  31757. i || (i = !0,
  31758. s(t, e))
  31759. })
  31760. } catch (e) {
  31761. if (i)
  31762. return;
  31763. i = !0,
  31764. s(t, e)
  31765. }
  31766. }
  31767. var u = setTimeout;
  31768. r.prototype.catch = function(e) {
  31769. return this.then(null, e)
  31770. }
  31771. ,
  31772. r.prototype.then = function(e, t) {
  31773. var n = new this.constructor(i);
  31774. return o(this, new c(e,t,n)),
  31775. n
  31776. }
  31777. ,
  31778. r.all = function(e) {
  31779. var t = Array.prototype.slice.call(e);
  31780. return new r(function(e, i) {
  31781. function n(o, a) {
  31782. try {
  31783. if (a && ("object" == typeof a || "function" == typeof a)) {
  31784. var s = a.then;
  31785. if ("function" == typeof s)
  31786. return void s.call(a, function(e) {
  31787. n(o, e)
  31788. }, i)
  31789. }
  31790. t[o] = a,
  31791. 0 === --r && e(t)
  31792. } catch (e) {
  31793. i(e)
  31794. }
  31795. }
  31796. if (0 === t.length)
  31797. return e([]);
  31798. for (var r = t.length, o = 0; o < t.length; o++)
  31799. n(o, t[o])
  31800. }
  31801. )
  31802. }
  31803. ,
  31804. r.resolve = function(e) {
  31805. return e && "object" == typeof e && e.constructor === r ? e : new r(function(t) {
  31806. t(e)
  31807. }
  31808. )
  31809. }
  31810. ,
  31811. r.reject = function(e) {
  31812. return new r(function(t, i) {
  31813. i(e)
  31814. }
  31815. )
  31816. }
  31817. ,
  31818. r.race = function(e) {
  31819. return new r(function(t, i) {
  31820. for (var n = 0, r = e.length; n < r; n++)
  31821. e[n].then(t, i)
  31822. }
  31823. )
  31824. }
  31825. ,
  31826. r._immediateFn = "function" == typeof setImmediate && function(e) {
  31827. setImmediate(e)
  31828. }
  31829. || function(e) {
  31830. u(e, 0)
  31831. }
  31832. ,
  31833. r._unhandledRejectionFn = function(e) {
  31834. "undefined" != typeof console && console && console.warn("Possible Unhandled Promise Rejection:", e)
  31835. }
  31836. ,
  31837. r._setImmediateFn = function(e) {
  31838. r._immediateFn = e
  31839. }
  31840. ,
  31841. r._setUnhandledRejectionFn = function(e) {
  31842. r._unhandledRejectionFn = e
  31843. }
  31844. ,
  31845. "undefined" != typeof t && t.exports ? t.exports = r : e.Promise || (e.Promise = r)
  31846. }(this)
  31847. }
  31848. , {}],
  31849. 214: [function(e, t, i) {
  31850. (function(i) {
  31851. !function(i, n) {
  31852. "function" == typeof define && define.amd ? define(["bytebuffer"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = n(e("bytebuffer"), !0) : (i.dcodeIO = i.dcodeIO || {}).ProtoBuf = n(i.dcodeIO.ByteBuffer)
  31853. }(this, function(t, n) {
  31854. "use strict";
  31855. var r = {};
  31856. return r.ByteBuffer = t,
  31857. r.Long = t.Long || null,
  31858. r.VERSION = "5.0.1",
  31859. r.WIRE_TYPES = {},
  31860. r.WIRE_TYPES.VARINT = 0,
  31861. r.WIRE_TYPES.BITS64 = 1,
  31862. r.WIRE_TYPES.LDELIM = 2,
  31863. r.WIRE_TYPES.STARTGROUP = 3,
  31864. r.WIRE_TYPES.ENDGROUP = 4,
  31865. r.WIRE_TYPES.BITS32 = 5,
  31866. r.PACKABLE_WIRE_TYPES = [r.WIRE_TYPES.VARINT, r.WIRE_TYPES.BITS64, r.WIRE_TYPES.BITS32],
  31867. r.TYPES = {
  31868. int32: {
  31869. name: "int32",
  31870. wireType: r.WIRE_TYPES.VARINT,
  31871. defaultValue: 0
  31872. },
  31873. uint32: {
  31874. name: "uint32",
  31875. wireType: r.WIRE_TYPES.VARINT,
  31876. defaultValue: 0
  31877. },
  31878. sint32: {
  31879. name: "sint32",
  31880. wireType: r.WIRE_TYPES.VARINT,
  31881. defaultValue: 0
  31882. },
  31883. int64: {
  31884. name: "int64",
  31885. wireType: r.WIRE_TYPES.VARINT,
  31886. defaultValue: r.Long ? r.Long.ZERO : void 0
  31887. },
  31888. uint64: {
  31889. name: "uint64",
  31890. wireType: r.WIRE_TYPES.VARINT,
  31891. defaultValue: r.Long ? r.Long.UZERO : void 0
  31892. },
  31893. sint64: {
  31894. name: "sint64",
  31895. wireType: r.WIRE_TYPES.VARINT,
  31896. defaultValue: r.Long ? r.Long.ZERO : void 0
  31897. },
  31898. bool: {
  31899. name: "bool",
  31900. wireType: r.WIRE_TYPES.VARINT,
  31901. defaultValue: !1
  31902. },
  31903. double: {
  31904. name: "double",
  31905. wireType: r.WIRE_TYPES.BITS64,
  31906. defaultValue: 0
  31907. },
  31908. string: {
  31909. name: "string",
  31910. wireType: r.WIRE_TYPES.LDELIM,
  31911. defaultValue: ""
  31912. },
  31913. bytes: {
  31914. name: "bytes",
  31915. wireType: r.WIRE_TYPES.LDELIM,
  31916. defaultValue: null
  31917. },
  31918. fixed32: {
  31919. name: "fixed32",
  31920. wireType: r.WIRE_TYPES.BITS32,
  31921. defaultValue: 0
  31922. },
  31923. sfixed32: {
  31924. name: "sfixed32",
  31925. wireType: r.WIRE_TYPES.BITS32,
  31926. defaultValue: 0
  31927. },
  31928. fixed64: {
  31929. name: "fixed64",
  31930. wireType: r.WIRE_TYPES.BITS64,
  31931. defaultValue: r.Long ? r.Long.UZERO : void 0
  31932. },
  31933. sfixed64: {
  31934. name: "sfixed64",
  31935. wireType: r.WIRE_TYPES.BITS64,
  31936. defaultValue: r.Long ? r.Long.ZERO : void 0
  31937. },
  31938. float: {
  31939. name: "float",
  31940. wireType: r.WIRE_TYPES.BITS32,
  31941. defaultValue: 0
  31942. },
  31943. enum: {
  31944. name: "enum",
  31945. wireType: r.WIRE_TYPES.VARINT,
  31946. defaultValue: 0
  31947. },
  31948. message: {
  31949. name: "message",
  31950. wireType: r.WIRE_TYPES.LDELIM,
  31951. defaultValue: null
  31952. },
  31953. group: {
  31954. name: "group",
  31955. wireType: r.WIRE_TYPES.STARTGROUP,
  31956. defaultValue: null
  31957. }
  31958. },
  31959. r.MAP_KEY_TYPES = [r.TYPES.int32, r.TYPES.sint32, r.TYPES.sfixed32, r.TYPES.uint32, r.TYPES.fixed32, r.TYPES.int64, r.TYPES.sint64, r.TYPES.sfixed64, r.TYPES.uint64, r.TYPES.fixed64, r.TYPES.bool, r.TYPES.string, r.TYPES.bytes],
  31960. r.ID_MIN = 1,
  31961. r.ID_MAX = 536870911,
  31962. r.convertFieldsToCamelCase = !1,
  31963. r.populateAccessors = !0,
  31964. r.populateDefaults = !0,
  31965. r.Util = function() {
  31966. var t = {};
  31967. return t.IS_NODE = !("object" != typeof i || i + "" != "[object process]" || i.browser),
  31968. t.XHR = function() {
  31969. for (var e = [function() {
  31970. return new XMLHttpRequest
  31971. }
  31972. , function() {
  31973. return new ActiveXObject("Msxml2.XMLHTTP")
  31974. }
  31975. , function() {
  31976. return new ActiveXObject("Msxml3.XMLHTTP")
  31977. }
  31978. , function() {
  31979. return new ActiveXObject("Microsoft.XMLHTTP")
  31980. }
  31981. ], t = null, i = 0; i < e.length; i++) {
  31982. try {
  31983. t = e[i]()
  31984. } catch (e) {
  31985. continue
  31986. }
  31987. break
  31988. }
  31989. if (!t)
  31990. throw Error("XMLHttpRequest is not supported");
  31991. return t
  31992. }
  31993. ,
  31994. t.fetch = function(i, n) {
  31995. if (n && "function" != typeof n && (n = null),
  31996. t.IS_NODE) {
  31997. var r = e("fs");
  31998. if (n)
  31999. r.readFile(i, function(e, t) {
  32000. n(e ? null : "" + t)
  32001. });
  32002. else
  32003. try {
  32004. return r.readFileSync(i)
  32005. } catch (e) {
  32006. return null
  32007. }
  32008. } else {
  32009. var o = t.XHR();
  32010. if (o.open("GET", i, !!n),
  32011. o.setRequestHeader("Accept", "text/plain"),
  32012. "function" == typeof o.overrideMimeType && o.overrideMimeType("text/plain"),
  32013. !n)
  32014. return o.send(null),
  32015. 200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null;
  32016. if (o.onreadystatechange = function() {
  32017. 4 == o.readyState && n(200 == o.status || 0 == o.status && "string" == typeof o.responseText ? o.responseText : null)
  32018. }
  32019. ,
  32020. 4 == o.readyState)
  32021. return;
  32022. o.send(null)
  32023. }
  32024. }
  32025. ,
  32026. t.toCamelCase = function(e) {
  32027. return e.replace(/_([a-zA-Z])/g, function(e, t) {
  32028. return t.toUpperCase()
  32029. })
  32030. }
  32031. ,
  32032. t
  32033. }(),
  32034. r.Lang = {
  32035. DELIM: /[\s\{\}=;:\[\],'"\(\)<>]/g,
  32036. RULE: /^(?:required|optional|repeated|map)$/,
  32037. TYPE: /^(?:double|float|int32|uint32|sint32|int64|uint64|sint64|fixed32|sfixed32|fixed64|sfixed64|bool|string|bytes)$/,
  32038. NAME: /^[a-zA-Z_][a-zA-Z_0-9]*$/,
  32039. TYPEDEF: /^[a-zA-Z][a-zA-Z_0-9]*$/,
  32040. TYPEREF: /^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)+$/,
  32041. FQTYPEREF: /^(?:\.[a-zA-Z][a-zA-Z_0-9]*)+$/,
  32042. NUMBER: /^-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+|([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?)|inf|nan)$/,
  32043. NUMBER_DEC: /^(?:[1-9][0-9]*|0)$/,
  32044. NUMBER_HEX: /^0[xX][0-9a-fA-F]+$/,
  32045. NUMBER_OCT: /^0[0-7]+$/,
  32046. NUMBER_FLT: /^([0-9]*(\.[0-9]*)?([Ee][+-]?[0-9]+)?|inf|nan)$/,
  32047. BOOL: /^(?:true|false)$/i,
  32048. ID: /^(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32049. NEGID: /^\-?(?:[1-9][0-9]*|0|0[xX][0-9a-fA-F]+|0[0-7]+)$/,
  32050. WHITESPACE: /\s/,
  32051. STRING: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")|(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,
  32052. STRING_DQ: /(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,
  32053. STRING_SQ: /(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g
  32054. },
  32055. r.DotProto = function(e, t) {
  32056. function i(e, i) {
  32057. var n = -1
  32058. , r = 1;
  32059. if ("-" == e.charAt(0) && (r = -1,
  32060. e = e.substring(1)),
  32061. t.NUMBER_DEC.test(e))
  32062. n = parseInt(e);
  32063. else if (t.NUMBER_HEX.test(e))
  32064. n = parseInt(e.substring(2), 16);
  32065. else {
  32066. if (!t.NUMBER_OCT.test(e))
  32067. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32068. n = parseInt(e.substring(1), 8)
  32069. }
  32070. if (n = r * n | 0,
  32071. !i && n < 0)
  32072. throw Error("illegal id value: " + (r < 0 ? "-" : "") + e);
  32073. return n
  32074. }
  32075. function n(e) {
  32076. var i = 1;
  32077. if ("-" == e.charAt(0) && (i = -1,
  32078. e = e.substring(1)),
  32079. t.NUMBER_DEC.test(e))
  32080. return i * parseInt(e, 10);
  32081. if (t.NUMBER_HEX.test(e))
  32082. return i * parseInt(e.substring(2), 16);
  32083. if (t.NUMBER_OCT.test(e))
  32084. return i * parseInt(e.substring(1), 8);
  32085. if ("inf" === e)
  32086. return i * (1 / 0);
  32087. if ("nan" === e)
  32088. return NaN;
  32089. if (t.NUMBER_FLT.test(e))
  32090. return i * parseFloat(e);
  32091. throw Error("illegal number value: " + (i < 0 ? "-" : "") + e)
  32092. }
  32093. function r(e, t, i) {
  32094. "undefined" == typeof e[t] ? e[t] = i : (Array.isArray(e[t]) || (e[t] = [e[t]]),
  32095. e[t].push(i))
  32096. }
  32097. var o = {}
  32098. , a = function(e) {
  32099. this.source = e + "",
  32100. this.index = 0,
  32101. this.line = 1,
  32102. this.stack = [],
  32103. this._stringOpen = null
  32104. }
  32105. , s = a.prototype;
  32106. s._readString = function() {
  32107. var e = '"' === this._stringOpen ? t.STRING_DQ : t.STRING_SQ;
  32108. e.lastIndex = this.index - 1;
  32109. var i = e.exec(this.source);
  32110. if (!i)
  32111. throw Error("unterminated string");
  32112. return this.index = e.lastIndex,
  32113. this.stack.push(this._stringOpen),
  32114. this._stringOpen = null,
  32115. i[1]
  32116. }
  32117. ,
  32118. s.next = function() {
  32119. if (this.stack.length > 0)
  32120. return this.stack.shift();
  32121. if (this.index >= this.source.length)
  32122. return null;
  32123. if (null !== this._stringOpen)
  32124. return this._readString();
  32125. var e, i, n;
  32126. do {
  32127. for (e = !1; t.WHITESPACE.test(n = this.source.charAt(this.index)); )
  32128. if ("\n" === n && ++this.line,
  32129. ++this.index === this.source.length)
  32130. return null;
  32131. if ("/" === this.source.charAt(this.index))
  32132. if (++this.index,
  32133. "/" === this.source.charAt(this.index)) {
  32134. for (; "\n" !== this.source.charAt(++this.index); )
  32135. if (this.index == this.source.length)
  32136. return null;
  32137. ++this.index,
  32138. ++this.line,
  32139. e = !0
  32140. } else {
  32141. if ("*" !== (n = this.source.charAt(this.index)))
  32142. return "/";
  32143. do {
  32144. if ("\n" === n && ++this.line,
  32145. ++this.index === this.source.length)
  32146. return null;
  32147. i = n,
  32148. n = this.source.charAt(this.index)
  32149. } while ("*" !== i || "/" !== n);++this.index,
  32150. e = !0
  32151. }
  32152. } while (e);if (this.index === this.source.length)
  32153. return null;
  32154. var r = this.index;
  32155. t.DELIM.lastIndex = 0;
  32156. var o = t.DELIM.test(this.source.charAt(r++));
  32157. if (!o)
  32158. for (; r < this.source.length && !t.DELIM.test(this.source.charAt(r)); )
  32159. ++r;
  32160. var a = this.source.substring(this.index, this.index = r);
  32161. return '"' !== a && "'" !== a || (this._stringOpen = a),
  32162. a
  32163. }
  32164. ,
  32165. s.peek = function() {
  32166. if (0 === this.stack.length) {
  32167. var e = this.next();
  32168. if (null === e)
  32169. return null;
  32170. this.stack.push(e)
  32171. }
  32172. return this.stack[0]
  32173. }
  32174. ,
  32175. s.skip = function(e) {
  32176. var t = this.next();
  32177. if (t !== e)
  32178. throw Error("illegal '" + t + "', '" + e + "' expected")
  32179. }
  32180. ,
  32181. s.omit = function(e) {
  32182. return this.peek() === e && (this.next(),
  32183. !0)
  32184. }
  32185. ,
  32186. s.toString = function() {
  32187. return "Tokenizer (" + this.index + "/" + this.source.length + " at line " + this.line + ")"
  32188. }
  32189. ,
  32190. o.Tokenizer = a;
  32191. var l = function(e) {
  32192. this.tn = new a(e),
  32193. this.proto3 = !1
  32194. }
  32195. , c = l.prototype;
  32196. return c.parse = function() {
  32197. var e, i, n = {
  32198. name: "[ROOT]",
  32199. package: null,
  32200. messages: [],
  32201. enums: [],
  32202. imports: [],
  32203. options: {},
  32204. services: []
  32205. }, r = !0;
  32206. try {
  32207. for (; e = this.tn.next(); )
  32208. switch (e) {
  32209. case "package":
  32210. if (!r || null !== n.package)
  32211. throw Error("unexpected 'package'");
  32212. if (e = this.tn.next(),
  32213. !t.TYPEREF.test(e))
  32214. throw Error("illegal package name: " + e);
  32215. this.tn.skip(";"),
  32216. n.package = e;
  32217. break;
  32218. case "import":
  32219. if (!r)
  32220. throw Error("unexpected 'import'");
  32221. e = this.tn.peek(),
  32222. ("public" === e || (i = "weak" === e)) && this.tn.next(),
  32223. e = this._readString(),
  32224. this.tn.skip(";"),
  32225. i || n.imports.push(e);
  32226. break;
  32227. case "syntax":
  32228. if (!r)
  32229. throw Error("unexpected 'syntax'");
  32230. this.tn.skip("="),
  32231. "proto3" === (n.syntax = this._readString()) && (this.proto3 = !0),
  32232. this.tn.skip(";");
  32233. break;
  32234. case "message":
  32235. this._parseMessage(n, null),
  32236. r = !1;
  32237. break;
  32238. case "enum":
  32239. this._parseEnum(n),
  32240. r = !1;
  32241. break;
  32242. case "option":
  32243. this._parseOption(n);
  32244. break;
  32245. case "service":
  32246. this._parseService(n);
  32247. break;
  32248. case "extend":
  32249. this._parseExtend(n);
  32250. break;
  32251. default:
  32252. throw Error("unexpected '" + e + "'")
  32253. }
  32254. } catch (e) {
  32255. throw e.message = "Parse error at line " + this.tn.line + ": " + e.message,
  32256. e
  32257. }
  32258. return delete n.name,
  32259. n
  32260. }
  32261. ,
  32262. l.parse = function(e) {
  32263. return new l(e).parse()
  32264. }
  32265. ,
  32266. c._readString = function() {
  32267. var e, t, i = "";
  32268. do {
  32269. if (t = this.tn.next(),
  32270. "'" !== t && '"' !== t)
  32271. throw Error("illegal string delimiter: " + t);
  32272. i += this.tn.next(),
  32273. this.tn.skip(t),
  32274. e = this.tn.peek()
  32275. } while ('"' === e || '"' === e);return i
  32276. }
  32277. ,
  32278. c._readValue = function(e) {
  32279. var i = this.tn.peek();
  32280. if ('"' === i || "'" === i)
  32281. return this._readString();
  32282. if (this.tn.next(),
  32283. t.NUMBER.test(i))
  32284. return n(i);
  32285. if (t.BOOL.test(i))
  32286. return "true" === i.toLowerCase();
  32287. if (e && t.TYPEREF.test(i))
  32288. return i;
  32289. throw Error("illegal value: " + i)
  32290. }
  32291. ,
  32292. c._parseOption = function(e, i) {
  32293. var n = this.tn.next()
  32294. , r = !1;
  32295. if ("(" === n && (r = !0,
  32296. n = this.tn.next()),
  32297. !t.TYPEREF.test(n))
  32298. throw Error("illegal option name: " + n);
  32299. var o = n;
  32300. r && (this.tn.skip(")"),
  32301. o = "(" + o + ")",
  32302. n = this.tn.peek(),
  32303. t.FQTYPEREF.test(n) && (o += n,
  32304. this.tn.next())),
  32305. this.tn.skip("="),
  32306. this._parseOptionValue(e, o),
  32307. i || this.tn.skip(";")
  32308. }
  32309. ,
  32310. c._parseOptionValue = function(e, i) {
  32311. var n = this.tn.peek();
  32312. if ("{" !== n)
  32313. r(e.options, i, this._readValue(!0));
  32314. else
  32315. for (this.tn.skip("{"); "}" !== (n = this.tn.next()); ) {
  32316. if (!t.NAME.test(n))
  32317. throw Error("illegal option name: " + i + "." + n);
  32318. this.tn.omit(":") ? r(e.options, i + "." + n, this._readValue(!0)) : this._parseOptionValue(e, i + "." + n)
  32319. }
  32320. }
  32321. ,
  32322. c._parseService = function(e) {
  32323. var i = this.tn.next();
  32324. if (!t.NAME.test(i))
  32325. throw Error("illegal service name at line " + this.tn.line + ": " + i);
  32326. var n = i
  32327. , r = {
  32328. name: n,
  32329. rpc: {},
  32330. options: {}
  32331. };
  32332. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32333. if ("option" === i)
  32334. this._parseOption(r);
  32335. else {
  32336. if ("rpc" !== i)
  32337. throw Error("illegal service token: " + i);
  32338. this._parseServiceRPC(r)
  32339. }
  32340. this.tn.omit(";"),
  32341. e.services.push(r)
  32342. }
  32343. ,
  32344. c._parseServiceRPC = function(e) {
  32345. var i = "rpc"
  32346. , n = this.tn.next();
  32347. if (!t.NAME.test(n))
  32348. throw Error("illegal rpc service method name: " + n);
  32349. var r = n
  32350. , o = {
  32351. request: null,
  32352. response: null,
  32353. request_stream: !1,
  32354. response_stream: !1,
  32355. options: {}
  32356. };
  32357. if (this.tn.skip("("),
  32358. n = this.tn.next(),
  32359. "stream" === n.toLowerCase() && (o.request_stream = !0,
  32360. n = this.tn.next()),
  32361. !t.TYPEREF.test(n))
  32362. throw Error("illegal rpc service request type: " + n);
  32363. if (o.request = n,
  32364. this.tn.skip(")"),
  32365. n = this.tn.next(),
  32366. "returns" !== n.toLowerCase())
  32367. throw Error("illegal rpc service request type delimiter: " + n);
  32368. if (this.tn.skip("("),
  32369. n = this.tn.next(),
  32370. "stream" === n.toLowerCase() && (o.response_stream = !0,
  32371. n = this.tn.next()),
  32372. o.response = n,
  32373. this.tn.skip(")"),
  32374. n = this.tn.peek(),
  32375. "{" === n) {
  32376. for (this.tn.next(); "}" !== (n = this.tn.next()); ) {
  32377. if ("option" !== n)
  32378. throw Error("illegal rpc service token: " + n);
  32379. this._parseOption(o)
  32380. }
  32381. this.tn.omit(";")
  32382. } else
  32383. this.tn.skip(";");
  32384. "undefined" == typeof e[i] && (e[i] = {}),
  32385. e[i][r] = o
  32386. }
  32387. ,
  32388. c._parseMessage = function(e, n) {
  32389. var r = !!n
  32390. , o = this.tn.next()
  32391. , a = {
  32392. name: "",
  32393. fields: [],
  32394. enums: [],
  32395. messages: [],
  32396. options: {},
  32397. services: [],
  32398. oneofs: {}
  32399. };
  32400. if (!t.NAME.test(o))
  32401. throw Error("illegal " + (r ? "group" : "message") + " name: " + o);
  32402. for (a.name = o,
  32403. r && (this.tn.skip("="),
  32404. n.id = i(this.tn.next()),
  32405. a.isGroup = !0),
  32406. o = this.tn.peek(),
  32407. "[" === o && n && this._parseFieldOptions(n),
  32408. this.tn.skip("{"); "}" !== (o = this.tn.next()); )
  32409. if (t.RULE.test(o))
  32410. this._parseMessageField(a, o);
  32411. else if ("oneof" === o)
  32412. this._parseMessageOneOf(a);
  32413. else if ("enum" === o)
  32414. this._parseEnum(a);
  32415. else if ("message" === o)
  32416. this._parseMessage(a);
  32417. else if ("option" === o)
  32418. this._parseOption(a);
  32419. else if ("service" === o)
  32420. this._parseService(a);
  32421. else if ("extensions" === o)
  32422. a.extensions = this._parseExtensionRanges();
  32423. else if ("reserved" === o)
  32424. this._parseIgnored();
  32425. else if ("extend" === o)
  32426. this._parseExtend(a);
  32427. else {
  32428. if (!t.TYPEREF.test(o))
  32429. throw Error("illegal message token: " + o);
  32430. if (!this.proto3)
  32431. throw Error("illegal field rule: " + o);
  32432. this._parseMessageField(a, "optional", o)
  32433. }
  32434. return this.tn.omit(";"),
  32435. e.messages.push(a),
  32436. a
  32437. }
  32438. ,
  32439. c._parseIgnored = function() {
  32440. for (; ";" !== this.tn.peek(); )
  32441. this.tn.next();
  32442. this.tn.skip(";")
  32443. }
  32444. ,
  32445. c._parseMessageField = function(e, n, r) {
  32446. if (!t.RULE.test(n))
  32447. throw Error("illegal message field rule: " + n);
  32448. var o, a = {
  32449. rule: n,
  32450. type: "",
  32451. name: "",
  32452. options: {},
  32453. id: 0
  32454. };
  32455. if ("map" === n) {
  32456. if (r)
  32457. throw Error("illegal type: " + r);
  32458. if (this.tn.skip("<"),
  32459. o = this.tn.next(),
  32460. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32461. throw Error("illegal message field type: " + o);
  32462. if (a.keytype = o,
  32463. this.tn.skip(","),
  32464. o = this.tn.next(),
  32465. !t.TYPE.test(o) && !t.TYPEREF.test(o))
  32466. throw Error("illegal message field: " + o);
  32467. if (a.type = o,
  32468. this.tn.skip(">"),
  32469. o = this.tn.next(),
  32470. !t.NAME.test(o))
  32471. throw Error("illegal message field name: " + o);
  32472. a.name = o,
  32473. this.tn.skip("="),
  32474. a.id = i(this.tn.next()),
  32475. o = this.tn.peek(),
  32476. "[" === o && this._parseFieldOptions(a),
  32477. this.tn.skip(";")
  32478. } else if (r = "undefined" != typeof r ? r : this.tn.next(),
  32479. "group" === r) {
  32480. var s = this._parseMessage(e, a);
  32481. if (!/^[A-Z]/.test(s.name))
  32482. throw Error("illegal group name: " + s.name);
  32483. a.type = s.name,
  32484. a.name = s.name.toLowerCase(),
  32485. this.tn.omit(";")
  32486. } else {
  32487. if (!t.TYPE.test(r) && !t.TYPEREF.test(r))
  32488. throw Error("illegal message field type: " + r);
  32489. if (a.type = r,
  32490. o = this.tn.next(),
  32491. !t.NAME.test(o))
  32492. throw Error("illegal message field name: " + o);
  32493. a.name = o,
  32494. this.tn.skip("="),
  32495. a.id = i(this.tn.next()),
  32496. o = this.tn.peek(),
  32497. "[" === o && this._parseFieldOptions(a),
  32498. this.tn.skip(";")
  32499. }
  32500. return e.fields.push(a),
  32501. a
  32502. }
  32503. ,
  32504. c._parseMessageOneOf = function(e) {
  32505. var i = this.tn.next();
  32506. if (!t.NAME.test(i))
  32507. throw Error("illegal oneof name: " + i);
  32508. var n, r = i, o = [];
  32509. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32510. n = this._parseMessageField(e, "optional", i),
  32511. n.oneof = r,
  32512. o.push(n.id);
  32513. this.tn.omit(";"),
  32514. e.oneofs[r] = o
  32515. }
  32516. ,
  32517. c._parseFieldOptions = function(e) {
  32518. this.tn.skip("[");
  32519. for (var t, i = !0; "]" !== (t = this.tn.peek()); )
  32520. i || this.tn.skip(","),
  32521. this._parseOption(e, !0),
  32522. i = !1;
  32523. this.tn.next()
  32524. }
  32525. ,
  32526. c._parseEnum = function(e) {
  32527. var n = {
  32528. name: "",
  32529. values: [],
  32530. options: {}
  32531. }
  32532. , r = this.tn.next();
  32533. if (!t.NAME.test(r))
  32534. throw Error("illegal name: " + r);
  32535. for (n.name = r,
  32536. this.tn.skip("{"); "}" !== (r = this.tn.next()); )
  32537. if ("option" === r)
  32538. this._parseOption(n);
  32539. else {
  32540. if (!t.NAME.test(r))
  32541. throw Error("illegal name: " + r);
  32542. this.tn.skip("=");
  32543. var o = {
  32544. name: r,
  32545. id: i(this.tn.next(), !0)
  32546. };
  32547. r = this.tn.peek(),
  32548. "[" === r && this._parseFieldOptions({
  32549. options: {}
  32550. }),
  32551. this.tn.skip(";"),
  32552. n.values.push(o)
  32553. }
  32554. this.tn.omit(";"),
  32555. e.enums.push(n)
  32556. }
  32557. ,
  32558. c._parseExtensionRanges = function() {
  32559. var t, i, r, o = [];
  32560. do {
  32561. for (i = []; ; ) {
  32562. switch (t = this.tn.next()) {
  32563. case "min":
  32564. r = e.ID_MIN;
  32565. break;
  32566. case "max":
  32567. r = e.ID_MAX;
  32568. break;
  32569. default:
  32570. r = n(t)
  32571. }
  32572. if (i.push(r),
  32573. 2 === i.length)
  32574. break;
  32575. if ("to" !== this.tn.peek()) {
  32576. i.push(r);
  32577. break
  32578. }
  32579. this.tn.next()
  32580. }
  32581. o.push(i)
  32582. } while (this.tn.omit(","));return this.tn.skip(";"),
  32583. o
  32584. }
  32585. ,
  32586. c._parseExtend = function(e) {
  32587. var i = this.tn.next();
  32588. if (!t.TYPEREF.test(i))
  32589. throw Error("illegal extend reference: " + i);
  32590. var n = {
  32591. ref: i,
  32592. fields: []
  32593. };
  32594. for (this.tn.skip("{"); "}" !== (i = this.tn.next()); )
  32595. if (t.RULE.test(i))
  32596. this._parseMessageField(n, i);
  32597. else {
  32598. if (!t.TYPEREF.test(i))
  32599. throw Error("illegal extend token: " + i);
  32600. if (!this.proto3)
  32601. throw Error("illegal field rule: " + i);
  32602. this._parseMessageField(n, "optional", i)
  32603. }
  32604. return this.tn.omit(";"),
  32605. e.messages.push(n),
  32606. n
  32607. }
  32608. ,
  32609. c.toString = function() {
  32610. return "Parser at line " + this.tn.line
  32611. }
  32612. ,
  32613. o.Parser = l,
  32614. o
  32615. }(r, r.Lang),
  32616. r.Reflect = function(e) {
  32617. function i(i) {
  32618. if ("string" == typeof i && (i = e.TYPES[i]),
  32619. "undefined" == typeof i.defaultValue)
  32620. throw Error("default value for type " + i.name + " is not supported");
  32621. return i == e.TYPES.bytes ? new t(0) : i.defaultValue
  32622. }
  32623. function n(t, i) {
  32624. if (t && "number" == typeof t.low && "number" == typeof t.high && "boolean" == typeof t.unsigned && t.low === t.low && t.high === t.high)
  32625. return new e.Long(t.low,t.high,"undefined" == typeof i ? t.unsigned : i);
  32626. if ("string" == typeof t)
  32627. return e.Long.fromString(t, i || !1, 10);
  32628. if ("number" == typeof t)
  32629. return e.Long.fromNumber(t, i || !1);
  32630. throw Error("not convertible to Long")
  32631. }
  32632. function r(t, i) {
  32633. var n = i.readVarint32()
  32634. , o = 7 & n
  32635. , a = n >>> 3;
  32636. switch (o) {
  32637. case e.WIRE_TYPES.VARINT:
  32638. do
  32639. n = i.readUint8();
  32640. while (128 === (128 & n));break;
  32641. case e.WIRE_TYPES.BITS64:
  32642. i.offset += 8;
  32643. break;
  32644. case e.WIRE_TYPES.LDELIM:
  32645. n = i.readVarint32(),
  32646. i.offset += n;
  32647. break;
  32648. case e.WIRE_TYPES.STARTGROUP:
  32649. r(a, i);
  32650. break;
  32651. case e.WIRE_TYPES.ENDGROUP:
  32652. if (a === t)
  32653. return !1;
  32654. throw Error("Illegal GROUPEND after unknown group: " + a + " (" + t + " expected)");
  32655. case e.WIRE_TYPES.BITS32:
  32656. i.offset += 4;
  32657. break;
  32658. default:
  32659. throw Error("Illegal wire type in unknown group " + t + ": " + o)
  32660. }
  32661. return !0
  32662. }
  32663. var o = {}
  32664. , a = function(e, t, i) {
  32665. this.builder = e,
  32666. this.parent = t,
  32667. this.name = i,
  32668. this.className
  32669. }
  32670. , s = a.prototype;
  32671. s.fqn = function() {
  32672. for (var e = this.name, t = this; ; ) {
  32673. if (t = t.parent,
  32674. null == t)
  32675. break;
  32676. e = t.name + "." + e
  32677. }
  32678. return e
  32679. }
  32680. ,
  32681. s.toString = function(e) {
  32682. return (e ? this.className + " " : "") + this.fqn()
  32683. }
  32684. ,
  32685. s.build = function() {
  32686. throw Error(this.toString(!0) + " cannot be built directly")
  32687. }
  32688. ,
  32689. o.T = a;
  32690. var l = function(e, t, i, n, r) {
  32691. a.call(this, e, t, i),
  32692. this.className = "Namespace",
  32693. this.children = [],
  32694. this.options = n || {},
  32695. this.syntax = r || "proto2"
  32696. }
  32697. , c = l.prototype = Object.create(a.prototype);
  32698. c.getChildren = function(e) {
  32699. if (e = e || null,
  32700. null == e)
  32701. return this.children.slice();
  32702. for (var t = [], i = 0, n = this.children.length; i < n; ++i)
  32703. this.children[i]instanceof e && t.push(this.children[i]);
  32704. return t
  32705. }
  32706. ,
  32707. c.addChild = function(e) {
  32708. var t;
  32709. if (t = this.getChild(e.name))
  32710. if (t instanceof d.Field && t.name !== t.originalName && null === this.getChild(t.originalName))
  32711. t.name = t.originalName;
  32712. else {
  32713. if (!(e instanceof d.Field && e.name !== e.originalName && null === this.getChild(e.originalName)))
  32714. throw Error("Duplicate name in namespace " + this.toString(!0) + ": " + e.name);
  32715. e.name = e.originalName
  32716. }
  32717. this.children.push(e)
  32718. }
  32719. ,
  32720. c.getChild = function(e) {
  32721. for (var t = "number" == typeof e ? "id" : "name", i = 0, n = this.children.length; i < n; ++i)
  32722. if (this.children[i][t] === e)
  32723. return this.children[i];
  32724. return null
  32725. }
  32726. ,
  32727. c.resolve = function(e, t) {
  32728. var i = "string" == typeof e ? e.split(".") : e
  32729. , n = this
  32730. , r = 0;
  32731. if ("" === i[r]) {
  32732. for (; null !== n.parent; )
  32733. n = n.parent;
  32734. r++
  32735. }
  32736. var a;
  32737. do {
  32738. do {
  32739. if (!(n instanceof o.Namespace)) {
  32740. n = null;
  32741. break
  32742. }
  32743. if (a = n.getChild(i[r]),
  32744. !a || !(a instanceof o.T) || t && !(a instanceof o.Namespace)) {
  32745. n = null;
  32746. break
  32747. }
  32748. n = a,
  32749. r++
  32750. } while (r < i.length);if (null != n)
  32751. break;
  32752. if (null !== this.parent)
  32753. return this.parent.resolve(e, t)
  32754. } while (null != n);return n
  32755. }
  32756. ,
  32757. c.qn = function(e) {
  32758. var t = []
  32759. , i = e;
  32760. do
  32761. t.unshift(i.name),
  32762. i = i.parent;
  32763. while (null !== i);for (var n = 1; n <= t.length; n++) {
  32764. var r = t.slice(t.length - n);
  32765. if (e === this.resolve(r, e instanceof o.Namespace))
  32766. return r.join(".")
  32767. }
  32768. return e.fqn()
  32769. }
  32770. ,
  32771. c.build = function() {
  32772. for (var e, t = {}, i = this.children, n = 0, r = i.length; n < r; ++n)
  32773. e = i[n],
  32774. e instanceof l && (t[e.name] = e.build());
  32775. return Object.defineProperty && Object.defineProperty(t, "$options", {
  32776. value: this.buildOpt()
  32777. }),
  32778. t
  32779. }
  32780. ,
  32781. c.buildOpt = function() {
  32782. for (var e = {}, t = Object.keys(this.options), i = 0, n = t.length; i < n; ++i) {
  32783. var r = t[i]
  32784. , o = this.options[t[i]];
  32785. e[r] = o
  32786. }
  32787. return e
  32788. }
  32789. ,
  32790. c.getOption = function(e) {
  32791. return "undefined" == typeof e ? this.options : "undefined" != typeof this.options[e] ? this.options[e] : null
  32792. }
  32793. ,
  32794. o.Namespace = l;
  32795. var h = function(t, i, n, r) {
  32796. if (this.type = t,
  32797. this.resolvedType = i,
  32798. this.isMapKey = n,
  32799. this.syntax = r,
  32800. n && e.MAP_KEY_TYPES.indexOf(t) < 0)
  32801. throw Error("Invalid map key type: " + t.name)
  32802. }
  32803. , u = h.prototype;
  32804. h.defaultFieldValue = i,
  32805. u.verifyValue = function(i) {
  32806. function r(e, t) {
  32807. throw Error("Illegal value for " + o.toString(!0) + " of type " + o.type.name + ": " + e + " (" + t + ")")
  32808. }
  32809. var o = this;
  32810. switch (this.type) {
  32811. case e.TYPES.int32:
  32812. case e.TYPES.sint32:
  32813. case e.TYPES.sfixed32:
  32814. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32815. i > 4294967295 ? 0 | i : i;
  32816. case e.TYPES.uint32:
  32817. case e.TYPES.fixed32:
  32818. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32819. i < 0 ? i >>> 0 : i;
  32820. case e.TYPES.int64:
  32821. case e.TYPES.sint64:
  32822. case e.TYPES.sfixed64:
  32823. if (e.Long)
  32824. try {
  32825. return n(i, !1)
  32826. } catch (e) {
  32827. r(typeof i, e.message)
  32828. }
  32829. else
  32830. r(typeof i, "requires Long.js");
  32831. case e.TYPES.uint64:
  32832. case e.TYPES.fixed64:
  32833. if (e.Long)
  32834. try {
  32835. return n(i, !0)
  32836. } catch (e) {
  32837. r(typeof i, e.message)
  32838. }
  32839. else
  32840. r(typeof i, "requires Long.js");
  32841. case e.TYPES.bool:
  32842. return "boolean" != typeof i && r(typeof i, "not a boolean"),
  32843. i;
  32844. case e.TYPES.float:
  32845. case e.TYPES.double:
  32846. return "number" != typeof i && r(typeof i, "not a number"),
  32847. i;
  32848. case e.TYPES.string:
  32849. return "string" == typeof i || i && i instanceof String || r(typeof i, "not a string"),
  32850. "" + i;
  32851. case e.TYPES.bytes:
  32852. return t.isByteBuffer(i) ? i : t.wrap(i, "base64");
  32853. case e.TYPES.enum:
  32854. var a = this.resolvedType.getChildren(e.Reflect.Enum.Value);
  32855. for (l = 0; l < a.length; l++) {
  32856. if (a[l].name == i)
  32857. return a[l].id;
  32858. if (a[l].id == i)
  32859. return a[l].id
  32860. }
  32861. if ("proto3" === this.syntax)
  32862. return ("number" != typeof i || i === i && i % 1 !== 0) && r(typeof i, "not an integer"),
  32863. (i > 4294967295 || i < 0) && r(typeof i, "not in range for uint32"),
  32864. i;
  32865. r(i, "not a valid enum value");
  32866. case e.TYPES.group:
  32867. case e.TYPES.message:
  32868. if (i && "object" == typeof i || r(typeof i, "object expected"),
  32869. i instanceof this.resolvedType.clazz)
  32870. return i;
  32871. if (i instanceof e.Builder.Message) {
  32872. var s = {};
  32873. for (var l in i)
  32874. i.hasOwnProperty(l) && (s[l] = i[l]);
  32875. i = s
  32876. }
  32877. return new this.resolvedType.clazz(i)
  32878. }
  32879. throw Error("[INTERNAL] Illegal value for " + this.toString(!0) + ": " + i + " (undefined type " + this.type + ")")
  32880. }
  32881. ,
  32882. u.calculateLength = function(i, n) {
  32883. if (null === n)
  32884. return 0;
  32885. var r;
  32886. switch (this.type) {
  32887. case e.TYPES.int32:
  32888. return n < 0 ? t.calculateVarint64(n) : t.calculateVarint32(n);
  32889. case e.TYPES.uint32:
  32890. return t.calculateVarint32(n);
  32891. case e.TYPES.sint32:
  32892. return t.calculateVarint32(t.zigZagEncode32(n));
  32893. case e.TYPES.fixed32:
  32894. case e.TYPES.sfixed32:
  32895. case e.TYPES.float:
  32896. return 4;
  32897. case e.TYPES.int64:
  32898. case e.TYPES.uint64:
  32899. return t.calculateVarint64(n);
  32900. case e.TYPES.sint64:
  32901. return t.calculateVarint64(t.zigZagEncode64(n));
  32902. case e.TYPES.fixed64:
  32903. case e.TYPES.sfixed64:
  32904. return 8;
  32905. case e.TYPES.bool:
  32906. return 1;
  32907. case e.TYPES.enum:
  32908. return t.calculateVarint32(n);
  32909. case e.TYPES.double:
  32910. return 8;
  32911. case e.TYPES.string:
  32912. return r = t.calculateUTF8Bytes(n),
  32913. t.calculateVarint32(r) + r;
  32914. case e.TYPES.bytes:
  32915. if (n.remaining() < 0)
  32916. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  32917. return t.calculateVarint32(n.remaining()) + n.remaining();
  32918. case e.TYPES.message:
  32919. return r = this.resolvedType.calculate(n),
  32920. t.calculateVarint32(r) + r;
  32921. case e.TYPES.group:
  32922. return r = this.resolvedType.calculate(n),
  32923. r + t.calculateVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP)
  32924. }
  32925. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  32926. }
  32927. ,
  32928. u.encodeValue = function(i, n, r) {
  32929. if (null === n)
  32930. return r;
  32931. switch (this.type) {
  32932. case e.TYPES.int32:
  32933. n < 0 ? r.writeVarint64(n) : r.writeVarint32(n);
  32934. break;
  32935. case e.TYPES.uint32:
  32936. r.writeVarint32(n);
  32937. break;
  32938. case e.TYPES.sint32:
  32939. r.writeVarint32ZigZag(n);
  32940. break;
  32941. case e.TYPES.fixed32:
  32942. r.writeUint32(n);
  32943. break;
  32944. case e.TYPES.sfixed32:
  32945. r.writeInt32(n);
  32946. break;
  32947. case e.TYPES.int64:
  32948. case e.TYPES.uint64:
  32949. r.writeVarint64(n);
  32950. break;
  32951. case e.TYPES.sint64:
  32952. r.writeVarint64ZigZag(n);
  32953. break;
  32954. case e.TYPES.fixed64:
  32955. r.writeUint64(n);
  32956. break;
  32957. case e.TYPES.sfixed64:
  32958. r.writeInt64(n);
  32959. break;
  32960. case e.TYPES.bool:
  32961. "string" == typeof n ? r.writeVarint32("false" === n.toLowerCase() ? 0 : !!n) : r.writeVarint32(n ? 1 : 0);
  32962. break;
  32963. case e.TYPES.enum:
  32964. r.writeVarint32(n);
  32965. break;
  32966. case e.TYPES.float:
  32967. r.writeFloat32(n);
  32968. break;
  32969. case e.TYPES.double:
  32970. r.writeFloat64(n);
  32971. break;
  32972. case e.TYPES.string:
  32973. r.writeVString(n);
  32974. break;
  32975. case e.TYPES.bytes:
  32976. if (n.remaining() < 0)
  32977. throw Error("Illegal value for " + this.toString(!0) + ": " + n.remaining() + " bytes remaining");
  32978. var o = n.offset;
  32979. r.writeVarint32(n.remaining()),
  32980. r.append(n),
  32981. n.offset = o;
  32982. break;
  32983. case e.TYPES.message:
  32984. var a = (new t).LE();
  32985. this.resolvedType.encode(n, a),
  32986. r.writeVarint32(a.offset),
  32987. r.append(a.flip());
  32988. break;
  32989. case e.TYPES.group:
  32990. this.resolvedType.encode(n, r),
  32991. r.writeVarint32(i << 3 | e.WIRE_TYPES.ENDGROUP);
  32992. break;
  32993. default:
  32994. throw Error("[INTERNAL] Illegal value to encode in " + this.toString(!0) + ": " + n + " (unknown type)")
  32995. }
  32996. return r
  32997. }
  32998. ,
  32999. u.decode = function(t, i, n) {
  33000. if (i != this.type.wireType)
  33001. throw Error("Unexpected wire type for element");
  33002. var r, o;
  33003. switch (this.type) {
  33004. case e.TYPES.int32:
  33005. return 0 | t.readVarint32();
  33006. case e.TYPES.uint32:
  33007. return t.readVarint32() >>> 0;
  33008. case e.TYPES.sint32:
  33009. return 0 | t.readVarint32ZigZag();
  33010. case e.TYPES.fixed32:
  33011. return t.readUint32() >>> 0;
  33012. case e.TYPES.sfixed32:
  33013. return 0 | t.readInt32();
  33014. case e.TYPES.int64:
  33015. return t.readVarint64();
  33016. case e.TYPES.uint64:
  33017. return t.readVarint64().toUnsigned();
  33018. case e.TYPES.sint64:
  33019. return t.readVarint64ZigZag();
  33020. case e.TYPES.fixed64:
  33021. return t.readUint64();
  33022. case e.TYPES.sfixed64:
  33023. return t.readInt64();
  33024. case e.TYPES.bool:
  33025. return !!t.readVarint32();
  33026. case e.TYPES.enum:
  33027. return t.readVarint32();
  33028. case e.TYPES.float:
  33029. return t.readFloat();
  33030. case e.TYPES.double:
  33031. return t.readDouble();
  33032. case e.TYPES.string:
  33033. return t.readVString();
  33034. case e.TYPES.bytes:
  33035. if (o = t.readVarint32(),
  33036. t.remaining() < o)
  33037. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + t.remaining());
  33038. return r = t.clone(),
  33039. r.limit = r.offset + o,
  33040. t.offset += o,
  33041. r;
  33042. case e.TYPES.message:
  33043. return o = t.readVarint32(),
  33044. this.resolvedType.decode(t, o);
  33045. case e.TYPES.group:
  33046. return this.resolvedType.decode(t, -1, n)
  33047. }
  33048. throw Error("[INTERNAL] Illegal decode type")
  33049. }
  33050. ,
  33051. u.valueFromString = function(i) {
  33052. if (!this.isMapKey)
  33053. throw Error("valueFromString() called on non-map-key element");
  33054. switch (this.type) {
  33055. case e.TYPES.int32:
  33056. case e.TYPES.sint32:
  33057. case e.TYPES.sfixed32:
  33058. case e.TYPES.uint32:
  33059. case e.TYPES.fixed32:
  33060. return this.verifyValue(parseInt(i));
  33061. case e.TYPES.int64:
  33062. case e.TYPES.sint64:
  33063. case e.TYPES.sfixed64:
  33064. case e.TYPES.uint64:
  33065. case e.TYPES.fixed64:
  33066. return this.verifyValue(i);
  33067. case e.TYPES.bool:
  33068. return "true" === i;
  33069. case e.TYPES.string:
  33070. return this.verifyValue(i);
  33071. case e.TYPES.bytes:
  33072. return t.fromBinary(i)
  33073. }
  33074. }
  33075. ,
  33076. u.valueToString = function(t) {
  33077. if (!this.isMapKey)
  33078. throw Error("valueToString() called on non-map-key element");
  33079. return this.type === e.TYPES.bytes ? t.toString("binary") : t.toString()
  33080. }
  33081. ,
  33082. o.Element = h;
  33083. var d = function(e, t, i, n, r, o) {
  33084. l.call(this, e, t, i, n, o),
  33085. this.className = "Message",
  33086. this.extensions = void 0,
  33087. this.clazz = null,
  33088. this.isGroup = !!r,
  33089. this._fields = null,
  33090. this._fieldsById = null,
  33091. this._fieldsByName = null
  33092. }
  33093. , p = d.prototype = Object.create(l.prototype);
  33094. p.build = function(i) {
  33095. if (this.clazz && !i)
  33096. return this.clazz;
  33097. var n = function(e, i) {
  33098. function n(i, r, o, a) {
  33099. if (null === i || "object" != typeof i) {
  33100. if (a && a instanceof e.Reflect.Enum) {
  33101. var s = e.Reflect.Enum.getName(a.object, i);
  33102. if (null !== s)
  33103. return s
  33104. }
  33105. return i
  33106. }
  33107. if (t.isByteBuffer(i))
  33108. return r ? i.toBase64() : i.toBuffer();
  33109. if (e.Long.isLong(i))
  33110. return o ? i.toString() : e.Long.fromValue(i);
  33111. var l;
  33112. if (Array.isArray(i))
  33113. return l = [],
  33114. i.forEach(function(e, t) {
  33115. l[t] = n(e, r, o, a)
  33116. }),
  33117. l;
  33118. if (l = {},
  33119. i instanceof e.Map) {
  33120. for (var c = i.entries(), h = c.next(); !h.done; h = c.next())
  33121. l[i.keyElem.valueToString(h.value[0])] = n(h.value[1], r, o, i.valueElem.resolvedType);
  33122. return l
  33123. }
  33124. var u = i.$type
  33125. , d = void 0;
  33126. for (var p in i)
  33127. i.hasOwnProperty(p) && (u && (d = u.getChild(p)) ? l[p] = n(i[p], r, o, d.resolvedType) : l[p] = n(i[p], r, o));
  33128. return l
  33129. }
  33130. var r = i.getChildren(e.Reflect.Message.Field)
  33131. , o = i.getChildren(e.Reflect.Message.OneOf)
  33132. , a = function(n, s) {
  33133. e.Builder.Message.call(this);
  33134. for (var l = 0, c = o.length; l < c; ++l)
  33135. this[o[l].name] = null;
  33136. for (l = 0,
  33137. c = r.length; l < c; ++l) {
  33138. var h = r[l];
  33139. this[h.name] = h.repeated ? [] : h.map ? new e.Map(h) : null,
  33140. !h.required && "proto3" !== i.syntax || null === h.defaultValue || (this[h.name] = h.defaultValue)
  33141. }
  33142. if (arguments.length > 0) {
  33143. var u;
  33144. if (1 !== arguments.length || null === n || "object" != typeof n || !("function" != typeof n.encode || n instanceof a) || Array.isArray(n) || n instanceof e.Map || t.isByteBuffer(n) || n instanceof ArrayBuffer || e.Long && n instanceof e.Long)
  33145. for (l = 0,
  33146. c = arguments.length; l < c; ++l)
  33147. "undefined" != typeof (u = arguments[l]) && this.$set(r[l].name, u);
  33148. else
  33149. this.$set(n)
  33150. }
  33151. }
  33152. , s = a.prototype = Object.create(e.Builder.Message.prototype);
  33153. s.add = function(t, n, r) {
  33154. var o = i._fieldsByName[t];
  33155. if (!r) {
  33156. if (!o)
  33157. throw Error(this + "#" + t + " is undefined");
  33158. if (!(o instanceof e.Reflect.Message.Field))
  33159. throw Error(this + "#" + t + " is not a field: " + o.toString(!0));
  33160. if (!o.repeated)
  33161. throw Error(this + "#" + t + " is not a repeated field");
  33162. n = o.verifyValue(n, !0)
  33163. }
  33164. return null === this[t] && (this[t] = []),
  33165. this[t].push(n),
  33166. this
  33167. }
  33168. ,
  33169. s.$add = s.add,
  33170. s.set = function(t, n, r) {
  33171. if (t && "object" == typeof t) {
  33172. r = n;
  33173. for (var o in t)
  33174. t.hasOwnProperty(o) && "undefined" != typeof (n = t[o]) && this.$set(o, n, r);
  33175. return this
  33176. }
  33177. var a = i._fieldsByName[t];
  33178. if (r)
  33179. this[t] = n;
  33180. else {
  33181. if (!a)
  33182. throw Error(this + "#" + t + " is not a field: undefined");
  33183. if (!(a instanceof e.Reflect.Message.Field))
  33184. throw Error(this + "#" + t + " is not a field: " + a.toString(!0));
  33185. this[a.name] = n = a.verifyValue(n)
  33186. }
  33187. if (a && a.oneof) {
  33188. var s = this[a.oneof.name];
  33189. null !== n ? (null !== s && s !== a.name && (this[s] = null),
  33190. this[a.oneof.name] = a.name) : s === t && (this[a.oneof.name] = null)
  33191. }
  33192. return this
  33193. }
  33194. ,
  33195. s.$set = s.set,
  33196. s.get = function(t, n) {
  33197. if (n)
  33198. return this[t];
  33199. var r = i._fieldsByName[t];
  33200. if (!(r && r instanceof e.Reflect.Message.Field))
  33201. throw Error(this + "#" + t + " is not a field: undefined");
  33202. if (!(r instanceof e.Reflect.Message.Field))
  33203. throw Error(this + "#" + t + " is not a field: " + r.toString(!0));
  33204. return this[r.name]
  33205. }
  33206. ,
  33207. s.$get = s.get;
  33208. for (var l = 0; l < r.length; l++) {
  33209. var c = r[l];
  33210. c instanceof e.Reflect.Message.ExtensionField || i.builder.options.populateAccessors && function(e) {
  33211. var t = e.originalName.replace(/(_[a-zA-Z])/g, function(e) {
  33212. return e.toUpperCase().replace("_", "")
  33213. });
  33214. t = t.substring(0, 1).toUpperCase() + t.substring(1);
  33215. var n = e.originalName.replace(/([A-Z])/g, function(e) {
  33216. return "_" + e
  33217. })
  33218. , r = function(t, i) {
  33219. return this[e.name] = i ? t : e.verifyValue(t),
  33220. this
  33221. }
  33222. , o = function() {
  33223. return this[e.name]
  33224. };
  33225. null === i.getChild("set" + t) && (s["set" + t] = r),
  33226. null === i.getChild("set_" + n) && (s["set_" + n] = r),
  33227. null === i.getChild("get" + t) && (s["get" + t] = o),
  33228. null === i.getChild("get_" + n) && (s["get_" + n] = o)
  33229. }(c)
  33230. }
  33231. s.encode = function(e, n) {
  33232. "boolean" == typeof e && (n = e,
  33233. e = void 0);
  33234. var r = !1;
  33235. e || (e = new t,
  33236. r = !0);
  33237. var o = e.littleEndian;
  33238. try {
  33239. return i.encode(this, e.LE(), n),
  33240. (r ? e.flip() : e).LE(o)
  33241. } catch (t) {
  33242. throw e.LE(o),
  33243. t
  33244. }
  33245. }
  33246. ,
  33247. a.encode = function(e, t, i) {
  33248. return new a(e).encode(t, i)
  33249. }
  33250. ,
  33251. s.calculate = function() {
  33252. return i.calculate(this)
  33253. }
  33254. ,
  33255. s.encodeDelimited = function(e, n) {
  33256. var r = !1;
  33257. e || (e = new t,
  33258. r = !0);
  33259. var o = (new t).LE();
  33260. return i.encode(this, o, n).flip(),
  33261. e.writeVarint32(o.remaining()),
  33262. e.append(o),
  33263. r ? e.flip() : e
  33264. }
  33265. ,
  33266. s.encodeAB = function() {
  33267. try {
  33268. return this.encode().toArrayBuffer()
  33269. } catch (e) {
  33270. throw e.encoded && (e.encoded = e.encoded.toArrayBuffer()),
  33271. e
  33272. }
  33273. }
  33274. ,
  33275. s.toArrayBuffer = s.encodeAB,
  33276. s.encodeNB = function() {
  33277. try {
  33278. return this.encode().toBuffer()
  33279. } catch (e) {
  33280. throw e.encoded && (e.encoded = e.encoded.toBuffer()),
  33281. e
  33282. }
  33283. }
  33284. ,
  33285. s.toBuffer = s.encodeNB,
  33286. s.encode64 = function() {
  33287. try {
  33288. return this.encode().toBase64()
  33289. } catch (e) {
  33290. throw e.encoded && (e.encoded = e.encoded.toBase64()),
  33291. e
  33292. }
  33293. }
  33294. ,
  33295. s.toBase64 = s.encode64,
  33296. s.encodeHex = function() {
  33297. try {
  33298. return this.encode().toHex()
  33299. } catch (e) {
  33300. throw e.encoded && (e.encoded = e.encoded.toHex()),
  33301. e
  33302. }
  33303. }
  33304. ,
  33305. s.toHex = s.encodeHex,
  33306. s.toRaw = function(e, t) {
  33307. return n(this, !!e, !!t, this.$type)
  33308. }
  33309. ,
  33310. s.encodeJSON = function() {
  33311. return JSON.stringify(n(this, !0, !0, this.$type))
  33312. }
  33313. ,
  33314. a.decode = function(e, n, r) {
  33315. "string" == typeof n && (r = n,
  33316. n = -1),
  33317. "string" == typeof e && (e = t.wrap(e, r ? r : "base64")),
  33318. e = t.isByteBuffer(e) ? e : t.wrap(e);
  33319. var o = e.littleEndian;
  33320. try {
  33321. var a = i.decode(e.LE());
  33322. return e.LE(o),
  33323. a
  33324. } catch (t) {
  33325. throw e.LE(o),
  33326. t
  33327. }
  33328. }
  33329. ,
  33330. a.decodeDelimited = function(e, n) {
  33331. if ("string" == typeof e && (e = t.wrap(e, n ? n : "base64")),
  33332. e = t.isByteBuffer(e) ? e : t.wrap(e),
  33333. e.remaining() < 1)
  33334. return null;
  33335. var r = e.offset
  33336. , o = e.readVarint32();
  33337. if (e.remaining() < o)
  33338. return e.offset = r,
  33339. null;
  33340. try {
  33341. var a = i.decode(e.slice(e.offset, e.offset + o).LE());
  33342. return e.offset += o,
  33343. a
  33344. } catch (t) {
  33345. throw e.offset += o,
  33346. t
  33347. }
  33348. }
  33349. ,
  33350. a.decode64 = function(e) {
  33351. return a.decode(e, "base64")
  33352. }
  33353. ,
  33354. a.decodeHex = function(e) {
  33355. return a.decode(e, "hex")
  33356. }
  33357. ,
  33358. a.decodeJSON = function(e) {
  33359. return new a(JSON.parse(e))
  33360. }
  33361. ,
  33362. s.toString = function() {
  33363. return i.toString()
  33364. }
  33365. ;
  33366. return Object.defineProperty && (Object.defineProperty(a, "$options", {
  33367. value: i.buildOpt()
  33368. }),
  33369. Object.defineProperty(s, "$options", {
  33370. value: a.$options
  33371. }),
  33372. Object.defineProperty(a, "$type", {
  33373. value: i
  33374. }),
  33375. Object.defineProperty(s, "$type", {
  33376. value: i
  33377. })),
  33378. a
  33379. }(e, this);
  33380. this._fields = [],
  33381. this._fieldsById = {},
  33382. this._fieldsByName = {};
  33383. for (var r, o = 0, a = this.children.length; o < a; o++)
  33384. if (r = this.children[o],
  33385. r instanceof A || r instanceof d || r instanceof E) {
  33386. if (n.hasOwnProperty(r.name))
  33387. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + r.toString(!0) + " cannot override static property '" + r.name + "'");
  33388. n[r.name] = r.build()
  33389. } else if (r instanceof d.Field)
  33390. r.build(),
  33391. this._fields.push(r),
  33392. this._fieldsById[r.id] = r,
  33393. this._fieldsByName[r.name] = r;
  33394. else if (!(r instanceof d.OneOf || r instanceof I))
  33395. throw Error("Illegal reflect child of " + this.toString(!0) + ": " + this.children[o].toString(!0));
  33396. return this.clazz = n
  33397. }
  33398. ,
  33399. p.encode = function(e, t, i) {
  33400. for (var n, r, o = null, a = 0, s = this._fields.length; a < s; ++a)
  33401. n = this._fields[a],
  33402. r = e[n.name],
  33403. n.required && null === r ? null === o && (o = n) : n.encode(i ? r : n.verifyValue(r), t, e);
  33404. if (null !== o) {
  33405. var l = Error("Missing at least one required field for " + this.toString(!0) + ": " + o);
  33406. throw l.encoded = t,
  33407. l
  33408. }
  33409. return t
  33410. }
  33411. ,
  33412. p.calculate = function(e) {
  33413. for (var t, i, n = 0, r = 0, o = this._fields.length; r < o; ++r) {
  33414. if (t = this._fields[r],
  33415. i = e[t.name],
  33416. t.required && null === i)
  33417. throw Error("Missing at least one required field for " + this.toString(!0) + ": " + t);
  33418. n += t.calculate(i, e)
  33419. }
  33420. return n
  33421. }
  33422. ,
  33423. p.decode = function(t, i, n) {
  33424. i = "number" == typeof i ? i : -1;
  33425. for (var o, a, s, l, c = t.offset, h = new this.clazz; t.offset < c + i || i === -1 && t.remaining() > 0; ) {
  33426. if (o = t.readVarint32(),
  33427. a = 7 & o,
  33428. s = o >>> 3,
  33429. a === e.WIRE_TYPES.ENDGROUP) {
  33430. if (s !== n)
  33431. throw Error("Illegal group end indicator for " + this.toString(!0) + ": " + s + " (" + (n ? n + " expected" : "not a group") + ")");
  33432. break
  33433. }
  33434. if (l = this._fieldsById[s]) {
  33435. if (l.repeated && !l.options.packed)
  33436. h[l.name].push(l.decode(a, t));
  33437. else if (l.map) {
  33438. var u = l.decode(a, t);
  33439. h[l.name].set(u[0], u[1])
  33440. } else if (h[l.name] = l.decode(a, t),
  33441. l.oneof) {
  33442. var d = h[l.oneof.name];
  33443. null !== d && d !== l.name && (h[d] = null),
  33444. h[l.oneof.name] = l.name
  33445. }
  33446. } else
  33447. switch (a) {
  33448. case e.WIRE_TYPES.VARINT:
  33449. t.readVarint32();
  33450. break;
  33451. case e.WIRE_TYPES.BITS32:
  33452. t.offset += 4;
  33453. break;
  33454. case e.WIRE_TYPES.BITS64:
  33455. t.offset += 8;
  33456. break;
  33457. case e.WIRE_TYPES.LDELIM:
  33458. var p = t.readVarint32();
  33459. t.offset += p;
  33460. break;
  33461. case e.WIRE_TYPES.STARTGROUP:
  33462. for (; r(s, t); )
  33463. ;
  33464. break;
  33465. default:
  33466. throw Error("Illegal wire type for unknown field " + s + " in " + this.toString(!0) + "#decode: " + a)
  33467. }
  33468. }
  33469. for (var f = 0, g = this._fields.length; f < g; ++f)
  33470. if (l = this._fields[f],
  33471. null === h[l.name])
  33472. if ("proto3" === this.syntax)
  33473. h[l.name] = l.defaultValue;
  33474. else {
  33475. if (l.required) {
  33476. var m = Error("Missing at least one required field for " + this.toString(!0) + ": " + l.name);
  33477. throw m.decoded = h,
  33478. m
  33479. }
  33480. e.populateDefaults && null !== l.defaultValue && (h[l.name] = l.defaultValue)
  33481. }
  33482. return h
  33483. }
  33484. ,
  33485. o.Message = d;
  33486. var f = function(t, i, n, r, o, s, l, c, h, u) {
  33487. a.call(this, t, i, s),
  33488. this.className = "Message.Field",
  33489. this.required = "required" === n,
  33490. this.repeated = "repeated" === n,
  33491. this.map = "map" === n,
  33492. this.keyType = r || null,
  33493. this.type = o,
  33494. this.resolvedType = null,
  33495. this.id = l,
  33496. this.options = c || {},
  33497. this.defaultValue = null,
  33498. this.oneof = h || null,
  33499. this.syntax = u || "proto2",
  33500. this.originalName = this.name,
  33501. this.element = null,
  33502. this.keyElement = null,
  33503. !this.builder.options.convertFieldsToCamelCase || this instanceof d.ExtensionField || (this.name = e.Util.toCamelCase(this.name))
  33504. }
  33505. , g = f.prototype = Object.create(a.prototype);
  33506. g.build = function() {
  33507. this.element = new h(this.type,this.resolvedType,!1,this.syntax),
  33508. this.map && (this.keyElement = new h(this.keyType,void 0,!0,this.syntax)),
  33509. "proto3" !== this.syntax || this.repeated || this.map ? "undefined" != typeof this.options.default && (this.defaultValue = this.verifyValue(this.options.default)) : this.defaultValue = h.defaultFieldValue(this.type)
  33510. }
  33511. ,
  33512. g.verifyValue = function(t, i) {
  33513. function n(e, t) {
  33514. throw Error("Illegal value for " + r.toString(!0) + " of type " + r.type.name + ": " + e + " (" + t + ")")
  33515. }
  33516. i = i || !1;
  33517. var r = this;
  33518. if (null === t)
  33519. return this.required && n(typeof t, "required"),
  33520. "proto3" === this.syntax && this.type !== e.TYPES.message && n(typeof t, "proto3 field without field presence cannot be null"),
  33521. null;
  33522. var o;
  33523. if (this.repeated && !i) {
  33524. Array.isArray(t) || (t = [t]);
  33525. var a = [];
  33526. for (o = 0; o < t.length; o++)
  33527. a.push(this.element.verifyValue(t[o]));
  33528. return a
  33529. }
  33530. return this.map && !i ? t instanceof e.Map ? t : (t instanceof Object || n(typeof t, "expected ProtoBuf.Map or raw object for map field"),
  33531. new e.Map(this,t)) : (!this.repeated && Array.isArray(t) && n(typeof t, "no array expected"),
  33532. this.element.verifyValue(t))
  33533. }
  33534. ,
  33535. g.hasWirePresence = function(t, i) {
  33536. if ("proto3" !== this.syntax)
  33537. return null !== t;
  33538. if (this.oneof && i[this.oneof.name] === this.name)
  33539. return !0;
  33540. switch (this.type) {
  33541. case e.TYPES.int32:
  33542. case e.TYPES.sint32:
  33543. case e.TYPES.sfixed32:
  33544. case e.TYPES.uint32:
  33545. case e.TYPES.fixed32:
  33546. return 0 !== t;
  33547. case e.TYPES.int64:
  33548. case e.TYPES.sint64:
  33549. case e.TYPES.sfixed64:
  33550. case e.TYPES.uint64:
  33551. case e.TYPES.fixed64:
  33552. return 0 !== t.low || 0 !== t.high;
  33553. case e.TYPES.bool:
  33554. return t;
  33555. case e.TYPES.float:
  33556. case e.TYPES.double:
  33557. return 0 !== t;
  33558. case e.TYPES.string:
  33559. return t.length > 0;
  33560. case e.TYPES.bytes:
  33561. return t.remaining() > 0;
  33562. case e.TYPES.enum:
  33563. return 0 !== t;
  33564. case e.TYPES.message:
  33565. return null !== t;
  33566. default:
  33567. return !0
  33568. }
  33569. }
  33570. ,
  33571. g.encode = function(i, n, r) {
  33572. if (null === this.type || "object" != typeof this.type)
  33573. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33574. if (null === i || this.repeated && 0 == i.length)
  33575. return n;
  33576. try {
  33577. if (this.repeated) {
  33578. var o;
  33579. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33580. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33581. n.ensureCapacity(n.offset += 1);
  33582. var a = n.offset;
  33583. for (o = 0; o < i.length; o++)
  33584. this.element.encodeValue(this.id, i[o], n);
  33585. var s = n.offset - a
  33586. , l = t.calculateVarint32(s);
  33587. if (l > 1) {
  33588. var c = n.slice(a, n.offset);
  33589. a += l - 1,
  33590. n.offset = a,
  33591. n.append(c)
  33592. }
  33593. n.writeVarint32(s, a - l)
  33594. } else
  33595. for (o = 0; o < i.length; o++)
  33596. n.writeVarint32(this.id << 3 | this.type.wireType),
  33597. this.element.encodeValue(this.id, i[o], n)
  33598. } else
  33599. this.map ? i.forEach(function(i, r, o) {
  33600. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, r) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33601. n.writeVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33602. n.writeVarint32(a),
  33603. n.writeVarint32(8 | this.keyType.wireType),
  33604. this.keyElement.encodeValue(1, r, n),
  33605. n.writeVarint32(16 | this.type.wireType),
  33606. this.element.encodeValue(2, i, n)
  33607. }, this) : this.hasWirePresence(i, r) && (n.writeVarint32(this.id << 3 | this.type.wireType),
  33608. this.element.encodeValue(this.id, i, n))
  33609. } catch (e) {
  33610. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33611. }
  33612. return n
  33613. }
  33614. ,
  33615. g.calculate = function(i, n) {
  33616. if (i = this.verifyValue(i),
  33617. null === this.type || "object" != typeof this.type)
  33618. throw Error("[INTERNAL] Unresolved type in " + this.toString(!0) + ": " + this.type);
  33619. if (null === i || this.repeated && 0 == i.length)
  33620. return 0;
  33621. var r = 0;
  33622. try {
  33623. if (this.repeated) {
  33624. var o, a;
  33625. if (this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0) {
  33626. for (r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33627. a = 0,
  33628. o = 0; o < i.length; o++)
  33629. a += this.element.calculateLength(this.id, i[o]);
  33630. r += t.calculateVarint32(a),
  33631. r += a
  33632. } else
  33633. for (o = 0; o < i.length; o++)
  33634. r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33635. r += this.element.calculateLength(this.id, i[o])
  33636. } else
  33637. this.map ? i.forEach(function(i, n, o) {
  33638. var a = t.calculateVarint32(8 | this.keyType.wireType) + this.keyElement.calculateLength(1, n) + t.calculateVarint32(16 | this.type.wireType) + this.element.calculateLength(2, i);
  33639. r += t.calculateVarint32(this.id << 3 | e.WIRE_TYPES.LDELIM),
  33640. r += t.calculateVarint32(a),
  33641. r += a
  33642. }, this) : this.hasWirePresence(i, n) && (r += t.calculateVarint32(this.id << 3 | this.type.wireType),
  33643. r += this.element.calculateLength(this.id, i))
  33644. } catch (e) {
  33645. throw Error("Illegal value for " + this.toString(!0) + ": " + i + " (" + e + ")")
  33646. }
  33647. return r
  33648. }
  33649. ,
  33650. g.decode = function(t, i, n) {
  33651. var r, o, a = !this.map && t == this.type.wireType || !n && this.repeated && this.options.packed && t == e.WIRE_TYPES.LDELIM || this.map && t == e.WIRE_TYPES.LDELIM;
  33652. if (!a)
  33653. throw Error("Illegal wire type for field " + this.toString(!0) + ": " + t + " (" + this.type.wireType + " expected)");
  33654. if (t == e.WIRE_TYPES.LDELIM && this.repeated && this.options.packed && e.PACKABLE_WIRE_TYPES.indexOf(this.type.wireType) >= 0 && !n) {
  33655. o = i.readVarint32(),
  33656. o = i.offset + o;
  33657. for (var s = []; i.offset < o; )
  33658. s.push(this.decode(this.type.wireType, i, !0));
  33659. return s
  33660. }
  33661. if (this.map) {
  33662. var l = h.defaultFieldValue(this.keyType);
  33663. if (r = h.defaultFieldValue(this.type),
  33664. o = i.readVarint32(),
  33665. i.remaining() < o)
  33666. throw Error("Illegal number of bytes for " + this.toString(!0) + ": " + o + " required but got only " + i.remaining());
  33667. var c = i.clone();
  33668. for (c.limit = c.offset + o,
  33669. i.offset += o; c.remaining() > 0; ) {
  33670. var u = c.readVarint32();
  33671. t = 7 & u;
  33672. var d = u >>> 3;
  33673. if (1 === d)
  33674. l = this.keyElement.decode(c, t, d);
  33675. else {
  33676. if (2 !== d)
  33677. throw Error("Unexpected tag in map field key/value submessage");
  33678. r = this.element.decode(c, t, d)
  33679. }
  33680. }
  33681. return [l, r]
  33682. }
  33683. return this.element.decode(i, t, this.id)
  33684. }
  33685. ,
  33686. o.Message.Field = f;
  33687. var m = function(e, t, i, n, r, o, a) {
  33688. f.call(this, e, t, i, null, n, r, o, a),
  33689. this.extension
  33690. };
  33691. m.prototype = Object.create(f.prototype),
  33692. o.Message.ExtensionField = m;
  33693. var v = function(e, t, i) {
  33694. a.call(this, e, t, i),
  33695. this.fields = []
  33696. };
  33697. o.Message.OneOf = v;
  33698. var A = function(e, t, i, n, r) {
  33699. l.call(this, e, t, i, n, r),
  33700. this.className = "Enum",
  33701. this.object = null
  33702. };
  33703. A.getName = function(e, t) {
  33704. for (var i, n = Object.keys(e), r = 0; r < n.length; ++r)
  33705. if (e[i = n[r]] === t)
  33706. return i;
  33707. return null
  33708. }
  33709. ;
  33710. var y = A.prototype = Object.create(l.prototype);
  33711. y.build = function(t) {
  33712. if (this.object && !t)
  33713. return this.object;
  33714. for (var i = new e.Builder.Enum, n = this.getChildren(A.Value), r = 0, o = n.length; r < o; ++r)
  33715. i[n[r].name] = n[r].id;
  33716. return Object.defineProperty && Object.defineProperty(i, "$options", {
  33717. value: this.buildOpt(),
  33718. enumerable: !1
  33719. }),
  33720. this.object = i
  33721. }
  33722. ,
  33723. o.Enum = A;
  33724. var C = function(e, t, i, n) {
  33725. a.call(this, e, t, i),
  33726. this.className = "Enum.Value",
  33727. this.id = n
  33728. };
  33729. C.prototype = Object.create(a.prototype),
  33730. o.Enum.Value = C;
  33731. var I = function(e, t, i, n) {
  33732. a.call(this, e, t, i),
  33733. this.field = n
  33734. };
  33735. I.prototype = Object.create(a.prototype),
  33736. o.Extension = I;
  33737. var E = function(e, t, i, n) {
  33738. l.call(this, e, t, i, n),
  33739. this.className = "Service",
  33740. this.clazz = null
  33741. }
  33742. , b = E.prototype = Object.create(l.prototype);
  33743. b.build = function(i) {
  33744. return this.clazz && !i ? this.clazz : this.clazz = function(e, i) {
  33745. for (var n = function(t) {
  33746. e.Builder.Service.call(this),
  33747. this.rpcImpl = t || function(e, t, i) {
  33748. setTimeout(i.bind(this, Error("Not implemented, see: https://github.com/dcodeIO/ProtoBuf.js/wiki/Services")), 0)
  33749. }
  33750. }, r = n.prototype = Object.create(e.Builder.Service.prototype), o = i.getChildren(e.Reflect.Service.RPCMethod), a = 0; a < o.length; a++)
  33751. !function(e) {
  33752. r[e.name] = function(n, r) {
  33753. try {
  33754. try {
  33755. n = e.resolvedRequestType.clazz.decode(t.wrap(n))
  33756. } catch (e) {
  33757. if (!(e instanceof TypeError))
  33758. throw e
  33759. }
  33760. if (null === n || "object" != typeof n)
  33761. throw Error("Illegal arguments");
  33762. n instanceof e.resolvedRequestType.clazz || (n = new e.resolvedRequestType.clazz(n)),
  33763. this.rpcImpl(e.fqn(), n, function(t, n) {
  33764. if (t)
  33765. return void r(t);
  33766. null === n && (n = "");
  33767. try {
  33768. n = e.resolvedResponseType.clazz.decode(n)
  33769. } catch (e) {}
  33770. 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))
  33771. })
  33772. } catch (e) {
  33773. setTimeout(r.bind(this, e), 0)
  33774. }
  33775. }
  33776. ,
  33777. n[e.name] = function(t, i, r) {
  33778. new n(t)[e.name](i, r)
  33779. }
  33780. ,
  33781. Object.defineProperty && (Object.defineProperty(n[e.name], "$options", {
  33782. value: e.buildOpt()
  33783. }),
  33784. Object.defineProperty(r[e.name], "$options", {
  33785. value: n[e.name].$options
  33786. }))
  33787. }(o[a]);
  33788. return Object.defineProperty && (Object.defineProperty(n, "$options", {
  33789. value: i.buildOpt()
  33790. }),
  33791. Object.defineProperty(r, "$options", {
  33792. value: n.$options
  33793. }),
  33794. Object.defineProperty(n, "$type", {
  33795. value: i
  33796. }),
  33797. Object.defineProperty(r, "$type", {
  33798. value: i
  33799. })),
  33800. n
  33801. }(e, this)
  33802. }
  33803. ,
  33804. o.Service = E;
  33805. var w = function(e, t, i, n) {
  33806. a.call(this, e, t, i),
  33807. this.className = "Service.Method",
  33808. this.options = n || {}
  33809. }
  33810. , _ = w.prototype = Object.create(a.prototype);
  33811. _.buildOpt = c.buildOpt,
  33812. o.Service.Method = w;
  33813. var T = function(e, t, i, n, r, o, a, s) {
  33814. w.call(this, e, t, i, s),
  33815. this.className = "Service.RPCMethod",
  33816. this.requestName = n,
  33817. this.responseName = r,
  33818. this.requestStream = o,
  33819. this.responseStream = a,
  33820. this.resolvedRequestType = null,
  33821. this.resolvedResponseType = null
  33822. };
  33823. return T.prototype = Object.create(w.prototype),
  33824. o.Service.RPCMethod = T,
  33825. o
  33826. }(r),
  33827. r.Builder = function(t, i, n) {
  33828. function r(e) {
  33829. e.messages && e.messages.forEach(function(t) {
  33830. t.syntax = e.syntax,
  33831. r(t)
  33832. }),
  33833. e.enums && e.enums.forEach(function(t) {
  33834. t.syntax = e.syntax
  33835. })
  33836. }
  33837. var o = function(e) {
  33838. this.ns = new n.Namespace(this,null,""),
  33839. this.ptr = this.ns,
  33840. this.resolved = !1,
  33841. this.result = null,
  33842. this.files = {},
  33843. this.importRoot = null,
  33844. this.options = e || {}
  33845. }
  33846. , a = o.prototype;
  33847. return o.isMessage = function(e) {
  33848. return "string" == typeof e.name && ("undefined" == typeof e.values && "undefined" == typeof e.rpc)
  33849. }
  33850. ,
  33851. o.isMessageField = function(e) {
  33852. return "string" == typeof e.rule && "string" == typeof e.name && "string" == typeof e.type && "undefined" != typeof e.id
  33853. }
  33854. ,
  33855. o.isEnum = function(e) {
  33856. return "string" == typeof e.name && !("undefined" == typeof e.values || !Array.isArray(e.values) || 0 === e.values.length)
  33857. }
  33858. ,
  33859. o.isService = function(e) {
  33860. return !("string" != typeof e.name || "object" != typeof e.rpc || !e.rpc)
  33861. }
  33862. ,
  33863. o.isExtend = function(e) {
  33864. return "string" == typeof e.ref
  33865. }
  33866. ,
  33867. a.reset = function() {
  33868. return this.ptr = this.ns,
  33869. this
  33870. }
  33871. ,
  33872. a.define = function(e) {
  33873. if ("string" != typeof e || !i.TYPEREF.test(e))
  33874. throw Error("illegal namespace: " + e);
  33875. return e.split(".").forEach(function(e) {
  33876. var t = this.ptr.getChild(e);
  33877. null === t && this.ptr.addChild(t = new n.Namespace(this,this.ptr,e)),
  33878. this.ptr = t
  33879. }, this),
  33880. this
  33881. }
  33882. ,
  33883. a.create = function(e) {
  33884. if (!e)
  33885. return this;
  33886. if (Array.isArray(e)) {
  33887. if (0 === e.length)
  33888. return this;
  33889. e = e.slice()
  33890. } else
  33891. e = [e];
  33892. for (var i = [e]; i.length > 0; ) {
  33893. if (e = i.pop(),
  33894. !Array.isArray(e))
  33895. throw Error("not a valid namespace: " + JSON.stringify(e));
  33896. for (; e.length > 0; ) {
  33897. var r = e.shift();
  33898. if (o.isMessage(r)) {
  33899. var a = new n.Message(this,this.ptr,r.name,r.options,r.isGroup,r.syntax)
  33900. , s = {};
  33901. r.oneofs && Object.keys(r.oneofs).forEach(function(e) {
  33902. a.addChild(s[e] = new n.Message.OneOf(this,a,e))
  33903. }, this),
  33904. r.fields && r.fields.forEach(function(e) {
  33905. if (null !== a.getChild(0 | e.id))
  33906. throw Error("duplicate or invalid field id in " + a.name + ": " + e.id);
  33907. if (e.options && "object" != typeof e.options)
  33908. throw Error("illegal field options in " + a.name + "#" + e.name);
  33909. var t = null;
  33910. if ("string" == typeof e.oneof && !(t = s[e.oneof]))
  33911. throw Error("illegal oneof in " + a.name + "#" + e.name + ": " + e.oneof);
  33912. e = new n.Message.Field(this,a,e.rule,e.keytype,e.type,e.name,e.id,e.options,t,r.syntax),
  33913. t && t.fields.push(e),
  33914. a.addChild(e)
  33915. }, this);
  33916. var l = [];
  33917. if (r.enums && r.enums.forEach(function(e) {
  33918. l.push(e)
  33919. }),
  33920. r.messages && r.messages.forEach(function(e) {
  33921. l.push(e)
  33922. }),
  33923. r.services && r.services.forEach(function(e) {
  33924. l.push(e)
  33925. }),
  33926. r.extensions && ("number" == typeof r.extensions[0] ? a.extensions = [r.extensions] : a.extensions = r.extensions),
  33927. this.ptr.addChild(a),
  33928. l.length > 0) {
  33929. i.push(e),
  33930. e = l,
  33931. l = null,
  33932. this.ptr = a,
  33933. a = null;
  33934. continue
  33935. }
  33936. l = null
  33937. } else if (o.isEnum(r))
  33938. a = new n.Enum(this,this.ptr,r.name,r.options,r.syntax),
  33939. r.values.forEach(function(e) {
  33940. a.addChild(new n.Enum.Value(this,a,e.name,e.id))
  33941. }, this),
  33942. this.ptr.addChild(a);
  33943. else if (o.isService(r))
  33944. a = new n.Service(this,this.ptr,r.name,r.options),
  33945. Object.keys(r.rpc).forEach(function(e) {
  33946. var t = r.rpc[e];
  33947. a.addChild(new n.Service.RPCMethod(this,a,e,t.request,t.response,!!t.request_stream,!!t.response_stream,t.options))
  33948. }, this),
  33949. this.ptr.addChild(a);
  33950. else {
  33951. if (!o.isExtend(r))
  33952. throw Error("not a valid definition: " + JSON.stringify(r));
  33953. if (a = this.ptr.resolve(r.ref, !0))
  33954. r.fields.forEach(function(e) {
  33955. if (null !== a.getChild(0 | e.id))
  33956. throw Error("duplicate extended field id in " + a.name + ": " + e.id);
  33957. if (a.extensions) {
  33958. var i = !1;
  33959. if (a.extensions.forEach(function(t) {
  33960. e.id >= t[0] && e.id <= t[1] && (i = !0)
  33961. }),
  33962. !i)
  33963. throw Error("illegal extended field id in " + a.name + ": " + e.id + " (not within valid ranges)")
  33964. }
  33965. var r = e.name;
  33966. this.options.convertFieldsToCamelCase && (r = t.Util.toCamelCase(r));
  33967. var o = new n.Message.ExtensionField(this,a,e.rule,e.type,this.ptr.fqn() + "." + r,e.id,e.options)
  33968. , s = new n.Extension(this,this.ptr,e.name,o);
  33969. o.extension = s,
  33970. this.ptr.addChild(s),
  33971. a.addChild(o)
  33972. }, this);
  33973. else if (!/\.?google\.protobuf\./.test(r.ref))
  33974. throw Error("extended message " + r.ref + " is not defined")
  33975. }
  33976. r = null,
  33977. a = null
  33978. }
  33979. e = null,
  33980. this.ptr = this.ptr.parent
  33981. }
  33982. return this.resolved = !1,
  33983. this.result = null,
  33984. this
  33985. }
  33986. ,
  33987. a.import = function(i, n) {
  33988. var o = "/";
  33989. if ("string" == typeof n) {
  33990. if (t.Util.IS_NODE && (n = e("path").resolve(n)),
  33991. this.files[n] === !0)
  33992. return this.reset();
  33993. this.files[n] = !0
  33994. } else if ("object" == typeof n) {
  33995. var a = n.root;
  33996. t.Util.IS_NODE && (a = e("path").resolve(a)),
  33997. (a.indexOf("\\") >= 0 || n.file.indexOf("\\") >= 0) && (o = "\\");
  33998. var s = a + o + n.file;
  33999. if (this.files[s] === !0)
  34000. return this.reset();
  34001. this.files[s] = !0
  34002. }
  34003. if (i.imports && i.imports.length > 0) {
  34004. var l, c = !1;
  34005. "object" == typeof n ? (this.importRoot = n.root,
  34006. c = !0,
  34007. l = this.importRoot,
  34008. n = n.file,
  34009. (l.indexOf("\\") >= 0 || n.indexOf("\\") >= 0) && (o = "\\")) : "string" == typeof n ? this.importRoot ? l = this.importRoot : n.indexOf("/") >= 0 ? (l = n.replace(/\/[^\/]*$/, ""),
  34010. "" === l && (l = "/")) : n.indexOf("\\") >= 0 ? (l = n.replace(/\\[^\\]*$/, ""),
  34011. o = "\\") : l = "." : l = null;
  34012. for (var h = 0; h < i.imports.length; h++)
  34013. if ("string" == typeof i.imports[h]) {
  34014. if (!l)
  34015. throw Error("cannot determine import root");
  34016. var u = i.imports[h];
  34017. if ("google/protobuf/descriptor.proto" === u)
  34018. continue;
  34019. if (u = l + o + u,
  34020. this.files[u] === !0)
  34021. continue;
  34022. /\.proto$/i.test(u) && !t.DotProto && (u = u.replace(/\.proto$/, ".json"));
  34023. var d = t.Util.fetch(u);
  34024. if (null === d)
  34025. throw Error("failed to import '" + u + "' in '" + n + "': file not found");
  34026. /\.json$/i.test(u) ? this.import(JSON.parse(d + ""), u) : this.import(t.DotProto.Parser.parse(d), u)
  34027. } else
  34028. n ? /\.(\w+)$/.test(n) ? this.import(i.imports[h], n.replace(/^(.+)\.(\w+)$/, function(e, t, i) {
  34029. return t + "_import" + h + "." + i
  34030. })) : this.import(i.imports[h], n + "_import" + h) : this.import(i.imports[h]);
  34031. c && (this.importRoot = null)
  34032. }
  34033. i.package && this.define(i.package),
  34034. i.syntax && r(i);
  34035. var p = this.ptr;
  34036. return i.options && Object.keys(i.options).forEach(function(e) {
  34037. p.options[e] = i.options[e]
  34038. }),
  34039. i.messages && (this.create(i.messages),
  34040. this.ptr = p),
  34041. i.enums && (this.create(i.enums),
  34042. this.ptr = p),
  34043. i.services && (this.create(i.services),
  34044. this.ptr = p),
  34045. i.extends && this.create(i.extends),
  34046. this.reset()
  34047. }
  34048. ,
  34049. a.resolveAll = function() {
  34050. var e;
  34051. if (null == this.ptr || "object" == typeof this.ptr.type)
  34052. return this;
  34053. if (this.ptr instanceof n.Namespace)
  34054. this.ptr.children.forEach(function(e) {
  34055. this.ptr = e,
  34056. this.resolveAll()
  34057. }, this);
  34058. else if (this.ptr instanceof n.Message.Field) {
  34059. if (i.TYPE.test(this.ptr.type))
  34060. this.ptr.type = t.TYPES[this.ptr.type];
  34061. else {
  34062. if (!i.TYPEREF.test(this.ptr.type))
  34063. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34064. if (e = (this.ptr instanceof n.Message.ExtensionField ? this.ptr.extension.parent : this.ptr.parent).resolve(this.ptr.type, !0),
  34065. !e)
  34066. throw Error("unresolvable type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34067. if (this.ptr.resolvedType = e,
  34068. e instanceof n.Enum) {
  34069. if (this.ptr.type = t.TYPES.enum,
  34070. "proto3" === this.ptr.syntax && "proto3" !== e.syntax)
  34071. throw Error("proto3 message cannot reference proto2 enum")
  34072. } else {
  34073. if (!(e instanceof n.Message))
  34074. throw Error("illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.type);
  34075. this.ptr.type = e.isGroup ? t.TYPES.group : t.TYPES.message
  34076. }
  34077. }
  34078. if (this.ptr.map) {
  34079. if (!i.TYPE.test(this.ptr.keyType))
  34080. throw Error("illegal key type for map field in " + this.ptr.toString(!0) + ": " + this.ptr.keyType);
  34081. this.ptr.keyType = t.TYPES[this.ptr.keyType]
  34082. }
  34083. } else if (this.ptr instanceof t.Reflect.Service.Method) {
  34084. if (!(this.ptr instanceof t.Reflect.Service.RPCMethod))
  34085. throw Error("illegal service type in " + this.ptr.toString(!0));
  34086. if (e = this.ptr.parent.resolve(this.ptr.requestName, !0),
  34087. !(e && e instanceof t.Reflect.Message))
  34088. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.requestName);
  34089. if (this.ptr.resolvedRequestType = e,
  34090. e = this.ptr.parent.resolve(this.ptr.responseName, !0),
  34091. !(e && e instanceof t.Reflect.Message))
  34092. throw Error("Illegal type reference in " + this.ptr.toString(!0) + ": " + this.ptr.responseName);
  34093. this.ptr.resolvedResponseType = e
  34094. } else if (!(this.ptr instanceof t.Reflect.Message.OneOf || this.ptr instanceof t.Reflect.Extension || this.ptr instanceof t.Reflect.Enum.Value))
  34095. throw Error("illegal object in namespace: " + typeof this.ptr + ": " + this.ptr);
  34096. return this.reset()
  34097. }
  34098. ,
  34099. a.build = function(e) {
  34100. if (this.reset(),
  34101. this.resolved || (this.resolveAll(),
  34102. this.resolved = !0,
  34103. this.result = null),
  34104. null === this.result && (this.result = this.ns.build()),
  34105. !e)
  34106. return this.result;
  34107. for (var t = "string" == typeof e ? e.split(".") : e, i = this.result, n = 0; n < t.length; n++) {
  34108. if (!i[t[n]]) {
  34109. i = null;
  34110. break
  34111. }
  34112. i = i[t[n]]
  34113. }
  34114. return i
  34115. }
  34116. ,
  34117. a.lookup = function(e, t) {
  34118. return e ? this.ns.resolve(e, t) : this.ns
  34119. }
  34120. ,
  34121. a.toString = function() {
  34122. return "Builder"
  34123. }
  34124. ,
  34125. o.Message = function() {}
  34126. ,
  34127. o.Enum = function() {}
  34128. ,
  34129. o.Service = function() {}
  34130. ,
  34131. o
  34132. }(r, r.Lang, r.Reflect),
  34133. r.Map = function(e, t) {
  34134. function i(e) {
  34135. var t = 0;
  34136. return {
  34137. next: function() {
  34138. return t < e.length ? {
  34139. done: !1,
  34140. value: e[t++]
  34141. } : {
  34142. done: !0
  34143. }
  34144. }
  34145. }
  34146. }
  34147. var n = function(e, i) {
  34148. if (!e.map)
  34149. throw Error("field is not a map");
  34150. if (this.field = e,
  34151. this.keyElem = new t.Element(e.keyType,null,!0,e.syntax),
  34152. this.valueElem = new t.Element(e.type,e.resolvedType,!1,e.syntax),
  34153. this.map = {},
  34154. Object.defineProperty(this, "size", {
  34155. get: function() {
  34156. return Object.keys(this.map).length
  34157. }
  34158. }),
  34159. i)
  34160. for (var n = Object.keys(i), r = 0; r < n.length; r++) {
  34161. var o = this.keyElem.valueFromString(n[r])
  34162. , a = this.valueElem.verifyValue(i[n[r]]);
  34163. this.map[this.keyElem.valueToString(o)] = {
  34164. key: o,
  34165. value: a
  34166. }
  34167. }
  34168. }
  34169. , r = n.prototype;
  34170. return r.clear = function() {
  34171. this.map = {}
  34172. }
  34173. ,
  34174. r.delete = function(e) {
  34175. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e))
  34176. , i = t in this.map;
  34177. return delete this.map[t],
  34178. i
  34179. }
  34180. ,
  34181. r.entries = function() {
  34182. for (var e, t = [], n = Object.keys(this.map), r = 0; r < n.length; r++)
  34183. t.push([(e = this.map[n[r]]).key, e.value]);
  34184. return i(t)
  34185. }
  34186. ,
  34187. r.keys = function() {
  34188. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34189. e.push(this.map[t[n]].key);
  34190. return i(e)
  34191. }
  34192. ,
  34193. r.values = function() {
  34194. for (var e = [], t = Object.keys(this.map), n = 0; n < t.length; n++)
  34195. e.push(this.map[t[n]].value);
  34196. return i(e)
  34197. }
  34198. ,
  34199. r.forEach = function(e, t) {
  34200. for (var i, n = Object.keys(this.map), r = 0; r < n.length; r++)
  34201. e.call(t, (i = this.map[n[r]]).value, i.key, this)
  34202. }
  34203. ,
  34204. r.set = function(e, t) {
  34205. var i = this.keyElem.verifyValue(e)
  34206. , n = this.valueElem.verifyValue(t);
  34207. return this.map[this.keyElem.valueToString(i)] = {
  34208. key: i,
  34209. value: n
  34210. },
  34211. this
  34212. }
  34213. ,
  34214. r.get = function(e) {
  34215. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34216. if (t in this.map)
  34217. return this.map[t].value
  34218. }
  34219. ,
  34220. r.has = function(e) {
  34221. var t = this.keyElem.valueToString(this.keyElem.verifyValue(e));
  34222. return t in this.map
  34223. }
  34224. ,
  34225. n
  34226. }(r, r.Reflect),
  34227. r.loadProto = function(e, t, i) {
  34228. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34229. t = void 0),
  34230. r.loadJson(r.DotProto.Parser.parse(e), t, i)
  34231. }
  34232. ,
  34233. r.protoFromString = r.loadProto,
  34234. r.loadProtoFile = function(e, t, i) {
  34235. if (t && "object" == typeof t ? (i = t,
  34236. t = null) : t && "function" == typeof t || (t = null),
  34237. t)
  34238. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34239. if (null === n)
  34240. return void t(Error("Failed to fetch file"));
  34241. try {
  34242. t(null, r.loadProto(n, i, e))
  34243. } catch (e) {
  34244. t(e)
  34245. }
  34246. });
  34247. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34248. return null === n ? null : r.loadProto(n, i, e)
  34249. }
  34250. ,
  34251. r.protoFromFile = r.loadProtoFile,
  34252. r.newBuilder = function(e) {
  34253. return e = e || {},
  34254. "undefined" == typeof e.convertFieldsToCamelCase && (e.convertFieldsToCamelCase = r.convertFieldsToCamelCase),
  34255. "undefined" == typeof e.populateAccessors && (e.populateAccessors = r.populateAccessors),
  34256. new r.Builder(e)
  34257. }
  34258. ,
  34259. r.loadJson = function(e, t, i) {
  34260. return ("string" == typeof t || t && "string" == typeof t.file && "string" == typeof t.root) && (i = t,
  34261. t = null),
  34262. t && "object" == typeof t || (t = r.newBuilder()),
  34263. "string" == typeof e && (e = JSON.parse(e)),
  34264. t.import(e, i),
  34265. t.resolveAll(),
  34266. t
  34267. }
  34268. ,
  34269. r.loadJsonFile = function(e, t, i) {
  34270. if (t && "object" == typeof t ? (i = t,
  34271. t = null) : t && "function" == typeof t || (t = null),
  34272. t)
  34273. return r.Util.fetch("string" == typeof e ? e : e.root + "/" + e.file, function(n) {
  34274. if (null === n)
  34275. return void t(Error("Failed to fetch file"));
  34276. try {
  34277. t(null, r.loadJson(JSON.parse(n), i, e))
  34278. } catch (e) {
  34279. t(e)
  34280. }
  34281. });
  34282. var n = r.Util.fetch("object" == typeof e ? e.root + "/" + e.file : e);
  34283. return null === n ? null : r.loadJson(JSON.parse(n), i, e)
  34284. }
  34285. ,
  34286. r
  34287. })
  34288. }
  34289. ).call(this, e("_process"))
  34290. }
  34291. , {
  34292. _process: 203,
  34293. bytebuffer: 215,
  34294. fs: 197,
  34295. path: 197
  34296. }],
  34297. 215: [function(e, t, i) {
  34298. !function(i, n) {
  34299. "function" == typeof define && define.amd ? define(["long"], n) : "function" == typeof e && "object" == typeof t && t && t.exports ? t.exports = function() {
  34300. var t;
  34301. try {
  34302. t = e("long")
  34303. } catch (e) {}
  34304. return n(t)
  34305. }() : (i.dcodeIO = i.dcodeIO || {}).ByteBuffer = n(i.dcodeIO.Long)
  34306. }(this, function(e) {
  34307. "use strict";
  34308. function t(e) {
  34309. var t = 0;
  34310. return function() {
  34311. return t < e.length ? e.charCodeAt(t++) : null
  34312. }
  34313. }
  34314. function i() {
  34315. var e = []
  34316. , t = [];
  34317. return function() {
  34318. return 0 === arguments.length ? t.join("") + l.apply(String, e) : (e.length + arguments.length > 1024 && (t.push(l.apply(String, e)),
  34319. e.length = 0),
  34320. void Array.prototype.push.apply(e, arguments))
  34321. }
  34322. }
  34323. function n(e, t, i, n, r) {
  34324. var o, a, s = 8 * r - n - 1, l = (1 << s) - 1, c = l >> 1, h = -7, u = i ? r - 1 : 0, d = i ? -1 : 1, p = e[t + u];
  34325. for (u += d,
  34326. o = p & (1 << -h) - 1,
  34327. p >>= -h,
  34328. h += s; h > 0; o = 256 * o + e[t + u],
  34329. u += d,
  34330. h -= 8)
  34331. ;
  34332. for (a = o & (1 << -h) - 1,
  34333. o >>= -h,
  34334. h += n; h > 0; a = 256 * a + e[t + u],
  34335. u += d,
  34336. h -= 8)
  34337. ;
  34338. if (0 === o)
  34339. o = 1 - c;
  34340. else {
  34341. if (o === l)
  34342. return a ? NaN : (p ? -1 : 1) * (1 / 0);
  34343. a += Math.pow(2, n),
  34344. o -= c
  34345. }
  34346. return (p ? -1 : 1) * a * Math.pow(2, o - n)
  34347. }
  34348. function r(e, t, i, n, r, o) {
  34349. var a, s, l, c = 8 * o - r - 1, h = (1 << c) - 1, u = h >> 1, d = 23 === r ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : o - 1, f = n ? 1 : -1, g = t < 0 || 0 === t && 1 / t < 0 ? 1 : 0;
  34350. for (t = Math.abs(t),
  34351. isNaN(t) || t === 1 / 0 ? (s = isNaN(t) ? 1 : 0,
  34352. a = h) : (a = Math.floor(Math.log(t) / Math.LN2),
  34353. t * (l = Math.pow(2, -a)) < 1 && (a--,
  34354. l *= 2),
  34355. t += a + u >= 1 ? d / l : d * Math.pow(2, 1 - u),
  34356. t * l >= 2 && (a++,
  34357. l /= 2),
  34358. a + u >= h ? (s = 0,
  34359. a = h) : a + u >= 1 ? (s = (t * l - 1) * Math.pow(2, r),
  34360. a += u) : (s = t * Math.pow(2, u - 1) * Math.pow(2, r),
  34361. a = 0)); r >= 8; e[i + p] = 255 & s,
  34362. p += f,
  34363. s /= 256,
  34364. r -= 8)
  34365. ;
  34366. for (a = a << r | s,
  34367. c += r; c > 0; e[i + p] = 255 & a,
  34368. p += f,
  34369. a /= 256,
  34370. c -= 8)
  34371. ;
  34372. e[i + p - f] |= 128 * g
  34373. }
  34374. var o = function(e, t, i) {
  34375. if ("undefined" == typeof e && (e = o.DEFAULT_CAPACITY),
  34376. "undefined" == typeof t && (t = o.DEFAULT_ENDIAN),
  34377. "undefined" == typeof i && (i = o.DEFAULT_NOASSERT),
  34378. !i) {
  34379. if (e |= 0,
  34380. e < 0)
  34381. throw RangeError("Illegal capacity");
  34382. t = !!t,
  34383. i = !!i
  34384. }
  34385. this.buffer = 0 === e ? s : new ArrayBuffer(e),
  34386. this.view = 0 === e ? null : new Uint8Array(this.buffer),
  34387. this.offset = 0,
  34388. this.markedOffset = -1,
  34389. this.limit = e,
  34390. this.littleEndian = t,
  34391. this.noAssert = i
  34392. };
  34393. o.VERSION = "5.0.1",
  34394. o.LITTLE_ENDIAN = !0,
  34395. o.BIG_ENDIAN = !1,
  34396. o.DEFAULT_CAPACITY = 16,
  34397. o.DEFAULT_ENDIAN = o.BIG_ENDIAN,
  34398. o.DEFAULT_NOASSERT = !1,
  34399. o.Long = e || null;
  34400. var a = o.prototype;
  34401. a.__isByteBuffer__,
  34402. Object.defineProperty(a, "__isByteBuffer__", {
  34403. value: !0,
  34404. enumerable: !1,
  34405. configurable: !1
  34406. });
  34407. var s = new ArrayBuffer(0)
  34408. , l = String.fromCharCode;
  34409. o.accessor = function() {
  34410. return Uint8Array
  34411. }
  34412. ,
  34413. o.allocate = function(e, t, i) {
  34414. return new o(e,t,i)
  34415. }
  34416. ,
  34417. o.concat = function(e, t, i, n) {
  34418. "boolean" != typeof t && "string" == typeof t || (n = i,
  34419. i = t,
  34420. t = void 0);
  34421. for (var r, a = 0, s = 0, l = e.length; s < l; ++s)
  34422. o.isByteBuffer(e[s]) || (e[s] = o.wrap(e[s], t)),
  34423. r = e[s].limit - e[s].offset,
  34424. r > 0 && (a += r);
  34425. if (0 === a)
  34426. return new o(0,i,n);
  34427. var c, h = new o(a,i,n);
  34428. for (s = 0; s < l; )
  34429. c = e[s++],
  34430. r = c.limit - c.offset,
  34431. r <= 0 || (h.view.set(c.view.subarray(c.offset, c.limit), h.offset),
  34432. h.offset += r);
  34433. return h.limit = h.offset,
  34434. h.offset = 0,
  34435. h
  34436. }
  34437. ,
  34438. o.isByteBuffer = function(e) {
  34439. return (e && e.__isByteBuffer__) === !0
  34440. }
  34441. ,
  34442. o.type = function() {
  34443. return ArrayBuffer
  34444. }
  34445. ,
  34446. o.wrap = function(e, t, i, n) {
  34447. if ("string" != typeof t && (n = i,
  34448. i = t,
  34449. t = void 0),
  34450. "string" == typeof e)
  34451. switch ("undefined" == typeof t && (t = "utf8"),
  34452. t) {
  34453. case "base64":
  34454. return o.fromBase64(e, i);
  34455. case "hex":
  34456. return o.fromHex(e, i);
  34457. case "binary":
  34458. return o.fromBinary(e, i);
  34459. case "utf8":
  34460. return o.fromUTF8(e, i);
  34461. case "debug":
  34462. return o.fromDebug(e, i);
  34463. default:
  34464. throw Error("Unsupported encoding: " + t)
  34465. }
  34466. if (null === e || "object" != typeof e)
  34467. throw TypeError("Illegal buffer");
  34468. var r;
  34469. if (o.isByteBuffer(e))
  34470. return r = a.clone.call(e),
  34471. r.markedOffset = -1,
  34472. r;
  34473. if (e instanceof Uint8Array)
  34474. r = new o(0,i,n),
  34475. e.length > 0 && (r.buffer = e.buffer,
  34476. r.offset = e.byteOffset,
  34477. r.limit = e.byteOffset + e.byteLength,
  34478. r.view = new Uint8Array(e.buffer));
  34479. else if (e instanceof ArrayBuffer)
  34480. r = new o(0,i,n),
  34481. e.byteLength > 0 && (r.buffer = e,
  34482. r.offset = 0,
  34483. r.limit = e.byteLength,
  34484. r.view = e.byteLength > 0 ? new Uint8Array(e) : null);
  34485. else {
  34486. if ("[object Array]" !== Object.prototype.toString.call(e))
  34487. throw TypeError("Illegal buffer");
  34488. r = new o(e.length,i,n),
  34489. r.limit = e.length;
  34490. for (var s = 0; s < e.length; ++s)
  34491. r.view[s] = e[s]
  34492. }
  34493. return r
  34494. }
  34495. ,
  34496. a.writeBitSet = function(e, t) {
  34497. var i = "undefined" == typeof t;
  34498. if (i && (t = this.offset),
  34499. !this.noAssert) {
  34500. if (!(e instanceof Array))
  34501. throw TypeError("Illegal BitSet: Not an array");
  34502. if ("number" != typeof t || t % 1 !== 0)
  34503. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34504. if (t >>>= 0,
  34505. t < 0 || t + 0 > this.buffer.byteLength)
  34506. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34507. }
  34508. var n, r = t, o = e.length, a = o >> 3, s = 0;
  34509. for (t += this.writeVarint32(o, t); a--; )
  34510. n = 1 & !!e[s++] | (1 & !!e[s++]) << 1 | (1 & !!e[s++]) << 2 | (1 & !!e[s++]) << 3 | (1 & !!e[s++]) << 4 | (1 & !!e[s++]) << 5 | (1 & !!e[s++]) << 6 | (1 & !!e[s++]) << 7,
  34511. this.writeByte(n, t++);
  34512. if (s < o) {
  34513. var l = 0;
  34514. for (n = 0; s < o; )
  34515. n |= (1 & !!e[s++]) << l++;
  34516. this.writeByte(n, t++)
  34517. }
  34518. return i ? (this.offset = t,
  34519. this) : t - r
  34520. }
  34521. ,
  34522. a.readBitSet = function(e) {
  34523. var t = "undefined" == typeof e;
  34524. t && (e = this.offset);
  34525. var i, n = this.readVarint32(e), r = n.value, o = r >> 3, a = 0, s = [];
  34526. for (e += n.length; o--; )
  34527. i = this.readByte(e++),
  34528. s[a++] = !!(1 & i),
  34529. s[a++] = !!(2 & i),
  34530. s[a++] = !!(4 & i),
  34531. s[a++] = !!(8 & i),
  34532. s[a++] = !!(16 & i),
  34533. s[a++] = !!(32 & i),
  34534. s[a++] = !!(64 & i),
  34535. s[a++] = !!(128 & i);
  34536. if (a < r) {
  34537. var l = 0;
  34538. for (i = this.readByte(e++); a < r; )
  34539. s[a++] = !!(i >> l++ & 1)
  34540. }
  34541. return t && (this.offset = e),
  34542. s
  34543. }
  34544. ,
  34545. a.readBytes = function(e, t) {
  34546. var i = "undefined" == typeof t;
  34547. if (i && (t = this.offset),
  34548. !this.noAssert) {
  34549. if ("number" != typeof t || t % 1 !== 0)
  34550. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34551. if (t >>>= 0,
  34552. t < 0 || t + e > this.buffer.byteLength)
  34553. throw RangeError("Illegal offset: 0 <= " + t + " (+" + e + ") <= " + this.buffer.byteLength)
  34554. }
  34555. var n = this.slice(t, t + e);
  34556. return i && (this.offset += e),
  34557. n
  34558. }
  34559. ,
  34560. a.writeBytes = a.append,
  34561. a.writeInt8 = function(e, t) {
  34562. var i = "undefined" == typeof t;
  34563. if (i && (t = this.offset),
  34564. !this.noAssert) {
  34565. if ("number" != typeof e || e % 1 !== 0)
  34566. throw TypeError("Illegal value: " + e + " (not an integer)");
  34567. if (e |= 0,
  34568. "number" != typeof t || t % 1 !== 0)
  34569. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34570. if (t >>>= 0,
  34571. t < 0 || t + 0 > this.buffer.byteLength)
  34572. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34573. }
  34574. t += 1;
  34575. var n = this.buffer.byteLength;
  34576. return t > n && this.resize((n *= 2) > t ? n : t),
  34577. t -= 1,
  34578. this.view[t] = e,
  34579. i && (this.offset += 1),
  34580. this
  34581. }
  34582. ,
  34583. a.writeByte = a.writeInt8,
  34584. a.readInt8 = function(e) {
  34585. var t = "undefined" == typeof e;
  34586. if (t && (e = this.offset),
  34587. !this.noAssert) {
  34588. if ("number" != typeof e || e % 1 !== 0)
  34589. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34590. if (e >>>= 0,
  34591. e < 0 || e + 1 > this.buffer.byteLength)
  34592. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34593. }
  34594. var i = this.view[e];
  34595. return 128 === (128 & i) && (i = -(255 - i + 1)),
  34596. t && (this.offset += 1),
  34597. i
  34598. }
  34599. ,
  34600. a.readByte = a.readInt8,
  34601. a.writeUint8 = function(e, t) {
  34602. var i = "undefined" == typeof t;
  34603. if (i && (t = this.offset),
  34604. !this.noAssert) {
  34605. if ("number" != typeof e || e % 1 !== 0)
  34606. throw TypeError("Illegal value: " + e + " (not an integer)");
  34607. if (e >>>= 0,
  34608. "number" != typeof t || t % 1 !== 0)
  34609. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34610. if (t >>>= 0,
  34611. t < 0 || t + 0 > this.buffer.byteLength)
  34612. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34613. }
  34614. t += 1;
  34615. var n = this.buffer.byteLength;
  34616. return t > n && this.resize((n *= 2) > t ? n : t),
  34617. t -= 1,
  34618. this.view[t] = e,
  34619. i && (this.offset += 1),
  34620. this
  34621. }
  34622. ,
  34623. a.writeUInt8 = a.writeUint8,
  34624. a.readUint8 = function(e) {
  34625. var t = "undefined" == typeof e;
  34626. if (t && (e = this.offset),
  34627. !this.noAssert) {
  34628. if ("number" != typeof e || e % 1 !== 0)
  34629. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34630. if (e >>>= 0,
  34631. e < 0 || e + 1 > this.buffer.byteLength)
  34632. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  34633. }
  34634. var i = this.view[e];
  34635. return t && (this.offset += 1),
  34636. i
  34637. }
  34638. ,
  34639. a.readUInt8 = a.readUint8,
  34640. a.writeInt16 = function(e, t) {
  34641. var i = "undefined" == typeof t;
  34642. if (i && (t = this.offset),
  34643. !this.noAssert) {
  34644. if ("number" != typeof e || e % 1 !== 0)
  34645. throw TypeError("Illegal value: " + e + " (not an integer)");
  34646. if (e |= 0,
  34647. "number" != typeof t || t % 1 !== 0)
  34648. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34649. if (t >>>= 0,
  34650. t < 0 || t + 0 > this.buffer.byteLength)
  34651. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34652. }
  34653. t += 2;
  34654. var n = this.buffer.byteLength;
  34655. return t > n && this.resize((n *= 2) > t ? n : t),
  34656. t -= 2,
  34657. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34658. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34659. this.view[t + 1] = 255 & e),
  34660. i && (this.offset += 2),
  34661. this
  34662. }
  34663. ,
  34664. a.writeShort = a.writeInt16,
  34665. a.readInt16 = function(e) {
  34666. var t = "undefined" == typeof e;
  34667. if (t && (e = this.offset),
  34668. !this.noAssert) {
  34669. if ("number" != typeof e || e % 1 !== 0)
  34670. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34671. if (e >>>= 0,
  34672. e < 0 || e + 2 > this.buffer.byteLength)
  34673. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34674. }
  34675. var i = 0;
  34676. return this.littleEndian ? (i = this.view[e],
  34677. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34678. i |= this.view[e + 1]),
  34679. 32768 === (32768 & i) && (i = -(65535 - i + 1)),
  34680. t && (this.offset += 2),
  34681. i
  34682. }
  34683. ,
  34684. a.readShort = a.readInt16,
  34685. a.writeUint16 = function(e, t) {
  34686. var i = "undefined" == typeof t;
  34687. if (i && (t = this.offset),
  34688. !this.noAssert) {
  34689. if ("number" != typeof e || e % 1 !== 0)
  34690. throw TypeError("Illegal value: " + e + " (not an integer)");
  34691. if (e >>>= 0,
  34692. "number" != typeof t || t % 1 !== 0)
  34693. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34694. if (t >>>= 0,
  34695. t < 0 || t + 0 > this.buffer.byteLength)
  34696. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34697. }
  34698. t += 2;
  34699. var n = this.buffer.byteLength;
  34700. return t > n && this.resize((n *= 2) > t ? n : t),
  34701. t -= 2,
  34702. this.littleEndian ? (this.view[t + 1] = (65280 & e) >>> 8,
  34703. this.view[t] = 255 & e) : (this.view[t] = (65280 & e) >>> 8,
  34704. this.view[t + 1] = 255 & e),
  34705. i && (this.offset += 2),
  34706. this
  34707. }
  34708. ,
  34709. a.writeUInt16 = a.writeUint16,
  34710. a.readUint16 = function(e) {
  34711. var t = "undefined" == typeof e;
  34712. if (t && (e = this.offset),
  34713. !this.noAssert) {
  34714. if ("number" != typeof e || e % 1 !== 0)
  34715. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34716. if (e >>>= 0,
  34717. e < 0 || e + 2 > this.buffer.byteLength)
  34718. throw RangeError("Illegal offset: 0 <= " + e + " (+2) <= " + this.buffer.byteLength)
  34719. }
  34720. var i = 0;
  34721. return this.littleEndian ? (i = this.view[e],
  34722. i |= this.view[e + 1] << 8) : (i = this.view[e] << 8,
  34723. i |= this.view[e + 1]),
  34724. t && (this.offset += 2),
  34725. i
  34726. }
  34727. ,
  34728. a.readUInt16 = a.readUint16,
  34729. a.writeInt32 = function(e, t) {
  34730. var i = "undefined" == typeof t;
  34731. if (i && (t = this.offset),
  34732. !this.noAssert) {
  34733. if ("number" != typeof e || e % 1 !== 0)
  34734. throw TypeError("Illegal value: " + e + " (not an integer)");
  34735. if (e |= 0,
  34736. "number" != typeof t || t % 1 !== 0)
  34737. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34738. if (t >>>= 0,
  34739. t < 0 || t + 0 > this.buffer.byteLength)
  34740. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34741. }
  34742. t += 4;
  34743. var n = this.buffer.byteLength;
  34744. return t > n && this.resize((n *= 2) > t ? n : t),
  34745. t -= 4,
  34746. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34747. this.view[t + 2] = e >>> 16 & 255,
  34748. this.view[t + 1] = e >>> 8 & 255,
  34749. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34750. this.view[t + 1] = e >>> 16 & 255,
  34751. this.view[t + 2] = e >>> 8 & 255,
  34752. this.view[t + 3] = 255 & e),
  34753. i && (this.offset += 4),
  34754. this
  34755. }
  34756. ,
  34757. a.writeInt = a.writeInt32,
  34758. a.readInt32 = function(e) {
  34759. var t = "undefined" == typeof e;
  34760. if (t && (e = this.offset),
  34761. !this.noAssert) {
  34762. if ("number" != typeof e || e % 1 !== 0)
  34763. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34764. if (e >>>= 0,
  34765. e < 0 || e + 4 > this.buffer.byteLength)
  34766. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34767. }
  34768. var i = 0;
  34769. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34770. i |= this.view[e + 1] << 8,
  34771. i |= this.view[e],
  34772. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34773. i |= this.view[e + 2] << 8,
  34774. i |= this.view[e + 3],
  34775. i += this.view[e] << 24 >>> 0),
  34776. i |= 0,
  34777. t && (this.offset += 4),
  34778. i
  34779. }
  34780. ,
  34781. a.readInt = a.readInt32,
  34782. a.writeUint32 = function(e, t) {
  34783. var i = "undefined" == typeof t;
  34784. if (i && (t = this.offset),
  34785. !this.noAssert) {
  34786. if ("number" != typeof e || e % 1 !== 0)
  34787. throw TypeError("Illegal value: " + e + " (not an integer)");
  34788. if (e >>>= 0,
  34789. "number" != typeof t || t % 1 !== 0)
  34790. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34791. if (t >>>= 0,
  34792. t < 0 || t + 0 > this.buffer.byteLength)
  34793. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  34794. }
  34795. t += 4;
  34796. var n = this.buffer.byteLength;
  34797. return t > n && this.resize((n *= 2) > t ? n : t),
  34798. t -= 4,
  34799. this.littleEndian ? (this.view[t + 3] = e >>> 24 & 255,
  34800. this.view[t + 2] = e >>> 16 & 255,
  34801. this.view[t + 1] = e >>> 8 & 255,
  34802. this.view[t] = 255 & e) : (this.view[t] = e >>> 24 & 255,
  34803. this.view[t + 1] = e >>> 16 & 255,
  34804. this.view[t + 2] = e >>> 8 & 255,
  34805. this.view[t + 3] = 255 & e),
  34806. i && (this.offset += 4),
  34807. this
  34808. }
  34809. ,
  34810. a.writeUInt32 = a.writeUint32,
  34811. a.readUint32 = function(e) {
  34812. var t = "undefined" == typeof e;
  34813. if (t && (e = this.offset),
  34814. !this.noAssert) {
  34815. if ("number" != typeof e || e % 1 !== 0)
  34816. throw TypeError("Illegal offset: " + e + " (not an integer)");
  34817. if (e >>>= 0,
  34818. e < 0 || e + 4 > this.buffer.byteLength)
  34819. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  34820. }
  34821. var i = 0;
  34822. return this.littleEndian ? (i = this.view[e + 2] << 16,
  34823. i |= this.view[e + 1] << 8,
  34824. i |= this.view[e],
  34825. i += this.view[e + 3] << 24 >>> 0) : (i = this.view[e + 1] << 16,
  34826. i |= this.view[e + 2] << 8,
  34827. i |= this.view[e + 3],
  34828. i += this.view[e] << 24 >>> 0),
  34829. t && (this.offset += 4),
  34830. i
  34831. }
  34832. ,
  34833. a.readUInt32 = a.readUint32,
  34834. e && (a.writeInt64 = function(t, i) {
  34835. var n = "undefined" == typeof i;
  34836. if (n && (i = this.offset),
  34837. !this.noAssert) {
  34838. if ("number" == typeof t)
  34839. t = e.fromNumber(t);
  34840. else if ("string" == typeof t)
  34841. t = e.fromString(t);
  34842. else if (!(t && t instanceof e))
  34843. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  34844. if ("number" != typeof i || i % 1 !== 0)
  34845. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34846. if (i >>>= 0,
  34847. i < 0 || i + 0 > this.buffer.byteLength)
  34848. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  34849. }
  34850. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  34851. i += 8;
  34852. var r = this.buffer.byteLength;
  34853. i > r && this.resize((r *= 2) > i ? r : i),
  34854. i -= 8;
  34855. var o = t.low
  34856. , a = t.high;
  34857. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  34858. this.view[i + 2] = o >>> 16 & 255,
  34859. this.view[i + 1] = o >>> 8 & 255,
  34860. this.view[i] = 255 & o,
  34861. i += 4,
  34862. this.view[i + 3] = a >>> 24 & 255,
  34863. this.view[i + 2] = a >>> 16 & 255,
  34864. this.view[i + 1] = a >>> 8 & 255,
  34865. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  34866. this.view[i + 1] = a >>> 16 & 255,
  34867. this.view[i + 2] = a >>> 8 & 255,
  34868. this.view[i + 3] = 255 & a,
  34869. i += 4,
  34870. this.view[i] = o >>> 24 & 255,
  34871. this.view[i + 1] = o >>> 16 & 255,
  34872. this.view[i + 2] = o >>> 8 & 255,
  34873. this.view[i + 3] = 255 & o),
  34874. n && (this.offset += 8),
  34875. this
  34876. }
  34877. ,
  34878. a.writeLong = a.writeInt64,
  34879. a.readInt64 = function(t) {
  34880. var i = "undefined" == typeof t;
  34881. if (i && (t = this.offset),
  34882. !this.noAssert) {
  34883. if ("number" != typeof t || t % 1 !== 0)
  34884. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34885. if (t >>>= 0,
  34886. t < 0 || t + 8 > this.buffer.byteLength)
  34887. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  34888. }
  34889. var n = 0
  34890. , r = 0;
  34891. this.littleEndian ? (n = this.view[t + 2] << 16,
  34892. n |= this.view[t + 1] << 8,
  34893. n |= this.view[t],
  34894. n += this.view[t + 3] << 24 >>> 0,
  34895. t += 4,
  34896. r = this.view[t + 2] << 16,
  34897. r |= this.view[t + 1] << 8,
  34898. r |= this.view[t],
  34899. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  34900. r |= this.view[t + 2] << 8,
  34901. r |= this.view[t + 3],
  34902. r += this.view[t] << 24 >>> 0,
  34903. t += 4,
  34904. n = this.view[t + 1] << 16,
  34905. n |= this.view[t + 2] << 8,
  34906. n |= this.view[t + 3],
  34907. n += this.view[t] << 24 >>> 0);
  34908. var o = new e(n,r,!1);
  34909. return i && (this.offset += 8),
  34910. o
  34911. }
  34912. ,
  34913. a.readLong = a.readInt64,
  34914. a.writeUint64 = function(t, i) {
  34915. var n = "undefined" == typeof i;
  34916. if (n && (i = this.offset),
  34917. !this.noAssert) {
  34918. if ("number" == typeof t)
  34919. t = e.fromNumber(t);
  34920. else if ("string" == typeof t)
  34921. t = e.fromString(t);
  34922. else if (!(t && t instanceof e))
  34923. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  34924. if ("number" != typeof i || i % 1 !== 0)
  34925. throw TypeError("Illegal offset: " + i + " (not an integer)");
  34926. if (i >>>= 0,
  34927. i < 0 || i + 0 > this.buffer.byteLength)
  34928. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  34929. }
  34930. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t)),
  34931. i += 8;
  34932. var r = this.buffer.byteLength;
  34933. i > r && this.resize((r *= 2) > i ? r : i),
  34934. i -= 8;
  34935. var o = t.low
  34936. , a = t.high;
  34937. return this.littleEndian ? (this.view[i + 3] = o >>> 24 & 255,
  34938. this.view[i + 2] = o >>> 16 & 255,
  34939. this.view[i + 1] = o >>> 8 & 255,
  34940. this.view[i] = 255 & o,
  34941. i += 4,
  34942. this.view[i + 3] = a >>> 24 & 255,
  34943. this.view[i + 2] = a >>> 16 & 255,
  34944. this.view[i + 1] = a >>> 8 & 255,
  34945. this.view[i] = 255 & a) : (this.view[i] = a >>> 24 & 255,
  34946. this.view[i + 1] = a >>> 16 & 255,
  34947. this.view[i + 2] = a >>> 8 & 255,
  34948. this.view[i + 3] = 255 & a,
  34949. i += 4,
  34950. this.view[i] = o >>> 24 & 255,
  34951. this.view[i + 1] = o >>> 16 & 255,
  34952. this.view[i + 2] = o >>> 8 & 255,
  34953. this.view[i + 3] = 255 & o),
  34954. n && (this.offset += 8),
  34955. this
  34956. }
  34957. ,
  34958. a.writeUInt64 = a.writeUint64,
  34959. a.readUint64 = function(t) {
  34960. var i = "undefined" == typeof t;
  34961. if (i && (t = this.offset),
  34962. !this.noAssert) {
  34963. if ("number" != typeof t || t % 1 !== 0)
  34964. throw TypeError("Illegal offset: " + t + " (not an integer)");
  34965. if (t >>>= 0,
  34966. t < 0 || t + 8 > this.buffer.byteLength)
  34967. throw RangeError("Illegal offset: 0 <= " + t + " (+8) <= " + this.buffer.byteLength)
  34968. }
  34969. var n = 0
  34970. , r = 0;
  34971. this.littleEndian ? (n = this.view[t + 2] << 16,
  34972. n |= this.view[t + 1] << 8,
  34973. n |= this.view[t],
  34974. n += this.view[t + 3] << 24 >>> 0,
  34975. t += 4,
  34976. r = this.view[t + 2] << 16,
  34977. r |= this.view[t + 1] << 8,
  34978. r |= this.view[t],
  34979. r += this.view[t + 3] << 24 >>> 0) : (r = this.view[t + 1] << 16,
  34980. r |= this.view[t + 2] << 8,
  34981. r |= this.view[t + 3],
  34982. r += this.view[t] << 24 >>> 0,
  34983. t += 4,
  34984. n = this.view[t + 1] << 16,
  34985. n |= this.view[t + 2] << 8,
  34986. n |= this.view[t + 3],
  34987. n += this.view[t] << 24 >>> 0);
  34988. var o = new e(n,r,!0);
  34989. return i && (this.offset += 8),
  34990. o
  34991. }
  34992. ,
  34993. a.readUInt64 = a.readUint64),
  34994. a.writeFloat32 = function(e, t) {
  34995. var i = "undefined" == typeof t;
  34996. if (i && (t = this.offset),
  34997. !this.noAssert) {
  34998. if ("number" != typeof e)
  34999. throw TypeError("Illegal value: " + e + " (not a number)");
  35000. if ("number" != typeof t || t % 1 !== 0)
  35001. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35002. if (t >>>= 0,
  35003. t < 0 || t + 0 > this.buffer.byteLength)
  35004. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35005. }
  35006. t += 4;
  35007. var n = this.buffer.byteLength;
  35008. return t > n && this.resize((n *= 2) > t ? n : t),
  35009. t -= 4,
  35010. r(this.view, e, t, this.littleEndian, 23, 4),
  35011. i && (this.offset += 4),
  35012. this
  35013. }
  35014. ,
  35015. a.writeFloat = a.writeFloat32,
  35016. a.readFloat32 = function(e) {
  35017. var t = "undefined" == typeof e;
  35018. if (t && (e = this.offset),
  35019. !this.noAssert) {
  35020. if ("number" != typeof e || e % 1 !== 0)
  35021. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35022. if (e >>>= 0,
  35023. e < 0 || e + 4 > this.buffer.byteLength)
  35024. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35025. }
  35026. var i = n(this.view, e, this.littleEndian, 23, 4);
  35027. return t && (this.offset += 4),
  35028. i
  35029. }
  35030. ,
  35031. a.readFloat = a.readFloat32,
  35032. a.writeFloat64 = function(e, t) {
  35033. var i = "undefined" == typeof t;
  35034. if (i && (t = this.offset),
  35035. !this.noAssert) {
  35036. if ("number" != typeof e)
  35037. throw TypeError("Illegal value: " + e + " (not a number)");
  35038. if ("number" != typeof t || t % 1 !== 0)
  35039. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35040. if (t >>>= 0,
  35041. t < 0 || t + 0 > this.buffer.byteLength)
  35042. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35043. }
  35044. t += 8;
  35045. var n = this.buffer.byteLength;
  35046. return t > n && this.resize((n *= 2) > t ? n : t),
  35047. t -= 8,
  35048. r(this.view, e, t, this.littleEndian, 52, 8),
  35049. i && (this.offset += 8),
  35050. this
  35051. }
  35052. ,
  35053. a.writeDouble = a.writeFloat64,
  35054. a.readFloat64 = function(e) {
  35055. var t = "undefined" == typeof e;
  35056. if (t && (e = this.offset),
  35057. !this.noAssert) {
  35058. if ("number" != typeof e || e % 1 !== 0)
  35059. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35060. if (e >>>= 0,
  35061. e < 0 || e + 8 > this.buffer.byteLength)
  35062. throw RangeError("Illegal offset: 0 <= " + e + " (+8) <= " + this.buffer.byteLength)
  35063. }
  35064. var i = n(this.view, e, this.littleEndian, 52, 8);
  35065. return t && (this.offset += 8),
  35066. i
  35067. }
  35068. ,
  35069. a.readDouble = a.readFloat64,
  35070. o.MAX_VARINT32_BYTES = 5,
  35071. o.calculateVarint32 = function(e) {
  35072. return e >>>= 0,
  35073. e < 128 ? 1 : e < 16384 ? 2 : e < 1 << 21 ? 3 : e < 1 << 28 ? 4 : 5
  35074. }
  35075. ,
  35076. o.zigZagEncode32 = function(e) {
  35077. return ((e |= 0) << 1 ^ e >> 31) >>> 0
  35078. }
  35079. ,
  35080. o.zigZagDecode32 = function(e) {
  35081. return e >>> 1 ^ -(1 & e) | 0
  35082. }
  35083. ,
  35084. a.writeVarint32 = function(e, t) {
  35085. var i = "undefined" == typeof t;
  35086. if (i && (t = this.offset),
  35087. !this.noAssert) {
  35088. if ("number" != typeof e || e % 1 !== 0)
  35089. throw TypeError("Illegal value: " + e + " (not an integer)");
  35090. if (e |= 0,
  35091. "number" != typeof t || t % 1 !== 0)
  35092. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35093. if (t >>>= 0,
  35094. t < 0 || t + 0 > this.buffer.byteLength)
  35095. throw RangeError("Illegal offset: 0 <= " + t + " (+0) <= " + this.buffer.byteLength)
  35096. }
  35097. var n, r = o.calculateVarint32(e);
  35098. t += r;
  35099. var a = this.buffer.byteLength;
  35100. for (t > a && this.resize((a *= 2) > t ? a : t),
  35101. t -= r,
  35102. e >>>= 0; e >= 128; )
  35103. n = 127 & e | 128,
  35104. this.view[t++] = n,
  35105. e >>>= 7;
  35106. return this.view[t++] = e,
  35107. i ? (this.offset = t,
  35108. this) : r
  35109. }
  35110. ,
  35111. a.writeVarint32ZigZag = function(e, t) {
  35112. return this.writeVarint32(o.zigZagEncode32(e), t)
  35113. }
  35114. ,
  35115. a.readVarint32 = function(e) {
  35116. var t = "undefined" == typeof e;
  35117. if (t && (e = this.offset),
  35118. !this.noAssert) {
  35119. if ("number" != typeof e || e % 1 !== 0)
  35120. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35121. if (e >>>= 0,
  35122. e < 0 || e + 1 > this.buffer.byteLength)
  35123. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35124. }
  35125. var i, n = 0, r = 0;
  35126. do {
  35127. if (!this.noAssert && e > this.limit) {
  35128. var o = Error("Truncated");
  35129. throw o.truncated = !0,
  35130. o
  35131. }
  35132. i = this.view[e++],
  35133. n < 5 && (r |= (127 & i) << 7 * n),
  35134. ++n
  35135. } while (0 !== (128 & i));return r |= 0,
  35136. t ? (this.offset = e,
  35137. r) : {
  35138. value: r,
  35139. length: n
  35140. }
  35141. }
  35142. ,
  35143. a.readVarint32ZigZag = function(e) {
  35144. var t = this.readVarint32(e);
  35145. return "object" == typeof t ? t.value = o.zigZagDecode32(t.value) : t = o.zigZagDecode32(t),
  35146. t
  35147. }
  35148. ,
  35149. e && (o.MAX_VARINT64_BYTES = 10,
  35150. o.calculateVarint64 = function(t) {
  35151. "number" == typeof t ? t = e.fromNumber(t) : "string" == typeof t && (t = e.fromString(t));
  35152. var i = t.toInt() >>> 0
  35153. , n = t.shiftRightUnsigned(28).toInt() >>> 0
  35154. , r = t.shiftRightUnsigned(56).toInt() >>> 0;
  35155. 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
  35156. }
  35157. ,
  35158. o.zigZagEncode64 = function(t) {
  35159. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35160. t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()
  35161. }
  35162. ,
  35163. o.zigZagDecode64 = function(t) {
  35164. return "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned()),
  35165. t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()
  35166. }
  35167. ,
  35168. a.writeVarint64 = function(t, i) {
  35169. var n = "undefined" == typeof i;
  35170. if (n && (i = this.offset),
  35171. !this.noAssert) {
  35172. if ("number" == typeof t)
  35173. t = e.fromNumber(t);
  35174. else if ("string" == typeof t)
  35175. t = e.fromString(t);
  35176. else if (!(t && t instanceof e))
  35177. throw TypeError("Illegal value: " + t + " (not an integer or Long)");
  35178. if ("number" != typeof i || i % 1 !== 0)
  35179. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35180. if (i >>>= 0,
  35181. i < 0 || i + 0 > this.buffer.byteLength)
  35182. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35183. }
  35184. "number" == typeof t ? t = e.fromNumber(t, !1) : "string" == typeof t ? t = e.fromString(t, !1) : t.unsigned !== !1 && (t = t.toSigned());
  35185. var r = o.calculateVarint64(t)
  35186. , a = t.toInt() >>> 0
  35187. , s = t.shiftRightUnsigned(28).toInt() >>> 0
  35188. , l = t.shiftRightUnsigned(56).toInt() >>> 0;
  35189. i += r;
  35190. var c = this.buffer.byteLength;
  35191. switch (i > c && this.resize((c *= 2) > i ? c : i),
  35192. i -= r,
  35193. r) {
  35194. case 10:
  35195. this.view[i + 9] = l >>> 7 & 1;
  35196. case 9:
  35197. this.view[i + 8] = 9 !== r ? 128 | l : 127 & l;
  35198. case 8:
  35199. this.view[i + 7] = 8 !== r ? s >>> 21 | 128 : s >>> 21 & 127;
  35200. case 7:
  35201. this.view[i + 6] = 7 !== r ? s >>> 14 | 128 : s >>> 14 & 127;
  35202. case 6:
  35203. this.view[i + 5] = 6 !== r ? s >>> 7 | 128 : s >>> 7 & 127;
  35204. case 5:
  35205. this.view[i + 4] = 5 !== r ? 128 | s : 127 & s;
  35206. case 4:
  35207. this.view[i + 3] = 4 !== r ? a >>> 21 | 128 : a >>> 21 & 127;
  35208. case 3:
  35209. this.view[i + 2] = 3 !== r ? a >>> 14 | 128 : a >>> 14 & 127;
  35210. case 2:
  35211. this.view[i + 1] = 2 !== r ? a >>> 7 | 128 : a >>> 7 & 127;
  35212. case 1:
  35213. this.view[i] = 1 !== r ? 128 | a : 127 & a
  35214. }
  35215. return n ? (this.offset += r,
  35216. this) : r
  35217. }
  35218. ,
  35219. a.writeVarint64ZigZag = function(e, t) {
  35220. return this.writeVarint64(o.zigZagEncode64(e), t)
  35221. }
  35222. ,
  35223. a.readVarint64 = function(t) {
  35224. var i = "undefined" == typeof t;
  35225. if (i && (t = this.offset),
  35226. !this.noAssert) {
  35227. if ("number" != typeof t || t % 1 !== 0)
  35228. throw TypeError("Illegal offset: " + t + " (not an integer)");
  35229. if (t >>>= 0,
  35230. t < 0 || t + 1 > this.buffer.byteLength)
  35231. throw RangeError("Illegal offset: 0 <= " + t + " (+1) <= " + this.buffer.byteLength)
  35232. }
  35233. var n = t
  35234. , r = 0
  35235. , o = 0
  35236. , a = 0
  35237. , s = 0;
  35238. if (s = this.view[t++],
  35239. r = 127 & s,
  35240. 128 & s && (s = this.view[t++],
  35241. r |= (127 & s) << 7,
  35242. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35243. r |= (127 & s) << 14,
  35244. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35245. r |= (127 & s) << 21,
  35246. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35247. o = 127 & s,
  35248. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35249. o |= (127 & s) << 7,
  35250. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35251. o |= (127 & s) << 14,
  35252. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35253. o |= (127 & s) << 21,
  35254. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35255. a = 127 & s,
  35256. (128 & s || this.noAssert && "undefined" == typeof s) && (s = this.view[t++],
  35257. a |= (127 & s) << 7,
  35258. 128 & s || this.noAssert && "undefined" == typeof s))))))))))
  35259. throw Error("Buffer overrun");
  35260. var l = e.fromBits(r | o << 28, o >>> 4 | a << 24, !1);
  35261. return i ? (this.offset = t,
  35262. l) : {
  35263. value: l,
  35264. length: t - n
  35265. }
  35266. }
  35267. ,
  35268. a.readVarint64ZigZag = function(t) {
  35269. var i = this.readVarint64(t);
  35270. return i && i.value instanceof e ? i.value = o.zigZagDecode64(i.value) : i = o.zigZagDecode64(i),
  35271. i
  35272. }
  35273. ),
  35274. a.writeCString = function(e, i) {
  35275. var n = "undefined" == typeof i;
  35276. n && (i = this.offset);
  35277. var r, o = e.length;
  35278. if (!this.noAssert) {
  35279. if ("string" != typeof e)
  35280. throw TypeError("Illegal str: Not a string");
  35281. for (r = 0; r < o; ++r)
  35282. if (0 === e.charCodeAt(r))
  35283. throw RangeError("Illegal str: Contains NULL-characters");
  35284. if ("number" != typeof i || i % 1 !== 0)
  35285. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35286. if (i >>>= 0,
  35287. i < 0 || i + 0 > this.buffer.byteLength)
  35288. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35289. }
  35290. o = h.calculateUTF16asUTF8(t(e))[1],
  35291. i += o + 1;
  35292. var a = this.buffer.byteLength;
  35293. return i > a && this.resize((a *= 2) > i ? a : i),
  35294. i -= o + 1,
  35295. h.encodeUTF16toUTF8(t(e), function(e) {
  35296. this.view[i++] = e
  35297. }
  35298. .bind(this)),
  35299. this.view[i++] = 0,
  35300. n ? (this.offset = i,
  35301. this) : o
  35302. }
  35303. ,
  35304. a.readCString = function(e) {
  35305. var t = "undefined" == typeof e;
  35306. if (t && (e = this.offset),
  35307. !this.noAssert) {
  35308. if ("number" != typeof e || e % 1 !== 0)
  35309. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35310. if (e >>>= 0,
  35311. e < 0 || e + 1 > this.buffer.byteLength)
  35312. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35313. }
  35314. var n, r = e, o = -1;
  35315. return h.decodeUTF8toUTF16(function() {
  35316. if (0 === o)
  35317. return null;
  35318. if (e >= this.limit)
  35319. throw RangeError("Illegal range: Truncated data, " + e + " < " + this.limit);
  35320. return o = this.view[e++],
  35321. 0 === o ? null : o
  35322. }
  35323. .bind(this), n = i(), !0),
  35324. t ? (this.offset = e,
  35325. n()) : {
  35326. string: n(),
  35327. length: e - r
  35328. }
  35329. }
  35330. ,
  35331. a.writeIString = function(e, i) {
  35332. var n = "undefined" == typeof i;
  35333. if (n && (i = this.offset),
  35334. !this.noAssert) {
  35335. if ("string" != typeof e)
  35336. throw TypeError("Illegal str: Not a string");
  35337. if ("number" != typeof i || i % 1 !== 0)
  35338. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35339. if (i >>>= 0,
  35340. i < 0 || i + 0 > this.buffer.byteLength)
  35341. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35342. }
  35343. var r, o = i;
  35344. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35345. i += 4 + r;
  35346. var a = this.buffer.byteLength;
  35347. if (i > a && this.resize((a *= 2) > i ? a : i),
  35348. i -= 4 + r,
  35349. this.littleEndian ? (this.view[i + 3] = r >>> 24 & 255,
  35350. this.view[i + 2] = r >>> 16 & 255,
  35351. this.view[i + 1] = r >>> 8 & 255,
  35352. this.view[i] = 255 & r) : (this.view[i] = r >>> 24 & 255,
  35353. this.view[i + 1] = r >>> 16 & 255,
  35354. this.view[i + 2] = r >>> 8 & 255,
  35355. this.view[i + 3] = 255 & r),
  35356. i += 4,
  35357. h.encodeUTF16toUTF8(t(e), function(e) {
  35358. this.view[i++] = e
  35359. }
  35360. .bind(this)),
  35361. i !== o + 4 + r)
  35362. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + 4 + r));
  35363. return n ? (this.offset = i,
  35364. this) : i - o
  35365. }
  35366. ,
  35367. a.readIString = function(e) {
  35368. var t = "undefined" == typeof e;
  35369. if (t && (e = this.offset),
  35370. !this.noAssert) {
  35371. if ("number" != typeof e || e % 1 !== 0)
  35372. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35373. if (e >>>= 0,
  35374. e < 0 || e + 4 > this.buffer.byteLength)
  35375. throw RangeError("Illegal offset: 0 <= " + e + " (+4) <= " + this.buffer.byteLength)
  35376. }
  35377. var i = e
  35378. , n = this.readUint32(e)
  35379. , r = this.readUTF8String(n, o.METRICS_BYTES, e += 4);
  35380. return e += r.length,
  35381. t ? (this.offset = e,
  35382. r.string) : {
  35383. string: r.string,
  35384. length: e - i
  35385. }
  35386. }
  35387. ,
  35388. o.METRICS_CHARS = "c",
  35389. o.METRICS_BYTES = "b",
  35390. a.writeUTF8String = function(e, i) {
  35391. var n = "undefined" == typeof i;
  35392. if (n && (i = this.offset),
  35393. !this.noAssert) {
  35394. if ("number" != typeof i || i % 1 !== 0)
  35395. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35396. if (i >>>= 0,
  35397. i < 0 || i + 0 > this.buffer.byteLength)
  35398. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35399. }
  35400. var r, o = i;
  35401. r = h.calculateUTF16asUTF8(t(e))[1],
  35402. i += r;
  35403. var a = this.buffer.byteLength;
  35404. return i > a && this.resize((a *= 2) > i ? a : i),
  35405. i -= r,
  35406. h.encodeUTF16toUTF8(t(e), function(e) {
  35407. this.view[i++] = e
  35408. }
  35409. .bind(this)),
  35410. n ? (this.offset = i,
  35411. this) : i - o
  35412. }
  35413. ,
  35414. a.writeString = a.writeUTF8String,
  35415. o.calculateUTF8Chars = function(e) {
  35416. return h.calculateUTF16asUTF8(t(e))[0]
  35417. }
  35418. ,
  35419. o.calculateUTF8Bytes = function(e) {
  35420. return h.calculateUTF16asUTF8(t(e))[1]
  35421. }
  35422. ,
  35423. o.calculateString = o.calculateUTF8Bytes,
  35424. a.readUTF8String = function(e, t, n) {
  35425. "number" == typeof t && (n = t,
  35426. t = void 0);
  35427. var r = "undefined" == typeof n;
  35428. if (r && (n = this.offset),
  35429. "undefined" == typeof t && (t = o.METRICS_CHARS),
  35430. !this.noAssert) {
  35431. if ("number" != typeof e || e % 1 !== 0)
  35432. throw TypeError("Illegal length: " + e + " (not an integer)");
  35433. if (e |= 0,
  35434. "number" != typeof n || n % 1 !== 0)
  35435. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35436. if (n >>>= 0,
  35437. n < 0 || n + 0 > this.buffer.byteLength)
  35438. throw RangeError("Illegal offset: 0 <= " + n + " (+0) <= " + this.buffer.byteLength)
  35439. }
  35440. var a, s = 0, l = n;
  35441. if (t === o.METRICS_CHARS) {
  35442. if (a = i(),
  35443. h.decodeUTF8(function() {
  35444. return s < e && n < this.limit ? this.view[n++] : null
  35445. }
  35446. .bind(this), function(e) {
  35447. ++s,
  35448. h.UTF8toUTF16(e, a)
  35449. }),
  35450. s !== e)
  35451. throw RangeError("Illegal range: Truncated data, " + s + " == " + e);
  35452. return r ? (this.offset = n,
  35453. a()) : {
  35454. string: a(),
  35455. length: n - l
  35456. }
  35457. }
  35458. if (t === o.METRICS_BYTES) {
  35459. if (!this.noAssert) {
  35460. if ("number" != typeof n || n % 1 !== 0)
  35461. throw TypeError("Illegal offset: " + n + " (not an integer)");
  35462. if (n >>>= 0,
  35463. n < 0 || n + e > this.buffer.byteLength)
  35464. throw RangeError("Illegal offset: 0 <= " + n + " (+" + e + ") <= " + this.buffer.byteLength)
  35465. }
  35466. var c = n + e;
  35467. if (h.decodeUTF8toUTF16(function() {
  35468. return n < c ? this.view[n++] : null
  35469. }
  35470. .bind(this), a = i(), this.noAssert),
  35471. n !== c)
  35472. throw RangeError("Illegal range: Truncated data, " + n + " == " + c);
  35473. return r ? (this.offset = n,
  35474. a()) : {
  35475. string: a(),
  35476. length: n - l
  35477. }
  35478. }
  35479. throw TypeError("Unsupported metrics: " + t)
  35480. }
  35481. ,
  35482. a.readString = a.readUTF8String,
  35483. a.writeVString = function(e, i) {
  35484. var n = "undefined" == typeof i;
  35485. if (n && (i = this.offset),
  35486. !this.noAssert) {
  35487. if ("string" != typeof e)
  35488. throw TypeError("Illegal str: Not a string");
  35489. if ("number" != typeof i || i % 1 !== 0)
  35490. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35491. if (i >>>= 0,
  35492. i < 0 || i + 0 > this.buffer.byteLength)
  35493. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35494. }
  35495. var r, a, s = i;
  35496. r = h.calculateUTF16asUTF8(t(e), this.noAssert)[1],
  35497. a = o.calculateVarint32(r),
  35498. i += a + r;
  35499. var l = this.buffer.byteLength;
  35500. if (i > l && this.resize((l *= 2) > i ? l : i),
  35501. i -= a + r,
  35502. i += this.writeVarint32(r, i),
  35503. h.encodeUTF16toUTF8(t(e), function(e) {
  35504. this.view[i++] = e
  35505. }
  35506. .bind(this)),
  35507. i !== s + r + a)
  35508. throw RangeError("Illegal range: Truncated data, " + i + " == " + (i + r + a));
  35509. return n ? (this.offset = i,
  35510. this) : i - s
  35511. }
  35512. ,
  35513. a.readVString = function(e) {
  35514. var t = "undefined" == typeof e;
  35515. if (t && (e = this.offset),
  35516. !this.noAssert) {
  35517. if ("number" != typeof e || e % 1 !== 0)
  35518. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35519. if (e >>>= 0,
  35520. e < 0 || e + 1 > this.buffer.byteLength)
  35521. throw RangeError("Illegal offset: 0 <= " + e + " (+1) <= " + this.buffer.byteLength)
  35522. }
  35523. var i = e
  35524. , n = this.readVarint32(e)
  35525. , r = this.readUTF8String(n.value, o.METRICS_BYTES, e += n.length);
  35526. return e += r.length,
  35527. t ? (this.offset = e,
  35528. r.string) : {
  35529. string: r.string,
  35530. length: e - i
  35531. }
  35532. }
  35533. ,
  35534. a.append = function(e, t, i) {
  35535. "number" != typeof t && "string" == typeof t || (i = t,
  35536. t = void 0);
  35537. var n = "undefined" == typeof i;
  35538. if (n && (i = this.offset),
  35539. !this.noAssert) {
  35540. if ("number" != typeof i || i % 1 !== 0)
  35541. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35542. if (i >>>= 0,
  35543. i < 0 || i + 0 > this.buffer.byteLength)
  35544. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35545. }
  35546. e instanceof o || (e = o.wrap(e, t));
  35547. var r = e.limit - e.offset;
  35548. if (r <= 0)
  35549. return this;
  35550. i += r;
  35551. var a = this.buffer.byteLength;
  35552. return i > a && this.resize((a *= 2) > i ? a : i),
  35553. i -= r,
  35554. this.view.set(e.view.subarray(e.offset, e.limit), i),
  35555. e.offset += r,
  35556. n && (this.offset += r),
  35557. this
  35558. }
  35559. ,
  35560. a.appendTo = function(e, t) {
  35561. return e.append(this, t),
  35562. this
  35563. }
  35564. ,
  35565. a.assert = function(e) {
  35566. return this.noAssert = !e,
  35567. this
  35568. }
  35569. ,
  35570. a.capacity = function() {
  35571. return this.buffer.byteLength
  35572. }
  35573. ,
  35574. a.clear = function() {
  35575. return this.offset = 0,
  35576. this.limit = this.buffer.byteLength,
  35577. this.markedOffset = -1,
  35578. this
  35579. }
  35580. ,
  35581. a.clone = function(e) {
  35582. var t = new o(0,this.littleEndian,this.noAssert);
  35583. return e ? (t.buffer = new ArrayBuffer(this.buffer.byteLength),
  35584. t.view = new Uint8Array(t.buffer)) : (t.buffer = this.buffer,
  35585. t.view = this.view),
  35586. t.offset = this.offset,
  35587. t.markedOffset = this.markedOffset,
  35588. t.limit = this.limit,
  35589. t
  35590. }
  35591. ,
  35592. a.compact = function(e, t) {
  35593. if ("undefined" == typeof e && (e = this.offset),
  35594. "undefined" == typeof t && (t = this.limit),
  35595. !this.noAssert) {
  35596. if ("number" != typeof e || e % 1 !== 0)
  35597. throw TypeError("Illegal begin: Not an integer");
  35598. if (e >>>= 0,
  35599. "number" != typeof t || t % 1 !== 0)
  35600. throw TypeError("Illegal end: Not an integer");
  35601. if (t >>>= 0,
  35602. e < 0 || e > t || t > this.buffer.byteLength)
  35603. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35604. }
  35605. if (0 === e && t === this.buffer.byteLength)
  35606. return this;
  35607. var i = t - e;
  35608. if (0 === i)
  35609. return this.buffer = s,
  35610. this.view = null,
  35611. this.markedOffset >= 0 && (this.markedOffset -= e),
  35612. this.offset = 0,
  35613. this.limit = 0,
  35614. this;
  35615. var n = new ArrayBuffer(i)
  35616. , r = new Uint8Array(n);
  35617. return r.set(this.view.subarray(e, t)),
  35618. this.buffer = n,
  35619. this.view = r,
  35620. this.markedOffset >= 0 && (this.markedOffset -= e),
  35621. this.offset = 0,
  35622. this.limit = i,
  35623. this
  35624. }
  35625. ,
  35626. a.copy = function(e, t) {
  35627. if ("undefined" == typeof e && (e = this.offset),
  35628. "undefined" == typeof t && (t = this.limit),
  35629. !this.noAssert) {
  35630. if ("number" != typeof e || e % 1 !== 0)
  35631. throw TypeError("Illegal begin: Not an integer");
  35632. if (e >>>= 0,
  35633. "number" != typeof t || t % 1 !== 0)
  35634. throw TypeError("Illegal end: Not an integer");
  35635. if (t >>>= 0,
  35636. e < 0 || e > t || t > this.buffer.byteLength)
  35637. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35638. }
  35639. if (e === t)
  35640. return new o(0,this.littleEndian,this.noAssert);
  35641. var i = t - e
  35642. , n = new o(i,this.littleEndian,this.noAssert);
  35643. return n.offset = 0,
  35644. n.limit = i,
  35645. n.markedOffset >= 0 && (n.markedOffset -= e),
  35646. this.copyTo(n, 0, e, t),
  35647. n
  35648. }
  35649. ,
  35650. a.copyTo = function(e, t, i, n) {
  35651. var r, a;
  35652. if (!this.noAssert && !o.isByteBuffer(e))
  35653. throw TypeError("Illegal target: Not a ByteBuffer");
  35654. if (t = (a = "undefined" == typeof t) ? e.offset : 0 | t,
  35655. i = (r = "undefined" == typeof i) ? this.offset : 0 | i,
  35656. n = "undefined" == typeof n ? this.limit : 0 | n,
  35657. t < 0 || t > e.buffer.byteLength)
  35658. throw RangeError("Illegal target range: 0 <= " + t + " <= " + e.buffer.byteLength);
  35659. if (i < 0 || n > this.buffer.byteLength)
  35660. throw RangeError("Illegal source range: 0 <= " + i + " <= " + this.buffer.byteLength);
  35661. var s = n - i;
  35662. return 0 === s ? e : (e.ensureCapacity(t + s),
  35663. e.view.set(this.view.subarray(i, n), t),
  35664. r && (this.offset += s),
  35665. a && (e.offset += s),
  35666. this)
  35667. }
  35668. ,
  35669. a.ensureCapacity = function(e) {
  35670. var t = this.buffer.byteLength;
  35671. return t < e ? this.resize((t *= 2) > e ? t : e) : this
  35672. }
  35673. ,
  35674. a.fill = function(e, t, i) {
  35675. var n = "undefined" == typeof t;
  35676. if (n && (t = this.offset),
  35677. "string" == typeof e && e.length > 0 && (e = e.charCodeAt(0)),
  35678. "undefined" == typeof t && (t = this.offset),
  35679. "undefined" == typeof i && (i = this.limit),
  35680. !this.noAssert) {
  35681. if ("number" != typeof e || e % 1 !== 0)
  35682. throw TypeError("Illegal value: " + e + " (not an integer)");
  35683. if (e |= 0,
  35684. "number" != typeof t || t % 1 !== 0)
  35685. throw TypeError("Illegal begin: Not an integer");
  35686. if (t >>>= 0,
  35687. "number" != typeof i || i % 1 !== 0)
  35688. throw TypeError("Illegal end: Not an integer");
  35689. if (i >>>= 0,
  35690. t < 0 || t > i || i > this.buffer.byteLength)
  35691. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35692. }
  35693. if (t >= i)
  35694. return this;
  35695. for (; t < i; )
  35696. this.view[t++] = e;
  35697. return n && (this.offset = t),
  35698. this
  35699. }
  35700. ,
  35701. a.flip = function() {
  35702. return this.limit = this.offset,
  35703. this.offset = 0,
  35704. this
  35705. }
  35706. ,
  35707. a.mark = function(e) {
  35708. if (e = "undefined" == typeof e ? this.offset : e,
  35709. !this.noAssert) {
  35710. if ("number" != typeof e || e % 1 !== 0)
  35711. throw TypeError("Illegal offset: " + e + " (not an integer)");
  35712. if (e >>>= 0,
  35713. e < 0 || e + 0 > this.buffer.byteLength)
  35714. throw RangeError("Illegal offset: 0 <= " + e + " (+0) <= " + this.buffer.byteLength)
  35715. }
  35716. return this.markedOffset = e,
  35717. this
  35718. }
  35719. ,
  35720. a.order = function(e) {
  35721. if (!this.noAssert && "boolean" != typeof e)
  35722. throw TypeError("Illegal littleEndian: Not a boolean");
  35723. return this.littleEndian = !!e,
  35724. this
  35725. }
  35726. ,
  35727. a.LE = function(e) {
  35728. return this.littleEndian = "undefined" == typeof e || !!e,
  35729. this
  35730. }
  35731. ,
  35732. a.BE = function(e) {
  35733. return this.littleEndian = "undefined" != typeof e && !e,
  35734. this
  35735. }
  35736. ,
  35737. a.prepend = function(e, t, i) {
  35738. "number" != typeof t && "string" == typeof t || (i = t,
  35739. t = void 0);
  35740. var n = "undefined" == typeof i;
  35741. if (n && (i = this.offset),
  35742. !this.noAssert) {
  35743. if ("number" != typeof i || i % 1 !== 0)
  35744. throw TypeError("Illegal offset: " + i + " (not an integer)");
  35745. if (i >>>= 0,
  35746. i < 0 || i + 0 > this.buffer.byteLength)
  35747. throw RangeError("Illegal offset: 0 <= " + i + " (+0) <= " + this.buffer.byteLength)
  35748. }
  35749. e instanceof o || (e = o.wrap(e, t));
  35750. var r = e.limit - e.offset;
  35751. if (r <= 0)
  35752. return this;
  35753. var a = r - i;
  35754. if (a > 0) {
  35755. var s = new ArrayBuffer(this.buffer.byteLength + a)
  35756. , l = new Uint8Array(s);
  35757. l.set(this.view.subarray(i, this.buffer.byteLength), r),
  35758. this.buffer = s,
  35759. this.view = l,
  35760. this.offset += a,
  35761. this.markedOffset >= 0 && (this.markedOffset += a),
  35762. this.limit += a,
  35763. i += a
  35764. } else {
  35765. new Uint8Array(this.buffer)
  35766. }
  35767. return this.view.set(e.view.subarray(e.offset, e.limit), i - r),
  35768. e.offset = e.limit,
  35769. n && (this.offset -= r),
  35770. this
  35771. }
  35772. ,
  35773. a.prependTo = function(e, t) {
  35774. return e.prepend(this, t),
  35775. this
  35776. }
  35777. ,
  35778. a.printDebug = function(e) {
  35779. "function" != typeof e && (e = console.log.bind(console)),
  35780. e(this.toString() + "\n-------------------------------------------------------------------\n" + this.toDebug(!0))
  35781. }
  35782. ,
  35783. a.remaining = function() {
  35784. return this.limit - this.offset
  35785. }
  35786. ,
  35787. a.reset = function() {
  35788. return this.markedOffset >= 0 ? (this.offset = this.markedOffset,
  35789. this.markedOffset = -1) : this.offset = 0,
  35790. this
  35791. }
  35792. ,
  35793. a.resize = function(e) {
  35794. if (!this.noAssert) {
  35795. if ("number" != typeof e || e % 1 !== 0)
  35796. throw TypeError("Illegal capacity: " + e + " (not an integer)");
  35797. if (e |= 0,
  35798. e < 0)
  35799. throw RangeError("Illegal capacity: 0 <= " + e)
  35800. }
  35801. if (this.buffer.byteLength < e) {
  35802. var t = new ArrayBuffer(e)
  35803. , i = new Uint8Array(t);
  35804. i.set(this.view),
  35805. this.buffer = t,
  35806. this.view = i
  35807. }
  35808. return this
  35809. }
  35810. ,
  35811. a.reverse = function(e, t) {
  35812. if ("undefined" == typeof e && (e = this.offset),
  35813. "undefined" == typeof t && (t = this.limit),
  35814. !this.noAssert) {
  35815. if ("number" != typeof e || e % 1 !== 0)
  35816. throw TypeError("Illegal begin: Not an integer");
  35817. if (e >>>= 0,
  35818. "number" != typeof t || t % 1 !== 0)
  35819. throw TypeError("Illegal end: Not an integer");
  35820. if (t >>>= 0,
  35821. e < 0 || e > t || t > this.buffer.byteLength)
  35822. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35823. }
  35824. return e === t ? this : (Array.prototype.reverse.call(this.view.subarray(e, t)),
  35825. this)
  35826. }
  35827. ,
  35828. a.skip = function(e) {
  35829. if (!this.noAssert) {
  35830. if ("number" != typeof e || e % 1 !== 0)
  35831. throw TypeError("Illegal length: " + e + " (not an integer)");
  35832. e |= 0
  35833. }
  35834. var t = this.offset + e;
  35835. if (!this.noAssert && (t < 0 || t > this.buffer.byteLength))
  35836. throw RangeError("Illegal length: 0 <= " + this.offset + " + " + e + " <= " + this.buffer.byteLength);
  35837. return this.offset = t,
  35838. this
  35839. }
  35840. ,
  35841. a.slice = function(e, t) {
  35842. if ("undefined" == typeof e && (e = this.offset),
  35843. "undefined" == typeof t && (t = this.limit),
  35844. !this.noAssert) {
  35845. if ("number" != typeof e || e % 1 !== 0)
  35846. throw TypeError("Illegal begin: Not an integer");
  35847. if (e >>>= 0,
  35848. "number" != typeof t || t % 1 !== 0)
  35849. throw TypeError("Illegal end: Not an integer");
  35850. if (t >>>= 0,
  35851. e < 0 || e > t || t > this.buffer.byteLength)
  35852. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  35853. }
  35854. var i = this.clone();
  35855. return i.offset = e,
  35856. i.limit = t,
  35857. i
  35858. }
  35859. ,
  35860. a.toBuffer = function(e) {
  35861. var t = this.offset
  35862. , i = this.limit;
  35863. if (!this.noAssert) {
  35864. if ("number" != typeof t || t % 1 !== 0)
  35865. throw TypeError("Illegal offset: Not an integer");
  35866. if (t >>>= 0,
  35867. "number" != typeof i || i % 1 !== 0)
  35868. throw TypeError("Illegal limit: Not an integer");
  35869. if (i >>>= 0,
  35870. t < 0 || t > i || i > this.buffer.byteLength)
  35871. throw RangeError("Illegal range: 0 <= " + t + " <= " + i + " <= " + this.buffer.byteLength)
  35872. }
  35873. if (!e && 0 === t && i === this.buffer.byteLength)
  35874. return this.buffer;
  35875. if (t === i)
  35876. return s;
  35877. var n = new ArrayBuffer(i - t);
  35878. return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t, i), 0),
  35879. n
  35880. }
  35881. ,
  35882. a.toArrayBuffer = a.toBuffer,
  35883. a.toString = function(e, t, i) {
  35884. if ("undefined" == typeof e)
  35885. return "ByteBufferAB(offset=" + this.offset + ",markedOffset=" + this.markedOffset + ",limit=" + this.limit + ",capacity=" + this.capacity() + ")";
  35886. switch ("number" == typeof e && (e = "utf8",
  35887. t = e,
  35888. i = t),
  35889. e) {
  35890. case "utf8":
  35891. return this.toUTF8(t, i);
  35892. case "base64":
  35893. return this.toBase64(t, i);
  35894. case "hex":
  35895. return this.toHex(t, i);
  35896. case "binary":
  35897. return this.toBinary(t, i);
  35898. case "debug":
  35899. return this.toDebug();
  35900. case "columns":
  35901. return this.toColumns();
  35902. default:
  35903. throw Error("Unsupported encoding: " + e)
  35904. }
  35905. }
  35906. ;
  35907. var c = function() {
  35908. for (var e = {}, t = [65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47], i = [], n = 0, r = t.length; n < r; ++n)
  35909. i[t[n]] = n;
  35910. return e.encode = function(e, i) {
  35911. for (var n, r; null !== (n = e()); )
  35912. i(t[n >> 2 & 63]),
  35913. r = (3 & n) << 4,
  35914. null !== (n = e()) ? (r |= n >> 4 & 15,
  35915. i(t[63 & (r | n >> 4 & 15)]),
  35916. r = (15 & n) << 2,
  35917. null !== (n = e()) ? (i(t[63 & (r | n >> 6 & 3)]),
  35918. i(t[63 & n])) : (i(t[63 & r]),
  35919. i(61))) : (i(t[63 & r]),
  35920. i(61),
  35921. i(61))
  35922. }
  35923. ,
  35924. e.decode = function(e, t) {
  35925. function n(e) {
  35926. throw Error("Illegal character code: " + e)
  35927. }
  35928. for (var r, o, a; null !== (r = e()); )
  35929. if (o = i[r],
  35930. "undefined" == typeof o && n(r),
  35931. null !== (r = e()) && (a = i[r],
  35932. "undefined" == typeof a && n(r),
  35933. t(o << 2 >>> 0 | (48 & a) >> 4),
  35934. null !== (r = e()))) {
  35935. if (o = i[r],
  35936. "undefined" == typeof o) {
  35937. if (61 === r)
  35938. break;
  35939. n(r)
  35940. }
  35941. if (t((15 & a) << 4 >>> 0 | (60 & o) >> 2),
  35942. null !== (r = e())) {
  35943. if (a = i[r],
  35944. "undefined" == typeof a) {
  35945. if (61 === r)
  35946. break;
  35947. n(r)
  35948. }
  35949. t((3 & o) << 6 >>> 0 | a)
  35950. }
  35951. }
  35952. }
  35953. ,
  35954. e.test = function(e) {
  35955. return /^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)
  35956. }
  35957. ,
  35958. e
  35959. }();
  35960. a.toBase64 = function(e, t) {
  35961. if ("undefined" == typeof e && (e = this.offset),
  35962. "undefined" == typeof t && (t = this.limit),
  35963. e |= 0,
  35964. t |= 0,
  35965. e < 0 || t > this.capacity || e > t)
  35966. throw RangeError("begin, end");
  35967. var n;
  35968. return c.encode(function() {
  35969. return e < t ? this.view[e++] : null
  35970. }
  35971. .bind(this), n = i()),
  35972. n()
  35973. }
  35974. ,
  35975. o.fromBase64 = function(e, i) {
  35976. if ("string" != typeof e)
  35977. throw TypeError("str");
  35978. var n = new o(e.length / 4 * 3,i)
  35979. , r = 0;
  35980. return c.decode(t(e), function(e) {
  35981. n.view[r++] = e
  35982. }),
  35983. n.limit = r,
  35984. n
  35985. }
  35986. ,
  35987. o.btoa = function(e) {
  35988. return o.fromBinary(e).toBase64()
  35989. }
  35990. ,
  35991. o.atob = function(e) {
  35992. return o.fromBase64(e).toBinary()
  35993. }
  35994. ,
  35995. a.toBinary = function(e, t) {
  35996. if ("undefined" == typeof e && (e = this.offset),
  35997. "undefined" == typeof t && (t = this.limit),
  35998. e |= 0,
  35999. t |= 0,
  36000. e < 0 || t > this.capacity() || e > t)
  36001. throw RangeError("begin, end");
  36002. if (e === t)
  36003. return "";
  36004. for (var i = [], n = []; e < t; )
  36005. i.push(this.view[e++]),
  36006. i.length >= 1024 && (n.push(String.fromCharCode.apply(String, i)),
  36007. i = []);
  36008. return n.join("") + String.fromCharCode.apply(String, i)
  36009. }
  36010. ,
  36011. o.fromBinary = function(e, t) {
  36012. if ("string" != typeof e)
  36013. throw TypeError("str");
  36014. for (var i, n = 0, r = e.length, a = new o(r,t); n < r; ) {
  36015. if (i = e.charCodeAt(n),
  36016. i > 255)
  36017. throw RangeError("illegal char code: " + i);
  36018. a.view[n++] = i
  36019. }
  36020. return a.limit = r,
  36021. a
  36022. }
  36023. ,
  36024. a.toDebug = function(e) {
  36025. for (var t, i = -1, n = this.buffer.byteLength, r = "", o = "", a = ""; i < n; ) {
  36026. if (i !== -1 && (t = this.view[i],
  36027. r += t < 16 ? "0" + t.toString(16).toUpperCase() : t.toString(16).toUpperCase(),
  36028. e && (o += t > 32 && t < 127 ? String.fromCharCode(t) : ".")),
  36029. ++i,
  36030. e && i > 0 && i % 16 === 0 && i !== n) {
  36031. for (; r.length < 51; )
  36032. r += " ";
  36033. a += r + o + "\n",
  36034. r = o = ""
  36035. }
  36036. r += i === this.offset && i === this.limit ? i === this.markedOffset ? "!" : "|" : i === this.offset ? i === this.markedOffset ? "[" : "<" : i === this.limit ? i === this.markedOffset ? "]" : ">" : i === this.markedOffset ? "'" : e || 0 !== i && i !== n ? " " : ""
  36037. }
  36038. if (e && " " !== r) {
  36039. for (; r.length < 51; )
  36040. r += " ";
  36041. a += r + o + "\n"
  36042. }
  36043. return e ? a : r
  36044. }
  36045. ,
  36046. o.fromDebug = function(e, t, i) {
  36047. 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; ) {
  36048. switch (n = e.charAt(l++)) {
  36049. case "!":
  36050. if (!i) {
  36051. if (u || d || p) {
  36052. f = !0;
  36053. break
  36054. }
  36055. u = d = p = !0
  36056. }
  36057. s.offset = s.markedOffset = s.limit = c,
  36058. h = !1;
  36059. break;
  36060. case "|":
  36061. if (!i) {
  36062. if (u || p) {
  36063. f = !0;
  36064. break
  36065. }
  36066. u = p = !0
  36067. }
  36068. s.offset = s.limit = c,
  36069. h = !1;
  36070. break;
  36071. case "[":
  36072. if (!i) {
  36073. if (u || d) {
  36074. f = !0;
  36075. break
  36076. }
  36077. u = d = !0
  36078. }
  36079. s.offset = s.markedOffset = c,
  36080. h = !1;
  36081. break;
  36082. case "<":
  36083. if (!i) {
  36084. if (u) {
  36085. f = !0;
  36086. break
  36087. }
  36088. u = !0
  36089. }
  36090. s.offset = c,
  36091. h = !1;
  36092. break;
  36093. case "]":
  36094. if (!i) {
  36095. if (p || d) {
  36096. f = !0;
  36097. break
  36098. }
  36099. p = d = !0
  36100. }
  36101. s.limit = s.markedOffset = c,
  36102. h = !1;
  36103. break;
  36104. case ">":
  36105. if (!i) {
  36106. if (p) {
  36107. f = !0;
  36108. break
  36109. }
  36110. p = !0
  36111. }
  36112. s.limit = c,
  36113. h = !1;
  36114. break;
  36115. case "'":
  36116. if (!i) {
  36117. if (d) {
  36118. f = !0;
  36119. break
  36120. }
  36121. d = !0
  36122. }
  36123. s.markedOffset = c,
  36124. h = !1;
  36125. break;
  36126. case " ":
  36127. h = !1;
  36128. break;
  36129. default:
  36130. if (!i && h) {
  36131. f = !0;
  36132. break
  36133. }
  36134. if (r = parseInt(n + e.charAt(l++), 16),
  36135. !i && (isNaN(r) || r < 0 || r > 255))
  36136. throw TypeError("Illegal str: Not a debug encoded string");
  36137. s.view[c++] = r,
  36138. h = !0
  36139. }
  36140. if (f)
  36141. throw TypeError("Illegal str: Invalid symbol at " + l)
  36142. }
  36143. if (!i) {
  36144. if (!u || !p)
  36145. throw TypeError("Illegal str: Missing offset or limit");
  36146. if (c < s.buffer.byteLength)
  36147. throw TypeError("Illegal str: Not a debug encoded string (is it hex?) " + c + " < " + a)
  36148. }
  36149. return s
  36150. }
  36151. ,
  36152. a.toHex = function(e, t) {
  36153. if (e = "undefined" == typeof e ? this.offset : e,
  36154. t = "undefined" == typeof t ? this.limit : t,
  36155. !this.noAssert) {
  36156. if ("number" != typeof e || e % 1 !== 0)
  36157. throw TypeError("Illegal begin: Not an integer");
  36158. if (e >>>= 0,
  36159. "number" != typeof t || t % 1 !== 0)
  36160. throw TypeError("Illegal end: Not an integer");
  36161. if (t >>>= 0,
  36162. e < 0 || e > t || t > this.buffer.byteLength)
  36163. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36164. }
  36165. for (var i, n = new Array(t - e); e < t; )
  36166. i = this.view[e++],
  36167. i < 16 ? n.push("0", i.toString(16)) : n.push(i.toString(16));
  36168. return n.join("")
  36169. }
  36170. ,
  36171. o.fromHex = function(e, t, i) {
  36172. if (!i) {
  36173. if ("string" != typeof e)
  36174. throw TypeError("Illegal str: Not a string");
  36175. if (e.length % 2 !== 0)
  36176. throw TypeError("Illegal str: Length not a multiple of 2")
  36177. }
  36178. for (var n, r = e.length, a = new o(r / 2 | 0,t), s = 0, l = 0; s < r; s += 2) {
  36179. if (n = parseInt(e.substring(s, s + 2), 16),
  36180. !i && (!isFinite(n) || n < 0 || n > 255))
  36181. throw TypeError("Illegal str: Contains non-hex characters");
  36182. a.view[l++] = n
  36183. }
  36184. return a.limit = l,
  36185. a
  36186. }
  36187. ;
  36188. var h = function() {
  36189. var e = {};
  36190. return e.MAX_CODEPOINT = 1114111,
  36191. e.encodeUTF8 = function(e, t) {
  36192. var i = null;
  36193. for ("number" == typeof e && (i = e,
  36194. e = function() {
  36195. return null
  36196. }
  36197. ); null !== i || null !== (i = e()); )
  36198. i < 128 ? t(127 & i) : i < 2048 ? (t(i >> 6 & 31 | 192),
  36199. t(63 & i | 128)) : i < 65536 ? (t(i >> 12 & 15 | 224),
  36200. t(i >> 6 & 63 | 128),
  36201. t(63 & i | 128)) : (t(i >> 18 & 7 | 240),
  36202. t(i >> 12 & 63 | 128),
  36203. t(i >> 6 & 63 | 128),
  36204. t(63 & i | 128)),
  36205. i = null
  36206. }
  36207. ,
  36208. e.decodeUTF8 = function(e, t) {
  36209. for (var i, n, r, o, a = function(e) {
  36210. e = e.slice(0, e.indexOf(null));
  36211. var t = Error(e.toString());
  36212. throw t.name = "TruncatedError",
  36213. t.bytes = e,
  36214. t
  36215. }; null !== (i = e()); )
  36216. if (0 === (128 & i))
  36217. t(i);
  36218. else if (192 === (224 & i))
  36219. null === (n = e()) && a([i, n]),
  36220. t((31 & i) << 6 | 63 & n);
  36221. else if (224 === (240 & i))
  36222. (null === (n = e()) || null === (r = e())) && a([i, n, r]),
  36223. t((15 & i) << 12 | (63 & n) << 6 | 63 & r);
  36224. else {
  36225. if (240 !== (248 & i))
  36226. throw RangeError("Illegal starting byte: " + i);
  36227. (null === (n = e()) || null === (r = e()) || null === (o = e())) && a([i, n, r, o]),
  36228. t((7 & i) << 18 | (63 & n) << 12 | (63 & r) << 6 | 63 & o)
  36229. }
  36230. }
  36231. ,
  36232. e.UTF16toUTF8 = function(e, t) {
  36233. for (var i, n = null; ; ) {
  36234. if (null === (i = null !== n ? n : e()))
  36235. break;
  36236. i >= 55296 && i <= 57343 && null !== (n = e()) && n >= 56320 && n <= 57343 ? (t(1024 * (i - 55296) + n - 56320 + 65536),
  36237. n = null) : t(i)
  36238. }
  36239. null !== n && t(n)
  36240. }
  36241. ,
  36242. e.UTF8toUTF16 = function(e, t) {
  36243. var i = null;
  36244. for ("number" == typeof e && (i = e,
  36245. e = function() {
  36246. return null
  36247. }
  36248. ); null !== i || null !== (i = e()); )
  36249. i <= 65535 ? t(i) : (i -= 65536,
  36250. t((i >> 10) + 55296),
  36251. t(i % 1024 + 56320)),
  36252. i = null
  36253. }
  36254. ,
  36255. e.encodeUTF16toUTF8 = function(t, i) {
  36256. e.UTF16toUTF8(t, function(t) {
  36257. e.encodeUTF8(t, i)
  36258. })
  36259. }
  36260. ,
  36261. e.decodeUTF8toUTF16 = function(t, i) {
  36262. e.decodeUTF8(t, function(t) {
  36263. e.UTF8toUTF16(t, i)
  36264. })
  36265. }
  36266. ,
  36267. e.calculateCodePoint = function(e) {
  36268. return e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36269. }
  36270. ,
  36271. e.calculateUTF8 = function(e) {
  36272. for (var t, i = 0; null !== (t = e()); )
  36273. i += t < 128 ? 1 : t < 2048 ? 2 : t < 65536 ? 3 : 4;
  36274. return i
  36275. }
  36276. ,
  36277. e.calculateUTF16asUTF8 = function(t) {
  36278. var i = 0
  36279. , n = 0;
  36280. return e.UTF16toUTF8(t, function(e) {
  36281. ++i,
  36282. n += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4
  36283. }),
  36284. [i, n]
  36285. }
  36286. ,
  36287. e
  36288. }();
  36289. return a.toUTF8 = function(e, t) {
  36290. if ("undefined" == typeof e && (e = this.offset),
  36291. "undefined" == typeof t && (t = this.limit),
  36292. !this.noAssert) {
  36293. if ("number" != typeof e || e % 1 !== 0)
  36294. throw TypeError("Illegal begin: Not an integer");
  36295. if (e >>>= 0,
  36296. "number" != typeof t || t % 1 !== 0)
  36297. throw TypeError("Illegal end: Not an integer");
  36298. if (t >>>= 0,
  36299. e < 0 || e > t || t > this.buffer.byteLength)
  36300. throw RangeError("Illegal range: 0 <= " + e + " <= " + t + " <= " + this.buffer.byteLength)
  36301. }
  36302. var n;
  36303. try {
  36304. h.decodeUTF8toUTF16(function() {
  36305. return e < t ? this.view[e++] : null
  36306. }
  36307. .bind(this), n = i())
  36308. } catch (i) {
  36309. if (e !== t)
  36310. throw RangeError("Illegal range: Truncated data, " + e + " != " + t)
  36311. }
  36312. return n()
  36313. }
  36314. ,
  36315. o.fromUTF8 = function(e, i, n) {
  36316. if (!n && "string" != typeof e)
  36317. throw TypeError("Illegal str: Not a string");
  36318. var r = new o(h.calculateUTF16asUTF8(t(e), !0)[1],i,n)
  36319. , a = 0;
  36320. return h.encodeUTF16toUTF8(t(e), function(e) {
  36321. r.view[a++] = e
  36322. }),
  36323. r.limit = a,
  36324. r
  36325. }
  36326. ,
  36327. o
  36328. })
  36329. }
  36330. , {
  36331. long: 216
  36332. }],
  36333. 216: [function(e, t, i) {
  36334. !function(i, n) {
  36335. "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()
  36336. }(this, function() {
  36337. "use strict";
  36338. function e(e, t, i) {
  36339. this.low = 0 | e,
  36340. this.high = 0 | t,
  36341. this.unsigned = !!i
  36342. }
  36343. function t(e) {
  36344. return (e && e.__isLong__) === !0
  36345. }
  36346. function i(e, t) {
  36347. var i, n, o;
  36348. return t ? (e >>>= 0,
  36349. (o = 0 <= e && e < 256) && (n = l[e]) ? n : (i = r(e, (0 | e) < 0 ? -1 : 0, !0),
  36350. o && (l[e] = i),
  36351. i)) : (e |= 0,
  36352. (o = -128 <= e && e < 128) && (n = s[e]) ? n : (i = r(e, e < 0 ? -1 : 0, !1),
  36353. o && (s[e] = i),
  36354. i))
  36355. }
  36356. function n(e, t) {
  36357. if (isNaN(e) || !isFinite(e))
  36358. return t ? m : g;
  36359. if (t) {
  36360. if (e < 0)
  36361. return m;
  36362. if (e >= d)
  36363. return I
  36364. } else {
  36365. if (e <= -p)
  36366. return E;
  36367. if (e + 1 >= p)
  36368. return C
  36369. }
  36370. return e < 0 ? n(-e, t).neg() : r(e % u | 0, e / u | 0, t)
  36371. }
  36372. function r(t, i, n) {
  36373. return new e(t,i,n)
  36374. }
  36375. function o(e, t, i) {
  36376. if (0 === e.length)
  36377. throw Error("empty string");
  36378. if ("NaN" === e || "Infinity" === e || "+Infinity" === e || "-Infinity" === e)
  36379. return g;
  36380. if ("number" == typeof t ? (i = t,
  36381. t = !1) : t = !!t,
  36382. i = i || 10,
  36383. i < 2 || 36 < i)
  36384. throw RangeError("radix");
  36385. var r;
  36386. if ((r = e.indexOf("-")) > 0)
  36387. throw Error("interior hyphen");
  36388. if (0 === r)
  36389. return o(e.substring(1), t, i).neg();
  36390. for (var a = n(c(i, 8)), s = g, l = 0; l < e.length; l += 8) {
  36391. var h = Math.min(8, e.length - l)
  36392. , u = parseInt(e.substring(l, l + h), i);
  36393. if (h < 8) {
  36394. var d = n(c(i, h));
  36395. s = s.mul(d).add(n(u))
  36396. } else
  36397. s = s.mul(a),
  36398. s = s.add(n(u))
  36399. }
  36400. return s.unsigned = t,
  36401. s
  36402. }
  36403. function a(t) {
  36404. return t instanceof e ? t : "number" == typeof t ? n(t) : "string" == typeof t ? o(t) : r(t.low, t.high, t.unsigned)
  36405. }
  36406. e.prototype.__isLong__,
  36407. Object.defineProperty(e.prototype, "__isLong__", {
  36408. value: !0,
  36409. enumerable: !1,
  36410. configurable: !1
  36411. }),
  36412. e.isLong = t;
  36413. var s = {}
  36414. , l = {};
  36415. e.fromInt = i,
  36416. e.fromNumber = n,
  36417. e.fromBits = r;
  36418. var c = Math.pow;
  36419. e.fromString = o,
  36420. e.fromValue = a;
  36421. var h = 1 << 24
  36422. , u = 4294967296
  36423. , d = 0x10000000000000000
  36424. , p = d / 2
  36425. , f = i(h)
  36426. , g = i(0);
  36427. e.ZERO = g;
  36428. var m = i(0, !0);
  36429. e.UZERO = m;
  36430. var v = i(1);
  36431. e.ONE = v;
  36432. var A = i(1, !0);
  36433. e.UONE = A;
  36434. var y = i(-1);
  36435. e.NEG_ONE = y;
  36436. var C = r(-1, 2147483647, !1);
  36437. e.MAX_VALUE = C;
  36438. var I = r(-1, -1, !0);
  36439. e.MAX_UNSIGNED_VALUE = I;
  36440. var E = r(0, -2147483648, !1);
  36441. e.MIN_VALUE = E;
  36442. var b = e.prototype;
  36443. return b.toInt = function() {
  36444. return this.unsigned ? this.low >>> 0 : this.low
  36445. }
  36446. ,
  36447. b.toNumber = function() {
  36448. return this.unsigned ? (this.high >>> 0) * u + (this.low >>> 0) : this.high * u + (this.low >>> 0)
  36449. }
  36450. ,
  36451. b.toString = function(e) {
  36452. if (e = e || 10,
  36453. e < 2 || 36 < e)
  36454. throw RangeError("radix");
  36455. if (this.isZero())
  36456. return "0";
  36457. if (this.isNegative()) {
  36458. if (this.eq(E)) {
  36459. var t = n(e)
  36460. , i = this.div(t)
  36461. , r = i.mul(t).sub(this);
  36462. return i.toString(e) + r.toInt().toString(e)
  36463. }
  36464. return "-" + this.neg().toString(e)
  36465. }
  36466. for (var o = n(c(e, 6), this.unsigned), a = this, s = ""; ; ) {
  36467. var l = a.div(o)
  36468. , h = a.sub(l.mul(o)).toInt() >>> 0
  36469. , u = h.toString(e);
  36470. if (a = l,
  36471. a.isZero())
  36472. return u + s;
  36473. for (; u.length < 6; )
  36474. u = "0" + u;
  36475. s = "" + u + s
  36476. }
  36477. }
  36478. ,
  36479. b.getHighBits = function() {
  36480. return this.high
  36481. }
  36482. ,
  36483. b.getHighBitsUnsigned = function() {
  36484. return this.high >>> 0
  36485. }
  36486. ,
  36487. b.getLowBits = function() {
  36488. return this.low
  36489. }
  36490. ,
  36491. b.getLowBitsUnsigned = function() {
  36492. return this.low >>> 0
  36493. }
  36494. ,
  36495. b.getNumBitsAbs = function() {
  36496. if (this.isNegative())
  36497. return this.eq(E) ? 64 : this.neg().getNumBitsAbs();
  36498. for (var e = 0 != this.high ? this.high : this.low, t = 31; t > 0 && 0 == (e & 1 << t); t--)
  36499. ;
  36500. return 0 != this.high ? t + 33 : t + 1
  36501. }
  36502. ,
  36503. b.isZero = function() {
  36504. return 0 === this.high && 0 === this.low
  36505. }
  36506. ,
  36507. b.isNegative = function() {
  36508. return !this.unsigned && this.high < 0
  36509. }
  36510. ,
  36511. b.isPositive = function() {
  36512. return this.unsigned || this.high >= 0
  36513. }
  36514. ,
  36515. b.isOdd = function() {
  36516. return 1 === (1 & this.low)
  36517. }
  36518. ,
  36519. b.isEven = function() {
  36520. return 0 === (1 & this.low)
  36521. }
  36522. ,
  36523. b.equals = function(e) {
  36524. return t(e) || (e = a(e)),
  36525. (this.unsigned === e.unsigned || this.high >>> 31 !== 1 || e.high >>> 31 !== 1) && (this.high === e.high && this.low === e.low)
  36526. }
  36527. ,
  36528. b.eq = b.equals,
  36529. b.notEquals = function(e) {
  36530. return !this.eq(e)
  36531. }
  36532. ,
  36533. b.neq = b.notEquals,
  36534. b.lessThan = function(e) {
  36535. return this.comp(e) < 0
  36536. }
  36537. ,
  36538. b.lt = b.lessThan,
  36539. b.lessThanOrEqual = function(e) {
  36540. return this.comp(e) <= 0
  36541. }
  36542. ,
  36543. b.lte = b.lessThanOrEqual,
  36544. b.greaterThan = function(e) {
  36545. return this.comp(e) > 0
  36546. }
  36547. ,
  36548. b.gt = b.greaterThan,
  36549. b.greaterThanOrEqual = function(e) {
  36550. return this.comp(e) >= 0
  36551. }
  36552. ,
  36553. b.gte = b.greaterThanOrEqual,
  36554. b.compare = function(e) {
  36555. if (t(e) || (e = a(e)),
  36556. this.eq(e))
  36557. return 0;
  36558. var i = this.isNegative()
  36559. , n = e.isNegative();
  36560. return i && !n ? -1 : !i && n ? 1 : this.unsigned ? e.high >>> 0 > this.high >>> 0 || e.high === this.high && e.low >>> 0 > this.low >>> 0 ? -1 : 1 : this.sub(e).isNegative() ? -1 : 1
  36561. }
  36562. ,
  36563. b.comp = b.compare,
  36564. b.negate = function() {
  36565. return !this.unsigned && this.eq(E) ? E : this.not().add(v)
  36566. }
  36567. ,
  36568. b.neg = b.negate,
  36569. b.add = function(e) {
  36570. t(e) || (e = a(e));
  36571. var i = this.high >>> 16
  36572. , n = 65535 & this.high
  36573. , o = this.low >>> 16
  36574. , s = 65535 & this.low
  36575. , l = e.high >>> 16
  36576. , c = 65535 & e.high
  36577. , h = e.low >>> 16
  36578. , u = 65535 & e.low
  36579. , d = 0
  36580. , p = 0
  36581. , f = 0
  36582. , g = 0;
  36583. return g += s + u,
  36584. f += g >>> 16,
  36585. g &= 65535,
  36586. f += o + h,
  36587. p += f >>> 16,
  36588. f &= 65535,
  36589. p += n + c,
  36590. d += p >>> 16,
  36591. p &= 65535,
  36592. d += i + l,
  36593. d &= 65535,
  36594. r(f << 16 | g, d << 16 | p, this.unsigned)
  36595. }
  36596. ,
  36597. b.subtract = function(e) {
  36598. return t(e) || (e = a(e)),
  36599. this.add(e.neg())
  36600. }
  36601. ,
  36602. b.sub = b.subtract,
  36603. b.multiply = function(e) {
  36604. if (this.isZero())
  36605. return g;
  36606. if (t(e) || (e = a(e)),
  36607. e.isZero())
  36608. return g;
  36609. if (this.eq(E))
  36610. return e.isOdd() ? E : g;
  36611. if (e.eq(E))
  36612. return this.isOdd() ? E : g;
  36613. if (this.isNegative())
  36614. return e.isNegative() ? this.neg().mul(e.neg()) : this.neg().mul(e).neg();
  36615. if (e.isNegative())
  36616. return this.mul(e.neg()).neg();
  36617. if (this.lt(f) && e.lt(f))
  36618. return n(this.toNumber() * e.toNumber(), this.unsigned);
  36619. var i = this.high >>> 16
  36620. , o = 65535 & this.high
  36621. , s = this.low >>> 16
  36622. , l = 65535 & this.low
  36623. , c = e.high >>> 16
  36624. , h = 65535 & e.high
  36625. , u = e.low >>> 16
  36626. , d = 65535 & e.low
  36627. , p = 0
  36628. , m = 0
  36629. , v = 0
  36630. , A = 0;
  36631. return A += l * d,
  36632. v += A >>> 16,
  36633. A &= 65535,
  36634. v += s * d,
  36635. m += v >>> 16,
  36636. v &= 65535,
  36637. v += l * u,
  36638. m += v >>> 16,
  36639. v &= 65535,
  36640. m += o * d,
  36641. p += m >>> 16,
  36642. m &= 65535,
  36643. m += s * u,
  36644. p += m >>> 16,
  36645. m &= 65535,
  36646. m += l * h,
  36647. p += m >>> 16,
  36648. m &= 65535,
  36649. p += i * d + o * u + s * h + l * c,
  36650. p &= 65535,
  36651. r(v << 16 | A, p << 16 | m, this.unsigned)
  36652. }
  36653. ,
  36654. b.mul = b.multiply,
  36655. b.divide = function(e) {
  36656. if (t(e) || (e = a(e)),
  36657. e.isZero())
  36658. throw Error("division by zero");
  36659. if (this.isZero())
  36660. return this.unsigned ? m : g;
  36661. var i, r, o;
  36662. if (this.unsigned) {
  36663. if (e.unsigned || (e = e.toUnsigned()),
  36664. e.gt(this))
  36665. return m;
  36666. if (e.gt(this.shru(1)))
  36667. return A;
  36668. o = m
  36669. } else {
  36670. if (this.eq(E)) {
  36671. if (e.eq(v) || e.eq(y))
  36672. return E;
  36673. if (e.eq(E))
  36674. return v;
  36675. var s = this.shr(1);
  36676. return i = s.div(e).shl(1),
  36677. i.eq(g) ? e.isNegative() ? v : y : (r = this.sub(e.mul(i)),
  36678. o = i.add(r.div(e)))
  36679. }
  36680. if (e.eq(E))
  36681. return this.unsigned ? m : g;
  36682. if (this.isNegative())
  36683. return e.isNegative() ? this.neg().div(e.neg()) : this.neg().div(e).neg();
  36684. if (e.isNegative())
  36685. return this.div(e.neg()).neg();
  36686. o = g
  36687. }
  36688. for (r = this; r.gte(e); ) {
  36689. i = Math.max(1, Math.floor(r.toNumber() / e.toNumber()));
  36690. 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); )
  36691. i -= h,
  36692. u = n(i, this.unsigned),
  36693. d = u.mul(e);
  36694. u.isZero() && (u = v),
  36695. o = o.add(u),
  36696. r = r.sub(d)
  36697. }
  36698. return o
  36699. }
  36700. ,
  36701. b.div = b.divide,
  36702. b.modulo = function(e) {
  36703. return t(e) || (e = a(e)),
  36704. this.sub(this.div(e).mul(e))
  36705. }
  36706. ,
  36707. b.mod = b.modulo,
  36708. b.not = function() {
  36709. return r(~this.low, ~this.high, this.unsigned)
  36710. }
  36711. ,
  36712. b.and = function(e) {
  36713. return t(e) || (e = a(e)),
  36714. r(this.low & e.low, this.high & e.high, this.unsigned)
  36715. }
  36716. ,
  36717. b.or = function(e) {
  36718. return t(e) || (e = a(e)),
  36719. r(this.low | e.low, this.high | e.high, this.unsigned)
  36720. }
  36721. ,
  36722. b.xor = function(e) {
  36723. return t(e) || (e = a(e)),
  36724. r(this.low ^ e.low, this.high ^ e.high, this.unsigned)
  36725. }
  36726. ,
  36727. b.shiftLeft = function(e) {
  36728. return t(e) && (e = e.toInt()),
  36729. 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)
  36730. }
  36731. ,
  36732. b.shl = b.shiftLeft,
  36733. b.shiftRight = function(e) {
  36734. return t(e) && (e = e.toInt()),
  36735. 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)
  36736. }
  36737. ,
  36738. b.shr = b.shiftRight,
  36739. b.shiftRightUnsigned = function(e) {
  36740. if (t(e) && (e = e.toInt()),
  36741. e &= 63,
  36742. 0 === e)
  36743. return this;
  36744. var i = this.high;
  36745. if (e < 32) {
  36746. var n = this.low;
  36747. return r(n >>> e | i << 32 - e, i >>> e, this.unsigned)
  36748. }
  36749. return 32 === e ? r(i, 0, this.unsigned) : r(i >>> e - 32, 0, this.unsigned)
  36750. }
  36751. ,
  36752. b.shru = b.shiftRightUnsigned,
  36753. b.toSigned = function() {
  36754. return this.unsigned ? r(this.low, this.high, !1) : this
  36755. }
  36756. ,
  36757. b.toUnsigned = function() {
  36758. return this.unsigned ? this : r(this.low, this.high, !0)
  36759. }
  36760. ,
  36761. b.toBytes = function(e) {
  36762. return e ? this.toBytesLE() : this.toBytesBE()
  36763. }
  36764. ,
  36765. b.toBytesLE = function() {
  36766. var e = this.high
  36767. , t = this.low;
  36768. return [255 & t, t >>> 8 & 255, t >>> 16 & 255, t >>> 24 & 255, 255 & e, e >>> 8 & 255, e >>> 16 & 255, e >>> 24 & 255]
  36769. }
  36770. ,
  36771. b.toBytesBE = function() {
  36772. var e = this.high
  36773. , t = this.low;
  36774. return [e >>> 24 & 255, e >>> 16 & 255, e >>> 8 & 255, 255 & e, t >>> 24 & 255, t >>> 16 & 255, t >>> 8 & 255, 255 & t]
  36775. }
  36776. ,
  36777. e
  36778. })
  36779. }
  36780. , {}],
  36781. 217: [function(e, t, i) {
  36782. var n = {
  36783. REVISION: "75"
  36784. };
  36785. "function" == typeof define && define.amd ? define("three", n) : "undefined" != typeof i && "undefined" != typeof t && (t.exports = n),
  36786. void 0 === Number.EPSILON && (Number.EPSILON = Math.pow(2, -52)),
  36787. void 0 === Math.sign && (Math.sign = function(e) {
  36788. return e < 0 ? -1 : e > 0 ? 1 : +e
  36789. }
  36790. ),
  36791. void 0 === Function.prototype.name && void 0 !== Object.defineProperty && Object.defineProperty(Function.prototype, "name", {
  36792. get: function() {
  36793. return this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]
  36794. }
  36795. }),
  36796. void 0 === Object.assign && Object.defineProperty(Object, "assign", {
  36797. writable: !0,
  36798. configurable: !0,
  36799. value: function(e) {
  36800. "use strict";
  36801. if (void 0 === e || null === e)
  36802. throw new TypeError("Cannot convert first argument to object");
  36803. for (var t = Object(e), i = 1, n = arguments.length; i !== n; ++i) {
  36804. var r = arguments[i];
  36805. if (void 0 !== r && null !== r) {
  36806. r = Object(r);
  36807. for (var o = Object.keys(r), a = 0, s = o.length; a !== s; ++a) {
  36808. var l = o[a]
  36809. , c = Object.getOwnPropertyDescriptor(r, l);
  36810. void 0 !== c && c.enumerable && (t[l] = r[l])
  36811. }
  36812. }
  36813. }
  36814. return t
  36815. }
  36816. }),
  36817. n.MOUSE = {
  36818. LEFT: 0,
  36819. MIDDLE: 1,
  36820. RIGHT: 2
  36821. },
  36822. n.CullFaceNone = 0,
  36823. n.CullFaceBack = 1,
  36824. n.CullFaceFront = 2,
  36825. n.CullFaceFrontBack = 3,
  36826. n.FrontFaceDirectionCW = 0,
  36827. n.FrontFaceDirectionCCW = 1,
  36828. n.BasicShadowMap = 0,
  36829. n.PCFShadowMap = 1,
  36830. n.PCFSoftShadowMap = 2,
  36831. n.FrontSide = 0,
  36832. n.BackSide = 1,
  36833. n.DoubleSide = 2,
  36834. n.FlatShading = 1,
  36835. n.SmoothShading = 2,
  36836. n.NoColors = 0,
  36837. n.FaceColors = 1,
  36838. n.VertexColors = 2,
  36839. n.NoBlending = 0,
  36840. n.NormalBlending = 1,
  36841. n.AdditiveBlending = 2,
  36842. n.SubtractiveBlending = 3,
  36843. n.MultiplyBlending = 4,
  36844. n.CustomBlending = 5,
  36845. n.AddEquation = 100,
  36846. n.SubtractEquation = 101,
  36847. n.ReverseSubtractEquation = 102,
  36848. n.MinEquation = 103,
  36849. n.MaxEquation = 104,
  36850. n.ZeroFactor = 200,
  36851. n.OneFactor = 201,
  36852. n.SrcColorFactor = 202,
  36853. n.OneMinusSrcColorFactor = 203,
  36854. n.SrcAlphaFactor = 204,
  36855. n.OneMinusSrcAlphaFactor = 205,
  36856. n.DstAlphaFactor = 206,
  36857. n.OneMinusDstAlphaFactor = 207,
  36858. n.DstColorFactor = 208,
  36859. n.OneMinusDstColorFactor = 209,
  36860. n.SrcAlphaSaturateFactor = 210,
  36861. n.NeverDepth = 0,
  36862. n.AlwaysDepth = 1,
  36863. n.LessDepth = 2,
  36864. n.LessEqualDepth = 3,
  36865. n.EqualDepth = 4,
  36866. n.GreaterEqualDepth = 5,
  36867. n.GreaterDepth = 6,
  36868. n.NotEqualDepth = 7,
  36869. n.MultiplyOperation = 0,
  36870. n.MixOperation = 1,
  36871. n.AddOperation = 2,
  36872. n.NoToneMapping = 0,
  36873. n.LinearToneMapping = 1,
  36874. n.ReinhardToneMapping = 2,
  36875. n.Uncharted2ToneMapping = 3,
  36876. n.CineonToneMapping = 4,
  36877. n.UVMapping = 300,
  36878. n.CubeReflectionMapping = 301,
  36879. n.CubeRefractionMapping = 302,
  36880. n.EquirectangularReflectionMapping = 303,
  36881. n.EquirectangularRefractionMapping = 304,
  36882. n.SphericalReflectionMapping = 305,
  36883. n.CubeUVReflectionMapping = 306,
  36884. n.CubeUVRefractionMapping = 307,
  36885. n.RepeatWrapping = 1e3,
  36886. n.ClampToEdgeWrapping = 1001,
  36887. n.MirroredRepeatWrapping = 1002,
  36888. n.NearestFilter = 1003,
  36889. n.NearestMipMapNearestFilter = 1004,
  36890. n.NearestMipMapLinearFilter = 1005,
  36891. n.LinearFilter = 1006,
  36892. n.LinearMipMapNearestFilter = 1007,
  36893. n.LinearMipMapLinearFilter = 1008,
  36894. n.UnsignedByteType = 1009,
  36895. n.ByteType = 1010,
  36896. n.ShortType = 1011,
  36897. n.UnsignedShortType = 1012,
  36898. n.IntType = 1013,
  36899. n.UnsignedIntType = 1014,
  36900. n.FloatType = 1015,
  36901. n.HalfFloatType = 1025,
  36902. n.UnsignedShort4444Type = 1016,
  36903. n.UnsignedShort5551Type = 1017,
  36904. n.UnsignedShort565Type = 1018,
  36905. n.AlphaFormat = 1019,
  36906. n.RGBFormat = 1020,
  36907. n.RGBAFormat = 1021,
  36908. n.LuminanceFormat = 1022,
  36909. n.LuminanceAlphaFormat = 1023,
  36910. n.RGBEFormat = n.RGBAFormat,
  36911. n.RGB_S3TC_DXT1_Format = 2001,
  36912. n.RGBA_S3TC_DXT1_Format = 2002,
  36913. n.RGBA_S3TC_DXT3_Format = 2003,
  36914. n.RGBA_S3TC_DXT5_Format = 2004,
  36915. n.RGB_PVRTC_4BPPV1_Format = 2100,
  36916. n.RGB_PVRTC_2BPPV1_Format = 2101,
  36917. n.RGBA_PVRTC_4BPPV1_Format = 2102,
  36918. n.RGBA_PVRTC_2BPPV1_Format = 2103,
  36919. n.RGB_ETC1_Format = 2151,
  36920. n.LoopOnce = 2200,
  36921. n.LoopRepeat = 2201,
  36922. n.LoopPingPong = 2202,
  36923. n.InterpolateDiscrete = 2300,
  36924. n.InterpolateLinear = 2301,
  36925. n.InterpolateSmooth = 2302,
  36926. n.ZeroCurvatureEnding = 2400,
  36927. n.ZeroSlopeEnding = 2401,
  36928. n.WrapAroundEnding = 2402,
  36929. n.TrianglesDrawMode = 0,
  36930. n.TriangleStripDrawMode = 1,
  36931. n.TriangleFanDrawMode = 2,
  36932. n.LinearEncoding = 3e3,
  36933. n.sRGBEncoding = 3001,
  36934. n.GammaEncoding = 3007,
  36935. n.RGBEEncoding = 3002,
  36936. n.LogLuvEncoding = 3003,
  36937. n.RGBM7Encoding = 3004,
  36938. n.RGBM16Encoding = 3005,
  36939. n.RGBDEncoding = 3006,
  36940. n.Color = function(e) {
  36941. return 3 === arguments.length ? this.fromArray(arguments) : this.set(e)
  36942. }
  36943. ,
  36944. n.Color.prototype = {
  36945. constructor: n.Color,
  36946. r: 1,
  36947. g: 1,
  36948. b: 1,
  36949. set: function(e) {
  36950. return e instanceof n.Color ? this.copy(e) : "number" == typeof e ? this.setHex(e) : "string" == typeof e && this.setStyle(e),
  36951. this
  36952. },
  36953. setScalar: function(e) {
  36954. this.r = e,
  36955. this.g = e,
  36956. this.b = e
  36957. },
  36958. setHex: function(e) {
  36959. return e = Math.floor(e),
  36960. this.r = (e >> 16 & 255) / 255,
  36961. this.g = (e >> 8 & 255) / 255,
  36962. this.b = (255 & e) / 255,
  36963. this
  36964. },
  36965. setRGB: function(e, t, i) {
  36966. return this.r = e,
  36967. this.g = t,
  36968. this.b = i,
  36969. this
  36970. },
  36971. setHSL: function() {
  36972. function e(e, t, i) {
  36973. return i < 0 && (i += 1),
  36974. i > 1 && (i -= 1),
  36975. i < 1 / 6 ? e + 6 * (t - e) * i : i < .5 ? t : i < 2 / 3 ? e + 6 * (t - e) * (2 / 3 - i) : e
  36976. }
  36977. return function(t, i, r) {
  36978. if (t = n.Math.euclideanModulo(t, 1),
  36979. i = n.Math.clamp(i, 0, 1),
  36980. r = n.Math.clamp(r, 0, 1),
  36981. 0 === i)
  36982. this.r = this.g = this.b = r;
  36983. else {
  36984. var o = r <= .5 ? r * (1 + i) : r + i - r * i
  36985. , a = 2 * r - o;
  36986. this.r = e(a, o, t + 1 / 3),
  36987. this.g = e(a, o, t),
  36988. this.b = e(a, o, t - 1 / 3)
  36989. }
  36990. return this
  36991. }
  36992. }(),
  36993. setStyle: function(e) {
  36994. function t(t) {
  36995. void 0 !== t && parseFloat(t) < 1 && console.warn("THREE.Color: Alpha component of " + e + " will be ignored.")
  36996. }
  36997. var i;
  36998. if (i = /^((?:rgb|hsl)a?)\(\s*([^\)]*)\)/.exec(e)) {
  36999. var r, o = i[1], a = i[2];
  37000. switch (o) {
  37001. case "rgb":
  37002. case "rgba":
  37003. if (r = /^(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37004. return this.r = Math.min(255, parseInt(r[1], 10)) / 255,
  37005. this.g = Math.min(255, parseInt(r[2], 10)) / 255,
  37006. this.b = Math.min(255, parseInt(r[3], 10)) / 255,
  37007. t(r[5]),
  37008. this;
  37009. if (r = /^(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a))
  37010. return this.r = Math.min(100, parseInt(r[1], 10)) / 100,
  37011. this.g = Math.min(100, parseInt(r[2], 10)) / 100,
  37012. this.b = Math.min(100, parseInt(r[3], 10)) / 100,
  37013. t(r[5]),
  37014. this;
  37015. break;
  37016. case "hsl":
  37017. case "hsla":
  37018. if (r = /^([0-9]*\.?[0-9]+)\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(,\s*([0-9]*\.?[0-9]+)\s*)?$/.exec(a)) {
  37019. var s = parseFloat(r[1]) / 360
  37020. , l = parseInt(r[2], 10) / 100
  37021. , c = parseInt(r[3], 10) / 100;
  37022. return t(r[5]),
  37023. this.setHSL(s, l, c)
  37024. }
  37025. }
  37026. } else if (i = /^\#([A-Fa-f0-9]+)$/.exec(e)) {
  37027. var h = i[1]
  37028. , u = h.length;
  37029. if (3 === u)
  37030. return this.r = parseInt(h.charAt(0) + h.charAt(0), 16) / 255,
  37031. this.g = parseInt(h.charAt(1) + h.charAt(1), 16) / 255,
  37032. this.b = parseInt(h.charAt(2) + h.charAt(2), 16) / 255,
  37033. this;
  37034. if (6 === u)
  37035. return this.r = parseInt(h.charAt(0) + h.charAt(1), 16) / 255,
  37036. this.g = parseInt(h.charAt(2) + h.charAt(3), 16) / 255,
  37037. this.b = parseInt(h.charAt(4) + h.charAt(5), 16) / 255,
  37038. this
  37039. }
  37040. if (e && e.length > 0) {
  37041. var h = n.ColorKeywords[e];
  37042. void 0 !== h ? this.setHex(h) : console.warn("THREE.Color: Unknown color " + e)
  37043. }
  37044. return this
  37045. },
  37046. clone: function() {
  37047. return new this.constructor(this.r,this.g,this.b)
  37048. },
  37049. copy: function(e) {
  37050. return this.r = e.r,
  37051. this.g = e.g,
  37052. this.b = e.b,
  37053. this
  37054. },
  37055. copyGammaToLinear: function(e, t) {
  37056. return void 0 === t && (t = 2),
  37057. this.r = Math.pow(e.r, t),
  37058. this.g = Math.pow(e.g, t),
  37059. this.b = Math.pow(e.b, t),
  37060. this
  37061. },
  37062. copyLinearToGamma: function(e, t) {
  37063. void 0 === t && (t = 2);
  37064. var i = t > 0 ? 1 / t : 1;
  37065. return this.r = Math.pow(e.r, i),
  37066. this.g = Math.pow(e.g, i),
  37067. this.b = Math.pow(e.b, i),
  37068. this
  37069. },
  37070. convertGammaToLinear: function() {
  37071. var e = this.r
  37072. , t = this.g
  37073. , i = this.b;
  37074. return this.r = e * e,
  37075. this.g = t * t,
  37076. this.b = i * i,
  37077. this
  37078. },
  37079. convertLinearToGamma: function() {
  37080. return this.r = Math.sqrt(this.r),
  37081. this.g = Math.sqrt(this.g),
  37082. this.b = Math.sqrt(this.b),
  37083. this
  37084. },
  37085. getHex: function() {
  37086. return 255 * this.r << 16 ^ 255 * this.g << 8 ^ 255 * this.b << 0
  37087. },
  37088. getHexString: function() {
  37089. return ("000000" + this.getHex().toString(16)).slice(-6)
  37090. },
  37091. getHSL: function(e) {
  37092. var t, i, n = e || {
  37093. h: 0,
  37094. s: 0,
  37095. l: 0
  37096. }, r = this.r, o = this.g, a = this.b, s = Math.max(r, o, a), l = Math.min(r, o, a), c = (l + s) / 2;
  37097. if (l === s)
  37098. t = 0,
  37099. i = 0;
  37100. else {
  37101. var h = s - l;
  37102. switch (i = c <= .5 ? h / (s + l) : h / (2 - s - l),
  37103. s) {
  37104. case r:
  37105. t = (o - a) / h + (o < a ? 6 : 0);
  37106. break;
  37107. case o:
  37108. t = (a - r) / h + 2;
  37109. break;
  37110. case a:
  37111. t = (r - o) / h + 4
  37112. }
  37113. t /= 6
  37114. }
  37115. return n.h = t,
  37116. n.s = i,
  37117. n.l = c,
  37118. n
  37119. },
  37120. getStyle: function() {
  37121. return "rgb(" + (255 * this.r | 0) + "," + (255 * this.g | 0) + "," + (255 * this.b | 0) + ")"
  37122. },
  37123. offsetHSL: function(e, t, i) {
  37124. var n = this.getHSL();
  37125. return n.h += e,
  37126. n.s += t,
  37127. n.l += i,
  37128. this.setHSL(n.h, n.s, n.l),
  37129. this
  37130. },
  37131. add: function(e) {
  37132. return this.r += e.r,
  37133. this.g += e.g,
  37134. this.b += e.b,
  37135. this
  37136. },
  37137. addColors: function(e, t) {
  37138. return this.r = e.r + t.r,
  37139. this.g = e.g + t.g,
  37140. this.b = e.b + t.b,
  37141. this
  37142. },
  37143. addScalar: function(e) {
  37144. return this.r += e,
  37145. this.g += e,
  37146. this.b += e,
  37147. this
  37148. },
  37149. multiply: function(e) {
  37150. return this.r *= e.r,
  37151. this.g *= e.g,
  37152. this.b *= e.b,
  37153. this
  37154. },
  37155. multiplyScalar: function(e) {
  37156. return this.r *= e,
  37157. this.g *= e,
  37158. this.b *= e,
  37159. this
  37160. },
  37161. lerp: function(e, t) {
  37162. return this.r += (e.r - this.r) * t,
  37163. this.g += (e.g - this.g) * t,
  37164. this.b += (e.b - this.b) * t,
  37165. this
  37166. },
  37167. equals: function(e) {
  37168. return e.r === this.r && e.g === this.g && e.b === this.b
  37169. },
  37170. fromArray: function(e, t) {
  37171. return void 0 === t && (t = 0),
  37172. this.r = e[t],
  37173. this.g = e[t + 1],
  37174. this.b = e[t + 2],
  37175. this
  37176. },
  37177. toArray: function(e, t) {
  37178. return void 0 === e && (e = []),
  37179. void 0 === t && (t = 0),
  37180. e[t] = this.r,
  37181. e[t + 1] = this.g,
  37182. e[t + 2] = this.b,
  37183. e
  37184. }
  37185. },
  37186. n.ColorKeywords = {
  37187. aliceblue: 15792383,
  37188. antiquewhite: 16444375,
  37189. aqua: 65535,
  37190. aquamarine: 8388564,
  37191. azure: 15794175,
  37192. beige: 16119260,
  37193. bisque: 16770244,
  37194. black: 0,
  37195. blanchedalmond: 16772045,
  37196. blue: 255,
  37197. blueviolet: 9055202,
  37198. brown: 10824234,
  37199. burlywood: 14596231,
  37200. cadetblue: 6266528,
  37201. chartreuse: 8388352,
  37202. chocolate: 13789470,
  37203. coral: 16744272,
  37204. cornflowerblue: 6591981,
  37205. cornsilk: 16775388,
  37206. crimson: 14423100,
  37207. cyan: 65535,
  37208. darkblue: 139,
  37209. darkcyan: 35723,
  37210. darkgoldenrod: 12092939,
  37211. darkgray: 11119017,
  37212. darkgreen: 25600,
  37213. darkgrey: 11119017,
  37214. darkkhaki: 12433259,
  37215. darkmagenta: 9109643,
  37216. darkolivegreen: 5597999,
  37217. darkorange: 16747520,
  37218. darkorchid: 10040012,
  37219. darkred: 9109504,
  37220. darksalmon: 15308410,
  37221. darkseagreen: 9419919,
  37222. darkslateblue: 4734347,
  37223. darkslategray: 3100495,
  37224. darkslategrey: 3100495,
  37225. darkturquoise: 52945,
  37226. darkviolet: 9699539,
  37227. deeppink: 16716947,
  37228. deepskyblue: 49151,
  37229. dimgray: 6908265,
  37230. dimgrey: 6908265,
  37231. dodgerblue: 2003199,
  37232. firebrick: 11674146,
  37233. floralwhite: 16775920,
  37234. forestgreen: 2263842,
  37235. fuchsia: 16711935,
  37236. gainsboro: 14474460,
  37237. ghostwhite: 16316671,
  37238. gold: 16766720,
  37239. goldenrod: 14329120,
  37240. gray: 8421504,
  37241. green: 32768,
  37242. greenyellow: 11403055,
  37243. grey: 8421504,
  37244. honeydew: 15794160,
  37245. hotpink: 16738740,
  37246. indianred: 13458524,
  37247. indigo: 4915330,
  37248. ivory: 16777200,
  37249. khaki: 15787660,
  37250. lavender: 15132410,
  37251. lavenderblush: 16773365,
  37252. lawngreen: 8190976,
  37253. lemonchiffon: 16775885,
  37254. lightblue: 11393254,
  37255. lightcoral: 15761536,
  37256. lightcyan: 14745599,
  37257. lightgoldenrodyellow: 16448210,
  37258. lightgray: 13882323,
  37259. lightgreen: 9498256,
  37260. lightgrey: 13882323,
  37261. lightpink: 16758465,
  37262. lightsalmon: 16752762,
  37263. lightseagreen: 2142890,
  37264. lightskyblue: 8900346,
  37265. lightslategray: 7833753,
  37266. lightslategrey: 7833753,
  37267. lightsteelblue: 11584734,
  37268. lightyellow: 16777184,
  37269. lime: 65280,
  37270. limegreen: 3329330,
  37271. linen: 16445670,
  37272. magenta: 16711935,
  37273. maroon: 8388608,
  37274. mediumaquamarine: 6737322,
  37275. mediumblue: 205,
  37276. mediumorchid: 12211667,
  37277. mediumpurple: 9662683,
  37278. mediumseagreen: 3978097,
  37279. mediumslateblue: 8087790,
  37280. mediumspringgreen: 64154,
  37281. mediumturquoise: 4772300,
  37282. mediumvioletred: 13047173,
  37283. midnightblue: 1644912,
  37284. mintcream: 16121850,
  37285. mistyrose: 16770273,
  37286. moccasin: 16770229,
  37287. navajowhite: 16768685,
  37288. navy: 128,
  37289. oldlace: 16643558,
  37290. olive: 8421376,
  37291. olivedrab: 7048739,
  37292. orange: 16753920,
  37293. orangered: 16729344,
  37294. orchid: 14315734,
  37295. palegoldenrod: 15657130,
  37296. palegreen: 10025880,
  37297. paleturquoise: 11529966,
  37298. palevioletred: 14381203,
  37299. papayawhip: 16773077,
  37300. peachpuff: 16767673,
  37301. peru: 13468991,
  37302. pink: 16761035,
  37303. plum: 14524637,
  37304. powderblue: 11591910,
  37305. purple: 8388736,
  37306. red: 16711680,
  37307. rosybrown: 12357519,
  37308. royalblue: 4286945,
  37309. saddlebrown: 9127187,
  37310. salmon: 16416882,
  37311. sandybrown: 16032864,
  37312. seagreen: 3050327,
  37313. seashell: 16774638,
  37314. sienna: 10506797,
  37315. silver: 12632256,
  37316. skyblue: 8900331,
  37317. slateblue: 6970061,
  37318. slategray: 7372944,
  37319. slategrey: 7372944,
  37320. snow: 16775930,
  37321. springgreen: 65407,
  37322. steelblue: 4620980,
  37323. tan: 13808780,
  37324. teal: 32896,
  37325. thistle: 14204888,
  37326. tomato: 16737095,
  37327. turquoise: 4251856,
  37328. violet: 15631086,
  37329. wheat: 16113331,
  37330. white: 16777215,
  37331. whitesmoke: 16119285,
  37332. yellow: 16776960,
  37333. yellowgreen: 10145074
  37334. },
  37335. n.Quaternion = function(e, t, i, n) {
  37336. this._x = e || 0,
  37337. this._y = t || 0,
  37338. this._z = i || 0,
  37339. this._w = void 0 !== n ? n : 1
  37340. }
  37341. ,
  37342. n.Quaternion.prototype = {
  37343. constructor: n.Quaternion,
  37344. get x() {
  37345. return this._x
  37346. },
  37347. set x(e) {
  37348. this._x = e,
  37349. this.onChangeCallback()
  37350. },
  37351. get y() {
  37352. return this._y
  37353. },
  37354. set y(e) {
  37355. this._y = e,
  37356. this.onChangeCallback()
  37357. },
  37358. get z() {
  37359. return this._z
  37360. },
  37361. set z(e) {
  37362. this._z = e,
  37363. this.onChangeCallback()
  37364. },
  37365. get w() {
  37366. return this._w
  37367. },
  37368. set w(e) {
  37369. this._w = e,
  37370. this.onChangeCallback()
  37371. },
  37372. set: function(e, t, i, n) {
  37373. return this._x = e,
  37374. this._y = t,
  37375. this._z = i,
  37376. this._w = n,
  37377. this.onChangeCallback(),
  37378. this
  37379. },
  37380. clone: function() {
  37381. return new this.constructor(this._x,this._y,this._z,this._w)
  37382. },
  37383. copy: function(e) {
  37384. return this._x = e.x,
  37385. this._y = e.y,
  37386. this._z = e.z,
  37387. this._w = e.w,
  37388. this.onChangeCallback(),
  37389. this
  37390. },
  37391. setFromEuler: function(e, t) {
  37392. if (e instanceof n.Euler == !1)
  37393. throw new Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  37394. var i = Math.cos(e._x / 2)
  37395. , r = Math.cos(e._y / 2)
  37396. , o = Math.cos(e._z / 2)
  37397. , a = Math.sin(e._x / 2)
  37398. , s = Math.sin(e._y / 2)
  37399. , l = Math.sin(e._z / 2)
  37400. , c = e.order;
  37401. return "XYZ" === c ? (this._x = a * r * o + i * s * l,
  37402. this._y = i * s * o - a * r * l,
  37403. this._z = i * r * l + a * s * o,
  37404. this._w = i * r * o - a * s * l) : "YXZ" === c ? (this._x = a * r * o + i * s * l,
  37405. this._y = i * s * o - a * r * l,
  37406. this._z = i * r * l - a * s * o,
  37407. this._w = i * r * o + a * s * l) : "ZXY" === c ? (this._x = a * r * o - i * s * l,
  37408. this._y = i * s * o + a * r * l,
  37409. this._z = i * r * l + a * s * o,
  37410. this._w = i * r * o - a * s * l) : "ZYX" === c ? (this._x = a * r * o - i * s * l,
  37411. this._y = i * s * o + a * r * l,
  37412. this._z = i * r * l - a * s * o,
  37413. this._w = i * r * o + a * s * l) : "YZX" === c ? (this._x = a * r * o + i * s * l,
  37414. this._y = i * s * o + a * r * l,
  37415. this._z = i * r * l - a * s * o,
  37416. this._w = i * r * o - a * s * l) : "XZY" === c && (this._x = a * r * o - i * s * l,
  37417. this._y = i * s * o - a * r * l,
  37418. this._z = i * r * l + a * s * o,
  37419. this._w = i * r * o + a * s * l),
  37420. t !== !1 && this.onChangeCallback(),
  37421. this
  37422. },
  37423. setFromAxisAngle: function(e, t) {
  37424. var i = t / 2
  37425. , n = Math.sin(i);
  37426. return this._x = e.x * n,
  37427. this._y = e.y * n,
  37428. this._z = e.z * n,
  37429. this._w = Math.cos(i),
  37430. this.onChangeCallback(),
  37431. this
  37432. },
  37433. setFromRotationMatrix: function(e) {
  37434. var t, i = e.elements, n = i[0], r = i[4], o = i[8], a = i[1], s = i[5], l = i[9], c = i[2], h = i[6], u = i[10], d = n + s + u;
  37435. return d > 0 ? (t = .5 / Math.sqrt(d + 1),
  37436. this._w = .25 / t,
  37437. this._x = (h - l) * t,
  37438. this._y = (o - c) * t,
  37439. this._z = (a - r) * t) : n > s && n > u ? (t = 2 * Math.sqrt(1 + n - s - u),
  37440. this._w = (h - l) / t,
  37441. this._x = .25 * t,
  37442. this._y = (r + a) / t,
  37443. this._z = (o + c) / t) : s > u ? (t = 2 * Math.sqrt(1 + s - n - u),
  37444. this._w = (o - c) / t,
  37445. this._x = (r + a) / t,
  37446. this._y = .25 * t,
  37447. this._z = (l + h) / t) : (t = 2 * Math.sqrt(1 + u - n - s),
  37448. this._w = (a - r) / t,
  37449. this._x = (o + c) / t,
  37450. this._y = (l + h) / t,
  37451. this._z = .25 * t),
  37452. this.onChangeCallback(),
  37453. this
  37454. },
  37455. setFromUnitVectors: function() {
  37456. var e, t, i = 1e-6;
  37457. return function(r, o) {
  37458. return void 0 === e && (e = new n.Vector3),
  37459. t = r.dot(o) + 1,
  37460. t < i ? (t = 0,
  37461. 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),
  37462. this._x = e.x,
  37463. this._y = e.y,
  37464. this._z = e.z,
  37465. this._w = t,
  37466. this.normalize(),
  37467. this
  37468. }
  37469. }(),
  37470. inverse: function() {
  37471. return this.conjugate().normalize(),
  37472. this
  37473. },
  37474. conjugate: function() {
  37475. return this._x *= -1,
  37476. this._y *= -1,
  37477. this._z *= -1,
  37478. this.onChangeCallback(),
  37479. this
  37480. },
  37481. dot: function(e) {
  37482. return this._x * e._x + this._y * e._y + this._z * e._z + this._w * e._w
  37483. },
  37484. lengthSq: function() {
  37485. return this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w
  37486. },
  37487. length: function() {
  37488. return Math.sqrt(this._x * this._x + this._y * this._y + this._z * this._z + this._w * this._w)
  37489. },
  37490. normalize: function() {
  37491. var e = this.length();
  37492. return 0 === e ? (this._x = 0,
  37493. this._y = 0,
  37494. this._z = 0,
  37495. this._w = 1) : (e = 1 / e,
  37496. this._x = this._x * e,
  37497. this._y = this._y * e,
  37498. this._z = this._z * e,
  37499. this._w = this._w * e),
  37500. this.onChangeCallback(),
  37501. this
  37502. },
  37503. multiply: function(e, t) {
  37504. return void 0 !== t ? (console.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),
  37505. this.multiplyQuaternions(e, t)) : this.multiplyQuaternions(this, e)
  37506. },
  37507. multiplyQuaternions: function(e, t) {
  37508. var i = e._x
  37509. , n = e._y
  37510. , r = e._z
  37511. , o = e._w
  37512. , a = t._x
  37513. , s = t._y
  37514. , l = t._z
  37515. , c = t._w;
  37516. return this._x = i * c + o * a + n * l - r * s,
  37517. this._y = n * c + o * s + r * a - i * l,
  37518. this._z = r * c + o * l + i * s - n * a,
  37519. this._w = o * c - i * a - n * s - r * l,
  37520. this.onChangeCallback(),
  37521. this
  37522. },
  37523. slerp: function(e, t) {
  37524. if (0 === t)
  37525. return this;
  37526. if (1 === t)
  37527. return this.copy(e);
  37528. var i = this._x
  37529. , n = this._y
  37530. , r = this._z
  37531. , o = this._w
  37532. , a = o * e._w + i * e._x + n * e._y + r * e._z;
  37533. if (a < 0 ? (this._w = -e._w,
  37534. this._x = -e._x,
  37535. this._y = -e._y,
  37536. this._z = -e._z,
  37537. a = -a) : this.copy(e),
  37538. a >= 1)
  37539. return this._w = o,
  37540. this._x = i,
  37541. this._y = n,
  37542. this._z = r,
  37543. this;
  37544. var s = Math.sqrt(1 - a * a);
  37545. if (Math.abs(s) < .001)
  37546. return this._w = .5 * (o + this._w),
  37547. this._x = .5 * (i + this._x),
  37548. this._y = .5 * (n + this._y),
  37549. this._z = .5 * (r + this._z),
  37550. this;
  37551. var l = Math.atan2(s, a)
  37552. , c = Math.sin((1 - t) * l) / s
  37553. , h = Math.sin(t * l) / s;
  37554. return this._w = o * c + this._w * h,
  37555. this._x = i * c + this._x * h,
  37556. this._y = n * c + this._y * h,
  37557. this._z = r * c + this._z * h,
  37558. this.onChangeCallback(),
  37559. this
  37560. },
  37561. equals: function(e) {
  37562. return e._x === this._x && e._y === this._y && e._z === this._z && e._w === this._w
  37563. },
  37564. fromArray: function(e, t) {
  37565. return void 0 === t && (t = 0),
  37566. this._x = e[t],
  37567. this._y = e[t + 1],
  37568. this._z = e[t + 2],
  37569. this._w = e[t + 3],
  37570. this.onChangeCallback(),
  37571. this
  37572. },
  37573. toArray: function(e, t) {
  37574. return void 0 === e && (e = []),
  37575. void 0 === t && (t = 0),
  37576. e[t] = this._x,
  37577. e[t + 1] = this._y,
  37578. e[t + 2] = this._z,
  37579. e[t + 3] = this._w,
  37580. e
  37581. },
  37582. onChange: function(e) {
  37583. return this.onChangeCallback = e,
  37584. this
  37585. },
  37586. onChangeCallback: function() {}
  37587. },
  37588. Object.assign(n.Quaternion, {
  37589. slerp: function(e, t, i, n) {
  37590. return i.copy(e).slerp(t, n)
  37591. },
  37592. slerpFlat: function(e, t, i, n, r, o, a) {
  37593. var s = i[n + 0]
  37594. , l = i[n + 1]
  37595. , c = i[n + 2]
  37596. , h = i[n + 3]
  37597. , u = r[o + 0]
  37598. , d = r[o + 1]
  37599. , p = r[o + 2]
  37600. , f = r[o + 3];
  37601. if (h !== f || s !== u || l !== d || c !== p) {
  37602. var g = 1 - a
  37603. , m = s * u + l * d + c * p + h * f
  37604. , v = m >= 0 ? 1 : -1
  37605. , A = 1 - m * m;
  37606. if (A > Number.EPSILON) {
  37607. var y = Math.sqrt(A)
  37608. , C = Math.atan2(y, m * v);
  37609. g = Math.sin(g * C) / y,
  37610. a = Math.sin(a * C) / y
  37611. }
  37612. var I = a * v;
  37613. if (s = s * g + u * I,
  37614. l = l * g + d * I,
  37615. c = c * g + p * I,
  37616. h = h * g + f * I,
  37617. g === 1 - a) {
  37618. var E = 1 / Math.sqrt(s * s + l * l + c * c + h * h);
  37619. s *= E,
  37620. l *= E,
  37621. c *= E,
  37622. h *= E
  37623. }
  37624. }
  37625. e[t] = s,
  37626. e[t + 1] = l,
  37627. e[t + 2] = c,
  37628. e[t + 3] = h
  37629. }
  37630. }),
  37631. n.Vector2 = function(e, t) {
  37632. this.x = e || 0,
  37633. this.y = t || 0
  37634. }
  37635. ,
  37636. n.Vector2.prototype = {
  37637. constructor: n.Vector2,
  37638. get width() {
  37639. return this.x
  37640. },
  37641. set width(e) {
  37642. this.x = e
  37643. },
  37644. get height() {
  37645. return this.y
  37646. },
  37647. set height(e) {
  37648. this.y = e
  37649. },
  37650. set: function(e, t) {
  37651. return this.x = e,
  37652. this.y = t,
  37653. this
  37654. },
  37655. setScalar: function(e) {
  37656. return this.x = e,
  37657. this.y = e,
  37658. this
  37659. },
  37660. setX: function(e) {
  37661. return this.x = e,
  37662. this
  37663. },
  37664. setY: function(e) {
  37665. return this.y = e,
  37666. this
  37667. },
  37668. setComponent: function(e, t) {
  37669. switch (e) {
  37670. case 0:
  37671. this.x = t;
  37672. break;
  37673. case 1:
  37674. this.y = t;
  37675. break;
  37676. default:
  37677. throw new Error("index is out of range: " + e)
  37678. }
  37679. },
  37680. getComponent: function(e) {
  37681. switch (e) {
  37682. case 0:
  37683. return this.x;
  37684. case 1:
  37685. return this.y;
  37686. default:
  37687. throw new Error("index is out of range: " + e)
  37688. }
  37689. },
  37690. clone: function() {
  37691. return new this.constructor(this.x,this.y)
  37692. },
  37693. copy: function(e) {
  37694. return this.x = e.x,
  37695. this.y = e.y,
  37696. this
  37697. },
  37698. add: function(e, t) {
  37699. return void 0 !== t ? (console.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37700. this.addVectors(e, t)) : (this.x += e.x,
  37701. this.y += e.y,
  37702. this)
  37703. },
  37704. addScalar: function(e) {
  37705. return this.x += e,
  37706. this.y += e,
  37707. this
  37708. },
  37709. addVectors: function(e, t) {
  37710. return this.x = e.x + t.x,
  37711. this.y = e.y + t.y,
  37712. this
  37713. },
  37714. addScaledVector: function(e, t) {
  37715. return this.x += e.x * t,
  37716. this.y += e.y * t,
  37717. this
  37718. },
  37719. sub: function(e, t) {
  37720. return void 0 !== t ? (console.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37721. this.subVectors(e, t)) : (this.x -= e.x,
  37722. this.y -= e.y,
  37723. this)
  37724. },
  37725. subScalar: function(e) {
  37726. return this.x -= e,
  37727. this.y -= e,
  37728. this
  37729. },
  37730. subVectors: function(e, t) {
  37731. return this.x = e.x - t.x,
  37732. this.y = e.y - t.y,
  37733. this
  37734. },
  37735. multiply: function(e) {
  37736. return this.x *= e.x,
  37737. this.y *= e.y,
  37738. this
  37739. },
  37740. multiplyScalar: function(e) {
  37741. return isFinite(e) ? (this.x *= e,
  37742. this.y *= e) : (this.x = 0,
  37743. this.y = 0),
  37744. this
  37745. },
  37746. divide: function(e) {
  37747. return this.x /= e.x,
  37748. this.y /= e.y,
  37749. this
  37750. },
  37751. divideScalar: function(e) {
  37752. return this.multiplyScalar(1 / e)
  37753. },
  37754. min: function(e) {
  37755. return this.x = Math.min(this.x, e.x),
  37756. this.y = Math.min(this.y, e.y),
  37757. this
  37758. },
  37759. max: function(e) {
  37760. return this.x = Math.max(this.x, e.x),
  37761. this.y = Math.max(this.y, e.y),
  37762. this
  37763. },
  37764. clamp: function(e, t) {
  37765. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  37766. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  37767. this
  37768. },
  37769. clampScalar: function() {
  37770. var e, t;
  37771. return function(i, r) {
  37772. return void 0 === e && (e = new n.Vector2,
  37773. t = new n.Vector2),
  37774. e.set(i, i),
  37775. t.set(r, r),
  37776. this.clamp(e, t)
  37777. }
  37778. }(),
  37779. clampLength: function(e, t) {
  37780. var i = this.length();
  37781. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  37782. this
  37783. },
  37784. floor: function() {
  37785. return this.x = Math.floor(this.x),
  37786. this.y = Math.floor(this.y),
  37787. this
  37788. },
  37789. ceil: function() {
  37790. return this.x = Math.ceil(this.x),
  37791. this.y = Math.ceil(this.y),
  37792. this
  37793. },
  37794. round: function() {
  37795. return this.x = Math.round(this.x),
  37796. this.y = Math.round(this.y),
  37797. this
  37798. },
  37799. roundToZero: function() {
  37800. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  37801. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  37802. this
  37803. },
  37804. negate: function() {
  37805. return this.x = -this.x,
  37806. this.y = -this.y,
  37807. this
  37808. },
  37809. dot: function(e) {
  37810. return this.x * e.x + this.y * e.y
  37811. },
  37812. lengthSq: function() {
  37813. return this.x * this.x + this.y * this.y
  37814. },
  37815. length: function() {
  37816. return Math.sqrt(this.x * this.x + this.y * this.y)
  37817. },
  37818. lengthManhattan: function() {
  37819. return Math.abs(this.x) + Math.abs(this.y)
  37820. },
  37821. normalize: function() {
  37822. return this.divideScalar(this.length())
  37823. },
  37824. angle: function() {
  37825. var e = Math.atan2(this.y, this.x);
  37826. return e < 0 && (e += 2 * Math.PI),
  37827. e
  37828. },
  37829. distanceTo: function(e) {
  37830. return Math.sqrt(this.distanceToSquared(e))
  37831. },
  37832. distanceToSquared: function(e) {
  37833. var t = this.x - e.x
  37834. , i = this.y - e.y;
  37835. return t * t + i * i
  37836. },
  37837. setLength: function(e) {
  37838. return this.multiplyScalar(e / this.length())
  37839. },
  37840. lerp: function(e, t) {
  37841. return this.x += (e.x - this.x) * t,
  37842. this.y += (e.y - this.y) * t,
  37843. this
  37844. },
  37845. lerpVectors: function(e, t, i) {
  37846. return this.subVectors(t, e).multiplyScalar(i).add(e),
  37847. this
  37848. },
  37849. equals: function(e) {
  37850. return e.x === this.x && e.y === this.y
  37851. },
  37852. fromArray: function(e, t) {
  37853. return void 0 === t && (t = 0),
  37854. this.x = e[t],
  37855. this.y = e[t + 1],
  37856. this
  37857. },
  37858. toArray: function(e, t) {
  37859. return void 0 === e && (e = []),
  37860. void 0 === t && (t = 0),
  37861. e[t] = this.x,
  37862. e[t + 1] = this.y,
  37863. e
  37864. },
  37865. fromAttribute: function(e, t, i) {
  37866. return void 0 === i && (i = 0),
  37867. t = t * e.itemSize + i,
  37868. this.x = e.array[t],
  37869. this.y = e.array[t + 1],
  37870. this
  37871. },
  37872. rotateAround: function(e, t) {
  37873. var i = Math.cos(t)
  37874. , n = Math.sin(t)
  37875. , r = this.x - e.x
  37876. , o = this.y - e.y;
  37877. return this.x = r * i - o * n + e.x,
  37878. this.y = r * n + o * i + e.y,
  37879. this
  37880. }
  37881. },
  37882. n.Vector3 = function(e, t, i) {
  37883. this.x = e || 0,
  37884. this.y = t || 0,
  37885. this.z = i || 0
  37886. }
  37887. ,
  37888. n.Vector3.prototype = {
  37889. constructor: n.Vector3,
  37890. set: function(e, t, i) {
  37891. return this.x = e,
  37892. this.y = t,
  37893. this.z = i,
  37894. this
  37895. },
  37896. setScalar: function(e) {
  37897. return this.x = e,
  37898. this.y = e,
  37899. this.z = e,
  37900. this
  37901. },
  37902. setX: function(e) {
  37903. return this.x = e,
  37904. this
  37905. },
  37906. setY: function(e) {
  37907. return this.y = e,
  37908. this
  37909. },
  37910. setZ: function(e) {
  37911. return this.z = e,
  37912. this
  37913. },
  37914. setComponent: function(e, t) {
  37915. switch (e) {
  37916. case 0:
  37917. this.x = t;
  37918. break;
  37919. case 1:
  37920. this.y = t;
  37921. break;
  37922. case 2:
  37923. this.z = t;
  37924. break;
  37925. default:
  37926. throw new Error("index is out of range: " + e)
  37927. }
  37928. },
  37929. getComponent: function(e) {
  37930. switch (e) {
  37931. case 0:
  37932. return this.x;
  37933. case 1:
  37934. return this.y;
  37935. case 2:
  37936. return this.z;
  37937. default:
  37938. throw new Error("index is out of range: " + e)
  37939. }
  37940. },
  37941. clone: function() {
  37942. return new this.constructor(this.x,this.y,this.z)
  37943. },
  37944. copy: function(e) {
  37945. return this.x = e.x,
  37946. this.y = e.y,
  37947. this.z = e.z,
  37948. this
  37949. },
  37950. add: function(e, t) {
  37951. return void 0 !== t ? (console.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  37952. this.addVectors(e, t)) : (this.x += e.x,
  37953. this.y += e.y,
  37954. this.z += e.z,
  37955. this)
  37956. },
  37957. addScalar: function(e) {
  37958. return this.x += e,
  37959. this.y += e,
  37960. this.z += e,
  37961. this
  37962. },
  37963. addVectors: function(e, t) {
  37964. return this.x = e.x + t.x,
  37965. this.y = e.y + t.y,
  37966. this.z = e.z + t.z,
  37967. this
  37968. },
  37969. addScaledVector: function(e, t) {
  37970. return this.x += e.x * t,
  37971. this.y += e.y * t,
  37972. this.z += e.z * t,
  37973. this
  37974. },
  37975. sub: function(e, t) {
  37976. return void 0 !== t ? (console.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  37977. this.subVectors(e, t)) : (this.x -= e.x,
  37978. this.y -= e.y,
  37979. this.z -= e.z,
  37980. this)
  37981. },
  37982. subScalar: function(e) {
  37983. return this.x -= e,
  37984. this.y -= e,
  37985. this.z -= e,
  37986. this
  37987. },
  37988. subVectors: function(e, t) {
  37989. return this.x = e.x - t.x,
  37990. this.y = e.y - t.y,
  37991. this.z = e.z - t.z,
  37992. this
  37993. },
  37994. multiply: function(e, t) {
  37995. return void 0 !== t ? (console.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),
  37996. this.multiplyVectors(e, t)) : (this.x *= e.x,
  37997. this.y *= e.y,
  37998. this.z *= e.z,
  37999. this)
  38000. },
  38001. multiplyScalar: function(e) {
  38002. return isFinite(e) ? (this.x *= e,
  38003. this.y *= e,
  38004. this.z *= e) : (this.x = 0,
  38005. this.y = 0,
  38006. this.z = 0),
  38007. this
  38008. },
  38009. multiplyVectors: function(e, t) {
  38010. return this.x = e.x * t.x,
  38011. this.y = e.y * t.y,
  38012. this.z = e.z * t.z,
  38013. this
  38014. },
  38015. applyEuler: function() {
  38016. var e;
  38017. return function(t) {
  38018. return t instanceof n.Euler == !1 && console.error("THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order."),
  38019. void 0 === e && (e = new n.Quaternion),
  38020. this.applyQuaternion(e.setFromEuler(t)),
  38021. this
  38022. }
  38023. }(),
  38024. applyAxisAngle: function() {
  38025. var e;
  38026. return function(t, i) {
  38027. return void 0 === e && (e = new n.Quaternion),
  38028. this.applyQuaternion(e.setFromAxisAngle(t, i)),
  38029. this
  38030. }
  38031. }(),
  38032. applyMatrix3: function(e) {
  38033. var t = this.x
  38034. , i = this.y
  38035. , n = this.z
  38036. , r = e.elements;
  38037. return this.x = r[0] * t + r[3] * i + r[6] * n,
  38038. this.y = r[1] * t + r[4] * i + r[7] * n,
  38039. this.z = r[2] * t + r[5] * i + r[8] * n,
  38040. this
  38041. },
  38042. applyMatrix4: function(e) {
  38043. var t = this.x
  38044. , i = this.y
  38045. , n = this.z
  38046. , r = e.elements;
  38047. return this.x = r[0] * t + r[4] * i + r[8] * n + r[12],
  38048. this.y = r[1] * t + r[5] * i + r[9] * n + r[13],
  38049. this.z = r[2] * t + r[6] * i + r[10] * n + r[14],
  38050. this
  38051. },
  38052. applyProjection: function(e) {
  38053. var t = this.x
  38054. , i = this.y
  38055. , n = this.z
  38056. , r = e.elements
  38057. , o = 1 / (r[3] * t + r[7] * i + r[11] * n + r[15]);
  38058. return this.x = (r[0] * t + r[4] * i + r[8] * n + r[12]) * o,
  38059. this.y = (r[1] * t + r[5] * i + r[9] * n + r[13]) * o,
  38060. this.z = (r[2] * t + r[6] * i + r[10] * n + r[14]) * o,
  38061. this
  38062. },
  38063. applyQuaternion: function(e) {
  38064. var t = this.x
  38065. , i = this.y
  38066. , n = this.z
  38067. , r = e.x
  38068. , o = e.y
  38069. , a = e.z
  38070. , s = e.w
  38071. , l = s * t + o * n - a * i
  38072. , c = s * i + a * t - r * n
  38073. , h = s * n + r * i - o * t
  38074. , u = -r * t - o * i - a * n;
  38075. return this.x = l * s + u * -r + c * -a - h * -o,
  38076. this.y = c * s + u * -o + h * -r - l * -a,
  38077. this.z = h * s + u * -a + l * -o - c * -r,
  38078. this
  38079. },
  38080. project: function() {
  38081. var e;
  38082. return function(t) {
  38083. return void 0 === e && (e = new n.Matrix4),
  38084. e.multiplyMatrices(t.projectionMatrix, e.getInverse(t.matrixWorld)),
  38085. this.applyProjection(e)
  38086. }
  38087. }(),
  38088. unproject: function() {
  38089. var e;
  38090. return function(t) {
  38091. return void 0 === e && (e = new n.Matrix4),
  38092. e.multiplyMatrices(t.matrixWorld, e.getInverse(t.projectionMatrix)),
  38093. this.applyProjection(e)
  38094. }
  38095. }(),
  38096. transformDirection: function(e) {
  38097. var t = this.x
  38098. , i = this.y
  38099. , n = this.z
  38100. , r = e.elements;
  38101. return this.x = r[0] * t + r[4] * i + r[8] * n,
  38102. this.y = r[1] * t + r[5] * i + r[9] * n,
  38103. this.z = r[2] * t + r[6] * i + r[10] * n,
  38104. this.normalize(),
  38105. this
  38106. },
  38107. divide: function(e) {
  38108. return this.x /= e.x,
  38109. this.y /= e.y,
  38110. this.z /= e.z,
  38111. this
  38112. },
  38113. divideScalar: function(e) {
  38114. return this.multiplyScalar(1 / e)
  38115. },
  38116. min: function(e) {
  38117. return this.x = Math.min(this.x, e.x),
  38118. this.y = Math.min(this.y, e.y),
  38119. this.z = Math.min(this.z, e.z),
  38120. this
  38121. },
  38122. max: function(e) {
  38123. return this.x = Math.max(this.x, e.x),
  38124. this.y = Math.max(this.y, e.y),
  38125. this.z = Math.max(this.z, e.z),
  38126. this
  38127. },
  38128. clamp: function(e, t) {
  38129. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38130. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38131. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38132. this
  38133. },
  38134. clampScalar: function() {
  38135. var e, t;
  38136. return function(i, r) {
  38137. return void 0 === e && (e = new n.Vector3,
  38138. t = new n.Vector3),
  38139. e.set(i, i, i),
  38140. t.set(r, r, r),
  38141. this.clamp(e, t)
  38142. }
  38143. }(),
  38144. clampLength: function(e, t) {
  38145. var i = this.length();
  38146. return this.multiplyScalar(Math.max(e, Math.min(t, i)) / i),
  38147. this
  38148. },
  38149. floor: function() {
  38150. return this.x = Math.floor(this.x),
  38151. this.y = Math.floor(this.y),
  38152. this.z = Math.floor(this.z),
  38153. this
  38154. },
  38155. ceil: function() {
  38156. return this.x = Math.ceil(this.x),
  38157. this.y = Math.ceil(this.y),
  38158. this.z = Math.ceil(this.z),
  38159. this
  38160. },
  38161. round: function() {
  38162. return this.x = Math.round(this.x),
  38163. this.y = Math.round(this.y),
  38164. this.z = Math.round(this.z),
  38165. this
  38166. },
  38167. roundToZero: function() {
  38168. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38169. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38170. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38171. this
  38172. },
  38173. negate: function() {
  38174. return this.x = -this.x,
  38175. this.y = -this.y,
  38176. this.z = -this.z,
  38177. this
  38178. },
  38179. dot: function(e) {
  38180. return this.x * e.x + this.y * e.y + this.z * e.z
  38181. },
  38182. lengthSq: function() {
  38183. return this.x * this.x + this.y * this.y + this.z * this.z
  38184. },
  38185. length: function() {
  38186. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z)
  38187. },
  38188. lengthManhattan: function() {
  38189. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z)
  38190. },
  38191. normalize: function() {
  38192. return this.divideScalar(this.length())
  38193. },
  38194. setLength: function(e) {
  38195. return this.multiplyScalar(e / this.length())
  38196. },
  38197. lerp: function(e, t) {
  38198. return this.x += (e.x - this.x) * t,
  38199. this.y += (e.y - this.y) * t,
  38200. this.z += (e.z - this.z) * t,
  38201. this
  38202. },
  38203. lerpVectors: function(e, t, i) {
  38204. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38205. this
  38206. },
  38207. cross: function(e, t) {
  38208. if (void 0 !== t)
  38209. return console.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),
  38210. this.crossVectors(e, t);
  38211. var i = this.x
  38212. , n = this.y
  38213. , r = this.z;
  38214. return this.x = n * e.z - r * e.y,
  38215. this.y = r * e.x - i * e.z,
  38216. this.z = i * e.y - n * e.x,
  38217. this
  38218. },
  38219. crossVectors: function(e, t) {
  38220. var i = e.x
  38221. , n = e.y
  38222. , r = e.z
  38223. , o = t.x
  38224. , a = t.y
  38225. , s = t.z;
  38226. return this.x = n * s - r * a,
  38227. this.y = r * o - i * s,
  38228. this.z = i * a - n * o,
  38229. this
  38230. },
  38231. projectOnVector: function() {
  38232. var e, t;
  38233. return function(i) {
  38234. return void 0 === e && (e = new n.Vector3),
  38235. e.copy(i).normalize(),
  38236. t = this.dot(e),
  38237. this.copy(e).multiplyScalar(t)
  38238. }
  38239. }(),
  38240. projectOnPlane: function() {
  38241. var e;
  38242. return function(t) {
  38243. return void 0 === e && (e = new n.Vector3),
  38244. e.copy(this).projectOnVector(t),
  38245. this.sub(e)
  38246. }
  38247. }(),
  38248. reflect: function() {
  38249. var e;
  38250. return function(t) {
  38251. return void 0 === e && (e = new n.Vector3),
  38252. this.sub(e.copy(t).multiplyScalar(2 * this.dot(t)))
  38253. }
  38254. }(),
  38255. angleTo: function(e) {
  38256. var t = this.dot(e) / Math.sqrt(this.lengthSq() * e.lengthSq());
  38257. return Math.acos(n.Math.clamp(t, -1, 1))
  38258. },
  38259. distanceTo: function(e) {
  38260. return Math.sqrt(this.distanceToSquared(e))
  38261. },
  38262. distanceToSquared: function(e) {
  38263. var t = this.x - e.x
  38264. , i = this.y - e.y
  38265. , n = this.z - e.z;
  38266. return t * t + i * i + n * n
  38267. },
  38268. setFromSpherical: function(e) {
  38269. var t = Math.sin(e.phi) * e.radius;
  38270. return this.x = t * Math.sin(e.theta),
  38271. this.y = Math.cos(e.phi) * e.radius,
  38272. this.z = t * Math.cos(e.theta),
  38273. this
  38274. },
  38275. setFromMatrixPosition: function(e) {
  38276. return this.setFromMatrixColumn(e, 3)
  38277. },
  38278. setFromMatrixScale: function(e) {
  38279. var t = this.setFromMatrixColumn(e, 0).length()
  38280. , i = this.setFromMatrixColumn(e, 1).length()
  38281. , n = this.setFromMatrixColumn(e, 2).length();
  38282. return this.x = t,
  38283. this.y = i,
  38284. this.z = n,
  38285. this
  38286. },
  38287. setFromMatrixColumn: function(e, t) {
  38288. return "number" == typeof e && (console.warn("THREE.Vector3: setFromMatrixColumn now expects ( matrix, index )."),
  38289. e = arguments[1],
  38290. t = arguments[0]),
  38291. this.fromArray(e.elements, 4 * t)
  38292. },
  38293. equals: function(e) {
  38294. return e.x === this.x && e.y === this.y && e.z === this.z
  38295. },
  38296. fromArray: function(e, t) {
  38297. return void 0 === t && (t = 0),
  38298. this.x = e[t],
  38299. this.y = e[t + 1],
  38300. this.z = e[t + 2],
  38301. this
  38302. },
  38303. toArray: function(e, t) {
  38304. return void 0 === e && (e = []),
  38305. void 0 === t && (t = 0),
  38306. e[t] = this.x,
  38307. e[t + 1] = this.y,
  38308. e[t + 2] = this.z,
  38309. e
  38310. },
  38311. fromAttribute: function(e, t, i) {
  38312. return void 0 === i && (i = 0),
  38313. t = t * e.itemSize + i,
  38314. this.x = e.array[t],
  38315. this.y = e.array[t + 1],
  38316. this.z = e.array[t + 2],
  38317. this
  38318. }
  38319. },
  38320. n.Vector4 = function(e, t, i, n) {
  38321. this.x = e || 0,
  38322. this.y = t || 0,
  38323. this.z = i || 0,
  38324. this.w = void 0 !== n ? n : 1
  38325. }
  38326. ,
  38327. n.Vector4.prototype = {
  38328. constructor: n.Vector4,
  38329. set: function(e, t, i, n) {
  38330. return this.x = e,
  38331. this.y = t,
  38332. this.z = i,
  38333. this.w = n,
  38334. this
  38335. },
  38336. setScalar: function(e) {
  38337. return this.x = e,
  38338. this.y = e,
  38339. this.z = e,
  38340. this.w = e,
  38341. this
  38342. },
  38343. setX: function(e) {
  38344. return this.x = e,
  38345. this
  38346. },
  38347. setY: function(e) {
  38348. return this.y = e,
  38349. this
  38350. },
  38351. setZ: function(e) {
  38352. return this.z = e,
  38353. this
  38354. },
  38355. setW: function(e) {
  38356. return this.w = e,
  38357. this
  38358. },
  38359. setComponent: function(e, t) {
  38360. switch (e) {
  38361. case 0:
  38362. this.x = t;
  38363. break;
  38364. case 1:
  38365. this.y = t;
  38366. break;
  38367. case 2:
  38368. this.z = t;
  38369. break;
  38370. case 3:
  38371. this.w = t;
  38372. break;
  38373. default:
  38374. throw new Error("index is out of range: " + e)
  38375. }
  38376. },
  38377. getComponent: function(e) {
  38378. switch (e) {
  38379. case 0:
  38380. return this.x;
  38381. case 1:
  38382. return this.y;
  38383. case 2:
  38384. return this.z;
  38385. case 3:
  38386. return this.w;
  38387. default:
  38388. throw new Error("index is out of range: " + e)
  38389. }
  38390. },
  38391. clone: function() {
  38392. return new this.constructor(this.x,this.y,this.z,this.w)
  38393. },
  38394. copy: function(e) {
  38395. return this.x = e.x,
  38396. this.y = e.y,
  38397. this.z = e.z,
  38398. this.w = void 0 !== e.w ? e.w : 1,
  38399. this
  38400. },
  38401. add: function(e, t) {
  38402. return void 0 !== t ? (console.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),
  38403. this.addVectors(e, t)) : (this.x += e.x,
  38404. this.y += e.y,
  38405. this.z += e.z,
  38406. this.w += e.w,
  38407. this)
  38408. },
  38409. addScalar: function(e) {
  38410. return this.x += e,
  38411. this.y += e,
  38412. this.z += e,
  38413. this.w += e,
  38414. this
  38415. },
  38416. addVectors: function(e, t) {
  38417. return this.x = e.x + t.x,
  38418. this.y = e.y + t.y,
  38419. this.z = e.z + t.z,
  38420. this.w = e.w + t.w,
  38421. this
  38422. },
  38423. addScaledVector: function(e, t) {
  38424. return this.x += e.x * t,
  38425. this.y += e.y * t,
  38426. this.z += e.z * t,
  38427. this.w += e.w * t,
  38428. this
  38429. },
  38430. sub: function(e, t) {
  38431. return void 0 !== t ? (console.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),
  38432. this.subVectors(e, t)) : (this.x -= e.x,
  38433. this.y -= e.y,
  38434. this.z -= e.z,
  38435. this.w -= e.w,
  38436. this)
  38437. },
  38438. subScalar: function(e) {
  38439. return this.x -= e,
  38440. this.y -= e,
  38441. this.z -= e,
  38442. this.w -= e,
  38443. this
  38444. },
  38445. subVectors: function(e, t) {
  38446. return this.x = e.x - t.x,
  38447. this.y = e.y - t.y,
  38448. this.z = e.z - t.z,
  38449. this.w = e.w - t.w,
  38450. this
  38451. },
  38452. multiplyScalar: function(e) {
  38453. return isFinite(e) ? (this.x *= e,
  38454. this.y *= e,
  38455. this.z *= e,
  38456. this.w *= e) : (this.x = 0,
  38457. this.y = 0,
  38458. this.z = 0,
  38459. this.w = 0),
  38460. this
  38461. },
  38462. applyMatrix4: function(e) {
  38463. var t = this.x
  38464. , i = this.y
  38465. , n = this.z
  38466. , r = this.w
  38467. , o = e.elements;
  38468. return this.x = o[0] * t + o[4] * i + o[8] * n + o[12] * r,
  38469. this.y = o[1] * t + o[5] * i + o[9] * n + o[13] * r,
  38470. this.z = o[2] * t + o[6] * i + o[10] * n + o[14] * r,
  38471. this.w = o[3] * t + o[7] * i + o[11] * n + o[15] * r,
  38472. this
  38473. },
  38474. divideScalar: function(e) {
  38475. return this.multiplyScalar(1 / e)
  38476. },
  38477. setAxisAngleFromQuaternion: function(e) {
  38478. this.w = 2 * Math.acos(e.w);
  38479. var t = Math.sqrt(1 - e.w * e.w);
  38480. return t < 1e-4 ? (this.x = 1,
  38481. this.y = 0,
  38482. this.z = 0) : (this.x = e.x / t,
  38483. this.y = e.y / t,
  38484. this.z = e.z / t),
  38485. this
  38486. },
  38487. setAxisAngleFromRotationMatrix: function(e) {
  38488. var t, i, n, r, o = .01, a = .1, s = e.elements, l = s[0], c = s[4], h = s[8], u = s[1], d = s[5], p = s[9], f = s[2], g = s[6], m = s[10];
  38489. if (Math.abs(c - u) < o && Math.abs(h - f) < o && Math.abs(p - g) < o) {
  38490. if (Math.abs(c + u) < a && Math.abs(h + f) < a && Math.abs(p + g) < a && Math.abs(l + d + m - 3) < a)
  38491. return this.set(1, 0, 0, 0),
  38492. this;
  38493. t = Math.PI;
  38494. var v = (l + 1) / 2
  38495. , A = (d + 1) / 2
  38496. , y = (m + 1) / 2
  38497. , C = (c + u) / 4
  38498. , I = (h + f) / 4
  38499. , E = (p + g) / 4;
  38500. return v > A && v > y ? v < o ? (i = 0,
  38501. n = .707106781,
  38502. r = .707106781) : (i = Math.sqrt(v),
  38503. n = C / i,
  38504. r = I / i) : A > y ? A < o ? (i = .707106781,
  38505. n = 0,
  38506. r = .707106781) : (n = Math.sqrt(A),
  38507. i = C / n,
  38508. r = E / n) : y < o ? (i = .707106781,
  38509. n = .707106781,
  38510. r = 0) : (r = Math.sqrt(y),
  38511. i = I / r,
  38512. n = E / r),
  38513. this.set(i, n, r, t),
  38514. this
  38515. }
  38516. var b = Math.sqrt((g - p) * (g - p) + (h - f) * (h - f) + (u - c) * (u - c));
  38517. return Math.abs(b) < .001 && (b = 1),
  38518. this.x = (g - p) / b,
  38519. this.y = (h - f) / b,
  38520. this.z = (u - c) / b,
  38521. this.w = Math.acos((l + d + m - 1) / 2),
  38522. this
  38523. },
  38524. min: function(e) {
  38525. return this.x = Math.min(this.x, e.x),
  38526. this.y = Math.min(this.y, e.y),
  38527. this.z = Math.min(this.z, e.z),
  38528. this.w = Math.min(this.w, e.w),
  38529. this
  38530. },
  38531. max: function(e) {
  38532. return this.x = Math.max(this.x, e.x),
  38533. this.y = Math.max(this.y, e.y),
  38534. this.z = Math.max(this.z, e.z),
  38535. this.w = Math.max(this.w, e.w),
  38536. this
  38537. },
  38538. clamp: function(e, t) {
  38539. return this.x = Math.max(e.x, Math.min(t.x, this.x)),
  38540. this.y = Math.max(e.y, Math.min(t.y, this.y)),
  38541. this.z = Math.max(e.z, Math.min(t.z, this.z)),
  38542. this.w = Math.max(e.w, Math.min(t.w, this.w)),
  38543. this
  38544. },
  38545. clampScalar: function() {
  38546. var e, t;
  38547. return function(i, r) {
  38548. return void 0 === e && (e = new n.Vector4,
  38549. t = new n.Vector4),
  38550. e.set(i, i, i, i),
  38551. t.set(r, r, r, r),
  38552. this.clamp(e, t)
  38553. }
  38554. }(),
  38555. floor: function() {
  38556. return this.x = Math.floor(this.x),
  38557. this.y = Math.floor(this.y),
  38558. this.z = Math.floor(this.z),
  38559. this.w = Math.floor(this.w),
  38560. this
  38561. },
  38562. ceil: function() {
  38563. return this.x = Math.ceil(this.x),
  38564. this.y = Math.ceil(this.y),
  38565. this.z = Math.ceil(this.z),
  38566. this.w = Math.ceil(this.w),
  38567. this
  38568. },
  38569. round: function() {
  38570. return this.x = Math.round(this.x),
  38571. this.y = Math.round(this.y),
  38572. this.z = Math.round(this.z),
  38573. this.w = Math.round(this.w),
  38574. this
  38575. },
  38576. roundToZero: function() {
  38577. return this.x = this.x < 0 ? Math.ceil(this.x) : Math.floor(this.x),
  38578. this.y = this.y < 0 ? Math.ceil(this.y) : Math.floor(this.y),
  38579. this.z = this.z < 0 ? Math.ceil(this.z) : Math.floor(this.z),
  38580. this.w = this.w < 0 ? Math.ceil(this.w) : Math.floor(this.w),
  38581. this
  38582. },
  38583. negate: function() {
  38584. return this.x = -this.x,
  38585. this.y = -this.y,
  38586. this.z = -this.z,
  38587. this.w = -this.w,
  38588. this
  38589. },
  38590. dot: function(e) {
  38591. return this.x * e.x + this.y * e.y + this.z * e.z + this.w * e.w
  38592. },
  38593. lengthSq: function() {
  38594. return this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w
  38595. },
  38596. length: function() {
  38597. return Math.sqrt(this.x * this.x + this.y * this.y + this.z * this.z + this.w * this.w)
  38598. },
  38599. lengthManhattan: function() {
  38600. return Math.abs(this.x) + Math.abs(this.y) + Math.abs(this.z) + Math.abs(this.w)
  38601. },
  38602. normalize: function() {
  38603. return this.divideScalar(this.length())
  38604. },
  38605. setLength: function(e) {
  38606. return this.multiplyScalar(e / this.length())
  38607. },
  38608. lerp: function(e, t) {
  38609. return this.x += (e.x - this.x) * t,
  38610. this.y += (e.y - this.y) * t,
  38611. this.z += (e.z - this.z) * t,
  38612. this.w += (e.w - this.w) * t,
  38613. this
  38614. },
  38615. lerpVectors: function(e, t, i) {
  38616. return this.subVectors(t, e).multiplyScalar(i).add(e),
  38617. this
  38618. },
  38619. equals: function(e) {
  38620. return e.x === this.x && e.y === this.y && e.z === this.z && e.w === this.w
  38621. },
  38622. fromArray: function(e, t) {
  38623. return void 0 === t && (t = 0),
  38624. this.x = e[t],
  38625. this.y = e[t + 1],
  38626. this.z = e[t + 2],
  38627. this.w = e[t + 3],
  38628. this
  38629. },
  38630. toArray: function(e, t) {
  38631. return void 0 === e && (e = []),
  38632. void 0 === t && (t = 0),
  38633. e[t] = this.x,
  38634. e[t + 1] = this.y,
  38635. e[t + 2] = this.z,
  38636. e[t + 3] = this.w,
  38637. e
  38638. },
  38639. fromAttribute: function(e, t, i) {
  38640. return void 0 === i && (i = 0),
  38641. t = t * e.itemSize + i,
  38642. this.x = e.array[t],
  38643. this.y = e.array[t + 1],
  38644. this.z = e.array[t + 2],
  38645. this.w = e.array[t + 3],
  38646. this
  38647. }
  38648. },
  38649. n.Euler = function(e, t, i, r) {
  38650. this._x = e || 0,
  38651. this._y = t || 0,
  38652. this._z = i || 0,
  38653. this._order = r || n.Euler.DefaultOrder
  38654. }
  38655. ,
  38656. n.Euler.RotationOrders = ["XYZ", "YZX", "ZXY", "XZY", "YXZ", "ZYX"],
  38657. n.Euler.DefaultOrder = "XYZ",
  38658. n.Euler.prototype = {
  38659. constructor: n.Euler,
  38660. get x() {
  38661. return this._x
  38662. },
  38663. set x(e) {
  38664. this._x = e,
  38665. this.onChangeCallback()
  38666. },
  38667. get y() {
  38668. return this._y
  38669. },
  38670. set y(e) {
  38671. this._y = e,
  38672. this.onChangeCallback()
  38673. },
  38674. get z() {
  38675. return this._z
  38676. },
  38677. set z(e) {
  38678. this._z = e,
  38679. this.onChangeCallback()
  38680. },
  38681. get order() {
  38682. return this._order
  38683. },
  38684. set order(e) {
  38685. this._order = e,
  38686. this.onChangeCallback()
  38687. },
  38688. set: function(e, t, i, n) {
  38689. return this._x = e,
  38690. this._y = t,
  38691. this._z = i,
  38692. this._order = n || this._order,
  38693. this.onChangeCallback(),
  38694. this
  38695. },
  38696. clone: function() {
  38697. return new this.constructor(this._x,this._y,this._z,this._order)
  38698. },
  38699. copy: function(e) {
  38700. return this._x = e._x,
  38701. this._y = e._y,
  38702. this._z = e._z,
  38703. this._order = e._order,
  38704. this.onChangeCallback(),
  38705. this
  38706. },
  38707. setFromRotationMatrix: function(e, t, i) {
  38708. var r = n.Math.clamp
  38709. , o = e.elements
  38710. , a = o[0]
  38711. , s = o[4]
  38712. , l = o[8]
  38713. , c = o[1]
  38714. , h = o[5]
  38715. , u = o[9]
  38716. , d = o[2]
  38717. , p = o[6]
  38718. , f = o[10];
  38719. return t = t || this._order,
  38720. "XYZ" === t ? (this._y = Math.asin(r(l, -1, 1)),
  38721. Math.abs(l) < .99999 ? (this._x = Math.atan2(-u, f),
  38722. this._z = Math.atan2(-s, a)) : (this._x = Math.atan2(p, h),
  38723. this._z = 0)) : "YXZ" === t ? (this._x = Math.asin(-r(u, -1, 1)),
  38724. Math.abs(u) < .99999 ? (this._y = Math.atan2(l, f),
  38725. this._z = Math.atan2(c, h)) : (this._y = Math.atan2(-d, a),
  38726. this._z = 0)) : "ZXY" === t ? (this._x = Math.asin(r(p, -1, 1)),
  38727. Math.abs(p) < .99999 ? (this._y = Math.atan2(-d, f),
  38728. this._z = Math.atan2(-s, h)) : (this._y = 0,
  38729. this._z = Math.atan2(c, a))) : "ZYX" === t ? (this._y = Math.asin(-r(d, -1, 1)),
  38730. Math.abs(d) < .99999 ? (this._x = Math.atan2(p, f),
  38731. this._z = Math.atan2(c, a)) : (this._x = 0,
  38732. this._z = Math.atan2(-s, h))) : "YZX" === t ? (this._z = Math.asin(r(c, -1, 1)),
  38733. Math.abs(c) < .99999 ? (this._x = Math.atan2(-u, h),
  38734. this._y = Math.atan2(-d, a)) : (this._x = 0,
  38735. this._y = Math.atan2(l, f))) : "XZY" === t ? (this._z = Math.asin(-r(s, -1, 1)),
  38736. Math.abs(s) < .99999 ? (this._x = Math.atan2(p, h),
  38737. this._y = Math.atan2(l, a)) : (this._x = Math.atan2(-u, f),
  38738. this._y = 0)) : console.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: " + t),
  38739. this._order = t,
  38740. i !== !1 && this.onChangeCallback(),
  38741. this
  38742. },
  38743. setFromQuaternion: function() {
  38744. var e;
  38745. return function(t, i, r) {
  38746. return void 0 === e && (e = new n.Matrix4),
  38747. e.makeRotationFromQuaternion(t),
  38748. this.setFromRotationMatrix(e, i, r),
  38749. this
  38750. }
  38751. }(),
  38752. setFromVector3: function(e, t) {
  38753. return this.set(e.x, e.y, e.z, t || this._order)
  38754. },
  38755. reorder: function() {
  38756. var e = new n.Quaternion;
  38757. return function(t) {
  38758. e.setFromEuler(this),
  38759. this.setFromQuaternion(e, t)
  38760. }
  38761. }(),
  38762. equals: function(e) {
  38763. return e._x === this._x && e._y === this._y && e._z === this._z && e._order === this._order
  38764. },
  38765. fromArray: function(e) {
  38766. return this._x = e[0],
  38767. this._y = e[1],
  38768. this._z = e[2],
  38769. void 0 !== e[3] && (this._order = e[3]),
  38770. this.onChangeCallback(),
  38771. this
  38772. },
  38773. toArray: function(e, t) {
  38774. return void 0 === e && (e = []),
  38775. void 0 === t && (t = 0),
  38776. e[t] = this._x,
  38777. e[t + 1] = this._y,
  38778. e[t + 2] = this._z,
  38779. e[t + 3] = this._order,
  38780. e
  38781. },
  38782. toVector3: function(e) {
  38783. return e ? e.set(this._x, this._y, this._z) : new n.Vector3(this._x,this._y,this._z)
  38784. },
  38785. onChange: function(e) {
  38786. return this.onChangeCallback = e,
  38787. this
  38788. },
  38789. onChangeCallback: function() {}
  38790. },
  38791. n.Line3 = function(e, t) {
  38792. this.start = void 0 !== e ? e : new n.Vector3,
  38793. this.end = void 0 !== t ? t : new n.Vector3
  38794. }
  38795. ,
  38796. n.Line3.prototype = {
  38797. constructor: n.Line3,
  38798. set: function(e, t) {
  38799. return this.start.copy(e),
  38800. this.end.copy(t),
  38801. this
  38802. },
  38803. clone: function() {
  38804. return (new this.constructor).copy(this)
  38805. },
  38806. copy: function(e) {
  38807. return this.start.copy(e.start),
  38808. this.end.copy(e.end),
  38809. this
  38810. },
  38811. center: function(e) {
  38812. var t = e || new n.Vector3;
  38813. return t.addVectors(this.start, this.end).multiplyScalar(.5)
  38814. },
  38815. delta: function(e) {
  38816. var t = e || new n.Vector3;
  38817. return t.subVectors(this.end, this.start)
  38818. },
  38819. distanceSq: function() {
  38820. return this.start.distanceToSquared(this.end)
  38821. },
  38822. distance: function() {
  38823. return this.start.distanceTo(this.end)
  38824. },
  38825. at: function(e, t) {
  38826. var i = t || new n.Vector3;
  38827. return this.delta(i).multiplyScalar(e).add(this.start)
  38828. },
  38829. closestPointToPointParameter: function() {
  38830. var e = new n.Vector3
  38831. , t = new n.Vector3;
  38832. return function(i, r) {
  38833. e.subVectors(i, this.start),
  38834. t.subVectors(this.end, this.start);
  38835. var o = t.dot(t)
  38836. , a = t.dot(e)
  38837. , s = a / o;
  38838. return r && (s = n.Math.clamp(s, 0, 1)),
  38839. s
  38840. }
  38841. }(),
  38842. closestPointToPoint: function(e, t, i) {
  38843. var r = this.closestPointToPointParameter(e, t)
  38844. , o = i || new n.Vector3;
  38845. return this.delta(o).multiplyScalar(r).add(this.start)
  38846. },
  38847. applyMatrix4: function(e) {
  38848. return this.start.applyMatrix4(e),
  38849. this.end.applyMatrix4(e),
  38850. this
  38851. },
  38852. equals: function(e) {
  38853. return e.start.equals(this.start) && e.end.equals(this.end)
  38854. }
  38855. },
  38856. n.Box2 = function(e, t) {
  38857. this.min = void 0 !== e ? e : new n.Vector2(+(1 / 0),+(1 / 0)),
  38858. this.max = void 0 !== t ? t : new n.Vector2(-(1 / 0),-(1 / 0))
  38859. }
  38860. ,
  38861. n.Box2.prototype = {
  38862. constructor: n.Box2,
  38863. set: function(e, t) {
  38864. return this.min.copy(e),
  38865. this.max.copy(t),
  38866. this
  38867. },
  38868. setFromPoints: function(e) {
  38869. this.makeEmpty();
  38870. for (var t = 0, i = e.length; t < i; t++)
  38871. this.expandByPoint(e[t]);
  38872. return this
  38873. },
  38874. setFromCenterAndSize: function() {
  38875. var e = new n.Vector2;
  38876. return function(t, i) {
  38877. var n = e.copy(i).multiplyScalar(.5);
  38878. return this.min.copy(t).sub(n),
  38879. this.max.copy(t).add(n),
  38880. this
  38881. }
  38882. }(),
  38883. clone: function() {
  38884. return (new this.constructor).copy(this)
  38885. },
  38886. copy: function(e) {
  38887. return this.min.copy(e.min),
  38888. this.max.copy(e.max),
  38889. this
  38890. },
  38891. makeEmpty: function() {
  38892. return this.min.x = this.min.y = +(1 / 0),
  38893. this.max.x = this.max.y = -(1 / 0),
  38894. this
  38895. },
  38896. isEmpty: function() {
  38897. return this.max.x < this.min.x || this.max.y < this.min.y
  38898. },
  38899. center: function(e) {
  38900. var t = e || new n.Vector2;
  38901. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  38902. },
  38903. size: function(e) {
  38904. var t = e || new n.Vector2;
  38905. return t.subVectors(this.max, this.min)
  38906. },
  38907. expandByPoint: function(e) {
  38908. return this.min.min(e),
  38909. this.max.max(e),
  38910. this
  38911. },
  38912. expandByVector: function(e) {
  38913. return this.min.sub(e),
  38914. this.max.add(e),
  38915. this
  38916. },
  38917. expandByScalar: function(e) {
  38918. return this.min.addScalar(-e),
  38919. this.max.addScalar(e),
  38920. this
  38921. },
  38922. containsPoint: function(e) {
  38923. return !(e.x < this.min.x || e.x > this.max.x || e.y < this.min.y || e.y > this.max.y)
  38924. },
  38925. containsBox: function(e) {
  38926. 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
  38927. },
  38928. getParameter: function(e, t) {
  38929. var i = t || new n.Vector2;
  38930. 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))
  38931. },
  38932. intersectsBox: function(e) {
  38933. 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)
  38934. },
  38935. clampPoint: function(e, t) {
  38936. var i = t || new n.Vector2;
  38937. return i.copy(e).clamp(this.min, this.max)
  38938. },
  38939. distanceToPoint: function() {
  38940. var e = new n.Vector2;
  38941. return function(t) {
  38942. var i = e.copy(t).clamp(this.min, this.max);
  38943. return i.sub(t).length()
  38944. }
  38945. }(),
  38946. intersect: function(e) {
  38947. return this.min.max(e.min),
  38948. this.max.min(e.max),
  38949. this
  38950. },
  38951. union: function(e) {
  38952. return this.min.min(e.min),
  38953. this.max.max(e.max),
  38954. this
  38955. },
  38956. translate: function(e) {
  38957. return this.min.add(e),
  38958. this.max.add(e),
  38959. this
  38960. },
  38961. equals: function(e) {
  38962. return e.min.equals(this.min) && e.max.equals(this.max)
  38963. }
  38964. },
  38965. n.Box3 = function(e, t) {
  38966. this.min = void 0 !== e ? e : new n.Vector3(+(1 / 0),+(1 / 0),+(1 / 0)),
  38967. this.max = void 0 !== t ? t : new n.Vector3(-(1 / 0),-(1 / 0),-(1 / 0))
  38968. }
  38969. ,
  38970. n.Box3.prototype = {
  38971. constructor: n.Box3,
  38972. set: function(e, t) {
  38973. return this.min.copy(e),
  38974. this.max.copy(t),
  38975. this
  38976. },
  38977. setFromArray: function(e) {
  38978. this.makeEmpty();
  38979. 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) {
  38980. var c = e[s]
  38981. , h = e[s + 1]
  38982. , u = e[s + 2];
  38983. c < t && (t = c),
  38984. h < i && (i = h),
  38985. u < n && (n = u),
  38986. c > r && (r = c),
  38987. h > o && (o = h),
  38988. u > a && (a = u)
  38989. }
  38990. this.min.set(t, i, n),
  38991. this.max.set(r, o, a)
  38992. },
  38993. setFromPoints: function(e) {
  38994. this.makeEmpty();
  38995. for (var t = 0, i = e.length; t < i; t++)
  38996. this.expandByPoint(e[t]);
  38997. return this
  38998. },
  38999. setFromCenterAndSize: function() {
  39000. var e = new n.Vector3;
  39001. return function(t, i) {
  39002. var n = e.copy(i).multiplyScalar(.5);
  39003. return this.min.copy(t).sub(n),
  39004. this.max.copy(t).add(n),
  39005. this
  39006. }
  39007. }(),
  39008. setFromObject: function() {
  39009. var e;
  39010. return function(t) {
  39011. void 0 === e && (e = new n.Box3);
  39012. var i = this;
  39013. return this.makeEmpty(),
  39014. t.updateMatrixWorld(!0),
  39015. t.traverse(function(t) {
  39016. var n = t.geometry;
  39017. void 0 !== n && (null === n.boundingBox && n.computeBoundingBox(),
  39018. n.boundingBox.isEmpty() === !1 && (e.copy(n.boundingBox),
  39019. e.applyMatrix4(t.matrixWorld),
  39020. i.union(e)))
  39021. }),
  39022. this
  39023. }
  39024. }(),
  39025. clone: function() {
  39026. return (new this.constructor).copy(this)
  39027. },
  39028. copy: function(e) {
  39029. return this.min.copy(e.min),
  39030. this.max.copy(e.max),
  39031. this
  39032. },
  39033. makeEmpty: function() {
  39034. return this.min.x = this.min.y = this.min.z = +(1 / 0),
  39035. this.max.x = this.max.y = this.max.z = -(1 / 0),
  39036. this
  39037. },
  39038. isEmpty: function() {
  39039. return this.max.x < this.min.x || this.max.y < this.min.y || this.max.z < this.min.z
  39040. },
  39041. center: function(e) {
  39042. var t = e || new n.Vector3;
  39043. return t.addVectors(this.min, this.max).multiplyScalar(.5)
  39044. },
  39045. size: function(e) {
  39046. var t = e || new n.Vector3;
  39047. return t.subVectors(this.max, this.min)
  39048. },
  39049. expandByPoint: function(e) {
  39050. return this.min.min(e),
  39051. this.max.max(e),
  39052. this
  39053. },
  39054. expandByVector: function(e) {
  39055. return this.min.sub(e),
  39056. this.max.add(e),
  39057. this
  39058. },
  39059. expandByScalar: function(e) {
  39060. return this.min.addScalar(-e),
  39061. this.max.addScalar(e),
  39062. this
  39063. },
  39064. containsPoint: function(e) {
  39065. 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)
  39066. },
  39067. containsBox: function(e) {
  39068. 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
  39069. },
  39070. getParameter: function(e, t) {
  39071. var i = t || new n.Vector3;
  39072. 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))
  39073. },
  39074. intersectsBox: function(e) {
  39075. 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)
  39076. },
  39077. intersectsSphere: function() {
  39078. var e;
  39079. return function(t) {
  39080. return void 0 === e && (e = new n.Vector3),
  39081. this.clampPoint(t.center, e),
  39082. e.distanceToSquared(t.center) <= t.radius * t.radius
  39083. }
  39084. }(),
  39085. intersectsPlane: function(e) {
  39086. var t, i;
  39087. return e.normal.x > 0 ? (t = e.normal.x * this.min.x,
  39088. i = e.normal.x * this.max.x) : (t = e.normal.x * this.max.x,
  39089. i = e.normal.x * this.min.x),
  39090. e.normal.y > 0 ? (t += e.normal.y * this.min.y,
  39091. i += e.normal.y * this.max.y) : (t += e.normal.y * this.max.y,
  39092. i += e.normal.y * this.min.y),
  39093. e.normal.z > 0 ? (t += e.normal.z * this.min.z,
  39094. i += e.normal.z * this.max.z) : (t += e.normal.z * this.max.z,
  39095. i += e.normal.z * this.min.z),
  39096. t <= e.constant && i >= e.constant
  39097. },
  39098. clampPoint: function(e, t) {
  39099. var i = t || new n.Vector3;
  39100. return i.copy(e).clamp(this.min, this.max)
  39101. },
  39102. distanceToPoint: function() {
  39103. var e = new n.Vector3;
  39104. return function(t) {
  39105. var i = e.copy(t).clamp(this.min, this.max);
  39106. return i.sub(t).length()
  39107. }
  39108. }(),
  39109. getBoundingSphere: function() {
  39110. var e = new n.Vector3;
  39111. return function(t) {
  39112. var i = t || new n.Sphere;
  39113. return i.center = this.center(),
  39114. i.radius = .5 * this.size(e).length(),
  39115. i
  39116. }
  39117. }(),
  39118. intersect: function(e) {
  39119. return this.min.max(e.min),
  39120. this.max.min(e.max),
  39121. this
  39122. },
  39123. union: function(e) {
  39124. return this.min.min(e.min),
  39125. this.max.max(e.max),
  39126. this
  39127. },
  39128. applyMatrix4: function() {
  39129. 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];
  39130. return function(t) {
  39131. return e[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t),
  39132. e[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t),
  39133. e[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t),
  39134. e[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t),
  39135. e[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t),
  39136. e[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t),
  39137. e[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t),
  39138. e[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t),
  39139. this.makeEmpty(),
  39140. this.setFromPoints(e),
  39141. this
  39142. }
  39143. }(),
  39144. translate: function(e) {
  39145. return this.min.add(e),
  39146. this.max.add(e),
  39147. this
  39148. },
  39149. equals: function(e) {
  39150. return e.min.equals(this.min) && e.max.equals(this.max)
  39151. }
  39152. },
  39153. n.Matrix3 = function() {
  39154. this.elements = new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]),
  39155. arguments.length > 0 && console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")
  39156. }
  39157. ,
  39158. n.Matrix3.prototype = {
  39159. constructor: n.Matrix3,
  39160. set: function(e, t, i, n, r, o, a, s, l) {
  39161. var c = this.elements;
  39162. return c[0] = e,
  39163. c[1] = n,
  39164. c[2] = a,
  39165. c[3] = t,
  39166. c[4] = r,
  39167. c[5] = s,
  39168. c[6] = i,
  39169. c[7] = o,
  39170. c[8] = l,
  39171. this
  39172. },
  39173. identity: function() {
  39174. return this.set(1, 0, 0, 0, 1, 0, 0, 0, 1),
  39175. this
  39176. },
  39177. clone: function() {
  39178. return (new this.constructor).fromArray(this.elements)
  39179. },
  39180. copy: function(e) {
  39181. var t = e.elements;
  39182. return this.set(t[0], t[3], t[6], t[1], t[4], t[7], t[2], t[5], t[8]),
  39183. this
  39184. },
  39185. setFromMatrix4: function(e) {
  39186. var t = e.elements;
  39187. return this.set(t[0], t[4], t[8], t[1], t[5], t[9], t[2], t[6], t[10]),
  39188. this
  39189. },
  39190. applyToVector3Array: function() {
  39191. var e;
  39192. return function(t, i, r) {
  39193. void 0 === e && (e = new n.Vector3),
  39194. void 0 === i && (i = 0),
  39195. void 0 === r && (r = t.length);
  39196. for (var o = 0, a = i; o < r; o += 3,
  39197. a += 3)
  39198. e.fromArray(t, a),
  39199. e.applyMatrix3(this),
  39200. e.toArray(t, a);
  39201. return t
  39202. }
  39203. }(),
  39204. applyToBuffer: function() {
  39205. var e;
  39206. return function(t, i, r) {
  39207. void 0 === e && (e = new n.Vector3),
  39208. void 0 === i && (i = 0),
  39209. void 0 === r && (r = t.length / t.itemSize);
  39210. for (var o = 0, a = i; o < r; o++,
  39211. a++)
  39212. e.x = t.getX(a),
  39213. e.y = t.getY(a),
  39214. e.z = t.getZ(a),
  39215. e.applyMatrix3(this),
  39216. t.setXYZ(e.x, e.y, e.z);
  39217. return t
  39218. }
  39219. }(),
  39220. multiplyScalar: function(e) {
  39221. var t = this.elements;
  39222. return t[0] *= e,
  39223. t[3] *= e,
  39224. t[6] *= e,
  39225. t[1] *= e,
  39226. t[4] *= e,
  39227. t[7] *= e,
  39228. t[2] *= e,
  39229. t[5] *= e,
  39230. t[8] *= e,
  39231. this
  39232. },
  39233. determinant: function() {
  39234. var e = this.elements
  39235. , t = e[0]
  39236. , i = e[1]
  39237. , n = e[2]
  39238. , r = e[3]
  39239. , o = e[4]
  39240. , a = e[5]
  39241. , s = e[6]
  39242. , l = e[7]
  39243. , c = e[8];
  39244. return t * o * c - t * a * l - i * r * c + i * a * s + n * r * l - n * o * s
  39245. },
  39246. getInverse: function(e, t) {
  39247. e instanceof n.Matrix4 && console.warn("THREE.Matrix3.getInverse no longer takes a Matrix4 argument.");
  39248. var i = e.elements
  39249. , r = this.elements
  39250. , o = i[0]
  39251. , a = i[1]
  39252. , s = i[2]
  39253. , l = i[3]
  39254. , c = i[4]
  39255. , h = i[5]
  39256. , u = i[6]
  39257. , d = i[7]
  39258. , p = i[8]
  39259. , f = p * c - h * d
  39260. , g = h * u - p * l
  39261. , m = d * l - c * u
  39262. , v = o * f + a * g + s * m;
  39263. if (0 === v) {
  39264. var A = "THREE.Matrix3.getInverse(): can't invert matrix, determinant is 0";
  39265. if (t)
  39266. throw new Error(A);
  39267. return console.warn(A),
  39268. this.identity()
  39269. }
  39270. return r[0] = f,
  39271. r[1] = s * d - p * a,
  39272. r[2] = h * a - s * c,
  39273. r[3] = g,
  39274. r[4] = p * o - s * u,
  39275. r[5] = s * l - h * o,
  39276. r[6] = m,
  39277. r[7] = a * u - d * o,
  39278. r[8] = c * o - a * l,
  39279. this.multiplyScalar(1 / v)
  39280. },
  39281. transpose: function() {
  39282. var e, t = this.elements;
  39283. return e = t[1],
  39284. t[1] = t[3],
  39285. t[3] = e,
  39286. e = t[2],
  39287. t[2] = t[6],
  39288. t[6] = e,
  39289. e = t[5],
  39290. t[5] = t[7],
  39291. t[7] = e,
  39292. this
  39293. },
  39294. flattenToArrayOffset: function(e, t) {
  39295. var i = this.elements;
  39296. return e[t] = i[0],
  39297. e[t + 1] = i[1],
  39298. e[t + 2] = i[2],
  39299. e[t + 3] = i[3],
  39300. e[t + 4] = i[4],
  39301. e[t + 5] = i[5],
  39302. e[t + 6] = i[6],
  39303. e[t + 7] = i[7],
  39304. e[t + 8] = i[8],
  39305. e
  39306. },
  39307. getNormalMatrix: function(e) {
  39308. return this.setFromMatrix4(e).getInverse(this).transpose()
  39309. },
  39310. transposeIntoArray: function(e) {
  39311. var t = this.elements;
  39312. return e[0] = t[0],
  39313. e[1] = t[3],
  39314. e[2] = t[6],
  39315. e[3] = t[1],
  39316. e[4] = t[4],
  39317. e[5] = t[7],
  39318. e[6] = t[2],
  39319. e[7] = t[5],
  39320. e[8] = t[8],
  39321. this
  39322. },
  39323. fromArray: function(e) {
  39324. return this.elements.set(e),
  39325. this
  39326. },
  39327. toArray: function() {
  39328. var e = this.elements;
  39329. return [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]]
  39330. }
  39331. },
  39332. n.Matrix4 = function() {
  39333. this.elements = new Float32Array([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]),
  39334. arguments.length > 0 && console.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")
  39335. }
  39336. ,
  39337. n.Matrix4.prototype = {
  39338. constructor: n.Matrix4,
  39339. set: function(e, t, i, n, r, o, a, s, l, c, h, u, d, p, f, g) {
  39340. var m = this.elements;
  39341. return m[0] = e,
  39342. m[4] = t,
  39343. m[8] = i,
  39344. m[12] = n,
  39345. m[1] = r,
  39346. m[5] = o,
  39347. m[9] = a,
  39348. m[13] = s,
  39349. m[2] = l,
  39350. m[6] = c,
  39351. m[10] = h,
  39352. m[14] = u,
  39353. m[3] = d,
  39354. m[7] = p,
  39355. m[11] = f,
  39356. m[15] = g,
  39357. this
  39358. },
  39359. identity: function() {
  39360. return this.set(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39361. this
  39362. },
  39363. clone: function() {
  39364. return (new n.Matrix4).fromArray(this.elements)
  39365. },
  39366. copy: function(e) {
  39367. return this.elements.set(e.elements),
  39368. this
  39369. },
  39370. copyPosition: function(e) {
  39371. var t = this.elements
  39372. , i = e.elements;
  39373. return t[12] = i[12],
  39374. t[13] = i[13],
  39375. t[14] = i[14],
  39376. this
  39377. },
  39378. extractBasis: function(e, t, i) {
  39379. return e.setFromMatrixColumn(this, 0),
  39380. t.setFromMatrixColumn(this, 1),
  39381. i.setFromMatrixColumn(this, 2),
  39382. this
  39383. },
  39384. makeBasis: function(e, t, i) {
  39385. 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),
  39386. this
  39387. },
  39388. extractRotation: function() {
  39389. var e;
  39390. return function(t) {
  39391. void 0 === e && (e = new n.Vector3);
  39392. var i = this.elements
  39393. , r = t.elements
  39394. , o = 1 / e.setFromMatrixColumn(t, 0).length()
  39395. , a = 1 / e.setFromMatrixColumn(t, 1).length()
  39396. , s = 1 / e.setFromMatrixColumn(t, 2).length();
  39397. return i[0] = r[0] * o,
  39398. i[1] = r[1] * o,
  39399. i[2] = r[2] * o,
  39400. i[4] = r[4] * a,
  39401. i[5] = r[5] * a,
  39402. i[6] = r[6] * a,
  39403. i[8] = r[8] * s,
  39404. i[9] = r[9] * s,
  39405. i[10] = r[10] * s,
  39406. this
  39407. }
  39408. }(),
  39409. makeRotationFromEuler: function(e) {
  39410. e instanceof n.Euler == !1 && console.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");
  39411. var t = this.elements
  39412. , i = e.x
  39413. , r = e.y
  39414. , o = e.z
  39415. , a = Math.cos(i)
  39416. , s = Math.sin(i)
  39417. , l = Math.cos(r)
  39418. , c = Math.sin(r)
  39419. , h = Math.cos(o)
  39420. , u = Math.sin(o);
  39421. if ("XYZ" === e.order) {
  39422. var d = a * h
  39423. , p = a * u
  39424. , f = s * h
  39425. , g = s * u;
  39426. t[0] = l * h,
  39427. t[4] = -l * u,
  39428. t[8] = c,
  39429. t[1] = p + f * c,
  39430. t[5] = d - g * c,
  39431. t[9] = -s * l,
  39432. t[2] = g - d * c,
  39433. t[6] = f + p * c,
  39434. t[10] = a * l
  39435. } else if ("YXZ" === e.order) {
  39436. var m = l * h
  39437. , v = l * u
  39438. , A = c * h
  39439. , y = c * u;
  39440. t[0] = m + y * s,
  39441. t[4] = A * s - v,
  39442. t[8] = a * c,
  39443. t[1] = a * u,
  39444. t[5] = a * h,
  39445. t[9] = -s,
  39446. t[2] = v * s - A,
  39447. t[6] = y + m * s,
  39448. t[10] = a * l
  39449. } else if ("ZXY" === e.order) {
  39450. var m = l * h
  39451. , v = l * u
  39452. , A = c * h
  39453. , y = c * u;
  39454. t[0] = m - y * s,
  39455. t[4] = -a * u,
  39456. t[8] = A + v * s,
  39457. t[1] = v + A * s,
  39458. t[5] = a * h,
  39459. t[9] = y - m * s,
  39460. t[2] = -a * c,
  39461. t[6] = s,
  39462. t[10] = a * l
  39463. } else if ("ZYX" === e.order) {
  39464. var d = a * h
  39465. , p = a * u
  39466. , f = s * h
  39467. , g = s * u;
  39468. t[0] = l * h,
  39469. t[4] = f * c - p,
  39470. t[8] = d * c + g,
  39471. t[1] = l * u,
  39472. t[5] = g * c + d,
  39473. t[9] = p * c - f,
  39474. t[2] = -c,
  39475. t[6] = s * l,
  39476. t[10] = a * l
  39477. } else if ("YZX" === e.order) {
  39478. var C = a * l
  39479. , I = a * c
  39480. , E = s * l
  39481. , b = s * c;
  39482. t[0] = l * h,
  39483. t[4] = b - C * u,
  39484. t[8] = E * u + I,
  39485. t[1] = u,
  39486. t[5] = a * h,
  39487. t[9] = -s * h,
  39488. t[2] = -c * h,
  39489. t[6] = I * u + E,
  39490. t[10] = C - b * u
  39491. } else if ("XZY" === e.order) {
  39492. var C = a * l
  39493. , I = a * c
  39494. , E = s * l
  39495. , b = s * c;
  39496. t[0] = l * h,
  39497. t[4] = -u,
  39498. t[8] = c * h,
  39499. t[1] = C * u + b,
  39500. t[5] = a * h,
  39501. t[9] = I * u - E,
  39502. t[2] = E * u - I,
  39503. t[6] = s * h,
  39504. t[10] = b * u + C
  39505. }
  39506. return t[3] = 0,
  39507. t[7] = 0,
  39508. t[11] = 0,
  39509. t[12] = 0,
  39510. t[13] = 0,
  39511. t[14] = 0,
  39512. t[15] = 1,
  39513. this
  39514. },
  39515. makeRotationFromQuaternion: function(e) {
  39516. var t = this.elements
  39517. , i = e.x
  39518. , n = e.y
  39519. , r = e.z
  39520. , o = e.w
  39521. , a = i + i
  39522. , s = n + n
  39523. , l = r + r
  39524. , c = i * a
  39525. , h = i * s
  39526. , u = i * l
  39527. , d = n * s
  39528. , p = n * l
  39529. , f = r * l
  39530. , g = o * a
  39531. , m = o * s
  39532. , v = o * l;
  39533. return t[0] = 1 - (d + f),
  39534. t[4] = h - v,
  39535. t[8] = u + m,
  39536. t[1] = h + v,
  39537. t[5] = 1 - (c + f),
  39538. t[9] = p - g,
  39539. t[2] = u - m,
  39540. t[6] = p + g,
  39541. t[10] = 1 - (c + d),
  39542. t[3] = 0,
  39543. t[7] = 0,
  39544. t[11] = 0,
  39545. t[12] = 0,
  39546. t[13] = 0,
  39547. t[14] = 0,
  39548. t[15] = 1,
  39549. this
  39550. },
  39551. lookAt: function() {
  39552. var e, t, i;
  39553. return function(r, o, a) {
  39554. void 0 === e && (e = new n.Vector3),
  39555. void 0 === t && (t = new n.Vector3),
  39556. void 0 === i && (i = new n.Vector3);
  39557. var s = this.elements;
  39558. return i.subVectors(r, o).normalize(),
  39559. 0 === i.lengthSq() && (i.z = 1),
  39560. e.crossVectors(a, i).normalize(),
  39561. 0 === e.lengthSq() && (i.x += 1e-4,
  39562. e.crossVectors(a, i).normalize()),
  39563. t.crossVectors(i, e),
  39564. s[0] = e.x,
  39565. s[4] = t.x,
  39566. s[8] = i.x,
  39567. s[1] = e.y,
  39568. s[5] = t.y,
  39569. s[9] = i.y,
  39570. s[2] = e.z,
  39571. s[6] = t.z,
  39572. s[10] = i.z,
  39573. this
  39574. }
  39575. }(),
  39576. multiply: function(e, t) {
  39577. return void 0 !== t ? (console.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),
  39578. this.multiplyMatrices(e, t)) : this.multiplyMatrices(this, e)
  39579. },
  39580. multiplyMatrices: function(e, t) {
  39581. var i = e.elements
  39582. , n = t.elements
  39583. , r = this.elements
  39584. , o = i[0]
  39585. , a = i[4]
  39586. , s = i[8]
  39587. , l = i[12]
  39588. , c = i[1]
  39589. , h = i[5]
  39590. , u = i[9]
  39591. , d = i[13]
  39592. , p = i[2]
  39593. , f = i[6]
  39594. , g = i[10]
  39595. , m = i[14]
  39596. , v = i[3]
  39597. , A = i[7]
  39598. , y = i[11]
  39599. , C = i[15]
  39600. , I = n[0]
  39601. , E = n[4]
  39602. , b = n[8]
  39603. , w = n[12]
  39604. , _ = n[1]
  39605. , T = n[5]
  39606. , x = n[9]
  39607. , S = n[13]
  39608. , M = n[2]
  39609. , R = n[6]
  39610. , P = n[10]
  39611. , O = n[14]
  39612. , L = n[3]
  39613. , D = n[7]
  39614. , N = n[11]
  39615. , B = n[15];
  39616. return r[0] = o * I + a * _ + s * M + l * L,
  39617. r[4] = o * E + a * T + s * R + l * D,
  39618. r[8] = o * b + a * x + s * P + l * N,
  39619. r[12] = o * w + a * S + s * O + l * B,
  39620. r[1] = c * I + h * _ + u * M + d * L,
  39621. r[5] = c * E + h * T + u * R + d * D,
  39622. r[9] = c * b + h * x + u * P + d * N,
  39623. r[13] = c * w + h * S + u * O + d * B,
  39624. r[2] = p * I + f * _ + g * M + m * L,
  39625. r[6] = p * E + f * T + g * R + m * D,
  39626. r[10] = p * b + f * x + g * P + m * N,
  39627. r[14] = p * w + f * S + g * O + m * B,
  39628. r[3] = v * I + A * _ + y * M + C * L,
  39629. r[7] = v * E + A * T + y * R + C * D,
  39630. r[11] = v * b + A * x + y * P + C * N,
  39631. r[15] = v * w + A * S + y * O + C * B,
  39632. this
  39633. },
  39634. multiplyToArray: function(e, t, i) {
  39635. var n = this.elements;
  39636. return this.multiplyMatrices(e, t),
  39637. i[0] = n[0],
  39638. i[1] = n[1],
  39639. i[2] = n[2],
  39640. i[3] = n[3],
  39641. i[4] = n[4],
  39642. i[5] = n[5],
  39643. i[6] = n[6],
  39644. i[7] = n[7],
  39645. i[8] = n[8],
  39646. i[9] = n[9],
  39647. i[10] = n[10],
  39648. i[11] = n[11],
  39649. i[12] = n[12],
  39650. i[13] = n[13],
  39651. i[14] = n[14],
  39652. i[15] = n[15],
  39653. this
  39654. },
  39655. multiplyScalar: function(e) {
  39656. var t = this.elements;
  39657. return t[0] *= e,
  39658. t[4] *= e,
  39659. t[8] *= e,
  39660. t[12] *= e,
  39661. t[1] *= e,
  39662. t[5] *= e,
  39663. t[9] *= e,
  39664. t[13] *= e,
  39665. t[2] *= e,
  39666. t[6] *= e,
  39667. t[10] *= e,
  39668. t[14] *= e,
  39669. t[3] *= e,
  39670. t[7] *= e,
  39671. t[11] *= e,
  39672. t[15] *= e,
  39673. this
  39674. },
  39675. applyToVector3Array: function() {
  39676. var e;
  39677. return function(t, i, r) {
  39678. void 0 === e && (e = new n.Vector3),
  39679. void 0 === i && (i = 0),
  39680. void 0 === r && (r = t.length);
  39681. for (var o = 0, a = i; o < r; o += 3,
  39682. a += 3)
  39683. e.fromArray(t, a),
  39684. e.applyMatrix4(this),
  39685. e.toArray(t, a);
  39686. return t
  39687. }
  39688. }(),
  39689. applyToBuffer: function() {
  39690. var e;
  39691. return function(t, i, r) {
  39692. void 0 === e && (e = new n.Vector3),
  39693. void 0 === i && (i = 0),
  39694. void 0 === r && (r = t.length / t.itemSize);
  39695. for (var o = 0, a = i; o < r; o++,
  39696. a++)
  39697. e.x = t.getX(a),
  39698. e.y = t.getY(a),
  39699. e.z = t.getZ(a),
  39700. e.applyMatrix4(this),
  39701. t.setXYZ(e.x, e.y, e.z);
  39702. return t
  39703. }
  39704. }(),
  39705. determinant: function() {
  39706. var e = this.elements
  39707. , t = e[0]
  39708. , i = e[4]
  39709. , n = e[8]
  39710. , r = e[12]
  39711. , o = e[1]
  39712. , a = e[5]
  39713. , s = e[9]
  39714. , l = e[13]
  39715. , c = e[2]
  39716. , h = e[6]
  39717. , u = e[10]
  39718. , d = e[14]
  39719. , p = e[3]
  39720. , f = e[7]
  39721. , g = e[11]
  39722. , m = e[15];
  39723. return p * (+r * s * h - n * l * h - r * a * u + i * l * u + n * a * d - i * s * d) + f * (+t * s * d - t * l * u + r * o * u - n * o * d + n * l * c - r * s * c) + g * (+t * l * h - t * a * d - r * o * h + i * o * d + r * a * c - i * l * c) + m * (-n * a * c - t * s * h + t * a * u + n * o * h - i * o * u + i * s * c)
  39724. },
  39725. transpose: function() {
  39726. var e, t = this.elements;
  39727. return e = t[1],
  39728. t[1] = t[4],
  39729. t[4] = e,
  39730. e = t[2],
  39731. t[2] = t[8],
  39732. t[8] = e,
  39733. e = t[6],
  39734. t[6] = t[9],
  39735. t[9] = e,
  39736. e = t[3],
  39737. t[3] = t[12],
  39738. t[12] = e,
  39739. e = t[7],
  39740. t[7] = t[13],
  39741. t[13] = e,
  39742. e = t[11],
  39743. t[11] = t[14],
  39744. t[14] = e,
  39745. this
  39746. },
  39747. flattenToArrayOffset: function(e, t) {
  39748. var i = this.elements;
  39749. return e[t] = i[0],
  39750. e[t + 1] = i[1],
  39751. e[t + 2] = i[2],
  39752. e[t + 3] = i[3],
  39753. e[t + 4] = i[4],
  39754. e[t + 5] = i[5],
  39755. e[t + 6] = i[6],
  39756. e[t + 7] = i[7],
  39757. e[t + 8] = i[8],
  39758. e[t + 9] = i[9],
  39759. e[t + 10] = i[10],
  39760. e[t + 11] = i[11],
  39761. e[t + 12] = i[12],
  39762. e[t + 13] = i[13],
  39763. e[t + 14] = i[14],
  39764. e[t + 15] = i[15],
  39765. e
  39766. },
  39767. getPosition: function() {
  39768. var e;
  39769. return function() {
  39770. return void 0 === e && (e = new n.Vector3),
  39771. console.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead."),
  39772. e.setFromMatrixColumn(this, 3)
  39773. }
  39774. }(),
  39775. setPosition: function(e) {
  39776. var t = this.elements;
  39777. return t[12] = e.x,
  39778. t[13] = e.y,
  39779. t[14] = e.z,
  39780. this
  39781. },
  39782. getInverse: function(e, t) {
  39783. var i = this.elements
  39784. , n = e.elements
  39785. , r = n[0]
  39786. , o = n[1]
  39787. , a = n[2]
  39788. , s = n[3]
  39789. , l = n[4]
  39790. , c = n[5]
  39791. , h = n[6]
  39792. , u = n[7]
  39793. , d = n[8]
  39794. , p = n[9]
  39795. , f = n[10]
  39796. , g = n[11]
  39797. , m = n[12]
  39798. , v = n[13]
  39799. , A = n[14]
  39800. , y = n[15]
  39801. , C = p * A * u - v * f * u + v * h * g - c * A * g - p * h * y + c * f * y
  39802. , I = m * f * u - d * A * u - m * h * g + l * A * g + d * h * y - l * f * y
  39803. , E = d * v * u - m * p * u + m * c * g - l * v * g - d * c * y + l * p * y
  39804. , b = m * p * h - d * v * h - m * c * f + l * v * f + d * c * A - l * p * A
  39805. , w = r * C + o * I + a * E + s * b;
  39806. if (0 === w) {
  39807. var _ = "THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0";
  39808. if (t)
  39809. throw new Error(_);
  39810. return console.warn(_),
  39811. this.identity()
  39812. }
  39813. return i[0] = C,
  39814. i[1] = v * f * s - p * A * s - v * a * g + o * A * g + p * a * y - o * f * y,
  39815. i[2] = c * A * s - v * h * s + v * a * u - o * A * u - c * a * y + o * h * y,
  39816. i[3] = p * h * s - c * f * s - p * a * u + o * f * u + c * a * g - o * h * g,
  39817. i[4] = I,
  39818. i[5] = d * A * s - m * f * s + m * a * g - r * A * g - d * a * y + r * f * y,
  39819. i[6] = m * h * s - l * A * s - m * a * u + r * A * u + l * a * y - r * h * y,
  39820. i[7] = l * f * s - d * h * s + d * a * u - r * f * u - l * a * g + r * h * g,
  39821. i[8] = E,
  39822. i[9] = m * p * s - d * v * s - m * o * g + r * v * g + d * o * y - r * p * y,
  39823. i[10] = l * v * s - m * c * s + m * o * u - r * v * u - l * o * y + r * c * y,
  39824. i[11] = d * c * s - l * p * s - d * o * u + r * p * u + l * o * g - r * c * g,
  39825. i[12] = b,
  39826. i[13] = d * v * a - m * p * a + m * o * f - r * v * f - d * o * A + r * p * A,
  39827. i[14] = m * c * a - l * v * a - m * o * h + r * v * h + l * o * A - r * c * A,
  39828. i[15] = l * p * a - d * c * a + d * o * h - r * p * h - l * o * f + r * c * f,
  39829. this.multiplyScalar(1 / w)
  39830. },
  39831. scale: function(e) {
  39832. var t = this.elements
  39833. , i = e.x
  39834. , n = e.y
  39835. , r = e.z;
  39836. return t[0] *= i,
  39837. t[4] *= n,
  39838. t[8] *= r,
  39839. t[1] *= i,
  39840. t[5] *= n,
  39841. t[9] *= r,
  39842. t[2] *= i,
  39843. t[6] *= n,
  39844. t[10] *= r,
  39845. t[3] *= i,
  39846. t[7] *= n,
  39847. t[11] *= r,
  39848. this
  39849. },
  39850. getMaxScaleOnAxis: function() {
  39851. var e = this.elements
  39852. , t = e[0] * e[0] + e[1] * e[1] + e[2] * e[2]
  39853. , i = e[4] * e[4] + e[5] * e[5] + e[6] * e[6]
  39854. , n = e[8] * e[8] + e[9] * e[9] + e[10] * e[10];
  39855. return Math.sqrt(Math.max(t, i, n))
  39856. },
  39857. makeTranslation: function(e, t, i) {
  39858. return this.set(1, 0, 0, e, 0, 1, 0, t, 0, 0, 1, i, 0, 0, 0, 1),
  39859. this
  39860. },
  39861. makeRotationX: function(e) {
  39862. var t = Math.cos(e)
  39863. , i = Math.sin(e);
  39864. return this.set(1, 0, 0, 0, 0, t, -i, 0, 0, i, t, 0, 0, 0, 0, 1),
  39865. this
  39866. },
  39867. makeRotationY: function(e) {
  39868. var t = Math.cos(e)
  39869. , i = Math.sin(e);
  39870. return this.set(t, 0, i, 0, 0, 1, 0, 0, -i, 0, t, 0, 0, 0, 0, 1),
  39871. this
  39872. },
  39873. makeRotationZ: function(e) {
  39874. var t = Math.cos(e)
  39875. , i = Math.sin(e);
  39876. return this.set(t, -i, 0, 0, i, t, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1),
  39877. this
  39878. },
  39879. makeRotationAxis: function(e, t) {
  39880. var i = Math.cos(t)
  39881. , n = Math.sin(t)
  39882. , r = 1 - i
  39883. , o = e.x
  39884. , a = e.y
  39885. , s = e.z
  39886. , l = r * o
  39887. , c = r * a;
  39888. 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),
  39889. this
  39890. },
  39891. makeScale: function(e, t, i) {
  39892. return this.set(e, 0, 0, 0, 0, t, 0, 0, 0, 0, i, 0, 0, 0, 0, 1),
  39893. this
  39894. },
  39895. compose: function(e, t, i) {
  39896. return this.makeRotationFromQuaternion(t),
  39897. this.scale(i),
  39898. this.setPosition(e),
  39899. this
  39900. },
  39901. decompose: function() {
  39902. var e, t;
  39903. return function(i, r, o) {
  39904. void 0 === e && (e = new n.Vector3),
  39905. void 0 === t && (t = new n.Matrix4);
  39906. var a = this.elements
  39907. , s = e.set(a[0], a[1], a[2]).length()
  39908. , l = e.set(a[4], a[5], a[6]).length()
  39909. , c = e.set(a[8], a[9], a[10]).length()
  39910. , h = this.determinant();
  39911. h < 0 && (s = -s),
  39912. i.x = a[12],
  39913. i.y = a[13],
  39914. i.z = a[14],
  39915. t.elements.set(this.elements);
  39916. var u = 1 / s
  39917. , d = 1 / l
  39918. , p = 1 / c;
  39919. return t.elements[0] *= u,
  39920. t.elements[1] *= u,
  39921. t.elements[2] *= u,
  39922. t.elements[4] *= d,
  39923. t.elements[5] *= d,
  39924. t.elements[6] *= d,
  39925. t.elements[8] *= p,
  39926. t.elements[9] *= p,
  39927. t.elements[10] *= p,
  39928. r.setFromRotationMatrix(t),
  39929. o.x = s,
  39930. o.y = l,
  39931. o.z = c,
  39932. this
  39933. }
  39934. }(),
  39935. makeFrustum: function(e, t, i, n, r, o) {
  39936. var a = this.elements
  39937. , s = 2 * r / (t - e)
  39938. , l = 2 * r / (n - i)
  39939. , c = (t + e) / (t - e)
  39940. , h = (n + i) / (n - i)
  39941. , u = -(o + r) / (o - r)
  39942. , d = -2 * o * r / (o - r);
  39943. return a[0] = s,
  39944. a[4] = 0,
  39945. a[8] = c,
  39946. a[12] = 0,
  39947. a[1] = 0,
  39948. a[5] = l,
  39949. a[9] = h,
  39950. a[13] = 0,
  39951. a[2] = 0,
  39952. a[6] = 0,
  39953. a[10] = u,
  39954. a[14] = d,
  39955. a[3] = 0,
  39956. a[7] = 0,
  39957. a[11] = -1,
  39958. a[15] = 0,
  39959. this
  39960. },
  39961. makePerspective: function(e, t, i, r) {
  39962. var o = i * Math.tan(n.Math.degToRad(.5 * e))
  39963. , a = -o
  39964. , s = a * t
  39965. , l = o * t;
  39966. return this.makeFrustum(s, l, a, o, i, r)
  39967. },
  39968. makeOrthographic: function(e, t, i, n, r, o) {
  39969. var a = this.elements
  39970. , s = 1 / (t - e)
  39971. , l = 1 / (i - n)
  39972. , c = 1 / (o - r)
  39973. , h = (t + e) * s
  39974. , u = (i + n) * l
  39975. , d = (o + r) * c;
  39976. return a[0] = 2 * s,
  39977. a[4] = 0,
  39978. a[8] = 0,
  39979. a[12] = -h,
  39980. a[1] = 0,
  39981. a[5] = 2 * l,
  39982. a[9] = 0,
  39983. a[13] = -u,
  39984. a[2] = 0,
  39985. a[6] = 0,
  39986. a[10] = -2 * c,
  39987. a[14] = -d,
  39988. a[3] = 0,
  39989. a[7] = 0,
  39990. a[11] = 0,
  39991. a[15] = 1,
  39992. this
  39993. },
  39994. equals: function(e) {
  39995. for (var t = this.elements, i = e.elements, n = 0; n < 16; n++)
  39996. if (t[n] !== i[n])
  39997. return !1;
  39998. return !0
  39999. },
  40000. fromArray: function(e) {
  40001. return this.elements.set(e),
  40002. this
  40003. },
  40004. toArray: function() {
  40005. var e = this.elements;
  40006. 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]]
  40007. }
  40008. },
  40009. n.Ray = function(e, t) {
  40010. this.origin = void 0 !== e ? e : new n.Vector3,
  40011. this.direction = void 0 !== t ? t : new n.Vector3
  40012. }
  40013. ,
  40014. n.Ray.prototype = {
  40015. constructor: n.Ray,
  40016. set: function(e, t) {
  40017. return this.origin.copy(e),
  40018. this.direction.copy(t),
  40019. this
  40020. },
  40021. clone: function() {
  40022. return (new this.constructor).copy(this)
  40023. },
  40024. copy: function(e) {
  40025. return this.origin.copy(e.origin),
  40026. this.direction.copy(e.direction),
  40027. this
  40028. },
  40029. at: function(e, t) {
  40030. var i = t || new n.Vector3;
  40031. return i.copy(this.direction).multiplyScalar(e).add(this.origin)
  40032. },
  40033. lookAt: function(e) {
  40034. this.direction.copy(e).sub(this.origin).normalize()
  40035. },
  40036. recast: function() {
  40037. var e = new n.Vector3;
  40038. return function(t) {
  40039. return this.origin.copy(this.at(t, e)),
  40040. this
  40041. }
  40042. }(),
  40043. closestPointToPoint: function(e, t) {
  40044. var i = t || new n.Vector3;
  40045. i.subVectors(e, this.origin);
  40046. var r = i.dot(this.direction);
  40047. return r < 0 ? i.copy(this.origin) : i.copy(this.direction).multiplyScalar(r).add(this.origin)
  40048. },
  40049. distanceToPoint: function(e) {
  40050. return Math.sqrt(this.distanceSqToPoint(e))
  40051. },
  40052. distanceSqToPoint: function() {
  40053. var e = new n.Vector3;
  40054. return function(t) {
  40055. var i = e.subVectors(t, this.origin).dot(this.direction);
  40056. return i < 0 ? this.origin.distanceToSquared(t) : (e.copy(this.direction).multiplyScalar(i).add(this.origin),
  40057. e.distanceToSquared(t))
  40058. }
  40059. }(),
  40060. distanceSqToSegment: function() {
  40061. var e = new n.Vector3
  40062. , t = new n.Vector3
  40063. , i = new n.Vector3;
  40064. return function(n, r, o, a) {
  40065. e.copy(n).add(r).multiplyScalar(.5),
  40066. t.copy(r).sub(n).normalize(),
  40067. i.copy(this.origin).sub(e);
  40068. var s, l, c, h, u = .5 * n.distanceTo(r), d = -this.direction.dot(t), p = i.dot(this.direction), f = -i.dot(t), g = i.lengthSq(), m = Math.abs(1 - d * d);
  40069. if (m > 0)
  40070. if (s = d * f - p,
  40071. l = d * p - f,
  40072. h = u * m,
  40073. s >= 0)
  40074. if (l >= -h)
  40075. if (l <= h) {
  40076. var v = 1 / m;
  40077. s *= v,
  40078. l *= v,
  40079. c = s * (s + d * l + 2 * p) + l * (d * s + l + 2 * f) + g
  40080. } else
  40081. l = u,
  40082. s = Math.max(0, -(d * l + p)),
  40083. c = -s * s + l * (l + 2 * f) + g;
  40084. else
  40085. l = -u,
  40086. s = Math.max(0, -(d * l + p)),
  40087. c = -s * s + l * (l + 2 * f) + g;
  40088. else
  40089. l <= -h ? (s = Math.max(0, -(-d * u + p)),
  40090. l = s > 0 ? -u : Math.min(Math.max(-u, -f), u),
  40091. c = -s * s + l * (l + 2 * f) + g) : l <= h ? (s = 0,
  40092. l = Math.min(Math.max(-u, -f), u),
  40093. c = l * (l + 2 * f) + g) : (s = Math.max(0, -(d * u + p)),
  40094. l = s > 0 ? u : Math.min(Math.max(-u, -f), u),
  40095. c = -s * s + l * (l + 2 * f) + g);
  40096. else
  40097. l = d > 0 ? -u : u,
  40098. s = Math.max(0, -(d * l + p)),
  40099. c = -s * s + l * (l + 2 * f) + g;
  40100. return o && o.copy(this.direction).multiplyScalar(s).add(this.origin),
  40101. a && a.copy(t).multiplyScalar(l).add(e),
  40102. c
  40103. }
  40104. }(),
  40105. intersectSphere: function() {
  40106. var e = new n.Vector3;
  40107. return function(t, i) {
  40108. e.subVectors(t.center, this.origin);
  40109. var n = e.dot(this.direction)
  40110. , r = e.dot(e) - n * n
  40111. , o = t.radius * t.radius;
  40112. if (r > o)
  40113. return null;
  40114. var a = Math.sqrt(o - r)
  40115. , s = n - a
  40116. , l = n + a;
  40117. return s < 0 && l < 0 ? null : s < 0 ? this.at(l, i) : this.at(s, i)
  40118. }
  40119. }(),
  40120. intersectsSphere: function(e) {
  40121. return this.distanceToPoint(e.center) <= e.radius
  40122. },
  40123. distanceToPlane: function(e) {
  40124. var t = e.normal.dot(this.direction);
  40125. if (0 === t)
  40126. return 0 === e.distanceToPoint(this.origin) ? 0 : null;
  40127. var i = -(this.origin.dot(e.normal) + e.constant) / t;
  40128. return i >= 0 ? i : null
  40129. },
  40130. intersectPlane: function(e, t) {
  40131. var i = this.distanceToPlane(e);
  40132. return null === i ? null : this.at(i, t)
  40133. },
  40134. intersectsPlane: function(e) {
  40135. var t = e.distanceToPoint(this.origin);
  40136. if (0 === t)
  40137. return !0;
  40138. var i = e.normal.dot(this.direction);
  40139. return i * t < 0
  40140. },
  40141. intersectBox: function(e, t) {
  40142. var i, n, r, o, a, s, l = 1 / this.direction.x, c = 1 / this.direction.y, h = 1 / this.direction.z, u = this.origin;
  40143. return l >= 0 ? (i = (e.min.x - u.x) * l,
  40144. n = (e.max.x - u.x) * l) : (i = (e.max.x - u.x) * l,
  40145. n = (e.min.x - u.x) * l),
  40146. c >= 0 ? (r = (e.min.y - u.y) * c,
  40147. o = (e.max.y - u.y) * c) : (r = (e.max.y - u.y) * c,
  40148. o = (e.min.y - u.y) * c),
  40149. i > o || r > n ? null : ((r > i || i !== i) && (i = r),
  40150. (o < n || n !== n) && (n = o),
  40151. h >= 0 ? (a = (e.min.z - u.z) * h,
  40152. s = (e.max.z - u.z) * h) : (a = (e.max.z - u.z) * h,
  40153. s = (e.min.z - u.z) * h),
  40154. i > s || a > n ? null : ((a > i || i !== i) && (i = a),
  40155. (s < n || n !== n) && (n = s),
  40156. n < 0 ? null : this.at(i >= 0 ? i : n, t)))
  40157. },
  40158. intersectsBox: function() {
  40159. var e = new n.Vector3;
  40160. return function(t) {
  40161. return null !== this.intersectBox(t, e)
  40162. }
  40163. }(),
  40164. intersectTriangle: function() {
  40165. var e = new n.Vector3
  40166. , t = new n.Vector3
  40167. , i = new n.Vector3
  40168. , r = new n.Vector3;
  40169. return function(n, o, a, s, l) {
  40170. t.subVectors(o, n),
  40171. i.subVectors(a, n),
  40172. r.crossVectors(t, i);
  40173. var c, h = this.direction.dot(r);
  40174. if (h > 0) {
  40175. if (s)
  40176. return null;
  40177. c = 1
  40178. } else {
  40179. if (!(h < 0))
  40180. return null;
  40181. c = -1,
  40182. h = -h
  40183. }
  40184. e.subVectors(this.origin, n);
  40185. var u = c * this.direction.dot(i.crossVectors(e, i));
  40186. if (u < 0)
  40187. return null;
  40188. var d = c * this.direction.dot(t.cross(e));
  40189. if (d < 0)
  40190. return null;
  40191. if (u + d > h)
  40192. return null;
  40193. var p = -c * e.dot(r);
  40194. return p < 0 ? null : this.at(p / h, l)
  40195. }
  40196. }(),
  40197. applyMatrix4: function(e) {
  40198. return this.direction.add(this.origin).applyMatrix4(e),
  40199. this.origin.applyMatrix4(e),
  40200. this.direction.sub(this.origin),
  40201. this.direction.normalize(),
  40202. this
  40203. },
  40204. equals: function(e) {
  40205. return e.origin.equals(this.origin) && e.direction.equals(this.direction)
  40206. }
  40207. },
  40208. n.Sphere = function(e, t) {
  40209. this.center = void 0 !== e ? e : new n.Vector3,
  40210. this.radius = void 0 !== t ? t : 0
  40211. }
  40212. ,
  40213. n.Sphere.prototype = {
  40214. constructor: n.Sphere,
  40215. set: function(e, t) {
  40216. return this.center.copy(e),
  40217. this.radius = t,
  40218. this
  40219. },
  40220. setFromPoints: function() {
  40221. var e = new n.Box3;
  40222. return function(t, i) {
  40223. var n = this.center;
  40224. void 0 !== i ? n.copy(i) : e.setFromPoints(t).center(n);
  40225. for (var r = 0, o = 0, a = t.length; o < a; o++)
  40226. r = Math.max(r, n.distanceToSquared(t[o]));
  40227. return this.radius = Math.sqrt(r),
  40228. this
  40229. }
  40230. }(),
  40231. clone: function() {
  40232. return (new this.constructor).copy(this)
  40233. },
  40234. copy: function(e) {
  40235. return this.center.copy(e.center),
  40236. this.radius = e.radius,
  40237. this
  40238. },
  40239. empty: function() {
  40240. return this.radius <= 0
  40241. },
  40242. containsPoint: function(e) {
  40243. return e.distanceToSquared(this.center) <= this.radius * this.radius
  40244. },
  40245. distanceToPoint: function(e) {
  40246. return e.distanceTo(this.center) - this.radius
  40247. },
  40248. intersectsSphere: function(e) {
  40249. var t = this.radius + e.radius;
  40250. return e.center.distanceToSquared(this.center) <= t * t
  40251. },
  40252. intersectsBox: function(e) {
  40253. return e.intersectsSphere(this)
  40254. },
  40255. intersectsPlane: function(e) {
  40256. return Math.abs(this.center.dot(e.normal) - e.constant) <= this.radius
  40257. },
  40258. clampPoint: function(e, t) {
  40259. var i = this.center.distanceToSquared(e)
  40260. , r = t || new n.Vector3;
  40261. return r.copy(e),
  40262. i > this.radius * this.radius && (r.sub(this.center).normalize(),
  40263. r.multiplyScalar(this.radius).add(this.center)),
  40264. r
  40265. },
  40266. getBoundingBox: function(e) {
  40267. var t = e || new n.Box3;
  40268. return t.set(this.center, this.center),
  40269. t.expandByScalar(this.radius),
  40270. t
  40271. },
  40272. applyMatrix4: function(e) {
  40273. return this.center.applyMatrix4(e),
  40274. this.radius = this.radius * e.getMaxScaleOnAxis(),
  40275. this
  40276. },
  40277. translate: function(e) {
  40278. return this.center.add(e),
  40279. this
  40280. },
  40281. equals: function(e) {
  40282. return e.center.equals(this.center) && e.radius === this.radius
  40283. }
  40284. },
  40285. n.Frustum = function(e, t, i, r, o, a) {
  40286. this.planes = [void 0 !== e ? e : new n.Plane, void 0 !== t ? t : new n.Plane, void 0 !== i ? i : new n.Plane, void 0 !== r ? r : new n.Plane, void 0 !== o ? o : new n.Plane, void 0 !== a ? a : new n.Plane]
  40287. }
  40288. ,
  40289. n.Frustum.prototype = {
  40290. constructor: n.Frustum,
  40291. set: function(e, t, i, n, r, o) {
  40292. var a = this.planes;
  40293. return a[0].copy(e),
  40294. a[1].copy(t),
  40295. a[2].copy(i),
  40296. a[3].copy(n),
  40297. a[4].copy(r),
  40298. a[5].copy(o),
  40299. this
  40300. },
  40301. clone: function() {
  40302. return (new this.constructor).copy(this)
  40303. },
  40304. copy: function(e) {
  40305. for (var t = this.planes, i = 0; i < 6; i++)
  40306. t[i].copy(e.planes[i]);
  40307. return this
  40308. },
  40309. setFromMatrix: function(e) {
  40310. var t = this.planes
  40311. , i = e.elements
  40312. , n = i[0]
  40313. , r = i[1]
  40314. , o = i[2]
  40315. , a = i[3]
  40316. , s = i[4]
  40317. , l = i[5]
  40318. , c = i[6]
  40319. , h = i[7]
  40320. , u = i[8]
  40321. , d = i[9]
  40322. , p = i[10]
  40323. , f = i[11]
  40324. , g = i[12]
  40325. , m = i[13]
  40326. , v = i[14]
  40327. , A = i[15];
  40328. return t[0].setComponents(a - n, h - s, f - u, A - g).normalize(),
  40329. t[1].setComponents(a + n, h + s, f + u, A + g).normalize(),
  40330. t[2].setComponents(a + r, h + l, f + d, A + m).normalize(),
  40331. t[3].setComponents(a - r, h - l, f - d, A - m).normalize(),
  40332. t[4].setComponents(a - o, h - c, f - p, A - v).normalize(),
  40333. t[5].setComponents(a + o, h + c, f + p, A + v).normalize(),
  40334. this
  40335. },
  40336. intersectsObject: function() {
  40337. var e = new n.Sphere;
  40338. return function(t) {
  40339. var i = t.geometry;
  40340. return null === i.boundingSphere && i.computeBoundingSphere(),
  40341. e.copy(i.boundingSphere),
  40342. e.applyMatrix4(t.matrixWorld),
  40343. this.intersectsSphere(e)
  40344. }
  40345. }(),
  40346. intersectsSphere: function(e) {
  40347. for (var t = this.planes, i = e.center, n = -e.radius, r = 0; r < 6; r++) {
  40348. var o = t[r].distanceToPoint(i);
  40349. if (o < n)
  40350. return !1
  40351. }
  40352. return !0
  40353. },
  40354. intersectsBox: function() {
  40355. var e = new n.Vector3
  40356. , t = new n.Vector3;
  40357. return function(i) {
  40358. for (var n = this.planes, r = 0; r < 6; r++) {
  40359. var o = n[r];
  40360. e.x = o.normal.x > 0 ? i.min.x : i.max.x,
  40361. t.x = o.normal.x > 0 ? i.max.x : i.min.x,
  40362. e.y = o.normal.y > 0 ? i.min.y : i.max.y,
  40363. t.y = o.normal.y > 0 ? i.max.y : i.min.y,
  40364. e.z = o.normal.z > 0 ? i.min.z : i.max.z,
  40365. t.z = o.normal.z > 0 ? i.max.z : i.min.z;
  40366. var a = o.distanceToPoint(e)
  40367. , s = o.distanceToPoint(t);
  40368. if (a < 0 && s < 0)
  40369. return !1
  40370. }
  40371. return !0
  40372. }
  40373. }(),
  40374. containsPoint: function(e) {
  40375. for (var t = this.planes, i = 0; i < 6; i++)
  40376. if (t[i].distanceToPoint(e) < 0)
  40377. return !1;
  40378. return !0
  40379. }
  40380. },
  40381. n.Plane = function(e, t) {
  40382. this.normal = void 0 !== e ? e : new n.Vector3(1,0,0),
  40383. this.constant = void 0 !== t ? t : 0
  40384. }
  40385. ,
  40386. n.Plane.prototype = {
  40387. constructor: n.Plane,
  40388. set: function(e, t) {
  40389. return this.normal.copy(e),
  40390. this.constant = t,
  40391. this
  40392. },
  40393. setComponents: function(e, t, i, n) {
  40394. return this.normal.set(e, t, i),
  40395. this.constant = n,
  40396. this
  40397. },
  40398. setFromNormalAndCoplanarPoint: function(e, t) {
  40399. return this.normal.copy(e),
  40400. this.constant = -t.dot(this.normal),
  40401. this
  40402. },
  40403. setFromCoplanarPoints: function() {
  40404. var e = new n.Vector3
  40405. , t = new n.Vector3;
  40406. return function(i, n, r) {
  40407. var o = e.subVectors(r, n).cross(t.subVectors(i, n)).normalize();
  40408. return this.setFromNormalAndCoplanarPoint(o, i),
  40409. this
  40410. }
  40411. }(),
  40412. clone: function() {
  40413. return (new this.constructor).copy(this)
  40414. },
  40415. copy: function(e) {
  40416. return this.normal.copy(e.normal),
  40417. this.constant = e.constant,
  40418. this
  40419. },
  40420. normalize: function() {
  40421. var e = 1 / this.normal.length();
  40422. return this.normal.multiplyScalar(e),
  40423. this.constant *= e,
  40424. this
  40425. },
  40426. negate: function() {
  40427. return this.constant *= -1,
  40428. this.normal.negate(),
  40429. this
  40430. },
  40431. distanceToPoint: function(e) {
  40432. return this.normal.dot(e) + this.constant
  40433. },
  40434. distanceToSphere: function(e) {
  40435. return this.distanceToPoint(e.center) - e.radius
  40436. },
  40437. projectPoint: function(e, t) {
  40438. return this.orthoPoint(e, t).sub(e).negate()
  40439. },
  40440. orthoPoint: function(e, t) {
  40441. var i = this.distanceToPoint(e)
  40442. , r = t || new n.Vector3;
  40443. return r.copy(this.normal).multiplyScalar(i)
  40444. },
  40445. intersectLine: function() {
  40446. var e = new n.Vector3;
  40447. return function(t, i) {
  40448. var r = i || new n.Vector3
  40449. , o = t.delta(e)
  40450. , a = this.normal.dot(o);
  40451. if (0 !== a) {
  40452. var s = -(t.start.dot(this.normal) + this.constant) / a;
  40453. if (!(s < 0 || s > 1))
  40454. return r.copy(o).multiplyScalar(s).add(t.start)
  40455. } else if (0 === this.distanceToPoint(t.start))
  40456. return r.copy(t.start)
  40457. }
  40458. }(),
  40459. intersectsLine: function(e) {
  40460. var t = this.distanceToPoint(e.start)
  40461. , i = this.distanceToPoint(e.end);
  40462. return t < 0 && i > 0 || i < 0 && t > 0
  40463. },
  40464. intersectsBox: function(e) {
  40465. return e.intersectsPlane(this)
  40466. },
  40467. intersectsSphere: function(e) {
  40468. return e.intersectsPlane(this)
  40469. },
  40470. coplanarPoint: function(e) {
  40471. var t = e || new n.Vector3;
  40472. return t.copy(this.normal).multiplyScalar(-this.constant)
  40473. },
  40474. applyMatrix4: function() {
  40475. var e = new n.Vector3
  40476. , t = new n.Vector3
  40477. , i = new n.Matrix3;
  40478. return function(n, r) {
  40479. var o = r || i.getNormalMatrix(n)
  40480. , a = e.copy(this.normal).applyMatrix3(o)
  40481. , s = this.coplanarPoint(t);
  40482. return s.applyMatrix4(n),
  40483. this.setFromNormalAndCoplanarPoint(a, s),
  40484. this
  40485. }
  40486. }(),
  40487. translate: function(e) {
  40488. return this.constant = this.constant - e.dot(this.normal),
  40489. this
  40490. },
  40491. equals: function(e) {
  40492. return e.normal.equals(this.normal) && e.constant === this.constant
  40493. }
  40494. },
  40495. n.Spherical = function(e, t, i) {
  40496. return this.radius = void 0 !== e ? e : 1,
  40497. this.phi = void 0 !== t ? t : 0,
  40498. this.theta = void 0 !== i ? i : 0,
  40499. this
  40500. }
  40501. ,
  40502. n.Spherical.prototype = {
  40503. constructor: n.Spherical,
  40504. set: function(e, t, i) {
  40505. this.radius = e,
  40506. this.phi = t,
  40507. this.theta = i
  40508. },
  40509. clone: function() {
  40510. return (new this.constructor).copy(this)
  40511. },
  40512. copy: function(e) {
  40513. return this.radius.copy(e.radius),
  40514. this.phi.copy(e.phi),
  40515. this.theta.copy(e.theta),
  40516. this
  40517. },
  40518. makeSafe: function() {
  40519. var e = 1e-6;
  40520. this.phi = Math.max(e, Math.min(Math.PI - e, this.phi))
  40521. },
  40522. setFromVector3: function(e) {
  40523. return this.radius = e.length(),
  40524. 0 === this.radius ? (this.theta = 0,
  40525. this.phi = 0) : (this.theta = Math.atan2(e.x, e.z),
  40526. this.phi = Math.acos(n.Math.clamp(e.y / this.radius, -1, 1))),
  40527. this
  40528. }
  40529. },
  40530. n.Math = {
  40531. generateUUID: function() {
  40532. var e, t = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""), i = new Array(36), n = 0;
  40533. return function() {
  40534. for (var r = 0; r < 36; r++)
  40535. 8 === r || 13 === r || 18 === r || 23 === r ? i[r] = "-" : 14 === r ? i[r] = "4" : (n <= 2 && (n = 33554432 + 16777216 * Math.random() | 0),
  40536. e = 15 & n,
  40537. n >>= 4,
  40538. i[r] = t[19 === r ? 3 & e | 8 : e]);
  40539. return i.join("")
  40540. }
  40541. }(),
  40542. clamp: function(e, t, i) {
  40543. return Math.max(t, Math.min(i, e))
  40544. },
  40545. euclideanModulo: function(e, t) {
  40546. return (e % t + t) % t
  40547. },
  40548. mapLinear: function(e, t, i, n, r) {
  40549. return n + (e - t) * (r - n) / (i - t)
  40550. },
  40551. smoothstep: function(e, t, i) {
  40552. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40553. e * e * (3 - 2 * e))
  40554. },
  40555. smootherstep: function(e, t, i) {
  40556. return e <= t ? 0 : e >= i ? 1 : (e = (e - t) / (i - t),
  40557. e * e * e * (e * (6 * e - 15) + 10))
  40558. },
  40559. random16: function() {
  40560. return console.warn("THREE.Math.random16() has been deprecated. Use Math.random() instead."),
  40561. Math.random()
  40562. },
  40563. randInt: function(e, t) {
  40564. return e + Math.floor(Math.random() * (t - e + 1))
  40565. },
  40566. randFloat: function(e, t) {
  40567. return e + Math.random() * (t - e)
  40568. },
  40569. randFloatSpread: function(e) {
  40570. return e * (.5 - Math.random())
  40571. },
  40572. degToRad: function() {
  40573. var e = Math.PI / 180;
  40574. return function(t) {
  40575. return t * e
  40576. }
  40577. }(),
  40578. radToDeg: function() {
  40579. var e = 180 / Math.PI;
  40580. return function(t) {
  40581. return t * e
  40582. }
  40583. }(),
  40584. isPowerOfTwo: function(e) {
  40585. return 0 === (e & e - 1) && 0 !== e
  40586. },
  40587. nearestPowerOfTwo: function(e) {
  40588. return Math.pow(2, Math.round(Math.log(e) / Math.LN2))
  40589. },
  40590. nextPowerOfTwo: function(e) {
  40591. return e--,
  40592. e |= e >> 1,
  40593. e |= e >> 2,
  40594. e |= e >> 4,
  40595. e |= e >> 8,
  40596. e |= e >> 16,
  40597. e++,
  40598. e
  40599. }
  40600. },
  40601. n.Spline = function(e) {
  40602. function t(e, t, i, n, r, o, a) {
  40603. var s = .5 * (i - e)
  40604. , l = .5 * (n - t);
  40605. return (2 * (t - i) + s + l) * a + (-3 * (t - i) - 2 * s - l) * o + s * r + t
  40606. }
  40607. this.points = e;
  40608. var i, r, o, a, s, l, c, h, u, d = [], p = {
  40609. x: 0,
  40610. y: 0,
  40611. z: 0
  40612. };
  40613. this.initFromArray = function(e) {
  40614. this.points = [];
  40615. for (var t = 0; t < e.length; t++)
  40616. this.points[t] = {
  40617. x: e[t][0],
  40618. y: e[t][1],
  40619. z: e[t][2]
  40620. }
  40621. }
  40622. ,
  40623. this.getPoint = function(e) {
  40624. return i = (this.points.length - 1) * e,
  40625. r = Math.floor(i),
  40626. o = i - r,
  40627. d[0] = 0 === r ? r : r - 1,
  40628. d[1] = r,
  40629. d[2] = r > this.points.length - 2 ? this.points.length - 1 : r + 1,
  40630. d[3] = r > this.points.length - 3 ? this.points.length - 1 : r + 2,
  40631. l = this.points[d[0]],
  40632. c = this.points[d[1]],
  40633. h = this.points[d[2]],
  40634. u = this.points[d[3]],
  40635. a = o * o,
  40636. s = o * a,
  40637. p.x = t(l.x, c.x, h.x, u.x, o, a, s),
  40638. p.y = t(l.y, c.y, h.y, u.y, o, a, s),
  40639. p.z = t(l.z, c.z, h.z, u.z, o, a, s),
  40640. p
  40641. }
  40642. ,
  40643. this.getControlPointsArray = function() {
  40644. var e, t, i = this.points.length, n = [];
  40645. for (e = 0; e < i; e++)
  40646. t = this.points[e],
  40647. n[e] = [t.x, t.y, t.z];
  40648. return n
  40649. }
  40650. ,
  40651. this.getLength = function(e) {
  40652. var t, i, r, o, a = 0, s = 0, l = 0, c = new n.Vector3, h = new n.Vector3, u = [], d = 0;
  40653. for (u[0] = 0,
  40654. e || (e = 100),
  40655. r = this.points.length * e,
  40656. c.copy(this.points[0]),
  40657. t = 1; t < r; t++)
  40658. i = t / r,
  40659. o = this.getPoint(i),
  40660. h.copy(o),
  40661. d += h.distanceTo(c),
  40662. c.copy(o),
  40663. a = (this.points.length - 1) * i,
  40664. s = Math.floor(a),
  40665. s !== l && (u[s] = d,
  40666. l = s);
  40667. return u[u.length] = d,
  40668. {
  40669. chunks: u,
  40670. total: d
  40671. }
  40672. }
  40673. ,
  40674. this.reparametrizeByArcLength = function(e) {
  40675. var t, i, r, o, a, s, l, c, h = [], u = new n.Vector3, d = this.getLength();
  40676. for (h.push(u.copy(this.points[0]).clone()),
  40677. t = 1; t < this.points.length; t++) {
  40678. for (s = d.chunks[t] - d.chunks[t - 1],
  40679. l = Math.ceil(e * s / d.total),
  40680. o = (t - 1) / (this.points.length - 1),
  40681. a = t / (this.points.length - 1),
  40682. i = 1; i < l - 1; i++)
  40683. r = o + i * (1 / l) * (a - o),
  40684. c = this.getPoint(r),
  40685. h.push(u.copy(c).clone());
  40686. h.push(u.copy(this.points[t]).clone())
  40687. }
  40688. this.points = h
  40689. }
  40690. }
  40691. ,
  40692. n.Triangle = function(e, t, i) {
  40693. this.a = void 0 !== e ? e : new n.Vector3,
  40694. this.b = void 0 !== t ? t : new n.Vector3,
  40695. this.c = void 0 !== i ? i : new n.Vector3
  40696. }
  40697. ,
  40698. n.Triangle.normal = function() {
  40699. var e = new n.Vector3;
  40700. return function(t, i, r, o) {
  40701. var a = o || new n.Vector3;
  40702. a.subVectors(r, i),
  40703. e.subVectors(t, i),
  40704. a.cross(e);
  40705. var s = a.lengthSq();
  40706. return s > 0 ? a.multiplyScalar(1 / Math.sqrt(s)) : a.set(0, 0, 0)
  40707. }
  40708. }(),
  40709. n.Triangle.barycoordFromPoint = function() {
  40710. var e = new n.Vector3
  40711. , t = new n.Vector3
  40712. , i = new n.Vector3;
  40713. return function(r, o, a, s, l) {
  40714. e.subVectors(s, o),
  40715. t.subVectors(a, o),
  40716. i.subVectors(r, o);
  40717. var c = e.dot(e)
  40718. , h = e.dot(t)
  40719. , u = e.dot(i)
  40720. , d = t.dot(t)
  40721. , p = t.dot(i)
  40722. , f = c * d - h * h
  40723. , g = l || new n.Vector3;
  40724. if (0 === f)
  40725. return g.set(-2, -1, -1);
  40726. var m = 1 / f
  40727. , v = (d * u - h * p) * m
  40728. , A = (c * p - h * u) * m;
  40729. return g.set(1 - v - A, A, v)
  40730. }
  40731. }(),
  40732. n.Triangle.containsPoint = function() {
  40733. var e = new n.Vector3;
  40734. return function(t, i, r, o) {
  40735. var a = n.Triangle.barycoordFromPoint(t, i, r, o, e);
  40736. return a.x >= 0 && a.y >= 0 && a.x + a.y <= 1
  40737. }
  40738. }(),
  40739. n.Triangle.prototype = {
  40740. constructor: n.Triangle,
  40741. set: function(e, t, i) {
  40742. return this.a.copy(e),
  40743. this.b.copy(t),
  40744. this.c.copy(i),
  40745. this
  40746. },
  40747. setFromPointsAndIndices: function(e, t, i, n) {
  40748. return this.a.copy(e[t]),
  40749. this.b.copy(e[i]),
  40750. this.c.copy(e[n]),
  40751. this
  40752. },
  40753. clone: function() {
  40754. return (new this.constructor).copy(this)
  40755. },
  40756. copy: function(e) {
  40757. return this.a.copy(e.a),
  40758. this.b.copy(e.b),
  40759. this.c.copy(e.c),
  40760. this
  40761. },
  40762. area: function() {
  40763. var e = new n.Vector3
  40764. , t = new n.Vector3;
  40765. return function() {
  40766. return e.subVectors(this.c, this.b),
  40767. t.subVectors(this.a, this.b),
  40768. .5 * e.cross(t).length()
  40769. }
  40770. }(),
  40771. midpoint: function(e) {
  40772. var t = e || new n.Vector3;
  40773. return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3)
  40774. },
  40775. normal: function(e) {
  40776. return n.Triangle.normal(this.a, this.b, this.c, e)
  40777. },
  40778. plane: function(e) {
  40779. var t = e || new n.Plane;
  40780. return t.setFromCoplanarPoints(this.a, this.b, this.c)
  40781. },
  40782. barycoordFromPoint: function(e, t) {
  40783. return n.Triangle.barycoordFromPoint(e, this.a, this.b, this.c, t)
  40784. },
  40785. containsPoint: function(e) {
  40786. return n.Triangle.containsPoint(e, this.a, this.b, this.c)
  40787. },
  40788. equals: function(e) {
  40789. return e.a.equals(this.a) && e.b.equals(this.b) && e.c.equals(this.c)
  40790. }
  40791. },
  40792. n.Interpolant = function(e, t, i, n) {
  40793. this.parameterPositions = e,
  40794. this._cachedIndex = 0,
  40795. this.resultBuffer = void 0 !== n ? n : new t.constructor(i),
  40796. this.sampleValues = t,
  40797. this.valueSize = i
  40798. }
  40799. ,
  40800. n.Interpolant.prototype = {
  40801. constructor: n.Interpolant,
  40802. evaluate: function(e) {
  40803. var t = this.parameterPositions
  40804. , i = this._cachedIndex
  40805. , n = t[i]
  40806. , r = t[i - 1];
  40807. e: {
  40808. t: {
  40809. var o;
  40810. i: {
  40811. n: if (!(e < n)) {
  40812. for (var a = i + 2; ; ) {
  40813. if (void 0 === n) {
  40814. if (e < r)
  40815. break n;
  40816. return i = t.length,
  40817. this._cachedIndex = i,
  40818. this.afterEnd_(i - 1, e, r)
  40819. }
  40820. if (i === a)
  40821. break;
  40822. if (r = n,
  40823. n = t[++i],
  40824. e < n)
  40825. break t
  40826. }
  40827. o = t.length;
  40828. break i
  40829. }
  40830. {
  40831. if (e >= r)
  40832. break e;
  40833. var s = t[1];
  40834. e < s && (i = 2,
  40835. r = s);
  40836. for (var a = i - 2; ; ) {
  40837. if (void 0 === r)
  40838. return this._cachedIndex = 0,
  40839. this.beforeStart_(0, e, n);
  40840. if (i === a)
  40841. break;
  40842. if (n = r,
  40843. r = t[--i - 1],
  40844. e >= r)
  40845. break t
  40846. }
  40847. o = i,
  40848. i = 0
  40849. }
  40850. }
  40851. for (; i < o; ) {
  40852. var l = i + o >>> 1;
  40853. e < t[l] ? o = l : i = l + 1
  40854. }
  40855. if (n = t[i],
  40856. r = t[i - 1],
  40857. void 0 === r)
  40858. return this._cachedIndex = 0,
  40859. this.beforeStart_(0, e, n);
  40860. if (void 0 === n)
  40861. return i = t.length,
  40862. this._cachedIndex = i,
  40863. this.afterEnd_(i - 1, r, e)
  40864. }
  40865. this._cachedIndex = i,
  40866. this.intervalChanged_(i, r, n)
  40867. }
  40868. return this.interpolate_(i, r, e, n)
  40869. },
  40870. settings: null,
  40871. DefaultSettings_: {},
  40872. getSettings_: function() {
  40873. return this.settings || this.DefaultSettings_
  40874. },
  40875. copySampleValue_: function(e) {
  40876. for (var t = this.resultBuffer, i = this.sampleValues, n = this.valueSize, r = e * n, o = 0; o !== n; ++o)
  40877. t[o] = i[r + o];
  40878. return t
  40879. },
  40880. interpolate_: function(e, t, i, n) {
  40881. throw new Error("call to abstract method")
  40882. },
  40883. intervalChanged_: function(e, t, i) {}
  40884. },
  40885. Object.assign(n.Interpolant.prototype, {
  40886. beforeStart_: n.Interpolant.prototype.copySampleValue_,
  40887. afterEnd_: n.Interpolant.prototype.copySampleValue_
  40888. }),
  40889. n.CubicInterpolant = function(e, t, i, r) {
  40890. n.Interpolant.call(this, e, t, i, r),
  40891. this._weightPrev = -0,
  40892. this._offsetPrev = -0,
  40893. this._weightNext = -0,
  40894. this._offsetNext = -0
  40895. }
  40896. ,
  40897. n.CubicInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40898. constructor: n.CubicInterpolant,
  40899. DefaultSettings_: {
  40900. endingStart: n.ZeroCurvatureEnding,
  40901. endingEnd: n.ZeroCurvatureEnding
  40902. },
  40903. intervalChanged_: function(e, t, i) {
  40904. var r = this.parameterPositions
  40905. , o = e - 2
  40906. , a = e + 1
  40907. , s = r[o]
  40908. , l = r[a];
  40909. if (void 0 === s)
  40910. switch (this.getSettings_().endingStart) {
  40911. case n.ZeroSlopeEnding:
  40912. o = e,
  40913. s = 2 * t - i;
  40914. break;
  40915. case n.WrapAroundEnding:
  40916. o = r.length - 2,
  40917. s = t + r[o] - r[o + 1];
  40918. break;
  40919. default:
  40920. o = e,
  40921. s = i
  40922. }
  40923. if (void 0 === l)
  40924. switch (this.getSettings_().endingEnd) {
  40925. case n.ZeroSlopeEnding:
  40926. a = e,
  40927. l = 2 * i - t;
  40928. break;
  40929. case n.WrapAroundEnding:
  40930. a = 1,
  40931. l = i + r[1] - r[0];
  40932. break;
  40933. default:
  40934. a = e - 1,
  40935. l = t
  40936. }
  40937. var c = .5 * (i - t)
  40938. , h = this.valueSize;
  40939. this._weightPrev = c / (t - s),
  40940. this._weightNext = c / (l - i),
  40941. this._offsetPrev = o * h,
  40942. this._offsetNext = a * h
  40943. },
  40944. interpolate_: function(e, t, i, n) {
  40945. for (var r = this.resultBuffer, o = this.sampleValues, a = this.valueSize, s = e * a, l = s - a, c = this._offsetPrev, h = this._offsetNext, u = this._weightPrev, d = this._weightNext, p = (i - t) / (n - t), f = p * p, g = f * p, m = -u * g + 2 * u * f - u * p, v = (1 + u) * g + (-1.5 - 2 * u) * f + (-.5 + u) * p + 1, A = (-1 - d) * g + (1.5 + d) * f + .5 * p, y = d * g - d * f, C = 0; C !== a; ++C)
  40946. r[C] = m * o[c + C] + v * o[l + C] + A * o[s + C] + y * o[h + C];
  40947. return r
  40948. }
  40949. }),
  40950. n.DiscreteInterpolant = function(e, t, i, r) {
  40951. n.Interpolant.call(this, e, t, i, r)
  40952. }
  40953. ,
  40954. n.DiscreteInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40955. constructor: n.DiscreteInterpolant,
  40956. interpolate_: function(e, t, i, n) {
  40957. return this.copySampleValue_(e - 1)
  40958. }
  40959. }),
  40960. n.LinearInterpolant = function(e, t, i, r) {
  40961. n.Interpolant.call(this, e, t, i, r)
  40962. }
  40963. ,
  40964. n.LinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40965. constructor: n.LinearInterpolant,
  40966. interpolate_: function(e, t, i, n) {
  40967. 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)
  40968. r[u] = o[l + u] * h + o[s + u] * c;
  40969. return r
  40970. }
  40971. }),
  40972. n.QuaternionLinearInterpolant = function(e, t, i, r) {
  40973. n.Interpolant.call(this, e, t, i, r)
  40974. }
  40975. ,
  40976. n.QuaternionLinearInterpolant.prototype = Object.assign(Object.create(n.Interpolant.prototype), {
  40977. constructor: n.QuaternionLinearInterpolant,
  40978. interpolate_: function(e, t, i, r) {
  40979. 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)
  40980. n.Quaternion.slerpFlat(o, 0, a, l - s, a, l, c);
  40981. return o
  40982. }
  40983. }),
  40984. n.Clock = function(e) {
  40985. this.autoStart = void 0 === e || e,
  40986. this.startTime = 0,
  40987. this.oldTime = 0,
  40988. this.elapsedTime = 0,
  40989. this.running = !1
  40990. }
  40991. ,
  40992. n.Clock.prototype = {
  40993. constructor: n.Clock,
  40994. start: function() {
  40995. this.startTime = performance.now(),
  40996. this.oldTime = this.startTime,
  40997. this.running = !0
  40998. },
  40999. stop: function() {
  41000. this.getElapsedTime(),
  41001. this.running = !1
  41002. },
  41003. getElapsedTime: function() {
  41004. return this.getDelta(),
  41005. this.elapsedTime
  41006. },
  41007. getDelta: function() {
  41008. var e = 0;
  41009. if (this.autoStart && !this.running && this.start(),
  41010. this.running) {
  41011. var t = performance.now();
  41012. e = .001 * (t - this.oldTime),
  41013. this.oldTime = t,
  41014. this.elapsedTime += e
  41015. }
  41016. return e
  41017. }
  41018. },
  41019. n.EventDispatcher = function() {}
  41020. ,
  41021. n.EventDispatcher.prototype = {
  41022. constructor: n.EventDispatcher,
  41023. apply: function(e) {
  41024. e.addEventListener = n.EventDispatcher.prototype.addEventListener,
  41025. e.hasEventListener = n.EventDispatcher.prototype.hasEventListener,
  41026. e.removeEventListener = n.EventDispatcher.prototype.removeEventListener,
  41027. e.dispatchEvent = n.EventDispatcher.prototype.dispatchEvent
  41028. },
  41029. addEventListener: function(e, t) {
  41030. void 0 === this._listeners && (this._listeners = {});
  41031. var i = this._listeners;
  41032. void 0 === i[e] && (i[e] = []),
  41033. i[e].indexOf(t) === -1 && i[e].push(t)
  41034. },
  41035. hasEventListener: function(e, t) {
  41036. if (void 0 === this._listeners)
  41037. return !1;
  41038. var i = this._listeners;
  41039. return void 0 !== i[e] && i[e].indexOf(t) !== -1
  41040. },
  41041. removeEventListener: function(e, t) {
  41042. if (void 0 !== this._listeners) {
  41043. var i = this._listeners
  41044. , n = i[e];
  41045. if (void 0 !== n) {
  41046. var r = n.indexOf(t);
  41047. r !== -1 && n.splice(r, 1)
  41048. }
  41049. }
  41050. },
  41051. dispatchEvent: function(e) {
  41052. if (void 0 !== this._listeners) {
  41053. var t = this._listeners
  41054. , i = t[e.type];
  41055. if (void 0 !== i) {
  41056. e.target = this;
  41057. for (var n = [], r = i.length, o = 0; o < r; o++)
  41058. n[o] = i[o];
  41059. for (var o = 0; o < r; o++)
  41060. n[o].call(this, e)
  41061. }
  41062. }
  41063. }
  41064. },
  41065. n.Layers = function() {
  41066. this.mask = 1
  41067. }
  41068. ,
  41069. n.Layers.prototype = {
  41070. constructor: n.Layers,
  41071. set: function(e) {
  41072. this.mask = 1 << e
  41073. },
  41074. enable: function(e) {
  41075. this.mask |= 1 << e
  41076. },
  41077. toggle: function(e) {
  41078. this.mask ^= 1 << e
  41079. },
  41080. disable: function(e) {
  41081. this.mask &= ~(1 << e)
  41082. },
  41083. test: function(e) {
  41084. return 0 !== (this.mask & e.mask)
  41085. }
  41086. },
  41087. function(e) {
  41088. function t(e, t) {
  41089. return e.distance - t.distance
  41090. }
  41091. function i(e, t, n, r) {
  41092. if (e.visible !== !1 && (e.raycast(t, n),
  41093. r === !0))
  41094. for (var o = e.children, a = 0, s = o.length; a < s; a++)
  41095. i(o[a], t, n, !0)
  41096. }
  41097. e.Raycaster = function(t, i, n, r) {
  41098. this.ray = new e.Ray(t,i),
  41099. this.near = n || 0,
  41100. this.far = r || 1 / 0,
  41101. this.params = {
  41102. Mesh: {},
  41103. Line: {},
  41104. LOD: {},
  41105. Points: {
  41106. threshold: 1
  41107. },
  41108. Sprite: {}
  41109. },
  41110. Object.defineProperties(this.params, {
  41111. PointCloud: {
  41112. get: function() {
  41113. return console.warn("THREE.Raycaster: params.PointCloud has been renamed to params.Points."),
  41114. this.Points
  41115. }
  41116. }
  41117. })
  41118. }
  41119. ,
  41120. e.Raycaster.prototype = {
  41121. constructor: e.Raycaster,
  41122. linePrecision: 1,
  41123. set: function(e, t) {
  41124. this.ray.set(e, t)
  41125. },
  41126. setFromCamera: function(t, i) {
  41127. i instanceof e.PerspectiveCamera ? (this.ray.origin.setFromMatrixPosition(i.matrixWorld),
  41128. this.ray.direction.set(t.x, t.y, .5).unproject(i).sub(this.ray.origin).normalize()) : i instanceof e.OrthographicCamera ? (this.ray.origin.set(t.x, t.y, -1).unproject(i),
  41129. this.ray.direction.set(0, 0, -1).transformDirection(i.matrixWorld)) : console.error("THREE.Raycaster: Unsupported camera type.")
  41130. },
  41131. intersectObject: function(e, n) {
  41132. var r = [];
  41133. return i(e, this, r, n),
  41134. r.sort(t),
  41135. r
  41136. },
  41137. intersectObjects: function(e, n) {
  41138. var r = [];
  41139. if (Array.isArray(e) === !1)
  41140. return console.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),
  41141. r;
  41142. for (var o = 0, a = e.length; o < a; o++)
  41143. i(e[o], this, r, n);
  41144. return r.sort(t),
  41145. r
  41146. }
  41147. }
  41148. }(n),
  41149. n.Object3D = function() {
  41150. function e() {
  41151. o.setFromEuler(r, !1)
  41152. }
  41153. function t() {
  41154. r.setFromQuaternion(o, void 0, !1)
  41155. }
  41156. Object.defineProperty(this, "id", {
  41157. value: n.Object3DIdCount++
  41158. }),
  41159. this.uuid = n.Math.generateUUID(),
  41160. this.name = "",
  41161. this.type = "Object3D",
  41162. this.parent = null,
  41163. this.children = [],
  41164. this.up = n.Object3D.DefaultUp.clone();
  41165. var i = new n.Vector3
  41166. , r = new n.Euler
  41167. , o = new n.Quaternion
  41168. , a = new n.Vector3(1,1,1);
  41169. r.onChange(e),
  41170. o.onChange(t),
  41171. Object.defineProperties(this, {
  41172. position: {
  41173. enumerable: !0,
  41174. value: i
  41175. },
  41176. rotation: {
  41177. enumerable: !0,
  41178. value: r
  41179. },
  41180. quaternion: {
  41181. enumerable: !0,
  41182. value: o
  41183. },
  41184. scale: {
  41185. enumerable: !0,
  41186. value: a
  41187. },
  41188. modelViewMatrix: {
  41189. value: new n.Matrix4
  41190. },
  41191. normalMatrix: {
  41192. value: new n.Matrix3
  41193. }
  41194. }),
  41195. this.rotationAutoUpdate = !0,
  41196. this.matrix = new n.Matrix4,
  41197. this.matrixWorld = new n.Matrix4,
  41198. this.matrixAutoUpdate = n.Object3D.DefaultMatrixAutoUpdate,
  41199. this.matrixWorldNeedsUpdate = !1,
  41200. this.layers = new n.Layers,
  41201. this.visible = !0,
  41202. this.castShadow = !1,
  41203. this.receiveShadow = !1,
  41204. this.frustumCulled = !0,
  41205. this.renderOrder = 0,
  41206. this.userData = {}
  41207. }
  41208. ,
  41209. n.Object3D.DefaultUp = new n.Vector3(0,1,0),
  41210. n.Object3D.DefaultMatrixAutoUpdate = !0,
  41211. n.Object3D.prototype = {
  41212. constructor: n.Object3D,
  41213. applyMatrix: function(e) {
  41214. this.matrix.multiplyMatrices(e, this.matrix),
  41215. this.matrix.decompose(this.position, this.quaternion, this.scale)
  41216. },
  41217. setRotationFromAxisAngle: function(e, t) {
  41218. this.quaternion.setFromAxisAngle(e, t)
  41219. },
  41220. setRotationFromEuler: function(e) {
  41221. this.quaternion.setFromEuler(e, !0)
  41222. },
  41223. setRotationFromMatrix: function(e) {
  41224. this.quaternion.setFromRotationMatrix(e)
  41225. },
  41226. setRotationFromQuaternion: function(e) {
  41227. this.quaternion.copy(e)
  41228. },
  41229. rotateOnAxis: function() {
  41230. var e = new n.Quaternion;
  41231. return function(t, i) {
  41232. return e.setFromAxisAngle(t, i),
  41233. this.quaternion.multiply(e),
  41234. this
  41235. }
  41236. }(),
  41237. rotateX: function() {
  41238. var e = new n.Vector3(1,0,0);
  41239. return function(t) {
  41240. return this.rotateOnAxis(e, t)
  41241. }
  41242. }(),
  41243. rotateY: function() {
  41244. var e = new n.Vector3(0,1,0);
  41245. return function(t) {
  41246. return this.rotateOnAxis(e, t)
  41247. }
  41248. }(),
  41249. rotateZ: function() {
  41250. var e = new n.Vector3(0,0,1);
  41251. return function(t) {
  41252. return this.rotateOnAxis(e, t)
  41253. }
  41254. }(),
  41255. translateOnAxis: function() {
  41256. var e = new n.Vector3;
  41257. return function(t, i) {
  41258. return e.copy(t).applyQuaternion(this.quaternion),
  41259. this.position.add(e.multiplyScalar(i)),
  41260. this
  41261. }
  41262. }(),
  41263. translateX: function() {
  41264. var e = new n.Vector3(1,0,0);
  41265. return function(t) {
  41266. return this.translateOnAxis(e, t)
  41267. }
  41268. }(),
  41269. translateY: function() {
  41270. var e = new n.Vector3(0,1,0);
  41271. return function(t) {
  41272. return this.translateOnAxis(e, t)
  41273. }
  41274. }(),
  41275. translateZ: function() {
  41276. var e = new n.Vector3(0,0,1);
  41277. return function(t) {
  41278. return this.translateOnAxis(e, t)
  41279. }
  41280. }(),
  41281. localToWorld: function(e) {
  41282. return e.applyMatrix4(this.matrixWorld)
  41283. },
  41284. worldToLocal: function() {
  41285. var e = new n.Matrix4;
  41286. return function(t) {
  41287. return t.applyMatrix4(e.getInverse(this.matrixWorld))
  41288. }
  41289. }(),
  41290. lookAt: function() {
  41291. var e = new n.Matrix4;
  41292. return function(t) {
  41293. e.lookAt(t, this.position, this.up),
  41294. this.quaternion.setFromRotationMatrix(e)
  41295. }
  41296. }(),
  41297. add: function(e) {
  41298. if (arguments.length > 1) {
  41299. for (var t = 0; t < arguments.length; t++)
  41300. this.add(arguments[t]);
  41301. return this
  41302. }
  41303. return e === this ? (console.error("THREE.Object3D.add: object can't be added as a child of itself.", e),
  41304. this) : (e instanceof n.Object3D ? (null !== e.parent && e.parent.remove(e),
  41305. e.parent = this,
  41306. e.dispatchEvent({
  41307. type: "added"
  41308. }),
  41309. this.children.push(e)) : console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.", e),
  41310. this)
  41311. },
  41312. remove: function(e) {
  41313. if (arguments.length > 1)
  41314. for (var t = 0; t < arguments.length; t++)
  41315. this.remove(arguments[t]);
  41316. var i = this.children.indexOf(e);
  41317. i !== -1 && (e.parent = null,
  41318. e.dispatchEvent({
  41319. type: "removed"
  41320. }),
  41321. this.children.splice(i, 1))
  41322. },
  41323. getObjectById: function(e) {
  41324. return this.getObjectByProperty("id", e)
  41325. },
  41326. getObjectByName: function(e) {
  41327. return this.getObjectByProperty("name", e)
  41328. },
  41329. getObjectByProperty: function(e, t) {
  41330. if (this[e] === t)
  41331. return this;
  41332. for (var i = 0, n = this.children.length; i < n; i++) {
  41333. var r = this.children[i]
  41334. , o = r.getObjectByProperty(e, t);
  41335. if (void 0 !== o)
  41336. return o
  41337. }
  41338. },
  41339. getWorldPosition: function(e) {
  41340. var t = e || new n.Vector3;
  41341. return this.updateMatrixWorld(!0),
  41342. t.setFromMatrixPosition(this.matrixWorld)
  41343. },
  41344. getWorldQuaternion: function() {
  41345. var e = new n.Vector3
  41346. , t = new n.Vector3;
  41347. return function(i) {
  41348. var r = i || new n.Quaternion;
  41349. return this.updateMatrixWorld(!0),
  41350. this.matrixWorld.decompose(e, r, t),
  41351. r
  41352. }
  41353. }(),
  41354. getWorldRotation: function() {
  41355. var e = new n.Quaternion;
  41356. return function(t) {
  41357. var i = t || new n.Euler;
  41358. return this.getWorldQuaternion(e),
  41359. i.setFromQuaternion(e, this.rotation.order, !1)
  41360. }
  41361. }(),
  41362. getWorldScale: function() {
  41363. var e = new n.Vector3
  41364. , t = new n.Quaternion;
  41365. return function(i) {
  41366. var r = i || new n.Vector3;
  41367. return this.updateMatrixWorld(!0),
  41368. this.matrixWorld.decompose(e, t, r),
  41369. r
  41370. }
  41371. }(),
  41372. getWorldDirection: function() {
  41373. var e = new n.Quaternion;
  41374. return function(t) {
  41375. var i = t || new n.Vector3;
  41376. return this.getWorldQuaternion(e),
  41377. i.set(0, 0, 1).applyQuaternion(e)
  41378. }
  41379. }(),
  41380. raycast: function() {},
  41381. traverse: function(e) {
  41382. e(this);
  41383. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41384. t[i].traverse(e)
  41385. },
  41386. traverseVisible: function(e) {
  41387. if (this.visible !== !1) {
  41388. e(this);
  41389. for (var t = this.children, i = 0, n = t.length; i < n; i++)
  41390. t[i].traverseVisible(e)
  41391. }
  41392. },
  41393. traverseAncestors: function(e) {
  41394. var t = this.parent;
  41395. null !== t && (e(t),
  41396. t.traverseAncestors(e))
  41397. },
  41398. updateMatrix: function() {
  41399. this.matrix.compose(this.position, this.quaternion, this.scale),
  41400. this.matrixWorldNeedsUpdate = !0
  41401. },
  41402. updateMatrixWorld: function(e) {
  41403. this.matrixAutoUpdate === !0 && this.updateMatrix(),
  41404. this.matrixWorldNeedsUpdate !== !0 && e !== !0 || (null === this.parent ? this.matrixWorld.copy(this.matrix) : this.matrixWorld.multiplyMatrices(this.parent.matrixWorld, this.matrix),
  41405. this.matrixWorldNeedsUpdate = !1,
  41406. e = !0);
  41407. for (var t = 0, i = this.children.length; t < i; t++)
  41408. this.children[t].updateMatrixWorld(e)
  41409. },
  41410. toJSON: function(e) {
  41411. function t(e) {
  41412. var t = [];
  41413. for (var i in e) {
  41414. var n = e[i];
  41415. delete n.metadata,
  41416. t.push(n)
  41417. }
  41418. return t
  41419. }
  41420. var i = void 0 === e
  41421. , n = {};
  41422. i && (e = {
  41423. geometries: {},
  41424. materials: {},
  41425. textures: {},
  41426. images: {}
  41427. },
  41428. n.metadata = {
  41429. version: 4.4,
  41430. type: "Object",
  41431. generator: "Object3D.toJSON"
  41432. });
  41433. var r = {};
  41434. if (r.uuid = this.uuid,
  41435. r.type = this.type,
  41436. "" !== this.name && (r.name = this.name),
  41437. "{}" !== JSON.stringify(this.userData) && (r.userData = this.userData),
  41438. this.castShadow === !0 && (r.castShadow = !0),
  41439. this.receiveShadow === !0 && (r.receiveShadow = !0),
  41440. this.visible === !1 && (r.visible = !1),
  41441. r.matrix = this.matrix.toArray(),
  41442. void 0 !== this.geometry && (void 0 === e.geometries[this.geometry.uuid] && (e.geometries[this.geometry.uuid] = this.geometry.toJSON(e)),
  41443. r.geometry = this.geometry.uuid),
  41444. void 0 !== this.material && (void 0 === e.materials[this.material.uuid] && (e.materials[this.material.uuid] = this.material.toJSON(e)),
  41445. r.material = this.material.uuid),
  41446. this.children.length > 0) {
  41447. r.children = [];
  41448. for (var o = 0; o < this.children.length; o++)
  41449. r.children.push(this.children[o].toJSON(e).object)
  41450. }
  41451. if (i) {
  41452. var a = t(e.geometries)
  41453. , s = t(e.materials)
  41454. , l = t(e.textures)
  41455. , c = t(e.images);
  41456. a.length > 0 && (n.geometries = a),
  41457. s.length > 0 && (n.materials = s),
  41458. l.length > 0 && (n.textures = l),
  41459. c.length > 0 && (n.images = c)
  41460. }
  41461. return n.object = r,
  41462. n
  41463. },
  41464. clone: function(e) {
  41465. return (new this.constructor).copy(this, e)
  41466. },
  41467. copy: function(e, t) {
  41468. if (void 0 === t && (t = !0),
  41469. this.name = e.name,
  41470. this.up.copy(e.up),
  41471. this.position.copy(e.position),
  41472. this.quaternion.copy(e.quaternion),
  41473. this.scale.copy(e.scale),
  41474. this.rotationAutoUpdate = e.rotationAutoUpdate,
  41475. this.matrix.copy(e.matrix),
  41476. this.matrixWorld.copy(e.matrixWorld),
  41477. this.matrixAutoUpdate = e.matrixAutoUpdate,
  41478. this.matrixWorldNeedsUpdate = e.matrixWorldNeedsUpdate,
  41479. this.visible = e.visible,
  41480. this.castShadow = e.castShadow,
  41481. this.receiveShadow = e.receiveShadow,
  41482. this.frustumCulled = e.frustumCulled,
  41483. this.renderOrder = e.renderOrder,
  41484. this.userData = JSON.parse(JSON.stringify(e.userData)),
  41485. t === !0)
  41486. for (var i = 0; i < e.children.length; i++) {
  41487. var n = e.children[i];
  41488. this.add(n.clone())
  41489. }
  41490. return this
  41491. }
  41492. },
  41493. n.EventDispatcher.prototype.apply(n.Object3D.prototype),
  41494. n.Object3DIdCount = 0,
  41495. n.Face3 = function(e, t, i, r, o, a) {
  41496. this.a = e,
  41497. this.b = t,
  41498. this.c = i,
  41499. this.normal = r instanceof n.Vector3 ? r : new n.Vector3,
  41500. this.vertexNormals = Array.isArray(r) ? r : [],
  41501. this.color = o instanceof n.Color ? o : new n.Color,
  41502. this.vertexColors = Array.isArray(o) ? o : [],
  41503. this.materialIndex = void 0 !== a ? a : 0
  41504. }
  41505. ,
  41506. n.Face3.prototype = {
  41507. constructor: n.Face3,
  41508. clone: function() {
  41509. return (new this.constructor).copy(this)
  41510. },
  41511. copy: function(e) {
  41512. this.a = e.a,
  41513. this.b = e.b,
  41514. this.c = e.c,
  41515. this.normal.copy(e.normal),
  41516. this.color.copy(e.color),
  41517. this.materialIndex = e.materialIndex;
  41518. for (var t = 0, i = e.vertexNormals.length; t < i; t++)
  41519. this.vertexNormals[t] = e.vertexNormals[t].clone();
  41520. for (var t = 0, i = e.vertexColors.length; t < i; t++)
  41521. this.vertexColors[t] = e.vertexColors[t].clone();
  41522. return this
  41523. }
  41524. },
  41525. n.BufferAttribute = function(e, t) {
  41526. this.uuid = n.Math.generateUUID(),
  41527. this.array = e,
  41528. this.itemSize = t,
  41529. this.dynamic = !1,
  41530. this.updateRange = {
  41531. offset: 0,
  41532. count: -1
  41533. },
  41534. this.version = 0
  41535. }
  41536. ,
  41537. n.BufferAttribute.prototype = {
  41538. constructor: n.BufferAttribute,
  41539. get count() {
  41540. return this.array.length / this.itemSize
  41541. },
  41542. set needsUpdate(e) {
  41543. e === !0 && this.version++
  41544. },
  41545. setDynamic: function(e) {
  41546. return this.dynamic = e,
  41547. this
  41548. },
  41549. copy: function(e) {
  41550. return this.array = new e.array.constructor(e.array),
  41551. this.itemSize = e.itemSize,
  41552. this.dynamic = e.dynamic,
  41553. this
  41554. },
  41555. copyAt: function(e, t, i) {
  41556. e *= this.itemSize,
  41557. i *= t.itemSize;
  41558. for (var n = 0, r = this.itemSize; n < r; n++)
  41559. this.array[e + n] = t.array[i + n];
  41560. return this
  41561. },
  41562. copyArray: function(e) {
  41563. return this.array.set(e),
  41564. this
  41565. },
  41566. copyColorsArray: function(e) {
  41567. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41568. var a = e[r];
  41569. void 0 === a && (console.warn("THREE.BufferAttribute.copyColorsArray(): color is undefined", r),
  41570. a = new n.Color),
  41571. t[i++] = a.r,
  41572. t[i++] = a.g,
  41573. t[i++] = a.b
  41574. }
  41575. return this
  41576. },
  41577. copyIndicesArray: function(e) {
  41578. for (var t = this.array, i = 0, n = 0, r = e.length; n < r; n++) {
  41579. var o = e[n];
  41580. t[i++] = o.a,
  41581. t[i++] = o.b,
  41582. t[i++] = o.c
  41583. }
  41584. return this
  41585. },
  41586. copyVector2sArray: function(e) {
  41587. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41588. var a = e[r];
  41589. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector2sArray(): vector is undefined", r),
  41590. a = new n.Vector2),
  41591. t[i++] = a.x,
  41592. t[i++] = a.y
  41593. }
  41594. return this
  41595. },
  41596. copyVector3sArray: function(e) {
  41597. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41598. var a = e[r];
  41599. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector3sArray(): vector is undefined", r),
  41600. a = new n.Vector3),
  41601. t[i++] = a.x,
  41602. t[i++] = a.y,
  41603. t[i++] = a.z
  41604. }
  41605. return this
  41606. },
  41607. copyVector4sArray: function(e) {
  41608. for (var t = this.array, i = 0, r = 0, o = e.length; r < o; r++) {
  41609. var a = e[r];
  41610. void 0 === a && (console.warn("THREE.BufferAttribute.copyVector4sArray(): vector is undefined", r),
  41611. a = new n.Vector4),
  41612. t[i++] = a.x,
  41613. t[i++] = a.y,
  41614. t[i++] = a.z,
  41615. t[i++] = a.w
  41616. }
  41617. return this
  41618. },
  41619. set: function(e, t) {
  41620. return void 0 === t && (t = 0),
  41621. this.array.set(e, t),
  41622. this
  41623. },
  41624. getX: function(e) {
  41625. return this.array[e * this.itemSize]
  41626. },
  41627. setX: function(e, t) {
  41628. return this.array[e * this.itemSize] = t,
  41629. this
  41630. },
  41631. getY: function(e) {
  41632. return this.array[e * this.itemSize + 1]
  41633. },
  41634. setY: function(e, t) {
  41635. return this.array[e * this.itemSize + 1] = t,
  41636. this
  41637. },
  41638. getZ: function(e) {
  41639. return this.array[e * this.itemSize + 2]
  41640. },
  41641. setZ: function(e, t) {
  41642. return this.array[e * this.itemSize + 2] = t,
  41643. this
  41644. },
  41645. getW: function(e) {
  41646. return this.array[e * this.itemSize + 3]
  41647. },
  41648. setW: function(e, t) {
  41649. return this.array[e * this.itemSize + 3] = t,
  41650. this
  41651. },
  41652. setXY: function(e, t, i) {
  41653. return e *= this.itemSize,
  41654. this.array[e + 0] = t,
  41655. this.array[e + 1] = i,
  41656. this
  41657. },
  41658. setXYZ: function(e, t, i, n) {
  41659. return e *= this.itemSize,
  41660. this.array[e + 0] = t,
  41661. this.array[e + 1] = i,
  41662. this.array[e + 2] = n,
  41663. this
  41664. },
  41665. setXYZW: function(e, t, i, n, r) {
  41666. return e *= this.itemSize,
  41667. this.array[e + 0] = t,
  41668. this.array[e + 1] = i,
  41669. this.array[e + 2] = n,
  41670. this.array[e + 3] = r,
  41671. this
  41672. },
  41673. clone: function() {
  41674. return (new this.constructor).copy(this)
  41675. }
  41676. },
  41677. n.Int8Attribute = function(e, t) {
  41678. return new n.BufferAttribute(new Int8Array(e),t)
  41679. }
  41680. ,
  41681. n.Uint8Attribute = function(e, t) {
  41682. return new n.BufferAttribute(new Uint8Array(e),t)
  41683. }
  41684. ,
  41685. n.Uint8ClampedAttribute = function(e, t) {
  41686. return new n.BufferAttribute(new Uint8ClampedArray(e),t)
  41687. }
  41688. ,
  41689. n.Int16Attribute = function(e, t) {
  41690. return new n.BufferAttribute(new Int16Array(e),t)
  41691. }
  41692. ,
  41693. n.Uint16Attribute = function(e, t) {
  41694. return new n.BufferAttribute(new Uint16Array(e),t)
  41695. }
  41696. ;
  41697. n.Int32Attribute = function(e, t) {
  41698. return new n.BufferAttribute(new Int32Array(e),t)
  41699. }
  41700. ;
  41701. n.Uint32Attribute = function(e, t) {
  41702. return new n.BufferAttribute(new Uint32Array(e),t)
  41703. }
  41704. ,
  41705. n.Float32Attribute = function(e, t) {
  41706. return new n.BufferAttribute(new Float32Array(e),t)
  41707. }
  41708. ,
  41709. n.Float64Attribute = function(e, t) {
  41710. return new n.BufferAttribute(new Float64Array(e),t)
  41711. }
  41712. ,
  41713. n.DynamicBufferAttribute = function(e, t) {
  41714. return console.warn("THREE.DynamicBufferAttribute has been removed. Use new THREE.BufferAttribute().setDynamic( true ) instead."),
  41715. new n.BufferAttribute(e,t).setDynamic(!0)
  41716. }
  41717. ,
  41718. n.InstancedBufferAttribute = function(e, t, i) {
  41719. n.BufferAttribute.call(this, e, t),
  41720. this.meshPerAttribute = i || 1
  41721. }
  41722. ,
  41723. n.InstancedBufferAttribute.prototype = Object.create(n.BufferAttribute.prototype),
  41724. n.InstancedBufferAttribute.prototype.constructor = n.InstancedBufferAttribute,
  41725. n.InstancedBufferAttribute.prototype.copy = function(e) {
  41726. return n.BufferAttribute.prototype.copy.call(this, e),
  41727. this.meshPerAttribute = e.meshPerAttribute,
  41728. this
  41729. }
  41730. ,
  41731. n.InterleavedBuffer = function(e, t) {
  41732. this.uuid = n.Math.generateUUID(),
  41733. this.array = e,
  41734. this.stride = t,
  41735. this.dynamic = !1,
  41736. this.updateRange = {
  41737. offset: 0,
  41738. count: -1
  41739. },
  41740. this.version = 0
  41741. }
  41742. ,
  41743. n.InterleavedBuffer.prototype = {
  41744. constructor: n.InterleavedBuffer,
  41745. get length() {
  41746. return this.array.length
  41747. },
  41748. get count() {
  41749. return this.array.length / this.stride
  41750. },
  41751. set needsUpdate(e) {
  41752. e === !0 && this.version++
  41753. },
  41754. setDynamic: function(e) {
  41755. return this.dynamic = e,
  41756. this
  41757. },
  41758. copy: function(e) {
  41759. return this.array = new e.array.constructor(e.array),
  41760. this.stride = e.stride,
  41761. this.dynamic = e.dynamic,
  41762. this
  41763. },
  41764. copyAt: function(e, t, i) {
  41765. e *= this.stride,
  41766. i *= t.stride;
  41767. for (var n = 0, r = this.stride; n < r; n++)
  41768. this.array[e + n] = t.array[i + n];
  41769. return this
  41770. },
  41771. set: function(e, t) {
  41772. return void 0 === t && (t = 0),
  41773. this.array.set(e, t),
  41774. this
  41775. },
  41776. clone: function() {
  41777. return (new this.constructor).copy(this)
  41778. }
  41779. },
  41780. n.InstancedInterleavedBuffer = function(e, t, i) {
  41781. n.InterleavedBuffer.call(this, e, t),
  41782. this.meshPerAttribute = i || 1
  41783. }
  41784. ,
  41785. n.InstancedInterleavedBuffer.prototype = Object.create(n.InterleavedBuffer.prototype),
  41786. n.InstancedInterleavedBuffer.prototype.constructor = n.InstancedInterleavedBuffer,
  41787. n.InstancedInterleavedBuffer.prototype.copy = function(e) {
  41788. return n.InterleavedBuffer.prototype.copy.call(this, e),
  41789. this.meshPerAttribute = e.meshPerAttribute,
  41790. this
  41791. }
  41792. ,
  41793. n.InterleavedBufferAttribute = function(e, t, i) {
  41794. this.uuid = n.Math.generateUUID(),
  41795. this.data = e,
  41796. this.itemSize = t,
  41797. this.offset = i
  41798. }
  41799. ,
  41800. n.InterleavedBufferAttribute.prototype = {
  41801. constructor: n.InterleavedBufferAttribute,
  41802. get length() {
  41803. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  41804. this.array.length
  41805. },
  41806. get count() {
  41807. return this.data.count
  41808. },
  41809. setX: function(e, t) {
  41810. return this.data.array[e * this.data.stride + this.offset] = t,
  41811. this
  41812. },
  41813. setY: function(e, t) {
  41814. return this.data.array[e * this.data.stride + this.offset + 1] = t,
  41815. this
  41816. },
  41817. setZ: function(e, t) {
  41818. return this.data.array[e * this.data.stride + this.offset + 2] = t,
  41819. this
  41820. },
  41821. setW: function(e, t) {
  41822. return this.data.array[e * this.data.stride + this.offset + 3] = t,
  41823. this
  41824. },
  41825. getX: function(e) {
  41826. return this.data.array[e * this.data.stride + this.offset]
  41827. },
  41828. getY: function(e) {
  41829. return this.data.array[e * this.data.stride + this.offset + 1]
  41830. },
  41831. getZ: function(e) {
  41832. return this.data.array[e * this.data.stride + this.offset + 2]
  41833. },
  41834. getW: function(e) {
  41835. return this.data.array[e * this.data.stride + this.offset + 3]
  41836. },
  41837. setXY: function(e, t, i) {
  41838. return e = e * this.data.stride + this.offset,
  41839. this.data.array[e + 0] = t,
  41840. this.data.array[e + 1] = i,
  41841. this
  41842. },
  41843. setXYZ: function(e, t, i, n) {
  41844. return e = e * this.data.stride + this.offset,
  41845. this.data.array[e + 0] = t,
  41846. this.data.array[e + 1] = i,
  41847. this.data.array[e + 2] = n,
  41848. this
  41849. },
  41850. setXYZW: function(e, t, i, n, r) {
  41851. return e = e * this.data.stride + this.offset,
  41852. this.data.array[e + 0] = t,
  41853. this.data.array[e + 1] = i,
  41854. this.data.array[e + 2] = n,
  41855. this.data.array[e + 3] = r,
  41856. this
  41857. }
  41858. },
  41859. n.Geometry = function() {
  41860. Object.defineProperty(this, "id", {
  41861. value: n.GeometryIdCount++
  41862. }),
  41863. this.uuid = n.Math.generateUUID(),
  41864. this.name = "",
  41865. this.type = "Geometry",
  41866. this.vertices = [],
  41867. this.colors = [],
  41868. this.faces = [],
  41869. this.faceVertexUvs = [[]],
  41870. this.morphTargets = [],
  41871. this.morphNormals = [],
  41872. this.skinWeights = [],
  41873. this.skinIndices = [],
  41874. this.lineDistances = [],
  41875. this.boundingBox = null,
  41876. this.boundingSphere = null,
  41877. this.verticesNeedUpdate = !1,
  41878. this.elementsNeedUpdate = !1,
  41879. this.uvsNeedUpdate = !1,
  41880. this.normalsNeedUpdate = !1,
  41881. this.colorsNeedUpdate = !1,
  41882. this.lineDistancesNeedUpdate = !1,
  41883. this.groupsNeedUpdate = !1
  41884. }
  41885. ,
  41886. n.Geometry.prototype = {
  41887. constructor: n.Geometry,
  41888. applyMatrix: function(e) {
  41889. for (var t = (new n.Matrix3).getNormalMatrix(e), i = 0, r = this.vertices.length; i < r; i++) {
  41890. var o = this.vertices[i];
  41891. o.applyMatrix4(e)
  41892. }
  41893. for (var i = 0, r = this.faces.length; i < r; i++) {
  41894. var a = this.faces[i];
  41895. a.normal.applyMatrix3(t).normalize();
  41896. for (var s = 0, l = a.vertexNormals.length; s < l; s++)
  41897. a.vertexNormals[s].applyMatrix3(t).normalize()
  41898. }
  41899. return null !== this.boundingBox && this.computeBoundingBox(),
  41900. null !== this.boundingSphere && this.computeBoundingSphere(),
  41901. this.verticesNeedUpdate = !0,
  41902. this.normalsNeedUpdate = !0,
  41903. this
  41904. },
  41905. rotateX: function() {
  41906. var e;
  41907. return function(t) {
  41908. return void 0 === e && (e = new n.Matrix4),
  41909. e.makeRotationX(t),
  41910. this.applyMatrix(e),
  41911. this
  41912. }
  41913. }(),
  41914. rotateY: function() {
  41915. var e;
  41916. return function(t) {
  41917. return void 0 === e && (e = new n.Matrix4),
  41918. e.makeRotationY(t),
  41919. this.applyMatrix(e),
  41920. this
  41921. }
  41922. }(),
  41923. rotateZ: function() {
  41924. var e;
  41925. return function(t) {
  41926. return void 0 === e && (e = new n.Matrix4),
  41927. e.makeRotationZ(t),
  41928. this.applyMatrix(e),
  41929. this
  41930. }
  41931. }(),
  41932. translate: function() {
  41933. var e;
  41934. return function(t, i, r) {
  41935. return void 0 === e && (e = new n.Matrix4),
  41936. e.makeTranslation(t, i, r),
  41937. this.applyMatrix(e),
  41938. this
  41939. }
  41940. }(),
  41941. scale: function() {
  41942. var e;
  41943. return function(t, i, r) {
  41944. return void 0 === e && (e = new n.Matrix4),
  41945. e.makeScale(t, i, r),
  41946. this.applyMatrix(e),
  41947. this
  41948. }
  41949. }(),
  41950. lookAt: function() {
  41951. var e;
  41952. return function(t) {
  41953. void 0 === e && (e = new n.Object3D),
  41954. e.lookAt(t),
  41955. e.updateMatrix(),
  41956. this.applyMatrix(e.matrix)
  41957. }
  41958. }(),
  41959. fromBufferGeometry: function(e) {
  41960. function t(e, t, r, o) {
  41961. var a = void 0 !== s ? [u[e].clone(), u[t].clone(), u[r].clone()] : []
  41962. , f = void 0 !== l ? [i.colors[e].clone(), i.colors[t].clone(), i.colors[r].clone()] : []
  41963. , g = new n.Face3(e,t,r,a,f,o);
  41964. i.faces.push(g),
  41965. void 0 !== c && i.faceVertexUvs[0].push([d[e].clone(), d[t].clone(), d[r].clone()]),
  41966. void 0 !== h && i.faceVertexUvs[1].push([p[e].clone(), p[t].clone(), p[r].clone()])
  41967. }
  41968. var i = this
  41969. , r = null !== e.index ? e.index.array : void 0
  41970. , o = e.attributes
  41971. , a = o.position.array
  41972. , s = void 0 !== o.normal ? o.normal.array : void 0
  41973. , l = void 0 !== o.color ? o.color.array : void 0
  41974. , c = void 0 !== o.uv ? o.uv.array : void 0
  41975. , h = void 0 !== o.uv2 ? o.uv2.array : void 0;
  41976. void 0 !== h && (this.faceVertexUvs[1] = []);
  41977. for (var u = [], d = [], p = [], f = 0, g = 0; f < a.length; f += 3,
  41978. g += 2)
  41979. i.vertices.push(new n.Vector3(a[f],a[f + 1],a[f + 2])),
  41980. void 0 !== s && u.push(new n.Vector3(s[f],s[f + 1],s[f + 2])),
  41981. void 0 !== l && i.colors.push(new n.Color(l[f],l[f + 1],l[f + 2])),
  41982. void 0 !== c && d.push(new n.Vector2(c[g],c[g + 1])),
  41983. void 0 !== h && p.push(new n.Vector2(h[g],h[g + 1]));
  41984. if (void 0 !== r) {
  41985. var m = e.groups;
  41986. if (m.length > 0)
  41987. for (var f = 0; f < m.length; f++)
  41988. for (var v = m[f], A = v.start, y = v.count, g = A, C = A + y; g < C; g += 3)
  41989. t(r[g], r[g + 1], r[g + 2], v.materialIndex);
  41990. else
  41991. for (var f = 0; f < r.length; f += 3)
  41992. t(r[f], r[f + 1], r[f + 2])
  41993. } else
  41994. for (var f = 0; f < a.length / 3; f += 3)
  41995. t(f, f + 1, f + 2);
  41996. return this.computeFaceNormals(),
  41997. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  41998. null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  41999. this
  42000. },
  42001. center: function() {
  42002. this.computeBoundingBox();
  42003. var e = this.boundingBox.center().negate();
  42004. return this.translate(e.x, e.y, e.z),
  42005. e
  42006. },
  42007. normalize: function() {
  42008. this.computeBoundingSphere();
  42009. var e = this.boundingSphere.center
  42010. , t = this.boundingSphere.radius
  42011. , i = 0 === t ? 1 : 1 / t
  42012. , r = new n.Matrix4;
  42013. 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),
  42014. this.applyMatrix(r),
  42015. this
  42016. },
  42017. computeFaceNormals: function() {
  42018. for (var e = new n.Vector3, t = new n.Vector3, i = 0, r = this.faces.length; i < r; i++) {
  42019. var o = this.faces[i]
  42020. , a = this.vertices[o.a]
  42021. , s = this.vertices[o.b]
  42022. , l = this.vertices[o.c];
  42023. e.subVectors(l, s),
  42024. t.subVectors(a, s),
  42025. e.cross(t),
  42026. e.normalize(),
  42027. o.normal.copy(e)
  42028. }
  42029. },
  42030. computeVertexNormals: function(e) {
  42031. void 0 === e && (e = !0);
  42032. var t, i, r, o, a, s;
  42033. for (s = new Array(this.vertices.length),
  42034. t = 0,
  42035. i = this.vertices.length; t < i; t++)
  42036. s[t] = new n.Vector3;
  42037. if (e) {
  42038. var l, c, h, u = new n.Vector3, d = new n.Vector3;
  42039. for (r = 0,
  42040. o = this.faces.length; r < o; r++)
  42041. a = this.faces[r],
  42042. l = this.vertices[a.a],
  42043. c = this.vertices[a.b],
  42044. h = this.vertices[a.c],
  42045. u.subVectors(h, c),
  42046. d.subVectors(l, c),
  42047. u.cross(d),
  42048. s[a.a].add(u),
  42049. s[a.b].add(u),
  42050. s[a.c].add(u)
  42051. } else
  42052. for (r = 0,
  42053. o = this.faces.length; r < o; r++)
  42054. a = this.faces[r],
  42055. s[a.a].add(a.normal),
  42056. s[a.b].add(a.normal),
  42057. s[a.c].add(a.normal);
  42058. for (t = 0,
  42059. i = this.vertices.length; t < i; t++)
  42060. s[t].normalize();
  42061. for (r = 0,
  42062. o = this.faces.length; r < o; r++) {
  42063. a = this.faces[r];
  42064. var p = a.vertexNormals;
  42065. 3 === p.length ? (p[0].copy(s[a.a]),
  42066. p[1].copy(s[a.b]),
  42067. p[2].copy(s[a.c])) : (p[0] = s[a.a].clone(),
  42068. p[1] = s[a.b].clone(),
  42069. p[2] = s[a.c].clone())
  42070. }
  42071. this.faces.length > 0 && (this.normalsNeedUpdate = !0)
  42072. },
  42073. computeMorphNormals: function() {
  42074. var e, t, i, r, o;
  42075. for (i = 0,
  42076. r = this.faces.length; i < r; i++)
  42077. for (o = this.faces[i],
  42078. o.__originalFaceNormal ? o.__originalFaceNormal.copy(o.normal) : o.__originalFaceNormal = o.normal.clone(),
  42079. o.__originalVertexNormals || (o.__originalVertexNormals = []),
  42080. e = 0,
  42081. t = o.vertexNormals.length; e < t; e++)
  42082. o.__originalVertexNormals[e] ? o.__originalVertexNormals[e].copy(o.vertexNormals[e]) : o.__originalVertexNormals[e] = o.vertexNormals[e].clone();
  42083. var a = new n.Geometry;
  42084. for (a.faces = this.faces,
  42085. e = 0,
  42086. t = this.morphTargets.length; e < t; e++) {
  42087. if (!this.morphNormals[e]) {
  42088. this.morphNormals[e] = {},
  42089. this.morphNormals[e].faceNormals = [],
  42090. this.morphNormals[e].vertexNormals = [];
  42091. var s, l, c = this.morphNormals[e].faceNormals, h = this.morphNormals[e].vertexNormals;
  42092. for (i = 0,
  42093. r = this.faces.length; i < r; i++)
  42094. s = new n.Vector3,
  42095. l = {
  42096. a: new n.Vector3,
  42097. b: new n.Vector3,
  42098. c: new n.Vector3
  42099. },
  42100. c.push(s),
  42101. h.push(l)
  42102. }
  42103. var u = this.morphNormals[e];
  42104. a.vertices = this.morphTargets[e].vertices,
  42105. a.computeFaceNormals(),
  42106. a.computeVertexNormals();
  42107. var s, l;
  42108. for (i = 0,
  42109. r = this.faces.length; i < r; i++)
  42110. o = this.faces[i],
  42111. s = u.faceNormals[i],
  42112. l = u.vertexNormals[i],
  42113. s.copy(o.normal),
  42114. l.a.copy(o.vertexNormals[0]),
  42115. l.b.copy(o.vertexNormals[1]),
  42116. l.c.copy(o.vertexNormals[2])
  42117. }
  42118. for (i = 0,
  42119. r = this.faces.length; i < r; i++)
  42120. o = this.faces[i],
  42121. o.normal = o.__originalFaceNormal,
  42122. o.vertexNormals = o.__originalVertexNormals
  42123. },
  42124. computeTangents: function() {
  42125. console.warn("THREE.Geometry: .computeTangents() has been removed.")
  42126. },
  42127. computeLineDistances: function() {
  42128. for (var e = 0, t = this.vertices, i = 0, n = t.length; i < n; i++)
  42129. i > 0 && (e += t[i].distanceTo(t[i - 1])),
  42130. this.lineDistances[i] = e
  42131. },
  42132. computeBoundingBox: function() {
  42133. null === this.boundingBox && (this.boundingBox = new n.Box3),
  42134. this.boundingBox.setFromPoints(this.vertices)
  42135. },
  42136. computeBoundingSphere: function() {
  42137. null === this.boundingSphere && (this.boundingSphere = new n.Sphere),
  42138. this.boundingSphere.setFromPoints(this.vertices)
  42139. },
  42140. merge: function(e, t, i) {
  42141. if (e instanceof n.Geometry == !1)
  42142. return void console.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.", e);
  42143. var r, o = this.vertices.length, a = this.vertices, s = e.vertices, l = this.faces, c = e.faces, h = this.faceVertexUvs[0], u = e.faceVertexUvs[0];
  42144. void 0 === i && (i = 0),
  42145. void 0 !== t && (r = (new n.Matrix3).getNormalMatrix(t));
  42146. for (var d = 0, p = s.length; d < p; d++) {
  42147. var f = s[d]
  42148. , g = f.clone();
  42149. void 0 !== t && g.applyMatrix4(t),
  42150. a.push(g)
  42151. }
  42152. for (d = 0,
  42153. p = c.length; d < p; d++) {
  42154. var m, v, A, y = c[d], C = y.vertexNormals, I = y.vertexColors;
  42155. m = new n.Face3(y.a + o,y.b + o,y.c + o),
  42156. m.normal.copy(y.normal),
  42157. void 0 !== r && m.normal.applyMatrix3(r).normalize();
  42158. for (var E = 0, b = C.length; E < b; E++)
  42159. v = C[E].clone(),
  42160. void 0 !== r && v.applyMatrix3(r).normalize(),
  42161. m.vertexNormals.push(v);
  42162. m.color.copy(y.color);
  42163. for (var E = 0, b = I.length; E < b; E++)
  42164. A = I[E],
  42165. m.vertexColors.push(A.clone());
  42166. m.materialIndex = y.materialIndex + i,
  42167. l.push(m)
  42168. }
  42169. for (d = 0,
  42170. p = u.length; d < p; d++) {
  42171. var w = u[d]
  42172. , _ = [];
  42173. if (void 0 !== w) {
  42174. for (var E = 0, b = w.length; E < b; E++)
  42175. _.push(w[E].clone());
  42176. h.push(_)
  42177. }
  42178. }
  42179. },
  42180. mergeMesh: function(e) {
  42181. return e instanceof n.Mesh == !1 ? void console.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.", e) : (e.matrixAutoUpdate && e.updateMatrix(),
  42182. void this.merge(e.geometry, e.matrix))
  42183. },
  42184. mergeVertices: function() {
  42185. var e, t, i, n, r, o, a, s, l = {}, c = [], h = [], u = 4, d = Math.pow(10, u);
  42186. for (i = 0,
  42187. n = this.vertices.length; i < n; i++)
  42188. e = this.vertices[i],
  42189. t = Math.round(e.x * d) + "_" + Math.round(e.y * d) + "_" + Math.round(e.z * d),
  42190. void 0 === l[t] ? (l[t] = i,
  42191. c.push(this.vertices[i]),
  42192. h[i] = c.length - 1) : h[i] = h[l[t]];
  42193. var p = [];
  42194. for (i = 0,
  42195. n = this.faces.length; i < n; i++) {
  42196. r = this.faces[i],
  42197. r.a = h[r.a],
  42198. r.b = h[r.b],
  42199. r.c = h[r.c],
  42200. o = [r.a, r.b, r.c];
  42201. for (var f = -1, g = 0; g < 3; g++)
  42202. if (o[g] === o[(g + 1) % 3]) {
  42203. f = g,
  42204. p.push(i);
  42205. break
  42206. }
  42207. }
  42208. for (i = p.length - 1; i >= 0; i--) {
  42209. var m = p[i];
  42210. for (this.faces.splice(m, 1),
  42211. a = 0,
  42212. s = this.faceVertexUvs.length; a < s; a++)
  42213. this.faceVertexUvs[a].splice(m, 1)
  42214. }
  42215. var v = this.vertices.length - c.length;
  42216. return this.vertices = c,
  42217. v
  42218. },
  42219. sortFacesByMaterialIndex: function() {
  42220. function e(e, t) {
  42221. return e.materialIndex - t.materialIndex
  42222. }
  42223. for (var t = this.faces, i = t.length, n = 0; n < i; n++)
  42224. t[n]._id = n;
  42225. t.sort(e);
  42226. var r, o, a = this.faceVertexUvs[0], s = this.faceVertexUvs[1];
  42227. a && a.length === i && (r = []),
  42228. s && s.length === i && (o = []);
  42229. for (var n = 0; n < i; n++) {
  42230. var l = t[n]._id;
  42231. r && r.push(a[l]),
  42232. o && o.push(s[l])
  42233. }
  42234. r && (this.faceVertexUvs[0] = r),
  42235. o && (this.faceVertexUvs[1] = o)
  42236. },
  42237. toJSON: function() {
  42238. function e(e, t, i) {
  42239. return i ? e | 1 << t : e & ~(1 << t)
  42240. }
  42241. function t(e) {
  42242. var t = e.x.toString() + e.y.toString() + e.z.toString();
  42243. return void 0 !== d[t] ? d[t] : (d[t] = u.length / 3,
  42244. u.push(e.x, e.y, e.z),
  42245. d[t])
  42246. }
  42247. function i(e) {
  42248. var t = e.r.toString() + e.g.toString() + e.b.toString();
  42249. return void 0 !== f[t] ? f[t] : (f[t] = p.length,
  42250. p.push(e.getHex()),
  42251. f[t])
  42252. }
  42253. function n(e) {
  42254. var t = e.x.toString() + e.y.toString();
  42255. return void 0 !== m[t] ? m[t] : (m[t] = g.length / 2,
  42256. g.push(e.x, e.y),
  42257. m[t])
  42258. }
  42259. var r = {
  42260. metadata: {
  42261. version: 4.4,
  42262. type: "Geometry",
  42263. generator: "Geometry.toJSON"
  42264. }
  42265. };
  42266. if (r.uuid = this.uuid,
  42267. r.type = this.type,
  42268. "" !== this.name && (r.name = this.name),
  42269. void 0 !== this.parameters) {
  42270. var o = this.parameters;
  42271. for (var a in o)
  42272. void 0 !== o[a] && (r[a] = o[a]);
  42273. return r
  42274. }
  42275. for (var s = [], l = 0; l < this.vertices.length; l++) {
  42276. var c = this.vertices[l];
  42277. s.push(c.x, c.y, c.z)
  42278. }
  42279. for (var h = [], u = [], d = {}, p = [], f = {}, g = [], m = {}, l = 0; l < this.faces.length; l++) {
  42280. var v = this.faces[l]
  42281. , A = !0
  42282. , y = !1
  42283. , C = void 0 !== this.faceVertexUvs[0][l]
  42284. , I = v.normal.length() > 0
  42285. , E = v.vertexNormals.length > 0
  42286. , b = 1 !== v.color.r || 1 !== v.color.g || 1 !== v.color.b
  42287. , w = v.vertexColors.length > 0
  42288. , _ = 0;
  42289. if (_ = e(_, 0, 0),
  42290. _ = e(_, 1, A),
  42291. _ = e(_, 2, y),
  42292. _ = e(_, 3, C),
  42293. _ = e(_, 4, I),
  42294. _ = e(_, 5, E),
  42295. _ = e(_, 6, b),
  42296. _ = e(_, 7, w),
  42297. h.push(_),
  42298. h.push(v.a, v.b, v.c),
  42299. h.push(v.materialIndex),
  42300. C) {
  42301. var T = this.faceVertexUvs[0][l];
  42302. h.push(n(T[0]), n(T[1]), n(T[2]))
  42303. }
  42304. if (I && h.push(t(v.normal)),
  42305. E) {
  42306. var x = v.vertexNormals;
  42307. h.push(t(x[0]), t(x[1]), t(x[2]))
  42308. }
  42309. if (b && h.push(i(v.color)),
  42310. w) {
  42311. var S = v.vertexColors;
  42312. h.push(i(S[0]), i(S[1]), i(S[2]))
  42313. }
  42314. }
  42315. return r.data = {},
  42316. r.data.vertices = s,
  42317. r.data.normals = u,
  42318. p.length > 0 && (r.data.colors = p),
  42319. g.length > 0 && (r.data.uvs = [g]),
  42320. r.data.faces = h,
  42321. r
  42322. },
  42323. clone: function() {
  42324. return (new n.Geometry).copy(this)
  42325. },
  42326. copy: function(e) {
  42327. this.vertices = [],
  42328. this.faces = [],
  42329. this.faceVertexUvs = [[]];
  42330. for (var t = e.vertices, i = 0, n = t.length; i < n; i++)
  42331. this.vertices.push(t[i].clone());
  42332. for (var r = e.faces, i = 0, n = r.length; i < n; i++)
  42333. this.faces.push(r[i].clone());
  42334. for (var i = 0, n = e.faceVertexUvs.length; i < n; i++) {
  42335. var o = e.faceVertexUvs[i];
  42336. void 0 === this.faceVertexUvs[i] && (this.faceVertexUvs[i] = []);
  42337. for (var a = 0, s = o.length; a < s; a++) {
  42338. for (var l = o[a], c = [], h = 0, u = l.length; h < u; h++) {
  42339. var d = l[h];
  42340. c.push(d.clone())
  42341. }
  42342. this.faceVertexUvs[i].push(c)
  42343. }
  42344. }
  42345. return this
  42346. },
  42347. dispose: function() {
  42348. this.dispatchEvent({
  42349. type: "dispose"
  42350. })
  42351. }
  42352. },
  42353. n.EventDispatcher.prototype.apply(n.Geometry.prototype),
  42354. n.GeometryIdCount = 0,
  42355. n.DirectGeometry = function() {
  42356. Object.defineProperty(this, "id", {
  42357. value: n.GeometryIdCount++
  42358. }),
  42359. this.uuid = n.Math.generateUUID(),
  42360. this.name = "",
  42361. this.type = "DirectGeometry",
  42362. this.indices = [],
  42363. this.vertices = [],
  42364. this.normals = [],
  42365. this.colors = [],
  42366. this.uvs = [],
  42367. this.uvs2 = [],
  42368. this.groups = [],
  42369. this.morphTargets = {},
  42370. this.skinWeights = [],
  42371. this.skinIndices = [],
  42372. this.boundingBox = null,
  42373. this.boundingSphere = null,
  42374. this.verticesNeedUpdate = !1,
  42375. this.normalsNeedUpdate = !1,
  42376. this.colorsNeedUpdate = !1,
  42377. this.uvsNeedUpdate = !1,
  42378. this.groupsNeedUpdate = !1
  42379. }
  42380. ,
  42381. n.DirectGeometry.prototype = {
  42382. constructor: n.DirectGeometry,
  42383. computeBoundingBox: n.Geometry.prototype.computeBoundingBox,
  42384. computeBoundingSphere: n.Geometry.prototype.computeBoundingSphere,
  42385. computeFaceNormals: function() {
  42386. console.warn("THREE.DirectGeometry: computeFaceNormals() is not a method of this type of geometry.")
  42387. },
  42388. computeVertexNormals: function() {
  42389. console.warn("THREE.DirectGeometry: computeVertexNormals() is not a method of this type of geometry.")
  42390. },
  42391. computeGroups: function(e) {
  42392. for (var t, i, n = [], r = e.faces, o = 0; o < r.length; o++) {
  42393. var a = r[o];
  42394. a.materialIndex !== i && (i = a.materialIndex,
  42395. void 0 !== t && (t.count = 3 * o - t.start,
  42396. n.push(t)),
  42397. t = {
  42398. start: 3 * o,
  42399. materialIndex: i
  42400. })
  42401. }
  42402. void 0 !== t && (t.count = 3 * o - t.start,
  42403. n.push(t)),
  42404. this.groups = n
  42405. },
  42406. fromGeometry: function(e) {
  42407. var t, i = e.faces, r = e.vertices, o = e.faceVertexUvs, a = o[0] && o[0].length > 0, s = o[1] && o[1].length > 0, l = e.morphTargets, c = l.length;
  42408. if (c > 0) {
  42409. t = [];
  42410. for (var h = 0; h < c; h++)
  42411. t[h] = [];
  42412. this.morphTargets.position = t
  42413. }
  42414. var u, d = e.morphNormals, p = d.length;
  42415. if (p > 0) {
  42416. u = [];
  42417. for (var h = 0; h < p; h++)
  42418. u[h] = [];
  42419. this.morphTargets.normal = u
  42420. }
  42421. for (var f = e.skinIndices, g = e.skinWeights, m = f.length === r.length, v = g.length === r.length, h = 0; h < i.length; h++) {
  42422. var A = i[h];
  42423. this.vertices.push(r[A.a], r[A.b], r[A.c]);
  42424. var y = A.vertexNormals;
  42425. if (3 === y.length)
  42426. this.normals.push(y[0], y[1], y[2]);
  42427. else {
  42428. var C = A.normal;
  42429. this.normals.push(C, C, C)
  42430. }
  42431. var I = A.vertexColors;
  42432. if (3 === I.length)
  42433. this.colors.push(I[0], I[1], I[2]);
  42434. else {
  42435. var E = A.color;
  42436. this.colors.push(E, E, E)
  42437. }
  42438. if (a === !0) {
  42439. var b = o[0][h];
  42440. void 0 !== b ? this.uvs.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv ", h),
  42441. this.uvs.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42442. }
  42443. if (s === !0) {
  42444. var b = o[1][h];
  42445. void 0 !== b ? this.uvs2.push(b[0], b[1], b[2]) : (console.warn("THREE.DirectGeometry.fromGeometry(): Undefined vertexUv2 ", h),
  42446. this.uvs2.push(new n.Vector2, new n.Vector2, new n.Vector2))
  42447. }
  42448. for (var w = 0; w < c; w++) {
  42449. var _ = l[w].vertices;
  42450. t[w].push(_[A.a], _[A.b], _[A.c])
  42451. }
  42452. for (var w = 0; w < p; w++) {
  42453. var T = d[w].vertexNormals[h];
  42454. u[w].push(T.a, T.b, T.c)
  42455. }
  42456. m && this.skinIndices.push(f[A.a], f[A.b], f[A.c]),
  42457. v && this.skinWeights.push(g[A.a], g[A.b], g[A.c])
  42458. }
  42459. return this.computeGroups(e),
  42460. this.verticesNeedUpdate = e.verticesNeedUpdate,
  42461. this.normalsNeedUpdate = e.normalsNeedUpdate,
  42462. this.colorsNeedUpdate = e.colorsNeedUpdate,
  42463. this.uvsNeedUpdate = e.uvsNeedUpdate,
  42464. this.groupsNeedUpdate = e.groupsNeedUpdate,
  42465. this
  42466. },
  42467. dispose: function() {
  42468. this.dispatchEvent({
  42469. type: "dispose"
  42470. })
  42471. }
  42472. },
  42473. n.EventDispatcher.prototype.apply(n.DirectGeometry.prototype),
  42474. n.BufferGeometry = function() {
  42475. Object.defineProperty(this, "id", {
  42476. value: n.GeometryIdCount++
  42477. }),
  42478. this.uuid = n.Math.generateUUID(),
  42479. this.name = "",
  42480. this.type = "BufferGeometry",
  42481. this.index = null,
  42482. this.attributes = {},
  42483. this.morphAttributes = {},
  42484. this.groups = [],
  42485. this.boundingBox = null,
  42486. this.boundingSphere = null,
  42487. this.drawRange = {
  42488. start: 0,
  42489. count: 1 / 0
  42490. }
  42491. }
  42492. ,
  42493. n.BufferGeometry.prototype = {
  42494. constructor: n.BufferGeometry,
  42495. getIndex: function() {
  42496. return this.index
  42497. },
  42498. setIndex: function(e) {
  42499. this.index = e
  42500. },
  42501. addAttribute: function(e, t) {
  42502. return t instanceof n.BufferAttribute == !1 && t instanceof n.InterleavedBufferAttribute == !1 ? (console.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),
  42503. void this.addAttribute(e, new n.BufferAttribute(arguments[1],arguments[2]))) : "index" === e ? (console.warn("THREE.BufferGeometry.addAttribute: Use .setIndex() for index attribute."),
  42504. void this.setIndex(t)) : (this.attributes[e] = t,
  42505. this)
  42506. },
  42507. getAttribute: function(e) {
  42508. return this.attributes[e]
  42509. },
  42510. removeAttribute: function(e) {
  42511. return delete this.attributes[e],
  42512. this
  42513. },
  42514. addGroup: function(e, t, i) {
  42515. this.groups.push({
  42516. start: e,
  42517. count: t,
  42518. materialIndex: void 0 !== i ? i : 0
  42519. })
  42520. },
  42521. clearGroups: function() {
  42522. this.groups = []
  42523. },
  42524. setDrawRange: function(e, t) {
  42525. this.drawRange.start = e,
  42526. this.drawRange.count = t
  42527. },
  42528. applyMatrix: function(e) {
  42529. var t = this.attributes.position;
  42530. void 0 !== t && (e.applyToVector3Array(t.array),
  42531. t.needsUpdate = !0);
  42532. var i = this.attributes.normal;
  42533. if (void 0 !== i) {
  42534. var r = (new n.Matrix3).getNormalMatrix(e);
  42535. r.applyToVector3Array(i.array),
  42536. i.needsUpdate = !0
  42537. }
  42538. return null !== this.boundingBox && this.computeBoundingBox(),
  42539. null !== this.boundingSphere && this.computeBoundingSphere(),
  42540. this
  42541. },
  42542. rotateX: function() {
  42543. var e;
  42544. return function(t) {
  42545. return void 0 === e && (e = new n.Matrix4),
  42546. e.makeRotationX(t),
  42547. this.applyMatrix(e),
  42548. this
  42549. }
  42550. }(),
  42551. rotateY: function() {
  42552. var e;
  42553. return function(t) {
  42554. return void 0 === e && (e = new n.Matrix4),
  42555. e.makeRotationY(t),
  42556. this.applyMatrix(e),
  42557. this
  42558. }
  42559. }(),
  42560. rotateZ: function() {
  42561. var e;
  42562. return function(t) {
  42563. return void 0 === e && (e = new n.Matrix4),
  42564. e.makeRotationZ(t),
  42565. this.applyMatrix(e),
  42566. this
  42567. }
  42568. }(),
  42569. translate: function() {
  42570. var e;
  42571. return function(t, i, r) {
  42572. return void 0 === e && (e = new n.Matrix4),
  42573. e.makeTranslation(t, i, r),
  42574. this.applyMatrix(e),
  42575. this
  42576. }
  42577. }(),
  42578. scale: function() {
  42579. var e;
  42580. return function(t, i, r) {
  42581. return void 0 === e && (e = new n.Matrix4),
  42582. e.makeScale(t, i, r),
  42583. this.applyMatrix(e),
  42584. this
  42585. }
  42586. }(),
  42587. lookAt: function() {
  42588. var e;
  42589. return function(t) {
  42590. void 0 === e && (e = new n.Object3D),
  42591. e.lookAt(t),
  42592. e.updateMatrix(),
  42593. this.applyMatrix(e.matrix)
  42594. }
  42595. }(),
  42596. center: function() {
  42597. this.computeBoundingBox();
  42598. var e = this.boundingBox.center().negate();
  42599. return this.translate(e.x, e.y, e.z),
  42600. e
  42601. },
  42602. setFromObject: function(e) {
  42603. var t = e.geometry;
  42604. if (e instanceof n.Points || e instanceof n.Line) {
  42605. var i = new n.Float32Attribute(3 * t.vertices.length,3)
  42606. , r = new n.Float32Attribute(3 * t.colors.length,3);
  42607. if (this.addAttribute("position", i.copyVector3sArray(t.vertices)),
  42608. this.addAttribute("color", r.copyColorsArray(t.colors)),
  42609. t.lineDistances && t.lineDistances.length === t.vertices.length) {
  42610. var o = new n.Float32Attribute(t.lineDistances.length,1);
  42611. this.addAttribute("lineDistance", o.copyArray(t.lineDistances))
  42612. }
  42613. null !== t.boundingSphere && (this.boundingSphere = t.boundingSphere.clone()),
  42614. null !== t.boundingBox && (this.boundingBox = t.boundingBox.clone())
  42615. } else
  42616. e instanceof n.Mesh && t instanceof n.Geometry && this.fromGeometry(t);
  42617. return this
  42618. },
  42619. updateFromObject: function(e) {
  42620. var t = e.geometry;
  42621. if (e instanceof n.Mesh) {
  42622. var i = t.__directGeometry;
  42623. if (void 0 === i)
  42624. return this.fromGeometry(t);
  42625. i.verticesNeedUpdate = t.verticesNeedUpdate,
  42626. i.normalsNeedUpdate = t.normalsNeedUpdate,
  42627. i.colorsNeedUpdate = t.colorsNeedUpdate,
  42628. i.uvsNeedUpdate = t.uvsNeedUpdate,
  42629. i.groupsNeedUpdate = t.groupsNeedUpdate,
  42630. t.verticesNeedUpdate = !1,
  42631. t.normalsNeedUpdate = !1,
  42632. t.colorsNeedUpdate = !1,
  42633. t.uvsNeedUpdate = !1,
  42634. t.groupsNeedUpdate = !1,
  42635. t = i
  42636. }
  42637. if (t.verticesNeedUpdate === !0) {
  42638. var r = this.attributes.position;
  42639. void 0 !== r && (r.copyVector3sArray(t.vertices),
  42640. r.needsUpdate = !0),
  42641. t.verticesNeedUpdate = !1
  42642. }
  42643. if (t.normalsNeedUpdate === !0) {
  42644. var r = this.attributes.normal;
  42645. void 0 !== r && (r.copyVector3sArray(t.normals),
  42646. r.needsUpdate = !0),
  42647. t.normalsNeedUpdate = !1
  42648. }
  42649. if (t.colorsNeedUpdate === !0) {
  42650. var r = this.attributes.color;
  42651. void 0 !== r && (r.copyColorsArray(t.colors),
  42652. r.needsUpdate = !0),
  42653. t.colorsNeedUpdate = !1
  42654. }
  42655. if (t.uvsNeedUpdate) {
  42656. var r = this.attributes.uv;
  42657. void 0 !== r && (r.copyVector2sArray(t.uvs),
  42658. r.needsUpdate = !0),
  42659. t.uvsNeedUpdate = !1
  42660. }
  42661. if (t.lineDistancesNeedUpdate) {
  42662. var r = this.attributes.lineDistance;
  42663. void 0 !== r && (r.copyArray(t.lineDistances),
  42664. r.needsUpdate = !0),
  42665. t.lineDistancesNeedUpdate = !1
  42666. }
  42667. return t.groupsNeedUpdate && (t.computeGroups(e.geometry),
  42668. this.groups = t.groups,
  42669. t.groupsNeedUpdate = !1),
  42670. this
  42671. },
  42672. fromGeometry: function(e) {
  42673. return e.__directGeometry = (new n.DirectGeometry).fromGeometry(e),
  42674. this.fromDirectGeometry(e.__directGeometry)
  42675. },
  42676. fromDirectGeometry: function(e) {
  42677. var t = new Float32Array(3 * e.vertices.length);
  42678. if (this.addAttribute("position", new n.BufferAttribute(t,3).copyVector3sArray(e.vertices)),
  42679. e.normals.length > 0) {
  42680. var i = new Float32Array(3 * e.normals.length);
  42681. this.addAttribute("normal", new n.BufferAttribute(i,3).copyVector3sArray(e.normals))
  42682. }
  42683. if (e.colors.length > 0) {
  42684. var r = new Float32Array(3 * e.colors.length);
  42685. this.addAttribute("color", new n.BufferAttribute(r,3).copyColorsArray(e.colors))
  42686. }
  42687. if (e.uvs.length > 0) {
  42688. var o = new Float32Array(2 * e.uvs.length);
  42689. this.addAttribute("uv", new n.BufferAttribute(o,2).copyVector2sArray(e.uvs))
  42690. }
  42691. if (e.uvs2.length > 0) {
  42692. var a = new Float32Array(2 * e.uvs2.length);
  42693. this.addAttribute("uv2", new n.BufferAttribute(a,2).copyVector2sArray(e.uvs2))
  42694. }
  42695. if (e.indices.length > 0) {
  42696. var s = e.vertices.length > 65535 ? Uint32Array : Uint16Array
  42697. , l = new s(3 * e.indices.length);
  42698. this.setIndex(new n.BufferAttribute(l,1).copyIndicesArray(e.indices))
  42699. }
  42700. this.groups = e.groups;
  42701. for (var c in e.morphTargets) {
  42702. for (var h = [], u = e.morphTargets[c], d = 0, p = u.length; d < p; d++) {
  42703. var f = u[d]
  42704. , g = new n.Float32Attribute(3 * f.length,3);
  42705. h.push(g.copyVector3sArray(f))
  42706. }
  42707. this.morphAttributes[c] = h
  42708. }
  42709. if (e.skinIndices.length > 0) {
  42710. var m = new n.Float32Attribute(4 * e.skinIndices.length,4);
  42711. this.addAttribute("skinIndex", m.copyVector4sArray(e.skinIndices))
  42712. }
  42713. if (e.skinWeights.length > 0) {
  42714. var v = new n.Float32Attribute(4 * e.skinWeights.length,4);
  42715. this.addAttribute("skinWeight", v.copyVector4sArray(e.skinWeights))
  42716. }
  42717. return null !== e.boundingSphere && (this.boundingSphere = e.boundingSphere.clone()),
  42718. null !== e.boundingBox && (this.boundingBox = e.boundingBox.clone()),
  42719. this
  42720. },
  42721. computeBoundingBox: function() {
  42722. new n.Vector3;
  42723. return function() {
  42724. null === this.boundingBox && (this.boundingBox = new n.Box3);
  42725. var e = this.attributes.position.array;
  42726. e && this.boundingBox.setFromArray(e),
  42727. void 0 !== e && 0 !== e.length || (this.boundingBox.min.set(0, 0, 0),
  42728. this.boundingBox.max.set(0, 0, 0)),
  42729. (isNaN(this.boundingBox.min.x) || isNaN(this.boundingBox.min.y) || isNaN(this.boundingBox.min.z)) && console.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this)
  42730. }
  42731. }(),
  42732. computeBoundingSphere: function() {
  42733. var e = new n.Box3
  42734. , t = new n.Vector3;
  42735. return function() {
  42736. null === this.boundingSphere && (this.boundingSphere = new n.Sphere);
  42737. var i = this.attributes.position.array;
  42738. if (i) {
  42739. var r = this.boundingSphere.center;
  42740. e.setFromArray(i),
  42741. e.center(r);
  42742. for (var o = 0, a = 0, s = i.length; a < s; a += 3)
  42743. t.fromArray(i, a),
  42744. o = Math.max(o, r.distanceToSquared(t));
  42745. this.boundingSphere.radius = Math.sqrt(o),
  42746. isNaN(this.boundingSphere.radius) && console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this)
  42747. }
  42748. }
  42749. }(),
  42750. computeFaceNormals: function() {},
  42751. computeVertexNormals: function() {
  42752. var e = this.index
  42753. , t = this.attributes
  42754. , i = this.groups;
  42755. if (t.position) {
  42756. var r = t.position.array;
  42757. if (void 0 === t.normal)
  42758. this.addAttribute("normal", new n.BufferAttribute(new Float32Array(r.length),3));
  42759. else
  42760. for (var o = t.normal.array, a = 0, s = o.length; a < s; a++)
  42761. o[a] = 0;
  42762. var l, c, h, u = t.normal.array, d = new n.Vector3, p = new n.Vector3, f = new n.Vector3, g = new n.Vector3, m = new n.Vector3;
  42763. if (e) {
  42764. var v = e.array;
  42765. 0 === i.length && this.addGroup(0, v.length);
  42766. for (var A = 0, y = i.length; A < y; ++A)
  42767. for (var C = i[A], I = C.start, E = C.count, a = I, s = I + E; a < s; a += 3)
  42768. l = 3 * v[a + 0],
  42769. c = 3 * v[a + 1],
  42770. h = 3 * v[a + 2],
  42771. d.fromArray(r, l),
  42772. p.fromArray(r, c),
  42773. f.fromArray(r, h),
  42774. g.subVectors(f, p),
  42775. m.subVectors(d, p),
  42776. g.cross(m),
  42777. u[l] += g.x,
  42778. u[l + 1] += g.y,
  42779. u[l + 2] += g.z,
  42780. u[c] += g.x,
  42781. u[c + 1] += g.y,
  42782. u[c + 2] += g.z,
  42783. u[h] += g.x,
  42784. u[h + 1] += g.y,
  42785. u[h + 2] += g.z
  42786. } else
  42787. for (var a = 0, s = r.length; a < s; a += 9)
  42788. d.fromArray(r, a),
  42789. p.fromArray(r, a + 3),
  42790. f.fromArray(r, a + 6),
  42791. g.subVectors(f, p),
  42792. m.subVectors(d, p),
  42793. g.cross(m),
  42794. u[a] = g.x,
  42795. u[a + 1] = g.y,
  42796. u[a + 2] = g.z,
  42797. u[a + 3] = g.x,
  42798. u[a + 4] = g.y,
  42799. u[a + 5] = g.z,
  42800. u[a + 6] = g.x,
  42801. u[a + 7] = g.y,
  42802. u[a + 8] = g.z;
  42803. this.normalizeNormals(),
  42804. t.normal.needsUpdate = !0
  42805. }
  42806. },
  42807. merge: function(e, t) {
  42808. if (e instanceof n.BufferGeometry == !1)
  42809. return void console.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.", e);
  42810. void 0 === t && (t = 0);
  42811. var i = this.attributes;
  42812. for (var r in i)
  42813. if (void 0 !== e.attributes[r])
  42814. 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++,
  42815. u++)
  42816. a[u] = l[h];
  42817. return this
  42818. },
  42819. normalizeNormals: function() {
  42820. for (var e, t, i, n, r = this.attributes.normal.array, o = 0, a = r.length; o < a; o += 3)
  42821. e = r[o],
  42822. t = r[o + 1],
  42823. i = r[o + 2],
  42824. n = 1 / Math.sqrt(e * e + t * t + i * i),
  42825. r[o] *= n,
  42826. r[o + 1] *= n,
  42827. r[o + 2] *= n
  42828. },
  42829. toNonIndexed: function() {
  42830. if (null === this.index)
  42831. return console.warn("THREE.BufferGeometry.toNonIndexed(): Geometry is already non-indexed."),
  42832. this;
  42833. var e = new n.BufferGeometry
  42834. , t = this.index.array
  42835. , i = this.attributes;
  42836. for (var r in i) {
  42837. 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++) {
  42838. c = t[u] * s;
  42839. for (var p = 0; p < s; p++)
  42840. l[h++] = a[c++]
  42841. }
  42842. e.addAttribute(r, new n.BufferAttribute(l,s))
  42843. }
  42844. return e
  42845. },
  42846. toJSON: function() {
  42847. var e = {
  42848. metadata: {
  42849. version: 4.4,
  42850. type: "BufferGeometry",
  42851. generator: "BufferGeometry.toJSON"
  42852. }
  42853. };
  42854. if (e.uuid = this.uuid,
  42855. e.type = this.type,
  42856. "" !== this.name && (e.name = this.name),
  42857. void 0 !== this.parameters) {
  42858. var t = this.parameters;
  42859. for (var i in t)
  42860. void 0 !== t[i] && (e[i] = t[i]);
  42861. return e
  42862. }
  42863. e.data = {
  42864. attributes: {}
  42865. };
  42866. var n = this.index;
  42867. if (null !== n) {
  42868. var r = Array.prototype.slice.call(n.array);
  42869. e.data.index = {
  42870. type: n.array.constructor.name,
  42871. array: r
  42872. }
  42873. }
  42874. var o = this.attributes;
  42875. for (var i in o) {
  42876. var a = o[i]
  42877. , r = Array.prototype.slice.call(a.array);
  42878. e.data.attributes[i] = {
  42879. itemSize: a.itemSize,
  42880. type: a.array.constructor.name,
  42881. array: r
  42882. }
  42883. }
  42884. var s = this.groups;
  42885. s.length > 0 && (e.data.groups = JSON.parse(JSON.stringify(s)));
  42886. var l = this.boundingSphere;
  42887. return null !== l && (e.data.boundingSphere = {
  42888. center: l.center.toArray(),
  42889. radius: l.radius
  42890. }),
  42891. e
  42892. },
  42893. clone: function() {
  42894. return (new n.BufferGeometry).copy(this)
  42895. },
  42896. copy: function(e) {
  42897. var t = e.index;
  42898. null !== t && this.setIndex(t.clone());
  42899. var i = e.attributes;
  42900. for (var n in i) {
  42901. var r = i[n];
  42902. this.addAttribute(n, r.clone())
  42903. }
  42904. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42905. var l = o[a];
  42906. this.addGroup(l.start, l.count)
  42907. }
  42908. return this
  42909. },
  42910. dispose: function() {
  42911. this.dispatchEvent({
  42912. type: "dispose"
  42913. })
  42914. }
  42915. },
  42916. n.EventDispatcher.prototype.apply(n.BufferGeometry.prototype),
  42917. n.BufferGeometry.MaxIndex = 65535,
  42918. n.InstancedBufferGeometry = function() {
  42919. n.BufferGeometry.call(this),
  42920. this.type = "InstancedBufferGeometry",
  42921. this.maxInstancedCount = void 0
  42922. }
  42923. ,
  42924. n.InstancedBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  42925. n.InstancedBufferGeometry.prototype.constructor = n.InstancedBufferGeometry,
  42926. n.InstancedBufferGeometry.prototype.addGroup = function(e, t, i) {
  42927. this.groups.push({
  42928. start: e,
  42929. count: t,
  42930. instances: i
  42931. })
  42932. }
  42933. ,
  42934. n.InstancedBufferGeometry.prototype.copy = function(e) {
  42935. var t = e.index;
  42936. null !== t && this.setIndex(t.clone());
  42937. var i = e.attributes;
  42938. for (var n in i) {
  42939. var r = i[n];
  42940. this.addAttribute(n, r.clone())
  42941. }
  42942. for (var o = e.groups, a = 0, s = o.length; a < s; a++) {
  42943. var l = o[a];
  42944. this.addGroup(l.start, l.count, l.instances)
  42945. }
  42946. return this
  42947. }
  42948. ,
  42949. n.EventDispatcher.prototype.apply(n.InstancedBufferGeometry.prototype),
  42950. n.Uniform = function(e, t) {
  42951. this.type = e,
  42952. this.value = t,
  42953. this.dynamic = !1
  42954. }
  42955. ,
  42956. n.Uniform.prototype = {
  42957. constructor: n.Uniform,
  42958. onUpdate: function(e) {
  42959. return this.dynamic = !0,
  42960. this.onUpdateCallback = e,
  42961. this
  42962. }
  42963. },
  42964. n.AnimationClip = function(e, t, i) {
  42965. this.name = e || n.Math.generateUUID(),
  42966. this.tracks = i,
  42967. this.duration = void 0 !== t ? t : -1,
  42968. this.duration < 0 && this.resetDuration(),
  42969. this.trim(),
  42970. this.optimize()
  42971. }
  42972. ,
  42973. n.AnimationClip.prototype = {
  42974. constructor: n.AnimationClip,
  42975. resetDuration: function() {
  42976. for (var e = this.tracks, t = 0, i = 0, n = e.length; i !== n; ++i) {
  42977. var r = this.tracks[i];
  42978. t = Math.max(t, r.times[r.times.length - 1])
  42979. }
  42980. this.duration = t
  42981. },
  42982. trim: function() {
  42983. for (var e = 0; e < this.tracks.length; e++)
  42984. this.tracks[e].trim(0, this.duration);
  42985. return this
  42986. },
  42987. optimize: function() {
  42988. for (var e = 0; e < this.tracks.length; e++)
  42989. this.tracks[e].optimize();
  42990. return this
  42991. }
  42992. },
  42993. Object.assign(n.AnimationClip, {
  42994. parse: function(e) {
  42995. for (var t = [], i = e.tracks, r = 1 / (e.fps || 1), o = 0, a = i.length; o !== a; ++o)
  42996. t.push(n.KeyframeTrack.parse(i[o]).scale(r));
  42997. return new n.AnimationClip(e.name,e.duration,t)
  42998. },
  42999. toJSON: function(e) {
  43000. for (var t = [], i = e.tracks, r = {
  43001. name: e.name,
  43002. duration: e.duration,
  43003. tracks: t
  43004. }, o = 0, a = i.length; o !== a; ++o)
  43005. t.push(n.KeyframeTrack.toJSON(i[o]));
  43006. return r
  43007. },
  43008. CreateFromMorphTargetSequence: function(e, t, i) {
  43009. for (var r = t.length, o = [], a = 0; a < r; a++) {
  43010. var s = []
  43011. , l = [];
  43012. s.push((a + r - 1) % r, a, (a + 1) % r),
  43013. l.push(0, 1, 0);
  43014. var c = n.AnimationUtils.getKeyframeOrder(s);
  43015. s = n.AnimationUtils.sortedArray(s, 1, c),
  43016. l = n.AnimationUtils.sortedArray(l, 1, c),
  43017. 0 === s[0] && (s.push(r),
  43018. l.push(l[0])),
  43019. o.push(new n.NumberKeyframeTrack(".morphTargetInfluences[" + t[a].name + "]",s,l).scale(1 / i))
  43020. }
  43021. return new n.AnimationClip(e,-1,o)
  43022. },
  43023. findByName: function(e, t) {
  43024. for (var i = 0; i < e.length; i++)
  43025. if (e[i].name === t)
  43026. return e[i];
  43027. return null
  43028. },
  43029. CreateClipsFromMorphTargetSequences: function(e, t) {
  43030. for (var i = {}, r = /^([\w-]*?)([\d]+)$/, o = 0, a = e.length; o < a; o++) {
  43031. var s = e[o]
  43032. , l = s.name.match(r);
  43033. if (l && l.length > 1) {
  43034. var c = l[1]
  43035. , h = i[c];
  43036. h || (i[c] = h = []),
  43037. h.push(s)
  43038. }
  43039. }
  43040. var u = [];
  43041. for (var c in i)
  43042. u.push(n.AnimationClip.CreateFromMorphTargetSequence(c, i[c], t));
  43043. return u
  43044. },
  43045. parseAnimation: function(e, t, i) {
  43046. if (!e)
  43047. return console.error(" no animation in JSONLoader data"),
  43048. null;
  43049. for (var r = function(e, t, i, r, o) {
  43050. if (0 !== i.length) {
  43051. var a = []
  43052. , s = [];
  43053. n.AnimationUtils.flattenJSON(i, a, s, r),
  43054. 0 !== a.length && o.push(new e(t,a,s))
  43055. }
  43056. }, o = [], a = e.name || "default", s = e.length || -1, l = e.fps || 30, c = e.hierarchy || [], h = 0; h < c.length; h++) {
  43057. var u = c[h].keys;
  43058. if (u && 0 != u.length)
  43059. if (u[0].morphTargets) {
  43060. for (var d = {}, p = 0; p < u.length; p++)
  43061. if (u[p].morphTargets)
  43062. for (var f = 0; f < u[p].morphTargets.length; f++)
  43063. d[u[p].morphTargets[f]] = -1;
  43064. for (var g in d) {
  43065. for (var m = [], v = [], f = 0; f !== u[p].morphTargets.length; ++f) {
  43066. var A = u[p];
  43067. m.push(A.time),
  43068. v.push(A.morphTarget === g ? 1 : 0)
  43069. }
  43070. o.push(new n.NumberKeyframeTrack(".morphTargetInfluence[" + g + "]",m,v))
  43071. }
  43072. s = d.length * (l || 1)
  43073. } else {
  43074. var y = ".bones[" + t[h].name + "]";
  43075. r(n.VectorKeyframeTrack, y + ".position", u, "pos", o),
  43076. r(n.QuaternionKeyframeTrack, y + ".quaternion", u, "rot", o),
  43077. r(n.VectorKeyframeTrack, y + ".scale", u, "scl", o)
  43078. }
  43079. }
  43080. if (0 === o.length)
  43081. return null;
  43082. var C = new n.AnimationClip(a,s,o);
  43083. return C
  43084. }
  43085. }),
  43086. n.AnimationMixer = function(e) {
  43087. this._root = e,
  43088. this._initMemoryManager(),
  43089. this._accuIndex = 0,
  43090. this.time = 0,
  43091. this.timeScale = 1
  43092. }
  43093. ,
  43094. n.AnimationMixer.prototype = {
  43095. constructor: n.AnimationMixer,
  43096. clipAction: function(e, t) {
  43097. var i, r = t || this._root, o = r.uuid, a = "string" == typeof e ? e : e.name, s = e !== a ? e : null, l = this._actionsByClip[a];
  43098. if (void 0 !== l) {
  43099. var c = l.actionByRoot[o];
  43100. if (void 0 !== c)
  43101. return c;
  43102. if (i = l.knownActions[0],
  43103. s = i._clip,
  43104. e !== a && e !== s)
  43105. throw new Error("Different clips with the same name detected!")
  43106. }
  43107. if (null === s)
  43108. return null;
  43109. var h = new n.AnimationMixer._Action(this,s,t);
  43110. return this._bindAction(h, i),
  43111. this._addInactiveAction(h, a, o),
  43112. h
  43113. },
  43114. existingAction: function(e, t) {
  43115. var i = t || this._root
  43116. , n = i.uuid
  43117. , r = "string" == typeof e ? e : e.name
  43118. , o = this._actionsByClip[r];
  43119. return void 0 !== o ? o.actionByRoot[n] || null : null
  43120. },
  43121. stopAllAction: function() {
  43122. var e = this._actions
  43123. , t = this._nActiveActions
  43124. , i = this._bindings
  43125. , n = this._nActiveBindings;
  43126. this._nActiveActions = 0,
  43127. this._nActiveBindings = 0;
  43128. for (var r = 0; r !== t; ++r)
  43129. e[r].reset();
  43130. for (var r = 0; r !== n; ++r)
  43131. i[r].useCount = 0;
  43132. return this
  43133. },
  43134. update: function(e) {
  43135. e *= this.timeScale;
  43136. 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) {
  43137. var s = t[a];
  43138. s.enabled && s._update(n, e, r, o)
  43139. }
  43140. for (var l = this._bindings, c = this._nActiveBindings, a = 0; a !== c; ++a)
  43141. l[a].apply(o);
  43142. return this
  43143. },
  43144. getRoot: function() {
  43145. return this._root
  43146. },
  43147. uncacheClip: function(e) {
  43148. var t = this._actions
  43149. , i = e.name
  43150. , n = this._actionsByClip
  43151. , r = n[i];
  43152. if (void 0 !== r) {
  43153. for (var o = r.knownActions, a = 0, s = o.length; a !== s; ++a) {
  43154. var l = o[a];
  43155. this._deactivateAction(l);
  43156. var c = l._cacheIndex
  43157. , h = t[t.length - 1];
  43158. l._cacheIndex = null,
  43159. l._byClipCacheIndex = null,
  43160. h._cacheIndex = c,
  43161. t[c] = h,
  43162. t.pop(),
  43163. this._removeInactiveBindingsForAction(l)
  43164. }
  43165. delete n[i]
  43166. }
  43167. },
  43168. uncacheRoot: function(e) {
  43169. var t = e.uuid
  43170. , i = this._actionsByClip;
  43171. for (var n in i) {
  43172. var r = i[n].actionByRoot
  43173. , o = r[t];
  43174. void 0 !== o && (this._deactivateAction(o),
  43175. this._removeInactiveAction(o))
  43176. }
  43177. var a = this._bindingsByRootAndName
  43178. , s = a[t];
  43179. if (void 0 !== s)
  43180. for (var l in s) {
  43181. var c = s[l];
  43182. c.restoreOriginalState(),
  43183. this._removeInactiveBinding(c)
  43184. }
  43185. },
  43186. uncacheAction: function(e, t) {
  43187. var i = this.existingAction(e, t);
  43188. null !== i && (this._deactivateAction(i),
  43189. this._removeInactiveAction(i))
  43190. }
  43191. },
  43192. n.EventDispatcher.prototype.apply(n.AnimationMixer.prototype),
  43193. n.AnimationMixer._Action = function(e, t, i) {
  43194. this._mixer = e,
  43195. this._clip = t,
  43196. this._localRoot = i || null;
  43197. for (var r = t.tracks, o = r.length, a = new Array(o), s = {
  43198. endingStart: n.ZeroCurvatureEnding,
  43199. endingEnd: n.ZeroCurvatureEnding
  43200. }, l = 0; l !== o; ++l) {
  43201. var c = r[l].createInterpolant(null);
  43202. a[l] = c,
  43203. c.settings = s
  43204. }
  43205. this._interpolantSettings = s,
  43206. this._interpolants = a,
  43207. this._propertyBindings = new Array(o),
  43208. this._cacheIndex = null,
  43209. this._byClipCacheIndex = null,
  43210. this._timeScaleInterpolant = null,
  43211. this._weightInterpolant = null,
  43212. this.loop = n.LoopRepeat,
  43213. this._loopCount = -1,
  43214. this._startTime = null,
  43215. this.time = 0,
  43216. this.timeScale = 1,
  43217. this._effectiveTimeScale = 1,
  43218. this.weight = 1,
  43219. this._effectiveWeight = 1,
  43220. this.repetitions = 1 / 0,
  43221. this.paused = !1,
  43222. this.enabled = !0,
  43223. this.clampWhenFinished = !1,
  43224. this.zeroSlopeAtStart = !0,
  43225. this.zeroSlopeAtEnd = !0
  43226. }
  43227. ,
  43228. n.AnimationMixer._Action.prototype = {
  43229. constructor: n.AnimationMixer._Action,
  43230. play: function() {
  43231. return this._mixer._activateAction(this),
  43232. this
  43233. },
  43234. stop: function() {
  43235. return this._mixer._deactivateAction(this),
  43236. this.reset()
  43237. },
  43238. reset: function() {
  43239. return this.paused = !1,
  43240. this.enabled = !0,
  43241. this.time = 0,
  43242. this._loopCount = -1,
  43243. this._startTime = null,
  43244. this.stopFading().stopWarping()
  43245. },
  43246. isRunning: function() {
  43247. this._startTime;
  43248. return this.enabled && !this.paused && 0 !== this.timeScale && null === this._startTime && this._mixer._isActiveAction(this)
  43249. },
  43250. isScheduled: function() {
  43251. return this._mixer._isActiveAction(this)
  43252. },
  43253. startAt: function(e) {
  43254. return this._startTime = e,
  43255. this
  43256. },
  43257. setLoop: function(e, t) {
  43258. return this.loop = e,
  43259. this.repetitions = t,
  43260. this
  43261. },
  43262. setEffectiveWeight: function(e) {
  43263. return this.weight = e,
  43264. this._effectiveWeight = this.enabled ? e : 0,
  43265. this.stopFading()
  43266. },
  43267. getEffectiveWeight: function() {
  43268. return this._effectiveWeight
  43269. },
  43270. fadeIn: function(e) {
  43271. return this._scheduleFading(e, 0, 1)
  43272. },
  43273. fadeOut: function(e) {
  43274. return this._scheduleFading(e, 1, 0)
  43275. },
  43276. crossFadeFrom: function(e, t, i) {
  43277. this._mixer;
  43278. if (e.fadeOut(t),
  43279. this.fadeIn(t),
  43280. i) {
  43281. var n = this._clip.duration
  43282. , r = e._clip.duration
  43283. , o = r / n
  43284. , a = n / r;
  43285. e.warp(1, o, t),
  43286. this.warp(a, 1, t)
  43287. }
  43288. return this
  43289. },
  43290. crossFadeTo: function(e, t, i) {
  43291. return e.crossFadeFrom(this, t, i)
  43292. },
  43293. stopFading: function() {
  43294. var e = this._weightInterpolant;
  43295. return null !== e && (this._weightInterpolant = null,
  43296. this._mixer._takeBackControlInterpolant(e)),
  43297. this
  43298. },
  43299. setEffectiveTimeScale: function(e) {
  43300. return this.timeScale = e,
  43301. this._effectiveTimeScale = this.paused ? 0 : e,
  43302. this.stopWarping()
  43303. },
  43304. getEffectiveTimeScale: function() {
  43305. return this._effectiveTimeScale
  43306. },
  43307. setDuration: function(e) {
  43308. return this.timeScale = this._clip.duration / e,
  43309. this.stopWarping()
  43310. },
  43311. syncWith: function(e) {
  43312. return this.time = e.time,
  43313. this.timeScale = e.timeScale,
  43314. this.stopWarping()
  43315. },
  43316. halt: function(e) {
  43317. return this.warp(this._currentTimeScale, 0, e)
  43318. },
  43319. warp: function(e, t, i) {
  43320. var n = this._mixer
  43321. , r = n.time
  43322. , o = this._timeScaleInterpolant
  43323. , a = this.timeScale;
  43324. null === o && (o = n._lendControlInterpolant(),
  43325. this._timeScaleInterpolant = o);
  43326. var s = o.parameterPositions
  43327. , l = o.sampleValues;
  43328. return s[0] = r,
  43329. s[1] = r + i,
  43330. l[0] = e / a,
  43331. l[1] = t / a,
  43332. this
  43333. },
  43334. stopWarping: function() {
  43335. var e = this._timeScaleInterpolant;
  43336. return null !== e && (this._timeScaleInterpolant = null,
  43337. this._mixer._takeBackControlInterpolant(e)),
  43338. this
  43339. },
  43340. getMixer: function() {
  43341. return this._mixer
  43342. },
  43343. getClip: function() {
  43344. return this._clip
  43345. },
  43346. getRoot: function() {
  43347. return this._localRoot || this._mixer._root
  43348. },
  43349. _update: function(e, t, i, n) {
  43350. var r = this._startTime;
  43351. if (null !== r) {
  43352. var o = (e - r) * i;
  43353. if (o < 0 || 0 === i)
  43354. return;
  43355. this._startTime = null,
  43356. t = i * o
  43357. }
  43358. t *= this._updateTimeScale(e);
  43359. var a = this._updateTime(t)
  43360. , s = this._updateWeight(e);
  43361. if (s > 0)
  43362. for (var l = this._interpolants, c = this._propertyBindings, h = 0, u = l.length; h !== u; ++h)
  43363. l[h].evaluate(a),
  43364. c[h].accumulate(n, s)
  43365. },
  43366. _updateWeight: function(e) {
  43367. var t = 0;
  43368. if (this.enabled) {
  43369. t = this.weight;
  43370. var i = this._weightInterpolant;
  43371. if (null !== i) {
  43372. var n = i.evaluate(e)[0];
  43373. t *= n,
  43374. e > i.parameterPositions[1] && (this.stopFading(),
  43375. 0 === n && (this.enabled = !1))
  43376. }
  43377. }
  43378. return this._effectiveWeight = t,
  43379. t
  43380. },
  43381. _updateTimeScale: function(e) {
  43382. var t = 0;
  43383. if (!this.paused) {
  43384. t = this.timeScale;
  43385. var i = this._timeScaleInterpolant;
  43386. if (null !== i) {
  43387. var n = i.evaluate(e)[0];
  43388. t *= n,
  43389. e > i.parameterPositions[1] && (this.stopWarping(),
  43390. 0 === t ? this.pause = !0 : this.timeScale = t)
  43391. }
  43392. }
  43393. return this._effectiveTimeScale = t,
  43394. t
  43395. },
  43396. _updateTime: function(e) {
  43397. var t = this.time + e;
  43398. if (0 === e)
  43399. return t;
  43400. var i = this._clip.duration
  43401. , r = this.loop
  43402. , o = this._loopCount
  43403. , a = !1;
  43404. switch (r) {
  43405. case n.LoopOnce:
  43406. if (o === -1 && (this.loopCount = 0,
  43407. this._setEndings(!0, !0, !1)),
  43408. t >= i)
  43409. t = i;
  43410. else {
  43411. if (!(t < 0))
  43412. break;
  43413. t = 0
  43414. }
  43415. this.clampWhenFinished ? this.pause = !0 : this.enabled = !1,
  43416. this._mixer.dispatchEvent({
  43417. type: "finished",
  43418. action: this,
  43419. direction: e < 0 ? -1 : 1
  43420. });
  43421. break;
  43422. case n.LoopPingPong:
  43423. a = !0;
  43424. case n.LoopRepeat:
  43425. if (o === -1 && (e > 0 ? (o = 0,
  43426. this._setEndings(!0, 0 === this.repetitions, a)) : this._setEndings(0 === this.repetitions, !0, a)),
  43427. t >= i || t < 0) {
  43428. var s = Math.floor(t / i);
  43429. t -= i * s,
  43430. o += Math.abs(s);
  43431. var l = this.repetitions - o;
  43432. if (l < 0) {
  43433. this.clampWhenFinished ? this.paused = !0 : this.enabled = !1,
  43434. t = e > 0 ? i : 0,
  43435. this._mixer.dispatchEvent({
  43436. type: "finished",
  43437. action: this,
  43438. direction: e > 0 ? 1 : -1
  43439. });
  43440. break
  43441. }
  43442. if (0 === l) {
  43443. var c = e < 0;
  43444. this._setEndings(c, !c, a)
  43445. } else
  43446. this._setEndings(!1, !1, a);
  43447. this._loopCount = o,
  43448. this._mixer.dispatchEvent({
  43449. type: "loop",
  43450. action: this,
  43451. loopDelta: s
  43452. })
  43453. }
  43454. if (r === n.LoopPingPong && 1 === (1 & o))
  43455. return this.time = t,
  43456. i - t
  43457. }
  43458. return this.time = t,
  43459. t
  43460. },
  43461. _setEndings: function(e, t, i) {
  43462. var r = this._interpolantSettings;
  43463. i ? (r.endingStart = n.ZeroSlopeEnding,
  43464. r.endingEnd = n.ZeroSlopeEnding) : (e ? r.endingStart = this.zeroSlopeAtStart ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingStart = n.WrapAroundEnding,
  43465. t ? r.endingEnd = this.zeroSlopeAtEnd ? n.ZeroSlopeEnding : n.ZeroCurvatureEnding : r.endingEnd = n.WrapAroundEnding)
  43466. },
  43467. _scheduleFading: function(e, t, i) {
  43468. var n = this._mixer
  43469. , r = n.time
  43470. , o = this._weightInterpolant;
  43471. null === o && (o = n._lendControlInterpolant(),
  43472. this._weightInterpolant = o);
  43473. var a = o.parameterPositions
  43474. , s = o.sampleValues;
  43475. return a[0] = r,
  43476. s[0] = t,
  43477. a[1] = r + e,
  43478. s[1] = i,
  43479. this
  43480. }
  43481. },
  43482. Object.assign(n.AnimationMixer.prototype, {
  43483. _bindAction: function(e, t) {
  43484. var i = e._localRoot || this._root
  43485. , r = e._clip.tracks
  43486. , o = r.length
  43487. , a = e._propertyBindings
  43488. , s = e._interpolants
  43489. , l = i.uuid
  43490. , c = this._bindingsByRootAndName
  43491. , h = c[l];
  43492. void 0 === h && (h = {},
  43493. c[l] = h);
  43494. for (var u = 0; u !== o; ++u) {
  43495. var d = r[u]
  43496. , p = d.name
  43497. , f = h[p];
  43498. if (void 0 !== f)
  43499. a[u] = f;
  43500. else {
  43501. if (f = a[u],
  43502. void 0 !== f) {
  43503. null === f._cacheIndex && (++f.referenceCount,
  43504. this._addInactiveBinding(f, l, p));
  43505. continue
  43506. }
  43507. var g = t && t._propertyBindings[u].binding.parsedPath;
  43508. f = new n.PropertyMixer(n.PropertyBinding.create(i, p, g),d.ValueTypeName,d.getValueSize()),
  43509. ++f.referenceCount,
  43510. this._addInactiveBinding(f, l, p),
  43511. a[u] = f
  43512. }
  43513. s[u].resultBuffer = f.buffer
  43514. }
  43515. },
  43516. _activateAction: function(e) {
  43517. if (!this._isActiveAction(e)) {
  43518. if (null === e._cacheIndex) {
  43519. var t = (e._localRoot || this._root).uuid
  43520. , i = e._clip.name
  43521. , n = this._actionsByClip[i];
  43522. this._bindAction(e, n && n.knownActions[0]),
  43523. this._addInactiveAction(e, i, t)
  43524. }
  43525. for (var r = e._propertyBindings, o = 0, a = r.length; o !== a; ++o) {
  43526. var s = r[o];
  43527. 0 === s.useCount++ && (this._lendBinding(s),
  43528. s.saveOriginalState())
  43529. }
  43530. this._lendAction(e)
  43531. }
  43532. },
  43533. _deactivateAction: function(e) {
  43534. if (this._isActiveAction(e)) {
  43535. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43536. var r = t[i];
  43537. 0 === --r.useCount && (r.restoreOriginalState(),
  43538. this._takeBackBinding(r))
  43539. }
  43540. this._takeBackAction(e)
  43541. }
  43542. },
  43543. _initMemoryManager: function() {
  43544. this._actions = [],
  43545. this._nActiveActions = 0,
  43546. this._actionsByClip = {},
  43547. this._bindings = [],
  43548. this._nActiveBindings = 0,
  43549. this._bindingsByRootAndName = {},
  43550. this._controlInterpolants = [],
  43551. this._nActiveControlInterpolants = 0;
  43552. var e = this;
  43553. this.stats = {
  43554. actions: {
  43555. get total() {
  43556. return e._actions.length
  43557. },
  43558. get inUse() {
  43559. return e._nActiveActions
  43560. }
  43561. },
  43562. bindings: {
  43563. get total() {
  43564. return e._bindings.length
  43565. },
  43566. get inUse() {
  43567. return e._nActiveBindings
  43568. }
  43569. },
  43570. controlInterpolants: {
  43571. get total() {
  43572. return e._controlInterpolants.length
  43573. },
  43574. get inUse() {
  43575. return e._nActiveControlInterpolants
  43576. }
  43577. }
  43578. }
  43579. },
  43580. _isActiveAction: function(e) {
  43581. var t = e._cacheIndex;
  43582. return null !== t && t < this._nActiveActions
  43583. },
  43584. _addInactiveAction: function(e, t, i) {
  43585. var n = this._actions
  43586. , r = this._actionsByClip
  43587. , o = r[t];
  43588. if (void 0 === o)
  43589. o = {
  43590. knownActions: [e],
  43591. actionByRoot: {}
  43592. },
  43593. e._byClipCacheIndex = 0,
  43594. r[t] = o;
  43595. else {
  43596. var a = o.knownActions;
  43597. e._byClipCacheIndex = a.length,
  43598. a.push(e)
  43599. }
  43600. e._cacheIndex = n.length,
  43601. n.push(e),
  43602. o.actionByRoot[i] = e
  43603. },
  43604. _removeInactiveAction: function(e) {
  43605. var t = this._actions
  43606. , i = t[t.length - 1]
  43607. , n = e._cacheIndex;
  43608. i._cacheIndex = n,
  43609. t[n] = i,
  43610. t.pop(),
  43611. e._cacheIndex = null;
  43612. var r = e._clip.name
  43613. , o = this._actionsByClip
  43614. , a = o[r]
  43615. , s = a.knownActions
  43616. , l = s[s.length - 1]
  43617. , c = e._byClipCacheIndex;
  43618. l._byClipCacheIndex = c,
  43619. s[c] = l,
  43620. s.pop(),
  43621. e._byClipCacheIndex = null;
  43622. var h = a.actionByRoot
  43623. , u = (t._localRoot || this._root).uuid;
  43624. delete h[u],
  43625. 0 === s.length && delete o[r],
  43626. this._removeInactiveBindingsForAction(e)
  43627. },
  43628. _removeInactiveBindingsForAction: function(e) {
  43629. for (var t = e._propertyBindings, i = 0, n = t.length; i !== n; ++i) {
  43630. var r = t[i];
  43631. 0 === --r.referenceCount && this._removeInactiveBinding(r)
  43632. }
  43633. },
  43634. _lendAction: function(e) {
  43635. var t = this._actions
  43636. , i = e._cacheIndex
  43637. , n = this._nActiveActions++
  43638. , r = t[n];
  43639. e._cacheIndex = n,
  43640. t[n] = e,
  43641. r._cacheIndex = i,
  43642. t[i] = r
  43643. },
  43644. _takeBackAction: function(e) {
  43645. var t = this._actions
  43646. , i = e._cacheIndex
  43647. , n = --this._nActiveActions
  43648. , r = t[n];
  43649. e._cacheIndex = n,
  43650. t[n] = e,
  43651. r._cacheIndex = i,
  43652. t[i] = r
  43653. },
  43654. _addInactiveBinding: function(e, t, i) {
  43655. var n = this._bindingsByRootAndName
  43656. , r = n[t]
  43657. , o = this._bindings;
  43658. void 0 === r && (r = {},
  43659. n[t] = r),
  43660. r[i] = e,
  43661. e._cacheIndex = o.length,
  43662. o.push(e)
  43663. },
  43664. _removeInactiveBinding: function(e) {
  43665. var t = this._bindings
  43666. , i = e.binding
  43667. , n = i.rootNode.uuid
  43668. , r = i.path
  43669. , o = this._bindingsByRootAndName
  43670. , a = o[n]
  43671. , s = t[t.length - 1]
  43672. , l = e._cacheIndex;
  43673. s._cacheIndex = l,
  43674. t[l] = s,
  43675. t.pop(),
  43676. delete a[r];
  43677. e: {
  43678. for (var c in a)
  43679. break e;
  43680. delete o[n]
  43681. }
  43682. },
  43683. _lendBinding: function(e) {
  43684. var t = this._bindings
  43685. , i = e._cacheIndex
  43686. , n = this._nActiveBindings++
  43687. , r = t[n];
  43688. e._cacheIndex = n,
  43689. t[n] = e,
  43690. r._cacheIndex = i,
  43691. t[i] = r
  43692. },
  43693. _takeBackBinding: function(e) {
  43694. var t = this._bindings
  43695. , i = e._cacheIndex
  43696. , n = --this._nActiveBindings
  43697. , r = t[n];
  43698. e._cacheIndex = n,
  43699. t[n] = e,
  43700. r._cacheIndex = i,
  43701. t[i] = r
  43702. },
  43703. _lendControlInterpolant: function() {
  43704. var e = this._controlInterpolants
  43705. , t = this._nActiveControlInterpolants++
  43706. , i = e[t];
  43707. return void 0 === i && (i = new n.LinearInterpolant(new Float32Array(2),new Float32Array(2),1,this._controlInterpolantsResultBuffer),
  43708. i.__cacheIndex = t,
  43709. e[t] = i),
  43710. i
  43711. },
  43712. _takeBackControlInterpolant: function(e) {
  43713. var t = this._controlInterpolants
  43714. , i = e.__cacheIndex
  43715. , n = --this._nActiveControlInterpolants
  43716. , r = t[n];
  43717. e.__cacheIndex = n,
  43718. t[n] = e,
  43719. r.__cacheIndex = i,
  43720. t[i] = r
  43721. },
  43722. _controlInterpolantsResultBuffer: new Float32Array(1)
  43723. }),
  43724. n.AnimationObjectGroup = function(e) {
  43725. this.uuid = n.Math.generateUUID(),
  43726. this._objects = Array.prototype.slice.call(arguments),
  43727. this.nCachedObjects_ = 0;
  43728. var t = {};
  43729. this._indicesByUUID = t;
  43730. for (var i = 0, r = arguments.length; i !== r; ++i)
  43731. t[arguments[i].uuid] = i;
  43732. this._paths = [],
  43733. this._parsedPaths = [],
  43734. this._bindings = [],
  43735. this._bindingsIndicesByPath = {};
  43736. var o = this;
  43737. this.stats = {
  43738. objects: {
  43739. get total() {
  43740. return o._objects.length
  43741. },
  43742. get inUse() {
  43743. return this.total - o.nCachedObjects_
  43744. }
  43745. },
  43746. get bindingsPerObject() {
  43747. return o._bindings.length
  43748. }
  43749. }
  43750. }
  43751. ,
  43752. n.AnimationObjectGroup.prototype = {
  43753. constructor: n.AnimationObjectGroup,
  43754. add: function(e) {
  43755. for (var t = this._objects, i = t.length, r = this.nCachedObjects_, o = this._indicesByUUID, a = this._paths, s = this._parsedPaths, l = this._bindings, c = l.length, h = 0, u = arguments.length; h !== u; ++h) {
  43756. var d = arguments[h]
  43757. , p = d.uuid
  43758. , f = o[p];
  43759. if (void 0 === f) {
  43760. f = i++,
  43761. o[p] = f,
  43762. t.push(d);
  43763. for (var g = 0, m = c; g !== m; ++g)
  43764. l[g].push(new n.PropertyBinding(d,a[g],s[g]))
  43765. } else if (f < r) {
  43766. var v = t[f]
  43767. , A = --r
  43768. , y = t[A];
  43769. o[y.uuid] = f,
  43770. t[f] = y,
  43771. o[p] = A,
  43772. t[A] = d;
  43773. for (var g = 0, m = c; g !== m; ++g) {
  43774. var C = l[g]
  43775. , I = C[A]
  43776. , E = C[f];
  43777. C[f] = I,
  43778. void 0 === E && (E = new n.PropertyBinding(d,a[g],s[g])),
  43779. C[A] = E
  43780. }
  43781. } else
  43782. t[f] !== v && console.error("Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes...")
  43783. }
  43784. this.nCachedObjects_ = r
  43785. },
  43786. remove: function(e) {
  43787. for (var t = this._objects, i = (t.length,
  43788. this.nCachedObjects_), n = this._indicesByUUID, r = this._bindings, o = r.length, a = 0, s = arguments.length; a !== s; ++a) {
  43789. var l = arguments[a]
  43790. , c = l.uuid
  43791. , h = n[c];
  43792. if (void 0 !== h && h >= i) {
  43793. var u = i++
  43794. , d = t[u];
  43795. n[d.uuid] = h,
  43796. t[h] = d,
  43797. n[c] = u,
  43798. t[u] = l;
  43799. for (var p = 0, f = o; p !== f; ++p) {
  43800. var g = r[p]
  43801. , m = g[u]
  43802. , v = g[h];
  43803. g[h] = m,
  43804. g[u] = v
  43805. }
  43806. }
  43807. }
  43808. this.nCachedObjects_ = i
  43809. },
  43810. uncache: function(e) {
  43811. 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) {
  43812. var c = arguments[s]
  43813. , h = c.uuid
  43814. , u = r[h];
  43815. if (void 0 !== u)
  43816. if (delete r[h],
  43817. u < n) {
  43818. var d = --n
  43819. , p = t[d]
  43820. , f = --i
  43821. , g = t[f];
  43822. r[p.uuid] = u,
  43823. t[u] = p,
  43824. r[g.uuid] = d,
  43825. t[d] = g,
  43826. t.pop();
  43827. for (var m = 0, v = a; m !== v; ++m) {
  43828. var A = o[m]
  43829. , y = A[d]
  43830. , C = A[f];
  43831. A[u] = y,
  43832. A[d] = C,
  43833. A.pop()
  43834. }
  43835. } else {
  43836. var f = --i
  43837. , g = t[f];
  43838. r[g.uuid] = u,
  43839. t[u] = g,
  43840. t.pop();
  43841. for (var m = 0, v = a; m !== v; ++m) {
  43842. var A = o[m];
  43843. A[u] = A[f],
  43844. A.pop()
  43845. }
  43846. }
  43847. }
  43848. this.nCachedObjects_ = n
  43849. },
  43850. subscribe_: function(e, t) {
  43851. var i = this._bindingsIndicesByPath
  43852. , r = i[e]
  43853. , o = this._bindings;
  43854. if (void 0 !== r)
  43855. return o[r];
  43856. var a = this._paths
  43857. , s = this._parsedPaths
  43858. , l = this._objects
  43859. , c = l.length
  43860. , h = this.nCachedObjects_
  43861. , u = new Array(c);
  43862. r = o.length,
  43863. i[e] = r,
  43864. a.push(e),
  43865. s.push(t),
  43866. o.push(u);
  43867. for (var d = h, p = l.length; d !== p; ++d) {
  43868. var f = l[d];
  43869. u[d] = new n.PropertyBinding(f,e,t)
  43870. }
  43871. return u
  43872. },
  43873. unsubscribe_: function(e) {
  43874. var t = this._bindingsIndicesByPath
  43875. , i = t[e];
  43876. if (void 0 !== i) {
  43877. var n = this._paths
  43878. , r = this._parsedPaths
  43879. , o = this._bindings
  43880. , a = o.length - 1
  43881. , s = o[a]
  43882. , l = e[a];
  43883. t[l] = i,
  43884. o[i] = s,
  43885. o.pop(),
  43886. r[i] = r[a],
  43887. r.pop(),
  43888. n[i] = n[a],
  43889. n.pop()
  43890. }
  43891. }
  43892. },
  43893. n.AnimationUtils = {
  43894. arraySlice: function(e, t, i) {
  43895. return n.AnimationUtils.isTypedArray(e) ? new e.constructor(e.subarray(t, i)) : e.slice(t, i)
  43896. },
  43897. convertArray: function(e, t, i) {
  43898. return !e || !i && e.constructor === t ? e : "number" == typeof t.BYTES_PER_ELEMENT ? new t(e) : Array.prototype.slice.call(e)
  43899. },
  43900. isTypedArray: function(e) {
  43901. return ArrayBuffer.isView(e) && !(e instanceof DataView)
  43902. },
  43903. getKeyframeOrder: function(e) {
  43904. function t(t, i) {
  43905. return e[t] - e[i]
  43906. }
  43907. for (var i = e.length, n = new Array(i), r = 0; r !== i; ++r)
  43908. n[r] = r;
  43909. return n.sort(t),
  43910. n
  43911. },
  43912. sortedArray: function(e, t, i) {
  43913. for (var n = e.length, r = new e.constructor(n), o = 0, a = 0; a !== n; ++o)
  43914. for (var s = i[o] * t, l = 0; l !== t; ++l)
  43915. r[a++] = e[s + l];
  43916. return r
  43917. },
  43918. flattenJSON: function(e, t, i, n) {
  43919. for (var r = 1, o = e[0]; void 0 !== o && void 0 === o[n]; )
  43920. o = e[r++];
  43921. if (void 0 !== o) {
  43922. var a = o[n];
  43923. if (void 0 !== a)
  43924. if (Array.isArray(a)) {
  43925. do
  43926. a = o[n],
  43927. void 0 !== a && (t.push(o.time),
  43928. i.push.apply(i, a)),
  43929. o = e[r++];
  43930. while (void 0 !== o)
  43931. } else if (void 0 !== a.toArray) {
  43932. do
  43933. a = o[n],
  43934. void 0 !== a && (t.push(o.time),
  43935. a.toArray(i, i.length)),
  43936. o = e[r++];
  43937. while (void 0 !== o)
  43938. } else
  43939. do
  43940. a = o[n],
  43941. void 0 !== a && (t.push(o.time),
  43942. i.push(a)),
  43943. o = e[r++];
  43944. while (void 0 !== o)
  43945. }
  43946. }
  43947. },
  43948. n.KeyframeTrack = function(e, t, i, r) {
  43949. if (void 0 === e)
  43950. throw new Error("track name is undefined");
  43951. if (void 0 === t || 0 === t.length)
  43952. throw new Error("no keyframes in track named " + e);
  43953. this.name = e,
  43954. this.times = n.AnimationUtils.convertArray(t, this.TimeBufferType),
  43955. this.values = n.AnimationUtils.convertArray(i, this.ValueBufferType),
  43956. this.setInterpolation(r || this.DefaultInterpolation),
  43957. this.validate(),
  43958. this.optimize()
  43959. }
  43960. ,
  43961. n.KeyframeTrack.prototype = {
  43962. constructor: n.KeyframeTrack,
  43963. TimeBufferType: Float32Array,
  43964. ValueBufferType: Float32Array,
  43965. DefaultInterpolation: n.InterpolateLinear,
  43966. InterpolantFactoryMethodDiscrete: function(e) {
  43967. return new n.DiscreteInterpolant(this.times,this.values,this.getValueSize(),e)
  43968. },
  43969. InterpolantFactoryMethodLinear: function(e) {
  43970. return new n.LinearInterpolant(this.times,this.values,this.getValueSize(),e)
  43971. },
  43972. InterpolantFactoryMethodSmooth: function(e) {
  43973. return new n.CubicInterpolant(this.times,this.values,this.getValueSize(),e)
  43974. },
  43975. setInterpolation: function(e) {
  43976. var t = void 0;
  43977. switch (e) {
  43978. case n.InterpolateDiscrete:
  43979. t = this.InterpolantFactoryMethodDiscrete;
  43980. break;
  43981. case n.InterpolateLinear:
  43982. t = this.InterpolantFactoryMethodLinear;
  43983. break;
  43984. case n.InterpolateSmooth:
  43985. t = this.InterpolantFactoryMethodSmooth
  43986. }
  43987. if (void 0 === t) {
  43988. var i = "unsupported interpolation for " + this.ValueTypeName + " keyframe track named " + this.name;
  43989. if (void 0 === this.createInterpolant) {
  43990. if (e === this.DefaultInterpolation)
  43991. throw new Error(i);
  43992. this.setInterpolation(this.DefaultInterpolation)
  43993. }
  43994. return void console.warn(i)
  43995. }
  43996. this.createInterpolant = t
  43997. },
  43998. getInterpolation: function() {
  43999. switch (this.createInterpolant) {
  44000. case this.InterpolantFactoryMethodDiscrete:
  44001. return n.InterpolateDiscrete;
  44002. case this.InterpolantFactoryMethodLinear:
  44003. return n.InterpolateLinear;
  44004. case this.InterpolantFactoryMethodSmooth:
  44005. return n.InterpolateSmooth
  44006. }
  44007. },
  44008. getValueSize: function() {
  44009. return this.values.length / this.times.length
  44010. },
  44011. shift: function(e) {
  44012. if (0 !== e)
  44013. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44014. t[i] += e;
  44015. return this
  44016. },
  44017. scale: function(e) {
  44018. if (1 !== e)
  44019. for (var t = this.times, i = 0, n = t.length; i !== n; ++i)
  44020. t[i] *= e;
  44021. return this
  44022. },
  44023. trim: function(e, t) {
  44024. for (var i = this.times, r = i.length, o = 0, a = r - 1; o !== r && i[o] < e; )
  44025. ++o;
  44026. for (; a !== -1 && i[a] > t; )
  44027. --a;
  44028. if (++a,
  44029. 0 !== o || a !== r) {
  44030. o >= a && (a = Math.max(a, 1),
  44031. o = a - 1);
  44032. var s = this.getValueSize();
  44033. this.times = n.AnimationUtils.arraySlice(i, o, a),
  44034. this.values = n.AnimationUtils.arraySlice(this.values, o * s, a * s)
  44035. }
  44036. return this
  44037. },
  44038. validate: function() {
  44039. var e = !0
  44040. , t = this.getValueSize();
  44041. t - Math.floor(t) !== 0 && (console.error("invalid value size in track", this),
  44042. e = !1);
  44043. var i = this.times
  44044. , r = this.values
  44045. , o = i.length;
  44046. 0 === o && (console.error("track is empty", this),
  44047. e = !1);
  44048. for (var a = null, s = 0; s !== o; s++) {
  44049. var l = i[s];
  44050. if ("number" == typeof l && isNaN(l)) {
  44051. console.error("time is not a valid number", this, s, l),
  44052. e = !1;
  44053. break
  44054. }
  44055. if (null !== a && a > l) {
  44056. console.error("out of order keys", this, s, l, a),
  44057. e = !1;
  44058. break
  44059. }
  44060. a = l
  44061. }
  44062. if (void 0 !== r && n.AnimationUtils.isTypedArray(r))
  44063. for (var s = 0, c = r.length; s !== c; ++s) {
  44064. var h = r[s];
  44065. if (isNaN(h)) {
  44066. console.error("value is not a valid number", this, s, h),
  44067. e = !1;
  44068. break
  44069. }
  44070. }
  44071. return e
  44072. },
  44073. optimize: function() {
  44074. for (var e = this.times, t = this.values, i = this.getValueSize(), r = 1, o = 1, a = e.length - 1; o <= a; ++o) {
  44075. var s = !1
  44076. , l = e[o]
  44077. , c = e[o + 1];
  44078. if (l !== c && (1 !== o || l !== l[0]))
  44079. for (var h = o * i, u = h - i, d = h + i, p = 0; p !== i; ++p) {
  44080. var f = t[h + p];
  44081. if (f !== t[u + p] || f !== t[d + p]) {
  44082. s = !0;
  44083. break
  44084. }
  44085. }
  44086. if (s) {
  44087. if (o !== r) {
  44088. e[r] = e[o];
  44089. for (var g = o * i, m = r * i, p = 0; p !== i; ++p)
  44090. t[m + p] = t[g + p]
  44091. }
  44092. ++r
  44093. }
  44094. }
  44095. return r !== e.length && (this.times = n.AnimationUtils.arraySlice(e, 0, r),
  44096. this.values = n.AnimationUtils.arraySlice(t, 0, r * i)),
  44097. this
  44098. }
  44099. },
  44100. Object.assign(n.KeyframeTrack, {
  44101. parse: function(e) {
  44102. if (void 0 === e.type)
  44103. throw new Error("track type undefined, can not parse");
  44104. var t = n.KeyframeTrack._getTrackTypeForValueTypeName(e.type);
  44105. if (void 0 === e.times) {
  44106. console.warn("legacy JSON format detected, converting");
  44107. var i = []
  44108. , r = [];
  44109. n.AnimationUtils.flattenJSON(e.keys, i, r, "value"),
  44110. e.times = i,
  44111. e.values = r
  44112. }
  44113. return void 0 !== t.parse ? t.parse(e) : new t(e.name,e.times,e.values,e.interpolation)
  44114. },
  44115. toJSON: function(e) {
  44116. var t, i = e.constructor;
  44117. if (void 0 !== i.toJSON)
  44118. t = i.toJSON(e);
  44119. else {
  44120. t = {
  44121. name: e.name,
  44122. times: n.AnimationUtils.convertArray(e.times, Array),
  44123. values: n.AnimationUtils.convertArray(e.values, Array)
  44124. };
  44125. var r = e.getInterpolation();
  44126. r !== e.DefaultInterpolation && (t.interpolation = r)
  44127. }
  44128. return t.type = e.ValueTypeName,
  44129. t
  44130. },
  44131. _getTrackTypeForValueTypeName: function(e) {
  44132. switch (e.toLowerCase()) {
  44133. case "scalar":
  44134. case "double":
  44135. case "float":
  44136. case "number":
  44137. case "integer":
  44138. return n.NumberKeyframeTrack;
  44139. case "vector":
  44140. case "vector2":
  44141. case "vector3":
  44142. case "vector4":
  44143. return n.VectorKeyframeTrack;
  44144. case "color":
  44145. return n.ColorKeyframeTrack;
  44146. case "quaternion":
  44147. return n.QuaternionKeyframeTrack;
  44148. case "bool":
  44149. case "boolean":
  44150. return n.BooleanKeyframeTrack;
  44151. case "string":
  44152. return n.StringKeyframeTrack
  44153. }
  44154. throw new Error("Unsupported typeName: " + e)
  44155. }
  44156. }),
  44157. n.PropertyBinding = function(e, t, i) {
  44158. this.path = t,
  44159. this.parsedPath = i || n.PropertyBinding.parseTrackName(t),
  44160. this.node = n.PropertyBinding.findNode(e, this.parsedPath.nodeName) || e,
  44161. this.rootNode = e
  44162. }
  44163. ,
  44164. n.PropertyBinding.prototype = {
  44165. constructor: n.PropertyBinding,
  44166. getValue: function(e, t) {
  44167. this.bind(),
  44168. this.getValue(e, t)
  44169. },
  44170. setValue: function(e, t) {
  44171. this.bind(),
  44172. this.setValue(e, t)
  44173. },
  44174. bind: function() {
  44175. var e = this.node
  44176. , t = this.parsedPath
  44177. , i = t.objectName
  44178. , r = t.propertyName
  44179. , o = t.propertyIndex;
  44180. if (e || (e = n.PropertyBinding.findNode(this.rootNode, t.nodeName) || this.rootNode,
  44181. this.node = e),
  44182. this.getValue = this._getValue_unavailable,
  44183. this.setValue = this._setValue_unavailable,
  44184. !e)
  44185. return void console.error(" trying to update node for track: " + this.path + " but it wasn't found.");
  44186. if (i) {
  44187. var a = t.objectIndex;
  44188. switch (i) {
  44189. case "materials":
  44190. if (!e.material)
  44191. return void console.error(" can not bind to material as node does not have a material", this);
  44192. if (!e.material.materials)
  44193. return void console.error(" can not bind to material.materials as node.material does not have a materials array", this);
  44194. e = e.material.materials;
  44195. break;
  44196. case "bones":
  44197. if (!e.skeleton)
  44198. return void console.error(" can not bind to bones as node does not have a skeleton", this);
  44199. e = e.skeleton.bones;
  44200. for (var s = 0; s < e.length; s++)
  44201. if (e[s].name === a) {
  44202. a = s;
  44203. break
  44204. }
  44205. break;
  44206. default:
  44207. if (void 0 === e[i])
  44208. return void console.error(" can not bind to objectName of node, undefined", this);
  44209. e = e[i]
  44210. }
  44211. if (void 0 !== a) {
  44212. if (void 0 === e[a])
  44213. return void console.error(" trying to bind to objectIndex of objectName, but is undefined:", this, e);
  44214. e = e[a]
  44215. }
  44216. }
  44217. var l = e[r];
  44218. if (!l) {
  44219. var c = t.nodeName;
  44220. return void console.error(" trying to update property for track: " + c + "." + r + " but it wasn't found.", e)
  44221. }
  44222. var h = this.Versioning.None;
  44223. void 0 !== e.needsUpdate ? (h = this.Versioning.NeedsUpdate,
  44224. this.targetObject = e) : void 0 !== e.matrixWorldNeedsUpdate && (h = this.Versioning.MatrixWorldNeedsUpdate,
  44225. this.targetObject = e);
  44226. var u = this.BindingType.Direct;
  44227. if (void 0 !== o) {
  44228. if ("morphTargetInfluences" === r) {
  44229. if (!e.geometry)
  44230. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry", this);
  44231. if (!e.geometry.morphTargets)
  44232. return void console.error(" can not bind to morphTargetInfluences becasuse node does not have a geometry.morphTargets", this);
  44233. for (var s = 0; s < this.node.geometry.morphTargets.length; s++)
  44234. if (e.geometry.morphTargets[s].name === o) {
  44235. o = s;
  44236. break
  44237. }
  44238. }
  44239. u = this.BindingType.ArrayElement,
  44240. this.resolvedProperty = l,
  44241. this.propertyIndex = o
  44242. } else
  44243. void 0 !== l.fromArray && void 0 !== l.toArray ? (u = this.BindingType.HasFromToArray,
  44244. this.resolvedProperty = l) : void 0 !== l.length ? (u = this.BindingType.EntireArray,
  44245. this.resolvedProperty = l) : this.propertyName = r;
  44246. this.getValue = this.GetterByBindingType[u],
  44247. this.setValue = this.SetterByBindingTypeAndVersioning[u][h]
  44248. },
  44249. unbind: function() {
  44250. this.node = null,
  44251. this.getValue = this._getValue_unbound,
  44252. this.setValue = this._setValue_unbound
  44253. }
  44254. },
  44255. Object.assign(n.PropertyBinding.prototype, {
  44256. _getValue_unavailable: function() {},
  44257. _setValue_unavailable: function() {},
  44258. _getValue_unbound: n.PropertyBinding.prototype.getValue,
  44259. _setValue_unbound: n.PropertyBinding.prototype.setValue,
  44260. BindingType: {
  44261. Direct: 0,
  44262. EntireArray: 1,
  44263. ArrayElement: 2,
  44264. HasFromToArray: 3
  44265. },
  44266. Versioning: {
  44267. None: 0,
  44268. NeedsUpdate: 1,
  44269. MatrixWorldNeedsUpdate: 2
  44270. },
  44271. GetterByBindingType: [function(e, t) {
  44272. e[t] = this.node[this.propertyName]
  44273. }
  44274. , function(e, t) {
  44275. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44276. e[t++] = i[n]
  44277. }
  44278. , function(e, t) {
  44279. e[t] = this.resolvedProperty[this.propertyIndex]
  44280. }
  44281. , function(e, t) {
  44282. this.resolvedProperty.toArray(e, t)
  44283. }
  44284. ],
  44285. SetterByBindingTypeAndVersioning: [[function(e, t) {
  44286. this.node[this.propertyName] = e[t]
  44287. }
  44288. , function(e, t) {
  44289. this.node[this.propertyName] = e[t],
  44290. this.targetObject.needsUpdate = !0
  44291. }
  44292. , function(e, t) {
  44293. this.node[this.propertyName] = e[t],
  44294. this.targetObject.matrixWorldNeedsUpdate = !0
  44295. }
  44296. ], [function(e, t) {
  44297. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44298. i[n] = e[t++]
  44299. }
  44300. , function(e, t) {
  44301. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44302. i[n] = e[t++];
  44303. this.targetObject.needsUpdate = !0
  44304. }
  44305. , function(e, t) {
  44306. for (var i = this.resolvedProperty, n = 0, r = i.length; n !== r; ++n)
  44307. i[n] = e[t++];
  44308. this.targetObject.matrixWorldNeedsUpdate = !0
  44309. }
  44310. ], [function(e, t) {
  44311. this.resolvedProperty[this.propertyIndex] = e[t]
  44312. }
  44313. , function(e, t) {
  44314. this.resolvedProperty[this.propertyIndex] = e[t],
  44315. this.targetObject.needsUpdate = !0
  44316. }
  44317. , function(e, t) {
  44318. this.resolvedProperty[this.propertyIndex] = e[t],
  44319. this.targetObject.matrixWorldNeedsUpdate = !0
  44320. }
  44321. ], [function(e, t) {
  44322. this.resolvedProperty.fromArray(e, t)
  44323. }
  44324. , function(e, t) {
  44325. this.resolvedProperty.fromArray(e, t),
  44326. this.targetObject.needsUpdate = !0
  44327. }
  44328. , function(e, t) {
  44329. this.resolvedProperty.fromArray(e, t),
  44330. this.targetObject.matrixWorldNeedsUpdate = !0
  44331. }
  44332. ]]
  44333. }),
  44334. n.PropertyBinding.Composite = function(e, t, i) {
  44335. var r = i || n.PropertyBinding.parseTrackName(t);
  44336. this._targetGroup = e,
  44337. this._bindings = e.subscribe_(t, r)
  44338. }
  44339. ,
  44340. n.PropertyBinding.Composite.prototype = {
  44341. constructor: n.PropertyBinding.Composite,
  44342. getValue: function(e, t) {
  44343. this.bind();
  44344. var i = this._targetGroup.nCachedObjects_
  44345. , n = this._bindings[i];
  44346. void 0 !== n && n.getValue(e, t)
  44347. },
  44348. setValue: function(e, t) {
  44349. for (var i = this._bindings, n = this._targetGroup.nCachedObjects_, r = i.length; n !== r; ++n)
  44350. i[n].setValue(e, t)
  44351. },
  44352. bind: function() {
  44353. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44354. e[t].bind()
  44355. },
  44356. unbind: function() {
  44357. for (var e = this._bindings, t = this._targetGroup.nCachedObjects_, i = e.length; t !== i; ++t)
  44358. e[t].unbind()
  44359. }
  44360. },
  44361. n.PropertyBinding.create = function(e, t, i) {
  44362. return e instanceof n.AnimationObjectGroup ? new n.PropertyBinding.Composite(e,t,i) : new n.PropertyBinding(e,t,i)
  44363. }
  44364. ,
  44365. n.PropertyBinding.parseTrackName = function(e) {
  44366. var t = /^(([\w]+\/)*)([\w-\d]+)?(\.([\w]+)(\[([\w\d\[\]\_.:\- ]+)\])?)?(\.([\w.]+)(\[([\w\d\[\]\_. ]+)\])?)$/
  44367. , i = t.exec(e);
  44368. if (!i)
  44369. throw new Error("cannot parse trackName at all: " + e);
  44370. i.index === t.lastIndex && t.lastIndex++;
  44371. var n = {
  44372. nodeName: i[3],
  44373. objectName: i[5],
  44374. objectIndex: i[7],
  44375. propertyName: i[9],
  44376. propertyIndex: i[11]
  44377. };
  44378. if (null === n.propertyName || 0 === n.propertyName.length)
  44379. throw new Error("can not parse propertyName from trackName: " + e);
  44380. return n
  44381. }
  44382. ,
  44383. n.PropertyBinding.findNode = function(e, t) {
  44384. if (!t || "" === t || "root" === t || "." === t || t === -1 || t === e.name || t === e.uuid)
  44385. return e;
  44386. if (e.skeleton) {
  44387. var i = function(e) {
  44388. for (var i = 0; i < e.bones.length; i++) {
  44389. var n = e.bones[i];
  44390. if (n.name === t)
  44391. return n
  44392. }
  44393. return null
  44394. }
  44395. , n = i(e.skeleton);
  44396. if (n)
  44397. return n
  44398. }
  44399. if (e.children) {
  44400. var r = function(e) {
  44401. for (var i = 0; i < e.length; i++) {
  44402. var n = e[i];
  44403. if (n.name === t || n.uuid === t)
  44404. return n;
  44405. var o = r(n.children);
  44406. if (o)
  44407. return o
  44408. }
  44409. return null
  44410. }
  44411. , o = r(e.children);
  44412. if (o)
  44413. return o
  44414. }
  44415. return null
  44416. }
  44417. ,
  44418. n.PropertyMixer = function(e, t, i) {
  44419. this.binding = e,
  44420. this.valueSize = i;
  44421. var n, r = Float64Array;
  44422. switch (t) {
  44423. case "quaternion":
  44424. n = this._slerp;
  44425. break;
  44426. case "string":
  44427. case "bool":
  44428. r = Array,
  44429. n = this._select;
  44430. break;
  44431. default:
  44432. n = this._lerp
  44433. }
  44434. this.buffer = new r(4 * i),
  44435. this._mixBufferRegion = n,
  44436. this.cumulativeWeight = 0,
  44437. this.useCount = 0,
  44438. this.referenceCount = 0
  44439. }
  44440. ,
  44441. n.PropertyMixer.prototype = {
  44442. constructor: n.PropertyMixer,
  44443. accumulate: function(e, t) {
  44444. var i = this.buffer
  44445. , n = this.valueSize
  44446. , r = e * n + n
  44447. , o = this.cumulativeWeight;
  44448. if (0 === o) {
  44449. for (var a = 0; a !== n; ++a)
  44450. i[r + a] = i[a];
  44451. o = t
  44452. } else {
  44453. o += t;
  44454. var s = t / o;
  44455. this._mixBufferRegion(i, r, 0, s, n)
  44456. }
  44457. this.cumulativeWeight = o
  44458. },
  44459. apply: function(e) {
  44460. var t = this.valueSize
  44461. , i = this.buffer
  44462. , n = e * t + t
  44463. , r = this.cumulativeWeight
  44464. , o = this.binding;
  44465. if (this.cumulativeWeight = 0,
  44466. r < 1) {
  44467. var a = 3 * t;
  44468. this._mixBufferRegion(i, n, a, 1 - r, t)
  44469. }
  44470. for (var s = t, l = t + t; s !== l; ++s)
  44471. if (i[s] !== i[s + t]) {
  44472. o.setValue(i, n);
  44473. break
  44474. }
  44475. },
  44476. saveOriginalState: function() {
  44477. var e = this.binding
  44478. , t = this.buffer
  44479. , i = this.valueSize
  44480. , n = 3 * i;
  44481. e.getValue(t, n);
  44482. for (var r = i, o = n; r !== o; ++r)
  44483. t[r] = t[n + r % i];
  44484. this.cumulativeWeight = 0
  44485. },
  44486. restoreOriginalState: function() {
  44487. var e = 3 * this.valueSize;
  44488. this.binding.setValue(this.buffer, e)
  44489. },
  44490. _select: function(e, t, i, n, r) {
  44491. if (n >= .5)
  44492. for (var o = 0; o !== r; ++o)
  44493. e[t + o] = e[i + o]
  44494. },
  44495. _slerp: function(e, t, i, r, o) {
  44496. n.Quaternion.slerpFlat(e, t, e, t, e, i, r)
  44497. },
  44498. _lerp: function(e, t, i, n, r) {
  44499. for (var o = 1 - n, a = 0; a !== r; ++a) {
  44500. var s = t + a;
  44501. e[s] = e[s] * o + e[i + a] * n
  44502. }
  44503. }
  44504. },
  44505. n.BooleanKeyframeTrack = function(e, t, i) {
  44506. n.KeyframeTrack.call(this, e, t, i)
  44507. }
  44508. ,
  44509. n.BooleanKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44510. constructor: n.BooleanKeyframeTrack,
  44511. ValueTypeName: "bool",
  44512. ValueBufferType: Array,
  44513. DefaultInterpolation: n.IntepolateDiscrete,
  44514. InterpolantFactoryMethodLinear: void 0,
  44515. InterpolantFactoryMethodSmooth: void 0
  44516. }),
  44517. n.NumberKeyframeTrack = function(e, t, i, r) {
  44518. n.KeyframeTrack.call(this, e, t, i, r)
  44519. }
  44520. ,
  44521. n.NumberKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44522. constructor: n.NumberKeyframeTrack,
  44523. ValueTypeName: "number"
  44524. }),
  44525. n.QuaternionKeyframeTrack = function(e, t, i, r) {
  44526. n.KeyframeTrack.call(this, e, t, i, r)
  44527. }
  44528. ,
  44529. n.QuaternionKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44530. constructor: n.QuaternionKeyframeTrack,
  44531. ValueTypeName: "quaternion",
  44532. DefaultInterpolation: n.InterpolateLinear,
  44533. InterpolantFactoryMethodLinear: function(e) {
  44534. return new n.QuaternionLinearInterpolant(this.times,this.values,this.getValueSize(),e)
  44535. },
  44536. InterpolantFactoryMethodSmooth: void 0
  44537. }),
  44538. n.StringKeyframeTrack = function(e, t, i, r) {
  44539. n.KeyframeTrack.call(this, e, t, i, r)
  44540. }
  44541. ,
  44542. n.StringKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44543. constructor: n.StringKeyframeTrack,
  44544. ValueTypeName: "string",
  44545. ValueBufferType: Array,
  44546. DefaultInterpolation: n.IntepolateDiscrete,
  44547. InterpolantFactoryMethodLinear: void 0,
  44548. InterpolantFactoryMethodSmooth: void 0
  44549. }),
  44550. n.VectorKeyframeTrack = function(e, t, i, r) {
  44551. n.KeyframeTrack.call(this, e, t, i, r)
  44552. }
  44553. ,
  44554. n.VectorKeyframeTrack.prototype = Object.assign(Object.create(n.KeyframeTrack.prototype), {
  44555. constructor: n.VectorKeyframeTrack,
  44556. ValueTypeName: "vector"
  44557. }),
  44558. n.Audio = function(e) {
  44559. n.Object3D.call(this),
  44560. this.type = "Audio",
  44561. this.context = e.context,
  44562. this.source = this.context.createBufferSource(),
  44563. this.source.onended = this.onEnded.bind(this),
  44564. this.gain = this.context.createGain(),
  44565. this.gain.connect(e.getInput()),
  44566. this.autoplay = !1,
  44567. this.startTime = 0,
  44568. this.playbackRate = 1,
  44569. this.isPlaying = !1,
  44570. this.hasPlaybackControl = !0,
  44571. this.sourceType = "empty",
  44572. this.filter = null
  44573. }
  44574. ,
  44575. n.Audio.prototype = Object.create(n.Object3D.prototype),
  44576. n.Audio.prototype.constructor = n.Audio,
  44577. n.Audio.prototype.getOutput = function() {
  44578. return this.gain
  44579. }
  44580. ,
  44581. n.Audio.prototype.load = function(e) {
  44582. var t = new n.AudioBuffer(this.context);
  44583. return t.load(e),
  44584. this.setBuffer(t),
  44585. this
  44586. }
  44587. ,
  44588. n.Audio.prototype.setNodeSource = function(e) {
  44589. return this.hasPlaybackControl = !1,
  44590. this.sourceType = "audioNode",
  44591. this.source = e,
  44592. this.connect(),
  44593. this
  44594. }
  44595. ,
  44596. n.Audio.prototype.setBuffer = function(e) {
  44597. var t = this;
  44598. return e.onReady(function(e) {
  44599. t.source.buffer = e,
  44600. t.sourceType = "buffer",
  44601. t.autoplay && t.play()
  44602. }),
  44603. this
  44604. }
  44605. ,
  44606. n.Audio.prototype.play = function() {
  44607. if (this.isPlaying === !0)
  44608. return void console.warn("THREE.Audio: Audio is already playing.");
  44609. if (this.hasPlaybackControl === !1)
  44610. return void console.warn("THREE.Audio: this Audio has no playback control.");
  44611. var e = this.context.createBufferSource();
  44612. e.buffer = this.source.buffer,
  44613. e.loop = this.source.loop,
  44614. e.onended = this.source.onended,
  44615. e.start(0, this.startTime),
  44616. e.playbackRate.value = this.playbackRate,
  44617. this.isPlaying = !0,
  44618. this.source = e,
  44619. this.connect()
  44620. }
  44621. ,
  44622. n.Audio.prototype.pause = function() {
  44623. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44624. void (this.startTime = this.context.currentTime))
  44625. }
  44626. ,
  44627. n.Audio.prototype.stop = function() {
  44628. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.source.stop(),
  44629. void (this.startTime = 0))
  44630. }
  44631. ,
  44632. n.Audio.prototype.connect = function() {
  44633. null !== this.filter ? (this.source.connect(this.filter),
  44634. this.filter.connect(this.getOutput())) : this.source.connect(this.getOutput())
  44635. }
  44636. ,
  44637. n.Audio.prototype.disconnect = function() {
  44638. null !== this.filter ? (this.source.disconnect(this.filter),
  44639. this.filter.disconnect(this.getOutput())) : this.source.disconnect(this.getOutput())
  44640. }
  44641. ,
  44642. n.Audio.prototype.getFilter = function() {
  44643. return this.filter
  44644. }
  44645. ,
  44646. n.Audio.prototype.setFilter = function(e) {
  44647. void 0 === e && (e = null),
  44648. this.isPlaying === !0 ? (this.disconnect(),
  44649. this.filter = e,
  44650. this.connect()) : this.filter = e
  44651. }
  44652. ,
  44653. n.Audio.prototype.setPlaybackRate = function(e) {
  44654. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : (this.playbackRate = e,
  44655. void (this.isPlaying === !0 && (this.source.playbackRate.value = this.playbackRate)))
  44656. }
  44657. ,
  44658. n.Audio.prototype.getPlaybackRate = function() {
  44659. return this.playbackRate
  44660. }
  44661. ,
  44662. n.Audio.prototype.onEnded = function() {
  44663. this.isPlaying = !1
  44664. }
  44665. ,
  44666. n.Audio.prototype.setLoop = function(e) {
  44667. return this.hasPlaybackControl === !1 ? void console.warn("THREE.Audio: this Audio has no playback control.") : void (this.source.loop = e)
  44668. }
  44669. ,
  44670. n.Audio.prototype.getLoop = function() {
  44671. return this.hasPlaybackControl === !1 ? (console.warn("THREE.Audio: this Audio has no playback control."),
  44672. !1) : this.source.loop
  44673. }
  44674. ,
  44675. n.Audio.prototype.setVolume = function(e) {
  44676. this.gain.gain.value = e
  44677. }
  44678. ,
  44679. n.Audio.prototype.getVolume = function() {
  44680. return this.gain.gain.value
  44681. }
  44682. ,
  44683. n.AudioAnalyser = function(e, t) {
  44684. this.analyser = e.context.createAnalyser(),
  44685. this.analyser.fftSize = void 0 !== t ? t : 2048,
  44686. this.data = new Uint8Array(this.analyser.frequencyBinCount),
  44687. e.getOutput().connect(this.analyser)
  44688. }
  44689. ,
  44690. n.AudioAnalyser.prototype = {
  44691. constructor: n.AudioAnalyser,
  44692. getData: function() {
  44693. return this.analyser.getByteFrequencyData(this.data),
  44694. this.data
  44695. }
  44696. },
  44697. n.AudioBuffer = function(e) {
  44698. this.context = e,
  44699. this.ready = !1,
  44700. this.readyCallbacks = []
  44701. }
  44702. ,
  44703. n.AudioBuffer.prototype.load = function(e) {
  44704. var t = this
  44705. , i = new XMLHttpRequest;
  44706. return i.open("GET", e, !0),
  44707. i.responseType = "arraybuffer",
  44708. i.onload = function(e) {
  44709. t.context.decodeAudioData(this.response, function(e) {
  44710. t.buffer = e,
  44711. t.ready = !0;
  44712. for (var i = 0; i < t.readyCallbacks.length; i++)
  44713. t.readyCallbacks[i](t.buffer);
  44714. t.readyCallbacks = []
  44715. })
  44716. }
  44717. ,
  44718. i.send(),
  44719. this
  44720. }
  44721. ,
  44722. n.AudioBuffer.prototype.onReady = function(e) {
  44723. this.ready ? e(this.buffer) : this.readyCallbacks.push(e)
  44724. }
  44725. ,
  44726. n.PositionalAudio = function(e) {
  44727. n.Audio.call(this, e),
  44728. this.panner = this.context.createPanner(),
  44729. this.panner.connect(this.gain)
  44730. }
  44731. ,
  44732. n.PositionalAudio.prototype = Object.create(n.Audio.prototype),
  44733. n.PositionalAudio.prototype.constructor = n.PositionalAudio,
  44734. n.PositionalAudio.prototype.getOutput = function() {
  44735. return this.panner
  44736. }
  44737. ,
  44738. n.PositionalAudio.prototype.setRefDistance = function(e) {
  44739. this.panner.refDistance = e
  44740. }
  44741. ,
  44742. n.PositionalAudio.prototype.getRefDistance = function() {
  44743. return this.panner.refDistance
  44744. }
  44745. ,
  44746. n.PositionalAudio.prototype.setRolloffFactor = function(e) {
  44747. this.panner.rolloffFactor = e
  44748. }
  44749. ,
  44750. n.PositionalAudio.prototype.getRolloffFactor = function() {
  44751. return this.panner.rolloffFactor
  44752. }
  44753. ,
  44754. n.PositionalAudio.prototype.setDistanceModel = function(e) {
  44755. this.panner.distanceModel = e
  44756. }
  44757. ,
  44758. n.PositionalAudio.prototype.getDistanceModel = function() {
  44759. return this.panner.distanceModel
  44760. }
  44761. ,
  44762. n.PositionalAudio.prototype.setMaxDistance = function(e) {
  44763. this.panner.maxDistance = e
  44764. }
  44765. ,
  44766. n.PositionalAudio.prototype.getMaxDistance = function() {
  44767. return this.panner.maxDistance
  44768. }
  44769. ,
  44770. n.PositionalAudio.prototype.updateMatrixWorld = function() {
  44771. var e = new n.Vector3;
  44772. return function(t) {
  44773. n.Object3D.prototype.updateMatrixWorld.call(this, t),
  44774. e.setFromMatrixPosition(this.matrixWorld),
  44775. this.panner.setPosition(e.x, e.y, e.z)
  44776. }
  44777. }(),
  44778. n.AudioListener = function() {
  44779. n.Object3D.call(this),
  44780. this.type = "AudioListener",
  44781. this.context = new (window.AudioContext || window.webkitAudioContext),
  44782. this.gain = this.context.createGain(),
  44783. this.gain.connect(this.context.destination),
  44784. this.filter = null
  44785. }
  44786. ,
  44787. n.AudioListener.prototype = Object.create(n.Object3D.prototype),
  44788. n.AudioListener.prototype.constructor = n.AudioListener,
  44789. n.AudioListener.prototype.getInput = function() {
  44790. return this.gain
  44791. }
  44792. ,
  44793. n.AudioListener.prototype.removeFilter = function() {
  44794. null !== this.filter && (this.gain.disconnect(this.filter),
  44795. this.filter.disconnect(this.context.destination),
  44796. this.gain.connect(this.context.destination),
  44797. this.filter = null)
  44798. }
  44799. ,
  44800. n.AudioListener.prototype.setFilter = function(e) {
  44801. null !== this.filter ? (this.gain.disconnect(this.filter),
  44802. this.filter.disconnect(this.context.destination)) : this.gain.disconnect(this.context.destination),
  44803. this.filter = e,
  44804. this.gain.connect(this.filter),
  44805. this.filter.connect(this.context.destination)
  44806. }
  44807. ,
  44808. n.AudioListener.prototype.getFilter = function() {
  44809. return this.filter
  44810. }
  44811. ,
  44812. n.AudioListener.prototype.setMasterVolume = function(e) {
  44813. this.gain.gain.value = e
  44814. }
  44815. ,
  44816. n.AudioListener.prototype.getMasterVolume = function() {
  44817. return this.gain.gain.value
  44818. }
  44819. ,
  44820. n.AudioListener.prototype.updateMatrixWorld = function() {
  44821. var e = new n.Vector3
  44822. , t = new n.Quaternion
  44823. , i = new n.Vector3
  44824. , r = new n.Vector3;
  44825. return function(o) {
  44826. n.Object3D.prototype.updateMatrixWorld.call(this, o);
  44827. var a = this.context.listener
  44828. , s = this.up;
  44829. this.matrixWorld.decompose(e, t, i),
  44830. r.set(0, 0, -1).applyQuaternion(t),
  44831. a.setPosition(e.x, e.y, e.z),
  44832. a.setOrientation(r.x, r.y, r.z, s.x, s.y, s.z)
  44833. }
  44834. }(),
  44835. n.Camera = function() {
  44836. n.Object3D.call(this),
  44837. this.type = "Camera",
  44838. this.matrixWorldInverse = new n.Matrix4,
  44839. this.projectionMatrix = new n.Matrix4
  44840. }
  44841. ,
  44842. n.Camera.prototype = Object.create(n.Object3D.prototype),
  44843. n.Camera.prototype.constructor = n.Camera,
  44844. n.Camera.prototype.getWorldDirection = function() {
  44845. var e = new n.Quaternion;
  44846. return function(t) {
  44847. var i = t || new n.Vector3;
  44848. return this.getWorldQuaternion(e),
  44849. i.set(0, 0, -1).applyQuaternion(e)
  44850. }
  44851. }(),
  44852. n.Camera.prototype.lookAt = function() {
  44853. var e = new n.Matrix4;
  44854. return function(t) {
  44855. e.lookAt(this.position, t, this.up),
  44856. this.quaternion.setFromRotationMatrix(e)
  44857. }
  44858. }(),
  44859. n.Camera.prototype.clone = function() {
  44860. return (new this.constructor).copy(this)
  44861. }
  44862. ,
  44863. n.Camera.prototype.copy = function(e) {
  44864. return n.Object3D.prototype.copy.call(this, e),
  44865. this.matrixWorldInverse.copy(e.matrixWorldInverse),
  44866. this.projectionMatrix.copy(e.projectionMatrix),
  44867. this
  44868. }
  44869. ,
  44870. n.CubeCamera = function(e, t, i) {
  44871. n.Object3D.call(this),
  44872. this.type = "CubeCamera";
  44873. var r = 90
  44874. , o = 1
  44875. , a = new n.PerspectiveCamera(r,o,e,t);
  44876. a.up.set(0, -1, 0),
  44877. a.lookAt(new n.Vector3(1,0,0)),
  44878. this.add(a);
  44879. var s = new n.PerspectiveCamera(r,o,e,t);
  44880. s.up.set(0, -1, 0),
  44881. s.lookAt(new n.Vector3(-1,0,0)),
  44882. this.add(s);
  44883. var l = new n.PerspectiveCamera(r,o,e,t);
  44884. l.up.set(0, 0, 1),
  44885. l.lookAt(new n.Vector3(0,1,0)),
  44886. this.add(l);
  44887. var c = new n.PerspectiveCamera(r,o,e,t);
  44888. c.up.set(0, 0, -1),
  44889. c.lookAt(new n.Vector3(0,-1,0)),
  44890. this.add(c);
  44891. var h = new n.PerspectiveCamera(r,o,e,t);
  44892. h.up.set(0, -1, 0),
  44893. h.lookAt(new n.Vector3(0,0,1)),
  44894. this.add(h);
  44895. var u = new n.PerspectiveCamera(r,o,e,t);
  44896. u.up.set(0, -1, 0),
  44897. u.lookAt(new n.Vector3(0,0,-1)),
  44898. this.add(u);
  44899. var d = {
  44900. format: n.RGBFormat,
  44901. magFilter: n.LinearFilter,
  44902. minFilter: n.LinearFilter
  44903. };
  44904. this.renderTarget = new n.WebGLRenderTargetCube(i,i,d),
  44905. this.updateCubeMap = function(e, t) {
  44906. null === this.parent && this.updateMatrixWorld();
  44907. var i = this.renderTarget
  44908. , n = i.texture.generateMipmaps;
  44909. i.texture.generateMipmaps = !1,
  44910. i.activeCubeFace = 0,
  44911. e.render(t, a, i),
  44912. i.activeCubeFace = 1,
  44913. e.render(t, s, i),
  44914. i.activeCubeFace = 2,
  44915. e.render(t, l, i),
  44916. i.activeCubeFace = 3,
  44917. e.render(t, c, i),
  44918. i.activeCubeFace = 4,
  44919. e.render(t, h, i),
  44920. i.texture.generateMipmaps = n,
  44921. i.activeCubeFace = 5,
  44922. e.render(t, u, i),
  44923. e.setRenderTarget(null)
  44924. }
  44925. }
  44926. ,
  44927. n.CubeCamera.prototype = Object.create(n.Object3D.prototype),
  44928. n.CubeCamera.prototype.constructor = n.CubeCamera,
  44929. n.OrthographicCamera = function(e, t, i, r, o, a) {
  44930. n.Camera.call(this),
  44931. this.type = "OrthographicCamera",
  44932. this.zoom = 1,
  44933. this.left = e,
  44934. this.right = t,
  44935. this.top = i,
  44936. this.bottom = r,
  44937. this.near = void 0 !== o ? o : .1,
  44938. this.far = void 0 !== a ? a : 2e3,
  44939. this.updateProjectionMatrix()
  44940. }
  44941. ,
  44942. n.OrthographicCamera.prototype = Object.create(n.Camera.prototype),
  44943. n.OrthographicCamera.prototype.constructor = n.OrthographicCamera,
  44944. n.OrthographicCamera.prototype.updateProjectionMatrix = function() {
  44945. var e = (this.right - this.left) / (2 * this.zoom)
  44946. , t = (this.top - this.bottom) / (2 * this.zoom)
  44947. , i = (this.right + this.left) / 2
  44948. , n = (this.top + this.bottom) / 2;
  44949. this.projectionMatrix.makeOrthographic(i - e, i + e, n + t, n - t, this.near, this.far)
  44950. }
  44951. ,
  44952. n.OrthographicCamera.prototype.copy = function(e) {
  44953. return n.Camera.prototype.copy.call(this, e),
  44954. this.left = e.left,
  44955. this.right = e.right,
  44956. this.top = e.top,
  44957. this.bottom = e.bottom,
  44958. this.near = e.near,
  44959. this.far = e.far,
  44960. this.zoom = e.zoom,
  44961. this
  44962. }
  44963. ,
  44964. n.OrthographicCamera.prototype.toJSON = function(e) {
  44965. var t = n.Object3D.prototype.toJSON.call(this, e);
  44966. return t.object.zoom = this.zoom,
  44967. t.object.left = this.left,
  44968. t.object.right = this.right,
  44969. t.object.top = this.top,
  44970. t.object.bottom = this.bottom,
  44971. t.object.near = this.near,
  44972. t.object.far = this.far,
  44973. t
  44974. }
  44975. ,
  44976. n.PerspectiveCamera = function(e, t, i, r) {
  44977. n.Camera.call(this),
  44978. this.type = "PerspectiveCamera",
  44979. this.focalLength = 10,
  44980. this.zoom = 1,
  44981. this.fov = void 0 !== e ? e : 50,
  44982. this.aspect = void 0 !== t ? t : 1,
  44983. this.near = void 0 !== i ? i : .1,
  44984. this.far = void 0 !== r ? r : 2e3,
  44985. this.updateProjectionMatrix()
  44986. }
  44987. ,
  44988. n.PerspectiveCamera.prototype = Object.create(n.Camera.prototype),
  44989. n.PerspectiveCamera.prototype.constructor = n.PerspectiveCamera,
  44990. n.PerspectiveCamera.prototype.setLens = function(e, t) {
  44991. void 0 === t && (t = 24),
  44992. this.fov = 2 * n.Math.radToDeg(Math.atan(t / (2 * e))),
  44993. this.updateProjectionMatrix()
  44994. }
  44995. ,
  44996. n.PerspectiveCamera.prototype.setViewOffset = function(e, t, i, n, r, o) {
  44997. this.fullWidth = e,
  44998. this.fullHeight = t,
  44999. this.x = i,
  45000. this.y = n,
  45001. this.width = r,
  45002. this.height = o,
  45003. this.updateProjectionMatrix()
  45004. }
  45005. ,
  45006. n.PerspectiveCamera.prototype.updateProjectionMatrix = function() {
  45007. var e = n.Math.radToDeg(2 * Math.atan(Math.tan(.5 * n.Math.degToRad(this.fov)) / this.zoom));
  45008. if (this.fullWidth) {
  45009. var t = this.fullWidth / this.fullHeight
  45010. , i = Math.tan(n.Math.degToRad(.5 * e)) * this.near
  45011. , r = -i
  45012. , o = t * r
  45013. , a = t * i
  45014. , s = Math.abs(a - o)
  45015. , l = Math.abs(i - r);
  45016. this.projectionMatrix.makeFrustum(o + this.x * s / this.fullWidth, o + (this.x + this.width) * s / this.fullWidth, i - (this.y + this.height) * l / this.fullHeight, i - this.y * l / this.fullHeight, this.near, this.far)
  45017. } else
  45018. this.projectionMatrix.makePerspective(e, this.aspect, this.near, this.far)
  45019. }
  45020. ,
  45021. n.PerspectiveCamera.prototype.copy = function(e) {
  45022. return n.Camera.prototype.copy.call(this, e),
  45023. this.focalLength = e.focalLength,
  45024. this.zoom = e.zoom,
  45025. this.fov = e.fov,
  45026. this.aspect = e.aspect,
  45027. this.near = e.near,
  45028. this.far = e.far,
  45029. this
  45030. }
  45031. ,
  45032. n.PerspectiveCamera.prototype.toJSON = function(e) {
  45033. var t = n.Object3D.prototype.toJSON.call(this, e);
  45034. return t.object.focalLength = this.focalLength,
  45035. t.object.zoom = this.zoom,
  45036. t.object.fov = this.fov,
  45037. t.object.aspect = this.aspect,
  45038. t.object.near = this.near,
  45039. t.object.far = this.far,
  45040. t
  45041. }
  45042. ,
  45043. n.StereoCamera = function() {
  45044. this.type = "StereoCamera",
  45045. this.aspect = 1,
  45046. this.cameraL = new n.PerspectiveCamera,
  45047. this.cameraL.layers.enable(1),
  45048. this.cameraL.matrixAutoUpdate = !1,
  45049. this.cameraR = new n.PerspectiveCamera,
  45050. this.cameraR.layers.enable(2),
  45051. this.cameraR.matrixAutoUpdate = !1
  45052. }
  45053. ,
  45054. n.StereoCamera.prototype = {
  45055. constructor: n.StereoCamera,
  45056. update: function() {
  45057. var e, t, i, r, o, a = new n.Matrix4, s = new n.Matrix4;
  45058. return function(l) {
  45059. var c = e !== l.focalLength || t !== l.fov || i !== l.aspect * this.aspect || r !== l.near || o !== l.far;
  45060. if (c) {
  45061. e = l.focalLength,
  45062. t = l.fov,
  45063. i = l.aspect * this.aspect,
  45064. r = l.near,
  45065. o = l.far;
  45066. var h, u, d = l.projectionMatrix.clone(), p = .032, f = p * r / e, g = r * Math.tan(n.Math.degToRad(.5 * t));
  45067. s.elements[12] = -p,
  45068. a.elements[12] = p,
  45069. h = -g * i + f,
  45070. u = g * i + f,
  45071. d.elements[0] = 2 * r / (u - h),
  45072. d.elements[8] = (u + h) / (u - h),
  45073. this.cameraL.projectionMatrix.copy(d),
  45074. h = -g * i - f,
  45075. u = g * i - f,
  45076. d.elements[0] = 2 * r / (u - h),
  45077. d.elements[8] = (u + h) / (u - h),
  45078. this.cameraR.projectionMatrix.copy(d)
  45079. }
  45080. this.cameraL.matrixWorld.copy(l.matrixWorld).multiply(s),
  45081. this.cameraR.matrixWorld.copy(l.matrixWorld).multiply(a)
  45082. }
  45083. }()
  45084. },
  45085. n.Light = function(e, t) {
  45086. n.Object3D.call(this),
  45087. this.type = "Light",
  45088. this.color = new n.Color(e),
  45089. this.intensity = void 0 !== t ? t : 1,
  45090. this.receiveShadow = void 0
  45091. }
  45092. ,
  45093. n.Light.prototype = Object.create(n.Object3D.prototype),
  45094. n.Light.prototype.constructor = n.Light,
  45095. n.Light.prototype.copy = function(e) {
  45096. return n.Object3D.prototype.copy.call(this, e),
  45097. this.color.copy(e.color),
  45098. this.intensity = e.intensity,
  45099. this
  45100. }
  45101. ,
  45102. n.Light.prototype.toJSON = function(e) {
  45103. var t = n.Object3D.prototype.toJSON.call(this, e);
  45104. return t.object.color = this.color.getHex(),
  45105. t.object.intensity = this.intensity,
  45106. void 0 !== this.groundColor && (t.object.groundColor = this.groundColor.getHex()),
  45107. void 0 !== this.distance && (t.object.distance = this.distance),
  45108. void 0 !== this.angle && (t.object.angle = this.angle),
  45109. void 0 !== this.decay && (t.object.decay = this.decay),
  45110. void 0 !== this.penumbra && (t.object.penumbra = this.penumbra),
  45111. t
  45112. }
  45113. ,
  45114. n.LightShadow = function(e) {
  45115. this.camera = e,
  45116. this.bias = 0,
  45117. this.radius = 1,
  45118. this.mapSize = new n.Vector2(512,512),
  45119. this.map = null,
  45120. this.matrix = new n.Matrix4
  45121. }
  45122. ,
  45123. n.LightShadow.prototype = {
  45124. constructor: n.LightShadow,
  45125. copy: function(e) {
  45126. return this.camera = e.camera.clone(),
  45127. this.bias = e.bias,
  45128. this.radius = e.radius,
  45129. this.mapSize.copy(e.mapSize),
  45130. this
  45131. },
  45132. clone: function() {
  45133. return (new this.constructor).copy(this)
  45134. }
  45135. },
  45136. n.AmbientLight = function(e, t) {
  45137. n.Light.call(this, e, t),
  45138. this.type = "AmbientLight",
  45139. this.castShadow = void 0
  45140. }
  45141. ,
  45142. n.AmbientLight.prototype = Object.create(n.Light.prototype),
  45143. n.AmbientLight.prototype.constructor = n.AmbientLight,
  45144. n.DirectionalLight = function(e, t) {
  45145. n.Light.call(this, e, t),
  45146. this.type = "DirectionalLight",
  45147. this.position.set(0, 1, 0),
  45148. this.updateMatrix(),
  45149. this.target = new n.Object3D,
  45150. this.shadow = new n.LightShadow(new n.OrthographicCamera(-5,5,5,-5,.5,500))
  45151. }
  45152. ,
  45153. n.DirectionalLight.prototype = Object.create(n.Light.prototype),
  45154. n.DirectionalLight.prototype.constructor = n.DirectionalLight,
  45155. n.DirectionalLight.prototype.copy = function(e) {
  45156. return n.Light.prototype.copy.call(this, e),
  45157. this.target = e.target.clone(),
  45158. this.shadow = e.shadow.clone(),
  45159. this
  45160. }
  45161. ,
  45162. n.HemisphereLight = function(e, t, i) {
  45163. n.Light.call(this, e, i),
  45164. this.type = "HemisphereLight",
  45165. this.castShadow = void 0,
  45166. this.position.set(0, 1, 0),
  45167. this.updateMatrix(),
  45168. this.groundColor = new n.Color(t)
  45169. }
  45170. ,
  45171. n.HemisphereLight.prototype = Object.create(n.Light.prototype),
  45172. n.HemisphereLight.prototype.constructor = n.HemisphereLight,
  45173. n.HemisphereLight.prototype.copy = function(e) {
  45174. return n.Light.prototype.copy.call(this, e),
  45175. this.groundColor.copy(e.groundColor),
  45176. this
  45177. }
  45178. ,
  45179. n.PointLight = function(e, t, i, r) {
  45180. n.Light.call(this, e, t),
  45181. this.type = "PointLight",
  45182. this.distance = void 0 !== i ? i : 0,
  45183. this.decay = void 0 !== r ? r : 1,
  45184. this.shadow = new n.LightShadow(new n.PerspectiveCamera(90,1,.5,500))
  45185. }
  45186. ,
  45187. n.PointLight.prototype = Object.create(n.Light.prototype),
  45188. n.PointLight.prototype.constructor = n.PointLight,
  45189. Object.defineProperty(n.PointLight.prototype, "power", {
  45190. get: function() {
  45191. return 4 * this.intensity * Math.PI
  45192. },
  45193. set: function(e) {
  45194. this.intensity = e / (4 * Math.PI)
  45195. }
  45196. }),
  45197. n.PointLight.prototype.copy = function(e) {
  45198. return n.Light.prototype.copy.call(this, e),
  45199. this.distance = e.distance,
  45200. this.decay = e.decay,
  45201. this.shadow = e.shadow.clone(),
  45202. this
  45203. }
  45204. ,
  45205. n.SpotLight = function(e, t, i, r, o, a) {
  45206. n.Light.call(this, e, t),
  45207. this.type = "SpotLight",
  45208. this.position.set(0, 1, 0),
  45209. this.updateMatrix(),
  45210. this.target = new n.Object3D,
  45211. this.distance = void 0 !== i ? i : 0,
  45212. this.angle = void 0 !== r ? r : Math.PI / 3,
  45213. this.penumbra = void 0 !== o ? o : 0,
  45214. this.decay = void 0 !== a ? a : 1,
  45215. this.shadow = new n.LightShadow(new n.PerspectiveCamera(50,1,.5,500))
  45216. }
  45217. ,
  45218. n.SpotLight.prototype = Object.create(n.Light.prototype),
  45219. n.SpotLight.prototype.constructor = n.SpotLight,
  45220. Object.defineProperty(n.SpotLight.prototype, "power", {
  45221. get: function() {
  45222. return this.intensity * Math.PI
  45223. },
  45224. set: function(e) {
  45225. this.intensity = e / Math.PI
  45226. }
  45227. }),
  45228. n.SpotLight.prototype.copy = function(e) {
  45229. return n.Light.prototype.copy.call(this, e),
  45230. this.distance = e.distance,
  45231. this.angle = e.angle,
  45232. this.penumbra = e.penumbra,
  45233. this.decay = e.decay,
  45234. this.target = e.target.clone(),
  45235. this.shadow = e.shadow.clone(),
  45236. this
  45237. }
  45238. ,
  45239. n.Cache = {
  45240. enabled: !1,
  45241. files: {},
  45242. add: function(e, t) {
  45243. this.enabled !== !1 && (this.files[e] = t)
  45244. },
  45245. get: function(e) {
  45246. if (this.enabled !== !1)
  45247. return this.files[e]
  45248. },
  45249. remove: function(e) {
  45250. delete this.files[e]
  45251. },
  45252. clear: function() {
  45253. this.files = {}
  45254. }
  45255. },
  45256. n.Loader = function() {
  45257. this.onLoadStart = function() {}
  45258. ,
  45259. this.onLoadProgress = function() {}
  45260. ,
  45261. this.onLoadComplete = function() {}
  45262. }
  45263. ,
  45264. n.Loader.prototype = {
  45265. constructor: n.Loader,
  45266. crossOrigin: void 0,
  45267. extractUrlBase: function(e) {
  45268. var t = e.split("/");
  45269. return 1 === t.length ? "./" : (t.pop(),
  45270. t.join("/") + "/")
  45271. },
  45272. initMaterials: function(e, t, i) {
  45273. for (var n = [], r = 0; r < e.length; ++r)
  45274. n[r] = this.createMaterial(e[r], t, i);
  45275. return n
  45276. },
  45277. createMaterial: function() {
  45278. var e, t, i;
  45279. return function(r, o, a) {
  45280. function s(e, i, r, s, c) {
  45281. var h, u = o + e, d = n.Loader.Handlers.get(u);
  45282. null !== d ? h = d.load(u) : (t.setCrossOrigin(a),
  45283. h = t.load(u)),
  45284. void 0 !== i && (h.repeat.fromArray(i),
  45285. 1 !== i[0] && (h.wrapS = n.RepeatWrapping),
  45286. 1 !== i[1] && (h.wrapT = n.RepeatWrapping)),
  45287. void 0 !== r && h.offset.fromArray(r),
  45288. void 0 !== s && ("repeat" === s[0] && (h.wrapS = n.RepeatWrapping),
  45289. "mirror" === s[0] && (h.wrapS = n.MirroredRepeatWrapping),
  45290. "repeat" === s[1] && (h.wrapT = n.RepeatWrapping),
  45291. "mirror" === s[1] && (h.wrapT = n.MirroredRepeatWrapping)),
  45292. void 0 !== c && (h.anisotropy = c);
  45293. var p = n.Math.generateUUID();
  45294. return l[p] = h,
  45295. p
  45296. }
  45297. void 0 === e && (e = new n.Color),
  45298. void 0 === t && (t = new n.TextureLoader),
  45299. void 0 === i && (i = new n.MaterialLoader);
  45300. var l = {}
  45301. , c = {
  45302. uuid: n.Math.generateUUID(),
  45303. type: "MeshLambertMaterial"
  45304. };
  45305. for (var h in r) {
  45306. var u = r[h];
  45307. switch (h) {
  45308. case "DbgColor":
  45309. case "DbgIndex":
  45310. case "opticalDensity":
  45311. case "illumination":
  45312. break;
  45313. case "DbgName":
  45314. c.name = u;
  45315. break;
  45316. case "blending":
  45317. c.blending = n[u];
  45318. break;
  45319. case "colorAmbient":
  45320. case "mapAmbient":
  45321. console.warn("THREE.Loader.createMaterial:", h, "is no longer supported.");
  45322. break;
  45323. case "colorDiffuse":
  45324. c.color = e.fromArray(u).getHex();
  45325. break;
  45326. case "colorSpecular":
  45327. c.specular = e.fromArray(u).getHex();
  45328. break;
  45329. case "colorEmissive":
  45330. c.emissive = e.fromArray(u).getHex();
  45331. break;
  45332. case "specularCoef":
  45333. c.shininess = u;
  45334. break;
  45335. case "shading":
  45336. "basic" === u.toLowerCase() && (c.type = "MeshBasicMaterial"),
  45337. "phong" === u.toLowerCase() && (c.type = "MeshPhongMaterial");
  45338. break;
  45339. case "mapDiffuse":
  45340. c.map = s(u, r.mapDiffuseRepeat, r.mapDiffuseOffset, r.mapDiffuseWrap, r.mapDiffuseAnisotropy);
  45341. break;
  45342. case "mapDiffuseRepeat":
  45343. case "mapDiffuseOffset":
  45344. case "mapDiffuseWrap":
  45345. case "mapDiffuseAnisotropy":
  45346. break;
  45347. case "mapLight":
  45348. c.lightMap = s(u, r.mapLightRepeat, r.mapLightOffset, r.mapLightWrap, r.mapLightAnisotropy);
  45349. break;
  45350. case "mapLightRepeat":
  45351. case "mapLightOffset":
  45352. case "mapLightWrap":
  45353. case "mapLightAnisotropy":
  45354. break;
  45355. case "mapAO":
  45356. c.aoMap = s(u, r.mapAORepeat, r.mapAOOffset, r.mapAOWrap, r.mapAOAnisotropy);
  45357. break;
  45358. case "mapAORepeat":
  45359. case "mapAOOffset":
  45360. case "mapAOWrap":
  45361. case "mapAOAnisotropy":
  45362. break;
  45363. case "mapBump":
  45364. c.bumpMap = s(u, r.mapBumpRepeat, r.mapBumpOffset, r.mapBumpWrap, r.mapBumpAnisotropy);
  45365. break;
  45366. case "mapBumpScale":
  45367. c.bumpScale = u;
  45368. break;
  45369. case "mapBumpRepeat":
  45370. case "mapBumpOffset":
  45371. case "mapBumpWrap":
  45372. case "mapBumpAnisotropy":
  45373. break;
  45374. case "mapNormal":
  45375. c.normalMap = s(u, r.mapNormalRepeat, r.mapNormalOffset, r.mapNormalWrap, r.mapNormalAnisotropy);
  45376. break;
  45377. case "mapNormalFactor":
  45378. c.normalScale = [u, u];
  45379. break;
  45380. case "mapNormalRepeat":
  45381. case "mapNormalOffset":
  45382. case "mapNormalWrap":
  45383. case "mapNormalAnisotropy":
  45384. break;
  45385. case "mapSpecular":
  45386. c.specularMap = s(u, r.mapSpecularRepeat, r.mapSpecularOffset, r.mapSpecularWrap, r.mapSpecularAnisotropy);
  45387. break;
  45388. case "mapSpecularRepeat":
  45389. case "mapSpecularOffset":
  45390. case "mapSpecularWrap":
  45391. case "mapSpecularAnisotropy":
  45392. break;
  45393. case "mapAlpha":
  45394. c.alphaMap = s(u, r.mapAlphaRepeat, r.mapAlphaOffset, r.mapAlphaWrap, r.mapAlphaAnisotropy);
  45395. break;
  45396. case "mapAlphaRepeat":
  45397. case "mapAlphaOffset":
  45398. case "mapAlphaWrap":
  45399. case "mapAlphaAnisotropy":
  45400. break;
  45401. case "flipSided":
  45402. c.side = n.BackSide;
  45403. break;
  45404. case "doubleSided":
  45405. c.side = n.DoubleSide;
  45406. break;
  45407. case "transparency":
  45408. console.warn("THREE.Loader.createMaterial: transparency has been renamed to opacity"),
  45409. c.opacity = u;
  45410. break;
  45411. case "depthTest":
  45412. case "depthWrite":
  45413. case "colorWrite":
  45414. case "opacity":
  45415. case "reflectivity":
  45416. case "transparent":
  45417. case "visible":
  45418. case "wireframe":
  45419. c[h] = u;
  45420. break;
  45421. case "vertexColors":
  45422. u === !0 && (c.vertexColors = n.VertexColors),
  45423. "face" === u && (c.vertexColors = n.FaceColors);
  45424. break;
  45425. default:
  45426. console.error("THREE.Loader.createMaterial: Unsupported", h, u)
  45427. }
  45428. }
  45429. return "MeshBasicMaterial" === c.type && delete c.emissive,
  45430. "MeshPhongMaterial" !== c.type && delete c.specular,
  45431. c.opacity < 1 && (c.transparent = !0),
  45432. i.setTextures(l),
  45433. i.parse(c)
  45434. }
  45435. }()
  45436. },
  45437. n.Loader.Handlers = {
  45438. handlers: [],
  45439. add: function(e, t) {
  45440. this.handlers.push(e, t)
  45441. },
  45442. get: function(e) {
  45443. for (var t = this.handlers, i = 0, n = t.length; i < n; i += 2) {
  45444. var r = t[i]
  45445. , o = t[i + 1];
  45446. if (r.test(e))
  45447. return o
  45448. }
  45449. return null
  45450. }
  45451. },
  45452. n.XHRLoader = function(e) {
  45453. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45454. }
  45455. ,
  45456. n.XHRLoader.prototype = {
  45457. constructor: n.XHRLoader,
  45458. load: function(e, t, i, r) {
  45459. void 0 !== this.path && (e = this.path + e);
  45460. var o = this
  45461. , a = n.Cache.get(e);
  45462. if (void 0 !== a)
  45463. return t && setTimeout(function() {
  45464. t(a)
  45465. }, 0),
  45466. a;
  45467. var s = new XMLHttpRequest;
  45468. return s.overrideMimeType("text/plain"),
  45469. s.open("GET", e, !0),
  45470. s.addEventListener("load", function(i) {
  45471. var a = i.target.response;
  45472. n.Cache.add(e, a),
  45473. 200 === this.status ? (t && t(a),
  45474. o.manager.itemEnd(e)) : 0 === this.status ? (console.warn("THREE.XHRLoader: HTTP Status 0 received."),
  45475. t && t(a),
  45476. o.manager.itemEnd(e)) : (r && r(i),
  45477. o.manager.itemError(e))
  45478. }, !1),
  45479. void 0 !== i && s.addEventListener("progress", function(e) {
  45480. i(e)
  45481. }, !1),
  45482. s.addEventListener("error", function(t) {
  45483. r && r(t),
  45484. o.manager.itemError(e)
  45485. }, !1),
  45486. void 0 !== this.responseType && (s.responseType = this.responseType),
  45487. void 0 !== this.withCredentials && (s.withCredentials = this.withCredentials),
  45488. s.send(null),
  45489. o.manager.itemStart(e),
  45490. s
  45491. },
  45492. setPath: function(e) {
  45493. this.path = e
  45494. },
  45495. setResponseType: function(e) {
  45496. this.responseType = e
  45497. },
  45498. setWithCredentials: function(e) {
  45499. this.withCredentials = e
  45500. }
  45501. },
  45502. n.FontLoader = function(e) {
  45503. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45504. }
  45505. ,
  45506. n.FontLoader.prototype = {
  45507. constructor: n.FontLoader,
  45508. load: function(e, t, i, r) {
  45509. var o = new n.XHRLoader(this.manager);
  45510. o.load(e, function(e) {
  45511. t(new n.Font(JSON.parse(e.substring(65, e.length - 2))))
  45512. }, i, r)
  45513. }
  45514. },
  45515. n.ImageLoader = function(e) {
  45516. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45517. }
  45518. ,
  45519. n.ImageLoader.prototype = {
  45520. constructor: n.ImageLoader,
  45521. load: function(e, t, i, r) {
  45522. void 0 !== this.path && (e = this.path + e);
  45523. var o = this
  45524. , a = n.Cache.get(e);
  45525. if (void 0 !== a)
  45526. return o.manager.itemStart(e),
  45527. t ? setTimeout(function() {
  45528. t(a),
  45529. o.manager.itemEnd(e)
  45530. }, 0) : o.manager.itemEnd(e),
  45531. a;
  45532. var s = document.createElement("img");
  45533. return s.addEventListener("load", function(i) {
  45534. n.Cache.add(e, this),
  45535. t && t(this),
  45536. o.manager.itemEnd(e)
  45537. }, !1),
  45538. void 0 !== i && s.addEventListener("progress", function(e) {
  45539. i(e)
  45540. }, !1),
  45541. s.addEventListener("error", function(t) {
  45542. r && r(t),
  45543. o.manager.itemError(e)
  45544. }, !1),
  45545. void 0 !== this.crossOrigin && (s.crossOrigin = this.crossOrigin),
  45546. o.manager.itemStart(e),
  45547. s.src = e,
  45548. s
  45549. },
  45550. setCrossOrigin: function(e) {
  45551. this.crossOrigin = e
  45552. },
  45553. setPath: function(e) {
  45554. this.path = e
  45555. }
  45556. },
  45557. n.JSONLoader = function(e) {
  45558. "boolean" == typeof e && (console.warn("THREE.JSONLoader: showStatus parameter has been removed from constructor."),
  45559. e = void 0),
  45560. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45561. this.withCredentials = !1
  45562. }
  45563. ,
  45564. n.JSONLoader.prototype = {
  45565. constructor: n.JSONLoader,
  45566. get statusDomElement() {
  45567. return void 0 === this._statusDomElement && (this._statusDomElement = document.createElement("div")),
  45568. console.warn("THREE.JSONLoader: .statusDomElement has been removed."),
  45569. this._statusDomElement
  45570. },
  45571. load: function(e, t, i, r) {
  45572. var o = this
  45573. , a = this.texturePath && "string" == typeof this.texturePath ? this.texturePath : n.Loader.prototype.extractUrlBase(e)
  45574. , s = new n.XHRLoader(this.manager);
  45575. s.setWithCredentials(this.withCredentials),
  45576. s.load(e, function(i) {
  45577. var n = JSON.parse(i)
  45578. , r = n.metadata;
  45579. if (void 0 !== r) {
  45580. var s = r.type;
  45581. if (void 0 !== s) {
  45582. if ("object" === s.toLowerCase())
  45583. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.ObjectLoader instead.");
  45584. if ("scene" === s.toLowerCase())
  45585. return void console.error("THREE.JSONLoader: " + e + " should be loaded with THREE.SceneLoader instead.")
  45586. }
  45587. }
  45588. var l = o.parse(n, a);
  45589. t(l.geometry, l.materials)
  45590. }, i, r)
  45591. },
  45592. setTexturePath: function(e) {
  45593. this.texturePath = e
  45594. },
  45595. parse: function(e, t) {
  45596. function i(t) {
  45597. function i(e, t) {
  45598. return e & 1 << t
  45599. }
  45600. var r, o, a, l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M, R, P, O = e.faces, L = e.vertices, D = e.normals, N = e.colors, B = 0;
  45601. if (void 0 !== e.uvs) {
  45602. for (r = 0; r < e.uvs.length; r++)
  45603. e.uvs[r].length && B++;
  45604. for (r = 0; r < B; r++)
  45605. s.faceVertexUvs[r] = []
  45606. }
  45607. for (l = 0,
  45608. c = L.length; l < c; )
  45609. E = new n.Vector3,
  45610. E.x = L[l++] * t,
  45611. E.y = L[l++] * t,
  45612. E.z = L[l++] * t,
  45613. s.vertices.push(E);
  45614. for (l = 0,
  45615. c = O.length; l < c; )
  45616. if (f = O[l++],
  45617. g = i(f, 0),
  45618. m = i(f, 1),
  45619. v = i(f, 3),
  45620. A = i(f, 4),
  45621. y = i(f, 5),
  45622. C = i(f, 6),
  45623. I = i(f, 7),
  45624. g) {
  45625. if (w = new n.Face3,
  45626. w.a = O[l],
  45627. w.b = O[l + 1],
  45628. w.c = O[l + 3],
  45629. _ = new n.Face3,
  45630. _.a = O[l + 1],
  45631. _.b = O[l + 2],
  45632. _.c = O[l + 3],
  45633. l += 4,
  45634. m && (p = O[l++],
  45635. w.materialIndex = p,
  45636. _.materialIndex = p),
  45637. a = s.faces.length,
  45638. v)
  45639. for (r = 0; r < B; r++)
  45640. for (S = e.uvs[r],
  45641. s.faceVertexUvs[r][a] = [],
  45642. s.faceVertexUvs[r][a + 1] = [],
  45643. o = 0; o < 4; o++)
  45644. d = O[l++],
  45645. R = S[2 * d],
  45646. P = S[2 * d + 1],
  45647. M = new n.Vector2(R,P),
  45648. 2 !== o && s.faceVertexUvs[r][a].push(M),
  45649. 0 !== o && s.faceVertexUvs[r][a + 1].push(M);
  45650. if (A && (u = 3 * O[l++],
  45651. w.normal.set(D[u++], D[u++], D[u]),
  45652. _.normal.copy(w.normal)),
  45653. y)
  45654. for (r = 0; r < 4; r++)
  45655. u = 3 * O[l++],
  45656. x = new n.Vector3(D[u++],D[u++],D[u]),
  45657. 2 !== r && w.vertexNormals.push(x),
  45658. 0 !== r && _.vertexNormals.push(x);
  45659. if (C && (h = O[l++],
  45660. T = N[h],
  45661. w.color.setHex(T),
  45662. _.color.setHex(T)),
  45663. I)
  45664. for (r = 0; r < 4; r++)
  45665. h = O[l++],
  45666. T = N[h],
  45667. 2 !== r && w.vertexColors.push(new n.Color(T)),
  45668. 0 !== r && _.vertexColors.push(new n.Color(T));
  45669. s.faces.push(w),
  45670. s.faces.push(_)
  45671. } else {
  45672. if (b = new n.Face3,
  45673. b.a = O[l++],
  45674. b.b = O[l++],
  45675. b.c = O[l++],
  45676. m && (p = O[l++],
  45677. b.materialIndex = p),
  45678. a = s.faces.length,
  45679. v)
  45680. for (r = 0; r < B; r++)
  45681. for (S = e.uvs[r],
  45682. s.faceVertexUvs[r][a] = [],
  45683. o = 0; o < 3; o++)
  45684. d = O[l++],
  45685. R = S[2 * d],
  45686. P = S[2 * d + 1],
  45687. M = new n.Vector2(R,P),
  45688. s.faceVertexUvs[r][a].push(M);
  45689. if (A && (u = 3 * O[l++],
  45690. b.normal.set(D[u++], D[u++], D[u])),
  45691. y)
  45692. for (r = 0; r < 3; r++)
  45693. u = 3 * O[l++],
  45694. x = new n.Vector3(D[u++],D[u++],D[u]),
  45695. b.vertexNormals.push(x);
  45696. if (C && (h = O[l++],
  45697. b.color.setHex(N[h])),
  45698. I)
  45699. for (r = 0; r < 3; r++)
  45700. h = O[l++],
  45701. b.vertexColors.push(new n.Color(N[h]));
  45702. s.faces.push(b)
  45703. }
  45704. }
  45705. function r() {
  45706. var t = void 0 !== e.influencesPerVertex ? e.influencesPerVertex : 2;
  45707. if (e.skinWeights)
  45708. for (var i = 0, r = e.skinWeights.length; i < r; i += t) {
  45709. var o = e.skinWeights[i]
  45710. , a = t > 1 ? e.skinWeights[i + 1] : 0
  45711. , l = t > 2 ? e.skinWeights[i + 2] : 0
  45712. , c = t > 3 ? e.skinWeights[i + 3] : 0;
  45713. s.skinWeights.push(new n.Vector4(o,a,l,c))
  45714. }
  45715. if (e.skinIndices)
  45716. for (var i = 0, r = e.skinIndices.length; i < r; i += t) {
  45717. var h = e.skinIndices[i]
  45718. , u = t > 1 ? e.skinIndices[i + 1] : 0
  45719. , d = t > 2 ? e.skinIndices[i + 2] : 0
  45720. , p = t > 3 ? e.skinIndices[i + 3] : 0;
  45721. s.skinIndices.push(new n.Vector4(h,u,d,p))
  45722. }
  45723. s.bones = e.bones,
  45724. s.bones && s.bones.length > 0 && (s.skinWeights.length !== s.skinIndices.length || s.skinIndices.length !== s.vertices.length) && console.warn("When skinning, number of vertices (" + s.vertices.length + "), skinIndices (" + s.skinIndices.length + "), and skinWeights (" + s.skinWeights.length + ") should match.")
  45725. }
  45726. function o(t) {
  45727. if (void 0 !== e.morphTargets)
  45728. for (var i = 0, r = e.morphTargets.length; i < r; i++) {
  45729. s.morphTargets[i] = {},
  45730. s.morphTargets[i].name = e.morphTargets[i].name,
  45731. s.morphTargets[i].vertices = [];
  45732. for (var o = s.morphTargets[i].vertices, a = e.morphTargets[i].vertices, l = 0, c = a.length; l < c; l += 3) {
  45733. var h = new n.Vector3;
  45734. h.x = a[l] * t,
  45735. h.y = a[l + 1] * t,
  45736. h.z = a[l + 2] * t,
  45737. o.push(h)
  45738. }
  45739. }
  45740. if (void 0 !== e.morphColors && e.morphColors.length > 0) {
  45741. console.warn('THREE.JSONLoader: "morphColors" no longer supported. Using them as face colors.');
  45742. for (var u = s.faces, d = e.morphColors[0].colors, i = 0, r = u.length; i < r; i++)
  45743. u[i].color.fromArray(d, 3 * i)
  45744. }
  45745. }
  45746. function a() {
  45747. var t = []
  45748. , i = [];
  45749. void 0 !== e.animation && i.push(e.animation),
  45750. void 0 !== e.animations && (e.animations.length ? i = i.concat(e.animations) : i.push(e.animations));
  45751. for (var r = 0; r < i.length; r++) {
  45752. var o = n.AnimationClip.parseAnimation(i[r], s.bones);
  45753. o && t.push(o)
  45754. }
  45755. if (s.morphTargets) {
  45756. var a = n.AnimationClip.CreateClipsFromMorphTargetSequences(s.morphTargets, 10);
  45757. t = t.concat(a)
  45758. }
  45759. t.length > 0 && (s.animations = t)
  45760. }
  45761. var s = new n.Geometry
  45762. , l = void 0 !== e.scale ? 1 / e.scale : 1;
  45763. if (i(l),
  45764. r(),
  45765. o(l),
  45766. a(),
  45767. s.computeFaceNormals(),
  45768. s.computeBoundingSphere(),
  45769. void 0 === e.materials || 0 === e.materials.length)
  45770. return {
  45771. geometry: s
  45772. };
  45773. var c = n.Loader.prototype.initMaterials(e.materials, t, this.crossOrigin);
  45774. return {
  45775. geometry: s,
  45776. materials: c
  45777. }
  45778. }
  45779. },
  45780. n.LoadingManager = function(e, t, i) {
  45781. var n = this
  45782. , r = !1
  45783. , o = 0
  45784. , a = 0;
  45785. this.onStart = void 0,
  45786. this.onLoad = e,
  45787. this.onProgress = t,
  45788. this.onError = i,
  45789. this.itemStart = function(e) {
  45790. a++,
  45791. r === !1 && void 0 !== n.onStart && n.onStart(e, o, a),
  45792. r = !0
  45793. }
  45794. ,
  45795. this.itemEnd = function(e) {
  45796. o++,
  45797. void 0 !== n.onProgress && n.onProgress(e, o, a),
  45798. o === a && (r = !1,
  45799. void 0 !== n.onLoad && n.onLoad())
  45800. }
  45801. ,
  45802. this.itemError = function(e) {
  45803. void 0 !== n.onError && n.onError(e)
  45804. }
  45805. }
  45806. ,
  45807. n.DefaultLoadingManager = new n.LoadingManager,
  45808. n.BufferGeometryLoader = function(e) {
  45809. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  45810. }
  45811. ,
  45812. n.BufferGeometryLoader.prototype = {
  45813. constructor: n.BufferGeometryLoader,
  45814. load: function(e, t, i, r) {
  45815. var o = this
  45816. , a = new n.XHRLoader(o.manager);
  45817. a.load(e, function(e) {
  45818. t(o.parse(JSON.parse(e)))
  45819. }, i, r)
  45820. },
  45821. parse: function(e) {
  45822. var t = new n.BufferGeometry
  45823. , i = e.data.index
  45824. , r = {
  45825. Int8Array: Int8Array,
  45826. Uint8Array: Uint8Array,
  45827. Uint8ClampedArray: Uint8ClampedArray,
  45828. Int16Array: Int16Array,
  45829. Uint16Array: Uint16Array,
  45830. Int32Array: Int32Array,
  45831. Uint32Array: Uint32Array,
  45832. Float32Array: Float32Array,
  45833. Float64Array: Float64Array
  45834. };
  45835. if (void 0 !== i) {
  45836. var o = new r[i.type](i.array);
  45837. t.setIndex(new n.BufferAttribute(o,1))
  45838. }
  45839. var a = e.data.attributes;
  45840. for (var s in a) {
  45841. var l = a[s]
  45842. , o = new r[l.type](l.array);
  45843. t.addAttribute(s, new n.BufferAttribute(o,l.itemSize))
  45844. }
  45845. var c = e.data.groups || e.data.drawcalls || e.data.offsets;
  45846. if (void 0 !== c)
  45847. for (var h = 0, u = c.length; h !== u; ++h) {
  45848. var d = c[h];
  45849. t.addGroup(d.start, d.count, d.materialIndex)
  45850. }
  45851. var p = e.data.boundingSphere;
  45852. if (void 0 !== p) {
  45853. var f = new n.Vector3;
  45854. void 0 !== p.center && f.fromArray(p.center),
  45855. t.boundingSphere = new n.Sphere(f,p.radius)
  45856. }
  45857. return t
  45858. }
  45859. },
  45860. n.MaterialLoader = function(e) {
  45861. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45862. this.textures = {}
  45863. }
  45864. ,
  45865. n.MaterialLoader.prototype = {
  45866. constructor: n.MaterialLoader,
  45867. load: function(e, t, i, r) {
  45868. var o = this
  45869. , a = new n.XHRLoader(o.manager);
  45870. a.load(e, function(e) {
  45871. t(o.parse(JSON.parse(e)))
  45872. }, i, r)
  45873. },
  45874. setTextures: function(e) {
  45875. this.textures = e
  45876. },
  45877. getTexture: function(e) {
  45878. var t = this.textures;
  45879. return void 0 === t[e] && console.warn("THREE.MaterialLoader: Undefined texture", e),
  45880. t[e]
  45881. },
  45882. parse: function(e) {
  45883. var t = new n[e.type];
  45884. if (void 0 !== e.uuid && (t.uuid = e.uuid),
  45885. void 0 !== e.name && (t.name = e.name),
  45886. void 0 !== e.color && t.color.setHex(e.color),
  45887. void 0 !== e.roughness && (t.roughness = e.roughness),
  45888. void 0 !== e.metalness && (t.metalness = e.metalness),
  45889. void 0 !== e.emissive && t.emissive.setHex(e.emissive),
  45890. void 0 !== e.specular && t.specular.setHex(e.specular),
  45891. void 0 !== e.shininess && (t.shininess = e.shininess),
  45892. void 0 !== e.uniforms && (t.uniforms = e.uniforms),
  45893. void 0 !== e.vertexShader && (t.vertexShader = e.vertexShader),
  45894. void 0 !== e.fragmentShader && (t.fragmentShader = e.fragmentShader),
  45895. void 0 !== e.vertexColors && (t.vertexColors = e.vertexColors),
  45896. void 0 !== e.shading && (t.shading = e.shading),
  45897. void 0 !== e.blending && (t.blending = e.blending),
  45898. void 0 !== e.side && (t.side = e.side),
  45899. void 0 !== e.opacity && (t.opacity = e.opacity),
  45900. void 0 !== e.transparent && (t.transparent = e.transparent),
  45901. void 0 !== e.alphaTest && (t.alphaTest = e.alphaTest),
  45902. void 0 !== e.depthTest && (t.depthTest = e.depthTest),
  45903. void 0 !== e.depthWrite && (t.depthWrite = e.depthWrite),
  45904. void 0 !== e.colorWrite && (t.colorWrite = e.colorWrite),
  45905. void 0 !== e.wireframe && (t.wireframe = e.wireframe),
  45906. void 0 !== e.wireframeLinewidth && (t.wireframeLinewidth = e.wireframeLinewidth),
  45907. void 0 !== e.size && (t.size = e.size),
  45908. void 0 !== e.sizeAttenuation && (t.sizeAttenuation = e.sizeAttenuation),
  45909. void 0 !== e.map && (t.map = this.getTexture(e.map)),
  45910. void 0 !== e.alphaMap && (t.alphaMap = this.getTexture(e.alphaMap),
  45911. t.transparent = !0),
  45912. void 0 !== e.bumpMap && (t.bumpMap = this.getTexture(e.bumpMap)),
  45913. void 0 !== e.bumpScale && (t.bumpScale = e.bumpScale),
  45914. void 0 !== e.normalMap && (t.normalMap = this.getTexture(e.normalMap)),
  45915. void 0 !== e.normalScale) {
  45916. var i = e.normalScale;
  45917. Array.isArray(i) === !1 && (i = [i, i]),
  45918. t.normalScale = (new n.Vector2).fromArray(i)
  45919. }
  45920. if (void 0 !== e.displacementMap && (t.displacementMap = this.getTexture(e.displacementMap)),
  45921. void 0 !== e.displacementScale && (t.displacementScale = e.displacementScale),
  45922. void 0 !== e.displacementBias && (t.displacementBias = e.displacementBias),
  45923. void 0 !== e.roughnessMap && (t.roughnessMap = this.getTexture(e.roughnessMap)),
  45924. void 0 !== e.metalnessMap && (t.metalnessMap = this.getTexture(e.metalnessMap)),
  45925. void 0 !== e.emissiveMap && (t.emissiveMap = this.getTexture(e.emissiveMap)),
  45926. void 0 !== e.emissiveIntensity && (t.emissiveIntensity = e.emissiveIntensity),
  45927. void 0 !== e.specularMap && (t.specularMap = this.getTexture(e.specularMap)),
  45928. void 0 !== e.envMap && (t.envMap = this.getTexture(e.envMap),
  45929. t.combine = n.MultiplyOperation),
  45930. e.reflectivity && (t.reflectivity = e.reflectivity),
  45931. void 0 !== e.lightMap && (t.lightMap = this.getTexture(e.lightMap)),
  45932. void 0 !== e.lightMapIntensity && (t.lightMapIntensity = e.lightMapIntensity),
  45933. void 0 !== e.aoMap && (t.aoMap = this.getTexture(e.aoMap)),
  45934. void 0 !== e.aoMapIntensity && (t.aoMapIntensity = e.aoMapIntensity),
  45935. void 0 !== e.materials)
  45936. for (var r = 0, o = e.materials.length; r < o; r++)
  45937. t.materials.push(this.parse(e.materials[r]));
  45938. return t
  45939. }
  45940. },
  45941. n.ObjectLoader = function(e) {
  45942. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  45943. this.texturePath = ""
  45944. }
  45945. ,
  45946. n.ObjectLoader.prototype = {
  45947. constructor: n.ObjectLoader,
  45948. load: function(e, t, i, r) {
  45949. "" === this.texturePath && (this.texturePath = e.substring(0, e.lastIndexOf("/") + 1));
  45950. var o = this
  45951. , a = new n.XHRLoader(o.manager);
  45952. a.load(e, function(e) {
  45953. o.parse(JSON.parse(e), t)
  45954. }, i, r)
  45955. },
  45956. setTexturePath: function(e) {
  45957. this.texturePath = e
  45958. },
  45959. setCrossOrigin: function(e) {
  45960. this.crossOrigin = e
  45961. },
  45962. parse: function(e, t) {
  45963. var i = this.parseGeometries(e.geometries)
  45964. , n = this.parseImages(e.images, function() {
  45965. void 0 !== t && t(a)
  45966. })
  45967. , r = this.parseTextures(e.textures, n)
  45968. , o = this.parseMaterials(e.materials, r)
  45969. , a = this.parseObject(e.object, i, o);
  45970. return e.animations && (a.animations = this.parseAnimations(e.animations)),
  45971. void 0 !== e.images && 0 !== e.images.length || void 0 !== t && t(a),
  45972. a
  45973. },
  45974. parseGeometries: function(e) {
  45975. var t = {};
  45976. if (void 0 !== e)
  45977. for (var i = new n.JSONLoader, r = new n.BufferGeometryLoader, o = 0, a = e.length; o < a; o++) {
  45978. var s, l = e[o];
  45979. switch (l.type) {
  45980. case "PlaneGeometry":
  45981. case "PlaneBufferGeometry":
  45982. s = new n[l.type](l.width,l.height,l.widthSegments,l.heightSegments);
  45983. break;
  45984. case "BoxGeometry":
  45985. case "BoxBufferGeometry":
  45986. case "CubeGeometry":
  45987. s = new n[l.type](l.width,l.height,l.depth,l.widthSegments,l.heightSegments,l.depthSegments);
  45988. break;
  45989. case "CircleGeometry":
  45990. case "CircleBufferGeometry":
  45991. s = new n[l.type](l.radius,l.segments,l.thetaStart,l.thetaLength);
  45992. break;
  45993. case "CylinderGeometry":
  45994. case "CylinderBufferGeometry":
  45995. s = new n[l.type](l.radiusTop,l.radiusBottom,l.height,l.radialSegments,l.heightSegments,l.openEnded,l.thetaStart,l.thetaLength);
  45996. break;
  45997. case "SphereGeometry":
  45998. case "SphereBufferGeometry":
  45999. s = new n[l.type](l.radius,l.widthSegments,l.heightSegments,l.phiStart,l.phiLength,l.thetaStart,l.thetaLength);
  46000. break;
  46001. case "DodecahedronGeometry":
  46002. s = new n.DodecahedronGeometry(l.radius,l.detail);
  46003. break;
  46004. case "IcosahedronGeometry":
  46005. s = new n.IcosahedronGeometry(l.radius,l.detail);
  46006. break;
  46007. case "OctahedronGeometry":
  46008. s = new n.OctahedronGeometry(l.radius,l.detail);
  46009. break;
  46010. case "TetrahedronGeometry":
  46011. s = new n.TetrahedronGeometry(l.radius,l.detail);
  46012. break;
  46013. case "RingGeometry":
  46014. case "RingBufferGeometry":
  46015. s = new n[l.type](l.innerRadius,l.outerRadius,l.thetaSegments,l.phiSegments,l.thetaStart,l.thetaLength);
  46016. break;
  46017. case "TorusGeometry":
  46018. case "TorusBufferGeometry":
  46019. s = new n[l.type](l.radius,l.tube,l.radialSegments,l.tubularSegments,l.arc);
  46020. break;
  46021. case "TorusKnotGeometry":
  46022. case "TorusKnotBufferGeometry":
  46023. s = new n[l.type](l.radius,l.tube,l.tubularSegments,l.radialSegments,l.p,l.q);
  46024. break;
  46025. case "LatheGeometry":
  46026. s = new n.LatheGeometry(l.points,l.segments,l.phiStart,l.phiLength);
  46027. break;
  46028. case "BufferGeometry":
  46029. s = r.parse(l);
  46030. break;
  46031. case "Geometry":
  46032. s = i.parse(l.data, this.texturePath).geometry;
  46033. break;
  46034. default:
  46035. console.warn('THREE.ObjectLoader: Unsupported geometry type "' + l.type + '"');
  46036. continue
  46037. }
  46038. s.uuid = l.uuid,
  46039. void 0 !== l.name && (s.name = l.name),
  46040. t[l.uuid] = s
  46041. }
  46042. return t
  46043. },
  46044. parseMaterials: function(e, t) {
  46045. var i = {};
  46046. if (void 0 !== e) {
  46047. var r = new n.MaterialLoader;
  46048. r.setTextures(t);
  46049. for (var o = 0, a = e.length; o < a; o++) {
  46050. var s = r.parse(e[o]);
  46051. i[s.uuid] = s
  46052. }
  46053. }
  46054. return i
  46055. },
  46056. parseAnimations: function(e) {
  46057. for (var t = [], i = 0; i < e.length; i++) {
  46058. var r = n.AnimationClip.parse(e[i]);
  46059. t.push(r)
  46060. }
  46061. return t
  46062. },
  46063. parseImages: function(e, t) {
  46064. function i(e) {
  46065. return r.manager.itemStart(e),
  46066. s.load(e, function() {
  46067. r.manager.itemEnd(e)
  46068. })
  46069. }
  46070. var r = this
  46071. , o = {};
  46072. if (void 0 !== e && e.length > 0) {
  46073. var a = new n.LoadingManager(t)
  46074. , s = new n.ImageLoader(a);
  46075. s.setCrossOrigin(this.crossOrigin);
  46076. for (var l = 0, c = e.length; l < c; l++) {
  46077. var h = e[l]
  46078. , u = /^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url) ? h.url : r.texturePath + h.url;
  46079. o[h.uuid] = i(u)
  46080. }
  46081. }
  46082. return o
  46083. },
  46084. parseTextures: function(e, t) {
  46085. function i(e) {
  46086. return "number" == typeof e ? e : (console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.", e),
  46087. n[e])
  46088. }
  46089. var r = {};
  46090. if (void 0 !== e)
  46091. for (var o = 0, a = e.length; o < a; o++) {
  46092. var s = e[o];
  46093. void 0 === s.image && console.warn('THREE.ObjectLoader: No "image" specified for', s.uuid),
  46094. void 0 === t[s.image] && console.warn("THREE.ObjectLoader: Undefined image", s.image);
  46095. var l = new n.Texture(t[s.image]);
  46096. l.needsUpdate = !0,
  46097. l.uuid = s.uuid,
  46098. void 0 !== s.name && (l.name = s.name),
  46099. void 0 !== s.mapping && (l.mapping = i(s.mapping)),
  46100. void 0 !== s.offset && (l.offset = new n.Vector2(s.offset[0],s.offset[1])),
  46101. void 0 !== s.repeat && (l.repeat = new n.Vector2(s.repeat[0],s.repeat[1])),
  46102. void 0 !== s.minFilter && (l.minFilter = i(s.minFilter)),
  46103. void 0 !== s.magFilter && (l.magFilter = i(s.magFilter)),
  46104. void 0 !== s.anisotropy && (l.anisotropy = s.anisotropy),
  46105. Array.isArray(s.wrap) && (l.wrapS = i(s.wrap[0]),
  46106. l.wrapT = i(s.wrap[1])),
  46107. r[s.uuid] = l
  46108. }
  46109. return r
  46110. },
  46111. parseObject: function() {
  46112. var e = new n.Matrix4;
  46113. return function(t, i, r) {
  46114. function o(e) {
  46115. return void 0 === i[e] && console.warn("THREE.ObjectLoader: Undefined geometry", e),
  46116. i[e]
  46117. }
  46118. function a(e) {
  46119. if (void 0 !== e)
  46120. return void 0 === r[e] && console.warn("THREE.ObjectLoader: Undefined material", e),
  46121. r[e]
  46122. }
  46123. var s;
  46124. switch (t.type) {
  46125. case "Scene":
  46126. s = new n.Scene;
  46127. break;
  46128. case "PerspectiveCamera":
  46129. s = new n.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);
  46130. break;
  46131. case "OrthographicCamera":
  46132. s = new n.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);
  46133. break;
  46134. case "AmbientLight":
  46135. s = new n.AmbientLight(t.color,t.intensity);
  46136. break;
  46137. case "DirectionalLight":
  46138. s = new n.DirectionalLight(t.color,t.intensity);
  46139. break;
  46140. case "PointLight":
  46141. s = new n.PointLight(t.color,t.intensity,t.distance,t.decay);
  46142. break;
  46143. case "SpotLight":
  46144. s = new n.SpotLight(t.color,t.intensity,t.distance,t.angle,t.penumbra,t.decay);
  46145. break;
  46146. case "HemisphereLight":
  46147. s = new n.HemisphereLight(t.color,t.groundColor,t.intensity);
  46148. break;
  46149. case "Mesh":
  46150. var l = o(t.geometry)
  46151. , c = a(t.material);
  46152. s = l.bones && l.bones.length > 0 ? new n.SkinnedMesh(l,c) : new n.Mesh(l,c);
  46153. break;
  46154. case "LOD":
  46155. s = new n.LOD;
  46156. break;
  46157. case "Line":
  46158. s = new n.Line(o(t.geometry),a(t.material),t.mode);
  46159. break;
  46160. case "PointCloud":
  46161. case "Points":
  46162. s = new n.Points(o(t.geometry),a(t.material));
  46163. break;
  46164. case "Sprite":
  46165. s = new n.Sprite(a(t.material));
  46166. break;
  46167. case "Group":
  46168. s = new n.Group;
  46169. break;
  46170. default:
  46171. s = new n.Object3D
  46172. }
  46173. if (s.uuid = t.uuid,
  46174. void 0 !== t.name && (s.name = t.name),
  46175. void 0 !== t.matrix ? (e.fromArray(t.matrix),
  46176. e.decompose(s.position, s.quaternion, s.scale)) : (void 0 !== t.position && s.position.fromArray(t.position),
  46177. void 0 !== t.rotation && s.rotation.fromArray(t.rotation),
  46178. void 0 !== t.scale && s.scale.fromArray(t.scale)),
  46179. void 0 !== t.castShadow && (s.castShadow = t.castShadow),
  46180. void 0 !== t.receiveShadow && (s.receiveShadow = t.receiveShadow),
  46181. void 0 !== t.visible && (s.visible = t.visible),
  46182. void 0 !== t.userData && (s.userData = t.userData),
  46183. void 0 !== t.children)
  46184. for (var h in t.children)
  46185. s.add(this.parseObject(t.children[h], i, r));
  46186. if ("LOD" === t.type)
  46187. for (var u = t.levels, d = 0; d < u.length; d++) {
  46188. var p = u[d]
  46189. , h = s.getObjectByProperty("uuid", p.object);
  46190. void 0 !== h && s.addLevel(h, p.distance)
  46191. }
  46192. return s
  46193. }
  46194. }()
  46195. },
  46196. n.TextureLoader = function(e) {
  46197. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46198. }
  46199. ,
  46200. n.TextureLoader.prototype = {
  46201. constructor: n.TextureLoader,
  46202. load: function(e, t, i, r) {
  46203. var o = new n.Texture
  46204. , a = new n.ImageLoader(this.manager);
  46205. return a.setCrossOrigin(this.crossOrigin),
  46206. a.setPath(this.path),
  46207. a.load(e, function(e) {
  46208. o.image = e,
  46209. o.needsUpdate = !0,
  46210. void 0 !== t && t(o)
  46211. }, i, r),
  46212. o
  46213. },
  46214. setCrossOrigin: function(e) {
  46215. this.crossOrigin = e
  46216. },
  46217. setPath: function(e) {
  46218. this.path = e
  46219. }
  46220. },
  46221. n.CubeTextureLoader = function(e) {
  46222. this.manager = void 0 !== e ? e : n.DefaultLoadingManager
  46223. }
  46224. ,
  46225. n.CubeTextureLoader.prototype = {
  46226. constructor: n.CubeTextureLoader,
  46227. load: function(e, t, i, r) {
  46228. function o(i) {
  46229. s.load(e[i], function(e) {
  46230. a.images[i] = e,
  46231. l++,
  46232. 6 === l && (a.needsUpdate = !0,
  46233. t && t(a))
  46234. }, void 0, r)
  46235. }
  46236. var a = new n.CubeTexture
  46237. , s = new n.ImageLoader(this.manager);
  46238. s.setCrossOrigin(this.crossOrigin),
  46239. s.setPath(this.path);
  46240. for (var l = 0, c = 0; c < e.length; ++c)
  46241. o(c);
  46242. return a
  46243. },
  46244. setCrossOrigin: function(e) {
  46245. this.crossOrigin = e
  46246. },
  46247. setPath: function(e) {
  46248. this.path = e
  46249. }
  46250. },
  46251. n.DataTextureLoader = n.BinaryTextureLoader = function(e) {
  46252. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46253. this._parser = null
  46254. }
  46255. ,
  46256. n.BinaryTextureLoader.prototype = {
  46257. constructor: n.BinaryTextureLoader,
  46258. load: function(e, t, i, r) {
  46259. var o = this
  46260. , a = new n.DataTexture
  46261. , s = new n.XHRLoader(this.manager);
  46262. return s.setResponseType("arraybuffer"),
  46263. s.load(e, function(e) {
  46264. var i = o._parser(e);
  46265. i && (void 0 !== i.image ? a.image = i.image : void 0 !== i.data && (a.image.width = i.width,
  46266. a.image.height = i.height,
  46267. a.image.data = i.data),
  46268. a.wrapS = void 0 !== i.wrapS ? i.wrapS : n.ClampToEdgeWrapping,
  46269. a.wrapT = void 0 !== i.wrapT ? i.wrapT : n.ClampToEdgeWrapping,
  46270. a.magFilter = void 0 !== i.magFilter ? i.magFilter : n.LinearFilter,
  46271. a.minFilter = void 0 !== i.minFilter ? i.minFilter : n.LinearMipMapLinearFilter,
  46272. a.anisotropy = void 0 !== i.anisotropy ? i.anisotropy : 1,
  46273. void 0 !== i.format && (a.format = i.format),
  46274. void 0 !== i.type && (a.type = i.type),
  46275. void 0 !== i.mipmaps && (a.mipmaps = i.mipmaps),
  46276. 1 === i.mipmapCount && (a.minFilter = n.LinearFilter),
  46277. a.needsUpdate = !0,
  46278. t && t(a, i))
  46279. }, i, r),
  46280. a
  46281. }
  46282. },
  46283. n.CompressedTextureLoader = function(e) {
  46284. this.manager = void 0 !== e ? e : n.DefaultLoadingManager,
  46285. this._parser = null
  46286. }
  46287. ;
  46288. n.CompressedTextureLoader.prototype = {
  46289. constructor: n.CompressedTextureLoader,
  46290. load: function(e, t, i, r) {
  46291. function o(o) {
  46292. c.load(e[o], function(e) {
  46293. var i = a._parser(e, !0);
  46294. s[o] = {
  46295. width: i.width,
  46296. height: i.height,
  46297. format: i.format,
  46298. mipmaps: i.mipmaps
  46299. },
  46300. h += 1,
  46301. 6 === h && (1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46302. l.format = i.format,
  46303. l.needsUpdate = !0,
  46304. t && t(l))
  46305. }, i, r)
  46306. }
  46307. var a = this
  46308. , s = []
  46309. , l = new n.CompressedTexture;
  46310. l.image = s;
  46311. var c = new n.XHRLoader(this.manager);
  46312. if (c.setPath(this.path),
  46313. c.setResponseType("arraybuffer"),
  46314. Array.isArray(e))
  46315. for (var h = 0, u = 0, d = e.length; u < d; ++u)
  46316. o(u);
  46317. else
  46318. c.load(e, function(e) {
  46319. var i = a._parser(e, !0);
  46320. if (i.isCubemap)
  46321. for (var r = i.mipmaps.length / i.mipmapCount, o = 0; o < r; o++) {
  46322. s[o] = {
  46323. mipmaps: []
  46324. };
  46325. for (var c = 0; c < i.mipmapCount; c++)
  46326. s[o].mipmaps.push(i.mipmaps[o * i.mipmapCount + c]),
  46327. s[o].format = i.format,
  46328. s[o].width = i.width,
  46329. s[o].height = i.height
  46330. }
  46331. else
  46332. l.image.width = i.width,
  46333. l.image.height = i.height,
  46334. l.mipmaps = i.mipmaps;
  46335. 1 === i.mipmapCount && (l.minFilter = n.LinearFilter),
  46336. l.format = i.format,
  46337. l.needsUpdate = !0,
  46338. t && t(l)
  46339. }, i, r);
  46340. return l
  46341. },
  46342. setPath: function(e) {
  46343. this.path = e
  46344. }
  46345. };
  46346. n.Material = function() {
  46347. Object.defineProperty(this, "id", {
  46348. value: n.MaterialIdCount++
  46349. }),
  46350. this.uuid = n.Math.generateUUID(),
  46351. this.name = "",
  46352. this.type = "Material",
  46353. this.side = n.FrontSide,
  46354. this.opacity = 1,
  46355. this.transparent = !1,
  46356. this.blending = n.NormalBlending,
  46357. this.blendSrc = n.SrcAlphaFactor,
  46358. this.blendDst = n.OneMinusSrcAlphaFactor,
  46359. this.blendEquation = n.AddEquation,
  46360. this.blendSrcAlpha = null,
  46361. this.blendDstAlpha = null,
  46362. this.blendEquationAlpha = null,
  46363. this.depthFunc = n.LessEqualDepth,
  46364. this.depthTest = !0,
  46365. this.depthWrite = !0,
  46366. this.colorWrite = !0,
  46367. this.precision = null,
  46368. this.polygonOffset = !1,
  46369. this.polygonOffsetFactor = 0,
  46370. this.polygonOffsetUnits = 0,
  46371. this.alphaTest = 0,
  46372. this.premultipliedAlpha = !1,
  46373. this.overdraw = 0,
  46374. this.visible = !0,
  46375. this._needsUpdate = !0
  46376. }
  46377. ,
  46378. n.Material.prototype = {
  46379. constructor: n.Material,
  46380. get needsUpdate() {
  46381. return this._needsUpdate
  46382. },
  46383. set needsUpdate(e) {
  46384. e === !0 && this.update(),
  46385. this._needsUpdate = e
  46386. },
  46387. setValues: function(e) {
  46388. if (void 0 !== e)
  46389. for (var t in e) {
  46390. var i = e[t];
  46391. if (void 0 !== i) {
  46392. var r = this[t];
  46393. void 0 !== r ? r instanceof n.Color ? r.set(i) : r instanceof n.Vector3 && i instanceof n.Vector3 ? r.copy(i) : "overdraw" === t ? this[t] = Number(i) : this[t] = i : console.warn("THREE." + this.type + ": '" + t + "' is not a property of this material.")
  46394. } else
  46395. console.warn("THREE.Material: '" + t + "' parameter is undefined.")
  46396. }
  46397. },
  46398. toJSON: function(e) {
  46399. function t(e) {
  46400. var t = [];
  46401. for (var i in e) {
  46402. var n = e[i];
  46403. delete n.metadata,
  46404. t.push(n)
  46405. }
  46406. return t
  46407. }
  46408. var i = void 0 === e;
  46409. i && (e = {
  46410. textures: {},
  46411. images: {}
  46412. });
  46413. var r = {
  46414. metadata: {
  46415. version: 4.4,
  46416. type: "Material",
  46417. generator: "Material.toJSON"
  46418. }
  46419. };
  46420. if (r.uuid = this.uuid,
  46421. r.type = this.type,
  46422. "" !== this.name && (r.name = this.name),
  46423. this.color instanceof n.Color && (r.color = this.color.getHex()),
  46424. .5 !== this.roughness && (r.roughness = this.roughness),
  46425. .5 !== this.metalness && (r.metalness = this.metalness),
  46426. this.emissive instanceof n.Color && (r.emissive = this.emissive.getHex()),
  46427. this.specular instanceof n.Color && (r.specular = this.specular.getHex()),
  46428. void 0 !== this.shininess && (r.shininess = this.shininess),
  46429. this.map instanceof n.Texture && (r.map = this.map.toJSON(e).uuid),
  46430. this.alphaMap instanceof n.Texture && (r.alphaMap = this.alphaMap.toJSON(e).uuid),
  46431. this.lightMap instanceof n.Texture && (r.lightMap = this.lightMap.toJSON(e).uuid),
  46432. this.bumpMap instanceof n.Texture && (r.bumpMap = this.bumpMap.toJSON(e).uuid,
  46433. r.bumpScale = this.bumpScale),
  46434. this.normalMap instanceof n.Texture && (r.normalMap = this.normalMap.toJSON(e).uuid,
  46435. r.normalScale = this.normalScale.toArray()),
  46436. this.displacementMap instanceof n.Texture && (r.displacementMap = this.displacementMap.toJSON(e).uuid,
  46437. r.displacementScale = this.displacementScale,
  46438. r.displacementBias = this.displacementBias),
  46439. this.roughnessMap instanceof n.Texture && (r.roughnessMap = this.roughnessMap.toJSON(e).uuid),
  46440. this.metalnessMap instanceof n.Texture && (r.metalnessMap = this.metalnessMap.toJSON(e).uuid),
  46441. this.emissiveMap instanceof n.Texture && (r.emissiveMap = this.emissiveMap.toJSON(e).uuid),
  46442. this.specularMap instanceof n.Texture && (r.specularMap = this.specularMap.toJSON(e).uuid),
  46443. this.envMap instanceof n.Texture && (r.envMap = this.envMap.toJSON(e).uuid,
  46444. r.reflectivity = this.reflectivity),
  46445. void 0 !== this.size && (r.size = this.size),
  46446. void 0 !== this.sizeAttenuation && (r.sizeAttenuation = this.sizeAttenuation),
  46447. void 0 !== this.vertexColors && this.vertexColors !== n.NoColors && (r.vertexColors = this.vertexColors),
  46448. void 0 !== this.shading && this.shading !== n.SmoothShading && (r.shading = this.shading),
  46449. void 0 !== this.blending && this.blending !== n.NormalBlending && (r.blending = this.blending),
  46450. void 0 !== this.side && this.side !== n.FrontSide && (r.side = this.side),
  46451. this.opacity < 1 && (r.opacity = this.opacity),
  46452. this.transparent === !0 && (r.transparent = this.transparent),
  46453. this.alphaTest > 0 && (r.alphaTest = this.alphaTest),
  46454. this.premultipliedAlpha === !0 && (r.premultipliedAlpha = this.premultipliedAlpha),
  46455. this.wireframe === !0 && (r.wireframe = this.wireframe),
  46456. this.wireframeLinewidth > 1 && (r.wireframeLinewidth = this.wireframeLinewidth),
  46457. i) {
  46458. var o = t(e.textures)
  46459. , a = t(e.images);
  46460. o.length > 0 && (r.textures = o),
  46461. a.length > 0 && (r.images = a)
  46462. }
  46463. return r
  46464. },
  46465. clone: function() {
  46466. return (new this.constructor).copy(this)
  46467. },
  46468. copy: function(e) {
  46469. return this.name = e.name,
  46470. this.side = e.side,
  46471. this.opacity = e.opacity,
  46472. this.transparent = e.transparent,
  46473. this.blending = e.blending,
  46474. this.blendSrc = e.blendSrc,
  46475. this.blendDst = e.blendDst,
  46476. this.blendEquation = e.blendEquation,
  46477. this.blendSrcAlpha = e.blendSrcAlpha,
  46478. this.blendDstAlpha = e.blendDstAlpha,
  46479. this.blendEquationAlpha = e.blendEquationAlpha,
  46480. this.depthFunc = e.depthFunc,
  46481. this.depthTest = e.depthTest,
  46482. this.depthWrite = e.depthWrite,
  46483. this.colorWrite = e.colorWrite,
  46484. this.precision = e.precision,
  46485. this.polygonOffset = e.polygonOffset,
  46486. this.polygonOffsetFactor = e.polygonOffsetFactor,
  46487. this.polygonOffsetUnits = e.polygonOffsetUnits,
  46488. this.alphaTest = e.alphaTest,
  46489. this.premultipliedAlpha = e.premultipliedAlpha,
  46490. this.overdraw = e.overdraw,
  46491. this.visible = e.visible,
  46492. this
  46493. },
  46494. update: function() {
  46495. this.dispatchEvent({
  46496. type: "update"
  46497. })
  46498. },
  46499. dispose: function() {
  46500. this.dispatchEvent({
  46501. type: "dispose"
  46502. })
  46503. }
  46504. },
  46505. n.EventDispatcher.prototype.apply(n.Material.prototype),
  46506. n.MaterialIdCount = 0,
  46507. n.LineBasicMaterial = function(e) {
  46508. n.Material.call(this),
  46509. this.type = "LineBasicMaterial",
  46510. this.color = new n.Color(16777215),
  46511. this.linewidth = 1,
  46512. this.linecap = "round",
  46513. this.linejoin = "round",
  46514. this.blending = n.NormalBlending,
  46515. this.vertexColors = n.NoColors,
  46516. this.fog = !0,
  46517. this.setValues(e)
  46518. }
  46519. ,
  46520. n.LineBasicMaterial.prototype = Object.create(n.Material.prototype),
  46521. n.LineBasicMaterial.prototype.constructor = n.LineBasicMaterial,
  46522. n.LineBasicMaterial.prototype.copy = function(e) {
  46523. return n.Material.prototype.copy.call(this, e),
  46524. this.color.copy(e.color),
  46525. this.linewidth = e.linewidth,
  46526. this.linecap = e.linecap,
  46527. this.linejoin = e.linejoin,
  46528. this.vertexColors = e.vertexColors,
  46529. this.fog = e.fog,
  46530. this
  46531. }
  46532. ,
  46533. n.LineDashedMaterial = function(e) {
  46534. n.Material.call(this),
  46535. this.type = "LineDashedMaterial",
  46536. this.color = new n.Color(16777215),
  46537. this.linewidth = 1,
  46538. this.scale = 1,
  46539. this.dashSize = 3,
  46540. this.gapSize = 1,
  46541. this.blending = n.NormalBlending,
  46542. this.vertexColors = n.NoColors,
  46543. this.fog = !0,
  46544. this.setValues(e)
  46545. }
  46546. ,
  46547. n.LineDashedMaterial.prototype = Object.create(n.Material.prototype),
  46548. n.LineDashedMaterial.prototype.constructor = n.LineDashedMaterial,
  46549. n.LineDashedMaterial.prototype.copy = function(e) {
  46550. return n.Material.prototype.copy.call(this, e),
  46551. this.color.copy(e.color),
  46552. this.linewidth = e.linewidth,
  46553. this.scale = e.scale,
  46554. this.dashSize = e.dashSize,
  46555. this.gapSize = e.gapSize,
  46556. this.vertexColors = e.vertexColors,
  46557. this.fog = e.fog,
  46558. this
  46559. }
  46560. ,
  46561. n.MeshBasicMaterial = function(e) {
  46562. n.Material.call(this),
  46563. this.type = "MeshBasicMaterial",
  46564. this.color = new n.Color(16777215),
  46565. this.map = null,
  46566. this.aoMap = null,
  46567. this.aoMapIntensity = 1,
  46568. this.specularMap = null,
  46569. this.alphaMap = null,
  46570. this.envMap = null,
  46571. this.combine = n.MultiplyOperation,
  46572. this.reflectivity = 1,
  46573. this.refractionRatio = .98,
  46574. this.fog = !0,
  46575. this.shading = n.SmoothShading,
  46576. this.blending = n.NormalBlending,
  46577. this.wireframe = !1,
  46578. this.wireframeLinewidth = 1,
  46579. this.wireframeLinecap = "round",
  46580. this.wireframeLinejoin = "round",
  46581. this.vertexColors = n.NoColors,
  46582. this.skinning = !1,
  46583. this.morphTargets = !1,
  46584. this.setValues(e)
  46585. }
  46586. ,
  46587. n.MeshBasicMaterial.prototype = Object.create(n.Material.prototype),
  46588. n.MeshBasicMaterial.prototype.constructor = n.MeshBasicMaterial,
  46589. n.MeshBasicMaterial.prototype.copy = function(e) {
  46590. return n.Material.prototype.copy.call(this, e),
  46591. this.color.copy(e.color),
  46592. this.map = e.map,
  46593. this.aoMap = e.aoMap,
  46594. this.aoMapIntensity = e.aoMapIntensity,
  46595. this.specularMap = e.specularMap,
  46596. this.alphaMap = e.alphaMap,
  46597. this.envMap = e.envMap,
  46598. this.combine = e.combine,
  46599. this.reflectivity = e.reflectivity,
  46600. this.refractionRatio = e.refractionRatio,
  46601. this.fog = e.fog,
  46602. this.shading = e.shading,
  46603. this.wireframe = e.wireframe,
  46604. this.wireframeLinewidth = e.wireframeLinewidth,
  46605. this.wireframeLinecap = e.wireframeLinecap,
  46606. this.wireframeLinejoin = e.wireframeLinejoin,
  46607. this.vertexColors = e.vertexColors,
  46608. this.skinning = e.skinning,
  46609. this.morphTargets = e.morphTargets,
  46610. this
  46611. }
  46612. ,
  46613. n.MeshLambertMaterial = function(e) {
  46614. n.Material.call(this),
  46615. this.type = "MeshLambertMaterial",
  46616. this.color = new n.Color(16777215),
  46617. this.map = null,
  46618. this.lightMap = null,
  46619. this.lightMapIntensity = 1,
  46620. this.aoMap = null,
  46621. this.aoMapIntensity = 1,
  46622. this.emissive = new n.Color(0),
  46623. this.emissiveIntensity = 1,
  46624. this.emissiveMap = null,
  46625. this.specularMap = null,
  46626. this.alphaMap = null,
  46627. this.envMap = null,
  46628. this.combine = n.MultiplyOperation,
  46629. this.reflectivity = 1,
  46630. this.refractionRatio = .98,
  46631. this.fog = !0,
  46632. this.blending = n.NormalBlending,
  46633. this.wireframe = !1,
  46634. this.wireframeLinewidth = 1,
  46635. this.wireframeLinecap = "round",
  46636. this.wireframeLinejoin = "round",
  46637. this.vertexColors = n.NoColors,
  46638. this.skinning = !1,
  46639. this.morphTargets = !1,
  46640. this.morphNormals = !1,
  46641. this.setValues(e)
  46642. }
  46643. ,
  46644. n.MeshLambertMaterial.prototype = Object.create(n.Material.prototype),
  46645. n.MeshLambertMaterial.prototype.constructor = n.MeshLambertMaterial,
  46646. n.MeshLambertMaterial.prototype.copy = function(e) {
  46647. return n.Material.prototype.copy.call(this, e),
  46648. this.color.copy(e.color),
  46649. this.map = e.map,
  46650. this.lightMap = e.lightMap,
  46651. this.lightMapIntensity = e.lightMapIntensity,
  46652. this.aoMap = e.aoMap,
  46653. this.aoMapIntensity = e.aoMapIntensity,
  46654. this.emissive.copy(e.emissive),
  46655. this.emissiveMap = e.emissiveMap,
  46656. this.emissiveIntensity = e.emissiveIntensity,
  46657. this.specularMap = e.specularMap,
  46658. this.alphaMap = e.alphaMap,
  46659. this.envMap = e.envMap,
  46660. this.combine = e.combine,
  46661. this.reflectivity = e.reflectivity,
  46662. this.refractionRatio = e.refractionRatio,
  46663. this.fog = e.fog,
  46664. this.wireframe = e.wireframe,
  46665. this.wireframeLinewidth = e.wireframeLinewidth,
  46666. this.wireframeLinecap = e.wireframeLinecap,
  46667. this.wireframeLinejoin = e.wireframeLinejoin,
  46668. this.vertexColors = e.vertexColors,
  46669. this.skinning = e.skinning,
  46670. this.morphTargets = e.morphTargets,
  46671. this.morphNormals = e.morphNormals,
  46672. this
  46673. }
  46674. ,
  46675. n.MeshPhongMaterial = function(e) {
  46676. n.Material.call(this),
  46677. this.type = "MeshPhongMaterial",
  46678. this.color = new n.Color(16777215),
  46679. this.specular = new n.Color(1118481),
  46680. this.shininess = 30,
  46681. this.map = null,
  46682. this.lightMap = null,
  46683. this.lightMapIntensity = 1,
  46684. this.aoMap = null,
  46685. this.aoMapIntensity = 1,
  46686. this.emissive = new n.Color(0),
  46687. this.emissiveIntensity = 1,
  46688. this.emissiveMap = null,
  46689. this.bumpMap = null,
  46690. this.bumpScale = 1,
  46691. this.normalMap = null,
  46692. this.normalScale = new n.Vector2(1,1),
  46693. this.displacementMap = null,
  46694. this.displacementScale = 1,
  46695. this.displacementBias = 0,
  46696. this.specularMap = null,
  46697. this.alphaMap = null,
  46698. this.envMap = null,
  46699. this.combine = n.MultiplyOperation,
  46700. this.reflectivity = 1,
  46701. this.refractionRatio = .98,
  46702. this.fog = !0,
  46703. this.shading = n.SmoothShading,
  46704. this.blending = n.NormalBlending,
  46705. this.wireframe = !1,
  46706. this.wireframeLinewidth = 1,
  46707. this.wireframeLinecap = "round",
  46708. this.wireframeLinejoin = "round",
  46709. this.vertexColors = n.NoColors,
  46710. this.skinning = !1,
  46711. this.morphTargets = !1,
  46712. this.morphNormals = !1,
  46713. this.setValues(e)
  46714. }
  46715. ,
  46716. n.MeshPhongMaterial.prototype = Object.create(n.Material.prototype),
  46717. n.MeshPhongMaterial.prototype.constructor = n.MeshPhongMaterial,
  46718. n.MeshPhongMaterial.prototype.copy = function(e) {
  46719. return n.Material.prototype.copy.call(this, e),
  46720. this.color.copy(e.color),
  46721. this.specular.copy(e.specular),
  46722. this.shininess = e.shininess,
  46723. this.map = e.map,
  46724. this.lightMap = e.lightMap,
  46725. this.lightMapIntensity = e.lightMapIntensity,
  46726. this.aoMap = e.aoMap,
  46727. this.aoMapIntensity = e.aoMapIntensity,
  46728. this.emissive.copy(e.emissive),
  46729. this.emissiveMap = e.emissiveMap,
  46730. this.emissiveIntensity = e.emissiveIntensity,
  46731. this.bumpMap = e.bumpMap,
  46732. this.bumpScale = e.bumpScale,
  46733. this.normalMap = e.normalMap,
  46734. this.normalScale.copy(e.normalScale),
  46735. this.displacementMap = e.displacementMap,
  46736. this.displacementScale = e.displacementScale,
  46737. this.displacementBias = e.displacementBias,
  46738. this.specularMap = e.specularMap,
  46739. this.alphaMap = e.alphaMap,
  46740. this.envMap = e.envMap,
  46741. this.combine = e.combine,
  46742. this.reflectivity = e.reflectivity,
  46743. this.refractionRatio = e.refractionRatio,
  46744. this.fog = e.fog,
  46745. this.shading = e.shading,
  46746. this.wireframe = e.wireframe,
  46747. this.wireframeLinewidth = e.wireframeLinewidth,
  46748. this.wireframeLinecap = e.wireframeLinecap,
  46749. this.wireframeLinejoin = e.wireframeLinejoin,
  46750. this.vertexColors = e.vertexColors,
  46751. this.skinning = e.skinning,
  46752. this.morphTargets = e.morphTargets,
  46753. this.morphNormals = e.morphNormals,
  46754. this
  46755. }
  46756. ,
  46757. n.MeshStandardMaterial = function(e) {
  46758. n.Material.call(this),
  46759. this.type = "MeshStandardMaterial",
  46760. this.color = new n.Color(16777215),
  46761. this.roughness = .5,
  46762. this.metalness = .5,
  46763. this.map = null,
  46764. this.lightMap = null,
  46765. this.lightMapIntensity = 1,
  46766. this.aoMap = null,
  46767. this.aoMapIntensity = 1,
  46768. this.emissive = new n.Color(0),
  46769. this.emissiveIntensity = 1,
  46770. this.emissiveMap = null,
  46771. this.bumpMap = null,
  46772. this.bumpScale = 1,
  46773. this.normalMap = null,
  46774. this.normalScale = new n.Vector2(1,1),
  46775. this.displacementMap = null,
  46776. this.displacementScale = 1,
  46777. this.displacementBias = 0,
  46778. this.roughnessMap = null,
  46779. this.metalnessMap = null,
  46780. this.alphaMap = null,
  46781. this.envMap = null,
  46782. this.envMapIntensity = 1,
  46783. this.refractionRatio = .98,
  46784. this.fog = !0,
  46785. this.shading = n.SmoothShading,
  46786. this.blending = n.NormalBlending,
  46787. this.wireframe = !1,
  46788. this.wireframeLinewidth = 1,
  46789. this.wireframeLinecap = "round",
  46790. this.wireframeLinejoin = "round",
  46791. this.vertexColors = n.NoColors,
  46792. this.skinning = !1,
  46793. this.morphTargets = !1,
  46794. this.morphNormals = !1,
  46795. this.setValues(e)
  46796. }
  46797. ,
  46798. n.MeshStandardMaterial.prototype = Object.create(n.Material.prototype),
  46799. n.MeshStandardMaterial.prototype.constructor = n.MeshStandardMaterial,
  46800. n.MeshStandardMaterial.prototype.copy = function(e) {
  46801. return n.Material.prototype.copy.call(this, e),
  46802. this.color.copy(e.color),
  46803. this.roughness = e.roughness,
  46804. this.metalness = e.metalness,
  46805. this.map = e.map,
  46806. this.lightMap = e.lightMap,
  46807. this.lightMapIntensity = e.lightMapIntensity,
  46808. this.aoMap = e.aoMap,
  46809. this.aoMapIntensity = e.aoMapIntensity,
  46810. this.emissive.copy(e.emissive),
  46811. this.emissiveMap = e.emissiveMap,
  46812. this.emissiveIntensity = e.emissiveIntensity,
  46813. this.bumpMap = e.bumpMap,
  46814. this.bumpScale = e.bumpScale,
  46815. this.normalMap = e.normalMap,
  46816. this.normalScale.copy(e.normalScale),
  46817. this.displacementMap = e.displacementMap,
  46818. this.displacementScale = e.displacementScale,
  46819. this.displacementBias = e.displacementBias,
  46820. this.roughnessMap = e.roughnessMap,
  46821. this.metalnessMap = e.metalnessMap,
  46822. this.alphaMap = e.alphaMap,
  46823. this.envMap = e.envMap,
  46824. this.envMapIntensity = e.envMapIntensity,
  46825. this.refractionRatio = e.refractionRatio,
  46826. this.fog = e.fog,
  46827. this.shading = e.shading,
  46828. this.wireframe = e.wireframe,
  46829. this.wireframeLinewidth = e.wireframeLinewidth,
  46830. this.wireframeLinecap = e.wireframeLinecap,
  46831. this.wireframeLinejoin = e.wireframeLinejoin,
  46832. this.vertexColors = e.vertexColors,
  46833. this.skinning = e.skinning,
  46834. this.morphTargets = e.morphTargets,
  46835. this.morphNormals = e.morphNormals,
  46836. this
  46837. }
  46838. ,
  46839. n.MeshDepthMaterial = function(e) {
  46840. n.Material.call(this),
  46841. this.type = "MeshDepthMaterial",
  46842. this.morphTargets = !1,
  46843. this.wireframe = !1,
  46844. this.wireframeLinewidth = 1,
  46845. this.setValues(e)
  46846. }
  46847. ,
  46848. n.MeshDepthMaterial.prototype = Object.create(n.Material.prototype),
  46849. n.MeshDepthMaterial.prototype.constructor = n.MeshDepthMaterial,
  46850. n.MeshDepthMaterial.prototype.copy = function(e) {
  46851. return n.Material.prototype.copy.call(this, e),
  46852. this.wireframe = e.wireframe,
  46853. this.wireframeLinewidth = e.wireframeLinewidth,
  46854. this
  46855. }
  46856. ,
  46857. n.MeshNormalMaterial = function(e) {
  46858. n.Material.call(this, e),
  46859. this.type = "MeshNormalMaterial",
  46860. this.wireframe = !1,
  46861. this.wireframeLinewidth = 1,
  46862. this.morphTargets = !1,
  46863. this.setValues(e)
  46864. }
  46865. ,
  46866. n.MeshNormalMaterial.prototype = Object.create(n.Material.prototype),
  46867. n.MeshNormalMaterial.prototype.constructor = n.MeshNormalMaterial,
  46868. n.MeshNormalMaterial.prototype.copy = function(e) {
  46869. return n.Material.prototype.copy.call(this, e),
  46870. this.wireframe = e.wireframe,
  46871. this.wireframeLinewidth = e.wireframeLinewidth,
  46872. this
  46873. }
  46874. ,
  46875. n.MultiMaterial = function(e) {
  46876. this.uuid = n.Math.generateUUID(),
  46877. this.type = "MultiMaterial",
  46878. this.materials = e instanceof Array ? e : [],
  46879. this.visible = !0
  46880. }
  46881. ,
  46882. n.MultiMaterial.prototype = {
  46883. constructor: n.MultiMaterial,
  46884. toJSON: function(e) {
  46885. for (var t = {
  46886. metadata: {
  46887. version: 4.2,
  46888. type: "material",
  46889. generator: "MaterialExporter"
  46890. },
  46891. uuid: this.uuid,
  46892. type: this.type,
  46893. materials: []
  46894. }, i = this.materials, n = 0, r = i.length; n < r; n++) {
  46895. var o = i[n].toJSON(e);
  46896. delete o.metadata,
  46897. t.materials.push(o)
  46898. }
  46899. return t.visible = this.visible,
  46900. t
  46901. },
  46902. clone: function() {
  46903. for (var e = new this.constructor, t = 0; t < this.materials.length; t++)
  46904. e.materials.push(this.materials[t].clone());
  46905. return e.visible = this.visible,
  46906. e
  46907. }
  46908. },
  46909. n.PointsMaterial = function(e) {
  46910. n.Material.call(this),
  46911. this.type = "PointsMaterial",
  46912. this.color = new n.Color(16777215),
  46913. this.map = null,
  46914. this.size = 1,
  46915. this.sizeAttenuation = !0,
  46916. this.blending = n.NormalBlending,
  46917. this.vertexColors = n.NoColors,
  46918. this.fog = !0,
  46919. this.setValues(e)
  46920. }
  46921. ,
  46922. n.PointsMaterial.prototype = Object.create(n.Material.prototype),
  46923. n.PointsMaterial.prototype.constructor = n.PointsMaterial,
  46924. n.PointsMaterial.prototype.copy = function(e) {
  46925. return n.Material.prototype.copy.call(this, e),
  46926. this.color.copy(e.color),
  46927. this.map = e.map,
  46928. this.size = e.size,
  46929. this.sizeAttenuation = e.sizeAttenuation,
  46930. this.vertexColors = e.vertexColors,
  46931. this.fog = e.fog,
  46932. this
  46933. }
  46934. ,
  46935. n.ShaderMaterial = function(e) {
  46936. n.Material.call(this),
  46937. this.type = "ShaderMaterial",
  46938. this.defines = {},
  46939. this.uniforms = {},
  46940. this.vertexShader = "void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",
  46941. this.fragmentShader = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",
  46942. this.shading = n.SmoothShading,
  46943. this.linewidth = 1,
  46944. this.wireframe = !1,
  46945. this.wireframeLinewidth = 1,
  46946. this.fog = !1,
  46947. this.lights = !1,
  46948. this.vertexColors = n.NoColors,
  46949. this.skinning = !1,
  46950. this.morphTargets = !1,
  46951. this.morphNormals = !1,
  46952. this.extensions = {
  46953. derivatives: !1,
  46954. fragDepth: !1,
  46955. drawBuffers: !1,
  46956. shaderTextureLOD: !1
  46957. },
  46958. this.defaultAttributeValues = {
  46959. color: [1, 1, 1],
  46960. uv: [0, 0],
  46961. uv2: [0, 0]
  46962. },
  46963. this.index0AttributeName = void 0,
  46964. void 0 !== e && (void 0 !== e.attributes && console.error("THREE.ShaderMaterial: attributes should now be defined in THREE.BufferGeometry instead."),
  46965. this.setValues(e))
  46966. }
  46967. ,
  46968. n.ShaderMaterial.prototype = Object.create(n.Material.prototype),
  46969. n.ShaderMaterial.prototype.constructor = n.ShaderMaterial,
  46970. n.ShaderMaterial.prototype.copy = function(e) {
  46971. return n.Material.prototype.copy.call(this, e),
  46972. this.fragmentShader = e.fragmentShader,
  46973. this.vertexShader = e.vertexShader,
  46974. this.uniforms = n.UniformsUtils.clone(e.uniforms),
  46975. this.defines = e.defines,
  46976. this.shading = e.shading,
  46977. this.wireframe = e.wireframe,
  46978. this.wireframeLinewidth = e.wireframeLinewidth,
  46979. this.fog = e.fog,
  46980. this.lights = e.lights,
  46981. this.vertexColors = e.vertexColors,
  46982. this.skinning = e.skinning,
  46983. this.morphTargets = e.morphTargets,
  46984. this.morphNormals = e.morphNormals,
  46985. this.extensions = e.extensions,
  46986. this
  46987. }
  46988. ,
  46989. n.ShaderMaterial.prototype.toJSON = function(e) {
  46990. var t = n.Material.prototype.toJSON.call(this, e);
  46991. return t.uniforms = this.uniforms,
  46992. t.vertexShader = this.vertexShader,
  46993. t.fragmentShader = this.fragmentShader,
  46994. t
  46995. }
  46996. ,
  46997. n.RawShaderMaterial = function(e) {
  46998. n.ShaderMaterial.call(this, e),
  46999. this.type = "RawShaderMaterial"
  47000. }
  47001. ,
  47002. n.RawShaderMaterial.prototype = Object.create(n.ShaderMaterial.prototype),
  47003. n.RawShaderMaterial.prototype.constructor = n.RawShaderMaterial,
  47004. n.SpriteMaterial = function(e) {
  47005. n.Material.call(this),
  47006. this.type = "SpriteMaterial",
  47007. this.color = new n.Color(16777215),
  47008. this.map = null,
  47009. this.rotation = 0,
  47010. this.fog = !1,
  47011. this.setValues(e)
  47012. }
  47013. ,
  47014. n.SpriteMaterial.prototype = Object.create(n.Material.prototype),
  47015. n.SpriteMaterial.prototype.constructor = n.SpriteMaterial,
  47016. n.SpriteMaterial.prototype.copy = function(e) {
  47017. return n.Material.prototype.copy.call(this, e),
  47018. this.color.copy(e.color),
  47019. this.map = e.map,
  47020. this.rotation = e.rotation,
  47021. this.fog = e.fog,
  47022. this
  47023. }
  47024. ,
  47025. n.Texture = function(e, t, i, r, o, a, s, l, c) {
  47026. Object.defineProperty(this, "id", {
  47027. value: n.TextureIdCount++
  47028. }),
  47029. this.uuid = n.Math.generateUUID(),
  47030. this.name = "",
  47031. this.sourceFile = "",
  47032. this.image = void 0 !== e ? e : n.Texture.DEFAULT_IMAGE,
  47033. this.mipmaps = [],
  47034. this.mapping = void 0 !== t ? t : n.Texture.DEFAULT_MAPPING,
  47035. this.wrapS = void 0 !== i ? i : n.ClampToEdgeWrapping,
  47036. this.wrapT = void 0 !== r ? r : n.ClampToEdgeWrapping,
  47037. this.magFilter = void 0 !== o ? o : n.LinearFilter,
  47038. this.minFilter = void 0 !== a ? a : n.LinearMipMapLinearFilter,
  47039. this.anisotropy = void 0 !== c ? c : 1,
  47040. this.format = void 0 !== s ? s : n.RGBAFormat,
  47041. this.type = void 0 !== l ? l : n.UnsignedByteType,
  47042. this.offset = new n.Vector2(0,0),
  47043. this.repeat = new n.Vector2(1,1),
  47044. this.generateMipmaps = !0,
  47045. this.premultiplyAlpha = !1,
  47046. this.flipY = !0,
  47047. this.unpackAlignment = 4,
  47048. this.encoding = n.LinearEncoding,
  47049. this.version = 0,
  47050. this.onUpdate = null
  47051. }
  47052. ,
  47053. n.Texture.DEFAULT_IMAGE = void 0,
  47054. n.Texture.DEFAULT_MAPPING = n.UVMapping,
  47055. n.Texture.prototype = {
  47056. constructor: n.Texture,
  47057. set needsUpdate(e) {
  47058. e === !0 && this.version++
  47059. },
  47060. clone: function() {
  47061. return (new this.constructor).copy(this)
  47062. },
  47063. copy: function(e) {
  47064. return this.image = e.image,
  47065. this.mipmaps = e.mipmaps.slice(0),
  47066. this.mapping = e.mapping,
  47067. this.wrapS = e.wrapS,
  47068. this.wrapT = e.wrapT,
  47069. this.magFilter = e.magFilter,
  47070. this.minFilter = e.minFilter,
  47071. this.anisotropy = e.anisotropy,
  47072. this.format = e.format,
  47073. this.type = e.type,
  47074. this.offset.copy(e.offset),
  47075. this.repeat.copy(e.repeat),
  47076. this.generateMipmaps = e.generateMipmaps,
  47077. this.premultiplyAlpha = e.premultiplyAlpha,
  47078. this.flipY = e.flipY,
  47079. this.unpackAlignment = e.unpackAlignment,
  47080. this.encoding = e.encoding,
  47081. this
  47082. },
  47083. toJSON: function(e) {
  47084. function t(e) {
  47085. var t;
  47086. return void 0 !== e.toDataURL ? t = e : (t = document.createElement("canvas"),
  47087. t.width = e.width,
  47088. t.height = e.height,
  47089. t.getContext("2d").drawImage(e, 0, 0, e.width, e.height)),
  47090. t.width > 2048 || t.height > 2048 ? t.toDataURL("image/jpeg", .6) : t.toDataURL("image/png")
  47091. }
  47092. if (void 0 !== e.textures[this.uuid])
  47093. return e.textures[this.uuid];
  47094. var i = {
  47095. metadata: {
  47096. version: 4.4,
  47097. type: "Texture",
  47098. generator: "Texture.toJSON"
  47099. },
  47100. uuid: this.uuid,
  47101. name: this.name,
  47102. mapping: this.mapping,
  47103. repeat: [this.repeat.x, this.repeat.y],
  47104. offset: [this.offset.x, this.offset.y],
  47105. wrap: [this.wrapS, this.wrapT],
  47106. minFilter: this.minFilter,
  47107. magFilter: this.magFilter,
  47108. anisotropy: this.anisotropy
  47109. };
  47110. if (void 0 !== this.image) {
  47111. var r = this.image;
  47112. void 0 === r.uuid && (r.uuid = n.Math.generateUUID()),
  47113. void 0 === e.images[r.uuid] && (e.images[r.uuid] = {
  47114. uuid: r.uuid,
  47115. url: t(r)
  47116. }),
  47117. i.image = r.uuid
  47118. }
  47119. return e.textures[this.uuid] = i,
  47120. i
  47121. },
  47122. dispose: function() {
  47123. this.dispatchEvent({
  47124. type: "dispose"
  47125. })
  47126. },
  47127. transformUv: function(e) {
  47128. if (this.mapping === n.UVMapping) {
  47129. if (e.multiply(this.repeat),
  47130. e.add(this.offset),
  47131. e.x < 0 || e.x > 1)
  47132. switch (this.wrapS) {
  47133. case n.RepeatWrapping:
  47134. e.x = e.x - Math.floor(e.x);
  47135. break;
  47136. case n.ClampToEdgeWrapping:
  47137. e.x = e.x < 0 ? 0 : 1;
  47138. break;
  47139. case n.MirroredRepeatWrapping:
  47140. 1 === Math.abs(Math.floor(e.x) % 2) ? e.x = Math.ceil(e.x) - e.x : e.x = e.x - Math.floor(e.x)
  47141. }
  47142. if (e.y < 0 || e.y > 1)
  47143. switch (this.wrapT) {
  47144. case n.RepeatWrapping:
  47145. e.y = e.y - Math.floor(e.y);
  47146. break;
  47147. case n.ClampToEdgeWrapping:
  47148. e.y = e.y < 0 ? 0 : 1;
  47149. break;
  47150. case n.MirroredRepeatWrapping:
  47151. 1 === Math.abs(Math.floor(e.y) % 2) ? e.y = Math.ceil(e.y) - e.y : e.y = e.y - Math.floor(e.y)
  47152. }
  47153. this.flipY && (e.y = 1 - e.y)
  47154. }
  47155. }
  47156. },
  47157. n.EventDispatcher.prototype.apply(n.Texture.prototype),
  47158. n.TextureIdCount = 0,
  47159. n.CanvasTexture = function(e, t, i, r, o, a, s, l, c) {
  47160. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47161. this.needsUpdate = !0
  47162. }
  47163. ,
  47164. n.CanvasTexture.prototype = Object.create(n.Texture.prototype),
  47165. n.CanvasTexture.prototype.constructor = n.CanvasTexture,
  47166. n.CubeTexture = function(e, t, i, r, o, a, s, l, c) {
  47167. e = void 0 !== e ? e : [],
  47168. t = void 0 !== t ? t : n.CubeReflectionMapping,
  47169. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47170. this.flipY = !1
  47171. }
  47172. ,
  47173. n.CubeTexture.prototype = Object.create(n.Texture.prototype),
  47174. n.CubeTexture.prototype.constructor = n.CubeTexture,
  47175. Object.defineProperty(n.CubeTexture.prototype, "images", {
  47176. get: function() {
  47177. return this.image
  47178. },
  47179. set: function(e) {
  47180. this.image = e
  47181. }
  47182. }),
  47183. n.CompressedTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47184. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47185. this.image = {
  47186. width: t,
  47187. height: i
  47188. },
  47189. this.mipmaps = e,
  47190. this.flipY = !1,
  47191. this.generateMipmaps = !1
  47192. }
  47193. ,
  47194. n.CompressedTexture.prototype = Object.create(n.Texture.prototype),
  47195. n.CompressedTexture.prototype.constructor = n.CompressedTexture,
  47196. n.DataTexture = function(e, t, i, r, o, a, s, l, c, h, u) {
  47197. n.Texture.call(this, null, a, s, l, c, h, r, o, u),
  47198. this.image = {
  47199. data: e,
  47200. width: t,
  47201. height: i
  47202. },
  47203. this.magFilter = void 0 !== c ? c : n.NearestFilter,
  47204. this.minFilter = void 0 !== h ? h : n.NearestFilter,
  47205. this.flipY = !1,
  47206. this.generateMipmaps = !1
  47207. }
  47208. ,
  47209. n.DataTexture.prototype = Object.create(n.Texture.prototype),
  47210. n.DataTexture.prototype.constructor = n.DataTexture,
  47211. n.VideoTexture = function(e, t, i, r, o, a, s, l, c) {
  47212. function h() {
  47213. requestAnimationFrame(h),
  47214. e.readyState === e.HAVE_ENOUGH_DATA && (u.needsUpdate = !0)
  47215. }
  47216. n.Texture.call(this, e, t, i, r, o, a, s, l, c),
  47217. this.generateMipmaps = !1;
  47218. var u = this;
  47219. h()
  47220. }
  47221. ,
  47222. n.VideoTexture.prototype = Object.create(n.Texture.prototype),
  47223. n.VideoTexture.prototype.constructor = n.VideoTexture,
  47224. n.Group = function() {
  47225. n.Object3D.call(this),
  47226. this.type = "Group"
  47227. }
  47228. ,
  47229. n.Group.prototype = Object.create(n.Object3D.prototype),
  47230. n.Group.prototype.constructor = n.Group,
  47231. n.Points = function(e, t) {
  47232. n.Object3D.call(this),
  47233. this.type = "Points",
  47234. this.geometry = void 0 !== e ? e : new n.Geometry,
  47235. this.material = void 0 !== t ? t : new n.PointsMaterial({
  47236. color: 16777215 * Math.random()
  47237. })
  47238. }
  47239. ,
  47240. n.Points.prototype = Object.create(n.Object3D.prototype),
  47241. n.Points.prototype.constructor = n.Points,
  47242. n.Points.prototype.raycast = function() {
  47243. var e = new n.Matrix4
  47244. , t = new n.Ray
  47245. , i = new n.Sphere;
  47246. return function(r, o) {
  47247. function a(e, i) {
  47248. var n = t.distanceSqToPoint(e);
  47249. if (n < d) {
  47250. var a = t.closestPointToPoint(e);
  47251. a.applyMatrix4(c);
  47252. var l = r.ray.origin.distanceTo(a);
  47253. if (l < r.near || l > r.far)
  47254. return;
  47255. o.push({
  47256. distance: l,
  47257. distanceToRay: Math.sqrt(n),
  47258. point: a.clone(),
  47259. index: i,
  47260. face: null,
  47261. object: s
  47262. })
  47263. }
  47264. }
  47265. var s = this
  47266. , l = this.geometry
  47267. , c = this.matrixWorld
  47268. , h = r.params.Points.threshold;
  47269. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47270. i.copy(l.boundingSphere),
  47271. i.applyMatrix4(c),
  47272. r.ray.intersectsSphere(i) !== !1) {
  47273. e.getInverse(c),
  47274. t.copy(r.ray).applyMatrix4(e);
  47275. var u = h / ((this.scale.x + this.scale.y + this.scale.z) / 3)
  47276. , d = u * u
  47277. , p = new n.Vector3;
  47278. if (l instanceof n.BufferGeometry) {
  47279. var f = l.index
  47280. , g = l.attributes
  47281. , m = g.position.array;
  47282. if (null !== f)
  47283. for (var v = f.array, A = 0, y = v.length; A < y; A++) {
  47284. var C = v[A];
  47285. p.fromArray(m, 3 * C),
  47286. a(p, C)
  47287. }
  47288. else
  47289. for (var A = 0, I = m.length / 3; A < I; A++)
  47290. p.fromArray(m, 3 * A),
  47291. a(p, A)
  47292. } else
  47293. for (var E = l.vertices, A = 0, I = E.length; A < I; A++)
  47294. a(E[A], A)
  47295. }
  47296. }
  47297. }(),
  47298. n.Points.prototype.clone = function() {
  47299. return new this.constructor(this.geometry,this.material).copy(this)
  47300. }
  47301. ,
  47302. n.Line = function(e, t, i) {
  47303. return 1 === i ? (console.warn("THREE.Line: parameter THREE.LinePieces no longer supported. Created THREE.LineSegments instead."),
  47304. new n.LineSegments(e,t)) : (n.Object3D.call(this),
  47305. this.type = "Line",
  47306. this.geometry = void 0 !== e ? e : new n.Geometry,
  47307. void (this.material = void 0 !== t ? t : new n.LineBasicMaterial({
  47308. color: 16777215 * Math.random()
  47309. })))
  47310. }
  47311. ,
  47312. n.Line.prototype = Object.create(n.Object3D.prototype),
  47313. n.Line.prototype.constructor = n.Line,
  47314. n.Line.prototype.raycast = function() {
  47315. var e = new n.Matrix4
  47316. , t = new n.Ray
  47317. , i = new n.Sphere;
  47318. return function(r, o) {
  47319. var a = r.linePrecision
  47320. , s = a * a
  47321. , l = this.geometry
  47322. , c = this.matrixWorld;
  47323. if (null === l.boundingSphere && l.computeBoundingSphere(),
  47324. i.copy(l.boundingSphere),
  47325. i.applyMatrix4(c),
  47326. r.ray.intersectsSphere(i) !== !1) {
  47327. e.getInverse(c),
  47328. t.copy(r.ray).applyMatrix4(e);
  47329. var h = new n.Vector3
  47330. , u = new n.Vector3
  47331. , d = new n.Vector3
  47332. , p = new n.Vector3
  47333. , f = this instanceof n.LineSegments ? 2 : 1;
  47334. if (l instanceof n.BufferGeometry) {
  47335. var g = l.index
  47336. , m = l.attributes
  47337. , v = m.position.array;
  47338. if (null !== g)
  47339. for (var A = g.array, y = 0, C = A.length - 1; y < C; y += f) {
  47340. var I = A[y]
  47341. , E = A[y + 1];
  47342. h.fromArray(v, 3 * I),
  47343. u.fromArray(v, 3 * E);
  47344. var b = t.distanceSqToSegment(h, u, p, d);
  47345. if (!(b > s)) {
  47346. p.applyMatrix4(this.matrixWorld);
  47347. var w = r.ray.origin.distanceTo(p);
  47348. w < r.near || w > r.far || o.push({
  47349. distance: w,
  47350. point: d.clone().applyMatrix4(this.matrixWorld),
  47351. index: y,
  47352. face: null,
  47353. faceIndex: null,
  47354. object: this
  47355. })
  47356. }
  47357. }
  47358. else
  47359. for (var y = 0, C = v.length / 3 - 1; y < C; y += f) {
  47360. h.fromArray(v, 3 * y),
  47361. u.fromArray(v, 3 * y + 3);
  47362. var b = t.distanceSqToSegment(h, u, p, d);
  47363. if (!(b > s)) {
  47364. p.applyMatrix4(this.matrixWorld);
  47365. var w = r.ray.origin.distanceTo(p);
  47366. w < r.near || w > r.far || o.push({
  47367. distance: w,
  47368. point: d.clone().applyMatrix4(this.matrixWorld),
  47369. index: y,
  47370. face: null,
  47371. faceIndex: null,
  47372. object: this
  47373. })
  47374. }
  47375. }
  47376. } else if (l instanceof n.Geometry)
  47377. for (var _ = l.vertices, T = _.length, y = 0; y < T - 1; y += f) {
  47378. var b = t.distanceSqToSegment(_[y], _[y + 1], p, d);
  47379. if (!(b > s)) {
  47380. p.applyMatrix4(this.matrixWorld);
  47381. var w = r.ray.origin.distanceTo(p);
  47382. w < r.near || w > r.far || o.push({
  47383. distance: w,
  47384. point: d.clone().applyMatrix4(this.matrixWorld),
  47385. index: y,
  47386. face: null,
  47387. faceIndex: null,
  47388. object: this
  47389. })
  47390. }
  47391. }
  47392. }
  47393. }
  47394. }(),
  47395. n.Line.prototype.clone = function() {
  47396. return new this.constructor(this.geometry,this.material).copy(this)
  47397. }
  47398. ,
  47399. n.LineStrip = 0,
  47400. n.LinePieces = 1,
  47401. n.LineSegments = function(e, t) {
  47402. n.Line.call(this, e, t),
  47403. this.type = "LineSegments"
  47404. }
  47405. ,
  47406. n.LineSegments.prototype = Object.create(n.Line.prototype),
  47407. n.LineSegments.prototype.constructor = n.LineSegments,
  47408. n.Mesh = function(e, t) {
  47409. n.Object3D.call(this),
  47410. this.type = "Mesh",
  47411. this.geometry = void 0 !== e ? e : new n.Geometry,
  47412. this.material = void 0 !== t ? t : new n.MeshBasicMaterial({
  47413. color: 16777215 * Math.random()
  47414. }),
  47415. this.drawMode = n.TrianglesDrawMode,
  47416. this.updateMorphTargets()
  47417. }
  47418. ,
  47419. n.Mesh.prototype = Object.create(n.Object3D.prototype),
  47420. n.Mesh.prototype.constructor = n.Mesh,
  47421. n.Mesh.prototype.setDrawMode = function(e) {
  47422. this.drawMode = e
  47423. }
  47424. ,
  47425. n.Mesh.prototype.updateMorphTargets = function() {
  47426. if (void 0 !== this.geometry.morphTargets && this.geometry.morphTargets.length > 0) {
  47427. this.morphTargetBase = -1,
  47428. this.morphTargetInfluences = [],
  47429. this.morphTargetDictionary = {};
  47430. for (var e = 0, t = this.geometry.morphTargets.length; e < t; e++)
  47431. this.morphTargetInfluences.push(0),
  47432. this.morphTargetDictionary[this.geometry.morphTargets[e].name] = e
  47433. }
  47434. }
  47435. ,
  47436. n.Mesh.prototype.getMorphTargetIndexByName = function(e) {
  47437. return void 0 !== this.morphTargetDictionary[e] ? this.morphTargetDictionary[e] : (console.warn("THREE.Mesh.getMorphTargetIndexByName: morph target " + e + " does not exist. Returning 0."),
  47438. 0)
  47439. }
  47440. ,
  47441. n.Mesh.prototype.raycast = function() {
  47442. function e(e, t, i, r, o, a, s) {
  47443. return n.Triangle.barycoordFromPoint(e, t, i, r, m),
  47444. o.multiplyScalar(m.x),
  47445. a.multiplyScalar(m.y),
  47446. s.multiplyScalar(m.z),
  47447. o.add(a).add(s),
  47448. o.clone()
  47449. }
  47450. function t(e, t, i, r, o, a, s) {
  47451. var l, c = e.material;
  47452. if (l = c.side === n.BackSide ? i.intersectTriangle(a, o, r, !0, s) : i.intersectTriangle(r, o, a, c.side !== n.DoubleSide, s),
  47453. null === l)
  47454. return null;
  47455. A.copy(s),
  47456. A.applyMatrix4(e.matrixWorld);
  47457. var h = t.ray.origin.distanceTo(A);
  47458. return h < t.near || h > t.far ? null : {
  47459. distance: h,
  47460. point: A.clone(),
  47461. object: e
  47462. }
  47463. }
  47464. function i(i, r, o, a, h, u, d, m) {
  47465. s.fromArray(a, 3 * u),
  47466. l.fromArray(a, 3 * d),
  47467. c.fromArray(a, 3 * m);
  47468. var A = t(i, r, o, s, l, c, v);
  47469. return A && (h && (p.fromArray(h, 2 * u),
  47470. f.fromArray(h, 2 * d),
  47471. g.fromArray(h, 2 * m),
  47472. A.uv = e(v, s, l, c, p, f, g)),
  47473. A.face = new n.Face3(u,d,m,n.Triangle.normal(s, l, c)),
  47474. A.faceIndex = u),
  47475. A
  47476. }
  47477. var r = new n.Matrix4
  47478. , o = new n.Ray
  47479. , a = new n.Sphere
  47480. , s = new n.Vector3
  47481. , l = new n.Vector3
  47482. , c = new n.Vector3
  47483. , h = new n.Vector3
  47484. , u = new n.Vector3
  47485. , d = new n.Vector3
  47486. , p = new n.Vector2
  47487. , f = new n.Vector2
  47488. , g = new n.Vector2
  47489. , m = new n.Vector3
  47490. , v = new n.Vector3
  47491. , A = new n.Vector3;
  47492. return function(m, A) {
  47493. var y = this.geometry
  47494. , C = this.material
  47495. , I = this.matrixWorld;
  47496. if (void 0 !== C && (null === y.boundingSphere && y.computeBoundingSphere(),
  47497. a.copy(y.boundingSphere),
  47498. a.applyMatrix4(I),
  47499. m.ray.intersectsSphere(a) !== !1 && (r.getInverse(I),
  47500. o.copy(m.ray).applyMatrix4(r),
  47501. null === y.boundingBox || o.intersectsBox(y.boundingBox) !== !1))) {
  47502. var E, b;
  47503. if (y instanceof n.BufferGeometry) {
  47504. var w, _, T, x = y.index, S = y.attributes, M = S.position.array;
  47505. if (void 0 !== S.uv && (E = S.uv.array),
  47506. null !== x)
  47507. for (var R = x.array, P = 0, O = R.length; P < O; P += 3)
  47508. w = R[P],
  47509. _ = R[P + 1],
  47510. T = R[P + 2],
  47511. b = i(this, m, o, M, E, w, _, T),
  47512. b && (b.faceIndex = Math.floor(P / 3),
  47513. A.push(b));
  47514. else
  47515. for (var P = 0, O = M.length; P < O; P += 9)
  47516. w = P / 3,
  47517. _ = w + 1,
  47518. T = w + 2,
  47519. b = i(this, m, o, M, E, w, _, T),
  47520. b && (b.index = w,
  47521. A.push(b))
  47522. } else if (y instanceof n.Geometry) {
  47523. var L, D, N, B = C instanceof n.MultiMaterial, F = B === !0 ? C.materials : null, V = y.vertices, U = y.faces, k = y.faceVertexUvs[0];
  47524. k.length > 0 && (E = k);
  47525. for (var H = 0, G = U.length; H < G; H++) {
  47526. var z = U[H]
  47527. , W = B === !0 ? F[z.materialIndex] : C;
  47528. if (void 0 !== W) {
  47529. if (L = V[z.a],
  47530. D = V[z.b],
  47531. N = V[z.c],
  47532. W.morphTargets === !0) {
  47533. var j = y.morphTargets
  47534. , Y = this.morphTargetInfluences;
  47535. s.set(0, 0, 0),
  47536. l.set(0, 0, 0),
  47537. c.set(0, 0, 0);
  47538. for (var X = 0, Z = j.length; X < Z; X++) {
  47539. var q = Y[X];
  47540. if (0 !== q) {
  47541. var K = j[X].vertices;
  47542. s.addScaledVector(h.subVectors(K[z.a], L), q),
  47543. l.addScaledVector(u.subVectors(K[z.b], D), q),
  47544. c.addScaledVector(d.subVectors(K[z.c], N), q)
  47545. }
  47546. }
  47547. s.add(L),
  47548. l.add(D),
  47549. c.add(N),
  47550. L = s,
  47551. D = l,
  47552. N = c
  47553. }
  47554. if (b = t(this, m, o, L, D, N, v)) {
  47555. if (E) {
  47556. var Q = E[H];
  47557. p.copy(Q[0]),
  47558. f.copy(Q[1]),
  47559. g.copy(Q[2]),
  47560. b.uv = e(v, L, D, N, p, f, g)
  47561. }
  47562. b.face = z,
  47563. b.faceIndex = H,
  47564. A.push(b)
  47565. }
  47566. }
  47567. }
  47568. }
  47569. }
  47570. }
  47571. }(),
  47572. n.Mesh.prototype.clone = function() {
  47573. return new this.constructor(this.geometry,this.material).copy(this)
  47574. }
  47575. ,
  47576. n.Bone = function(e) {
  47577. n.Object3D.call(this),
  47578. this.type = "Bone",
  47579. this.skin = e
  47580. }
  47581. ,
  47582. n.Bone.prototype = Object.create(n.Object3D.prototype),
  47583. n.Bone.prototype.constructor = n.Bone,
  47584. n.Bone.prototype.copy = function(e) {
  47585. return n.Object3D.prototype.copy.call(this, e),
  47586. this.skin = e.skin,
  47587. this
  47588. }
  47589. ,
  47590. n.Skeleton = function(e, t, i) {
  47591. if (this.useVertexTexture = void 0 === i || i,
  47592. this.identityMatrix = new n.Matrix4,
  47593. e = e || [],
  47594. this.bones = e.slice(0),
  47595. this.useVertexTexture) {
  47596. var r = Math.sqrt(4 * this.bones.length);
  47597. r = n.Math.nextPowerOfTwo(Math.ceil(r)),
  47598. r = Math.max(r, 4),
  47599. this.boneTextureWidth = r,
  47600. this.boneTextureHeight = r,
  47601. this.boneMatrices = new Float32Array(this.boneTextureWidth * this.boneTextureHeight * 4),
  47602. this.boneTexture = new n.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,n.RGBAFormat,n.FloatType)
  47603. } else
  47604. this.boneMatrices = new Float32Array(16 * this.bones.length);
  47605. if (void 0 === t)
  47606. this.calculateInverses();
  47607. else if (this.bones.length === t.length)
  47608. this.boneInverses = t.slice(0);
  47609. else {
  47610. console.warn("THREE.Skeleton bonInverses is the wrong length."),
  47611. this.boneInverses = [];
  47612. for (var o = 0, a = this.bones.length; o < a; o++)
  47613. this.boneInverses.push(new n.Matrix4)
  47614. }
  47615. }
  47616. ,
  47617. n.Skeleton.prototype.calculateInverses = function() {
  47618. this.boneInverses = [];
  47619. for (var e = 0, t = this.bones.length; e < t; e++) {
  47620. var i = new n.Matrix4;
  47621. this.bones[e] && i.getInverse(this.bones[e].matrixWorld),
  47622. this.boneInverses.push(i)
  47623. }
  47624. }
  47625. ,
  47626. n.Skeleton.prototype.pose = function() {
  47627. for (var e, t = 0, i = this.bones.length; t < i; t++)
  47628. e = this.bones[t],
  47629. e && e.matrixWorld.getInverse(this.boneInverses[t]);
  47630. for (var t = 0, i = this.bones.length; t < i; t++)
  47631. e = this.bones[t],
  47632. e && (e.parent ? (e.matrix.getInverse(e.parent.matrixWorld),
  47633. e.matrix.multiply(e.matrixWorld)) : e.matrix.copy(e.matrixWorld),
  47634. e.matrix.decompose(e.position, e.quaternion, e.scale));
  47635. }
  47636. ,
  47637. n.Skeleton.prototype.update = function() {
  47638. var e = new n.Matrix4;
  47639. return function() {
  47640. for (var t = 0, i = this.bones.length; t < i; t++) {
  47641. var n = this.bones[t] ? this.bones[t].matrixWorld : this.identityMatrix;
  47642. e.multiplyMatrices(n, this.boneInverses[t]),
  47643. e.flattenToArrayOffset(this.boneMatrices, 16 * t)
  47644. }
  47645. this.useVertexTexture && (this.boneTexture.needsUpdate = !0)
  47646. }
  47647. }(),
  47648. n.Skeleton.prototype.clone = function() {
  47649. return new n.Skeleton(this.bones,this.boneInverses,this.useVertexTexture)
  47650. }
  47651. ,
  47652. n.SkinnedMesh = function(e, t, i) {
  47653. n.Mesh.call(this, e, t),
  47654. this.type = "SkinnedMesh",
  47655. this.bindMode = "attached",
  47656. this.bindMatrix = new n.Matrix4,
  47657. this.bindMatrixInverse = new n.Matrix4;
  47658. var r = [];
  47659. if (this.geometry && void 0 !== this.geometry.bones) {
  47660. for (var o, a, s = 0, l = this.geometry.bones.length; s < l; ++s)
  47661. a = this.geometry.bones[s],
  47662. o = new n.Bone(this),
  47663. r.push(o),
  47664. o.name = a.name,
  47665. o.position.fromArray(a.pos),
  47666. o.quaternion.fromArray(a.rotq),
  47667. void 0 !== a.scl && o.scale.fromArray(a.scl);
  47668. for (var s = 0, l = this.geometry.bones.length; s < l; ++s)
  47669. a = this.geometry.bones[s],
  47670. a.parent !== -1 && null !== a.parent ? r[a.parent].add(r[s]) : this.add(r[s])
  47671. }
  47672. this.normalizeSkinWeights(),
  47673. this.updateMatrixWorld(!0),
  47674. this.bind(new n.Skeleton(r,void 0,i), this.matrixWorld)
  47675. }
  47676. ,
  47677. n.SkinnedMesh.prototype = Object.create(n.Mesh.prototype),
  47678. n.SkinnedMesh.prototype.constructor = n.SkinnedMesh,
  47679. n.SkinnedMesh.prototype.bind = function(e, t) {
  47680. this.skeleton = e,
  47681. void 0 === t && (this.updateMatrixWorld(!0),
  47682. this.skeleton.calculateInverses(),
  47683. t = this.matrixWorld),
  47684. this.bindMatrix.copy(t),
  47685. this.bindMatrixInverse.getInverse(t)
  47686. }
  47687. ,
  47688. n.SkinnedMesh.prototype.pose = function() {
  47689. this.skeleton.pose()
  47690. }
  47691. ,
  47692. n.SkinnedMesh.prototype.normalizeSkinWeights = function() {
  47693. if (this.geometry instanceof n.Geometry)
  47694. for (var e = 0; e < this.geometry.skinWeights.length; e++) {
  47695. var t = this.geometry.skinWeights[e]
  47696. , i = 1 / t.lengthManhattan();
  47697. i !== 1 / 0 ? t.multiplyScalar(i) : t.set(1, 0, 0, 0)
  47698. }
  47699. else if (this.geometry instanceof n.BufferGeometry)
  47700. for (var r = new n.Vector4, o = this.geometry.attributes.skinWeight, e = 0; e < o.count; e++) {
  47701. r.x = o.getX(e),
  47702. r.y = o.getY(e),
  47703. r.z = o.getZ(e),
  47704. r.w = o.getW(e);
  47705. var i = 1 / r.lengthManhattan();
  47706. i !== 1 / 0 ? r.multiplyScalar(i) : r.set(1, 0, 0, 0),
  47707. o.setXYZW(e, r.x, r.y, r.z, r.w)
  47708. }
  47709. }
  47710. ,
  47711. n.SkinnedMesh.prototype.updateMatrixWorld = function(e) {
  47712. n.Mesh.prototype.updateMatrixWorld.call(this, !0),
  47713. "attached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.matrixWorld) : "detached" === this.bindMode ? this.bindMatrixInverse.getInverse(this.bindMatrix) : console.warn("THREE.SkinnedMesh unrecognized bindMode: " + this.bindMode)
  47714. }
  47715. ,
  47716. n.SkinnedMesh.prototype.clone = function() {
  47717. return new this.constructor(this.geometry,this.material,this.useVertexTexture).copy(this)
  47718. }
  47719. ,
  47720. n.LOD = function() {
  47721. n.Object3D.call(this),
  47722. this.type = "LOD",
  47723. Object.defineProperties(this, {
  47724. levels: {
  47725. enumerable: !0,
  47726. value: []
  47727. },
  47728. objects: {
  47729. get: function() {
  47730. return console.warn("THREE.LOD: .objects has been renamed to .levels."),
  47731. this.levels
  47732. }
  47733. }
  47734. })
  47735. }
  47736. ,
  47737. n.LOD.prototype = Object.create(n.Object3D.prototype),
  47738. n.LOD.prototype.constructor = n.LOD,
  47739. n.LOD.prototype.addLevel = function(e, t) {
  47740. void 0 === t && (t = 0),
  47741. t = Math.abs(t);
  47742. for (var i = this.levels, n = 0; n < i.length && !(t < i[n].distance); n++)
  47743. ;
  47744. i.splice(n, 0, {
  47745. distance: t,
  47746. object: e
  47747. }),
  47748. this.add(e)
  47749. }
  47750. ,
  47751. n.LOD.prototype.getObjectForDistance = function(e) {
  47752. for (var t = this.levels, i = 1, n = t.length; i < n && !(e < t[i].distance); i++)
  47753. ;
  47754. return t[i - 1].object
  47755. }
  47756. ,
  47757. n.LOD.prototype.raycast = function() {
  47758. var e = new n.Vector3;
  47759. return function(t, i) {
  47760. e.setFromMatrixPosition(this.matrixWorld);
  47761. var n = t.ray.origin.distanceTo(e);
  47762. this.getObjectForDistance(n).raycast(t, i)
  47763. }
  47764. }(),
  47765. n.LOD.prototype.update = function() {
  47766. var e = new n.Vector3
  47767. , t = new n.Vector3;
  47768. return function(i) {
  47769. var n = this.levels;
  47770. if (n.length > 1) {
  47771. e.setFromMatrixPosition(i.matrixWorld),
  47772. t.setFromMatrixPosition(this.matrixWorld);
  47773. var r = e.distanceTo(t);
  47774. n[0].object.visible = !0;
  47775. for (var o = 1, a = n.length; o < a && r >= n[o].distance; o++)
  47776. n[o - 1].object.visible = !1,
  47777. n[o].object.visible = !0;
  47778. for (; o < a; o++)
  47779. n[o].object.visible = !1
  47780. }
  47781. }
  47782. }(),
  47783. n.LOD.prototype.copy = function(e) {
  47784. n.Object3D.prototype.copy.call(this, e, !1);
  47785. for (var t = e.levels, i = 0, r = t.length; i < r; i++) {
  47786. var o = t[i];
  47787. this.addLevel(o.object.clone(), o.distance)
  47788. }
  47789. return this
  47790. }
  47791. ,
  47792. n.LOD.prototype.toJSON = function(e) {
  47793. var t = n.Object3D.prototype.toJSON.call(this, e);
  47794. t.object.levels = [];
  47795. for (var i = this.levels, r = 0, o = i.length; r < o; r++) {
  47796. var a = i[r];
  47797. t.object.levels.push({
  47798. object: a.object.uuid,
  47799. distance: a.distance
  47800. })
  47801. }
  47802. return t
  47803. }
  47804. ,
  47805. n.Sprite = function() {
  47806. var e = new Uint16Array([0, 1, 2, 0, 2, 3])
  47807. , t = new Float32Array([-.5, -.5, 0, .5, -.5, 0, .5, .5, 0, -.5, .5, 0])
  47808. , i = new Float32Array([0, 0, 1, 0, 1, 1, 0, 1])
  47809. , r = new n.BufferGeometry;
  47810. return r.setIndex(new n.BufferAttribute(e,1)),
  47811. r.addAttribute("position", new n.BufferAttribute(t,3)),
  47812. r.addAttribute("uv", new n.BufferAttribute(i,2)),
  47813. function(e) {
  47814. n.Object3D.call(this),
  47815. this.type = "Sprite",
  47816. this.geometry = r,
  47817. this.material = void 0 !== e ? e : new n.SpriteMaterial
  47818. }
  47819. }(),
  47820. n.Sprite.prototype = Object.create(n.Object3D.prototype),
  47821. n.Sprite.prototype.constructor = n.Sprite,
  47822. n.Sprite.prototype.raycast = function() {
  47823. var e = new n.Vector3;
  47824. return function(t, i) {
  47825. e.setFromMatrixPosition(this.matrixWorld);
  47826. var n = t.ray.distanceSqToPoint(e)
  47827. , r = this.scale.x * this.scale.y;
  47828. n > r || i.push({
  47829. distance: Math.sqrt(n),
  47830. point: this.position,
  47831. face: null,
  47832. object: this
  47833. })
  47834. }
  47835. }(),
  47836. n.Sprite.prototype.clone = function() {
  47837. return new this.constructor(this.material).copy(this)
  47838. }
  47839. ,
  47840. n.Particle = n.Sprite,
  47841. n.LensFlare = function(e, t, i, r, o) {
  47842. n.Object3D.call(this),
  47843. this.lensFlares = [],
  47844. this.positionScreen = new n.Vector3,
  47845. this.customUpdateCallback = void 0,
  47846. void 0 !== e && this.add(e, t, i, r, o)
  47847. }
  47848. ,
  47849. n.LensFlare.prototype = Object.create(n.Object3D.prototype),
  47850. n.LensFlare.prototype.constructor = n.LensFlare,
  47851. n.LensFlare.prototype.add = function(e, t, i, r, o, a) {
  47852. void 0 === t && (t = -1),
  47853. void 0 === i && (i = 0),
  47854. void 0 === a && (a = 1),
  47855. void 0 === o && (o = new n.Color(16777215)),
  47856. void 0 === r && (r = n.NormalBlending),
  47857. i = Math.min(i, Math.max(0, i)),
  47858. this.lensFlares.push({
  47859. texture: e,
  47860. size: t,
  47861. distance: i,
  47862. x: 0,
  47863. y: 0,
  47864. z: 0,
  47865. scale: 1,
  47866. rotation: 0,
  47867. opacity: a,
  47868. color: o,
  47869. blending: r
  47870. })
  47871. }
  47872. ,
  47873. n.LensFlare.prototype.updateLensFlares = function() {
  47874. var e, t, i = this.lensFlares.length, n = 2 * -this.positionScreen.x, r = 2 * -this.positionScreen.y;
  47875. for (e = 0; e < i; e++)
  47876. t = this.lensFlares[e],
  47877. t.x = this.positionScreen.x + n * t.distance,
  47878. t.y = this.positionScreen.y + r * t.distance,
  47879. t.wantedRotation = t.x * Math.PI * .25,
  47880. t.rotation += .25 * (t.wantedRotation - t.rotation)
  47881. }
  47882. ,
  47883. n.LensFlare.prototype.copy = function(e) {
  47884. n.Object3D.prototype.copy.call(this, e),
  47885. this.positionScreen.copy(e.positionScreen),
  47886. this.customUpdateCallback = e.customUpdateCallback;
  47887. for (var t = 0, i = e.lensFlares.length; t < i; t++)
  47888. this.lensFlares.push(e.lensFlares[t]);
  47889. return this
  47890. }
  47891. ,
  47892. n.Scene = function() {
  47893. n.Object3D.call(this),
  47894. this.type = "Scene",
  47895. this.fog = null,
  47896. this.overrideMaterial = null,
  47897. this.autoUpdate = !0
  47898. }
  47899. ,
  47900. n.Scene.prototype = Object.create(n.Object3D.prototype),
  47901. n.Scene.prototype.constructor = n.Scene,
  47902. n.Scene.prototype.copy = function(e, t) {
  47903. return n.Object3D.prototype.copy.call(this, e, t),
  47904. null !== e.fog && (this.fog = e.fog.clone()),
  47905. null !== e.overrideMaterial && (this.overrideMaterial = e.overrideMaterial.clone()),
  47906. this.autoUpdate = e.autoUpdate,
  47907. this.matrixAutoUpdate = e.matrixAutoUpdate,
  47908. this
  47909. }
  47910. ,
  47911. n.Fog = function(e, t, i) {
  47912. this.name = "",
  47913. this.color = new n.Color(e),
  47914. this.near = void 0 !== t ? t : 1,
  47915. this.far = void 0 !== i ? i : 1e3
  47916. }
  47917. ,
  47918. n.Fog.prototype.clone = function() {
  47919. return new n.Fog(this.color.getHex(),this.near,this.far)
  47920. }
  47921. ,
  47922. n.FogExp2 = function(e, t) {
  47923. this.name = "",
  47924. this.color = new n.Color(e),
  47925. this.density = void 0 !== t ? t : 25e-5
  47926. }
  47927. ,
  47928. n.FogExp2.prototype.clone = function() {
  47929. return new n.FogExp2(this.color.getHex(),this.density)
  47930. }
  47931. ,
  47932. n.ShaderChunk = {},
  47933. n.ShaderChunk.alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n#endif\n",
  47934. n.ShaderChunk.alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif\n",
  47935. n.ShaderChunk.alphatest_fragment = "#ifdef ALPHATEST\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n#endif\n",
  47936. n.ShaderChunk.aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D( aoMap, vUv2 ).r - 1.0 ) * aoMapIntensity + 1.0;\n\treflectedLight.indirectDiffuse *= ambientOcclusion;\n\t#if defined( USE_ENVMAP ) && defined( STANDARD )\n\t\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\t\treflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.specularRoughness );\n\t#endif\n#endif\n",
  47937. n.ShaderChunk.aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif",
  47938. n.ShaderChunk.begin_vertex = "\nvec3 transformed = vec3( position );\n",
  47939. n.ShaderChunk.beginnormal_vertex = "\nvec3 objectNormal = vec3( normal );\n",
  47940. n.ShaderChunk.bsdfs = "bool testLightInRange( const in float lightDistance, const in float cutoffDistance ) {\n\treturn any( bvec2( cutoffDistance == 0.0, lightDistance < cutoffDistance ) );\n}\nfloat punctualLightIntensityToIrradianceFactor( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t\tif( decayExponent > 0.0 ) {\n#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\t\tfloat maxDistanceCutoffFactor = pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t\treturn distanceFalloff * maxDistanceCutoffFactor;\n#else\n\t\t\treturn pow( saturate( -lightDistance / cutoffDistance + 1.0 ), decayExponent );\n#endif\n\t\t}\n\t\treturn 1.0;\n}\nvec3 BRDF_Diffuse_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 specularColor, const in float dotLH ) {\n\tfloat fresnel = exp2( ( -5.55473 * dotLH - 6.98316 ) * dotLH );\n\treturn ( 1.0 - specularColor ) * fresnel + specularColor;\n}\nfloat G_GGX_Smith( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gl = dotNL + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\tfloat gv = dotNV + sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\treturn 1.0 / ( gl * gv );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_Specular_GGX( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNL = saturate( dot( geometry.normal, incidentLight.direction ) );\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_GGX_Smith( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( G * D );\n}\nvec3 BRDF_Specular_GGX_Environment( const in GeometricContext geometry, const in vec3 specularColor, const in float roughness ) {\n\tfloat dotNV = saturate( dot( geometry.normal, geometry.viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 AB = vec2( -1.04, 1.04 ) * a004 + r.zw;\n\treturn specularColor * AB.x + AB.y;\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_Specular_BlinnPhong( const in IncidentLight incidentLight, const in GeometricContext geometry, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( incidentLight.direction + geometry.viewDir );\n\tfloat dotNH = saturate( dot( geometry.normal, halfDir ) );\n\tfloat dotLH = saturate( dot( incidentLight.direction, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, dotLH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\nfloat GGXRoughnessToBlinnExponent( const in float ggxRoughness ) {\n\treturn ( 2.0 / pow2( ggxRoughness + 0.0001 ) - 2.0 );\n}\nfloat BlinnExponentToGGXRoughness( const in float blinnExponent ) {\n\treturn sqrt( 2.0 / ( blinnExponent + 2.0 ) );\n}\n",
  47941. n.ShaderChunk.bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif\n",
  47942. n.ShaderChunk.color_fragment = "#ifdef USE_COLOR\n\tdiffuseColor.rgb *= vColor;\n#endif",
  47943. n.ShaderChunk.color_pars_fragment = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif\n",
  47944. n.ShaderChunk.color_pars_vertex = "#ifdef USE_COLOR\n\tvarying vec3 vColor;\n#endif",
  47945. n.ShaderChunk.color_vertex = "#ifdef USE_COLOR\n\tvColor.xyz = color.xyz;\n#endif",
  47946. n.ShaderChunk.common = "#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI 0.31830988618\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n#define saturate(a) clamp( a, 0.0, 1.0 )\n#define whiteCompliment(a) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\tfloat distance = dot( planeNormal, point - pointOnPlane );\n\treturn - distance * planeNormal + point;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) ) + pointOnLine;\n}\n",
  47947. n.ShaderChunk.cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\nconst float cubeUV_textureSize = 1024.0;\nint getFaceFromDirection(vec3 direction) {\n vec3 absDirection = abs(direction);\n int face = -1;\n if( absDirection.x > absDirection.z ) {\n if(absDirection.x > absDirection.y )\n face = direction.x > 0.0 ? 0 : 3;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n else {\n if(absDirection.z > absDirection.y )\n face = direction.z > 0.0 ? 2 : 5;\n else\n face = direction.y > 0.0 ? 1 : 4;\n }\n return face;\n}\nconst float cubeUV_maxLods1 = log2(cubeUV_textureSize*0.25) - 1.0;\nconst float cubeUV_rangeClamp = exp2((6.0 - 1.0) * 2.0);\nvec2 MipLevelInfo( vec3 vec, float roughnessLevel, float roughness ) {\n float scale = exp2(cubeUV_maxLods1 - roughnessLevel);\n float dxRoughness = dFdx(roughness);\n float dyRoughness = dFdy(roughness);\n vec3 dx = dFdx( vec * scale * dxRoughness );\n vec3 dy = dFdy( vec * scale * dyRoughness );\n float d = max( dot( dx, dx ), dot( dy, dy ) );\n d = clamp(d, 1.0, cubeUV_rangeClamp);\n float mipLevel = 0.5 * log2(d);\n return vec2(floor(mipLevel), fract(mipLevel));\n}\nconst float cubeUV_maxLods2 = log2(cubeUV_textureSize*0.25) - 2.0;\nconst float cubeUV_rcpTextureSize = 1.0 / cubeUV_textureSize;\nvec2 getCubeUV(vec3 direction, float roughnessLevel, float mipLevel) {\n mipLevel = roughnessLevel > cubeUV_maxLods2 - 3.0 ? 0.0 : mipLevel;\n float a = 16.0 * cubeUV_rcpTextureSize;\n vec2 exp2_packed = exp2( vec2( roughnessLevel, mipLevel ) );\n vec2 rcp_exp2_packed = vec2( 1.0 ) / exp2_packed;\n float powScale = exp2_packed.x * exp2_packed.y;\n float scale = rcp_exp2_packed.x * rcp_exp2_packed.y * 0.25;\n float mipOffset = 0.75*(1.0 - rcp_exp2_packed.y) * rcp_exp2_packed.x;\n bool bRes = mipLevel == 0.0;\n scale = bRes && (scale < a) ? a : scale;\n vec3 r;\n vec2 offset;\n int face = getFaceFromDirection(direction);\n float rcpPowScale = 1.0 / powScale;\n if( face == 0) {\n r = vec3(direction.x, -direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 1) {\n r = vec3(direction.y, direction.x, direction.z);\n offset = vec2(scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 2) {\n r = vec3(direction.z, direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.75 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? a : offset.y;\n }\n else if( face == 3) {\n r = vec3(direction.x, direction.z, direction.y);\n offset = vec2(0.0+mipOffset,0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else if( face == 4) {\n r = vec3(direction.y, direction.x, -direction.z);\n offset = vec2(scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n else {\n r = vec3(direction.z, -direction.x, direction.y);\n offset = vec2(2.0*scale+mipOffset, 0.5 * rcpPowScale);\n offset.y = bRes && (offset.y < 2.0*a) ? 0.0 : offset.y;\n }\n r = normalize(r);\n float texelOffset = 0.5 * cubeUV_rcpTextureSize;\n vec2 s = ( r.yz / abs( r.x ) + vec2( 1.0 ) ) * 0.5;\n vec2 base = offset + vec2( texelOffset );\n return base + s * ( scale - 2.0 * texelOffset );\n}\nconst float cubeUV_maxLods3 = log2(cubeUV_textureSize*0.25) - 3.0;\nvec4 textureCubeUV(vec3 reflectedDirection, float roughness ) {\n float roughnessVal = roughness* cubeUV_maxLods3;\n float r1 = floor(roughnessVal);\n float r2 = r1 + 1.0;\n float t = fract(roughnessVal);\n vec2 mipInfo = MipLevelInfo(reflectedDirection, r1, roughness);\n float s = mipInfo.y;\n float level0 = mipInfo.x;\n float level1 = level0 + 1.0;\n level1 = level1 > 5.0 ? 5.0 : level1;\n level0 += min( floor( s + 0.5 ), 5.0 );\n vec2 uv_10 = getCubeUV(reflectedDirection, r1, level0);\n vec4 color10 = envMapTexelToLinear(texture2D(envMap, uv_10));\n vec2 uv_20 = getCubeUV(reflectedDirection, r2, level0);\n vec4 color20 = envMapTexelToLinear(texture2D(envMap, uv_20));\n vec4 result = mix(color10, color20, t);\n return vec4(result.rgb, 1.0);\n}\n#endif\n",
  47948. n.ShaderChunk.defaultnormal_vertex = "#ifdef FLIP_SIDED\n\tobjectNormal = -objectNormal;\n#endif\nvec3 transformedNormal = normalMatrix * objectNormal;\n",
  47949. n.ShaderChunk.displacementmap_vertex = "#ifdef USE_DISPLACEMENTMAP\n\ttransformed += normal * ( texture2D( displacementMap, uv ).x * displacementScale + displacementBias );\n#endif\n",
  47950. n.ShaderChunk.displacementmap_pars_vertex = "#ifdef USE_DISPLACEMENTMAP\n\tuniform sampler2D displacementMap;\n\tuniform float displacementScale;\n\tuniform float displacementBias;\n#endif\n",
  47951. n.ShaderChunk.emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = texture2D( emissiveMap, vUv );\n\temissiveColor.rgb = emissiveMapTexelToLinear( emissiveColor ).rgb;\n\ttotalEmissiveRadiance *= emissiveColor.rgb;\n#endif\n",
  47952. n.ShaderChunk.emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif\n",
  47953. n.ShaderChunk.encodings_pars_fragment = "\nvec4 LinearToLinear( in vec4 value ) {\n return value;\n}\nvec4 GammaToLinear( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( gammaFactor ) ), value.w );\n}\nvec4 LinearToGamma( in vec4 value, in float gammaFactor ) {\n return vec4( pow( value.xyz, vec3( 1.0 / gammaFactor ) ), value.w );\n}\nvec4 sRGBToLinear( in vec4 value ) {\n return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.w );\n}\nvec4 LinearTosRGB( in vec4 value ) {\n return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.w );\n}\nvec4 RGBEToLinear( in vec4 value ) {\n return vec4( value.rgb * exp2( value.a * 255.0 - 128.0 ), 1.0 );\n}\nvec4 LinearToRGBE( in vec4 value ) {\n float maxComponent = max( max( value.r, value.g ), value.b );\n float fExp = clamp( ceil( log2( maxComponent ) ), -128.0, 127.0 );\n return vec4( value.rgb / exp2( fExp ), ( fExp + 128.0 ) / 255.0 );\n}\nvec4 RGBMToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.xyz * value.w * maxRange, 1.0 );\n}\nvec4 LinearToRGBM( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float M = clamp( maxRGB / maxRange, 0.0, 1.0 );\n M = ceil( M * 255.0 ) / 255.0;\n return vec4( value.rgb / ( M * maxRange ), M );\n}\nvec4 RGBDToLinear( in vec4 value, in float maxRange ) {\n return vec4( value.rgb * ( ( maxRange / 255.0 ) / value.a ), 1.0 );\n}\nvec4 LinearToRGBD( in vec4 value, in float maxRange ) {\n float maxRGB = max( value.x, max( value.g, value.b ) );\n float D = max( maxRange / maxRGB, 1.0 );\n D = min( floor( D ) / 255.0, 1.0 );\n return vec4( value.rgb * ( D * ( 255.0 / maxRange ) ), D );\n}\nconst mat3 cLogLuvM = mat3( 0.2209, 0.3390, 0.4184, 0.1138, 0.6780, 0.7319, 0.0102, 0.1130, 0.2969 );\nvec4 LinearToLogLuv( in vec4 value ) {\n vec3 Xp_Y_XYZp = value.rgb * cLogLuvM;\n Xp_Y_XYZp = max(Xp_Y_XYZp, vec3(1e-6, 1e-6, 1e-6));\n vec4 vResult;\n vResult.xy = Xp_Y_XYZp.xy / Xp_Y_XYZp.z;\n float Le = 2.0 * log2(Xp_Y_XYZp.y) + 127.0;\n vResult.w = fract(Le);\n vResult.z = (Le - (floor(vResult.w*255.0))/255.0)/255.0;\n return vResult;\n}\nconst mat3 cLogLuvInverseM = mat3( 6.0014, -2.7008, -1.7996, -1.3320, 3.1029, -5.7721, 0.3008, -1.0882, 5.6268 );\nvec4 LogLuvToLinear( in vec4 value ) {\n float Le = value.z * 255.0 + value.w;\n vec3 Xp_Y_XYZp;\n Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);\n Xp_Y_XYZp.z = Xp_Y_XYZp.y / value.y;\n Xp_Y_XYZp.x = value.x * Xp_Y_XYZp.z;\n vec3 vRGB = Xp_Y_XYZp.rgb * cLogLuvInverseM;\n return vec4( max(vRGB, 0.0), 1.0 );\n}\n",
  47954. n.ShaderChunk.encodings_fragment = " gl_FragColor = linearToOutputTexel( gl_FragColor );\n",
  47955. n.ShaderChunk.envmap_fragment = "#ifdef USE_ENVMAP\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\tenvColor = envMapTexelToLinear( envColor );\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif\n",
  47956. n.ShaderChunk.envmap_pars_fragment = "#if defined( USE_ENVMAP ) || defined( STANDARD )\n\tuniform float reflectivity;\n\tuniform float envMapIntenstiy;\n#endif\n#ifdef USE_ENVMAP\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( STANDARD )\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif\n",
  47957. n.ShaderChunk.envmap_pars_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvarying vec3 vReflect;\n\tuniform float refractionRatio;\n#endif\n",
  47958. n.ShaderChunk.envmap_vertex = "#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG ) && ! defined( STANDARD )\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\tvec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );\n\t#ifdef ENVMAP_MODE_REFLECTION\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\t#else\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\t#endif\n#endif\n",
  47959. n.ShaderChunk.fog_fragment = "#ifdef USE_FOG\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\t#ifdef FOG_EXP2\n\t\tfloat fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * depth * depth * LOG2 ) );\n\t#else\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\t#endif\n\tgl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );\n#endif\n",
  47960. n.ShaderChunk.fog_pars_fragment = "#ifdef USE_FOG\n\tuniform vec3 fogColor;\n\t#ifdef FOG_EXP2\n\t\tuniform float fogDensity;\n\t#else\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n#endif",
  47961. n.ShaderChunk.lightmap_fragment = "#ifdef USE_LIGHTMAP\n\treflectedLight.indirectDiffuse += PI * texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n#endif\n",
  47962. n.ShaderChunk.lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;\n\tuniform float lightMapIntensity;\n#endif",
  47963. n.ShaderChunk.lights_lambert_vertex = "vec3 diffuse = vec3( 1.0 );\nGeometricContext geometry;\ngeometry.position = mvPosition.xyz;\ngeometry.normal = normalize( transformedNormal );\ngeometry.viewDir = normalize( -mvPosition.xyz );\nGeometricContext backGeometry;\nbackGeometry.position = geometry.position;\nbackGeometry.normal = -geometry.normal;\nbackGeometry.viewDir = geometry.viewDir;\nvLightFront = vec3( 0.0 );\n#ifdef DOUBLE_SIDED\n\tvLightBack = vec3( 0.0 );\n#endif\nIncidentLight directLight;\nfloat dotNL;\nvec3 directLightColor_Diffuse;\n#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tdirectLight = getPointDirectLightIrradiance( pointLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLights[ i ], geometry );\n\t\tdotNL = dot( geometry.normal, directLight.direction );\n\t\tdirectLightColor_Diffuse = PI * directLight.color;\n\t\tvLightFront += saturate( dotNL ) * directLightColor_Diffuse;\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += saturate( -dotNL ) * directLightColor_Diffuse;\n\t\t#endif\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\tvLightFront += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tvLightBack += getHemisphereLightIrradiance( hemisphereLights[ i ], backGeometry );\n\t\t#endif\n\t}\n#endif\n",
  47964. n.ShaderChunk.lights_pars = "uniform vec3 ambientLightColor;\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treturn irradiance;\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tIncidentLight getDirectionalDirectLightIrradiance( const in DirectionalLight directionalLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tdirectLight.color = directionalLight.color;\n\t\tdirectLight.direction = directionalLight.direction;\n\t\tdirectLight.visible = true;\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tIncidentLight getPointDirectLightIrradiance( const in PointLight pointLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tif ( testLightInRange( lightDistance, pointLight.distance ) ) {\n\t\t\tdirectLight.color = pointLight.color;\n\t\t\tdirectLight.color *= punctualLightIntensityToIrradianceFactor( lightDistance, pointLight.distance, pointLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t\tint shadow;\n\t\tfloat shadowBias;\n\t\tfloat shadowRadius;\n\t\tvec2 shadowMapSize;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tIncidentLight getSpotDirectLightIrradiance( const in SpotLight spotLight, const in GeometricContext geometry ) {\n\t\tIncidentLight directLight;\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tdirectLight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tfloat angleCos = dot( directLight.direction, spotLight.direction );\n\t\tif ( all( bvec2( angleCos > spotLight.coneCos, testLightInRange( lightDistance, spotLight.distance ) ) ) ) {\n\t\t\tfloat spotEffect = smoothstep( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\t\tdirectLight.color = spotLight.color;\n\t\t\tdirectLight.color *= spotEffect * punctualLightIntensityToIrradianceFactor( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tdirectLight.visible = true;\n\t\t} else {\n\t\t\tdirectLight.color = vec3( 0.0 );\n\t\t\tdirectLight.visible = false;\n\t\t}\n\t\treturn directLight;\n\t}\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in GeometricContext geometry ) {\n\t\tfloat dotNL = dot( geometry.normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tirradiance *= PI;\n\t\t#endif\n\t\treturn irradiance;\n\t}\n#endif\n#if defined( USE_ENVMAP ) && defined( STANDARD )\n\tvec3 getLightProbeIndirectIrradiance( const in GeometricContext geometry, const in int maxMIPLevel ) {\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\tvec3 worldNormal = inverseTransformDirection( geometry.normal, viewMatrix );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryVec, float( maxMIPLevel ) );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryVec = flipNormal * vec3( flipEnvMap * worldNormal.x, worldNormal.yz );\n\t\t\tvec4 envMapColor = textureCubeUV( queryVec, 1.0 );\n\t\t#else\n\t\t\tvec4 envMapColor = vec4( 0.0 );\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t}\n\tfloat getSpecularMIPLevel( const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\tfloat maxMIPLevelScalar = float( maxMIPLevel );\n\t\tfloat desiredMIPLevel = maxMIPLevelScalar - 0.79248 - 0.5 * log2( pow2( blinnShininessExponent ) + 1.0 );\n\t\treturn clamp( desiredMIPLevel, 0.0, maxMIPLevelScalar );\n\t}\n\tvec3 getLightProbeIndirectRadiance( const in GeometricContext geometry, const in float blinnShininessExponent, const in int maxMIPLevel ) {\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( -geometry.viewDir, geometry.normal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( -geometry.viewDir, geometry.normal, refractionRatio );\n\t\t#endif\n\t\t#ifdef DOUBLE_SIDED\n\t\t\tfloat flipNormal = ( float( gl_FrontFacing ) * 2.0 - 1.0 );\n\t\t#else\n\t\t\tfloat flipNormal = 1.0;\n\t\t#endif\n\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\tfloat specularMIPLevel = getSpecularMIPLevel( blinnShininessExponent, maxMIPLevel );\n\t\t#ifdef ENVMAP_TYPE_CUBE\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = textureCubeLodEXT( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = textureCube( envMap, queryReflectVec, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 queryReflectVec = flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz );\n\t\t\tvec4 envMapColor = textureCubeUV(queryReflectVec, BlinnExponentToGGXRoughness(blinnShininessExponent));\n\t\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\t\tvec2 sampleUV;\n\t\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, sampleUV, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, sampleUV, specularMIPLevel );\n\t\t\t#endif\n\t\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\t\t#ifdef TEXTURE_LOD_EXT\n\t\t\t\tvec4 envMapColor = texture2DLodEXT( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#else\n\t\t\t\tvec4 envMapColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5, specularMIPLevel );\n\t\t\t#endif\n\t\t#endif\n\t\tenvMapColor.rgb = envMapTexelToLinear( envMapColor ).rgb;\n\t\treturn envMapColor.rgb * envMapIntensity;\n\t}\n#endif\n",
  47965. n.ShaderChunk.lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;\n",
  47966. n.ShaderChunk.lights_phong_pars_fragment = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\nstruct BlinnPhongMaterial {\n\tvec3\tdiffuseColor;\n\tvec3\tspecularColor;\n\tfloat\tspecularShininess;\n\tfloat\tspecularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_BlinnPhong( directLight, geometry, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)\n",
  47967. n.ShaderChunk.lights_phong_pars_vertex = "#ifdef USE_ENVMAP\n\tvarying vec3 vWorldPosition;\n#endif\n",
  47968. n.ShaderChunk.lights_phong_vertex = "#ifdef USE_ENVMAP\n\tvWorldPosition = worldPosition.xyz;\n#endif\n",
  47969. n.ShaderChunk.lights_standard_fragment = "StandardMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nmaterial.specularRoughness = clamp( roughnessFactor, 0.04, 1.0 );\nmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n",
  47970. n.ShaderChunk.lights_standard_pars_fragment = "struct StandardMaterial {\n\tvec3\tdiffuseColor;\n\tfloat\tspecularRoughness;\n\tvec3\tspecularColor;\n};\nvoid RE_Direct_Standard( const in IncidentLight directLight, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\tirradiance *= PI;\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_Specular_GGX( directLight, geometry, material.specularColor, material.specularRoughness );\n}\nvoid RE_IndirectDiffuse_Standard( const in vec3 irradiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Diffuse_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Standard( const in vec3 radiance, const in GeometricContext geometry, const in StandardMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectSpecular += radiance * BRDF_Specular_GGX_Environment( geometry, material.specularColor, material.specularRoughness );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Standard\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Standard\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Standard\n#define Material_BlinnShininessExponent( material ) GGXRoughnessToBlinnExponent( material.specularRoughness )\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}\n",
  47971. n.ShaderChunk.lights_template = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = normalize( vViewPosition );\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tdirectLight = getPointDirectLightIrradiance( pointLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( pointLight.shadow, directLight.visible ) ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tdirectLight = getSpotDirectLightIrradiance( spotLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( spotLight.shadow, directLight.visible ) ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tdirectLight = getDirectionalDirectLightIrradiance( directionalLight, geometry );\n\t\t#ifdef USE_SHADOWMAP\n\t\tdirectLight.color *= all( bvec2( directionalLight.shadow, directLight.visible ) ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#ifdef USE_LIGHTMAP\n\t\tvec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;\n\t\t#ifndef PHYSICALLY_CORRECT_LIGHTS\n\t\t\tlightMapIrradiance *= PI;\n\t\t#endif\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry );\n\t\t}\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t \tirradiance += getLightProbeIndirectIrradiance( geometry, 8 );\n\t#endif\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tvec3 radiance = getLightProbeIndirectRadiance( geometry, Material_BlinnShininessExponent( material ), 8 );\n\tRE_IndirectSpecular( radiance, geometry, material, reflectedLight );\n#endif\n",
  47972. n.ShaderChunk.logdepthbuf_fragment = "#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n#endif",
  47973. 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",
  47974. 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",
  47975. n.ShaderChunk.logdepthbuf_vertex = "#ifdef USE_LOGDEPTHBUF\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\t#else\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\t#endif\n#endif\n",
  47976. n.ShaderChunk.map_fragment = "#ifdef USE_MAP\n\tvec4 texelColor = texture2D( map, vUv );\n\ttexelColor = mapTexelToLinear( texelColor );\n\tdiffuseColor *= texelColor;\n#endif\n",
  47977. n.ShaderChunk.map_pars_fragment = "#ifdef USE_MAP\n\tuniform sampler2D map;\n#endif\n",
  47978. n.ShaderChunk.map_particle_fragment = "#ifdef USE_MAP\n\tvec4 mapTexel = texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\tdiffuseColor *= mapTexelToLinear( mapTexel );\n#endif\n",
  47979. n.ShaderChunk.map_particle_pars_fragment = "#ifdef USE_MAP\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n#endif\n",
  47980. n.ShaderChunk.metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_METALNESSMAP\n\tvec4 texelMetalness = texture2D( metalnessMap, vUv );\n\tmetalnessFactor *= texelMetalness.r;\n#endif\n",
  47981. n.ShaderChunk.metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif",
  47982. n.ShaderChunk.morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tobjectNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tobjectNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tobjectNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n#endif\n",
  47983. n.ShaderChunk.morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_MORPHNORMALS\n\tuniform float morphTargetInfluences[ 8 ];\n\t#else\n\tuniform float morphTargetInfluences[ 4 ];\n\t#endif\n#endif";
  47984. n.ShaderChunk.morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\ttransformed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\ttransformed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\ttransformed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\t#ifndef USE_MORPHNORMALS\n\ttransformed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\ttransformed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\ttransformed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\ttransformed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\t#endif\n#endif\n";
  47985. n.ShaderChunk.normal_fragment = "#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#endif\n#endif\n#ifdef USE_NORMALMAP\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n#endif\n",
  47986. n.ShaderChunk.normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\t}\n#endif\n",
  47987. n.ShaderChunk.premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif\n",
  47988. n.ShaderChunk.project_vertex = "#ifdef USE_SKINNING\n\tvec4 mvPosition = modelViewMatrix * skinned;\n#else\n\tvec4 mvPosition = modelViewMatrix * vec4( transformed, 1.0 );\n#endif\ngl_Position = projectionMatrix * mvPosition;\n",
  47989. n.ShaderChunk.roughnessmap_fragment = "float roughnessFactor = roughness;\n#ifdef USE_ROUGHNESSMAP\n\tvec4 texelRoughness = texture2D( roughnessMap, vUv );\n\troughnessFactor *= texelRoughness.r;\n#endif\n",
  47990. n.ShaderChunk.roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif",
  47991. n.ShaderChunk.shadowmap_pars_fragment = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\treturn dot( rgba_depth, bit_shift );\n\t}\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackDepth( texture2D( depths, uv ) ) );\n\t}\n\tfloat texture2DShadowLerp( sampler2D depths, vec2 size, vec2 uv, float compare ) {\n\t\tconst vec2 offset = vec2( 0.0, 1.0 );\n\t\tvec2 texelSize = vec2( 1.0 ) / size;\n\t\tvec2 centroidUV = floor( uv * size + 0.5 ) / size;\n\t\tfloat lb = texture2DCompare( depths, centroidUV + texelSize * offset.xx, compare );\n\t\tfloat lt = texture2DCompare( depths, centroidUV + texelSize * offset.xy, compare );\n\t\tfloat rb = texture2DCompare( depths, centroidUV + texelSize * offset.yx, compare );\n\t\tfloat rt = texture2DCompare( depths, centroidUV + texelSize * offset.yy, compare );\n\t\tvec2 f = fract( uv * size + 0.5 );\n\t\tfloat a = mix( lb, lt, f.y );\n\t\tfloat b = mix( rb, rt, f.y );\n\t\tfloat c = mix( a, b, f.x );\n\t\treturn c;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\treturn (\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DShadowLerp( shadowMap, shadowMapSize, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn 1.0;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\tfloat dp = ( length( lightToPosition ) - shadowBias ) / 1000.0;\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif\n",
  47992. n.ShaderChunk.shadowmap_pars_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHTS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHTS ];\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\t\tuniform mat4 spotShadowMatrix[ NUM_SPOT_LIGHTS ];\n\t\tvarying vec4 vSpotShadowCoord[ NUM_SPOT_LIGHTS ];\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHTS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHTS ];\n\t#endif\n#endif\n",
  47993. n.ShaderChunk.shadowmap_vertex = "#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tvDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tvSpotShadowCoord[ i ] = spotShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tvPointShadowCoord[ i ] = pointShadowMatrix[ i ] * worldPosition;\n\t}\n\t#endif\n#endif\n",
  47994. n.ShaderChunk.shadowmask_pars_fragment = "float getShadowMask() {\n\tfloat shadow = 1.0;\n\t#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHTS > 0\n\tDirectionalLight directionalLight;\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tshadow *= bool( directionalLight.shadow ) ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_SPOT_LIGHTS > 0\n\tSpotLight spotLight;\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tshadow *= bool( spotLight.shadow ) ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#if NUM_POINT_LIGHTS > 0\n\tPointLight pointLight;\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tshadow *= bool( pointLight.shadow ) ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ] ) : 1.0;\n\t}\n\t#endif\n\t#endif\n\treturn shadow;\n}\n",
  47995. n.ShaderChunk.skinbase_vertex = "#ifdef USE_SKINNING\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n#endif",
  47996. n.ShaderChunk.skinning_pars_vertex = "#ifdef USE_SKINNING\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\t#ifdef BONE_TEXTURE\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\t\t\ty = dy * ( y + 0.5 );\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\t\t\treturn bone;\n\t\t}\n\t#else\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\t\tmat4 getBoneMatrix( const in float i ) {\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\t\t}\n\t#endif\n#endif\n",
  47997. n.ShaderChunk.skinning_vertex = "#ifdef USE_SKINNING\n\tvec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned = bindMatrixInverse * skinned;\n#endif\n",
  47998. n.ShaderChunk.skinnormal_vertex = "#ifdef USE_SKINNING\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;\n\tobjectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;\n#endif\n",
  47999. n.ShaderChunk.specularmap_fragment = "float specularStrength;\n#ifdef USE_SPECULARMAP\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n#else\n\tspecularStrength = 1.0;\n#endif",
  48000. n.ShaderChunk.specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D specularMap;\n#endif",
  48001. n.ShaderChunk.tonemapping_fragment = "#if defined( TONE_MAPPING )\n gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif\n",
  48002. n.ShaderChunk.tonemapping_pars_fragment = "#define saturate(a) clamp( a, 0.0, 1.0 )\nuniform float toneMappingExposure;\nuniform float toneMappingWhitePoint;\nvec3 LinearToneMapping( vec3 color ) {\n return toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( color / ( vec3( 1.0 ) + color ) );\n}\n#define Uncharted2Helper( x ) max( ( ( x * ( 0.15 * x + 0.10 * 0.50 ) + 0.20 * 0.02 ) / ( x * ( 0.15 * x + 0.50 ) + 0.20 * 0.30 ) ) - 0.02 / 0.30, vec3( 0.0 ) )\nvec3 Uncharted2ToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n return saturate( Uncharted2Helper( color ) / Uncharted2Helper( vec3( toneMappingWhitePoint ) ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n color *= toneMappingExposure;\n color = max( vec3( 0.0 ), color - 0.004 );\n return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\n",
  48003. n.ShaderChunk.uv2_pars_fragment = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvarying vec2 vUv2;\n#endif",
  48004. n.ShaderChunk.uv2_pars_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tattribute vec2 uv2;\n\tvarying vec2 vUv2;\n#endif",
  48005. n.ShaderChunk.uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 = uv2;\n#endif",
  48006. n.ShaderChunk.uv_pars_fragment = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n#endif",
  48007. n.ShaderChunk.uv_pars_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n#endif\n",
  48008. n.ShaderChunk.uv_vertex = "#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP ) || defined( USE_EMISSIVEMAP ) || defined( USE_ROUGHNESSMAP ) || defined( USE_METALNESSMAP )\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n#endif",
  48009. n.ShaderChunk.worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( STANDARD ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\t#ifdef USE_SKINNING\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\t#else\n\t\tvec4 worldPosition = modelMatrix * vec4( transformed, 1.0 );\n\t#endif\n#endif\n",
  48010. n.UniformsUtils = {
  48011. merge: function(e) {
  48012. for (var t = {}, i = 0; i < e.length; i++) {
  48013. var n = this.clone(e[i]);
  48014. for (var r in n)
  48015. t[r] = n[r]
  48016. }
  48017. return t
  48018. },
  48019. clone: function(e) {
  48020. var t = {};
  48021. for (var i in e) {
  48022. t[i] = {};
  48023. for (var r in e[i]) {
  48024. var o = e[i][r];
  48025. o instanceof n.Color || o instanceof n.Vector2 || o instanceof n.Vector3 || o instanceof n.Vector4 || o instanceof n.Matrix3 || o instanceof n.Matrix4 || o instanceof n.Texture ? t[i][r] = o.clone() : Array.isArray(o) ? t[i][r] = o.slice() : t[i][r] = o
  48026. }
  48027. }
  48028. return t
  48029. }
  48030. },
  48031. n.UniformsLib = {
  48032. common: {
  48033. diffuse: {
  48034. type: "c",
  48035. value: new n.Color(15658734)
  48036. },
  48037. opacity: {
  48038. type: "f",
  48039. value: 1
  48040. },
  48041. map: {
  48042. type: "t",
  48043. value: null
  48044. },
  48045. offsetRepeat: {
  48046. type: "v4",
  48047. value: new n.Vector4(0,0,1,1)
  48048. },
  48049. specularMap: {
  48050. type: "t",
  48051. value: null
  48052. },
  48053. alphaMap: {
  48054. type: "t",
  48055. value: null
  48056. },
  48057. envMap: {
  48058. type: "t",
  48059. value: null
  48060. },
  48061. flipEnvMap: {
  48062. type: "f",
  48063. value: -1
  48064. },
  48065. reflectivity: {
  48066. type: "f",
  48067. value: 1
  48068. },
  48069. refractionRatio: {
  48070. type: "f",
  48071. value: .98
  48072. }
  48073. },
  48074. aomap: {
  48075. aoMap: {
  48076. type: "t",
  48077. value: null
  48078. },
  48079. aoMapIntensity: {
  48080. type: "f",
  48081. value: 1
  48082. }
  48083. },
  48084. lightmap: {
  48085. lightMap: {
  48086. type: "t",
  48087. value: null
  48088. },
  48089. lightMapIntensity: {
  48090. type: "f",
  48091. value: 1
  48092. }
  48093. },
  48094. emissivemap: {
  48095. emissiveMap: {
  48096. type: "t",
  48097. value: null
  48098. }
  48099. },
  48100. bumpmap: {
  48101. bumpMap: {
  48102. type: "t",
  48103. value: null
  48104. },
  48105. bumpScale: {
  48106. type: "f",
  48107. value: 1
  48108. }
  48109. },
  48110. normalmap: {
  48111. normalMap: {
  48112. type: "t",
  48113. value: null
  48114. },
  48115. normalScale: {
  48116. type: "v2",
  48117. value: new n.Vector2(1,1)
  48118. }
  48119. },
  48120. displacementmap: {
  48121. displacementMap: {
  48122. type: "t",
  48123. value: null
  48124. },
  48125. displacementScale: {
  48126. type: "f",
  48127. value: 1
  48128. },
  48129. displacementBias: {
  48130. type: "f",
  48131. value: 0
  48132. }
  48133. },
  48134. roughnessmap: {
  48135. roughnessMap: {
  48136. type: "t",
  48137. value: null
  48138. }
  48139. },
  48140. metalnessmap: {
  48141. metalnessMap: {
  48142. type: "t",
  48143. value: null
  48144. }
  48145. },
  48146. fog: {
  48147. fogDensity: {
  48148. type: "f",
  48149. value: 25e-5
  48150. },
  48151. fogNear: {
  48152. type: "f",
  48153. value: 1
  48154. },
  48155. fogFar: {
  48156. type: "f",
  48157. value: 2e3
  48158. },
  48159. fogColor: {
  48160. type: "c",
  48161. value: new n.Color(16777215)
  48162. }
  48163. },
  48164. lights: {
  48165. ambientLightColor: {
  48166. type: "fv",
  48167. value: []
  48168. },
  48169. directionalLights: {
  48170. type: "sa",
  48171. value: [],
  48172. properties: {
  48173. direction: {
  48174. type: "v3"
  48175. },
  48176. color: {
  48177. type: "c"
  48178. },
  48179. shadow: {
  48180. type: "i"
  48181. },
  48182. shadowBias: {
  48183. type: "f"
  48184. },
  48185. shadowRadius: {
  48186. type: "f"
  48187. },
  48188. shadowMapSize: {
  48189. type: "v2"
  48190. }
  48191. }
  48192. },
  48193. directionalShadowMap: {
  48194. type: "tv",
  48195. value: []
  48196. },
  48197. directionalShadowMatrix: {
  48198. type: "m4v",
  48199. value: []
  48200. },
  48201. spotLights: {
  48202. type: "sa",
  48203. value: [],
  48204. properties: {
  48205. color: {
  48206. type: "c"
  48207. },
  48208. position: {
  48209. type: "v3"
  48210. },
  48211. direction: {
  48212. type: "v3"
  48213. },
  48214. distance: {
  48215. type: "f"
  48216. },
  48217. coneCos: {
  48218. type: "f"
  48219. },
  48220. penumbraCos: {
  48221. type: "f"
  48222. },
  48223. decay: {
  48224. type: "f"
  48225. },
  48226. shadow: {
  48227. type: "i"
  48228. },
  48229. shadowBias: {
  48230. type: "f"
  48231. },
  48232. shadowRadius: {
  48233. type: "f"
  48234. },
  48235. shadowMapSize: {
  48236. type: "v2"
  48237. }
  48238. }
  48239. },
  48240. spotShadowMap: {
  48241. type: "tv",
  48242. value: []
  48243. },
  48244. spotShadowMatrix: {
  48245. type: "m4v",
  48246. value: []
  48247. },
  48248. pointLights: {
  48249. type: "sa",
  48250. value: [],
  48251. properties: {
  48252. color: {
  48253. type: "c"
  48254. },
  48255. position: {
  48256. type: "v3"
  48257. },
  48258. decay: {
  48259. type: "f"
  48260. },
  48261. distance: {
  48262. type: "f"
  48263. },
  48264. shadow: {
  48265. type: "i"
  48266. },
  48267. shadowBias: {
  48268. type: "f"
  48269. },
  48270. shadowRadius: {
  48271. type: "f"
  48272. },
  48273. shadowMapSize: {
  48274. type: "v2"
  48275. }
  48276. }
  48277. },
  48278. pointShadowMap: {
  48279. type: "tv",
  48280. value: []
  48281. },
  48282. pointShadowMatrix: {
  48283. type: "m4v",
  48284. value: []
  48285. },
  48286. hemisphereLights: {
  48287. type: "sa",
  48288. value: [],
  48289. properties: {
  48290. direction: {
  48291. type: "v3"
  48292. },
  48293. skyColor: {
  48294. type: "c"
  48295. },
  48296. groundColor: {
  48297. type: "c"
  48298. }
  48299. }
  48300. }
  48301. },
  48302. points: {
  48303. diffuse: {
  48304. type: "c",
  48305. value: new n.Color(15658734)
  48306. },
  48307. opacity: {
  48308. type: "f",
  48309. value: 1
  48310. },
  48311. size: {
  48312. type: "f",
  48313. value: 1
  48314. },
  48315. scale: {
  48316. type: "f",
  48317. value: 1
  48318. },
  48319. map: {
  48320. type: "t",
  48321. value: null
  48322. },
  48323. offsetRepeat: {
  48324. type: "v4",
  48325. value: new n.Vector4(0,0,1,1)
  48326. }
  48327. }
  48328. },
  48329. n.ShaderChunk.cube_frag = "uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );\n\t#include <logdepthbuf_fragment>\n}\n",
  48330. n.ShaderChunk.cube_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48331. n.ShaderChunk.depth_frag = "uniform float mNear;\nuniform float mFar;\nuniform float opacity;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}\n",
  48332. n.ShaderChunk.depth_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48333. n.ShaderChunk.depthRGBA_frag = "#include <common>\n#include <logdepthbuf_pars_fragment>\nvec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}\n",
  48334. n.ShaderChunk.depthRGBA_vert = "#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48335. n.ShaderChunk.distanceRGBA_frag = "uniform vec3 lightPos;\nvarying vec4 vWorldPosition;\n#include <common>\nvec4 pack1K ( float depth ) {\n\tdepth /= 1000.0;\n\tconst vec4 bitSh = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bitMsk = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bitSh * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bitMsk;\n\treturn res;\n}\nfloat unpack1K ( vec4 color ) {\n\tconst vec4 bitSh = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\treturn dot( color, bitSh ) * 1000.0;\n}\nvoid main () {\n\tgl_FragColor = pack1K( length( vWorldPosition.xyz - lightPos.xyz ) );\n}\n",
  48336. n.ShaderChunk.distanceRGBA_vert = "varying vec4 vWorldPosition;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\nvoid main() {\n\t#include <skinbase_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\tvWorldPosition = worldPosition;\n}\n",
  48337. n.ShaderChunk.equirect_frag = "uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 direction = normalize( vWorldPosition );\n\tvec2 sampleUV;\n\tsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\n\tsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <logdepthbuf_fragment>\n}\n",
  48338. n.ShaderChunk.equirect_vert = "varying vec3 vWorldPosition;\n#include <common>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t#include <logdepthbuf_vertex>\n}\n",
  48339. n.ShaderChunk.linedashed_frag = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48340. n.ShaderChunk.linedashed_vert = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n}\n",
  48341. n.ShaderChunk.meshbasic_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight;\n\treflectedLight.directDiffuse = vec3( 0.0 );\n\treflectedLight.directSpecular = vec3( 0.0 );\n\treflectedLight.indirectDiffuse = diffuseColor.rgb;\n\treflectedLight.indirectSpecular = vec3( 0.0 );\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48342. n.ShaderChunk.meshbasic_vert = "#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_ENVMAP\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n}\n",
  48343. n.ShaderChunk.meshlambert_frag = "uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <emissivemap_fragment>\n\treflectedLight.indirectDiffuse = getAmbientLightIrradiance( ambientLightColor );\n\t#include <lightmap_fragment>\n\treflectedLight.indirectDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb );\n\t#ifdef DOUBLE_SIDED\n\t\treflectedLight.directDiffuse = ( gl_FrontFacing ) ? vLightFront : vLightBack;\n\t#else\n\t\treflectedLight.directDiffuse = vLightFront;\n\t#endif\n\treflectedLight.directDiffuse *= BRDF_Diffuse_Lambert( diffuseColor.rgb ) * getShadowMask();\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48344. n.ShaderChunk.meshlambert_vert = "#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <envmap_pars_vertex>\n#include <bsdfs>\n#include <lights_pars>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_lambert_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48345. n.ShaderChunk.meshphong_frag = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48346. n.ShaderChunk.meshphong_vert = "#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <lights_phong_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <lights_phong_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48347. n.ShaderChunk.meshstandard_frag = "#define STANDARD\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\nuniform float envMapIntensity;\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <uv2_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <cube_uv_reflection_fragment>\n#include <lights_pars>\n#include <lights_standard_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment>\n\t#include <emissivemap_fragment>\n\t#include <lights_standard_fragment>\n\t#include <lights_template>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48348. n.ShaderChunk.meshstandard_vert = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <uv2_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <uv2_vertex>\n\t#include <color_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif\n\t#include <begin_vertex>\n\t#include <displacementmap_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48349. n.ShaderChunk.normal_frag = "uniform float opacity;\nvarying vec3 vNormal;\n#include <common>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );\n\t#include <logdepthbuf_fragment>\n}\n",
  48350. n.ShaderChunk.normal_vert = "varying vec3 vNormal;\n#include <common>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\tvNormal = normalize( normalMatrix * normal );\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n}\n",
  48351. n.ShaderChunk.points_frag = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <fog_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\nvoid main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n\t#include <premultiplied_alpha_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}\n",
  48352. n.ShaderChunk.points_vert = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\nvoid main() {\n\t#include <color_vertex>\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / - mvPosition.z );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n}\n",
  48353. n.ShaderLib = {
  48354. basic: {
  48355. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.fog]),
  48356. vertexShader: n.ShaderChunk.meshbasic_vert,
  48357. fragmentShader: n.ShaderChunk.meshbasic_frag
  48358. },
  48359. lambert: {
  48360. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48361. emissive: {
  48362. type: "c",
  48363. value: new n.Color(0)
  48364. }
  48365. }]),
  48366. vertexShader: n.ShaderChunk.meshlambert_vert,
  48367. fragmentShader: n.ShaderChunk.meshlambert_frag
  48368. },
  48369. phong: {
  48370. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48371. emissive: {
  48372. type: "c",
  48373. value: new n.Color(0)
  48374. },
  48375. specular: {
  48376. type: "c",
  48377. value: new n.Color(1118481)
  48378. },
  48379. shininess: {
  48380. type: "f",
  48381. value: 30
  48382. }
  48383. }]),
  48384. vertexShader: n.ShaderChunk.meshphong_vert,
  48385. fragmentShader: n.ShaderChunk.meshphong_frag
  48386. },
  48387. standard: {
  48388. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.aomap, n.UniformsLib.lightmap, n.UniformsLib.emissivemap, n.UniformsLib.bumpmap, n.UniformsLib.normalmap, n.UniformsLib.displacementmap, n.UniformsLib.roughnessmap, n.UniformsLib.metalnessmap, n.UniformsLib.fog, n.UniformsLib.lights, {
  48389. emissive: {
  48390. type: "c",
  48391. value: new n.Color(0)
  48392. },
  48393. roughness: {
  48394. type: "f",
  48395. value: .5
  48396. },
  48397. metalness: {
  48398. type: "f",
  48399. value: 0
  48400. },
  48401. envMapIntensity: {
  48402. type: "f",
  48403. value: 1
  48404. }
  48405. }]),
  48406. vertexShader: n.ShaderChunk.meshstandard_vert,
  48407. fragmentShader: n.ShaderChunk.meshstandard_frag
  48408. },
  48409. points: {
  48410. uniforms: n.UniformsUtils.merge([n.UniformsLib.points, n.UniformsLib.fog]),
  48411. vertexShader: n.ShaderChunk.points_vert,
  48412. fragmentShader: n.ShaderChunk.points_frag
  48413. },
  48414. dashed: {
  48415. uniforms: n.UniformsUtils.merge([n.UniformsLib.common, n.UniformsLib.fog, {
  48416. scale: {
  48417. type: "f",
  48418. value: 1
  48419. },
  48420. dashSize: {
  48421. type: "f",
  48422. value: 1
  48423. },
  48424. totalSize: {
  48425. type: "f",
  48426. value: 2
  48427. }
  48428. }]),
  48429. vertexShader: n.ShaderChunk.linedashed_vert,
  48430. fragmentShader: n.ShaderChunk.linedashed_frag
  48431. },
  48432. depth: {
  48433. uniforms: {
  48434. mNear: {
  48435. type: "f",
  48436. value: 1
  48437. },
  48438. mFar: {
  48439. type: "f",
  48440. value: 2e3
  48441. },
  48442. opacity: {
  48443. type: "f",
  48444. value: 1
  48445. }
  48446. },
  48447. vertexShader: n.ShaderChunk.depth_vert,
  48448. fragmentShader: n.ShaderChunk.depth_frag
  48449. },
  48450. normal: {
  48451. uniforms: {
  48452. opacity: {
  48453. type: "f",
  48454. value: 1
  48455. }
  48456. },
  48457. vertexShader: n.ShaderChunk.normal_vert,
  48458. fragmentShader: n.ShaderChunk.normal_frag
  48459. },
  48460. cube: {
  48461. uniforms: {
  48462. tCube: {
  48463. type: "t",
  48464. value: null
  48465. },
  48466. tFlip: {
  48467. type: "f",
  48468. value: -1
  48469. }
  48470. },
  48471. vertexShader: n.ShaderChunk.cube_vert,
  48472. fragmentShader: n.ShaderChunk.cube_frag
  48473. },
  48474. equirect: {
  48475. uniforms: {
  48476. tEquirect: {
  48477. type: "t",
  48478. value: null
  48479. },
  48480. tFlip: {
  48481. type: "f",
  48482. value: -1
  48483. }
  48484. },
  48485. vertexShader: n.ShaderChunk.equirect_vert,
  48486. fragmentShader: n.ShaderChunk.equirect_frag
  48487. },
  48488. depthRGBA: {
  48489. uniforms: {},
  48490. vertexShader: n.ShaderChunk.depthRGBA_vert,
  48491. fragmentShader: n.ShaderChunk.depthRGBA_frag
  48492. },
  48493. distanceRGBA: {
  48494. uniforms: {
  48495. lightPos: {
  48496. type: "v3",
  48497. value: new n.Vector3(0,0,0)
  48498. }
  48499. },
  48500. vertexShader: n.ShaderChunk.distanceRGBA_vert,
  48501. fragmentShader: n.ShaderChunk.distanceRGBA_frag
  48502. }
  48503. },
  48504. n.WebGLRenderer = function(e) {
  48505. function t() {
  48506. return null === ye ? Oe : 1
  48507. }
  48508. function i(e, t, i, n) {
  48509. se === !0 && (e *= n,
  48510. t *= n,
  48511. i *= n),
  48512. Ye.clearColor(e, t, i, n)
  48513. }
  48514. function r() {
  48515. Ye.init(),
  48516. Ye.scissor(we.copy(Le).multiplyScalar(Oe)),
  48517. Ye.viewport(Te.copy(Ne).multiplyScalar(Oe)),
  48518. i(Se.r, Se.g, Se.b, Me)
  48519. }
  48520. function o() {
  48521. Ae = null,
  48522. be = null,
  48523. Ee = "",
  48524. Ie = -1,
  48525. Ye.reset()
  48526. }
  48527. function a(e) {
  48528. e.preventDefault(),
  48529. o(),
  48530. r(),
  48531. Xe.clear()
  48532. }
  48533. function s(e) {
  48534. var t = e.target;
  48535. t.removeEventListener("dispose", s),
  48536. h(t),
  48537. ke.textures--
  48538. }
  48539. function l(e) {
  48540. var t = e.target;
  48541. t.removeEventListener("dispose", l),
  48542. u(t),
  48543. ke.textures--
  48544. }
  48545. function c(e) {
  48546. var t = e.target;
  48547. t.removeEventListener("dispose", c),
  48548. d(t)
  48549. }
  48550. function h(e) {
  48551. var t = Xe.get(e);
  48552. if (e.image && t.__image__webglTextureCube)
  48553. Ge.deleteTexture(t.__image__webglTextureCube);
  48554. else {
  48555. if (void 0 === t.__webglInit)
  48556. return;
  48557. Ge.deleteTexture(t.__webglTexture)
  48558. }
  48559. Xe.delete(e)
  48560. }
  48561. function u(e) {
  48562. var t = Xe.get(e)
  48563. , i = Xe.get(e.texture);
  48564. if (e && void 0 !== i.__webglTexture) {
  48565. if (Ge.deleteTexture(i.__webglTexture),
  48566. e instanceof n.WebGLRenderTargetCube)
  48567. for (var r = 0; r < 6; r++)
  48568. Ge.deleteFramebuffer(t.__webglFramebuffer[r]),
  48569. Ge.deleteRenderbuffer(t.__webglDepthbuffer[r]);
  48570. else
  48571. Ge.deleteFramebuffer(t.__webglFramebuffer),
  48572. Ge.deleteRenderbuffer(t.__webglDepthbuffer);
  48573. Xe.delete(e.texture),
  48574. Xe.delete(e)
  48575. }
  48576. }
  48577. function d(e) {
  48578. p(e),
  48579. Xe.delete(e)
  48580. }
  48581. function p(e) {
  48582. var t = Xe.get(e).program;
  48583. e.program = void 0,
  48584. void 0 !== t && qe.releaseProgram(t)
  48585. }
  48586. function f(e, t, i, r) {
  48587. var o;
  48588. if (i instanceof n.InstancedBufferGeometry && (o = We.get("ANGLE_instanced_arrays"),
  48589. null === o))
  48590. return void console.error("THREE.WebGLRenderer.setupVertexAttributes: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  48591. void 0 === r && (r = 0),
  48592. Ye.initAttributes();
  48593. var a = i.attributes
  48594. , s = t.getAttributes()
  48595. , l = e.defaultAttributeValues;
  48596. for (var c in s) {
  48597. var h = s[c];
  48598. if (h >= 0) {
  48599. var u = a[c];
  48600. if (void 0 !== u) {
  48601. var d = u.itemSize
  48602. , p = Ze.getAttributeBuffer(u);
  48603. if (u instanceof n.InterleavedBufferAttribute) {
  48604. var f = u.data
  48605. , g = f.stride
  48606. , m = u.offset;
  48607. f instanceof n.InstancedInterleavedBuffer ? (Ye.enableAttributeAndDivisor(h, f.meshPerAttribute, o),
  48608. void 0 === i.maxInstancedCount && (i.maxInstancedCount = f.meshPerAttribute * f.count)) : Ye.enableAttribute(h),
  48609. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48610. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, g * f.array.BYTES_PER_ELEMENT, (r * g + m) * f.array.BYTES_PER_ELEMENT)
  48611. } else
  48612. u instanceof n.InstancedBufferAttribute ? (Ye.enableAttributeAndDivisor(h, u.meshPerAttribute, o),
  48613. void 0 === i.maxInstancedCount && (i.maxInstancedCount = u.meshPerAttribute * u.count)) : Ye.enableAttribute(h),
  48614. Ge.bindBuffer(Ge.ARRAY_BUFFER, p),
  48615. Ge.vertexAttribPointer(h, d, Ge.FLOAT, !1, 0, r * d * 4)
  48616. } else if (void 0 !== l) {
  48617. var v = l[c];
  48618. if (void 0 !== v)
  48619. switch (v.length) {
  48620. case 2:
  48621. Ge.vertexAttrib2fv(h, v);
  48622. break;
  48623. case 3:
  48624. Ge.vertexAttrib3fv(h, v);
  48625. break;
  48626. case 4:
  48627. Ge.vertexAttrib4fv(h, v);
  48628. break;
  48629. default:
  48630. Ge.vertexAttrib1fv(h, v)
  48631. }
  48632. }
  48633. }
  48634. }
  48635. Ye.disableUnusedAttributes()
  48636. }
  48637. function g(e, t) {
  48638. return Math.abs(t[0]) - Math.abs(e[0])
  48639. }
  48640. function m(e, t) {
  48641. return e.object.renderOrder !== t.object.renderOrder ? e.object.renderOrder - t.object.renderOrder : e.material.id !== t.material.id ? e.material.id - t.material.id : e.z !== t.z ? e.z - t.z : e.id - t.id
  48642. }
  48643. function v(e, t) {
  48644. 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
  48645. }
  48646. function A(e, t, i, n, r) {
  48647. var o, a;
  48648. i.transparent ? (o = de,
  48649. a = ++pe) : (o = he,
  48650. a = ++ue);
  48651. var s = o[a];
  48652. void 0 !== s ? (s.id = e.id,
  48653. s.object = e,
  48654. s.geometry = t,
  48655. s.material = i,
  48656. s.z = Ve.z,
  48657. s.group = r) : (s = {
  48658. id: e.id,
  48659. object: e,
  48660. geometry: t,
  48661. material: i,
  48662. z: Ve.z,
  48663. group: r
  48664. },
  48665. o.push(s))
  48666. }
  48667. function y(e, t) {
  48668. if (e.visible !== !1) {
  48669. if (e.layers.test(t.layers))
  48670. if (e instanceof n.Light)
  48671. ce.push(e);
  48672. else if (e instanceof n.Sprite)
  48673. e.frustumCulled !== !1 && Be.intersectsObject(e) !== !0 || ge.push(e);
  48674. else if (e instanceof n.LensFlare)
  48675. me.push(e);
  48676. else if (e instanceof n.ImmediateRenderObject)
  48677. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48678. Ve.applyProjection(Fe)),
  48679. A(e, null, e.material, Ve.z, null);
  48680. else if ((e instanceof n.Mesh || e instanceof n.Line || e instanceof n.Points) && (e instanceof n.SkinnedMesh && e.skeleton.update(),
  48681. e.frustumCulled === !1 || Be.intersectsObject(e) === !0)) {
  48682. var i = e.material;
  48683. if (i.visible === !0) {
  48684. ve.sortObjects === !0 && (Ve.setFromMatrixPosition(e.matrixWorld),
  48685. Ve.applyProjection(Fe));
  48686. var r = Ze.update(e);
  48687. if (i instanceof n.MultiMaterial)
  48688. for (var o = r.groups, a = i.materials, s = 0, l = o.length; s < l; s++) {
  48689. var c = o[s]
  48690. , h = a[c.materialIndex];
  48691. h.visible === !0 && A(e, r, h, Ve.z, c)
  48692. }
  48693. else
  48694. A(e, r, i, Ve.z, null)
  48695. }
  48696. }
  48697. for (var u = e.children, s = 0, l = u.length; s < l; s++)
  48698. y(u[s], t)
  48699. }
  48700. }
  48701. function C(e, t, i, r) {
  48702. for (var o = 0, a = e.length; o < a; o++) {
  48703. var s = e[o]
  48704. , l = s.object
  48705. , c = s.geometry
  48706. , h = void 0 === r ? s.material : r
  48707. , u = s.group;
  48708. if (l.modelViewMatrix.multiplyMatrices(t.matrixWorldInverse, l.matrixWorld),
  48709. l.normalMatrix.getNormalMatrix(l.modelViewMatrix),
  48710. l instanceof n.ImmediateRenderObject) {
  48711. E(h);
  48712. var d = w(t, i, h, l);
  48713. Ee = "",
  48714. l.render(function(e) {
  48715. ve.renderBufferImmediate(e, d, h)
  48716. })
  48717. } else
  48718. ve.renderBufferDirect(t, i, c, h, l, u)
  48719. }
  48720. }
  48721. function I(e, t, i) {
  48722. var r = Xe.get(e)
  48723. , o = qe.getParameters(e, Ue, t, i)
  48724. , a = qe.getProgramCode(e, o)
  48725. , s = r.program
  48726. , l = !0;
  48727. if (void 0 === s)
  48728. e.addEventListener("dispose", c);
  48729. else if (s.code !== a)
  48730. p(e);
  48731. else {
  48732. if (void 0 !== o.shaderID)
  48733. return;
  48734. l = !1
  48735. }
  48736. if (l) {
  48737. if (o.shaderID) {
  48738. var h = n.ShaderLib[o.shaderID];
  48739. r.__webglShader = {
  48740. name: e.type,
  48741. uniforms: n.UniformsUtils.clone(h.uniforms),
  48742. vertexShader: h.vertexShader,
  48743. fragmentShader: h.fragmentShader
  48744. }
  48745. } else
  48746. r.__webglShader = {
  48747. name: e.type,
  48748. uniforms: e.uniforms,
  48749. vertexShader: e.vertexShader,
  48750. fragmentShader: e.fragmentShader
  48751. };
  48752. e.__webglShader = r.__webglShader,
  48753. s = qe.acquireProgram(e, o, a),
  48754. r.program = s,
  48755. e.program = s
  48756. }
  48757. var u = s.getAttributes();
  48758. if (e.morphTargets) {
  48759. e.numSupportedMorphTargets = 0;
  48760. for (var d = 0; d < ve.maxMorphTargets; d++)
  48761. u["morphTarget" + d] >= 0 && e.numSupportedMorphTargets++
  48762. }
  48763. if (e.morphNormals) {
  48764. e.numSupportedMorphNormals = 0;
  48765. for (var d = 0; d < ve.maxMorphNormals; d++)
  48766. u["morphNormal" + d] >= 0 && e.numSupportedMorphNormals++
  48767. }
  48768. r.uniformsList = [];
  48769. var f = r.__webglShader.uniforms
  48770. , g = r.program.getUniforms();
  48771. for (var m in f) {
  48772. var v = g[m];
  48773. v && r.uniformsList.push([r.__webglShader.uniforms[m], v])
  48774. }
  48775. (e instanceof n.MeshPhongMaterial || e instanceof n.MeshLambertMaterial || e instanceof n.MeshStandardMaterial || e.lights) && (r.lightsHash = Ue.hash,
  48776. f.ambientLightColor.value = Ue.ambient,
  48777. f.directionalLights.value = Ue.directional,
  48778. f.spotLights.value = Ue.spot,
  48779. f.pointLights.value = Ue.point,
  48780. f.hemisphereLights.value = Ue.hemi,
  48781. f.directionalShadowMap.value = Ue.directionalShadowMap,
  48782. f.directionalShadowMatrix.value = Ue.directionalShadowMatrix,
  48783. f.spotShadowMap.value = Ue.spotShadowMap,
  48784. f.spotShadowMatrix.value = Ue.spotShadowMatrix,
  48785. f.pointShadowMap.value = Ue.pointShadowMap,
  48786. f.pointShadowMatrix.value = Ue.pointShadowMatrix),
  48787. r.hasDynamicUniforms = !1;
  48788. for (var A = 0, y = r.uniformsList.length; A < y; A++) {
  48789. var C = r.uniformsList[A][0];
  48790. if (C.dynamic === !0) {
  48791. r.hasDynamicUniforms = !0;
  48792. break
  48793. }
  48794. }
  48795. }
  48796. function E(e) {
  48797. b(e),
  48798. e.transparent === !0 ? Ye.setBlending(e.blending, e.blendEquation, e.blendSrc, e.blendDst, e.blendEquationAlpha, e.blendSrcAlpha, e.blendDstAlpha, e.premultipliedAlpha) : Ye.setBlending(n.NoBlending),
  48799. Ye.setDepthFunc(e.depthFunc),
  48800. Ye.setDepthTest(e.depthTest),
  48801. Ye.setDepthWrite(e.depthWrite),
  48802. Ye.setColorWrite(e.colorWrite),
  48803. Ye.setPolygonOffset(e.polygonOffset, e.polygonOffsetFactor, e.polygonOffsetUnits)
  48804. }
  48805. function b(e) {
  48806. e.side !== n.DoubleSide ? Ye.enable(Ge.CULL_FACE) : Ye.disable(Ge.CULL_FACE),
  48807. Ye.setFlipSided(e.side === n.BackSide)
  48808. }
  48809. function w(e, t, i, r) {
  48810. xe = 0;
  48811. var o = Xe.get(i);
  48812. void 0 === o.program && (i.needsUpdate = !0),
  48813. void 0 !== o.lightsHash && o.lightsHash !== Ue.hash && (i.needsUpdate = !0),
  48814. i.needsUpdate && (I(i, t, r),
  48815. i.needsUpdate = !1);
  48816. var a = !1
  48817. , s = !1
  48818. , l = !1
  48819. , c = o.program
  48820. , h = c.getUniforms()
  48821. , u = o.__webglShader.uniforms;
  48822. if (c.id !== Ae && (Ge.useProgram(c.program),
  48823. Ae = c.id,
  48824. a = !0,
  48825. s = !0,
  48826. l = !0),
  48827. i.id !== Ie && (Ie = i.id,
  48828. s = !0),
  48829. (a || e !== be) && (Ge.uniformMatrix4fv(h.projectionMatrix, !1, e.projectionMatrix.elements),
  48830. je.logarithmicDepthBuffer && Ge.uniform1f(h.logDepthBufFC, 2 / (Math.log(e.far + 1) / Math.LN2)),
  48831. e !== be && (be = e,
  48832. s = !0,
  48833. l = !0),
  48834. (i instanceof n.ShaderMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial || i.envMap) && void 0 !== h.cameraPosition && (Ve.setFromMatrixPosition(e.matrixWorld),
  48835. Ge.uniform3f(h.cameraPosition, Ve.x, Ve.y, Ve.z)),
  48836. (i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshBasicMaterial || i instanceof n.MeshStandardMaterial || i instanceof n.ShaderMaterial || i.skinning) && void 0 !== h.viewMatrix && Ge.uniformMatrix4fv(h.viewMatrix, !1, e.matrixWorldInverse.elements),
  48837. void 0 !== h.toneMappingExposure && Ge.uniform1f(h.toneMappingExposure, ve.toneMappingExposure),
  48838. void 0 !== h.toneMappingWhitePoint && Ge.uniform1f(h.toneMappingWhitePoint, ve.toneMappingWhitePoint)),
  48839. i.skinning)
  48840. if (r.bindMatrix && void 0 !== h.bindMatrix && Ge.uniformMatrix4fv(h.bindMatrix, !1, r.bindMatrix.elements),
  48841. r.bindMatrixInverse && void 0 !== h.bindMatrixInverse && Ge.uniformMatrix4fv(h.bindMatrixInverse, !1, r.bindMatrixInverse.elements),
  48842. je.floatVertexTextures && r.skeleton && r.skeleton.useVertexTexture) {
  48843. if (void 0 !== h.boneTexture) {
  48844. var d = B();
  48845. Ge.uniform1i(h.boneTexture, d),
  48846. ve.setTexture(r.skeleton.boneTexture, d)
  48847. }
  48848. void 0 !== h.boneTextureWidth && Ge.uniform1i(h.boneTextureWidth, r.skeleton.boneTextureWidth),
  48849. void 0 !== h.boneTextureHeight && Ge.uniform1i(h.boneTextureHeight, r.skeleton.boneTextureHeight)
  48850. } else
  48851. r.skeleton && r.skeleton.boneMatrices && void 0 !== h.boneGlobalMatrices && Ge.uniformMatrix4fv(h.boneGlobalMatrices, !1, r.skeleton.boneMatrices);
  48852. return s && ((i instanceof n.MeshPhongMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshStandardMaterial || i.lights) && D(u, l),
  48853. t && i.fog && R(u, t),
  48854. (i instanceof n.MeshBasicMaterial || i instanceof n.MeshLambertMaterial || i instanceof n.MeshPhongMaterial || i instanceof n.MeshStandardMaterial) && T(u, i),
  48855. i instanceof n.LineBasicMaterial ? x(u, i) : i instanceof n.LineDashedMaterial ? (x(u, i),
  48856. S(u, i)) : i instanceof n.PointsMaterial ? M(u, i) : i instanceof n.MeshLambertMaterial ? P(u, i) : i instanceof n.MeshPhongMaterial ? O(u, i) : i instanceof n.MeshStandardMaterial ? L(u, i) : i instanceof n.MeshDepthMaterial ? (u.mNear.value = e.near,
  48857. u.mFar.value = e.far,
  48858. u.opacity.value = i.opacity) : i instanceof n.MeshNormalMaterial && (u.opacity.value = i.opacity),
  48859. V(o.uniformsList)),
  48860. N(h, r),
  48861. void 0 !== h.modelMatrix && Ge.uniformMatrix4fv(h.modelMatrix, !1, r.matrixWorld.elements),
  48862. o.hasDynamicUniforms === !0 && _(o.uniformsList, r, e),
  48863. c
  48864. }
  48865. function _(e, t, i) {
  48866. for (var n = [], r = 0, o = e.length; r < o; r++) {
  48867. var a = e[r][0]
  48868. , s = a.onUpdateCallback;
  48869. void 0 !== s && (s.bind(a)(t, i),
  48870. n.push(e[r]))
  48871. }
  48872. V(n)
  48873. }
  48874. function T(e, t) {
  48875. e.opacity.value = t.opacity,
  48876. e.diffuse.value = t.color,
  48877. t.emissive && e.emissive.value.copy(t.emissive).multiplyScalar(t.emissiveIntensity),
  48878. e.map.value = t.map,
  48879. e.specularMap.value = t.specularMap,
  48880. e.alphaMap.value = t.alphaMap,
  48881. t.aoMap && (e.aoMap.value = t.aoMap,
  48882. e.aoMapIntensity.value = t.aoMapIntensity);
  48883. var i;
  48884. if (t.map ? i = t.map : t.specularMap ? i = t.specularMap : t.displacementMap ? i = t.displacementMap : t.normalMap ? i = t.normalMap : t.bumpMap ? i = t.bumpMap : t.roughnessMap ? i = t.roughnessMap : t.metalnessMap ? i = t.metalnessMap : t.alphaMap ? i = t.alphaMap : t.emissiveMap && (i = t.emissiveMap),
  48885. void 0 !== i) {
  48886. i instanceof n.WebGLRenderTarget && (i = i.texture);
  48887. var r = i.offset
  48888. , o = i.repeat;
  48889. e.offsetRepeat.value.set(r.x, r.y, o.x, o.y)
  48890. }
  48891. e.envMap.value = t.envMap,
  48892. e.flipEnvMap.value = t.envMap instanceof n.WebGLRenderTargetCube ? 1 : -1,
  48893. e.reflectivity.value = t.reflectivity,
  48894. e.refractionRatio.value = t.refractionRatio
  48895. }
  48896. function x(e, t) {
  48897. e.diffuse.value = t.color,
  48898. e.opacity.value = t.opacity
  48899. }
  48900. function S(e, t) {
  48901. e.dashSize.value = t.dashSize,
  48902. e.totalSize.value = t.dashSize + t.gapSize,
  48903. e.scale.value = t.scale
  48904. }
  48905. function M(e, t) {
  48906. if (e.diffuse.value = t.color,
  48907. e.opacity.value = t.opacity,
  48908. e.size.value = t.size * Oe,
  48909. e.scale.value = te.clientHeight / 2,
  48910. e.map.value = t.map,
  48911. null !== t.map) {
  48912. var i = t.map.offset
  48913. , n = t.map.repeat;
  48914. e.offsetRepeat.value.set(i.x, i.y, n.x, n.y)
  48915. }
  48916. }
  48917. function R(e, t) {
  48918. e.fogColor.value = t.color,
  48919. t instanceof n.Fog ? (e.fogNear.value = t.near,
  48920. e.fogFar.value = t.far) : t instanceof n.FogExp2 && (e.fogDensity.value = t.density)
  48921. }
  48922. function P(e, t) {
  48923. t.lightMap && (e.lightMap.value = t.lightMap,
  48924. e.lightMapIntensity.value = t.lightMapIntensity),
  48925. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap)
  48926. }
  48927. function O(e, t) {
  48928. e.specular.value = t.specular,
  48929. e.shininess.value = Math.max(t.shininess, 1e-4),
  48930. t.lightMap && (e.lightMap.value = t.lightMap,
  48931. e.lightMapIntensity.value = t.lightMapIntensity),
  48932. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48933. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48934. e.bumpScale.value = t.bumpScale),
  48935. t.normalMap && (e.normalMap.value = t.normalMap,
  48936. e.normalScale.value.copy(t.normalScale)),
  48937. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48938. e.displacementScale.value = t.displacementScale,
  48939. e.displacementBias.value = t.displacementBias)
  48940. }
  48941. function L(e, t) {
  48942. e.roughness.value = t.roughness,
  48943. e.metalness.value = t.metalness,
  48944. t.roughnessMap && (e.roughnessMap.value = t.roughnessMap),
  48945. t.metalnessMap && (e.metalnessMap.value = t.metalnessMap),
  48946. t.lightMap && (e.lightMap.value = t.lightMap,
  48947. e.lightMapIntensity.value = t.lightMapIntensity),
  48948. t.emissiveMap && (e.emissiveMap.value = t.emissiveMap),
  48949. t.bumpMap && (e.bumpMap.value = t.bumpMap,
  48950. e.bumpScale.value = t.bumpScale),
  48951. t.normalMap && (e.normalMap.value = t.normalMap,
  48952. e.normalScale.value.copy(t.normalScale)),
  48953. t.displacementMap && (e.displacementMap.value = t.displacementMap,
  48954. e.displacementScale.value = t.displacementScale,
  48955. e.displacementBias.value = t.displacementBias),
  48956. t.envMap && (e.envMapIntensity.value = t.envMapIntensity)
  48957. }
  48958. function D(e, t) {
  48959. e.ambientLightColor.needsUpdate = t,
  48960. e.directionalLights.needsUpdate = t,
  48961. e.pointLights.needsUpdate = t,
  48962. e.spotLights.needsUpdate = t,
  48963. e.hemisphereLights.needsUpdate = t
  48964. }
  48965. function N(e, t) {
  48966. Ge.uniformMatrix4fv(e.modelViewMatrix, !1, t.modelViewMatrix.elements),
  48967. e.normalMatrix && Ge.uniformMatrix3fv(e.normalMatrix, !1, t.normalMatrix.elements)
  48968. }
  48969. function B() {
  48970. var e = xe;
  48971. return e >= je.maxTextures && console.warn("WebGLRenderer: trying to use " + e + " texture units while this GPU supports only " + je.maxTextures),
  48972. xe += 1,
  48973. e
  48974. }
  48975. function F(e, t, i, r) {
  48976. var o, a;
  48977. if ("1i" === t)
  48978. Ge.uniform1i(i, r);
  48979. else if ("1f" === t)
  48980. Ge.uniform1f(i, r);
  48981. else if ("2f" === t)
  48982. Ge.uniform2f(i, r[0], r[1]);
  48983. else if ("3f" === t)
  48984. Ge.uniform3f(i, r[0], r[1], r[2]);
  48985. else if ("4f" === t)
  48986. Ge.uniform4f(i, r[0], r[1], r[2], r[3]);
  48987. else if ("1iv" === t)
  48988. Ge.uniform1iv(i, r);
  48989. else if ("3iv" === t)
  48990. Ge.uniform3iv(i, r);
  48991. else if ("1fv" === t)
  48992. Ge.uniform1fv(i, r);
  48993. else if ("2fv" === t)
  48994. Ge.uniform2fv(i, r);
  48995. else if ("3fv" === t)
  48996. Ge.uniform3fv(i, r);
  48997. else if ("4fv" === t)
  48998. Ge.uniform4fv(i, r);
  48999. else if ("Matrix2fv" === t)
  49000. Ge.uniformMatrix2fv(i, !1, r);
  49001. else if ("Matrix3fv" === t)
  49002. Ge.uniformMatrix3fv(i, !1, r);
  49003. else if ("Matrix4fv" === t)
  49004. Ge.uniformMatrix4fv(i, !1, r);
  49005. else if ("i" === t)
  49006. Ge.uniform1i(i, r);
  49007. else if ("f" === t)
  49008. Ge.uniform1f(i, r);
  49009. else if ("v2" === t)
  49010. Ge.uniform2f(i, r.x, r.y);
  49011. else if ("v3" === t)
  49012. Ge.uniform3f(i, r.x, r.y, r.z);
  49013. else if ("v4" === t)
  49014. Ge.uniform4f(i, r.x, r.y, r.z, r.w);
  49015. else if ("c" === t)
  49016. Ge.uniform3f(i, r.r, r.g, r.b);
  49017. else if ("s" === t) {
  49018. var s = e.properties;
  49019. for (var l in s) {
  49020. var c = s[l]
  49021. , h = i[l]
  49022. , u = r[l];
  49023. F(c, c.type, h, u)
  49024. }
  49025. } else if ("sa" === t)
  49026. for (var s = e.properties, d = 0, p = r.length; d < p; d++)
  49027. for (var l in s) {
  49028. var c = s[l]
  49029. , h = i[d][l]
  49030. , u = r[d][l];
  49031. F(c, c.type, h, u)
  49032. }
  49033. else if ("iv1" === t)
  49034. Ge.uniform1iv(i, r);
  49035. else if ("iv" === t)
  49036. Ge.uniform3iv(i, r);
  49037. else if ("fv1" === t)
  49038. Ge.uniform1fv(i, r);
  49039. else if ("fv" === t)
  49040. Ge.uniform3fv(i, r);
  49041. else if ("v2v" === t) {
  49042. void 0 === e._array && (e._array = new Float32Array(2 * r.length));
  49043. for (var d = 0, f = 0, g = r.length; d < g; d++,
  49044. f += 2)
  49045. e._array[f + 0] = r[d].x,
  49046. e._array[f + 1] = r[d].y;
  49047. Ge.uniform2fv(i, e._array)
  49048. } else if ("v3v" === t) {
  49049. void 0 === e._array && (e._array = new Float32Array(3 * r.length));
  49050. for (var d = 0, m = 0, g = r.length; d < g; d++,
  49051. m += 3)
  49052. e._array[m + 0] = r[d].x,
  49053. e._array[m + 1] = r[d].y,
  49054. e._array[m + 2] = r[d].z;
  49055. Ge.uniform3fv(i, e._array)
  49056. } else if ("v4v" === t) {
  49057. void 0 === e._array && (e._array = new Float32Array(4 * r.length));
  49058. for (var d = 0, v = 0, g = r.length; d < g; d++,
  49059. v += 4)
  49060. e._array[v + 0] = r[d].x,
  49061. e._array[v + 1] = r[d].y,
  49062. e._array[v + 2] = r[d].z,
  49063. e._array[v + 3] = r[d].w;
  49064. Ge.uniform4fv(i, e._array)
  49065. } else if ("m2" === t)
  49066. Ge.uniformMatrix2fv(i, !1, r.elements);
  49067. else if ("m3" === t)
  49068. Ge.uniformMatrix3fv(i, !1, r.elements);
  49069. else if ("m3v" === t) {
  49070. void 0 === e._array && (e._array = new Float32Array(9 * r.length));
  49071. for (var d = 0, g = r.length; d < g; d++)
  49072. r[d].flattenToArrayOffset(e._array, 9 * d);
  49073. Ge.uniformMatrix3fv(i, !1, e._array)
  49074. } else if ("m4" === t)
  49075. Ge.uniformMatrix4fv(i, !1, r.elements);
  49076. else if ("m4v" === t) {
  49077. void 0 === e._array && (e._array = new Float32Array(16 * r.length));
  49078. for (var d = 0, g = r.length; d < g; d++)
  49079. r[d].flattenToArrayOffset(e._array, 16 * d);
  49080. Ge.uniformMatrix4fv(i, !1, e._array)
  49081. } else if ("t" === t) {
  49082. if (o = r,
  49083. a = B(),
  49084. Ge.uniform1i(i, a),
  49085. !o)
  49086. return;
  49087. o instanceof n.CubeTexture || Array.isArray(o.image) && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : ve.setTexture(o, a)
  49088. } else if ("tv" === t) {
  49089. void 0 === e._array && (e._array = []);
  49090. for (var d = 0, g = e.value.length; d < g; d++)
  49091. e._array[d] = B();
  49092. Ge.uniform1iv(i, e._array);
  49093. for (var d = 0, g = e.value.length; d < g; d++)
  49094. o = e.value[d],
  49095. a = e._array[d],
  49096. o && (o instanceof n.CubeTexture || o.image instanceof Array && 6 === o.image.length ? Y(o, a) : o instanceof n.WebGLRenderTarget ? ve.setTexture(o.texture, a) : o instanceof n.WebGLRenderTargetCube ? X(o.texture, a) : ve.setTexture(o, a))
  49097. } else
  49098. console.warn("THREE.WebGLRenderer: Unknown uniform type: " + t)
  49099. }
  49100. function V(e) {
  49101. for (var t = 0, i = e.length; t < i; t++) {
  49102. var n = e[t][0];
  49103. if (n.needsUpdate !== !1) {
  49104. var r = n.type
  49105. , o = e[t][1]
  49106. , a = n.value;
  49107. F(n, r, o, a)
  49108. }
  49109. }
  49110. }
  49111. function U(e, t) {
  49112. var i, r, o, a, s, l, c = 0, h = 0, u = 0, d = t.matrixWorldInverse, p = 0, f = 0, g = 0, m = 0, v = 0;
  49113. for (Ue.shadowsPointLight = 0,
  49114. i = 0,
  49115. r = e.length; i < r; i++)
  49116. if (o = e[i],
  49117. a = o.color,
  49118. s = o.intensity,
  49119. l = o.distance,
  49120. o instanceof n.AmbientLight)
  49121. c += a.r * s,
  49122. h += a.g * s,
  49123. u += a.b * s;
  49124. else if (o instanceof n.DirectionalLight) {
  49125. var A = Ke.get(o);
  49126. A.color.copy(o.color).multiplyScalar(o.intensity),
  49127. A.direction.setFromMatrixPosition(o.matrixWorld),
  49128. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49129. A.direction.sub(Ve),
  49130. A.direction.transformDirection(d),
  49131. A.shadow = o.castShadow,
  49132. o.castShadow && (A.shadowBias = o.shadow.bias,
  49133. A.shadowRadius = o.shadow.radius,
  49134. A.shadowMapSize = o.shadow.mapSize,
  49135. Ue.shadows[v++] = o),
  49136. Ue.directionalShadowMap[p] = o.shadow.map,
  49137. Ue.directionalShadowMatrix[p] = o.shadow.matrix,
  49138. Ue.directional[p++] = A
  49139. } else if (o instanceof n.SpotLight) {
  49140. var A = Ke.get(o);
  49141. A.position.setFromMatrixPosition(o.matrixWorld),
  49142. A.position.applyMatrix4(d),
  49143. A.color.copy(a).multiplyScalar(s),
  49144. A.distance = l,
  49145. A.direction.setFromMatrixPosition(o.matrixWorld),
  49146. Ve.setFromMatrixPosition(o.target.matrixWorld),
  49147. A.direction.sub(Ve),
  49148. A.direction.transformDirection(d),
  49149. A.coneCos = Math.cos(o.angle),
  49150. A.penumbraCos = Math.cos(o.angle * (1 - o.penumbra)),
  49151. A.decay = 0 === o.distance ? 0 : o.decay,
  49152. A.shadow = o.castShadow,
  49153. o.castShadow && (A.shadowBias = o.shadow.bias,
  49154. A.shadowRadius = o.shadow.radius,
  49155. A.shadowMapSize = o.shadow.mapSize,
  49156. Ue.shadows[v++] = o),
  49157. Ue.spotShadowMap[g] = o.shadow.map,
  49158. Ue.spotShadowMatrix[g] = o.shadow.matrix,
  49159. Ue.spot[g++] = A
  49160. } else if (o instanceof n.PointLight) {
  49161. var A = Ke.get(o);
  49162. A.position.setFromMatrixPosition(o.matrixWorld),
  49163. A.position.applyMatrix4(d),
  49164. A.color.copy(o.color).multiplyScalar(o.intensity),
  49165. A.distance = o.distance,
  49166. A.decay = 0 === o.distance ? 0 : o.decay,
  49167. A.shadow = o.castShadow,
  49168. o.castShadow && (A.shadowBias = o.shadow.bias,
  49169. A.shadowRadius = o.shadow.radius,
  49170. A.shadowMapSize = o.shadow.mapSize,
  49171. Ue.shadows[v++] = o),
  49172. Ue.pointShadowMap[f] = o.shadow.map,
  49173. void 0 === Ue.pointShadowMatrix[f] && (Ue.pointShadowMatrix[f] = new n.Matrix4),
  49174. Ve.setFromMatrixPosition(o.matrixWorld).negate(),
  49175. Ue.pointShadowMatrix[f].identity().setPosition(Ve),
  49176. Ue.point[f++] = A
  49177. } else if (o instanceof n.HemisphereLight) {
  49178. var A = Ke.get(o);
  49179. A.direction.setFromMatrixPosition(o.matrixWorld),
  49180. A.direction.transformDirection(d),
  49181. A.direction.normalize(),
  49182. A.skyColor.copy(o.color).multiplyScalar(s),
  49183. A.groundColor.copy(o.groundColor).multiplyScalar(s),
  49184. Ue.hemi[m++] = A
  49185. }
  49186. Ue.ambient[0] = c,
  49187. Ue.ambient[1] = h,
  49188. Ue.ambient[2] = u,
  49189. Ue.directional.length = p,
  49190. Ue.spot.length = g,
  49191. Ue.point.length = f,
  49192. Ue.hemi.length = m,
  49193. Ue.shadows.length = v,
  49194. Ue.hash = p + "," + f + "," + g + "," + m + "," + v
  49195. }
  49196. function k(e, t, i) {
  49197. var r;
  49198. if (i ? (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, ee(t.wrapS)),
  49199. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, ee(t.wrapT)),
  49200. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, ee(t.magFilter)),
  49201. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, ee(t.minFilter))) : (Ge.texParameteri(e, Ge.TEXTURE_WRAP_S, Ge.CLAMP_TO_EDGE),
  49202. Ge.texParameteri(e, Ge.TEXTURE_WRAP_T, Ge.CLAMP_TO_EDGE),
  49203. t.wrapS === n.ClampToEdgeWrapping && t.wrapT === n.ClampToEdgeWrapping || console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping.", t),
  49204. Ge.texParameteri(e, Ge.TEXTURE_MAG_FILTER, $(t.magFilter)),
  49205. Ge.texParameteri(e, Ge.TEXTURE_MIN_FILTER, $(t.minFilter)),
  49206. t.minFilter !== n.NearestFilter && t.minFilter !== n.LinearFilter && console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.", t)),
  49207. r = We.get("EXT_texture_filter_anisotropic")) {
  49208. if (t.type === n.FloatType && null === We.get("OES_texture_float_linear"))
  49209. return;
  49210. if (t.type === n.HalfFloatType && null === We.get("OES_texture_half_float_linear"))
  49211. return;
  49212. (t.anisotropy > 1 || Xe.get(t).__currentAnisotropy) && (Ge.texParameterf(e, r.TEXTURE_MAX_ANISOTROPY_EXT, Math.min(t.anisotropy, ve.getMaxAnisotropy())),
  49213. Xe.get(t).__currentAnisotropy = t.anisotropy)
  49214. }
  49215. }
  49216. function H(e, t, i) {
  49217. void 0 === e.__webglInit && (e.__webglInit = !0,
  49218. t.addEventListener("dispose", s),
  49219. e.__webglTexture = Ge.createTexture(),
  49220. ke.textures++),
  49221. Ye.activeTexture(Ge.TEXTURE0 + i),
  49222. Ye.bindTexture(Ge.TEXTURE_2D, e.__webglTexture),
  49223. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, t.flipY),
  49224. Ge.pixelStorei(Ge.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t.premultiplyAlpha),
  49225. Ge.pixelStorei(Ge.UNPACK_ALIGNMENT, t.unpackAlignment);
  49226. var r = G(t.image, je.maxTextureSize);
  49227. W(t) && z(r) === !1 && (r = j(r));
  49228. var o = z(r)
  49229. , a = ee(t.format)
  49230. , l = ee(t.type);
  49231. k(Ge.TEXTURE_2D, t, o);
  49232. var c, h = t.mipmaps;
  49233. if (t instanceof n.DataTexture)
  49234. if (h.length > 0 && o) {
  49235. for (var u = 0, d = h.length; u < d; u++)
  49236. c = h[u],
  49237. Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49238. t.generateMipmaps = !1
  49239. } else
  49240. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, r.width, r.height, 0, a, l, r.data);
  49241. else if (t instanceof n.CompressedTexture)
  49242. for (var u = 0, d = h.length; u < d; u++)
  49243. c = h[u],
  49244. t.format !== n.RGBAFormat && t.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(a) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, c.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()") : Ye.texImage2D(Ge.TEXTURE_2D, u, a, c.width, c.height, 0, a, l, c.data);
  49245. else if (h.length > 0 && o) {
  49246. for (var u = 0, d = h.length; u < d; u++)
  49247. c = h[u],
  49248. Ye.texImage2D(Ge.TEXTURE_2D, u, a, a, l, c);
  49249. t.generateMipmaps = !1
  49250. } else
  49251. Ye.texImage2D(Ge.TEXTURE_2D, 0, a, a, l, r);
  49252. t.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49253. e.__version = t.version,
  49254. t.onUpdate && t.onUpdate(t)
  49255. }
  49256. function G(e, t) {
  49257. if (e.width > t || e.height > t) {
  49258. var i = t / Math.max(e.width, e.height)
  49259. , n = document.createElement("canvas");
  49260. n.width = Math.floor(e.width * i),
  49261. n.height = Math.floor(e.height * i);
  49262. var r = n.getContext("2d");
  49263. return r.drawImage(e, 0, 0, e.width, e.height, 0, 0, n.width, n.height),
  49264. console.warn("THREE.WebGLRenderer: image is too big (" + e.width + "x" + e.height + "). Resized to " + n.width + "x" + n.height, e),
  49265. n
  49266. }
  49267. return e
  49268. }
  49269. function z(e) {
  49270. return n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height)
  49271. }
  49272. function W(e) {
  49273. return e.wrapS !== n.ClampToEdgeWrapping || e.wrapT !== n.ClampToEdgeWrapping || e.minFilter !== n.NearestFilter && e.minFilter !== n.LinearFilter
  49274. }
  49275. function j(e) {
  49276. if (e instanceof HTMLImageElement || e instanceof HTMLCanvasElement) {
  49277. var t = document.createElement("canvas");
  49278. t.width = n.Math.nearestPowerOfTwo(e.width),
  49279. t.height = n.Math.nearestPowerOfTwo(e.height);
  49280. var i = t.getContext("2d");
  49281. return i.drawImage(e, 0, 0, t.width, t.height),
  49282. console.warn("THREE.WebGLRenderer: image is not power of two (" + e.width + "x" + e.height + "). Resized to " + t.width + "x" + t.height, e),
  49283. t
  49284. }
  49285. return e
  49286. }
  49287. function Y(e, t) {
  49288. var i = Xe.get(e);
  49289. if (6 === e.image.length)
  49290. if (e.version > 0 && i.__version !== e.version) {
  49291. i.__image__webglTextureCube || (e.addEventListener("dispose", s),
  49292. i.__image__webglTextureCube = Ge.createTexture(),
  49293. ke.textures++),
  49294. Ye.activeTexture(Ge.TEXTURE0 + t),
  49295. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube),
  49296. Ge.pixelStorei(Ge.UNPACK_FLIP_Y_WEBGL, e.flipY);
  49297. for (var r = e instanceof n.CompressedTexture, o = e.image[0]instanceof n.DataTexture, a = [], l = 0; l < 6; l++)
  49298. !ve.autoScaleCubemaps || r || o ? a[l] = o ? e.image[l].image : e.image[l] : a[l] = G(e.image[l], je.maxCubemapSize);
  49299. var c = a[0]
  49300. , h = z(c)
  49301. , u = ee(e.format)
  49302. , d = ee(e.type);
  49303. k(Ge.TEXTURE_CUBE_MAP, e, h);
  49304. for (var l = 0; l < 6; l++)
  49305. if (r)
  49306. for (var p, f = a[l].mipmaps, g = 0, m = f.length; g < m; g++)
  49307. p = f[g],
  49308. e.format !== n.RGBAFormat && e.format !== n.RGBFormat ? Ye.getCompressedTextureFormats().indexOf(u) > -1 ? Ye.compressedTexImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, p.data) : console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()") : Ye.texImage2D(Ge.TEXTURE_CUBE_MAP_POSITIVE_X + l, g, u, p.width, p.height, 0, u, d, p.data);
  49309. else
  49310. 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]);
  49311. e.generateMipmaps && h && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49312. i.__version = e.version,
  49313. e.onUpdate && e.onUpdate(e)
  49314. } else
  49315. Ye.activeTexture(Ge.TEXTURE0 + t),
  49316. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__image__webglTextureCube)
  49317. }
  49318. function X(e, t) {
  49319. Ye.activeTexture(Ge.TEXTURE0 + t),
  49320. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, Xe.get(e).__webglTexture)
  49321. }
  49322. function Z(e, t, i, n) {
  49323. var r = ee(t.texture.format)
  49324. , o = ee(t.texture.type);
  49325. Ye.texImage2D(n, 0, r, t.width, t.height, 0, r, o, null),
  49326. Ge.bindFramebuffer(Ge.FRAMEBUFFER, e),
  49327. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, i, n, Xe.get(t.texture).__webglTexture, 0),
  49328. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49329. }
  49330. function q(e, t) {
  49331. Ge.bindRenderbuffer(Ge.RENDERBUFFER, e),
  49332. t.depthBuffer && !t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_COMPONENT16, t.width, t.height),
  49333. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_ATTACHMENT, Ge.RENDERBUFFER, e)) : t.depthBuffer && t.stencilBuffer ? (Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.DEPTH_STENCIL, t.width, t.height),
  49334. Ge.framebufferRenderbuffer(Ge.FRAMEBUFFER, Ge.DEPTH_STENCIL_ATTACHMENT, Ge.RENDERBUFFER, e)) : Ge.renderbufferStorage(Ge.RENDERBUFFER, Ge.RGBA4, t.width, t.height),
  49335. Ge.bindRenderbuffer(Ge.RENDERBUFFER, null)
  49336. }
  49337. function K(e) {
  49338. var t = Xe.get(e)
  49339. , i = e instanceof n.WebGLRenderTargetCube;
  49340. if (i) {
  49341. t.__webglDepthbuffer = [];
  49342. for (var r = 0; r < 6; r++)
  49343. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer[r]),
  49344. t.__webglDepthbuffer[r] = Ge.createRenderbuffer(),
  49345. q(t.__webglDepthbuffer[r], e)
  49346. } else
  49347. Ge.bindFramebuffer(Ge.FRAMEBUFFER, t.__webglFramebuffer),
  49348. t.__webglDepthbuffer = Ge.createRenderbuffer(),
  49349. q(t.__webglDepthbuffer, e);
  49350. Ge.bindFramebuffer(Ge.FRAMEBUFFER, null)
  49351. }
  49352. function Q(e) {
  49353. var t = Xe.get(e)
  49354. , i = Xe.get(e.texture);
  49355. e.addEventListener("dispose", l),
  49356. i.__webglTexture = Ge.createTexture(),
  49357. ke.textures++;
  49358. var r = e instanceof n.WebGLRenderTargetCube
  49359. , o = n.Math.isPowerOfTwo(e.width) && n.Math.isPowerOfTwo(e.height);
  49360. if (r) {
  49361. t.__webglFramebuffer = [];
  49362. for (var a = 0; a < 6; a++)
  49363. t.__webglFramebuffer[a] = Ge.createFramebuffer()
  49364. } else
  49365. t.__webglFramebuffer = Ge.createFramebuffer();
  49366. if (r) {
  49367. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, i.__webglTexture),
  49368. k(Ge.TEXTURE_CUBE_MAP, e.texture, o);
  49369. for (var a = 0; a < 6; a++)
  49370. Z(t.__webglFramebuffer[a], e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + a);
  49371. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_CUBE_MAP),
  49372. Ye.bindTexture(Ge.TEXTURE_CUBE_MAP, null)
  49373. } else
  49374. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture),
  49375. k(Ge.TEXTURE_2D, e.texture, o),
  49376. Z(t.__webglFramebuffer, e, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_2D),
  49377. e.texture.generateMipmaps && o && Ge.generateMipmap(Ge.TEXTURE_2D),
  49378. Ye.bindTexture(Ge.TEXTURE_2D, null);
  49379. e.depthBuffer && K(e)
  49380. }
  49381. function J(e) {
  49382. var t = e instanceof n.WebGLRenderTargetCube ? Ge.TEXTURE_CUBE_MAP : Ge.TEXTURE_2D
  49383. , i = Xe.get(e.texture).__webglTexture;
  49384. Ye.bindTexture(t, i),
  49385. Ge.generateMipmap(t),
  49386. Ye.bindTexture(t, null)
  49387. }
  49388. function $(e) {
  49389. return e === n.NearestFilter || e === n.NearestMipMapNearestFilter || e === n.NearestMipMapLinearFilter ? Ge.NEAREST : Ge.LINEAR
  49390. }
  49391. function ee(e) {
  49392. var t;
  49393. if (e === n.RepeatWrapping)
  49394. return Ge.REPEAT;
  49395. if (e === n.ClampToEdgeWrapping)
  49396. return Ge.CLAMP_TO_EDGE;
  49397. if (e === n.MirroredRepeatWrapping)
  49398. return Ge.MIRRORED_REPEAT;
  49399. if (e === n.NearestFilter)
  49400. return Ge.NEAREST;
  49401. if (e === n.NearestMipMapNearestFilter)
  49402. return Ge.NEAREST_MIPMAP_NEAREST;
  49403. if (e === n.NearestMipMapLinearFilter)
  49404. return Ge.NEAREST_MIPMAP_LINEAR;
  49405. if (e === n.LinearFilter)
  49406. return Ge.LINEAR;
  49407. if (e === n.LinearMipMapNearestFilter)
  49408. return Ge.LINEAR_MIPMAP_NEAREST;
  49409. if (e === n.LinearMipMapLinearFilter)
  49410. return Ge.LINEAR_MIPMAP_LINEAR;
  49411. if (e === n.UnsignedByteType)
  49412. return Ge.UNSIGNED_BYTE;
  49413. if (e === n.UnsignedShort4444Type)
  49414. return Ge.UNSIGNED_SHORT_4_4_4_4;
  49415. if (e === n.UnsignedShort5551Type)
  49416. return Ge.UNSIGNED_SHORT_5_5_5_1;
  49417. if (e === n.UnsignedShort565Type)
  49418. return Ge.UNSIGNED_SHORT_5_6_5;
  49419. if (e === n.ByteType)
  49420. return Ge.BYTE;
  49421. if (e === n.ShortType)
  49422. return Ge.SHORT;
  49423. if (e === n.UnsignedShortType)
  49424. return Ge.UNSIGNED_SHORT;
  49425. if (e === n.IntType)
  49426. return Ge.INT;
  49427. if (e === n.UnsignedIntType)
  49428. return Ge.UNSIGNED_INT;
  49429. if (e === n.FloatType)
  49430. return Ge.FLOAT;
  49431. if (t = We.get("OES_texture_half_float"),
  49432. null !== t && e === n.HalfFloatType)
  49433. return t.HALF_FLOAT_OES;
  49434. if (e === n.AlphaFormat)
  49435. return Ge.ALPHA;
  49436. if (e === n.RGBFormat)
  49437. return Ge.RGB;
  49438. if (e === n.RGBAFormat)
  49439. return Ge.RGBA;
  49440. if (e === n.LuminanceFormat)
  49441. return Ge.LUMINANCE;
  49442. if (e === n.LuminanceAlphaFormat)
  49443. return Ge.LUMINANCE_ALPHA;
  49444. if (e === n.AddEquation)
  49445. return Ge.FUNC_ADD;
  49446. if (e === n.SubtractEquation)
  49447. return Ge.FUNC_SUBTRACT;
  49448. if (e === n.ReverseSubtractEquation)
  49449. return Ge.FUNC_REVERSE_SUBTRACT;
  49450. if (e === n.ZeroFactor)
  49451. return Ge.ZERO;
  49452. if (e === n.OneFactor)
  49453. return Ge.ONE;
  49454. if (e === n.SrcColorFactor)
  49455. return Ge.SRC_COLOR;
  49456. if (e === n.OneMinusSrcColorFactor)
  49457. return Ge.ONE_MINUS_SRC_COLOR;
  49458. if (e === n.SrcAlphaFactor)
  49459. return Ge.SRC_ALPHA;
  49460. if (e === n.OneMinusSrcAlphaFactor)
  49461. return Ge.ONE_MINUS_SRC_ALPHA;
  49462. if (e === n.DstAlphaFactor)
  49463. return Ge.DST_ALPHA;
  49464. if (e === n.OneMinusDstAlphaFactor)
  49465. return Ge.ONE_MINUS_DST_ALPHA;
  49466. if (e === n.DstColorFactor)
  49467. return Ge.DST_COLOR;
  49468. if (e === n.OneMinusDstColorFactor)
  49469. return Ge.ONE_MINUS_DST_COLOR;
  49470. if (e === n.SrcAlphaSaturateFactor)
  49471. return Ge.SRC_ALPHA_SATURATE;
  49472. if (t = We.get("WEBGL_compressed_texture_s3tc"),
  49473. null !== t) {
  49474. if (e === n.RGB_S3TC_DXT1_Format)
  49475. return t.COMPRESSED_RGB_S3TC_DXT1_EXT;
  49476. if (e === n.RGBA_S3TC_DXT1_Format)
  49477. return t.COMPRESSED_RGBA_S3TC_DXT1_EXT;
  49478. if (e === n.RGBA_S3TC_DXT3_Format)
  49479. return t.COMPRESSED_RGBA_S3TC_DXT3_EXT;
  49480. if (e === n.RGBA_S3TC_DXT5_Format)
  49481. return t.COMPRESSED_RGBA_S3TC_DXT5_EXT
  49482. }
  49483. if (t = We.get("WEBGL_compressed_texture_pvrtc"),
  49484. null !== t) {
  49485. if (e === n.RGB_PVRTC_4BPPV1_Format)
  49486. return t.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;
  49487. if (e === n.RGB_PVRTC_2BPPV1_Format)
  49488. return t.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;
  49489. if (e === n.RGBA_PVRTC_4BPPV1_Format)
  49490. return t.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;
  49491. if (e === n.RGBA_PVRTC_2BPPV1_Format)
  49492. return t.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG
  49493. }
  49494. if (t = We.get("WEBGL_compressed_texture_etc1"),
  49495. null !== t && e === n.RGB_ETC1_Format)
  49496. return t.COMPRESSED_RGB_ETC1_WEBGL;
  49497. if (t = We.get("EXT_blend_minmax"),
  49498. null !== t) {
  49499. if (e === n.MinEquation)
  49500. return t.MIN_EXT;
  49501. if (e === n.MaxEquation)
  49502. return t.MAX_EXT
  49503. }
  49504. return 0
  49505. }
  49506. console.log("THREE.WebGLRenderer", n.REVISION),
  49507. e = e || {};
  49508. var te = void 0 !== e.canvas ? e.canvas : document.createElement("canvas")
  49509. , ie = void 0 !== e.context ? e.context : null
  49510. , ne = void 0 !== e.alpha && e.alpha
  49511. , re = void 0 === e.depth || e.depth
  49512. , oe = void 0 === e.stencil || e.stencil
  49513. , ae = void 0 !== e.antialias && e.antialias
  49514. , se = void 0 === e.premultipliedAlpha || e.premultipliedAlpha
  49515. , le = void 0 !== e.preserveDrawingBuffer && e.preserveDrawingBuffer
  49516. , ce = []
  49517. , he = []
  49518. , ue = -1
  49519. , de = []
  49520. , pe = -1
  49521. , fe = new Float32Array(8)
  49522. , ge = []
  49523. , me = [];
  49524. this.domElement = te,
  49525. this.context = null,
  49526. this.autoClear = !0,
  49527. this.autoClearColor = !0,
  49528. this.autoClearDepth = !0,
  49529. this.autoClearStencil = !0,
  49530. this.sortObjects = !0,
  49531. this.gammaFactor = 2,
  49532. this.gammaInput = !1,
  49533. this.gammaOutput = !1,
  49534. this.physicallyCorrectLights = !1,
  49535. this.toneMapping = n.LinearToneMapping,
  49536. this.toneMappingExposure = 1,
  49537. this.toneMappingWhitePoint = 1,
  49538. this.maxMorphTargets = 8,
  49539. this.maxMorphNormals = 4,
  49540. this.autoScaleCubemaps = !0;
  49541. var ve = this
  49542. , Ae = null
  49543. , ye = null
  49544. , Ce = null
  49545. , Ie = -1
  49546. , Ee = ""
  49547. , be = null
  49548. , we = new n.Vector4
  49549. , _e = null
  49550. , Te = new n.Vector4
  49551. , xe = 0
  49552. , Se = new n.Color(0)
  49553. , Me = 0
  49554. , Re = te.width
  49555. , Pe = te.height
  49556. , Oe = 1
  49557. , Le = new n.Vector4(0,0,Re,Pe)
  49558. , De = !1
  49559. , Ne = new n.Vector4(0,0,Re,Pe)
  49560. , Be = new n.Frustum
  49561. , Fe = new n.Matrix4
  49562. , Ve = new n.Vector3
  49563. , Ue = {
  49564. hash: "",
  49565. ambient: [0, 0, 0],
  49566. directional: [],
  49567. directionalShadowMap: [],
  49568. directionalShadowMatrix: [],
  49569. spot: [],
  49570. spotShadowMap: [],
  49571. spotShadowMatrix: [],
  49572. point: [],
  49573. pointShadowMap: [],
  49574. pointShadowMatrix: [],
  49575. hemi: [],
  49576. shadows: [],
  49577. shadowsPointLight: 0
  49578. }
  49579. , ke = {
  49580. geometries: 0,
  49581. textures: 0
  49582. }
  49583. , He = {
  49584. calls: 0,
  49585. vertices: 0,
  49586. faces: 0,
  49587. points: 0
  49588. };
  49589. this.info = {
  49590. render: He,
  49591. memory: ke,
  49592. programs: null
  49593. };
  49594. var Ge;
  49595. try {
  49596. var ze = {
  49597. alpha: ne,
  49598. depth: re,
  49599. stencil: oe,
  49600. antialias: ae,
  49601. premultipliedAlpha: se,
  49602. preserveDrawingBuffer: le
  49603. };
  49604. if (Ge = ie || te.getContext("webgl", ze) || te.getContext("experimental-webgl", ze),
  49605. null === Ge)
  49606. throw null !== te.getContext("webgl") ? "Error creating WebGL context with your selected attributes." : "Error creating WebGL context.";
  49607. void 0 === Ge.getShaderPrecisionFormat && (Ge.getShaderPrecisionFormat = function() {
  49608. return {
  49609. rangeMin: 1,
  49610. rangeMax: 1,
  49611. precision: 1
  49612. }
  49613. }
  49614. ),
  49615. te.addEventListener("webglcontextlost", a, !1)
  49616. } catch (e) {
  49617. console.error("THREE.WebGLRenderer: " + e)
  49618. }
  49619. var We = new n.WebGLExtensions(Ge);
  49620. We.get("OES_texture_float"),
  49621. We.get("OES_texture_float_linear"),
  49622. We.get("OES_texture_half_float"),
  49623. We.get("OES_texture_half_float_linear"),
  49624. We.get("OES_standard_derivatives"),
  49625. We.get("ANGLE_instanced_arrays"),
  49626. We.get("OES_element_index_uint") && (n.BufferGeometry.MaxIndex = 4294967296);
  49627. var je = new n.WebGLCapabilities(Ge,We,e)
  49628. , Ye = new n.WebGLState(Ge,We,ee)
  49629. , Xe = new n.WebGLProperties
  49630. , Ze = new n.WebGLObjects(Ge,Xe,this.info)
  49631. , qe = new n.WebGLPrograms(this,je)
  49632. , Ke = new n.WebGLLights;
  49633. this.info.programs = qe.programs;
  49634. var Qe = new n.WebGLBufferRenderer(Ge,We,He)
  49635. , Je = new n.WebGLIndexedBufferRenderer(Ge,We,He);
  49636. r(),
  49637. this.context = Ge,
  49638. this.capabilities = je,
  49639. this.extensions = We,
  49640. this.properties = Xe,
  49641. this.state = Ye;
  49642. var $e = new n.WebGLShadowMap(this,Ue,Ze);
  49643. this.shadowMap = $e;
  49644. var et = new n.SpritePlugin(this,ge)
  49645. , tt = new n.LensFlarePlugin(this,me);
  49646. this.getContext = function() {
  49647. return Ge
  49648. }
  49649. ,
  49650. this.getContextAttributes = function() {
  49651. return Ge.getContextAttributes()
  49652. }
  49653. ,
  49654. this.forceContextLoss = function() {
  49655. We.get("WEBGL_lose_context").loseContext()
  49656. }
  49657. ,
  49658. this.getMaxAnisotropy = function() {
  49659. var e;
  49660. return function() {
  49661. if (void 0 !== e)
  49662. return e;
  49663. var t = We.get("EXT_texture_filter_anisotropic");
  49664. return e = null !== t ? Ge.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 0
  49665. }
  49666. }(),
  49667. this.getPrecision = function() {
  49668. return je.precision
  49669. }
  49670. ,
  49671. this.getPixelRatio = function() {
  49672. return Oe
  49673. }
  49674. ,
  49675. this.setPixelRatio = function(e) {
  49676. void 0 !== e && (Oe = e,
  49677. this.setSize(Ne.z, Ne.w, !1))
  49678. }
  49679. ,
  49680. this.getSize = function() {
  49681. return {
  49682. width: Re,
  49683. height: Pe
  49684. }
  49685. }
  49686. ,
  49687. this.setSize = function(e, t, i, devicePixelRatio) {
  49688. if(devicePixelRatio != void 0) Oe = devicePixelRatio; //xzw add 改分辨率 始终保持清晰
  49689. Re = e,
  49690. Pe = t,
  49691. te.width = e * Oe,
  49692. te.height = t * Oe,
  49693. i !== !1 && (te.style.width = e + "px",
  49694. te.style.height = t + "px"),
  49695. this.setViewport(0, 0, e, t)
  49696. }
  49697. ,
  49698. this.setViewport = function(e, t, i, n) {
  49699. Ye.viewport(Ne.set(e, t, i, n))
  49700. }
  49701. ,
  49702. this.setScissor = function(e, t, i, n) {
  49703. Ye.scissor(Le.set(e, t, i, n))
  49704. }
  49705. ,
  49706. this.setScissorTest = function(e) {
  49707. Ye.setScissorTest(De = e)
  49708. }
  49709. ,
  49710. this.getClearColor = function() {
  49711. return Se
  49712. }
  49713. ,
  49714. this.setClearColor = function(e, t) {
  49715. Se.set(e),
  49716. Me = void 0 !== t ? t : 1,
  49717. i(Se.r, Se.g, Se.b, Me)
  49718. }
  49719. ,
  49720. this.getClearAlpha = function() {
  49721. return Me
  49722. }
  49723. ,
  49724. this.setClearAlpha = function(e) {
  49725. Me = e,
  49726. i(Se.r, Se.g, Se.b, Me)
  49727. }
  49728. ,
  49729. this.clear = function(e, t, i) {
  49730. var n = 0;
  49731. (void 0 === e || e) && (n |= Ge.COLOR_BUFFER_BIT),
  49732. (void 0 === t || t) && (n |= Ge.DEPTH_BUFFER_BIT),
  49733. (void 0 === i || i) && (n |= Ge.STENCIL_BUFFER_BIT),
  49734. Ge.clear(n)
  49735. }
  49736. ,
  49737. this.clearColor = function() {
  49738. this.clear(!0, !1, !1)
  49739. }
  49740. ,
  49741. this.clearDepth = function() {
  49742. this.clear(!1, !0, !1)
  49743. }
  49744. ,
  49745. this.clearStencil = function() {
  49746. this.clear(!1, !1, !0)
  49747. }
  49748. ,
  49749. this.clearTarget = function(e, t, i, n) {
  49750. this.setRenderTarget(e),
  49751. this.clear(t, i, n)
  49752. }
  49753. ,
  49754. this.resetGLState = o,
  49755. this.dispose = function() {
  49756. te.removeEventListener("webglcontextlost", a, !1)
  49757. }
  49758. ,
  49759. this.renderBufferImmediate = function(e, t, i) {
  49760. Ye.initAttributes();
  49761. var r = Xe.get(e);
  49762. e.hasPositions && !r.position && (r.position = Ge.createBuffer()),
  49763. e.hasNormals && !r.normal && (r.normal = Ge.createBuffer()),
  49764. e.hasUvs && !r.uv && (r.uv = Ge.createBuffer()),
  49765. e.hasColors && !r.color && (r.color = Ge.createBuffer());
  49766. var o = t.getAttributes();
  49767. if (e.hasPositions && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.position),
  49768. Ge.bufferData(Ge.ARRAY_BUFFER, e.positionArray, Ge.DYNAMIC_DRAW),
  49769. Ye.enableAttribute(o.position),
  49770. Ge.vertexAttribPointer(o.position, 3, Ge.FLOAT, !1, 0, 0)),
  49771. e.hasNormals) {
  49772. if (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.normal),
  49773. "MeshPhongMaterial" !== i.type && "MeshStandardMaterial" !== i.type && i.shading === n.FlatShading)
  49774. for (var a = 0, s = 3 * e.count; a < s; a += 9) {
  49775. var l = e.normalArray
  49776. , c = (l[a + 0] + l[a + 3] + l[a + 6]) / 3
  49777. , h = (l[a + 1] + l[a + 4] + l[a + 7]) / 3
  49778. , u = (l[a + 2] + l[a + 5] + l[a + 8]) / 3;
  49779. l[a + 0] = c,
  49780. l[a + 1] = h,
  49781. l[a + 2] = u,
  49782. l[a + 3] = c,
  49783. l[a + 4] = h,
  49784. l[a + 5] = u,
  49785. l[a + 6] = c,
  49786. l[a + 7] = h,
  49787. l[a + 8] = u
  49788. }
  49789. Ge.bufferData(Ge.ARRAY_BUFFER, e.normalArray, Ge.DYNAMIC_DRAW),
  49790. Ye.enableAttribute(o.normal),
  49791. Ge.vertexAttribPointer(o.normal, 3, Ge.FLOAT, !1, 0, 0)
  49792. }
  49793. e.hasUvs && i.map && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.uv),
  49794. Ge.bufferData(Ge.ARRAY_BUFFER, e.uvArray, Ge.DYNAMIC_DRAW),
  49795. Ye.enableAttribute(o.uv),
  49796. Ge.vertexAttribPointer(o.uv, 2, Ge.FLOAT, !1, 0, 0)),
  49797. e.hasColors && i.vertexColors !== n.NoColors && (Ge.bindBuffer(Ge.ARRAY_BUFFER, r.color),
  49798. Ge.bufferData(Ge.ARRAY_BUFFER, e.colorArray, Ge.DYNAMIC_DRAW),
  49799. Ye.enableAttribute(o.color),
  49800. Ge.vertexAttribPointer(o.color, 3, Ge.FLOAT, !1, 0, 0)),
  49801. Ye.disableUnusedAttributes(),
  49802. Ge.drawArrays(Ge.TRIANGLES, 0, e.count),
  49803. e.count = 0
  49804. }
  49805. ,
  49806. this.renderBufferDirect = function(e, i, r, o, a, s) {
  49807. E(o);
  49808. var l = w(e, i, o, a)
  49809. , c = !1
  49810. , h = r.id + "_" + l.id + "_" + o.wireframe;
  49811. h !== Ee && (Ee = h,
  49812. c = !0);
  49813. var u = a.morphTargetInfluences;
  49814. if (void 0 !== u) {
  49815. for (var d = [], p = 0, m = u.length; p < m; p++) {
  49816. var v = u[p];
  49817. d.push([v, p])
  49818. }
  49819. d.sort(g),
  49820. d.length > 8 && (d.length = 8);
  49821. for (var A = r.morphAttributes, p = 0, m = d.length; p < m; p++) {
  49822. var v = d[p];
  49823. if (fe[p] = v[0],
  49824. 0 !== v[0]) {
  49825. var y = v[1];
  49826. o.morphTargets === !0 && A.position && r.addAttribute("morphTarget" + p, A.position[y]),
  49827. o.morphNormals === !0 && A.normal && r.addAttribute("morphNormal" + p, A.normal[y])
  49828. } else
  49829. o.morphTargets === !0 && r.removeAttribute("morphTarget" + p),
  49830. o.morphNormals === !0 && r.removeAttribute("morphNormal" + p)
  49831. }
  49832. var C = l.getUniforms();
  49833. null !== C.morphTargetInfluences && Ge.uniform1fv(C.morphTargetInfluences, fe),
  49834. c = !0
  49835. }
  49836. var y = r.index
  49837. , I = r.attributes.position;
  49838. o.wireframe === !0 && (y = Ze.getWireframeAttribute(r));
  49839. var b;
  49840. null !== y ? (b = Je,
  49841. b.setIndex(y)) : b = Qe,
  49842. c && (f(o, l, r),
  49843. null !== y && Ge.bindBuffer(Ge.ELEMENT_ARRAY_BUFFER, Ze.getAttributeBuffer(y)));
  49844. var _ = 0
  49845. , T = 1 / 0;
  49846. null !== y ? T = y.count : void 0 !== I && (T = I.count);
  49847. var x = r.drawRange.start
  49848. , S = r.drawRange.count
  49849. , M = null !== s ? s.start : 0
  49850. , R = null !== s ? s.count : 1 / 0
  49851. , P = Math.max(_, x, M)
  49852. , O = Math.min(_ + T, x + S, M + R) - 1
  49853. , L = Math.max(0, O - P + 1);
  49854. if (a instanceof n.Mesh)
  49855. if (o.wireframe === !0)
  49856. Ye.setLineWidth(o.wireframeLinewidth * t()),
  49857. b.setMode(Ge.LINES);
  49858. else
  49859. switch (a.drawMode) {
  49860. case n.TrianglesDrawMode:
  49861. b.setMode(Ge.TRIANGLES);
  49862. break;
  49863. case n.TriangleStripDrawMode:
  49864. b.setMode(Ge.TRIANGLE_STRIP);
  49865. break;
  49866. case n.TriangleFanDrawMode:
  49867. b.setMode(Ge.TRIANGLE_FAN)
  49868. }
  49869. else if (a instanceof n.Line) {
  49870. var D = o.linewidth;
  49871. void 0 === D && (D = 1),
  49872. Ye.setLineWidth(D * t()),
  49873. a instanceof n.LineSegments ? b.setMode(Ge.LINES) : b.setMode(Ge.LINE_STRIP)
  49874. } else
  49875. a instanceof n.Points && b.setMode(Ge.POINTS);
  49876. r instanceof n.InstancedBufferGeometry ? r.maxInstancedCount > 0 && b.renderInstances(r, P, L) : b.render(P, L)
  49877. }
  49878. ,
  49879. this.render = function(e, t, i, r) {
  49880. if (t instanceof n.Camera == !1)
  49881. return void console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");
  49882. var o = e.fog;
  49883. if (Ee = "",
  49884. Ie = -1,
  49885. be = null,
  49886. e.autoUpdate === !0 && e.updateMatrixWorld(),
  49887. null === t.parent && t.updateMatrixWorld(),
  49888. t.matrixWorldInverse.getInverse(t.matrixWorld),
  49889. Fe.multiplyMatrices(t.projectionMatrix, t.matrixWorldInverse),
  49890. Be.setFromMatrix(Fe),
  49891. ce.length = 0,
  49892. ue = -1,
  49893. pe = -1,
  49894. ge.length = 0,
  49895. me.length = 0,
  49896. y(e, t),
  49897. he.length = ue + 1,
  49898. de.length = pe + 1,
  49899. ve.sortObjects === !0 && (he.sort(m),
  49900. de.sort(v)),
  49901. U(ce, t),
  49902. $e.render(e, t),
  49903. He.calls = 0,
  49904. He.vertices = 0,
  49905. He.faces = 0,
  49906. He.points = 0,
  49907. void 0 === i && (i = null),
  49908. this.setRenderTarget(i),
  49909. (this.autoClear || r) && this.clear(this.autoClearColor, this.autoClearDepth, this.autoClearStencil),
  49910. e.overrideMaterial) {
  49911. var a = e.overrideMaterial;
  49912. C(he, t, o, a),
  49913. C(de, t, o, a)
  49914. } else
  49915. Ye.setBlending(n.NoBlending),
  49916. C(he, t, o),
  49917. C(de, t, o);
  49918. if (et.render(e, t),
  49919. tt.render(e, t, Te),
  49920. i) {
  49921. var s = i.texture;
  49922. s.generateMipmaps && z(i) && s.minFilter !== n.NearestFilter && s.minFilter !== n.LinearFilter && J(i)
  49923. }
  49924. Ye.setDepthTest(!0),
  49925. Ye.setDepthWrite(!0),
  49926. Ye.setColorWrite(!0)
  49927. }
  49928. ,
  49929. this.setFaceCulling = function(e, t) {
  49930. e === n.CullFaceNone ? Ye.disable(Ge.CULL_FACE) : (t === n.FrontFaceDirectionCW ? Ge.frontFace(Ge.CW) : Ge.frontFace(Ge.CCW),
  49931. e === n.CullFaceBack ? Ge.cullFace(Ge.BACK) : e === n.CullFaceFront ? Ge.cullFace(Ge.FRONT) : Ge.cullFace(Ge.FRONT_AND_BACK),
  49932. Ye.enable(Ge.CULL_FACE))
  49933. }
  49934. ,
  49935. this.setTexture = function(e, t) {
  49936. var i = Xe.get(e);
  49937. if (e.version > 0 && i.__version !== e.version) {
  49938. var n = e.image;
  49939. return void 0 === n ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is undefined", e) : n.complete === !1 ? void console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete", e) : void H(i, e, t)
  49940. }
  49941. Ye.activeTexture(Ge.TEXTURE0 + t),
  49942. Ye.bindTexture(Ge.TEXTURE_2D, i.__webglTexture)
  49943. }
  49944. ,
  49945. this.getCurrentRenderTarget = function() {
  49946. return ye
  49947. }
  49948. ,
  49949. this.setRenderTarget = function(e) {
  49950. ye = e,
  49951. e && void 0 === Xe.get(e).__webglFramebuffer && Q(e);
  49952. var t, i = e instanceof n.WebGLRenderTargetCube;
  49953. if (e) {
  49954. var r = Xe.get(e);
  49955. t = i ? r.__webglFramebuffer[e.activeCubeFace] : r.__webglFramebuffer,
  49956. we.copy(e.scissor),
  49957. _e = e.scissorTest,
  49958. Te.copy(e.viewport)
  49959. } else
  49960. t = null,
  49961. we.copy(Le).multiplyScalar(Oe),
  49962. _e = De,
  49963. Te.copy(Ne).multiplyScalar(Oe);
  49964. if (Ce !== t && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, t),
  49965. Ce = t),
  49966. Ye.scissor(we),
  49967. Ye.setScissorTest(_e),
  49968. Ye.viewport(Te),
  49969. i) {
  49970. var o = Xe.get(e.texture);
  49971. Ge.framebufferTexture2D(Ge.FRAMEBUFFER, Ge.COLOR_ATTACHMENT0, Ge.TEXTURE_CUBE_MAP_POSITIVE_X + e.activeCubeFace, o.__webglTexture, e.activeMipMapLevel)
  49972. }
  49973. }
  49974. ,
  49975. this.readRenderTargetPixels = function(e, t, i, r, o, a) {
  49976. if (e instanceof n.WebGLRenderTarget == !1)
  49977. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");
  49978. var s = Xe.get(e).__webglFramebuffer;
  49979. if (s) {
  49980. var l = !1;
  49981. s !== Ce && (Ge.bindFramebuffer(Ge.FRAMEBUFFER, s),
  49982. l = !0);
  49983. try {
  49984. var c = e.texture;
  49985. if (c.format !== n.RGBAFormat && ee(c.format) !== Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_FORMAT))
  49986. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");
  49987. if (!(c.type === n.UnsignedByteType || ee(c.type) === Ge.getParameter(Ge.IMPLEMENTATION_COLOR_READ_TYPE) || c.type === n.FloatType && We.get("WEBGL_color_buffer_float") || c.type === n.HalfFloatType && We.get("EXT_color_buffer_half_float")))
  49988. return void console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");
  49989. Ge.checkFramebufferStatus(Ge.FRAMEBUFFER) === Ge.FRAMEBUFFER_COMPLETE ? Ge.readPixels(t, i, r, o, ee(c.format), ee(c.type), a) : console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete.")
  49990. } finally {
  49991. l && Ge.bindFramebuffer(Ge.FRAMEBUFFER, Ce)
  49992. }
  49993. }
  49994. }
  49995. }
  49996. ,
  49997. n.WebGLRenderTarget = function(e, t, i) {
  49998. this.uuid = n.Math.generateUUID(),
  49999. this.width = e,
  50000. this.height = t,
  50001. this.scissor = new n.Vector4(0,0,e,t),
  50002. this.scissorTest = !1,
  50003. this.viewport = new n.Vector4(0,0,e,t),
  50004. i = i || {},
  50005. void 0 === i.minFilter && (i.minFilter = n.LinearFilter),
  50006. this.texture = new n.Texture(void 0,void 0,i.wrapS,i.wrapT,i.magFilter,i.minFilter,i.format,i.type,i.anisotropy),
  50007. this.depthBuffer = void 0 === i.depthBuffer || i.depthBuffer,
  50008. this.stencilBuffer = void 0 === i.stencilBuffer || i.stencilBuffer
  50009. }
  50010. ,
  50011. n.WebGLRenderTarget.prototype = {
  50012. constructor: n.WebGLRenderTarget,
  50013. setSize: function(e, t) {
  50014. this.width === e && this.height === t || (this.width = e,
  50015. this.height = t,
  50016. this.dispose()),
  50017. this.viewport.set(0, 0, e, t),
  50018. this.scissor.set(0, 0, e, t)
  50019. },
  50020. clone: function() {
  50021. return (new this.constructor).copy(this)
  50022. },
  50023. copy: function(e) {
  50024. return this.width = e.width,
  50025. this.height = e.height,
  50026. this.viewport.copy(e.viewport),
  50027. this.texture = e.texture.clone(),
  50028. this.depthBuffer = e.depthBuffer,
  50029. this.stencilBuffer = e.stencilBuffer,
  50030. this
  50031. },
  50032. dispose: function() {
  50033. this.dispatchEvent({
  50034. type: "dispose"
  50035. })
  50036. }
  50037. },
  50038. n.EventDispatcher.prototype.apply(n.WebGLRenderTarget.prototype),
  50039. n.WebGLRenderTargetCube = function(e, t, i) {
  50040. n.WebGLRenderTarget.call(this, e, t, i),
  50041. this.activeCubeFace = 0,
  50042. this.activeMipMapLevel = 0
  50043. }
  50044. ,
  50045. n.WebGLRenderTargetCube.prototype = Object.create(n.WebGLRenderTarget.prototype),
  50046. n.WebGLRenderTargetCube.prototype.constructor = n.WebGLRenderTargetCube,
  50047. n.WebGLBufferRenderer = function(e, t, i) {
  50048. function r(e) {
  50049. s = e
  50050. }
  50051. function o(t, n) {
  50052. e.drawArrays(s, t, n),
  50053. i.calls++,
  50054. i.vertices += n,
  50055. s === e.TRIANGLES && (i.faces += n / 3)
  50056. }
  50057. function a(r) {
  50058. var o = t.get("ANGLE_instanced_arrays");
  50059. if (null === o)
  50060. return void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.");
  50061. var a = r.attributes.position
  50062. , l = 0;
  50063. a instanceof n.InterleavedBufferAttribute ? (l = a.data.count,
  50064. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)) : (l = a.count,
  50065. o.drawArraysInstancedANGLE(s, 0, l, r.maxInstancedCount)),
  50066. i.calls++,
  50067. i.vertices += l * r.maxInstancedCount,
  50068. s === e.TRIANGLES && (i.faces += r.maxInstancedCount * l / 3)
  50069. }
  50070. var s;
  50071. this.setMode = r,
  50072. this.render = o,
  50073. this.renderInstances = a
  50074. }
  50075. ,
  50076. n.WebGLIndexedBufferRenderer = function(e, t, i) {
  50077. function n(e) {
  50078. s = e
  50079. }
  50080. function r(i) {
  50081. i.array instanceof Uint32Array && t.get("OES_element_index_uint") ? (l = e.UNSIGNED_INT,
  50082. c = 4) : (l = e.UNSIGNED_SHORT,
  50083. c = 2)
  50084. }
  50085. function o(t, n) {
  50086. e.drawElements(s, n, l, t * c),
  50087. i.calls++,
  50088. i.vertices += n,
  50089. s === e.TRIANGLES && (i.faces += n / 3)
  50090. }
  50091. function a(n, r, o) {
  50092. var a = t.get("ANGLE_instanced_arrays");
  50093. return null === a ? void console.error("THREE.WebGLBufferRenderer: using THREE.InstancedBufferGeometry but hardware does not support extension ANGLE_instanced_arrays.") : (a.drawElementsInstancedANGLE(s, o, l, r * c, n.maxInstancedCount),
  50094. i.calls++,
  50095. i.vertices += o * n.maxInstancedCount,
  50096. void (s === e.TRIANGLES && (i.faces += n.maxInstancedCount * o / 3)))
  50097. }
  50098. var s, l, c;
  50099. this.setMode = n,
  50100. this.setIndex = r,
  50101. this.render = o,
  50102. this.renderInstances = a
  50103. }
  50104. ,
  50105. n.WebGLExtensions = function(e) {
  50106. var t = {};
  50107. this.get = function(i) {
  50108. if (void 0 !== t[i])
  50109. return t[i];
  50110. var n;
  50111. switch (i) {
  50112. case "EXT_texture_filter_anisotropic":
  50113. n = e.getExtension("EXT_texture_filter_anisotropic") || e.getExtension("MOZ_EXT_texture_filter_anisotropic") || e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");
  50114. break;
  50115. case "WEBGL_compressed_texture_s3tc":
  50116. n = e.getExtension("WEBGL_compressed_texture_s3tc") || e.getExtension("MOZ_WEBGL_compressed_texture_s3tc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");
  50117. break;
  50118. case "WEBGL_compressed_texture_pvrtc":
  50119. n = e.getExtension("WEBGL_compressed_texture_pvrtc") || e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");
  50120. break;
  50121. case "WEBGL_compressed_texture_etc1":
  50122. n = e.getExtension("WEBGL_compressed_texture_etc1");
  50123. break;
  50124. default:
  50125. n = e.getExtension(i)
  50126. }
  50127. return null === n && console.warn("THREE.WebGLRenderer: " + i + " extension not supported."),
  50128. t[i] = n,
  50129. n
  50130. }
  50131. }
  50132. ,
  50133. n.WebGLCapabilities = function(e, t, i) {
  50134. function n(t) {
  50135. if ("highp" === t) {
  50136. if (e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.HIGH_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.HIGH_FLOAT).precision > 0)
  50137. return "highp";
  50138. t = "mediump"
  50139. }
  50140. return "mediump" === t && e.getShaderPrecisionFormat(e.VERTEX_SHADER, e.MEDIUM_FLOAT).precision > 0 && e.getShaderPrecisionFormat(e.FRAGMENT_SHADER, e.MEDIUM_FLOAT).precision > 0 ? "mediump" : "lowp"
  50141. }
  50142. this.getMaxPrecision = n,
  50143. this.precision = void 0 !== i.precision ? i.precision : "highp",
  50144. this.logarithmicDepthBuffer = void 0 !== i.logarithmicDepthBuffer && i.logarithmicDepthBuffer,
  50145. this.maxTextures = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),
  50146. this.maxVertexTextures = e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS),
  50147. this.maxTextureSize = e.getParameter(e.MAX_TEXTURE_SIZE),
  50148. this.maxCubemapSize = e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE),
  50149. this.maxAttributes = e.getParameter(e.MAX_VERTEX_ATTRIBS),
  50150. this.maxVertexUniforms = e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS),
  50151. this.maxVaryings = e.getParameter(e.MAX_VARYING_VECTORS),
  50152. this.maxFragmentUniforms = e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS),
  50153. this.vertexTextures = this.maxVertexTextures > 0,
  50154. this.floatFragmentTextures = !!t.get("OES_texture_float"),
  50155. this.floatVertexTextures = this.vertexTextures && this.floatFragmentTextures;
  50156. var r = n(this.precision);
  50157. r !== this.precision && (console.warn("THREE.WebGLRenderer:", this.precision, "not supported, using", r, "instead."),
  50158. this.precision = r),
  50159. this.logarithmicDepthBuffer && (this.logarithmicDepthBuffer = !!t.get("EXT_frag_depth"))
  50160. }
  50161. ,
  50162. n.WebGLGeometries = function(e, t, i) {
  50163. function r(e) {
  50164. var t = e.geometry;
  50165. if (void 0 !== h[t.id])
  50166. return h[t.id];
  50167. t.addEventListener("dispose", o);
  50168. var r;
  50169. return t instanceof n.BufferGeometry ? r = t : t instanceof n.Geometry && (void 0 === t._bufferGeometry && (t._bufferGeometry = (new n.BufferGeometry).setFromObject(e)),
  50170. r = t._bufferGeometry),
  50171. h[t.id] = r,
  50172. i.memory.geometries++,
  50173. r
  50174. }
  50175. function o(e) {
  50176. var n = e.target
  50177. , r = h[n.id];
  50178. null !== r.index && s(r.index),
  50179. l(r.attributes),
  50180. n.removeEventListener("dispose", o),
  50181. delete h[n.id];
  50182. var a = t.get(n);
  50183. a.wireframe && s(a.wireframe),
  50184. t.delete(n);
  50185. var c = t.get(r);
  50186. c.wireframe && s(c.wireframe),
  50187. t.delete(r),
  50188. i.memory.geometries--
  50189. }
  50190. function a(e) {
  50191. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50192. }
  50193. function s(t) {
  50194. var i = a(t);
  50195. void 0 !== i && (e.deleteBuffer(i),
  50196. c(t))
  50197. }
  50198. function l(e) {
  50199. for (var t in e)
  50200. s(e[t])
  50201. }
  50202. function c(e) {
  50203. e instanceof n.InterleavedBufferAttribute ? t.delete(e.data) : t.delete(e)
  50204. }
  50205. var h = {};
  50206. this.get = r
  50207. }
  50208. ,
  50209. n.WebGLLights = function() {
  50210. var e = {};
  50211. this.get = function(t) {
  50212. if (void 0 !== e[t.id])
  50213. return e[t.id];
  50214. var i;
  50215. switch (t.type) {
  50216. case "DirectionalLight":
  50217. i = {
  50218. direction: new n.Vector3,
  50219. color: new n.Color,
  50220. shadow: !1,
  50221. shadowBias: 0,
  50222. shadowRadius: 1,
  50223. shadowMapSize: new n.Vector2
  50224. };
  50225. break;
  50226. case "SpotLight":
  50227. i = {
  50228. position: new n.Vector3,
  50229. direction: new n.Vector3,
  50230. color: new n.Color,
  50231. distance: 0,
  50232. coneCos: 0,
  50233. penumbraCos: 0,
  50234. decay: 0,
  50235. shadow: !1,
  50236. shadowBias: 0,
  50237. shadowRadius: 1,
  50238. shadowMapSize: new n.Vector2
  50239. };
  50240. break;
  50241. case "PointLight":
  50242. i = {
  50243. position: new n.Vector3,
  50244. color: new n.Color,
  50245. distance: 0,
  50246. decay: 0,
  50247. shadow: !1,
  50248. shadowBias: 0,
  50249. shadowRadius: 1,
  50250. shadowMapSize: new n.Vector2
  50251. };
  50252. break;
  50253. case "HemisphereLight":
  50254. i = {
  50255. direction: new n.Vector3,
  50256. skyColor: new n.Color,
  50257. groundColor: new n.Color
  50258. }
  50259. }
  50260. return e[t.id] = i,
  50261. i
  50262. }
  50263. }
  50264. ,
  50265. n.WebGLObjects = function(e, t, i) {
  50266. function r(t) {
  50267. var i = u.get(t);
  50268. t.geometry instanceof n.Geometry && i.updateFromObject(t);
  50269. var r = i.index
  50270. , a = i.attributes;
  50271. null !== r && o(r, e.ELEMENT_ARRAY_BUFFER);
  50272. for (var s in a)
  50273. o(a[s], e.ARRAY_BUFFER);
  50274. var l = i.morphAttributes;
  50275. for (var s in l)
  50276. for (var c = l[s], h = 0, d = c.length; h < d; h++)
  50277. o(c[h], e.ARRAY_BUFFER);
  50278. return i
  50279. }
  50280. function o(e, i) {
  50281. var r = e instanceof n.InterleavedBufferAttribute ? e.data : e
  50282. , o = t.get(r);
  50283. void 0 === o.__webglBuffer ? a(o, r, i) : o.version !== r.version && s(o, r, i)
  50284. }
  50285. function a(t, i, n) {
  50286. t.__webglBuffer = e.createBuffer(),
  50287. e.bindBuffer(n, t.__webglBuffer);
  50288. var r = i.dynamic ? e.DYNAMIC_DRAW : e.STATIC_DRAW;
  50289. e.bufferData(n, i.array, r),
  50290. t.version = i.version
  50291. }
  50292. function s(t, i, n) {
  50293. e.bindBuffer(n, t.__webglBuffer),
  50294. i.dynamic === !1 || i.updateRange.count === -1 ? e.bufferSubData(n, 0, i.array) : 0 === i.updateRange.count ? console.error("THREE.WebGLObjects.updateBuffer: dynamic THREE.BufferAttribute marked as needsUpdate but updateRange.count is 0, ensure you are using set methods or updating manually.") : (e.bufferSubData(n, i.updateRange.offset * i.array.BYTES_PER_ELEMENT, i.array.subarray(i.updateRange.offset, i.updateRange.offset + i.updateRange.count)),
  50295. i.updateRange.count = 0),
  50296. t.version = i.version
  50297. }
  50298. function l(e) {
  50299. return e instanceof n.InterleavedBufferAttribute ? t.get(e.data).__webglBuffer : t.get(e).__webglBuffer
  50300. }
  50301. function c(i) {
  50302. var r = t.get(i);
  50303. if (void 0 !== r.wireframe)
  50304. return r.wireframe;
  50305. var a = []
  50306. , s = i.index
  50307. , l = i.attributes
  50308. , c = l.position;
  50309. if (null !== s)
  50310. for (var u = {}, d = s.array, p = 0, f = d.length; p < f; p += 3) {
  50311. var g = d[p + 0]
  50312. , m = d[p + 1]
  50313. , v = d[p + 2];
  50314. h(u, g, m) && a.push(g, m),
  50315. h(u, m, v) && a.push(m, v),
  50316. h(u, v, g) && a.push(v, g)
  50317. }
  50318. else
  50319. for (var d = l.position.array, p = 0, f = d.length / 3 - 1; p < f; p += 3) {
  50320. var g = p + 0
  50321. , m = p + 1
  50322. , v = p + 2;
  50323. a.push(g, m, m, v, v, g)
  50324. }
  50325. var A = c.count > 65535 ? Uint32Array : Uint16Array
  50326. , y = new n.BufferAttribute(new A(a),1);
  50327. return o(y, e.ELEMENT_ARRAY_BUFFER),
  50328. r.wireframe = y,
  50329. y
  50330. }
  50331. function h(e, t, i) {
  50332. if (t > i) {
  50333. var n = t;
  50334. t = i,
  50335. i = n
  50336. }
  50337. var r = e[t];
  50338. return void 0 === r ? (e[t] = [i],
  50339. !0) : r.indexOf(i) === -1 && (r.push(i),
  50340. !0)
  50341. }
  50342. var u = new n.WebGLGeometries(e,t,i);
  50343. this.getAttributeBuffer = l,
  50344. this.getWireframeAttribute = c,
  50345. this.update = r
  50346. }
  50347. ,
  50348. n.WebGLProgram = function() {
  50349. function e(e) {
  50350. switch (e) {
  50351. case n.LinearEncoding:
  50352. return ["Linear", "( value )"];
  50353. case n.sRGBEncoding:
  50354. return ["sRGB", "( value )"];
  50355. case n.RGBEEncoding:
  50356. return ["RGBE", "( value )"];
  50357. case n.RGBM7Encoding:
  50358. return ["RGBM", "( value, 7.0 )"];
  50359. case n.RGBM16Encoding:
  50360. return ["RGBM", "( value, 16.0 )"];
  50361. case n.RGBDEncoding:
  50362. return ["RGBD", "( value, 256.0 )"];
  50363. case n.GammaEncoding:
  50364. return ["Gamma", "( value, float( GAMMA_FACTOR ) )"];
  50365. default:
  50366. throw new Error("unsupported encoding: " + e)
  50367. }
  50368. }
  50369. function t(t, i) {
  50370. var n = e(i);
  50371. return "vec4 " + t + "( vec4 value ) { return " + n[0] + "ToLinear" + n[1] + "; }"
  50372. }
  50373. function i(t, i) {
  50374. var n = e(i);
  50375. return "vec4 " + t + "( vec4 value ) { return LinearTo" + n[0] + n[1] + "; }"
  50376. }
  50377. function r(e, t) {
  50378. var i;
  50379. switch (t) {
  50380. case n.LinearToneMapping:
  50381. i = "Linear";
  50382. break;
  50383. case n.ReinhardToneMapping:
  50384. i = "Reinhard";
  50385. break;
  50386. case n.Uncharted2ToneMapping:
  50387. i = "Uncharted2";
  50388. break;
  50389. case n.CineonToneMapping:
  50390. i = "OptimizedCineon";
  50391. break;
  50392. default:
  50393. throw new Error("unsupported toneMapping: " + t)
  50394. }
  50395. return "vec3 " + e + "( vec3 color ) { return " + i + "ToneMapping( color ); }"
  50396. }
  50397. function o(e, t, i) {
  50398. e = e || {};
  50399. var n = [e.derivatives || t.envMapCubeUV || t.bumpMap || t.normalMap || t.flatShading ? "#extension GL_OES_standard_derivatives : enable" : "", (e.fragDepth || t.logarithmicDepthBuffer) && i.get("EXT_frag_depth") ? "#extension GL_EXT_frag_depth : enable" : "", e.drawBuffers && i.get("WEBGL_draw_buffers") ? "#extension GL_EXT_draw_buffers : require" : "", (e.shaderTextureLOD || t.envMap) && i.get("EXT_shader_texture_lod") ? "#extension GL_EXT_shader_texture_lod : enable" : ""];
  50400. return n.filter(c).join("\n")
  50401. }
  50402. function a(e) {
  50403. var t = [];
  50404. for (var i in e) {
  50405. var n = e[i];
  50406. n !== !1 && t.push("#define " + i + " " + n)
  50407. }
  50408. return t.join("\n")
  50409. }
  50410. function s(e, t, i) {
  50411. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), o = 0; o < r; o++) {
  50412. var a = e.getActiveUniform(t, o)
  50413. , s = a.name
  50414. , l = e.getUniformLocation(t, s)
  50415. , c = f.exec(s);
  50416. if (c) {
  50417. var h = c[1]
  50418. , u = c[2]
  50419. , d = n[h];
  50420. d || (d = n[h] = {}),
  50421. d[u] = l
  50422. } else if (c = g.exec(s)) {
  50423. var p = c[1]
  50424. , v = c[2]
  50425. , A = c[3]
  50426. , y = n[p];
  50427. y || (y = n[p] = []);
  50428. var C = y[v];
  50429. C || (C = y[v] = {}),
  50430. C[A] = l
  50431. } else if (c = m.exec(s)) {
  50432. var p = c[1];
  50433. n[p] = l
  50434. } else
  50435. n[s] = l
  50436. }
  50437. return n
  50438. }
  50439. function l(e, t, i) {
  50440. for (var n = {}, r = e.getProgramParameter(t, e.ACTIVE_ATTRIBUTES), o = 0; o < r; o++) {
  50441. var a = e.getActiveAttrib(t, o)
  50442. , s = a.name;
  50443. n[s] = e.getAttribLocation(t, s)
  50444. }
  50445. return n
  50446. }
  50447. function c(e) {
  50448. return "" !== e
  50449. }
  50450. function h(e, t) {
  50451. return e.replace(/NUM_DIR_LIGHTS/g, t.numDirLights).replace(/NUM_SPOT_LIGHTS/g, t.numSpotLights).replace(/NUM_POINT_LIGHTS/g, t.numPointLights).replace(/NUM_HEMI_LIGHTS/g, t.numHemiLights)
  50452. }
  50453. function u(e) {
  50454. function t(e, t) {
  50455. var i = n.ShaderChunk[t];
  50456. if (void 0 === i)
  50457. throw new Error("Can not resolve #include <" + t + ">");
  50458. return u(i)
  50459. }
  50460. var i = /#include +<([\w\d.]+)>/g;
  50461. return e.replace(i, t)
  50462. }
  50463. function d(e) {
  50464. function t(e, t, i, n) {
  50465. for (var r = "", o = parseInt(t); o < parseInt(i); o++)
  50466. r += n.replace(/\[ i \]/g, "[ " + o + " ]");
  50467. return r
  50468. }
  50469. var i = /for \( int i \= (\d+)\; i < (\d+)\; i \+\+ \) \{([\s\S]+?)(?=\})\}/g;
  50470. return e.replace(i, t)
  50471. }
  50472. var p = 0
  50473. , f = /^([\w\d_]+)\.([\w\d_]+)$/
  50474. , g = /^([\w\d_]+)\[(\d+)\]\.([\w\d_]+)$/
  50475. , m = /^([\w\d_]+)\[0\]$/;
  50476. return function(e, f, g, m) {
  50477. var v = e.context
  50478. , A = g.extensions
  50479. , y = g.defines
  50480. , C = g.__webglShader.vertexShader
  50481. , I = g.__webglShader.fragmentShader
  50482. , E = "SHADOWMAP_TYPE_BASIC";
  50483. m.shadowMapType === n.PCFShadowMap ? E = "SHADOWMAP_TYPE_PCF" : m.shadowMapType === n.PCFSoftShadowMap && (E = "SHADOWMAP_TYPE_PCF_SOFT");
  50484. var b = "ENVMAP_TYPE_CUBE"
  50485. , w = "ENVMAP_MODE_REFLECTION"
  50486. , _ = "ENVMAP_BLENDING_MULTIPLY";
  50487. if (m.envMap) {
  50488. switch (g.envMap.mapping) {
  50489. case n.CubeReflectionMapping:
  50490. case n.CubeRefractionMapping:
  50491. b = "ENVMAP_TYPE_CUBE";
  50492. break;
  50493. case n.CubeUVReflectionMapping:
  50494. case n.CubeUVRefractionMapping:
  50495. b = "ENVMAP_TYPE_CUBE_UV";
  50496. break;
  50497. case n.EquirectangularReflectionMapping:
  50498. case n.EquirectangularRefractionMapping:
  50499. b = "ENVMAP_TYPE_EQUIREC";
  50500. break;
  50501. case n.SphericalReflectionMapping:
  50502. b = "ENVMAP_TYPE_SPHERE"
  50503. }
  50504. switch (g.envMap.mapping) {
  50505. case n.CubeRefractionMapping:
  50506. case n.EquirectangularRefractionMapping:
  50507. w = "ENVMAP_MODE_REFRACTION"
  50508. }
  50509. switch (g.combine) {
  50510. case n.MultiplyOperation:
  50511. _ = "ENVMAP_BLENDING_MULTIPLY";
  50512. break;
  50513. case n.MixOperation:
  50514. _ = "ENVMAP_BLENDING_MIX";
  50515. break;
  50516. case n.AddOperation:
  50517. _ = "ENVMAP_BLENDING_ADD"
  50518. }
  50519. }
  50520. var T, x, S = e.gammaFactor > 0 ? e.gammaFactor : 1, M = o(A, m, e.extensions), R = a(y), P = v.createProgram();
  50521. g instanceof n.RawShaderMaterial ? (T = "",
  50522. x = "") : (T = ["precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.supportsVertexTextures ? "#define VERTEX_TEXTURES" : "", "#define GAMMA_FACTOR " + S, "#define MAX_BONES " + m.maxBones, m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + w : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.displacementMap && m.supportsVertexTextures ? "#define USE_DISPLACEMENTMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.skinning ? "#define USE_SKINNING" : "", m.useVertexTexture ? "#define BONE_TEXTURE" : "", m.morphTargets ? "#define USE_MORPHTARGETS" : "", m.morphNormals && m.flatShading === !1 ? "#define USE_MORPHNORMALS" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.sizeAttenuation ? "#define USE_SIZEATTENUATION" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", "uniform mat4 modelMatrix;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform mat4 viewMatrix;", "uniform mat3 normalMatrix;", "uniform vec3 cameraPosition;", "attribute vec3 position;", "attribute vec3 normal;", "attribute vec2 uv;", "#ifdef USE_COLOR", "\tattribute vec3 color;", "#endif", "#ifdef USE_MORPHTARGETS", "\tattribute vec3 morphTarget0;", "\tattribute vec3 morphTarget1;", "\tattribute vec3 morphTarget2;", "\tattribute vec3 morphTarget3;", "\t#ifdef USE_MORPHNORMALS", "\t\tattribute vec3 morphNormal0;", "\t\tattribute vec3 morphNormal1;", "\t\tattribute vec3 morphNormal2;", "\t\tattribute vec3 morphNormal3;", "\t#else", "\t\tattribute vec3 morphTarget4;", "\t\tattribute vec3 morphTarget5;", "\t\tattribute vec3 morphTarget6;", "\t\tattribute vec3 morphTarget7;", "\t#endif", "#endif", "#ifdef USE_SKINNING", "\tattribute vec4 skinIndex;", "\tattribute vec4 skinWeight;", "#endif", "\n"].filter(c).join("\n"),
  50523. x = [M, "precision " + m.precision + " float;", "precision " + m.precision + " int;", "#define SHADER_NAME " + g.__webglShader.name, R, m.alphaTest ? "#define ALPHATEST " + m.alphaTest : "", "#define GAMMA_FACTOR " + S, m.useFog && m.fog ? "#define USE_FOG" : "", m.useFog && m.fogExp ? "#define FOG_EXP2" : "", m.map ? "#define USE_MAP" : "", m.envMap ? "#define USE_ENVMAP" : "", m.envMap ? "#define " + b : "", m.envMap ? "#define " + w : "", m.envMap ? "#define " + _ : "", m.lightMap ? "#define USE_LIGHTMAP" : "", m.aoMap ? "#define USE_AOMAP" : "", m.emissiveMap ? "#define USE_EMISSIVEMAP" : "", m.bumpMap ? "#define USE_BUMPMAP" : "", m.normalMap ? "#define USE_NORMALMAP" : "", m.specularMap ? "#define USE_SPECULARMAP" : "", m.roughnessMap ? "#define USE_ROUGHNESSMAP" : "", m.metalnessMap ? "#define USE_METALNESSMAP" : "", m.alphaMap ? "#define USE_ALPHAMAP" : "", m.vertexColors ? "#define USE_COLOR" : "", m.flatShading ? "#define FLAT_SHADED" : "", m.doubleSided ? "#define DOUBLE_SIDED" : "", m.flipSided ? "#define FLIP_SIDED" : "", m.shadowMapEnabled ? "#define USE_SHADOWMAP" : "", m.shadowMapEnabled ? "#define " + E : "", m.pointLightShadows > 0 ? "#define POINT_LIGHT_SHADOWS" : "", m.premultipliedAlpha ? "#define PREMULTIPLIED_ALPHA" : "", m.physicallyCorrectLights ? "#define PHYSICALLY_CORRECT_LIGHTS" : "", m.logarithmicDepthBuffer ? "#define USE_LOGDEPTHBUF" : "", m.logarithmicDepthBuffer && e.extensions.get("EXT_frag_depth") ? "#define USE_LOGDEPTHBUF_EXT" : "", m.envMap && e.extensions.get("EXT_shader_texture_lod") ? "#define TEXTURE_LOD_EXT" : "", "uniform mat4 viewMatrix;", "uniform vec3 cameraPosition;", m.toneMapping !== n.NoToneMapping ? "#define TONE_MAPPING" : "", m.toneMapping !== n.NoToneMapping ? n.ShaderChunk.tonemapping_pars_fragment : "", m.toneMapping !== n.NoToneMapping ? r("toneMapping", m.toneMapping) : "", m.outputEncoding || m.mapEncoding || m.envMapEncoding || m.emissiveMapEncoding ? n.ShaderChunk.encodings_pars_fragment : "", m.mapEncoding ? t("mapTexelToLinear", m.mapEncoding) : "", m.envMapEncoding ? t("envMapTexelToLinear", m.envMapEncoding) : "", m.emissiveMapEncoding ? t("emissiveMapTexelToLinear", m.emissiveMapEncoding) : "", m.outputEncoding ? i("linearToOutputTexel", m.outputEncoding) : "", "\n"].filter(c).join("\n")),
  50524. C = u(C, m),
  50525. C = h(C, m),
  50526. I = u(I, m),
  50527. I = h(I, m),
  50528. g instanceof n.ShaderMaterial == !1 && (C = d(C),
  50529. I = d(I));
  50530. var O = T + C
  50531. , L = x + I
  50532. , D = n.WebGLShader(v, v.VERTEX_SHADER, O)
  50533. , N = n.WebGLShader(v, v.FRAGMENT_SHADER, L);
  50534. v.attachShader(P, D),
  50535. v.attachShader(P, N),
  50536. void 0 !== g.index0AttributeName ? v.bindAttribLocation(P, 0, g.index0AttributeName) : m.morphTargets === !0 && v.bindAttribLocation(P, 0, "position"),
  50537. v.linkProgram(P);
  50538. var B = v.getProgramInfoLog(P)
  50539. , F = v.getShaderInfoLog(D)
  50540. , V = v.getShaderInfoLog(N)
  50541. , U = !0
  50542. , k = !0;
  50543. v.getProgramParameter(P, v.LINK_STATUS) === !1 ? (U = !1,
  50544. console.error("THREE.WebGLProgram: shader error: ", v.getError(), "gl.VALIDATE_STATUS", v.getProgramParameter(P, v.VALIDATE_STATUS), "gl.getProgramInfoLog", B, F, V)) : "" !== B ? console.warn("THREE.WebGLProgram: gl.getProgramInfoLog()", B) : "" !== F && "" !== V || (k = !1),
  50545. k && (this.diagnostics = {
  50546. runnable: U,
  50547. material: g,
  50548. programLog: B,
  50549. vertexShader: {
  50550. log: F,
  50551. prefix: T
  50552. },
  50553. fragmentShader: {
  50554. log: V,
  50555. prefix: x
  50556. }
  50557. }),
  50558. v.deleteShader(D),
  50559. v.deleteShader(N);
  50560. var H;
  50561. this.getUniforms = function() {
  50562. return void 0 === H && (H = s(v, P)),
  50563. H
  50564. }
  50565. ;
  50566. var G;
  50567. return this.getAttributes = function() {
  50568. return void 0 === G && (G = l(v, P)),
  50569. G
  50570. }
  50571. ,
  50572. this.destroy = function() {
  50573. v.deleteProgram(P),
  50574. this.program = void 0
  50575. }
  50576. ,
  50577. Object.defineProperties(this, {
  50578. uniforms: {
  50579. get: function() {
  50580. return console.warn("THREE.WebGLProgram: .uniforms is now .getUniforms()."),
  50581. this.getUniforms()
  50582. }
  50583. },
  50584. attributes: {
  50585. get: function() {
  50586. return console.warn("THREE.WebGLProgram: .attributes is now .getAttributes()."),
  50587. this.getAttributes()
  50588. }
  50589. }
  50590. }),
  50591. this.id = p++,
  50592. this.code = f,
  50593. this.usedTimes = 1,
  50594. this.program = P,
  50595. this.vertexShader = D,
  50596. this.fragmentShader = N,
  50597. this
  50598. }
  50599. }(),
  50600. n.WebGLPrograms = function(e, t) {
  50601. function i(e) {
  50602. if (t.floatVertexTextures && e && e.skeleton && e.skeleton.useVertexTexture)
  50603. return 1024;
  50604. var i = t.maxVertexUniforms
  50605. , r = Math.floor((i - 20) / 4)
  50606. , o = r;
  50607. return void 0 !== e && e instanceof n.SkinnedMesh && (o = Math.min(e.skeleton.bones.length, o),
  50608. 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)")),
  50609. o
  50610. }
  50611. function r(e, t) {
  50612. var i;
  50613. return e ? e instanceof n.Texture ? i = e.encoding : e instanceof n.WebGLRenderTarget && (i = e.texture.encoding) : i = n.LinearEncoding,
  50614. i === n.LinearEncoding && t && (i = n.GammaEncoding),
  50615. i
  50616. }
  50617. var o = []
  50618. , a = {
  50619. MeshDepthMaterial: "depth",
  50620. MeshNormalMaterial: "normal",
  50621. MeshBasicMaterial: "basic",
  50622. MeshLambertMaterial: "lambert",
  50623. MeshPhongMaterial: "phong",
  50624. MeshStandardMaterial: "standard",
  50625. LineBasicMaterial: "basic",
  50626. LineDashedMaterial: "dashed",
  50627. PointsMaterial: "points"
  50628. }
  50629. , s = ["precision", "supportsVertexTextures", "map", "mapEncoding", "envMap", "envMapMode", "envMapEncoding", "lightMap", "aoMap", "emissiveMap", "emissiveMapEncoding", "bumpMap", "normalMap", "displacementMap", "specularMap", "roughnessMap", "metalnessMap", "alphaMap", "combine", "vertexColors", "fog", "useFog", "fogExp", "flatShading", "sizeAttenuation", "logarithmicDepthBuffer", "skinning", "maxBones", "useVertexTexture", "morphTargets", "morphNormals", "maxMorphTargets", "maxMorphNormals", "premultipliedAlpha", "numDirLights", "numPointLights", "numSpotLights", "numHemiLights", "shadowMapEnabled", "pointLightShadows", "toneMapping", "physicallyCorrectLights", "shadowMapType", "alphaTest", "doubleSided", "flipSided"];
  50630. this.getParameters = function(o, s, l, c) {
  50631. var h = a[o.type]
  50632. , u = i(c)
  50633. , d = e.getPrecision();
  50634. null !== o.precision && (d = t.getMaxPrecision(o.precision),
  50635. d !== o.precision && console.warn("THREE.WebGLProgram.getParameters:", o.precision, "not supported, using", d, "instead."));
  50636. var p = {
  50637. shaderID: h,
  50638. precision: d,
  50639. supportsVertexTextures: t.vertexTextures,
  50640. outputEncoding: r(e.getCurrentRenderTarget(), e.gammaOutput),
  50641. map: !!o.map,
  50642. mapEncoding: r(o.map, e.gammaInput),
  50643. envMap: !!o.envMap,
  50644. envMapMode: o.envMap && o.envMap.mapping,
  50645. envMapEncoding: r(o.envMap, e.gammaInput),
  50646. envMapCubeUV: !!o.envMap && (o.envMap.mapping === n.CubeUVReflectionMapping || o.envMap.mapping === n.CubeUVRefractionMapping),
  50647. lightMap: !!o.lightMap,
  50648. aoMap: !!o.aoMap,
  50649. emissiveMap: !!o.emissiveMap,
  50650. emissiveMapEncoding: r(o.emissiveMap, e.gammaInput),
  50651. bumpMap: !!o.bumpMap,
  50652. normalMap: !!o.normalMap,
  50653. displacementMap: !!o.displacementMap,
  50654. roughnessMap: !!o.roughnessMap,
  50655. metalnessMap: !!o.metalnessMap,
  50656. specularMap: !!o.specularMap,
  50657. alphaMap: !!o.alphaMap,
  50658. combine: o.combine,
  50659. vertexColors: o.vertexColors,
  50660. fog: l,
  50661. useFog: o.fog,
  50662. fogExp: l instanceof n.FogExp2,
  50663. flatShading: o.shading === n.FlatShading,
  50664. sizeAttenuation: o.sizeAttenuation,
  50665. logarithmicDepthBuffer: t.logarithmicDepthBuffer,
  50666. skinning: o.skinning,
  50667. maxBones: u,
  50668. useVertexTexture: t.floatVertexTextures && c && c.skeleton && c.skeleton.useVertexTexture,
  50669. morphTargets: o.morphTargets,
  50670. morphNormals: o.morphNormals,
  50671. maxMorphTargets: e.maxMorphTargets,
  50672. maxMorphNormals: e.maxMorphNormals,
  50673. numDirLights: s.directional.length,
  50674. numPointLights: s.point.length,
  50675. numSpotLights: s.spot.length,
  50676. numHemiLights: s.hemi.length,
  50677. pointLightShadows: s.shadowsPointLight,
  50678. shadowMapEnabled: e.shadowMap.enabled && c.receiveShadow && s.shadows.length > 0,
  50679. shadowMapType: e.shadowMap.type,
  50680. toneMapping: e.toneMapping,
  50681. physicallyCorrectLights: e.physicallyCorrectLights,
  50682. premultipliedAlpha: o.premultipliedAlpha,
  50683. alphaTest: o.alphaTest,
  50684. doubleSided: o.side === n.DoubleSide,
  50685. flipSided: o.side === n.BackSide
  50686. };
  50687. return p
  50688. }
  50689. ,
  50690. this.getProgramCode = function(e, t) {
  50691. var i = [];
  50692. if (t.shaderID ? i.push(t.shaderID) : (i.push(e.fragmentShader),
  50693. i.push(e.vertexShader)),
  50694. void 0 !== e.defines)
  50695. for (var n in e.defines)
  50696. i.push(n),
  50697. i.push(e.defines[n]);
  50698. for (var r = 0; r < s.length; r++) {
  50699. var o = s[r];
  50700. i.push(o),
  50701. i.push(t[o])
  50702. }
  50703. return i.join()
  50704. }
  50705. ,
  50706. this.acquireProgram = function(t, i, r) {
  50707. for (var a, s = 0, l = o.length; s < l; s++) {
  50708. var c = o[s];
  50709. if (c.code === r) {
  50710. a = c,
  50711. ++a.usedTimes;
  50712. break
  50713. }
  50714. }
  50715. return void 0 === a && (a = new n.WebGLProgram(e,r,t,i),
  50716. o.push(a)),
  50717. a
  50718. }
  50719. ,
  50720. this.releaseProgram = function(e) {
  50721. if (0 === --e.usedTimes) {
  50722. var t = o.indexOf(e);
  50723. o[t] = o[o.length - 1],
  50724. o.pop(),
  50725. e.destroy()
  50726. }
  50727. }
  50728. ,
  50729. this.programs = o
  50730. }
  50731. ,
  50732. n.WebGLProperties = function() {
  50733. var e = {};
  50734. this.get = function(t) {
  50735. var i = t.uuid
  50736. , n = e[i];
  50737. return void 0 === n && (n = {},
  50738. e[i] = n),
  50739. n
  50740. }
  50741. ,
  50742. this.delete = function(t) {
  50743. delete e[t.uuid]
  50744. }
  50745. ,
  50746. this.clear = function() {
  50747. e = {}
  50748. }
  50749. }
  50750. ,
  50751. n.WebGLShader = function() {
  50752. function e(e) {
  50753. for (var t = e.split("\n"), i = 0; i < t.length; i++)
  50754. t[i] = i + 1 + ": " + t[i];
  50755. return t.join("\n")
  50756. }
  50757. return function(t, i, n) {
  50758. var r = t.createShader(i);
  50759. return t.shaderSource(r, n),
  50760. t.compileShader(r),
  50761. t.getShaderParameter(r, t.COMPILE_STATUS) === !1 && console.error("THREE.WebGLShader: Shader couldn't compile."),
  50762. "" !== t.getShaderInfoLog(r) && console.warn("THREE.WebGLShader: gl.getShaderInfoLog()", i === t.VERTEX_SHADER ? "vertex" : "fragment", t.getShaderInfoLog(r), e(n)),
  50763. r
  50764. }
  50765. }(),
  50766. n.WebGLShadowMap = function(e, t, i) {
  50767. function r(e, t, i, r) {
  50768. var o = e.geometry
  50769. , a = null
  50770. , s = v
  50771. , l = e.customDepthMaterial;
  50772. if (i && (s = A,
  50773. l = e.customDistanceMaterial),
  50774. l)
  50775. a = l;
  50776. else {
  50777. var c = void 0 !== o.morphTargets && o.morphTargets.length > 0 && t.morphTargets
  50778. , h = e instanceof n.SkinnedMesh && t.skinning
  50779. , u = 0;
  50780. c && (u |= f),
  50781. h && (u |= g),
  50782. a = s[u]
  50783. }
  50784. return a.visible = t.visible,
  50785. a.wireframe = t.wireframe,
  50786. a.wireframeLinewidth = t.wireframeLinewidth,
  50787. i && void 0 !== a.uniforms.lightPos && a.uniforms.lightPos.value.copy(r),
  50788. a
  50789. }
  50790. function o(e, t, i) {
  50791. if (e.visible !== !1) {
  50792. 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)) {
  50793. var r = e.material;
  50794. r.visible === !0 && (e.modelViewMatrix.multiplyMatrices(i.matrixWorldInverse, e.matrixWorld),
  50795. p.push(e))
  50796. }
  50797. for (var a = e.children, s = 0, c = a.length; s < c; s++)
  50798. o(a[s], t, i)
  50799. }
  50800. }
  50801. for (var a = e.context, s = e.state, l = new n.Frustum, c = new n.Matrix4, h = new n.Vector2, u = new n.Vector3, d = new n.Vector3, p = [], f = 1, g = 2, m = (f | g) + 1, v = new Array(m), A = new Array(m), y = [new n.Vector3(1,0,0), new n.Vector3(-1,0,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1), new n.Vector3(0,1,0), new n.Vector3(0,-1,0)], C = [new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,1,0), new n.Vector3(0,0,1), new n.Vector3(0,0,-1)], I = [new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4, new n.Vector4], E = n.ShaderLib.depthRGBA, b = n.UniformsUtils.clone(E.uniforms), w = n.ShaderLib.distanceRGBA, _ = n.UniformsUtils.clone(w.uniforms), T = 0; T !== m; ++T) {
  50802. var x = 0 !== (T & f)
  50803. , S = 0 !== (T & g)
  50804. , M = new n.ShaderMaterial({
  50805. uniforms: b,
  50806. vertexShader: E.vertexShader,
  50807. fragmentShader: E.fragmentShader,
  50808. morphTargets: x,
  50809. skinning: S
  50810. });
  50811. v[T] = M;
  50812. var R = new n.ShaderMaterial({
  50813. defines: {
  50814. USE_SHADOWMAP: ""
  50815. },
  50816. uniforms: _,
  50817. vertexShader: w.vertexShader,
  50818. fragmentShader: w.fragmentShader,
  50819. morphTargets: x,
  50820. skinning: S
  50821. });
  50822. A[T] = R
  50823. }
  50824. var P = this;
  50825. this.enabled = !1,
  50826. this.autoUpdate = !0,
  50827. this.needsUpdate = !1,
  50828. this.type = n.PCFShadowMap,
  50829. this.cullFace = n.CullFaceFront,
  50830. this.render = function(f, g) {
  50831. var m, v, A = t.shadows;
  50832. if (0 !== A.length && P.enabled !== !1 && (P.autoUpdate !== !1 || P.needsUpdate !== !1)) {
  50833. s.clearColor(1, 1, 1, 1),
  50834. s.disable(a.BLEND),
  50835. s.enable(a.CULL_FACE),
  50836. a.frontFace(a.CCW),
  50837. a.cullFace(P.cullFace === n.CullFaceFront ? a.FRONT : a.BACK),
  50838. s.setDepthTest(!0),
  50839. s.setScissorTest(!1);
  50840. for (var E = 0, b = A.length; E < b; E++) {
  50841. var w = A[E]
  50842. , _ = w.shadow
  50843. , T = _.camera;
  50844. if (h.copy(_.mapSize),
  50845. w instanceof n.PointLight) {
  50846. m = 6,
  50847. v = !0;
  50848. var x = h.x
  50849. , S = h.y;
  50850. I[0].set(2 * x, S, x, S),
  50851. I[1].set(0, S, x, S),
  50852. I[2].set(3 * x, S, x, S),
  50853. I[3].set(x, S, x, S),
  50854. I[4].set(3 * x, 0, x, S),
  50855. I[5].set(x, 0, x, S),
  50856. h.x *= 4,
  50857. h.y *= 2
  50858. } else
  50859. m = 1,
  50860. v = !1;
  50861. if (null === _.map) {
  50862. var M = {
  50863. minFilter: n.NearestFilter,
  50864. magFilter: n.NearestFilter,
  50865. format: n.RGBAFormat
  50866. };
  50867. _.map = new n.WebGLRenderTarget(h.x,h.y,M),
  50868. w instanceof n.SpotLight && (T.aspect = h.x / h.y),
  50869. T.updateProjectionMatrix()
  50870. }
  50871. var R = _.map
  50872. , O = _.matrix;
  50873. d.setFromMatrixPosition(w.matrixWorld),
  50874. T.position.copy(d),
  50875. e.setRenderTarget(R),
  50876. e.clear();
  50877. for (var L = 0; L < m; L++) {
  50878. if (v) {
  50879. u.copy(T.position),
  50880. u.add(y[L]),
  50881. T.up.copy(C[L]),
  50882. T.lookAt(u);
  50883. var D = I[L];
  50884. s.viewport(D)
  50885. } else
  50886. u.setFromMatrixPosition(w.target.matrixWorld),
  50887. T.lookAt(u);
  50888. T.updateMatrixWorld(),
  50889. T.matrixWorldInverse.getInverse(T.matrixWorld),
  50890. O.set(.5, 0, 0, .5, 0, .5, 0, .5, 0, 0, .5, .5, 0, 0, 0, 1),
  50891. O.multiply(T.projectionMatrix),
  50892. O.multiply(T.matrixWorldInverse),
  50893. c.multiplyMatrices(T.projectionMatrix, T.matrixWorldInverse),
  50894. l.setFromMatrix(c),
  50895. p.length = 0,
  50896. o(f, g, T);
  50897. for (var N = 0, B = p.length; N < B; N++) {
  50898. var F = p[N]
  50899. , V = i.update(F)
  50900. , U = F.material;
  50901. if (U instanceof n.MultiMaterial)
  50902. for (var k = V.groups, H = U.materials, G = 0, z = k.length; G < z; G++) {
  50903. var W = k[G]
  50904. , j = H[W.materialIndex];
  50905. if (j.visible === !0) {
  50906. var Y = r(F, j, v, d);
  50907. e.renderBufferDirect(T, null, V, Y, F, W)
  50908. }
  50909. }
  50910. else {
  50911. var Y = r(F, U, v, d);
  50912. e.renderBufferDirect(T, null, V, Y, F, null)
  50913. }
  50914. }
  50915. }
  50916. }
  50917. var X = e.getClearColor()
  50918. , Z = e.getClearAlpha();
  50919. e.setClearColor(X, Z),
  50920. s.enable(a.BLEND),
  50921. P.cullFace === n.CullFaceFront && a.cullFace(a.BACK),
  50922. P.needsUpdate = !1
  50923. }
  50924. }
  50925. }
  50926. ,
  50927. n.WebGLState = function(e, t, i) {
  50928. var r = this
  50929. , o = new n.Vector4
  50930. , a = new Uint8Array(16)
  50931. , s = new Uint8Array(16)
  50932. , l = new Uint8Array(16)
  50933. , c = {}
  50934. , h = null
  50935. , u = null
  50936. , d = null
  50937. , p = null
  50938. , f = null
  50939. , g = null
  50940. , m = null
  50941. , v = null
  50942. , A = !1
  50943. , y = null
  50944. , C = null
  50945. , I = null
  50946. , E = null
  50947. , b = null
  50948. , w = null
  50949. , _ = null
  50950. , T = null
  50951. , x = null
  50952. , S = null
  50953. , M = null
  50954. , R = null
  50955. , P = null
  50956. , O = null
  50957. , L = null
  50958. , D = e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)
  50959. , N = void 0
  50960. , B = {}
  50961. , F = new n.Vector4
  50962. , V = null
  50963. , U = null
  50964. , k = new n.Vector4
  50965. , H = new n.Vector4
  50966. , G = e.createTexture();
  50967. e.bindTexture(e.TEXTURE_2D, G),
  50968. e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.LINEAR),
  50969. e.texImage2D(e.TEXTURE_2D, 0, e.RGB, 1, 1, 0, e.RGB, e.UNSIGNED_BYTE, new Uint8Array(3)),
  50970. this.init = function() {
  50971. this.clearColor(0, 0, 0, 1),
  50972. this.clearDepth(1),
  50973. this.clearStencil(0),
  50974. this.enable(e.DEPTH_TEST),
  50975. e.depthFunc(e.LEQUAL),
  50976. e.frontFace(e.CCW),
  50977. e.cullFace(e.BACK),
  50978. this.enable(e.CULL_FACE),
  50979. this.enable(e.BLEND),
  50980. e.blendEquation(e.FUNC_ADD),
  50981. e.blendFunc(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA)
  50982. }
  50983. ,
  50984. this.initAttributes = function() {
  50985. for (var e = 0, t = a.length; e < t; e++)
  50986. a[e] = 0
  50987. }
  50988. ,
  50989. this.enableAttribute = function(i) {
  50990. if (a[i] = 1,
  50991. 0 === s[i] && (e.enableVertexAttribArray(i),
  50992. s[i] = 1),
  50993. 0 !== l[i]) {
  50994. var n = t.get("ANGLE_instanced_arrays");
  50995. n.vertexAttribDivisorANGLE(i, 0),
  50996. l[i] = 0
  50997. }
  50998. }
  50999. ,
  51000. this.enableAttributeAndDivisor = function(t, i, n) {
  51001. a[t] = 1,
  51002. 0 === s[t] && (e.enableVertexAttribArray(t),
  51003. s[t] = 1),
  51004. l[t] !== i && (n.vertexAttribDivisorANGLE(t, i),
  51005. l[t] = i)
  51006. }
  51007. ,
  51008. this.disableUnusedAttributes = function() {
  51009. for (var t = 0, i = s.length; t < i; t++)
  51010. s[t] !== a[t] && (e.disableVertexAttribArray(t),
  51011. s[t] = 0)
  51012. }
  51013. ,
  51014. this.enable = function(t) {
  51015. c[t] !== !0 && (e.enable(t),
  51016. c[t] = !0)
  51017. }
  51018. ,
  51019. this.disable = function(t) {
  51020. c[t] !== !1 && (e.disable(t),
  51021. c[t] = !1)
  51022. }
  51023. ,
  51024. this.getCompressedTextureFormats = function() {
  51025. if (null === h && (h = [],
  51026. t.get("WEBGL_compressed_texture_pvrtc") || t.get("WEBGL_compressed_texture_s3tc") || t.get("WEBGL_compressed_texture_etc1")))
  51027. for (var i = e.getParameter(e.COMPRESSED_TEXTURE_FORMATS), n = 0; n < i.length; n++)
  51028. h.push(i[n]);
  51029. return h
  51030. }
  51031. ,
  51032. this.setBlending = function(t, r, o, a, s, l, c, h) {
  51033. t === n.NoBlending ? this.disable(e.BLEND) : this.enable(e.BLEND),
  51034. t === u && h === A || (t === n.AdditiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51035. e.blendFuncSeparate(e.ONE, e.ONE, e.ONE, e.ONE)) : (e.blendEquation(e.FUNC_ADD),
  51036. e.blendFunc(e.SRC_ALPHA, e.ONE)) : t === n.SubtractiveBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51037. e.blendFuncSeparate(e.ZERO, e.ZERO, e.ONE_MINUS_SRC_COLOR, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51038. e.blendFunc(e.ZERO, e.ONE_MINUS_SRC_COLOR)) : t === n.MultiplyBlending ? h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51039. e.blendFuncSeparate(e.ZERO, e.ZERO, e.SRC_COLOR, e.SRC_ALPHA)) : (e.blendEquation(e.FUNC_ADD),
  51040. e.blendFunc(e.ZERO, e.SRC_COLOR)) : h ? (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51041. e.blendFuncSeparate(e.ONE, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)) : (e.blendEquationSeparate(e.FUNC_ADD, e.FUNC_ADD),
  51042. e.blendFuncSeparate(e.SRC_ALPHA, e.ONE_MINUS_SRC_ALPHA, e.ONE, e.ONE_MINUS_SRC_ALPHA)),
  51043. u = t,
  51044. A = h),
  51045. t === n.CustomBlending ? (s = s || r,
  51046. l = l || o,
  51047. c = c || a,
  51048. r === d && s === g || (e.blendEquationSeparate(i(r), i(s)),
  51049. d = r,
  51050. g = s),
  51051. o === p && a === f && l === m && c === v || (e.blendFuncSeparate(i(o), i(a), i(l), i(c)),
  51052. p = o,
  51053. f = a,
  51054. m = l,
  51055. v = c)) : (d = null,
  51056. p = null,
  51057. f = null,
  51058. g = null,
  51059. m = null,
  51060. v = null)
  51061. }
  51062. ,
  51063. this.setDepthFunc = function(t) {
  51064. if (y !== t) {
  51065. if (t)
  51066. switch (t) {
  51067. case n.NeverDepth:
  51068. e.depthFunc(e.NEVER);
  51069. break;
  51070. case n.AlwaysDepth:
  51071. e.depthFunc(e.ALWAYS);
  51072. break;
  51073. case n.LessDepth:
  51074. e.depthFunc(e.LESS);
  51075. break;
  51076. case n.LessEqualDepth:
  51077. e.depthFunc(e.LEQUAL);
  51078. break;
  51079. case n.EqualDepth:
  51080. e.depthFunc(e.EQUAL);
  51081. break;
  51082. case n.GreaterEqualDepth:
  51083. e.depthFunc(e.GEQUAL);
  51084. break;
  51085. case n.GreaterDepth:
  51086. e.depthFunc(e.GREATER);
  51087. break;
  51088. case n.NotEqualDepth:
  51089. e.depthFunc(e.NOTEQUAL);
  51090. break;
  51091. default:
  51092. e.depthFunc(e.LEQUAL)
  51093. }
  51094. else
  51095. e.depthFunc(e.LEQUAL);
  51096. y = t
  51097. }
  51098. }
  51099. ,
  51100. this.setDepthTest = function(t) {
  51101. t ? this.enable(e.DEPTH_TEST) : this.disable(e.DEPTH_TEST)
  51102. }
  51103. ,
  51104. this.setDepthWrite = function(t) {
  51105. C !== t && (e.depthMask(t),
  51106. C = t)
  51107. }
  51108. ,
  51109. this.setColorWrite = function(t) {
  51110. I !== t && (e.colorMask(t, t, t, t),
  51111. I = t)
  51112. }
  51113. ,
  51114. this.setStencilFunc = function(t, i, n) {
  51115. b === t && w === i && _ === n || (e.stencilFunc(t, i, n),
  51116. b = t,
  51117. w = i,
  51118. _ = n)
  51119. }
  51120. ,
  51121. this.setStencilOp = function(t, i, n) {
  51122. T === t && x === i && S === n || (e.stencilOp(t, i, n),
  51123. T = t,
  51124. x = i,
  51125. S = n)
  51126. }
  51127. ,
  51128. this.setStencilTest = function(t) {
  51129. t ? this.enable(e.STENCIL_TEST) : this.disable(e.STENCIL_TEST)
  51130. }
  51131. ,
  51132. this.setStencilWrite = function(t) {
  51133. E !== t && (e.stencilMask(t),
  51134. E = t)
  51135. }
  51136. ,
  51137. this.setFlipSided = function(t) {
  51138. M !== t && (t ? e.frontFace(e.CW) : e.frontFace(e.CCW),
  51139. M = t)
  51140. }
  51141. ,
  51142. this.setLineWidth = function(t) {
  51143. t !== R && (e.lineWidth(t),
  51144. R = t)
  51145. }
  51146. ,
  51147. this.setPolygonOffset = function(t, i, n) {
  51148. t ? this.enable(e.POLYGON_OFFSET_FILL) : this.disable(e.POLYGON_OFFSET_FILL),
  51149. !t || P === i && O === n || (e.polygonOffset(i, n),
  51150. P = i,
  51151. O = n)
  51152. }
  51153. ,
  51154. this.getScissorTest = function() {
  51155. return L
  51156. }
  51157. ,
  51158. this.setScissorTest = function(t) {
  51159. L = t,
  51160. t ? this.enable(e.SCISSOR_TEST) : this.disable(e.SCISSOR_TEST)
  51161. }
  51162. ,
  51163. this.activeTexture = function(t) {
  51164. void 0 === t && (t = e.TEXTURE0 + D - 1),
  51165. N !== t && (e.activeTexture(t),
  51166. N = t)
  51167. }
  51168. ,
  51169. this.bindTexture = function(t, i) {
  51170. void 0 === N && r.activeTexture();
  51171. var n = B[N];
  51172. void 0 === n && (n = {
  51173. type: void 0,
  51174. texture: void 0
  51175. },
  51176. B[N] = n),
  51177. n.type === t && n.texture === i || (e.bindTexture(t, i || G),
  51178. n.type = t,
  51179. n.texture = i)
  51180. }
  51181. ,
  51182. this.compressedTexImage2D = function() {
  51183. try {
  51184. e.compressedTexImage2D.apply(e, arguments)
  51185. } catch (e) {
  51186. console.error(e)
  51187. }
  51188. }
  51189. ,
  51190. this.texImage2D = function() {
  51191. try {
  51192. e.texImage2D.apply(e, arguments)
  51193. } catch (e) {
  51194. console.error(e)
  51195. }
  51196. }
  51197. ,
  51198. this.clearColor = function(t, i, n, r) {
  51199. o.set(t, i, n, r),
  51200. F.equals(o) === !1 && (e.clearColor(t, i, n, r),
  51201. F.copy(o))
  51202. }
  51203. ,
  51204. this.clearDepth = function(t) {
  51205. V !== t && (e.clearDepth(t),
  51206. V = t)
  51207. }
  51208. ,
  51209. this.clearStencil = function(t) {
  51210. U !== t && (e.clearStencil(t),
  51211. U = t)
  51212. }
  51213. ,
  51214. this.scissor = function(t) {
  51215. k.equals(t) === !1 && (e.scissor(t.x, t.y, t.z, t.w),
  51216. k.copy(t))
  51217. }
  51218. ,
  51219. this.viewport = function(t) {
  51220. H.equals(t) === !1 && (e.viewport(t.x, t.y, t.z, t.w),
  51221. H.copy(t))
  51222. }
  51223. ,
  51224. this.reset = function() {
  51225. for (var t = 0; t < s.length; t++)
  51226. 1 === s[t] && (e.disableVertexAttribArray(t),
  51227. s[t] = 0);
  51228. c = {},
  51229. h = null,
  51230. N = void 0,
  51231. B = {},
  51232. u = null,
  51233. I = null,
  51234. C = null,
  51235. E = null,
  51236. M = null
  51237. }
  51238. }
  51239. ,
  51240. n.LensFlarePlugin = function(e, t) {
  51241. function i() {
  51242. var e = new Float32Array([-1, -1, 0, 0, 1, -1, 1, 0, 1, 1, 1, 1, -1, 1, 0, 1])
  51243. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51244. o = p.createBuffer(),
  51245. a = p.createBuffer(),
  51246. p.bindBuffer(p.ARRAY_BUFFER, o),
  51247. p.bufferData(p.ARRAY_BUFFER, e, p.STATIC_DRAW),
  51248. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51249. p.bufferData(p.ELEMENT_ARRAY_BUFFER, t, p.STATIC_DRAW),
  51250. u = p.createTexture(),
  51251. d = p.createTexture(),
  51252. f.bindTexture(p.TEXTURE_2D, u),
  51253. p.texImage2D(p.TEXTURE_2D, 0, p.RGB, 16, 16, 0, p.RGB, p.UNSIGNED_BYTE, null),
  51254. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51255. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51256. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51257. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51258. f.bindTexture(p.TEXTURE_2D, d),
  51259. p.texImage2D(p.TEXTURE_2D, 0, p.RGBA, 16, 16, 0, p.RGBA, p.UNSIGNED_BYTE, null),
  51260. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_S, p.CLAMP_TO_EDGE),
  51261. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_WRAP_T, p.CLAMP_TO_EDGE),
  51262. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MAG_FILTER, p.NEAREST),
  51263. p.texParameteri(p.TEXTURE_2D, p.TEXTURE_MIN_FILTER, p.NEAREST),
  51264. h = p.getParameter(p.MAX_VERTEX_TEXTURE_IMAGE_UNITS) > 0;
  51265. var i;
  51266. i = h ? {
  51267. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "uniform sampler2D occlusionMap;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "vec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );", "vVisibility = visibility.r / 9.0;", "vVisibility *= 1.0 - visibility.g / 9.0;", "vVisibility *= visibility.b / 9.0;", "vVisibility *= 1.0 - visibility.a / 9.0;", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  51268. fragmentShader: ["uniform lowp int renderType;", "uniform sampler2D map;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "varying float vVisibility;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * vVisibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  51269. } : {
  51270. vertexShader: ["uniform lowp int renderType;", "uniform vec3 screenPosition;", "uniform vec2 scale;", "uniform float rotation;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uv;", "vec2 pos = position;", "if ( renderType == 2 ) {", "pos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;", "pos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;", "}", "gl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );", "}"].join("\n"),
  51271. fragmentShader: ["precision mediump float;", "uniform lowp int renderType;", "uniform sampler2D map;", "uniform sampler2D occlusionMap;", "uniform float opacity;", "uniform vec3 color;", "varying vec2 vUV;", "void main() {", "if ( renderType == 0 ) {", "gl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );", "} else if ( renderType == 1 ) {", "gl_FragColor = texture2D( map, vUV );", "} else {", "float visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;", "visibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;", "visibility = ( 1.0 - visibility / 4.0 );", "vec4 texture = texture2D( map, vUV );", "texture.a *= opacity * visibility;", "gl_FragColor = texture;", "gl_FragColor.rgb *= color;", "}", "}"].join("\n")
  51272. },
  51273. s = r(i),
  51274. l = {
  51275. vertex: p.getAttribLocation(s, "position"),
  51276. uv: p.getAttribLocation(s, "uv")
  51277. },
  51278. c = {
  51279. renderType: p.getUniformLocation(s, "renderType"),
  51280. map: p.getUniformLocation(s, "map"),
  51281. occlusionMap: p.getUniformLocation(s, "occlusionMap"),
  51282. opacity: p.getUniformLocation(s, "opacity"),
  51283. color: p.getUniformLocation(s, "color"),
  51284. scale: p.getUniformLocation(s, "scale"),
  51285. rotation: p.getUniformLocation(s, "rotation"),
  51286. screenPosition: p.getUniformLocation(s, "screenPosition")
  51287. }
  51288. }
  51289. function r(t) {
  51290. var i = p.createProgram()
  51291. , n = p.createShader(p.FRAGMENT_SHADER)
  51292. , r = p.createShader(p.VERTEX_SHADER)
  51293. , o = "precision " + e.getPrecision() + " float;\n";
  51294. return p.shaderSource(n, o + t.fragmentShader),
  51295. p.shaderSource(r, o + t.vertexShader),
  51296. p.compileShader(n),
  51297. p.compileShader(r),
  51298. p.attachShader(i, n),
  51299. p.attachShader(i, r),
  51300. p.linkProgram(i),
  51301. i
  51302. }
  51303. var o, a, s, l, c, h, u, d, p = e.context, f = e.state;
  51304. this.render = function(r, g, m) {
  51305. if (0 !== t.length) {
  51306. var v = new n.Vector3
  51307. , A = m.w / m.z
  51308. , y = .5 * m.z
  51309. , C = .5 * m.w
  51310. , I = 16 / m.w
  51311. , E = new n.Vector2(I * A,I)
  51312. , b = new n.Vector3(1,1,0)
  51313. , w = new n.Vector2(1,1);
  51314. void 0 === s && i(),
  51315. p.useProgram(s),
  51316. f.initAttributes(),
  51317. f.enableAttribute(l.vertex),
  51318. f.enableAttribute(l.uv),
  51319. f.disableUnusedAttributes(),
  51320. p.uniform1i(c.occlusionMap, 0),
  51321. p.uniform1i(c.map, 1),
  51322. p.bindBuffer(p.ARRAY_BUFFER, o),
  51323. p.vertexAttribPointer(l.vertex, 2, p.FLOAT, !1, 16, 0),
  51324. p.vertexAttribPointer(l.uv, 2, p.FLOAT, !1, 16, 8),
  51325. p.bindBuffer(p.ELEMENT_ARRAY_BUFFER, a),
  51326. f.disable(p.CULL_FACE),
  51327. f.setDepthWrite(!1);
  51328. for (var _ = 0, T = t.length; _ < T; _++) {
  51329. I = 16 / m.w,
  51330. E.set(I * A, I);
  51331. var x = t[_];
  51332. if (v.set(x.matrixWorld.elements[12], x.matrixWorld.elements[13], x.matrixWorld.elements[14]),
  51333. v.applyMatrix4(g.matrixWorldInverse),
  51334. v.applyProjection(g.projectionMatrix),
  51335. b.copy(v),
  51336. w.x = b.x * y + y,
  51337. w.y = b.y * C + C,
  51338. h || w.x > 0 && w.x < m.z && w.y > 0 && w.y < m.w) {
  51339. f.activeTexture(p.TEXTURE0),
  51340. f.bindTexture(p.TEXTURE_2D, null),
  51341. f.activeTexture(p.TEXTURE1),
  51342. f.bindTexture(p.TEXTURE_2D, u),
  51343. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGB, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51344. p.uniform1i(c.renderType, 0),
  51345. p.uniform2f(c.scale, E.x, E.y),
  51346. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51347. f.disable(p.BLEND),
  51348. f.enable(p.DEPTH_TEST),
  51349. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51350. f.activeTexture(p.TEXTURE0),
  51351. f.bindTexture(p.TEXTURE_2D, d),
  51352. p.copyTexImage2D(p.TEXTURE_2D, 0, p.RGBA, m.x + w.x - 8, m.y + w.y - 8, 16, 16, 0),
  51353. p.uniform1i(c.renderType, 1),
  51354. f.disable(p.DEPTH_TEST),
  51355. f.activeTexture(p.TEXTURE1),
  51356. f.bindTexture(p.TEXTURE_2D, u),
  51357. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0),
  51358. x.positionScreen.copy(b),
  51359. x.customUpdateCallback ? x.customUpdateCallback(x) : x.updateLensFlares(),
  51360. p.uniform1i(c.renderType, 2),
  51361. f.enable(p.BLEND);
  51362. for (var S = 0, M = x.lensFlares.length; S < M; S++) {
  51363. var R = x.lensFlares[S];
  51364. R.opacity > .001 && R.scale > .001 && (b.x = R.x,
  51365. b.y = R.y,
  51366. b.z = R.z,
  51367. I = R.size * R.scale / m.w,
  51368. E.x = I * A,
  51369. E.y = I,
  51370. p.uniform3f(c.screenPosition, b.x, b.y, b.z),
  51371. p.uniform2f(c.scale, E.x, E.y),
  51372. p.uniform1f(c.rotation, R.rotation),
  51373. p.uniform1f(c.opacity, R.opacity),
  51374. p.uniform3f(c.color, R.color.r, R.color.g, R.color.b),
  51375. f.setBlending(R.blending, R.blendEquation, R.blendSrc, R.blendDst),
  51376. e.setTexture(R.texture, 1),
  51377. p.drawElements(p.TRIANGLES, 6, p.UNSIGNED_SHORT, 0))
  51378. }
  51379. }
  51380. }
  51381. f.enable(p.CULL_FACE),
  51382. f.enable(p.DEPTH_TEST),
  51383. f.setDepthWrite(!0),
  51384. e.resetGLState()
  51385. }
  51386. }
  51387. }
  51388. ,
  51389. n.SpritePlugin = function(e, t) {
  51390. function i() {
  51391. var e = new Float32Array([-.5, -.5, 0, 0, .5, -.5, 1, 0, .5, .5, 1, 1, -.5, .5, 0, 1])
  51392. , t = new Uint16Array([0, 1, 2, 0, 2, 3]);
  51393. a = d.createBuffer(),
  51394. s = d.createBuffer(),
  51395. d.bindBuffer(d.ARRAY_BUFFER, a),
  51396. d.bufferData(d.ARRAY_BUFFER, e, d.STATIC_DRAW),
  51397. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51398. d.bufferData(d.ELEMENT_ARRAY_BUFFER, t, d.STATIC_DRAW),
  51399. l = r(),
  51400. c = {
  51401. position: d.getAttribLocation(l, "position"),
  51402. uv: d.getAttribLocation(l, "uv")
  51403. },
  51404. h = {
  51405. uvOffset: d.getUniformLocation(l, "uvOffset"),
  51406. uvScale: d.getUniformLocation(l, "uvScale"),
  51407. rotation: d.getUniformLocation(l, "rotation"),
  51408. scale: d.getUniformLocation(l, "scale"),
  51409. color: d.getUniformLocation(l, "color"),
  51410. map: d.getUniformLocation(l, "map"),
  51411. opacity: d.getUniformLocation(l, "opacity"),
  51412. modelViewMatrix: d.getUniformLocation(l, "modelViewMatrix"),
  51413. projectionMatrix: d.getUniformLocation(l, "projectionMatrix"),
  51414. fogType: d.getUniformLocation(l, "fogType"),
  51415. fogDensity: d.getUniformLocation(l, "fogDensity"),
  51416. fogNear: d.getUniformLocation(l, "fogNear"),
  51417. fogFar: d.getUniformLocation(l, "fogFar"),
  51418. fogColor: d.getUniformLocation(l, "fogColor"),
  51419. alphaTest: d.getUniformLocation(l, "alphaTest")
  51420. };
  51421. var i = document.createElement("canvas");
  51422. i.width = 8,
  51423. i.height = 8;
  51424. var o = i.getContext("2d");
  51425. o.fillStyle = "white",
  51426. o.fillRect(0, 0, 8, 8),
  51427. u = new n.Texture(i),
  51428. u.needsUpdate = !0
  51429. }
  51430. function r() {
  51431. var t = d.createProgram()
  51432. , i = d.createShader(d.VERTEX_SHADER)
  51433. , n = d.createShader(d.FRAGMENT_SHADER);
  51434. return d.shaderSource(i, ["precision " + e.getPrecision() + " float;", "uniform mat4 modelViewMatrix;", "uniform mat4 projectionMatrix;", "uniform float rotation;", "uniform vec2 scale;", "uniform vec2 uvOffset;", "uniform vec2 uvScale;", "attribute vec2 position;", "attribute vec2 uv;", "varying vec2 vUV;", "void main() {", "vUV = uvOffset + uv * uvScale;", "vec2 alignedPosition = position * scale;", "vec2 rotatedPosition;", "rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;", "rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;", "vec4 finalPosition;", "finalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );", "finalPosition.xy += rotatedPosition;", "finalPosition = projectionMatrix * finalPosition;", "gl_Position = finalPosition;", "}"].join("\n")),
  51435. d.shaderSource(n, ["precision " + e.getPrecision() + " float;", "uniform vec3 color;", "uniform sampler2D map;", "uniform float opacity;", "uniform int fogType;", "uniform vec3 fogColor;", "uniform float fogDensity;", "uniform float fogNear;", "uniform float fogFar;", "uniform float alphaTest;", "varying vec2 vUV;", "void main() {", "vec4 texture = texture2D( map, vUV );", "if ( texture.a < alphaTest ) discard;", "gl_FragColor = vec4( color * texture.xyz, texture.a * opacity );", "if ( fogType > 0 ) {", "float depth = gl_FragCoord.z / gl_FragCoord.w;", "float fogFactor = 0.0;", "if ( fogType == 1 ) {", "fogFactor = smoothstep( fogNear, fogFar, depth );", "} else {", "const float LOG2 = 1.442695;", "fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );", "fogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );", "}", "gl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );", "}", "}"].join("\n")),
  51436. d.compileShader(i),
  51437. d.compileShader(n),
  51438. d.attachShader(t, i),
  51439. d.attachShader(t, n),
  51440. d.linkProgram(t),
  51441. t
  51442. }
  51443. function o(e, t) {
  51444. return e.renderOrder !== t.renderOrder ? e.renderOrder - t.renderOrder : e.z !== t.z ? t.z - e.z : t.id - e.id
  51445. }
  51446. var a, s, l, c, h, u, d = e.context, p = e.state, f = new n.Vector3, g = new n.Quaternion, m = new n.Vector3;
  51447. this.render = function(r, v) {
  51448. if (0 !== t.length) {
  51449. void 0 === l && i(),
  51450. d.useProgram(l),
  51451. p.initAttributes(),
  51452. p.enableAttribute(c.position),
  51453. p.enableAttribute(c.uv),
  51454. p.disableUnusedAttributes(),
  51455. p.disable(d.CULL_FACE),
  51456. p.enable(d.BLEND),
  51457. d.bindBuffer(d.ARRAY_BUFFER, a),
  51458. d.vertexAttribPointer(c.position, 2, d.FLOAT, !1, 16, 0),
  51459. d.vertexAttribPointer(c.uv, 2, d.FLOAT, !1, 16, 8),
  51460. d.bindBuffer(d.ELEMENT_ARRAY_BUFFER, s),
  51461. d.uniformMatrix4fv(h.projectionMatrix, !1, v.projectionMatrix.elements),
  51462. p.activeTexture(d.TEXTURE0),
  51463. d.uniform1i(h.map, 0);
  51464. var A = 0
  51465. , y = 0
  51466. , C = r.fog;
  51467. C ? (d.uniform3f(h.fogColor, C.color.r, C.color.g, C.color.b),
  51468. C instanceof n.Fog ? (d.uniform1f(h.fogNear, C.near),
  51469. d.uniform1f(h.fogFar, C.far),
  51470. d.uniform1i(h.fogType, 1),
  51471. A = 1,
  51472. y = 1) : C instanceof n.FogExp2 && (d.uniform1f(h.fogDensity, C.density),
  51473. d.uniform1i(h.fogType, 2),
  51474. A = 2,
  51475. y = 2)) : (d.uniform1i(h.fogType, 0),
  51476. A = 0,
  51477. y = 0);
  51478. for (var I = 0, E = t.length; I < E; I++) {
  51479. var b = t[I];
  51480. b.modelViewMatrix.multiplyMatrices(v.matrixWorldInverse, b.matrixWorld),
  51481. b.z = -b.modelViewMatrix.elements[14]
  51482. }
  51483. t.sort(o);
  51484. for (var w = [], I = 0, E = t.length; I < E; I++) {
  51485. var b = t[I]
  51486. , _ = b.material;
  51487. d.uniform1f(h.alphaTest, _.alphaTest),
  51488. d.uniformMatrix4fv(h.modelViewMatrix, !1, b.modelViewMatrix.elements),
  51489. b.matrixWorld.decompose(f, g, m),
  51490. w[0] = m.x,
  51491. w[1] = m.y;
  51492. var T = 0;
  51493. r.fog && _.fog && (T = y),
  51494. A !== T && (d.uniform1i(h.fogType, T),
  51495. A = T),
  51496. null !== _.map ? (d.uniform2f(h.uvOffset, _.map.offset.x, _.map.offset.y),
  51497. d.uniform2f(h.uvScale, _.map.repeat.x, _.map.repeat.y)) : (d.uniform2f(h.uvOffset, 0, 0),
  51498. d.uniform2f(h.uvScale, 1, 1)),
  51499. d.uniform1f(h.opacity, _.opacity),
  51500. d.uniform3f(h.color, _.color.r, _.color.g, _.color.b),
  51501. d.uniform1f(h.rotation, _.rotation),
  51502. d.uniform2fv(h.scale, w),
  51503. p.setBlending(_.blending, _.blendEquation, _.blendSrc, _.blendDst),
  51504. p.setDepthTest(_.depthTest),
  51505. p.setDepthWrite(_.depthWrite),
  51506. _.map && _.map.image && _.map.image.width ? e.setTexture(_.map, 0) : e.setTexture(u, 0),
  51507. d.drawElements(d.TRIANGLES, 6, d.UNSIGNED_SHORT, 0)
  51508. }
  51509. p.enable(d.CULL_FACE),
  51510. e.resetGLState()
  51511. }
  51512. }
  51513. }
  51514. ,
  51515. Object.defineProperties(n.Box2.prototype, {
  51516. empty: {
  51517. value: function() {
  51518. return console.warn("THREE.Box2: .empty() has been renamed to .isEmpty()."),
  51519. this.isEmpty()
  51520. }
  51521. },
  51522. isIntersectionBox: {
  51523. value: function(e) {
  51524. return console.warn("THREE.Box2: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51525. this.intersectsBox(e)
  51526. }
  51527. }
  51528. }),
  51529. Object.defineProperties(n.Box3.prototype, {
  51530. empty: {
  51531. value: function() {
  51532. return console.warn("THREE.Box3: .empty() has been renamed to .isEmpty()."),
  51533. this.isEmpty()
  51534. }
  51535. },
  51536. isIntersectionBox: {
  51537. value: function(e) {
  51538. return console.warn("THREE.Box3: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51539. this.intersectsBox(e)
  51540. }
  51541. },
  51542. isIntersectionSphere: {
  51543. value: function(e) {
  51544. return console.warn("THREE.Box3: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51545. this.intersectsSphere(e)
  51546. }
  51547. }
  51548. }),
  51549. Object.defineProperties(n.Matrix3.prototype, {
  51550. multiplyVector3: {
  51551. value: function(e) {
  51552. return console.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),
  51553. e.applyMatrix3(this)
  51554. }
  51555. },
  51556. multiplyVector3Array: {
  51557. value: function(e) {
  51558. return console.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51559. this.applyToVector3Array(e)
  51560. }
  51561. }
  51562. }),
  51563. Object.defineProperties(n.Matrix4.prototype, {
  51564. extractPosition: {
  51565. value: function(e) {
  51566. return console.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),
  51567. this.copyPosition(e)
  51568. }
  51569. },
  51570. setRotationFromQuaternion: {
  51571. value: function(e) {
  51572. return console.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),
  51573. this.makeRotationFromQuaternion(e)
  51574. }
  51575. },
  51576. multiplyVector3: {
  51577. value: function(e) {
  51578. return console.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),
  51579. e.applyProjection(this)
  51580. }
  51581. },
  51582. multiplyVector4: {
  51583. value: function(e) {
  51584. return console.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51585. e.applyMatrix4(this)
  51586. }
  51587. },
  51588. multiplyVector3Array: {
  51589. value: function(e) {
  51590. return console.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),
  51591. this.applyToVector3Array(e)
  51592. }
  51593. },
  51594. rotateAxis: {
  51595. value: function(e) {
  51596. console.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),
  51597. e.transformDirection(this)
  51598. }
  51599. },
  51600. crossVector: {
  51601. value: function(e) {
  51602. return console.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),
  51603. e.applyMatrix4(this)
  51604. }
  51605. },
  51606. translate: {
  51607. value: function(e) {
  51608. console.error("THREE.Matrix4: .translate() has been removed.")
  51609. }
  51610. },
  51611. rotateX: {
  51612. value: function(e) {
  51613. console.error("THREE.Matrix4: .rotateX() has been removed.")
  51614. }
  51615. },
  51616. rotateY: {
  51617. value: function(e) {
  51618. console.error("THREE.Matrix4: .rotateY() has been removed.")
  51619. }
  51620. },
  51621. rotateZ: {
  51622. value: function(e) {
  51623. console.error("THREE.Matrix4: .rotateZ() has been removed.")
  51624. }
  51625. },
  51626. rotateByAxis: {
  51627. value: function(e, t) {
  51628. console.error("THREE.Matrix4: .rotateByAxis() has been removed.")
  51629. }
  51630. }
  51631. }),
  51632. Object.defineProperties(n.Plane.prototype, {
  51633. isIntersectionLine: {
  51634. value: function(e) {
  51635. return console.warn("THREE.Plane: .isIntersectionLine() has been renamed to .intersectsLine()."),
  51636. this.intersectsLine(e)
  51637. }
  51638. }
  51639. }),
  51640. Object.defineProperties(n.Quaternion.prototype, {
  51641. multiplyVector3: {
  51642. value: function(e) {
  51643. return console.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),
  51644. e.applyQuaternion(this)
  51645. }
  51646. }
  51647. }),
  51648. Object.defineProperties(n.Ray.prototype, {
  51649. isIntersectionBox: {
  51650. value: function(e) {
  51651. return console.warn("THREE.Ray: .isIntersectionBox() has been renamed to .intersectsBox()."),
  51652. this.intersectsBox(e)
  51653. }
  51654. },
  51655. isIntersectionPlane: {
  51656. value: function(e) {
  51657. return console.warn("THREE.Ray: .isIntersectionPlane() has been renamed to .intersectsPlane()."),
  51658. this.intersectsPlane(e)
  51659. }
  51660. },
  51661. isIntersectionSphere: {
  51662. value: function(e) {
  51663. return console.warn("THREE.Ray: .isIntersectionSphere() has been renamed to .intersectsSphere()."),
  51664. this.intersectsSphere(e)
  51665. }
  51666. }
  51667. }),
  51668. Object.defineProperties(n.Vector3.prototype, {
  51669. setEulerFromRotationMatrix: {
  51670. value: function() {
  51671. console.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")
  51672. }
  51673. },
  51674. setEulerFromQuaternion: {
  51675. value: function() {
  51676. console.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")
  51677. }
  51678. },
  51679. getPositionFromMatrix: {
  51680. value: function(e) {
  51681. return console.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),
  51682. this.setFromMatrixPosition(e)
  51683. }
  51684. },
  51685. getScaleFromMatrix: {
  51686. value: function(e) {
  51687. return console.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),
  51688. this.setFromMatrixScale(e)
  51689. }
  51690. },
  51691. getColumnFromMatrix: {
  51692. value: function(e, t) {
  51693. return console.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),
  51694. this.setFromMatrixColumn(e, t)
  51695. }
  51696. }
  51697. }),
  51698. n.Face4 = function(e, t, i, r, o, a, s) {
  51699. return console.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),
  51700. new n.Face3(e,t,i,o,a,s)
  51701. }
  51702. ,
  51703. n.Vertex = function(e, t, i) {
  51704. return console.warn("THREE.Vertex has been removed. Use THREE.Vector3 instead."),
  51705. new n.Vector3(e,t,i)
  51706. }
  51707. ,
  51708. Object.defineProperties(n.Object3D.prototype, {
  51709. eulerOrder: {
  51710. get: function() {
  51711. return console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51712. this.rotation.order
  51713. },
  51714. set: function(e) {
  51715. console.warn("THREE.Object3D: .eulerOrder is now .rotation.order."),
  51716. this.rotation.order = e
  51717. }
  51718. },
  51719. getChildByName: {
  51720. value: function(e) {
  51721. return console.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),
  51722. this.getObjectByName(e)
  51723. }
  51724. },
  51725. renderDepth: {
  51726. set: function(e) {
  51727. console.warn("THREE.Object3D: .renderDepth has been removed. Use .renderOrder, instead.")
  51728. }
  51729. },
  51730. translate: {
  51731. value: function(e, t) {
  51732. return console.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),
  51733. this.translateOnAxis(t, e)
  51734. }
  51735. },
  51736. useQuaternion: {
  51737. get: function() {
  51738. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51739. },
  51740. set: function(e) {
  51741. console.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")
  51742. }
  51743. }
  51744. }),
  51745. Object.defineProperties(n, {
  51746. PointCloud: {
  51747. value: function(e, t) {
  51748. return console.warn("THREE.PointCloud has been renamed to THREE.Points."),
  51749. new n.Points(e,t)
  51750. }
  51751. },
  51752. ParticleSystem: {
  51753. value: function(e, t) {
  51754. return console.warn("THREE.ParticleSystem has been renamed to THREE.Points."),
  51755. new n.Points(e,t)
  51756. }
  51757. }
  51758. }),
  51759. Object.defineProperties(n.Light.prototype, {
  51760. onlyShadow: {
  51761. set: function(e) {
  51762. console.warn("THREE.Light: .onlyShadow has been removed.")
  51763. }
  51764. },
  51765. shadowCameraFov: {
  51766. set: function(e) {
  51767. console.warn("THREE.Light: .shadowCameraFov is now .shadow.camera.fov."),
  51768. this.shadow.camera.fov = e
  51769. }
  51770. },
  51771. shadowCameraLeft: {
  51772. set: function(e) {
  51773. console.warn("THREE.Light: .shadowCameraLeft is now .shadow.camera.left."),
  51774. this.shadow.camera.left = e
  51775. }
  51776. },
  51777. shadowCameraRight: {
  51778. set: function(e) {
  51779. console.warn("THREE.Light: .shadowCameraRight is now .shadow.camera.right."),
  51780. this.shadow.camera.right = e
  51781. }
  51782. },
  51783. shadowCameraTop: {
  51784. set: function(e) {
  51785. console.warn("THREE.Light: .shadowCameraTop is now .shadow.camera.top."),
  51786. this.shadow.camera.top = e
  51787. }
  51788. },
  51789. shadowCameraBottom: {
  51790. set: function(e) {
  51791. console.warn("THREE.Light: .shadowCameraBottom is now .shadow.camera.bottom."),
  51792. this.shadow.camera.bottom = e
  51793. }
  51794. },
  51795. shadowCameraNear: {
  51796. set: function(e) {
  51797. console.warn("THREE.Light: .shadowCameraNear is now .shadow.camera.near."),
  51798. this.shadow.camera.near = e
  51799. }
  51800. },
  51801. shadowCameraFar: {
  51802. set: function(e) {
  51803. console.warn("THREE.Light: .shadowCameraFar is now .shadow.camera.far."),
  51804. this.shadow.camera.far = e
  51805. }
  51806. },
  51807. shadowCameraVisible: {
  51808. set: function(e) {
  51809. console.warn("THREE.Light: .shadowCameraVisible has been removed. Use new THREE.CameraHelper( light.shadow.camera ) instead.")
  51810. }
  51811. },
  51812. shadowBias: {
  51813. set: function(e) {
  51814. console.warn("THREE.Light: .shadowBias is now .shadow.bias."),
  51815. this.shadow.bias = e
  51816. }
  51817. },
  51818. shadowDarkness: {
  51819. set: function(e) {
  51820. console.warn("THREE.Light: .shadowDarkness has been removed.")
  51821. }
  51822. },
  51823. shadowMapWidth: {
  51824. set: function(e) {
  51825. console.warn("THREE.Light: .shadowMapWidth is now .shadow.mapSize.width."),
  51826. this.shadow.mapSize.width = e
  51827. }
  51828. },
  51829. shadowMapHeight: {
  51830. set: function(e) {
  51831. console.warn("THREE.Light: .shadowMapHeight is now .shadow.mapSize.height."),
  51832. this.shadow.mapSize.height = e
  51833. }
  51834. }
  51835. }),
  51836. Object.defineProperties(n.BufferAttribute.prototype, {
  51837. length: {
  51838. get: function() {
  51839. return console.warn("THREE.BufferAttribute: .length has been deprecated. Please use .count."),
  51840. this.array.length
  51841. }
  51842. }
  51843. }),
  51844. Object.defineProperties(n.BufferGeometry.prototype, {
  51845. drawcalls: {
  51846. get: function() {
  51847. return console.error("THREE.BufferGeometry: .drawcalls has been renamed to .groups."),
  51848. this.groups
  51849. }
  51850. },
  51851. offsets: {
  51852. get: function() {
  51853. return console.warn("THREE.BufferGeometry: .offsets has been renamed to .groups."),
  51854. this.groups
  51855. }
  51856. },
  51857. addIndex: {
  51858. value: function(e) {
  51859. console.warn("THREE.BufferGeometry: .addIndex() has been renamed to .setIndex()."),
  51860. this.setIndex(e)
  51861. }
  51862. },
  51863. addDrawCall: {
  51864. value: function(e, t, i) {
  51865. void 0 !== i && console.warn("THREE.BufferGeometry: .addDrawCall() no longer supports indexOffset."),
  51866. console.warn("THREE.BufferGeometry: .addDrawCall() is now .addGroup()."),
  51867. this.addGroup(e, t)
  51868. }
  51869. },
  51870. clearDrawCalls: {
  51871. value: function() {
  51872. console.warn("THREE.BufferGeometry: .clearDrawCalls() is now .clearGroups()."),
  51873. this.clearGroups()
  51874. }
  51875. },
  51876. computeTangents: {
  51877. value: function() {
  51878. console.warn("THREE.BufferGeometry: .computeTangents() has been removed.")
  51879. }
  51880. },
  51881. computeOffsets: {
  51882. value: function() {
  51883. console.warn("THREE.BufferGeometry: .computeOffsets() has been removed.")
  51884. }
  51885. }
  51886. }),
  51887. Object.defineProperties(n.Material.prototype, {
  51888. wrapAround: {
  51889. get: function() {
  51890. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51891. },
  51892. set: function(e) {
  51893. console.warn("THREE." + this.type + ": .wrapAround has been removed.")
  51894. }
  51895. },
  51896. wrapRGB: {
  51897. get: function() {
  51898. return console.warn("THREE." + this.type + ": .wrapRGB has been removed."),
  51899. new n.Color
  51900. }
  51901. }
  51902. }),
  51903. Object.defineProperties(n, {
  51904. PointCloudMaterial: {
  51905. value: function(e) {
  51906. return console.warn("THREE.PointCloudMaterial has been renamed to THREE.PointsMaterial."),
  51907. new n.PointsMaterial(e)
  51908. }
  51909. },
  51910. ParticleBasicMaterial: {
  51911. value: function(e) {
  51912. return console.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointsMaterial."),
  51913. new n.PointsMaterial(e)
  51914. }
  51915. },
  51916. ParticleSystemMaterial: {
  51917. value: function(e) {
  51918. return console.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointsMaterial."),
  51919. new n.PointsMaterial(e)
  51920. }
  51921. }
  51922. }),
  51923. Object.defineProperties(n.MeshPhongMaterial.prototype, {
  51924. metal: {
  51925. get: function() {
  51926. return console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead."),
  51927. !1
  51928. },
  51929. set: function(e) {
  51930. console.warn("THREE.MeshPhongMaterial: .metal has been removed. Use THREE.MeshStandardMaterial instead")
  51931. }
  51932. }
  51933. }),
  51934. Object.defineProperties(n.ShaderMaterial.prototype, {
  51935. derivatives: {
  51936. get: function() {
  51937. return console.warn("THREE.ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51938. this.extensions.derivatives
  51939. },
  51940. set: function(e) {
  51941. console.warn("THREE. ShaderMaterial: .derivatives has been moved to .extensions.derivatives."),
  51942. this.extensions.derivatives = e
  51943. }
  51944. }
  51945. }),
  51946. Object.defineProperties(n.WebGLRenderer.prototype, {
  51947. supportsFloatTextures: {
  51948. value: function() {
  51949. return console.warn("THREE.WebGLRenderer: .supportsFloatTextures() is now .extensions.get( 'OES_texture_float' )."),
  51950. this.extensions.get("OES_texture_float")
  51951. }
  51952. },
  51953. supportsHalfFloatTextures: {
  51954. value: function() {
  51955. return console.warn("THREE.WebGLRenderer: .supportsHalfFloatTextures() is now .extensions.get( 'OES_texture_half_float' )."),
  51956. this.extensions.get("OES_texture_half_float")
  51957. }
  51958. },
  51959. supportsStandardDerivatives: {
  51960. value: function() {
  51961. return console.warn("THREE.WebGLRenderer: .supportsStandardDerivatives() is now .extensions.get( 'OES_standard_derivatives' )."),
  51962. this.extensions.get("OES_standard_derivatives")
  51963. }
  51964. },
  51965. supportsCompressedTextureS3TC: {
  51966. value: function() {
  51967. return console.warn("THREE.WebGLRenderer: .supportsCompressedTextureS3TC() is now .extensions.get( 'WEBGL_compressed_texture_s3tc' )."),
  51968. this.extensions.get("WEBGL_compressed_texture_s3tc")
  51969. }
  51970. },
  51971. supportsCompressedTexturePVRTC: {
  51972. value: function() {
  51973. return console.warn("THREE.WebGLRenderer: .supportsCompressedTexturePVRTC() is now .extensions.get( 'WEBGL_compressed_texture_pvrtc' )."),
  51974. this.extensions.get("WEBGL_compressed_texture_pvrtc")
  51975. }
  51976. },
  51977. supportsBlendMinMax: {
  51978. value: function() {
  51979. return console.warn("THREE.WebGLRenderer: .supportsBlendMinMax() is now .extensions.get( 'EXT_blend_minmax' )."),
  51980. this.extensions.get("EXT_blend_minmax")
  51981. }
  51982. },
  51983. supportsVertexTextures: {
  51984. value: function() {
  51985. return this.capabilities.vertexTextures
  51986. }
  51987. },
  51988. supportsInstancedArrays: {
  51989. value: function() {
  51990. return console.warn("THREE.WebGLRenderer: .supportsInstancedArrays() is now .extensions.get( 'ANGLE_instanced_arrays' )."),
  51991. this.extensions.get("ANGLE_instanced_arrays")
  51992. }
  51993. },
  51994. enableScissorTest: {
  51995. value: function(e) {
  51996. console.warn("THREE.WebGLRenderer: .enableScissorTest() is now .setScissorTest()."),
  51997. this.setScissorTest(e)
  51998. }
  51999. },
  52000. initMaterial: {
  52001. value: function() {
  52002. console.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")
  52003. }
  52004. },
  52005. addPrePlugin: {
  52006. value: function() {
  52007. console.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")
  52008. }
  52009. },
  52010. addPostPlugin: {
  52011. value: function() {
  52012. console.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")
  52013. }
  52014. },
  52015. updateShadowMap: {
  52016. value: function() {
  52017. console.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")
  52018. }
  52019. },
  52020. shadowMapEnabled: {
  52021. get: function() {
  52022. return this.shadowMap.enabled
  52023. },
  52024. set: function(e) {
  52025. console.warn("THREE.WebGLRenderer: .shadowMapEnabled is now .shadowMap.enabled."),
  52026. this.shadowMap.enabled = e
  52027. }
  52028. },
  52029. shadowMapType: {
  52030. get: function() {
  52031. return this.shadowMap.type
  52032. },
  52033. set: function(e) {
  52034. console.warn("THREE.WebGLRenderer: .shadowMapType is now .shadowMap.type."),
  52035. this.shadowMap.type = e
  52036. }
  52037. },
  52038. shadowMapCullFace: {
  52039. get: function() {
  52040. return this.shadowMap.cullFace
  52041. },
  52042. set: function(e) {
  52043. console.warn("THREE.WebGLRenderer: .shadowMapCullFace is now .shadowMap.cullFace."),
  52044. this.shadowMap.cullFace = e
  52045. }
  52046. }
  52047. }),
  52048. Object.defineProperties(n.WebGLRenderTarget.prototype, {
  52049. wrapS: {
  52050. get: function() {
  52051. return console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52052. this.texture.wrapS
  52053. },
  52054. set: function(e) {
  52055. console.warn("THREE.WebGLRenderTarget: .wrapS is now .texture.wrapS."),
  52056. this.texture.wrapS = e
  52057. }
  52058. },
  52059. wrapT: {
  52060. get: function() {
  52061. return console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52062. this.texture.wrapT
  52063. },
  52064. set: function(e) {
  52065. console.warn("THREE.WebGLRenderTarget: .wrapT is now .texture.wrapT."),
  52066. this.texture.wrapT = e
  52067. }
  52068. },
  52069. magFilter: {
  52070. get: function() {
  52071. return console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52072. this.texture.magFilter
  52073. },
  52074. set: function(e) {
  52075. console.warn("THREE.WebGLRenderTarget: .magFilter is now .texture.magFilter."),
  52076. this.texture.magFilter = e
  52077. }
  52078. },
  52079. minFilter: {
  52080. get: function() {
  52081. return console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52082. this.texture.minFilter
  52083. },
  52084. set: function(e) {
  52085. console.warn("THREE.WebGLRenderTarget: .minFilter is now .texture.minFilter."),
  52086. this.texture.minFilter = e
  52087. }
  52088. },
  52089. anisotropy: {
  52090. get: function() {
  52091. return console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52092. this.texture.anisotropy
  52093. },
  52094. set: function(e) {
  52095. console.warn("THREE.WebGLRenderTarget: .anisotropy is now .texture.anisotropy."),
  52096. this.texture.anisotropy = e
  52097. }
  52098. },
  52099. offset: {
  52100. get: function() {
  52101. return console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52102. this.texture.offset
  52103. },
  52104. set: function(e) {
  52105. console.warn("THREE.WebGLRenderTarget: .offset is now .texture.offset."),
  52106. this.texture.offset = e
  52107. }
  52108. },
  52109. repeat: {
  52110. get: function() {
  52111. return console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52112. this.texture.repeat
  52113. },
  52114. set: function(e) {
  52115. console.warn("THREE.WebGLRenderTarget: .repeat is now .texture.repeat."),
  52116. this.texture.repeat = e
  52117. }
  52118. },
  52119. format: {
  52120. get: function() {
  52121. return console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52122. this.texture.format
  52123. },
  52124. set: function(e) {
  52125. console.warn("THREE.WebGLRenderTarget: .format is now .texture.format."),
  52126. this.texture.format = e
  52127. }
  52128. },
  52129. type: {
  52130. get: function() {
  52131. return console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52132. this.texture.type
  52133. },
  52134. set: function(e) {
  52135. console.warn("THREE.WebGLRenderTarget: .type is now .texture.type."),
  52136. this.texture.type = e
  52137. }
  52138. },
  52139. generateMipmaps: {
  52140. get: function() {
  52141. return console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52142. this.texture.generateMipmaps
  52143. },
  52144. set: function(e) {
  52145. console.warn("THREE.WebGLRenderTarget: .generateMipmaps is now .texture.generateMipmaps."),
  52146. this.texture.generateMipmaps = e
  52147. }
  52148. }
  52149. }),
  52150. n.GeometryUtils = {
  52151. merge: function(e, t, i) {
  52152. console.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead.");
  52153. var r;
  52154. t instanceof n.Mesh && (t.matrixAutoUpdate && t.updateMatrix(),
  52155. r = t.matrix,
  52156. t = t.geometry),
  52157. e.merge(t, r, i)
  52158. },
  52159. center: function(e) {
  52160. return console.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),
  52161. e.center()
  52162. }
  52163. },
  52164. n.ImageUtils = {
  52165. crossOrigin: void 0,
  52166. loadTexture: function(e, t, i, r) {
  52167. console.warn("THREE.ImageUtils.loadTexture has been deprecated. Use THREE.TextureLoader() instead.");
  52168. var o = new n.TextureLoader;
  52169. o.setCrossOrigin(this.crossOrigin);
  52170. var a = o.load(e, i, void 0, r);
  52171. return t && (a.mapping = t),
  52172. a
  52173. },
  52174. loadTextureCube: function(e, t, i, r) {
  52175. console.warn("THREE.ImageUtils.loadTextureCube has been deprecated. Use THREE.CubeTextureLoader() instead.");
  52176. var o = new n.CubeTextureLoader;
  52177. o.setCrossOrigin(this.crossOrigin);
  52178. var a = o.load(e, i, void 0, r);
  52179. return t && (a.mapping = t),
  52180. a
  52181. },
  52182. loadCompressedTexture: function() {
  52183. console.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")
  52184. },
  52185. loadCompressedTextureCube: function() {
  52186. console.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")
  52187. }
  52188. },
  52189. n.Projector = function() {
  52190. console.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),
  52191. this.projectVector = function(e, t) {
  52192. console.warn("THREE.Projector: .projectVector() is now vector.project()."),
  52193. e.project(t)
  52194. }
  52195. ,
  52196. this.unprojectVector = function(e, t) {
  52197. console.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),
  52198. e.unproject(t)
  52199. }
  52200. ,
  52201. this.pickingRay = function(e, t) {
  52202. console.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")
  52203. }
  52204. }
  52205. ,
  52206. n.CanvasRenderer = function() {
  52207. console.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),
  52208. this.domElement = document.createElement("canvas"),
  52209. this.clear = function() {}
  52210. ,
  52211. this.render = function() {}
  52212. ,
  52213. this.setClearColor = function() {}
  52214. ,
  52215. this.setSize = function() {}
  52216. }
  52217. ,
  52218. n.MeshFaceMaterial = n.MultiMaterial,
  52219. n.CurveUtils = {
  52220. tangentQuadraticBezier: function(e, t, i, n) {
  52221. return 2 * (1 - e) * (i - t) + 2 * e * (n - i)
  52222. },
  52223. tangentCubicBezier: function(e, t, i, n, r) {
  52224. 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
  52225. },
  52226. tangentSpline: function(e, t, i, n, r) {
  52227. var o = 6 * e * e - 6 * e
  52228. , a = 3 * e * e - 4 * e + 1
  52229. , s = -6 * e * e + 6 * e
  52230. , l = 3 * e * e - 2 * e;
  52231. return o + a + s + l
  52232. },
  52233. interpolate: function(e, t, i, n, r) {
  52234. var o = .5 * (i - e)
  52235. , a = .5 * (n - t)
  52236. , s = r * r
  52237. , l = r * s;
  52238. return (2 * t - 2 * i + o + a) * l + (-3 * t + 3 * i - 2 * o - a) * s + o * r + t
  52239. }
  52240. },
  52241. n.SceneUtils = {
  52242. createMultiMaterialObject: function(e, t) {
  52243. for (var i = new n.Group, r = 0, o = t.length; r < o; r++)
  52244. i.add(new n.Mesh(e,t[r]));
  52245. return i
  52246. },
  52247. detach: function(e, t, i) {
  52248. e.applyMatrix(t.matrixWorld),
  52249. t.remove(e),
  52250. i.add(e)
  52251. },
  52252. attach: function(e, t, i) {
  52253. var r = new n.Matrix4;
  52254. r.getInverse(i.matrixWorld),
  52255. e.applyMatrix(r),
  52256. t.remove(e),
  52257. i.add(e)
  52258. }
  52259. },
  52260. n.ShapeUtils = {
  52261. area: function(e) {
  52262. for (var t = e.length, i = 0, n = t - 1, r = 0; r < t; n = r++)
  52263. i += e[n].x * e[r].y - e[r].x * e[n].y;
  52264. return .5 * i
  52265. },
  52266. triangulate: function() {
  52267. function e(e, t, i, n, r, o) {
  52268. var a, s, l, c, h, u, d, p, f;
  52269. if (s = e[o[t]].x,
  52270. l = e[o[t]].y,
  52271. c = e[o[i]].x,
  52272. h = e[o[i]].y,
  52273. u = e[o[n]].x,
  52274. d = e[o[n]].y,
  52275. Number.EPSILON > (c - s) * (d - l) - (h - l) * (u - s))
  52276. return !1;
  52277. var g, m, v, A, y, C, I, E, b, w, _, T, x, S, M;
  52278. for (g = u - c,
  52279. m = d - h,
  52280. v = s - u,
  52281. A = l - d,
  52282. y = c - s,
  52283. C = h - l,
  52284. a = 0; a < r; a++)
  52285. if (p = e[o[a]].x,
  52286. f = e[o[a]].y,
  52287. !(p === s && f === l || p === c && f === h || p === u && f === d) && (I = p - s,
  52288. E = f - l,
  52289. b = p - c,
  52290. w = f - h,
  52291. _ = p - u,
  52292. T = f - d,
  52293. M = g * w - m * b,
  52294. x = y * E - C * I,
  52295. S = v * T - A * _,
  52296. M >= -Number.EPSILON && S >= -Number.EPSILON && x >= -Number.EPSILON))
  52297. return !1;
  52298. return !0
  52299. }
  52300. return function(t, i) {
  52301. var r = t.length;
  52302. if (r < 3)
  52303. return null;
  52304. var o, a, s, l = [], c = [], h = [];
  52305. if (n.ShapeUtils.area(t) > 0)
  52306. for (a = 0; a < r; a++)
  52307. c[a] = a;
  52308. else
  52309. for (a = 0; a < r; a++)
  52310. c[a] = r - 1 - a;
  52311. var u = r
  52312. , d = 2 * u;
  52313. for (a = u - 1; u > 2; ) {
  52314. if (d-- <= 0)
  52315. return console.warn("THREE.ShapeUtils: Unable to triangulate polygon! in triangulate()"),
  52316. i ? h : l;
  52317. if (o = a,
  52318. u <= o && (o = 0),
  52319. a = o + 1,
  52320. u <= a && (a = 0),
  52321. s = a + 1,
  52322. u <= s && (s = 0),
  52323. e(t, o, a, s, u, c)) {
  52324. var p, f, g, m, v;
  52325. for (p = c[o],
  52326. f = c[a],
  52327. g = c[s],
  52328. l.push([t[p], t[f], t[g]]),
  52329. h.push([c[o], c[a], c[s]]),
  52330. m = a,
  52331. v = a + 1; v < u; m++,
  52332. v++)
  52333. c[m] = c[v];
  52334. u--,
  52335. d = 2 * u
  52336. }
  52337. }
  52338. return i ? h : l
  52339. }
  52340. }(),
  52341. triangulateShape: function(e, t) {
  52342. function i(e, t, i) {
  52343. 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
  52344. }
  52345. function r(e, t, n, r, o) {
  52346. var a = t.x - e.x
  52347. , s = t.y - e.y
  52348. , l = r.x - n.x
  52349. , c = r.y - n.y
  52350. , h = e.x - n.x
  52351. , u = e.y - n.y
  52352. , d = s * l - a * c
  52353. , p = s * h - a * u;
  52354. if (Math.abs(d) > Number.EPSILON) {
  52355. var f;
  52356. if (d > 0) {
  52357. if (p < 0 || p > d)
  52358. return [];
  52359. if (f = c * h - l * u,
  52360. f < 0 || f > d)
  52361. return []
  52362. } else {
  52363. if (p > 0 || p < d)
  52364. return [];
  52365. if (f = c * h - l * u,
  52366. f > 0 || f < d)
  52367. return []
  52368. }
  52369. if (0 === f)
  52370. return !o || 0 !== p && p !== d ? [e] : [];
  52371. if (f === d)
  52372. return !o || 0 !== p && p !== d ? [t] : [];
  52373. if (0 === p)
  52374. return [n];
  52375. if (p === d)
  52376. return [r];
  52377. var g = f / d;
  52378. return [{
  52379. x: e.x + g * a,
  52380. y: e.y + g * s
  52381. }]
  52382. }
  52383. if (0 !== p || c * h !== l * u)
  52384. return [];
  52385. var m = 0 === a && 0 === s
  52386. , v = 0 === l && 0 === c;
  52387. if (m && v)
  52388. return e.x !== n.x || e.y !== n.y ? [] : [e];
  52389. if (m)
  52390. return i(n, r, e) ? [e] : [];
  52391. if (v)
  52392. return i(e, t, n) ? [n] : [];
  52393. var A, y, C, I, E, b, w, _;
  52394. return 0 !== a ? (e.x < t.x ? (A = e,
  52395. C = e.x,
  52396. y = t,
  52397. I = t.x) : (A = t,
  52398. C = t.x,
  52399. y = e,
  52400. I = e.x),
  52401. n.x < r.x ? (E = n,
  52402. w = n.x,
  52403. b = r,
  52404. _ = r.x) : (E = r,
  52405. w = r.x,
  52406. b = n,
  52407. _ = n.x)) : (e.y < t.y ? (A = e,
  52408. C = e.y,
  52409. y = t,
  52410. I = t.y) : (A = t,
  52411. C = t.y,
  52412. y = e,
  52413. I = e.y),
  52414. n.y < r.y ? (E = n,
  52415. w = n.y,
  52416. b = r,
  52417. _ = r.y) : (E = r,
  52418. w = r.y,
  52419. b = n,
  52420. _ = n.y)),
  52421. C <= w ? I < w ? [] : I === w ? o ? [] : [E] : I <= _ ? [E, y] : [E, b] : C > _ ? [] : C === _ ? o ? [] : [A] : I <= _ ? [A, y] : [A, b]
  52422. }
  52423. function o(e, t, i, n) {
  52424. var r = t.x - e.x
  52425. , o = t.y - e.y
  52426. , a = i.x - e.x
  52427. , s = i.y - e.y
  52428. , l = n.x - e.x
  52429. , c = n.y - e.y
  52430. , h = r * s - o * a
  52431. , u = r * c - o * l;
  52432. if (Math.abs(h) > Number.EPSILON) {
  52433. var d = l * s - c * a;
  52434. return h > 0 ? u >= 0 && d >= 0 : u >= 0 || d >= 0
  52435. }
  52436. return u > 0
  52437. }
  52438. function a(e, t) {
  52439. function i(e, t) {
  52440. var i = A.length - 1
  52441. , n = e - 1;
  52442. n < 0 && (n = i);
  52443. var r = e + 1;
  52444. r > i && (r = 0);
  52445. var a = o(A[e], A[n], A[r], s[t]);
  52446. if (!a)
  52447. return !1;
  52448. var l = s.length - 1
  52449. , c = t - 1;
  52450. c < 0 && (c = l);
  52451. var h = t + 1;
  52452. return h > l && (h = 0),
  52453. a = o(s[t], s[c], s[h], A[e]),
  52454. !!a
  52455. }
  52456. function n(e, t) {
  52457. var i, n, o;
  52458. for (i = 0; i < A.length; i++)
  52459. if (n = i + 1,
  52460. n %= A.length,
  52461. o = r(e, t, A[i], A[n], !0),
  52462. o.length > 0)
  52463. return !0;
  52464. return !1
  52465. }
  52466. function a(e, i) {
  52467. var n, o, a, s, l;
  52468. for (n = 0; n < y.length; n++)
  52469. for (o = t[y[n]],
  52470. a = 0; a < o.length; a++)
  52471. if (s = a + 1,
  52472. s %= o.length,
  52473. l = r(e, i, o[a], o[s], !0),
  52474. l.length > 0)
  52475. return !0;
  52476. return !1
  52477. }
  52478. 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++)
  52479. y.push(I);
  52480. for (var b = 0, w = 2 * y.length; y.length > 0; ) {
  52481. if (w--,
  52482. w < 0) {
  52483. console.log("Infinite Loop! Holes left:" + y.length + ", Probably Hole outside Shape!");
  52484. break
  52485. }
  52486. for (c = b; c < A.length; c++) {
  52487. h = A[c],
  52488. l = -1;
  52489. for (var I = 0; I < y.length; I++)
  52490. if (d = y[I],
  52491. p = h.x + ":" + h.y + ":" + d,
  52492. void 0 === C[p]) {
  52493. s = t[d];
  52494. for (var _ = 0; _ < s.length; _++)
  52495. if (u = s[_],
  52496. i(c, _) && !n(h, u) && !a(h, u)) {
  52497. l = _,
  52498. y.splice(I, 1),
  52499. f = A.slice(0, c + 1),
  52500. g = A.slice(c),
  52501. m = s.slice(l),
  52502. v = s.slice(0, l + 1),
  52503. A = f.concat(m).concat(v).concat(g),
  52504. b = c;
  52505. break
  52506. }
  52507. if (l >= 0)
  52508. break;
  52509. C[p] = !0
  52510. }
  52511. if (l >= 0)
  52512. break
  52513. }
  52514. }
  52515. return A
  52516. }
  52517. for (var s, l, c, h, u, d, p = {}, f = e.concat(), g = 0, m = t.length; g < m; g++)
  52518. Array.prototype.push.apply(f, t[g]);
  52519. for (s = 0,
  52520. l = f.length; s < l; s++)
  52521. u = f[s].x + ":" + f[s].y,
  52522. void 0 !== p[u] && console.warn("THREE.Shape: Duplicate point", u),
  52523. p[u] = s;
  52524. var v = a(e, t)
  52525. , A = n.ShapeUtils.triangulate(v, !1);
  52526. for (s = 0,
  52527. l = A.length; s < l; s++)
  52528. for (h = A[s],
  52529. c = 0; c < 3; c++)
  52530. u = h[c].x + ":" + h[c].y,
  52531. d = p[u],
  52532. void 0 !== d && (h[c] = d);
  52533. return A.concat()
  52534. },
  52535. isClockWise: function(e) {
  52536. return n.ShapeUtils.area(e) < 0
  52537. },
  52538. b2: function() {
  52539. function e(e, t) {
  52540. var i = 1 - e;
  52541. return i * i * t
  52542. }
  52543. function t(e, t) {
  52544. return 2 * (1 - e) * e * t
  52545. }
  52546. function i(e, t) {
  52547. return e * e * t
  52548. }
  52549. return function(n, r, o, a) {
  52550. return e(n, r) + t(n, o) + i(n, a)
  52551. }
  52552. }(),
  52553. b3: function() {
  52554. function e(e, t) {
  52555. var i = 1 - e;
  52556. return i * i * i * t
  52557. }
  52558. function t(e, t) {
  52559. var i = 1 - e;
  52560. return 3 * i * i * e * t
  52561. }
  52562. function i(e, t) {
  52563. var i = 1 - e;
  52564. return 3 * i * e * e * t
  52565. }
  52566. function n(e, t) {
  52567. return e * e * e * t
  52568. }
  52569. return function(r, o, a, s, l) {
  52570. return e(r, o) + t(r, a) + i(r, s) + n(r, l)
  52571. }
  52572. }()
  52573. },
  52574. n.Curve = function() {}
  52575. ,
  52576. n.Curve.prototype = {
  52577. constructor: n.Curve,
  52578. getPoint: function(e) {
  52579. return console.warn("THREE.Curve: Warning, getPoint() not implemented!"),
  52580. null
  52581. },
  52582. getPointAt: function(e) {
  52583. var t = this.getUtoTmapping(e);
  52584. return this.getPoint(t)
  52585. },
  52586. getPoints: function(e) {
  52587. e || (e = 5);
  52588. var t, i = [];
  52589. for (t = 0; t <= e; t++)
  52590. i.push(this.getPoint(t / e));
  52591. return i
  52592. },
  52593. getSpacedPoints: function(e) {
  52594. e || (e = 5);
  52595. var t, i = [];
  52596. for (t = 0; t <= e; t++)
  52597. i.push(this.getPointAt(t / e));
  52598. return i
  52599. },
  52600. getLength: function() {
  52601. var e = this.getLengths();
  52602. return e[e.length - 1]
  52603. },
  52604. getLengths: function(e) {
  52605. if (e || (e = this.__arcLengthDivisions ? this.__arcLengthDivisions : 200),
  52606. this.cacheArcLengths && this.cacheArcLengths.length === e + 1 && !this.needsUpdate)
  52607. return this.cacheArcLengths;
  52608. this.needsUpdate = !1;
  52609. var t, i, n = [], r = this.getPoint(0), o = 0;
  52610. for (n.push(0),
  52611. i = 1; i <= e; i++)
  52612. t = this.getPoint(i / e),
  52613. o += t.distanceTo(r),
  52614. n.push(o),
  52615. r = t;
  52616. return this.cacheArcLengths = n,
  52617. n
  52618. },
  52619. updateArcLengths: function() {
  52620. this.needsUpdate = !0,
  52621. this.getLengths()
  52622. },
  52623. getUtoTmapping: function(e, t) {
  52624. var i, n = this.getLengths(), r = 0, o = n.length;
  52625. i = t ? t : e * n[o - 1];
  52626. for (var a, s = 0, l = o - 1; s <= l; )
  52627. if (r = Math.floor(s + (l - s) / 2),
  52628. a = n[r] - i,
  52629. a < 0)
  52630. s = r + 1;
  52631. else {
  52632. if (!(a > 0)) {
  52633. l = r;
  52634. break
  52635. }
  52636. l = r - 1
  52637. }
  52638. if (r = l,
  52639. n[r] === i) {
  52640. var c = r / (o - 1);
  52641. return c
  52642. }
  52643. var h = n[r]
  52644. , u = n[r + 1]
  52645. , d = u - h
  52646. , p = (i - h) / d
  52647. , c = (r + p) / (o - 1);
  52648. return c
  52649. },
  52650. getTangent: function(e) {
  52651. var t = 1e-4
  52652. , i = e - t
  52653. , n = e + t;
  52654. i < 0 && (i = 0),
  52655. n > 1 && (n = 1);
  52656. var r = this.getPoint(i)
  52657. , o = this.getPoint(n)
  52658. , a = o.clone().sub(r);
  52659. return a.normalize()
  52660. },
  52661. getTangentAt: function(e) {
  52662. var t = this.getUtoTmapping(e);
  52663. return this.getTangent(t)
  52664. }
  52665. },
  52666. n.Curve.create = function(e, t) {
  52667. return e.prototype = Object.create(n.Curve.prototype),
  52668. e.prototype.constructor = e,
  52669. e.prototype.getPoint = t,
  52670. e
  52671. }
  52672. ,
  52673. n.CurvePath = function() {
  52674. this.curves = [],
  52675. this.autoClose = !1
  52676. }
  52677. ,
  52678. n.CurvePath.prototype = Object.create(n.Curve.prototype),
  52679. n.CurvePath.prototype.constructor = n.CurvePath,
  52680. n.CurvePath.prototype.add = function(e) {
  52681. this.curves.push(e)
  52682. }
  52683. ,
  52684. n.CurvePath.prototype.closePath = function() {
  52685. var e = this.curves[0].getPoint(0)
  52686. , t = this.curves[this.curves.length - 1].getPoint(1);
  52687. e.equals(t) || this.curves.push(new n.LineCurve(t,e))
  52688. }
  52689. ,
  52690. n.CurvePath.prototype.getPoint = function(e) {
  52691. for (var t = e * this.getLength(), i = this.getCurveLengths(), n = 0; n < i.length; ) {
  52692. if (i[n] >= t) {
  52693. var r = i[n] - t
  52694. , o = this.curves[n]
  52695. , a = 1 - r / o.getLength();
  52696. return o.getPointAt(a)
  52697. }
  52698. n++
  52699. }
  52700. return null
  52701. }
  52702. ,
  52703. n.CurvePath.prototype.getLength = function() {
  52704. var e = this.getCurveLengths();
  52705. return e[e.length - 1]
  52706. }
  52707. ,
  52708. n.CurvePath.prototype.getCurveLengths = function() {
  52709. if (this.cacheLengths && this.cacheLengths.length === this.curves.length)
  52710. return this.cacheLengths;
  52711. for (var e = [], t = 0, i = 0, n = this.curves.length; i < n; i++)
  52712. t += this.curves[i].getLength(),
  52713. e.push(t);
  52714. return this.cacheLengths = e,
  52715. e
  52716. }
  52717. ,
  52718. n.CurvePath.prototype.createPointsGeometry = function(e) {
  52719. var t = this.getPoints(e);
  52720. return this.createGeometry(t)
  52721. }
  52722. ,
  52723. n.CurvePath.prototype.createSpacedPointsGeometry = function(e) {
  52724. var t = this.getSpacedPoints(e);
  52725. return this.createGeometry(t)
  52726. }
  52727. ,
  52728. n.CurvePath.prototype.createGeometry = function(e) {
  52729. for (var t = new n.Geometry, i = 0, r = e.length; i < r; i++) {
  52730. var o = e[i];
  52731. t.vertices.push(new n.Vector3(o.x,o.y,o.z || 0))
  52732. }
  52733. return t
  52734. }
  52735. ,
  52736. n.Font = function(e) {
  52737. this.data = e
  52738. }
  52739. ,
  52740. n.Font.prototype = {
  52741. constructor: n.Font,
  52742. generateShapes: function(e, t, i) {
  52743. function r(e) {
  52744. for (var i = String(e).split(""), n = t / a.resolution, r = 0, s = [], l = 0; l < i.length; l++) {
  52745. var c = o(i[l], n, r);
  52746. r += c.offset,
  52747. s.push(c.path)
  52748. }
  52749. return s
  52750. }
  52751. function o(e, t, r) {
  52752. var o = a.glyphs[e] || a.glyphs["?"];
  52753. if (o) {
  52754. var s, l, c, h, u, d, p, f, g, m, v, A = new n.Path, y = [], C = n.ShapeUtils.b2, I = n.ShapeUtils.b3;
  52755. if (o.o)
  52756. for (var E = o._cachedOutline || (o._cachedOutline = o.o.split(" ")), b = 0, w = E.length; b < w; ) {
  52757. var _ = E[b++];
  52758. switch (_) {
  52759. case "m":
  52760. s = E[b++] * t + r,
  52761. l = E[b++] * t,
  52762. A.moveTo(s, l);
  52763. break;
  52764. case "l":
  52765. s = E[b++] * t + r,
  52766. l = E[b++] * t,
  52767. A.lineTo(s, l);
  52768. break;
  52769. case "q":
  52770. if (c = E[b++] * t + r,
  52771. h = E[b++] * t,
  52772. p = E[b++] * t + r,
  52773. f = E[b++] * t,
  52774. A.quadraticCurveTo(p, f, c, h),
  52775. v = y[y.length - 1]) {
  52776. u = v.x,
  52777. d = v.y;
  52778. for (var T = 1; T <= i; T++) {
  52779. var x = T / i;
  52780. C(x, u, p, c),
  52781. C(x, d, f, h)
  52782. }
  52783. }
  52784. break;
  52785. case "b":
  52786. if (c = E[b++] * t + r,
  52787. h = E[b++] * t,
  52788. p = E[b++] * t + r,
  52789. f = E[b++] * t,
  52790. g = E[b++] * t + r,
  52791. m = E[b++] * t,
  52792. A.bezierCurveTo(p, f, g, m, c, h),
  52793. v = y[y.length - 1]) {
  52794. u = v.x,
  52795. d = v.y;
  52796. for (var T = 1; T <= i; T++) {
  52797. var x = T / i;
  52798. I(x, u, p, g, c),
  52799. I(x, d, f, m, h)
  52800. }
  52801. }
  52802. }
  52803. }
  52804. return {
  52805. offset: o.ha * t,
  52806. path: A
  52807. }
  52808. }
  52809. }
  52810. void 0 === t && (t = 100),
  52811. void 0 === i && (i = 4);
  52812. for (var a = this.data, s = r(e), l = [], c = 0, h = s.length; c < h; c++)
  52813. Array.prototype.push.apply(l, s[c].toShapes());
  52814. return l
  52815. }
  52816. },
  52817. n.Path = function(e) {
  52818. n.CurvePath.call(this),
  52819. this.actions = [],
  52820. e && this.fromPoints(e)
  52821. }
  52822. ,
  52823. n.Path.prototype = Object.create(n.CurvePath.prototype),
  52824. n.Path.prototype.constructor = n.Path,
  52825. n.Path.prototype.fromPoints = function(e) {
  52826. this.moveTo(e[0].x, e[0].y);
  52827. for (var t = 1, i = e.length; t < i; t++)
  52828. this.lineTo(e[t].x, e[t].y)
  52829. }
  52830. ,
  52831. n.Path.prototype.moveTo = function(e, t) {
  52832. this.actions.push({
  52833. action: "moveTo",
  52834. args: [e, t]
  52835. })
  52836. }
  52837. ,
  52838. n.Path.prototype.lineTo = function(e, t) {
  52839. var i = this.actions[this.actions.length - 1].args
  52840. , r = i[i.length - 2]
  52841. , o = i[i.length - 1]
  52842. , a = new n.LineCurve(new n.Vector2(r,o),new n.Vector2(e,t));
  52843. this.curves.push(a),
  52844. this.actions.push({
  52845. action: "lineTo",
  52846. args: [e, t]
  52847. })
  52848. }
  52849. ,
  52850. n.Path.prototype.quadraticCurveTo = function(e, t, i, r) {
  52851. var o = this.actions[this.actions.length - 1].args
  52852. , a = o[o.length - 2]
  52853. , s = o[o.length - 1]
  52854. , l = new n.QuadraticBezierCurve(new n.Vector2(a,s),new n.Vector2(e,t),new n.Vector2(i,r));
  52855. this.curves.push(l),
  52856. this.actions.push({
  52857. action: "quadraticCurveTo",
  52858. args: [e, t, i, r]
  52859. })
  52860. }
  52861. ,
  52862. n.Path.prototype.bezierCurveTo = function(e, t, i, r, o, a) {
  52863. var s = this.actions[this.actions.length - 1].args
  52864. , l = s[s.length - 2]
  52865. , c = s[s.length - 1]
  52866. , h = new n.CubicBezierCurve(new n.Vector2(l,c),new n.Vector2(e,t),new n.Vector2(i,r),new n.Vector2(o,a));
  52867. this.curves.push(h),
  52868. this.actions.push({
  52869. action: "bezierCurveTo",
  52870. args: [e, t, i, r, o, a]
  52871. })
  52872. }
  52873. ,
  52874. n.Path.prototype.splineThru = function(e) {
  52875. var t = Array.prototype.slice.call(arguments)
  52876. , i = this.actions[this.actions.length - 1].args
  52877. , r = i[i.length - 2]
  52878. , o = i[i.length - 1]
  52879. , a = [new n.Vector2(r,o)];
  52880. Array.prototype.push.apply(a, e);
  52881. var s = new n.SplineCurve(a);
  52882. this.curves.push(s),
  52883. this.actions.push({
  52884. action: "splineThru",
  52885. args: t
  52886. })
  52887. }
  52888. ,
  52889. n.Path.prototype.arc = function(e, t, i, n, r, o) {
  52890. var a = this.actions[this.actions.length - 1].args
  52891. , s = a[a.length - 2]
  52892. , l = a[a.length - 1];
  52893. this.absarc(e + s, t + l, i, n, r, o)
  52894. }
  52895. ,
  52896. n.Path.prototype.absarc = function(e, t, i, n, r, o) {
  52897. this.absellipse(e, t, i, i, n, r, o)
  52898. }
  52899. ,
  52900. n.Path.prototype.ellipse = function(e, t, i, n, r, o, a, s) {
  52901. var l = this.actions[this.actions.length - 1].args
  52902. , c = l[l.length - 2]
  52903. , h = l[l.length - 1];
  52904. this.absellipse(e + c, t + h, i, n, r, o, a, s)
  52905. }
  52906. ,
  52907. n.Path.prototype.absellipse = function(e, t, i, r, o, a, s, l) {
  52908. var c = [e, t, i, r, o, a, s, l || 0]
  52909. , h = new n.EllipseCurve(e,t,i,r,o,a,s,l);
  52910. this.curves.push(h);
  52911. var u = h.getPoint(1);
  52912. c.push(u.x),
  52913. c.push(u.y),
  52914. this.actions.push({
  52915. action: "ellipse",
  52916. args: c
  52917. })
  52918. }
  52919. ,
  52920. n.Path.prototype.getSpacedPoints = function(e) {
  52921. e || (e = 40);
  52922. for (var t = [], i = 0; i < e; i++)
  52923. t.push(this.getPoint(i / e));
  52924. return this.autoClose && t.push(t[0]),
  52925. t
  52926. }
  52927. ,
  52928. n.Path.prototype.getPoints = function(e) {
  52929. e = e || 12;
  52930. 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++) {
  52931. var A = this.actions[m]
  52932. , y = A.action
  52933. , C = A.args;
  52934. switch (y) {
  52935. case "moveTo":
  52936. g.push(new n.Vector2(C[0],C[1]));
  52937. break;
  52938. case "lineTo":
  52939. g.push(new n.Vector2(C[0],C[1]));
  52940. break;
  52941. case "quadraticCurveTo":
  52942. t = C[2],
  52943. i = C[3],
  52944. a = C[0],
  52945. s = C[1],
  52946. g.length > 0 ? (h = g[g.length - 1],
  52947. l = h.x,
  52948. c = h.y) : (h = this.actions[m - 1].args,
  52949. l = h[h.length - 2],
  52950. c = h[h.length - 1]);
  52951. for (var I = 1; I <= e; I++) {
  52952. var E = I / e;
  52953. u = p(E, l, a, t),
  52954. d = p(E, c, s, i),
  52955. g.push(new n.Vector2(u,d))
  52956. }
  52957. break;
  52958. case "bezierCurveTo":
  52959. t = C[4],
  52960. i = C[5],
  52961. a = C[0],
  52962. s = C[1],
  52963. r = C[2],
  52964. o = C[3],
  52965. g.length > 0 ? (h = g[g.length - 1],
  52966. l = h.x,
  52967. c = h.y) : (h = this.actions[m - 1].args,
  52968. l = h[h.length - 2],
  52969. c = h[h.length - 1]);
  52970. for (var I = 1; I <= e; I++) {
  52971. var E = I / e;
  52972. u = f(E, l, a, r, t),
  52973. d = f(E, c, s, o, i),
  52974. g.push(new n.Vector2(u,d))
  52975. }
  52976. break;
  52977. case "splineThru":
  52978. h = this.actions[m - 1].args;
  52979. var b = new n.Vector2(h[h.length - 2],h[h.length - 1])
  52980. , w = [b]
  52981. , _ = e * C[0].length;
  52982. w = w.concat(C[0]);
  52983. for (var T = new n.SplineCurve(w), I = 1; I <= _; I++)
  52984. g.push(T.getPointAt(I / _));
  52985. break;
  52986. case "arc":
  52987. 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++) {
  52988. var E = I / N;
  52989. L || (E = 1 - E),
  52990. x = P + E * D,
  52991. u = S + R * Math.cos(x),
  52992. d = M + R * Math.sin(x),
  52993. g.push(new n.Vector2(u,d))
  52994. }
  52995. break;
  52996. case "ellipse":
  52997. var x, B, F, S = C[0], M = C[1], V = C[2], U = C[3], P = C[4], O = C[5], L = !!C[6], k = C[7], D = O - P, N = 2 * e;
  52998. 0 !== k && (B = Math.cos(k),
  52999. F = Math.sin(k));
  53000. for (var I = 1; I <= N; I++) {
  53001. var E = I / N;
  53002. if (L || (E = 1 - E),
  53003. x = P + E * D,
  53004. u = S + V * Math.cos(x),
  53005. d = M + U * Math.sin(x),
  53006. 0 !== k) {
  53007. var H = u
  53008. , G = d;
  53009. u = (H - S) * B - (G - M) * F + S,
  53010. d = (H - S) * F + (G - M) * B + M
  53011. }
  53012. g.push(new n.Vector2(u,d))
  53013. }
  53014. }
  53015. }
  53016. var z = g[g.length - 1];
  53017. 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),
  53018. this.autoClose && g.push(g[0]),
  53019. g
  53020. }
  53021. ,
  53022. n.Path.prototype.toShapes = function(e, t) {
  53023. function i(e) {
  53024. for (var t = [], i = new n.Path, r = 0, o = e.length; r < o; r++) {
  53025. var a = e[r]
  53026. , s = a.args
  53027. , l = a.action;
  53028. "moveTo" === l && 0 !== i.actions.length && (t.push(i),
  53029. i = new n.Path),
  53030. i[l].apply(i, s)
  53031. }
  53032. return 0 !== i.actions.length && t.push(i),
  53033. t
  53034. }
  53035. function r(e) {
  53036. for (var t = [], i = 0, r = e.length; i < r; i++) {
  53037. var o = e[i]
  53038. , a = new n.Shape;
  53039. a.actions = o.actions,
  53040. a.curves = o.curves,
  53041. t.push(a)
  53042. }
  53043. return t
  53044. }
  53045. function o(e, t) {
  53046. for (var i = t.length, n = !1, r = i - 1, o = 0; o < i; r = o++) {
  53047. var a = t[r]
  53048. , s = t[o]
  53049. , l = s.x - a.x
  53050. , c = s.y - a.y;
  53051. if (Math.abs(c) > Number.EPSILON) {
  53052. if (c < 0 && (a = t[o],
  53053. l = -l,
  53054. s = t[r],
  53055. c = -c),
  53056. e.y < a.y || e.y > s.y)
  53057. continue;
  53058. if (e.y === a.y) {
  53059. if (e.x === a.x)
  53060. return !0
  53061. } else {
  53062. var h = c * (e.x - a.x) - l * (e.y - a.y);
  53063. if (0 === h)
  53064. return !0;
  53065. if (h < 0)
  53066. continue;
  53067. n = !n
  53068. }
  53069. } else {
  53070. if (e.y !== a.y)
  53071. continue;
  53072. if (s.x <= e.x && e.x <= a.x || a.x <= e.x && e.x <= s.x)
  53073. return !0
  53074. }
  53075. }
  53076. return n
  53077. }
  53078. var a = n.ShapeUtils.isClockWise
  53079. , s = i(this.actions);
  53080. if (0 === s.length)
  53081. return [];
  53082. if (t === !0)
  53083. return r(s);
  53084. var l, c, h, u = [];
  53085. if (1 === s.length)
  53086. return c = s[0],
  53087. h = new n.Shape,
  53088. h.actions = c.actions,
  53089. h.curves = c.curves,
  53090. u.push(h),
  53091. u;
  53092. var d = !a(s[0].getPoints());
  53093. d = e ? !d : d;
  53094. var p, f = [], g = [], m = [], v = 0;
  53095. g[v] = void 0,
  53096. m[v] = [];
  53097. for (var A = 0, y = s.length; A < y; A++)
  53098. c = s[A],
  53099. p = c.getPoints(),
  53100. l = a(p),
  53101. l = e ? !l : l,
  53102. l ? (!d && g[v] && v++,
  53103. g[v] = {
  53104. s: new n.Shape,
  53105. p: p
  53106. },
  53107. g[v].s.actions = c.actions,
  53108. g[v].s.curves = c.curves,
  53109. d && v++,
  53110. m[v] = []) : m[v].push({
  53111. h: c,
  53112. p: p[0]
  53113. });
  53114. if (!g[0])
  53115. return r(s);
  53116. if (g.length > 1) {
  53117. for (var C = !1, I = [], E = 0, b = g.length; E < b; E++)
  53118. f[E] = [];
  53119. for (var E = 0, b = g.length; E < b; E++)
  53120. for (var w = m[E], _ = 0; _ < w.length; _++) {
  53121. for (var T = w[_], x = !0, S = 0; S < g.length; S++)
  53122. o(T.p, g[S].p) && (E !== S && I.push({
  53123. froms: E,
  53124. tos: S,
  53125. hole: _
  53126. }),
  53127. x ? (x = !1,
  53128. f[S].push(T)) : C = !0);
  53129. x && f[E].push(T)
  53130. }
  53131. I.length > 0 && (C || (m = f))
  53132. }
  53133. for (var M, A = 0, R = g.length; A < R; A++) {
  53134. h = g[A].s,
  53135. u.push(h),
  53136. M = m[A];
  53137. for (var P = 0, O = M.length; P < O; P++)
  53138. h.holes.push(M[P].h)
  53139. }
  53140. return u
  53141. }
  53142. ,
  53143. n.Shape = function() {
  53144. n.Path.apply(this, arguments),
  53145. this.holes = []
  53146. }
  53147. ,
  53148. n.Shape.prototype = Object.create(n.Path.prototype),
  53149. n.Shape.prototype.constructor = n.Shape,
  53150. n.Shape.prototype.extrude = function(e) {
  53151. return new n.ExtrudeGeometry(this,e)
  53152. }
  53153. ,
  53154. n.Shape.prototype.makeGeometry = function(e) {
  53155. return new n.ShapeGeometry(this,e)
  53156. }
  53157. ,
  53158. n.Shape.prototype.getPointsHoles = function(e) {
  53159. for (var t = [], i = 0, n = this.holes.length; i < n; i++)
  53160. t[i] = this.holes[i].getPoints(e);
  53161. return t
  53162. }
  53163. ,
  53164. n.Shape.prototype.extractAllPoints = function(e) {
  53165. return {
  53166. shape: this.getPoints(e),
  53167. holes: this.getPointsHoles(e)
  53168. }
  53169. }
  53170. ,
  53171. n.Shape.prototype.extractPoints = function(e) {
  53172. return this.extractAllPoints(e)
  53173. }
  53174. ,
  53175. n.LineCurve = function(e, t) {
  53176. this.v1 = e,
  53177. this.v2 = t
  53178. }
  53179. ,
  53180. n.LineCurve.prototype = Object.create(n.Curve.prototype),
  53181. n.LineCurve.prototype.constructor = n.LineCurve,
  53182. n.LineCurve.prototype.getPoint = function(e) {
  53183. var t = this.v2.clone().sub(this.v1);
  53184. return t.multiplyScalar(e).add(this.v1),
  53185. t
  53186. }
  53187. ,
  53188. n.LineCurve.prototype.getPointAt = function(e) {
  53189. return this.getPoint(e)
  53190. }
  53191. ,
  53192. n.LineCurve.prototype.getTangent = function(e) {
  53193. var t = this.v2.clone().sub(this.v1);
  53194. return t.normalize()
  53195. }
  53196. ,
  53197. n.QuadraticBezierCurve = function(e, t, i) {
  53198. this.v0 = e,
  53199. this.v1 = t,
  53200. this.v2 = i
  53201. }
  53202. ,
  53203. n.QuadraticBezierCurve.prototype = Object.create(n.Curve.prototype),
  53204. n.QuadraticBezierCurve.prototype.constructor = n.QuadraticBezierCurve,
  53205. n.QuadraticBezierCurve.prototype.getPoint = function(e) {
  53206. var t = n.ShapeUtils.b2;
  53207. 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))
  53208. }
  53209. ,
  53210. n.QuadraticBezierCurve.prototype.getTangent = function(e) {
  53211. var t = n.CurveUtils.tangentQuadraticBezier;
  53212. 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()
  53213. }
  53214. ,
  53215. n.CubicBezierCurve = function(e, t, i, n) {
  53216. this.v0 = e,
  53217. this.v1 = t,
  53218. this.v2 = i,
  53219. this.v3 = n
  53220. }
  53221. ,
  53222. n.CubicBezierCurve.prototype = Object.create(n.Curve.prototype),
  53223. n.CubicBezierCurve.prototype.constructor = n.CubicBezierCurve,
  53224. n.CubicBezierCurve.prototype.getPoint = function(e) {
  53225. var t = n.ShapeUtils.b3;
  53226. 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))
  53227. }
  53228. ,
  53229. n.CubicBezierCurve.prototype.getTangent = function(e) {
  53230. var t = n.CurveUtils.tangentCubicBezier;
  53231. 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()
  53232. }
  53233. ,
  53234. n.SplineCurve = function(e) {
  53235. this.points = void 0 == e ? [] : e
  53236. }
  53237. ,
  53238. n.SplineCurve.prototype = Object.create(n.Curve.prototype),
  53239. n.SplineCurve.prototype.constructor = n.SplineCurve,
  53240. n.SplineCurve.prototype.getPoint = function(e) {
  53241. var t = this.points
  53242. , i = (t.length - 1) * e
  53243. , r = Math.floor(i)
  53244. , o = i - r
  53245. , a = t[0 === r ? r : r - 1]
  53246. , s = t[r]
  53247. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53248. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53249. , h = n.CurveUtils.interpolate;
  53250. return new n.Vector2(h(a.x, s.x, l.x, c.x, o),h(a.y, s.y, l.y, c.y, o))
  53251. }
  53252. ,
  53253. n.EllipseCurve = function(e, t, i, n, r, o, a, s) {
  53254. this.aX = e,
  53255. this.aY = t,
  53256. this.xRadius = i,
  53257. this.yRadius = n,
  53258. this.aStartAngle = r,
  53259. this.aEndAngle = o,
  53260. this.aClockwise = a,
  53261. this.aRotation = s || 0
  53262. }
  53263. ,
  53264. n.EllipseCurve.prototype = Object.create(n.Curve.prototype),
  53265. n.EllipseCurve.prototype.constructor = n.EllipseCurve,
  53266. n.EllipseCurve.prototype.getPoint = function(e) {
  53267. var t = this.aEndAngle - this.aStartAngle;
  53268. t < 0 && (t += 2 * Math.PI),
  53269. t > 2 * Math.PI && (t -= 2 * Math.PI);
  53270. var i;
  53271. i = this.aClockwise === !0 ? this.aEndAngle + (1 - e) * (2 * Math.PI - t) : this.aStartAngle + e * t;
  53272. var r = this.aX + this.xRadius * Math.cos(i)
  53273. , o = this.aY + this.yRadius * Math.sin(i);
  53274. if (0 !== this.aRotation) {
  53275. var a = Math.cos(this.aRotation)
  53276. , s = Math.sin(this.aRotation)
  53277. , l = r
  53278. , c = o;
  53279. r = (l - this.aX) * a - (c - this.aY) * s + this.aX,
  53280. o = (l - this.aX) * s + (c - this.aY) * a + this.aY
  53281. }
  53282. return new n.Vector2(r,o)
  53283. }
  53284. ,
  53285. n.ArcCurve = function(e, t, i, r, o, a) {
  53286. n.EllipseCurve.call(this, e, t, i, i, r, o, a)
  53287. }
  53288. ,
  53289. n.ArcCurve.prototype = Object.create(n.EllipseCurve.prototype),
  53290. n.ArcCurve.prototype.constructor = n.ArcCurve,
  53291. n.LineCurve3 = n.Curve.create(function(e, t) {
  53292. this.v1 = e,
  53293. this.v2 = t
  53294. }, function(e) {
  53295. var t = new n.Vector3;
  53296. return t.subVectors(this.v2, this.v1),
  53297. t.multiplyScalar(e),
  53298. t.add(this.v1),
  53299. t
  53300. }),
  53301. n.QuadraticBezierCurve3 = n.Curve.create(function(e, t, i) {
  53302. this.v0 = e,
  53303. this.v1 = t,
  53304. this.v2 = i
  53305. }, function(e) {
  53306. var t = n.ShapeUtils.b2;
  53307. 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))
  53308. }),
  53309. n.CubicBezierCurve3 = n.Curve.create(function(e, t, i, n) {
  53310. this.v0 = e,
  53311. this.v1 = t,
  53312. this.v2 = i,
  53313. this.v3 = n
  53314. }, function(e) {
  53315. var t = n.ShapeUtils.b3;
  53316. 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))
  53317. }),
  53318. n.SplineCurve3 = n.Curve.create(function(e) {
  53319. console.warn("THREE.SplineCurve3 will be deprecated. Please use THREE.CatmullRomCurve3"),
  53320. this.points = void 0 == e ? [] : e
  53321. }, function(e) {
  53322. var t = this.points
  53323. , i = (t.length - 1) * e
  53324. , r = Math.floor(i)
  53325. , o = i - r
  53326. , a = t[0 == r ? r : r - 1]
  53327. , s = t[r]
  53328. , l = t[r > t.length - 2 ? t.length - 1 : r + 1]
  53329. , c = t[r > t.length - 3 ? t.length - 1 : r + 2]
  53330. , h = n.CurveUtils.interpolate;
  53331. 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))
  53332. }),
  53333. n.CatmullRomCurve3 = function() {
  53334. function e() {}
  53335. var t = new n.Vector3
  53336. , i = new e
  53337. , r = new e
  53338. , o = new e;
  53339. return e.prototype.init = function(e, t, i, n) {
  53340. this.c0 = e,
  53341. this.c1 = i,
  53342. this.c2 = -3 * e + 3 * t - 2 * i - n,
  53343. this.c3 = 2 * e - 2 * t + i + n
  53344. }
  53345. ,
  53346. e.prototype.initNonuniformCatmullRom = function(e, t, i, n, r, o, a) {
  53347. var s = (t - e) / r - (i - e) / (r + o) + (i - t) / o
  53348. , l = (i - t) / o - (n - t) / (o + a) + (n - i) / a;
  53349. s *= o,
  53350. l *= o,
  53351. this.init(t, i, s, l)
  53352. }
  53353. ,
  53354. e.prototype.initCatmullRom = function(e, t, i, n, r) {
  53355. this.init(t, i, r * (i - e), r * (n - t))
  53356. }
  53357. ,
  53358. e.prototype.calc = function(e) {
  53359. var t = e * e
  53360. , i = t * e;
  53361. return this.c0 + this.c1 * e + this.c2 * t + this.c3 * i
  53362. }
  53363. ,
  53364. n.Curve.create(function(e) {
  53365. this.points = e || [],
  53366. this.closed = !1
  53367. }, function(e) {
  53368. var a, s, l, c, h = this.points;
  53369. c = h.length,
  53370. c < 2 && console.log("duh, you need at least 2 points"),
  53371. a = (c - (this.closed ? 0 : 1)) * e,
  53372. s = Math.floor(a),
  53373. l = a - s,
  53374. this.closed ? s += s > 0 ? 0 : (Math.floor(Math.abs(s) / h.length) + 1) * h.length : 0 === l && s === c - 1 && (s = c - 2,
  53375. l = 1);
  53376. var u, d, p, f;
  53377. if (this.closed || s > 0 ? u = h[(s - 1) % c] : (t.subVectors(h[0], h[1]).add(h[0]),
  53378. u = t),
  53379. d = h[s % c],
  53380. p = h[(s + 1) % c],
  53381. this.closed || s + 2 < c ? f = h[(s + 2) % c] : (t.subVectors(h[c - 1], h[c - 2]).add(h[c - 1]),
  53382. f = t),
  53383. void 0 === this.type || "centripetal" === this.type || "chordal" === this.type) {
  53384. var g = "chordal" === this.type ? .5 : .25
  53385. , m = Math.pow(u.distanceToSquared(d), g)
  53386. , v = Math.pow(d.distanceToSquared(p), g)
  53387. , A = Math.pow(p.distanceToSquared(f), g);
  53388. v < 1e-4 && (v = 1),
  53389. m < 1e-4 && (m = v),
  53390. A < 1e-4 && (A = v),
  53391. i.initNonuniformCatmullRom(u.x, d.x, p.x, f.x, m, v, A),
  53392. r.initNonuniformCatmullRom(u.y, d.y, p.y, f.y, m, v, A),
  53393. o.initNonuniformCatmullRom(u.z, d.z, p.z, f.z, m, v, A)
  53394. } else if ("catmullrom" === this.type) {
  53395. var y = void 0 !== this.tension ? this.tension : .5;
  53396. i.initCatmullRom(u.x, d.x, p.x, f.x, y),
  53397. r.initCatmullRom(u.y, d.y, p.y, f.y, y),
  53398. o.initCatmullRom(u.z, d.z, p.z, f.z, y)
  53399. }
  53400. var C = new n.Vector3(i.calc(l),r.calc(l),o.calc(l));
  53401. return C
  53402. })
  53403. }(),
  53404. n.ClosedSplineCurve3 = function(e) {
  53405. console.warn("THREE.ClosedSplineCurve3 has been deprecated. Please use THREE.CatmullRomCurve3."),
  53406. n.CatmullRomCurve3.call(this, e),
  53407. this.type = "catmullrom",
  53408. this.closed = !0
  53409. }
  53410. ,
  53411. n.ClosedSplineCurve3.prototype = Object.create(n.CatmullRomCurve3.prototype),
  53412. n.BoxGeometry = function(e, t, i, r, o, a) {
  53413. n.Geometry.call(this),
  53414. this.type = "BoxGeometry",
  53415. this.parameters = {
  53416. width: e,
  53417. height: t,
  53418. depth: i,
  53419. widthSegments: r,
  53420. heightSegments: o,
  53421. depthSegments: a
  53422. },
  53423. this.fromBufferGeometry(new n.BoxBufferGeometry(e,t,i,r,o,a)),
  53424. this.mergeVertices()
  53425. }
  53426. ,
  53427. n.BoxGeometry.prototype = Object.create(n.Geometry.prototype),
  53428. n.BoxGeometry.prototype.constructor = n.BoxGeometry,
  53429. n.CubeGeometry = n.BoxGeometry,
  53430. n.BoxBufferGeometry = function(e, t, i, r, o, a) {
  53431. function s(e, t, i) {
  53432. var n = 0;
  53433. return n += e * t * 2,
  53434. n += e * i * 2,
  53435. n += i * t * 2,
  53436. 4 * n
  53437. }
  53438. function l(e, t, i, r, o, a, s, l, h, u, I) {
  53439. 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++)
  53440. for (var L = O * b - _, D = 0; D < x; D++) {
  53441. var N = D * E - w;
  53442. P[e] = N * r,
  53443. P[t] = L * o,
  53444. P[i] = T,
  53445. p[m] = P.x,
  53446. p[m + 1] = P.y,
  53447. p[m + 2] = P.z,
  53448. P[e] = 0,
  53449. P[t] = 0,
  53450. P[i] = l > 0 ? 1 : -1,
  53451. f[m] = P.x,
  53452. f[m + 1] = P.y,
  53453. f[m + 2] = P.z,
  53454. g[v] = D / h,
  53455. g[v + 1] = 1 - O / u,
  53456. m += 3,
  53457. v += 2,
  53458. M += 1
  53459. }
  53460. for (O = 0; O < u; O++)
  53461. for (D = 0; D < h; D++) {
  53462. var B = y + D + x * O
  53463. , F = y + D + x * (O + 1)
  53464. , V = y + (D + 1) + x * (O + 1)
  53465. , U = y + (D + 1) + x * O;
  53466. d[A] = B,
  53467. d[A + 1] = F,
  53468. d[A + 2] = U,
  53469. d[A + 3] = F,
  53470. d[A + 4] = V,
  53471. d[A + 5] = U,
  53472. A += 6,
  53473. R += 6
  53474. }
  53475. c.addGroup(C, R, I),
  53476. C += R,
  53477. y += M
  53478. }
  53479. n.BufferGeometry.call(this),
  53480. this.type = "BoxBufferGeometry",
  53481. this.parameters = {
  53482. width: e,
  53483. height: t,
  53484. depth: i,
  53485. widthSegments: r,
  53486. heightSegments: o,
  53487. depthSegments: a
  53488. };
  53489. var c = this;
  53490. r = Math.floor(r) || 1,
  53491. o = Math.floor(o) || 1,
  53492. a = Math.floor(a) || 1;
  53493. var h = s(r, o, a)
  53494. , u = h / 4 * 6
  53495. , d = new (u > 65535 ? Uint32Array : Uint16Array)(u)
  53496. , p = new Float32Array(3 * h)
  53497. , f = new Float32Array(3 * h)
  53498. , g = new Float32Array(2 * h)
  53499. , m = 0
  53500. , v = 0
  53501. , A = 0
  53502. , y = 0
  53503. , C = 0;
  53504. l("z", "y", "x", -1, -1, i, t, e, a, o, 0),
  53505. l("z", "y", "x", 1, -1, i, t, -e, a, o, 1),
  53506. l("x", "z", "y", 1, 1, e, i, t, r, a, 2),
  53507. l("x", "z", "y", 1, -1, e, i, -t, r, a, 3),
  53508. l("x", "y", "z", 1, -1, e, t, i, r, o, 4),
  53509. l("x", "y", "z", -1, -1, e, t, -i, r, o, 5),
  53510. this.setIndex(new n.BufferAttribute(d,1)),
  53511. this.addAttribute("position", new n.BufferAttribute(p,3)),
  53512. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  53513. this.addAttribute("uv", new n.BufferAttribute(g,2))
  53514. }
  53515. ,
  53516. n.BoxBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53517. n.BoxBufferGeometry.prototype.constructor = n.BoxBufferGeometry,
  53518. n.CircleGeometry = function(e, t, i, r) {
  53519. n.Geometry.call(this),
  53520. this.type = "CircleGeometry",
  53521. this.parameters = {
  53522. radius: e,
  53523. segments: t,
  53524. thetaStart: i,
  53525. thetaLength: r
  53526. },
  53527. this.fromBufferGeometry(new n.CircleBufferGeometry(e,t,i,r))
  53528. }
  53529. ,
  53530. n.CircleGeometry.prototype = Object.create(n.Geometry.prototype),
  53531. n.CircleGeometry.prototype.constructor = n.CircleGeometry,
  53532. n.CircleBufferGeometry = function(e, t, i, r) {
  53533. n.BufferGeometry.call(this),
  53534. this.type = "CircleBufferGeometry",
  53535. this.parameters = {
  53536. radius: e,
  53537. segments: t,
  53538. thetaStart: i,
  53539. thetaLength: r
  53540. },
  53541. e = e || 50,
  53542. t = void 0 !== t ? Math.max(3, t) : 8,
  53543. i = void 0 !== i ? i : 0,
  53544. r = void 0 !== r ? r : 2 * Math.PI;
  53545. var o = t + 2
  53546. , a = new Float32Array(3 * o)
  53547. , s = new Float32Array(3 * o)
  53548. , l = new Float32Array(2 * o);
  53549. s[2] = 1,
  53550. l[0] = .5,
  53551. l[1] = .5;
  53552. for (var c = 0, h = 3, u = 2; c <= t; c++,
  53553. h += 3,
  53554. u += 2) {
  53555. var d = i + c / t * r;
  53556. a[h] = e * Math.cos(d),
  53557. a[h + 1] = e * Math.sin(d),
  53558. s[h + 2] = 1,
  53559. l[u] = (a[h] / e + 1) / 2,
  53560. l[u + 1] = (a[h + 1] / e + 1) / 2
  53561. }
  53562. for (var p = [], h = 1; h <= t; h++)
  53563. p.push(h, h + 1, 0);
  53564. this.setIndex(new n.BufferAttribute(new Uint16Array(p),1)),
  53565. this.addAttribute("position", new n.BufferAttribute(a,3)),
  53566. this.addAttribute("normal", new n.BufferAttribute(s,3)),
  53567. this.addAttribute("uv", new n.BufferAttribute(l,2)),
  53568. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  53569. }
  53570. ,
  53571. n.CircleBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53572. n.CircleBufferGeometry.prototype.constructor = n.CircleBufferGeometry,
  53573. n.CylinderBufferGeometry = function(e, t, i, r, o, a, s, l) {
  53574. function c() {
  53575. var e = (r + 1) * (o + 1);
  53576. return a === !1 && (e += 2 * (r + 1) + 2 * r),
  53577. e
  53578. }
  53579. function h() {
  53580. var e = r * o * 2 * 3;
  53581. return a === !1 && (e += 2 * r * 3),
  53582. e
  53583. }
  53584. function u() {
  53585. var a, c, h = new n.Vector3, u = new n.Vector3, d = (t - e) / i;
  53586. for (c = 0; c <= o; c++) {
  53587. var p = []
  53588. , f = c / o
  53589. , b = f * (t - e) + e;
  53590. for (a = 0; a <= r; a++) {
  53591. var w = a / r;
  53592. u.x = b * Math.sin(w * l + s),
  53593. u.y = -f * i + E,
  53594. u.z = b * Math.cos(w * l + s),
  53595. m.setXYZ(y, u.x, u.y, u.z),
  53596. h.copy(u),
  53597. (0 === e && 0 === c || 0 === t && c === o) && (h.x = Math.sin(w * l + s),
  53598. h.z = Math.cos(w * l + s)),
  53599. h.setY(Math.sqrt(h.x * h.x + h.z * h.z) * d).normalize(),
  53600. v.setXYZ(y, h.x, h.y, h.z),
  53601. A.setXY(y, w, 1 - f),
  53602. p.push(y),
  53603. y++
  53604. }
  53605. I.push(p)
  53606. }
  53607. for (a = 0; a < r; a++)
  53608. for (c = 0; c < o; c++) {
  53609. var _ = I[c][a]
  53610. , T = I[c + 1][a]
  53611. , x = I[c + 1][a + 1]
  53612. , S = I[c][a + 1];
  53613. g.setX(C, _),
  53614. C++,
  53615. g.setX(C, T),
  53616. C++,
  53617. g.setX(C, S),
  53618. C++,
  53619. g.setX(C, T),
  53620. C++,
  53621. g.setX(C, x),
  53622. C++,
  53623. g.setX(C, S),
  53624. C++
  53625. }
  53626. }
  53627. function d(i) {
  53628. var o, a, c, h = new n.Vector2, u = new n.Vector3, d = i === !0 ? e : t, p = i === !0 ? 1 : -1;
  53629. for (a = y,
  53630. o = 1; o <= r; o++)
  53631. m.setXYZ(y, 0, E * p, 0),
  53632. v.setXYZ(y, 0, p, 0),
  53633. i === !0 ? (h.x = o / r,
  53634. h.y = 0) : (h.x = (o - 1) / r,
  53635. h.y = 1),
  53636. A.setXY(y, h.x, h.y),
  53637. y++;
  53638. for (c = y,
  53639. o = 0; o <= r; o++) {
  53640. var f = o / r;
  53641. u.x = d * Math.sin(f * l + s),
  53642. u.y = E * p,
  53643. u.z = d * Math.cos(f * l + s),
  53644. m.setXYZ(y, u.x, u.y, u.z),
  53645. v.setXYZ(y, 0, p, 0),
  53646. A.setXY(y, f, i === !0 ? 1 : 0),
  53647. y++
  53648. }
  53649. for (o = 0; o < r; o++) {
  53650. var I = a + o
  53651. , b = c + o;
  53652. i === !0 ? (g.setX(C, b),
  53653. C++,
  53654. g.setX(C, b + 1),
  53655. C++,
  53656. g.setX(C, I),
  53657. C++) : (g.setX(C, b + 1),
  53658. C++,
  53659. g.setX(C, b),
  53660. C++,
  53661. g.setX(C, I),
  53662. C++)
  53663. }
  53664. }
  53665. n.BufferGeometry.call(this),
  53666. this.type = "CylinderBufferGeometry",
  53667. this.parameters = {
  53668. radiusTop: e,
  53669. radiusBottom: t,
  53670. height: i,
  53671. radialSegments: r,
  53672. heightSegments: o,
  53673. openEnded: a,
  53674. thetaStart: s,
  53675. thetaLength: l
  53676. },
  53677. e = void 0 !== e ? e : 20,
  53678. t = void 0 !== t ? t : 20,
  53679. i = void 0 !== i ? i : 100,
  53680. r = Math.floor(r) || 8,
  53681. o = Math.floor(o) || 1,
  53682. a = void 0 !== a && a,
  53683. s = void 0 !== s ? s : 0,
  53684. l = void 0 !== l ? l : 2 * Math.PI;
  53685. var p = c()
  53686. , f = h()
  53687. , g = new n.BufferAttribute(new (f > 65535 ? Uint32Array : Uint16Array)(f),1)
  53688. , m = new n.BufferAttribute(new Float32Array(3 * p),3)
  53689. , v = new n.BufferAttribute(new Float32Array(3 * p),3)
  53690. , A = new n.BufferAttribute(new Float32Array(2 * p),2)
  53691. , y = 0
  53692. , C = 0
  53693. , I = []
  53694. , E = i / 2;
  53695. u(),
  53696. a === !1 && (e > 0 && d(!0),
  53697. t > 0 && d(!1)),
  53698. this.setIndex(g),
  53699. this.addAttribute("position", m),
  53700. this.addAttribute("normal", v),
  53701. this.addAttribute("uv", A)
  53702. }
  53703. ,
  53704. n.CylinderBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53705. n.CylinderBufferGeometry.prototype.constructor = n.CylinderBufferGeometry,
  53706. n.CylinderGeometry = function(e, t, i, r, o, a, s, l) {
  53707. n.Geometry.call(this),
  53708. this.type = "CylinderGeometry",
  53709. this.parameters = {
  53710. radiusTop: e,
  53711. radiusBottom: t,
  53712. height: i,
  53713. radialSegments: r,
  53714. heightSegments: o,
  53715. openEnded: a,
  53716. thetaStart: s,
  53717. thetaLength: l
  53718. },
  53719. this.fromBufferGeometry(new n.CylinderBufferGeometry(e,t,i,r,o,a,s,l)),
  53720. this.mergeVertices()
  53721. }
  53722. ,
  53723. n.CylinderGeometry.prototype = Object.create(n.Geometry.prototype),
  53724. n.CylinderGeometry.prototype.constructor = n.CylinderGeometry,
  53725. n.EdgesGeometry = function(e, t) {
  53726. function i(e, t) {
  53727. return e - t
  53728. }
  53729. n.BufferGeometry.call(this),
  53730. t = void 0 !== t ? t : 1;
  53731. var r, o = Math.cos(n.Math.degToRad(t)), a = [0, 0], s = {}, l = ["a", "b", "c"];
  53732. e instanceof n.BufferGeometry ? (r = new n.Geometry,
  53733. r.fromBufferGeometry(e)) : r = e.clone(),
  53734. r.mergeVertices(),
  53735. r.computeFaceNormals();
  53736. for (var c = r.vertices, h = r.faces, u = 0, d = h.length; u < d; u++)
  53737. for (var p = h[u], f = 0; f < 3; f++) {
  53738. a[0] = p[l[f]],
  53739. a[1] = p[l[(f + 1) % 3]],
  53740. a.sort(i);
  53741. var g = a.toString();
  53742. void 0 === s[g] ? s[g] = {
  53743. vert1: a[0],
  53744. vert2: a[1],
  53745. face1: u,
  53746. face2: void 0
  53747. } : s[g].face2 = u
  53748. }
  53749. var m = [];
  53750. for (var g in s) {
  53751. var v = s[g];
  53752. if (void 0 === v.face2 || h[v.face1].normal.dot(h[v.face2].normal) <= o) {
  53753. var A = c[v.vert1];
  53754. m.push(A.x),
  53755. m.push(A.y),
  53756. m.push(A.z),
  53757. A = c[v.vert2],
  53758. m.push(A.x),
  53759. m.push(A.y),
  53760. m.push(A.z)
  53761. }
  53762. }
  53763. this.addAttribute("position", new n.BufferAttribute(new Float32Array(m),3))
  53764. }
  53765. ,
  53766. n.EdgesGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  53767. n.EdgesGeometry.prototype.constructor = n.EdgesGeometry,
  53768. n.ExtrudeGeometry = function(e, t) {
  53769. return "undefined" == typeof e ? void (e = []) : (n.Geometry.call(this),
  53770. this.type = "ExtrudeGeometry",
  53771. e = Array.isArray(e) ? e : [e],
  53772. this.addShapeList(e, t),
  53773. void this.computeFaceNormals())
  53774. }
  53775. ;
  53776. n.ExtrudeGeometry.prototype = Object.create(n.Geometry.prototype);
  53777. n.ExtrudeGeometry.prototype.constructor = n.ExtrudeGeometry,
  53778. n.ExtrudeGeometry.prototype.addShapeList = function(e, t) {
  53779. for (var i = e.length, n = 0; n < i; n++) {
  53780. var r = e[n];
  53781. this.addShape(r, t)
  53782. }
  53783. }
  53784. ,
  53785. n.ExtrudeGeometry.prototype.addShape = function(e, t) {
  53786. function i(e, t, i) {
  53787. return t || console.error("THREE.ExtrudeGeometry: vec does not exist"),
  53788. t.clone().multiplyScalar(i).add(e)
  53789. }
  53790. function r(e, t, i) {
  53791. var r, o, a = 1, s = e.x - t.x, l = e.y - t.y, c = i.x - e.x, h = i.y - e.y, u = s * s + l * l, d = s * h - l * c;
  53792. if (Math.abs(d) > Number.EPSILON) {
  53793. var p = Math.sqrt(u)
  53794. , f = Math.sqrt(c * c + h * h)
  53795. , g = t.x - l / p
  53796. , m = t.y + s / p
  53797. , v = i.x - h / f
  53798. , A = i.y + c / f
  53799. , y = ((v - g) * h - (A - m) * c) / (s * h - l * c);
  53800. r = g + s * y - e.x,
  53801. o = m + l * y - e.y;
  53802. var C = r * r + o * o;
  53803. if (C <= 2)
  53804. return new n.Vector2(r,o);
  53805. a = Math.sqrt(C / 2)
  53806. } else {
  53807. var I = !1;
  53808. s > Number.EPSILON ? c > Number.EPSILON && (I = !0) : s < -Number.EPSILON ? c < -Number.EPSILON && (I = !0) : Math.sign(l) === Math.sign(h) && (I = !0),
  53809. I ? (r = -l,
  53810. o = s,
  53811. a = Math.sqrt(u)) : (r = s,
  53812. o = l,
  53813. a = Math.sqrt(u / 2))
  53814. }
  53815. return new n.Vector2(r / a,o / a)
  53816. }
  53817. function o() {
  53818. if (C) {
  53819. var e = 0
  53820. , t = z * e;
  53821. for (Y = 0; Y < W; Y++)
  53822. G = N[Y],
  53823. c(G[2] + t, G[1] + t, G[0] + t);
  53824. for (e = E + 2 * y,
  53825. t = z * e,
  53826. Y = 0; Y < W; Y++)
  53827. G = N[Y],
  53828. c(G[0] + t, G[1] + t, G[2] + t)
  53829. } else {
  53830. for (Y = 0; Y < W; Y++)
  53831. G = N[Y],
  53832. c(G[2], G[1], G[0]);
  53833. for (Y = 0; Y < W; Y++)
  53834. G = N[Y],
  53835. c(G[0] + z * E, G[1] + z * E, G[2] + z * E)
  53836. }
  53837. }
  53838. function a() {
  53839. var e = 0;
  53840. for (s(B, e),
  53841. e += B.length,
  53842. x = 0,
  53843. S = L.length; x < S; x++)
  53844. T = L[x],
  53845. s(T, e),
  53846. e += T.length
  53847. }
  53848. function s(e, t) {
  53849. var i, n;
  53850. for (Y = e.length; --Y >= 0; ) {
  53851. i = Y,
  53852. n = Y - 1,
  53853. n < 0 && (n = e.length - 1);
  53854. var r = 0
  53855. , o = E + 2 * y;
  53856. for (r = 0; r < o; r++) {
  53857. var a = z * r
  53858. , s = z * (r + 1)
  53859. , l = t + i + a
  53860. , c = t + n + a
  53861. , u = t + n + s
  53862. , d = t + i + s;
  53863. h(l, c, u, d, e, r, o, i, n)
  53864. }
  53865. }
  53866. }
  53867. function l(e, t, i) {
  53868. M.vertices.push(new n.Vector3(e,t,i))
  53869. }
  53870. function c(e, t, i) {
  53871. e += R,
  53872. t += R,
  53873. i += R,
  53874. M.faces.push(new n.Face3(e,t,i,null,null,0));
  53875. var r = _.generateTopUV(M, e, t, i);
  53876. M.faceVertexUvs[0].push(r)
  53877. }
  53878. function h(e, t, i, r, o, a, s, l, c) {
  53879. e += R,
  53880. t += R,
  53881. i += R,
  53882. r += R,
  53883. M.faces.push(new n.Face3(e,t,r,null,null,1)),
  53884. M.faces.push(new n.Face3(t,i,r,null,null,1));
  53885. var h = _.generateSideWallUV(M, e, t, i, r);
  53886. M.faceVertexUvs[0].push([h[0], h[1], h[3]]),
  53887. M.faceVertexUvs[0].push([h[1], h[2], h[3]])
  53888. }
  53889. var u, d, p, f, g, m = void 0 !== t.amount ? t.amount : 100, v = void 0 !== t.bevelThickness ? t.bevelThickness : 6, A = void 0 !== t.bevelSize ? t.bevelSize : v - 2, y = void 0 !== t.bevelSegments ? t.bevelSegments : 3, C = void 0 === t.bevelEnabled || t.bevelEnabled, I = void 0 !== t.curveSegments ? t.curveSegments : 12, E = void 0 !== t.steps ? t.steps : 1, b = t.extrudePath, w = !1, _ = void 0 !== t.UVGenerator ? t.UVGenerator : n.ExtrudeGeometry.WorldUVGenerator;
  53890. b && (u = b.getSpacedPoints(E),
  53891. w = !0,
  53892. C = !1,
  53893. d = void 0 !== t.frames ? t.frames : new n.TubeGeometry.FrenetFrames(b,E,!1),
  53894. p = new n.Vector3,
  53895. f = new n.Vector3,
  53896. g = new n.Vector3),
  53897. C || (y = 0,
  53898. v = 0,
  53899. A = 0);
  53900. var T, x, S, M = this, R = this.vertices.length, P = e.extractPoints(I), O = P.shape, L = P.holes, D = !n.ShapeUtils.isClockWise(O);
  53901. if (D) {
  53902. for (O = O.reverse(),
  53903. x = 0,
  53904. S = L.length; x < S; x++)
  53905. T = L[x],
  53906. n.ShapeUtils.isClockWise(T) && (L[x] = T.reverse());
  53907. D = !1
  53908. }
  53909. var N = n.ShapeUtils.triangulateShape(O, L)
  53910. , B = O;
  53911. for (x = 0,
  53912. S = L.length; x < S; x++)
  53913. T = L[x],
  53914. O = O.concat(T);
  53915. 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++,
  53916. Z++,
  53917. q++)
  53918. Z === X && (Z = 0),
  53919. q === X && (q = 0),
  53920. j[Y] = r(B[Y], B[Z], B[q]);
  53921. var K, Q = [], J = j.concat();
  53922. for (x = 0,
  53923. S = L.length; x < S; x++) {
  53924. for (T = L[x],
  53925. K = [],
  53926. Y = 0,
  53927. X = T.length,
  53928. Z = X - 1,
  53929. q = Y + 1; Y < X; Y++,
  53930. Z++,
  53931. q++)
  53932. Z === X && (Z = 0),
  53933. q === X && (q = 0),
  53934. K[Y] = r(T[Y], T[Z], T[q]);
  53935. Q.push(K),
  53936. J = J.concat(K)
  53937. }
  53938. for (F = 0; F < y; F++) {
  53939. for (U = F / y,
  53940. k = v * (1 - U),
  53941. V = A * Math.sin(U * Math.PI / 2),
  53942. Y = 0,
  53943. X = B.length; Y < X; Y++)
  53944. H = i(B[Y], j[Y], V),
  53945. l(H.x, H.y, -k);
  53946. for (x = 0,
  53947. S = L.length; x < S; x++)
  53948. for (T = L[x],
  53949. K = Q[x],
  53950. Y = 0,
  53951. X = T.length; Y < X; Y++)
  53952. H = i(T[Y], K[Y], V),
  53953. l(H.x, H.y, -k)
  53954. }
  53955. for (V = A,
  53956. Y = 0; Y < z; Y++)
  53957. H = C ? i(O[Y], J[Y], V) : O[Y],
  53958. w ? (f.copy(d.normals[0]).multiplyScalar(H.x),
  53959. p.copy(d.binormals[0]).multiplyScalar(H.y),
  53960. g.copy(u[0]).add(f).add(p),
  53961. l(g.x, g.y, g.z)) : l(H.x, H.y, 0);
  53962. var $;
  53963. for ($ = 1; $ <= E; $++)
  53964. for (Y = 0; Y < z; Y++)
  53965. H = C ? i(O[Y], J[Y], V) : O[Y],
  53966. w ? (f.copy(d.normals[$]).multiplyScalar(H.x),
  53967. p.copy(d.binormals[$]).multiplyScalar(H.y),
  53968. g.copy(u[$]).add(f).add(p),
  53969. l(g.x, g.y, g.z)) : l(H.x, H.y, m / E * $);
  53970. for (F = y - 1; F >= 0; F--) {
  53971. for (U = F / y,
  53972. k = v * (1 - U),
  53973. V = A * Math.sin(U * Math.PI / 2),
  53974. Y = 0,
  53975. X = B.length; Y < X; Y++)
  53976. H = i(B[Y], j[Y], V),
  53977. l(H.x, H.y, m + k);
  53978. for (x = 0,
  53979. S = L.length; x < S; x++)
  53980. for (T = L[x],
  53981. K = Q[x],
  53982. Y = 0,
  53983. X = T.length; Y < X; Y++)
  53984. H = i(T[Y], K[Y], V),
  53985. w ? l(H.x, H.y + u[E - 1].y, u[E - 1].x + k) : l(H.x, H.y, m + k)
  53986. }
  53987. o(),
  53988. a()
  53989. }
  53990. ,
  53991. n.ExtrudeGeometry.WorldUVGenerator = {
  53992. generateTopUV: function(e, t, i, r) {
  53993. var o = e.vertices
  53994. , a = o[t]
  53995. , s = o[i]
  53996. , l = o[r];
  53997. return [new n.Vector2(a.x,a.y), new n.Vector2(s.x,s.y), new n.Vector2(l.x,l.y)]
  53998. },
  53999. generateSideWallUV: function(e, t, i, r, o) {
  54000. var a = e.vertices
  54001. , s = a[t]
  54002. , l = a[i]
  54003. , c = a[r]
  54004. , h = a[o];
  54005. return Math.abs(s.y - l.y) < .01 ? [new n.Vector2(s.x,1 - s.z), new n.Vector2(l.x,1 - l.z), new n.Vector2(c.x,1 - c.z), new n.Vector2(h.x,1 - h.z)] : [new n.Vector2(s.y,1 - s.z), new n.Vector2(l.y,1 - l.z), new n.Vector2(c.y,1 - c.z), new n.Vector2(h.y,1 - h.z)]
  54006. }
  54007. },
  54008. n.ShapeGeometry = function(e, t) {
  54009. n.Geometry.call(this),
  54010. this.type = "ShapeGeometry",
  54011. Array.isArray(e) === !1 && (e = [e]),
  54012. this.addShapeList(e, t),
  54013. this.computeFaceNormals()
  54014. }
  54015. ,
  54016. n.ShapeGeometry.prototype = Object.create(n.Geometry.prototype),
  54017. n.ShapeGeometry.prototype.constructor = n.ShapeGeometry,
  54018. n.ShapeGeometry.prototype.addShapeList = function(e, t) {
  54019. for (var i = 0, n = e.length; i < n; i++)
  54020. this.addShape(e[i], t);
  54021. return this
  54022. }
  54023. ,
  54024. n.ShapeGeometry.prototype.addShape = function(e, t) {
  54025. void 0 === t && (t = {});
  54026. var i, r, o, a = void 0 !== t.curveSegments ? t.curveSegments : 12, s = t.material, l = void 0 === t.UVGenerator ? n.ExtrudeGeometry.WorldUVGenerator : t.UVGenerator, c = this.vertices.length, h = e.extractPoints(a), u = h.shape, d = h.holes, p = !n.ShapeUtils.isClockWise(u);
  54027. if (p) {
  54028. for (u = u.reverse(),
  54029. i = 0,
  54030. r = d.length; i < r; i++)
  54031. o = d[i],
  54032. n.ShapeUtils.isClockWise(o) && (d[i] = o.reverse());
  54033. p = !1
  54034. }
  54035. var f = n.ShapeUtils.triangulateShape(u, d);
  54036. for (i = 0,
  54037. r = d.length; i < r; i++)
  54038. o = d[i],
  54039. u = u.concat(o);
  54040. var g, m, v = u.length, A = f.length;
  54041. for (i = 0; i < v; i++)
  54042. g = u[i],
  54043. this.vertices.push(new n.Vector3(g.x,g.y,0));
  54044. for (i = 0; i < A; i++) {
  54045. m = f[i];
  54046. var y = m[0] + c
  54047. , C = m[1] + c
  54048. , I = m[2] + c;
  54049. this.faces.push(new n.Face3(y,C,I,null,null,s)),
  54050. this.faceVertexUvs[0].push(l.generateTopUV(this, y, C, I))
  54051. }
  54052. }
  54053. ,
  54054. n.LatheBufferGeometry = function(e, t, i, r) {
  54055. n.BufferGeometry.call(this),
  54056. this.type = "LatheBufferGeometry",
  54057. this.parameters = {
  54058. points: e,
  54059. segments: t,
  54060. phiStart: i,
  54061. phiLength: r
  54062. },
  54063. t = Math.floor(t) || 12,
  54064. i = i || 0,
  54065. r = r || 2 * Math.PI,
  54066. r = n.Math.clamp(r, 0, 2 * Math.PI);
  54067. var o, a, s, l = (t + 1) * e.length, c = t * e.length * 2 * 3, h = new n.BufferAttribute(new (c > 65535 ? Uint32Array : Uint16Array)(c),1), u = new n.BufferAttribute(new Float32Array(3 * l),3), d = new n.BufferAttribute(new Float32Array(2 * l),2), p = 0, f = 0, g = (1 / (e.length - 1),
  54068. 1 / t), m = new n.Vector3, v = new n.Vector2;
  54069. for (a = 0; a <= t; a++) {
  54070. var A = i + a * g * r
  54071. , y = Math.sin(A)
  54072. , C = Math.cos(A);
  54073. for (s = 0; s <= e.length - 1; s++)
  54074. m.x = e[s].x * y,
  54075. m.y = e[s].y,
  54076. m.z = e[s].x * C,
  54077. u.setXYZ(p, m.x, m.y, m.z),
  54078. v.x = a / t,
  54079. v.y = s / (e.length - 1),
  54080. d.setXY(p, v.x, v.y),
  54081. p++
  54082. }
  54083. for (a = 0; a < t; a++)
  54084. for (s = 0; s < e.length - 1; s++) {
  54085. o = s + a * e.length;
  54086. var I = o
  54087. , E = o + e.length
  54088. , b = o + e.length + 1
  54089. , w = o + 1;
  54090. h.setX(f, I),
  54091. f++,
  54092. h.setX(f, E),
  54093. f++,
  54094. h.setX(f, w),
  54095. f++,
  54096. h.setX(f, E),
  54097. f++,
  54098. h.setX(f, b),
  54099. f++,
  54100. h.setX(f, w),
  54101. f++
  54102. }
  54103. if (this.setIndex(h),
  54104. this.addAttribute("position", u),
  54105. this.addAttribute("uv", d),
  54106. this.computeVertexNormals(),
  54107. r === 2 * Math.PI) {
  54108. var _ = this.attributes.normal.array
  54109. , T = new n.Vector3
  54110. , x = new n.Vector3
  54111. , S = new n.Vector3;
  54112. for (o = t * e.length * 3,
  54113. a = 0,
  54114. s = 0; a < e.length; a++,
  54115. s += 3)
  54116. T.x = _[s + 0],
  54117. T.y = _[s + 1],
  54118. T.z = _[s + 2],
  54119. x.x = _[o + s + 0],
  54120. x.y = _[o + s + 1],
  54121. x.z = _[o + s + 2],
  54122. S.addVectors(T, x).normalize(),
  54123. _[s + 0] = _[o + s + 0] = S.x,
  54124. _[s + 1] = _[o + s + 1] = S.y,
  54125. _[s + 2] = _[o + s + 2] = S.z
  54126. }
  54127. }
  54128. ,
  54129. n.LatheBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54130. n.LatheBufferGeometry.prototype.constructor = n.LatheBufferGeometry,
  54131. n.LatheGeometry = function(e, t, i, r) {
  54132. n.Geometry.call(this),
  54133. this.type = "LatheGeometry",
  54134. this.parameters = {
  54135. points: e,
  54136. segments: t,
  54137. phiStart: i,
  54138. phiLength: r
  54139. },
  54140. this.fromBufferGeometry(new n.LatheBufferGeometry(e,t,i,r)),
  54141. this.mergeVertices()
  54142. }
  54143. ,
  54144. n.LatheGeometry.prototype = Object.create(n.Geometry.prototype),
  54145. n.LatheGeometry.prototype.constructor = n.LatheGeometry,
  54146. n.PlaneGeometry = function(e, t, i, r) {
  54147. n.Geometry.call(this),
  54148. this.type = "PlaneGeometry",
  54149. this.parameters = {
  54150. width: e,
  54151. height: t,
  54152. widthSegments: i,
  54153. heightSegments: r
  54154. },
  54155. this.fromBufferGeometry(new n.PlaneBufferGeometry(e,t,i,r))
  54156. }
  54157. ,
  54158. n.PlaneGeometry.prototype = Object.create(n.Geometry.prototype),
  54159. n.PlaneGeometry.prototype.constructor = n.PlaneGeometry,
  54160. n.PlaneBufferGeometry = function(e, t, i, r) {
  54161. n.BufferGeometry.call(this),
  54162. this.type = "PlaneBufferGeometry",
  54163. this.parameters = {
  54164. width: e,
  54165. height: t,
  54166. widthSegments: i,
  54167. heightSegments: r
  54168. };
  54169. for (var o = e / 2, a = t / 2, s = Math.floor(i) || 1, l = Math.floor(r) || 1, c = s + 1, h = l + 1, u = e / s, d = t / l, p = new Float32Array(c * h * 3), f = new Float32Array(c * h * 3), g = new Float32Array(c * h * 2), m = 0, v = 0, A = 0; A < h; A++)
  54170. for (var y = A * d - a, C = 0; C < c; C++) {
  54171. var I = C * u - o;
  54172. p[m] = I,
  54173. p[m + 1] = -y,
  54174. f[m + 2] = 1,
  54175. g[v] = C / s,
  54176. g[v + 1] = 1 - A / l,
  54177. m += 3,
  54178. v += 2
  54179. }
  54180. m = 0;
  54181. for (var E = new (p.length / 3 > 65535 ? Uint32Array : Uint16Array)(s * l * 6), A = 0; A < l; A++)
  54182. for (var C = 0; C < s; C++) {
  54183. var b = C + c * A
  54184. , w = C + c * (A + 1)
  54185. , _ = C + 1 + c * (A + 1)
  54186. , T = C + 1 + c * A;
  54187. E[m] = b,
  54188. E[m + 1] = w,
  54189. E[m + 2] = T,
  54190. E[m + 3] = w,
  54191. E[m + 4] = _,
  54192. E[m + 5] = T,
  54193. m += 6
  54194. }
  54195. this.setIndex(new n.BufferAttribute(E,1)),
  54196. this.addAttribute("position", new n.BufferAttribute(p,3)),
  54197. this.addAttribute("normal", new n.BufferAttribute(f,3)),
  54198. this.addAttribute("uv", new n.BufferAttribute(g,2))
  54199. }
  54200. ,
  54201. n.PlaneBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54202. n.PlaneBufferGeometry.prototype.constructor = n.PlaneBufferGeometry,
  54203. n.RingBufferGeometry = function(e, t, i, r, o, a) {
  54204. n.BufferGeometry.call(this),
  54205. this.type = "RingBufferGeometry",
  54206. this.parameters = {
  54207. innerRadius: e,
  54208. outerRadius: t,
  54209. thetaSegments: i,
  54210. phiSegments: r,
  54211. thetaStart: o,
  54212. thetaLength: a
  54213. },
  54214. e = e || 20,
  54215. t = t || 50,
  54216. o = void 0 !== o ? o : 0,
  54217. a = void 0 !== a ? a : 2 * Math.PI,
  54218. i = void 0 !== i ? Math.max(3, i) : 8,
  54219. r = void 0 !== r ? Math.max(1, r) : 1;
  54220. var s, l, c, h = (i + 1) * (r + 1), u = i * r * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = e, y = (t - e) / r, C = new n.Vector3, I = new n.Vector2;
  54221. for (l = 0; l <= r; l++) {
  54222. for (c = 0; c <= i; c++)
  54223. s = o + c / i * a,
  54224. C.x = A * Math.cos(s),
  54225. C.y = A * Math.sin(s),
  54226. p.setXYZ(m, C.x, C.y, C.z),
  54227. f.setXYZ(m, 0, 0, 1),
  54228. I.x = (C.x / t + 1) / 2,
  54229. I.y = (C.y / t + 1) / 2,
  54230. g.setXY(m, I.x, I.y),
  54231. m++;
  54232. A += y
  54233. }
  54234. for (l = 0; l < r; l++) {
  54235. var E = l * (i + 1);
  54236. for (c = 0; c < i; c++) {
  54237. s = c + E;
  54238. var b = s
  54239. , w = s + i + 1
  54240. , _ = s + i + 2
  54241. , T = s + 1;
  54242. d.setX(v, b),
  54243. v++,
  54244. d.setX(v, w),
  54245. v++,
  54246. d.setX(v, _),
  54247. v++,
  54248. d.setX(v, b),
  54249. v++,
  54250. d.setX(v, _),
  54251. v++,
  54252. d.setX(v, T),
  54253. v++
  54254. }
  54255. }
  54256. this.setIndex(d),
  54257. this.addAttribute("position", p),
  54258. this.addAttribute("normal", f),
  54259. this.addAttribute("uv", g)
  54260. }
  54261. ,
  54262. n.RingBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54263. n.RingBufferGeometry.prototype.constructor = n.RingBufferGeometry,
  54264. n.RingGeometry = function(e, t, i, r, o, a) {
  54265. n.Geometry.call(this),
  54266. this.type = "RingGeometry",
  54267. this.parameters = {
  54268. innerRadius: e,
  54269. outerRadius: t,
  54270. thetaSegments: i,
  54271. phiSegments: r,
  54272. thetaStart: o,
  54273. thetaLength: a
  54274. },
  54275. this.fromBufferGeometry(new n.RingBufferGeometry(e,t,i,r,o,a))
  54276. }
  54277. ,
  54278. n.RingGeometry.prototype = Object.create(n.Geometry.prototype),
  54279. n.RingGeometry.prototype.constructor = n.RingGeometry,
  54280. n.SphereGeometry = function(e, t, i, r, o, a, s) {
  54281. n.Geometry.call(this),
  54282. this.type = "SphereGeometry",
  54283. this.parameters = {
  54284. radius: e,
  54285. widthSegments: t,
  54286. heightSegments: i,
  54287. phiStart: r,
  54288. phiLength: o,
  54289. thetaStart: a,
  54290. thetaLength: s
  54291. },
  54292. this.fromBufferGeometry(new n.SphereBufferGeometry(e,t,i,r,o,a,s))
  54293. }
  54294. ,
  54295. n.SphereGeometry.prototype = Object.create(n.Geometry.prototype),
  54296. n.SphereGeometry.prototype.constructor = n.SphereGeometry,
  54297. n.SphereBufferGeometry = function(e, t, i, r, o, a, s) {
  54298. n.BufferGeometry.call(this),
  54299. this.type = "SphereBufferGeometry",
  54300. this.parameters = {
  54301. radius: e,
  54302. widthSegments: t,
  54303. heightSegments: i,
  54304. phiStart: r,
  54305. phiLength: o,
  54306. thetaStart: a,
  54307. thetaLength: s
  54308. },
  54309. e = e || 50,
  54310. t = Math.max(3, Math.floor(t) || 8),
  54311. i = Math.max(2, Math.floor(i) || 6),
  54312. r = void 0 !== r ? r : 0,
  54313. o = void 0 !== o ? o : 2 * Math.PI,
  54314. a = void 0 !== a ? a : 0,
  54315. s = void 0 !== s ? s : Math.PI;
  54316. for (var l = a + s, c = (t + 1) * (i + 1), h = new n.BufferAttribute(new Float32Array(3 * c),3), u = new n.BufferAttribute(new Float32Array(3 * c),3), d = new n.BufferAttribute(new Float32Array(2 * c),2), p = 0, f = [], g = new n.Vector3, m = 0; m <= i; m++) {
  54317. for (var v = [], A = m / i, y = 0; y <= t; y++) {
  54318. var C = y / t
  54319. , I = -e * Math.cos(r + C * o) * Math.sin(a + A * s)
  54320. , E = e * Math.cos(a + A * s)
  54321. , b = e * Math.sin(r + C * o) * Math.sin(a + A * s);
  54322. g.set(I, E, b).normalize(),
  54323. h.setXYZ(p, I, E, b),
  54324. u.setXYZ(p, g.x, g.y, g.z),
  54325. d.setXY(p, C, 1 - A),
  54326. v.push(p),
  54327. p++
  54328. }
  54329. f.push(v)
  54330. }
  54331. for (var w = [], m = 0; m < i; m++)
  54332. for (var y = 0; y < t; y++) {
  54333. var _ = f[m][y + 1]
  54334. , T = f[m][y]
  54335. , x = f[m + 1][y]
  54336. , S = f[m + 1][y + 1];
  54337. (0 !== m || a > 0) && w.push(_, T, S),
  54338. (m !== i - 1 || l < Math.PI) && w.push(T, x, S)
  54339. }
  54340. this.setIndex(new (h.count > 65535 ? n.Uint32Attribute : n.Uint16Attribute)(w,1)),
  54341. this.addAttribute("position", h),
  54342. this.addAttribute("normal", u),
  54343. this.addAttribute("uv", d),
  54344. this.boundingSphere = new n.Sphere(new n.Vector3,e)
  54345. }
  54346. ,
  54347. n.SphereBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54348. n.SphereBufferGeometry.prototype.constructor = n.SphereBufferGeometry,
  54349. n.TextGeometry = function(e, t) {
  54350. t = t || {};
  54351. var i = t.font;
  54352. if (i instanceof n.Font == !1)
  54353. return console.error("THREE.TextGeometry: font parameter is not an instance of THREE.Font."),
  54354. new n.Geometry;
  54355. var r = i.generateShapes(e, t.size, t.curveSegments);
  54356. t.amount = void 0 !== t.height ? t.height : 50,
  54357. void 0 === t.bevelThickness && (t.bevelThickness = 10),
  54358. void 0 === t.bevelSize && (t.bevelSize = 8),
  54359. void 0 === t.bevelEnabled && (t.bevelEnabled = !1),
  54360. n.ExtrudeGeometry.call(this, r, t),
  54361. this.type = "TextGeometry"
  54362. }
  54363. ,
  54364. n.TextGeometry.prototype = Object.create(n.ExtrudeGeometry.prototype),
  54365. n.TextGeometry.prototype.constructor = n.TextGeometry,
  54366. n.TorusBufferGeometry = function(e, t, i, r, o) {
  54367. n.BufferGeometry.call(this),
  54368. this.type = "TorusBufferGeometry",
  54369. this.parameters = {
  54370. radius: e,
  54371. tube: t,
  54372. radialSegments: i,
  54373. tubularSegments: r,
  54374. arc: o
  54375. },
  54376. e = e || 100,
  54377. t = t || 40,
  54378. i = Math.floor(i) || 8,
  54379. r = Math.floor(r) || 6,
  54380. o = o || 2 * Math.PI;
  54381. var a, s, l = (i + 1) * (r + 1), c = i * r * 2 * 3, h = new (c > 65535 ? Uint32Array : Uint16Array)(c), u = new Float32Array(3 * l), d = new Float32Array(3 * l), p = new Float32Array(2 * l), f = 0, g = 0, m = 0, v = new n.Vector3, A = new n.Vector3, y = new n.Vector3;
  54382. for (a = 0; a <= i; a++)
  54383. for (s = 0; s <= r; s++) {
  54384. var C = s / r * o
  54385. , I = a / i * Math.PI * 2;
  54386. A.x = (e + t * Math.cos(I)) * Math.cos(C),
  54387. A.y = (e + t * Math.cos(I)) * Math.sin(C),
  54388. A.z = t * Math.sin(I),
  54389. u[f] = A.x,
  54390. u[f + 1] = A.y,
  54391. u[f + 2] = A.z,
  54392. v.x = e * Math.cos(C),
  54393. v.y = e * Math.sin(C),
  54394. y.subVectors(A, v).normalize(),
  54395. d[f] = y.x,
  54396. d[f + 1] = y.y,
  54397. d[f + 2] = y.z,
  54398. p[g] = s / r,
  54399. p[g + 1] = a / i,
  54400. f += 3,
  54401. g += 2
  54402. }
  54403. for (a = 1; a <= i; a++)
  54404. for (s = 1; s <= r; s++) {
  54405. var E = (r + 1) * a + s - 1
  54406. , b = (r + 1) * (a - 1) + s - 1
  54407. , w = (r + 1) * (a - 1) + s
  54408. , _ = (r + 1) * a + s;
  54409. h[m] = E,
  54410. h[m + 1] = b,
  54411. h[m + 2] = _,
  54412. h[m + 3] = b,
  54413. h[m + 4] = w,
  54414. h[m + 5] = _,
  54415. m += 6
  54416. }
  54417. this.setIndex(new n.BufferAttribute(h,1)),
  54418. this.addAttribute("position", new n.BufferAttribute(u,3)),
  54419. this.addAttribute("normal", new n.BufferAttribute(d,3)),
  54420. this.addAttribute("uv", new n.BufferAttribute(p,2))
  54421. }
  54422. ,
  54423. n.TorusBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54424. n.TorusBufferGeometry.prototype.constructor = n.TorusBufferGeometry,
  54425. n.TorusGeometry = function(e, t, i, r, o) {
  54426. n.Geometry.call(this),
  54427. this.type = "TorusGeometry",
  54428. this.parameters = {
  54429. radius: e,
  54430. tube: t,
  54431. radialSegments: i,
  54432. tubularSegments: r,
  54433. arc: o
  54434. },
  54435. this.fromBufferGeometry(new n.TorusBufferGeometry(e,t,i,r,o))
  54436. }
  54437. ,
  54438. n.TorusGeometry.prototype = Object.create(n.Geometry.prototype),
  54439. n.TorusGeometry.prototype.constructor = n.TorusGeometry,
  54440. n.TorusKnotBufferGeometry = function(e, t, i, r, o, a) {
  54441. function s(e, t, i, n, r) {
  54442. var o = Math.cos(e)
  54443. , a = Math.sin(e)
  54444. , s = i / t * e
  54445. , l = Math.cos(s);
  54446. r.x = n * (2 + l) * .5 * o,
  54447. r.y = n * (2 + l) * a * .5,
  54448. r.z = n * Math.sin(s) * .5
  54449. }
  54450. n.BufferGeometry.call(this),
  54451. this.type = "TorusKnotBufferGeometry",
  54452. this.parameters = {
  54453. radius: e,
  54454. tube: t,
  54455. tubularSegments: i,
  54456. radialSegments: r,
  54457. p: o,
  54458. q: a
  54459. },
  54460. e = e || 100,
  54461. t = t || 40,
  54462. i = Math.floor(i) || 64,
  54463. r = Math.floor(r) || 8,
  54464. o = o || 2,
  54465. a = a || 3;
  54466. var l, c, h = (r + 1) * (i + 1), u = r * i * 2 * 3, d = new n.BufferAttribute(new (u > 65535 ? Uint32Array : Uint16Array)(u),1), p = new n.BufferAttribute(new Float32Array(3 * h),3), f = new n.BufferAttribute(new Float32Array(3 * h),3), g = new n.BufferAttribute(new Float32Array(2 * h),2), m = 0, v = 0, A = new n.Vector3, y = new n.Vector3, C = new n.Vector2, I = new n.Vector3, E = new n.Vector3, b = new n.Vector3, w = new n.Vector3, _ = new n.Vector3;
  54467. for (l = 0; l <= i; ++l) {
  54468. var T = l / i * o * Math.PI * 2;
  54469. for (s(T, o, a, e, I),
  54470. s(T + .01, o, a, e, E),
  54471. w.subVectors(E, I),
  54472. _.addVectors(E, I),
  54473. b.crossVectors(w, _),
  54474. _.crossVectors(b, w),
  54475. b.normalize(),
  54476. _.normalize(),
  54477. c = 0; c <= r; ++c) {
  54478. var x = c / r * Math.PI * 2
  54479. , S = -t * Math.cos(x)
  54480. , M = t * Math.sin(x);
  54481. A.x = I.x + (S * _.x + M * b.x),
  54482. A.y = I.y + (S * _.y + M * b.y),
  54483. A.z = I.z + (S * _.z + M * b.z),
  54484. p.setXYZ(m, A.x, A.y, A.z),
  54485. y.subVectors(A, I).normalize(),
  54486. f.setXYZ(m, y.x, y.y, y.z),
  54487. C.x = l / i,
  54488. C.y = c / r,
  54489. g.setXY(m, C.x, C.y),
  54490. m++
  54491. }
  54492. }
  54493. for (c = 1; c <= i; c++)
  54494. for (l = 1; l <= r; l++) {
  54495. var R = (r + 1) * (c - 1) + (l - 1)
  54496. , P = (r + 1) * c + (l - 1)
  54497. , O = (r + 1) * c + l
  54498. , L = (r + 1) * (c - 1) + l;
  54499. d.setX(v, R),
  54500. v++,
  54501. d.setX(v, P),
  54502. v++,
  54503. d.setX(v, L),
  54504. v++,
  54505. d.setX(v, P),
  54506. v++,
  54507. d.setX(v, O),
  54508. v++,
  54509. d.setX(v, L),
  54510. v++
  54511. }
  54512. this.setIndex(d),
  54513. this.addAttribute("position", p),
  54514. this.addAttribute("normal", f),
  54515. this.addAttribute("uv", g)
  54516. }
  54517. ,
  54518. n.TorusKnotBufferGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54519. n.TorusKnotBufferGeometry.prototype.constructor = n.TorusKnotBufferGeometry,
  54520. n.TorusKnotGeometry = function(e, t, i, r, o, a, s) {
  54521. n.Geometry.call(this),
  54522. this.type = "TorusKnotGeometry",
  54523. this.parameters = {
  54524. radius: e,
  54525. tube: t,
  54526. tubularSegments: i,
  54527. radialSegments: r,
  54528. p: o,
  54529. q: a
  54530. },
  54531. void 0 !== s && console.warn("THREE.TorusKnotGeometry: heightScale has been deprecated. Use .scale( x, y, z ) instead."),
  54532. this.fromBufferGeometry(new n.TorusKnotBufferGeometry(e,t,i,r,o,a)),
  54533. this.mergeVertices()
  54534. }
  54535. ,
  54536. n.TorusKnotGeometry.prototype = Object.create(n.Geometry.prototype),
  54537. n.TorusKnotGeometry.prototype.constructor = n.TorusKnotGeometry,
  54538. n.TubeGeometry = function(e, t, i, r, o, a) {
  54539. function s(e, t, i) {
  54540. return R.vertices.push(new n.Vector3(e,t,i)) - 1
  54541. }
  54542. n.Geometry.call(this),
  54543. this.type = "TubeGeometry",
  54544. this.parameters = {
  54545. path: e,
  54546. segments: t,
  54547. radius: i,
  54548. radialSegments: r,
  54549. closed: o,
  54550. taper: a
  54551. },
  54552. t = t || 64,
  54553. i = i || 1,
  54554. r = r || 8,
  54555. o = o || !1,
  54556. a = a || n.TubeGeometry.NoTaper;
  54557. var l, c, h, u, d, p, f, g, m, v, A, y, C, I, E, b, w, _, T, x, S, M = [], R = this, P = t + 1, O = new n.Vector3, L = new n.TubeGeometry.FrenetFrames(e,t,o), D = L.tangents, N = L.normals, B = L.binormals;
  54558. for (this.tangents = D,
  54559. this.normals = N,
  54560. this.binormals = B,
  54561. v = 0; v < P; v++)
  54562. for (M[v] = [],
  54563. u = v / (P - 1),
  54564. m = e.getPointAt(u),
  54565. l = D[v],
  54566. c = N[v],
  54567. h = B[v],
  54568. p = i * a(u),
  54569. A = 0; A < r; A++)
  54570. d = A / r * 2 * Math.PI,
  54571. f = -p * Math.cos(d),
  54572. g = p * Math.sin(d),
  54573. O.copy(m),
  54574. O.x += f * c.x + g * h.x,
  54575. O.y += f * c.y + g * h.y,
  54576. O.z += f * c.z + g * h.z,
  54577. M[v][A] = s(O.x, O.y, O.z);
  54578. for (v = 0; v < t; v++)
  54579. for (A = 0; A < r; A++)
  54580. y = o ? (v + 1) % t : v + 1,
  54581. C = (A + 1) % r,
  54582. I = M[v][A],
  54583. E = M[y][A],
  54584. b = M[y][C],
  54585. w = M[v][C],
  54586. _ = new n.Vector2(v / t,A / r),
  54587. T = new n.Vector2((v + 1) / t,A / r),
  54588. x = new n.Vector2((v + 1) / t,(A + 1) / r),
  54589. S = new n.Vector2(v / t,(A + 1) / r),
  54590. this.faces.push(new n.Face3(I,E,w)),
  54591. this.faceVertexUvs[0].push([_, T, S]),
  54592. this.faces.push(new n.Face3(E,b,w)),
  54593. this.faceVertexUvs[0].push([T.clone(), x, S.clone()]);
  54594. this.computeFaceNormals(),
  54595. this.computeVertexNormals()
  54596. }
  54597. ,
  54598. n.TubeGeometry.prototype = Object.create(n.Geometry.prototype),
  54599. n.TubeGeometry.prototype.constructor = n.TubeGeometry,
  54600. n.TubeGeometry.NoTaper = function(e) {
  54601. return 1
  54602. }
  54603. ,
  54604. n.TubeGeometry.SinusoidalTaper = function(e) {
  54605. return Math.sin(Math.PI * e)
  54606. }
  54607. ,
  54608. n.TubeGeometry.FrenetFrames = function(e, t, i) {
  54609. function r() {
  54610. f[0] = new n.Vector3,
  54611. g[0] = new n.Vector3,
  54612. a = Number.MAX_VALUE,
  54613. s = Math.abs(p[0].x),
  54614. l = Math.abs(p[0].y),
  54615. c = Math.abs(p[0].z),
  54616. s <= a && (a = s,
  54617. d.set(1, 0, 0)),
  54618. l <= a && (a = l,
  54619. d.set(0, 1, 0)),
  54620. c <= a && d.set(0, 0, 1),
  54621. m.crossVectors(p[0], d).normalize(),
  54622. f[0].crossVectors(p[0], m),
  54623. g[0].crossVectors(p[0], f[0])
  54624. }
  54625. var o, a, s, l, c, h, u, d = new n.Vector3, p = [], f = [], g = [], m = new n.Vector3, v = new n.Matrix4, A = t + 1;
  54626. for (this.tangents = p,
  54627. this.normals = f,
  54628. this.binormals = g,
  54629. h = 0; h < A; h++)
  54630. u = h / (A - 1),
  54631. p[h] = e.getTangentAt(u),
  54632. p[h].normalize();
  54633. for (r(),
  54634. h = 1; h < A; h++)
  54635. f[h] = f[h - 1].clone(),
  54636. g[h] = g[h - 1].clone(),
  54637. m.crossVectors(p[h - 1], p[h]),
  54638. m.length() > Number.EPSILON && (m.normalize(),
  54639. o = Math.acos(n.Math.clamp(p[h - 1].dot(p[h]), -1, 1)),
  54640. f[h].applyMatrix4(v.makeRotationAxis(m, o))),
  54641. g[h].crossVectors(p[h], f[h]);
  54642. if (i)
  54643. for (o = Math.acos(n.Math.clamp(f[0].dot(f[A - 1]), -1, 1)),
  54644. o /= A - 1,
  54645. p[0].dot(m.crossVectors(f[0], f[A - 1])) > 0 && (o = -o),
  54646. h = 1; h < A; h++)
  54647. f[h].applyMatrix4(v.makeRotationAxis(p[h], o * h)),
  54648. g[h].crossVectors(p[h], f[h])
  54649. }
  54650. ,
  54651. n.PolyhedronGeometry = function(e, t, i, r) {
  54652. function o(e) {
  54653. var t = e.normalize().clone();
  54654. t.index = u.vertices.push(t) - 1;
  54655. var i = l(e) / 2 / Math.PI + .5
  54656. , r = c(e) / Math.PI + .5;
  54657. return t.uv = new n.Vector2(i,1 - r),
  54658. t
  54659. }
  54660. function a(e, t, i, r) {
  54661. var o = new n.Face3(e.index,t.index,i.index,[e.clone(), t.clone(), i.clone()],void 0,r);
  54662. u.faces.push(o),
  54663. C.copy(e).add(t).add(i).divideScalar(3);
  54664. var a = l(C);
  54665. u.faceVertexUvs[0].push([h(e.uv, e, a), h(t.uv, t, a), h(i.uv, i, a)])
  54666. }
  54667. function s(e, t) {
  54668. 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++) {
  54669. l[h] = [];
  54670. 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++)
  54671. 0 === g && h === i ? l[h][g] = d : l[h][g] = o(d.clone().lerp(p, g / f))
  54672. }
  54673. for (var h = 0; h < i; h++)
  54674. for (var g = 0; g < 2 * (i - h) - 1; g++) {
  54675. var m = Math.floor(g / 2);
  54676. 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)
  54677. }
  54678. }
  54679. function l(e) {
  54680. return Math.atan2(e.z, -e.x)
  54681. }
  54682. function c(e) {
  54683. return Math.atan2(-e.y, Math.sqrt(e.x * e.x + e.z * e.z))
  54684. }
  54685. function h(e, t, i) {
  54686. return i < 0 && 1 === e.x && (e = new n.Vector2(e.x - 1,e.y)),
  54687. 0 === t.x && 0 === t.z && (e = new n.Vector2(i / 2 / Math.PI + .5,e.y)),
  54688. e.clone()
  54689. }
  54690. n.Geometry.call(this),
  54691. this.type = "PolyhedronGeometry",
  54692. this.parameters = {
  54693. vertices: e,
  54694. indices: t,
  54695. radius: i,
  54696. detail: r
  54697. },
  54698. i = i || 1,
  54699. r = r || 0;
  54700. for (var u = this, d = 0, p = e.length; d < p; d += 3)
  54701. o(new n.Vector3(e[d],e[d + 1],e[d + 2]));
  54702. for (var f = this.vertices, g = [], d = 0, m = 0, p = t.length; d < p; d += 3,
  54703. m++) {
  54704. var v = f[t[d]]
  54705. , A = f[t[d + 1]]
  54706. , y = f[t[d + 2]];
  54707. g[m] = new n.Face3(v.index,A.index,y.index,[v.clone(), A.clone(), y.clone()],void 0,m)
  54708. }
  54709. for (var C = new n.Vector3, d = 0, p = g.length; d < p; d++)
  54710. s(g[d], r);
  54711. for (var d = 0, p = this.faceVertexUvs[0].length; d < p; d++) {
  54712. var I = this.faceVertexUvs[0][d]
  54713. , E = I[0].x
  54714. , b = I[1].x
  54715. , w = I[2].x
  54716. , _ = Math.max(E, b, w)
  54717. , T = Math.min(E, b, w);
  54718. _ > .9 && T < .1 && (E < .2 && (I[0].x += 1),
  54719. b < .2 && (I[1].x += 1),
  54720. w < .2 && (I[2].x += 1))
  54721. }
  54722. for (var d = 0, p = this.vertices.length; d < p; d++)
  54723. this.vertices[d].multiplyScalar(i);
  54724. this.mergeVertices(),
  54725. this.computeFaceNormals(),
  54726. this.boundingSphere = new n.Sphere(new n.Vector3,i)
  54727. }
  54728. ,
  54729. n.PolyhedronGeometry.prototype = Object.create(n.Geometry.prototype),
  54730. n.PolyhedronGeometry.prototype.constructor = n.PolyhedronGeometry,
  54731. n.DodecahedronGeometry = function(e, t) {
  54732. var i = (1 + Math.sqrt(5)) / 2
  54733. , r = 1 / i
  54734. , o = [-1, -1, -1, -1, -1, 1, -1, 1, -1, -1, 1, 1, 1, -1, -1, 1, -1, 1, 1, 1, -1, 1, 1, 1, 0, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, -r, -i, 0, -r, i, 0, r, -i, 0, r, i, 0, -i, 0, -r, i, 0, -r, -i, 0, r, i, 0, r]
  54735. , a = [3, 11, 7, 3, 7, 15, 3, 15, 13, 7, 19, 17, 7, 17, 6, 7, 6, 15, 17, 4, 8, 17, 8, 10, 17, 10, 6, 8, 0, 16, 8, 16, 2, 8, 2, 10, 0, 12, 1, 0, 1, 18, 0, 18, 16, 6, 10, 2, 6, 2, 13, 6, 13, 15, 2, 16, 18, 2, 18, 3, 2, 3, 13, 18, 1, 9, 18, 9, 11, 18, 11, 3, 4, 14, 12, 4, 12, 0, 4, 0, 8, 11, 9, 5, 11, 5, 19, 11, 19, 7, 19, 5, 14, 19, 14, 4, 19, 4, 17, 1, 12, 14, 1, 14, 5, 1, 5, 9];
  54736. n.PolyhedronGeometry.call(this, o, a, e, t),
  54737. this.type = "DodecahedronGeometry",
  54738. this.parameters = {
  54739. radius: e,
  54740. detail: t
  54741. }
  54742. }
  54743. ,
  54744. n.DodecahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54745. n.DodecahedronGeometry.prototype.constructor = n.DodecahedronGeometry,
  54746. n.IcosahedronGeometry = function(e, t) {
  54747. var i = (1 + Math.sqrt(5)) / 2
  54748. , 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]
  54749. , o = [0, 11, 5, 0, 5, 1, 0, 1, 7, 0, 7, 10, 0, 10, 11, 1, 5, 9, 5, 11, 4, 11, 10, 2, 10, 7, 6, 7, 1, 8, 3, 9, 4, 3, 4, 2, 3, 2, 6, 3, 6, 8, 3, 8, 9, 4, 9, 5, 2, 4, 11, 6, 2, 10, 8, 6, 7, 9, 8, 1];
  54750. n.PolyhedronGeometry.call(this, r, o, e, t),
  54751. this.type = "IcosahedronGeometry",
  54752. this.parameters = {
  54753. radius: e,
  54754. detail: t
  54755. }
  54756. }
  54757. ,
  54758. n.IcosahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54759. n.IcosahedronGeometry.prototype.constructor = n.IcosahedronGeometry,
  54760. n.OctahedronGeometry = function(e, t) {
  54761. var i = [1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1]
  54762. , 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];
  54763. n.PolyhedronGeometry.call(this, i, r, e, t),
  54764. this.type = "OctahedronGeometry",
  54765. this.parameters = {
  54766. radius: e,
  54767. detail: t
  54768. }
  54769. }
  54770. ,
  54771. n.OctahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54772. n.OctahedronGeometry.prototype.constructor = n.OctahedronGeometry,
  54773. n.TetrahedronGeometry = function(e, t) {
  54774. var i = [1, 1, 1, -1, -1, 1, -1, 1, -1, 1, -1, -1]
  54775. , r = [2, 1, 0, 0, 3, 2, 1, 3, 0, 2, 3, 1];
  54776. n.PolyhedronGeometry.call(this, i, r, e, t),
  54777. this.type = "TetrahedronGeometry",
  54778. this.parameters = {
  54779. radius: e,
  54780. detail: t
  54781. }
  54782. }
  54783. ,
  54784. n.TetrahedronGeometry.prototype = Object.create(n.PolyhedronGeometry.prototype),
  54785. n.TetrahedronGeometry.prototype.constructor = n.TetrahedronGeometry,
  54786. n.ParametricGeometry = function(e, t, i) {
  54787. n.Geometry.call(this),
  54788. this.type = "ParametricGeometry",
  54789. this.parameters = {
  54790. func: e,
  54791. slices: t,
  54792. stacks: i
  54793. };
  54794. var r, o, a, s, l, c = this.vertices, h = this.faces, u = this.faceVertexUvs[0], d = t + 1;
  54795. for (r = 0; r <= i; r++)
  54796. for (l = r / i,
  54797. o = 0; o <= t; o++)
  54798. s = o / t,
  54799. a = e(s, l),
  54800. c.push(a);
  54801. var p, f, g, m, v, A, y, C;
  54802. for (r = 0; r < i; r++)
  54803. for (o = 0; o < t; o++)
  54804. p = r * d + o,
  54805. f = r * d + o + 1,
  54806. g = (r + 1) * d + o + 1,
  54807. m = (r + 1) * d + o,
  54808. v = new n.Vector2(o / t,r / i),
  54809. A = new n.Vector2((o + 1) / t,r / i),
  54810. y = new n.Vector2((o + 1) / t,(r + 1) / i),
  54811. C = new n.Vector2(o / t,(r + 1) / i),
  54812. h.push(new n.Face3(p,f,m)),
  54813. u.push([v, A, C]),
  54814. h.push(new n.Face3(f,g,m)),
  54815. u.push([A.clone(), y, C.clone()]);
  54816. this.computeFaceNormals(),
  54817. this.computeVertexNormals()
  54818. }
  54819. ,
  54820. n.ParametricGeometry.prototype = Object.create(n.Geometry.prototype),
  54821. n.ParametricGeometry.prototype.constructor = n.ParametricGeometry,
  54822. n.WireframeGeometry = function(e) {
  54823. function t(e, t) {
  54824. return e - t
  54825. }
  54826. n.BufferGeometry.call(this);
  54827. var i = [0, 0]
  54828. , r = {}
  54829. , o = ["a", "b", "c"];
  54830. if (e instanceof n.Geometry) {
  54831. for (var a = e.vertices, s = e.faces, l = 0, c = new Uint32Array(6 * s.length), h = 0, u = s.length; h < u; h++)
  54832. for (var d = s[h], p = 0; p < 3; p++) {
  54833. i[0] = d[o[p]],
  54834. i[1] = d[o[(p + 1) % 3]],
  54835. i.sort(t);
  54836. var f = i.toString();
  54837. void 0 === r[f] && (c[2 * l] = i[0],
  54838. c[2 * l + 1] = i[1],
  54839. r[f] = !0,
  54840. l++)
  54841. }
  54842. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  54843. for (var p = 0; p < 2; p++) {
  54844. var m = a[c[2 * h + p]]
  54845. , v = 6 * h + 3 * p;
  54846. g[v + 0] = m.x,
  54847. g[v + 1] = m.y,
  54848. g[v + 2] = m.z
  54849. }
  54850. this.addAttribute("position", new n.BufferAttribute(g,3))
  54851. } else if (e instanceof n.BufferGeometry)
  54852. if (null !== e.index) {
  54853. var A = e.index.array
  54854. , a = e.attributes.position
  54855. , y = e.groups
  54856. , l = 0;
  54857. 0 === y.length && e.addGroup(0, A.length);
  54858. for (var c = new Uint32Array(2 * A.length), C = 0, I = y.length; C < I; ++C)
  54859. for (var E = y[C], b = E.start, w = E.count, h = b, _ = b + w; h < _; h += 3)
  54860. for (var p = 0; p < 3; p++) {
  54861. i[0] = A[h + p],
  54862. i[1] = A[h + (p + 1) % 3],
  54863. i.sort(t);
  54864. var f = i.toString();
  54865. void 0 === r[f] && (c[2 * l] = i[0],
  54866. c[2 * l + 1] = i[1],
  54867. r[f] = !0,
  54868. l++)
  54869. }
  54870. for (var g = new Float32Array(2 * l * 3), h = 0, u = l; h < u; h++)
  54871. for (var p = 0; p < 2; p++) {
  54872. var v = 6 * h + 3 * p
  54873. , T = c[2 * h + p];
  54874. g[v + 0] = a.getX(T),
  54875. g[v + 1] = a.getY(T),
  54876. g[v + 2] = a.getZ(T)
  54877. }
  54878. this.addAttribute("position", new n.BufferAttribute(g,3))
  54879. } else {
  54880. 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++)
  54881. for (var p = 0; p < 3; p++) {
  54882. var v = 18 * h + 6 * p
  54883. , S = 9 * h + 3 * p;
  54884. g[v + 0] = a[S],
  54885. g[v + 1] = a[S + 1],
  54886. g[v + 2] = a[S + 2];
  54887. var T = 9 * h + 3 * ((p + 1) % 3);
  54888. g[v + 3] = a[T],
  54889. g[v + 4] = a[T + 1],
  54890. g[v + 5] = a[T + 2]
  54891. }
  54892. this.addAttribute("position", new n.BufferAttribute(g,3))
  54893. }
  54894. }
  54895. ,
  54896. n.WireframeGeometry.prototype = Object.create(n.BufferGeometry.prototype),
  54897. n.WireframeGeometry.prototype.constructor = n.WireframeGeometry,
  54898. n.AxisHelper = function(e) {
  54899. e = e || 1;
  54900. var t = new Float32Array([0, 0, 0, e, 0, 0, 0, 0, 0, 0, e, 0, 0, 0, 0, 0, 0, e])
  54901. , i = new Float32Array([1, 0, 0, 1, .6, 0, 0, 1, 0, .6, 1, 0, 0, 0, 1, 0, .6, 1])
  54902. , r = new n.BufferGeometry;
  54903. r.addAttribute("position", new n.BufferAttribute(t,3)),
  54904. r.addAttribute("color", new n.BufferAttribute(i,3));
  54905. var o = new n.LineBasicMaterial({
  54906. vertexColors: n.VertexColors
  54907. });
  54908. n.LineSegments.call(this, r, o)
  54909. }
  54910. ,
  54911. n.AxisHelper.prototype = Object.create(n.LineSegments.prototype),
  54912. n.AxisHelper.prototype.constructor = n.AxisHelper,
  54913. n.ArrowHelper = function() {
  54914. var e = new n.Geometry;
  54915. e.vertices.push(new n.Vector3(0,0,0), new n.Vector3(0,1,0));
  54916. var t = new n.CylinderGeometry(0,.5,1,5,1);
  54917. return t.translate(0, -.5, 0),
  54918. function(i, r, o, a, s, l) {
  54919. n.Object3D.call(this),
  54920. void 0 === a && (a = 16776960),
  54921. void 0 === o && (o = 1),
  54922. void 0 === s && (s = .2 * o),
  54923. void 0 === l && (l = .2 * s),
  54924. this.position.copy(r),
  54925. this.line = new n.Line(e,new n.LineBasicMaterial({
  54926. color: a
  54927. })),
  54928. this.line.matrixAutoUpdate = !1,
  54929. this.add(this.line),
  54930. this.cone = new n.Mesh(t,new n.MeshBasicMaterial({
  54931. color: a
  54932. })),
  54933. this.cone.matrixAutoUpdate = !1,
  54934. this.add(this.cone),
  54935. this.setDirection(i),
  54936. this.setLength(o, s, l)
  54937. }
  54938. }(),
  54939. n.ArrowHelper.prototype = Object.create(n.Object3D.prototype),
  54940. n.ArrowHelper.prototype.constructor = n.ArrowHelper,
  54941. n.ArrowHelper.prototype.setDirection = function() {
  54942. var e, t = new n.Vector3;
  54943. return function(i) {
  54944. i.y > .99999 ? this.quaternion.set(0, 0, 0, 1) : i.y < -.99999 ? this.quaternion.set(1, 0, 0, 0) : (t.set(i.z, 0, -i.x).normalize(),
  54945. e = Math.acos(i.y),
  54946. this.quaternion.setFromAxisAngle(t, e))
  54947. }
  54948. }(),
  54949. n.ArrowHelper.prototype.setLength = function(e, t, i) {
  54950. void 0 === t && (t = .2 * e),
  54951. void 0 === i && (i = .2 * t),
  54952. this.line.scale.set(1, Math.max(0, e - t), 1),
  54953. this.line.updateMatrix(),
  54954. this.cone.scale.set(i, t, i),
  54955. this.cone.position.y = e,
  54956. this.cone.updateMatrix()
  54957. }
  54958. ,
  54959. n.ArrowHelper.prototype.setColor = function(e) {
  54960. this.line.material.color.set(e),
  54961. this.cone.material.color.set(e)
  54962. }
  54963. ,
  54964. n.BoxHelper = function(e) {
  54965. 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])
  54966. , i = new Float32Array(24)
  54967. , r = new n.BufferGeometry;
  54968. r.setIndex(new n.BufferAttribute(t,1)),
  54969. r.addAttribute("position", new n.BufferAttribute(i,3)),
  54970. n.LineSegments.call(this, r, new n.LineBasicMaterial({
  54971. color: 16776960
  54972. })),
  54973. void 0 !== e && this.update(e)
  54974. }
  54975. ,
  54976. n.BoxHelper.prototype = Object.create(n.LineSegments.prototype),
  54977. n.BoxHelper.prototype.constructor = n.BoxHelper,
  54978. n.BoxHelper.prototype.update = function() {
  54979. var e = new n.Box3;
  54980. return function(t) {
  54981. if (e.setFromObject(t),
  54982. !e.isEmpty()) {
  54983. var i = e.min
  54984. , n = e.max
  54985. , r = this.geometry.attributes.position
  54986. , o = r.array;
  54987. o[0] = n.x,
  54988. o[1] = n.y,
  54989. o[2] = n.z,
  54990. o[3] = i.x,
  54991. o[4] = n.y,
  54992. o[5] = n.z,
  54993. o[6] = i.x,
  54994. o[7] = i.y,
  54995. o[8] = n.z,
  54996. o[9] = n.x,
  54997. o[10] = i.y,
  54998. o[11] = n.z,
  54999. o[12] = n.x,
  55000. o[13] = n.y,
  55001. o[14] = i.z,
  55002. o[15] = i.x,
  55003. o[16] = n.y,
  55004. o[17] = i.z,
  55005. o[18] = i.x,
  55006. o[19] = i.y,
  55007. o[20] = i.z,
  55008. o[21] = n.x,
  55009. o[22] = i.y,
  55010. o[23] = i.z,
  55011. r.needsUpdate = !0,
  55012. this.geometry.computeBoundingSphere()
  55013. }
  55014. }
  55015. }(),
  55016. n.BoundingBoxHelper = function(e, t) {
  55017. var i = void 0 !== t ? t : 8947848;
  55018. this.object = e,
  55019. this.box = new n.Box3,
  55020. n.Mesh.call(this, new n.BoxGeometry(1,1,1), new n.MeshBasicMaterial({
  55021. color: i,
  55022. wireframe: !0
  55023. }))
  55024. }
  55025. ,
  55026. n.BoundingBoxHelper.prototype = Object.create(n.Mesh.prototype),
  55027. n.BoundingBoxHelper.prototype.constructor = n.BoundingBoxHelper,
  55028. n.BoundingBoxHelper.prototype.update = function() {
  55029. this.box.setFromObject(this.object),
  55030. this.box.size(this.scale),
  55031. this.box.center(this.position)
  55032. }
  55033. ,
  55034. n.CameraHelper = function(e) {
  55035. function t(e, t, n) {
  55036. i(e, n),
  55037. i(t, n)
  55038. }
  55039. function i(e, t) {
  55040. r.vertices.push(new n.Vector3),
  55041. r.colors.push(new n.Color(t)),
  55042. void 0 === a[e] && (a[e] = []),
  55043. a[e].push(r.vertices.length - 1)
  55044. }
  55045. var r = new n.Geometry
  55046. , o = new n.LineBasicMaterial({
  55047. color: 16777215,
  55048. vertexColors: n.FaceColors
  55049. })
  55050. , a = {}
  55051. , s = 16755200
  55052. , l = 16711680
  55053. , c = 43775
  55054. , h = 16777215
  55055. , u = 3355443;
  55056. t("n1", "n2", s),
  55057. t("n2", "n4", s),
  55058. t("n4", "n3", s),
  55059. t("n3", "n1", s),
  55060. t("f1", "f2", s),
  55061. t("f2", "f4", s),
  55062. t("f4", "f3", s),
  55063. t("f3", "f1", s),
  55064. t("n1", "f1", s),
  55065. t("n2", "f2", s),
  55066. t("n3", "f3", s),
  55067. t("n4", "f4", s),
  55068. t("p", "n1", l),
  55069. t("p", "n2", l),
  55070. t("p", "n3", l),
  55071. t("p", "n4", l),
  55072. t("u1", "u2", c),
  55073. t("u2", "u3", c),
  55074. t("u3", "u1", c),
  55075. t("c", "t", h),
  55076. t("p", "c", u),
  55077. t("cn1", "cn2", u),
  55078. t("cn3", "cn4", u),
  55079. t("cf1", "cf2", u),
  55080. t("cf3", "cf4", u),
  55081. n.LineSegments.call(this, r, o),
  55082. this.camera = e,
  55083. this.camera.updateProjectionMatrix(),
  55084. this.matrix = e.matrixWorld,
  55085. this.matrixAutoUpdate = !1,
  55086. this.pointMap = a,
  55087. this.update()
  55088. }
  55089. ,
  55090. n.CameraHelper.prototype = Object.create(n.LineSegments.prototype),
  55091. n.CameraHelper.prototype.constructor = n.CameraHelper,
  55092. n.CameraHelper.prototype.update = function() {
  55093. function e(e, n, a, s) {
  55094. r.set(n, a, s).unproject(o);
  55095. var l = i[e];
  55096. if (void 0 !== l)
  55097. for (var c = 0, h = l.length; c < h; c++)
  55098. t.vertices[l[c]].copy(r)
  55099. }
  55100. var t, i, r = new n.Vector3, o = new n.Camera;
  55101. return function() {
  55102. t = this.geometry,
  55103. i = this.pointMap;
  55104. var n = 1
  55105. , r = 1;
  55106. o.projectionMatrix.copy(this.camera.projectionMatrix),
  55107. e("c", 0, 0, -1),
  55108. e("t", 0, 0, 1),
  55109. e("n1", -n, -r, -1),
  55110. e("n2", n, -r, -1),
  55111. e("n3", -n, r, -1),
  55112. e("n4", n, r, -1),
  55113. e("f1", -n, -r, 1),
  55114. e("f2", n, -r, 1),
  55115. e("f3", -n, r, 1),
  55116. e("f4", n, r, 1),
  55117. e("u1", .7 * n, 1.1 * r, -1),
  55118. e("u2", .7 * -n, 1.1 * r, -1),
  55119. e("u3", 0, 2 * r, -1),
  55120. e("cf1", -n, 0, 1),
  55121. e("cf2", n, 0, 1),
  55122. e("cf3", 0, -r, 1),
  55123. e("cf4", 0, r, 1),
  55124. e("cn1", -n, 0, -1),
  55125. e("cn2", n, 0, -1),
  55126. e("cn3", 0, -r, -1),
  55127. e("cn4", 0, r, -1),
  55128. t.verticesNeedUpdate = !0
  55129. }
  55130. }(),
  55131. n.DirectionalLightHelper = function(e, t) {
  55132. n.Object3D.call(this),
  55133. this.light = e,
  55134. this.light.updateMatrixWorld(),
  55135. this.matrix = e.matrixWorld,
  55136. this.matrixAutoUpdate = !1,
  55137. t = t || 1;
  55138. var i = new n.Geometry;
  55139. 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));
  55140. var r = new n.LineBasicMaterial({
  55141. fog: !1
  55142. });
  55143. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55144. this.lightPlane = new n.Line(i,r),
  55145. this.add(this.lightPlane),
  55146. i = new n.Geometry,
  55147. i.vertices.push(new n.Vector3, new n.Vector3),
  55148. r = new n.LineBasicMaterial({
  55149. fog: !1
  55150. }),
  55151. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55152. this.targetLine = new n.Line(i,r),
  55153. this.add(this.targetLine),
  55154. this.update()
  55155. }
  55156. ,
  55157. n.DirectionalLightHelper.prototype = Object.create(n.Object3D.prototype),
  55158. n.DirectionalLightHelper.prototype.constructor = n.DirectionalLightHelper,
  55159. n.DirectionalLightHelper.prototype.dispose = function() {
  55160. this.lightPlane.geometry.dispose(),
  55161. this.lightPlane.material.dispose(),
  55162. this.targetLine.geometry.dispose(),
  55163. this.targetLine.material.dispose()
  55164. }
  55165. ,
  55166. n.DirectionalLightHelper.prototype.update = function() {
  55167. var e = new n.Vector3
  55168. , t = new n.Vector3
  55169. , i = new n.Vector3;
  55170. return function() {
  55171. e.setFromMatrixPosition(this.light.matrixWorld),
  55172. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55173. i.subVectors(t, e),
  55174. this.lightPlane.lookAt(i),
  55175. this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55176. this.targetLine.geometry.vertices[1].copy(i),
  55177. this.targetLine.geometry.verticesNeedUpdate = !0,
  55178. this.targetLine.material.color.copy(this.lightPlane.material.color)
  55179. }
  55180. }(),
  55181. n.EdgesHelper = function(e, t, i) {
  55182. var r = void 0 !== t ? t : 16777215;
  55183. n.LineSegments.call(this, new n.EdgesGeometry(e.geometry,i), new n.LineBasicMaterial({
  55184. color: r
  55185. })),
  55186. this.matrix = e.matrixWorld,
  55187. this.matrixAutoUpdate = !1
  55188. }
  55189. ,
  55190. n.EdgesHelper.prototype = Object.create(n.LineSegments.prototype),
  55191. n.EdgesHelper.prototype.constructor = n.EdgesHelper,
  55192. n.FaceNormalsHelper = function(e, t, i, r) {
  55193. this.object = e,
  55194. this.size = void 0 !== t ? t : 1;
  55195. var o = void 0 !== i ? i : 16776960
  55196. , a = void 0 !== r ? r : 1
  55197. , s = 0
  55198. , l = this.object.geometry;
  55199. l instanceof n.Geometry ? s = l.faces.length : console.warn("THREE.FaceNormalsHelper: only THREE.Geometry is supported. Use THREE.VertexNormalsHelper, instead.");
  55200. var c = new n.BufferGeometry
  55201. , h = new n.Float32Attribute(2 * s * 3,3);
  55202. c.addAttribute("position", h),
  55203. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55204. color: o,
  55205. linewidth: a
  55206. })),
  55207. this.matrixAutoUpdate = !1,
  55208. this.update()
  55209. }
  55210. ,
  55211. n.FaceNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55212. n.FaceNormalsHelper.prototype.constructor = n.FaceNormalsHelper,
  55213. n.FaceNormalsHelper.prototype.update = function() {
  55214. var e = new n.Vector3
  55215. , t = new n.Vector3
  55216. , i = new n.Matrix3;
  55217. return function() {
  55218. this.object.updateMatrixWorld(!0),
  55219. i.getNormalMatrix(this.object.matrixWorld);
  55220. 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++) {
  55221. var u = s[c]
  55222. , d = u.normal;
  55223. e.copy(a[u.a]).add(a[u.b]).add(a[u.c]).divideScalar(3).applyMatrix4(n),
  55224. t.copy(d).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55225. r.setXYZ(l, e.x, e.y, e.z),
  55226. l += 1,
  55227. r.setXYZ(l, t.x, t.y, t.z),
  55228. l += 1
  55229. }
  55230. return r.needsUpdate = !0,
  55231. this
  55232. }
  55233. }(),
  55234. n.GridHelper = function(e, t) {
  55235. var i = new n.Geometry
  55236. , r = new n.LineBasicMaterial({
  55237. vertexColors: n.VertexColors
  55238. });
  55239. this.color1 = new n.Color(4473924),
  55240. this.color2 = new n.Color(8947848);
  55241. for (var o = -e; o <= e; o += t) {
  55242. 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));
  55243. var a = 0 === o ? this.color1 : this.color2;
  55244. i.colors.push(a, a, a, a)
  55245. }
  55246. n.LineSegments.call(this, i, r)
  55247. }
  55248. ,
  55249. n.GridHelper.prototype = Object.create(n.LineSegments.prototype),
  55250. n.GridHelper.prototype.constructor = n.GridHelper,
  55251. n.GridHelper.prototype.setColors = function(e, t) {
  55252. this.color1.set(e),
  55253. this.color2.set(t),
  55254. this.geometry.colorsNeedUpdate = !0
  55255. }
  55256. ,
  55257. n.HemisphereLightHelper = function(e, t) {
  55258. n.Object3D.call(this),
  55259. this.light = e,
  55260. this.light.updateMatrixWorld(),
  55261. this.matrix = e.matrixWorld,
  55262. this.matrixAutoUpdate = !1,
  55263. this.colors = [new n.Color, new n.Color];
  55264. var i = new n.SphereGeometry(t,4,2);
  55265. i.rotateX(-Math.PI / 2);
  55266. for (var r = 0, o = 8; r < o; r++)
  55267. i.faces[r].color = this.colors[r < 4 ? 0 : 1];
  55268. var a = new n.MeshBasicMaterial({
  55269. vertexColors: n.FaceColors,
  55270. wireframe: !0
  55271. });
  55272. this.lightSphere = new n.Mesh(i,a),
  55273. this.add(this.lightSphere),
  55274. this.update()
  55275. }
  55276. ,
  55277. n.HemisphereLightHelper.prototype = Object.create(n.Object3D.prototype),
  55278. n.HemisphereLightHelper.prototype.constructor = n.HemisphereLightHelper,
  55279. n.HemisphereLightHelper.prototype.dispose = function() {
  55280. this.lightSphere.geometry.dispose(),
  55281. this.lightSphere.material.dispose()
  55282. }
  55283. ,
  55284. n.HemisphereLightHelper.prototype.update = function() {
  55285. var e = new n.Vector3;
  55286. return function() {
  55287. this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),
  55288. this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),
  55289. this.lightSphere.lookAt(e.setFromMatrixPosition(this.light.matrixWorld).negate()),
  55290. this.lightSphere.geometry.colorsNeedUpdate = !0
  55291. }
  55292. }(),
  55293. n.PointLightHelper = function(e, t) {
  55294. this.light = e,
  55295. this.light.updateMatrixWorld();
  55296. var i = new n.SphereGeometry(t,4,2)
  55297. , r = new n.MeshBasicMaterial({
  55298. wireframe: !0,
  55299. fog: !1
  55300. });
  55301. r.color.copy(this.light.color).multiplyScalar(this.light.intensity),
  55302. n.Mesh.call(this, i, r),
  55303. this.matrix = this.light.matrixWorld,
  55304. this.matrixAutoUpdate = !1
  55305. }
  55306. ,
  55307. n.PointLightHelper.prototype = Object.create(n.Mesh.prototype),
  55308. n.PointLightHelper.prototype.constructor = n.PointLightHelper,
  55309. n.PointLightHelper.prototype.dispose = function() {
  55310. this.geometry.dispose(),
  55311. this.material.dispose()
  55312. }
  55313. ,
  55314. n.PointLightHelper.prototype.update = function() {
  55315. this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55316. }
  55317. ,
  55318. n.SkeletonHelper = function(e) {
  55319. this.bones = this.getBoneList(e);
  55320. for (var t = new n.Geometry, i = 0; i < this.bones.length; i++) {
  55321. var r = this.bones[i];
  55322. r.parent instanceof n.Bone && (t.vertices.push(new n.Vector3),
  55323. t.vertices.push(new n.Vector3),
  55324. t.colors.push(new n.Color(0,0,1)),
  55325. t.colors.push(new n.Color(0,1,0)))
  55326. }
  55327. t.dynamic = !0;
  55328. var o = new n.LineBasicMaterial({
  55329. vertexColors: n.VertexColors,
  55330. depthTest: !1,
  55331. depthWrite: !1,
  55332. transparent: !0
  55333. });
  55334. n.LineSegments.call(this, t, o),
  55335. this.root = e,
  55336. this.matrix = e.matrixWorld,
  55337. this.matrixAutoUpdate = !1,
  55338. this.update()
  55339. }
  55340. ,
  55341. n.SkeletonHelper.prototype = Object.create(n.LineSegments.prototype),
  55342. n.SkeletonHelper.prototype.constructor = n.SkeletonHelper,
  55343. n.SkeletonHelper.prototype.getBoneList = function(e) {
  55344. var t = [];
  55345. e instanceof n.Bone && t.push(e);
  55346. for (var i = 0; i < e.children.length; i++)
  55347. t.push.apply(t, this.getBoneList(e.children[i]));
  55348. return t
  55349. }
  55350. ,
  55351. n.SkeletonHelper.prototype.update = function() {
  55352. 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++) {
  55353. var a = this.bones[o];
  55354. a.parent instanceof n.Bone && (i.multiplyMatrices(t, a.matrixWorld),
  55355. e.vertices[r].setFromMatrixPosition(i),
  55356. i.multiplyMatrices(t, a.parent.matrixWorld),
  55357. e.vertices[r + 1].setFromMatrixPosition(i),
  55358. r += 2)
  55359. }
  55360. e.verticesNeedUpdate = !0,
  55361. e.computeBoundingSphere()
  55362. }
  55363. ,
  55364. n.SpotLightHelper = function(e) {
  55365. n.Object3D.call(this),
  55366. this.light = e,
  55367. this.light.updateMatrixWorld(),
  55368. this.matrix = e.matrixWorld,
  55369. this.matrixAutoUpdate = !1;
  55370. var t = new n.CylinderGeometry(0,1,1,8,1,!0);
  55371. t.translate(0, -.5, 0),
  55372. t.rotateX(-Math.PI / 2);
  55373. var i = new n.MeshBasicMaterial({
  55374. wireframe: !0,
  55375. fog: !1
  55376. });
  55377. this.cone = new n.Mesh(t,i),
  55378. this.add(this.cone),
  55379. this.update()
  55380. }
  55381. ,
  55382. n.SpotLightHelper.prototype = Object.create(n.Object3D.prototype),
  55383. n.SpotLightHelper.prototype.constructor = n.SpotLightHelper,
  55384. n.SpotLightHelper.prototype.dispose = function() {
  55385. this.cone.geometry.dispose(),
  55386. this.cone.material.dispose()
  55387. }
  55388. ,
  55389. n.SpotLightHelper.prototype.update = function() {
  55390. var e = new n.Vector3
  55391. , t = new n.Vector3;
  55392. return function() {
  55393. var i = this.light.distance ? this.light.distance : 1e4
  55394. , n = i * Math.tan(this.light.angle);
  55395. this.cone.scale.set(n, n, i),
  55396. e.setFromMatrixPosition(this.light.matrixWorld),
  55397. t.setFromMatrixPosition(this.light.target.matrixWorld),
  55398. this.cone.lookAt(t.sub(e)),
  55399. this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)
  55400. }
  55401. }(),
  55402. n.VertexNormalsHelper = function(e, t, i, r) {
  55403. this.object = e,
  55404. this.size = void 0 !== t ? t : 1;
  55405. var o = void 0 !== i ? i : 16711680
  55406. , a = void 0 !== r ? r : 1
  55407. , s = 0
  55408. , l = this.object.geometry;
  55409. l instanceof n.Geometry ? s = 3 * l.faces.length : l instanceof n.BufferGeometry && (s = l.attributes.normal.count);
  55410. var c = new n.BufferGeometry
  55411. , h = new n.Float32Attribute(2 * s * 3,3);
  55412. c.addAttribute("position", h),
  55413. n.LineSegments.call(this, c, new n.LineBasicMaterial({
  55414. color: o,
  55415. linewidth: a
  55416. })),
  55417. this.matrixAutoUpdate = !1,
  55418. this.update()
  55419. }
  55420. ,
  55421. n.VertexNormalsHelper.prototype = Object.create(n.LineSegments.prototype),
  55422. n.VertexNormalsHelper.prototype.constructor = n.VertexNormalsHelper,
  55423. n.VertexNormalsHelper.prototype.update = function() {
  55424. var e = new n.Vector3
  55425. , t = new n.Vector3
  55426. , i = new n.Matrix3;
  55427. return function() {
  55428. var r = ["a", "b", "c"];
  55429. this.object.updateMatrixWorld(!0),
  55430. i.getNormalMatrix(this.object.matrixWorld);
  55431. var o = this.object.matrixWorld
  55432. , a = this.geometry.attributes.position
  55433. , s = this.object.geometry;
  55434. if (s instanceof n.Geometry)
  55435. for (var l = s.vertices, c = s.faces, h = 0, u = 0, d = c.length; u < d; u++)
  55436. for (var p = c[u], f = 0, g = p.vertexNormals.length; f < g; f++) {
  55437. var m = l[p[r[f]]]
  55438. , v = p.vertexNormals[f];
  55439. e.copy(m).applyMatrix4(o),
  55440. t.copy(v).applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55441. a.setXYZ(h, e.x, e.y, e.z),
  55442. h += 1,
  55443. a.setXYZ(h, t.x, t.y, t.z),
  55444. h += 1
  55445. }
  55446. else if (s instanceof n.BufferGeometry)
  55447. for (var A = s.attributes.position, y = s.attributes.normal, h = 0, f = 0, g = A.count; f < g; f++)
  55448. e.set(A.getX(f), A.getY(f), A.getZ(f)).applyMatrix4(o),
  55449. t.set(y.getX(f), y.getY(f), y.getZ(f)),
  55450. t.applyMatrix3(i).normalize().multiplyScalar(this.size).add(e),
  55451. a.setXYZ(h, e.x, e.y, e.z),
  55452. h += 1,
  55453. a.setXYZ(h, t.x, t.y, t.z),
  55454. h += 1;
  55455. return a.needsUpdate = !0,
  55456. this
  55457. }
  55458. }(),
  55459. n.WireframeHelper = function(e, t) {
  55460. var i = void 0 !== t ? t : 16777215;
  55461. n.LineSegments.call(this, new n.WireframeGeometry(e.geometry), new n.LineBasicMaterial({
  55462. color: i
  55463. })),
  55464. this.matrix = e.matrixWorld,
  55465. this.matrixAutoUpdate = !1
  55466. }
  55467. ,
  55468. n.WireframeHelper.prototype = Object.create(n.LineSegments.prototype),
  55469. n.WireframeHelper.prototype.constructor = n.WireframeHelper,
  55470. n.ImmediateRenderObject = function(e) {
  55471. n.Object3D.call(this),
  55472. this.material = e,
  55473. this.render = function(e) {}
  55474. }
  55475. ,
  55476. n.ImmediateRenderObject.prototype = Object.create(n.Object3D.prototype),
  55477. n.ImmediateRenderObject.prototype.constructor = n.ImmediateRenderObject,
  55478. n.MorphBlendMesh = function(e, t) {
  55479. n.Mesh.call(this, e, t),
  55480. this.animationsMap = {},
  55481. this.animationsList = [];
  55482. var i = this.geometry.morphTargets.length
  55483. , r = "__default"
  55484. , o = 0
  55485. , a = i - 1
  55486. , s = i / 1;
  55487. this.createAnimation(r, o, a, s),
  55488. this.setAnimationWeight(r, 1)
  55489. }
  55490. ,
  55491. n.MorphBlendMesh.prototype = Object.create(n.Mesh.prototype),
  55492. n.MorphBlendMesh.prototype.constructor = n.MorphBlendMesh,
  55493. n.MorphBlendMesh.prototype.createAnimation = function(e, t, i, n) {
  55494. var r = {
  55495. start: t,
  55496. end: i,
  55497. length: i - t + 1,
  55498. fps: n,
  55499. duration: (i - t) / n,
  55500. lastFrame: 0,
  55501. currentFrame: 0,
  55502. active: !1,
  55503. time: 0,
  55504. direction: 1,
  55505. weight: 1,
  55506. directionBackwards: !1,
  55507. mirroredLoop: !1
  55508. };
  55509. this.animationsMap[e] = r,
  55510. this.animationsList.push(r)
  55511. }
  55512. ,
  55513. n.MorphBlendMesh.prototype.autoCreateAnimations = function(e) {
  55514. for (var t, i = /([a-z]+)_?(\d+)/i, n = {}, r = this.geometry, o = 0, a = r.morphTargets.length; o < a; o++) {
  55515. var s = r.morphTargets[o]
  55516. , l = s.name.match(i);
  55517. if (l && l.length > 1) {
  55518. var c = l[1];
  55519. n[c] || (n[c] = {
  55520. start: 1 / 0,
  55521. end: -(1 / 0)
  55522. });
  55523. var h = n[c];
  55524. o < h.start && (h.start = o),
  55525. o > h.end && (h.end = o),
  55526. t || (t = c)
  55527. }
  55528. }
  55529. for (var c in n) {
  55530. var h = n[c];
  55531. this.createAnimation(c, h.start, h.end, e)
  55532. }
  55533. this.firstAnimation = t
  55534. }
  55535. ,
  55536. n.MorphBlendMesh.prototype.setAnimationDirectionForward = function(e) {
  55537. var t = this.animationsMap[e];
  55538. t && (t.direction = 1,
  55539. t.directionBackwards = !1)
  55540. }
  55541. ,
  55542. n.MorphBlendMesh.prototype.setAnimationDirectionBackward = function(e) {
  55543. var t = this.animationsMap[e];
  55544. t && (t.direction = -1,
  55545. t.directionBackwards = !0)
  55546. }
  55547. ,
  55548. n.MorphBlendMesh.prototype.setAnimationFPS = function(e, t) {
  55549. var i = this.animationsMap[e];
  55550. i && (i.fps = t,
  55551. i.duration = (i.end - i.start) / i.fps)
  55552. }
  55553. ,
  55554. n.MorphBlendMesh.prototype.setAnimationDuration = function(e, t) {
  55555. var i = this.animationsMap[e];
  55556. i && (i.duration = t,
  55557. i.fps = (i.end - i.start) / i.duration)
  55558. }
  55559. ,
  55560. n.MorphBlendMesh.prototype.setAnimationWeight = function(e, t) {
  55561. var i = this.animationsMap[e];
  55562. i && (i.weight = t)
  55563. }
  55564. ,
  55565. n.MorphBlendMesh.prototype.setAnimationTime = function(e, t) {
  55566. var i = this.animationsMap[e];
  55567. i && (i.time = t)
  55568. }
  55569. ,
  55570. n.MorphBlendMesh.prototype.getAnimationTime = function(e) {
  55571. var t = 0
  55572. , i = this.animationsMap[e];
  55573. return i && (t = i.time),
  55574. t
  55575. }
  55576. ,
  55577. n.MorphBlendMesh.prototype.getAnimationDuration = function(e) {
  55578. var t = -1
  55579. , i = this.animationsMap[e];
  55580. return i && (t = i.duration),
  55581. t
  55582. }
  55583. ,
  55584. n.MorphBlendMesh.prototype.playAnimation = function(e) {
  55585. var t = this.animationsMap[e];
  55586. t ? (t.time = 0,
  55587. t.active = !0) : console.warn("THREE.MorphBlendMesh: animation[" + e + "] undefined in .playAnimation()")
  55588. }
  55589. ,
  55590. n.MorphBlendMesh.prototype.stopAnimation = function(e) {
  55591. var t = this.animationsMap[e];
  55592. t && (t.active = !1)
  55593. }
  55594. ,
  55595. n.MorphBlendMesh.prototype.update = function(e) {
  55596. for (var t = 0, i = this.animationsList.length; t < i; t++) {
  55597. var r = this.animationsList[t];
  55598. if (r.active) {
  55599. var o = r.duration / r.length;
  55600. r.time += r.direction * e,
  55601. r.mirroredLoop ? (r.time > r.duration || r.time < 0) && (r.direction *= -1,
  55602. r.time > r.duration && (r.time = r.duration,
  55603. r.directionBackwards = !0),
  55604. r.time < 0 && (r.time = 0,
  55605. r.directionBackwards = !1)) : (r.time = r.time % r.duration,
  55606. r.time < 0 && (r.time += r.duration));
  55607. var a = r.start + n.Math.clamp(Math.floor(r.time / o), 0, r.length - 1)
  55608. , s = r.weight;
  55609. a !== r.currentFrame && (this.morphTargetInfluences[r.lastFrame] = 0,
  55610. this.morphTargetInfluences[r.currentFrame] = 1 * s,
  55611. this.morphTargetInfluences[a] = 0,
  55612. r.lastFrame = r.currentFrame,
  55613. r.currentFrame = a);
  55614. var l = r.time % o / o;
  55615. r.directionBackwards && (l = 1 - l),
  55616. r.currentFrame !== r.lastFrame ? (this.morphTargetInfluences[r.currentFrame] = l * s,
  55617. this.morphTargetInfluences[r.lastFrame] = (1 - l) * s) : this.morphTargetInfluences[r.currentFrame] = s
  55618. }
  55619. }
  55620. }
  55621. ,
  55622. "undefined" != typeof i ? ("undefined" != typeof t && t.exports && (i = t.exports = n),
  55623. i.THREE = n) : this.THREE = n
  55624. }
  55625. , {}]
  55626. }, {}, [116]);